@lovrabet/rabetbase-cli 2.3.16-beta.2 → 2.3.16-beta.3
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/README.md +1 -1
- 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 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.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/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.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/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- 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/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -0
- package/lib/commands/page/react/detail.js +1 -0
- package/lib/commands/page/react/list.js +1 -0
- package/lib/commands/page/react/publish.js +1 -0
- package/lib/commands/page/react/shared.js +1 -0
- package/lib/commands/page/react/syntax.js +1 -0
- package/lib/commands/page/react/template.js +1 -0
- package/lib/commands/page/react/update.js +1 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.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/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.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/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.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-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.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/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.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/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +1 -1
- package/templates/projects/sub-app-react-demo/README.md +1 -1
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +1 -1
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +1 -1
- package/lib/commands/project/init.js +0 -1
- package/lib/commands/sql/save.js +0 -1
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x267fb7,_0x10d75b){const _0x37c7e3=a270_0x2722,_0x211632=_0x267fb7();while(!![]){try{const _0x54f4f6=-parseInt(_0x37c7e3(0x1bb))/0x1+parseInt(_0x37c7e3(0x1c0))/0x2*(-parseInt(_0x37c7e3(0x1c2))/0x3)+-parseInt(_0x37c7e3(0x1bd))/0x4+-parseInt(_0x37c7e3(0x1bc))/0x5+parseInt(_0x37c7e3(0x1b9))/0x6*(parseInt(_0x37c7e3(0x1b8))/0x7)+-parseInt(_0x37c7e3(0x1be))/0x8*(parseInt(_0x37c7e3(0x1c1))/0x9)+-parseInt(_0x37c7e3(0x1bf))/0xa*(-parseInt(_0x37c7e3(0x1ba))/0xb);if(_0x54f4f6===_0x10d75b)break;else _0x211632['push'](_0x211632['shift']());}catch(_0x3aa6cd){_0x211632['push'](_0x211632['shift']());}}}(a270_0x123b,0x61b60));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';function a270_0x2722(_0x2ddf71,_0x3eb958){_0x2ddf71=_0x2ddf71-0x1b8;const _0x123b57=a270_0x123b();let _0x27228a=_0x123b57[_0x2ddf71];return _0x27228a;}function a270_0x123b(){const _0x2057e8=['463707HnjOZi','1947786oUyWOR','41545TbZdFG','294TrizRh','23744941JGVOwL','621242dmMukl','3405880mAiuZe','184076CwLBCJ','8jFhpAb','10nhZdVc','2hIcQjN'];a270_0x123b=function(){return _0x2057e8;};return a270_0x123b();}export async function copyDir(_0x329bd1,_0x59998f){const _0x5103d0=statSync(_0x329bd1);if(_0x5103d0['isDirectory']()){!existsSync(_0x59998f)&&mkdirSync(_0x59998f,{'recursive':!![]});const _0x8e25ca=readdirSync(_0x329bd1);for(const _0x3de24c of _0x8e25ca){await copyDir(join(_0x329bd1,_0x3de24c),join(_0x59998f,_0x3de24c));}}else copyFileSync(_0x329bd1,_0x59998f);}export function ensureDir(_0x306bbd){!existsSync(_0x306bbd)&&mkdirSync(_0x306bbd,{'recursive':!![]});}export function pathExists(_0xf895bf){return existsSync(_0xf895bf);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a271_0x294bf0=a271_0x3e2e;(function(_0x99478a,_0x510bad){const _0x551682=a271_0x3e2e,_0x493dd5=_0x99478a();while(!![]){try{const _0x5c1949=parseInt(_0x551682(0x1fa))/0x1+-parseInt(_0x551682(0x1eb))/0x2+-parseInt(_0x551682(0x1f5))/0x3*(parseInt(_0x551682(0x1ef))/0x4)+parseInt(_0x551682(0x1f0))/0x5+-parseInt(_0x551682(0x1fe))/0x6+-parseInt(_0x551682(0x205))/0x7+-parseInt(_0x551682(0x1ee))/0x8*(-parseInt(_0x551682(0x1f2))/0x9);if(_0x5c1949===_0x510bad)break;else _0x493dd5['push'](_0x493dd5['shift']());}catch(_0x4cf271){_0x493dd5['push'](_0x493dd5['shift']());}}}(a271_0x5ca7,0xe2bc8));import{mkdirSync,writeFileSync}from'node:fs';function a271_0x3e2e(_0x5495fe,_0x2d0893){_0x5495fe=_0x5495fe-0x1e8;const _0x5ca761=a271_0x5ca7();let _0x3e2e39=_0x5ca761[_0x5495fe];return _0x3e2e39;}import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'../utils/config.js';function getGuidesCdnUrl(){const _0x48a6a3=a271_0x3e2e,_0x26eceb=getTemplateBaseUrl();return _0x26eceb+_0x48a6a3(0x1f9);}const CACHE_DIR=join(homedir(),a271_0x294bf0(0x200),'cache');function a271_0x5ca7(){const _0x3d7699=['6rqMQzj','replace','skillTemplate','CDN\x20请求失败:\x20','/skills/guides.json','280671EEFdcg','path','trimEnd','.md','10698252TcmLzU','object','.lovrabet','map','content','push','.lovrabet/skill/guides','6099464PuCQSo','statusText','CDN\x20数据中缺少\x20skillTemplate','CDN\x20返回数据格式错误','lastUpdated','2936462zMfTmG','extendContent','length','400NwTCGb','2321324hbgJfO','5650640mGEErM','utf-8','864216VjZcqs','entries','guides'];a271_0x5ca7=function(){return _0x3d7699;};return a271_0x5ca7();}export async function fetchGuidesFromCDN(){const _0x579d32=a271_0x294bf0,_0x30eeb0=getGuidesCdnUrl(),_0x1a33b3=await fetch(_0x30eeb0,{'headers':{'Accept':'application/json'}});if(!_0x1a33b3['ok'])throw new Error(_0x579d32(0x1f8)+_0x1a33b3['status']+'\x20'+_0x1a33b3[_0x579d32(0x206)]);const _0x541a85=await _0x1a33b3['json']();if(!_0x541a85['guides']||typeof _0x541a85[_0x579d32(0x1f4)]!==_0x579d32(0x1ff))throw new Error(_0x579d32(0x1e9));return _0x541a85;}export function writeGuidesToProject(_0x377f43,_0xddd0e5,_0x509ebc=a271_0x294bf0(0x204),_0x3b6cdf){const _0x7ac19d=a271_0x294bf0,_0x25b5c1=join(_0xddd0e5,_0x509ebc);mkdirSync(_0x25b5c1,{'recursive':!![]});for(const [_0x3f0d29,_0x17a1ab]of Object['entries'](_0x377f43[_0x7ac19d(0x1f4)])){let _0x125d47=_0x17a1ab[_0x7ac19d(0x202)];_0x17a1ab[_0x7ac19d(0x1ea)]&&(_0x125d47=appendUpdateTime(_0x125d47,_0x17a1ab['lastUpdated'])),writeFileSync(join(_0x25b5c1,_0x3f0d29+_0x7ac19d(0x1fd)),_0x125d47,_0x7ac19d(0x1f1));}}export function appendUpdateTime(_0x2cafe3,_0x13d756){const _0xa1e76a=a271_0x294bf0;return _0x2cafe3=_0x2cafe3[_0xa1e76a(0x1f6)](/\n*>更新时间:.*$/m,''),_0x2cafe3['trimEnd']()+('\x0a\x0a>更新时间:'+_0x13d756);}export function getSkillTemplate(_0x52908b){const _0x4e3d54=a271_0x294bf0;return _0x52908b['skillTemplate']?.[_0x4e3d54(0x202)]||'';}export function appendExtendContents(_0x2bed36,_0x240c16,_0xcab8e2){const _0x163c85=a271_0x294bf0,_0x1a7a8a=[];for(const [,_0x417845]of Object[_0x163c85(0x1f3)](_0x240c16[_0x163c85(0x1f4)])){_0x417845[_0x163c85(0x1ec)]&&_0x1a7a8a[_0x163c85(0x203)](_0x417845['extendContent']['trimEnd']());}if(_0x1a7a8a[_0x163c85(0x1ed)]===0x0)return _0x2bed36;return _0x2bed36[_0x163c85(0x1fc)]()+'\x0a\x0a'+_0x1a7a8a['join']('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x49aa14,_0x335496,_0x5a925a){const _0x25c3eb=a271_0x294bf0,_0x3c7840=getSkillTemplate(_0x49aa14);if(!_0x3c7840)throw new Error(_0x25c3eb(0x1e8));const _0x3a571d=dirname(_0x335496);mkdirSync(_0x3a571d,{'recursive':!![]});let _0x2d1209=_0x3c7840['replace'](/\{\{IDE_NAME\}\}/g,_0x5a925a);_0x2d1209=appendExtendContents(_0x2d1209,_0x49aa14),_0x49aa14[_0x25c3eb(0x1f7)]['lastUpdated']&&(_0x2d1209=appendUpdateTime(_0x2d1209,_0x49aa14[_0x25c3eb(0x1f7)]['lastUpdated'])),writeFileSync(_0x335496,_0x2d1209,_0x25c3eb(0x1f1));}export async function installGuides(_0x355e68){const _0x52c455=a271_0x294bf0,_0x5ed514=await fetchGuidesFromCDN();return writeGuidesToProject(_0x5ed514,_0x355e68),Object['keys'](_0x5ed514[_0x52c455(0x1f4)])[_0x52c455(0x1ed)];}export function getGuidesSummary(_0xb02db0){const _0x2cade0=a271_0x294bf0;return Object[_0x2cade0(0x1f3)](_0xb02db0[_0x2cade0(0x1f4)])[_0x2cade0(0x201)](([_0x3921d2,_0x298a12])=>({'key':_0x3921d2,'title':_0x298a12['title'],'path':_0x298a12[_0x2cade0(0x1fb)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a272_0x3b63(){const _0x8b0ae0=['TypeError','222FmXRNx','Request\x20failed','2909578VdIZee','44224020qmWDBO','json','1448212LWLpQP','fetch','ms\x20后进行第\x20','AbortError','name','\x20次重试...','1340863cGqOKt','*\x20请求失败,','abort','log','5153795QqpJkL','includes','ECONNRESET','content-type','24Ghcpgd','headers','message','49896JOdAPB','application/json','url','text','statusText','status','2652880ZTiMvh'];a272_0x3b63=function(){return _0x8b0ae0;};return a272_0x3b63();}(function(_0xf9d5ac,_0x30832b){const _0x5bdf9e=a272_0x80e4,_0x11c817=_0xf9d5ac();while(!![]){try{const _0x31a67e=parseInt(_0x5bdf9e(0x92))/0x1+-parseInt(_0x5bdf9e(0x9d))/0x2*(-parseInt(_0x5bdf9e(0xa5))/0x3)+parseInt(_0x5bdf9e(0xaa))/0x4+parseInt(_0x5bdf9e(0x96))/0x5+-parseInt(_0x5bdf9e(0x9a))/0x6*(-parseInt(_0x5bdf9e(0xa7))/0x7)+-parseInt(_0x5bdf9e(0xa3))/0x8+-parseInt(_0x5bdf9e(0xa8))/0x9;if(_0x31a67e===_0x30832b)break;else _0x11c817['push'](_0x11c817['shift']());}catch(_0x441aec){_0x11c817['push'](_0x11c817['shift']());}}}(a272_0x3b63,0xf36bd));export async function httpRequest(_0x556a84,_0x4501db={}){const _0x1e5057=a272_0x80e4,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x4501db;let _0x3da6cd=null;for(let _0x94fa3=0x0;_0x94fa3<=retries;_0x94fa3++){try{const _0x107257=new AbortController(),_0x264706=setTimeout(()=>_0x107257[_0x1e5057(0x94)](),timeout),_0x3f6033=await fetch(_0x556a84,{'headers':headers,'signal':_0x107257['signal']});clearTimeout(_0x264706);let _0x4641be;const _0x23d2e2=_0x3f6033[_0x1e5057(0x9b)]['get'](_0x1e5057(0x99));return _0x23d2e2?.[_0x1e5057(0x97)](_0x1e5057(0x9e))?_0x4641be=await _0x3f6033[_0x1e5057(0xa9)]():_0x4641be=await _0x3f6033[_0x1e5057(0xa0)](),{'ok':_0x3f6033['ok'],'status':_0x3f6033[_0x1e5057(0xa2)],'statusText':_0x3f6033[_0x1e5057(0xa1)],'data':_0x4641be,'headers':_0x3f6033[_0x1e5057(0x9b)],'url':_0x3f6033[_0x1e5057(0x9f)],'text':()=>_0x3f6033[_0x1e5057(0xa0)]()};}catch(_0x107799){_0x3da6cd=_0x107799 instanceof Error?_0x107799:new Error(String(_0x107799));if(_0x94fa3===retries)break;if(shouldRetry(_0x107799)){console[_0x1e5057(0x95)](_0x1e5057(0x93)+retryDelay+_0x1e5057(0x8e)+(_0x94fa3+0x1)+_0x1e5057(0x91)),await sleep(retryDelay);continue;}else break;}}throw _0x3da6cd||new Error(_0x1e5057(0xa6));}function shouldRetry(_0x56bf6d){const _0x32dec5=a272_0x80e4;if(_0x56bf6d instanceof Error){if(_0x56bf6d[_0x32dec5(0x90)]===_0x32dec5(0x8f))return![];if(_0x56bf6d[_0x32dec5(0x90)]===_0x32dec5(0xa4)&&_0x56bf6d[_0x32dec5(0x9c)]['includes'](_0x32dec5(0x8d)))return!![];if(_0x56bf6d[_0x32dec5(0x9c)][_0x32dec5(0x97)](_0x32dec5(0x98)))return!![];if(_0x56bf6d['message'][_0x32dec5(0x97)]('ENOTFOUND'))return![];}return![];}function a272_0x80e4(_0x52a80d,_0x1b15b6){_0x52a80d=_0x52a80d-0x8d;const _0x3b63bb=a272_0x3b63();let _0x80e46=_0x3b63bb[_0x52a80d];return _0x80e46;}function sleep(_0x139bee){return new Promise(_0x47135a=>setTimeout(_0x47135a,_0x139bee));}export function validateUrl(_0xa8e4f4){try{return new URL(_0xa8e4f4),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x230176,_0x3b21e6){const _0x3460aa=a273_0x1da1,_0x515666=_0x230176();while(!![]){try{const _0x3770c1=parseInt(_0x3460aa(0x90))/0x1+-parseInt(_0x3460aa(0x95))/0x2+-parseInt(_0x3460aa(0x94))/0x3*(-parseInt(_0x3460aa(0x91))/0x4)+parseInt(_0x3460aa(0x8d))/0x5*(parseInt(_0x3460aa(0x88))/0x6)+-parseInt(_0x3460aa(0x98))/0x7+-parseInt(_0x3460aa(0x92))/0x8*(parseInt(_0x3460aa(0x97))/0x9)+parseInt(_0x3460aa(0x96))/0xa*(parseInt(_0x3460aa(0x8a))/0xb);if(_0x3770c1===_0x3b21e6)break;else _0x515666['push'](_0x515666['shift']());}catch(_0x48cfd5){_0x515666['push'](_0x515666['shift']());}}}(a273_0x3edb,0x8b4d3));function a273_0x1da1(_0x1b2350,_0x26af48){_0x1b2350=_0x1b2350-0x88;const _0x3edb33=a273_0x3edb();let _0x1da1e1=_0x3edb33[_0x1b2350];return _0x1da1e1;}function a273_0x3edb(){const _0x5ea8ce=['stdout','isTTY','375ibYdXs','setRawMode','true','365332VRhvJl','7628DZwbJY','27000qExeyH','isRaw','321RZjDrh','781248OgHXbl','10zBgdEA','396xLAMyq','122654nTAIGY','24684YxncjK','stdin','2742234psNcDl'];a273_0x3edb=function(){return _0x5ea8ce;};return a273_0x3edb();}function env(_0x4ac5ef){return process.env[`RABETBASE_${_0x4ac5ef}`]||process.env[`LOVRABET_${_0x4ac5ef}`]||undefined;}export function isNonInteractive(_0x2591b2){const _0x542415=a273_0x1da1;return!!(_0x2591b2['nonInteractive']||_0x2591b2['ci']||env('CI')==='true'||process.env.CI===_0x542415(0x8f)||!process[_0x542415(0x8b)][_0x542415(0x8c)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x4ec373=a273_0x1da1;if(!process[_0x4ec373(0x89)]['isTTY'])return![];try{const _0x583f0=process[_0x4ec373(0x89)][_0x4ec373(0x93)];return process[_0x4ec373(0x89)][_0x4ec373(0x8e)](!![]),process['stdin'][_0x4ec373(0x8e)](_0x583f0??![]),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a274_0x5e12fb=a274_0x5200;(function(_0xc08667,_0x2be717){const _0x3e8323=a274_0x5200,_0x4514ad=_0xc08667();while(!![]){try{const _0x404eae=-parseInt(_0x3e8323(0x12a))/0x1+-parseInt(_0x3e8323(0x12b))/0x2*(-parseInt(_0x3e8323(0x130))/0x3)+-parseInt(_0x3e8323(0x157))/0x4*(-parseInt(_0x3e8323(0x12e))/0x5)+-parseInt(_0x3e8323(0x14d))/0x6*(-parseInt(_0x3e8323(0x151))/0x7)+parseInt(_0x3e8323(0x141))/0x8+parseInt(_0x3e8323(0x135))/0x9*(parseInt(_0x3e8323(0x150))/0xa)+parseInt(_0x3e8323(0x155))/0xb*(-parseInt(_0x3e8323(0x131))/0xc);if(_0x404eae===_0x2be717)break;else _0x4514ad['push'](_0x4514ad['shift']());}catch(_0x5a544c){_0x4514ad['push'](_0x4514ad['shift']());}}}(a274_0x532b,0x610c0));import a274_0x3ac139 from'winston';import a274_0x2738ad from'node:fs';import a274_0x2e11c4 from'node:path';function a274_0x532b(){const _0x5ea08f=['yellow','warn','2046144WmqRMw','writeFileSync','Failed\x20to\x20clear\x20logs:','message','完成:\x20','red','level','error','parse','toISOString','green','getWinstonInstance','546fBChww','Failed\x20to\x20read\x20logs:','readFileSync','71560LjTUGZ','30044nxlOms','info','unknown','now','7260oiUOee','setRawCommand','4jrvzJT','stringify','map','readLogs','format','logFilePath','utf8','clearLogs','setLogPath','rawCommand','duration','command','失败:\x20','436661wjKCEN','32576GsSPRM','File','winstonLogger','1493025Enfrah','initWinstonLogger','93EHdqer','12756bDAxIj','blue','currentRawCommand','existsSync','108PSIsnh','log','.lovrabet.log','details','printf','trim','addColors','success','timestamp','split'];a274_0x532b=function(){return _0x5ea08f;};return a274_0x532b();}function a274_0x5200(_0x5e449c,_0x2c4137){_0x5e449c=_0x5e449c-0x126;const _0x532b19=a274_0x532b();let _0x520061=_0x532b19[_0x5e449c];return _0x520061;}class Logger{[a274_0x5e12fb(0x12d)];[a274_0x5e12fb(0x15c)];[a274_0x5e12fb(0x133)]='';constructor(){const _0x3cda7d=a274_0x5e12fb;this[_0x3cda7d(0x15c)]='';}[a274_0x5e12fb(0x156)](_0x2df498){const _0x1697d3=a274_0x5e12fb;this[_0x1697d3(0x133)]=_0x2df498;}[a274_0x5e12fb(0x12f)](){const _0x210f46=a274_0x5e12fb,_0xd90cc7=a274_0x2e11c4['dirname'](this[_0x210f46(0x15c)]);!a274_0x2738ad[_0x210f46(0x134)](_0xd90cc7)&&a274_0x2738ad['mkdirSync'](_0xd90cc7,{'recursive':!![]});const _0x42ad99=a274_0x3ac139[_0x210f46(0x15b)]['combine'](a274_0x3ac139[_0x210f46(0x15b)]['timestamp'](),a274_0x3ac139[_0x210f46(0x15b)]['errors']({'stack':!![]}),a274_0x3ac139[_0x210f46(0x15b)][_0x210f46(0x139)](_0x5f1ec2=>{const _0x5a8e50=_0x210f46,_0x4d3b00={'timestamp':_0x5f1ec2[_0x5a8e50(0x13d)]||new Date()[_0x5a8e50(0x14a)](),'level':_0x5f1ec2[_0x5a8e50(0x147)]||_0x5a8e50(0x152),'command':_0x5f1ec2[_0x5a8e50(0x128)]||_0x5a8e50(0x153),'rawCommand':_0x5f1ec2[_0x5a8e50(0x126)]||this[_0x5a8e50(0x133)]||undefined,'message':_0x5f1ec2[_0x5a8e50(0x144)]||'','duration':_0x5f1ec2[_0x5a8e50(0x127)]||undefined,'details':_0x5f1ec2[_0x5a8e50(0x138)]||undefined};return JSON[_0x5a8e50(0x158)](_0x4d3b00);}));this[_0x210f46(0x12d)]=a274_0x3ac139['createLogger']({'level':_0x210f46(0x152),'format':_0x42ad99,'transports':[new a274_0x3ac139['transports'][(_0x210f46(0x12c))]({'filename':this[_0x210f46(0x15c)],'level':_0x210f46(0x152)})],'silent':![]}),a274_0x3ac139[_0x210f46(0x13b)]({'success':_0x210f46(0x14b),'error':_0x210f46(0x146),'warn':_0x210f46(0x13f),'info':_0x210f46(0x132)});}[a274_0x5e12fb(0x15f)](_0x1ad070){const _0x3736c7=a274_0x5e12fb;this[_0x3736c7(0x15c)]=a274_0x2e11c4['join'](_0x1ad070,_0x3736c7(0x137)),this[_0x3736c7(0x12d)]&&this['winstonLogger']['clear'](),this[_0x3736c7(0x12f)]();}[a274_0x5e12fb(0x152)](_0x36bb84,_0xd8583d,_0xe52566){const _0x1bea35=a274_0x5e12fb;if(!this[_0x1bea35(0x15c)]||!this[_0x1bea35(0x12d)])return;this[_0x1bea35(0x12d)][_0x1bea35(0x152)](_0xd8583d,{'command':_0x36bb84,'details':_0xe52566});}[a274_0x5e12fb(0x13c)](_0x4277d5,_0x2a9605,_0x16880c,_0x3a324b){const _0x1baa77=a274_0x5e12fb;if(!this[_0x1baa77(0x15c)]||!this[_0x1baa77(0x12d)])return;this[_0x1baa77(0x12d)][_0x1baa77(0x136)](_0x1baa77(0x152),_0x2a9605,{'level':'success','command':_0x4277d5,'duration':_0x16880c,'details':_0x3a324b});}['error'](_0x40f25e,_0x151e68,_0x2de7e3){const _0x702f51=a274_0x5e12fb;if(!this[_0x702f51(0x15c)]||!this['winstonLogger'])return;this[_0x702f51(0x12d)]['error'](_0x151e68,{'command':_0x40f25e,'details':_0x2de7e3});}[a274_0x5e12fb(0x140)](_0x277c65,_0x36e67d,_0x4e4c33){const _0x4cf843=a274_0x5e12fb;if(!this[_0x4cf843(0x15c)]||!this[_0x4cf843(0x12d)])return;this[_0x4cf843(0x12d)]['warn'](_0x36e67d,{'command':_0x277c65,'details':_0x4e4c33});}async['logTask'](_0x16d27b,_0x253c9e,_0x394585){const _0x3b165b=a274_0x5e12fb,_0x5704bc=Date[_0x3b165b(0x154)]();this['info'](_0x16d27b,'开始执行:\x20'+_0x253c9e);try{const _0x38eb2e=await _0x394585(),_0x347e60=Date[_0x3b165b(0x154)]()-_0x5704bc;return this[_0x3b165b(0x13c)](_0x16d27b,_0x3b165b(0x145)+_0x253c9e,_0x347e60),_0x38eb2e;}catch(_0x2c312c){const _0x6fb3d8=Date[_0x3b165b(0x154)]()-_0x5704bc;this[_0x3b165b(0x148)](_0x16d27b,_0x3b165b(0x129)+_0x253c9e,{'error':_0x2c312c instanceof Error?_0x2c312c[_0x3b165b(0x144)]:String(_0x2c312c),'duration':_0x6fb3d8});throw _0x2c312c;}}[a274_0x5e12fb(0x15a)](){const _0x14f50a=a274_0x5e12fb;try{if(!a274_0x2738ad[_0x14f50a(0x134)](this[_0x14f50a(0x15c)]))return[];const _0x20d434=a274_0x2738ad[_0x14f50a(0x14f)](this[_0x14f50a(0x15c)],_0x14f50a(0x15d));return _0x20d434[_0x14f50a(0x13e)]('\x0a')['filter'](_0x1bea4a=>_0x1bea4a[_0x14f50a(0x13a)]())[_0x14f50a(0x159)](_0x1c08a4=>JSON[_0x14f50a(0x149)](_0x1c08a4));}catch(_0xd8d860){return console[_0x14f50a(0x140)](_0x14f50a(0x14e),_0xd8d860),[];}}[a274_0x5e12fb(0x15e)](){const _0x4237e0=a274_0x5e12fb;try{a274_0x2738ad[_0x4237e0(0x134)](this[_0x4237e0(0x15c)])&&a274_0x2738ad[_0x4237e0(0x142)](this[_0x4237e0(0x15c)],'',_0x4237e0(0x15d));}catch(_0x554b0a){console['warn'](_0x4237e0(0x143),_0x554b0a);}}[a274_0x5e12fb(0x14c)](){return this['winstonLogger'];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d2313,_0xe25b80){const _0x50026e=a275_0x5e24,_0x555624=_0x4d2313();while(!![]){try{const _0x2a611b=parseInt(_0x50026e(0x1e0))/0x1*(-parseInt(_0x50026e(0x1ee))/0x2)+parseInt(_0x50026e(0x1ea))/0x3+-parseInt(_0x50026e(0x1e8))/0x4*(parseInt(_0x50026e(0x1eb))/0x5)+parseInt(_0x50026e(0x1e1))/0x6*(parseInt(_0x50026e(0x1ef))/0x7)+parseInt(_0x50026e(0x1e9))/0x8*(parseInt(_0x50026e(0x1e6))/0x9)+-parseInt(_0x50026e(0x1e4))/0xa*(parseInt(_0x50026e(0x1e2))/0xb)+parseInt(_0x50026e(0x1ed))/0xc;if(_0x2a611b===_0xe25b80)break;else _0x555624['push'](_0x555624['shift']());}catch(_0x24fa5e){_0x555624['push'](_0x555624['shift']());}}}(a275_0x4fd1,0x66762));function a275_0x5e24(_0x57cf31,_0x158e69){_0x57cf31=_0x57cf31-0x1df;const _0x4fd197=a275_0x4fd1();let _0x5e2471=_0x4fd197[_0x57cf31];return _0x5e2471;}function a275_0x4fd1(){const _0x1612ea=['16216tLyXVU','2294064PndjoT','26245vbhCKT','--params\x20must\x20be\x20a\x20JSON\x20object','1951860qNFaWC','1649506hgwaXp','95543cUfqoB','Invalid\x20JSON\x20for\x20--params:\x20','parse','1eMDtHd','348RRmPzB','184514nCsjVb','validation','230PTJevR','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','981ZnZFKZ','object','236yADary'];a275_0x4fd1=function(){return _0x1612ea;};return a275_0x4fd1();}import{CliErrors}from'../errors.js';export function parseJsonParams(_0x19243b){const _0x58b334=a275_0x5e24;if(!_0x19243b)return undefined;let _0x3b14c8;try{_0x3b14c8=JSON[_0x58b334(0x1df)](_0x19243b);}catch{throw CliErrors['validation'](_0x58b334(0x1f0)+_0x19243b);}if(!_0x3b14c8||typeof _0x3b14c8!==_0x58b334(0x1e7)||Array['isArray'](_0x3b14c8))throw CliErrors[_0x58b334(0x1e3)](_0x58b334(0x1ec),_0x58b334(0x1e5));return _0x3b14c8;}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a276_0x5e2be2=a276_0x1125;function a276_0x1125(_0x347bd0,_0x3c3511){_0x347bd0=_0x347bd0-0x15e;const _0x47442f=a276_0x4744();let _0x11252e=_0x47442f[_0x347bd0];return _0x11252e;}(function(_0x283b90,_0x32b612){const _0x4d6025=a276_0x1125,_0x21e3b9=_0x283b90();while(!![]){try{const _0xeddb63=parseInt(_0x4d6025(0x165))/0x1+-parseInt(_0x4d6025(0x168))/0x2+parseInt(_0x4d6025(0x15e))/0x3+parseInt(_0x4d6025(0x161))/0x4+parseInt(_0x4d6025(0x15f))/0x5+-parseInt(_0x4d6025(0x166))/0x6*(parseInt(_0x4d6025(0x162))/0x7)+-parseInt(_0x4d6025(0x167))/0x8;if(_0xeddb63===_0x32b612)break;else _0x21e3b9['push'](_0x21e3b9['shift']());}catch(_0x8feca6){_0x21e3b9['push'](_0x21e3b9['shift']());}}}(a276_0x4744,0x8eed9));function a276_0x4744(){const _0x2d2f2e=['272517cuVvTB','platform','.cmd','868525vHntrP','6yJkaVQ','13266656YJkiNt','1324058owfttO','1779768YsvcQO','2684535kIVhGC','win32','3784148NlRezQ'];a276_0x4744=function(){return _0x2d2f2e;};return a276_0x4744();}export const isWindows=process[a276_0x5e2be2(0x163)]===a276_0x5e2be2(0x160);export function resolveNpmBin(_0x289978){const _0x1bc2ef=a276_0x5e2be2;return isWindows?_0x289978+_0x1bc2ef(0x164):_0x289978;}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a277_0x3fe2(_0x24b5c2,_0x696547){_0x24b5c2=_0x24b5c2-0x76;const _0x11771a=a277_0x1177();let _0x3fe28b=_0x11771a[_0x24b5c2];return _0x3fe28b;}(function(_0x2648b9,_0xe63a35){const _0x2dc0d3=a277_0x3fe2,_0x5dac37=_0x2648b9();while(!![]){try{const _0x3a12fe=-parseInt(_0x2dc0d3(0x85))/0x1+-parseInt(_0x2dc0d3(0x80))/0x2*(-parseInt(_0x2dc0d3(0x77))/0x3)+-parseInt(_0x2dc0d3(0x7b))/0x4+-parseInt(_0x2dc0d3(0x87))/0x5*(-parseInt(_0x2dc0d3(0x76))/0x6)+-parseInt(_0x2dc0d3(0x7f))/0x7*(-parseInt(_0x2dc0d3(0x79))/0x8)+parseInt(_0x2dc0d3(0x81))/0x9+-parseInt(_0x2dc0d3(0x86))/0xa;if(_0x3a12fe===_0xe63a35)break;else _0x5dac37['push'](_0x5dac37['shift']());}catch(_0x354473){_0x5dac37['push'](_0x5dac37['shift']());}}}(a277_0x1177,0x8816e));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'../utils/config.js';import{appendUpdateTime}from'../utils/guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x2e93cc=a277_0x3fe2,_0x4d8d06=getTemplateBaseUrl();return _0x4d8d06+_0x2e93cc(0x84);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,'../../templates/rules/lovrabet_rules.mdc.tpl');export async function fetchRulesFromCDN(){const _0x3c4e8d=a277_0x3fe2,_0x2327e4=getRulesCdnUrl(),_0x3462e6=await fetch(_0x2327e4,{'headers':{'Accept':'application/json'}});if(!_0x3462e6['ok'])throw new Error(_0x3c4e8d(0x78)+_0x3462e6['status']+'\x20'+_0x3462e6['statusText']);const _0x4f6fd0=await _0x3462e6[_0x3c4e8d(0x89)]();if(!_0x4f6fd0[_0x3c4e8d(0x7a)]||typeof _0x4f6fd0['content']!=='string')throw new Error('CDN\x20返回数据格式错误');return _0x4f6fd0;}export async function getRulesContent(){const _0x1990e8=a277_0x3fe2;try{const _0xa27e76=await fetchRulesFromCDN();return _0xa27e76[_0x1990e8(0x7a)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x34453f=a277_0x3fe2;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x34453f(0x82));throw new Error(_0x34453f(0x83)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x4e1687){const _0x100f52=a277_0x3fe2,_0x5e77bc=await fetchRulesFromCDN()[_0x100f52(0x7e)](()=>null);let _0x9bfe40;_0x5e77bc?(_0x9bfe40=_0x5e77bc[_0x100f52(0x7a)],_0x5e77bc[_0x100f52(0x88)]&&(_0x9bfe40=appendUpdateTime(_0x9bfe40,_0x5e77bc[_0x100f52(0x88)]))):_0x9bfe40=readLocalTemplate();const _0x2efd99=dirname(_0x4e1687);!existsSync(_0x2efd99)&&mkdirSync(_0x2efd99,{'recursive':!![]}),writeFileSync(_0x4e1687,_0x9bfe40,'utf-8');}export async function copyRulesToCursor(_0x135788){const _0x15bc13=a277_0x3fe2,_0xf366c0=join(_0x135788,_0x15bc13(0x7c)),_0xcd910d=join(_0xf366c0,_0x15bc13(0x7d));if(existsSync(_0xcd910d))return![];return await writeRulesFile(_0xcd910d),!![];}function a277_0x1177(){const _0x37d87d=['1551360lHKoGD','130jiVkTN','lastUpdated','json','12972mcvxTG','6036yltKAo','CDN\x20请求失败:\x20','6866536wcIGLZ','content','3488480oQvHYw','.cursor/rules','lovrabet_rules.mdc','catch','7lHXKba','956IjoJFv','7366257UfBPBi','utf-8','本地模板文件不存在:\x20','/rules/rules.json','1110060zqkrsK'];a277_0x1177=function(){return _0x37d87d;};return a277_0x1177();}export async function copyRulesToAgentsMd(_0xc160c1){const _0x3ff2a6=join(_0xc160c1,'agents.md');if(existsSync(_0x3ff2a6))return![];return await writeRulesFile(_0x3ff2a6),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x5ec9ee){return new Promise(_0x421ab1=>setTimeout(_0x421ab1,_0x5ec9ee));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a279_0x462793=a279_0x1687;(function(_0x2f1899,_0x511b71){const _0x751e21=a279_0x1687,_0x47f5f7=_0x2f1899();while(!![]){try{const _0x4517ca=-parseInt(_0x751e21(0x16a))/0x1+-parseInt(_0x751e21(0x18d))/0x2*(-parseInt(_0x751e21(0x181))/0x3)+parseInt(_0x751e21(0x17b))/0x4*(parseInt(_0x751e21(0x157))/0x5)+-parseInt(_0x751e21(0x165))/0x6*(-parseInt(_0x751e21(0x172))/0x7)+-parseInt(_0x751e21(0x154))/0x8+-parseInt(_0x751e21(0x171))/0x9*(-parseInt(_0x751e21(0x162))/0xa)+-parseInt(_0x751e21(0x175))/0xb;if(_0x4517ca===_0x511b71)break;else _0x47f5f7['push'](_0x47f5f7['shift']());}catch(_0x2d5e00){_0x47f5f7['push'](_0x47f5f7['shift']());}}}(a279_0x4c4f,0x22772));import a279_0x651b64 from'node:fs';import a279_0x39bd4c from'node:path';function a279_0x4c4f(){const _0x1218df=['3889754YPPZaf','slice','模板内容替换完成','padStart','getMonth','tableName:\x20\x22','48CxBcFQ','success','datasetCode','writeFile','template','getMinutes','32898zYmZej','message','replaceApiContent','toISOString','getHours','processFile','toDisplayTitle','pop','getSeconds','\x20},','formatLocalTimestamp','.tpl','32goEeXO','.ts','toLowerCase','.md','alias','.jsx','map','.tsx','charAt','name:\x20\x22','name','模板内容替换失败','856696dHntJo','开始处理模板内容替换','pad','20165qoSygD','error','replace','endsWith','includes','toComponentName','LOVRABET','tableName','promises','processDirectory','replaceContent','79710xNDOrq','readdir','info','1276218tBNAWe','toUpperCase','alias:\x20\x22','join','utf8','81785JisikD','now','split','isFile','datasetCode:\x20\x22','extname','processTemplate','279kfqoto','7uPaNuF','isDirectory','mkdir'];a279_0x4c4f=function(){return _0x1218df;};return a279_0x4c4f();}import{logger}from'../utils/logger.js';function a279_0x1687(_0x373d6b,_0x158ca8){_0x373d6b=_0x373d6b-0x151;const _0x4c4fb4=a279_0x4c4f();let _0x168707=_0x4c4fb4[_0x373d6b];return _0x168707;}import{getCliVersion}from'../utils/version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a279_0x462793(0x156)](_0x547d88){const _0x45e13a=a279_0x462793;return String(_0x547d88)[_0x45e13a(0x178)](0x2,'0');}static[a279_0x462793(0x18b)](_0x50b16b){const _0x39dc98=a279_0x462793,_0xa21cf5=_0x50b16b['getFullYear'](),_0x4e545a=this['pad'](_0x50b16b[_0x39dc98(0x179)]()+0x1),_0x3be532=this[_0x39dc98(0x156)](_0x50b16b['getDate']()),_0xb753ac=this[_0x39dc98(0x156)](_0x50b16b[_0x39dc98(0x185)]()),_0x4e3874=this[_0x39dc98(0x156)](_0x50b16b[_0x39dc98(0x180)]()),_0x474bb3=this[_0x39dc98(0x156)](_0x50b16b[_0x39dc98(0x189)]());return{'createdAt':_0xa21cf5+'-'+_0x4e545a+'-'+_0x3be532+'\x20'+_0xb753ac+':'+_0x4e3874+':'+_0x474bb3,'createdDate':_0xa21cf5+'-'+_0x4e545a+'-'+_0x3be532,'createdTime':_0xb753ac+':'+_0x4e3874+':'+_0x474bb3};}static[a279_0x462793(0x15c)](_0x1d5273){const _0x11c6ee=a279_0x462793,_0x89bdb2=_0x1d5273[_0x11c6ee(0x16c)]('/')[_0x11c6ee(0x188)]()||_0x1d5273;return _0x89bdb2[_0x11c6ee(0x16c)]('-')[_0x11c6ee(0x193)](_0x3de648=>_0x3de648[_0x11c6ee(0x195)](0x0)[_0x11c6ee(0x166)]()+_0x3de648['slice'](0x1)['toLowerCase']())[_0x11c6ee(0x168)]('');}static[a279_0x462793(0x187)](_0x5bd3c5){const _0x4cfb3d=a279_0x462793,_0x3bff83=_0x5bd3c5[_0x4cfb3d(0x16c)]('/')[_0x4cfb3d(0x188)]()||_0x5bd3c5;return _0x3bff83[_0x4cfb3d(0x16c)]('-')[_0x4cfb3d(0x193)](_0x10a488=>_0x10a488[_0x4cfb3d(0x195)](0x0)[_0x4cfb3d(0x166)]()+_0x10a488[_0x4cfb3d(0x176)](0x1)['toLowerCase']())['join']('\x20');}static[a279_0x462793(0x161)](_0x3ebdc5,_0x39fba3,_0x162278){const _0x401090=a279_0x462793,_0x98886f=this[_0x401090(0x15c)](_0x39fba3),_0x1d2405=this['toDisplayTitle'](_0x39fba3),{createdAt:_0x5049a3,createdDate:_0x19b0ba,createdTime:_0x185f45}=this[_0x401090(0x18b)](new Date());let _0x5d238e=_0x3ebdc5[_0x401090(0x159)](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x98886f)['replace'](/\{DisplayTitle\}/g,_0x1d2405)[_0x401090(0x159)](/\{PageName\}/g,_0x39fba3)[_0x401090(0x159)](/\{TemplateName\}/g,_0x162278)['replace'](/\{CreatedAt\}/g,_0x5049a3)[_0x401090(0x159)](/\{CreatedDate\}/g,_0x19b0ba)[_0x401090(0x159)](/\{CreatedTime\}/g,_0x185f45);return _0x5d238e;}static[a279_0x462793(0x183)](_0x28707f,_0xd09e9e,_0x36ea1e,_0x4d4d54,_0x365e53,_0x29129b,_0x2d1957,_0x17bdc4){const _0x21f2f3=a279_0x462793,_0x3e6bbf=new Date(),_0x324f8a=_0x3e6bbf[_0x21f2f3(0x184)](),_0x1cd04b=_0x36ea1e[_0x21f2f3(0x193)](_0x38baf6=>{const _0x410bfd=_0x21f2f3,_0x154e45=[_0x410bfd(0x16e)+_0x38baf6[_0x410bfd(0x17d)]+'\x22',_0x410bfd(0x17a)+_0x38baf6[_0x410bfd(0x15e)]+'\x22',_0x410bfd(0x151)+_0x38baf6[_0x410bfd(0x152)]+'\x22'];return _0x38baf6[_0x410bfd(0x191)]&&_0x154e45['push'](_0x410bfd(0x167)+_0x38baf6[_0x410bfd(0x191)]+'\x22'),'\x0a\x20\x20\x20\x20{\x20'+_0x154e45[_0x410bfd(0x168)](',\x20')+_0x410bfd(0x18a);})[_0x21f2f3(0x168)](''),_0x5e8918=_0x4d4d54||_0x36ea1e[0x0]?.[_0x21f2f3(0x191)]||'YourModel';let _0x1d076e=_0x28707f[_0x21f2f3(0x159)](/\{AppCode\}/g,_0xd09e9e)[_0x21f2f3(0x159)](/\{ModelConfigs\}/g,_0x1cd04b)[_0x21f2f3(0x159)](/\{ExampleModelName\}/g,_0x5e8918)[_0x21f2f3(0x159)](/\{ApiFileName\}/g,_0x365e53||'api')[_0x21f2f3(0x159)](/\{ConfigName\}/g,_0x29129b||'default')['replace'](/\{ClientConfigParam\}/g,_0x2d1957||'')[_0x21f2f3(0x159)](/\{VarPrefix\}/g,_0x17bdc4||_0x21f2f3(0x15d))[_0x21f2f3(0x159)](/\{CreatedAt\}/g,_0x324f8a);return _0x1d076e;}static async[a279_0x462793(0x170)](_0x5a9332,_0x1bd71d,_0x6c813e,_0x4818c1,_0x156730=!![]){const _0x259c92=a279_0x462793,_0x5e551e=Date['now']();try{_0x156730&&logger[_0x259c92(0x164)](_0x259c92(0x17f),_0x259c92(0x155),{'templatePath':_0x5a9332,'targetPath':_0x1bd71d,'pageName':_0x6c813e,'templateName':_0x4818c1});await a279_0x651b64[_0x259c92(0x15f)][_0x259c92(0x174)](_0x1bd71d,{'recursive':!![]}),await this[_0x259c92(0x160)](_0x5a9332,_0x1bd71d,_0x6c813e,_0x4818c1);if(_0x156730){const _0x667194=Date[_0x259c92(0x16b)]()-_0x5e551e;logger[_0x259c92(0x17c)]('template',_0x259c92(0x177),_0x667194,{'pageName':_0x6c813e,'templateName':_0x4818c1});}}catch(_0x3f8a64){if(_0x156730){const _0xedd212=Date[_0x259c92(0x16b)]()-_0x5e551e;logger[_0x259c92(0x158)](_0x259c92(0x17f),_0x259c92(0x153),{'templatePath':_0x5a9332,'targetPath':_0x1bd71d,'pageName':_0x6c813e,'templateName':_0x4818c1,'error':_0x3f8a64 instanceof Error?_0x3f8a64[_0x259c92(0x182)]:String(_0x3f8a64),'duration':_0xedd212});}throw _0x3f8a64;}}static async[a279_0x462793(0x160)](_0x4be36a,_0x110b28,_0x42b8a0,_0x1901df){const _0x1deb71=a279_0x462793,_0x3c3c99=await a279_0x651b64[_0x1deb71(0x15f)][_0x1deb71(0x163)](_0x4be36a,{'withFileTypes':!![]});for(const _0x290de6 of _0x3c3c99){const _0x431bb0=a279_0x39bd4c[_0x1deb71(0x168)](_0x4be36a,_0x290de6[_0x1deb71(0x152)]);let _0x84996b=a279_0x39bd4c[_0x1deb71(0x168)](_0x110b28,_0x290de6['name']);_0x290de6[_0x1deb71(0x152)][_0x1deb71(0x15a)](_0x1deb71(0x18c))&&(_0x84996b=a279_0x39bd4c[_0x1deb71(0x168)](_0x110b28,_0x290de6['name'][_0x1deb71(0x159)](/\.tpl$/,'')));if(_0x290de6[_0x1deb71(0x173)]())await a279_0x651b64[_0x1deb71(0x15f)][_0x1deb71(0x174)](_0x84996b,{'recursive':!![]}),await this[_0x1deb71(0x160)](_0x431bb0,_0x84996b,_0x42b8a0,_0x1901df);else _0x290de6[_0x1deb71(0x16d)]()&&await this[_0x1deb71(0x186)](_0x431bb0,_0x84996b,_0x42b8a0,_0x1901df);}}static async[a279_0x462793(0x186)](_0x5d4be2,_0x1d7208,_0x352af2,_0xa446b2){const _0x21b364=a279_0x462793,_0x1eaef2=a279_0x39bd4c[_0x21b364(0x16f)](_0x5d4be2)[_0x21b364(0x18f)]();_0x5d4be2['endsWith'](_0x21b364(0x18c))&&(_0x1d7208=_0x1d7208['replace'](/\.tpl$/,''));const _0x266de2=[_0x21b364(0x194),_0x21b364(0x18e),_0x21b364(0x192),'.js','.json',_0x21b364(0x190),'.css','.scss',_0x21b364(0x18c)];if(_0x266de2[_0x21b364(0x15b)](_0x1eaef2)||_0x5d4be2[_0x21b364(0x15a)](_0x21b364(0x18c))){const _0x5c71e1=await a279_0x651b64[_0x21b364(0x15f)]['readFile'](_0x5d4be2,_0x21b364(0x169)),_0x2b403c=this[_0x21b364(0x161)](_0x5c71e1,_0x352af2,_0xa446b2);await a279_0x651b64['promises'][_0x21b364(0x17e)](_0x1d7208,_0x2b403c,_0x21b364(0x169));}else await a279_0x651b64['promises']['copyFile'](_0x5d4be2,_0x1d7208);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4818d9,_0x3631ef){const _0x59ca33=a280_0x2aad,_0x549310=_0x4818d9();while(!![]){try{const _0x4c4b18=-parseInt(_0x59ca33(0x80))/0x1+parseInt(_0x59ca33(0x6a))/0x2+-parseInt(_0x59ca33(0x77))/0x3+-parseInt(_0x59ca33(0x71))/0x4+-parseInt(_0x59ca33(0x7e))/0x5+-parseInt(_0x59ca33(0x6e))/0x6*(parseInt(_0x59ca33(0x6d))/0x7)+-parseInt(_0x59ca33(0x6c))/0x8*(-parseInt(_0x59ca33(0x73))/0x9);if(_0x4c4b18===_0x3631ef)break;else _0x549310['push'](_0x549310['shift']());}catch(_0x311ea3){_0x549310['push'](_0x549310['shift']());}}}(a280_0x5a74,0xa9ad7));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import a280_0x15bc62 from'semver';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';function a280_0x5a74(){const _0xac958f=['update-check.json','now','3095932bhDkzU','toLowerCase','1791AmHYpy','trim',',\x20run:\x20','valid','2757816ruqgJz','\x20update','stringify','stableVersion','gte','latest','number','122160LOOlLN','.cache','1311936rsRXqm','parse','utf8','2280416pfPmyx','checkedAt','143472wnGUHY','14oqxTUq','2953356JHqwKN'];a280_0x5a74=function(){return _0xac958f;};return a280_0x5a74();}const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function isUpdateNoticeDisabled(){const _0x303886=a280_0x2aad,_0x4662d2=process.env.RABETBASE_NO_UPDATE_NOTICE?.[_0x303886(0x74)]()[_0x303886(0x72)]();return _0x4662d2==='1'||_0x4662d2==='true'||_0x4662d2==='yes';}function cacheRoot(){const _0x4d96bd=a280_0x2aad;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x4d96bd(0x7f));}export function getUpdateNoticeCachePath(){const _0x23f5af=a280_0x2aad;return join(cacheRoot(),'rabetbase-cli',_0x23f5af(0x6f));}async function readUpdateNoticeCache(){const _0x203e93=a280_0x2aad;try{const _0x1114c3=await readFile(getUpdateNoticeCachePath(),_0x203e93(0x82)),_0x45a272=JSON[_0x203e93(0x81)](_0x1114c3);if(!_0x45a272||typeof _0x45a272!=='object')return{};return _0x45a272;}catch{return{};}}function a280_0x2aad(_0x330455,_0x50efe8){_0x330455=_0x330455-0x6a;const _0x5a74df=a280_0x5a74();let _0x2aadd9=_0x5a74df[_0x330455];return _0x2aadd9;}async function writeUpdateNoticeCache(_0x5b0b7c){const _0x45526e=a280_0x2aad;try{const _0x2559b1=getUpdateNoticeCachePath();await mkdir(dirname(_0x2559b1),{'recursive':!![]}),await writeFile(_0x2559b1,JSON[_0x45526e(0x79)](_0x5b0b7c,null,0x2)+'\x0a',_0x45526e(0x82));}catch{}}function isFreshCheck(_0x2625d7,_0x2ff459){const _0x4481c1=a280_0x2aad;return typeof _0x2625d7[_0x4481c1(0x6b)]===_0x4481c1(0x7d)&&_0x2ff459-_0x2625d7['checkedAt']<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x24f476,_0x2ed3f7,_0x3fabc6){return _0x24f476['lastNotifiedVersion']===_0x2ed3f7&&typeof _0x24f476['lastNotifiedAt']==='number'&&_0x3fabc6-_0x24f476['lastNotifiedAt']<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0x42bda3){return'https://www.npmjs.com/package/'+NPM_PACKAGE_NAME+'/v/'+_0x42bda3;}export async function resolveLatestUpdateNotice(){const _0x31beb5=a280_0x2aad;if(isUpdateNoticeDisabled())return null;try{const _0x178ccc=Date[_0x31beb5(0x70)](),_0x2bd1ff=getCliVersion(),_0x7321e4=await readUpdateNoticeCache();let _0x2f5be3=isFreshCheck(_0x7321e4,_0x178ccc)?_0x7321e4[_0x31beb5(0x7c)]?.[_0x31beb5(0x74)]():undefined;if(!_0x2f5be3&&!isFreshCheck(_0x7321e4,_0x178ccc)){const _0x325d3=await getCliVersionPolicy();_0x2f5be3=_0x325d3?.[_0x31beb5(0x7a)]?.[_0x31beb5(0x74)]()||undefined,await writeUpdateNoticeCache({..._0x7321e4,'checkedAt':_0x178ccc,'latest':_0x2f5be3,'failed':!_0x2f5be3});}if(!_0x2f5be3||!a280_0x15bc62['valid'](_0x2bd1ff)||!a280_0x15bc62[_0x31beb5(0x76)](_0x2f5be3))return null;if(a280_0x15bc62[_0x31beb5(0x7b)](_0x2bd1ff,_0x2f5be3))return null;if(isRecentlyNotified(_0x7321e4,_0x2f5be3,_0x178ccc))return null;const _0x3fc77c=CLI_BIN_NAME+_0x31beb5(0x78);return await writeUpdateNoticeCache({..._0x7321e4,'checkedAt':isFreshCheck(_0x7321e4,_0x178ccc)?_0x7321e4[_0x31beb5(0x6b)]:_0x178ccc,'latest':_0x2f5be3,'failed':![],'lastNotifiedVersion':_0x2f5be3,'lastNotifiedAt':_0x178ccc}),{'command':_0x3fc77c,'current':_0x2bd1ff,'latest':_0x2f5be3,'url':buildNpmVersionUrl(_0x2f5be3),'message':CLI_BIN_NAME+'\x20'+_0x2f5be3+'\x20available,\x20current\x20'+_0x2bd1ff+_0x31beb5(0x75)+_0x3fc77c};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a281_0x51fd(){var _0x1722cd=['5559256WgAezs','68734eYnHDT','9QCaYrs','5077751kthrLn','6iqYVrD','43230oHHnCk','92199putqvv','196mbAMEx','6syPdGE','3835970IdycxI','26339599VGlOOI'];a281_0x51fd=function(){return _0x1722cd;};return a281_0x51fd();}(function(_0xb25281,_0x551f8e){var _0x580a42=a281_0x5b7c,_0x3ac94a=_0xb25281();while(!![]){try{var _0x1078d3=parseInt(_0x580a42(0x152))/0x1*(parseInt(_0x580a42(0x14f))/0x2)+parseInt(_0x580a42(0x154))/0x3+-parseInt(_0x580a42(0x14a))/0x4*(parseInt(_0x580a42(0x153))/0x5)+-parseInt(_0x580a42(0x14b))/0x6*(parseInt(_0x580a42(0x151))/0x7)+-parseInt(_0x580a42(0x14e))/0x8+parseInt(_0x580a42(0x150))/0x9*(-parseInt(_0x580a42(0x14c))/0xa)+parseInt(_0x580a42(0x14d))/0xb;if(_0x1078d3===_0x551f8e)break;else _0x3ac94a['push'](_0x3ac94a['shift']());}catch(_0x5516de){_0x3ac94a['push'](_0x3ac94a['shift']());}}}(a281_0x51fd,0x629b5));import{VERSION}from'../generated/build-info.js';function a281_0x5b7c(_0x14aac3,_0x1d4d17){_0x14aac3=_0x14aac3-0x14a;var _0x51fdb4=a281_0x51fd();var _0x5b7c28=_0x51fdb4[_0x14aac3];return _0x5b7c28;}export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a282_0x4867(){var _0x2ca6ec=['1492QTYxIF','57RsUdFO','4250034MHYiSW','4366586YLkOMM','16615NDACjH','2939768sCzHwQ','2021690ioIrQJ','5934768dVAABh','18ZeApRD','54452mNeCLb'];a282_0x4867=function(){return _0x2ca6ec;};return a282_0x4867();}(function(_0x22bf2f,_0x5a69ed){var _0x26b2d7=a282_0x165c,_0x122f18=_0x22bf2f();while(!![]){try{var _0x3ee0d0=-parseInt(_0x26b2d7(0x74))/0x1*(parseInt(_0x26b2d7(0x72))/0x2)+-parseInt(_0x26b2d7(0x75))/0x3+-parseInt(_0x26b2d7(0x73))/0x4*(-parseInt(_0x26b2d7(0x6d))/0x5)+parseInt(_0x26b2d7(0x70))/0x6+parseInt(_0x26b2d7(0x6c))/0x7+-parseInt(_0x26b2d7(0x6e))/0x8*(-parseInt(_0x26b2d7(0x71))/0x9)+parseInt(_0x26b2d7(0x6f))/0xa;if(_0x3ee0d0===_0x5a69ed)break;else _0x122f18['push'](_0x122f18['shift']());}catch(_0x20e1be){_0x122f18['push'](_0x122f18['shift']());}}}(a282_0x4867,0xc86dc));function a282_0x165c(_0xcb7242,_0x18c85a){_0xcb7242=_0xcb7242-0x6c;var _0x486753=a282_0x4867();var _0x165cef=_0x486753[_0xcb7242];return _0x165cef;}import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';export async function withActiveCookie(_0x200d47,_0x3f782a){setActiveCookie(_0x200d47);try{return await _0x3f782a();}finally{clearActiveCookie();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a283_0xd982(_0x1403cd,_0x5002f2){_0x1403cd=_0x1403cd-0x105;var _0x3a720b=a283_0x3a72();var _0xd982b5=_0x3a720b[_0x1403cd];return _0xd982b5;}function a283_0x3a72(){var _0x5471ab=['1171098oIFedF','175994LVZceE','194934NwkUrQ','4191qaIcYr','932054xBARhK','812WOcUME','5945376JTZvmx','5taSQPS','532439Jelgtz','stderr','write'];a283_0x3a72=function(){return _0x5471ab;};return a283_0x3a72();}(function(_0x31cadd,_0x5b124b){var _0x2b08e2=a283_0xd982,_0x39e21f=_0x31cadd();while(!![]){try{var _0x200faf=parseInt(_0x2b08e2(0x109))/0x1+parseInt(_0x2b08e2(0x105))/0x2+-parseInt(_0x2b08e2(0x10f))/0x3*(-parseInt(_0x2b08e2(0x106))/0x4)+-parseInt(_0x2b08e2(0x108))/0x5*(-parseInt(_0x2b08e2(0x10e))/0x6)+-parseInt(_0x2b08e2(0x10d))/0x7+-parseInt(_0x2b08e2(0x107))/0x8+-parseInt(_0x2b08e2(0x10c))/0x9;if(_0x200faf===_0x5b124b)break;else _0x39e21f['push'](_0x39e21f['shift']());}catch(_0x3c3cd4){_0x39e21f['push'](_0x39e21f['shift']());}}}(a283_0x3a72,0x6596e));export function writeCliSideChannelLine(_0x20b59b){var _0x29c7c3=a283_0xd982;process[_0x29c7c3(0x10a)][_0x29c7c3(0x10b)](_0x20b59b+'\x0a');}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.3.16-beta.
|
|
3
|
+
"version": "2.3.16-beta.3",
|
|
4
4
|
"description": "Developer CLI for Lovrabet apps, datasets, pages, SQL, BFF, database connections, skills, and AI agent workflows.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"keywords": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
- 移除旧 `/hello-world`、`/chart-fetch`、`/intro` 实操路径,改为当前 `src/pages` 自动路由页面。
|
|
12
12
|
- 统一本地启动、构建、预览命令为 `rabetbase run start/build/preview`。
|
|
13
|
-
- 补充 `rabetbase project create`、`rabetbase config set appcode`、`rabetbase
|
|
13
|
+
- 补充 `rabetbase project create`、`rabetbase config set appcode`、`rabetbase workspace init`、`rabetbase api pull` 的使用时机。
|
|
14
14
|
- 补充 SDK 配置、微前端接入、CDN 产物和 Lovrabet 主应用页面配置说明。
|
|
15
15
|
- 重做首页为 Prompt 开发入口,展示 AppCode 状态、Agent 场景示例、飞书文库导航、内置页面入口和主应用接入检查清单。
|
|
16
16
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(_0x30aea1,_0x5c7f9c){const _0x46b991=a161_0x4846,_0x5687cc=_0x30aea1();while(!![]){try{const _0x26c001=-parseInt(_0x46b991(0x123))/0x1+-parseInt(_0x46b991(0x106))/0x2+parseInt(_0x46b991(0x10c))/0x3*(-parseInt(_0x46b991(0x110))/0x4)+parseInt(_0x46b991(0xff))/0x5*(-parseInt(_0x46b991(0x128))/0x6)+parseInt(_0x46b991(0x125))/0x7*(-parseInt(_0x46b991(0xf9))/0x8)+-parseInt(_0x46b991(0x111))/0x9+parseInt(_0x46b991(0x100))/0xa;if(_0x26c001===_0x5c7f9c)break;else _0x5687cc['push'](_0x5687cc['shift']());}catch(_0x1f240c){_0x5687cc['push'](_0x5687cc['shift']());}}}(a161_0x477e,0x465d9));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';function a161_0x4846(_0x15db03,_0x3344b0){_0x15db03=_0x15db03-0xf7;const _0x477e63=a161_0x477e();let _0x4846b7=_0x477e63[_0x15db03];return _0x4846b7;}import a161_0x5db4fa from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';function a161_0x477e(){const _0x420d86=['169187pdKSwG','Upgrade\x20it\x20to\x20','374283YcvVZZ','init','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','146868QgWmFj','\x20\x20Apps:\x20','.rabetbase.json','?\x20(Old\x20file\x20→\x20*.bak)','72ppvYPm','✓\x20Upgraded\x20','log','bold','appcode','\x20\x20Default:\x20','10oWhseR','18692530cEQsNu','defaultApp','parse','App\x20Code\x20cannot\x20be\x20empty','cwd','gray','987466vJwuex','package.json','trim','\x20api\x20pull\x27','join','\x20workspace\x20init`\x20to\x20start\x20fresh.','3ymomib','\x20→\x20.rabetbase.json','Please\x20enter\x20App\x20Code:','Invalid\x20App\x20Code','1536048rLlcsN','35343YDNZZH','apps','string','1.0.0','\x20api\x20generate\x27\x20and\x20\x27','toLocaleString','utf8','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','green','app','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','setLogPath','env','.bak','初始化项目配置文件成功','cyan','version','info'];a161_0x477e=function(){return _0x420d86;};return a161_0x477e();}import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x389c36){const _0x7ed70d=a161_0x4846,{appcode:_0x428224,env:_0x4c355b,autoYes:_0x3490d6}=_0x389c36,_0x3453e9=process[_0x7ed70d(0x104)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x2aac2c;for(const _0x31ba6b of LEGACY_CONFIG_NAMES){const _0x2efa18=resolve(_0x3453e9,_0x31ba6b);if(existsSync(_0x2efa18)){_0x2aac2c=_0x2efa18;break;}}if(_0x2aac2c){let _0x2a141c={};try{_0x2a141c=JSON[_0x7ed70d(0x102)](readFileSync(_0x2aac2c,'utf8'));}catch{}const _0xbec3ab=basename(_0x2aac2c),_0x1ef899=_0x2a141c?.[_0x7ed70d(0xfd)]||_0x2a141c?.[_0x7ed70d(0x11a)];let _0x4c1844=_0x3490d6;!_0x3490d6&&(console[_0x7ed70d(0xfb)](a161_0x5db4fa['yellow'](_0x7ed70d(0x127)+a161_0x5db4fa[_0x7ed70d(0xfc)](_0xbec3ab))),_0x1ef899&&console[_0x7ed70d(0xfb)](a161_0x5db4fa['cyan']('\x20\x20appcode:\x20'+_0x1ef899)),_0x4c1844=await confirm({'message':_0x7ed70d(0x124)+a161_0x5db4fa[_0x7ed70d(0xfc)](_0x7ed70d(0xf7))+_0x7ed70d(0xf8),'default':!![]}));if(!_0x4c1844){console[_0x7ed70d(0xfb)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x7ed70d(0x10b));return;}const _0x4a19d3=resolve(_0x3453e9,NEW_CONFIG_NAME),_0x3875c9=getCliVersionFromPkg(),_0x5c9406=readRawConfig(),_0x2eeed1=_0x428224||(typeof _0x2a141c?.['appcode']===_0x7ed70d(0x113)?_0x2a141c[_0x7ed70d(0xfd)]:undefined)||(typeof _0x2a141c?.[_0x7ed70d(0x11a)]===_0x7ed70d(0x113)?_0x2a141c['app']:undefined)||await askAppcode(),_0x36d592=typeof _0x2a141c?.[_0x7ed70d(0x11d)]==='string'?_0x2a141c['env']:typeof _0x5c9406[_0x7ed70d(0x11d)]===_0x7ed70d(0x113)?_0x5c9406[_0x7ed70d(0x11d)]:'production',_0x21051f=buildCanonicalProjectConfig({..._0x5c9406,..._0x2a141c},{'appCodes':[_0x2eeed1],'env':_0x36d592,'metadata':{'version':_0x3875c9,'migratedAt':new Date()[_0x7ed70d(0x116)](),'migratedFrom':_0x2aac2c}});writeConfigFile(_0x4a19d3,_0x21051f);const _0x4e6026=_0x2aac2c+'.bak';renameSync(_0x2aac2c,_0x4e6026),logger[_0x7ed70d(0x11c)](_0x3453e9),logger[_0x7ed70d(0x122)](_0x7ed70d(0x126),'从旧配置文件升级成功',{'from':_0x2aac2c,'to':_0x4a19d3,'appcode':_0x2eeed1,'env':_0x21051f[_0x7ed70d(0x11d)]}),console['log'](a161_0x5db4fa['green'](_0x7ed70d(0xfa)+_0xbec3ab+_0x7ed70d(0x10d))),console[_0x7ed70d(0xfb)](a161_0x5db4fa[_0x7ed70d(0x120)](_0x7ed70d(0x129)+Object['keys'](_0x21051f[_0x7ed70d(0x112)]||{})[_0x7ed70d(0x10a)](',\x20'))),console[_0x7ed70d(0xfb)](a161_0x5db4fa[_0x7ed70d(0x120)]('\x20\x20Default:\x20'+_0x21051f[_0x7ed70d(0x101)])),console[_0x7ed70d(0xfb)](a161_0x5db4fa[_0x7ed70d(0x105)](_0x7ed70d(0x118)+_0xbec3ab+_0x7ed70d(0x11e)));return;}const _0x107ac6=_0x428224||await askAppcode(),_0xafb9b8=resolve(_0x3453e9,NEW_CONFIG_NAME),_0x477345=getCliVersionFromPkg(),_0x5a9458=readRawConfig(),_0x2357df=typeof _0x5a9458[_0x7ed70d(0x11d)]===_0x7ed70d(0x113)?_0x5a9458['env']:undefined,_0x146677=buildCanonicalProjectConfig({},{'appCodes':[_0x107ac6],'env':_0x4c355b||_0x2357df||'production','metadata':{'version':_0x477345,'createdAt':new Date()[_0x7ed70d(0x116)]()}});writeConfigFile(_0xafb9b8,_0x146677),logger[_0x7ed70d(0x11c)](_0x3453e9),logger['info'](_0x7ed70d(0x126),_0x7ed70d(0x11f),{'appcode':_0x107ac6,'env':_0x146677[_0x7ed70d(0x11d)],'version':_0x146677[_0x7ed70d(0x121)],'configPath':_0xafb9b8}),console['log'](a161_0x5db4fa[_0x7ed70d(0x119)](_0x7ed70d(0x11b))),console['log'](a161_0x5db4fa[_0x7ed70d(0x120)](_0x7ed70d(0x129)+Object['keys'](_0x146677['apps']||{})[_0x7ed70d(0x10a)](',\x20'))),console[_0x7ed70d(0xfb)](a161_0x5db4fa['cyan'](_0x7ed70d(0xfe)+_0x146677[_0x7ed70d(0x101)])),console['log']('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x7ed70d(0x115)+CLI_BIN_NAME+_0x7ed70d(0x109));}function askAppcode(){const _0x520c9e=a161_0x4846;return input({'message':_0x520c9e(0x10e),'validate':_0x4db694=>{const _0x56b35d=_0x520c9e;if(!_0x4db694[_0x56b35d(0x108)]())return _0x56b35d(0x103);const {valid:_0x349da2,message:_0x1da23b}=validateAppcode(_0x4db694[_0x56b35d(0x108)]());return _0x349da2||_0x1da23b||_0x56b35d(0x10f);}});}function getCliVersionFromPkg(){const _0x379a28=a161_0x4846;try{const _0x157b95=fileURLToPath(import.meta.url),_0x18b2f6=resolve(dirname(_0x157b95),'../..'),_0x3a7317=JSON['parse'](readFileSync(resolve(_0x18b2f6,_0x379a28(0x107)),_0x379a28(0x117)));return _0x3a7317[_0x379a28(0x121)]||_0x379a28(0x114);}catch{return'1.0.0';}}
|
package/lib/commands/sql/save.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a184_0x92c3a8=a184_0x1016;(function(_0x1165ee,_0x3e8c6f){const _0xa26156=a184_0x1016,_0x3461e1=_0x1165ee();while(!![]){try{const _0x55d123=parseInt(_0xa26156(0x80))/0x1+parseInt(_0xa26156(0x72))/0x2+-parseInt(_0xa26156(0x83))/0x3+-parseInt(_0xa26156(0x76))/0x4+-parseInt(_0xa26156(0x85))/0x5*(-parseInt(_0xa26156(0x74))/0x6)+-parseInt(_0xa26156(0x7d))/0x7+parseInt(_0xa26156(0x73))/0x8;if(_0x55d123===_0x3e8c6f)break;else _0x3461e1['push'](_0x3461e1['shift']());}catch(_0x368d6d){_0x3461e1['push'](_0x3461e1['shift']());}}}(a184_0x13a6,0xd026f));import{CliErrors}from'../../errors.js';function a184_0x13a6(){const _0x323f3a=['Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','1541064ADZIMc','10052128SnANOI','6qmQfPo','SQL\x20query\x20display\x20name','1568464LFbVNW','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','sqlname','string','validation','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','7426832BeMNtk','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','sql','1274396Xqzzrh','join','description','2987997EhRcow','write','1190lzbdBQ','Path\x20to\x20the\x20SQL\x20file','file'];a184_0x13a6=function(){return _0x323f3a;};return a184_0x13a6();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a184_0x92c3a8(0x77),a184_0x92c3a8(0x7e),a184_0x92c3a8(0x7c)][a184_0x92c3a8(0x81)]('\x0a');function a184_0x1016(_0xe8bf5b,_0x2f92b8){_0xe8bf5b=_0xe8bf5b-0x70;const _0x13a6cf=a184_0x13a6();let _0x1016db=_0x13a6cf[_0xe8bf5b];return _0x1016db;}export const sqlSave={'service':a184_0x92c3a8(0x7f),'command':'save','description':a184_0x92c3a8(0x7b),'risk':a184_0x92c3a8(0x84),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a184_0x92c3a8(0x70),'type':'string','required':!![],'description':a184_0x92c3a8(0x86)},SQLCODE_FLAG_OPTIONAL,{'name':a184_0x92c3a8(0x78),'type':a184_0x92c3a8(0x79),'description':a184_0x92c3a8(0x75)},{'name':'db','type':a184_0x92c3a8(0x79),'description':a184_0x92c3a8(0x71)},{'name':a184_0x92c3a8(0x82),'type':'string','description':'Query\x20description'}],async 'validate'(){const _0x4c6d1d=a184_0x92c3a8;throw CliErrors[_0x4c6d1d(0x7a)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x38058c=a184_0x92c3a8;throw CliErrors[_0x38058c(0x7a)](SQL_SAVE_DEPRECATED_HINT);}};
|