@lovrabet/rabetbase-cli 2.3.16-beta.1 → 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 +2 -2
- 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 -0
- 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 -0
- package/lib/commands/tenant/members-list.js +1 -0
- package/lib/commands/tenant/shared.js +1 -0
- 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 +2 -2
- 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/app/add.js +0 -1
- package/lib/commands/app/remove.js +0 -1
- package/lib/commands/project/init.js +0 -1
- package/lib/commands/sql/save.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a262_0x55de(_0x54a24b,_0x3d56be){_0x54a24b=_0x54a24b-0x1c5;const _0x2ffcce=a262_0x2ffc();let _0x55de4d=_0x2ffcce[_0x54a24b];return _0x55de4d;}function a262_0x2ffc(){const _0x2e9e8d=['7274480oraArx','1859790yHAsVW','3711104IVUiqX','14fFPQsi','3lbZbtb','219278cdWJUV','1866006SmZNYo','686161uaMecv','2489650AruDIg'];a262_0x2ffc=function(){return _0x2e9e8d;};return a262_0x2ffc();}(function(_0x75af1b,_0x4dff19){const _0xe91de1=a262_0x55de,_0x51ff2c=_0x75af1b();while(!![]){try{const _0x2a73cb=parseInt(_0xe91de1(0x1c9))/0x1+parseInt(_0xe91de1(0x1c7))/0x2*(parseInt(_0xe91de1(0x1c6))/0x3)+parseInt(_0xe91de1(0x1cd))/0x4+-parseInt(_0xe91de1(0x1ca))/0x5+-parseInt(_0xe91de1(0x1cc))/0x6*(-parseInt(_0xe91de1(0x1c5))/0x7)+-parseInt(_0xe91de1(0x1cb))/0x8+-parseInt(_0xe91de1(0x1c8))/0x9;if(_0x2a73cb===_0x4dff19)break;else _0x51ff2c['push'](_0x51ff2c['shift']());}catch(_0x4da229){_0x51ff2c['push'](_0x51ff2c['shift']());}}}(a262_0x2ffc,0xb1f64));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x205475,_0x12c9c7){const _0x36c4db=a263_0x1d1b,_0x464b79=_0x205475();while(!![]){try{const _0x10d74d=-parseInt(_0x36c4db(0x19b))/0x1*(parseInt(_0x36c4db(0x198))/0x2)+-parseInt(_0x36c4db(0x1a8))/0x3*(parseInt(_0x36c4db(0x1a9))/0x4)+-parseInt(_0x36c4db(0x1a6))/0x5+-parseInt(_0x36c4db(0x1a2))/0x6*(-parseInt(_0x36c4db(0x1aa))/0x7)+-parseInt(_0x36c4db(0x1a3))/0x8*(-parseInt(_0x36c4db(0x1a5))/0x9)+parseInt(_0x36c4db(0x1a4))/0xa*(-parseInt(_0x36c4db(0x1a7))/0xb)+parseInt(_0x36c4db(0x19f))/0xc;if(_0x10d74d===_0x12c9c7)break;else _0x464b79['push'](_0x464b79['shift']());}catch(_0x27752a){_0x464b79['push'](_0x464b79['shift']());}}}(a263_0x400e,0x760a9));import{getTemplateBaseUrl}from'../utils/config.js';function a263_0x1d1b(_0x417625,_0xa6a4c2){_0x417625=_0x417625-0x197;const _0x400e11=a263_0x400e();let _0x1d1bda=_0x400e11[_0x417625];return _0x1d1bda;}export async function fetchCdnConfig(){const _0x11ee7e=a263_0x1d1b,_0x1ac1a1=getTemplateBaseUrl(),_0x543648=[_0x1ac1a1+_0x11ee7e(0x19e),_0x1ac1a1+_0x11ee7e(0x1a1)];for(const _0x4c3595 of _0x543648){try{const _0x2b0d09=await fetch(_0x4c3595,{'headers':{'Accept':_0x11ee7e(0x19d)}});if(!_0x2b0d09['ok'])continue;const _0x2ea541=await _0x2b0d09[_0x11ee7e(0x1a0)]();if(!_0x2ea541['cli']?.[_0x11ee7e(0x199)]||!_0x2ea541[_0x11ee7e(0x197)]?.[_0x11ee7e(0x19c)]?.['stableVersion'])continue;return _0x2ea541;}catch{}}return null;}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL=0x3c*0x3e8;let hasCachedConfig=![];function a263_0x400e(){const _0x349154=['3610JDFVsg','9YRjWBn','2880730bsouHv','15213EXsyoS','1125714BzlxuW','4WDAipF','21NrRqwj','sdk','8KIMfAv','stableVersion','now','191885tlbZfy','node','application/json','/config.json','26401932talazu','json','/config/index.json','443148mjleBL','2239592uviJXg'];a263_0x400e=function(){return _0x349154;};return a263_0x400e();}export async function getCdnConfig(){const _0x5d74e5=a263_0x1d1b,_0x23d99a=Date[_0x5d74e5(0x19a)]();if(hasCachedConfig){const _0x3a69ec=cachedConfig?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x23d99a-cacheTime<_0x3a69ec)return cachedConfig;}const _0x6c5377=await fetchCdnConfig();return cachedConfig=_0x6c5377,cacheTime=_0x23d99a,hasCachedConfig=!![],_0x6c5377;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0,hasCachedConfig=![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a264_0x2652c0=a264_0x1691;(function(_0x9519c1,_0x38189e){const _0x44e405=a264_0x1691,_0x238daf=_0x9519c1();while(!![]){try{const _0x4621c4=-parseInt(_0x44e405(0x1cf))/0x1*(-parseInt(_0x44e405(0x1d1))/0x2)+-parseInt(_0x44e405(0x1dc))/0x3+-parseInt(_0x44e405(0x1bb))/0x4+parseInt(_0x44e405(0x1d7))/0x5+parseInt(_0x44e405(0x1d6))/0x6*(parseInt(_0x44e405(0x1cb))/0x7)+parseInt(_0x44e405(0x1d4))/0x8+-parseInt(_0x44e405(0x1d2))/0x9;if(_0x4621c4===_0x38189e)break;else _0x238daf['push'](_0x238daf['shift']());}catch(_0x3ec59c){_0x238daf['push'](_0x238daf['shift']());}}}(a264_0x29d3,0xe8a99));function a264_0x29d3(){const _0x370a5c=['951894glaKLz','utf8','log','3559364IMnhYy','minVersion','node','parse','\x20\x20\x20Stable\x20version:\x20','\x20\x20\x20Upgrade\x20command:\x20','version','readFileSync','npm\x20install\x20','stableVersion','@lovrabet/sdk','devDependencies','needsUpgrade','coerce','1.2.0','\x1b[33m','1180571Jsvnvn','\x20\x20\x20Current\x20version:\x20','package.json','all','194802TFJfvF','utf-8','2XxQAEw','4630941GXmsxZ','join','5884416ColRlw','packageName','36QFrJgu','3662005GgnBis','sdk','\x1b[0m','latest','↪\x20SDK\x20update\x20available'];a264_0x29d3=function(){return _0x370a5c;};return a264_0x29d3();}import a264_0x414a28 from'node:fs';import a264_0x18e893 from'node:path';import a264_0x2f88b1 from'semver';import{getCdnConfig}from'../utils/cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a264_0x2652c0(0x1c9);function isNonNumericVersion(_0x50fe78){const _0x22f731=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x22f731['some'](_0x4667e5=>_0x4667e5['test'](_0x50fe78));}function getInstalledVersion(_0x600a8,_0x2d5bc9){const _0x577027=a264_0x2652c0;try{const _0x596743=a264_0x18e893['join'](_0x600a8,'node_modules',_0x2d5bc9,_0x577027(0x1cd));if(a264_0x414a28['existsSync'](_0x596743)){const _0x1f6ea3=JSON[_0x577027(0x1be)](a264_0x414a28['readFileSync'](_0x596743,_0x577027(0x1d0)));return _0x1f6ea3[_0x577027(0x1c1)]||null;}}catch{}return null;}function a264_0x1691(_0x2e3af8,_0x2a529c){_0x2e3af8=_0x2e3af8-0x1b9;const _0x29d340=a264_0x29d3();let _0x169134=_0x29d340[_0x2e3af8];return _0x169134;}async function getSdkStableVersion(){const _0x11c13b=a264_0x2652c0;try{const _0x499bb2=await getCdnConfig();return _0x499bb2?.['sdk']?.[_0x11c13b(0x1bd)]?.[_0x11c13b(0x1c4)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x191fd5=a264_0x2652c0;try{const _0x42b6b2=await getCdnConfig();return _0x42b6b2?.[_0x191fd5(0x1d8)]?.[_0x191fd5(0x1bd)]?.[_0x191fd5(0x1d5)]||_0x191fd5(0x1c5);}catch{return _0x191fd5(0x1c5);}}export async function checkSdkVersion(_0x2c7010){const _0x369f1a=a264_0x2652c0,_0x4f9a62=a264_0x18e893[_0x369f1a(0x1d3)](_0x2c7010,_0x369f1a(0x1cd)),[_0x22b707,_0x4d5b76]=await Promise[_0x369f1a(0x1ce)]([getSdkStableVersion(),getSdkPackageName()]),_0x1decb8=_0x22b707||FALLBACK_MIN_SDK_VERSION;if(!a264_0x414a28['existsSync'](_0x4f9a62))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x1decb8,'packageName':_0x4d5b76,'stableVersion':_0x22b707};try{const _0x4e76d4=JSON[_0x369f1a(0x1be)](a264_0x414a28['readFileSync'](_0x4f9a62,'utf8')),_0x5306b4=_0x4e76d4['dependencies']||{},_0x5597de=_0x4e76d4['devDependencies']||{},_0x1b08ee=_0x5306b4[_0x4d5b76]||_0x5597de[_0x4d5b76];if(!_0x1b08ee)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x1decb8,'packageName':_0x4d5b76,'stableVersion':_0x22b707};let _0x47a6d5=getInstalledVersion(_0x2c7010,_0x4d5b76);!_0x47a6d5&&(_0x47a6d5=_0x1b08ee);if(isNonNumericVersion(_0x1b08ee))return{'installed':!![],'version':_0x47a6d5,'needsUpgrade':![],'minVersion':_0x1decb8,'packageName':_0x4d5b76,'stableVersion':_0x22b707};const _0x5cae55=a264_0x2f88b1[_0x369f1a(0x1c8)](_0x47a6d5),_0x89d842=a264_0x2f88b1[_0x369f1a(0x1c8)](_0x1decb8),_0x531904=_0x5cae55&&_0x89d842?a264_0x2f88b1['lt'](_0x5cae55,_0x89d842):![];return{'installed':!![],'version':_0x47a6d5,'needsUpgrade':_0x531904,'minVersion':_0x1decb8,'packageName':_0x4d5b76,'stableVersion':_0x22b707};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x1decb8,'packageName':_0x4d5b76,'stableVersion':_0x22b707};}}export function checkSdkVersionSync(_0xd152ad){const _0x30516a=a264_0x2652c0,_0x44c679=a264_0x18e893[_0x30516a(0x1d3)](_0xd152ad,_0x30516a(0x1cd)),_0x30df3c=_0x30516a(0x1c5);if(!a264_0x414a28['existsSync'](_0x44c679))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x30df3c,'stableVersion':null};try{const _0x1cdfc9=JSON[_0x30516a(0x1be)](a264_0x414a28[_0x30516a(0x1c2)](_0x44c679,_0x30516a(0x1b9))),_0x1a0b13=_0x1cdfc9['dependencies']||{},_0x1ff419=_0x1cdfc9[_0x30516a(0x1c6)]||{},_0x2200d6=_0x1a0b13[_0x30df3c]||_0x1ff419[_0x30df3c];if(!_0x2200d6)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x30df3c,'stableVersion':null};let _0x491403=getInstalledVersion(_0xd152ad,_0x30df3c);!_0x491403&&(_0x491403=_0x2200d6);if(isNonNumericVersion(_0x2200d6))return{'installed':!![],'version':_0x491403,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x30df3c,'stableVersion':null};const _0x3ad599=a264_0x2f88b1[_0x30516a(0x1c8)](_0x491403),_0x3ef346=_0x3ad599?a264_0x2f88b1['lt'](_0x3ad599,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x491403,'needsUpgrade':_0x3ef346,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x30df3c,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x30df3c,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x2ba119){const _0xc1b90=a264_0x2652c0;if(!_0x2ba119[_0xc1b90(0x1c7)])return;const _0x8a81bf=_0xc1b90(0x1ca),_0x28e03a=_0xc1b90(0x1d9),_0x44ff5e='\x1b[1m',_0x5e35fd=_0x2ba119['packageName']||_0xc1b90(0x1c5),_0x237195=_0x2ba119[_0xc1b90(0x1c4)]||_0x2ba119[_0xc1b90(0x1bc)],_0xf0a112=_0xc1b90(0x1c3)+_0x5e35fd+'@'+(_0x237195||_0xc1b90(0x1da));console[_0xc1b90(0x1ba)](),console[_0xc1b90(0x1ba)](''+_0x8a81bf+_0x44ff5e+_0xc1b90(0x1db)+_0x28e03a),console[_0xc1b90(0x1ba)](_0x8a81bf+_0xc1b90(0x1cc)+_0x5e35fd+'@'+_0x2ba119[_0xc1b90(0x1c1)]+_0x28e03a),console[_0xc1b90(0x1ba)](_0x8a81bf+_0xc1b90(0x1bf)+_0x237195+_0x28e03a),console[_0xc1b90(0x1ba)](_0x8a81bf+_0xc1b90(0x1c0)+_0xf0a112+_0x28e03a),console['log']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xac792,_0x26977d){const _0x255bbc=a265_0x5470,_0x475631=_0xac792();while(!![]){try{const _0x2a6c55=parseInt(_0x255bbc(0x1b7))/0x1+parseInt(_0x255bbc(0x1a2))/0x2+-parseInt(_0x255bbc(0x1b2))/0x3*(-parseInt(_0x255bbc(0x1b6))/0x4)+parseInt(_0x255bbc(0x1a8))/0x5+parseInt(_0x255bbc(0x1c1))/0x6+-parseInt(_0x255bbc(0x1c6))/0x7+parseInt(_0x255bbc(0x1b9))/0x8*(-parseInt(_0x255bbc(0x1bc))/0x9);if(_0x2a6c55===_0x26977d)break;else _0x475631['push'](_0x475631['shift']());}catch(_0x56f5e6){_0x475631['push'](_0x475631['shift']());}}}(a265_0x454c,0x3c2db));function a265_0x454c(){const _0xff6dcc=['version','\x20\x20\x20Recommended\x20stable:\x20','utf-8','\x20\x20\x20Stable\x20version:\x20','2699235xtJVoD','npm\x20install\x20-g\x20','89802rbdTje','Current\x20CLI\x20version\x20is\x20below\x20the\x20service\x20compatibility\x20support\x20line.','package.json','filter','\x20\x20\x20','belowMinimum','542945QxcGzx','minimumVersionMessage','\x1b[33m','\x1b[1m','stableVersion','\x20\x20\x20Upgrade\x20command:\x20','\x20\x20\x20Current\x20CLI\x20version:\x20','coerce','Minimum\x20supported:\x20','needsUpgrade','15GuwIRd','Upgrade\x20command:\x20','upgradeMessage','minimumVersion','46212vZydzU','252245hQQLKK','latest','7640Wcphuh','log','1.0.0','1611UAopDN','currentVersion','↪\x20Critical\x20CLI\x20upgrade\x20required','validation','join','2037246oGIeEs'];a265_0x454c=function(){return _0xff6dcc;};return a265_0x454c();}import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a265_0x3dd90a from'semver';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{CliErrors}from'../errors.js';export function getCliUpgradeCommand(_0x15dd42){const _0x5937fc=a265_0x5470,_0x335c47=_0x15dd42[_0x5937fc(0x1ac)]||_0x5937fc(0x1b8);return _0x5937fc(0x1a1)+NPM_PACKAGE_NAME+'@'+_0x335c47;}function getCurrentCliVersion(){const _0x137f55=a265_0x5470;try{const _0x2057fd=fileURLToPath(import.meta.url),_0x732956=resolve(dirname(_0x2057fd),'../..'),_0x524d61=resolve(_0x732956,_0x137f55(0x1a4)),_0x39f679=JSON['parse'](readFileSync(_0x524d61,_0x137f55(0x1c4)));return _0x39f679[_0x137f55(0x1c2)]||_0x137f55(0x1bb);}catch{return _0x137f55(0x1bb);}}export async function checkCliVersion(){const _0x43a70f=a265_0x5470,_0x54974e=getCurrentCliVersion(),_0x3427f2=await getCliVersionPolicy(),_0x1ce17a=_0x3427f2?.[_0x43a70f(0x1ac)]||null,_0x497765=_0x3427f2?.['minimumVersion']||null;let _0x148f57=![],_0x595542=![];const _0x262847=a265_0x3dd90a['coerce'](_0x54974e);if(_0x262847&&_0x1ce17a)try{const _0x56a433=a265_0x3dd90a[_0x43a70f(0x1af)](_0x1ce17a);if(_0x56a433)_0x148f57=a265_0x3dd90a['lt'](_0x262847,_0x56a433);}catch{}if(_0x262847&&_0x497765)try{const _0x357c93=a265_0x3dd90a[_0x43a70f(0x1af)](_0x497765);if(_0x357c93)_0x595542=a265_0x3dd90a['lt'](_0x262847,_0x357c93);}catch{}return _0x595542&&(_0x148f57=!![]),{'currentVersion':_0x54974e,'stableVersion':_0x1ce17a,'minimumVersion':_0x497765,'needsUpgrade':_0x148f57,'belowMinimum':_0x595542,'isPreRelease':![],'upgradeMessage':_0x3427f2?.[_0x43a70f(0x1b4)],'minimumVersionMessage':_0x3427f2?.[_0x43a70f(0x1a9)]};}export function printCliUpgradeWarning(_0x19b61b){const _0x51efe4=a265_0x5470;if(!_0x19b61b[_0x51efe4(0x1b1)]&&!_0x19b61b[_0x51efe4(0x1a7)])return;const _0x2e7ff8='\x1b[31m',_0x207299=_0x51efe4(0x1aa),_0x3ffb14='\x1b[0m',_0x4e0c4f=_0x51efe4(0x1ab),_0x4f22c9=getCliUpgradeCommand(_0x19b61b);console['log'](),_0x19b61b[_0x51efe4(0x1a7)]?(console[_0x51efe4(0x1ba)](''+_0x2e7ff8+_0x4e0c4f+_0x51efe4(0x1be)+_0x3ffb14),console[_0x51efe4(0x1ba)](_0x2e7ff8+_0x51efe4(0x1ae)+_0x19b61b[_0x51efe4(0x1bd)]+_0x3ffb14),_0x19b61b[_0x51efe4(0x1b5)]&&console[_0x51efe4(0x1ba)](_0x2e7ff8+'\x20\x20\x20Minimum\x20supported:\x20'+_0x19b61b['minimumVersion']+_0x3ffb14),_0x19b61b[_0x51efe4(0x1ac)]&&_0x19b61b[_0x51efe4(0x1ac)]!==_0x19b61b[_0x51efe4(0x1b5)]&&console[_0x51efe4(0x1ba)](_0x2e7ff8+_0x51efe4(0x1c3)+_0x19b61b[_0x51efe4(0x1ac)]+_0x3ffb14),_0x19b61b['minimumVersionMessage']&&console[_0x51efe4(0x1ba)](_0x2e7ff8+'\x20\x20\x20'+_0x19b61b[_0x51efe4(0x1a9)]+_0x3ffb14),console[_0x51efe4(0x1ba)](_0x2e7ff8+_0x51efe4(0x1ad)+_0x4f22c9+_0x3ffb14)):(console[_0x51efe4(0x1ba)](''+_0x207299+_0x4e0c4f+'↪\x20New\x20version\x20available'+_0x3ffb14),console[_0x51efe4(0x1ba)](_0x207299+_0x51efe4(0x1ae)+_0x19b61b[_0x51efe4(0x1bd)]+_0x3ffb14),console[_0x51efe4(0x1ba)](_0x207299+_0x51efe4(0x1c5)+_0x19b61b[_0x51efe4(0x1ac)]+_0x3ffb14),_0x19b61b['upgradeMessage']&&console[_0x51efe4(0x1ba)](_0x207299+_0x51efe4(0x1a6)+_0x19b61b[_0x51efe4(0x1b4)]+_0x3ffb14),console[_0x51efe4(0x1ba)](_0x207299+'\x20\x20\x20Upgrade\x20command:\x20'+_0x4f22c9+_0x3ffb14)),console[_0x51efe4(0x1ba)]();}function a265_0x5470(_0x1d76b2,_0x2e541e){_0x1d76b2=_0x1d76b2-0x1a1;const _0x454cfc=a265_0x454c();let _0x54702c=_0x454cfc[_0x1d76b2];return _0x54702c;}export function assertCliVersionSupported(_0x69d023){const _0x1a9510=a265_0x5470;if(!_0x69d023['belowMinimum'])return;const _0x5d249d=[_0x69d023['minimumVersionMessage'],'Current\x20version:\x20'+_0x69d023[_0x1a9510(0x1bd)],_0x69d023[_0x1a9510(0x1b5)]?_0x1a9510(0x1b0)+_0x69d023['minimumVersion']:null,_0x1a9510(0x1b3)+getCliUpgradeCommand(_0x69d023)][_0x1a9510(0x1a5)](Boolean)[_0x1a9510(0x1c0)]('\x0a');throw CliErrors[_0x1a9510(0x1bf)](_0x1a9510(0x1a3),_0x5d249d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4416b5,_0x4f0262){const _0x5e2e6d=a266_0x2065,_0x91029b=_0x4416b5();while(!![]){try{const _0x1abec0=parseInt(_0x5e2e6d(0x90))/0x1*(-parseInt(_0x5e2e6d(0x8b))/0x2)+-parseInt(_0x5e2e6d(0x8f))/0x3*(-parseInt(_0x5e2e6d(0x98))/0x4)+-parseInt(_0x5e2e6d(0x99))/0x5*(-parseInt(_0x5e2e6d(0xa1))/0x6)+-parseInt(_0x5e2e6d(0x8a))/0x7*(parseInt(_0x5e2e6d(0x94))/0x8)+parseInt(_0x5e2e6d(0x88))/0x9*(-parseInt(_0x5e2e6d(0xa2))/0xa)+parseInt(_0x5e2e6d(0x92))/0xb*(-parseInt(_0x5e2e6d(0x96))/0xc)+-parseInt(_0x5e2e6d(0x97))/0xd*(-parseInt(_0x5e2e6d(0x85))/0xe);if(_0x1abec0===_0x4f0262)break;else _0x91029b['push'](_0x91029b['shift']());}catch(_0x2f93df){_0x91029b['push'](_0x91029b['shift']());}}}(a266_0x16fa,0x9e454));import{CLI_VERSION_POLICY_URL}from'../constant/cdn.js';const CACHE_TTL=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL=0x3c*0x3e8,FETCH_TIMEOUT_MS=0xbb8;function pickString(_0x2a02e4){const _0x54f7d0=a266_0x2065;return typeof _0x2a02e4===_0x54f7d0(0x86)&&_0x2a02e4[_0x54f7d0(0x93)]()[_0x54f7d0(0x8e)]>0x0?_0x2a02e4[_0x54f7d0(0x93)]():null;}function a266_0x16fa(){const _0x2fa133=['820780KTZuRW','recommendedVersion','42DILugW','string','upgradeMessage','45unFDFx','minimumVersionMessage','4781EcCPnA','142oyNiIz','json','minVersion','length','60TkqOuu','17403keAFQT','latestVersion','11MRsSFm','trim','3864LEmblc','object','1326036zNpfun','4316117sRShDI','122816FuQxZG','20xPjwPf','signal','minimumVersion','abort','now','stableVersion','cli','application/json','1686846IaKdTZ'];a266_0x16fa=function(){return _0x2fa133;};return a266_0x16fa();}function a266_0x2065(_0x3af6a8,_0x4d876a){_0x3af6a8=_0x3af6a8-0x84;const _0x16faef=a266_0x16fa();let _0x20652b=_0x16faef[_0x3af6a8];return _0x20652b;}function normalizeCliVersionPolicy(_0x15bd3d){const _0x3dccab=a266_0x2065;if(!_0x15bd3d||typeof _0x15bd3d!==_0x3dccab(0x95))return null;const _0x239864=_0x15bd3d,_0x5d3e9c=_0x239864['cli']&&typeof _0x239864[_0x3dccab(0x9f)]===_0x3dccab(0x95)?_0x239864[_0x3dccab(0x9f)]:_0x239864,_0x3746dd=pickString(_0x5d3e9c[_0x3dccab(0x9e)])||pickString(_0x5d3e9c[_0x3dccab(0x91)])||pickString(_0x5d3e9c[_0x3dccab(0x84)]),_0x31c3e8=pickString(_0x5d3e9c[_0x3dccab(0x9b)])||pickString(_0x5d3e9c[_0x3dccab(0x8d)]);if(!_0x3746dd&&!_0x31c3e8)return null;return{'stableVersion':_0x3746dd,'minimumVersion':_0x31c3e8,'upgradeMessage':pickString(_0x5d3e9c[_0x3dccab(0x87)])||undefined,'minimumVersionMessage':pickString(_0x5d3e9c[_0x3dccab(0x89)])||undefined};}export async function fetchCliVersionPolicy(){const _0x5a2852=a266_0x2065,_0xb60c66=new AbortController(),_0x23ecc7=setTimeout(()=>_0xb60c66[_0x5a2852(0x9c)](),FETCH_TIMEOUT_MS);try{const _0x2537d2=await fetch(CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x5a2852(0xa0)},'signal':_0xb60c66[_0x5a2852(0x9a)]});if(!_0x2537d2['ok'])return null;const _0x3cae63=await _0x2537d2[_0x5a2852(0x8c)]();return normalizeCliVersionPolicy(_0x3cae63);}catch{return null;}finally{clearTimeout(_0x23ecc7);}}let cachedPolicy=null,cacheTime=0x0,hasCachedPolicy=![];export async function getCliVersionPolicy(){const _0x513bfa=a266_0x2065,_0x46e47d=Date[_0x513bfa(0x9d)]();if(hasCachedPolicy){const _0x1e0af0=cachedPolicy?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x46e47d-cacheTime<_0x1e0af0)return cachedPolicy;}const _0x54333b=await fetchCliVersionPolicy();return cachedPolicy=_0x54333b,cacheTime=_0x46e47d,hasCachedPolicy=!![],_0x54333b;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cacheTime=0x0,hasCachedPolicy=![];}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a267_0x408339=a267_0x1eaf;(function(_0x5be388,_0x362b99){const _0x12d551=a267_0x1eaf,_0x4371fe=_0x5be388();while(!![]){try{const _0x47ac9f=parseInt(_0x12d551(0xad))/0x1+-parseInt(_0x12d551(0xb5))/0x2*(-parseInt(_0x12d551(0xae))/0x3)+parseInt(_0x12d551(0xb2))/0x4+parseInt(_0x12d551(0xb0))/0x5*(-parseInt(_0x12d551(0xb1))/0x6)+-parseInt(_0x12d551(0xb7))/0x7*(-parseInt(_0x12d551(0xb6))/0x8)+parseInt(_0x12d551(0xb3))/0x9+-parseInt(_0x12d551(0xac))/0xa*(parseInt(_0x12d551(0xb9))/0xb);if(_0x47ac9f===_0x362b99)break;else _0x4371fe['push'](_0x4371fe['shift']());}catch(_0x4272ef){_0x4371fe['push'](_0x4371fe['shift']());}}}(a267_0x3af7,0x3db57));function a267_0x3af7(){const _0x3a8d61=['project','414805ihcaDV','6oCwoUd','577848pXIrqf','766710ZnrLMa','env','2TQxCEW','24KkDEJU','973021hzAbSa','string','114983EkqLFV','680SJEOGS','371562EjdEXu','84903mAoVrq'];a267_0x3af7=function(){return _0x3a8d61;};return a267_0x3af7();}import{initEnv}from'../constant/env.js';function a267_0x1eaf(_0x1b84da,_0x2c3cb5){_0x1b84da=_0x1b84da-0xac;const _0x3af79c=a267_0x3af7();let _0x1eaf7b=_0x3af79c[_0x1b84da];return _0x1eaf7b;}import{readRawConfig,getConfigAppCode as a267_0x2252d4,getMultiAppConfigs as a267_0xdc36ec,getTemplateBaseUrl as a267_0x31e011}from'../context.js';export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';export{isInProject}from'../context.js';export function readConfig(_0x41b214){const _0x2ce03e=a267_0x1eaf,_0x3a58bd=readRawConfig(_0x41b214);return _0x3a58bd[_0x2ce03e(0xb4)]&&typeof _0x3a58bd[_0x2ce03e(0xb4)]===_0x2ce03e(0xb8)&&initEnv(_0x3a58bd['env']),_0x3a58bd;}export function getConfigAppCode(){return a267_0x2252d4();}export function getMultiAppConfigs(_0xb79e1b=a267_0x408339(0xaf)){return a267_0xdc36ec(_0xb79e1b);}export function getTemplateBaseUrl(){return a267_0x31e011();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a268_0x5c96(){const _0xefe483=['65ZxHbQB','36060KBMgHP','8xogjkC','631752PRaojD','error','join','105GlrwSj','4654704JXKHQM','copyFileSync','926676crfkob','name','1244tuLBJt','7IDUWvT','复制目录时出错:','4678731nWvNuY','2833650zpmIdn','isDirectory','329QpxWav','110wVMbti'];a268_0x5c96=function(){return _0xefe483;};return a268_0x5c96();}(function(_0x266f3e,_0x2803ad){const _0xfc3427=a268_0xd5e1,_0x163126=_0x266f3e();while(!![]){try{const _0x3b8317=-parseInt(_0xfc3427(0x19d))/0x1*(-parseInt(_0xfc3427(0x1aa))/0x2)+-parseInt(_0xfc3427(0x1a8))/0x3+-parseInt(_0xfc3427(0x1a0))/0x4*(-parseInt(_0xfc3427(0x1a5))/0x5)+-parseInt(_0xfc3427(0x19b))/0x6*(parseInt(_0xfc3427(0x1ab))/0x7)+-parseInt(_0xfc3427(0x1a1))/0x8*(parseInt(_0xfc3427(0x1ad))/0x9)+parseInt(_0xfc3427(0x19e))/0xa*(-parseInt(_0xfc3427(0x1a2))/0xb)+parseInt(_0xfc3427(0x1a6))/0xc*(parseInt(_0xfc3427(0x19f))/0xd);if(_0x3b8317===_0x2803ad)break;else _0x163126['push'](_0x163126['shift']());}catch(_0x321b90){_0x163126['push'](_0x163126['shift']());}}}(a268_0x5c96,0x61cfb));import a268_0x11c2fc from'node:path';function a268_0xd5e1(_0x773ea4,_0x1bdb93){_0x773ea4=_0x773ea4-0x19b;const _0x5c960b=a268_0x5c96();let _0xd5e185=_0x5c960b[_0x773ea4];return _0xd5e185;}import a268_0x46cb77 from'node:fs';export async function copyDirectory(_0x374000,_0x59ee3a){const _0x2c1662=a268_0xd5e1;try{const _0x49cb6a=a268_0x46cb77['readdirSync'](_0x374000,{'withFileTypes':!![]});a268_0x46cb77['mkdirSync'](_0x59ee3a,{'recursive':!![]});for(const _0x36a985 of _0x49cb6a){const _0x586922=a268_0x11c2fc['join'](_0x374000,_0x36a985[_0x2c1662(0x1a9)]),_0x2e8eae=a268_0x11c2fc[_0x2c1662(0x1a4)](_0x59ee3a,_0x36a985[_0x2c1662(0x1a9)]);_0x36a985[_0x2c1662(0x19c)]()?await copyDirectory(_0x586922,_0x2e8eae):a268_0x46cb77[_0x2c1662(0x1a7)](_0x586922,_0x2e8eae);}}catch(_0x218769){console[_0x2c1662(0x1a3)](_0x2c1662(0x1ac),_0x218769);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7e0ec5,_0x314f1e){const _0x4a5b03=a269_0x5528,_0x24f5b5=_0x7e0ec5();while(!![]){try{const _0x5101a0=parseInt(_0x4a5b03(0x14a))/0x1*(-parseInt(_0x4a5b03(0x14e))/0x2)+-parseInt(_0x4a5b03(0x14d))/0x3+parseInt(_0x4a5b03(0x153))/0x4*(-parseInt(_0x4a5b03(0x14b))/0x5)+-parseInt(_0x4a5b03(0x154))/0x6*(-parseInt(_0x4a5b03(0x155))/0x7)+-parseInt(_0x4a5b03(0x14c))/0x8*(-parseInt(_0x4a5b03(0x151))/0x9)+parseInt(_0x4a5b03(0x148))/0xa*(parseInt(_0x4a5b03(0x152))/0xb)+parseInt(_0x4a5b03(0x147))/0xc;if(_0x5101a0===_0x314f1e)break;else _0x24f5b5['push'](_0x24f5b5['shift']());}catch(_0x3f5547){_0x24f5b5['push'](_0x24f5b5['shift']());}}}(a269_0x2e1c,0x5fb46));function a269_0x5528(_0x263d84,_0x2b3f0f){_0x263d84=_0x263d84-0x146;const _0x2e1cbc=a269_0x2e1c();let _0x5528c3=_0x2e1cbc[_0x263d84];return _0x5528c3;}function toFiniteNumber(_0xfaa9a1){const _0x248947=a269_0x5528;if(typeof _0xfaa9a1===_0x248947(0x14f)&&Number[_0x248947(0x150)](_0xfaa9a1))return _0xfaa9a1;if(typeof _0xfaa9a1===_0x248947(0x146)){const _0x1f426c=_0xfaa9a1[_0x248947(0x149)]();if(!_0x1f426c)return undefined;const _0x134817=Number(_0x1f426c);if(Number[_0x248947(0x150)](_0x134817))return _0x134817;}return undefined;}export function normalizeEntityWithIdResponse(_0x583ead){const _0x2c9f5b=toFiniteNumber(_0x583ead);if(_0x2c9f5b!==undefined)return{'id':_0x2c9f5b,'entity':{'id':_0x2c9f5b}};if(!_0x583ead||typeof _0x583ead!=='object')return{'id':undefined,'entity':{}};const _0x54d59e={..._0x583ead},_0x3e3e4a=toFiniteNumber(_0x54d59e['id']);return _0x3e3e4a!==undefined&&(_0x54d59e['id']=_0x3e3e4a),{'id':_0x3e3e4a,'entity':_0x54d59e};}function a269_0x2e1c(){const _0x2f5ebf=['number','isFinite','3684159TbqqMJ','22owaHoM','10596FmjcLZ','27528EqkEKP','315GEZIVR','string','5602896ewiHCh','2359830LQmrao','trim','4Btxwqd','130tUQSyz','8bdFaiT','2227623hbyuPT','175632kUEkIZ'];a269_0x2e1c=function(){return _0x2f5ebf;};return a269_0x2e1c();}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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
|
-
(function(
|
|
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
|
-
const
|
|
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
|
-
const
|
|
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
|
-
function
|
|
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();}}
|