@lovrabet/rabetbase-cli 2.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +45 -0
- package/README.md +605 -0
- package/lib/ai-setup/config.js +1 -0
- package/lib/api/api-doc-ui.js +1 -0
- package/lib/api/api-doc.js +1 -0
- package/lib/api/api-pull-ui.js +1 -0
- package/lib/api/fetch-model-list.js +1 -0
- package/lib/api/generate-api-file.js +1 -0
- package/lib/api/main.js +1 -0
- package/lib/api/pull-silent.js +1 -0
- package/lib/app-menu/app-menu-sync-ui.js +1 -0
- package/lib/app-menu/create-menu.js +1 -0
- package/lib/app-menu/get-local-pages.js +1 -0
- package/lib/app-menu/get-online-menu-list.js +1 -0
- package/lib/app-menu/types.js +1 -0
- package/lib/app-menu/use-get-online-menu-list.js +1 -0
- package/lib/app-menu/utils.js +1 -0
- package/lib/app-menu/valid-url.js +1 -0
- package/lib/app-menu-update-cdn/current-content.js +1 -0
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -0
- package/lib/app-menu-update-cdn/main.js +1 -0
- package/lib/app-menu-update-cdn/types.js +1 -0
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -0
- package/lib/auth/auth-server.js +1 -0
- package/lib/auth/constant.js +1 -0
- package/lib/auth/get-cookie.js +1 -0
- package/lib/auth/is-session-valid.js +1 -0
- package/lib/auth/logout.js +1 -0
- package/lib/cli-flags.js +1 -0
- package/lib/cli.js +2 -0
- package/lib/commands/api.js +1 -0
- package/lib/commands/app.js +1 -0
- package/lib/commands/auth.js +1 -0
- package/lib/commands/bff/delete.js +1 -0
- package/lib/commands/bff/detail.js +1 -0
- package/lib/commands/bff/index.js +1 -0
- package/lib/commands/bff/list.js +1 -0
- package/lib/commands/bff/new.js +1 -0
- package/lib/commands/bff/pull.js +1 -0
- package/lib/commands/bff/push.js +1 -0
- package/lib/commands/bff/status.js +1 -0
- package/lib/commands/build.js +1 -0
- package/lib/commands/codegen/index.js +1 -0
- package/lib/commands/codegen/sdk.js +1 -0
- package/lib/commands/codegen/sql.js +1 -0
- package/lib/commands/config.js +1 -0
- package/lib/commands/create.js +1 -0
- package/lib/commands/dataset/detail.js +1 -0
- package/lib/commands/dataset/index.js +1 -0
- package/lib/commands/dataset/links.js +1 -0
- package/lib/commands/dataset/list.js +1 -0
- package/lib/commands/dataset/operations.js +1 -0
- package/lib/commands/init.js +1 -0
- package/lib/commands/logout.js +1 -0
- package/lib/commands/logs.js +1 -0
- package/lib/commands/mcp.js +1 -0
- package/lib/commands/menu.js +1 -0
- package/lib/commands/preview.js +1 -0
- package/lib/commands/registry.js +1 -0
- package/lib/commands/run.js +1 -0
- package/lib/commands/skill.js +1 -0
- package/lib/commands/sql/detail.js +1 -0
- package/lib/commands/sql/exec.js +1 -0
- package/lib/commands/sql/index.js +1 -0
- package/lib/commands/sql/list.js +1 -0
- package/lib/commands/sql/save.js +1 -0
- package/lib/commands/sql/validate.js +1 -0
- package/lib/commands/start.js +1 -0
- package/lib/config/config-help.js +1 -0
- package/lib/config/main.js +1 -0
- package/lib/constant/cli.js +1 -0
- package/lib/constant/domain.js +1 -0
- package/lib/constant/env.js +1 -0
- package/lib/context.js +1 -0
- package/lib/core/alias-resolver.js +1 -0
- package/lib/core/api-client.js +1 -0
- package/lib/core/bff/config.js +1 -0
- package/lib/core/bff/file-system.js +1 -0
- package/lib/core/bff/hash.js +1 -0
- package/lib/core/bff/lock.js +1 -0
- package/lib/core/bff/types.js +1 -0
- package/lib/core/bff/utils.js +1 -0
- package/lib/core/db-resolver.js +1 -0
- package/lib/core/sql-validator.js +1 -0
- package/lib/create-app/enhanced-guided-create.js +1 -0
- package/lib/create-app/format-elapsed.js +1 -0
- package/lib/create-app/main.js +1 -0
- package/lib/create-app/non-interactive.js +1 -0
- package/lib/create-app/task-finished.js +1 -0
- package/lib/create-app/task-loading.js +1 -0
- package/lib/create-app/task-running.js +1 -0
- package/lib/create-app/task-time.js +1 -0
- package/lib/create-app/use-copy-project-template.js +1 -0
- package/lib/create-app/use-format-code.js +1 -0
- package/lib/create-app/use-install-dependencies.js +1 -0
- package/lib/errors.js +1 -0
- package/lib/framework/flags.js +1 -0
- package/lib/framework/help.js +1 -0
- package/lib/framework/index.js +1 -0
- package/lib/framework/output.js +1 -0
- package/lib/framework/response.js +1 -0
- package/lib/framework/runner.js +1 -0
- package/lib/framework/types.js +1 -0
- package/lib/generated/build-info.js +1 -0
- package/lib/help.js +1 -0
- package/lib/init/main.js +1 -0
- package/lib/mcp/McpInstallUI.js +1 -0
- package/lib/mcp/claude.js +1 -0
- package/lib/mcp/cursor.js +1 -0
- package/lib/mcp/main.js +1 -0
- package/lib/mcp/mcp-install-non-interactive.js +1 -0
- package/lib/mcp/mcp-installer.js +1 -0
- package/lib/skills/main.js +1 -0
- package/lib/skills/npx-skills-add.js +1 -0
- package/lib/types/index.js +1 -0
- package/lib/ui/IDESelector.js +1 -0
- package/lib/ui/useIDESelection.js +1 -0
- package/lib/utils/ai_config.js +1 -0
- package/lib/utils/cdn-config.js +1 -0
- package/lib/utils/check-sdk-version.js +1 -0
- package/lib/utils/cli-version-check.js +1 -0
- package/lib/utils/config.js +1 -0
- package/lib/utils/copy-directory.js +1 -0
- package/lib/utils/file-utils.js +1 -0
- package/lib/utils/guides-cdn.js +1 -0
- package/lib/utils/http-client.js +1 -0
- package/lib/utils/logger.js +1 -0
- package/lib/utils/rules-cdn.js +1 -0
- package/lib/utils/sleep.js +1 -0
- package/lib/utils/template-replacer.js +1 -0
- package/package.json +77 -0
- package/sidecar/flags.json +10 -0
- package/templates/README.md +97 -0
- package/templates/generate-api/api.ts.tpl +47 -0
- package/templates/generate-api/client.ts.tpl +64 -0
- package/templates/projects/sub-app-react-demo/.prettierrc +1 -0
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +53 -0
- package/templates/projects/sub-app-react-demo/README.md +318 -0
- package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +212 -0
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +526 -0
- package/templates/projects/sub-app-react-demo/index.html +27 -0
- package/templates/projects/sub-app-react-demo/package.json +34 -0
- package/templates/projects/sub-app-react-demo/public/logo.svg +1 -0
- package/templates/projects/sub-app-react-demo/public/vite.svg +1 -0
- package/templates/projects/sub-app-react-demo/src/api/api.ts +83 -0
- package/templates/projects/sub-app-react-demo/src/api/client.ts +64 -0
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +311 -0
- package/templates/projects/sub-app-react-demo/src/main.tsx +48 -0
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +572 -0
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +526 -0
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +467 -0
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +453 -0
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +293 -0
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +155 -0
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +30 -0
- package/templates/projects/sub-app-react-demo/src/style.css +92 -0
- package/templates/projects/sub-app-react-demo/src/utils/api.ts +12 -0
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +2 -0
- package/templates/projects/sub-app-react-demo/tsconfig.json +26 -0
- package/templates/projects/sub-app-react-demo/vite.config.ts +111 -0
- package/templates/rules/lovrabet_rules.mdc.tpl +891 -0
- package/templates/skill/SKILL.md.tpl +120 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a2_0x1c46f4=a2_0x574a;(function(_0x4fa7d6,_0x3df481){const _0x55cd09=a2_0x574a,_0x1cd9ed=_0x4fa7d6();while(!![]){try{const _0x1b967a=parseInt(_0x55cd09(0x153))/0x1*(-parseInt(_0x55cd09(0x14c))/0x2)+parseInt(_0x55cd09(0x147))/0x3*(-parseInt(_0x55cd09(0x15c))/0x4)+parseInt(_0x55cd09(0x148))/0x5*(parseInt(_0x55cd09(0x140))/0x6)+parseInt(_0x55cd09(0x168))/0x7+parseInt(_0x55cd09(0x156))/0x8*(parseInt(_0x55cd09(0x14f))/0x9)+-parseInt(_0x55cd09(0x161))/0xa+parseInt(_0x55cd09(0x15d))/0xb;if(_0x1b967a===_0x3df481)break;else _0x1cd9ed['push'](_0x1cd9ed['shift']());}catch(_0x2e533f){_0x1cd9ed['push'](_0x1cd9ed['shift']());}}}(a2_0xddd9,0x910d0));function a2_0x574a(_0x493aa9,_0x599a7c){_0x493aa9=_0x493aa9-0x13b;const _0xddd9e8=a2_0xddd9();let _0x574a56=_0xddd9e8[_0x493aa9];return _0x574a56;}import{mkdirSync,writeFileSync}from'node:fs';function a2_0xddd9(){const _0x1aa6e8=['.md\x20-\x20','success','Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','stringify','tableName','9QIRehy','6015KZPsqa','log','data','生成文档成功:\x20','2NjgwEC','.md\x20(','markdown','315paXWur','.md','application/json','message','833201DtwYYH','push','join','237704htNWXk','POST','./docs','datasetCode','✗\x20Failed:\x20','name','337628vVLSle','3564407yZKGWV','Failed\x20to\x20fetch\x20doc\x20(','status','text','10464990tCCLxC','length','✓\x20Generated:\x20','),\x20HTTP\x20status:\x20','utf8','api-doc','Waiting\x203\x20seconds...\x0a','2130919xrvjYU','error','Invalid\x20response\x20format\x20(','string','json','):\x20missing\x20data.markdown\x20field','5280RDdLYC','\x20datasets\x20to\x20generate\x20docs\x20for\x0a'];a2_0xddd9=function(){return _0x1aa6e8;};return a2_0xddd9();}import a2_0x12a130 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x116ac3){const _0x4fc841=a2_0x574a,{appCode:_0x315d2a,datasetCode:_0x790645,datasetId:_0x4a567e,extraParams:_0x322a4b}=_0x116ac3,_0x391365=getApiDomain(),_0xa86b4d=_0x391365+'/api/node-toolbox/api-doc-generator',_0x4ad5d6={'appCode':_0x315d2a,'datasetCode':_0x790645,'datasetId':_0x4a567e,..._0x322a4b||{}},_0x12ebca=await fetch(_0xa86b4d,{'method':_0x4fc841(0x157),'headers':{'Content-Type':_0x4fc841(0x151),'Cookie':getCookie()},'body':JSON[_0x4fc841(0x145)](_0x4ad5d6)});if(!_0x12ebca['ok']){if(_0x12ebca['status']===0x191)throw new Error(_0x4fc841(0x144));let _0x24b19e='';try{_0x24b19e=await _0x12ebca[_0x4fc841(0x160)]();}catch(_0x4c8f00){}throw new Error(_0x4fc841(0x15e)+_0x790645+_0x4fc841(0x164)+_0x12ebca[_0x4fc841(0x15f)]+(_0x24b19e?'\x0a'+_0x24b19e:''));}const _0x346bf7=await _0x12ebca[_0x4fc841(0x13e)]();if(!_0x346bf7[_0x4fc841(0x14a)]||typeof _0x346bf7[_0x4fc841(0x14a)]['markdown']!==_0x4fc841(0x13d))throw new Error(_0x4fc841(0x13c)+_0x790645+_0x4fc841(0x13f));return _0x346bf7[_0x4fc841(0x14a)][_0x4fc841(0x14e)];}function delay(_0x2ff81d){return new Promise(_0x4f5bcc=>setTimeout(_0x4f5bcc,_0x2ff81d));}export async function generateDatasetDocs(_0x43de9d,_0x58fc64,_0x308877=a2_0x1c46f4(0x158),_0x5de9ce,_0x216bd7){const _0x378a08=a2_0x1c46f4;mkdirSync(_0x308877,{'recursive':!![]});const _0x744ec7=[],_0x41ce15=_0x43de9d['length'];console['log']('\x0a'+_0x41ce15+_0x378a08(0x141));for(let _0x506012=0x0;_0x506012<_0x43de9d[_0x378a08(0x162)];_0x506012++){const _0x1a9608=_0x43de9d[_0x506012],_0x232aef=_0x506012+0x1,_0xf885c0=_0x1a9608[_0x378a08(0x146)];try{console[_0x378a08(0x149)]('['+_0x232aef+'/'+_0x41ce15+']\x20Generating:\x20'+_0xf885c0+_0x378a08(0x14d)+_0x1a9608[_0x378a08(0x15b)]+')');_0x5de9ce&&_0x5de9ce(_0x232aef,_0x41ce15,_0xf885c0);const _0x3798d0=await fetchDatasetDoc({'appCode':_0x58fc64,'datasetCode':_0x1a9608[_0x378a08(0x159)],'datasetId':_0x1a9608['id'],'enableAI':![],'extraParams':_0x216bd7}),_0x15e8c3=a2_0x12a130[_0x378a08(0x155)](_0x308877,_0xf885c0+_0x378a08(0x150));writeFileSync(_0x15e8c3,_0x3798d0,{'encoding':_0x378a08(0x165)}),console['log'](_0x378a08(0x163)+_0xf885c0+_0x378a08(0x150)),logger[_0x378a08(0x143)](_0x378a08(0x166),_0x378a08(0x14b)+_0xf885c0,undefined,{'datasetCode':_0x1a9608[_0x378a08(0x159)],'datasetName':_0x1a9608[_0x378a08(0x15b)],'filePath':_0x15e8c3,'progress':_0x232aef+'/'+_0x41ce15}),_0x744ec7['push']({'datasetCode':_0x1a9608[_0x378a08(0x159)],'datasetName':_0x1a9608['name'],'filePath':_0x15e8c3,'success':!![]}),_0x232aef<_0x41ce15&&await delay(0x1388);}catch(_0x496173){const _0x3e32cd=_0x496173 instanceof Error?_0x496173[_0x378a08(0x152)]:String(_0x496173);console[_0x378a08(0x149)](_0x378a08(0x15a)+_0xf885c0+_0x378a08(0x142)+_0x3e32cd),logger[_0x378a08(0x13b)](_0x378a08(0x166),'生成文档失败:\x20'+_0x1a9608[_0x378a08(0x159)],{'datasetCode':_0x1a9608[_0x378a08(0x159)],'datasetName':_0x1a9608[_0x378a08(0x15b)],'error':_0x3e32cd,'progress':_0x232aef+'/'+_0x41ce15}),_0x744ec7[_0x378a08(0x154)]({'datasetCode':_0x1a9608[_0x378a08(0x159)],'datasetName':_0x1a9608[_0x378a08(0x15b)],'filePath':'','success':![],'error':_0x3e32cd}),_0x232aef<_0x41ce15&&(console[_0x378a08(0x149)](_0x378a08(0x167)),await delay(0xbb8));}}return _0x744ec7;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0xc1c49a,_0x156455){const _0x365cf3=a3_0x5332,_0x29dd48=_0xc1c49a();while(!![]){try{const _0x4f19da=-parseInt(_0x365cf3(0x208))/0x1+parseInt(_0x365cf3(0x1ec))/0x2*(parseInt(_0x365cf3(0x1f9))/0x3)+parseInt(_0x365cf3(0x20b))/0x4*(parseInt(_0x365cf3(0x1fa))/0x5)+parseInt(_0x365cf3(0x1f6))/0x6*(-parseInt(_0x365cf3(0x1fb))/0x7)+parseInt(_0x365cf3(0x210))/0x8+-parseInt(_0x365cf3(0x1dc))/0x9*(parseInt(_0x365cf3(0x207))/0xa)+-parseInt(_0x365cf3(0x1db))/0xb*(-parseInt(_0x365cf3(0x206))/0xc);if(_0x4f19da===_0x156455)break;else _0x29dd48['push'](_0x29dd48['shift']());}catch(_0x6f3066){_0x29dd48['push'](_0x29dd48['shift']());}}}(a3_0x182f,0x6298d));import{jsx as a3_0x4709df,jsxs as a3_0x1c47da}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a3_0x182f(){const _0x6e4887=['2849085YFRWLQ','\x20datasets,\x20generated\x20','message','import\x20','length','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','production','Using\x20specified\x20AppCode:\x20','white','endsWith','*\x20Generated\x20files:','api','replace','\x20duplicates','cwd','client','1094luowHY','-client','modelCount','duplicateCount','\x20login\x20again\x20and\x20retry','*\x20Pulling\x20API\x20config\x20from\x20server...\x20(env:\x20','\x20from\x20\x27@/','拉取\x20API\x20配置失败:\x20','\x20models','apiDir','14550mpHogF','\x20-\x20Client\x20instance\x20file','gray','2037jqGxlA','287785PlUHvE','567YnUkfx','\x20models)','dim','setLogPath','{\x20lovrabetClient\x20}','!\x20Original\x20','-api','cyan','column','slice','Using\x20configured\x20AppCode:\x20','10920rYgVHS','10EpqKfX','789064UDCotf','-\x20Model\x20config\x20(','./src/api/','4mIDViK','yellow','green','Failed\x20to\x20pull\x20API\x20config:\x20','includes','4398776CPrBjF','[ERROR]\x20','env','string','.ts','split','join','8789atdypD'];a3_0x182f=function(){return _0x6e4887;};return a3_0x182f();}function a3_0x5332(_0x375e85,_0x315e72){_0x375e85=_0x375e85-0x1db;const _0x182f7c=a3_0x182f();let _0x533257=_0x182f7c[_0x375e85];return _0x533257;}import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x4288f5,env:_0x6b5306,output:_0x1e7366})=>{const _0x47a1ec=a3_0x5332,{exit:_0x2f09ac}=useApp(),[_0xd3c2ae,_0x216d06]=useState(![]),[_0x420828,_0x4aee8a]=useState(![]),[_0x5d56c0,_0x45ea0a]=useState(null),[_0x3b4eac,_0x535dd1]=useState(null),_0x586b80=readConfig(),_0x477cbf=getConfigAppCode(),_0x284425=_0x4288f5||_0x477cbf,_0x9c4bb5=typeof _0x586b80?.[_0x47a1ec(0x212)]==='string'?_0x586b80[_0x47a1ec(0x212)]:undefined,_0x3045a3=_0x6b5306||_0x9c4bb5||_0x47a1ec(0x1e2);initEnv(_0x3045a3);const _0x107be9=typeof _0x586b80?.[_0x47a1ec(0x1f5)]===_0x47a1ec(0x213)?_0x586b80[_0x47a1ec(0x1f5)]:undefined,_0x1d5aa5=_0x1e7366||_0x107be9||_0x47a1ec(0x20a),_0x65d3c3=_0x4288f5&&_0x4288f5[_0x47a1ec(0x20f)]('-')?_0x4288f5[_0x47a1ec(0x215)]('-')[_0x47a1ec(0x204)](0x1)[_0x47a1ec(0x216)]('-'):'',_0x328cfe=_0x4288f5?_0x47a1ec(0x1e3)+_0x284425:_0x47a1ec(0x205)+_0x284425,_0x4f8252=_0x65d3c3?_0x65d3c3+_0x47a1ec(0x201):_0x47a1ec(0x1e7),_0x8bb262=_0x65d3c3?_0x65d3c3+_0x47a1ec(0x1ed):_0x47a1ec(0x1eb);useEffect(()=>{_0x216d06(!![]),_0x2acf65();},[]),useEffect(()=>{(_0x420828||_0x5d56c0)&&_0x2f09ac();},[_0x420828,_0x5d56c0,_0x2f09ac]);async function _0x2acf65(){const _0x1be706=_0x47a1ec;if(!_0x284425){_0x45ea0a(_0x1be706(0x1e1));return;}try{logger[_0x1be706(0x1fe)](process[_0x1be706(0x1ea)]());const {configArray:_0x450a26}=await fetchModelList(_0x284425),_0x51363f=_0x450a26[_0x1be706(0x1e0)],_0x1ae4c7=!_0x4288f5,_0x4f1ee7=await generateApiFile(_0x450a26,_0x65d3c3,_0x284425,_0x1ae4c7,_0x3045a3,_0x1d5aa5),_0x1261cb=_0x1d5aa5[_0x1be706(0x1e5)]('/')?_0x1d5aa5:_0x1d5aa5+'/';_0x535dd1({'api':''+_0x1261cb+_0x4f8252+_0x1be706(0x214),'client':''+_0x1261cb+_0x8bb262+_0x1be706(0x214),'modelCount':_0x4f1ee7[_0x1be706(0x1ee)],'datasetCount':_0x51363f,'originalCount':_0x51363f,'duplicateCount':0x0}),_0x4aee8a(!![]);}catch(_0x22755c){const _0x1d620d=_0x22755c instanceof Error?_0x22755c[_0x1be706(0x1de)]:String(_0x22755c);logger['error']('api-pull',_0x1be706(0x1f3)+_0x1d620d,{'appCode':_0x284425,'error':_0x1d620d}),_0x45ea0a(_0x1be706(0x20e)+_0x1d620d);}finally{_0x216d06(![]);}}return a3_0x1c47da(Box,{'flexDirection':_0x47a1ec(0x203),'children':[(_0xd3c2ae||_0x420828)&&a3_0x1c47da(Box,{'children':[a3_0x4709df(Text,{'color':'gray','children':'*\x20'}),a3_0x4709df(Text,{'color':_0x4288f5?_0x47a1ec(0x1e4):_0x47a1ec(0x1fd),'children':_0x328cfe})]}),_0xd3c2ae&&a3_0x4709df(Box,{'children':a3_0x4709df(Text,{'children':_0x47a1ec(0x1f1)+_0x3045a3+')'})}),_0x420828&&_0x3b4eac&&a3_0x1c47da(Box,{'flexDirection':'column','children':[a3_0x4709df(Box,{'children':a3_0x4709df(Text,{'color':_0x47a1ec(0x20d),'children':'√\x20Pulled\x20'+_0x3b4eac['datasetCount']+_0x47a1ec(0x1dd)+_0x3b4eac[_0x47a1ec(0x1ee)]+_0x47a1ec(0x1f4)})}),_0x3b4eac[_0x47a1ec(0x1ef)]>0x0&&a3_0x4709df(Box,{'marginTop':0x1,'children':a3_0x4709df(Text,{'color':'yellow','children':_0x47a1ec(0x200)+_0x3b4eac['originalCount']+'\x20datasets,\x20filtered\x20'+_0x3b4eac[_0x47a1ec(0x1ef)]+_0x47a1ec(0x1e9)})}),a3_0x4709df(Box,{'marginTop':0x1,'children':a3_0x4709df(Text,{'color':_0x47a1ec(0x1f8),'children':_0x47a1ec(0x1e6)})}),a3_0x1c47da(Box,{'marginLeft':0x2,'children':[a3_0x1c47da(Text,{'color':_0x47a1ec(0x202),'children':['•\x20',_0x3b4eac[_0x47a1ec(0x1e7)]]}),a3_0x1c47da(Text,{'color':_0x47a1ec(0x1fd),'children':['\x20',_0x47a1ec(0x209)+_0x3b4eac[_0x47a1ec(0x1ee)]+_0x47a1ec(0x1fc)]})]}),a3_0x1c47da(Box,{'marginLeft':0x2,'children':[a3_0x1c47da(Text,{'color':_0x47a1ec(0x202),'children':['•\x20',_0x3b4eac[_0x47a1ec(0x1eb)]]}),a3_0x4709df(Text,{'color':_0x47a1ec(0x1fd),'children':_0x47a1ec(0x1f7)})]}),a3_0x4709df(Box,{'marginTop':0x1,'children':a3_0x4709df(Text,{'color':'gray','children':'*\x20Import\x20usage:'})}),a3_0x4709df(Box,{'marginLeft':0x2,'children':a3_0x1c47da(Text,{'color':_0x47a1ec(0x20c),'children':[_0x47a1ec(0x1df),_0x47a1ec(0x1ff),_0x47a1ec(0x1f2),_0x3b4eac[_0x47a1ec(0x1eb)]['replace'](/^\.\//,'')[_0x47a1ec(0x1e8)](_0x47a1ec(0x214),''),'\x27']})})]}),_0x5d56c0&&a3_0x1c47da(Box,{'flexDirection':'column','children':[a3_0x4709df(Box,{'children':a3_0x1c47da(Text,{'color':'red','children':[_0x47a1ec(0x211),_0x5d56c0]})}),(_0x5d56c0[_0x47a1ec(0x20f)]('登录')||_0x5d56c0['includes']('Authentication')||_0x5d56c0['includes']('expired'))&&a3_0x1c47da(Box,{'marginTop':0x1,'children':[a3_0x4709df(Text,{'color':_0x47a1ec(0x20c),'children':'*\x20'}),a3_0x4709df(Text,{'color':_0x47a1ec(0x202),'children':'rabetbase\x20auth'}),a3_0x4709df(Text,{'color':_0x47a1ec(0x20c),'children':_0x47a1ec(0x1f0)})]})]})]});};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a4_0x3a42(_0x35ad7a,_0x341371){_0x35ad7a=_0x35ad7a-0x1b0;const _0x26f12c=a4_0x26f1();let _0x3a4263=_0x26f12c[_0x35ad7a];return _0x3a4263;}(function(_0x18da47,_0x4bfc0d){const _0x490214=a4_0x3a42,_0x494b44=_0x18da47();while(!![]){try{const _0xf59c61=parseInt(_0x490214(0x1c6))/0x1*(-parseInt(_0x490214(0x1c2))/0x2)+-parseInt(_0x490214(0x1c5))/0x3*(-parseInt(_0x490214(0x1d1))/0x4)+parseInt(_0x490214(0x1d3))/0x5*(-parseInt(_0x490214(0x1cc))/0x6)+parseInt(_0x490214(0x1b7))/0x7*(-parseInt(_0x490214(0x1ce))/0x8)+parseInt(_0x490214(0x1c9))/0x9*(-parseInt(_0x490214(0x1d0))/0xa)+-parseInt(_0x490214(0x1cf))/0xb+parseInt(_0x490214(0x1b2))/0xc*(parseInt(_0x490214(0x1d4))/0xd);if(_0xf59c61===_0x4bfc0d)break;else _0x494b44['push'](_0x494b44['shift']());}catch(_0x232bb4){_0x494b44['push'](_0x494b44['shift']());}}}(a4_0x26f1,0xb2743));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function cleanNewlines(_0x12ea87){const _0x3137eb=a4_0x3a42;return _0x12ea87[_0x3137eb(0x1b8)](/[\r\n]+/g,'\x20')[_0x3137eb(0x1be)]();}function a4_0x26f1(){const _0x29e259=['message','info','code','653429KnjACY','replace','errorCode','Unknown\x20error','json','Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','正在从服务器拉取模型列表...\x20(环境:\x20','trim','includes','/api/node-toolbox/dataset/model-list?appcode=','data','654HAdFoU','Failed\x20to\x20fetch\x20datasets:\x20','Failed\x20to\x20fetch\x20datasets,\x20HTTP\x20status:\x20','39KzJpOF','2977RMxJEg','&otype=array','map','112986uNSBdW','success','errorMessage','2089602VxFDkn','Unauthorized','72QcRuNw','697521alxclY','1090DzgKFH','421016NjXfHo','length','5ozADPI','39NrBtti','error','UNAUTHORIZED','401','name','11825244bSSEco','status'];a4_0x26f1=function(){return _0x29e259;};return a4_0x26f1();}function cleanDatasetName(_0x4cf892){const _0x46eef5=a4_0x3a42;if(!_0x4cf892[_0x46eef5(0x1b1)])return _0x4cf892;return{..._0x4cf892,'name':cleanNewlines(_0x4cf892[_0x46eef5(0x1b1)])};}function cleanDatasetNames(_0x25f0d4){const _0x27d69c=a4_0x3a42;return _0x25f0d4[_0x27d69c(0x1c8)](cleanDatasetName);}export async function fetchModelList(_0x1cbfe6){const _0x3ff7e8=a4_0x3a42,_0x49b109=getEnv(),_0x212524=getApiDomain()+_0x3ff7e8(0x1c0)+_0x1cbfe6+_0x3ff7e8(0x1c7);logger[_0x3ff7e8(0x1b5)]('fetch-model-list',_0x3ff7e8(0x1bd)+_0x49b109+')',{'apiUrl':_0x212524});const _0x26e1d1=await fetch(_0x212524,{'headers':{'Cookie':getCookie()}});if(!_0x26e1d1['ok']){if(_0x26e1d1[_0x3ff7e8(0x1b3)]===0x191)throw new Error('Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again');throw new Error(_0x3ff7e8(0x1c4)+_0x26e1d1['status']);}const _0x42d895=await _0x26e1d1[_0x3ff7e8(0x1bb)]();if(!_0x42d895[_0x3ff7e8(0x1ca)]){const _0x4ded8d=_0x42d895['errorMsg']||_0x42d895[_0x3ff7e8(0x1b4)]||_0x42d895['data']?.['message']||_0x42d895[_0x3ff7e8(0x1cb)]||_0x42d895[_0x3ff7e8(0x1d5)]||_0x3ff7e8(0x1ba);if(_0x4ded8d[_0x3ff7e8(0x1bf)](_0x3ff7e8(0x1b0))||_0x4ded8d[_0x3ff7e8(0x1bf)](_0x3ff7e8(0x1cd))||_0x4ded8d[_0x3ff7e8(0x1bf)]('登录')||_0x4ded8d['includes']('认证')||_0x42d895[_0x3ff7e8(0x1b9)]===_0x3ff7e8(0x1d6)||_0x42d895['code']===0x191||_0x42d895[_0x3ff7e8(0x1b6)]==='401')throw new Error(_0x3ff7e8(0x1bc));throw new Error(_0x3ff7e8(0x1c3)+_0x4ded8d);}const _0x2171f9=cleanDatasetNames(_0x42d895[_0x3ff7e8(0x1c1)]['configArray']);return{'configArray':_0x2171f9,'count':_0x2171f9[_0x3ff7e8(0x1d2)]};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a5_0x305799=a5_0x29f8;(function(_0x4dc7d1,_0x33e2ed){const _0x307ad7=a5_0x29f8,_0x1f76e4=_0x4dc7d1();while(!![]){try{const _0x8c41c=-parseInt(_0x307ad7(0xd8))/0x1*(-parseInt(_0x307ad7(0xe8))/0x2)+parseInt(_0x307ad7(0xe0))/0x3*(-parseInt(_0x307ad7(0xe6))/0x4)+-parseInt(_0x307ad7(0xd3))/0x5+-parseInt(_0x307ad7(0xec))/0x6+-parseInt(_0x307ad7(0xe7))/0x7*(parseInt(_0x307ad7(0xe1))/0x8)+-parseInt(_0x307ad7(0xeb))/0x9*(-parseInt(_0x307ad7(0xe5))/0xa)+-parseInt(_0x307ad7(0xf5))/0xb*(-parseInt(_0x307ad7(0xdf))/0xc);if(_0x8c41c===_0x33e2ed)break;else _0x1f76e4['push'](_0x1f76e4['shift']());}catch(_0x340e7a){_0x1f76e4['push'](_0x1f76e4['shift']());}}}(a5_0x3fd2,0x86dfd));import a5_0x57a6bc from'prettier';function a5_0x3fd2(){const _0x490bb1=['API\x20文件生成成功!','utf8','\x22\x20}','name','187272OQDyvi','230772hhKlOm','19984bIRFWV','templates/generate-api','CONFIG_NAMES.DEFAULT','typescript','20620shWCTm','20HvjHIC','2639akMFiU','1678904byRSXm','./src/api/','client','603pHiISd','2741250vrSzJF','init-api',',\x20env:\x20\x22','resolve','string','slice','endsWith','env','Please\x20configure\x20app\x20code\x20first\x20via\x20`rabetbase\x20config\x20set\x20app\x20<value>`','1441Mjqmev','client.ts.tpl','forEach','replaceApiContent','tableName','length','format','.ts','success','{\x20apiConfigName:\x20','production','3431530YvFPkr','join','key','alias','{\x20apiConfigName:\x20\x22','1rpRlfx','app','api'];a5_0x3fd2=function(){return _0x490bb1;};return a5_0x3fd2();}import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x55ffd4 from'node:path';import{fileURLToPath}from'node:url';function a5_0x29f8(_0x102764,_0x1320e5){_0x102764=_0x102764-0xc9;const _0x3fd2c3=a5_0x3fd2();let _0x29f841=_0x3fd2c3[_0x102764];return _0x29f841;}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x52f4f7,_0x43da41='',_0x4bbd68,_0x331778=![],_0x19ac18,_0x4a1335=a5_0x305799(0xe9)){const _0x21d158=a5_0x305799,_0x447b00=readConfig(),_0xab9c08=_0x4bbd68||_0x447b00?.[_0x21d158(0xd9)];if(typeof _0xab9c08!==_0x21d158(0xf0)||!_0xab9c08)throw new Error(_0x21d158(0xf4));const _0x2e1c5f=_0x331778?_0x21d158(0xe3):'\x22'+_0xab9c08+'\x22',_0x2737aa=typeof _0x447b00[_0x21d158(0xf3)]===_0x21d158(0xf0)?_0x447b00[_0x21d158(0xf3)]:undefined,_0x1afa79=_0x19ac18||_0x2737aa||_0x21d158(0xd2),_0xafbdfa=_0x1afa79!==_0x21d158(0xd2);let _0x4f96ac;if(_0x331778)_0xafbdfa?_0x4f96ac=_0x21d158(0xd1)+_0x2e1c5f+_0x21d158(0xee)+_0x1afa79+_0x21d158(0xdd):_0x4f96ac='';else{const _0x48c2e2=_0xafbdfa?_0x21d158(0xee)+_0x1afa79+'\x22':'';_0x4f96ac=_0x21d158(0xd7)+_0xab9c08+'\x22'+_0x48c2e2+'\x20}';}const _0x10bb12=_0x43da41?_0x43da41+'-api':_0x21d158(0xda),_0x3109f8=_0x43da41?_0x43da41+'-client':_0x21d158(0xea),_0x59b15f=[];_0x52f4f7[_0x21d158(0xca)](_0x54a5be=>{const _0x30ad8c=_0x21d158;_0x59b15f['push']({'datasetCode':_0x54a5be['datasetCode'],'tableName':_0x54a5be[_0x30ad8c(0xcc)],'name':_0x54a5be[_0x30ad8c(0xde)]||'','alias':_0x54a5be['alias']||_0x54a5be[_0x30ad8c(0xd5)]});});const _0x5e1237=fileURLToPath(import.meta.url),_0x4f725f=a5_0x55ffd4[_0x21d158(0xef)](a5_0x55ffd4['dirname'](_0x5e1237),'../..'),_0x4368c5=a5_0x55ffd4[_0x21d158(0xd4)](_0x4f725f,_0x21d158(0xe2)),_0x976cf0=a5_0x55ffd4['join'](_0x4368c5,'api.ts.tpl'),_0x100562=a5_0x55ffd4[_0x21d158(0xd4)](_0x4368c5,_0x21d158(0xc9)),_0x22e088=_0x4a1335[_0x21d158(0xf2)]('/')?_0x4a1335[_0x21d158(0xf1)](0x0,-0x1):_0x4a1335;mkdirSync(_0x22e088,{'recursive':!![]});const _0x5e5377=_0x59b15f[0x0]?.[_0x21d158(0xd6)],_0x36ecfc=readFileSync(_0x976cf0,'utf8'),_0x2e23ff=TemplateReplacer[_0x21d158(0xcb)](_0x36ecfc,_0xab9c08,_0x59b15f,_0x5e5377,_0x10bb12,_0x2e1c5f),_0x125f37=await a5_0x57a6bc[_0x21d158(0xce)](_0x2e23ff,{'parser':_0x21d158(0xe4)}),_0x2e52dd=_0x22e088+'/'+_0x10bb12+_0x21d158(0xcf);writeFileSync(_0x2e52dd,_0x125f37,{'encoding':'utf8'});const _0x462daa=readFileSync(_0x100562,_0x21d158(0xdc)),_0x5ac314=TemplateReplacer['replaceApiContent'](_0x462daa,_0xab9c08,_0x59b15f,_0x5e5377,_0x10bb12,_0x2e1c5f,_0x4f96ac),_0x63193=await a5_0x57a6bc[_0x21d158(0xce)](_0x5ac314,{'parser':_0x21d158(0xe4)}),_0x26c104=_0x22e088+'/'+_0x3109f8+_0x21d158(0xcf);writeFileSync(_0x26c104,_0x63193,{'encoding':_0x21d158(0xdc)});const _0x42d15d=_0x59b15f[_0x21d158(0xcd)];return logger[_0x21d158(0xd0)](_0x21d158(0xed),_0x21d158(0xdb),undefined,{'apiFile':_0x2e52dd,'clientFile':_0x26c104,'modelCount':_0x42d15d,'configName':_0x2e1c5f}),{'modelCount':_0x42d15d,'apiFilePath':_0x2e52dd,'clientFilePath':_0x26c104,'configName':_0x2e1c5f};}
|
package/lib/api/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x19f589,_0x1fe2fc){const _0x5cfe26=a6_0x4e3b,_0x593e57=_0x19f589();while(!![]){try{const _0xa6ef58=-parseInt(_0x5cfe26(0x155))/0x1+parseInt(_0x5cfe26(0x14e))/0x2+parseInt(_0x5cfe26(0x137))/0x3+-parseInt(_0x5cfe26(0x130))/0x4+-parseInt(_0x5cfe26(0x154))/0x5*(parseInt(_0x5cfe26(0x12e))/0x6)+-parseInt(_0x5cfe26(0x14c))/0x7+-parseInt(_0x5cfe26(0x15a))/0x8*(-parseInt(_0x5cfe26(0x153))/0x9);if(_0xa6ef58===_0x1fe2fc)break;else _0x593e57['push'](_0x593e57['shift']());}catch(_0x5df1dd){_0x593e57['push'](_0x593e57['shift']());}}}(a6_0x2f72,0xd8c26));function a6_0x4e3b(_0x68d79e,_0x2ae3fb){_0x68d79e=_0x68d79e-0x12a;const _0x2f7230=a6_0x2f72();let _0x4e3b3d=_0x2f7230[_0x68d79e];return _0x4e3b3d;}import{jsx as a6_0x3fb278}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a6_0x2f72(){const _0x1cba3d=['54PlbRtA','5vifnnk','29840ffQrMh','\x20\x20\x202.\x20Use\x20flag:\x20rabetbase\x20api\x20pull\x20--appcode\x20<app-code>','\x20\x20rabetbase\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20API\x20for\x20specified\x20environment','\x20\x20rabetbase\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20doc\x20output\x20directory','\x1b[90m\x20\x20(Note:\x20--appcode\x20flag\x20matches\x20config,\x20using\x20default\x20config)\x1b[0m','16312XAFKYi','\x1b[90m*\x20Using\x20configured\x20AppCode:\x20','appcode','\x20\x20rabetbase\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20all\x20datasets','env','--params\x20must\x20be\x20a\x20valid\x20JSON\x20object','filter','\x20\x20rabetbase\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode','3966810RwbFHS','isArray','4901932gorOhC','length','AppCode\x20not\x20configured','\x20\x20rabetbase\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20output\x20directory','params','exit','pull','5020806ZpovwT','Error:\x20Positional\x20arguments\x20are\x20no\x20longer\x20supported','Please\x20use\x20the\x20--appcode\x20flag,\x20for\x20example:','\x20\x20\x202.\x20Use\x20flag:\x20rabetbase\x20api\x20doc\x20--appcode\x20<app-code>','map','input','\x20\x20rabetbase\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20specified\x20environment','help','split','object','--datasetcode\x20cannot\x20be\x20empty','\x20\x20rabetbase\x20api\x20doc\x20--appcode\x20','\x20\x20\x201.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20appcode\x20<app-code>','trim','\x20\x20rabetbase\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20and\x20generate\x20API\x20config\x20files','flags','\x20\x20rabetbase\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode','parse','\x1b[0m','output','log','2416981ZSAlKU','string','2927502CSVgik','error','--params\x20is\x20not\x20valid\x20JSON\x20format','doc','Please\x20use\x20one\x20of\x20the\x20following:'];a6_0x2f72=function(){return _0x1cba3d;};return a6_0x2f72();}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x4f9c64){const _0x30188f=a6_0x4e3b,_0x5a758b=_0x4f9c64[_0x30188f(0x13c)][0x1];if(_0x4f9c64[_0x30188f(0x146)][_0x30188f(0x13e)]){console['log']('\x0arabetbase\x20api\x20-\x20API\x20Operations\x0a\x0aUsage:\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20[options]\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20[options]\x0a\x0aOptions:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20Specify\x20app\x20code\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20output\x20directory\x20(pull:\x20./src/api/,\x20doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20environment\x20(e.g.\x20daily,\x20production)\x0a\x20\x20--datasetcode\x20<codes>\x20Specify\x20dataset\x20codes\x20for\x20doc\x20generation\x20(comma-separated,\x20doc\x20command\x20only)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aExamples:\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20and\x20generate\x20API\x20config\x20files\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20output\x20directory\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20API\x20for\x20specified\x20environment\x0a\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20all\x20datasets\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20doc\x20output\x20directory\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20specified\x20environment\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20doc\x20for\x20specific\x20dataset\x20only\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20multiple\x20datasets\x0a');return;}if(_0x5a758b===_0x30188f(0x136)){_0x4f9c64[_0x30188f(0x13c)][0x2]&&(console['error'](_0x30188f(0x138)),console[_0x30188f(0x14b)](_0x30188f(0x139)),console['log']('\x20\x20rabetbase\x20api\x20pull\x20--appcode\x20'+_0x4f9c64[_0x30188f(0x13c)][0x2]),process[_0x30188f(0x135)](0x1));const _0x2b2742=getConfigAppCode();let _0x1819d1=_0x4f9c64[_0x30188f(0x146)][_0x30188f(0x15c)];const _0x438e7c=typeof _0x4f9c64[_0x30188f(0x146)][_0x30188f(0x12a)]===_0x30188f(0x14d)?_0x4f9c64['flags'][_0x30188f(0x12a)]:undefined,_0x532f9e=_0x4f9c64['flags']['output'];!_0x1819d1&&!_0x2b2742&&(console[_0x30188f(0x14f)](_0x30188f(0x132)),console['log']('Please\x20use\x20one\x20of\x20the\x20following:'),console['log']('\x20\x20\x201.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20appcode\x20<app-code>'),console['log'](_0x30188f(0x156)),process[_0x30188f(0x135)](0x1)),_0x1819d1&&_0x2b2742&&_0x1819d1===_0x2b2742&&(console[_0x30188f(0x14b)](_0x30188f(0x15b)+_0x1819d1+_0x30188f(0x149)),console['log'](_0x30188f(0x159)),_0x1819d1=undefined),render(a6_0x3fb278(ApiPullUI,{'appCode':_0x1819d1,'env':_0x438e7c,'output':_0x532f9e}));}else{if(_0x5a758b===_0x30188f(0x151)){_0x4f9c64['input'][0x2]&&(console[_0x30188f(0x14f)](_0x30188f(0x138)),console['log'](_0x30188f(0x139)),console[_0x30188f(0x14b)](_0x30188f(0x142)+_0x4f9c64[_0x30188f(0x13c)][0x2]),process[_0x30188f(0x135)](0x1));const _0x459518=getConfigAppCode();let _0x39ad9a=_0x4f9c64[_0x30188f(0x146)][_0x30188f(0x15c)];const _0x511c25=typeof _0x4f9c64[_0x30188f(0x146)][_0x30188f(0x12a)]===_0x30188f(0x14d)?_0x4f9c64[_0x30188f(0x146)]['env']:undefined,_0x170703=_0x4f9c64['flags'][_0x30188f(0x14a)],_0x4d42ed=_0x4f9c64[_0x30188f(0x146)][_0x30188f(0x134)],_0x52aad7=_0x4f9c64[_0x30188f(0x146)]['datasetcode'];!_0x39ad9a&&!_0x459518&&(console[_0x30188f(0x14f)](_0x30188f(0x132)),console[_0x30188f(0x14b)](_0x30188f(0x152)),console[_0x30188f(0x14b)](_0x30188f(0x143)),console[_0x30188f(0x14b)](_0x30188f(0x13a)),process[_0x30188f(0x135)](0x1));_0x39ad9a&&_0x459518&&_0x39ad9a===_0x459518&&(console[_0x30188f(0x14b)](_0x30188f(0x15b)+_0x39ad9a+_0x30188f(0x149)),_0x39ad9a=undefined);let _0x4e6ce8;if(_0x4d42ed)try{_0x4e6ce8=JSON[_0x30188f(0x148)](_0x4d42ed),(typeof _0x4e6ce8!==_0x30188f(0x140)||_0x4e6ce8===null||Array[_0x30188f(0x12f)](_0x4e6ce8))&&(console[_0x30188f(0x14f)](_0x30188f(0x12b)),process['exit'](0x1));}catch(_0x17a07c){console[_0x30188f(0x14f)](_0x30188f(0x150)),console[_0x30188f(0x14f)]('\x20\x20Error:\x20'+(_0x17a07c instanceof Error?_0x17a07c['message']:String(_0x17a07c))),process[_0x30188f(0x135)](0x1);}let _0x4d6604;_0x52aad7&&(_0x4d6604=_0x52aad7[_0x30188f(0x13f)](',')[_0x30188f(0x13b)](_0xfee4fc=>_0xfee4fc[_0x30188f(0x144)]())[_0x30188f(0x12c)](_0x2f2807=>_0x2f2807[_0x30188f(0x131)]>0x0),_0x4d6604[_0x30188f(0x131)]===0x0&&(console[_0x30188f(0x14f)](_0x30188f(0x141)),process[_0x30188f(0x135)](0x1)),console[_0x30188f(0x14b)]('\x1b[90m*\x20Generating\x20docs\x20only\x20for\x20specified\x20datasets:\x20'+_0x4d6604['join'](',\x20')+_0x30188f(0x149))),render(a6_0x3fb278(ApiDocUI,{'appCode':_0x39ad9a,'env':_0x511c25,'output':_0x170703,'extraParams':_0x4e6ce8,'datasetCodes':_0x4d6604}));}else console[_0x30188f(0x14f)]('Unknown\x20api\x20command:\x20'+_0x5a758b),console[_0x30188f(0x14b)]('Available\x20commands:'),console[_0x30188f(0x14b)](_0x30188f(0x145)),console['log'](_0x30188f(0x147)),console[_0x30188f(0x14b)](_0x30188f(0x133)),console[_0x30188f(0x14b)](_0x30188f(0x157)),console['log'](''),console[_0x30188f(0x14b)](_0x30188f(0x15d)),console[_0x30188f(0x14b)](_0x30188f(0x12d)),console[_0x30188f(0x14b)](_0x30188f(0x158)),console[_0x30188f(0x14b)](_0x30188f(0x13d)),process[_0x30188f(0x135)](0x1);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x2b60b9,_0x3e0b7e){const _0x3e2810=a7_0x5442,_0x2ac9ef=_0x2b60b9();while(!![]){try{const _0x12357b=-parseInt(_0x3e2810(0x127))/0x1*(parseInt(_0x3e2810(0x109))/0x2)+parseInt(_0x3e2810(0xff))/0x3*(-parseInt(_0x3e2810(0x108))/0x4)+-parseInt(_0x3e2810(0x115))/0x5+-parseInt(_0x3e2810(0x118))/0x6+-parseInt(_0x3e2810(0x100))/0x7*(-parseInt(_0x3e2810(0x10d))/0x8)+-parseInt(_0x3e2810(0x129))/0x9+parseInt(_0x3e2810(0x125))/0xa*(parseInt(_0x3e2810(0x107))/0xb);if(_0x12357b===_0x3e0b7e)break;else _0x2ac9ef['push'](_0x2ac9ef['shift']());}catch(_0x206568){_0x2ac9ef['push'](_0x2ac9ef['shift']());}}}(a7_0x5e66,0x6542a));function a7_0x5442(_0x4451a2,_0x11d2e7){_0x4451a2=_0x4451a2-0xff;const _0x5e6638=a7_0x5e66();let _0x544225=_0x5e6638[_0x4451a2];return _0x544225;}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a7_0x5e66(){const _0x2b43fa=['test','*\x20Pulling\x20API\x20config\x20from\x20server...\x20(env:\x20','\x20models','\x20datasets...','API\x20配置拉取成功:\x20','production','473655ANLtCD','-api','chdir','3153294HfHjhU','log','\x20datasets,\x20generated\x20','message','*\x20Processing\x20','info','./src/api/','trim','×\x20Invalid\x20file\x20prefix.\x20Only\x20letters,\x20numbers,\x20hyphens\x20and\x20underscores\x20allowed,\x20must\x20start\x20with\x20a\x20letter.','length','env','cwd','×\x20API\x20config\x20pull\x20failed:\x20','280IeOmbe','create-api-pull','719547TVRtZh','apiDir','2839374enHWjD','3iSmFZb','5656LoUZWJ','.ts\x20-\x20Client\x20instance\x20file','string','modelCount','-client','error','api','607607OsAcAO','617892AaZYJU','2aQDyKJ','API\x20配置拉取异常:\x20','*\x20Generating\x20API\x20config\x20files:','\x20\x20\x20•\x20','6712pXuyOn','√\x20Pulled\x20'];a7_0x5e66=function(){return _0x2b43fa;};return a7_0x5e66();}import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x5a00bb,_0x3e07f4,_0x31c28a,_0x3efec9){const _0xdb546b=a7_0x5442;let _0x73760;try{const _0x326eb8=_0x3e07f4?.[_0xdb546b(0x11f)]()||'';if(_0x326eb8){const _0x35ccdf=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x35ccdf[_0xdb546b(0x10f)](_0x326eb8))return console[_0xdb546b(0x105)](_0xdb546b(0x120)),![];}_0x31c28a&&(_0x73760=process[_0xdb546b(0x123)](),process['chdir'](_0x31c28a));const _0x1f2743=readConfig(),_0x5b58b4=typeof _0x1f2743[_0xdb546b(0x122)]==='string'?_0x1f2743[_0xdb546b(0x122)]:undefined,_0x32a98e=_0x3efec9||_0x5b58b4||_0xdb546b(0x114);initEnv(_0x32a98e),console[_0xdb546b(0x119)](_0xdb546b(0x110)+_0x32a98e+')');const {configArray:_0x185210}=await fetchModelList(_0x5a00bb),_0x59dcf9=_0x326eb8?_0x326eb8+_0xdb546b(0x116):_0xdb546b(0x106),_0x428f89=_0x326eb8?_0x326eb8+_0xdb546b(0x104):'client';console['log'](_0xdb546b(0x10b)),console[_0xdb546b(0x119)](_0xdb546b(0x10c)+_0x59dcf9+'.ts\x20-\x20Model\x20config\x20file'),console['log']('\x20\x20\x20•\x20'+_0x428f89+_0xdb546b(0x101)),console['log'](_0xdb546b(0x11c)+_0x185210[_0xdb546b(0x121)]+_0xdb546b(0x112));const _0x3cd091=typeof _0x1f2743[_0xdb546b(0x128)]===_0xdb546b(0x102)?_0x1f2743['apiDir']:undefined,_0x2cda5e=await generateApiFile(_0x185210,_0x326eb8,_0x5a00bb,!![],_0x32a98e,_0x3cd091||_0xdb546b(0x11e));return console[_0xdb546b(0x119)](_0xdb546b(0x10e)+_0x185210['length']+_0xdb546b(0x11a)+_0x2cda5e[_0xdb546b(0x103)]+_0xdb546b(0x111)),_0x31c28a&&logger[_0xdb546b(0x11d)](_0xdb546b(0x126),_0xdb546b(0x113)+_0x5a00bb,{'projectPath':_0x31c28a,'appCode':_0x5a00bb,'datasetCount':_0x185210['length'],'filePrefix':_0x326eb8}),!![];}catch(_0x13ba84){const _0x48208d=_0x13ba84 instanceof Error?_0x13ba84[_0xdb546b(0x11b)]:String(_0x13ba84);return console[_0xdb546b(0x105)](_0xdb546b(0x124)+_0x48208d),_0x31c28a&&logger['error'](_0xdb546b(0x126),_0xdb546b(0x10a)+_0x48208d,{'appCode':_0x5a00bb,'projectPath':_0x31c28a}),![];}finally{_0x73760&&process[_0xdb546b(0x117)](_0x73760);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x5efb3a,_0x1ee91f){const _0x386d67=a8_0x136b,_0x528c49=_0x5efb3a();while(!![]){try{const _0x267381=-parseInt(_0x386d67(0x12d))/0x1*(parseInt(_0x386d67(0x12b))/0x2)+parseInt(_0x386d67(0x142))/0x3+-parseInt(_0x386d67(0x14c))/0x4+parseInt(_0x386d67(0x165))/0x5*(-parseInt(_0x386d67(0x159))/0x6)+-parseInt(_0x386d67(0x169))/0x7*(-parseInt(_0x386d67(0x14a))/0x8)+parseInt(_0x386d67(0x13f))/0x9+parseInt(_0x386d67(0x14f))/0xa;if(_0x267381===_0x1ee91f)break;else _0x528c49['push'](_0x528c49['shift']());}catch(_0x82e8f7){_0x528c49['push'](_0x528c49['shift']());}}}(a8_0x244e,0x7184d));import{jsx as a8_0x29aa4c,jsxs as a8_0x195ad6,Fragment as a8_0x352d22}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a8_0x244e(){const _0x473061=['Failed\x20to\x20create\x20menu','Hint:\x20use\x20','fill','upArrow','JS\x20URL','local','has','\x20command\x20to\x20re-login','\x20Enter\x20project\x20CSS\x20asset\x20URL\x20(https://...)','Please\x20select\x20at\x20least\x20one\x20menu','trim','selecting','column','yellow','input-js','3024801eUdfwf','filter','\x20items','1106718mwPuHV','gray','\x20←\x20','includes','map','CSS\x20URL','label','Menu\x20Name','104jVoMbW','√\x20Menu\x20creation\x20completed','1847796MraWxU','input-css','Selected\x20menus','8527510qLKlAu','online','backspace','test','delete','catch','size','repeat','Please\x20enter\x20a\x20valid\x20JS\x20https\x20URL','[\x20]','540lZtmpT','message','dots','slice','white','then','[✓]','creating','blue','green','Update','length','22535isdRhM','cyan','path','Create','231049OOrVLN','Lovrabet\x20Platform','add','max','value','join','return','red','261714seSLxJ','*\x20Select\x20menus\x20to\x20sync:','5npxnDa','done','Local'];a8_0x244e=function(){return _0x473061;};return a8_0x244e();}import a8_0xb82e28 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';function a8_0x136b(_0xe1861e,_0x41ca27){_0xe1861e=_0xe1861e-0x126;const _0x244ebc=a8_0x244e();let _0x136b5d=_0x244ebc[_0xe1861e];return _0x136b5d;}import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a8_0x29aa4c(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x184960=a8_0x136b,{exit:_0xb7617a}=useApp(),{loading:_0x536907,menuList:_0xe6a22a,error:_0x41c18b}=useGetOnlineMenuList(),_0x267b60=getLocalPages(),_0x367a18=_0xe6a22a[_0x184960(0x146)](_0x5db56e=>_0x5db56e[_0x184960(0x167)]),_0x3f8c40=_0x184960(0x149),_0x573ac1=[_0x3f8c40,..._0x267b60[_0x184960(0x146)](_0xa8a16c=>_0xa8a16c['label'])],_0x2294f4=getStringWidth(getMaxWidth(_0x573ac1,0x4)),_0x5e3dce=getStringWidth(getMaxWidth([_0x3f8c40])),[_0x4d56ae,_0x58c3bc]=useState(_0x184960(0x13b)),[_0x1aa4e8,_0xc1ada4]=useState(new Set()),[_0x43f639,_0x47c91d]=useState(0x0),[_0x3e4623,_0x5ba1aa]=useState(''),[_0x239581,_0x18d564]=useState(''),[_0x290c0a,_0x1dd19f]=useState(''),[_0x385589,_0x567380]=useState(''),[_0x32fa48,_0x2ea9aa]=useState([]),_0x508391=_0x267b60[_0x184960(0x146)](_0x17e9f3=>({'label':_0x17e9f3[_0x184960(0x148)],'path':_0x17e9f3[_0x184960(0x167)],'local':!![],'online':_0x367a18['includes'](_0x17e9f3['path'])})),_0x12d742=_0x267b60['filter'](_0x5a14c1=>{return!_0x367a18['includes'](_0x5a14c1['path']);});useEffect(()=>{const _0x54227e=_0x184960;if(!_0x536907&&_0x267b60['length']>0x0&&_0x1aa4e8['size']===0x0){const _0x1572e3=new Set(_0x267b60[_0x54227e(0x146)]((_0xffd142,_0x367a23)=>({'page':_0xffd142,'index':_0x367a23}))[_0x54227e(0x140)](({page:_0x58caca})=>!_0x367a18[_0x54227e(0x145)](_0x58caca[_0x54227e(0x167)]))[_0x54227e(0x146)](({index:_0x1b886e})=>_0x1b886e));_0xc1ada4(_0x1572e3);}},[_0x536907,_0x267b60[_0x184960(0x164)],_0x367a18[_0x184960(0x164)]]),useInput(async(_0x3671b8,_0x20b858)=>{const _0x34de94=_0x184960;if(_0x4d56ae===_0x34de94(0x13b)){if(_0x20b858[_0x34de94(0x133)]){_0x47c91d(_0x2b6925=>_0x2b6925>0x0?_0x2b6925-0x1:_0x267b60['length']-0x1);return;}if(_0x20b858['downArrow']){_0x47c91d(_0x58d479=>_0x58d479<_0x267b60[_0x34de94(0x164)]-0x1?_0x58d479+0x1:0x0);return;}if(_0x3671b8==='\x20'){_0xc1ada4(_0x5cf21e=>{const _0x13176f=_0x34de94,_0x3713e6=new Set(_0x5cf21e);return _0x3713e6[_0x13176f(0x136)](_0x43f639)?_0x3713e6[_0x13176f(0x153)](_0x43f639):_0x3713e6['add'](_0x43f639),_0x3713e6;});return;}if(_0x3671b8==='a'||_0x3671b8==='A'){const _0x549985=new Set(_0x267b60['map']((_0x21f8da,_0x3b0d79)=>_0x3b0d79));_0xc1ada4(_0x549985);return;}if(_0x3671b8==='i'||_0x3671b8==='I'||_0x3671b8==='r'||_0x3671b8==='R'){_0xc1ada4(_0x4aa8be=>{const _0x11fbed=_0x34de94,_0x244b15=new Set();for(let _0x8208c7=0x0;_0x8208c7<_0x267b60[_0x11fbed(0x164)];_0x8208c7++){!_0x4aa8be['has'](_0x8208c7)&&_0x244b15[_0x11fbed(0x16b)](_0x8208c7);}return _0x244b15;});return;}if(_0x3671b8==='q'||_0x3671b8==='Q'){_0xb7617a();return;}if(_0x20b858[_0x34de94(0x129)]){if(_0x1aa4e8[_0x34de94(0x155)]===0x0){_0x567380(_0x34de94(0x139));return;}const _0x797531=_0x267b60['filter']((_0x18982c,_0x15aebf)=>_0x1aa4e8['has'](_0x15aebf)),_0x217527=_0x797531[_0x34de94(0x146)](_0x54b937=>_0x54b937['label'])[_0x34de94(0x128)](',\x20');_0x2ea9aa([{'label':_0x34de94(0x14e),'value':_0x1aa4e8[_0x34de94(0x155)]+_0x34de94(0x141)}]),_0x567380(''),_0x58c3bc(_0x34de94(0x13e));return;}return;}if(_0x4d56ae==='input-js'){if(_0x20b858[_0x34de94(0x129)]){const _0x1a8714=_0x290c0a[_0x34de94(0x13a)]();if(_0x1a8714==='')return;if(!isValidJsHttpsUrl(_0x1a8714)){_0x567380(_0x34de94(0x157));return;}if(!await isUrlReachable(_0x1a8714)){_0x567380('JS\x20URL\x20is\x20unreachable');return;}_0x5ba1aa(_0x1a8714),_0x2ea9aa(_0x3aecd0=>[..._0x3aecd0,{'label':_0x34de94(0x134),'value':_0x1a8714}]),_0x1dd19f(''),_0x567380(''),_0x58c3bc(_0x34de94(0x14d));return;}if(_0x20b858[_0x34de94(0x151)]||_0x20b858[_0x34de94(0x153)]){_0x1dd19f(_0x39c917=>_0x39c917[_0x34de94(0x15c)](0x0,-0x1)),_0x567380('');return;}_0x1dd19f(_0x53114c=>_0x53114c+_0x3671b8);return;}if(_0x4d56ae===_0x34de94(0x14d)){if(_0x20b858['return']){const _0x39dd57=_0x290c0a[_0x34de94(0x13a)]();if(_0x39dd57==='')return;if(!isValidCssHttpsUrl(_0x39dd57)){_0x567380('Please\x20enter\x20a\x20valid\x20CSS\x20https\x20URL');return;}if(!await isUrlReachable(_0x39dd57)){_0x567380('CSS\x20URL\x20is\x20unreachable');return;}_0x18d564(_0x39dd57),_0x2ea9aa(_0x5e217c=>[..._0x5e217c,{'label':_0x34de94(0x147),'value':_0x39dd57}]),_0x1dd19f(''),_0x567380(''),_0x58c3bc(_0x34de94(0x160));const _0xdf0d5=_0x267b60[_0x34de94(0x140)]((_0x4fa839,_0x4e7e7c)=>_0x1aa4e8['has'](_0x4e7e7c));createMenus(_0xdf0d5,[_0x3e4623,_0x39dd57])[_0x34de94(0x15e)](()=>{_0x58c3bc('done'),setTimeout(()=>{_0xb7617a();},0x3e8);})[_0x34de94(0x154)](_0x344c15=>{const _0x5e0998=_0x34de94;_0x567380(_0x344c15[_0x5e0998(0x15a)]||_0x5e0998(0x130)),_0x58c3bc(_0x5e0998(0x13b));});return;}if(_0x20b858['backspace']||_0x20b858['delete']){_0x1dd19f(_0x81449f=>_0x81449f[_0x34de94(0x15c)](0x0,-0x1)),_0x567380('');return;}_0x1dd19f(_0x4394cb=>_0x4394cb+_0x3671b8);return;}});if(_0x536907)return a8_0x195ad6(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a8_0x29aa4c(Text,{'children':'\x20\x20'}),a8_0x29aa4c(a8_0xb82e28,{'type':_0x184960(0x15b)}),a8_0x29aa4c(Text,{'children':'\x20Fetching\x20online\x20menu\x20list...'})]});if(_0x41c18b)return a8_0x195ad6(Box,{'flexDirection':_0x184960(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[a8_0x195ad6(Text,{'color':_0x184960(0x12a),'children':['✗\x20',_0x41c18b]}),a8_0x195ad6(Box,{'marginTop':0x1,'children':[a8_0x29aa4c(Text,{'color':'gray','children':_0x184960(0x131)}),a8_0x29aa4c(Text,{'color':_0x184960(0x166),'children':'rabetbase\x20auth'}),a8_0x29aa4c(Text,{'color':'gray','children':_0x184960(0x137)})]})]});if(_0x267b60[_0x184960(0x164)]===0x0)return a8_0x29aa4c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a8_0x29aa4c(Text,{'color':_0x184960(0x13d),'children':'!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first'})});return a8_0x195ad6(Box,{'flexDirection':_0x184960(0x13c),'marginTop':0x1,'marginBottom':0x1,'children':[_0x4d56ae==='selecting'&&a8_0x195ad6(a8_0x352d22,{'children':[a8_0x195ad6(Box,{'children':[a8_0x195ad6(Text,{'bold':!![],'children':['\x20\x20',_0x3f8c40,getRemainingSpaces(_0x2294f4,_0x3f8c40)]}),a8_0x195ad6(Text,{'bold':!![],'children':[_0x184960(0x12f),getRemainingSpaces(_0x5e3dce,_0x3f8c40)]}),a8_0x195ad6(Text,{'bold':!![],'children':[_0x184960(0x16a),getRemainingSpaces(_0x5e3dce,_0x3f8c40)]})]}),_0x508391[_0x184960(0x146)](_0x3ff01d=>a8_0x195ad6(Box,{'children':[a8_0x195ad6(Text,{'children':['\x20\x20',_0x3ff01d[_0x184960(0x148)],getRemainingSpaces(_0x2294f4,_0x3ff01d[_0x184960(0x148)])]}),a8_0x195ad6(Text,{'color':_0x184960(0x162),'children':[_0x3ff01d[_0x184960(0x135)]?'✓':'✗',getRemainingSpaces(_0x5e3dce,'✓')]}),a8_0x195ad6(Text,{'color':_0x3ff01d[_0x184960(0x150)]?_0x184960(0x162):_0x184960(0x12a),'children':[_0x3ff01d[_0x184960(0x150)]?'✓':'✗',getRemainingSpaces(_0x5e3dce,'✓')]})]},_0x3ff01d[_0x184960(0x167)]))]}),_0x4d56ae==='selecting'&&_0x32fa48[_0x184960(0x164)]===0x0&&a8_0x29aa4c(Box,{'marginTop':0x1,'children':a8_0x29aa4c(Text,{'color':_0x184960(0x166),'children':'*\x20Sync\x20menus\x20to\x20Lovrabet\x20platform'})}),_0x32fa48[_0x184960(0x146)]((_0x4615d5,_0x27dbd4)=>a8_0x195ad6(Box,{'children':[a8_0x195ad6(Text,{'color':_0x184960(0x162),'children':['√\x20',_0x4615d5[_0x184960(0x148)],':\x20']}),a8_0x29aa4c(Text,{'color':_0x184960(0x166),'children':_0x4615d5[_0x184960(0x127)]})]},_0x27dbd4)),_0x385589&&_0x4d56ae===_0x184960(0x13b)&&a8_0x29aa4c(Box,{'marginTop':0x1,'children':a8_0x195ad6(Text,{'color':_0x184960(0x12a),'children':['✗\x20',_0x385589]})}),_0x4d56ae===_0x184960(0x13b)&&a8_0x29aa4c(a8_0x352d22,{'children':a8_0x195ad6(Box,{'marginTop':_0x32fa48[_0x184960(0x164)]>0x0||_0x385589?0x1:0x0,'flexDirection':'column','children':[a8_0x29aa4c(Text,{'bold':!![],'children':_0x184960(0x12c)}),_0x267b60[_0x184960(0x146)]((_0x40f4fd,_0x48ac25)=>{const _0x4b06c3=_0x184960,_0x43627c=_0x43f639===_0x48ac25,_0x15f7c1=_0x1aa4e8[_0x4b06c3(0x136)](_0x48ac25),_0x30f87e=_0x367a18['includes'](_0x40f4fd['path']),_0x8df9a6=_0x30f87e?_0x4b06c3(0x163):_0x4b06c3(0x168);return a8_0x29aa4c(Box,{'children':a8_0x195ad6(Text,{'backgroundColor':_0x43627c?_0x4b06c3(0x161):undefined,'color':_0x43627c?_0x4b06c3(0x15d):undefined,'children':['\x20\x20',_0x15f7c1?_0x4b06c3(0x15f):_0x4b06c3(0x158),'\x20',_0x40f4fd['label']]})},_0x40f4fd[_0x4b06c3(0x167)]);}),a8_0x29aa4c(Box,{'marginTop':0x1,'children':a8_0x29aa4c(Text,{'color':_0x184960(0x143),'children':'\x20↑/↓:\x20Move\x20\x20Space:\x20Toggle\x20\x20a:\x20All\x20\x20i/r:\x20Invert\x20\x20Enter:\x20Confirm'})})]})}),_0x4d56ae==='input-js'&&a8_0x195ad6(a8_0x352d22,{'children':[a8_0x195ad6(Box,{'children':[a8_0x29aa4c(Text,{'children':'*\x20JS\x20URL:\x20'}),a8_0x29aa4c(Text,{'color':_0x184960(0x162),'children':_0x290c0a}),_0x385589&&a8_0x195ad6(Text,{'color':'red','children':[_0x184960(0x144),_0x385589]})]}),!_0x385589&&a8_0x29aa4c(Box,{'children':a8_0x29aa4c(Text,{'color':_0x184960(0x143),'children':'\x20Enter\x20project\x20JS\x20asset\x20URL\x20(https://...)'})})]}),_0x4d56ae===_0x184960(0x14d)&&a8_0x195ad6(a8_0x352d22,{'children':[a8_0x195ad6(Box,{'children':[a8_0x29aa4c(Text,{'children':'*\x20CSS\x20URL:\x20'}),a8_0x29aa4c(Text,{'color':_0x184960(0x162),'children':_0x290c0a}),_0x385589&&a8_0x195ad6(Text,{'color':_0x184960(0x12a),'children':[_0x184960(0x144),_0x385589]})]}),!_0x385589&&a8_0x29aa4c(Box,{'children':a8_0x29aa4c(Text,{'color':'gray','children':_0x184960(0x138)})})]}),_0x4d56ae===_0x184960(0x160)&&a8_0x29aa4c(Box,{'children':a8_0x29aa4c(Text,{'children':'*\x20Creating\x20menus...'})}),_0x4d56ae===_0x184960(0x12e)&&a8_0x29aa4c(Box,{'children':a8_0x29aa4c(Text,{'color':_0x184960(0x162),'children':_0x184960(0x14b)})})]});}function getStringWidth(_0x3d6175){const _0x3b1a45=a8_0x136b;let _0x7b670b=0x0;for(const _0x3a25ae of _0x3d6175){/[\u4e00-\u9fa5]/[_0x3b1a45(0x152)](_0x3a25ae)?_0x7b670b+=0x2:_0x7b670b+=0x1;}return _0x7b670b;}function getRemainingSpaces(_0xc2436a,_0x11f27a){const _0xd9ac0f=a8_0x136b,_0x4e5d3f=getStringWidth(_0x11f27a);return Array(Math[_0xd9ac0f(0x126)](0x0,_0xc2436a-_0x4e5d3f))[_0xd9ac0f(0x132)]('\x20')[_0xd9ac0f(0x128)]('');}function getMaxWidth(_0x38092f,_0x4fa959=0x2){const _0x5016ee=a8_0x136b;let _0x5df4a7='',_0x34fc9d=0x0;for(const _0x36ee68 of _0x38092f){const _0x3d1bf8=getStringWidth(_0x36ee68);_0x3d1bf8>_0x34fc9d&&(_0x34fc9d=_0x3d1bf8,_0x5df4a7=_0x36ee68);}return _0x5df4a7+'\x20'[_0x5016ee(0x156)](_0x4fa959);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x39d0aa,_0x2821aa){const _0x190080=a9_0x2a74,_0x3af0b9=_0x39d0aa();while(!![]){try{const _0x35c4b9=-parseInt(_0x190080(0x180))/0x1+-parseInt(_0x190080(0x19d))/0x2*(-parseInt(_0x190080(0x179))/0x3)+parseInt(_0x190080(0x18d))/0x4*(parseInt(_0x190080(0x191))/0x5)+-parseInt(_0x190080(0x185))/0x6+parseInt(_0x190080(0x17a))/0x7+parseInt(_0x190080(0x18c))/0x8*(-parseInt(_0x190080(0x17c))/0x9)+parseInt(_0x190080(0x194))/0xa*(parseInt(_0x190080(0x1a8))/0xb);if(_0x35c4b9===_0x2821aa)break;else _0x3af0b9['push'](_0x3af0b9['shift']());}catch(_0x408fdc){_0x3af0b9['push'](_0x3af0b9['shift']());}}}(a9_0x4d30,0x97ac6));import{getCookie}from'../auth/get-cookie.js';function a9_0x2a74(_0x338aa0,_0x1d9412){_0x338aa0=_0x338aa0-0x178;const _0x4d304f=a9_0x4d30();let _0x2a74c0=_0x4d304f[_0x338aa0];return _0x2a74c0;}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a9_0x4d30(){const _0x255332=['38uWEDXm','error','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','create-menu','errorMsg','create-menus','application/json','stringify','success','data','info','1067dxhRpa','Auth\x20validation\x20failed.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','Failed\x20to\x20create\x20menu,\x20HTTP\x20status:\x20','163002zhtXWe','353521DXgoxr','\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>','1986651HJXqai','Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','json','label','128778atcyai','Creating\x20menu:\x20','appcode','resources','map','5617338FOjDSX','includes','length','all','status','Failed\x20to\x20create\x20menu:\x20','path','40bcYWfJ','20OccZgI','procode','import','Error','771730gZnetI','errorCode','\x20\x20\x201.\x20Specify\x20directly:\x20rabetbase\x20api\x20pull\x20<app-code>','96430UgmKgk','0011','/smartapi/menu/create','POST','Menu\x20created\x20successfully:','Start\x20batch\x20menu\x20creation,\x20total\x20','log','!\x20Please\x20use\x20one\x20of\x20the\x20following:','Batch\x20menu\x20creation\x20completed,\x20total\x20'];a9_0x4d30=function(){return _0x255332;};return a9_0x4d30();}import{logger}from'../utils/logger.js';const config=readConfig();export async function createMenu(_0x1319f0){const _0xe99fae=a9_0x2a74,_0x54498c=config?.[_0xe99fae(0x182)];if(!_0x54498c){const _0x27e2cd=_0xe99fae(0x19f);logger['error'](_0xe99fae(0x1a0),_0x27e2cd),console[_0xe99fae(0x19e)]('×\x20'+_0x27e2cd),console['log'](_0xe99fae(0x19b)),console[_0xe99fae(0x19a)](_0xe99fae(0x193)),console[_0xe99fae(0x19a)](_0xe99fae(0x17b));return;}logger['info']('create-menu',_0xe99fae(0x181)+_0x1319f0['label']+'\x20('+_0x1319f0['path']+')');const _0x136ea8={'appCode':_0x54498c,'type':_0xe99fae(0x18e),'sort':0x0,'extend':{'loadScriptMode':_0xe99fae(0x18f),'resources':_0x1319f0[_0xe99fae(0x183)]?JSON[_0xe99fae(0x1a4)](_0x1319f0[_0xe99fae(0x183)]):undefined},..._0x1319f0},_0x357528=await fetch(getApiDomain()+_0xe99fae(0x196),{'method':_0xe99fae(0x197),'body':JSON[_0xe99fae(0x1a4)](_0x136ea8),'headers':{'Content-Type':_0xe99fae(0x1a3),'Cookie':getCookie()}});if(!_0x357528['ok']){if(_0x357528[_0xe99fae(0x189)]===0x191){const _0x1aa58a=_0xe99fae(0x17d);logger[_0xe99fae(0x19e)](_0xe99fae(0x1a0),_0x1aa58a,{'status':_0x357528[_0xe99fae(0x189)],'menu':_0x1319f0[_0xe99fae(0x17f)]});throw new Error(_0x1aa58a);}const _0x4ae7b0=_0xe99fae(0x178)+_0x357528[_0xe99fae(0x189)];logger['error'](_0xe99fae(0x1a0),_0x4ae7b0,{'menu':_0x1319f0[_0xe99fae(0x17f)]});throw new Error(_0x4ae7b0);}const _0x435f72=await _0x357528[_0xe99fae(0x17e)]();if(!_0x435f72['success']){const _0x5c2a59='Failed\x20to\x20create\x20menu:\x20'+(_0x435f72[_0xe99fae(0x1a1)]||_0xe99fae(0x190));logger['error'](_0xe99fae(0x1a0),_0x5c2a59,{'errorCode':_0x435f72['errorCode'],'errorMsg':_0x435f72[_0xe99fae(0x1a1)],'menu':_0x1319f0[_0xe99fae(0x17f)]});throw new Error(_0x5c2a59);}logger[_0xe99fae(0x1a7)](_0xe99fae(0x1a0),_0xe99fae(0x198)+_0x1319f0[_0xe99fae(0x17f)],_0x435f72[_0xe99fae(0x1a6)]),console[_0xe99fae(0x19a)](_0xe99fae(0x198),_0x435f72[_0xe99fae(0x1a6)]);}async function _createMenu(_0x1b3b04,_0x22f5ee){const _0x28345d=a9_0x2a74,_0x489be8=config?.['appcode'];if(!_0x489be8){const _0x5151be=_0x28345d(0x19f);logger[_0x28345d(0x19e)]('create-menu',_0x5151be),console[_0x28345d(0x19e)]('×\x20'+_0x5151be),console[_0x28345d(0x19a)](_0x28345d(0x19b)),console[_0x28345d(0x19a)](_0x28345d(0x193)),console[_0x28345d(0x19a)](_0x28345d(0x17b));return;}const _0x20a3fa={'appCode':_0x489be8,'type':_0x28345d(0x18e),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x22f5ee?JSON[_0x28345d(0x1a4)](_0x22f5ee):undefined},'label':_0x1b3b04[_0x28345d(0x17f)],'path':_0x1b3b04[_0x28345d(0x18b)]},_0x35b923=await fetch(getApiDomain()+_0x28345d(0x196),{'method':_0x28345d(0x197),'body':JSON[_0x28345d(0x1a4)](_0x20a3fa),'headers':{'Content-Type':_0x28345d(0x1a3),'Cookie':getCookie()}});if(!_0x35b923['ok']){if(_0x35b923[_0x28345d(0x189)]===0x191){const _0xf5c09a='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger[_0x28345d(0x19e)]('create-menu',_0xf5c09a,{'status':_0x35b923['status'],'menu':_0x1b3b04[_0x28345d(0x17f)]});throw new Error(_0xf5c09a);}const _0x20c83b=_0x28345d(0x178)+_0x35b923[_0x28345d(0x189)];logger['error'](_0x28345d(0x1a0),_0x20c83b,{'menu':_0x1b3b04[_0x28345d(0x17f)]});throw new Error(_0x20c83b);}const _0x2b161d=await _0x35b923['json']();if(!_0x2b161d[_0x28345d(0x1a5)]){if(_0x2b161d[_0x28345d(0x192)]===_0x28345d(0x195)||_0x2b161d[_0x28345d(0x1a1)]?.[_0x28345d(0x186)]('登录')){const _0x574f53=_0x28345d(0x1a9);logger[_0x28345d(0x19e)](_0x28345d(0x1a0),_0x574f53,{'errorCode':_0x2b161d[_0x28345d(0x192)],'errorMsg':_0x2b161d[_0x28345d(0x1a1)],'menu':_0x1b3b04['label']});throw new Error(_0x574f53);}const _0x2a3761=_0x28345d(0x18a)+(_0x2b161d['errorMsg']||_0x28345d(0x190));logger['error'](_0x28345d(0x1a0),_0x2a3761,{'errorCode':_0x2b161d[_0x28345d(0x192)],'errorMsg':_0x2b161d[_0x28345d(0x1a1)],'menu':_0x1b3b04[_0x28345d(0x17f)]});throw new Error(_0x2a3761);}logger[_0x28345d(0x1a7)](_0x28345d(0x1a0),_0x28345d(0x198)+_0x1b3b04[_0x28345d(0x17f)]);}export async function createMenus(_0x173db0,_0x48b02b){const _0x5ee646=a9_0x2a74;logger['info'](_0x5ee646(0x1a2),_0x5ee646(0x199)+_0x173db0[_0x5ee646(0x187)]),await Promise[_0x5ee646(0x188)](_0x173db0[_0x5ee646(0x184)](async _0x373bcb=>{await _createMenu(_0x373bcb,_0x48b02b);})),logger[_0x5ee646(0x1a7)]('create-menus',_0x5ee646(0x19c)+_0x173db0[_0x5ee646(0x187)]);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4c78db,_0x3d9e95){const _0x20f8b4=a10_0x1f8c,_0x465e20=_0x4c78db();while(!![]){try{const _0x3d159d=-parseInt(_0x20f8b4(0x9d))/0x1+parseInt(_0x20f8b4(0xa4))/0x2+-parseInt(_0x20f8b4(0x9a))/0x3+-parseInt(_0x20f8b4(0x9e))/0x4*(parseInt(_0x20f8b4(0xa8))/0x5)+parseInt(_0x20f8b4(0xa1))/0x6+parseInt(_0x20f8b4(0xa0))/0x7*(parseInt(_0x20f8b4(0xa9))/0x8)+-parseInt(_0x20f8b4(0x9b))/0x9;if(_0x3d159d===_0x3d9e95)break;else _0x465e20['push'](_0x465e20['shift']());}catch(_0x5cbf33){_0x465e20['push'](_0x465e20['shift']());}}}(a10_0x7a72,0x77514));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';function a10_0x1f8c(_0x3f2093,_0x1ff9ac){_0x3f2093=_0x3f2093-0x98;const _0x7a7216=a10_0x7a72();let _0x1f8c45=_0x7a7216[_0x3f2093];return _0x1f8c45;}function a10_0x7a72(){const _0x740c4c=['.tsx','310035dWKFZG','380TsGdgE','isDirectory','158795YTlWpe','3281400mTdqLe','trim','push','1553782bZZQVq','match','endsWith','filter','14470pjPYFG','296DWlGFp','replace','slice','forEach','2818956GDgYIi','1348155YQPNDA'];a10_0x7a72=function(){return _0x740c4c;};return a10_0x7a72();}const pagesDir=resolve(process['cwd'](),'src/pages');export function extractTitleFromComment(_0x806f20){const _0x18673a=a10_0x1f8c;try{const _0x3e557b=readFileSync(_0x806f20,'utf-8'),_0x3f7cc5=_0x3e557b['match'](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x3f7cc5&&_0x3f7cc5[0x1]){const _0x2dbc88=_0x3f7cc5[0x1],_0x4f43d4=_0x2dbc88[_0x18673a(0xa5)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x4f43d4&&_0x4f43d4[0x1])return _0x4f43d4[0x1][_0x18673a(0xa2)]();}let _0x1c9123=null;const _0x508f00=_0x3e557b['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x508f00&&_0x508f00[0x1]&&(_0x1c9123=_0x508f00[0x1]);if(!_0x1c9123){const _0x439a5d=_0x3e557b['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x439a5d&&_0x439a5d[0x1]&&(_0x1c9123=_0x439a5d[0x1]);}if(_0x1c9123){const _0x14a93d=new RegExp('\x5cb'+_0x1c9123+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x3d1230=_0x3e557b[_0x18673a(0xa5)](_0x14a93d);if(_0x3d1230&&_0x3d1230[0x1])return _0x3d1230[0x1];return _0x1c9123;}return null;}catch(_0x3b39ec){return null;}}export function getLocalPages(_0x42087f=pagesDir,_0x33b895=pagesDir){const _0x1f44e8=a10_0x1f8c;let _0x9669b0=[];const _0x3317fc=readdirSync(_0x42087f);return _0x3317fc[_0x1f44e8(0x99)](_0x3e2f86=>{const _0x2e7515=_0x1f44e8,_0x53f98a=join(_0x42087f,_0x3e2f86),_0xcc2083=statSync(_0x53f98a);if(_0xcc2083&&_0xcc2083[_0x2e7515(0x9f)]())_0x9669b0=_0x9669b0['concat'](getLocalPages(_0x53f98a,_0x33b895));else{if(_0x3e2f86['endsWith'](_0x2e7515(0x9c))){let _0x17c39a=relative(_0x33b895,_0x53f98a);_0x17c39a[_0x2e7515(0xa6)]('index.tsx')?_0x17c39a=_0x17c39a[_0x2e7515(0xaa)](/index\.tsx$/,''):_0x17c39a=_0x17c39a['replace'](/\.tsx$/,'');_0x17c39a[_0x2e7515(0xa6)]('/')&&(_0x17c39a=_0x17c39a[_0x2e7515(0x98)](0x0,-0x1));const _0x8ac52e=extractTitleFromComment(_0x53f98a),_0x20bd5b=_0x8ac52e||_0x17c39a;_0x9669b0[_0x2e7515(0xa3)]({'path':_0x17c39a['replaceAll']('$',':'),'label':_0x20bd5b});}}}),_0x9669b0[_0x1f44e8(0xa7)](_0x369c4b=>_0x369c4b['path']!=='');}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3ba76a,_0xfcca35){const _0x518fd4=a11_0x2f7b,_0x10b473=_0x3ba76a();while(!![]){try{const _0x5931e3=parseInt(_0x518fd4(0x8c))/0x1+parseInt(_0x518fd4(0x7d))/0x2*(-parseInt(_0x518fd4(0x82))/0x3)+-parseInt(_0x518fd4(0x97))/0x4+-parseInt(_0x518fd4(0x91))/0x5*(-parseInt(_0x518fd4(0x8e))/0x6)+-parseInt(_0x518fd4(0x83))/0x7+-parseInt(_0x518fd4(0x70))/0x8*(-parseInt(_0x518fd4(0x8a))/0x9)+parseInt(_0x518fd4(0x79))/0xa;if(_0x5931e3===_0xfcca35)break;else _0x10b473['push'](_0x10b473['shift']());}catch(_0x4ebb43){_0x10b473['push'](_0x10b473['shift']());}}}(a11_0x7d7e,0x6cdf0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a11_0x7d7e(){const _0x2eada6=['extend','data','130OMNReR','length','GET','isArray','\x20\x20\x201.\x20Specify\x20directly:\x20rabetbase\x20api\x20pull\x20<app-code>','flat','980400nufvKO','online','520yiEYkb','Failed\x20to\x20fetch\x20menu\x20list,\x20HTTP\x20status:\x20','info','push','json','\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>','resources','log','appcode','17287430yHNtam','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','error','Error','2AYLuMs','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Server\x20returned\x20empty\x20menu\x20list','label','!\x20Please\x20use\x20one\x20of\x20the\x20following:','2672130GdZVmo','5365416rRnYDK','map','Failed\x20to\x20fetch\x20menu\x20list:\x20','success','status','/smartapi/menu/find?appCode=','parse','1233EtBUlE','application/json','484902LFppdV','get-online-menu-list','29004PtkgEq'];a11_0x7d7e=function(){return _0x2eada6;};return a11_0x7d7e();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';const config=readConfig();export async function getOnlineMenuList(){const _0x1d4948=a11_0x2f7b,_0x42a0c2=config?.[_0x1d4948(0x78)];if(!_0x42a0c2){const _0x1dc152=_0x1d4948(0x7a);return logger[_0x1d4948(0x7b)](_0x1d4948(0x8d),_0x1dc152),console[_0x1d4948(0x7b)]('×\x20'+_0x1dc152),console['log'](_0x1d4948(0x81)),console[_0x1d4948(0x77)](_0x1d4948(0x95)),console[_0x1d4948(0x77)](_0x1d4948(0x75)),[];}const _0xf8a5f8=getEnv();logger[_0x1d4948(0x72)](_0x1d4948(0x8d),_0xf8a5f8===_0x1d4948(0x98)?_0x1d4948(0x7e)+_0x42a0c2+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x42a0c2+')');const _0x25e769=await fetch(getApiDomain()+_0x1d4948(0x88)+_0x42a0c2,{'method':_0x1d4948(0x93),'headers':{'Content-Type':_0x1d4948(0x8b),'Cookie':getCookie()}});if(!_0x25e769['ok']){if(_0x25e769['status']===0x191){const _0x3901bd='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger[_0x1d4948(0x7b)]('get-online-menu-list',_0x3901bd,{'status':_0x25e769['status']});throw new Error(_0x3901bd);}const _0x1d4ce1=_0x1d4948(0x71)+_0x25e769[_0x1d4948(0x87)];logger[_0x1d4948(0x7b)](_0x1d4948(0x8d),_0x1d4ce1);throw new Error(_0x1d4ce1);}const _0x5506e0=await _0x25e769[_0x1d4948(0x74)]();if(!_0x5506e0[_0x1d4948(0x86)]){const _0x5c475b=_0x1d4948(0x85)+(_0x5506e0['errorMsg']||_0x1d4948(0x7c));logger['error'](_0x1d4948(0x8d),_0x5c475b,{'errorCode':_0x5506e0['errorCode'],'errorMsg':_0x5506e0['errorMsg']});throw new Error(_0x5c475b);}if(!_0x5506e0['data'])return logger[_0x1d4948(0x72)](_0x1d4948(0x8d),_0x1d4948(0x7f)),[];return logger[_0x1d4948(0x72)](_0x1d4948(0x8d),'Fetched\x20'+_0x5506e0['data'][_0x1d4948(0x92)]+'\x20online\x20menus\x20successfully'),_0x5506e0[_0x1d4948(0x90)][_0x1d4948(0x84)](formatMenuList)[_0x1d4948(0x96)]();}function a11_0x2f7b(_0x1ade4a,_0x366fe4){_0x1ade4a=_0x1ade4a-0x70;const _0x7d7ea=a11_0x7d7e();let _0x2f7b84=_0x7d7ea[_0x1ade4a];return _0x2f7b84;}function formatMenuList(_0x46916c){const _0x824e6c=a11_0x2f7b;let _0x2b185f=[];try{if(_0x46916c[_0x824e6c(0x8f)]?.['resources']){const _0x3a2756=JSON[_0x824e6c(0x89)](_0x46916c[_0x824e6c(0x8f)][_0x824e6c(0x76)]);Array[_0x824e6c(0x94)](_0x3a2756)&&(_0x2b185f=_0x3a2756);}}catch(_0xc6c44d){}const _0x15e39b=[{'id':_0x46916c['id'],'path':_0x46916c['path'],'label':_0x46916c[_0x824e6c(0x80)],'resources':_0x2b185f}];if(_0x46916c['children']&&_0x46916c['children']['length']>0x0)for(const _0xe61793 of _0x46916c['children']){_0x15e39b[_0x824e6c(0x73)](...formatMenuList(_0xe61793));}return _0x15e39b;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3106d6,_0x539f10){const _0x8d4cb=a13_0x1bfb,_0x4098ee=_0x3106d6();while(!![]){try{const _0x47084d=parseInt(_0x8d4cb(0x106))/0x1*(-parseInt(_0x8d4cb(0x104))/0x2)+-parseInt(_0x8d4cb(0x10d))/0x3+parseInt(_0x8d4cb(0x10c))/0x4*(-parseInt(_0x8d4cb(0x101))/0x5)+-parseInt(_0x8d4cb(0x10a))/0x6*(parseInt(_0x8d4cb(0x105))/0x7)+parseInt(_0x8d4cb(0x10f))/0x8+parseInt(_0x8d4cb(0x10b))/0x9*(parseInt(_0x8d4cb(0x109))/0xa)+parseInt(_0x8d4cb(0x108))/0xb;if(_0x47084d===_0x539f10)break;else _0x4098ee['push'](_0x4098ee['shift']());}catch(_0x3a4778){_0x4098ee['push'](_0x4098ee['shift']());}}}(a13_0x5349,0x547bc));import{useEffect,useState}from'react';function a13_0x1bfb(_0x1e0d2d,_0x2ed1f7){_0x1e0d2d=_0x1e0d2d-0x101;const _0x5349cc=a13_0x5349();let _0x1bfb6c=_0x5349cc[_0x1e0d2d];return _0x1bfb6c;}function a13_0x5349(){const _0x122b76=['91dXBEeI','1OSMIgW','finally','11469348bdlcDF','87790mqgQJC','205692YntlJg','180wOfzRn','4QkzFFl','548931FNLJoA','Failed\x20to\x20fetch\x20menu\x20list:\x20Error','4159344tJElDU','2900805MMAoWG','catch','message','366636XTsUoh'];a13_0x5349=function(){return _0x122b76;};return a13_0x5349();}import{getOnlineMenuList}from'./get-online-menu-list.js';export function useGetOnlineMenuList(){const [_0x49472d,_0x45f781]=useState([]),[_0x9810a7,_0x40e3ba]=useState(!![]),[_0x263cfb,_0x57178b]=useState('');return useEffect(()=>{const _0x4345d6=a13_0x1bfb;_0x40e3ba(!![]),_0x57178b(''),getOnlineMenuList()['then'](_0x45f781)[_0x4345d6(0x102)](_0x2e1e64=>{const _0xdacd78=_0x4345d6;_0x57178b(_0x2e1e64[_0xdacd78(0x103)]||_0xdacd78(0x10e));})[_0x4345d6(0x107)](()=>_0x40e3ba(![]));},[]),{'menuList':_0x49472d,'loading':_0x9810a7,'error':_0x263cfb};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x29b540,_0x4bae3c){const _0x2f471e=a14_0x5273,_0x4e63ad=_0x29b540();while(!![]){try{const _0x19b11f=-parseInt(_0x2f471e(0x185))/0x1*(-parseInt(_0x2f471e(0x182))/0x2)+-parseInt(_0x2f471e(0x17c))/0x3+parseInt(_0x2f471e(0x180))/0x4*(parseInt(_0x2f471e(0x17a))/0x5)+parseInt(_0x2f471e(0x176))/0x6+-parseInt(_0x2f471e(0x184))/0x7+parseInt(_0x2f471e(0x183))/0x8*(-parseInt(_0x2f471e(0x17b))/0x9)+parseInt(_0x2f471e(0x17e))/0xa*(parseInt(_0x2f471e(0x17f))/0xb);if(_0x19b11f===_0x4bae3c)break;else _0x4e63ad['push'](_0x4e63ad['shift']());}catch(_0x290bd8){_0x4e63ad['push'](_0x4e63ad['shift']());}}}(a14_0xacd3,0x4f202));export function getRemainingSpaces(_0x567bf4,_0x2d36a1){const _0x190676=a14_0x5273,_0x4ff277=getStringWidth(_0x2d36a1);return Array(Math[_0x190676(0x17d)](0x0,_0x567bf4-_0x4ff277))[_0x190676(0x178)]('\x20')[_0x190676(0x177)]('');}function a14_0xacd3(){const _0x352f99=['2678949KERoIM','20441DfLqwA','2047782TXqcNb','join','fill','test','95LZzIeI','49482EKTosF','295767fMHZPw','max','1270JwRQwi','62117hRttcj','23768XVsqsO','repeat','4UoYuFi','592JzTCRI'];a14_0xacd3=function(){return _0x352f99;};return a14_0xacd3();}export function getMaxWidth(_0x600698,_0x25e392=0x2){const _0x4a56cc=a14_0x5273;let _0x3e5d73='',_0xa9ce08=0x0;for(const _0x1ece7d of _0x600698){const _0x354f1e=getStringWidth(_0x1ece7d);_0x354f1e>_0xa9ce08&&(_0xa9ce08=_0x354f1e,_0x3e5d73=_0x1ece7d);}return _0x3e5d73+'\x20'[_0x4a56cc(0x181)](_0x25e392);}function a14_0x5273(_0xfa1a28,_0x1b2faf){_0xfa1a28=_0xfa1a28-0x176;const _0xacd39=a14_0xacd3();let _0x5273c2=_0xacd39[_0xfa1a28];return _0x5273c2;}export function getStringWidth(_0x5626d2){const _0x438ccf=a14_0x5273;let _0x504116=0x0;for(const _0x37b5fd of _0x5626d2){/[\u4e00-\u9fa5]/[_0x438ccf(0x179)](_0x37b5fd)?_0x504116+=0x2:_0x504116+=0x1;}return _0x504116;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a15_0x2e20(){const _0x56bc13=['12336RHmWbJ','90050HKylHI','189682ZewwVI','1741985gvuKhX','2254596PsRNUv','55JVtTMr','HEAD','137008eCIziK','412792CESneR','test','8yEIxll','1685LRrYJo','trim','9dBYQAS'];a15_0x2e20=function(){return _0x56bc13;};return a15_0x2e20();}function a15_0x5b32(_0x475893,_0x3bfc04){_0x475893=_0x475893-0x7b;const _0x2e206e=a15_0x2e20();let _0x5b32de=_0x2e206e[_0x475893];return _0x5b32de;}(function(_0x5c5ab2,_0x4dea8e){const _0x57a0fa=a15_0x5b32,_0x54b046=_0x5c5ab2();while(!![]){try{const _0x140843=parseInt(_0x57a0fa(0x86))/0x1*(-parseInt(_0x57a0fa(0x80))/0x2)+parseInt(_0x57a0fa(0x88))/0x3+parseInt(_0x57a0fa(0x7d))/0x4+-parseInt(_0x57a0fa(0x81))/0x5*(-parseInt(_0x57a0fa(0x84))/0x6)+-parseInt(_0x57a0fa(0x87))/0x7+-parseInt(_0x57a0fa(0x7e))/0x8*(parseInt(_0x57a0fa(0x83))/0x9)+parseInt(_0x57a0fa(0x85))/0xa*(parseInt(_0x57a0fa(0x7b))/0xb);if(_0x140843===_0x4dea8e)break;else _0x54b046['push'](_0x54b046['shift']());}catch(_0x3161ad){_0x54b046['push'](_0x54b046['shift']());}}}(a15_0x2e20,0x71673));export function isValidJsHttpsUrl(_0x202c16){const _0x19f8d0=a15_0x5b32;return/^https:\/\/.+\.js(\?.*)?$/[_0x19f8d0(0x7f)](_0x202c16[_0x19f8d0(0x82)]());}export function isValidCssHttpsUrl(_0x45defe){const _0xbb03ec=a15_0x5b32;return/^https:\/\/.+\.css(\?.*)?$/[_0xbb03ec(0x7f)](_0x45defe[_0xbb03ec(0x82)]());}export async function isUrlReachable(_0x22d1a0){const _0xa9b68a=a15_0x5b32;try{const _0xf12e82=await fetch(_0x22d1a0,{'method':_0xa9b68a(0x7c)});return _0xf12e82['ok'];}catch{return![];}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a16_0x63a6(){const _0x33383f=['*\x20Menus\x20and\x20asset\x20links\x20to\x20update','2101050cuPiQi','resources','2172254aiqxSB','779931USHShC','164480iudjKB','12yzUWGR','join','filter','cyan','2730bvJAIc','column','length','21258XRXYcr','map','32CqPYMq','6014575uiZhxy','Asset\x20links\x20to\x20update:','416194MZuBwq','Menus\x20to\x20update:'];a16_0x63a6=function(){return _0x33383f;};return a16_0x63a6();}(function(_0x44fd50,_0x386719){const _0x184918=a16_0x2633,_0x40a0b3=_0x44fd50();while(!![]){try{const _0x31a05e=-parseInt(_0x184918(0xad))/0x1+parseInt(_0x184918(0xb4))/0x2+parseInt(_0x184918(0xb3))/0x3*(parseInt(_0x184918(0xb5))/0x4)+-parseInt(_0x184918(0xbf))/0x5+-parseInt(_0x184918(0xb0))/0x6+-parseInt(_0x184918(0xb2))/0x7*(-parseInt(_0x184918(0xbe))/0x8)+-parseInt(_0x184918(0xbc))/0x9*(-parseInt(_0x184918(0xb9))/0xa);if(_0x31a05e===_0x386719)break;else _0x40a0b3['push'](_0x40a0b3['shift']());}catch(_0x199c85){_0x40a0b3['push'](_0x40a0b3['shift']());}}}(a16_0x63a6,0xbe2f9));function a16_0x2633(_0xd0784b,_0x7715ee){_0xd0784b=_0xd0784b-0xad;const _0x63a688=a16_0x63a6();let _0x26332e=_0x63a688[_0xd0784b];return _0x26332e;}import{jsx as a16_0x1ead2c,jsxs as a16_0x1d9d4d}from'react/jsx-runtime';import{Text,Box}from'ink';export function CurrentMenuCdnContent(_0x1d1743){const _0x9185e=a16_0x2633,{menuList:_0x1aa56e}=_0x1d1743,_0x2de395=_0x1aa56e[_0x9185e(0xb7)](_0x37143e=>_0x37143e[_0x9185e(0xb1)][_0x9185e(0xbb)]),_0x243f20=Array['from'](new Set(_0x1aa56e[_0x9185e(0xbd)](_0x6239cf=>_0x6239cf['resources'])['flat']()));return a16_0x1d9d4d(Box,{'flexDirection':'column','children':[a16_0x1ead2c(Text,{'color':_0x9185e(0xb8),'children':_0x9185e(0xaf)}),a16_0x1d9d4d(Box,{'marginTop':0x1,'flexDirection':_0x9185e(0xba),'children':[a16_0x1d9d4d(Text,{'bold':!![],'children':['\x20\x20',_0x9185e(0xae)]}),a16_0x1d9d4d(Text,{'children':['\x20\x20',_0x2de395[_0x9185e(0xbd)](_0x1a0e85=>_0x1a0e85['label'])[_0x9185e(0xb6)](',\x20')]})]}),a16_0x1ead2c(Box,{'marginTop':0x1,'children':a16_0x1d9d4d(Text,{'bold':!![],'children':['\x20\x20',_0x9185e(0xc0)]})}),_0x243f20[_0x9185e(0xbd)](_0x2b8d49=>a16_0x1ead2c(Box,{'children':a16_0x1d9d4d(Text,{'children':['\x20\x20',_0x2b8d49]})},_0x2b8d49))]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x180ebb,_0x3b31ce){const _0x340723=a17_0x247e,_0x406de7=_0x180ebb();while(!![]){try{const _0x553d4d=parseInt(_0x340723(0x195))/0x1+parseInt(_0x340723(0x190))/0x2*(-parseInt(_0x340723(0x18d))/0x3)+parseInt(_0x340723(0x189))/0x4*(-parseInt(_0x340723(0x193))/0x5)+-parseInt(_0x340723(0x18c))/0x6+parseInt(_0x340723(0x18e))/0x7+-parseInt(_0x340723(0x18f))/0x8+parseInt(_0x340723(0x18a))/0x9*(parseInt(_0x340723(0x191))/0xa);if(_0x553d4d===_0x3b31ce)break;else _0x406de7['push'](_0x406de7['shift']());}catch(_0x198a95){_0x406de7['push'](_0x406de7['shift']());}}}(a17_0x82f3,0x54bb9));function a17_0x247e(_0x342d41,_0x5703bf){_0x342d41=_0x342d41-0x189;const _0x82f308=a17_0x82f3();let _0x247ed1=_0x82f308[_0x342d41];return _0x247ed1;}import{jsx as a17_0x54804d,jsxs as a17_0x160932}from'react/jsx-runtime';function a17_0x82f3(){const _0x524d9b=['479676sdsxtY','257214kqzxqM','2371187jJLwwK','1333032OrvuYw','6tnGIhS','20abedko','green','5cwRlwy','cyan','183844eECFsb','578212hWvctf','2127699esEEfL','JS\x20URL:\x20'];a17_0x82f3=function(){return _0x524d9b;};return a17_0x82f3();}import{Text,Box}from'ink';export function InputCdnAsset(_0x4804e8){const _0x5b08e4=a17_0x247e,{jsCdnUrl:_0xbb24ca,cssCdnUrl:_0x16874f}=_0x4804e8;return a17_0x160932(Box,{'flexDirection':'column','marginTop':0x1,'children':[a17_0x54804d(Text,{'color':_0x5b08e4(0x194),'children':'*\x20Entered\x20asset\x20URLs'}),a17_0x160932(Box,{'children':[a17_0x160932(Text,{'children':['\x20\x20',_0x5b08e4(0x18b)]}),a17_0x54804d(Text,{'color':_0x5b08e4(0x192),'children':_0xbb24ca})]}),a17_0x160932(Box,{'children':[a17_0x160932(Text,{'children':['\x20\x20','CSS\x20URL:\x20']}),a17_0x54804d(Text,{'color':'green','children':_0x16874f})]})]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x465bc4,_0xa27090){const _0x318478=a18_0x29ee,_0x3ca415=_0x465bc4();while(!![]){try{const _0x306775=parseInt(_0x318478(0xea))/0x1*(parseInt(_0x318478(0x100))/0x2)+parseInt(_0x318478(0x116))/0x3*(parseInt(_0x318478(0xf4))/0x4)+-parseInt(_0x318478(0x10e))/0x5*(parseInt(_0x318478(0xfb))/0x6)+parseInt(_0x318478(0xe9))/0x7+parseInt(_0x318478(0x101))/0x8+parseInt(_0x318478(0x115))/0x9+parseInt(_0x318478(0xfd))/0xa*(-parseInt(_0x318478(0xed))/0xb);if(_0x306775===_0xa27090)break;else _0x3ca415['push'](_0x3ca415['shift']());}catch(_0x5826c4){_0x3ca415['push'](_0x3ca415['shift']());}}}(a18_0xc3d3,0x26cbd));import{jsx as a18_0x5b3efd,jsxs as a18_0x57250a,Fragment as a18_0x854b00}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a18_0x29ee(_0x34a0cd,_0x311244){_0x34a0cd=_0x34a0cd-0xe7;const _0xc3d32f=a18_0xc3d3();let _0x29ee1c=_0xc3d32f[_0x34a0cd];return _0x29ee1c;}function a18_0xc3d3(){const _0x18fad4=['return','cyan','gray','label','input-css','red','trim','value','backspace','90OkOHVe','green','map','Continue\x20update','slice','cancel','Please\x20enter\x20a\x20valid\x20CSS\x20https\x20URL','2542590ystYoM','135juZwDJ','column','updated','1864422rbsher','887nPmOqt','need-confirm','dots','11hnlDAI','CSS\x20URL:\x20','\x20Assets\x20are\x20syncing...','all','\x20←\x20','input-js','Enter\x20project\x20CSS\x20asset\x20URL\x20(https://...)','1736NITBtw','JS\x20URL:\x20','Please\x20enter\x20a\x20valid\x20JS\x20https\x20URL','yellow','length','resources','upArrow','91830cpTtRZ','delete','3044200mpdNca','creating','\x20command\x20to\x20re-login','382qVqFPo','8128uWDdbJ','flat','√\x20Updated\x20successfully','Cancel\x20update'];a18_0xc3d3=function(){return _0x18fad4;};return a18_0xc3d3();}import a18_0x1c7254 from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import.meta.main&&render(a18_0x5b3efd(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x5c13cb=a18_0x29ee,{exit:_0x424886}=useApp(),{loading:_0x55c193,menuList:_0x1f6a66,error:_0x2147af}=useGetOnlineMenuList(),[_0x369b35,_0x556635]=useState('ok'),[_0x3689f0,_0x486996]=useState('input-js'),[_0x2ec9ea,_0x3d5077]=useState(''),[_0x30f7a6,_0x1f61b5]=useState(''),[_0x596e8f,_0x15d600]=useState(''),[_0x331dc2,_0x11d546]=useState(''),_0xede7fb=Array['from'](new Set(_0x1f6a66[_0x5c13cb(0x110)](_0x42b153=>_0x42b153[_0x5c13cb(0xf9)])[_0x5c13cb(0x102)]()));useEffect(()=>{const _0x4c9f69=_0x5c13cb;_0x3689f0===_0x4c9f69(0xe8)&&setTimeout(_0x424886,0x32);},[_0x3689f0]),useInput(async(_0x1377c7,_0x41046e)=>{const _0x198974=_0x5c13cb;if(_0x3689f0===_0x198974(0xf2)){if(_0x41046e['return']){const _0x56056b=_0x596e8f[_0x198974(0x10b)]();if(_0x56056b==='')return;if(!isValidJsHttpsUrl(_0x56056b)){_0x11d546(_0x198974(0xf6));return;}if(!await isUrlReachable(_0x56056b)){_0x11d546('JS\x20URL\x20is\x20unreachable');return;}_0x3d5077(_0x56056b),_0x15d600(''),_0x11d546(''),_0x486996(_0x198974(0x109));return;}if(_0x41046e[_0x198974(0x10d)]||_0x41046e[_0x198974(0xfc)]){_0x15d600(_0x3dfb9b=>_0x3dfb9b[_0x198974(0x112)](0x0,-0x1)),_0x11d546('');return;}_0x15d600(_0x268279=>_0x268279+_0x1377c7);return;}if(_0x3689f0==='input-css'){if(_0x41046e[_0x198974(0x105)]){const _0x563301=_0x596e8f[_0x198974(0x10b)]();if(_0x563301==='')return;if(!isValidCssHttpsUrl(_0x563301)){_0x11d546(_0x198974(0x114));return;}if(!await isUrlReachable(_0x563301)){_0x11d546('CSS\x20URL\x20is\x20unreachable');return;}_0x1f61b5(_0x563301),_0x15d600(''),_0x11d546(''),_0x486996(_0x198974(0xeb));return;}if(_0x41046e[_0x198974(0x10d)]||_0x41046e['delete']){_0x15d600(_0x133a4b=>_0x133a4b[_0x198974(0x112)](0x0,-0x1)),_0x11d546('');return;}_0x15d600(_0x21240e=>_0x21240e+_0x1377c7);return;}if(_0x3689f0===_0x198974(0xeb)){(_0x41046e[_0x198974(0xfa)]||_0x41046e['downArrow']||_0x41046e['leftArrow']||_0x41046e['rightArrow'])&&_0x556635(_0x11a79a=>_0x11a79a==='ok'?'cancel':'ok');if(_0x41046e[_0x198974(0x105)]){_0x486996(_0x198974(0xfe));if(_0x369b35==='ok')await Promise[_0x198974(0xf0)](_0x1f6a66[_0x198974(0x110)](_0x539db4=>{const _0x417f81=_0x198974,_0x45c4e4={'id':_0x539db4['id'],'label':_0x539db4['label'],'path':_0x539db4['path'],'resources':[_0x2ec9ea,_0x30f7a6]};if(_0x539db4[_0x417f81(0xf9)]['length']===0x0)return Promise['resolve']();return updateMenuCdnUrl(_0x45c4e4);})),await new Promise(_0x480a56=>setTimeout(_0x480a56,0x3e8)),_0x486996(_0x198974(0xe8));else _0x369b35===_0x198974(0x113)&&_0x424886();}}});if(_0x55c193)return a18_0x57250a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x5b3efd(Text,{}),a18_0x5b3efd(a18_0x1c7254,{'type':_0x5c13cb(0xec)}),a18_0x5b3efd(Text,{'children':'\x20Fetching\x20online\x20menu\x20asset\x20links...'})]});if(_0x2147af)return a18_0x57250a(Box,{'flexDirection':_0x5c13cb(0xe7),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x57250a(Text,{'color':_0x5c13cb(0x10a),'children':['✗\x20',_0x2147af]}),a18_0x57250a(Box,{'marginTop':0x1,'children':[a18_0x5b3efd(Text,{'color':_0x5c13cb(0x107),'children':'Hint:\x20use\x20'}),a18_0x5b3efd(Text,{'color':_0x5c13cb(0x106),'children':'rabetbase\x20auth'}),a18_0x5b3efd(Text,{'color':_0x5c13cb(0x107),'children':_0x5c13cb(0xff)})]})]});if(_0xede7fb[_0x5c13cb(0xf8)]===0x0)return a18_0x5b3efd(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a18_0x5b3efd(Text,{'color':_0x5c13cb(0xf7),'children':'!\x20No\x20menu\x20asset\x20links\x20found'})});if(_0x3689f0==='need-confirm')return a18_0x57250a(Box,{'flexDirection':_0x5c13cb(0xe7),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x5b3efd(CurrentMenuCdnContent,{'menuList':_0x1f6a66}),a18_0x5b3efd(InputCdnAsset,{'jsCdnUrl':_0x2ec9ea,'cssCdnUrl':_0x30f7a6}),a18_0x5b3efd(Box,{'marginTop':0x1,'flexDirection':_0x5c13cb(0xe7),'children':[{'label':_0x5c13cb(0x111),'value':'ok'},{'label':_0x5c13cb(0x104),'value':_0x5c13cb(0x113)}][_0x5c13cb(0x110)](_0x52a21e=>a18_0x57250a(Text,{'color':_0x369b35===_0x52a21e[_0x5c13cb(0x10c)]?_0x5c13cb(0xf7):undefined,'children':[_0x369b35===_0x52a21e[_0x5c13cb(0x10c)]?'>\x20':'\x20\x20',_0x52a21e[_0x5c13cb(0x108)]]},_0x52a21e[_0x5c13cb(0x10c)]))})]});if(_0x3689f0==='creating')return a18_0x57250a(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a18_0x5b3efd(CurrentMenuCdnContent,{'menuList':_0x1f6a66}),a18_0x5b3efd(InputCdnAsset,{'jsCdnUrl':_0x2ec9ea,'cssCdnUrl':_0x30f7a6}),a18_0x57250a(Box,{'marginTop':0x1,'children':[a18_0x5b3efd(a18_0x1c7254,{'type':_0x5c13cb(0xec)}),a18_0x5b3efd(Text,{'children':_0x5c13cb(0xef)})]})]});if(_0x3689f0===_0x5c13cb(0xe8))return a18_0x57250a(Box,{'flexDirection':_0x5c13cb(0xe7),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x5b3efd(CurrentMenuCdnContent,{'menuList':_0x1f6a66}),a18_0x5b3efd(InputCdnAsset,{'jsCdnUrl':_0x2ec9ea,'cssCdnUrl':_0x30f7a6}),a18_0x5b3efd(Box,{'marginTop':0x1,'children':a18_0x5b3efd(Text,{'color':_0x5c13cb(0x10f),'children':_0x5c13cb(0x103)})})]});return a18_0x57250a(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a18_0x5b3efd(CurrentMenuCdnContent,{'menuList':_0x1f6a66}),a18_0x57250a(Box,{'marginTop':0x1,'flexDirection':'column','children':[a18_0x5b3efd(Text,{'color':_0x5c13cb(0x106),'children':'*\x20Enter\x20new\x20asset\x20URLs'}),_0x2ec9ea?a18_0x57250a(Box,{'children':[a18_0x57250a(Text,{'color':_0x5c13cb(0x107),'children':['\x20\x20',_0x5c13cb(0xf5)]}),a18_0x5b3efd(Text,{'color':_0x5c13cb(0x10f),'children':_0x2ec9ea})]}):_0x3689f0===_0x5c13cb(0xf2)&&a18_0x57250a(a18_0x854b00,{'children':[a18_0x57250a(Box,{'children':[a18_0x57250a(Text,{'children':['\x20\x20','JS\x20URL:\x20']}),a18_0x5b3efd(Text,{'color':_0x5c13cb(0x10f),'children':_0x596e8f}),_0x331dc2&&a18_0x57250a(Text,{'color':'red','children':[_0x5c13cb(0xf1),_0x331dc2]})]}),!_0x331dc2&&a18_0x5b3efd(Box,{'children':a18_0x57250a(Text,{'color':_0x5c13cb(0x107),'children':['\x20\x20','Enter\x20project\x20JS\x20asset\x20URL\x20(https://...)']})})]}),_0x30f7a6?a18_0x57250a(Box,{'children':[a18_0x57250a(Text,{'children':['\x20\x20',_0x5c13cb(0xee)]}),a18_0x5b3efd(Text,{'color':_0x5c13cb(0x10f),'children':_0x30f7a6})]}):_0x3689f0===_0x5c13cb(0x109)&&a18_0x57250a(a18_0x854b00,{'children':[a18_0x57250a(Box,{'children':[a18_0x57250a(Text,{'children':['\x20\x20',_0x5c13cb(0xee)]}),a18_0x5b3efd(Text,{'color':_0x5c13cb(0x10f),'children':_0x596e8f}),_0x331dc2&&a18_0x57250a(Text,{'color':'red','children':[_0x5c13cb(0xf1),_0x331dc2]})]}),!_0x331dc2&&a18_0x5b3efd(Box,{'children':a18_0x57250a(Text,{'color':_0x5c13cb(0x107),'children':['\x20\x20',_0x5c13cb(0xf3)]})})]})]})]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a20_0x27fb49=a20_0x5e41;function a20_0x3d72(){const _0x367e19=['application/json','5071416bLuvPT','error','info','\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>','import','227559iFkuDS','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','json','\x20\x20\x201.\x20Specify\x20directly:\x20rabetbase\x20api\x20pull\x20<app-code>','5025921aItFAz','stringify','success','label','10524vrfKwQ','Menu\x20assets\x20synced:\x20','POST','errorCode','/smartapi/menu/update','resources','sdk-demo','update-menu-cdn-url','path','Failed\x20to\x20update\x20menu\x20assets:\x20','21080064vFxYkT','1195abFQjD','SdkDemo1','367896ifGdPV','log','!\x20Please\x20use\x20one\x20of\x20the\x20following:','data','status','Error','5970992aJulRp'];a20_0x3d72=function(){return _0x367e19;};return a20_0x3d72();}(function(_0x5a980f,_0x59332b){const _0x1a3bde=a20_0x5e41,_0x2ec9a9=_0x5a980f();while(!![]){try{const _0xfd09ea=-parseInt(_0x1a3bde(0x1c4))/0x1+-parseInt(_0x1a3bde(0x1b7))/0x2+-parseInt(_0x1a3bde(0x1c9))/0x3+parseInt(_0x1a3bde(0x1bd))/0x4+parseInt(_0x1a3bde(0x1b5))/0x5*(-parseInt(_0x1a3bde(0x1cd))/0x6)+-parseInt(_0x1a3bde(0x1bf))/0x7+parseInt(_0x1a3bde(0x1b4))/0x8;if(_0xfd09ea===_0x59332b)break;else _0x2ec9a9['push'](_0x2ec9a9['shift']());}catch(_0x902d15){_0x2ec9a9['push'](_0x2ec9a9['shift']());}}}(a20_0x3d72,0xdb0e0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a20_0x5e41(_0x16c9b6,_0x52cb62){_0x16c9b6=_0x16c9b6-0x1b3;const _0x3d72ef=a20_0x3d72();let _0x5e41dd=_0x3d72ef[_0x16c9b6];return _0x5e41dd;}import{logger}from'../utils/logger.js';const config=readConfig(),logLabel=a20_0x27fb49(0x1d4);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a20_0x27fb49(0x1b6),'path':a20_0x27fb49(0x1d3),'resources':['https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js',a20_0x27fb49(0x1c6)]});export async function updateMenuCdnUrl(_0x41e499){const _0x870aba=a20_0x27fb49,_0x21be19=config?.['appcode'];if(!_0x21be19){const _0x340691=_0x870aba(0x1c5);logger['error'](logLabel,_0x340691),console['error']('×\x20'+_0x340691),console[_0x870aba(0x1b8)](_0x870aba(0x1b9)),console[_0x870aba(0x1b8)](_0x870aba(0x1c8)),console[_0x870aba(0x1b8)](_0x870aba(0x1c2));return;}logger['info'](logLabel,'Updating\x20menu\x20asset\x20links:\x20'+_0x41e499['label']+'\x20('+_0x41e499[_0x870aba(0x1d5)]+')');const _0x184113={'id':_0x41e499['id'],'appCode':_0x21be19,'extend':{'loadScriptMode':_0x870aba(0x1c3),'resources':_0x41e499['resources']?JSON[_0x870aba(0x1ca)](_0x41e499[_0x870aba(0x1d2)]):undefined}},_0x454d6d=await fetch(getApiDomain()+_0x870aba(0x1d1),{'method':_0x870aba(0x1cf),'body':JSON[_0x870aba(0x1ca)](_0x184113),'headers':{'Content-Type':_0x870aba(0x1be),'Cookie':getCookie()}});if(!_0x454d6d['ok']){if(_0x454d6d['status']===0x191){const _0x308d8a='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger['error'](logLabel,_0x308d8a,{'status':_0x454d6d[_0x870aba(0x1bb)],'menu':_0x41e499[_0x870aba(0x1cc)]});throw new Error(_0x308d8a);}const _0x46d216=_0x870aba(0x1b3)+_0x454d6d[_0x870aba(0x1bb)];logger[_0x870aba(0x1c0)](logLabel,_0x46d216,{'menu':_0x41e499[_0x870aba(0x1cc)]});throw new Error(_0x46d216);}const _0x4fb496=await _0x454d6d[_0x870aba(0x1c7)]();if(!_0x4fb496[_0x870aba(0x1cb)]){const _0x1cf9a9=_0x870aba(0x1b3)+(_0x4fb496['errorMsg']||_0x870aba(0x1bc));logger[_0x870aba(0x1c0)](logLabel,_0x1cf9a9,{'errorCode':_0x4fb496[_0x870aba(0x1d0)],'errorMsg':_0x4fb496['errorMsg'],'menu':_0x41e499[_0x870aba(0x1cc)]});throw new Error(_0x1cf9a9);}logger[_0x870aba(0x1c1)](logLabel,_0x870aba(0x1ce)+_0x41e499[_0x870aba(0x1cc)],_0x4fb496[_0x870aba(0x1ba)]);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a21_0x22f3(_0x2bf499,_0xdcbdf6){_0x2bf499=_0x2bf499-0x76;const _0x112e78=a21_0x112e();let _0x22f39d=_0x112e78[_0x2bf499];return _0x22f39d;}(function(_0x3dc8aa,_0x5da65c){const _0x1fd666=a21_0x22f3,_0x4ef80d=_0x3dc8aa();while(!![]){try{const _0x59ee26=parseInt(_0x1fd666(0x88))/0x1*(-parseInt(_0x1fd666(0x79))/0x2)+-parseInt(_0x1fd666(0x85))/0x3*(-parseInt(_0x1fd666(0x7d))/0x4)+parseInt(_0x1fd666(0x84))/0x5+-parseInt(_0x1fd666(0x7e))/0x6+-parseInt(_0x1fd666(0x82))/0x7*(-parseInt(_0x1fd666(0x76))/0x8)+parseInt(_0x1fd666(0x7c))/0x9*(parseInt(_0x1fd666(0x8a))/0xa)+parseInt(_0x1fd666(0x78))/0xb;if(_0x59ee26===_0x5da65c)break;else _0x4ef80d['push'](_0x4ef80d['shift']());}catch(_0x4e46cc){_0x4ef80d['push'](_0x4ef80d['shift']());}}}(a21_0x112e,0xbe0e6));import{jsx as a21_0x49fc1b,jsxs as a21_0x5b869f}from'react/jsx-runtime';function a21_0x112e(){const _0x57ba15=['gray','*\x20Login\x20successful!','3626JYEZLX','log','2502185sERSRa','12477LJSXJL','Logging\x20in...\x20','column','24999HnlJgN','return','10wJbSRU','21864xswVgM','green','1057089TYYJSw','118RuOMfF','Press\x20\x22q\x22\x20to\x20exit.','finally','3964023tcKoCK','212bqfydR','2518158TSXqUl','Please\x20complete\x20login\x20in\x20your\x20browser.'];a21_0x112e=function(){return _0x57ba15;};return a21_0x112e();}import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a21_0x254170 from'ink-spinner';export function AuthServer(){const _0x39813d=a21_0x22f3,{exit:_0x2b0a37}=useApp(),[_0x7741a9,_0x539289]=useState(![]),[_0x1ee761,_0x578282]=useState(!![]),[_0x5a7937,_0x55d32b]=useState(![]),[_0x4ff02a,_0x3a8b5f]=useState(![]);useEffect(()=>{const _0x4ef408=a21_0x22f3;getIsSessionValid()['then'](_0x539289)[_0x4ef408(0x7b)](()=>_0x578282(![]));},[]),useEffect(()=>{!_0x1ee761&&_0x7741a9&&(console['log']('√\x20Valid\x20session\x20detected,\x20no\x20login\x20required.'),_0x2b0a37());},[_0x1ee761,_0x7741a9,_0x2b0a37]),useEffect(()=>{const _0x1c9e3f=a21_0x22f3;_0x4ff02a&&(console[_0x1c9e3f(0x83)](_0x1c9e3f(0x81)),_0x2b0a37());},[_0x4ff02a,_0x2b0a37]),useInput((_0xe64466,_0xfd5d22)=>{const _0x4f72d1=a21_0x22f3;_0xfd5d22[_0x4f72d1(0x89)]&&(_0x55d32b(!![]),authServer({'silent':!![]})['then'](_0x301ef0=>{_0x3a8b5f(_0x301ef0);})),_0xe64466==='q'&&_0x2b0a37();});if(_0x1ee761)return null;if(_0x7741a9||_0x4ff02a)return null;return a21_0x49fc1b(Box,{'flexDirection':_0x39813d(0x87),'marginTop':0x1,'marginBottom':0x1,'children':_0x5a7937?a21_0x5b869f(Box,{'children':[a21_0x49fc1b(Box,{'width':'1'}),a21_0x5b869f(Text,{'color':_0x39813d(0x77),'children':[a21_0x49fc1b(a21_0x254170,{'type':'dots'}),'\x20\x20']}),a21_0x49fc1b(Text,{'children':_0x39813d(0x86)}),a21_0x49fc1b(Text,{'color':'gray','children':_0x39813d(0x7f)})]}):a21_0x5b869f(Box,{'children':[a21_0x49fc1b(Box,{'width':'1'}),a21_0x49fc1b(Text,{'children':'*\x20Press\x20Enter\x20to\x20start\x20login.'}),a21_0x49fc1b(Text,{'color':_0x39813d(0x80),'children':_0x39813d(0x7a)})]})});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4ede5a,_0x39d53d){const _0x1bac72=a22_0x2e87,_0xab83fa=_0x4ede5a();while(!![]){try{const _0x4062cd=parseInt(_0x1bac72(0xcb))/0x1+-parseInt(_0x1bac72(0xcf))/0x2+parseInt(_0x1bac72(0xc1))/0x3*(-parseInt(_0x1bac72(0xbb))/0x4)+parseInt(_0x1bac72(0xdd))/0x5*(parseInt(_0x1bac72(0xd1))/0x6)+parseInt(_0x1bac72(0xd5))/0x7*(parseInt(_0x1bac72(0xce))/0x8)+-parseInt(_0x1bac72(0xd0))/0x9+parseInt(_0x1bac72(0xd8))/0xa*(parseInt(_0x1bac72(0xe1))/0xb);if(_0x4062cd===_0x39d53d)break;else _0xab83fa['push'](_0xab83fa['shift']());}catch(_0x3d3be5){_0xab83fa['push'](_0xab83fa['shift']());}}}(a22_0x94cc,0xb6cad));import{writeFileSync}from'node:fs';import a22_0x52708b from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';function a22_0x2e87(_0x4d97a4,_0x33470a){_0x4d97a4=_0x4d97a4-0xb9;const _0x94cce4=a22_0x94cc();let _0x2e877a=_0x94cce4[_0x4d97a4];return _0x2e877a;}function a22_0x94cc(){const _0xe511ed=['utf-8','<span\x20id=\x22t\x22>5</span>','435937xGFspc','https://dev.lovrabet.com:','end','4474200EcnGZO','909092mokutX','13391874JhNPWg','120qTHyGf','✅\x20Browser\x20opened.\x20Please\x20complete\x20login\x20in\x20the\x20browser.','win32','📍\x20Login\x20URL:','7RtQeYP','user','log','3890PjZsfu','createServer','Login\x20successful.\x20Please\x20return\x20to\x20the\x20CLI\x20to\x20continue.\x20This\x20window\x20will\x20close\x20in\x20','/api/auth/get-session','start\x20\x22\x22\x20\x22','176990KeFCaS','</title></head>\x0a<body>\x0a\x20\x20<div>','address','darwin','51733YdcIiM','\x20seconds.','🔐\x20Starting\x20login\x20service...','writeHead','then','Auth\x20server\x20error:','30596uFCLYa','platform','headers','⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically','🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:','xdg-open\x20\x22','330KBWJxG','silent','Unable\x20to\x20close\x20automatically.\x20Please\x20close\x20this\x20tab\x20or\x20window\x20manually.','error','json','object','port','</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>'];a22_0x94cc=function(){return _0xe511ed;};return a22_0x94cc();}export async function authServer(_0x14c595){const _0x40f990=a22_0x2e87,_0x2ab107=_0x14c595?.[_0x40f990(0xc2)]||![];if(await getIsSessionValid())return!![];const _0x1772f8=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))[_0x40f990(0xc5)]();return new Promise(async(_0x32cd8f,_0x54d750)=>{const _0x101b34=_0x40f990;let _0x31afe8=0x0;const _0x33617c=a22_0x52708b[_0x101b34(0xd9)](_0x1772f8,async(_0x25b46a,_0x3463a4)=>{const _0x4303d4=_0x101b34,_0x10d649=getUserDomain(),_0x5c81d1=_0x25b46a[_0x4303d4(0xbd)]['cookie']||'',_0x337681=await fetch(_0x10d649+_0x4303d4(0xdb),{'headers':{'cookie':_0x5c81d1}})[_0x4303d4(0xb9)](_0x17b216=>_0x17b216['json']()),_0x1a6b04=_0x337681&&_0x337681['session']&&_0x337681[_0x4303d4(0xd6)];if(_0x1a6b04){writeFileSync(cookieFile,_0x5c81d1,_0x4303d4(0xc9)),_0x32cd8f(!![]);const _0x399f3d='Login\x20Successful',_0x6ded99=_0x4303d4(0xda)+_0x4303d4(0xca)+_0x4303d4(0xe2),_0x3a4ec3=_0x4303d4(0xc3),_0x56136b='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>'+_0x399f3d+_0x4303d4(0xde)+_0x6ded99+_0x4303d4(0xc8)+_0x3a4ec3+'</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x3463a4[_0x4303d4(0xe4)](0xc8,{'Content-Type':'text/html;\x20charset=utf-8'}),_0x3463a4[_0x4303d4(0xcd)](_0x56136b),_0x33617c['close']();}else{const _0x2579f3=''+encodeURIComponent(_0x4303d4(0xcc)+_0x31afe8);_0x3463a4['writeHead'](0x12e,{'location':_0x10d649+'/sign-in?redirect='+_0x2579f3}),_0x3463a4['end']();return;}});_0x33617c['listen'](0x0,'127.0.0.1',()=>{const _0x2fe6e8=_0x101b34,_0x13ec51=_0x33617c[_0x2fe6e8(0xdf)]();_0x31afe8=typeof _0x13ec51===_0x2fe6e8(0xc6)&&_0x13ec51?_0x13ec51[_0x2fe6e8(0xc7)]:Number(_0x13ec51);const _0x3567c4='https://dev.lovrabet.com:'+_0x31afe8;!_0x2ab107&&(console[_0x2fe6e8(0xd7)](_0x2fe6e8(0xe3)),console[_0x2fe6e8(0xd7)](_0x2fe6e8(0xd4),_0x3567c4),console[_0x2fe6e8(0xd7)]('🌐\x20Attempting\x20to\x20open\x20browser\x20automatically...'),console[_0x2fe6e8(0xd7)](''),console[_0x2fe6e8(0xd7)]('💡\x20If\x20the\x20browser\x20does\x20not\x20open\x20automatically,\x20copy\x20the\x20login\x20URL\x20above\x20into\x20your\x20browser.'),console['log']('')),openInBrowser(_0x3567c4)[_0x2fe6e8(0xb9)](_0x3b3bae=>{const _0x356afb=_0x2fe6e8;!_0x2ab107&&(_0x3b3bae?console[_0x356afb(0xd7)](_0x356afb(0xd2)):(console[_0x356afb(0xd7)](_0x356afb(0xbe)),console['log']('🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:',_0x3567c4)),console[_0x356afb(0xd7)](''));})['catch'](()=>{const _0x4a2128=_0x2fe6e8;!_0x2ab107&&(console[_0x4a2128(0xd7)](_0x4a2128(0xbe)),console[_0x4a2128(0xd7)](_0x4a2128(0xbf),_0x3567c4),console[_0x4a2128(0xd7)](''));});}),_0x33617c['on'](_0x101b34(0xc4),_0x223106=>{const _0x368f53=_0x101b34;!_0x2ab107&&console[_0x368f53(0xc4)](_0x368f53(0xba),_0x223106),_0x54d750(_0x223106);});});}function openInBrowser(_0x16fe25){return new Promise(_0x436e4e=>{const _0x440da4=a22_0x2e87,_0x4199d7=process[_0x440da4(0xbc)];let _0x5953d7;if(_0x4199d7===_0x440da4(0xd3))_0x5953d7=_0x440da4(0xdc)+_0x16fe25+'\x22';else _0x4199d7===_0x440da4(0xe0)?_0x5953d7='open\x20\x22'+_0x16fe25+'\x22':_0x5953d7=_0x440da4(0xc0)+_0x16fe25+'\x22';exec(_0x5953d7,_0x15ac63=>{_0x15ac63?_0x436e4e(![]):_0x436e4e(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log']('isAuth',isAuth);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a23_0x5ed9f8=a23_0x2c0f;function a23_0x2c0f(_0x49b5d8,_0x7fe0b8){_0x49b5d8=_0x49b5d8-0x115;const _0x1081d7=a23_0x1081();let _0x2c0fe8=_0x1081d7[_0x49b5d8];return _0x2c0fe8;}(function(_0x127255,_0x296e0f){const _0x34e19a=a23_0x2c0f,_0x983d5b=_0x127255();while(!![]){try{const _0x48373a=-parseInt(_0x34e19a(0x121))/0x1*(parseInt(_0x34e19a(0x11c))/0x2)+parseInt(_0x34e19a(0x117))/0x3+-parseInt(_0x34e19a(0x11b))/0x4*(parseInt(_0x34e19a(0x11d))/0x5)+-parseInt(_0x34e19a(0x120))/0x6*(-parseInt(_0x34e19a(0x11e))/0x7)+parseInt(_0x34e19a(0x119))/0x8+-parseInt(_0x34e19a(0x11f))/0x9+parseInt(_0x34e19a(0x116))/0xa*(-parseInt(_0x34e19a(0x115))/0xb);if(_0x48373a===_0x296e0f)break;else _0x983d5b['push'](_0x983d5b['shift']());}catch(_0x127be8){_0x983d5b['push'](_0x983d5b['shift']());}}}(a23_0x1081,0x713a6));import{mkdirSync}from'node:fs';function a23_0x1081(){const _0x35cb0c=['442620pnUxpT','1965450ksYoZf','cookie','5156512JLdGXH','.lovrabet','115512iNqYqT','14entSHd','5gOHkrS','56HtQXxy','6232959AfErzx','438714VAfngt','49337qmHAbg','88MnPxGl'];a23_0x1081=function(){return _0x35cb0c;};return a23_0x1081();}import{homedir}from'node:os';import{join}from'node:path';export const configDir=join(homedir(),a23_0x5ed9f8(0x11a));export const cookieFile=join(configDir,a23_0x5ed9f8(0x118));mkdirSync(configDir,{'recursive':!![]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x267724,_0x1ad52b){var _0x62dfcb=a24_0x43e6,_0x43f5b8=_0x267724();while(!![]){try{var _0x28b9bd=-parseInt(_0x62dfcb(0x13f))/0x1+-parseInt(_0x62dfcb(0x13d))/0x2*(parseInt(_0x62dfcb(0x140))/0x3)+-parseInt(_0x62dfcb(0x142))/0x4+-parseInt(_0x62dfcb(0x13a))/0x5*(-parseInt(_0x62dfcb(0x137))/0x6)+parseInt(_0x62dfcb(0x13e))/0x7*(parseInt(_0x62dfcb(0x141))/0x8)+-parseInt(_0x62dfcb(0x13c))/0x9*(-parseInt(_0x62dfcb(0x138))/0xa)+parseInt(_0x62dfcb(0x13b))/0xb*(parseInt(_0x62dfcb(0x136))/0xc);if(_0x28b9bd===_0x1ad52b)break;else _0x43f5b8['push'](_0x43f5b8['shift']());}catch(_0x1a7901){_0x43f5b8['push'](_0x43f5b8['shift']());}}}(a24_0x2abe,0xa1ee1));function a24_0x2abe(){var _0x81f51d=['160EsQTRA','utf-8','1284365gbpRAL','55UJBvXb','398619ggPCmC','116bwwNVj','49bqcUkK','378255zTVxon','12219byXfqM','132920kIciuV','1368964lSaxiB','58596EofQyZ','18qFTBAA'];a24_0x2abe=function(){return _0x81f51d;};return a24_0x2abe();}function a24_0x43e6(_0x3b274e,_0x4c0052){_0x3b274e=_0x3b274e-0x136;var _0x2abef4=a24_0x2abe();var _0x43e637=_0x2abef4[_0x3b274e];return _0x43e637;}import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x1b79fc=a24_0x43e6;try{return readFileSync(cookieFile,_0x1b79fc(0x139));}catch{}return'';}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4371d1,_0x2687e8){const _0x33269b=a25_0x251c,_0x185528=_0x4371d1();while(!![]){try{const _0x577151=-parseInt(_0x33269b(0xd0))/0x1*(parseInt(_0x33269b(0xd7))/0x2)+-parseInt(_0x33269b(0xd8))/0x3*(parseInt(_0x33269b(0xd9))/0x4)+-parseInt(_0x33269b(0xcf))/0x5*(parseInt(_0x33269b(0xd2))/0x6)+-parseInt(_0x33269b(0xd3))/0x7+parseInt(_0x33269b(0xd1))/0x8*(-parseInt(_0x33269b(0xcb))/0x9)+-parseInt(_0x33269b(0xcd))/0xa+parseInt(_0x33269b(0xd5))/0xb*(parseInt(_0x33269b(0xd6))/0xc);if(_0x577151===_0x2687e8)break;else _0x185528['push'](_0x185528['shift']());}catch(_0x52bccb){_0x185528['push'](_0x185528['shift']());}}}(a25_0xfd1a,0xc7535));import{existsSync,readFileSync}from'node:fs';function a25_0xfd1a(){const _0x19d220=['65748KsmpOl','1734346bbQeHY','34239HiFhJV','180DOYOaL','then','6499305udeuhB','user','2986870VLOmVD','utf-8','10610tkIqAp','1ffXNYF','8gTTuNE','2592zodDRD','10637179GPVBtu','session','11352HHGGAE'];a25_0xfd1a=function(){return _0x19d220;};return a25_0xfd1a();}function a25_0x251c(_0x348472,_0x1b9c1b){_0x348472=_0x348472-0xca;const _0xfd1af7=a25_0xfd1a();let _0x251c13=_0xfd1af7[_0x348472];return _0x251c13;}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x17006e=a25_0x251c;try{if(!existsSync(cookieFile))return![];const _0x4449f2=readFileSync(cookieFile,_0x17006e(0xce)),_0x3f25f6=await fetch(getUserDomain()+'/api/auth/get-session',{'headers':{'cookie':_0x4449f2}})[_0x17006e(0xca)](_0x40a88b=>_0x40a88b['json']());return _0x3f25f6&&_0x3f25f6[_0x17006e(0xd4)]&&_0x3f25f6[_0x17006e(0xcc)];}catch{}return![];}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x13c962,_0xe1a874){var _0x61710=a26_0x2478,_0x50bd91=_0x13c962();while(!![]){try{var _0x55e1f2=parseInt(_0x61710(0x1b7))/0x1+parseInt(_0x61710(0x1b8))/0x2+parseInt(_0x61710(0x1b9))/0x3*(parseInt(_0x61710(0x1bf))/0x4)+parseInt(_0x61710(0x1c0))/0x5*(-parseInt(_0x61710(0x1ba))/0x6)+-parseInt(_0x61710(0x1b6))/0x7+-parseInt(_0x61710(0x1c2))/0x8*(-parseInt(_0x61710(0x1bb))/0x9)+-parseInt(_0x61710(0x1bd))/0xa*(parseInt(_0x61710(0x1c1))/0xb);if(_0x55e1f2===_0xe1a874)break;else _0x50bd91['push'](_0x50bd91['shift']());}catch(_0x5e340c){_0x50bd91['push'](_0x50bd91['shift']());}}}(a26_0x3d0d,0x6dcf2));function a26_0x3d0d(){var _0x87966d=['9460560uGaSqL','✓\x20Logged\x20out','2014984ybgfYk','29485zIQiwm','11LZIxya','406552gHEThC','2585982xLIyrn','582282wynKIi','1528088XqGKKC','3HdhdEr','138oEDdEv','9lvLUrc','log'];a26_0x3d0d=function(){return _0x87966d;};return a26_0x3d0d();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a26_0x2478(_0x5f5bde,_0x1c7dd5){_0x5f5bde=_0x5f5bde-0x1b6;var _0x3d0dc0=a26_0x3d0d();var _0x24780e=_0x3d0dc0[_0x5f5bde];return _0x24780e;}export function logout(){var _0x368fbb=a26_0x2478;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x368fbb(0x1bc)](_0x368fbb(0x1be))):console[_0x368fbb(0x1bc)]('!\x20Not\x20logged\x20in');}
|
package/lib/cli-flags.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a27_0x10b7(_0x41a9a9,_0x105a73){_0x41a9a9=_0x41a9a9-0x1e3;const _0x2f18a5=a27_0x2f18();let _0x10b700=_0x2f18a5[_0x41a9a9];return _0x10b700;}const a27_0x9258a8=a27_0x10b7;function a27_0x2f18(){const _0x7228e6=['11557QPLBOM','365321tcnlIm','26fLGrcX','boolean','1562931fRJekx','2931852zQxHlg','6GXtaWz','8XCLKCb','1548450AYBfFQ','319611KpPXHZ','20ZmziKu','8dJIaqs','2244613mXOawn'];a27_0x2f18=function(){return _0x7228e6;};return a27_0x2f18();}(function(_0x52dbcc,_0x3285b4){const _0x5b99c7=a27_0x10b7,_0x147ba5=_0x52dbcc();while(!![]){try{const _0x13da98=parseInt(_0x5b99c7(0x1e7))/0x1*(parseInt(_0x5b99c7(0x1e9))/0x2)+parseInt(_0x5b99c7(0x1e3))/0x3*(parseInt(_0x5b99c7(0x1ee))/0x4)+parseInt(_0x5b99c7(0x1ef))/0x5+parseInt(_0x5b99c7(0x1ed))/0x6*(-parseInt(_0x5b99c7(0x1e6))/0x7)+-parseInt(_0x5b99c7(0x1e5))/0x8*(-parseInt(_0x5b99c7(0x1eb))/0x9)+-parseInt(_0x5b99c7(0x1e4))/0xa*(parseInt(_0x5b99c7(0x1e8))/0xb)+-parseInt(_0x5b99c7(0x1ec))/0xc;if(_0x13da98===_0x3285b4)break;else _0x147ba5['push'](_0x147ba5['shift']());}catch(_0x42f6da){_0x147ba5['push'](_0x147ba5['shift']());}}}(a27_0x2f18,0x348de));export const dynamicCliFlags={'enableBffSave':{'type':a27_0x9258a8(0x1ea)}};
|
package/lib/cli.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const a28_0x54ac64=a28_0x12bc;(function(_0x536563,_0x4ef27f){const _0x59a4aa=a28_0x12bc,_0x12f7eb=_0x536563();while(!![]){try{const _0x54d23b=parseInt(_0x59a4aa(0x1b8))/0x1*(parseInt(_0x59a4aa(0x1d1))/0x2)+-parseInt(_0x59a4aa(0x1cc))/0x3+-parseInt(_0x59a4aa(0x1c7))/0x4*(parseInt(_0x59a4aa(0x1c0))/0x5)+parseInt(_0x59a4aa(0x1ba))/0x6+-parseInt(_0x59a4aa(0x1b6))/0x7+parseInt(_0x59a4aa(0x1a6))/0x8*(-parseInt(_0x59a4aa(0x1c8))/0x9)+-parseInt(_0x59a4aa(0x1ac))/0xa*(-parseInt(_0x59a4aa(0x1cb))/0xb);if(_0x54d23b===_0x4ef27f)break;else _0x12f7eb['push'](_0x12f7eb['shift']());}catch(_0x2c0323){_0x12f7eb['push'](_0x12f7eb['shift']());}}}(a28_0xf159,0x27136));import{jsx as a28_0x3dc6dd}from'react/jsx-runtime';import a28_0x30d64a from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{createContext}from'./context.js';function a28_0xf159(){const _0x37be55=['401360GUvVsc','hint','help','env','⚠\x20`','exitCode','module','4aKfoKC','153UPqVsZ','slice','Unexpected\x20error:','857725FdFrow','543999jLFmTj','Error:\x20','`\x20has\x20been\x20moved\x20to\x20`','appcode','stdout','2954DLXGEn','Hint:\x20','defaultCommand','LOVRABET_APPCODE','RABETBASE_CI','dynamicCliFlags','cookie','apiDir','passCommandAsArg','./context.js','LOVRABET_CI','true','appCode','exit','RABETBASE_APPCODE','pageSize','134008fQWuAS','input','boolean','string','log','service','60kqZATu','run','./cli-flags.js','flags','wildcardModule','node:fs','`\x20in\x20v2.0.\x0a','isTTY','nonInteractive','./constant/env.js','191240ULuwiW','node:url','164lWjbix','utf-8','142008xwHeQL','message','error','0.0.0','node:path','unknownCommand'];a28_0xf159=function(){return _0x37be55;};return a28_0xf159();}import{isKnownService,isDeclarativeService,getServiceEntry,findDefinition,getLegacyHandler,deprecatedAliases}from'./commands/registry.js';import{runCommand}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{getCookie}from'./auth/get-cookie.js';import{getApiDomain}from'./constant/domain.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{BUILD_NUMBER}from'./generated/build-info.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import(a28_0x54ac64(0x1ae)))[a28_0x54ac64(0x1d6)];}catch{}const helpText=generateFullHelp(),pkgVersion=await((async()=>{const _0x42b18c=a28_0x54ac64;try{const {readFileSync:_0x4db1ab}=await import(_0x42b18c(0x1b1)),{resolve:_0x1dea46,dirname:_0x5ae24f}=await import(_0x42b18c(0x1be)),{fileURLToPath:_0x22a669}=await import(_0x42b18c(0x1b7)),_0x39adc6=_0x1dea46(_0x5ae24f(_0x22a669(import.meta.url)),'..'),_0x1db21a=JSON['parse'](_0x4db1ab(_0x1dea46(_0x39adc6,'package.json'),_0x42b18c(0x1b9)));return _0x1db21a['version']||_0x42b18c(0x1bd);}catch{return _0x42b18c(0x1bd);}})()),cliVersion=BUILD_NUMBER?pkgVersion+'+'+BUILD_NUMBER:pkgVersion,cli=a28_0x30d64a(helpText,{'importMeta':import.meta,'version':cliVersion,'flags':{'help':{'type':a28_0x54ac64(0x1a8)},'env':{'type':a28_0x54ac64(0x1a9)},'appcode':{'type':'string'},'app':{'type':'string'},'nonInteractive':{'type':'boolean'},'ci':{'type':a28_0x54ac64(0x1a8)},'format':{'type':a28_0x54ac64(0x1a9)},'dryRun':{'type':a28_0x54ac64(0x1a8)},'yes':{'type':a28_0x54ac64(0x1a8)},'name':{'type':a28_0x54ac64(0x1a9)},'clear':{'type':a28_0x54ac64(0x1a8)},'watch':{'type':a28_0x54ac64(0x1a8)},'output':{'type':a28_0x54ac64(0x1a9)},'params':{'type':'string'},'datasetcode':{'type':'string'},'mcpCursor':{'type':a28_0x54ac64(0x1a8)},'mcpClaude':{'type':a28_0x54ac64(0x1a8)},'mcpOther':{'type':a28_0x54ac64(0x1a8)},'cursor':{'type':'boolean'},'windsurf':{'type':a28_0x54ac64(0x1a8)},'claude':{'type':a28_0x54ac64(0x1a8)},'cline':{'type':a28_0x54ac64(0x1a8)},'codex':{'type':a28_0x54ac64(0x1a8)},'opencode':{'type':a28_0x54ac64(0x1a8)},'qoder':{'type':a28_0x54ac64(0x1a8)},'codebuddy':{'type':a28_0x54ac64(0x1a8)},'trae':{'type':a28_0x54ac64(0x1a8)},'agent':{'type':a28_0x54ac64(0x1a8)},'antigravity':{'type':a28_0x54ac64(0x1a8)},'all':{'type':a28_0x54ac64(0x1a8)},'enableBffSave':{'type':a28_0x54ac64(0x1a8)},'id':{'type':a28_0x54ac64(0x1a9)},'type':{'type':'string'},'file':{'type':a28_0x54ac64(0x1a9)},'sqlcode':{'type':a28_0x54ac64(0x1a9)},'sqlname':{'type':a28_0x54ac64(0x1a9)},'dbid':{'type':'string'},'description':{'type':a28_0x54ac64(0x1a9)},'page':{'type':a28_0x54ac64(0x1a9)},'pagesize':{'type':a28_0x54ac64(0x1a9)},'keyword':{'type':a28_0x54ac64(0x1a9)},'code':{'type':a28_0x54ac64(0x1a9)},'sql':{'type':'string'},'schemas':{'type':a28_0x54ac64(0x1a9)},'operation':{'type':'string'},'target':{'type':a28_0x54ac64(0x1a9)},'skipImports':{'type':a28_0x54ac64(0x1a8)},'force':{'type':a28_0x54ac64(0x1a8)},'remote':{'type':a28_0x54ac64(0x1a8)},'verbose':{'type':'boolean'},'operationType':{'type':a28_0x54ac64(0x1a9)},'functionNode':{'type':a28_0x54ac64(0x1a9)},...dynamicCliFlags||{}}});await run();function a28_0x12bc(_0x360715,_0xdfb093){_0x360715=_0x360715-0x1a3;const _0xf159c3=a28_0xf159();let _0x12bcdf=_0xf159c3[_0x360715];return _0x12bcdf;}async function run(){const _0x132421=a28_0x54ac64;let _0x5117ed=cli[_0x132421(0x1a7)][0x0],_0x179689=cli['input'][0x1];const _0x400a07=cli[_0x132421(0x1af)];if(!_0x5117ed){render(a28_0x3dc6dd(Help,{}));return;}const _0x2dcb35=deprecatedAliases[_0x5117ed];if(_0x2dcb35&&!isKnownService(_0x5117ed)){const _0x320a5e=_0x179689?CLI_BIN_NAME+'\x20'+_0x5117ed+'\x20'+_0x179689:CLI_BIN_NAME+'\x20'+_0x5117ed,_0x28717b=CLI_BIN_NAME+'\x20'+_0x2dcb35[_0x132421(0x1ab)]+'\x20'+_0x2dcb35['command'];console[_0x132421(0x1bc)](_0x132421(0x1c4)+_0x320a5e+_0x132421(0x1ce)+_0x28717b+_0x132421(0x1b2)+'\x20\x20Please\x20update\x20your\x20command\x20and\x20try\x20again.\x0a'),process[_0x132421(0x1a3)](0x1);}if(!isKnownService(_0x5117ed)){render(a28_0x3dc6dd(Help,{}));return;}const _0x27a66b=getServiceEntry(_0x5117ed);if(!_0x179689){if(_0x27a66b[_0x132421(0x1d3)])_0x179689=_0x27a66b['defaultCommand'];else{if(_0x27a66b[_0x132421(0x1b0)]){const _0x4fda1f=await createContext(_0x400a07);try{await _0x27a66b[_0x132421(0x1b0)][_0x132421(0x1ad)](_0x4fda1f,[],_0x400a07);}catch(_0x5357bf){handleError(_0x5357bf);}return;}else{printServiceHelp(_0x5117ed);return;}}}if(_0x400a07[_0x132421(0x1c2)]&&!findDefinition(_0x5117ed,_0x179689)&&!getLegacyHandler(_0x5117ed,_0x179689)){printServiceHelp(_0x5117ed);return;}if(_0x400a07[_0x132421(0x1c3)]&&typeof _0x400a07['env']==='string'){const {initEnv:_0x5d523d}=await import(_0x132421(0x1b5));_0x5d523d(_0x400a07['env']);}const {buildConfigFromFlags:_0xf83426}=await import(_0x132421(0x1da)),_0x32855f=_0xf83426(_0x400a07);if(!_0x400a07[_0x132421(0x1c3)]&&_0x32855f['env']){const {initEnv:_0x2669ba}=await import(_0x132421(0x1b5));_0x2669ba(_0x32855f['env']);}if(isDeclarativeService(_0x5117ed)){const _0x3dfc8b=findDefinition(_0x5117ed,_0x179689);!_0x3dfc8b&&(printServiceHelp(_0x5117ed),handleError(CliErrors[_0x132421(0x1bf)](_0x5117ed+'\x20'+_0x179689)));if(_0x400a07[_0x132421(0x1c2)]){console[_0x132421(0x1aa)](generateCommandHelp(_0x3dfc8b));return;}try{await runCommand(_0x3dfc8b,{'rawFlags':_0x400a07,'resolveAppCode':()=>_0x32855f[_0x132421(0x1dd)]||_0x400a07[_0x132421(0x1cf)]||process[_0x132421(0x1c3)][_0x132421(0x1a4)]||process[_0x132421(0x1c3)][_0x132421(0x1d4)]||undefined,'resolveCookie':()=>_0x32855f[_0x132421(0x1d7)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':isNonInteractive(_0x400a07),'defaultFormat':_0x32855f['format'],'defaultPageSize':_0x32855f[_0x132421(0x1a5)],'defaultVerbose':_0x32855f['verbose'],'apiDir':_0x32855f[_0x132421(0x1d8)],'riskLevel':_0x32855f['riskLevel']});}catch(_0xa70a6e){handleError(_0xa70a6e);}return;}const _0x58603f=getLegacyHandler(_0x5117ed,_0x179689);if(_0x58603f){if(_0x400a07[_0x132421(0x1c2)]){printServiceHelp(_0x5117ed);return;}const _0x390119=await createContext(_0x400a07),_0x4e3563=_0x58603f[_0x132421(0x1d9)]?[_0x179689,...cli[_0x132421(0x1a7)][_0x132421(0x1c9)](0x2)]:cli[_0x132421(0x1a7)][_0x132421(0x1c9)](0x2);try{await _0x58603f[_0x132421(0x1c6)][_0x132421(0x1ad)](_0x390119,_0x4e3563,_0x400a07);}catch(_0x2f08e7){handleError(_0x2f08e7);}return;}if(_0x27a66b['wildcardModule']){if(_0x400a07[_0x132421(0x1c2)]){printServiceHelp(_0x5117ed);return;}const _0x44dd7a=await createContext(_0x400a07),_0xb7203c=[_0x179689,...cli[_0x132421(0x1a7)][_0x132421(0x1c9)](0x2)];try{await _0x27a66b[_0x132421(0x1b0)][_0x132421(0x1ad)](_0x44dd7a,_0xb7203c,_0x400a07);}catch(_0x419f0e){handleError(_0x419f0e);}return;}printServiceHelp(_0x5117ed),handleError(CliErrors[_0x132421(0x1bf)](_0x5117ed+'\x20'+_0x179689));}function printServiceHelp(_0x4de38d){const _0x19403d=a28_0x54ac64;console[_0x19403d(0x1aa)](generateServiceHelp(_0x4de38d));}function handleError(_0x366ada){const _0x39b7ee=a28_0x54ac64;if(_0x366ada instanceof CliError){console[_0x39b7ee(0x1bc)](_0x39b7ee(0x1cd)+_0x366ada[_0x39b7ee(0x1bb)]);if(_0x366ada[_0x39b7ee(0x1c1)])console[_0x39b7ee(0x1bc)](_0x39b7ee(0x1d2)+_0x366ada[_0x39b7ee(0x1c1)]);process[_0x39b7ee(0x1a3)](_0x366ada[_0x39b7ee(0x1c5)]);}console[_0x39b7ee(0x1bc)](_0x39b7ee(0x1ca),_0x366ada),process['exit'](0x1);}function isNonInteractive(_0x4fdbd4){const _0x1fc4fc=a28_0x54ac64;return!!(_0x4fdbd4[_0x1fc4fc(0x1b4)]||_0x4fdbd4['ci']||process[_0x1fc4fc(0x1c3)][_0x1fc4fc(0x1d5)]==='true'||process[_0x1fc4fc(0x1c3)][_0x1fc4fc(0x1db)]===_0x1fc4fc(0x1dc)||process['env']['CI']==='true'||!process[_0x1fc4fc(0x1d0)][_0x1fc4fc(0x1b3)]);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a29_0x2159e9=a29_0x54da;function a29_0x54da(_0x2a5765,_0x485a63){_0x2a5765=_0x2a5765-0x1b2;const _0xcd02e1=a29_0xcd02();let _0x54dadf=_0xcd02e1[_0x2a5765];return _0x54dadf;}(function(_0x2007bb,_0x31c611){const _0x5499ea=a29_0x54da,_0x12cf20=_0x2007bb();while(!![]){try{const _0x481f47=-parseInt(_0x5499ea(0x1c4))/0x1*(-parseInt(_0x5499ea(0x1d6))/0x2)+-parseInt(_0x5499ea(0x1e6))/0x3+-parseInt(_0x5499ea(0x1e7))/0x4*(-parseInt(_0x5499ea(0x1d4))/0x5)+-parseInt(_0x5499ea(0x1c2))/0x6*(parseInt(_0x5499ea(0x1e1))/0x7)+parseInt(_0x5499ea(0x1e5))/0x8+parseInt(_0x5499ea(0x1e3))/0x9+-parseInt(_0x5499ea(0x1d7))/0xa;if(_0x481f47===_0x31c611)break;else _0x12cf20['push'](_0x12cf20['shift']());}catch(_0x32df56){_0x12cf20['push'](_0x12cf20['shift']());}}}(a29_0xcd02,0x8722a));import{jsx as a29_0x16ec08}from'react/jsx-runtime';function a29_0xcd02(){const _0x42ab63=['trim','7xNMswp','filter','9285948VgOKBw','Use:\x20rabetbase\x20api\x20pull\x20--appcode\x20','6602000wazboB','2039175qddEtv','410452VNpIuP','Set\x20appcode:\x20`rabetbase\x20config\x20set\x20appcode\x20<code>`\x20or\x20pass\x20--appcode.','datasetcode','split','output','slice','repeat','api\x20(missing\x20subcommand:\x20list,\x20pull\x20or\x20doc)','\x1b[0m','\x1b[90m*\x20Using\x20configured\x20AppCode:\x20','parse','max','name','must\x20be\x20a\x20JSON\x20object','join','Provide\x20a\x20valid\x20JSON\x20object,\x20e.g.\x20--params\x20\x27{\x22key\x22:\x22value\x22}\x27','Positional\x20arguments\x20are\x20no\x20longer\x20supported\x20for\x20`api\x20pull`.','doc','Pull\x20API\x20config\x20and\x20generate\x20documentation','api\x20','246642mAMgej','log','1097csqOQZ','unknownCommand','configMissing','string','\x0a\x20\x20rabetbase\x20api\x20—\x20API\x20Operations\x0a\x0a\x20\x20USAGE\x0a\x20\x20\x20\x20rabetbase\x20api\x20list\x20[options]\x0a\x20\x20\x20\x20rabetbase\x20api\x20pull\x20[options]\x0a\x20\x20\x20\x20rabetbase\x20api\x20doc\x20\x20[options]\x0a\x0a\x20\x20OPTIONS\x0a\x20\x20\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20Specify\x20app\x20code\x0a\x20\x20\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20Output\x20directory\x20(pull:\x20./src/api/,\x20doc:\x20./docs)\x0a\x20\x20\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Environment\x20(daily\x20/\x20production)\x0a\x20\x20\x20\x20--datasetcode\x20<codes>\x20Dataset\x20codes\x20for\x20doc\x20(comma-separated,\x20doc\x20only)\x0a\x20\x20\x20\x20--params\x20<json>\x20\x20\x20\x20\x20\x20\x20Extra\x20params\x20JSON\x20(doc\x20only)\x0a\x0a\x20\x20EXAMPLES\x0a\x20\x20\x20\x20rabetbase\x20api\x20list\x0a\x20\x20\x20\x20rabetbase\x20api\x20list\x20--appcode\x20myapp\x0a\x20\x20\x20\x20rabetbase\x20api\x20pull\x0a\x20\x20\x20\x20rabetbase\x20api\x20pull\x20--appcode\x20myapp\x20--output\x20./api\x0a\x20\x20\x20\x20rabetbase\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x0a','No\x20models\x20found.','message','validation','help','appcode','\x20model(s)\x0a','min','Positional\x20arguments\x20are\x20no\x20longer\x20supported\x20for\x20`api\x20doc`.','env','key','params','45OXMZzJ','Key','20uBnrIE','15171630UnJuDq','padStart','Name','\x0a\x20\x20App:\x20','Invalid\x20--params:\x20','api','DatasetCode','length','Use:\x20rabetbase\x20api\x20doc\x20--appcode\x20'];a29_0xcd02=function(){return _0x42ab63;};return a29_0xcd02();}import{render}from'ink';import{ApiPullUI}from'../api/api-pull-ui.js';import{ApiDocUI}from'../api/api-doc-ui.js';import{fetchModelList}from'../api/fetch-model-list.js';import{getConfigAppCode}from'../utils/config.js';import{CliErrors}from'../errors.js';const API_HELP=a29_0x2159e9(0x1c8);export const apiCommand={'name':a29_0x2159e9(0x1dc),'description':a29_0x2159e9(0x1c0),async 'run'(_0x6d7bfc,_0x5099e1,_0x505b2c){const _0x4562f5=a29_0x2159e9,_0x30d7ec=_0x5099e1[0x0];if(_0x505b2c[_0x4562f5(0x1cc)]||!_0x30d7ec&&!_0x505b2c[_0x4562f5(0x1cc)]){console[_0x4562f5(0x1c3)](API_HELP);if(!_0x30d7ec&&!_0x505b2c[_0x4562f5(0x1cc)])throw CliErrors[_0x4562f5(0x1c5)](_0x4562f5(0x1b5));return;}if(_0x30d7ec==='list'){const _0x633c8f=getConfigAppCode(),_0x21e4ab=_0x505b2c['appcode']??_0x633c8f;if(!_0x21e4ab)throw CliErrors[_0x4562f5(0x1c6)](_0x4562f5(0x1e8));const {configArray:_0x15631d,count:_0x584021}=await fetchModelList(_0x21e4ab);if(_0x584021===0x0){console[_0x4562f5(0x1c3)](_0x4562f5(0x1c9));return;}const _0x33cb4f=Math[_0x4562f5(0x1cf)](0x28,Math[_0x4562f5(0x1b9)](0x4,..._0x15631d['map'](_0xa041e9=>_0xa041e9[_0x4562f5(0x1ba)][_0x4562f5(0x1de)]))),_0xee799f=Math[_0x4562f5(0x1cf)](0x24,Math[_0x4562f5(0x1b9)](0x3,..._0x15631d['map'](_0xa7cae7=>_0xa7cae7[_0x4562f5(0x1d2)][_0x4562f5(0x1de)]))),_0x3a8193=Math['min'](0x28,Math['max'](0x4,..._0x15631d['map'](_0x12447d=>_0x12447d['datasetCode']['length']))),_0x10d544=(_0x3afb7f,_0x17792f)=>_0x3afb7f[_0x4562f5(0x1b3)](0x0,_0x17792f)['padEnd'](_0x17792f),_0x36b217=(_0xfe821c,_0x4dd9e6,_0x3293fc,_0x3bf613)=>'\x20\x20'+String(_0xfe821c)[_0x4562f5(0x1d8)](0x6)+'\x20\x20'+_0x10d544(_0x4dd9e6,_0x33cb4f)+'\x20\x20'+_0x10d544(_0x3293fc,_0xee799f)+'\x20\x20'+_0x10d544(_0x3bf613,_0x3a8193);console[_0x4562f5(0x1c3)](_0x4562f5(0x1da)+_0x21e4ab+'\x20\x20|\x20\x20'+_0x584021+_0x4562f5(0x1ce)),console[_0x4562f5(0x1c3)](_0x36b217('ID',_0x4562f5(0x1d9),_0x4562f5(0x1d5),_0x4562f5(0x1dd))),console[_0x4562f5(0x1c3)]('\x20\x20'+'─'['repeat'](0x6)+'\x20\x20'+'─'[_0x4562f5(0x1b4)](_0x33cb4f)+'\x20\x20'+'─'[_0x4562f5(0x1b4)](_0xee799f)+'\x20\x20'+'─'[_0x4562f5(0x1b4)](_0x3a8193));for(const _0x37b3f8 of _0x15631d){console[_0x4562f5(0x1c3)](_0x36b217(_0x37b3f8['id'],_0x37b3f8[_0x4562f5(0x1ba)],_0x37b3f8[_0x4562f5(0x1d2)],_0x37b3f8['datasetCode']));}console[_0x4562f5(0x1c3)]();return;}if(_0x30d7ec==='pull'){if(_0x5099e1[0x1])throw CliErrors[_0x4562f5(0x1cb)](_0x4562f5(0x1be),_0x4562f5(0x1e4)+_0x5099e1[0x1]);const _0x392f4d=getConfigAppCode();let _0x2d3172=_0x505b2c['appcode'];const _0x5d7047=typeof _0x505b2c[_0x4562f5(0x1d1)]===_0x4562f5(0x1c7)?_0x505b2c['env']:undefined,_0x47672b=_0x505b2c[_0x4562f5(0x1b2)];if(!_0x2d3172&&!_0x392f4d)throw CliErrors[_0x4562f5(0x1c6)](_0x4562f5(0x1e8));_0x2d3172&&_0x392f4d&&_0x2d3172===_0x392f4d&&(console[_0x4562f5(0x1c3)]('\x1b[90m*\x20Using\x20configured\x20AppCode:\x20'+_0x2d3172+_0x4562f5(0x1b6)),_0x2d3172=undefined),render(a29_0x16ec08(ApiPullUI,{'appCode':_0x2d3172,'env':_0x5d7047,'output':_0x47672b}));}else{if(_0x30d7ec===_0x4562f5(0x1bf)){if(_0x5099e1[0x1])throw CliErrors['validation'](_0x4562f5(0x1d0),_0x4562f5(0x1df)+_0x5099e1[0x1]);const _0x5ac544=getConfigAppCode();let _0x431e60=_0x505b2c[_0x4562f5(0x1cd)];const _0x879ea2=typeof _0x505b2c[_0x4562f5(0x1d1)]==='string'?_0x505b2c[_0x4562f5(0x1d1)]:undefined,_0x135cd2=_0x505b2c[_0x4562f5(0x1b2)],_0x2ea43b=_0x505b2c[_0x4562f5(0x1d3)],_0x229eeb=_0x505b2c[_0x4562f5(0x1e9)];if(!_0x431e60&&!_0x5ac544)throw CliErrors[_0x4562f5(0x1c6)](_0x4562f5(0x1e8));_0x431e60&&_0x5ac544&&_0x431e60===_0x5ac544&&(console[_0x4562f5(0x1c3)](_0x4562f5(0x1b7)+_0x431e60+_0x4562f5(0x1b6)),_0x431e60=undefined);let _0x9d7614;if(_0x2ea43b)try{_0x9d7614=JSON[_0x4562f5(0x1b8)](_0x2ea43b);if(typeof _0x9d7614!=='object'||_0x9d7614===null||Array['isArray'](_0x9d7614))throw new Error(_0x4562f5(0x1bb));}catch(_0x1000a8){throw CliErrors[_0x4562f5(0x1cb)](_0x4562f5(0x1db)+(_0x1000a8 instanceof Error?_0x1000a8[_0x4562f5(0x1ca)]:String(_0x1000a8)),_0x4562f5(0x1bd));}let _0x57976d;if(_0x229eeb){const _0xf63c21=_0x229eeb[_0x4562f5(0x1ea)](',')['map'](_0x3b611a=>_0x3b611a[_0x4562f5(0x1e0)]())[_0x4562f5(0x1e2)](_0x204fba=>_0x204fba[_0x4562f5(0x1de)]>0x0);if(_0xf63c21[_0x4562f5(0x1de)]===0x0)throw CliErrors[_0x4562f5(0x1cb)]('--datasetcode\x20cannot\x20be\x20empty.');console[_0x4562f5(0x1c3)]('\x1b[90m*\x20Generating\x20docs\x20for:\x20'+_0xf63c21[_0x4562f5(0x1bc)](',\x20')+'\x1b[0m'),_0x57976d=_0xf63c21;}render(a29_0x16ec08(ApiDocUI,{'appCode':_0x431e60,'env':_0x879ea2,'output':_0x135cd2,'extraParams':_0x9d7614,'datasetCodes':_0x57976d}));}else{console[_0x4562f5(0x1c3)](API_HELP);throw CliErrors[_0x4562f5(0x1c5)](_0x4562f5(0x1c1)+_0x30d7ec);}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a30_0x46c84b=a30_0x175f;(function(_0x11a90a,_0x347829){const _0x373605=a30_0x175f,_0x40403b=_0x11a90a();while(!![]){try{const _0x37e56d=parseInt(_0x373605(0xd9))/0x1+-parseInt(_0x373605(0xef))/0x2*(-parseInt(_0x373605(0x108))/0x3)+parseInt(_0x373605(0xe8))/0x4+-parseInt(_0x373605(0xf2))/0x5*(-parseInt(_0x373605(0xc6))/0x6)+-parseInt(_0x373605(0xfd))/0x7*(-parseInt(_0x373605(0xf1))/0x8)+parseInt(_0x373605(0xdb))/0x9*(parseInt(_0x373605(0x10b))/0xa)+-parseInt(_0x373605(0xe5))/0xb;if(_0x37e56d===_0x347829)break;else _0x40403b['push'](_0x40403b['shift']());}catch(_0x3bfda0){_0x40403b['push'](_0x40403b['shift']());}}}(a30_0x28e3,0xbc965));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function getConfigPath(_0x5d66cd={}){const _0xf530e1=a30_0x175f,_0xc358a4=_0x5d66cd[_0xf530e1(0xf7)]?_0xf530e1(0xf7):_0xf530e1(0xcb);return resolveWriteConfigPath(_0xc358a4);}function a30_0x175f(_0x3d3e58,_0xef49f3){_0x3d3e58=_0x3d3e58-0xc6;const _0x28e311=a30_0x28e3();let _0x175f0c=_0x28e311[_0x3d3e58];return _0x175f0c;}function a30_0x28e3(){const _0x543707=['config','207ZeaRZS','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','\x20\x20\x20\x20cookie:\x20\x20\x20\x20(set)','App\x20\x22','\x20\x20\x20\x20format:\x20\x20\x20\x20','\x20\x20\x20\x20apiDir:\x20\x20\x20\x20','log','riskLevel','\x22\x20not\x20found.','apiDir','48384754JtzDLV','\x20\x20\x20\x20pageSize:\x20\x20','\x22\x20(appcode:\x20','5175956hChYee','pageSize','\x0aUse\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.','Manage\x20multiple\x20apps\x20in\x20one\x20workspace','keys','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20','locale','4138MQHsjq','\x20\x20\x20\x20locale:\x20\x20\x20\x20','18024nAgZnK','4605wUGPgh','cookie','risklevel','Removed\x20app\x20\x22','--appcode\x20is\x20required\x20when\x20adding\x20an\x20app.','global','env','\x20(global)','Default\x20app\x20changed\x20to\x20\x22','slice','Usage:\x20rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>\x20[--env\x20<env>]\x20[--apiDir\x20<dir>]\x20[--global]','329USUzFo','Usage:\x20rabetbase\x20app\x20use\x20<name>\x20[--global]','Default\x20app\x20set\x20to\x20\x22','pagesize','error','Default:\x20','Configured\x20apps:\x0a','app','appCode','appcode','defaultApp','1773NnbwQr','list','length','615990zYDmZk','Updated','\x22\x20not\x20found.\x20Available:\x20','format','5238heqbwJ','\x20\x20\x20\x20env:\x20\x20\x20\x20\x20\x20\x20','\x20(default)','accesskey','No\x20default\x20app\x20set.\x20Use\x20`rabetbase\x20app\x20use\x20<name>`\x20to\x20set\x20one.','project','apidir','entries','\x20\x20appcode:\x20','\x20\x20\x20\x20accessKey:\x20(set)','\x20--appcode\x20<code>`\x20first.','Set\x20as\x20default\x20app.','exit','Usage:\x20rabetbase\x20app\x20remove\x20<name>\x20[--global]','use','accessKey','apps','\x20\x20env:\x20','Single-app\x20mode:','327598GpipdA'];a30_0x28e3=function(){return _0x543707;};return a30_0x28e3();}function readConfig(_0x130f2a={}){return readConfigFile(getConfigPath(_0x130f2a));}function writeConfig(_0x257a69,_0x4bfaa3={}){writeConfigFile(getConfigPath(_0x4bfaa3),_0x257a69);}function listApps(_0x5332c9){const _0x55f666=a30_0x175f,{apps:_0x53ab93,defaultApp:_0xa51881,currentApp:_0x5f018f}=_0x5332c9[_0x55f666(0xda)],_0xe02efa=Object[_0x55f666(0xcd)](_0x53ab93);if(_0xe02efa[_0x55f666(0x10a)]===0x0){const _0x241e73=_0x5332c9[_0x55f666(0xda)][_0x55f666(0x105)];_0x241e73?(console['log'](_0x55f666(0xd8)),console[_0x55f666(0xe1)](_0x55f666(0xce)+_0x241e73+_0x55f666(0xd7)+_0x5332c9['config'][_0x55f666(0xf8)]),console[_0x55f666(0xe1)](_0x55f666(0xea))):console[_0x55f666(0xe1)](_0x55f666(0xdc));return;}console[_0x55f666(0xe1)](_0x55f666(0x103));for(const [_0x2f6925,_0x4fe6c0]of _0xe02efa){const _0x28381f=_0x2f6925===_0xa51881,_0x2a5edc=_0x2f6925===_0x5f018f,_0x1bba02=_0x2a5edc?'\x20*':_0x28381f?_0x55f666(0xc8):'';console[_0x55f666(0xe1)]('\x20\x20'+_0x2f6925+_0x1bba02),console['log']('\x20\x20\x20\x20appcode:\x20'+_0x4fe6c0[_0x55f666(0x106)]);if(_0x4fe6c0[_0x55f666(0xf8)])console[_0x55f666(0xe1)](_0x55f666(0xc7)+_0x4fe6c0['env']);if(_0x4fe6c0[_0x55f666(0xe4)])console[_0x55f666(0xe1)](_0x55f666(0xe0)+_0x4fe6c0['apiDir']);if(_0x4fe6c0['cookie'])console[_0x55f666(0xe1)](_0x55f666(0xdd));if(_0x4fe6c0[_0x55f666(0xd5)])console[_0x55f666(0xe1)](_0x55f666(0xcf));if(_0x4fe6c0[_0x55f666(0x10e)])console[_0x55f666(0xe1)](_0x55f666(0xdf)+_0x4fe6c0[_0x55f666(0x10e)]);if(_0x4fe6c0[_0x55f666(0xe9)])console[_0x55f666(0xe1)](_0x55f666(0xe6)+_0x4fe6c0[_0x55f666(0xe9)]);if(_0x4fe6c0[_0x55f666(0xe2)])console[_0x55f666(0xe1)]('\x20\x20\x20\x20riskLevel:\x20'+_0x4fe6c0[_0x55f666(0xe2)]);if(_0x4fe6c0[_0x55f666(0xee)])console[_0x55f666(0xe1)](_0x55f666(0xf0)+_0x4fe6c0[_0x55f666(0xee)]);console[_0x55f666(0xe1)]('');}_0xa51881?console[_0x55f666(0xe1)](_0x55f666(0x102)+_0xa51881):console[_0x55f666(0xe1)](_0x55f666(0xca));}function useApp(_0x52db76,_0x550740,_0x16bfaf){const _0x50bb23=a30_0x175f,_0x536323=_0x550740[0x0];!_0x536323&&(console[_0x50bb23(0x101)](_0x50bb23(0xfe)),process[_0x50bb23(0xd2)](0x1));const _0x8e8872=readConfig(_0x16bfaf),_0x2f318d=_0x8e8872[_0x50bb23(0xd6)]||{};if(!_0x2f318d[_0x536323]){const _0x5db2c1=Object['keys'](_0x2f318d);_0x5db2c1['length']===0x0?console[_0x50bb23(0x101)](_0x50bb23(0xed)+_0x536323+_0x50bb23(0xd0)):console[_0x50bb23(0x101)]('App\x20\x22'+_0x536323+_0x50bb23(0x10d)+_0x5db2c1['join'](',\x20')),process[_0x50bb23(0xd2)](0x1);}_0x8e8872[_0x50bb23(0x107)]=_0x536323,writeConfig(_0x8e8872,_0x16bfaf);const _0x2cd464=_0x16bfaf[_0x50bb23(0xf7)]?'\x20(global)':'';console[_0x50bb23(0xe1)](_0x50bb23(0xff)+_0x536323+_0x50bb23(0xe7)+_0x2f318d[_0x536323][_0x50bb23(0x106)]+')'+_0x2cd464);}function addApp(_0x19d5f1,_0x1b81ac,_0x57a13a){const _0x21415f=a30_0x175f,_0x1c652d=_0x1b81ac[0x0];!_0x1c652d&&(console['error'](_0x21415f(0xfc)),process[_0x21415f(0xd2)](0x1));const _0x1e0343=_0x57a13a[_0x21415f(0x106)];!_0x1e0343&&(console[_0x21415f(0x101)](_0x21415f(0xf6)),process['exit'](0x1));const _0x4cc3d7=readConfig(_0x57a13a);if(!_0x4cc3d7[_0x21415f(0xd6)])_0x4cc3d7[_0x21415f(0xd6)]={};const _0x4686cc={'appcode':_0x1e0343};if(_0x57a13a['env'])_0x4686cc[_0x21415f(0xf8)]=_0x57a13a['env'];if(_0x57a13a[_0x21415f(0xe4)]||_0x57a13a[_0x21415f(0xcc)])_0x4686cc[_0x21415f(0xe4)]=_0x57a13a[_0x21415f(0xe4)]||_0x57a13a[_0x21415f(0xcc)];if(_0x57a13a['cookie'])_0x4686cc['cookie']=_0x57a13a[_0x21415f(0xf3)];if(_0x57a13a[_0x21415f(0xd5)]||_0x57a13a[_0x21415f(0xc9)])_0x4686cc[_0x21415f(0xd5)]=_0x57a13a['accessKey']||_0x57a13a[_0x21415f(0xc9)];if(_0x57a13a[_0x21415f(0x10e)])_0x4686cc[_0x21415f(0x10e)]=_0x57a13a['format'];if(_0x57a13a[_0x21415f(0xe9)]||_0x57a13a[_0x21415f(0x100)])_0x4686cc['pageSize']=Number(_0x57a13a[_0x21415f(0xe9)]||_0x57a13a[_0x21415f(0x100)]);if(_0x57a13a[_0x21415f(0xe2)]||_0x57a13a[_0x21415f(0xf4)])_0x4686cc[_0x21415f(0xe2)]=_0x57a13a[_0x21415f(0xe2)]||_0x57a13a['risklevel'];if(_0x57a13a[_0x21415f(0xee)])_0x4686cc[_0x21415f(0xee)]=_0x57a13a[_0x21415f(0xee)];const _0x7b37aa=!!_0x4cc3d7['apps'][_0x1c652d];_0x4cc3d7[_0x21415f(0xd6)][_0x1c652d]=_0x4686cc;!_0x4cc3d7[_0x21415f(0x107)]&&(_0x4cc3d7[_0x21415f(0x107)]=_0x1c652d);writeConfig(_0x4cc3d7,_0x57a13a);const _0x2dd2bd=_0x57a13a['global']?_0x21415f(0xf9):'';console[_0x21415f(0xe1)]((_0x7b37aa?_0x21415f(0x10c):'Added')+'\x20app\x20\x22'+_0x1c652d+_0x21415f(0xe7)+_0x1e0343+')'+_0x2dd2bd),_0x4cc3d7[_0x21415f(0x107)]===_0x1c652d&&!_0x7b37aa&&console[_0x21415f(0xe1)](_0x21415f(0xd1));}function removeApp(_0x5597e3,_0x54ab5b,_0x27b5d4){const _0x4fdf6f=a30_0x175f,_0x20a0d7=_0x54ab5b[0x0];!_0x20a0d7&&(console[_0x4fdf6f(0x101)](_0x4fdf6f(0xd3)),process[_0x4fdf6f(0xd2)](0x1));const _0x3c59db=readConfig(_0x27b5d4);(!_0x3c59db[_0x4fdf6f(0xd6)]||!_0x3c59db[_0x4fdf6f(0xd6)][_0x20a0d7])&&(console[_0x4fdf6f(0x101)](_0x4fdf6f(0xde)+_0x20a0d7+_0x4fdf6f(0xe3)),process['exit'](0x1));delete _0x3c59db['apps'][_0x20a0d7];if(_0x3c59db[_0x4fdf6f(0x107)]===_0x20a0d7){const _0x374581=Object[_0x4fdf6f(0xec)](_0x3c59db[_0x4fdf6f(0xd6)]);_0x3c59db['defaultApp']=_0x374581[_0x4fdf6f(0x10a)]>0x0?_0x374581[0x0]:undefined,_0x3c59db['defaultApp']?console[_0x4fdf6f(0xe1)](_0x4fdf6f(0xfa)+_0x3c59db[_0x4fdf6f(0x107)]+'\x22.'):delete _0x3c59db[_0x4fdf6f(0x107)];}Object[_0x4fdf6f(0xec)](_0x3c59db['apps'])[_0x4fdf6f(0x10a)]===0x0&&(delete _0x3c59db[_0x4fdf6f(0xd6)],delete _0x3c59db[_0x4fdf6f(0x107)]),writeConfig(_0x3c59db,_0x27b5d4),console[_0x4fdf6f(0xe1)](_0x4fdf6f(0xf5)+_0x20a0d7+'\x22.');}export const appCommand={'name':a30_0x46c84b(0x104),'description':a30_0x46c84b(0xeb),async 'run'(_0x5c9c25,_0x1e4d45,_0x1f491f){const _0x5976b5=a30_0x46c84b,_0x172476=_0x1e4d45[0x0],_0x169726=_0x1e4d45[_0x5976b5(0xfb)](0x1);switch(_0x172476){case _0x5976b5(0x109):listApps(_0x5c9c25);break;case _0x5976b5(0xd4):useApp(_0x5c9c25,_0x169726,_0x1f491f);break;case'add':addApp(_0x5c9c25,_0x169726,_0x1f491f);break;case'remove':removeApp(_0x5c9c25,_0x169726,_0x1f491f);break;default:listApps(_0x5c9c25);break;}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a31_0x4f43(_0x4b499a,_0x3a1822){_0x4b499a=_0x4b499a-0x76;const _0x288ac0=a31_0x288a();let _0x4f4313=_0x288ac0[_0x4b499a];return _0x4f4313;}const a31_0x293f35=a31_0x4f43;(function(_0x367ae3,_0xa34664){const _0x26909b=a31_0x4f43,_0x2cd5a9=_0x367ae3();while(!![]){try{const _0xa13d8e=-parseInt(_0x26909b(0x83))/0x1+parseInt(_0x26909b(0x7c))/0x2*(parseInt(_0x26909b(0x7e))/0x3)+parseInt(_0x26909b(0x7f))/0x4*(-parseInt(_0x26909b(0x81))/0x5)+-parseInt(_0x26909b(0x82))/0x6*(-parseInt(_0x26909b(0x76))/0x7)+-parseInt(_0x26909b(0x79))/0x8+parseInt(_0x26909b(0x78))/0x9*(-parseInt(_0x26909b(0x80))/0xa)+parseInt(_0x26909b(0x7b))/0xb*(parseInt(_0x26909b(0x7a))/0xc);if(_0xa13d8e===_0xa34664)break;else _0x2cd5a9['push'](_0x2cd5a9['shift']());}catch(_0x1e17b9){_0x2cd5a9['push'](_0x2cd5a9['shift']());}}}(a31_0x288a,0xa8486));function a31_0x288a(){const _0x2f0dfa=['Authenticate\x20with\x20rabetbase','8324433PjaKJg','2385408iqFdNJ','14724LOvQbT','15543UDofVt','2TUExQk','auth','2005221wdoinm','4pVLnOu','10OJKKae','4756395RQcxXx','4482498tJlhda','285563vPTlTE','7FiVbIM'];a31_0x288a=function(){return _0x2f0dfa;};return a31_0x288a();}import{jsx as a31_0x298607}from'react/jsx-runtime';import{render}from'ink';import{AuthServer}from'../auth/auth-server-ui.js';export const authCommand={'name':a31_0x293f35(0x7d),'description':a31_0x293f35(0x77),async 'run'(_0x1b0fbb,_0x2feb54,_0x4842cf){render(a31_0x298607(AuthServer,{}));}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a32_0x559555=a32_0x3780;(function(_0x54a356,_0x4aa017){const _0x2d7821=a32_0x3780,_0x5da6cb=_0x54a356();while(!![]){try{const _0x3abd9d=-parseInt(_0x2d7821(0xe4))/0x1*(-parseInt(_0x2d7821(0xf9))/0x2)+-parseInt(_0x2d7821(0xf8))/0x3*(parseInt(_0x2d7821(0xe7))/0x4)+-parseInt(_0x2d7821(0xee))/0x5*(parseInt(_0x2d7821(0xfa))/0x6)+-parseInt(_0x2d7821(0xf6))/0x7*(parseInt(_0x2d7821(0xf7))/0x8)+-parseInt(_0x2d7821(0xe8))/0x9+parseInt(_0x2d7821(0xe9))/0xa+parseInt(_0x2d7821(0xef))/0xb;if(_0x3abd9d===_0x4aa017)break;else _0x5da6cb['push'](_0x5da6cb['shift']());}catch(_0x448956){_0x5da6cb['push'](_0x5da6cb['shift']());}}}(a32_0x46d2,0x69346));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a32_0x46d2(){const _0x430e5e=['Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','trashDir','split','toISOString','length','find','bff','keys','projectRoot','No\x20lock\x20entry\x20found\x20for\x20\x22','string','Deleted\x20','31EhTcch','validation','trashedTo','60jIKDia','2111652dwDAYP','5509940dSIlgE','scriptsRoot','Function\x20not\x20found:\x20','target','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','10CqMkkr','20362210WjNhcc','lastSync','scriptsWorkspaceRoot','str','delete','map','join','1135589GgOFSX','32MbFKBI','53394njnLTm','1832QhPEPo','2547228IeWvfY','functions','\x20(local\x20file\x20moved\x20to\x20trash)','appCode','includes','lockFilePath','filter','high-risk-write','scriptsRootDir'];a32_0x46d2=function(){return _0x430e5e;};return a32_0x46d2();}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a32_0x3780(_0x14ad89,_0x34b646){_0x14ad89=_0x14ad89-0xdf;const _0x46d2c5=a32_0x46d2();let _0x378092=_0x46d2c5[_0x14ad89];return _0x378092;}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a32_0x559555(0x109),'command':'delete','description':a32_0x559555(0xed),'risk':a32_0x559555(0x101),'flags':[{'name':'target','type':a32_0x559555(0xe2),'required':!![],'description':a32_0x559555(0x103)}],async 'validate'(_0x29ea59){const _0x39ea54=a32_0x559555,_0x4a0f61=loadBffProjectConfig(_0x29ea59[_0x39ea54(0xfd)]),_0x39e2d1=await readBffLockFile(_0x4a0f61[_0x39ea54(0xff)]);if(!_0x39e2d1)throw CliErrors[_0x39ea54(0xe5)]('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'execute'(_0x306e69){const _0x2ce15c=a32_0x559555,_0x51fc02=loadBffProjectConfig(_0x306e69['appCode']),_0x577e54=await readBffLockFile(_0x51fc02[_0x2ce15c(0xff)]);if(!_0x577e54)throw CliErrors[_0x2ce15c(0xe5)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x1c32fd,appLock:_0x1b7776}=ensureLockScope(_0x577e54,_0x51fc02[_0x2ce15c(0xfd)],_0x51fc02[_0x2ce15c(0xea)],_0x2ce15c(0xf3),_0x51fc02['appCode'],_0x51fc02[_0x2ce15c(0xf1)]+'/'+_0x51fc02[_0x2ce15c(0xfd)]),_0x1e5644=_0x306e69[_0x2ce15c(0xf2)](_0x2ce15c(0xec)),_0x528c0b=Object[_0x2ce15c(0xdf)](_0x1b7776[_0x2ce15c(0xfb)]),_0x3c423f=resolveDeleteTarget(_0x1e5644,_0x528c0b),_0x2a807b=_0x1b7776[_0x2ce15c(0xfb)][_0x3c423f];if(!_0x2a807b)throw CliErrors[_0x2ce15c(0xe5)](_0x2ce15c(0xe1)+_0x3c423f+'\x22.');await deleteBffScript(_0x2a807b['remoteId']),delete _0x1b7776['functions'][_0x3c423f],_0x1b7776[_0x2ce15c(0xf0)]=new Date()['toISOString'](),await writeBffLockFile(_0x51fc02[_0x2ce15c(0xff)],_0x1c32fd);const _0x3bae19=resolveLocalFilePathFromLockKey(_0x51fc02,_0x3c423f);let _0x3858ec;await fileExists(_0x3bae19)&&(_0x3858ec=await moveToTrash(_0x51fc02[_0x2ce15c(0xe0)],_0x51fc02[_0x2ce15c(0x104)],_0x3bae19),await cleanupEmptyDirectories(dirname(_0x3bae19),_0x51fc02[_0x2ce15c(0x102)]));const _0x18d66b={'deleted':_0x3c423f,'remoteId':_0x2a807b['remoteId']};if(_0x3858ec)_0x18d66b[_0x2ce15c(0xe6)]=_0x3858ec;return{'ok':!![],'data':_0x18d66b,'message':_0x2ce15c(0xe3)+_0x3c423f+(_0x3858ec?_0x2ce15c(0xfc):'')};}};function resolveDeleteTarget(_0x73f00c,_0x60b91e){const _0x4f0316=a32_0x559555;if(_0x73f00c[_0x4f0316(0xfe)]('/')){const _0x21bf15=_0x60b91e[_0x4f0316(0x108)](_0xfcc829=>_0xfcc829===_0x73f00c);if(!_0x21bf15)throw CliErrors['validation'](_0x4f0316(0xeb)+_0x73f00c);return _0x21bf15;}const _0x4feaf9=_0x60b91e[_0x4f0316(0x100)](_0xe8e89a=>_0xe8e89a[_0x4f0316(0x105)]('/')['at'](-0x1)===_0x73f00c);if(_0x4feaf9[_0x4f0316(0x107)]===0x0)throw CliErrors[_0x4f0316(0xe5)](_0x4f0316(0xeb)+_0x73f00c);if(_0x4feaf9[_0x4f0316(0x107)]>0x1)throw CliErrors['validation']('Multiple\x20functions\x20match\x20\x22'+_0x73f00c+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x4feaf9[_0x4f0316(0xf4)](_0x3ffa51=>'\x20\x20-\x20'+_0x3ffa51)[_0x4f0316(0xf5)]('\x0a'));return _0x4feaf9[0x0];}async function moveToTrash(_0x22cd46,_0x81271f,_0x34d061){const _0x3ea179=a32_0x559555,_0x4378fb=new Date()[_0x3ea179(0x106)]()['replace'](/[:.]/g,'-'),_0x12caf3=relative(_0x22cd46,_0x34d061),_0x1f545d=join(_0x81271f,_0x4378fb,_0x12caf3);return await mkdir(dirname(_0x1f545d),{'recursive':!![]}),await rename(_0x34d061,_0x1f545d),_0x1f545d;}async function cleanupEmptyDirectories(_0xfebb4a,_0x466c76){const _0x3590cc=a32_0x559555;let _0x5dc5b8=resolve(_0xfebb4a);const _0x2037b9=resolve(_0x466c76);while(_0x5dc5b8['startsWith'](''+_0x2037b9+sep)||_0x5dc5b8===_0x2037b9){if(_0x5dc5b8===_0x2037b9)return;try{const _0x2cd56f=await readdir(_0x5dc5b8);if(_0x2cd56f[_0x3590cc(0x107)]>0x0)return;await rmdir(_0x5dc5b8);}catch{return;}_0x5dc5b8=dirname(_0x5dc5b8);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a33_0x343880=a33_0xcf70;function a33_0xcf70(_0x494391,_0x577ecf){_0x494391=_0x494391-0x18e;const _0x3157e3=a33_0x3157();let _0xcf70e1=_0x3157e3[_0x494391];return _0xcf70e1;}function a33_0x3157(){const _0x4a2303=['bool','181966ZdWjvb','3335740xxDkXU','updatedTime','scriptType','4nazTsj','263335UXGWLq','bff','Get\x20BFF\x20script\x20details\x20by\x20ID','number','(none)','Return\x20full\x20raw\x20script\x20object','detail','625839ebeHgo','12eLYZyS','43463aLbxYe','scriptContent','1634424nlLEHC','18AIgdHg','read','434350KMaRvF','appCode','num','Script\x20ID'];a33_0x3157=function(){return _0x4a2303;};return a33_0x3157();}(function(_0x5e16fe,_0x155350){const _0x1a161f=a33_0xcf70,_0x58c090=_0x5e16fe();while(!![]){try{const _0x247264=-parseInt(_0x1a161f(0x199))/0x1+-parseInt(_0x1a161f(0x194))/0x2+parseInt(_0x1a161f(0x1a5))/0x3*(parseInt(_0x1a161f(0x19d))/0x4)+-parseInt(_0x1a161f(0x19e))/0x5*(parseInt(_0x1a161f(0x18e))/0x6)+-parseInt(_0x1a161f(0x18f))/0x7+-parseInt(_0x1a161f(0x191))/0x8+-parseInt(_0x1a161f(0x192))/0x9*(-parseInt(_0x1a161f(0x19a))/0xa);if(_0x247264===_0x155350)break;else _0x58c090['push'](_0x58c090['shift']());}catch(_0x163c35){_0x58c090['push'](_0x58c090['shift']());}}}(a33_0x3157,0x27406));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x343880(0x19f),'command':a33_0x343880(0x1a4),'description':a33_0x343880(0x1a0),'risk':a33_0x343880(0x193),'flags':[{'name':'id','type':a33_0x343880(0x1a1),'required':!![],'description':a33_0x343880(0x197)},{'name':'verbose','type':'boolean','description':a33_0x343880(0x1a3)}],async 'execute'(_0x37c58a){const _0x4a02fb=a33_0x343880,_0x123c35=await getBffScriptInfo(_0x37c58a[_0x4a02fb(0x196)]('id')),_0x3bb81f=_0x37c58a[_0x4a02fb(0x198)]('verbose');if(_0x3bb81f)return{'ok':!![],'data':_0x123c35};return{'ok':!![],'data':{'id':_0x123c35['id'],'appCode':_0x123c35[_0x4a02fb(0x195)],'scriptType':_0x123c35[_0x4a02fb(0x19c)],'description':_0x123c35['description']||_0x4a02fb(0x1a2),'createdTime':_0x123c35['createdTime']??'','updatedTime':_0x123c35[_0x4a02fb(0x19b)]??'','scriptContent':_0x123c35[_0x4a02fb(0x190)]??''}};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4ec2ae,_0x389a9d){const _0x23853f=a34_0x30fa,_0x662cbf=_0x4ec2ae();while(!![]){try{const _0x498e26=parseInt(_0x23853f(0x17f))/0x1*(-parseInt(_0x23853f(0x17e))/0x2)+parseInt(_0x23853f(0x183))/0x3*(-parseInt(_0x23853f(0x17a))/0x4)+parseInt(_0x23853f(0x185))/0x5*(-parseInt(_0x23853f(0x180))/0x6)+parseInt(_0x23853f(0x181))/0x7*(parseInt(_0x23853f(0x17b))/0x8)+parseInt(_0x23853f(0x17d))/0x9*(parseInt(_0x23853f(0x182))/0xa)+-parseInt(_0x23853f(0x184))/0xb+parseInt(_0x23853f(0x17c))/0xc;if(_0x498e26===_0x389a9d)break;else _0x662cbf['push'](_0x662cbf['shift']());}catch(_0x562461){_0x662cbf['push'](_0x662cbf['shift']());}}}(a34_0x2c13,0x8d609));import{bffList}from'./list.js';function a34_0x30fa(_0x180d23,_0x1c7706){_0x180d23=_0x180d23-0x17a;const _0x2c1323=a34_0x2c13();let _0x30fa51=_0x2c1323[_0x180d23];return _0x30fa51;}import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';function a34_0x2c13(){const _0x3adcac=['92SUVIxb','1144YggXuN','21405468adTaZE','18ZxsZTS','107452OljAZk','18ymOCmv','17490vmjIWd','53011lSlTXl','267730ZTWUBU','125766nlwgCc','3002054eDJMZk','235DTLBfo'];a34_0x2c13=function(){return _0x3adcac;};return a34_0x2c13();}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a35_0x260f(_0x2f6516,_0x2afd49){_0x2f6516=_0x2f6516-0x14e;const _0x3dfb9f=a35_0x3dfb();let _0x260fae=_0x3dfb9f[_0x2f6516];return _0x260fae;}const a35_0xbe2acd=a35_0x260f;function a35_0x3dfb(){const _0x49427c=['5890476rqRZvG','Return\x20full\x20script\x20objects','Script\x20type\x20filter','functionName','scriptType','bool','name','description','858609bWbCzw','length','No\x20BFF\x20scripts\x20found.','appCode','(unnamed)','map','string','type','14lwQQql','2620432zYPorT','2368800xRkfjI','199857qrPKPK','9ewjfnO','str','ENDPOINT','verbose','448147mpjEeN','list','COMMON','1078755VYRwRJ'];a35_0x3dfb=function(){return _0x49427c;};return a35_0x3dfb();}(function(_0x390d0f,_0x1f88f1){const _0x45b660=a35_0x260f,_0x5cb359=_0x390d0f();while(!![]){try{const _0x74a4b3=parseInt(_0x45b660(0x151))/0x1+parseInt(_0x45b660(0x159))/0x2*(-parseInt(_0x45b660(0x15c))/0x3)+parseInt(_0x45b660(0x15b))/0x4+parseInt(_0x45b660(0x164))/0x5+-parseInt(_0x45b660(0x165))/0x6+parseInt(_0x45b660(0x161))/0x7+-parseInt(_0x45b660(0x15a))/0x8*(-parseInt(_0x45b660(0x15d))/0x9);if(_0x74a4b3===_0x1f88f1)break;else _0x5cb359['push'](_0x5cb359['shift']());}catch(_0x3f3eb0){_0x5cb359['push'](_0x5cb359['shift']());}}}(a35_0x3dfb,0x94f08));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a35_0xbe2acd(0x162),'description':'List\x20BFF\x20scripts','risk':'read','flags':[{'name':a35_0xbe2acd(0x158),'type':a35_0xbe2acd(0x157),'description':a35_0xbe2acd(0x167),'default':'ENDPOINT','enum':[a35_0xbe2acd(0x15f),a35_0xbe2acd(0x163)]},{'name':a35_0xbe2acd(0x14f),'type':a35_0xbe2acd(0x157),'description':'Filter\x20by\x20script\x20name'},{'name':a35_0xbe2acd(0x160),'type':'boolean','description':a35_0xbe2acd(0x166)}],async 'execute'(_0x11854b){const _0x28dace=a35_0xbe2acd,_0x468660=await listBffScripts(_0x11854b[_0x28dace(0x154)],_0x11854b[_0x28dace(0x15e)]('type'),{'scriptName':_0x11854b[_0x28dace(0x15e)]('name')||undefined}),_0x4729ca=_0x11854b[_0x28dace(0x14e)](_0x28dace(0x160));return{'ok':!![],'data':_0x4729ca?_0x468660:_0x468660[_0x28dace(0x156)](_0x445955=>({'id':_0x445955['id'],'functionName':_0x445955[_0x28dace(0x168)]??'','description':_0x445955[_0x28dace(0x150)]||_0x28dace(0x155),'scriptType':_0x445955[_0x28dace(0x169)]})),'message':_0x468660[_0x28dace(0x152)]===0x0?_0x28dace(0x153):undefined};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a36_0x25f630=a36_0x255b;(function(_0x5edb5d,_0x359b55){const _0x446f93=a36_0x255b,_0x233641=_0x5edb5d();while(!![]){try{const _0x64ceba=-parseInt(_0x446f93(0x16d))/0x1+parseInt(_0x446f93(0x194))/0x2*(-parseInt(_0x446f93(0x19b))/0x3)+-parseInt(_0x446f93(0x1a9))/0x4*(-parseInt(_0x446f93(0x1a6))/0x5)+parseInt(_0x446f93(0x18d))/0x6*(parseInt(_0x446f93(0x153))/0x7)+parseInt(_0x446f93(0x16f))/0x8*(parseInt(_0x446f93(0x1ab))/0x9)+parseInt(_0x446f93(0x188))/0xa*(-parseInt(_0x446f93(0x15e))/0xb)+parseInt(_0x446f93(0x164))/0xc*(parseInt(_0x446f93(0x1a5))/0xd);if(_0x64ceba===_0x359b55)break;else _0x233641['push'](_0x233641['shift']());}catch(_0x5205ed){_0x233641['push'](_0x233641['shift']());}}}(a36_0x2ef0,0x5d397));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a36_0x255b(_0x46d7c5,_0x4ff972){_0x46d7c5=_0x46d7c5-0x153;const _0x2ef051=a36_0x2ef0();let _0x255bff=_0x2ef051[_0x46d7c5];return _0x255bff;}import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';function a36_0x2ef0(){const _0x1ee94b=['isInteger','316584Xxzekc','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','utf8','TODO:\x20add\x20script\x20description','close','function-node','HOOK\x20requires\x20alias/operation/node\x20options.','str','before','tableName','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','after','trim','find','validation','functionNode','No\x20datasets\x20found\x20for\x20this\x20app.','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','scriptsRootDir','Invalid\x20dataset\x20selection.','operationType','Available:\x20','nonInteractive','3260NmryAW','datasetCode','File\x20already\x20exists:\x20','apiDir','question','2958342lFtMMV','\x20function:\x20','No\x20api.ts\x20found.\x20Run\x20`','Dataset\x20not\x20found\x20for\x20code\x20\x22','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x22\x20not\x20found.\x20','84122haNVAy','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','description','Script\x20type','map','Script\x20description','3sAzoKp','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x20api\x20pull`\x20to\x20refresh.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','new','Operation\x20type\x20\x22','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Available\x20aliases:\x20','HOOK','13LbrQhB','5BBGLzf','\x22\x20not\x20found\x20for\x20dataset\x20','alias','1043492xXdTNX','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','117KmaBQR','appCode','name','Select\x20trigger\x20node:','operation-type','7cQDuEn','Invalid\x20function\x20name\x20\x22','Select\x20dataset:','datasetcode','COMMON','Select\x20operation\x20type:','join','string','\x0a\x20*\x20[触发节点]\x20','length','write','23045uuwAcP','ENDPOINT','keys','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x22.\x20','type','5200716QaRNwK','stderr','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','includes','.js','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Trigger\x20node\x20(HOOK\x20only)','594894DTnSjK'];a36_0x2ef0=function(){return _0x1ee94b;};return a36_0x2ef0();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':'bff','command':a36_0x25f630(0x19f),'description':a36_0x25f630(0x17b),'risk':a36_0x25f630(0x15d),'flags':[{'name':a36_0x25f630(0x163),'type':a36_0x25f630(0x15a),'required':!![],'enum':[a36_0x25f630(0x157),a36_0x25f630(0x15f),a36_0x25f630(0x1a4)],'description':a36_0x25f630(0x198)},{'name':a36_0x25f630(0x1ad),'type':a36_0x25f630(0x15a),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':'string','description':a36_0x25f630(0x19a)},{'name':a36_0x25f630(0x1a8),'type':a36_0x25f630(0x15a),'description':a36_0x25f630(0x1a1)},{'name':'datasetcode','type':a36_0x25f630(0x15a),'description':a36_0x25f630(0x17a)},{'name':a36_0x25f630(0x1af),'type':a36_0x25f630(0x15a),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a36_0x25f630(0x174),'type':'string','description':a36_0x25f630(0x16c),'enum':['before',a36_0x25f630(0x17c)]}],async 'validate'(_0x4989ca){const _0x339cf4=a36_0x25f630,_0x7b2b56=_0x4989ca['str']('name');if(!isValidBffFunctionName(_0x7b2b56))throw CliErrors[_0x339cf4(0x17f)](_0x339cf4(0x154)+_0x7b2b56+_0x339cf4(0x19e));},async 'execute'(_0x122bbf){const _0x20642b=a36_0x25f630,_0x236823=loadBffProjectConfig(_0x122bbf['appCode']),_0x18e08c=_0x122bbf['str'](_0x20642b(0x163)),_0x11c816=_0x122bbf[_0x20642b(0x176)]('name'),_0x393695=_0x122bbf[_0x20642b(0x176)]('description')||undefined,_0x144b32=_0x18e08c===_0x20642b(0x1a4)?await resolveHookOptions(_0x236823,_0x122bbf):undefined,_0x214388=buildFilePath(_0x236823,_0x18e08c,_0x11c816,_0x144b32);if(await fileExists(_0x214388))throw CliErrors['validation'](_0x20642b(0x18a)+_0x214388);await mkdir(dirname(_0x214388),{'recursive':!![]});const _0x30bc37=generateTemplate(_0x18e08c,_0x11c816,_0x236823,_0x393695,_0x144b32);await writeFile(_0x214388,_0x30bc37,_0x20642b(0x171));const _0xe4e5c5={'type':_0x18e08c,'name':_0x11c816,'path':_0x214388};if(_0x393695)_0xe4e5c5[_0x20642b(0x197)]=_0x393695;if(_0x144b32){if(_0x144b32[_0x20642b(0x1a8)])_0xe4e5c5[_0x20642b(0x1a8)]=_0x144b32['alias'];_0xe4e5c5[_0x20642b(0x189)]=_0x144b32['datasetCode'],_0xe4e5c5[_0x20642b(0x185)]=_0x144b32[_0x20642b(0x185)],_0xe4e5c5[_0x20642b(0x180)]=_0x144b32[_0x20642b(0x180)];}return{'ok':!![],'data':_0xe4e5c5,'message':'Created\x20'+_0x18e08c+_0x20642b(0x18e)+_0x11c816};}};async function resolveHookOptions(_0x52e69b,_0x3a1618){const _0xe0ff70=a36_0x25f630,_0x1969cf=loadAliasMap(_0x3a1618[_0xe0ff70(0x18b)]),_0x4eb93f=_0x1969cf['length']>0x0;let _0x101ca7,_0x56e044,_0x13247b;const _0x2f3020=_0x3a1618[_0xe0ff70(0x176)](_0xe0ff70(0x1a8)),_0x53578f=_0x3a1618[_0xe0ff70(0x176)](_0xe0ff70(0x156));if(_0x2f3020){const _0x3f8482=resolveAlias(_0x3a1618[_0xe0ff70(0x18b)],_0x2f3020);if(!_0x3f8482){const _0x15a0ad=_0x4eb93f?_0xe0ff70(0x1a3)+_0x1969cf['map'](_0x39c454=>_0x39c454[_0xe0ff70(0x1a8)])[_0xe0ff70(0x159)](',\x20'):_0xe0ff70(0x18f)+CLI_BIN_NAME+_0xe0ff70(0x167);throw CliErrors[_0xe0ff70(0x17f)]('Alias\x20\x22'+_0x2f3020+_0xe0ff70(0x193)+_0x15a0ad);}_0x101ca7=_0x2f3020,_0x56e044=_0x3f8482;}else{if(_0x53578f){_0x56e044=_0x53578f;const _0x2f2c5f=_0x1969cf[_0xe0ff70(0x17e)](_0x132605=>_0x132605[_0xe0ff70(0x189)]===_0x53578f);_0x101ca7=_0x2f2c5f?.[_0xe0ff70(0x1a8)];}else{if(_0x3a1618[_0xe0ff70(0x187)])throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x170));else{if(_0x4eb93f){const _0x1f7d89=_0x1969cf[_0xe0ff70(0x199)](_0x54ddf3=>_0x54ddf3[_0xe0ff70(0x1a8)]+'\x20('+_0x54ddf3[_0xe0ff70(0x178)]+')'),_0x209e24=await promptSelect(_0xe0ff70(0x155),_0x1f7d89),_0xf722a3=_0x1969cf[_0x209e24];if(!_0xf722a3)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x101ca7=_0xf722a3['alias'],_0x56e044=_0xf722a3[_0xe0ff70(0x189)];}else{const _0x30f5ce=await listDatasets(_0x52e69b[_0xe0ff70(0x1ac)]);if(_0x30f5ce[_0xe0ff70(0x15c)]===0x0)throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x181));const _0x4a5667=_0x30f5ce[_0xe0ff70(0x199)](_0x5c7cf1=>_0x5c7cf1['name']+'\x20('+_0x5c7cf1['code']+')'),_0x23b889=await promptSelect(_0xe0ff70(0x155),_0x4a5667),_0x54c549=_0x30f5ce[_0x23b889];if(!_0x54c549)throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x184));_0x56e044=_0x54c549['code'],_0x101ca7=undefined;}}}}const _0x260d32=await listDatasets(_0x52e69b[_0xe0ff70(0x1ac)]),_0x2289ea=_0x260d32[_0xe0ff70(0x17e)](_0x57d654=>_0x57d654['code']===_0x56e044);if(!_0x2289ea)throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x190)+_0x56e044+_0xe0ff70(0x162)+(_0x101ca7?_0xe0ff70(0x1a2)+CLI_BIN_NAME+_0xe0ff70(0x19d):''));_0x13247b=_0x2289ea['id'];const _0x4cfb32=_0x101ca7??_0x56e044,_0x3bbdbe=await listBffDatasetOperations(_0x52e69b['appCode'],_0x13247b),_0x1f6834=_0x3bbdbe?Object[_0xe0ff70(0x160)](_0x3bbdbe):[];if(_0x1f6834[_0xe0ff70(0x15c)]===0x0)throw CliErrors[_0xe0ff70(0x17f)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x4cfb32+'.');let _0x89bcd7;const _0x309922=_0x3a1618['str'](_0xe0ff70(0x1af));if(_0x309922){if(!_0x1f6834[_0xe0ff70(0x169)](_0x309922))throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x1a0)+_0x309922+_0xe0ff70(0x1a7)+_0x4cfb32+'.\x20'+(_0xe0ff70(0x186)+_0x1f6834[_0xe0ff70(0x159)](',\x20')));_0x89bcd7=_0x309922;}else{if(_0x3a1618[_0xe0ff70(0x187)])throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x168));const _0x589ce5=await promptSelect(_0xe0ff70(0x158),_0x1f6834);_0x89bcd7=_0x1f6834[_0x589ce5]??_0x1f6834[0x0];}let _0x443a3c=normalizeHookFunctionNode(_0x3a1618[_0xe0ff70(0x176)]('function-node'));if(!_0x443a3c){if(_0x3a1618[_0xe0ff70(0x176)](_0xe0ff70(0x174)))throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x1aa));if(_0x3a1618[_0xe0ff70(0x187)])throw CliErrors['validation'](_0xe0ff70(0x166));const _0x27c385=await promptSelect(_0xe0ff70(0x1ae),[_0xe0ff70(0x177),_0xe0ff70(0x17c)]);_0x443a3c=[_0xe0ff70(0x177),'after'][_0x27c385]??_0xe0ff70(0x177);}return{'alias':_0x101ca7,'datasetCode':_0x56e044,'datasetId':_0x13247b,'operationType':_0x89bcd7,'functionNode':_0x443a3c};}async function promptSelect(_0x3ddace,_0x4b55fa){const _0x1e6e60=a36_0x25f630;if(_0x4b55fa['length']===0x1)return 0x0;for(const [_0x1326c5,_0x338c63]of _0x4b55fa['entries']()){process['stderr'][_0x1e6e60(0x15d)]('\x20\x20'+(_0x1326c5+0x1)+'.\x20'+_0x338c63+'\x0a');}const _0x485d0a=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x56ce27=await new Promise(_0x32d706=>{const _0x48f8f5=_0x1e6e60;_0x485d0a[_0x48f8f5(0x18c)](_0x3ddace+'\x20',_0x32d706);}),_0xb7f284=Number['parseInt'](_0x56ce27[_0x1e6e60(0x17d)](),0xa);if(Number[_0x1e6e60(0x16e)](_0xb7f284)&&_0xb7f284>=0x1&&_0xb7f284<=_0x4b55fa[_0x1e6e60(0x15c)])return _0x485d0a[_0x1e6e60(0x173)](),_0xb7f284-0x1;process[_0x1e6e60(0x165)]['write'](_0x1e6e60(0x195)+_0x4b55fa[_0x1e6e60(0x15c)]+'.\x0a');}}function buildFilePath(_0x14ea0f,_0x13d5db,_0x1b1b86,_0x457dee){const _0x724238=a36_0x25f630;if(_0x13d5db===_0x724238(0x1a4)){if(!_0x457dee)throw CliErrors['validation'](_0x724238(0x175));const _0x409544=_0x457dee[_0x724238(0x1a8)]??_0x457dee[_0x724238(0x189)];return join(_0x14ea0f[_0x724238(0x183)],_0x724238(0x1a4),_0x409544,_0x457dee[_0x724238(0x185)],_0x457dee[_0x724238(0x180)],_0x1b1b86+_0x724238(0x16a));}return join(_0x14ea0f['scriptsRootDir'],_0x13d5db,_0x1b1b86+_0x724238(0x16a));}function generateTemplate(_0x3b2c9b,_0x4ff647,_0x514dce,_0x58030f,_0x4f6749){const _0x324ece=a36_0x25f630,_0x469670=_0x58030f?.[_0x324ece(0x17d)]()||_0x324ece(0x172);if(_0x3b2c9b==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x469670+'\x0a\x20*\x20[脚本名称]\x20'+_0x4ff647+_0x324ece(0x179)+_0x4ff647+'.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x4ff647+_0x324ece(0x191);if(_0x3b2c9b==='ENDPOINT')return _0x324ece(0x182)+_0x469670+_0x324ece(0x16b)+_0x514dce[_0x324ece(0x1ac)]+'/endpoint/'+_0x4ff647+_0x324ece(0x192)+_0x4ff647+'(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x4f6749)throw CliErrors[_0x324ece(0x17f)](_0x324ece(0x196));return _0x324ece(0x19c)+_0x469670+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x514dce[_0x324ece(0x1ac)]+'/'+_0x4f6749[_0x324ece(0x189)]+'/'+_0x4f6749[_0x324ece(0x185)]+_0x324ece(0x15b)+_0x4f6749['functionNode']+_0x324ece(0x161)+_0x4ff647+'(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a37_0x4a596e=a37_0x2c97;(function(_0x3af404,_0x484aee){const _0x4abf7d=a37_0x2c97,_0x39919f=_0x3af404();while(!![]){try{const _0x11dcf0=-parseInt(_0x4abf7d(0x18f))/0x1+-parseInt(_0x4abf7d(0x1b5))/0x2+-parseInt(_0x4abf7d(0x190))/0x3+-parseInt(_0x4abf7d(0x188))/0x4+parseInt(_0x4abf7d(0x1a5))/0x5+-parseInt(_0x4abf7d(0x1a4))/0x6+parseInt(_0x4abf7d(0x180))/0x7;if(_0x11dcf0===_0x484aee)break;else _0x39919f['push'](_0x39919f['shift']());}catch(_0x1c56d7){_0x39919f['push'](_0x39919f['shift']());}}}(a37_0x5640,0x65ebf));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x5640(){const _0x532025=['appCode','all','force','functionNode','Pull\x20complete:\x20','filePath','Force\x20pull\x20cancelled.','814648ToAHPI','unresolvable\x20target\x20path','lockKey','Pull\x20only\x20this\x20script\x20type','ENDPOINT','utf8','Force\x20overwrite\x20local\x20unsynced\x20changes','HOOK','map','operationType','hash','13670587qilaad','No\x20remote\x20BFF\x20scripts\x20found.','aliases','length','lastSync','local\x20unsynced\x20changes','\x20file(s)','functionName','960224XfPFlC','functions','stdin','scriptsWorkspaceRoot','scriptsRoot','lockFilePath','close','450688Dpmmpb','1243503qTFVWY','GET','bff','trim','hookLocation','\x20skipped,\x20','bool','fromEntries','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','pull','scriptContent','message','type','boolean','push','alias','Remote\x20script\x20missing\x20content.','entries','question','nonInteractive','2231436pkxXoC','1745025vBgmMY','Remote\x20script\x20missing\x20id.','apiDir','string','\x20pulled,\x20','datasetCode','str','apps','scriptType'];a37_0x5640=function(){return _0x532025;};return a37_0x5640();}import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a37_0x4a596e(0x192),'command':a37_0x4a596e(0x199),'description':a37_0x4a596e(0x198),'risk':'write','flags':[{'name':'type','type':a37_0x4a596e(0x1a8),'description':a37_0x4a596e(0x178),'enum':['COMMON',a37_0x4a596e(0x179),a37_0x4a596e(0x17c)]},{'name':'force','type':a37_0x4a596e(0x19d),'description':a37_0x4a596e(0x17b)}],async 'dryRun'(_0x530096){const _0x3d242c=a37_0x4a596e,_0xf0e2bf=loadBffProjectConfig(_0x530096['appCode']),_0x407761=await readBffLockFile(_0xf0e2bf[_0x3d242c(0x18d)]),{appLock:_0x19d693}=ensureLockScope(_0x407761??createEmptyBffLock(),_0xf0e2bf[_0x3d242c(0x1ae)],_0xf0e2bf[_0x3d242c(0x18c)],_0x3d242c(0x199),_0xf0e2bf['appCode'],_0xf0e2bf['scriptsWorkspaceRoot']+'/'+_0xf0e2bf[_0x3d242c(0x1ae)]),_0x1077c6=buildDatasetCodeToAliasMap(_0x530096[_0x3d242c(0x1a7)]),_0x557502=normalizeBffType(_0x530096[_0x3d242c(0x1ab)](_0x3d242c(0x19c)))??undefined,[_0x280148,_0x3e2088]=await Promise[_0x3d242c(0x1af)]([listBffScripts(_0x530096['appCode'],_0x557502),getBffScriptStatistics(_0x530096[_0x3d242c(0x1ae)])]),_0x16342f=createHookLocationMap(_0x3e2088),_0x338e5d=[];for(const _0x5bf826 of _0x280148){const _0xd8fe8d=resolveRemoteScriptTarget(_0xf0e2bf,_0x5bf826,_0x16342f,_0x19d693[_0x3d242c(0x189)],_0x1077c6);if(_0xd8fe8d)_0x338e5d['push'](_0xd8fe8d[_0x3d242c(0x177)]);}return{'method':_0x3d242c(0x191),'url':'/api/management/library/scripts/list','body':{'scripts':_0x338e5d,'appCode':_0x530096[_0x3d242c(0x1ae)]},'description':'Would\x20pull\x20'+_0x338e5d['length']+_0x3d242c(0x186)};},async 'execute'(_0x5e3085){const _0x1f137e=a37_0x4a596e,_0x5c92f5=loadBffProjectConfig(_0x5e3085[_0x1f137e(0x1ae)]),_0x1c0981=await readBffLockFile(_0x5c92f5['lockFilePath']),{lockData:_0x2ce346,appLock:_0x48d910}=ensureLockScope(_0x1c0981??createEmptyBffLock(),_0x5c92f5[_0x1f137e(0x1ae)],_0x5c92f5[_0x1f137e(0x18c)],_0x1f137e(0x199),_0x5c92f5['appCode'],_0x5c92f5[_0x1f137e(0x18b)]+'/'+_0x5c92f5[_0x1f137e(0x1ae)]),_0x186fb1=normalizeBffType(_0x5e3085[_0x1f137e(0x1ab)](_0x1f137e(0x19c)))??undefined;if(_0x5e3085['str']('type')&&!_0x186fb1)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x343366,_0x437a79]=await Promise[_0x1f137e(0x1af)]([listBffScripts(_0x5e3085['appCode'],_0x186fb1),getBffScriptStatistics(_0x5e3085[_0x1f137e(0x1ae)])]);if(_0x343366[_0x1f137e(0x183)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1f137e(0x181)};const _0x11ff35=_0x5e3085[_0x1f137e(0x196)](_0x1f137e(0x1b0));if(_0x11ff35&&!_0x5e3085['nonInteractive']){const _0x311870=await confirmForce();if(!_0x311870)throw CliErrors['cancelled'](_0x1f137e(0x1b4));}if(_0x11ff35&&_0x5e3085[_0x1f137e(0x1a3)]){}const _0x51a87f=buildDatasetCodeToAliasMap(_0x5e3085[_0x1f137e(0x1a7)]),_0x3f357a=createHookLocationMap(_0x437a79),_0x9cec18=cloneLockData(_0x2ce346),_0x1d6710=_0x9cec18['apps'][_0x5c92f5[_0x1f137e(0x1ae)]],_0xba69b7=[],_0x1c79e7=[],_0x135730=[];for(const _0x21abfa of _0x343366){const _0x58ce32=resolveRemoteScriptTarget(_0x5c92f5,_0x21abfa,_0x3f357a,_0x48d910[_0x1f137e(0x189)],_0x51a87f);if(!_0x58ce32){_0x1c79e7[_0x1f137e(0x19e)]({'lockKey':_0x21abfa[_0x1f137e(0x1ad)]+'/'+_0x21abfa[_0x1f137e(0x187)],'reason':_0x1f137e(0x176)});continue;}const _0x4a0dc0=_0x48d910[_0x1f137e(0x189)][_0x58ce32[_0x1f137e(0x177)]];try{if(!_0x11ff35){const _0x181119=await hasUnsyncedLocalChanges(_0x58ce32[_0x1f137e(0x1b3)],_0x4a0dc0);if(_0x181119){_0x1c79e7['push']({'lockKey':_0x58ce32[_0x1f137e(0x177)],'reason':_0x1f137e(0x185)});continue;}}if(!_0x21abfa['id'])throw new Error(_0x1f137e(0x1a6));if(_0x21abfa[_0x1f137e(0x19a)]==null)throw new Error(_0x1f137e(0x1a0));const _0x75cdb7=_0x21abfa['scriptContent'];await ensureParentDirectory(_0x58ce32[_0x1f137e(0x1b3)]),await writeFile(_0x58ce32[_0x1f137e(0x1b3)],_0x75cdb7,_0x1f137e(0x17a));const _0x30f882={'hash':computeContentHash(_0x75cdb7),'remoteId':_0x21abfa['id'],'version':_0x21abfa['version']};_0x58ce32[_0x1f137e(0x19c)]==='HOOK'&&_0x58ce32[_0x1f137e(0x194)]&&(_0x30f882[_0x1f137e(0x19f)]=_0x58ce32['hookLocation'][_0x1f137e(0x19f)],_0x30f882[_0x1f137e(0x1aa)]=_0x58ce32[_0x1f137e(0x194)][_0x1f137e(0x1aa)],_0x30f882[_0x1f137e(0x17e)]=_0x58ce32[_0x1f137e(0x194)][_0x1f137e(0x17e)],_0x30f882[_0x1f137e(0x1b1)]=_0x58ce32[_0x1f137e(0x194)]['functionNode']),_0x1d6710[_0x1f137e(0x189)][_0x58ce32[_0x1f137e(0x177)]]=_0x30f882,_0xba69b7[_0x1f137e(0x19e)]({'lockKey':_0x58ce32[_0x1f137e(0x177)],'remoteId':_0x21abfa['id']});}catch(_0x1cc5a2){_0x135730[_0x1f137e(0x19e)]({'lockKey':_0x58ce32[_0x1f137e(0x177)],'error':_0x1cc5a2 instanceof Error?_0x1cc5a2[_0x1f137e(0x19b)]:String(_0x1cc5a2)});}}return _0x1d6710[_0x1f137e(0x184)]=new Date()['toISOString'](),await writeBffLockFile(_0x5c92f5[_0x1f137e(0x18d)],_0x9cec18),{'ok':_0x135730['length']===0x0,'data':{'pulled':_0xba69b7,'skipped':_0x1c79e7,'failed':_0x135730},'message':_0x1f137e(0x1b2)+_0xba69b7[_0x1f137e(0x183)]+_0x1f137e(0x1a9)+_0x1c79e7[_0x1f137e(0x183)]+_0x1f137e(0x195)+_0x135730[_0x1f137e(0x183)]+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0xffe11e,_0x141776){const _0x19df37=a37_0x4a596e;if(!await fileExists(_0xffe11e))return![];const _0x5d3f05=await computeFileHash(_0xffe11e);if(!_0x141776)return!![];return _0x5d3f05!==_0x141776[_0x19df37(0x17f)];}function cloneLockData(_0x5f1cdd){const _0x349451=a37_0x4a596e;return{'aliases':{..._0x5f1cdd[_0x349451(0x182)]},'apps':Object[_0x349451(0x197)](Object[_0x349451(0x1a1)](_0x5f1cdd[_0x349451(0x1ac)])['map'](([_0x2be8db,_0x563f4d])=>[_0x2be8db,{'scriptsRoot':_0x563f4d['scriptsRoot'],'lastSync':_0x563f4d[_0x349451(0x184)],'functions':{..._0x563f4d[_0x349451(0x189)]}}]))};}function a37_0x2c97(_0x27a4c7,_0x53defd){_0x27a4c7=_0x27a4c7-0x176;const _0x5640da=a37_0x5640();let _0x2c976b=_0x5640da[_0x27a4c7];return _0x2c976b;}function buildDatasetCodeToAliasMap(_0x3a8e62){const _0x2d321a=a37_0x4a596e,_0x31f4f9=loadAliasMap(_0x3a8e62);return new Map(_0x31f4f9[_0x2d321a(0x17d)](_0x448790=>[_0x448790[_0x2d321a(0x1aa)],_0x448790['alias']]));}async function confirmForce(){const _0x3df7b3=a37_0x4a596e,_0x38dae5=createInterface({'input':process[_0x3df7b3(0x18a)],'output':process['stderr']}),_0x158f59=await new Promise(_0x5ca460=>{const _0x1d1b5d=_0x3df7b3;_0x38dae5[_0x1d1b5d(0x1a2)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x5ca460);});return _0x38dae5[_0x3df7b3(0x18e)](),['y','yes']['includes'](_0x158f59[_0x3df7b3(0x193)]()['toLowerCase']());}
|