@lovrabet/rabetbase-cli 2.0.2-beta.1 → 2.0.2-beta.10
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/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -0
- package/lib/commands/api/index.js +1 -0
- package/lib/commands/api/list.js +1 -0
- package/lib/commands/api/pull.js +1 -0
- package/lib/commands/app.js +1 -1
- package/lib/commands/auth.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/cli-update.js +1 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/flags.js +1 -0
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -0
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/menu/index.js +1 -0
- package/lib/commands/menu/shared/compare-table.js +1 -0
- package/lib/commands/menu/shared/index.js +1 -0
- package/lib/commands/menu/shared/inquirer.js +1 -0
- package/lib/commands/menu/shared/local-pages.js +1 -0
- package/lib/commands/menu/shared/logic.js +1 -0
- package/lib/commands/menu/shared/service.js +1 -0
- package/lib/commands/menu/shared/sync-core.js +1 -0
- package/lib/commands/menu/shared/update-core.js +1 -0
- package/lib/commands/menu/shared/valid-url.js +1 -0
- package/lib/commands/menu/sync.js +1 -0
- package/lib/commands/menu/update.js +1 -0
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +7 -4
- package/templates/generate-api/api.ts.tpl +4 -4
- package/templates/generate-api/client.ts.tpl +2 -2
- package/lib/ai-setup/config.js +0 -1
- package/lib/api/api-doc-ui.js +0 -1
- package/lib/api/api-pull-ui.js +0 -1
- package/lib/api/main.js +0 -1
- package/lib/api/pull-silent.js +0 -1
- package/lib/app-menu/app-menu-sync-ui.js +0 -1
- package/lib/app-menu/create-menu.js +0 -1
- package/lib/app-menu/get-local-pages.js +0 -1
- package/lib/app-menu/get-online-menu-list.js +0 -1
- package/lib/app-menu/types.js +0 -1
- package/lib/app-menu/use-get-online-menu-list.js +0 -1
- package/lib/app-menu/utils.js +0 -1
- package/lib/app-menu/valid-url.js +0 -1
- package/lib/app-menu-update-cdn/current-content.js +0 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +0 -1
- package/lib/app-menu-update-cdn/main.js +0 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
- package/lib/commands/api.js +0 -1
- package/lib/commands/mcp.js +0 -1
- package/lib/commands/menu.js +0 -1
- package/lib/mcp/McpInstallUI.js +0 -1
- package/lib/mcp/claude.js +0 -1
- package/lib/mcp/cursor.js +0 -1
- package/lib/mcp/main.js +0 -1
- package/lib/mcp/mcp-install-non-interactive.js +0 -1
- package/lib/mcp/mcp-installer.js +0 -1
- package/lib/ui/IDESelector.js +0 -1
- package/lib/ui/useIDESelection.js +0 -1
- /package/lib/{app-menu-update-cdn → commands/menu/shared}/types.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xd64b93,_0x2c0141){const _0x59c8c2=a118_0x349a,_0x4e0695=_0xd64b93();while(!![]){try{const _0x3d36ac=-parseInt(_0x59c8c2(0x11f))/0x1*(-parseInt(_0x59c8c2(0x11b))/0x2)+-parseInt(_0x59c8c2(0x129))/0x3*(-parseInt(_0x59c8c2(0x123))/0x4)+-parseInt(_0x59c8c2(0x127))/0x5+parseInt(_0x59c8c2(0x11d))/0x6*(-parseInt(_0x59c8c2(0x11e))/0x7)+parseInt(_0x59c8c2(0x128))/0x8+-parseInt(_0x59c8c2(0x126))/0x9+-parseInt(_0x59c8c2(0x124))/0xa;if(_0x3d36ac===_0x2c0141)break;else _0x4e0695['push'](_0x4e0695['shift']());}catch(_0x148567){_0x4e0695['push'](_0x4e0695['shift']());}}}(a118_0x5194,0x9ea6d));import a118_0x11fc7c from'node:path';function a118_0x349a(_0x28ed1f,_0x1030ea){_0x28ed1f=_0x28ed1f-0x11a;const _0x5194e1=a118_0x5194();let _0x349a00=_0x5194e1[_0x28ed1f];return _0x349a00;}import a118_0xe16b80 from'node:fs';export async function copyDirectory(_0x324a94,_0x252558){const _0x338cb6=a118_0x349a;try{const _0x5f3ef4=a118_0xe16b80['readdirSync'](_0x324a94,{'withFileTypes':!![]});a118_0xe16b80[_0x338cb6(0x120)](_0x252558,{'recursive':!![]});for(const _0x1c7811 of _0x5f3ef4){const _0x180533=a118_0x11fc7c[_0x338cb6(0x121)](_0x324a94,_0x1c7811[_0x338cb6(0x125)]),_0x41eb0c=a118_0x11fc7c['join'](_0x252558,_0x1c7811['name']);_0x1c7811['isDirectory']()?await copyDirectory(_0x180533,_0x41eb0c):a118_0xe16b80[_0x338cb6(0x11c)](_0x180533,_0x41eb0c);}}catch(_0x26a829){console[_0x338cb6(0x11a)](_0x338cb6(0x122),_0x26a829);}}function a118_0x5194(){const _0x11f52b=['14EKYHsa','1241210ENLYPa','mkdirSync','join','复制目录时出错:','123436GeMrTA','2300720NqGXyo','name','4653783DqBRsO','1235790JYaVRW','4237496WpmHjN','39lTovaj','error','2oaYsIt','copyFileSync','1583730kjcDlL'];a118_0x5194=function(){return _0x11f52b;};return a118_0x5194();}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f00b2,_0x226db0){const _0x1460fd=a119_0x3e60,_0x358406=_0x5f00b2();while(!![]){try{const _0x11b726=-parseInt(_0x1460fd(0xe6))/0x1*(parseInt(_0x1460fd(0xe3))/0x2)+-parseInt(_0x1460fd(0xe4))/0x3+-parseInt(_0x1460fd(0xe2))/0x4+-parseInt(_0x1460fd(0xe7))/0x5+parseInt(_0x1460fd(0xe0))/0x6+-parseInt(_0x1460fd(0xdf))/0x7*(parseInt(_0x1460fd(0xe1))/0x8)+parseInt(_0x1460fd(0xe5))/0x9*(parseInt(_0x1460fd(0xe8))/0xa);if(_0x11b726===_0x226db0)break;else _0x358406['push'](_0x358406['shift']());}catch(_0x12d98d){_0x358406['push'](_0x358406['shift']());}}}(a119_0x1147,0x4c88c));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';function a119_0x3e60(_0x8cd015,_0x53d31d){_0x8cd015=_0x8cd015-0xde;const _0x1147a0=a119_0x1147();let _0x3e604f=_0x1147a0[_0x8cd015];return _0x3e604f;}import{join}from'node:path';export async function copyDir(_0x4461aa,_0x579b0a){const _0x47328f=a119_0x3e60,_0x1bfa0c=statSync(_0x4461aa);if(_0x1bfa0c[_0x47328f(0xde)]()){!existsSync(_0x579b0a)&&mkdirSync(_0x579b0a,{'recursive':!![]});const _0x335073=readdirSync(_0x4461aa);for(const _0x13f1b8 of _0x335073){await copyDir(join(_0x4461aa,_0x13f1b8),join(_0x579b0a,_0x13f1b8));}}else copyFileSync(_0x4461aa,_0x579b0a);}function a119_0x1147(){const _0x40f1f2=['624180fmsSxl','13768wFmbXe','1709380tPySfy','523442ysYYJU','1694241snBCqp','4194NEpBss','2rBRHHP','2877355Ugmuro','53170oEcVje','isDirectory','721QwKnUW'];a119_0x1147=function(){return _0x40f1f2;};return a119_0x1147();}export function ensureDir(_0x5e226d){!existsSync(_0x5e226d)&&mkdirSync(_0x5e226d,{'recursive':!![]});}export function pathExists(_0x319544){return existsSync(_0x319544);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x5479d3=a120_0x255c;(function(_0x396d7e,_0xbbb649){const _0x7b72e4=a120_0x255c,_0x377bf0=_0x396d7e();while(!![]){try{const _0x105f13=-parseInt(_0x7b72e4(0x104))/0x1*(-parseInt(_0x7b72e4(0x103))/0x2)+-parseInt(_0x7b72e4(0xe4))/0x3*(-parseInt(_0x7b72e4(0xee))/0x4)+-parseInt(_0x7b72e4(0xe7))/0x5*(parseInt(_0x7b72e4(0xf2))/0x6)+parseInt(_0x7b72e4(0xfa))/0x7+-parseInt(_0x7b72e4(0xe3))/0x8*(parseInt(_0x7b72e4(0xea))/0x9)+-parseInt(_0x7b72e4(0xf8))/0xa+parseInt(_0x7b72e4(0x101))/0xb;if(_0x105f13===_0xbbb649)break;else _0x377bf0['push'](_0x377bf0['shift']());}catch(_0x1cf8bb){_0x377bf0['push'](_0x377bf0['shift']());}}}(a120_0x22cf,0x90b7c));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x582c07=a120_0x255c,_0x2f8c0f=getTemplateBaseUrl();return _0x2f8c0f+_0x582c07(0xfb);}function a120_0x255c(_0x2ea887,_0x29cac7){_0x2ea887=_0x2ea887-0xe2;const _0x22cf6f=a120_0x22cf();let _0x255cc0=_0x22cf6f[_0x2ea887];return _0x255cc0;}function a120_0x22cf(){const _0x5e5ba8=['3MKPtIa','keys','content','5GiEnYO','replace','.lovrabet/skill/guides','189AKfnnS','CDN\x20返回数据格式错误','length','CDN\x20请求失败:\x20','2046188OYQjcx','entries','extendContent','join','198666nLolaG','title','utf-8','skillTemplate','.md','statusText','11431370YCGTRS','.lovrabet','1232588wqxqrz','/skills/guides.json','path','lastUpdated','cache','\x0a\x0a>更新时间:','status','6300019hzGnRO','trimEnd','65822SRGCRi','29SMBiQE','object','guides','169816lygrYV'];a120_0x22cf=function(){return _0x5e5ba8;};return a120_0x22cf();}const CACHE_DIR=join(homedir(),a120_0x5479d3(0xf9),a120_0x5479d3(0xfe));export async function fetchGuidesFromCDN(){const _0x1187ed=a120_0x5479d3,_0x54392d=getGuidesCdnUrl(),_0x24425f=await fetch(_0x54392d,{'headers':{'Accept':'application/json'}});if(!_0x24425f['ok'])throw new Error(_0x1187ed(0xed)+_0x24425f[_0x1187ed(0x100)]+'\x20'+_0x24425f[_0x1187ed(0xf7)]);const _0x18d647=await _0x24425f['json']();if(!_0x18d647['guides']||typeof _0x18d647[_0x1187ed(0xe2)]!==_0x1187ed(0x105))throw new Error(_0x1187ed(0xeb));return _0x18d647;}export function writeGuidesToProject(_0x25c4cd,_0x2daccb,_0x239e41=a120_0x5479d3(0xe9),_0x5463f8){const _0x343370=a120_0x5479d3,_0x5851c0=join(_0x2daccb,_0x239e41);mkdirSync(_0x5851c0,{'recursive':!![]});for(const [_0x152321,_0x1c1f22]of Object[_0x343370(0xef)](_0x25c4cd[_0x343370(0xe2)])){let _0x54bac7=_0x1c1f22[_0x343370(0xe6)];_0x1c1f22[_0x343370(0xfd)]&&(_0x54bac7=appendUpdateTime(_0x54bac7,_0x1c1f22['lastUpdated'])),writeFileSync(join(_0x5851c0,_0x152321+_0x343370(0xf6)),_0x54bac7,'utf-8');}}export function appendUpdateTime(_0x346ee5,_0x22aa45){const _0x4ab8ca=a120_0x5479d3;return _0x346ee5=_0x346ee5[_0x4ab8ca(0xe8)](/\n*>更新时间:.*$/m,''),_0x346ee5[_0x4ab8ca(0x102)]()+(_0x4ab8ca(0xff)+_0x22aa45);}export function getSkillTemplate(_0x46610a){const _0x25cab8=a120_0x5479d3;return _0x46610a[_0x25cab8(0xf5)]?.[_0x25cab8(0xe6)]||'';}export function appendExtendContents(_0x12e131,_0x622a3,_0x4e8dce){const _0x10be38=a120_0x5479d3,_0x3697fe=[];for(const [,_0x59a306]of Object[_0x10be38(0xef)](_0x622a3[_0x10be38(0xe2)])){_0x59a306['extendContent']&&_0x3697fe['push'](_0x59a306[_0x10be38(0xf0)][_0x10be38(0x102)]());}if(_0x3697fe[_0x10be38(0xec)]===0x0)return _0x12e131;return _0x12e131[_0x10be38(0x102)]()+'\x0a\x0a'+_0x3697fe[_0x10be38(0xf1)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x2e1899,_0x10017a,_0x3c0f66){const _0x3379a6=a120_0x5479d3,_0x5d68af=getSkillTemplate(_0x2e1899);if(!_0x5d68af)throw new Error('CDN\x20数据中缺少\x20skillTemplate');const _0x4e4d27=dirname(_0x10017a);mkdirSync(_0x4e4d27,{'recursive':!![]});let _0x537d30=_0x5d68af['replace'](/\{\{IDE_NAME\}\}/g,_0x3c0f66);_0x537d30=appendExtendContents(_0x537d30,_0x2e1899),_0x2e1899['skillTemplate'][_0x3379a6(0xfd)]&&(_0x537d30=appendUpdateTime(_0x537d30,_0x2e1899['skillTemplate'][_0x3379a6(0xfd)])),writeFileSync(_0x10017a,_0x537d30,_0x3379a6(0xf4));}export async function installGuides(_0x2d0bd4){const _0x301e83=a120_0x5479d3,_0x3540eb=await fetchGuidesFromCDN();return writeGuidesToProject(_0x3540eb,_0x2d0bd4),Object[_0x301e83(0xe5)](_0x3540eb[_0x301e83(0xe2)])[_0x301e83(0xec)];}export function getGuidesSummary(_0x1eba8e){const _0x402dd6=a120_0x5479d3;return Object[_0x402dd6(0xef)](_0x1eba8e[_0x402dd6(0xe2)])['map'](([_0x5ea783,_0x5751b1])=>({'key':_0x5ea783,'title':_0x5751b1[_0x402dd6(0xf3)],'path':_0x5751b1[_0x402dd6(0xfc)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b588d,_0x3b36d5){const _0x421829=a121_0x2539,_0x328746=_0x1b588d();while(!![]){try{const _0x5cd233=parseInt(_0x421829(0x188))/0x1+parseInt(_0x421829(0x175))/0x2*(-parseInt(_0x421829(0x18b))/0x3)+-parseInt(_0x421829(0x174))/0x4*(-parseInt(_0x421829(0x17a))/0x5)+-parseInt(_0x421829(0x181))/0x6*(parseInt(_0x421829(0x178))/0x7)+parseInt(_0x421829(0x17e))/0x8*(parseInt(_0x421829(0x189))/0x9)+-parseInt(_0x421829(0x18c))/0xa+-parseInt(_0x421829(0x176))/0xb;if(_0x5cd233===_0x3b36d5)break;else _0x328746['push'](_0x328746['shift']());}catch(_0x3b43c1){_0x328746['push'](_0x328746['shift']());}}}(a121_0x5267,0x44d5d));function a121_0x2539(_0x1eac57,_0x983145){_0x1eac57=_0x1eac57-0x174;const _0x5267f0=a121_0x5267();let _0x2539ff=_0x5267f0[_0x1eac57];return _0x2539ff;}export async function httpRequest(_0x56630d,_0x492764={}){const _0x3225e0=a121_0x2539,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x492764;let _0x5a2f53=null;for(let _0x4548ef=0x0;_0x4548ef<=retries;_0x4548ef++){try{const _0x56579e=new AbortController(),_0x1444b8=setTimeout(()=>_0x56579e[_0x3225e0(0x192)](),timeout),_0x418b66=await fetch(_0x56630d,{'headers':headers,'signal':_0x56579e['signal']});clearTimeout(_0x1444b8);let _0x5717bf;const _0x291b44=_0x418b66[_0x3225e0(0x179)][_0x3225e0(0x177)](_0x3225e0(0x18e));return _0x291b44?.[_0x3225e0(0x17f)](_0x3225e0(0x186))?_0x5717bf=await _0x418b66[_0x3225e0(0x17c)]():_0x5717bf=await _0x418b66[_0x3225e0(0x17d)](),{'ok':_0x418b66['ok'],'status':_0x418b66[_0x3225e0(0x180)],'statusText':_0x418b66[_0x3225e0(0x191)],'data':_0x5717bf,'headers':_0x418b66[_0x3225e0(0x179)],'url':_0x418b66['url'],'text':()=>_0x418b66[_0x3225e0(0x17d)]()};}catch(_0x282392){_0x5a2f53=_0x282392 instanceof Error?_0x282392:new Error(String(_0x282392));if(_0x4548ef===retries)break;if(shouldRetry(_0x282392)){console[_0x3225e0(0x184)](_0x3225e0(0x18d)+retryDelay+_0x3225e0(0x18f)+(_0x4548ef+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x5a2f53||new Error(_0x3225e0(0x183));}function shouldRetry(_0xf1e832){const _0x524f1a=a121_0x2539;if(_0xf1e832 instanceof Error){if(_0xf1e832['name']===_0x524f1a(0x190))return![];if(_0xf1e832[_0x524f1a(0x193)]===_0x524f1a(0x182)&&_0xf1e832[_0x524f1a(0x185)]['includes'](_0x524f1a(0x17b)))return!![];if(_0xf1e832['message']['includes'](_0x524f1a(0x187)))return!![];if(_0xf1e832['message'][_0x524f1a(0x17f)](_0x524f1a(0x18a)))return![];}return![];}function sleep(_0x249558){return new Promise(_0x36a29a=>setTimeout(_0x36a29a,_0x249558));}function a121_0x5267(){const _0x3e64e3=['headers','5dtnpsS','fetch','json','text','7624BNaKYn','includes','status','702pgLWvn','TypeError','Request\x20failed','log','message','application/json','ECONNRESET','159899cjKGUP','4203wmiNts','ENOTFOUND','156TYJGzM','3068220bfMHjO','*\x20请求失败,','content-type','ms\x20后进行第\x20','AbortError','statusText','abort','name','829228xVVKGy','5090LXZsiC','918951GKvpMq','get','455OKHIzB'];a121_0x5267=function(){return _0x3e64e3;};return a121_0x5267();}export function validateUrl(_0x423312){try{return new URL(_0x423312),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x7b6bf3=a122_0x1868;(function(_0x391dcd,_0x24ffce){const _0x2b549e=a122_0x1868,_0x2d6ba8=_0x391dcd();while(!![]){try{const _0x1e7c50=-parseInt(_0x2b549e(0x20c))/0x1*(parseInt(_0x2b549e(0x1f1))/0x2)+-parseInt(_0x2b549e(0x1e3))/0x3*(-parseInt(_0x2b549e(0x20a))/0x4)+-parseInt(_0x2b549e(0x205))/0x5*(parseInt(_0x2b549e(0x1f8))/0x6)+parseInt(_0x2b549e(0x212))/0x7*(-parseInt(_0x2b549e(0x1eb))/0x8)+-parseInt(_0x2b549e(0x20e))/0x9*(parseInt(_0x2b549e(0x1f0))/0xa)+parseInt(_0x2b549e(0x1e4))/0xb+parseInt(_0x2b549e(0x1e5))/0xc;if(_0x1e7c50===_0x24ffce)break;else _0x2d6ba8['push'](_0x2d6ba8['shift']());}catch(_0x460d1a){_0x2d6ba8['push'](_0x2d6ba8['shift']());}}}(a122_0x4fa2,0xa7a26));import a122_0x29a04d from'winston';import a122_0x403282 from'node:fs';function a122_0x4fa2(){const _0x374fe9=['map','createLogger','toISOString','addColors','message','8048328ZKUZJE','duration','clear','error','transports','10721720EcrZFE','55442YqVqcT','errors','Failed\x20to\x20clear\x20logs:','filter','split','writeFileSync','yellow','570gmCdPz','setRawCommand','readLogs','utf8','clearLogs','initWinstonLogger','blue','success','logFilePath','warn','format','logTask','Failed\x20to\x20read\x20logs:','3790tedrwR','combine','winstonLogger','unknown','command','4IMbwmu','info','5kfJuQM','File','9iFKcog','currentRawCommand','red','parse','7CGTmFv','printf','stringify','.lovrabet.log','existsSync','now','dirname','join','352083UscSCr','10642456hmuFDo','22687212rjNqJB'];a122_0x4fa2=function(){return _0x374fe9;};return a122_0x4fa2();}function a122_0x1868(_0x1c119b,_0x38e714){_0x1c119b=_0x1c119b-0x1e1;const _0x4fa21c=a122_0x4fa2();let _0x186890=_0x4fa21c[_0x1c119b];return _0x186890;}import a122_0x57c32f from'node:path';class Logger{[a122_0x7b6bf3(0x207)];[a122_0x7b6bf3(0x200)];[a122_0x7b6bf3(0x20f)]='';constructor(){const _0x1e5a4d=a122_0x7b6bf3;this[_0x1e5a4d(0x200)]='';}[a122_0x7b6bf3(0x1f9)](_0x4ef319){const _0x55d38c=a122_0x7b6bf3;this[_0x55d38c(0x20f)]=_0x4ef319;}[a122_0x7b6bf3(0x1fd)](){const _0x5c2bd9=a122_0x7b6bf3,_0x36f79a=a122_0x57c32f[_0x5c2bd9(0x1e1)](this[_0x5c2bd9(0x200)]);!a122_0x403282['existsSync'](_0x36f79a)&&a122_0x403282['mkdirSync'](_0x36f79a,{'recursive':!![]});const _0x250568=a122_0x29a04d[_0x5c2bd9(0x202)][_0x5c2bd9(0x206)](a122_0x29a04d[_0x5c2bd9(0x202)]['timestamp'](),a122_0x29a04d[_0x5c2bd9(0x202)][_0x5c2bd9(0x1f2)]({'stack':!![]}),a122_0x29a04d[_0x5c2bd9(0x202)][_0x5c2bd9(0x213)](_0x882c51=>{const _0x455cec=_0x5c2bd9,_0x2334a2={'timestamp':_0x882c51['timestamp']||new Date()[_0x455cec(0x1e8)](),'level':_0x882c51['level']||'info','command':_0x882c51[_0x455cec(0x209)]||_0x455cec(0x208),'rawCommand':_0x882c51['rawCommand']||this[_0x455cec(0x20f)]||undefined,'message':_0x882c51[_0x455cec(0x1ea)]||'','duration':_0x882c51[_0x455cec(0x1ec)]||undefined,'details':_0x882c51['details']||undefined};return JSON[_0x455cec(0x214)](_0x2334a2);}));this[_0x5c2bd9(0x207)]=a122_0x29a04d[_0x5c2bd9(0x1e7)]({'level':_0x5c2bd9(0x20b),'format':_0x250568,'transports':[new a122_0x29a04d[(_0x5c2bd9(0x1ef))][(_0x5c2bd9(0x20d))]({'filename':this['logFilePath'],'level':'info'})],'silent':![]}),a122_0x29a04d[_0x5c2bd9(0x1e9)]({'success':'green','error':_0x5c2bd9(0x210),'warn':_0x5c2bd9(0x1f7),'info':_0x5c2bd9(0x1fe)});}['setLogPath'](_0x498288){const _0x1dcd43=a122_0x7b6bf3;this[_0x1dcd43(0x200)]=a122_0x57c32f[_0x1dcd43(0x1e2)](_0x498288,_0x1dcd43(0x215)),this[_0x1dcd43(0x207)]&&this['winstonLogger'][_0x1dcd43(0x1ed)](),this[_0x1dcd43(0x1fd)]();}['info'](_0x2c6540,_0x327d1f,_0x4ac066){const _0x4ad6b4=a122_0x7b6bf3;if(!this[_0x4ad6b4(0x200)]||!this[_0x4ad6b4(0x207)])return;this[_0x4ad6b4(0x207)][_0x4ad6b4(0x20b)](_0x327d1f,{'command':_0x2c6540,'details':_0x4ac066});}[a122_0x7b6bf3(0x1ff)](_0xf3d8c,_0x585227,_0x258586,_0x40f271){const _0x144813=a122_0x7b6bf3;if(!this['logFilePath']||!this[_0x144813(0x207)])return;this[_0x144813(0x207)]['log'](_0x144813(0x20b),_0x585227,{'level':_0x144813(0x1ff),'command':_0xf3d8c,'duration':_0x258586,'details':_0x40f271});}[a122_0x7b6bf3(0x1ee)](_0x1c4313,_0xdb3391,_0x426300){const _0x16ba3a=a122_0x7b6bf3;if(!this[_0x16ba3a(0x200)]||!this['winstonLogger'])return;this[_0x16ba3a(0x207)][_0x16ba3a(0x1ee)](_0xdb3391,{'command':_0x1c4313,'details':_0x426300});}[a122_0x7b6bf3(0x201)](_0x2daed5,_0xd038ac,_0x4ff03e){const _0x561ae4=a122_0x7b6bf3;if(!this[_0x561ae4(0x200)]||!this[_0x561ae4(0x207)])return;this['winstonLogger'][_0x561ae4(0x201)](_0xd038ac,{'command':_0x2daed5,'details':_0x4ff03e});}async[a122_0x7b6bf3(0x203)](_0x352d9e,_0x51af33,_0x1a3601){const _0x9b73a7=a122_0x7b6bf3,_0x5c6317=Date['now']();this['info'](_0x352d9e,'开始执行:\x20'+_0x51af33);try{const _0x59b11a=await _0x1a3601(),_0x35802f=Date[_0x9b73a7(0x217)]()-_0x5c6317;return this[_0x9b73a7(0x1ff)](_0x352d9e,'完成:\x20'+_0x51af33,_0x35802f),_0x59b11a;}catch(_0xfbce70){const _0x3cbd86=Date[_0x9b73a7(0x217)]()-_0x5c6317;this['error'](_0x352d9e,'失败:\x20'+_0x51af33,{'error':_0xfbce70 instanceof Error?_0xfbce70[_0x9b73a7(0x1ea)]:String(_0xfbce70),'duration':_0x3cbd86});throw _0xfbce70;}}[a122_0x7b6bf3(0x1fa)](){const _0x3d09f2=a122_0x7b6bf3;try{if(!a122_0x403282[_0x3d09f2(0x216)](this[_0x3d09f2(0x200)]))return[];const _0x36de26=a122_0x403282['readFileSync'](this[_0x3d09f2(0x200)],_0x3d09f2(0x1fb));return _0x36de26[_0x3d09f2(0x1f5)]('\x0a')[_0x3d09f2(0x1f4)](_0x53b82e=>_0x53b82e['trim']())[_0x3d09f2(0x1e6)](_0x5080e5=>JSON[_0x3d09f2(0x211)](_0x5080e5));}catch(_0x436499){return console['warn'](_0x3d09f2(0x204),_0x436499),[];}}[a122_0x7b6bf3(0x1fc)](){const _0x340954=a122_0x7b6bf3;try{a122_0x403282[_0x340954(0x216)](this[_0x340954(0x200)])&&a122_0x403282[_0x340954(0x1f6)](this[_0x340954(0x200)],'',_0x340954(0x1fb));}catch(_0x3f1fd3){console[_0x340954(0x201)](_0x340954(0x1f3),_0x3f1fd3);}}['getWinstonInstance'](){const _0x18fdcc=a122_0x7b6bf3;return this[_0x18fdcc(0x207)];}}export const logger=new Logger();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a123_0x1c5a8b=a123_0x59f2;function a123_0x59f2(_0x24fd19,_0x3235bb){_0x24fd19=_0x24fd19-0x17d;const _0x5c4f9a=a123_0x5c4f();let _0x59f205=_0x5c4f9a[_0x24fd19];return _0x59f205;}(function(_0x4b0f7f,_0x2d6a45){const _0x263b60=a123_0x59f2,_0x34a380=_0x4b0f7f();while(!![]){try{const _0x47fec3=parseInt(_0x263b60(0x18b))/0x1*(parseInt(_0x263b60(0x184))/0x2)+parseInt(_0x263b60(0x17d))/0x3*(parseInt(_0x263b60(0x18c))/0x4)+-parseInt(_0x263b60(0x181))/0x5*(-parseInt(_0x263b60(0x188))/0x6)+parseInt(_0x263b60(0x185))/0x7+-parseInt(_0x263b60(0x186))/0x8*(-parseInt(_0x263b60(0x17e))/0x9)+-parseInt(_0x263b60(0x183))/0xa*(-parseInt(_0x263b60(0x187))/0xb)+-parseInt(_0x263b60(0x18a))/0xc*(parseInt(_0x263b60(0x180))/0xd);if(_0x47fec3===_0x2d6a45)break;else _0x34a380['push'](_0x34a380['shift']());}catch(_0x269708){_0x34a380['push'](_0x34a380['shift']());}}}(a123_0x5c4f,0xde04f));function a123_0x5c4f(){const _0x2b2548=['platform','1888430lVgdSu','1031518CvaGYj','1976051zCgsJG','8kIgWui','77pvkYat','1754538IeRVmd','win32','19518888ZvdgCg','1nZzrOb','36ivfkmd','303291dXWsBX','4930803bLiJWT','.cmd','26YkqGbI','10kyIpNM'];a123_0x5c4f=function(){return _0x2b2548;};return a123_0x5c4f();}export const isWindows=process[a123_0x1c5a8b(0x182)]===a123_0x1c5a8b(0x189);export function resolveNpmBin(_0xa0238d){const _0x41a990=a123_0x1c5a8b;return isWindows?_0xa0238d+_0x41a990(0x17f):_0xa0238d;}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xcc18e8,_0x59b435){const _0x39a26d=a124_0x5c74,_0x780166=_0xcc18e8();while(!![]){try{const _0x120bf6=parseInt(_0x39a26d(0x1d0))/0x1+-parseInt(_0x39a26d(0x1d2))/0x2*(-parseInt(_0x39a26d(0x1d5))/0x3)+-parseInt(_0x39a26d(0x1da))/0x4+-parseInt(_0x39a26d(0x1e0))/0x5+-parseInt(_0x39a26d(0x1d8))/0x6+-parseInt(_0x39a26d(0x1df))/0x7*(parseInt(_0x39a26d(0x1e2))/0x8)+parseInt(_0x39a26d(0x1de))/0x9;if(_0x120bf6===_0x59b435)break;else _0x780166['push'](_0x780166['shift']());}catch(_0x437b5e){_0x780166['push'](_0x780166['shift']());}}}(a124_0x3099,0xe9a1f));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x4deb38=a124_0x5c74,_0x2147b4=getTemplateBaseUrl();return _0x2147b4+_0x4deb38(0x1db);}function a124_0x5c74(_0x29b4d7,_0x38e901){_0x29b4d7=_0x29b4d7-0x1cd;const _0x3099d0=a124_0x3099();let _0x5c7441=_0x3099d0[_0x29b4d7];return _0x5c7441;}function a124_0x3099(){const _0x2eb07c=['utf-8','lastUpdated','40100913sUzNzc','57267QNTtMK','2424345vIlPNP','lovrabet_rules.mdc','1528TyLoxx','CDN\x20请求失败:\x20','.cursor/rules','catch','本地模板文件不存在:\x20','CDN\x20返回数据格式错误','63261rQNeWB','content','62654KXoLAC','application/json','statusText','12sGYgcR','string','agents.md','6498384XktREU','json','2227052EcFBJI','/rules/rules.json'];a124_0x3099=function(){return _0x2eb07c;};return a124_0x3099();}const LOCAL_TEMPLATE_PATH=resolve(__dirname,'../../templates/rules/lovrabet_rules.mdc.tpl');export async function fetchRulesFromCDN(){const _0x1c5439=a124_0x5c74,_0x1fa248=getRulesCdnUrl(),_0x299f28=await fetch(_0x1fa248,{'headers':{'Accept':_0x1c5439(0x1d3)}});if(!_0x299f28['ok'])throw new Error(_0x1c5439(0x1e3)+_0x299f28['status']+'\x20'+_0x299f28[_0x1c5439(0x1d4)]);const _0x4e0970=await _0x299f28[_0x1c5439(0x1d9)]();if(!_0x4e0970['content']||typeof _0x4e0970[_0x1c5439(0x1d1)]!==_0x1c5439(0x1d6))throw new Error(_0x1c5439(0x1cf));return _0x4e0970;}export async function getRulesContent(){const _0x16a0ba=a124_0x5c74;try{const _0x178b7e=await fetchRulesFromCDN();return _0x178b7e[_0x16a0ba(0x1d1)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0xba28e0=a124_0x5c74;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0xba28e0(0x1dc));throw new Error(_0xba28e0(0x1ce)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x5dfdb2){const _0x5bc59a=a124_0x5c74,_0x1c2227=await fetchRulesFromCDN()[_0x5bc59a(0x1cd)](()=>null);let _0x35e18a;_0x1c2227?(_0x35e18a=_0x1c2227[_0x5bc59a(0x1d1)],_0x1c2227[_0x5bc59a(0x1dd)]&&(_0x35e18a=appendUpdateTime(_0x35e18a,_0x1c2227['lastUpdated']))):_0x35e18a=readLocalTemplate();const _0x17400d=dirname(_0x5dfdb2);!existsSync(_0x17400d)&&mkdirSync(_0x17400d,{'recursive':!![]}),writeFileSync(_0x5dfdb2,_0x35e18a,_0x5bc59a(0x1dc));}export async function copyRulesToCursor(_0x49f75b){const _0x34e90c=a124_0x5c74,_0x335531=join(_0x49f75b,_0x34e90c(0x1e4)),_0x35534a=join(_0x335531,_0x34e90c(0x1e1));if(existsSync(_0x35534a))return![];return await writeRulesFile(_0x35534a),!![];}export async function copyRulesToAgentsMd(_0x14b258){const _0x2faac1=a124_0x5c74,_0x23b63b=join(_0x14b258,_0x2faac1(0x1d7));if(existsSync(_0x23b63b))return![];return await writeRulesFile(_0x23b63b),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x4252e5){return new Promise(_0x196dfe=>setTimeout(_0x196dfe,_0x4252e5));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x3deb37=a126_0x3b4c;function a126_0x3b4c(_0x5a069a,_0x444b2d){_0x5a069a=_0x5a069a-0x1ab;const _0x24811c=a126_0x2481();let _0x3b4cdf=_0x24811c[_0x5a069a];return _0x3b4cdf;}(function(_0x8da526,_0xaa1118){const _0x2dee05=a126_0x3b4c,_0x5d449d=_0x8da526();while(!![]){try{const _0x36606d=parseInt(_0x2dee05(0x1d4))/0x1+parseInt(_0x2dee05(0x1c5))/0x2+parseInt(_0x2dee05(0x1e1))/0x3+-parseInt(_0x2dee05(0x1ee))/0x4+parseInt(_0x2dee05(0x1ce))/0x5*(parseInt(_0x2dee05(0x1ae))/0x6)+parseInt(_0x2dee05(0x1cd))/0x7+-parseInt(_0x2dee05(0x1b5))/0x8*(parseInt(_0x2dee05(0x1ba))/0x9);if(_0x36606d===_0xaa1118)break;else _0x5d449d['push'](_0x5d449d['shift']());}catch(_0x3728a7){_0x5d449d['push'](_0x5d449d['shift']());}}}(a126_0x2481,0x6652a));import a126_0x13b116 from'node:fs';import a126_0x4f93db from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require('../../package.json')[a126_0x3deb37(0x1f0)];function a126_0x2481(){const _0x3a1411=['replace','pop','\x20},','.tpl','模板内容替换完成','split','readdir','toUpperCase','toLocaleDateString','alias','1905540tahtRK','writeFile','version','readFile','processFile','error','.ts','135168EIJkcC','message','.tsx','开始处理模板内容替换','default','copyFile','utf8','1768gUCcrt','.css','info','charAt','replaceApiContent','67014tyKzAN','.md','datasetCode:\x20\x22','datasetCode','toComponentName','toDisplayTitle','promises','now','toISOString','extname','tableName','1223820HMfUJx','toLocaleTimeString','2-digit','includes','模板内容替换失败','join','\x0a\x20\x20\x20\x20{\x20','.js','5751837VgchPp','50jueyNj','numeric','replaceContent','endsWith','push','toLocaleString','664827JOlZoj','processDirectory','slice','toLowerCase','tableName:\x20\x22','isDirectory','map','success','api','template','name','isFile','name:\x20\x22','652071RPnBDh','.json','processTemplate'];a126_0x2481=function(){return _0x3a1411;};return a126_0x2481();}export class TemplateReplacer{static['toComponentName'](_0x58929e){const _0x3b2dcd=a126_0x3deb37,_0x466c75=_0x58929e[_0x3b2dcd(0x1e9)]('/')[_0x3b2dcd(0x1e5)]()||_0x58929e;return _0x466c75[_0x3b2dcd(0x1e9)]('-')[_0x3b2dcd(0x1da)](_0x52cb58=>_0x52cb58[_0x3b2dcd(0x1b8)](0x0)[_0x3b2dcd(0x1eb)]()+_0x52cb58[_0x3b2dcd(0x1d6)](0x1)[_0x3b2dcd(0x1d7)]())[_0x3b2dcd(0x1ca)]('');}static[a126_0x3deb37(0x1bf)](_0x237137){const _0x2f7c4a=a126_0x3deb37,_0x340b15=_0x237137[_0x2f7c4a(0x1e9)]('/')[_0x2f7c4a(0x1e5)]()||_0x237137;return _0x340b15[_0x2f7c4a(0x1e9)]('-')[_0x2f7c4a(0x1da)](_0x5662e6=>_0x5662e6[_0x2f7c4a(0x1b8)](0x0)[_0x2f7c4a(0x1eb)]()+_0x5662e6[_0x2f7c4a(0x1d6)](0x1)[_0x2f7c4a(0x1d7)]())[_0x2f7c4a(0x1ca)]('\x20');}static[a126_0x3deb37(0x1d0)](_0x3d6ad7,_0x374af0,_0x1cee47){const _0x53dce7=a126_0x3deb37,_0x556f38=this[_0x53dce7(0x1be)](_0x374af0),_0xb4fcc5=this[_0x53dce7(0x1bf)](_0x374af0),_0x7c2811=new Date(),_0xb413f1=_0x7c2811[_0x53dce7(0x1d3)](undefined,{'year':_0x53dce7(0x1cf),'month':_0x53dce7(0x1c7),'day':_0x53dce7(0x1c7),'hour':_0x53dce7(0x1c7),'minute':'2-digit','second':_0x53dce7(0x1c7),'hour12':![]})[_0x53dce7(0x1e4)](/\//g,'-'),_0x2feb6c=_0x7c2811[_0x53dce7(0x1ec)](undefined,{'year':_0x53dce7(0x1cf),'month':_0x53dce7(0x1c7),'day':'2-digit'})[_0x53dce7(0x1e4)](/\//g,'-'),_0x2201a8=_0x7c2811[_0x53dce7(0x1c6)](undefined,{'hour12':![]});let _0x3337e2=_0x3d6ad7['replace'](/\{CliVersion\}/g,CLI_VERSION)[_0x53dce7(0x1e4)](/\{ComponentName\}/g,_0x556f38)[_0x53dce7(0x1e4)](/\{DisplayTitle\}/g,_0xb4fcc5)[_0x53dce7(0x1e4)](/\{PageName\}/g,_0x374af0)[_0x53dce7(0x1e4)](/\{TemplateName\}/g,_0x1cee47)[_0x53dce7(0x1e4)](/\{CreatedAt\}/g,_0xb413f1)['replace'](/\{CreatedDate\}/g,_0x2feb6c)['replace'](/\{CreatedTime\}/g,_0x2201a8);return _0x3337e2;}static[a126_0x3deb37(0x1b9)](_0x5786e8,_0x3da34c,_0x803746,_0x360c4a,_0x1510cc,_0x3461f9,_0x3d25fa,_0x30604e){const _0x41d4a4=a126_0x3deb37,_0x49ae90=new Date(),_0x50d3e0=_0x49ae90[_0x41d4a4(0x1c2)](),_0xf93e92=_0x803746[_0x41d4a4(0x1da)](_0x11dd42=>{const _0x45c7e8=_0x41d4a4,_0x245044=[_0x45c7e8(0x1bc)+_0x11dd42[_0x45c7e8(0x1bd)]+'\x22',_0x45c7e8(0x1d8)+_0x11dd42[_0x45c7e8(0x1c4)]+'\x22',_0x45c7e8(0x1e0)+_0x11dd42['name']+'\x22'];return _0x11dd42[_0x45c7e8(0x1ed)]&&_0x245044[_0x45c7e8(0x1d2)]('alias:\x20\x22'+_0x11dd42[_0x45c7e8(0x1ed)]+'\x22'),_0x45c7e8(0x1cb)+_0x245044[_0x45c7e8(0x1ca)](',\x20')+_0x45c7e8(0x1e6);})['join'](''),_0x5e2856=_0x360c4a||_0x803746[0x0]?.[_0x41d4a4(0x1ed)]||'YourModel';let _0x226803=_0x5786e8['replace'](/\{AppCode\}/g,_0x3da34c)[_0x41d4a4(0x1e4)](/\{ModelConfigs\}/g,_0xf93e92)['replace'](/\{ExampleModelName\}/g,_0x5e2856)[_0x41d4a4(0x1e4)](/\{ApiFileName\}/g,_0x1510cc||_0x41d4a4(0x1dc))[_0x41d4a4(0x1e4)](/\{ConfigName\}/g,_0x3461f9||_0x41d4a4(0x1b2))[_0x41d4a4(0x1e4)](/\{ClientConfigParam\}/g,_0x3d25fa||'')[_0x41d4a4(0x1e4)](/\{VarPrefix\}/g,_0x30604e||'LOVRABET')[_0x41d4a4(0x1e4)](/\{CreatedAt\}/g,_0x50d3e0);return _0x226803;}static async[a126_0x3deb37(0x1e3)](_0x3ce25c,_0x40b283,_0x1d9a83,_0x34a945,_0x3cad8c=!![]){const _0x3e695b=a126_0x3deb37,_0x129d13=Date['now']();try{_0x3cad8c&&logger[_0x3e695b(0x1b7)](_0x3e695b(0x1dd),_0x3e695b(0x1b1),{'templatePath':_0x3ce25c,'targetPath':_0x40b283,'pageName':_0x1d9a83,'templateName':_0x34a945});await a126_0x13b116[_0x3e695b(0x1c0)]['mkdir'](_0x40b283,{'recursive':!![]}),await this[_0x3e695b(0x1d5)](_0x3ce25c,_0x40b283,_0x1d9a83,_0x34a945);if(_0x3cad8c){const _0x3b784a=Date[_0x3e695b(0x1c1)]()-_0x129d13;logger[_0x3e695b(0x1db)](_0x3e695b(0x1dd),_0x3e695b(0x1e8),_0x3b784a,{'pageName':_0x1d9a83,'templateName':_0x34a945});}}catch(_0x2f3c5e){if(_0x3cad8c){const _0x4402bc=Date[_0x3e695b(0x1c1)]()-_0x129d13;logger[_0x3e695b(0x1ac)]('template',_0x3e695b(0x1c9),{'templatePath':_0x3ce25c,'targetPath':_0x40b283,'pageName':_0x1d9a83,'templateName':_0x34a945,'error':_0x2f3c5e instanceof Error?_0x2f3c5e[_0x3e695b(0x1af)]:String(_0x2f3c5e),'duration':_0x4402bc});}throw _0x2f3c5e;}}static async['processDirectory'](_0x95e947,_0x549026,_0xf56a93,_0x282aa5){const _0x458c4e=a126_0x3deb37,_0x4314d7=await a126_0x13b116[_0x458c4e(0x1c0)][_0x458c4e(0x1ea)](_0x95e947,{'withFileTypes':!![]});for(const _0x50b3e0 of _0x4314d7){const _0x582856=a126_0x4f93db['join'](_0x95e947,_0x50b3e0[_0x458c4e(0x1de)]);let _0x740b23=a126_0x4f93db[_0x458c4e(0x1ca)](_0x549026,_0x50b3e0['name']);_0x50b3e0['name'][_0x458c4e(0x1d1)](_0x458c4e(0x1e7))&&(_0x740b23=a126_0x4f93db[_0x458c4e(0x1ca)](_0x549026,_0x50b3e0[_0x458c4e(0x1de)]['replace'](/\.tpl$/,'')));if(_0x50b3e0[_0x458c4e(0x1d9)]())await a126_0x13b116[_0x458c4e(0x1c0)]['mkdir'](_0x740b23,{'recursive':!![]}),await this[_0x458c4e(0x1d5)](_0x582856,_0x740b23,_0xf56a93,_0x282aa5);else _0x50b3e0[_0x458c4e(0x1df)]()&&await this[_0x458c4e(0x1ab)](_0x582856,_0x740b23,_0xf56a93,_0x282aa5);}}static async['processFile'](_0x58d993,_0x40bc58,_0x407564,_0x2cec3b){const _0x3afd27=a126_0x3deb37,_0x15c10a=a126_0x4f93db[_0x3afd27(0x1c3)](_0x58d993)[_0x3afd27(0x1d7)]();_0x58d993[_0x3afd27(0x1d1)](_0x3afd27(0x1e7))&&(_0x40bc58=_0x40bc58[_0x3afd27(0x1e4)](/\.tpl$/,''));const _0x34b829=[_0x3afd27(0x1b0),_0x3afd27(0x1ad),'.jsx',_0x3afd27(0x1cc),_0x3afd27(0x1e2),_0x3afd27(0x1bb),_0x3afd27(0x1b6),'.scss',_0x3afd27(0x1e7)];if(_0x34b829[_0x3afd27(0x1c8)](_0x15c10a)||_0x58d993[_0x3afd27(0x1d1)](_0x3afd27(0x1e7))){const _0x4dccda=await a126_0x13b116['promises'][_0x3afd27(0x1f1)](_0x58d993,'utf8'),_0x16f3b3=this[_0x3afd27(0x1d0)](_0x4dccda,_0x407564,_0x2cec3b);await a126_0x13b116[_0x3afd27(0x1c0)][_0x3afd27(0x1ef)](_0x40bc58,_0x16f3b3,_0x3afd27(0x1b4));}else await a126_0x13b116[_0x3afd27(0x1c0)][_0x3afd27(0x1b3)](_0x58d993,_0x40bc58);}}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.0.2-beta.
|
|
3
|
+
"version": "2.0.2-beta.10",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git@codeup.aliyun.com:yuntoo/open/rabetbase-cli.git"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"rabetbase": "lib/cli.js"
|
|
11
|
-
"lovrabet": "lib/cli.js"
|
|
10
|
+
"rabetbase": "lib/cli.js"
|
|
12
11
|
},
|
|
13
12
|
"type": "module",
|
|
14
13
|
"module": "lib/cli.js",
|
|
@@ -51,13 +50,17 @@
|
|
|
51
50
|
"sidecar"
|
|
52
51
|
],
|
|
53
52
|
"dependencies": {
|
|
53
|
+
"@inquirer/prompts": "^8.3.2",
|
|
54
54
|
"@types/winston": "^2.4.4",
|
|
55
|
+
"@lovrabet/otel-logger": "1.0.1-beta.2",
|
|
56
|
+
"chalk": "^5.6.2",
|
|
55
57
|
"execa": "^9.6.0",
|
|
56
58
|
"ink": "^6.2.3",
|
|
57
59
|
"ink-spinner": "^5.0.0",
|
|
58
60
|
"javascript-obfuscator": "^4.1.1",
|
|
59
61
|
"listr": "^0.14.3",
|
|
60
62
|
"meow": "^13.2.0",
|
|
63
|
+
"ora": "^9.3.0",
|
|
61
64
|
"prettier": "^3.6.2",
|
|
62
65
|
"react": "^19.2.0",
|
|
63
66
|
"semver": "^7.7.3",
|
|
@@ -74,4 +77,4 @@
|
|
|
74
77
|
"typescript": "latest",
|
|
75
78
|
"vitest": "^3.2.4"
|
|
76
79
|
}
|
|
77
|
-
}
|
|
80
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { registerModels, CONFIG_NAMES, type ModelsConfig } from "@lovrabet/sdk";
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const {VarPrefix}_APP_CODE = "{AppCode}";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* 项目的模型配置
|
|
@@ -18,8 +18,8 @@ export const RABETBASE_APP_CODE = "{AppCode}";
|
|
|
18
18
|
* - 标准访问:client.models.dataset_[datasetCode]
|
|
19
19
|
* - 别名访问:client.models.[alias](如果配置了 alias)
|
|
20
20
|
*/
|
|
21
|
-
export const
|
|
22
|
-
appCode:
|
|
21
|
+
export const {VarPrefix}_MODELS_CONFIG: ModelsConfig = {
|
|
22
|
+
appCode: {VarPrefix}_APP_CODE,
|
|
23
23
|
models: [{ModelConfigs}
|
|
24
24
|
]
|
|
25
25
|
} as const;
|
|
@@ -28,7 +28,7 @@ export const RABETBASE_MODELS_CONFIG: ModelsConfig = {
|
|
|
28
28
|
* 自动注册配置
|
|
29
29
|
* 配置名称: {ConfigName}
|
|
30
30
|
*/
|
|
31
|
-
registerModels(
|
|
31
|
+
registerModels({VarPrefix}_MODELS_CONFIG, {ConfigName});
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* 如果需要支持多项目或多环境,可以注册额外的配置:
|
|
@@ -48,8 +48,8 @@ export const lovrabetClient = createClient({ClientConfigParam});
|
|
|
48
48
|
* export const prodClient = createClient('prod');
|
|
49
49
|
*
|
|
50
50
|
* 3. 直接传入配置对象:
|
|
51
|
-
* import {
|
|
52
|
-
* export const lovrabetClient = createClient(
|
|
51
|
+
* import { {VarPrefix}_MODELS_CONFIG } from './api';
|
|
52
|
+
* export const lovrabetClient = createClient({VarPrefix}_MODELS_CONFIG);
|
|
53
53
|
*
|
|
54
54
|
* 4. 通过 ClientConfig 指定配置名和其他选项:
|
|
55
55
|
* export const lovrabetClient = createClient({
|
package/lib/ai-setup/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a0_0x8fa46e=a0_0x15da;(function(_0x23b022,_0x12795d){const _0x4e7d09=a0_0x15da,_0x470d12=_0x23b022();while(!![]){try{const _0x61a09d=-parseInt(_0x4e7d09(0x1a0))/0x1*(-parseInt(_0x4e7d09(0x18b))/0x2)+parseInt(_0x4e7d09(0x1ac))/0x3+parseInt(_0x4e7d09(0x1b0))/0x4*(parseInt(_0x4e7d09(0x19b))/0x5)+-parseInt(_0x4e7d09(0x191))/0x6+parseInt(_0x4e7d09(0x193))/0x7*(parseInt(_0x4e7d09(0x198))/0x8)+parseInt(_0x4e7d09(0x19c))/0x9*(-parseInt(_0x4e7d09(0x1b8))/0xa)+parseInt(_0x4e7d09(0x18a))/0xb*(-parseInt(_0x4e7d09(0x199))/0xc);if(_0x61a09d===_0x12795d)break;else _0x470d12['push'](_0x470d12['shift']());}catch(_0x2042c7){_0x470d12['push'](_0x470d12['shift']());}}}(a0_0x1b27,0xd7ef2));function a0_0x1b27(){const _0x5d6b21=['Written\x20.cursor/mcp.json','.cursor','22SzlwzI','234MyCOCh','mcp-install','Other','app','message','join','733074TxmEfq','@lovrabet/dataset-mcp-server@latest','812595EwpYPh','cursor','\x20\x20\x20\x20\x20\x20\x20\x20\x22RABETBASE_APP_CODE\x22:\x20\x22','stringify','utf-8','88tclMoU','4472940qGivvG','mcpServers','60105iTimgx','27jXcfOk','info','\x20\x20\x20\x20\x22','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','6276wSvfmc','mcp.json','\x0a📋\x20Other\x20IDE\x20MCP\x20configuration:\x0a','\x20\x20}','\x20-e\x20RABETBASE_APP_CODE=','production','Configuration\x20guide\x20displayed','Unsupported\x20MCP\x20IDE:\x20','\x0a📋\x20Run\x20the\x20following\x20command\x20to\x20configure\x20Claude\x20Code\x20MCP:\x0a','\x20-e\x20RABETBASE_ENV=','\x22:\x20{','error','1198161dwaLUX','Appcode\x20must\x20be\x20configured\x20first','success','RABETBASE_ENV','332iJCkSi','log','appcode','\x20\x20\x20\x20}','\x20\x20\x22mcpServers\x22:\x20{','cwd','claude','parse','5520740IkrBpl','Please\x20run:\x20','env','Cursor\x20MCP\x20configuration\x20failed','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','npx','claude\x20mcp\x20add\x20','map','Cursor','\x20\x20\x20\x20\x20\x20}','\x20\x20Environment:\x20','manual'];a0_0x1b27=function(){return _0x5d6b21;};return a0_0x1b27();}import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{join}from'node:path';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{copyRulesToAgentsMd,copyRulesToCursor}from'../utils/rules-cdn.js';function a0_0x15da(_0x545993,_0x29f4c2){_0x545993=_0x545993-0x187;const _0x1b2725=a0_0x1b27();let _0x15da0f=_0x1b2725[_0x545993];return _0x15da0f;}import{normalizeEnv}from'../constant/env.js';const MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a0_0x8fa46e(0x1bd),MCP_ARGS=[a0_0x8fa46e(0x192)];export function buildEnvConfig(_0x2c6921,_0x2bcf55){const _0x1d67fb=a0_0x8fa46e,_0x3aa954={'RABETBASE_APP_CODE':String(_0x2c6921)};return _0x2bcf55!=='production'&&(_0x3aa954[_0x1d67fb(0x1af)]=String(_0x2bcf55)),_0x3aa954;}export async function configureCursorMcp(_0x5e057a){const _0x18336c=a0_0x8fa46e,_0xbe4c1f=_0x5e057a||process['cwd'](),_0x126ec0=readConfig(_0xbe4c1f),_0x4d6e93=_0x126ec0[_0x18336c(0x1b2)]||_0x126ec0[_0x18336c(0x18e)],_0x17ae64=normalizeEnv(_0x126ec0[_0x18336c(0x1ba)]||_0x18336c(0x1a5));if(!_0x4d6e93)return{'ide':_0x18336c(0x1c0),'status':'error','message':_0x18336c(0x1ad)};const _0x36620e=buildEnvConfig(_0x4d6e93,_0x17ae64),_0x889a43={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x36620e},_0x3b6f1e=join(_0xbe4c1f,_0x18336c(0x189),_0x18336c(0x1a1)),_0x5684fc=join(_0xbe4c1f,_0x18336c(0x189));try{!existsSync(_0x5684fc)&&mkdirSync(_0x5684fc,{'recursive':!![]});let _0x350349={'mcpServers':{}};if(existsSync(_0x3b6f1e)){const _0x7c8e43=readFileSync(_0x3b6f1e,_0x18336c(0x197));_0x350349=JSON[_0x18336c(0x1b7)](_0x7c8e43);}return(!_0x350349['mcpServers']||typeof _0x350349[_0x18336c(0x19a)]!=='object')&&(_0x350349[_0x18336c(0x19a)]={}),_0x350349[_0x18336c(0x19a)][MCP_SERVER_NAME]=_0x889a43,writeFileSync(_0x3b6f1e,JSON[_0x18336c(0x196)](_0x350349,null,0x2),_0x18336c(0x197)),logger[_0x18336c(0x19d)](_0x18336c(0x18c),'Cursor\x20MCP\x20configured\x20successfully',{'appcode':_0x4d6e93,'env':_0x17ae64,'path':_0x3b6f1e}),await copyRulesToCursor(_0xbe4c1f),{'ide':_0x18336c(0x1c0),'status':_0x18336c(0x1ae),'message':_0x18336c(0x188)};}catch(_0x2d5e1e){return logger[_0x18336c(0x1ab)](_0x18336c(0x18c),_0x18336c(0x1bb),{'error':_0x2d5e1e instanceof Error?_0x2d5e1e[_0x18336c(0x18f)]:String(_0x2d5e1e)}),{'ide':_0x18336c(0x1c0),'status':'error','message':_0x2d5e1e instanceof Error?_0x2d5e1e[_0x18336c(0x18f)]:String(_0x2d5e1e)};}}export async function configureClaudeMcp(_0x29e8b8){const _0x33d086=a0_0x8fa46e,_0x2a28ec=_0x29e8b8||process[_0x33d086(0x1b5)](),_0x42ba6c=readConfig(_0x2a28ec),_0x19478e=_0x42ba6c['appcode']||_0x42ba6c['app'],_0x55ecc3=normalizeEnv(_0x42ba6c[_0x33d086(0x1ba)]||_0x33d086(0x1a5));if(!_0x19478e)return{'ide':'Claude\x20Code','status':_0x33d086(0x1ab),'message':_0x33d086(0x1ad)};let _0xd4eea5=_0x33d086(0x1be)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x33d086(0x190)]('\x20')+_0x33d086(0x1a4)+_0x19478e;return _0x55ecc3!==_0x33d086(0x1a5)&&(_0xd4eea5+=_0x33d086(0x1a9)+_0x55ecc3),await copyRulesToAgentsMd(_0x2a28ec),logger[_0x33d086(0x19d)](_0x33d086(0x18c),'Claude\x20Code\x20MCP\x20command\x20generated',{'command':_0xd4eea5,'appcode':_0x19478e,'env':_0x55ecc3}),console[_0x33d086(0x1b1)](_0x33d086(0x1a8)),console['log']('\x20\x20'+_0xd4eea5+'\x0a'),console[_0x33d086(0x1b1)]('Configuration:'),console[_0x33d086(0x1b1)]('\x20\x20AppCode:\x20'+_0x19478e),_0x55ecc3!==_0x33d086(0x1a5)&&console['log'](_0x33d086(0x1c2)+_0x55ecc3),console['log']('\x20\x20Restart\x20Claude\x20Code\x20to\x20take\x20effect\x0a'),{'ide':'Claude\x20Code','status':_0x33d086(0x187),'message':_0x33d086(0x1b9)+_0xd4eea5};}export async function showOtherGuide(_0x17b27b){const _0x3de0e6=a0_0x8fa46e,_0x1dc9f4=_0x17b27b||process[_0x3de0e6(0x1b5)](),_0x20645d=readConfig(_0x1dc9f4),_0x2e56b8=_0x20645d['appcode']||_0x20645d[_0x3de0e6(0x18e)],_0xd66fd7=normalizeEnv(_0x20645d[_0x3de0e6(0x1ba)]||_0x3de0e6(0x1a5));if(!_0x2e56b8)return{'ide':_0x3de0e6(0x18d),'status':_0x3de0e6(0x1ab),'message':_0x3de0e6(0x1ad)};return console[_0x3de0e6(0x1b1)](_0x3de0e6(0x1a2)),console[_0x3de0e6(0x1b1)]('{'),console[_0x3de0e6(0x1b1)](_0x3de0e6(0x1b4)),console['log'](_0x3de0e6(0x19e)+MCP_SERVER_NAME+_0x3de0e6(0x1aa)),console[_0x3de0e6(0x1b1)]('\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22'+MCP_COMMAND+'\x22,'),console[_0x3de0e6(0x1b1)](_0x3de0e6(0x19f)+MCP_ARGS[_0x3de0e6(0x1bf)](_0x181f0c=>'\x22'+_0x181f0c+'\x22')[_0x3de0e6(0x190)](',\x20')+'],'),console[_0x3de0e6(0x1b1)](_0x3de0e6(0x1bc)),console[_0x3de0e6(0x1b1)](_0x3de0e6(0x195)+_0x2e56b8+'\x22,'),_0xd66fd7!==_0x3de0e6(0x1a5)&&console[_0x3de0e6(0x1b1)]('\x20\x20\x20\x20\x20\x20\x20\x20\x22RABETBASE_ENV\x22:\x20\x22'+_0xd66fd7+'\x22,'),console[_0x3de0e6(0x1b1)](_0x3de0e6(0x1c1)),console['log'](_0x3de0e6(0x1b3)),console[_0x3de0e6(0x1b1)](_0x3de0e6(0x1a3)),console[_0x3de0e6(0x1b1)]('}\x0a'),logger[_0x3de0e6(0x19d)](_0x3de0e6(0x18c),_0x3de0e6(0x1a6),{'appcode':_0x2e56b8,'env':_0xd66fd7}),{'ide':_0x3de0e6(0x18d),'status':_0x3de0e6(0x187),'message':'Configuration\x20guide\x20displayed'};}export async function configureMcp(_0x1d3b1f,_0x4a6351){const _0x405763=a0_0x8fa46e;switch(_0x1d3b1f){case _0x405763(0x194):return await configureCursorMcp(_0x4a6351);case _0x405763(0x1b6):return await configureClaudeMcp(_0x4a6351);default:throw new Error(_0x405763(0x1a7)+_0x1d3b1f);}}
|
package/lib/api/api-doc-ui.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function a1_0x51e4(){const _0x574496=['\x20datasets','length','success','70395nxKdIE','env','./docs','Generating\x20','log','\x20login\x20again\x20and\x20retry','\x1b[33m!\x20The\x20following\x20dataset\x20codes\x20do\x20not\x20exist:\x20','55280GYWKKa','\x20matching\x20datasets\x20from\x20','\x1b[0m','Using\x20configured\x20AppCode:\x20','No\x20datasets\x20found','Doc\x20generation\x20failed:\x20','25629810ImzcBh','The\x20following\x20datasets\x20failed\x20to\x20generate:','All\x20specified\x20dataset\x20codes\x20do\x20not\x20exist:\x20','gray','filter','文档生成完成','Using\x20specified\x20AppCode:\x20','20480soFkfZ','join','Generating\x20docs\x20for\x20','red','datasetCode','15798618ZKoOJT','\x20total\x1b[0m','*\x20Output\x20directory:\x20','[ERROR]\x20','cyan','Fetching\x20dataset\x20list...','column','2208iBGrCj','api-doc','\x20datasets...','includes','expired','dim','8wCqfjt','cwd','6trRBtb','41336UWnmgi','error','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','\x1b[90m*\x20Filtered\x20','√\x20Doc\x20generation\x20complete!\x20','.md\x20(','white','\x20-\x20','*\x20Generated\x20doc\x20files:','map','yellow','\x20failed','12730277evOWkm'];a1_0x51e4=function(){return _0x574496;};return a1_0x51e4();}(function(_0x1256e3,_0x3ffe6b){const _0x393115=a1_0x3f55,_0x30a5bb=_0x1256e3();while(!![]){try{const _0x5113f2=-parseInt(_0x393115(0x204))/0x1+parseInt(_0x393115(0x1f4))/0x2*(parseInt(_0x393115(0x1f3))/0x3)+-parseInt(_0x393115(0x20b))/0x4+parseInt(_0x393115(0x218))/0x5*(-parseInt(_0x393115(0x1eb))/0x6)+-parseInt(_0x393115(0x200))/0x7*(parseInt(_0x393115(0x1f1))/0x8)+parseInt(_0x393115(0x21d))/0x9+parseInt(_0x393115(0x211))/0xa;if(_0x5113f2===_0x3ffe6b)break;else _0x30a5bb['push'](_0x30a5bb['shift']());}catch(_0x2f69d9){_0x30a5bb['push'](_0x30a5bb['shift']());}}}(a1_0x51e4,0xe7d3d));import{jsx as a1_0xb1c2f3,jsxs as a1_0x1ecd9c,Fragment as a1_0x59b60e}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';function a1_0x3f55(_0x364e21,_0x37dc1d){_0x364e21=_0x364e21-0x1ea;const _0x51e424=a1_0x51e4();let _0x3f5509=_0x51e424[_0x364e21];return _0x3f5509;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x1a4c6a,env:_0x4be9b6,output:_0x53346a,extraParams:_0x2a06b0,datasetCodes:_0x43da12})=>{const _0x5699d9=a1_0x3f55,{exit:_0xf04ab0}=useApp(),[_0x352504,_0x54c7d7]=useState(![]),[_0xd6e531,_0x4c89ea]=useState(''),[_0x32a23c,_0x4bacc2]=useState(![]),[_0x9ab147,_0x188571]=useState(null),[_0x44db14,_0x4fef4a]=useState(null),[_0x56877a,_0x4dc2d6]=useState(0x0),_0x245ff9=readConfig(),_0x6b54b9=getConfigAppCode(),_0x522b8c=_0x1a4c6a||_0x6b54b9,_0x4810f5=typeof _0x245ff9?.[_0x5699d9(0x205)]==='string'?_0x245ff9['env']:undefined,_0x2dc889=_0x4be9b6||_0x4810f5||'production';initEnv(_0x2dc889);const _0xb55ee7=_0x53346a||_0x5699d9(0x206),_0x3af676=_0x1a4c6a?_0x5699d9(0x217)+_0x522b8c:_0x5699d9(0x20e)+_0x522b8c;useEffect(()=>{_0x54c7d7(!![]),_0x50c00a();},[]),useEffect(()=>{(_0x32a23c||_0x9ab147)&&_0xf04ab0();},[_0x32a23c,_0x9ab147,_0xf04ab0]);async function _0x50c00a(){const _0x4db291=_0x5699d9;if(!_0x522b8c){_0x188571(_0x4db291(0x1f6));return;}try{logger['setLogPath'](process[_0x4db291(0x1f2)]()),_0x4c89ea(_0x4db291(0x222));const {configArray:_0x3d306a}=await fetchModelList(_0x522b8c);_0x4dc2d6(_0x3d306a['length']);if(_0x3d306a[_0x4db291(0x202)]===0x0){_0x188571(_0x4db291(0x20f));return;}let _0x3fd722=_0x3d306a;if(_0x43da12&&_0x43da12[_0x4db291(0x202)]>0x0){_0x3fd722=_0x3d306a[_0x4db291(0x215)](_0x163bca=>_0x43da12[_0x4db291(0x1ee)](_0x163bca[_0x4db291(0x21c)]));const _0x20550d=_0x3fd722[_0x4db291(0x1fd)](_0x425d48=>_0x425d48[_0x4db291(0x21c)]),_0x5a26a4=_0x43da12['filter'](_0x535989=>!_0x20550d[_0x4db291(0x1ee)](_0x535989));_0x5a26a4[_0x4db291(0x202)]>0x0&&console[_0x4db291(0x208)](_0x4db291(0x20a)+_0x5a26a4[_0x4db291(0x219)](',\x20')+_0x4db291(0x20d));if(_0x3fd722['length']===0x0){_0x188571(_0x4db291(0x213)+_0x43da12[_0x4db291(0x219)](',\x20'));return;}console[_0x4db291(0x208)](_0x4db291(0x1f7)+_0x3fd722[_0x4db291(0x202)]+_0x4db291(0x20c)+_0x3d306a[_0x4db291(0x202)]+_0x4db291(0x21e));}_0x4c89ea(_0x4db291(0x21a)+_0x3fd722[_0x4db291(0x202)]+_0x4db291(0x1ed));const _0x4dd5ce=await generateDatasetDocs(_0x3fd722,_0x522b8c,_0xb55ee7,(_0x31b661,_0x211f4b,_0x4c1dae)=>{const _0x3767bb=_0x4db291;_0x4c89ea(_0x3767bb(0x207)+_0x4c1dae+_0x3767bb(0x1f9)+_0x31b661+'/'+_0x211f4b+')');},_0x2a06b0);_0x4fef4a(_0x4dd5ce),_0x4bacc2(!![]);const _0xfddb09=_0x4dd5ce[_0x4db291(0x215)](_0x2d67d3=>_0x2d67d3[_0x4db291(0x203)])[_0x4db291(0x202)],_0x30f374=_0x4dd5ce[_0x4db291(0x215)](_0xc4d146=>!_0xc4d146[_0x4db291(0x203)])['length'];logger['success'](_0x4db291(0x1ec),_0x4db291(0x216),undefined,{'totalCount':_0x4dd5ce['length'],'successCount':_0xfddb09,'failCount':_0x30f374,'outputDir':_0xb55ee7});}catch(_0x592c74){const _0x3d8458=_0x592c74 instanceof Error?_0x592c74['message']:String(_0x592c74);logger[_0x4db291(0x1f5)](_0x4db291(0x1ec),'文档生成失败:\x20'+_0x3d8458,{'appCode':_0x522b8c,'outputDir':_0xb55ee7}),_0x188571(_0x4db291(0x210)+_0x3d8458);}finally{_0x54c7d7(![]);}}const _0x2cc8b9=_0x44db14?.[_0x5699d9(0x215)](_0x372abf=>_0x372abf[_0x5699d9(0x203)])[_0x5699d9(0x202)]||0x0,_0x10396c=_0x44db14?.[_0x5699d9(0x215)](_0x1916fa=>!_0x1916fa[_0x5699d9(0x203)])[_0x5699d9(0x202)]||0x0;return a1_0x1ecd9c(Box,{'flexDirection':'column','children':[(_0x352504||_0x32a23c)&&a1_0x1ecd9c(Box,{'children':[a1_0xb1c2f3(Text,{'color':_0x5699d9(0x214),'children':'*\x20'}),a1_0xb1c2f3(Text,{'color':_0x1a4c6a?_0x5699d9(0x1fa):_0x5699d9(0x1f0),'children':_0x3af676})]}),_0x352504&&a1_0xb1c2f3(Box,{'children':a1_0x1ecd9c(Text,{'children':['*\x20',_0xd6e531]})}),_0x32a23c&&_0x44db14&&a1_0x1ecd9c(Box,{'flexDirection':_0x5699d9(0x1ea),'children':[a1_0xb1c2f3(Box,{'children':a1_0x1ecd9c(Text,{'color':'green','children':[_0x5699d9(0x1f8)+_0x2cc8b9+'\x20succeeded',_0x10396c>0x0?',\x20'+_0x10396c+_0x5699d9(0x1ff):'']})}),a1_0xb1c2f3(Box,{'marginTop':0x1,'children':a1_0xb1c2f3(Text,{'color':_0x5699d9(0x214),'children':'*\x20Processed\x20'+_0x56877a+_0x5699d9(0x201)})}),a1_0x1ecd9c(Box,{'marginTop':0x1,'children':[a1_0xb1c2f3(Text,{'color':_0x5699d9(0x214),'children':_0x5699d9(0x21f)}),a1_0xb1c2f3(Text,{'color':_0x5699d9(0x221),'children':_0xb55ee7})]}),_0x2cc8b9>0x0&&a1_0x1ecd9c(a1_0x59b60e,{'children':[a1_0xb1c2f3(Box,{'marginTop':0x1,'children':a1_0xb1c2f3(Text,{'color':_0x5699d9(0x214),'children':_0x5699d9(0x1fc)})}),_0x44db14[_0x5699d9(0x215)](_0x5e5583=>_0x5e5583[_0x5699d9(0x203)])['map']((_0x4150f9,_0x1b7d7c)=>a1_0x1ecd9c(Box,{'marginLeft':0x2,'children':[a1_0x1ecd9c(Text,{'color':_0x5699d9(0x221),'children':['•\x20',_0x4150f9['filePath']]}),a1_0x1ecd9c(Text,{'color':_0x5699d9(0x1f0),'children':[_0x5699d9(0x1fb),_0x4150f9['datasetName']]})]},_0x1b7d7c))]}),_0x10396c>0x0&&a1_0x1ecd9c(a1_0x59b60e,{'children':[a1_0xb1c2f3(Box,{'marginTop':0x1,'children':a1_0xb1c2f3(Text,{'color':'yellow','children':_0x5699d9(0x212)})}),_0x44db14[_0x5699d9(0x215)](_0x2f317c=>!_0x2f317c['success'])[_0x5699d9(0x1fd)]((_0x4e008e,_0x385e42)=>a1_0x1ecd9c(Box,{'marginLeft':0x2,'flexDirection':_0x5699d9(0x1ea),'children':[a1_0x1ecd9c(Text,{'color':_0x5699d9(0x21b),'children':['•\x20',_0x4e008e['datasetName'],'\x20(',_0x4e008e[_0x5699d9(0x21c)],')']}),_0x4e008e[_0x5699d9(0x1f5)]&&a1_0xb1c2f3(Box,{'marginLeft':0x2,'children':a1_0xb1c2f3(Text,{'color':_0x5699d9(0x1f0),'children':_0x4e008e['error']})})]},_0x385e42))]})]}),_0x9ab147&&a1_0x1ecd9c(Box,{'flexDirection':_0x5699d9(0x1ea),'children':[a1_0xb1c2f3(Box,{'children':a1_0x1ecd9c(Text,{'color':_0x5699d9(0x21b),'children':[_0x5699d9(0x220),_0x9ab147]})}),(_0x9ab147['includes']('登录')||_0x9ab147[_0x5699d9(0x1ee)]('Authentication')||_0x9ab147['includes'](_0x5699d9(0x1ef)))&&a1_0x1ecd9c(Box,{'marginTop':0x1,'children':[a1_0xb1c2f3(Text,{'color':_0x5699d9(0x1fe),'children':'*\x20'}),a1_0xb1c2f3(Text,{'color':_0x5699d9(0x221),'children':'rabetbase\x20auth'}),a1_0xb1c2f3(Text,{'color':_0x5699d9(0x1fe),'children':_0x5699d9(0x209)})]})]})]});};
|
package/lib/api/api-pull-ui.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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)})]})]})]});};
|
package/lib/api/main.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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);}}
|
package/lib/api/pull-silent.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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);}}
|
|
@@ -1 +0,0 @@
|
|
|
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);}
|
|
@@ -1 +0,0 @@
|
|
|
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)]);}
|
|
@@ -1 +0,0 @@
|
|
|
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']!=='');}
|
|
@@ -1 +0,0 @@
|
|
|
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;}
|
package/lib/app-menu/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
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};}
|
package/lib/app-menu/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;}
|
|
@@ -1 +0,0 @@
|
|
|
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![];}}
|
|
@@ -1 +0,0 @@
|
|
|
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))]});}
|