@lovrabet/rabetbase-cli 2.3.16-beta.2 → 2.3.16-beta.4
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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1ad1e1,_0x174ecb){const _0x4d1920=a254_0x4b80,_0x1d5b46=_0x1ad1e1();while(!![]){try{const _0xe7f9fa=parseInt(_0x4d1920(0xfe))/0x1*(-parseInt(_0x4d1920(0xf9))/0x2)+parseInt(_0x4d1920(0x101))/0x3+-parseInt(_0x4d1920(0xfc))/0x4+-parseInt(_0x4d1920(0xff))/0x5+-parseInt(_0x4d1920(0xfb))/0x6+parseInt(_0x4d1920(0xfa))/0x7*(parseInt(_0x4d1920(0xfd))/0x8)+-parseInt(_0x4d1920(0x102))/0x9*(-parseInt(_0x4d1920(0x100))/0xa);if(_0xe7f9fa===_0x174ecb)break;else _0x1d5b46['push'](_0x1d5b46['shift']());}catch(_0x3ab26d){_0x1d5b46['push'](_0x1d5b46['shift']());}}}(a254_0x1b4a,0xe5a83));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a254_0x4b80(_0x4c3946,_0x4fb7c0){_0x4c3946=_0x4c3946-0xf9;const _0x1b4a3b=a254_0x1b4a();let _0x4b8088=_0x1b4a3b[_0x4c3946];return _0x4b8088;}import{CliErrors}from'../errors.js';function a254_0x1b4a(){const _0x1bb861=['11241KXBKgp','154MJIwjO','1747403GburDq','4882530FfyzHI','7003152HpquLi','32GFqKpp','13933mZqVdD','1283610OGCirI','26700kBgdHY','1504305ybTOMx'];a254_0x1b4a=function(){return _0x1bb861;};return a254_0x1b4a();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x417e52,_0x9b1b1f){const _0x454eaf=a255_0x3d58,_0x1811bf=_0x417e52();while(!![]){try{const _0x52c4cb=-parseInt(_0x454eaf(0xb7))/0x1+-parseInt(_0x454eaf(0xb3))/0x2+-parseInt(_0x454eaf(0xad))/0x3*(parseInt(_0x454eaf(0xb5))/0x4)+-parseInt(_0x454eaf(0xb2))/0x5*(parseInt(_0x454eaf(0xb6))/0x6)+-parseInt(_0x454eaf(0xb1))/0x7*(parseInt(_0x454eaf(0xb0))/0x8)+parseInt(_0x454eaf(0xae))/0x9*(parseInt(_0x454eaf(0xa6))/0xa)+-parseInt(_0x454eaf(0xab))/0xb*(-parseInt(_0x454eaf(0xac))/0xc);if(_0x52c4cb===_0x9b1b1f)break;else _0x1811bf['push'](_0x1811bf['shift']());}catch(_0x57ddbb){_0x1811bf['push'](_0x1811bf['shift']());}}}(a255_0x517f,0x7238f));import{getTemplateBaseUrl}from'../utils/config.js';export async function fetchCdnConfig(){const _0x47d79a=a255_0x3d58,_0x4463a6=getTemplateBaseUrl(),_0x5e94fa=[_0x4463a6+_0x47d79a(0xa7),_0x4463a6+_0x47d79a(0xa9)];for(const _0x37ef99 of _0x5e94fa){try{const _0x4ca876=await fetch(_0x37ef99,{'headers':{'Accept':_0x47d79a(0xaf)}});if(!_0x4ca876['ok'])continue;const _0xcb069b=await _0x4ca876['json']();if(!_0xcb069b['cli']?.['stableVersion']||!_0xcb069b[_0x47d79a(0xa8)]?.['node']?.[_0x47d79a(0xaa)])continue;return _0xcb069b;}catch{}}return null;}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL=0x3c*0x3e8;let hasCachedConfig=![];export async function getCdnConfig(){const _0x472384=a255_0x3d58,_0x3d2a98=Date[_0x472384(0xb4)]();if(hasCachedConfig){const _0x5d689b=cachedConfig?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x3d2a98-cacheTime<_0x5d689b)return cachedConfig;}const _0x121fac=await fetchCdnConfig();return cachedConfig=_0x121fac,cacheTime=_0x3d2a98,hasCachedConfig=!![],_0x121fac;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0,hasCachedConfig=![];}function a255_0x3d58(_0x58cc6d,_0x1cfd7b){_0x58cc6d=_0x58cc6d-0xa6;const _0x517fb3=a255_0x517f();let _0x3d58cd=_0x517fb3[_0x58cc6d];return _0x3d58cd;}function a255_0x517f(){const _0x1d3e5b=['/config.json','sdk','/config/index.json','stableVersion','27364469sNbmqY','12Ppxiqf','3sRenxp','1035udtAjk','application/json','4924888FJcDsu','7BzuXLA','5epXhXL','390622iIIaSl','now','627412oZYLRy','3947736nIjxGm','908258RFnBmh','44710WYGmhw'];a255_0x517f=function(){return _0x1d3e5b;};return a255_0x517f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a256_0x3a5983=a256_0x7cfe;(function(_0x364c2a,_0x2b57e9){const _0x59937b=a256_0x7cfe,_0x13b026=_0x364c2a();while(!![]){try{const _0x421075=parseInt(_0x59937b(0x8d))/0x1*(-parseInt(_0x59937b(0x6d))/0x2)+parseInt(_0x59937b(0x6f))/0x3*(parseInt(_0x59937b(0x6e))/0x4)+parseInt(_0x59937b(0x6c))/0x5*(-parseInt(_0x59937b(0x7d))/0x6)+parseInt(_0x59937b(0x7f))/0x7*(parseInt(_0x59937b(0x8a))/0x8)+parseInt(_0x59937b(0x70))/0x9*(parseInt(_0x59937b(0x71))/0xa)+parseInt(_0x59937b(0x74))/0xb+parseInt(_0x59937b(0x78))/0xc*(-parseInt(_0x59937b(0x7a))/0xd);if(_0x421075===_0x2b57e9)break;else _0x13b026['push'](_0x13b026['shift']());}catch(_0xc84b8b){_0x13b026['push'](_0x13b026['shift']());}}}(a256_0x102c,0x3b92d));import a256_0xeea591 from'node:fs';import a256_0x4442dc from'node:path';import a256_0x30045c from'semver';import{getCdnConfig}from'../utils/cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a256_0x3a5983(0x84);function a256_0x7cfe(_0x1781f8,_0x55cf48){_0x1781f8=_0x1781f8-0x67;const _0x102c4b=a256_0x102c();let _0x7cfee3=_0x102c4b[_0x1781f8];return _0x7cfee3;}function isNonNumericVersion(_0x2e58f6){const _0x5954c1=a256_0x3a5983,_0x52846d=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x52846d['some'](_0xe4cf98=>_0xe4cf98[_0x5954c1(0x89)](_0x2e58f6));}function getInstalledVersion(_0x4f8e1a,_0x4c39e6){const _0x106fcd=a256_0x3a5983;try{const _0x367199=a256_0x4442dc[_0x106fcd(0x76)](_0x4f8e1a,_0x106fcd(0x68),_0x4c39e6,_0x106fcd(0x87));if(a256_0xeea591['existsSync'](_0x367199)){const _0x82fd21=JSON[_0x106fcd(0x73)](a256_0xeea591[_0x106fcd(0x8e)](_0x367199,'utf-8'));return _0x82fd21['version']||null;}}catch{}return null;}async function getSdkStableVersion(){const _0x28538a=a256_0x3a5983;try{const _0xac9d3c=await getCdnConfig();return _0xac9d3c?.[_0x28538a(0x77)]?.[_0x28538a(0x83)]?.[_0x28538a(0x88)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x52cf72=a256_0x3a5983;try{const _0x1082fb=await getCdnConfig();return _0x1082fb?.[_0x52cf72(0x77)]?.[_0x52cf72(0x83)]?.[_0x52cf72(0x72)]||_0x52cf72(0x79);}catch{return _0x52cf72(0x79);}}function a256_0x102c(){const _0x1641f9=['2YxlYZt','12qlotzM','32868vseRNV','279AWYKqw','114340mYSAkb','packageName','parse','2669194CCagoR','dependencies','join','sdk','2292mhRpoy','@lovrabet/sdk','12259DJSkJd','\x1b[1m','\x1b[0m','18JrjTnh','devDependencies','63wCogRl','latest','npm\x20install\x20','utf8','node','1.2.0','minVersion','existsSync','package.json','stableVersion','test','221608XalGMz','\x20\x20\x20Stable\x20version:\x20','↪\x20SDK\x20update\x20available','86249MZyRwp','readFileSync','version','\x1b[33m','node_modules','log','needsUpgrade','coerce','614850ISekgX'];a256_0x102c=function(){return _0x1641f9;};return a256_0x102c();}export async function checkSdkVersion(_0x2a023a){const _0x401952=a256_0x3a5983,_0x3352b8=a256_0x4442dc[_0x401952(0x76)](_0x2a023a,'package.json'),[_0x4760a1,_0x11d844]=await Promise['all']([getSdkStableVersion(),getSdkPackageName()]),_0x37dcdc=_0x4760a1||FALLBACK_MIN_SDK_VERSION;if(!a256_0xeea591[_0x401952(0x86)](_0x3352b8))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x37dcdc,'packageName':_0x11d844,'stableVersion':_0x4760a1};try{const _0x5459ae=JSON[_0x401952(0x73)](a256_0xeea591[_0x401952(0x8e)](_0x3352b8,_0x401952(0x82))),_0x7fead9=_0x5459ae[_0x401952(0x75)]||{},_0x3b73a9=_0x5459ae['devDependencies']||{},_0x19afd6=_0x7fead9[_0x11d844]||_0x3b73a9[_0x11d844];if(!_0x19afd6)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x37dcdc,'packageName':_0x11d844,'stableVersion':_0x4760a1};let _0x2ae41c=getInstalledVersion(_0x2a023a,_0x11d844);!_0x2ae41c&&(_0x2ae41c=_0x19afd6);if(isNonNumericVersion(_0x19afd6))return{'installed':!![],'version':_0x2ae41c,'needsUpgrade':![],'minVersion':_0x37dcdc,'packageName':_0x11d844,'stableVersion':_0x4760a1};const _0x1e0e78=a256_0x30045c[_0x401952(0x6b)](_0x2ae41c),_0x39a7e1=a256_0x30045c['coerce'](_0x37dcdc),_0x31c128=_0x1e0e78&&_0x39a7e1?a256_0x30045c['lt'](_0x1e0e78,_0x39a7e1):![];return{'installed':!![],'version':_0x2ae41c,'needsUpgrade':_0x31c128,'minVersion':_0x37dcdc,'packageName':_0x11d844,'stableVersion':_0x4760a1};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x37dcdc,'packageName':_0x11d844,'stableVersion':_0x4760a1};}}export function checkSdkVersionSync(_0x4c0d85){const _0xf98209=a256_0x3a5983,_0x27a777=a256_0x4442dc[_0xf98209(0x76)](_0x4c0d85,_0xf98209(0x87)),_0xd8ba8c=_0xf98209(0x79);if(!a256_0xeea591[_0xf98209(0x86)](_0x27a777))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0xd8ba8c,'stableVersion':null};try{const _0x27a3a1=JSON[_0xf98209(0x73)](a256_0xeea591[_0xf98209(0x8e)](_0x27a777,'utf8')),_0x5cfaed=_0x27a3a1['dependencies']||{},_0x3e7e12=_0x27a3a1[_0xf98209(0x7e)]||{},_0x2fcd1f=_0x5cfaed[_0xd8ba8c]||_0x3e7e12[_0xd8ba8c];if(!_0x2fcd1f)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0xd8ba8c,'stableVersion':null};let _0x5a7e41=getInstalledVersion(_0x4c0d85,_0xd8ba8c);!_0x5a7e41&&(_0x5a7e41=_0x2fcd1f);if(isNonNumericVersion(_0x2fcd1f))return{'installed':!![],'version':_0x5a7e41,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0xd8ba8c,'stableVersion':null};const _0x23ca63=a256_0x30045c['coerce'](_0x5a7e41),_0x3c8844=_0x23ca63?a256_0x30045c['lt'](_0x23ca63,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x5a7e41,'needsUpgrade':_0x3c8844,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0xd8ba8c,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0xd8ba8c,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x472659){const _0x2315d4=a256_0x3a5983;if(!_0x472659[_0x2315d4(0x6a)])return;const _0x391f01=_0x2315d4(0x67),_0x26d386=_0x2315d4(0x7c),_0x24dbf9=_0x2315d4(0x7b),_0x403491=_0x472659['packageName']||'@lovrabet/sdk',_0x3419e6=_0x472659[_0x2315d4(0x88)]||_0x472659[_0x2315d4(0x85)],_0x406820=_0x2315d4(0x81)+_0x403491+'@'+(_0x3419e6||_0x2315d4(0x80));console[_0x2315d4(0x69)](),console[_0x2315d4(0x69)](''+_0x391f01+_0x24dbf9+_0x2315d4(0x8c)+_0x26d386),console[_0x2315d4(0x69)](_0x391f01+'\x20\x20\x20Current\x20version:\x20'+_0x403491+'@'+_0x472659[_0x2315d4(0x8f)]+_0x26d386),console[_0x2315d4(0x69)](_0x391f01+_0x2315d4(0x8b)+_0x3419e6+_0x26d386),console[_0x2315d4(0x69)](_0x391f01+'\x20\x20\x20Upgrade\x20command:\x20'+_0x406820+_0x26d386),console['log']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b0ba0,_0x573151){const _0x4cc529=a257_0x4c75,_0x4b81dd=_0x1b0ba0();while(!![]){try{const _0x27de69=-parseInt(_0x4cc529(0x1c4))/0x1+-parseInt(_0x4cc529(0x1ac))/0x2+-parseInt(_0x4cc529(0x1af))/0x3+-parseInt(_0x4cc529(0x1bc))/0x4+parseInt(_0x4cc529(0x1b7))/0x5*(-parseInt(_0x4cc529(0x1be))/0x6)+parseInt(_0x4cc529(0x1b6))/0x7+-parseInt(_0x4cc529(0x1c0))/0x8*(-parseInt(_0x4cc529(0x1b5))/0x9);if(_0x27de69===_0x573151)break;else _0x4b81dd['push'](_0x4b81dd['shift']());}catch(_0x31d7a1){_0x4b81dd['push'](_0x4b81dd['shift']());}}}(a257_0x51c0,0xb54de));import{readFileSync}from'node:fs';function a257_0x51c0(){const _0x251046=['coerce','\x20\x20\x20Current\x20CLI\x20version:\x20','\x1b[31m','latest','../..','stableVersion','1957174owZEpR','currentVersion','validation','1708749HfMcRK','belowMinimum','package.json','upgradeMessage','minimumVersionMessage','Minimum\x20supported:\x20','681039LeVFdo','9429049jYPhUa','1797805nbDCxl','\x20\x20\x20','↪\x20New\x20version\x20available','log','\x1b[33m','2413572xdinSc','Current\x20version:\x20','12VRooSs','\x1b[0m','272pjKsia','join','minimumVersion','parse','306514uvKqPx','filter','1.0.0'];a257_0x51c0=function(){return _0x251046;};return a257_0x51c0();}import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a257_0x36bc5a from'semver';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{CliErrors}from'../errors.js';function a257_0x4c75(_0x20e002,_0x5e5e8f){_0x20e002=_0x20e002-0x1a6;const _0x51c0e0=a257_0x51c0();let _0x4c759b=_0x51c0e0[_0x20e002];return _0x4c759b;}export function getCliUpgradeCommand(_0x5812db){const _0x3d2669=a257_0x4c75,_0x10263c=_0x5812db[_0x3d2669(0x1ab)]||_0x3d2669(0x1a9);return'npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x10263c;}function getCurrentCliVersion(){const _0x1ee303=a257_0x4c75;try{const _0x41fb66=fileURLToPath(import.meta.url),_0x17924a=resolve(dirname(_0x41fb66),_0x1ee303(0x1aa)),_0x34a1be=resolve(_0x17924a,_0x1ee303(0x1b1)),_0x5115f5=JSON[_0x1ee303(0x1c3)](readFileSync(_0x34a1be,'utf-8'));return _0x5115f5['version']||'1.0.0';}catch{return _0x1ee303(0x1c6);}}export async function checkCliVersion(){const _0x3321d4=a257_0x4c75,_0x126c6b=getCurrentCliVersion(),_0x172473=await getCliVersionPolicy(),_0x49a2a4=_0x172473?.[_0x3321d4(0x1ab)]||null,_0x22d880=_0x172473?.[_0x3321d4(0x1c2)]||null;let _0x113f40=![],_0x2e35c2=![];const _0x28b35e=a257_0x36bc5a[_0x3321d4(0x1a6)](_0x126c6b);if(_0x28b35e&&_0x49a2a4)try{const _0x1d6bbb=a257_0x36bc5a['coerce'](_0x49a2a4);if(_0x1d6bbb)_0x113f40=a257_0x36bc5a['lt'](_0x28b35e,_0x1d6bbb);}catch{}if(_0x28b35e&&_0x22d880)try{const _0x1a096a=a257_0x36bc5a['coerce'](_0x22d880);if(_0x1a096a)_0x2e35c2=a257_0x36bc5a['lt'](_0x28b35e,_0x1a096a);}catch{}return _0x2e35c2&&(_0x113f40=!![]),{'currentVersion':_0x126c6b,'stableVersion':_0x49a2a4,'minimumVersion':_0x22d880,'needsUpgrade':_0x113f40,'belowMinimum':_0x2e35c2,'isPreRelease':![],'upgradeMessage':_0x172473?.['upgradeMessage'],'minimumVersionMessage':_0x172473?.[_0x3321d4(0x1b3)]};}export function printCliUpgradeWarning(_0x1565d8){const _0x2636e4=a257_0x4c75;if(!_0x1565d8['needsUpgrade']&&!_0x1565d8[_0x2636e4(0x1b0)])return;const _0x3b0728=_0x2636e4(0x1a8),_0x1c27b1=_0x2636e4(0x1bb),_0x2ef976=_0x2636e4(0x1bf),_0x128da6='\x1b[1m',_0xc27aa=getCliUpgradeCommand(_0x1565d8);console['log'](),_0x1565d8[_0x2636e4(0x1b0)]?(console[_0x2636e4(0x1ba)](''+_0x3b0728+_0x128da6+'↪\x20Critical\x20CLI\x20upgrade\x20required'+_0x2ef976),console[_0x2636e4(0x1ba)](_0x3b0728+_0x2636e4(0x1a7)+_0x1565d8[_0x2636e4(0x1ad)]+_0x2ef976),_0x1565d8[_0x2636e4(0x1c2)]&&console[_0x2636e4(0x1ba)](_0x3b0728+'\x20\x20\x20Minimum\x20supported:\x20'+_0x1565d8[_0x2636e4(0x1c2)]+_0x2ef976),_0x1565d8['stableVersion']&&_0x1565d8[_0x2636e4(0x1ab)]!==_0x1565d8['minimumVersion']&&console[_0x2636e4(0x1ba)](_0x3b0728+'\x20\x20\x20Recommended\x20stable:\x20'+_0x1565d8[_0x2636e4(0x1ab)]+_0x2ef976),_0x1565d8[_0x2636e4(0x1b3)]&&console[_0x2636e4(0x1ba)](_0x3b0728+_0x2636e4(0x1b8)+_0x1565d8[_0x2636e4(0x1b3)]+_0x2ef976),console['log'](_0x3b0728+'\x20\x20\x20Upgrade\x20command:\x20'+_0xc27aa+_0x2ef976)):(console['log'](''+_0x1c27b1+_0x128da6+_0x2636e4(0x1b9)+_0x2ef976),console['log'](_0x1c27b1+_0x2636e4(0x1a7)+_0x1565d8[_0x2636e4(0x1ad)]+_0x2ef976),console['log'](_0x1c27b1+'\x20\x20\x20Stable\x20version:\x20'+_0x1565d8[_0x2636e4(0x1ab)]+_0x2ef976),_0x1565d8[_0x2636e4(0x1b2)]&&console[_0x2636e4(0x1ba)](_0x1c27b1+_0x2636e4(0x1b8)+_0x1565d8['upgradeMessage']+_0x2ef976),console[_0x2636e4(0x1ba)](_0x1c27b1+'\x20\x20\x20Upgrade\x20command:\x20'+_0xc27aa+_0x2ef976)),console[_0x2636e4(0x1ba)]();}export function assertCliVersionSupported(_0x24c813){const _0x40912a=a257_0x4c75;if(!_0x24c813[_0x40912a(0x1b0)])return;const _0x3ec886=[_0x24c813[_0x40912a(0x1b3)],_0x40912a(0x1bd)+_0x24c813[_0x40912a(0x1ad)],_0x24c813[_0x40912a(0x1c2)]?_0x40912a(0x1b4)+_0x24c813[_0x40912a(0x1c2)]:null,'Upgrade\x20command:\x20'+getCliUpgradeCommand(_0x24c813)][_0x40912a(0x1c5)](Boolean)[_0x40912a(0x1c1)]('\x0a');throw CliErrors[_0x40912a(0x1ae)]('Current\x20CLI\x20version\x20is\x20below\x20the\x20service\x20compatibility\x20support\x20line.',_0x3ec886);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x404036,_0x56b6e0){const _0x1a1b30=a258_0x4c3d,_0x144a41=_0x404036();while(!![]){try{const _0x5e9ad0=parseInt(_0x1a1b30(0x83))/0x1*(parseInt(_0x1a1b30(0x90))/0x2)+parseInt(_0x1a1b30(0x8d))/0x3*(parseInt(_0x1a1b30(0x8f))/0x4)+-parseInt(_0x1a1b30(0x85))/0x5+-parseInt(_0x1a1b30(0x84))/0x6+-parseInt(_0x1a1b30(0x96))/0x7+-parseInt(_0x1a1b30(0x8a))/0x8*(parseInt(_0x1a1b30(0x92))/0x9)+-parseInt(_0x1a1b30(0x91))/0xa*(-parseInt(_0x1a1b30(0x8e))/0xb);if(_0x5e9ad0===_0x56b6e0)break;else _0x144a41['push'](_0x144a41['shift']());}catch(_0x50b0d5){_0x144a41['push'](_0x144a41['shift']());}}}(a258_0x265d,0xaa3b4));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(_0x1406e7){const _0x242abf=a258_0x4c3d;return typeof _0x1406e7==='string'&&_0x1406e7[_0x242abf(0x94)]()[_0x242abf(0x89)]>0x0?_0x1406e7[_0x242abf(0x94)]():null;}function normalizeCliVersionPolicy(_0xfc2a77){const _0x4ff85e=a258_0x4c3d;if(!_0xfc2a77||typeof _0xfc2a77!==_0x4ff85e(0x97))return null;const _0x347d40=_0xfc2a77,_0x396b01=_0x347d40[_0x4ff85e(0x88)]&&typeof _0x347d40[_0x4ff85e(0x88)]==='object'?_0x347d40[_0x4ff85e(0x88)]:_0x347d40,_0x2048c7=pickString(_0x396b01[_0x4ff85e(0x95)])||pickString(_0x396b01[_0x4ff85e(0x8b)])||pickString(_0x396b01[_0x4ff85e(0x86)]),_0x317cb1=pickString(_0x396b01['minimumVersion'])||pickString(_0x396b01[_0x4ff85e(0x81)]);if(!_0x2048c7&&!_0x317cb1)return null;return{'stableVersion':_0x2048c7,'minimumVersion':_0x317cb1,'upgradeMessage':pickString(_0x396b01['upgradeMessage'])||undefined,'minimumVersionMessage':pickString(_0x396b01['minimumVersionMessage'])||undefined};}function a258_0x4c3d(_0x252af2,_0x1e334a){_0x252af2=_0x252af2-0x81;const _0x265de3=a258_0x265d();let _0x4c3d0d=_0x265de3[_0x252af2];return _0x4c3d0d;}export async function fetchCliVersionPolicy(){const _0x9991c2=a258_0x4c3d,_0x321608=new AbortController(),_0x14d497=setTimeout(()=>_0x321608[_0x9991c2(0x82)](),FETCH_TIMEOUT_MS);try{const _0x5b5fbf=await fetch(CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x9991c2(0x93)},'signal':_0x321608['signal']});if(!_0x5b5fbf['ok'])return null;const _0x5d8175=await _0x5b5fbf[_0x9991c2(0x8c)]();return normalizeCliVersionPolicy(_0x5d8175);}catch{return null;}finally{clearTimeout(_0x14d497);}}let cachedPolicy=null,cacheTime=0x0,hasCachedPolicy=![];export async function getCliVersionPolicy(){const _0x232dc2=a258_0x4c3d,_0x434bdd=Date[_0x232dc2(0x87)]();if(hasCachedPolicy){const _0xe55f=cachedPolicy?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x434bdd-cacheTime<_0xe55f)return cachedPolicy;}const _0xc6d35d=await fetchCliVersionPolicy();return cachedPolicy=_0xc6d35d,cacheTime=_0x434bdd,hasCachedPolicy=!![],_0xc6d35d;}function a258_0x265d(){const _0x3db82c=['json','508857njqxFq','11rpQxsW','20MaMZFk','366334PVcccR','17593610bezjwY','2277261jLTiRg','application/json','trim','stableVersion','2293697YtKBYj','object','minVersion','abort','3uZhFrW','7069464NDpcQB','973435UObVrF','recommendedVersion','now','cli','length','24cVNqYY','latestVersion'];a258_0x265d=function(){return _0x3db82c;};return a258_0x265d();}export function clearCliVersionPolicyCache(){cachedPolicy=null,cacheTime=0x0,hasCachedPolicy=![];}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a259_0x43bde6=a259_0x59dd;(function(_0x325ec1,_0x315a97){const _0x33818a=a259_0x59dd,_0x1ae7c9=_0x325ec1();while(!![]){try{const _0x2f7259=-parseInt(_0x33818a(0x1a4))/0x1+parseInt(_0x33818a(0x19f))/0x2+parseInt(_0x33818a(0x1a1))/0x3+parseInt(_0x33818a(0x1a0))/0x4+parseInt(_0x33818a(0x1a9))/0x5*(parseInt(_0x33818a(0x19e))/0x6)+parseInt(_0x33818a(0x1a8))/0x7*(parseInt(_0x33818a(0x1a3))/0x8)+-parseInt(_0x33818a(0x1a5))/0x9;if(_0x2f7259===_0x315a97)break;else _0x1ae7c9['push'](_0x1ae7c9['shift']());}catch(_0x121492){_0x1ae7c9['push'](_0x1ae7c9['shift']());}}}(a259_0x5f8e,0x6db06));import{initEnv}from'../constant/env.js';import{readRawConfig,getConfigAppCode as a259_0x44648a,getMultiAppConfigs as a259_0x166d33,getTemplateBaseUrl as a259_0x4dbc2d}from'../context.js';function a259_0x59dd(_0x3507c7,_0x550baf){_0x3507c7=_0x3507c7-0x19e;const _0x5f8ebb=a259_0x5f8e();let _0x59dd2a=_0x5f8ebb[_0x3507c7];return _0x59dd2a;}export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';function a259_0x5f8e(){const _0xbda506=['project','string','238PVFdUo','310JatfMU','1020qWdSlo','807294BiimRg','1684392tprMOJ','2656839VAiVfr','env','7224WMuaLo','95958XOMtHS','10857204WFScWJ'];a259_0x5f8e=function(){return _0xbda506;};return a259_0x5f8e();}export{isInProject}from'../context.js';export function readConfig(_0x21752e){const _0x10b853=a259_0x59dd,_0x231c6d=readRawConfig(_0x21752e);return _0x231c6d[_0x10b853(0x1a2)]&&typeof _0x231c6d[_0x10b853(0x1a2)]===_0x10b853(0x1a7)&&initEnv(_0x231c6d['env']),_0x231c6d;}export function getConfigAppCode(){return a259_0x44648a();}export function getMultiAppConfigs(_0x352bb4=a259_0x43bde6(0x1a6)){return a259_0x166d33(_0x352bb4);}export function getTemplateBaseUrl(){return a259_0x4dbc2d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a5387,_0x22dc6c){const _0x2879ff=a260_0x4abe,_0x52081b=_0x3a5387();while(!![]){try{const _0x551844=-parseInt(_0x2879ff(0x119))/0x1*(-parseInt(_0x2879ff(0x116))/0x2)+-parseInt(_0x2879ff(0x112))/0x3*(-parseInt(_0x2879ff(0x105))/0x4)+parseInt(_0x2879ff(0x111))/0x5*(parseInt(_0x2879ff(0x118))/0x6)+-parseInt(_0x2879ff(0x10f))/0x7*(parseInt(_0x2879ff(0x117))/0x8)+parseInt(_0x2879ff(0x10b))/0x9+parseInt(_0x2879ff(0x113))/0xa*(-parseInt(_0x2879ff(0x108))/0xb)+-parseInt(_0x2879ff(0x10a))/0xc*(parseInt(_0x2879ff(0x107))/0xd);if(_0x551844===_0x22dc6c)break;else _0x52081b['push'](_0x52081b['shift']());}catch(_0x1acc89){_0x52081b['push'](_0x52081b['shift']());}}}(a260_0x1cda,0x7808a));import a260_0x54ea2a from'node:path';import a260_0xed5e84 from'node:fs';function a260_0x1cda(){const _0x1b8ae5=['复制目录时出错:','13sqsXlh','1375BeIKOL','isDirectory','16724340tktIsF','6975090DBmqzt','name','copyFileSync','mkdirSync','865550zmjQGv','join','11185KvLZbi','190011blnteb','5790QBQoLR','error','readdirSync','32fQYDts','40IjyLEd','1362cJaupP','45196KYMFgM','36SWxfTo'];a260_0x1cda=function(){return _0x1b8ae5;};return a260_0x1cda();}function a260_0x4abe(_0x320e9e,_0x4fc56c){_0x320e9e=_0x320e9e-0x105;const _0x1cda9b=a260_0x1cda();let _0x4abe28=_0x1cda9b[_0x320e9e];return _0x4abe28;}export async function copyDirectory(_0x5d84c9,_0x320894){const _0x3f391e=a260_0x4abe;try{const _0x1a9a51=a260_0xed5e84[_0x3f391e(0x115)](_0x5d84c9,{'withFileTypes':!![]});a260_0xed5e84[_0x3f391e(0x10e)](_0x320894,{'recursive':!![]});for(const _0x4eeb19 of _0x1a9a51){const _0x2083bd=a260_0x54ea2a[_0x3f391e(0x110)](_0x5d84c9,_0x4eeb19[_0x3f391e(0x10c)]),_0x5b171e=a260_0x54ea2a[_0x3f391e(0x110)](_0x320894,_0x4eeb19[_0x3f391e(0x10c)]);_0x4eeb19[_0x3f391e(0x109)]()?await copyDirectory(_0x2083bd,_0x5b171e):a260_0xed5e84[_0x3f391e(0x10d)](_0x2083bd,_0x5b171e);}}catch(_0x3500a){console[_0x3f391e(0x114)](_0x3f391e(0x106),_0x3500a);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a261_0xaeed(){const _0x59192f=['isFinite','1420eorpVJ','1235140yxeyCY','object','32412YUnSmE','string','86145AuaSCV','3855mqNCmd','2295088BGGJVU','14598yHLNkD','14490EtxzWG','1091790NPeWkj','679tOXLRp'];a261_0xaeed=function(){return _0x59192f;};return a261_0xaeed();}(function(_0x121f5a,_0x573674){const _0x3dc194=a261_0x2131,_0x3593b6=_0x121f5a();while(!![]){try{const _0x34bab7=parseInt(_0x3dc194(0x1b4))/0x1+-parseInt(_0x3dc194(0x1b0))/0x2+-parseInt(_0x3dc194(0x1a8))/0x3*(parseInt(_0x3dc194(0x1af))/0x4)+-parseInt(_0x3dc194(0x1ac))/0x5+parseInt(_0x3dc194(0x1b2))/0x6*(-parseInt(_0x3dc194(0x1ad))/0x7)+-parseInt(_0x3dc194(0x1a9))/0x8+parseInt(_0x3dc194(0x1aa))/0x9*(parseInt(_0x3dc194(0x1ab))/0xa);if(_0x34bab7===_0x573674)break;else _0x3593b6['push'](_0x3593b6['shift']());}catch(_0x2546e9){_0x3593b6['push'](_0x3593b6['shift']());}}}(a261_0xaeed,0x51680));function toFiniteNumber(_0x3687bc){const _0x409540=a261_0x2131;if(typeof _0x3687bc==='number'&&Number['isFinite'](_0x3687bc))return _0x3687bc;if(typeof _0x3687bc===_0x409540(0x1b3)){const _0x3a663e=_0x3687bc['trim']();if(!_0x3a663e)return undefined;const _0x30cefa=Number(_0x3a663e);if(Number[_0x409540(0x1ae)](_0x30cefa))return _0x30cefa;}return undefined;}function a261_0x2131(_0x4644f5,_0x5bcb71){_0x4644f5=_0x4644f5-0x1a8;const _0xaeed54=a261_0xaeed();let _0x213171=_0xaeed54[_0x4644f5];return _0x213171;}export function normalizeEntityWithIdResponse(_0x5a89ec){const _0x5519e8=a261_0x2131,_0x1c3b35=toFiniteNumber(_0x5a89ec);if(_0x1c3b35!==undefined)return{'id':_0x1c3b35,'entity':{'id':_0x1c3b35}};if(!_0x5a89ec||typeof _0x5a89ec!==_0x5519e8(0x1b1))return{'id':undefined,'entity':{}};const _0x5a1ef0={..._0x5a89ec},_0x764347=toFiniteNumber(_0x5a1ef0['id']);return _0x764347!==undefined&&(_0x5a1ef0['id']=_0x764347),{'id':_0x764347,'entity':_0x5a1ef0};}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a262_0x1cae(){const _0x5f25ad=['379491JUdNRP','807210lgdYRQ','84273vQpSEJ','7791480MtDqsS','2295828ZumifL','24NwEMrg','isDirectory','1309840zArotc','83829foEyLy'];a262_0x1cae=function(){return _0x5f25ad;};return a262_0x1cae();}(function(_0x3f5522,_0x25fae6){const _0x5a4892=a262_0x1ca3,_0x5291bd=_0x3f5522();while(!![]){try{const _0x1949f0=-parseInt(_0x5a4892(0x125))/0x1+-parseInt(_0x5a4892(0x126))/0x2+parseInt(_0x5a4892(0x124))/0x3*(parseInt(_0x5a4892(0x121))/0x4)+parseInt(_0x5a4892(0x123))/0x5+-parseInt(_0x5a4892(0x120))/0x6+-parseInt(_0x5a4892(0x127))/0x7+parseInt(_0x5a4892(0x128))/0x8;if(_0x1949f0===_0x25fae6)break;else _0x5291bd['push'](_0x5291bd['shift']());}catch(_0x3c88df){_0x5291bd['push'](_0x5291bd['shift']());}}}(a262_0x1cae,0x371fc));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';function a262_0x1ca3(_0x4cbe09,_0x29ac5f){_0x4cbe09=_0x4cbe09-0x120;const _0x1cae1c=a262_0x1cae();let _0x1ca35=_0x1cae1c[_0x4cbe09];return _0x1ca35;}export async function copyDir(_0x11e762,_0xafdc31){const _0x2d1096=a262_0x1ca3,_0x39884e=statSync(_0x11e762);if(_0x39884e[_0x2d1096(0x122)]()){!existsSync(_0xafdc31)&&mkdirSync(_0xafdc31,{'recursive':!![]});const _0x4ecdce=readdirSync(_0x11e762);for(const _0x5d0e47 of _0x4ecdce){await copyDir(join(_0x11e762,_0x5d0e47),join(_0xafdc31,_0x5d0e47));}}else copyFileSync(_0x11e762,_0xafdc31);}export function ensureDir(_0xd355c7){!existsSync(_0xd355c7)&&mkdirSync(_0xd355c7,{'recursive':!![]});}export function pathExists(_0x5130eb){return existsSync(_0x5130eb);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a263_0xd21190=a263_0x449f;(function(_0x770fa0,_0x5afad0){const _0x7b5150=a263_0x449f,_0xbde06b=_0x770fa0();while(!![]){try{const _0x80578e=-parseInt(_0x7b5150(0x1bd))/0x1+parseInt(_0x7b5150(0x1c0))/0x2*(parseInt(_0x7b5150(0x1c2))/0x3)+parseInt(_0x7b5150(0x1ca))/0x4+parseInt(_0x7b5150(0x1dc))/0x5*(-parseInt(_0x7b5150(0x1c4))/0x6)+-parseInt(_0x7b5150(0x1d5))/0x7+-parseInt(_0x7b5150(0x1d8))/0x8+parseInt(_0x7b5150(0x1c7))/0x9*(parseInt(_0x7b5150(0x1c6))/0xa);if(_0x80578e===_0x5afad0)break;else _0xbde06b['push'](_0xbde06b['shift']());}catch(_0x4a6351){_0xbde06b['push'](_0xbde06b['shift']());}}}(a263_0x3f4f,0x578ef));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';function a263_0x449f(_0x45d7b9,_0x209055){_0x45d7b9=_0x45d7b9-0x1bc;const _0x3f4ff0=a263_0x3f4f();let _0x449f11=_0x3f4ff0[_0x45d7b9];return _0x449f11;}import{getTemplateBaseUrl}from'../utils/config.js';function getGuidesCdnUrl(){const _0x3d96c6=getTemplateBaseUrl();return _0x3d96c6+'/skills/guides.json';}function a263_0x3f4f(){const _0x1540a0=['45165hXdhOK','skillTemplate','extendContent','28508TLUjqr','join','6BDktFq','lastUpdated','342438aeEtqU','CDN\x20返回数据格式错误','6546610lFdhYg','9AOAjqp','statusText','trimEnd','1952512QfNLia','application/json','\x0a\x0a>更新时间:','status','.md','.lovrabet/skill/guides','guides','object','replace','cache','entries','3069990gowsad','utf-8','path','2174800IHHddk','push','title','length','5sWkcSF','CDN\x20数据中缺少\x20skillTemplate','map','content'];a263_0x3f4f=function(){return _0x1540a0;};return a263_0x3f4f();}const CACHE_DIR=join(homedir(),'.lovrabet',a263_0xd21190(0x1d3));export async function fetchGuidesFromCDN(){const _0x13cc15=a263_0xd21190,_0x18fad6=getGuidesCdnUrl(),_0x531759=await fetch(_0x18fad6,{'headers':{'Accept':_0x13cc15(0x1cb)}});if(!_0x531759['ok'])throw new Error('CDN\x20请求失败:\x20'+_0x531759[_0x13cc15(0x1cd)]+'\x20'+_0x531759[_0x13cc15(0x1c8)]);const _0x233d66=await _0x531759['json']();if(!_0x233d66[_0x13cc15(0x1d0)]||typeof _0x233d66[_0x13cc15(0x1d0)]!==_0x13cc15(0x1d1))throw new Error(_0x13cc15(0x1c5));return _0x233d66;}export function writeGuidesToProject(_0x181665,_0x9be492,_0x5c17e7=a263_0xd21190(0x1cf),_0xee902e){const _0x1289cf=a263_0xd21190,_0x5b738c=join(_0x9be492,_0x5c17e7);mkdirSync(_0x5b738c,{'recursive':!![]});for(const [_0x5a8f0e,_0x3de58f]of Object[_0x1289cf(0x1d4)](_0x181665['guides'])){let _0xe5089b=_0x3de58f[_0x1289cf(0x1bc)];_0x3de58f[_0x1289cf(0x1c3)]&&(_0xe5089b=appendUpdateTime(_0xe5089b,_0x3de58f[_0x1289cf(0x1c3)])),writeFileSync(join(_0x5b738c,_0x5a8f0e+_0x1289cf(0x1ce)),_0xe5089b,_0x1289cf(0x1d6));}}export function appendUpdateTime(_0x40b609,_0x1fc15e){const _0xa199fa=a263_0xd21190;return _0x40b609=_0x40b609[_0xa199fa(0x1d2)](/\n*>更新时间:.*$/m,''),_0x40b609[_0xa199fa(0x1c9)]()+(_0xa199fa(0x1cc)+_0x1fc15e);}export function getSkillTemplate(_0x413f18){const _0x5578bf=a263_0xd21190;return _0x413f18[_0x5578bf(0x1be)]?.[_0x5578bf(0x1bc)]||'';}export function appendExtendContents(_0x3c4826,_0x5ad75a,_0x300d83){const _0x3a409a=a263_0xd21190,_0x904843=[];for(const [,_0x408c2d]of Object['entries'](_0x5ad75a[_0x3a409a(0x1d0)])){_0x408c2d[_0x3a409a(0x1bf)]&&_0x904843[_0x3a409a(0x1d9)](_0x408c2d[_0x3a409a(0x1bf)][_0x3a409a(0x1c9)]());}if(_0x904843[_0x3a409a(0x1db)]===0x0)return _0x3c4826;return _0x3c4826[_0x3a409a(0x1c9)]()+'\x0a\x0a'+_0x904843[_0x3a409a(0x1c1)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x1a32cb,_0x3d3ee7,_0xd3b2d0){const _0x22b859=a263_0xd21190,_0x3a7895=getSkillTemplate(_0x1a32cb);if(!_0x3a7895)throw new Error(_0x22b859(0x1dd));const _0x280809=dirname(_0x3d3ee7);mkdirSync(_0x280809,{'recursive':!![]});let _0x39bdd1=_0x3a7895[_0x22b859(0x1d2)](/\{\{IDE_NAME\}\}/g,_0xd3b2d0);_0x39bdd1=appendExtendContents(_0x39bdd1,_0x1a32cb),_0x1a32cb[_0x22b859(0x1be)][_0x22b859(0x1c3)]&&(_0x39bdd1=appendUpdateTime(_0x39bdd1,_0x1a32cb['skillTemplate']['lastUpdated'])),writeFileSync(_0x3d3ee7,_0x39bdd1,'utf-8');}export async function installGuides(_0x460a9b){const _0x91b996=a263_0xd21190,_0x5c96c5=await fetchGuidesFromCDN();return writeGuidesToProject(_0x5c96c5,_0x460a9b),Object['keys'](_0x5c96c5[_0x91b996(0x1d0)])[_0x91b996(0x1db)];}export function getGuidesSummary(_0x56d5b9){const _0x30f5d1=a263_0xd21190;return Object[_0x30f5d1(0x1d4)](_0x56d5b9['guides'])[_0x30f5d1(0x1de)](([_0x315046,_0x5efc8c])=>({'key':_0x315046,'title':_0x5efc8c[_0x30f5d1(0x1da)],'path':_0x5efc8c[_0x30f5d1(0x1d7)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x49aacd,_0x52db54){const _0x2c4100=a264_0x5de9,_0x5d513b=_0x49aacd();while(!![]){try{const _0x2a67d1=parseInt(_0x2c4100(0x205))/0x1+parseInt(_0x2c4100(0x20a))/0x2+-parseInt(_0x2c4100(0x1fd))/0x3*(parseInt(_0x2c4100(0x206))/0x4)+-parseInt(_0x2c4100(0x203))/0x5*(-parseInt(_0x2c4100(0x20d))/0x6)+parseInt(_0x2c4100(0x201))/0x7+-parseInt(_0x2c4100(0x1f8))/0x8+-parseInt(_0x2c4100(0x207))/0x9;if(_0x2a67d1===_0x52db54)break;else _0x5d513b['push'](_0x5d513b['shift']());}catch(_0x1cb516){_0x5d513b['push'](_0x5d513b['shift']());}}}(a264_0x5002,0xcc3d8));function a264_0x5002(){const _0x464fa2=['Request\x20failed','5008240VtcIWu','includes','1443545tNKcke','49288txXjuu','560061KzoyiX','signal','message','2573176pVhTht','headers','log','6mhpDMU','text','json','abort','\x20次重试...','get','status','ECONNRESET','11822392BYvuon','url','statusText','*\x20请求失败,','name','339eASWYf','fetch','AbortError','application/json','260407txCVRq'];a264_0x5002=function(){return _0x464fa2;};return a264_0x5002();}function a264_0x5de9(_0x5ac795,_0x3ce5fd){_0x5ac795=_0x5ac795-0x1f4;const _0x50023f=a264_0x5002();let _0x5de97e=_0x50023f[_0x5ac795];return _0x5de97e;}export async function httpRequest(_0x34d711,_0x47f0e1={}){const _0x303537=a264_0x5de9,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x47f0e1;let _0x4bb36c=null;for(let _0x569449=0x0;_0x569449<=retries;_0x569449++){try{const _0x4c34e2=new AbortController(),_0x31ce58=setTimeout(()=>_0x4c34e2[_0x303537(0x210)](),timeout),_0x574264=await fetch(_0x34d711,{'headers':headers,'signal':_0x4c34e2[_0x303537(0x208)]});clearTimeout(_0x31ce58);let _0x45cc0a;const _0x51fede=_0x574264[_0x303537(0x20b)][_0x303537(0x1f5)]('content-type');return _0x51fede?.[_0x303537(0x204)](_0x303537(0x200))?_0x45cc0a=await _0x574264[_0x303537(0x20f)]():_0x45cc0a=await _0x574264['text'](),{'ok':_0x574264['ok'],'status':_0x574264[_0x303537(0x1f6)],'statusText':_0x574264[_0x303537(0x1fa)],'data':_0x45cc0a,'headers':_0x574264[_0x303537(0x20b)],'url':_0x574264[_0x303537(0x1f9)],'text':()=>_0x574264[_0x303537(0x20e)]()};}catch(_0x49440d){_0x4bb36c=_0x49440d instanceof Error?_0x49440d:new Error(String(_0x49440d));if(_0x569449===retries)break;if(shouldRetry(_0x49440d)){console[_0x303537(0x20c)](_0x303537(0x1fb)+retryDelay+'ms\x20后进行第\x20'+(_0x569449+0x1)+_0x303537(0x1f4)),await sleep(retryDelay);continue;}else break;}}throw _0x4bb36c||new Error(_0x303537(0x202));}function shouldRetry(_0x29a15e){const _0x703bfb=a264_0x5de9;if(_0x29a15e instanceof Error){if(_0x29a15e['name']===_0x703bfb(0x1ff))return![];if(_0x29a15e[_0x703bfb(0x1fc)]==='TypeError'&&_0x29a15e['message'][_0x703bfb(0x204)](_0x703bfb(0x1fe)))return!![];if(_0x29a15e[_0x703bfb(0x209)][_0x703bfb(0x204)](_0x703bfb(0x1f7)))return!![];if(_0x29a15e[_0x703bfb(0x209)]['includes']('ENOTFOUND'))return![];}return![];}function sleep(_0x3d950c){return new Promise(_0x339c29=>setTimeout(_0x339c29,_0x3d950c));}export function validateUrl(_0xef6b4c){try{return new URL(_0xef6b4c),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a265_0x289c(_0x3e8047,_0x3b0e85){_0x3e8047=_0x3e8047-0x1b6;const _0x2c8981=a265_0x2c89();let _0x289c43=_0x2c8981[_0x3e8047];return _0x289c43;}(function(_0x280937,_0x4ebc75){const _0x250b7e=a265_0x289c,_0x57d5e5=_0x280937();while(!![]){try{const _0xf4635a=parseInt(_0x250b7e(0x1bf))/0x1*(parseInt(_0x250b7e(0x1c3))/0x2)+parseInt(_0x250b7e(0x1bb))/0x3*(parseInt(_0x250b7e(0x1c4))/0x4)+parseInt(_0x250b7e(0x1b9))/0x5+parseInt(_0x250b7e(0x1c1))/0x6+-parseInt(_0x250b7e(0x1bd))/0x7+-parseInt(_0x250b7e(0x1ba))/0x8+-parseInt(_0x250b7e(0x1b7))/0x9*(-parseInt(_0x250b7e(0x1c2))/0xa);if(_0xf4635a===_0x4ebc75)break;else _0x57d5e5['push'](_0x57d5e5['shift']());}catch(_0x413531){_0x57d5e5['push'](_0x57d5e5['shift']());}}}(a265_0x2c89,0x77ad1));function env(_0x2fc3fa){return process.env[`RABETBASE_${_0x2fc3fa}`]||process.env[`LOVRABET_${_0x2fc3fa}`]||undefined;}export function isNonInteractive(_0x488476){const _0x281576=a265_0x289c;return!!(_0x488476[_0x281576(0x1c0)]||_0x488476['ci']||env('CI')===_0x281576(0x1b8)||process.env.CI===_0x281576(0x1b8)||!process['stdout'][_0x281576(0x1c5)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x3cfbda=a265_0x289c;if(!process[_0x3cfbda(0x1bc)]['isTTY'])return![];try{const _0x5682ce=process[_0x3cfbda(0x1bc)][_0x3cfbda(0x1b6)];return process[_0x3cfbda(0x1bc)]['setRawMode'](!![]),process['stdin'][_0x3cfbda(0x1be)](_0x5682ce??![]),!![];}catch{return![];}}function a265_0x2c89(){const _0x417b5b=['true','3289300VdZKuW','7157504FMExxQ','1545NMYEUH','stdin','4602423tNAYMW','setRawMode','1VCdHdm','nonInteractive','598560KlwSWX','8088560IpcTof','531548rQQdiF','1632oLWqPt','isTTY','isRaw','9sUHqia'];a265_0x2c89=function(){return _0x417b5b;};return a265_0x2c89();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a266_0x11abc8=a266_0x3578;function a266_0x4f90(){const _0x549226=['errors','log','existsSync','error','setRawCommand','timestamp','toISOString','1317685YMrZTN','currentRawCommand','format','command','trim','addColors','.lovrabet.log','696845HCwjIh','rawCommand','438150yDhFTA','details','utf8','getWinstonInstance','printf','filter','message','success','171kZVPkm','blue','unknown','now','createLogger','map','失败:\x20','warn','Failed\x20to\x20clear\x20logs:','initWinstonLogger','logFilePath','readFileSync','winstonLogger','clearLogs','950vtrztJ','logTask','split','4047Vbrgqh','完成:\x20','writeFileSync','level','4670080ZRBYEr','7LSgbEp','readLogs','info','red','transports','2678976kqeBYs','yellow','281510tbeuLz','duration'];a266_0x4f90=function(){return _0x549226;};return a266_0x4f90();}function a266_0x3578(_0x46bdb1,_0x2fa901){_0x46bdb1=_0x46bdb1-0x150;const _0x4f9026=a266_0x4f90();let _0x35780b=_0x4f9026[_0x46bdb1];return _0x35780b;}(function(_0x178f02,_0x311917){const _0x256158=a266_0x3578,_0x5a67ef=_0x178f02();while(!![]){try{const _0x3cff18=parseInt(_0x256158(0x16a))/0x1+-parseInt(_0x256158(0x182))/0x2*(-parseInt(_0x256158(0x185))/0x3)+-parseInt(_0x256158(0x158))/0x4+-parseInt(_0x256158(0x163))/0x5+-parseInt(_0x256158(0x16c))/0x6*(parseInt(_0x256158(0x153))/0x7)+parseInt(_0x256158(0x152))/0x8+parseInt(_0x256158(0x174))/0x9*(-parseInt(_0x256158(0x15a))/0xa);if(_0x3cff18===_0x311917)break;else _0x5a67ef['push'](_0x5a67ef['shift']());}catch(_0x464848){_0x5a67ef['push'](_0x5a67ef['shift']());}}}(a266_0x4f90,0x5cd2d));import a266_0x44eb08 from'winston';import a266_0x4a06a4 from'node:fs';import a266_0xa8c3cb from'node:path';class Logger{['winstonLogger'];[a266_0x11abc8(0x17e)];[a266_0x11abc8(0x164)]='';constructor(){const _0x4a8b73=a266_0x11abc8;this[_0x4a8b73(0x17e)]='';}[a266_0x11abc8(0x160)](_0x51e2b6){const _0x5f1bc4=a266_0x11abc8;this[_0x5f1bc4(0x164)]=_0x51e2b6;}[a266_0x11abc8(0x17d)](){const _0x24aef9=a266_0x11abc8,_0x9ab6ce=a266_0xa8c3cb['dirname'](this[_0x24aef9(0x17e)]);!a266_0x4a06a4[_0x24aef9(0x15e)](_0x9ab6ce)&&a266_0x4a06a4['mkdirSync'](_0x9ab6ce,{'recursive':!![]});const _0x485d8b=a266_0x44eb08['format']['combine'](a266_0x44eb08[_0x24aef9(0x165)][_0x24aef9(0x161)](),a266_0x44eb08[_0x24aef9(0x165)][_0x24aef9(0x15c)]({'stack':!![]}),a266_0x44eb08[_0x24aef9(0x165)][_0x24aef9(0x170)](_0x252a3b=>{const _0x1fe8ee=_0x24aef9,_0x1c5c22={'timestamp':_0x252a3b[_0x1fe8ee(0x161)]||new Date()[_0x1fe8ee(0x162)](),'level':_0x252a3b[_0x1fe8ee(0x151)]||_0x1fe8ee(0x155),'command':_0x252a3b[_0x1fe8ee(0x166)]||_0x1fe8ee(0x176),'rawCommand':_0x252a3b[_0x1fe8ee(0x16b)]||this[_0x1fe8ee(0x164)]||undefined,'message':_0x252a3b[_0x1fe8ee(0x172)]||'','duration':_0x252a3b[_0x1fe8ee(0x15b)]||undefined,'details':_0x252a3b[_0x1fe8ee(0x16d)]||undefined};return JSON['stringify'](_0x1c5c22);}));this[_0x24aef9(0x180)]=a266_0x44eb08[_0x24aef9(0x178)]({'level':_0x24aef9(0x155),'format':_0x485d8b,'transports':[new a266_0x44eb08[(_0x24aef9(0x157))]['File']({'filename':this[_0x24aef9(0x17e)],'level':'info'})],'silent':![]}),a266_0x44eb08[_0x24aef9(0x168)]({'success':'green','error':_0x24aef9(0x156),'warn':_0x24aef9(0x159),'info':_0x24aef9(0x175)});}['setLogPath'](_0x1ebafc){const _0x7557bc=a266_0x11abc8;this[_0x7557bc(0x17e)]=a266_0xa8c3cb['join'](_0x1ebafc,_0x7557bc(0x169)),this['winstonLogger']&&this[_0x7557bc(0x180)]['clear'](),this[_0x7557bc(0x17d)]();}[a266_0x11abc8(0x155)](_0x3b0d16,_0x509334,_0x3a22ac){const _0x12c0a6=a266_0x11abc8;if(!this[_0x12c0a6(0x17e)]||!this[_0x12c0a6(0x180)])return;this[_0x12c0a6(0x180)][_0x12c0a6(0x155)](_0x509334,{'command':_0x3b0d16,'details':_0x3a22ac});}[a266_0x11abc8(0x173)](_0x4b850c,_0x3a9436,_0xec36a2,_0x5108dd){const _0x2a23e2=a266_0x11abc8;if(!this[_0x2a23e2(0x17e)]||!this[_0x2a23e2(0x180)])return;this['winstonLogger'][_0x2a23e2(0x15d)](_0x2a23e2(0x155),_0x3a9436,{'level':_0x2a23e2(0x173),'command':_0x4b850c,'duration':_0xec36a2,'details':_0x5108dd});}[a266_0x11abc8(0x15f)](_0x3bd55d,_0x1efdd6,_0x6b7866){const _0x1515c9=a266_0x11abc8;if(!this[_0x1515c9(0x17e)]||!this[_0x1515c9(0x180)])return;this[_0x1515c9(0x180)][_0x1515c9(0x15f)](_0x1efdd6,{'command':_0x3bd55d,'details':_0x6b7866});}['warn'](_0x202ef2,_0x551cfe,_0xc8ea5a){const _0x410ea8=a266_0x11abc8;if(!this[_0x410ea8(0x17e)]||!this[_0x410ea8(0x180)])return;this[_0x410ea8(0x180)][_0x410ea8(0x17b)](_0x551cfe,{'command':_0x202ef2,'details':_0xc8ea5a});}async[a266_0x11abc8(0x183)](_0x5c5e92,_0x244998,_0x1e0dc8){const _0x2fb663=a266_0x11abc8,_0x3c163b=Date[_0x2fb663(0x177)]();this[_0x2fb663(0x155)](_0x5c5e92,'开始执行:\x20'+_0x244998);try{const _0x4fae51=await _0x1e0dc8(),_0x436729=Date[_0x2fb663(0x177)]()-_0x3c163b;return this['success'](_0x5c5e92,_0x2fb663(0x186)+_0x244998,_0x436729),_0x4fae51;}catch(_0x53e0ab){const _0x30aaa6=Date[_0x2fb663(0x177)]()-_0x3c163b;this['error'](_0x5c5e92,_0x2fb663(0x17a)+_0x244998,{'error':_0x53e0ab instanceof Error?_0x53e0ab['message']:String(_0x53e0ab),'duration':_0x30aaa6});throw _0x53e0ab;}}[a266_0x11abc8(0x154)](){const _0x214000=a266_0x11abc8;try{if(!a266_0x4a06a4[_0x214000(0x15e)](this['logFilePath']))return[];const _0x2832a5=a266_0x4a06a4[_0x214000(0x17f)](this[_0x214000(0x17e)],_0x214000(0x16e));return _0x2832a5[_0x214000(0x184)]('\x0a')[_0x214000(0x171)](_0xfa4081=>_0xfa4081[_0x214000(0x167)]())[_0x214000(0x179)](_0x5b67bb=>JSON['parse'](_0x5b67bb));}catch(_0x14c8f4){return console[_0x214000(0x17b)]('Failed\x20to\x20read\x20logs:',_0x14c8f4),[];}}[a266_0x11abc8(0x181)](){const _0x1b9bb4=a266_0x11abc8;try{a266_0x4a06a4[_0x1b9bb4(0x15e)](this[_0x1b9bb4(0x17e)])&&a266_0x4a06a4[_0x1b9bb4(0x150)](this['logFilePath'],'',_0x1b9bb4(0x16e));}catch(_0x34bf47){console[_0x1b9bb4(0x17b)](_0x1b9bb4(0x17c),_0x34bf47);}}[a266_0x11abc8(0x16f)](){return this['winstonLogger'];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x598de9,_0x2c3734){const _0x4b8278=a267_0x53ac,_0x27d1de=_0x598de9();while(!![]){try{const _0x2b58a1=-parseInt(_0x4b8278(0x7c))/0x1+-parseInt(_0x4b8278(0x85))/0x2*(parseInt(_0x4b8278(0x83))/0x3)+parseInt(_0x4b8278(0x7e))/0x4+-parseInt(_0x4b8278(0x86))/0x5+parseInt(_0x4b8278(0x80))/0x6*(parseInt(_0x4b8278(0x7f))/0x7)+parseInt(_0x4b8278(0x89))/0x8*(parseInt(_0x4b8278(0x84))/0x9)+parseInt(_0x4b8278(0x7d))/0xa*(parseInt(_0x4b8278(0x7b))/0xb);if(_0x2b58a1===_0x2c3734)break;else _0x27d1de['push'](_0x27d1de['shift']());}catch(_0x1193a7){_0x27d1de['push'](_0x27d1de['shift']());}}}(a267_0x3ad0,0xc61ec));import{CliErrors}from'../errors.js';export function parseJsonParams(_0x1df658){const _0x212e0a=a267_0x53ac;if(!_0x1df658)return undefined;let _0x59e720;try{_0x59e720=JSON[_0x212e0a(0x81)](_0x1df658);}catch{throw CliErrors[_0x212e0a(0x82)](_0x212e0a(0x87)+_0x1df658);}if(!_0x59e720||typeof _0x59e720!=='object'||Array['isArray'](_0x59e720))throw CliErrors[_0x212e0a(0x82)](_0x212e0a(0x88),'Example:\x20--params\x20\x27{\x22id\x22:123}\x27');return _0x59e720;}function a267_0x53ac(_0x4a1a85,_0x46fb73){_0x4a1a85=_0x4a1a85-0x7b;const _0x3ad0f4=a267_0x3ad0();let _0x53ac64=_0x3ad0f4[_0x4a1a85];return _0x53ac64;}function a267_0x3ad0(){const _0x160e57=['236301oVdtnM','17030whNeYh','6229700VjZfOO','6161568zryUcB','6qCpgpm','parse','validation','14097hwEQEE','3481857WEwvmG','226klNbMJ','7872065rxFmsd','Invalid\x20JSON\x20for\x20--params:\x20','--params\x20must\x20be\x20a\x20JSON\x20object','8qdOsls','2123gIYQQJ'];a267_0x3ad0=function(){return _0x160e57;};return a267_0x3ad0();}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a268_0x318556=a268_0x4992;(function(_0x3f2d5a,_0x9f1827){const _0x3e2a2c=a268_0x4992,_0xafb719=_0x3f2d5a();while(!![]){try{const _0x59093e=parseInt(_0x3e2a2c(0xd0))/0x1*(-parseInt(_0x3e2a2c(0xd2))/0x2)+parseInt(_0x3e2a2c(0xce))/0x3*(-parseInt(_0x3e2a2c(0xcf))/0x4)+-parseInt(_0x3e2a2c(0xc7))/0x5*(-parseInt(_0x3e2a2c(0xd4))/0x6)+-parseInt(_0x3e2a2c(0xcb))/0x7*(parseInt(_0x3e2a2c(0xd1))/0x8)+-parseInt(_0x3e2a2c(0xd5))/0x9*(-parseInt(_0x3e2a2c(0xcd))/0xa)+-parseInt(_0x3e2a2c(0xc8))/0xb+-parseInt(_0x3e2a2c(0xd3))/0xc*(-parseInt(_0x3e2a2c(0xc9))/0xd);if(_0x59093e===_0x9f1827)break;else _0xafb719['push'](_0xafb719['shift']());}catch(_0x455ec1){_0xafb719['push'](_0xafb719['shift']());}}}(a268_0x24f7,0xef2d3));function a268_0x4992(_0x547a47,_0x33dcab){_0x547a47=_0x547a47-0xc7;const _0x24f728=a268_0x24f7();let _0x499250=_0x24f728[_0x547a47];return _0x499250;}function a268_0x24f7(){const _0x56ad3b=['platform','3970ARXAqu','31224ILAWxH','596ccSyRN','798673Ovtsdj','5640424JcIfpI','4cVjAKf','3348GBjiGC','285378KKVYJu','11871oONqnf','.cmd','195eFnTHn','5178338olOXcX','169143dSUJab','win32','14prVIqB'];a268_0x24f7=function(){return _0x56ad3b;};return a268_0x24f7();}export const isWindows=process[a268_0x318556(0xcc)]===a268_0x318556(0xca);export function resolveNpmBin(_0xc935e1){const _0x15090d=a268_0x318556;return isWindows?_0xc935e1+_0x15090d(0xd6):_0xc935e1;}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a269_0x3747ae=a269_0x2aac;(function(_0x1a7be1,_0x2e730b){const _0x478e17=a269_0x2aac,_0x34deba=_0x1a7be1();while(!![]){try{const _0x5ba2d5=-parseInt(_0x478e17(0x1d2))/0x1*(parseInt(_0x478e17(0x1e2))/0x2)+parseInt(_0x478e17(0x1cc))/0x3*(parseInt(_0x478e17(0x1e3))/0x4)+-parseInt(_0x478e17(0x1e1))/0x5+parseInt(_0x478e17(0x1dd))/0x6*(-parseInt(_0x478e17(0x1d9))/0x7)+-parseInt(_0x478e17(0x1d5))/0x8*(-parseInt(_0x478e17(0x1ce))/0x9)+parseInt(_0x478e17(0x1d6))/0xa*(-parseInt(_0x478e17(0x1d3))/0xb)+parseInt(_0x478e17(0x1d8))/0xc*(parseInt(_0x478e17(0x1cf))/0xd);if(_0x5ba2d5===_0x2e730b)break;else _0x34deba['push'](_0x34deba['shift']());}catch(_0x3886f1){_0x34deba['push'](_0x34deba['shift']());}}}(a269_0x16d7,0x7ba8b));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 a269_0x16d7(){const _0x171ca1=['964cfFhpN','utf-8','application/json','11469nZLrES','agents.md','81dponWM','13430924UzqaQC','catch','/rules/rules.json','2237pwbdRF','55uoLllr','lastUpdated','464296meviQj','1529140jOkxkO','json','12zCDwqr','10115rHiaqA','status','statusText','../../templates/rules/lovrabet_rules.mdc.tpl','102eCJgEL','content','本地模板文件不存在:\x20','.cursor/rules','1062805SHQckn','866UhGxrY'];a269_0x16d7=function(){return _0x171ca1;};return a269_0x16d7();}function getRulesCdnUrl(){const _0x534776=a269_0x2aac,_0x1a408d=getTemplateBaseUrl();return _0x1a408d+_0x534776(0x1d1);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a269_0x3747ae(0x1dc));export async function fetchRulesFromCDN(){const _0x26f85f=a269_0x3747ae,_0x5a73a8=getRulesCdnUrl(),_0x37f1b9=await fetch(_0x5a73a8,{'headers':{'Accept':_0x26f85f(0x1cb)}});if(!_0x37f1b9['ok'])throw new Error('CDN\x20请求失败:\x20'+_0x37f1b9[_0x26f85f(0x1da)]+'\x20'+_0x37f1b9[_0x26f85f(0x1db)]);const _0x248fe7=await _0x37f1b9[_0x26f85f(0x1d7)]();if(!_0x248fe7[_0x26f85f(0x1de)]||typeof _0x248fe7['content']!=='string')throw new Error('CDN\x20返回数据格式错误');return _0x248fe7;}export async function getRulesContent(){const _0x4410a4=a269_0x3747ae;try{const _0x29d917=await fetchRulesFromCDN();return _0x29d917[_0x4410a4(0x1de)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x55efb7=a269_0x3747ae;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x55efb7(0x1e4));throw new Error(_0x55efb7(0x1df)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x42fe5d){const _0x32e0ee=a269_0x3747ae,_0x50b8a4=await fetchRulesFromCDN()[_0x32e0ee(0x1d0)](()=>null);let _0x393ea7;_0x50b8a4?(_0x393ea7=_0x50b8a4[_0x32e0ee(0x1de)],_0x50b8a4[_0x32e0ee(0x1d4)]&&(_0x393ea7=appendUpdateTime(_0x393ea7,_0x50b8a4[_0x32e0ee(0x1d4)]))):_0x393ea7=readLocalTemplate();const _0x5734de=dirname(_0x42fe5d);!existsSync(_0x5734de)&&mkdirSync(_0x5734de,{'recursive':!![]}),writeFileSync(_0x42fe5d,_0x393ea7,'utf-8');}export async function copyRulesToCursor(_0x2bbd84){const _0x28876b=a269_0x3747ae,_0x2fdada=join(_0x2bbd84,_0x28876b(0x1e0)),_0x1b49f5=join(_0x2fdada,'lovrabet_rules.mdc');if(existsSync(_0x1b49f5))return![];return await writeRulesFile(_0x1b49f5),!![];}function a269_0x2aac(_0x1ca3be,_0x840cbf){_0x1ca3be=_0x1ca3be-0x1cb;const _0x16d744=a269_0x16d7();let _0x2aace3=_0x16d744[_0x1ca3be];return _0x2aace3;}export async function copyRulesToAgentsMd(_0xa3f832){const _0xcbe869=a269_0x3747ae,_0x2c582c=join(_0xa3f832,_0xcbe869(0x1cd));if(existsSync(_0x2c582c))return![];return await writeRulesFile(_0x2c582c),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x41e6fa){return new Promise(_0x604646=>setTimeout(_0x604646,_0x41e6fa));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a271_0x419c36=a271_0x4d53;function a271_0x4d53(_0x47fb7a,_0x42da51){_0x47fb7a=_0x47fb7a-0x1f1;const _0xc39812=a271_0xc398();let _0x4d53e3=_0xc39812[_0x47fb7a];return _0x4d53e3;}(function(_0x1f3deb,_0x3fe2b7){const _0x1dc8ec=a271_0x4d53,_0x545d72=_0x1f3deb();while(!![]){try{const _0x2d8ab3=parseInt(_0x1dc8ec(0x217))/0x1+-parseInt(_0x1dc8ec(0x1f5))/0x2*(parseInt(_0x1dc8ec(0x22e))/0x3)+parseInt(_0x1dc8ec(0x22c))/0x4*(parseInt(_0x1dc8ec(0x1f6))/0x5)+parseInt(_0x1dc8ec(0x224))/0x6+parseInt(_0x1dc8ec(0x208))/0x7+-parseInt(_0x1dc8ec(0x1f4))/0x8+parseInt(_0x1dc8ec(0x205))/0x9*(-parseInt(_0x1dc8ec(0x1fd))/0xa);if(_0x2d8ab3===_0x3fe2b7)break;else _0x545d72['push'](_0x545d72['shift']());}catch(_0x1e6e06){_0x545d72['push'](_0x545d72['shift']());}}}(a271_0xc398,0xb787c));import a271_0xdbb35d from'node:fs';import a271_0x58b053 from'node:path';import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a271_0x419c36(0x1f8)](_0x5ddfe7){const _0x1c3eff=a271_0x419c36;return String(_0x5ddfe7)[_0x1c3eff(0x200)](0x2,'0');}static[a271_0x419c36(0x21b)](_0x543980){const _0x58dd3b=a271_0x419c36,_0x3b45ed=_0x543980[_0x58dd3b(0x201)](),_0x245177=this[_0x58dd3b(0x1f8)](_0x543980[_0x58dd3b(0x209)]()+0x1),_0x5b8ee1=this[_0x58dd3b(0x1f8)](_0x543980['getDate']()),_0x4494b7=this[_0x58dd3b(0x1f8)](_0x543980[_0x58dd3b(0x221)]()),_0x3cb48d=this[_0x58dd3b(0x1f8)](_0x543980[_0x58dd3b(0x223)]()),_0x3b8c92=this['pad'](_0x543980['getSeconds']());return{'createdAt':_0x3b45ed+'-'+_0x245177+'-'+_0x5b8ee1+'\x20'+_0x4494b7+':'+_0x3cb48d+':'+_0x3b8c92,'createdDate':_0x3b45ed+'-'+_0x245177+'-'+_0x5b8ee1,'createdTime':_0x4494b7+':'+_0x3cb48d+':'+_0x3b8c92};}static['toComponentName'](_0xd6e5cd){const _0x19885a=a271_0x419c36,_0x1b5541=_0xd6e5cd[_0x19885a(0x21f)]('/')[_0x19885a(0x227)]()||_0xd6e5cd;return _0x1b5541[_0x19885a(0x21f)]('-')[_0x19885a(0x20a)](_0x43a6c1=>_0x43a6c1[_0x19885a(0x225)](0x0)[_0x19885a(0x226)]()+_0x43a6c1[_0x19885a(0x207)](0x1)['toLowerCase']())['join']('');}static[a271_0x419c36(0x228)](_0x46116c){const _0x3ddc80=a271_0x419c36,_0x218121=_0x46116c[_0x3ddc80(0x21f)]('/')[_0x3ddc80(0x227)]()||_0x46116c;return _0x218121[_0x3ddc80(0x21f)]('-')[_0x3ddc80(0x20a)](_0xaa3c22=>_0xaa3c22[_0x3ddc80(0x225)](0x0)[_0x3ddc80(0x226)]()+_0xaa3c22['slice'](0x1)[_0x3ddc80(0x214)]())[_0x3ddc80(0x206)]('\x20');}static[a271_0x419c36(0x22f)](_0x5d70e2,_0x461886,_0x1332c9){const _0x277cf0=a271_0x419c36,_0x414f00=this[_0x277cf0(0x21a)](_0x461886),_0x5d39f4=this[_0x277cf0(0x228)](_0x461886),{createdAt:_0x1f8815,createdDate:_0x7063bf,createdTime:_0x526418}=this[_0x277cf0(0x21b)](new Date());let _0x180f67=_0x5d70e2[_0x277cf0(0x21d)](/\{CliVersion\}/g,CLI_VERSION)[_0x277cf0(0x21d)](/\{ComponentName\}/g,_0x414f00)['replace'](/\{DisplayTitle\}/g,_0x5d39f4)['replace'](/\{PageName\}/g,_0x461886)[_0x277cf0(0x21d)](/\{TemplateName\}/g,_0x1332c9)[_0x277cf0(0x21d)](/\{CreatedAt\}/g,_0x1f8815)['replace'](/\{CreatedDate\}/g,_0x7063bf)[_0x277cf0(0x21d)](/\{CreatedTime\}/g,_0x526418);return _0x180f67;}static['replaceApiContent'](_0x2107cb,_0x469a3a,_0x4796d5,_0x1d2d0b,_0x112c13,_0x1e7823,_0x1ea6ad,_0x5ac234){const _0x119202=a271_0x419c36,_0x47d9c6=new Date(),_0x570653=_0x47d9c6[_0x119202(0x1ff)](),_0x1aaa6f=_0x4796d5[_0x119202(0x20a)](_0x26cf2b=>{const _0x3ec5cc=_0x119202,_0x3c2b3f=[_0x3ec5cc(0x230)+_0x26cf2b[_0x3ec5cc(0x1f7)]+'\x22',_0x3ec5cc(0x22d)+_0x26cf2b[_0x3ec5cc(0x1f9)]+'\x22',_0x3ec5cc(0x220)+_0x26cf2b[_0x3ec5cc(0x219)]+'\x22'];return _0x26cf2b[_0x3ec5cc(0x229)]&&_0x3c2b3f[_0x3ec5cc(0x218)]('alias:\x20\x22'+_0x26cf2b[_0x3ec5cc(0x229)]+'\x22'),_0x3ec5cc(0x1f1)+_0x3c2b3f[_0x3ec5cc(0x206)](',\x20')+_0x3ec5cc(0x1fa);})[_0x119202(0x206)](''),_0x2ff17a=_0x1d2d0b||_0x4796d5[0x0]?.['alias']||_0x119202(0x204);let _0x5da854=_0x2107cb[_0x119202(0x21d)](/\{AppCode\}/g,_0x469a3a)['replace'](/\{ModelConfigs\}/g,_0x1aaa6f)[_0x119202(0x21d)](/\{ExampleModelName\}/g,_0x2ff17a)[_0x119202(0x21d)](/\{ApiFileName\}/g,_0x112c13||_0x119202(0x20d))['replace'](/\{ConfigName\}/g,_0x1e7823||'default')['replace'](/\{ClientConfigParam\}/g,_0x1ea6ad||'')['replace'](/\{VarPrefix\}/g,_0x5ac234||'LOVRABET')['replace'](/\{CreatedAt\}/g,_0x570653);return _0x5da854;}static async[a271_0x419c36(0x20b)](_0x5dd7a6,_0x106510,_0x5359bd,_0x5101f4,_0xb07ff1=!![]){const _0x3b1c77=a271_0x419c36,_0x3a3532=Date[_0x3b1c77(0x1fb)]();try{_0xb07ff1&&logger['info'](_0x3b1c77(0x1f2),_0x3b1c77(0x1fc),{'templatePath':_0x5dd7a6,'targetPath':_0x106510,'pageName':_0x5359bd,'templateName':_0x5101f4});await a271_0xdbb35d[_0x3b1c77(0x21c)][_0x3b1c77(0x203)](_0x106510,{'recursive':!![]}),await this[_0x3b1c77(0x212)](_0x5dd7a6,_0x106510,_0x5359bd,_0x5101f4);if(_0xb07ff1){const _0x44ca06=Date[_0x3b1c77(0x1fb)]()-_0x3a3532;logger[_0x3b1c77(0x222)](_0x3b1c77(0x1f2),'模板内容替换完成',_0x44ca06,{'pageName':_0x5359bd,'templateName':_0x5101f4});}}catch(_0x5a14cb){if(_0xb07ff1){const _0x45cdf7=Date['now']()-_0x3a3532;logger['error'](_0x3b1c77(0x1f2),_0x3b1c77(0x20c),{'templatePath':_0x5dd7a6,'targetPath':_0x106510,'pageName':_0x5359bd,'templateName':_0x5101f4,'error':_0x5a14cb instanceof Error?_0x5a14cb[_0x3b1c77(0x1fe)]:String(_0x5a14cb),'duration':_0x45cdf7});}throw _0x5a14cb;}}static async[a271_0x419c36(0x212)](_0x3be11a,_0x25637c,_0x478fd6,_0x5f4bba){const _0x39d4e6=a271_0x419c36,_0xef1387=await a271_0xdbb35d[_0x39d4e6(0x21c)][_0x39d4e6(0x202)](_0x3be11a,{'withFileTypes':!![]});for(const _0x9473a6 of _0xef1387){const _0x30527c=a271_0x58b053['join'](_0x3be11a,_0x9473a6[_0x39d4e6(0x219)]);let _0x2f1a55=a271_0x58b053['join'](_0x25637c,_0x9473a6[_0x39d4e6(0x219)]);_0x9473a6[_0x39d4e6(0x219)][_0x39d4e6(0x20f)]('.tpl')&&(_0x2f1a55=a271_0x58b053['join'](_0x25637c,_0x9473a6['name'][_0x39d4e6(0x21d)](/\.tpl$/,'')));if(_0x9473a6[_0x39d4e6(0x213)]())await a271_0xdbb35d['promises']['mkdir'](_0x2f1a55,{'recursive':!![]}),await this[_0x39d4e6(0x212)](_0x30527c,_0x2f1a55,_0x478fd6,_0x5f4bba);else _0x9473a6['isFile']()&&await this['processFile'](_0x30527c,_0x2f1a55,_0x478fd6,_0x5f4bba);}}static async[a271_0x419c36(0x211)](_0x54e1d6,_0x1db40a,_0x1de451,_0xfe9f3d){const _0xcfc97d=a271_0x419c36,_0xe6579d=a271_0x58b053['extname'](_0x54e1d6)[_0xcfc97d(0x214)]();_0x54e1d6['endsWith'](_0xcfc97d(0x22b))&&(_0x1db40a=_0x1db40a['replace'](/\.tpl$/,''));const _0x853099=['.tsx','.ts',_0xcfc97d(0x1f3),'.js',_0xcfc97d(0x215),'.md','.css',_0xcfc97d(0x22a),_0xcfc97d(0x22b)];if(_0x853099['includes'](_0xe6579d)||_0x54e1d6[_0xcfc97d(0x20f)](_0xcfc97d(0x22b))){const _0x2752e4=await a271_0xdbb35d[_0xcfc97d(0x21c)][_0xcfc97d(0x20e)](_0x54e1d6,_0xcfc97d(0x21e)),_0xde74db=this[_0xcfc97d(0x22f)](_0x2752e4,_0x1de451,_0xfe9f3d);await a271_0xdbb35d[_0xcfc97d(0x21c)][_0xcfc97d(0x210)](_0x1db40a,_0xde74db,_0xcfc97d(0x21e));}else await a271_0xdbb35d['promises'][_0xcfc97d(0x216)](_0x54e1d6,_0x1db40a);}}function a271_0xc398(){const _0x199fb0=['toISOString','padStart','getFullYear','readdir','mkdir','YourModel','100197omkUso','join','slice','7426566GRYNJt','getMonth','map','processTemplate','模板内容替换失败','api','readFile','endsWith','writeFile','processFile','processDirectory','isDirectory','toLowerCase','.json','copyFile','962605wpNkAT','push','name','toComponentName','formatLocalTimestamp','promises','replace','utf8','split','name:\x20\x22','getHours','success','getMinutes','6081996iLoQMj','charAt','toUpperCase','pop','toDisplayTitle','alias','.scss','.tpl','292LXkEBb','tableName:\x20\x22','3iwCapa','replaceContent','datasetCode:\x20\x22','\x0a\x20\x20\x20\x20{\x20','template','.jsx','1904448OLVMTw','2504926zpQbSn','82045LKnNeQ','datasetCode','pad','tableName','\x20},','now','开始处理模板内容替换','1790dCbDKg','message'];a271_0xc398=function(){return _0x199fb0;};return a271_0xc398();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b79b5,_0x4fbe99){const _0x5f2404=a272_0x4ab5,_0x16fd8a=_0x3b79b5();while(!![]){try{const _0x4920ba=parseInt(_0x5f2404(0x1f6))/0x1+parseInt(_0x5f2404(0x1f9))/0x2*(parseInt(_0x5f2404(0x1f3))/0x3)+parseInt(_0x5f2404(0x1ec))/0x4+parseInt(_0x5f2404(0x1e1))/0x5*(parseInt(_0x5f2404(0x1ee))/0x6)+parseInt(_0x5f2404(0x1e5))/0x7+parseInt(_0x5f2404(0x1ea))/0x8*(-parseInt(_0x5f2404(0x1dd))/0x9)+-parseInt(_0x5f2404(0x1e4))/0xa*(parseInt(_0x5f2404(0x1f2))/0xb);if(_0x4920ba===_0x4fbe99)break;else _0x16fd8a['push'](_0x16fd8a['shift']());}catch(_0x2a980d){_0x16fd8a['push'](_0x16fd8a['shift']());}}}(a272_0xc5a5,0xb7822));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import a272_0x425004 from'semver';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';function a272_0xc5a5(){const _0x3911aa=['stringify','5191677IQKROt','now','utf8','valid','5GGUvHV','stableVersion','checkedAt','18437590mLgtPe','4831827uFOTaK','parse','number','true','/v/','8BNnCcY','\x20available,\x20current\x20','2810112grCOqy',',\x20run:\x20','7663902DvNRrw','gte','trim','update-check.json','11NvvDIs','30PavuAL','lastNotifiedAt','lastNotifiedVersion','452566LNgaly','https://www.npmjs.com/package/','toLowerCase','9918ZZGPkn'];a272_0xc5a5=function(){return _0x3911aa;};return a272_0xc5a5();}import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function isUpdateNoticeDisabled(){const _0x2f6237=a272_0x4ab5,_0x3d0392=process.env.RABETBASE_NO_UPDATE_NOTICE?.[_0x2f6237(0x1f0)]()[_0x2f6237(0x1f8)]();return _0x3d0392==='1'||_0x3d0392===_0x2f6237(0x1e8)||_0x3d0392==='yes';}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),'.cache');}export function getUpdateNoticeCachePath(){const _0x1bebdc=a272_0x4ab5;return join(cacheRoot(),'rabetbase-cli',_0x1bebdc(0x1f1));}async function readUpdateNoticeCache(){const _0x271d54=a272_0x4ab5;try{const _0x2ee23a=await readFile(getUpdateNoticeCachePath(),'utf8'),_0x576d5e=JSON[_0x271d54(0x1e6)](_0x2ee23a);if(!_0x576d5e||typeof _0x576d5e!=='object')return{};return _0x576d5e;}catch{return{};}}async function writeUpdateNoticeCache(_0x43f842){const _0x49f86c=a272_0x4ab5;try{const _0x1d11bd=getUpdateNoticeCachePath();await mkdir(dirname(_0x1d11bd),{'recursive':!![]}),await writeFile(_0x1d11bd,JSON[_0x49f86c(0x1fa)](_0x43f842,null,0x2)+'\x0a',_0x49f86c(0x1df));}catch{}}function isFreshCheck(_0xd29de4,_0x4bd427){const _0x20110=a272_0x4ab5;return typeof _0xd29de4['checkedAt']==='number'&&_0x4bd427-_0xd29de4[_0x20110(0x1e3)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x2ccbf7,_0x2c10f9,_0x5cc0fb){const _0x3e57e1=a272_0x4ab5;return _0x2ccbf7[_0x3e57e1(0x1f5)]===_0x2c10f9&&typeof _0x2ccbf7['lastNotifiedAt']===_0x3e57e1(0x1e7)&&_0x5cc0fb-_0x2ccbf7[_0x3e57e1(0x1f4)]<UPDATE_NOTICE_TTL_MS;}function a272_0x4ab5(_0x5e612d,_0x41abf3){_0x5e612d=_0x5e612d-0x1dd;const _0xc5a5b4=a272_0xc5a5();let _0x4ab509=_0xc5a5b4[_0x5e612d];return _0x4ab509;}export function buildNpmVersionUrl(_0x492447){const _0x27701a=a272_0x4ab5;return _0x27701a(0x1f7)+NPM_PACKAGE_NAME+_0x27701a(0x1e9)+_0x492447;}export async function resolveLatestUpdateNotice(){const _0x3b421a=a272_0x4ab5;if(isUpdateNoticeDisabled())return null;try{const _0x49a525=Date[_0x3b421a(0x1de)](),_0x501641=getCliVersion(),_0x541e9a=await readUpdateNoticeCache();let _0x563f28=isFreshCheck(_0x541e9a,_0x49a525)?_0x541e9a['latest']?.[_0x3b421a(0x1f0)]():undefined;if(!_0x563f28&&!isFreshCheck(_0x541e9a,_0x49a525)){const _0x20f8dd=await getCliVersionPolicy();_0x563f28=_0x20f8dd?.[_0x3b421a(0x1e2)]?.[_0x3b421a(0x1f0)]()||undefined,await writeUpdateNoticeCache({..._0x541e9a,'checkedAt':_0x49a525,'latest':_0x563f28,'failed':!_0x563f28});}if(!_0x563f28||!a272_0x425004[_0x3b421a(0x1e0)](_0x501641)||!a272_0x425004[_0x3b421a(0x1e0)](_0x563f28))return null;if(a272_0x425004[_0x3b421a(0x1ef)](_0x501641,_0x563f28))return null;if(isRecentlyNotified(_0x541e9a,_0x563f28,_0x49a525))return null;const _0x5c9921=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0x541e9a,'checkedAt':isFreshCheck(_0x541e9a,_0x49a525)?_0x541e9a[_0x3b421a(0x1e3)]:_0x49a525,'latest':_0x563f28,'failed':![],'lastNotifiedVersion':_0x563f28,'lastNotifiedAt':_0x49a525}),{'command':_0x5c9921,'current':_0x501641,'latest':_0x563f28,'url':buildNpmVersionUrl(_0x563f28),'message':CLI_BIN_NAME+'\x20'+_0x563f28+_0x3b421a(0x1eb)+_0x501641+_0x3b421a(0x1ed)+_0x5c9921};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a273_0x43a4(_0xcf54e8,_0x2e6ef0){_0xcf54e8=_0xcf54e8-0xc8;var _0x57d55e=a273_0x57d5();var _0x43a439=_0x57d55e[_0xcf54e8];return _0x43a439;}(function(_0x16e2b6,_0xafe85a){var _0x223fcf=a273_0x43a4,_0x3a3c44=_0x16e2b6();while(!![]){try{var _0x163263=parseInt(_0x223fcf(0xcf))/0x1+parseInt(_0x223fcf(0xc8))/0x2*(parseInt(_0x223fcf(0xcb))/0x3)+-parseInt(_0x223fcf(0xca))/0x4+-parseInt(_0x223fcf(0xc9))/0x5*(-parseInt(_0x223fcf(0xd0))/0x6)+parseInt(_0x223fcf(0xd1))/0x7+parseInt(_0x223fcf(0xce))/0x8*(parseInt(_0x223fcf(0xcd))/0x9)+parseInt(_0x223fcf(0xcc))/0xa*(-parseInt(_0x223fcf(0xd2))/0xb);if(_0x163263===_0xafe85a)break;else _0x3a3c44['push'](_0x3a3c44['shift']());}catch(_0x31aebf){_0x3a3c44['push'](_0x3a3c44['shift']());}}}(a273_0x57d5,0xeab63));import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}function a273_0x57d5(){var _0x3bb29f=['24204KNNitl','45329210bKnAgx','207hXAHkO','616328yMiDGa','433363lIzAko','66TwSKHh','6480117nzIWvf','11yqzCyj','344FMaXuN','858325POuGWe','3650992bXwtpG'];a273_0x57d5=function(){return _0x3bb29f;};return a273_0x57d5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2a4392,_0x349b27){var _0x5d70cd=a274_0x4d55,_0x4285b6=_0x2a4392();while(!![]){try{var _0x20042f=-parseInt(_0x5d70cd(0x154))/0x1+-parseInt(_0x5d70cd(0x15c))/0x2+-parseInt(_0x5d70cd(0x15a))/0x3+-parseInt(_0x5d70cd(0x159))/0x4+-parseInt(_0x5d70cd(0x157))/0x5+-parseInt(_0x5d70cd(0x15b))/0x6*(-parseInt(_0x5d70cd(0x158))/0x7)+-parseInt(_0x5d70cd(0x156))/0x8*(-parseInt(_0x5d70cd(0x155))/0x9);if(_0x20042f===_0x349b27)break;else _0x4285b6['push'](_0x4285b6['shift']());}catch(_0x2bed05){_0x4285b6['push'](_0x4285b6['shift']());}}}(a274_0x2dfd,0xef61a));function a274_0x4d55(_0x20ccda,_0x368897){_0x20ccda=_0x20ccda-0x154;var _0x2dfde9=a274_0x2dfd();var _0x4d5531=_0x2dfde9[_0x20ccda];return _0x4d5531;}import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';export async function withActiveCookie(_0x4a9fad,_0x406d94){setActiveCookie(_0x4a9fad);try{return await _0x406d94();}finally{clearActiveCookie();}}function a274_0x2dfd(){var _0x44ed23=['4142178wPIlFK','21084NwZcZa','3225920wPfvZL','554004mkhUzN','37714482unDuaY','8mwwHYV','643505BumlTD','1743zYAmSv','1634348twZMWZ'];a274_0x2dfd=function(){return _0x44ed23;};return a274_0x2dfd();}
|