@lovrabet/rabetbase-cli 2.2.4 → 2.2.5-beta.2
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/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/app-config/delete.js +1 -0
- package/lib/commands/app-config/get.js +1 -0
- package/lib/commands/app-config/index.js +1 -0
- package/lib/commands/app-config/list.js +1 -0
- package/lib/commands/app-config/set.js +1 -0
- package/lib/commands/app-config/shared.js +1 -0
- 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-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-selector.js +1 -1
- package/lib/commands/common/flags.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 -0
- 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/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-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 -0
- 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/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/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/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/menu/update.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/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/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/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.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/save.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/workspace/index.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-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/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/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/README.md +15 -25
- package/templates/generate-api/api.ts.tpl +2 -2
- package/templates/generate-api/client.ts.tpl +2 -2
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +15 -1
- package/templates/projects/sub-app-react-demo/README.md +159 -231
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +145 -426
- package/templates/projects/sub-app-react-demo/src/api/api.ts +8 -65
- package/templates/projects/sub-app-react-demo/src/api/client.ts +10 -42
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +28 -0
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +55 -0
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +6 -9
- package/templates/projects/sub-app-react-demo/src/main.tsx +10 -6
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +3 -5
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +153 -148
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +500 -0
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +517 -343
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +325 -242
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +8 -6
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +174 -87
- package/templates/projects/sub-app-react-demo/src/style.css +19 -3
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
- package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +0 -212
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a201_0x2fe667=a201_0x5699;(function(_0x1f1912,_0x152e77){const _0x26bbb6=a201_0x5699,_0x107b01=_0x1f1912();while(!![]){try{const _0x4b29ae=-parseInt(_0x26bbb6(0x183))/0x1*(parseInt(_0x26bbb6(0x16f))/0x2)+-parseInt(_0x26bbb6(0x171))/0x3+-parseInt(_0x26bbb6(0x166))/0x4*(parseInt(_0x26bbb6(0x165))/0x5)+-parseInt(_0x26bbb6(0x168))/0x6+parseInt(_0x26bbb6(0x179))/0x7+-parseInt(_0x26bbb6(0x16d))/0x8+-parseInt(_0x26bbb6(0x176))/0x9*(-parseInt(_0x26bbb6(0x17e))/0xa);if(_0x4b29ae===_0x152e77)break;else _0x107b01['push'](_0x107b01['shift']());}catch(_0x1aac33){_0x107b01['push'](_0x107b01['shift']());}}}(a201_0x5d1e,0x7ced2));import a201_0x28c2ae from'node:fs';import a201_0x2edf47 from'node:path';import a201_0x5ccb62 from'semver';import{getCdnConfig}from'../utils/cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a201_0x2fe667(0x16e);function isNonNumericVersion(_0x508fb8){const _0xc51888=a201_0x2fe667,_0x4cb722=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x4cb722[_0xc51888(0x184)](_0x30223b=>_0x30223b[_0xc51888(0x17a)](_0x508fb8));}function getInstalledVersion(_0xd7eebd,_0x1abcf4){const _0x21db62=a201_0x2fe667;try{const _0x54f23a=a201_0x2edf47[_0x21db62(0x164)](_0xd7eebd,_0x21db62(0x16c),_0x1abcf4,_0x21db62(0x172));if(a201_0x28c2ae['existsSync'](_0x54f23a)){const _0x4edb6d=JSON[_0x21db62(0x17b)](a201_0x28c2ae['readFileSync'](_0x54f23a,_0x21db62(0x173)));return _0x4edb6d[_0x21db62(0x17f)]||null;}}catch{}return null;}async function getSdkStableVersion(){const _0x42a7b4=a201_0x2fe667;try{const _0x128102=await getCdnConfig();return _0x128102?.[_0x42a7b4(0x17d)]?.[_0x42a7b4(0x174)]?.[_0x42a7b4(0x180)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x206dd9=a201_0x2fe667;try{const _0x55ba73=await getCdnConfig();return _0x55ba73?.['sdk']?.[_0x206dd9(0x174)]?.[_0x206dd9(0x16a)]||_0x206dd9(0x182);}catch{return _0x206dd9(0x182);}}function a201_0x5d1e(){const _0x3fc931=['readFileSync','join','43285MjCAgF','468TWHEXZ','\x20\x20\x20Upgrade\x20command:\x20','2031108GdqdDC','all','packageName','log','node_modules','660584mgPnZw','1.2.0','1010456iGfkec','\x1b[33m','1554177UvoqEj','package.json','utf-8','node','↪\x20SDK\x20update\x20available','18516537xrLwIu','devDependencies','coerce','6380864UJXfaZ','test','parse','\x1b[0m','sdk','10bLHIkJ','version','stableVersion','npm\x20install\x20','@lovrabet/sdk','1EczhsH','some','\x20\x20\x20Current\x20version:\x20','dependencies','\x1b[1m','utf8','existsSync','needsUpgrade'];a201_0x5d1e=function(){return _0x3fc931;};return a201_0x5d1e();}export async function checkSdkVersion(_0x37ea2d){const _0x1aa9ba=a201_0x2fe667,_0x4b3ea1=a201_0x2edf47[_0x1aa9ba(0x164)](_0x37ea2d,'package.json'),[_0x3c9987,_0x122155]=await Promise[_0x1aa9ba(0x169)]([getSdkStableVersion(),getSdkPackageName()]),_0x40acd8=_0x3c9987||FALLBACK_MIN_SDK_VERSION;if(!a201_0x28c2ae['existsSync'](_0x4b3ea1))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x40acd8,'packageName':_0x122155,'stableVersion':_0x3c9987};try{const _0x346611=JSON[_0x1aa9ba(0x17b)](a201_0x28c2ae[_0x1aa9ba(0x163)](_0x4b3ea1,_0x1aa9ba(0x188))),_0x3e0f30=_0x346611[_0x1aa9ba(0x186)]||{},_0x250fcb=_0x346611[_0x1aa9ba(0x177)]||{},_0x244895=_0x3e0f30[_0x122155]||_0x250fcb[_0x122155];if(!_0x244895)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x40acd8,'packageName':_0x122155,'stableVersion':_0x3c9987};let _0x2355fd=getInstalledVersion(_0x37ea2d,_0x122155);!_0x2355fd&&(_0x2355fd=_0x244895);if(isNonNumericVersion(_0x244895))return{'installed':!![],'version':_0x2355fd,'needsUpgrade':![],'minVersion':_0x40acd8,'packageName':_0x122155,'stableVersion':_0x3c9987};const _0x23ec13=a201_0x5ccb62[_0x1aa9ba(0x178)](_0x2355fd),_0x1e80a1=a201_0x5ccb62[_0x1aa9ba(0x178)](_0x40acd8),_0x4f77b9=_0x23ec13&&_0x1e80a1?a201_0x5ccb62['lt'](_0x23ec13,_0x1e80a1):![];return{'installed':!![],'version':_0x2355fd,'needsUpgrade':_0x4f77b9,'minVersion':_0x40acd8,'packageName':_0x122155,'stableVersion':_0x3c9987};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x40acd8,'packageName':_0x122155,'stableVersion':_0x3c9987};}}export function checkSdkVersionSync(_0x4c6b79){const _0x1b35fb=a201_0x2fe667,_0xf30b0=a201_0x2edf47[_0x1b35fb(0x164)](_0x4c6b79,'package.json'),_0x48cb35=_0x1b35fb(0x182);if(!a201_0x28c2ae[_0x1b35fb(0x189)](_0xf30b0))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x48cb35,'stableVersion':null};try{const _0xc1d8e8=JSON[_0x1b35fb(0x17b)](a201_0x28c2ae[_0x1b35fb(0x163)](_0xf30b0,'utf8')),_0xc17ca5=_0xc1d8e8[_0x1b35fb(0x186)]||{},_0x4bed1a=_0xc1d8e8[_0x1b35fb(0x177)]||{},_0x55397e=_0xc17ca5[_0x48cb35]||_0x4bed1a[_0x48cb35];if(!_0x55397e)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x48cb35,'stableVersion':null};let _0x241651=getInstalledVersion(_0x4c6b79,_0x48cb35);!_0x241651&&(_0x241651=_0x55397e);if(isNonNumericVersion(_0x55397e))return{'installed':!![],'version':_0x241651,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x48cb35,'stableVersion':null};const _0x1463cc=a201_0x5ccb62[_0x1b35fb(0x178)](_0x241651),_0xc24471=_0x1463cc?a201_0x5ccb62['lt'](_0x1463cc,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x241651,'needsUpgrade':_0xc24471,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x48cb35,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x48cb35,'stableVersion':null};}}function a201_0x5699(_0x2b7962,_0x131c19){_0x2b7962=_0x2b7962-0x162;const _0x5d1e61=a201_0x5d1e();let _0x56992c=_0x5d1e61[_0x2b7962];return _0x56992c;}export function printSdkUpgradeWarning(_0x323f58){const _0x4ecf56=a201_0x2fe667;if(!_0x323f58[_0x4ecf56(0x162)])return;const _0x2d83ff=_0x4ecf56(0x170),_0x5db184=_0x4ecf56(0x17c),_0x5d3ce2=_0x4ecf56(0x187),_0x2e0071=_0x323f58[_0x4ecf56(0x16a)]||_0x4ecf56(0x182),_0x2a6856=_0x323f58[_0x4ecf56(0x180)]||_0x323f58['minVersion'],_0x31bb93=_0x4ecf56(0x181)+_0x2e0071+'@'+(_0x2a6856||'latest');console['log'](),console[_0x4ecf56(0x16b)](''+_0x2d83ff+_0x5d3ce2+_0x4ecf56(0x175)+_0x5db184),console[_0x4ecf56(0x16b)](_0x2d83ff+_0x4ecf56(0x185)+_0x2e0071+'@'+_0x323f58[_0x4ecf56(0x17f)]+_0x5db184),console[_0x4ecf56(0x16b)](_0x2d83ff+'\x20\x20\x20Stable\x20version:\x20'+_0x2a6856+_0x5db184),console['log'](_0x2d83ff+_0x4ecf56(0x167)+_0x31bb93+_0x5db184),console[_0x4ecf56(0x16b)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa55c97,_0x36c1ba){const _0xa68cf8=a202_0x16b9,_0x2cabf6=_0xa55c97();while(!![]){try{const _0x17a6d1=-parseInt(_0xa68cf8(0x116))/0x1+parseInt(_0xa68cf8(0x126))/0x2+-parseInt(_0xa68cf8(0x131))/0x3+-parseInt(_0xa68cf8(0x10d))/0x4*(-parseInt(_0xa68cf8(0x11e))/0x5)+-parseInt(_0xa68cf8(0x12a))/0x6*(-parseInt(_0xa68cf8(0x130))/0x7)+-parseInt(_0xa68cf8(0x11d))/0x8*(parseInt(_0xa68cf8(0x123))/0x9)+parseInt(_0xa68cf8(0x12f))/0xa;if(_0x17a6d1===_0x36c1ba)break;else _0x2cabf6['push'](_0x2cabf6['shift']());}catch(_0x1637b){_0x2cabf6['push'](_0x2cabf6['shift']());}}}(a202_0x1a4b,0x9f327));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a202_0x31bb41 from'semver';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';function a202_0x16b9(_0x4c1b0c,_0x325ac5){_0x4c1b0c=_0x4c1b0c-0x108;const _0x1a4bf7=a202_0x1a4b();let _0x16b93c=_0x1a4bf7[_0x4c1b0c];return _0x16b93c;}function a202_0x1a4b(){const _0x51bbd5=['needsUpgrade','↪\x20New\x20version\x20available','Current\x20CLI\x20version\x20is\x20below\x20the\x20service\x20compatibility\x20support\x20line.','1484955pDFmlY','\x20\x20\x20Minimum\x20supported:\x20','\x20\x20\x20Recommended\x20stable:\x20','1880038pnRxIH','belowMinimum','validation','\x20\x20\x20Upgrade\x20command:\x20','6242664LWQMag','stableVersion','upgradeMessage','npm\x20install\x20-g\x20','Upgrade\x20command:\x20','3357280DqZzmM','7uUwOmb','3801225oMXcEz','minimumVersion','currentVersion','log','latest','\x1b[1m','44QJJife','\x20\x20\x20Stable\x20version:\x20','\x1b[0m','Current\x20version:\x20','coerce','utf-8','\x1b[31m','package.json','Minimum\x20supported:\x20','302351CnTdPe','join','\x1b[33m','minimumVersionMessage','1.0.0','\x20\x20\x20','filter','8cbIITf','31955LlFjmj','parse'];a202_0x1a4b=function(){return _0x51bbd5;};return a202_0x1a4b();}import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{CliErrors}from'../errors.js';export function getCliUpgradeCommand(_0x2a04b0){const _0x1d301c=a202_0x16b9,_0x14b1b8=_0x2a04b0[_0x1d301c(0x12b)]||_0x1d301c(0x10b);return _0x1d301c(0x12d)+NPM_PACKAGE_NAME+'@'+_0x14b1b8;}function getCurrentCliVersion(){const _0x3ce121=a202_0x16b9;try{const _0xbf4321=fileURLToPath(import.meta.url),_0x4f3019=resolve(dirname(_0xbf4321),'../..'),_0x6ab148=resolve(_0x4f3019,_0x3ce121(0x114)),_0x9e24f0=JSON[_0x3ce121(0x11f)](readFileSync(_0x6ab148,_0x3ce121(0x112)));return _0x9e24f0['version']||_0x3ce121(0x11a);}catch{return _0x3ce121(0x11a);}}export async function checkCliVersion(){const _0x14e1b4=a202_0x16b9,_0x1e9228=getCurrentCliVersion(),_0xaab8ad=await getCliVersionPolicy(),_0x494a18=_0xaab8ad?.['stableVersion']||null,_0x1ab4a3=_0xaab8ad?.[_0x14e1b4(0x108)]||null;let _0x4dd09f=![],_0x579e4=![];const _0x26cce2=a202_0x31bb41[_0x14e1b4(0x111)](_0x1e9228);if(_0x26cce2&&_0x494a18)try{const _0x13eb10=a202_0x31bb41[_0x14e1b4(0x111)](_0x494a18);if(_0x13eb10)_0x4dd09f=a202_0x31bb41['lt'](_0x26cce2,_0x13eb10);}catch{}if(_0x26cce2&&_0x1ab4a3)try{const _0xe224f8=a202_0x31bb41['coerce'](_0x1ab4a3);if(_0xe224f8)_0x579e4=a202_0x31bb41['lt'](_0x26cce2,_0xe224f8);}catch{}return _0x579e4&&(_0x4dd09f=!![]),{'currentVersion':_0x1e9228,'stableVersion':_0x494a18,'minimumVersion':_0x1ab4a3,'needsUpgrade':_0x4dd09f,'belowMinimum':_0x579e4,'isPreRelease':![],'upgradeMessage':_0xaab8ad?.[_0x14e1b4(0x12c)],'minimumVersionMessage':_0xaab8ad?.['minimumVersionMessage']};}export function printCliUpgradeWarning(_0x4fc391){const _0x2fa0ac=a202_0x16b9;if(!_0x4fc391[_0x2fa0ac(0x120)]&&!_0x4fc391[_0x2fa0ac(0x127)])return;const _0xe89cb4=_0x2fa0ac(0x113),_0x204601=_0x2fa0ac(0x118),_0x469ec7=_0x2fa0ac(0x10f),_0x34cca2=_0x2fa0ac(0x10c),_0x169ab0=getCliUpgradeCommand(_0x4fc391);console[_0x2fa0ac(0x10a)](),_0x4fc391[_0x2fa0ac(0x127)]?(console[_0x2fa0ac(0x10a)](''+_0xe89cb4+_0x34cca2+'↪\x20Critical\x20CLI\x20upgrade\x20required'+_0x469ec7),console['log'](_0xe89cb4+'\x20\x20\x20Current\x20CLI\x20version:\x20'+_0x4fc391[_0x2fa0ac(0x109)]+_0x469ec7),_0x4fc391['minimumVersion']&&console['log'](_0xe89cb4+_0x2fa0ac(0x124)+_0x4fc391[_0x2fa0ac(0x108)]+_0x469ec7),_0x4fc391[_0x2fa0ac(0x12b)]&&_0x4fc391[_0x2fa0ac(0x12b)]!==_0x4fc391[_0x2fa0ac(0x108)]&&console[_0x2fa0ac(0x10a)](_0xe89cb4+_0x2fa0ac(0x125)+_0x4fc391['stableVersion']+_0x469ec7),_0x4fc391[_0x2fa0ac(0x119)]&&console['log'](_0xe89cb4+_0x2fa0ac(0x11b)+_0x4fc391[_0x2fa0ac(0x119)]+_0x469ec7),console[_0x2fa0ac(0x10a)](_0xe89cb4+_0x2fa0ac(0x129)+_0x169ab0+_0x469ec7)):(console['log'](''+_0x204601+_0x34cca2+_0x2fa0ac(0x121)+_0x469ec7),console[_0x2fa0ac(0x10a)](_0x204601+'\x20\x20\x20Current\x20CLI\x20version:\x20'+_0x4fc391[_0x2fa0ac(0x109)]+_0x469ec7),console['log'](_0x204601+_0x2fa0ac(0x10e)+_0x4fc391[_0x2fa0ac(0x12b)]+_0x469ec7),_0x4fc391[_0x2fa0ac(0x12c)]&&console[_0x2fa0ac(0x10a)](_0x204601+_0x2fa0ac(0x11b)+_0x4fc391[_0x2fa0ac(0x12c)]+_0x469ec7),console['log'](_0x204601+_0x2fa0ac(0x129)+_0x169ab0+_0x469ec7)),console[_0x2fa0ac(0x10a)]();}export function assertCliVersionSupported(_0x3691cf){const _0x4fb015=a202_0x16b9;if(!_0x3691cf[_0x4fb015(0x127)])return;const _0x5211a3=[_0x3691cf[_0x4fb015(0x119)],_0x4fb015(0x110)+_0x3691cf['currentVersion'],_0x3691cf[_0x4fb015(0x108)]?_0x4fb015(0x115)+_0x3691cf[_0x4fb015(0x108)]:null,_0x4fb015(0x12e)+getCliUpgradeCommand(_0x3691cf)][_0x4fb015(0x11c)](Boolean)[_0x4fb015(0x117)]('\x0a');throw CliErrors[_0x4fb015(0x128)](_0x4fb015(0x122),_0x5211a3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b7601,_0x52d227){const _0x4a00e4=a203_0x554f,_0x8b77ef=_0x2b7601();while(!![]){try{const _0x3d5791=parseInt(_0x4a00e4(0x1f4))/0x1*(-parseInt(_0x4a00e4(0x1f3))/0x2)+parseInt(_0x4a00e4(0x1fa))/0x3+-parseInt(_0x4a00e4(0x1fc))/0x4+parseInt(_0x4a00e4(0x1f6))/0x5+-parseInt(_0x4a00e4(0x1f9))/0x6+-parseInt(_0x4a00e4(0x1f2))/0x7*(parseInt(_0x4a00e4(0x1eb))/0x8)+parseInt(_0x4a00e4(0x1f5))/0x9;if(_0x3d5791===_0x52d227)break;else _0x8b77ef['push'](_0x8b77ef['shift']());}catch(_0x5ceeb3){_0x8b77ef['push'](_0x8b77ef['shift']());}}}(a203_0x35d7,0x3c507));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(_0x39d7d6){const _0x385bd3=a203_0x554f;return typeof _0x39d7d6===_0x385bd3(0x1ec)&&_0x39d7d6[_0x385bd3(0x1fb)]()['length']>0x0?_0x39d7d6[_0x385bd3(0x1fb)]():null;}function normalizeCliVersionPolicy(_0x2c46b6){const _0x1ca7a6=a203_0x554f;if(!_0x2c46b6||typeof _0x2c46b6!=='object')return null;const _0x121ede=_0x2c46b6,_0x132648=_0x121ede['cli']&&typeof _0x121ede[_0x1ca7a6(0x1fd)]===_0x1ca7a6(0x1e9)?_0x121ede['cli']:_0x121ede,_0x5f0491=pickString(_0x132648['stableVersion'])||pickString(_0x132648[_0x1ca7a6(0x1fe)])||pickString(_0x132648[_0x1ca7a6(0x1ee)]),_0x1d2bc5=pickString(_0x132648['minimumVersion'])||pickString(_0x132648['minVersion']);if(!_0x5f0491&&!_0x1d2bc5)return null;return{'stableVersion':_0x5f0491,'minimumVersion':_0x1d2bc5,'upgradeMessage':pickString(_0x132648[_0x1ca7a6(0x1ed)])||undefined,'minimumVersionMessage':pickString(_0x132648[_0x1ca7a6(0x1f7)])||undefined};}function a203_0x35d7(){const _0x261a56=['json','signal','application/json','287vquUBN','296182vgQrPT','2GmHblz','4673169zAtVKT','1628635pzktbP','minimumVersionMessage','now','1846896SmHVZn','1240596sfdkJA','trim','1194072RXuXAI','cli','latestVersion','object','abort','21256KUtTRW','string','upgradeMessage','recommendedVersion'];a203_0x35d7=function(){return _0x261a56;};return a203_0x35d7();}export async function fetchCliVersionPolicy(){const _0x5c05da=a203_0x554f,_0x26aff9=new AbortController(),_0x45d7e3=setTimeout(()=>_0x26aff9[_0x5c05da(0x1ea)](),FETCH_TIMEOUT_MS);try{const _0x40009a=await fetch(CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x5c05da(0x1f1)},'signal':_0x26aff9[_0x5c05da(0x1f0)]});if(!_0x40009a['ok'])return null;const _0x377fc6=await _0x40009a[_0x5c05da(0x1ef)]();return normalizeCliVersionPolicy(_0x377fc6);}catch{return null;}finally{clearTimeout(_0x45d7e3);}}let cachedPolicy=null,cacheTime=0x0,hasCachedPolicy=![];export async function getCliVersionPolicy(){const _0x11ec30=a203_0x554f,_0x148a70=Date[_0x11ec30(0x1f8)]();if(hasCachedPolicy){const _0x325f29=cachedPolicy?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x148a70-cacheTime<_0x325f29)return cachedPolicy;}const _0x4f8341=await fetchCliVersionPolicy();return cachedPolicy=_0x4f8341,cacheTime=_0x148a70,hasCachedPolicy=!![],_0x4f8341;}function a203_0x554f(_0x54a44c,_0x585e5d){_0x54a44c=_0x54a44c-0x1e9;const _0x35d732=a203_0x35d7();let _0x554f69=_0x35d732[_0x54a44c];return _0x554f69;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cacheTime=0x0,hasCachedPolicy=![];}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a204_0xefa9(){const _0x7a2eb5=['string','8756072hWTzkt','project','4oTOyoB','96870CWUwnu','env','63ZHZxPw','5219755Zrkgbg','3472406zGHvQi','4274OZeNHI','11EenMQp','148AxnOzd','17910324kxXCoe','2322834UjXmMZ','6kppdpq'];a204_0xefa9=function(){return _0x7a2eb5;};return a204_0xefa9();}const a204_0x8ffc7e=a204_0x5e0b;function a204_0x5e0b(_0x3d51e7,_0x4a7480){_0x3d51e7=_0x3d51e7-0x170;const _0xefa98e=a204_0xefa9();let _0x5e0b0e=_0xefa98e[_0x3d51e7];return _0x5e0b0e;}(function(_0x5b8a0b,_0x477ff5){const _0x48de05=a204_0x5e0b,_0x53e5af=_0x5b8a0b();while(!![]){try{const _0x32b4d0=parseInt(_0x48de05(0x17b))/0x1*(parseInt(_0x48de05(0x17d))/0x2)+-parseInt(_0x48de05(0x170))/0x3+parseInt(_0x48de05(0x175))/0x4*(parseInt(_0x48de05(0x179))/0x5)+-parseInt(_0x48de05(0x171))/0x6*(-parseInt(_0x48de05(0x17a))/0x7)+parseInt(_0x48de05(0x173))/0x8+parseInt(_0x48de05(0x178))/0x9*(-parseInt(_0x48de05(0x176))/0xa)+-parseInt(_0x48de05(0x17c))/0xb*(parseInt(_0x48de05(0x17e))/0xc);if(_0x32b4d0===_0x477ff5)break;else _0x53e5af['push'](_0x53e5af['shift']());}catch(_0x272aac){_0x53e5af['push'](_0x53e5af['shift']());}}}(a204_0xefa9,0x966f4));import{initEnv}from'../constant/env.js';import{readRawConfig,getConfigAppCode as a204_0x11b754,getMultiAppConfigs as a204_0x5b8e5e,getTemplateBaseUrl as a204_0x1d787b}from'../context.js';export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';export{isInProject}from'../context.js';export function readConfig(_0xba1bd1){const _0x1575f3=a204_0x5e0b,_0x443165=readRawConfig(_0xba1bd1);return _0x443165[_0x1575f3(0x177)]&&typeof _0x443165[_0x1575f3(0x177)]===_0x1575f3(0x172)&&initEnv(_0x443165['env']),_0x443165;}export function getConfigAppCode(){return a204_0x11b754();}export function getMultiAppConfigs(_0x14231e=a204_0x8ffc7e(0x174)){return a204_0x5b8e5e(_0x14231e);}export function getTemplateBaseUrl(){return a204_0x1d787b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a205_0x2f06(_0x4c92ca,_0x11b88d){_0x4c92ca=_0x4c92ca-0x185;const _0x300473=a205_0x3004();let _0x2f06d8=_0x300473[_0x4c92ca];return _0x2f06d8;}(function(_0x5162a3,_0x584af0){const _0x4f6344=a205_0x2f06,_0xe3d077=_0x5162a3();while(!![]){try{const _0x20412a=-parseInt(_0x4f6344(0x187))/0x1*(-parseInt(_0x4f6344(0x18f))/0x2)+parseInt(_0x4f6344(0x18b))/0x3+-parseInt(_0x4f6344(0x192))/0x4+parseInt(_0x4f6344(0x18e))/0x5+parseInt(_0x4f6344(0x190))/0x6+parseInt(_0x4f6344(0x18c))/0x7+-parseInt(_0x4f6344(0x188))/0x8*(parseInt(_0x4f6344(0x191))/0x9);if(_0x20412a===_0x584af0)break;else _0xe3d077['push'](_0xe3d077['shift']());}catch(_0x493fd0){_0xe3d077['push'](_0xe3d077['shift']());}}}(a205_0x3004,0x45f6e));import a205_0x1f3882 from'node:path';import a205_0x5e911b from'node:fs';export async function copyDirectory(_0x38dbe2,_0x594b78){const _0x4f4d11=a205_0x2f06;try{const _0x5d646f=a205_0x5e911b['readdirSync'](_0x38dbe2,{'withFileTypes':!![]});a205_0x5e911b[_0x4f4d11(0x185)](_0x594b78,{'recursive':!![]});for(const _0x272820 of _0x5d646f){const _0x449715=a205_0x1f3882[_0x4f4d11(0x18d)](_0x38dbe2,_0x272820[_0x4f4d11(0x186)]),_0x23b912=a205_0x1f3882[_0x4f4d11(0x18d)](_0x594b78,_0x272820[_0x4f4d11(0x186)]);_0x272820['isDirectory']()?await copyDirectory(_0x449715,_0x23b912):a205_0x5e911b[_0x4f4d11(0x18a)](_0x449715,_0x23b912);}}catch(_0x554da5){console['error'](_0x4f4d11(0x189),_0x554da5);}}function a205_0x3004(){const _0x1310eb=['2088360SFFklV','2678mKSUWM','2527308OUaBhE','2169BNDXTc','633664XRxuRs','mkdirSync','name','122HhPqTl','51928Phucxb','复制目录时出错:','copyFileSync','1481667aYyMbX','3592288FToZsq','join'];a205_0x3004=function(){return _0x1310eb;};return a205_0x3004();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x300c07,_0x32343d){const _0x59fe3d=a206_0x97e2,_0x5dd09b=_0x300c07();while(!![]){try{const _0x59e7bf=-parseInt(_0x59fe3d(0x164))/0x1+-parseInt(_0x59fe3d(0x163))/0x2*(parseInt(_0x59fe3d(0x160))/0x3)+-parseInt(_0x59fe3d(0x15b))/0x4+-parseInt(_0x59fe3d(0x15c))/0x5*(-parseInt(_0x59fe3d(0x159))/0x6)+parseInt(_0x59fe3d(0x157))/0x7+-parseInt(_0x59fe3d(0x15d))/0x8*(-parseInt(_0x59fe3d(0x15f))/0x9)+-parseInt(_0x59fe3d(0x162))/0xa*(-parseInt(_0x59fe3d(0x15a))/0xb);if(_0x59e7bf===_0x32343d)break;else _0x5dd09b['push'](_0x5dd09b['shift']());}catch(_0x251f6d){_0x5dd09b['push'](_0x5dd09b['shift']());}}}(a206_0x51df,0x8fcd2));function a206_0x97e2(_0xfcc9ec,_0x4c59ba){_0xfcc9ec=_0xfcc9ec-0x156;const _0x51df7f=a206_0x51df();let _0x97e251=_0x51df7f[_0xfcc9ec];return _0x97e251;}function toFiniteNumber(_0x3b7e2f){const _0x366241=a206_0x97e2;if(typeof _0x3b7e2f===_0x366241(0x15e)&&Number['isFinite'](_0x3b7e2f))return _0x3b7e2f;if(typeof _0x3b7e2f===_0x366241(0x161)){const _0x4bd839=_0x3b7e2f[_0x366241(0x158)]();if(!_0x4bd839)return undefined;const _0x36afdf=Number(_0x4bd839);if(Number['isFinite'](_0x36afdf))return _0x36afdf;}return undefined;}function a206_0x51df(){const _0x3a66d3=['307681ZewGSo','1745528XTfBjl','913435dZxsDx','8irZlWC','number','4677255ISdHuq','9ibsfkv','string','320XXrlkp','477182izHUgE','593260rCTnIG','object','5158797VqjRgC','trim','6xzYrSx'];a206_0x51df=function(){return _0x3a66d3;};return a206_0x51df();}export function normalizeEntityWithIdResponse(_0x4c7f7e){const _0x2692b0=a206_0x97e2,_0x4a8edf=toFiniteNumber(_0x4c7f7e);if(_0x4a8edf!==undefined)return{'id':_0x4a8edf,'entity':{'id':_0x4a8edf}};if(!_0x4c7f7e||typeof _0x4c7f7e!==_0x2692b0(0x156))return{'id':undefined,'entity':{}};const _0x235e19={..._0x4c7f7e},_0x31b147=toFiniteNumber(_0x235e19['id']);return _0x31b147!==undefined&&(_0x235e19['id']=_0x31b147),{'id':_0x31b147,'entity':_0x235e19};}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x182a01,_0x2a249f){const _0x445af2=a207_0xb712,_0x2cd92d=_0x182a01();while(!![]){try{const _0x4c82e4=-parseInt(_0x445af2(0xb9))/0x1+parseInt(_0x445af2(0xbb))/0x2*(-parseInt(_0x445af2(0xb5))/0x3)+parseInt(_0x445af2(0xb8))/0x4*(-parseInt(_0x445af2(0xb4))/0x5)+-parseInt(_0x445af2(0xbd))/0x6*(parseInt(_0x445af2(0xb7))/0x7)+parseInt(_0x445af2(0xb6))/0x8*(parseInt(_0x445af2(0xb3))/0x9)+-parseInt(_0x445af2(0xba))/0xa*(-parseInt(_0x445af2(0xbc))/0xb)+parseInt(_0x445af2(0xb2))/0xc;if(_0x4c82e4===_0x2a249f)break;else _0x2cd92d['push'](_0x2cd92d['shift']());}catch(_0x210b01){_0x2cd92d['push'](_0x2cd92d['shift']());}}}(a207_0x52a2,0x6c584));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';function a207_0xb712(_0x5a03fb,_0x259904){_0x5a03fb=_0x5a03fb-0xb2;const _0x52a259=a207_0x52a2();let _0xb712a6=_0x52a259[_0x5a03fb];return _0xb712a6;}import{join}from'node:path';export async function copyDir(_0x33fb2c,_0x5265ed){const _0x150f3a=statSync(_0x33fb2c);if(_0x150f3a['isDirectory']()){!existsSync(_0x5265ed)&&mkdirSync(_0x5265ed,{'recursive':!![]});const _0xcd580c=readdirSync(_0x33fb2c);for(const _0x4dce07 of _0xcd580c){await copyDir(join(_0x33fb2c,_0x4dce07),join(_0x5265ed,_0x4dce07));}}else copyFileSync(_0x33fb2c,_0x5265ed);}export function ensureDir(_0x5215ec){!existsSync(_0x5215ec)&&mkdirSync(_0x5215ec,{'recursive':!![]});}function a207_0x52a2(){const _0x2f394d=['6zoyRoy','14663412YsHbGb','162uoJvVb','2836905nZIjUU','3icyoZT','388696gqBnoD','1918021mXmiUw','4NhknzP','36652awseby','69980vQjwju','1605386MbWFcI','44xEbPoZ'];a207_0x52a2=function(){return _0x2f394d;};return a207_0x52a2();}export function pathExists(_0x56cd71){return existsSync(_0x56cd71);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a208_0x3fd1(){const _0x5a1360=['skillTemplate','CDN\x20数据中缺少\x20skillTemplate','trimEnd','join','3410892DXmJhS','.md','object','.lovrabet/skill/guides','length','3622VqWUMr','application/json','651ubDQIA','\x0a\x0a>更新时间:','title','entries','/skills/guides.json','path','1525916hTdBGo','5356150XbfTie','guides','status','4610837Ifkgca','keys','8AVCXYc','content','697815sXdjaX','push','extendContent','lastUpdated','replace','627540NAXcnf','utf-8','10QMPmLn','map','CDN\x20请求失败:\x20','CDN\x20返回数据格式错误'];a208_0x3fd1=function(){return _0x5a1360;};return a208_0x3fd1();}function a208_0x5084(_0x356e64,_0x5577cc){_0x356e64=_0x356e64-0x178;const _0x3fd157=a208_0x3fd1();let _0x508496=_0x3fd157[_0x356e64];return _0x508496;}const a208_0x418123=a208_0x5084;(function(_0x3e4437,_0x5c578f){const _0x460ee9=a208_0x5084,_0x450c87=_0x3e4437();while(!![]){try{const _0x55a228=-parseInt(_0x460ee9(0x196))/0x1+parseInt(_0x460ee9(0x186))/0x2*(parseInt(_0x460ee9(0x188))/0x3)+-parseInt(_0x460ee9(0x18e))/0x4*(parseInt(_0x460ee9(0x179))/0x5)+-parseInt(_0x460ee9(0x19b))/0x6+parseInt(_0x460ee9(0x192))/0x7*(parseInt(_0x460ee9(0x194))/0x8)+parseInt(_0x460ee9(0x181))/0x9+parseInt(_0x460ee9(0x18f))/0xa;if(_0x55a228===_0x5c578f)break;else _0x450c87['push'](_0x450c87['shift']());}catch(_0xa27abb){_0x450c87['push'](_0x450c87['shift']());}}}(a208_0x3fd1,0x61e16));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'../utils/config.js';function getGuidesCdnUrl(){const _0xba6f15=a208_0x5084,_0x19894e=getTemplateBaseUrl();return _0x19894e+_0xba6f15(0x18c);}const CACHE_DIR=join(homedir(),'.lovrabet','cache');export async function fetchGuidesFromCDN(){const _0x1f8119=a208_0x5084,_0xb629ae=getGuidesCdnUrl(),_0x15a22c=await fetch(_0xb629ae,{'headers':{'Accept':_0x1f8119(0x187)}});if(!_0x15a22c['ok'])throw new Error(_0x1f8119(0x17b)+_0x15a22c[_0x1f8119(0x191)]+'\x20'+_0x15a22c['statusText']);const _0xc66157=await _0x15a22c['json']();if(!_0xc66157[_0x1f8119(0x190)]||typeof _0xc66157[_0x1f8119(0x190)]!==_0x1f8119(0x183))throw new Error(_0x1f8119(0x17c));return _0xc66157;}export function writeGuidesToProject(_0x21e22c,_0x325160,_0x416c50=a208_0x418123(0x184),_0x4a5fa6){const _0x5823be=a208_0x418123,_0x3bbc1d=join(_0x325160,_0x416c50);mkdirSync(_0x3bbc1d,{'recursive':!![]});for(const [_0x65e42b,_0x2f24cb]of Object['entries'](_0x21e22c[_0x5823be(0x190)])){let _0x37b06a=_0x2f24cb[_0x5823be(0x195)];_0x2f24cb[_0x5823be(0x199)]&&(_0x37b06a=appendUpdateTime(_0x37b06a,_0x2f24cb['lastUpdated'])),writeFileSync(join(_0x3bbc1d,_0x65e42b+_0x5823be(0x182)),_0x37b06a,_0x5823be(0x178));}}export function appendUpdateTime(_0x306d78,_0x36d138){const _0x558974=a208_0x418123;return _0x306d78=_0x306d78['replace'](/\n*>更新时间:.*$/m,''),_0x306d78[_0x558974(0x17f)]()+(_0x558974(0x189)+_0x36d138);}export function getSkillTemplate(_0x27ad5b){const _0x494cd9=a208_0x418123;return _0x27ad5b[_0x494cd9(0x17d)]?.[_0x494cd9(0x195)]||'';}export function appendExtendContents(_0x1a23c8,_0x22a1ba,_0x1977b4){const _0x132497=a208_0x418123,_0xa89b73=[];for(const [,_0x279826]of Object['entries'](_0x22a1ba[_0x132497(0x190)])){_0x279826[_0x132497(0x198)]&&_0xa89b73[_0x132497(0x197)](_0x279826['extendContent'][_0x132497(0x17f)]());}if(_0xa89b73[_0x132497(0x185)]===0x0)return _0x1a23c8;return _0x1a23c8[_0x132497(0x17f)]()+'\x0a\x0a'+_0xa89b73[_0x132497(0x180)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x22f6dd,_0x2d7f80,_0x1c01c2){const _0x569ba7=a208_0x418123,_0x57b0d2=getSkillTemplate(_0x22f6dd);if(!_0x57b0d2)throw new Error(_0x569ba7(0x17e));const _0x1911aa=dirname(_0x2d7f80);mkdirSync(_0x1911aa,{'recursive':!![]});let _0x37ba51=_0x57b0d2[_0x569ba7(0x19a)](/\{\{IDE_NAME\}\}/g,_0x1c01c2);_0x37ba51=appendExtendContents(_0x37ba51,_0x22f6dd),_0x22f6dd[_0x569ba7(0x17d)][_0x569ba7(0x199)]&&(_0x37ba51=appendUpdateTime(_0x37ba51,_0x22f6dd[_0x569ba7(0x17d)][_0x569ba7(0x199)])),writeFileSync(_0x2d7f80,_0x37ba51,'utf-8');}export async function installGuides(_0x2a2060){const _0x5a558d=a208_0x418123,_0x4adca9=await fetchGuidesFromCDN();return writeGuidesToProject(_0x4adca9,_0x2a2060),Object[_0x5a558d(0x193)](_0x4adca9[_0x5a558d(0x190)])[_0x5a558d(0x185)];}export function getGuidesSummary(_0x524f34){const _0x27482a=a208_0x418123;return Object[_0x27482a(0x18b)](_0x524f34['guides'])[_0x27482a(0x17a)](([_0x339436,_0x4c9297])=>({'key':_0x339436,'title':_0x4c9297[_0x27482a(0x18a)],'path':_0x4c9297[_0x27482a(0x18d)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d133f,_0x20c16f){const _0x22ea88=a209_0x1696,_0x28060d=_0x4d133f();while(!![]){try{const _0x53c97c=parseInt(_0x22ea88(0xce))/0x1*(-parseInt(_0x22ea88(0xd6))/0x2)+parseInt(_0x22ea88(0xc9))/0x3+-parseInt(_0x22ea88(0xcf))/0x4+-parseInt(_0x22ea88(0xd1))/0x5*(parseInt(_0x22ea88(0xc1))/0x6)+-parseInt(_0x22ea88(0xca))/0x7*(parseInt(_0x22ea88(0xc7))/0x8)+-parseInt(_0x22ea88(0xc5))/0x9+parseInt(_0x22ea88(0xd3))/0xa*(parseInt(_0x22ea88(0xcd))/0xb);if(_0x53c97c===_0x20c16f)break;else _0x28060d['push'](_0x28060d['shift']());}catch(_0x4203ba){_0x28060d['push'](_0x28060d['shift']());}}}(a209_0x8ab4,0xb1c2b));function a209_0x8ab4(){const _0x4ad7f5=['json','1987098itnUfY','41342GfKXPc','includes','message','5753ekeFnG','655CSvEVD','4822828kScoZj','content-type','295AXdyQx','log','101130CpjKja','TypeError','url','3902oKqucF','AbortError','statusText','ms\x20后进行第\x20','text','name','signal','118950xqRMAL','ENOTFOUND','headers','\x20次重试...','10037781mTFlpw','Request\x20failed','616tozdvR'];a209_0x8ab4=function(){return _0x4ad7f5;};return a209_0x8ab4();}export async function httpRequest(_0x1d53eb,_0x1ea69e={}){const _0x236f95=a209_0x1696,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x1ea69e;let _0x48dc85=null;for(let _0x72a976=0x0;_0x72a976<=retries;_0x72a976++){try{const _0x1efbcc=new AbortController(),_0xf553df=setTimeout(()=>_0x1efbcc['abort'](),timeout),_0x49e4b0=await fetch(_0x1d53eb,{'headers':headers,'signal':_0x1efbcc[_0x236f95(0xdc)]});clearTimeout(_0xf553df);let _0x36c103;const _0x3c14dc=_0x49e4b0[_0x236f95(0xc3)]['get'](_0x236f95(0xd0));return _0x3c14dc?.[_0x236f95(0xcb)]('application/json')?_0x36c103=await _0x49e4b0[_0x236f95(0xc8)]():_0x36c103=await _0x49e4b0[_0x236f95(0xda)](),{'ok':_0x49e4b0['ok'],'status':_0x49e4b0['status'],'statusText':_0x49e4b0[_0x236f95(0xd8)],'data':_0x36c103,'headers':_0x49e4b0[_0x236f95(0xc3)],'url':_0x49e4b0[_0x236f95(0xd5)],'text':()=>_0x49e4b0[_0x236f95(0xda)]()};}catch(_0x499dc4){_0x48dc85=_0x499dc4 instanceof Error?_0x499dc4:new Error(String(_0x499dc4));if(_0x72a976===retries)break;if(shouldRetry(_0x499dc4)){console[_0x236f95(0xd2)]('*\x20请求失败,'+retryDelay+_0x236f95(0xd9)+(_0x72a976+0x1)+_0x236f95(0xc4)),await sleep(retryDelay);continue;}else break;}}throw _0x48dc85||new Error(_0x236f95(0xc6));}function shouldRetry(_0x15fe7b){const _0x1d995d=a209_0x1696;if(_0x15fe7b instanceof Error){if(_0x15fe7b[_0x1d995d(0xdb)]===_0x1d995d(0xd7))return![];if(_0x15fe7b[_0x1d995d(0xdb)]===_0x1d995d(0xd4)&&_0x15fe7b[_0x1d995d(0xcc)][_0x1d995d(0xcb)]('fetch'))return!![];if(_0x15fe7b[_0x1d995d(0xcc)][_0x1d995d(0xcb)]('ECONNRESET'))return!![];if(_0x15fe7b[_0x1d995d(0xcc)][_0x1d995d(0xcb)](_0x1d995d(0xc2)))return![];}return![];}function sleep(_0x224b54){return new Promise(_0xa25246=>setTimeout(_0xa25246,_0x224b54));}function a209_0x1696(_0x46876c,_0x517011){_0x46876c=_0x46876c-0xc1;const _0x8ab454=a209_0x8ab4();let _0x169637=_0x8ab454[_0x46876c];return _0x169637;}export function validateUrl(_0x21b063){try{return new URL(_0x21b063),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a210_0x2d58(){const _0x2e8a71=['stdin','true','nonInteractive','2828986ehnLAr','setRawMode','isRaw','3444105SSKaOX','15193100HeVRwU','2139999QJsjga','104877NAFiQm','176FqJTxz','1118601kczyvq','6VqTJDx','isTTY','99460PoJrDT','stdout','88ynFxwu'];a210_0x2d58=function(){return _0x2e8a71;};return a210_0x2d58();}function a210_0x3463(_0x464d5d,_0x4f4274){_0x464d5d=_0x464d5d-0xa9;const _0x2d58cf=a210_0x2d58();let _0x3463a3=_0x2d58cf[_0x464d5d];return _0x3463a3;}(function(_0x161d9a,_0x22821b){const _0x1935f9=a210_0x3463,_0x2014c0=_0x161d9a();while(!![]){try{const _0x5ae4f6=-parseInt(_0x1935f9(0xb2))/0x1+-parseInt(_0x1935f9(0xac))/0x2+parseInt(_0x1935f9(0xb1))/0x3+-parseInt(_0x1935f9(0xb3))/0x4*(-parseInt(_0x1935f9(0xb7))/0x5)+-parseInt(_0x1935f9(0xb5))/0x6*(-parseInt(_0x1935f9(0xaf))/0x7)+-parseInt(_0x1935f9(0xb9))/0x8*(parseInt(_0x1935f9(0xb4))/0x9)+parseInt(_0x1935f9(0xb0))/0xa;if(_0x5ae4f6===_0x22821b)break;else _0x2014c0['push'](_0x2014c0['shift']());}catch(_0x2c9d20){_0x2014c0['push'](_0x2014c0['shift']());}}}(a210_0x2d58,0xae28d));function env(_0x77c0e8){return process.env[`RABETBASE_${_0x77c0e8}`]||process.env[`LOVRABET_${_0x77c0e8}`]||undefined;}export function isNonInteractive(_0x373ead){const _0x551068=a210_0x3463;return!!(_0x373ead[_0x551068(0xab)]||_0x373ead['ci']||env('CI')===_0x551068(0xaa)||process.env.CI===_0x551068(0xaa)||!process[_0x551068(0xb8)]['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x36ae5d=a210_0x3463;if(!process[_0x36ae5d(0xa9)][_0x36ae5d(0xb6)])return![];try{const _0x3547ba=process[_0x36ae5d(0xa9)][_0x36ae5d(0xae)];return process[_0x36ae5d(0xa9)][_0x36ae5d(0xad)](!![]),process[_0x36ae5d(0xa9)]['setRawMode'](_0x3547ba??![]),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a211_0x13ba(_0xdc6a5e,_0x4e594c){_0xdc6a5e=_0xdc6a5e-0xb6;const _0x72cd10=a211_0x72cd();let _0x13ba98=_0x72cd10[_0xdc6a5e];return _0x13ba98;}const a211_0x14fdff=a211_0x13ba;(function(_0x511df2,_0x126038){const _0x1964d0=a211_0x13ba,_0xd6de5e=_0x511df2();while(!![]){try{const _0x1d5a29=parseInt(_0x1964d0(0xc6))/0x1*(-parseInt(_0x1964d0(0xed))/0x2)+-parseInt(_0x1964d0(0xbe))/0x3*(-parseInt(_0x1964d0(0xb8))/0x4)+parseInt(_0x1964d0(0xd9))/0x5+-parseInt(_0x1964d0(0xe3))/0x6+parseInt(_0x1964d0(0xef))/0x7*(parseInt(_0x1964d0(0xd4))/0x8)+parseInt(_0x1964d0(0xd6))/0x9*(parseInt(_0x1964d0(0xc5))/0xa)+-parseInt(_0x1964d0(0xba))/0xb*(-parseInt(_0x1964d0(0xe4))/0xc);if(_0x1d5a29===_0x126038)break;else _0xd6de5e['push'](_0xd6de5e['shift']());}catch(_0x5eddc3){_0xd6de5e['push'](_0xd6de5e['shift']());}}}(a211_0x72cd,0xcd81e));import a211_0x1b2ed1 from'winston';import a211_0x471e81 from'node:fs';import a211_0xf0bcdc from'node:path';class Logger{[a211_0x14fdff(0xec)];['logFilePath'];[a211_0x14fdff(0xd3)]='';constructor(){const _0xf1ec9c=a211_0x14fdff;this[_0xf1ec9c(0xbd)]='';}[a211_0x14fdff(0xd7)](_0x23f034){const _0x3826c7=a211_0x14fdff;this[_0x3826c7(0xd3)]=_0x23f034;}[a211_0x14fdff(0xcd)](){const _0x38fcb0=a211_0x14fdff,_0x1acf6d=a211_0xf0bcdc[_0x38fcb0(0xdc)](this[_0x38fcb0(0xbd)]);!a211_0x471e81['existsSync'](_0x1acf6d)&&a211_0x471e81['mkdirSync'](_0x1acf6d,{'recursive':!![]});const _0xbeadfd=a211_0x1b2ed1[_0x38fcb0(0xc8)][_0x38fcb0(0xda)](a211_0x1b2ed1[_0x38fcb0(0xc8)]['timestamp'](),a211_0x1b2ed1[_0x38fcb0(0xc8)][_0x38fcb0(0xbb)]({'stack':!![]}),a211_0x1b2ed1['format'][_0x38fcb0(0xe6)](_0x31f298=>{const _0x1061db=_0x38fcb0,_0x58bb5e={'timestamp':_0x31f298[_0x1061db(0xe7)]||new Date()[_0x1061db(0xc2)](),'level':_0x31f298[_0x1061db(0xc7)]||_0x1061db(0xdf),'command':_0x31f298[_0x1061db(0xf0)]||_0x1061db(0xce),'rawCommand':_0x31f298['rawCommand']||this['currentRawCommand']||undefined,'message':_0x31f298['message']||'','duration':_0x31f298[_0x1061db(0xd8)]||undefined,'details':_0x31f298['details']||undefined};return JSON[_0x1061db(0xdb)](_0x58bb5e);}));this[_0x38fcb0(0xec)]=a211_0x1b2ed1[_0x38fcb0(0xc0)]({'level':_0x38fcb0(0xdf),'format':_0xbeadfd,'transports':[new a211_0x1b2ed1['transports'][(_0x38fcb0(0xbc))]({'filename':this[_0x38fcb0(0xbd)],'level':'info'})],'silent':![]}),a211_0x1b2ed1[_0x38fcb0(0xb9)]({'success':'green','error':_0x38fcb0(0xeb),'warn':_0x38fcb0(0xb6),'info':'blue'});}[a211_0x14fdff(0xc9)](_0x2f0568){const _0x3291ec=a211_0x14fdff;this['logFilePath']=a211_0xf0bcdc[_0x3291ec(0xc3)](_0x2f0568,'.lovrabet.log'),this[_0x3291ec(0xec)]&&this[_0x3291ec(0xec)]['clear'](),this[_0x3291ec(0xcd)]();}[a211_0x14fdff(0xdf)](_0x26c736,_0x21831e,_0x5c577a){const _0x559c21=a211_0x14fdff;if(!this[_0x559c21(0xbd)]||!this['winstonLogger'])return;this[_0x559c21(0xec)][_0x559c21(0xdf)](_0x21831e,{'command':_0x26c736,'details':_0x5c577a});}[a211_0x14fdff(0xbf)](_0x4a2d58,_0x17fb20,_0x5ec66b,_0x242364){const _0x1e8993=a211_0x14fdff;if(!this[_0x1e8993(0xbd)]||!this[_0x1e8993(0xec)])return;this['winstonLogger'][_0x1e8993(0xf1)]('info',_0x17fb20,{'level':_0x1e8993(0xbf),'command':_0x4a2d58,'duration':_0x5ec66b,'details':_0x242364});}[a211_0x14fdff(0xea)](_0x5e0197,_0x257e5f,_0x39205c){const _0x2ee85c=a211_0x14fdff;if(!this[_0x2ee85c(0xbd)]||!this[_0x2ee85c(0xec)])return;this[_0x2ee85c(0xec)][_0x2ee85c(0xea)](_0x257e5f,{'command':_0x5e0197,'details':_0x39205c});}[a211_0x14fdff(0xc4)](_0x14b77b,_0xbd1610,_0x15f363){const _0x362e4c=a211_0x14fdff;if(!this[_0x362e4c(0xbd)]||!this[_0x362e4c(0xec)])return;this['winstonLogger'][_0x362e4c(0xc4)](_0xbd1610,{'command':_0x14b77b,'details':_0x15f363});}async[a211_0x14fdff(0xc1)](_0x2fc7c9,_0x58ae8f,_0xa79861){const _0x1e0690=a211_0x14fdff,_0x2aa330=Date['now']();this[_0x1e0690(0xdf)](_0x2fc7c9,_0x1e0690(0xe9)+_0x58ae8f);try{const _0xb6fb22=await _0xa79861(),_0x3be8a6=Date[_0x1e0690(0xde)]()-_0x2aa330;return this['success'](_0x2fc7c9,_0x1e0690(0xe8)+_0x58ae8f,_0x3be8a6),_0xb6fb22;}catch(_0x280f21){const _0x4b3c7a=Date[_0x1e0690(0xde)]()-_0x2aa330;this[_0x1e0690(0xea)](_0x2fc7c9,_0x1e0690(0xee)+_0x58ae8f,{'error':_0x280f21 instanceof Error?_0x280f21[_0x1e0690(0xca)]:String(_0x280f21),'duration':_0x4b3c7a});throw _0x280f21;}}[a211_0x14fdff(0xd0)](){const _0x1ef2ff=a211_0x14fdff;try{if(!a211_0x471e81[_0x1ef2ff(0xe0)](this['logFilePath']))return[];const _0x5b5d50=a211_0x471e81[_0x1ef2ff(0xcc)](this[_0x1ef2ff(0xbd)],_0x1ef2ff(0xcb));return _0x5b5d50[_0x1ef2ff(0xd5)]('\x0a')[_0x1ef2ff(0xe5)](_0x9dd282=>_0x9dd282[_0x1ef2ff(0xe1)]())[_0x1ef2ff(0xb7)](_0x5cff64=>JSON[_0x1ef2ff(0xe2)](_0x5cff64));}catch(_0x2cc5f9){return console['warn'](_0x1ef2ff(0xd1),_0x2cc5f9),[];}}[a211_0x14fdff(0xcf)](){const _0x3a22f0=a211_0x14fdff;try{a211_0x471e81[_0x3a22f0(0xe0)](this[_0x3a22f0(0xbd)])&&a211_0x471e81[_0x3a22f0(0xdd)](this[_0x3a22f0(0xbd)],'',_0x3a22f0(0xcb));}catch(_0x429683){console[_0x3a22f0(0xc4)]('Failed\x20to\x20clear\x20logs:',_0x429683);}}[a211_0x14fdff(0xd2)](){const _0x54c51b=a211_0x14fdff;return this[_0x54c51b(0xec)];}}function a211_0x72cd(){const _0x10a347=['完成:\x20','开始执行:\x20','error','red','winstonLogger','3253406sUQqyx','失败:\x20','133gJexOl','command','log','yellow','map','16aqCFto','addColors','44bHXWjt','errors','File','logFilePath','430386WjqXvU','success','createLogger','logTask','toISOString','join','warn','4370910XEfPnV','1GyfdRZ','level','format','setLogPath','message','utf8','readFileSync','initWinstonLogger','unknown','clearLogs','readLogs','Failed\x20to\x20read\x20logs:','getWinstonInstance','currentRawCommand','255792AMbEzx','split','18wuWyqN','setRawCommand','duration','915960GBjsHc','combine','stringify','dirname','writeFileSync','now','info','existsSync','trim','parse','7448778QgjgWf','4413588hCUbqD','filter','printf','timestamp'];a211_0x72cd=function(){return _0x10a347;};return a211_0x72cd();}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a212_0x2dbf(){const _0x4dc8ef=['validation','1122231jvYWGF','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','isArray','1569642vzLbYt','192mXrFGh','2OYofXm','Invalid\x20JSON\x20for\x20--params:\x20','parse','10xLPwYb','8769339hDSqzM','4332432pIHwRZ','259812NyBXts','240xzABrC','--params\x20must\x20be\x20a\x20JSON\x20object','object','7wEyCcz','26970ZZwYUG','1090478ftfAXX'];a212_0x2dbf=function(){return _0x4dc8ef;};return a212_0x2dbf();}(function(_0x5f47da,_0x297f13){const _0x4dfca1=a212_0x2062,_0x2a0154=_0x5f47da();while(!![]){try{const _0x522091=-parseInt(_0x4dfca1(0xe9))/0x1*(parseInt(_0x4dfca1(0xe2))/0x2)+parseInt(_0x4dfca1(0xef))/0x3+-parseInt(_0x4dfca1(0xe8))/0x4*(-parseInt(_0x4dfca1(0xe1))/0x5)+parseInt(_0x4dfca1(0xe7))/0x6*(-parseInt(_0x4dfca1(0xe0))/0x7)+parseInt(_0x4dfca1(0xee))/0x8+parseInt(_0x4dfca1(0xed))/0x9*(-parseInt(_0x4dfca1(0xec))/0xa)+parseInt(_0x4dfca1(0xe4))/0xb*(parseInt(_0x4dfca1(0xf0))/0xc);if(_0x522091===_0x297f13)break;else _0x2a0154['push'](_0x2a0154['shift']());}catch(_0x11f799){_0x2a0154['push'](_0x2a0154['shift']());}}}(a212_0x2dbf,0x92bca));import{CliErrors}from'../errors.js';function a212_0x2062(_0x16a23e,_0x177503){_0x16a23e=_0x16a23e-0xde;const _0x2dbf78=a212_0x2dbf();let _0x206200=_0x2dbf78[_0x16a23e];return _0x206200;}export function parseJsonParams(_0x1d638b){const _0x550132=a212_0x2062;if(!_0x1d638b)return undefined;let _0x5ea172;try{_0x5ea172=JSON[_0x550132(0xeb)](_0x1d638b);}catch{throw CliErrors['validation'](_0x550132(0xea)+_0x1d638b);}if(!_0x5ea172||typeof _0x5ea172!==_0x550132(0xdf)||Array[_0x550132(0xe6)](_0x5ea172))throw CliErrors[_0x550132(0xe3)](_0x550132(0xde),_0x550132(0xe5));return _0x5ea172;}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a213_0x55c52a=a213_0xeb61;(function(_0x2d85e8,_0x53683f){const _0x1a8fa8=a213_0xeb61,_0x3415bb=_0x2d85e8();while(!![]){try{const _0x5dd48e=parseInt(_0x1a8fa8(0x1d1))/0x1*(-parseInt(_0x1a8fa8(0x1cd))/0x2)+-parseInt(_0x1a8fa8(0x1ce))/0x3*(-parseInt(_0x1a8fa8(0x1cc))/0x4)+parseInt(_0x1a8fa8(0x1d3))/0x5+-parseInt(_0x1a8fa8(0x1d4))/0x6+parseInt(_0x1a8fa8(0x1cf))/0x7+-parseInt(_0x1a8fa8(0x1d6))/0x8*(parseInt(_0x1a8fa8(0x1d7))/0x9)+-parseInt(_0x1a8fa8(0x1d5))/0xa*(-parseInt(_0x1a8fa8(0x1d8))/0xb);if(_0x5dd48e===_0x53683f)break;else _0x3415bb['push'](_0x3415bb['shift']());}catch(_0x38046e){_0x3415bb['push'](_0x3415bb['shift']());}}}(a213_0x586e,0x5548b));export const isWindows=process['platform']===a213_0x55c52a(0x1d2);export function resolveNpmBin(_0x28c3d0){const _0x3a0195=a213_0x55c52a;return isWindows?_0x28c3d0+_0x3a0195(0x1d0):_0x28c3d0;}function a213_0xeb61(_0x589ad5,_0x47a5ad){_0x589ad5=_0x589ad5-0x1cc;const _0x586e2f=a213_0x586e();let _0xeb6171=_0x586e2f[_0x589ad5];return _0xeb6171;}function a213_0x586e(){const _0x37eb19=['2302685egEhba','.cmd','1oZvokJ','win32','494365nGrNJV','2426334otDdLF','10eKqPVU','3063352FcNQUi','9ygiIiD','13458027fRsgMt','640396VzVgqX','1349506ZEkWrf','3QGHBxh'];a213_0x586e=function(){return _0x37eb19;};return a213_0x586e();}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a214_0x228243=a214_0x1131;(function(_0x3d29c2,_0x343b8b){const _0x568ad1=a214_0x1131,_0x33e72a=_0x3d29c2();while(!![]){try{const _0x3b8942=-parseInt(_0x568ad1(0x86))/0x1*(-parseInt(_0x568ad1(0x7d))/0x2)+parseInt(_0x568ad1(0x85))/0x3*(parseInt(_0x568ad1(0x7f))/0x4)+parseInt(_0x568ad1(0x89))/0x5*(-parseInt(_0x568ad1(0x81))/0x6)+-parseInt(_0x568ad1(0x7b))/0x7*(parseInt(_0x568ad1(0x83))/0x8)+parseInt(_0x568ad1(0x8c))/0x9*(parseInt(_0x568ad1(0x82))/0xa)+-parseInt(_0x568ad1(0x88))/0xb+-parseInt(_0x568ad1(0x76))/0xc*(-parseInt(_0x568ad1(0x8d))/0xd);if(_0x3b8942===_0x343b8b)break;else _0x33e72a['push'](_0x33e72a['shift']());}catch(_0xa7c484){_0x33e72a['push'](_0x33e72a['shift']());}}}(a214_0xd0c8,0xf1b41));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 _0x58e288=a214_0x1131,_0x2e8377=getTemplateBaseUrl();return _0x2e8377+_0x58e288(0x7e);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a214_0x228243(0x7a));export async function fetchRulesFromCDN(){const _0x4a887f=a214_0x228243,_0x4d183e=getRulesCdnUrl(),_0x17c20a=await fetch(_0x4d183e,{'headers':{'Accept':_0x4a887f(0x77)}});if(!_0x17c20a['ok'])throw new Error(_0x4a887f(0x8b)+_0x17c20a[_0x4a887f(0x75)]+'\x20'+_0x17c20a[_0x4a887f(0x80)]);const _0xd7082d=await _0x17c20a['json']();if(!_0xd7082d[_0x4a887f(0x8e)]||typeof _0xd7082d['content']!==_0x4a887f(0x78))throw new Error('CDN\x20返回数据格式错误');return _0xd7082d;}function a214_0x1131(_0x366d9c,_0x108859){_0x366d9c=_0x366d9c-0x75;const _0xd0c87f=a214_0xd0c8();let _0x11319f=_0xd0c87f[_0x366d9c];return _0x11319f;}export async function getRulesContent(){try{const _0x331445=await fetchRulesFromCDN();return _0x331445['content'];}catch{return readLocalTemplate();}}function a214_0xd0c8(){const _0x43d850=['8582QhjgOP','/rules/rules.json','1536FfHRms','statusText','102rLwuBp','10flEtyU','512OTTzCe','.cursor/rules','12438esKbnd','2swjhbH','catch','2690479AyDPvK','489595jsiwXQ','本地模板文件不存在:\x20','CDN\x20请求失败:\x20','9940599kmjWdY','26MhvyCd','content','status','7684368neCHDK','application/json','string','lovrabet_rules.mdc','../../templates/rules/lovrabet_rules.mdc.tpl','118853FlNmop','utf-8'];a214_0xd0c8=function(){return _0x43d850;};return a214_0xd0c8();}export function readLocalTemplate(){const _0x3ad3fd=a214_0x228243;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x3ad3fd(0x7c));throw new Error(_0x3ad3fd(0x8a)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x3c23ae){const _0x48d905=a214_0x228243,_0x5285ba=await fetchRulesFromCDN()[_0x48d905(0x87)](()=>null);let _0x4e79e7;_0x5285ba?(_0x4e79e7=_0x5285ba['content'],_0x5285ba['lastUpdated']&&(_0x4e79e7=appendUpdateTime(_0x4e79e7,_0x5285ba['lastUpdated']))):_0x4e79e7=readLocalTemplate();const _0x30e0bc=dirname(_0x3c23ae);!existsSync(_0x30e0bc)&&mkdirSync(_0x30e0bc,{'recursive':!![]}),writeFileSync(_0x3c23ae,_0x4e79e7,_0x48d905(0x7c));}export async function copyRulesToCursor(_0xc87903){const _0x4b102e=a214_0x228243,_0x420506=join(_0xc87903,_0x4b102e(0x84)),_0x1f3b42=join(_0x420506,_0x4b102e(0x79));if(existsSync(_0x1f3b42))return![];return await writeRulesFile(_0x1f3b42),!![];}export async function copyRulesToAgentsMd(_0xca467c){const _0x9da006=join(_0xca467c,'agents.md');if(existsSync(_0x9da006))return![];return await writeRulesFile(_0x9da006),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x4f1aff){return new Promise(_0x4358fa=>setTimeout(_0x4358fa,_0x4f1aff));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a216_0x3af642=a216_0x3df0;(function(_0x1f070b,_0xc9d9de){const _0x2e647a=a216_0x3df0,_0xe49c7a=_0x1f070b();while(!![]){try{const _0x4f2b08=parseInt(_0x2e647a(0x1c4))/0x1+-parseInt(_0x2e647a(0x1cb))/0x2*(-parseInt(_0x2e647a(0x1c8))/0x3)+-parseInt(_0x2e647a(0x1c9))/0x4*(-parseInt(_0x2e647a(0x1eb))/0x5)+parseInt(_0x2e647a(0x1bd))/0x6*(parseInt(_0x2e647a(0x1ee))/0x7)+parseInt(_0x2e647a(0x1b8))/0x8*(-parseInt(_0x2e647a(0x1cc))/0x9)+parseInt(_0x2e647a(0x1e0))/0xa+-parseInt(_0x2e647a(0x1e6))/0xb;if(_0x4f2b08===_0xc9d9de)break;else _0xe49c7a['push'](_0xe49c7a['shift']());}catch(_0x3d85ca){_0xe49c7a['push'](_0xe49c7a['shift']());}}}(a216_0x4684,0x1e1ec));function a216_0x3df0(_0x1f8f8c,_0x51e093){_0x1f8f8c=_0x1f8f8c-0x1b4;const _0x4684bf=a216_0x4684();let _0x3df033=_0x4684bf[_0x1f8f8c];return _0x3df033;}import a216_0x4b08e5 from'node:fs';import a216_0x12add1 from'node:path';import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';function a216_0x4684(){const _0x434b72=['processDirectory','readdir','replace','6lRCbwq','isFile','.ts','map','YourModel','datasetCode:\x20\x22','utf8','163984oLYFPc','.tpl','processFile','alias','519663TIJDcM','24VQNpjL','toISOString','2jQfLdc','9AplPFd','processTemplate','.scss','readFile','getHours','slice','join','模板内容替换完成','\x20},','replaceApiContent','message','formatLocalTimestamp','copyFile','getMonth','pad','getMinutes','.css','charAt','split','name','224040YNUMns','replaceContent','api','datasetCode','toDisplayTitle','promises','5152268woSKUo','error','template','toLowerCase','.md','19060BMCInX','includes','writeFile','1476447NbbWOM','toComponentName','padStart','now','extname','getFullYear','name:\x20\x22','alias:\x20\x22','toUpperCase','endsWith','pop','开始处理模板内容替换','13136FDDQTK','.jsx'];a216_0x4684=function(){return _0x434b72;};return a216_0x4684();}const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a216_0x3af642(0x1da)](_0x2c781f){const _0x4b8ea5=a216_0x3af642;return String(_0x2c781f)[_0x4b8ea5(0x1f0)](0x2,'0');}static[a216_0x3af642(0x1d7)](_0x4c75de){const _0x11c9f6=a216_0x3af642,_0x333383=_0x4c75de[_0x11c9f6(0x1f3)](),_0x180b11=this[_0x11c9f6(0x1da)](_0x4c75de[_0x11c9f6(0x1d9)]()+0x1),_0x36bdc0=this[_0x11c9f6(0x1da)](_0x4c75de['getDate']()),_0x173a89=this[_0x11c9f6(0x1da)](_0x4c75de[_0x11c9f6(0x1d0)]()),_0x54e8c8=this['pad'](_0x4c75de[_0x11c9f6(0x1db)]()),_0x1adbb4=this[_0x11c9f6(0x1da)](_0x4c75de['getSeconds']());return{'createdAt':_0x333383+'-'+_0x180b11+'-'+_0x36bdc0+'\x20'+_0x173a89+':'+_0x54e8c8+':'+_0x1adbb4,'createdDate':_0x333383+'-'+_0x180b11+'-'+_0x36bdc0,'createdTime':_0x173a89+':'+_0x54e8c8+':'+_0x1adbb4};}static[a216_0x3af642(0x1ef)](_0x261cba){const _0x5c0dd9=a216_0x3af642,_0x148133=_0x261cba[_0x5c0dd9(0x1de)]('/')['pop']()||_0x261cba;return _0x148133['split']('-')[_0x5c0dd9(0x1c0)](_0xa46b0=>_0xa46b0[_0x5c0dd9(0x1dd)](0x0)[_0x5c0dd9(0x1b4)]()+_0xa46b0[_0x5c0dd9(0x1d1)](0x1)['toLowerCase']())[_0x5c0dd9(0x1d2)]('');}static[a216_0x3af642(0x1e4)](_0x42b963){const _0xaa797=a216_0x3af642,_0xfdc350=_0x42b963[_0xaa797(0x1de)]('/')[_0xaa797(0x1b6)]()||_0x42b963;return _0xfdc350[_0xaa797(0x1de)]('-')[_0xaa797(0x1c0)](_0x2c75ec=>_0x2c75ec[_0xaa797(0x1dd)](0x0)[_0xaa797(0x1b4)]()+_0x2c75ec[_0xaa797(0x1d1)](0x1)[_0xaa797(0x1e9)]())['join']('\x20');}static[a216_0x3af642(0x1e1)](_0x228f34,_0x1c1c4b,_0x14d686){const _0x5c5025=a216_0x3af642,_0x2b091d=this['toComponentName'](_0x1c1c4b),_0x46bee1=this[_0x5c5025(0x1e4)](_0x1c1c4b),{createdAt:_0x402408,createdDate:_0x2ce2a4,createdTime:_0x24bd79}=this[_0x5c5025(0x1d7)](new Date());let _0x4b6912=_0x228f34[_0x5c5025(0x1bc)](/\{CliVersion\}/g,CLI_VERSION)[_0x5c5025(0x1bc)](/\{ComponentName\}/g,_0x2b091d)[_0x5c5025(0x1bc)](/\{DisplayTitle\}/g,_0x46bee1)[_0x5c5025(0x1bc)](/\{PageName\}/g,_0x1c1c4b)['replace'](/\{TemplateName\}/g,_0x14d686)['replace'](/\{CreatedAt\}/g,_0x402408)[_0x5c5025(0x1bc)](/\{CreatedDate\}/g,_0x2ce2a4)['replace'](/\{CreatedTime\}/g,_0x24bd79);return _0x4b6912;}static[a216_0x3af642(0x1d5)](_0x4b91c5,_0x6e99db,_0x2bdf1b,_0x4a59cf,_0x22a558,_0x2caf12,_0x47002a,_0x373f16){const _0x2c1043=a216_0x3af642,_0x127ebe=new Date(),_0xf80242=_0x127ebe[_0x2c1043(0x1ca)](),_0x1d3fa3=_0x2bdf1b[_0x2c1043(0x1c0)](_0x3cb671=>{const _0x2721a0=_0x2c1043,_0x856a26=[_0x2721a0(0x1c2)+_0x3cb671[_0x2721a0(0x1e3)]+'\x22','tableName:\x20\x22'+_0x3cb671['tableName']+'\x22',_0x2721a0(0x1f4)+_0x3cb671[_0x2721a0(0x1df)]+'\x22'];return _0x3cb671[_0x2721a0(0x1c7)]&&_0x856a26['push'](_0x2721a0(0x1f5)+_0x3cb671[_0x2721a0(0x1c7)]+'\x22'),'\x0a\x20\x20\x20\x20{\x20'+_0x856a26[_0x2721a0(0x1d2)](',\x20')+_0x2721a0(0x1d4);})[_0x2c1043(0x1d2)](''),_0x2efcb7=_0x4a59cf||_0x2bdf1b[0x0]?.[_0x2c1043(0x1c7)]||_0x2c1043(0x1c1);let _0x1ad0db=_0x4b91c5[_0x2c1043(0x1bc)](/\{AppCode\}/g,_0x6e99db)[_0x2c1043(0x1bc)](/\{ModelConfigs\}/g,_0x1d3fa3)[_0x2c1043(0x1bc)](/\{ExampleModelName\}/g,_0x2efcb7)[_0x2c1043(0x1bc)](/\{ApiFileName\}/g,_0x22a558||_0x2c1043(0x1e2))[_0x2c1043(0x1bc)](/\{ConfigName\}/g,_0x2caf12||'default')['replace'](/\{ClientConfigParam\}/g,_0x47002a||'')[_0x2c1043(0x1bc)](/\{VarPrefix\}/g,_0x373f16||'LOVRABET')[_0x2c1043(0x1bc)](/\{CreatedAt\}/g,_0xf80242);return _0x1ad0db;}static async[a216_0x3af642(0x1cd)](_0x302c12,_0xb827e3,_0x5468a8,_0x566dcc,_0x1e7690=!![]){const _0x12d96b=a216_0x3af642,_0xbd088e=Date[_0x12d96b(0x1f1)]();try{_0x1e7690&&logger['info'](_0x12d96b(0x1e8),_0x12d96b(0x1b7),{'templatePath':_0x302c12,'targetPath':_0xb827e3,'pageName':_0x5468a8,'templateName':_0x566dcc});await a216_0x4b08e5['promises']['mkdir'](_0xb827e3,{'recursive':!![]}),await this[_0x12d96b(0x1ba)](_0x302c12,_0xb827e3,_0x5468a8,_0x566dcc);if(_0x1e7690){const _0x11cd20=Date[_0x12d96b(0x1f1)]()-_0xbd088e;logger['success'](_0x12d96b(0x1e8),_0x12d96b(0x1d3),_0x11cd20,{'pageName':_0x5468a8,'templateName':_0x566dcc});}}catch(_0x9a66b8){if(_0x1e7690){const _0x196059=Date[_0x12d96b(0x1f1)]()-_0xbd088e;logger[_0x12d96b(0x1e7)]('template','模板内容替换失败',{'templatePath':_0x302c12,'targetPath':_0xb827e3,'pageName':_0x5468a8,'templateName':_0x566dcc,'error':_0x9a66b8 instanceof Error?_0x9a66b8[_0x12d96b(0x1d6)]:String(_0x9a66b8),'duration':_0x196059});}throw _0x9a66b8;}}static async[a216_0x3af642(0x1ba)](_0x523a7b,_0x324d9a,_0x2cc1d8,_0x5cf9ee){const _0x236be5=a216_0x3af642,_0x577ae5=await a216_0x4b08e5[_0x236be5(0x1e5)][_0x236be5(0x1bb)](_0x523a7b,{'withFileTypes':!![]});for(const _0xbecbb7 of _0x577ae5){const _0xd9c1c7=a216_0x12add1['join'](_0x523a7b,_0xbecbb7[_0x236be5(0x1df)]);let _0x48478e=a216_0x12add1[_0x236be5(0x1d2)](_0x324d9a,_0xbecbb7[_0x236be5(0x1df)]);_0xbecbb7['name']['endsWith'](_0x236be5(0x1c5))&&(_0x48478e=a216_0x12add1[_0x236be5(0x1d2)](_0x324d9a,_0xbecbb7['name'][_0x236be5(0x1bc)](/\.tpl$/,'')));if(_0xbecbb7['isDirectory']())await a216_0x4b08e5[_0x236be5(0x1e5)]['mkdir'](_0x48478e,{'recursive':!![]}),await this[_0x236be5(0x1ba)](_0xd9c1c7,_0x48478e,_0x2cc1d8,_0x5cf9ee);else _0xbecbb7[_0x236be5(0x1be)]()&&await this['processFile'](_0xd9c1c7,_0x48478e,_0x2cc1d8,_0x5cf9ee);}}static async[a216_0x3af642(0x1c6)](_0x44b941,_0x4d4c9e,_0x3239f3,_0x49d959){const _0x56ea85=a216_0x3af642,_0x193830=a216_0x12add1[_0x56ea85(0x1f2)](_0x44b941)[_0x56ea85(0x1e9)]();_0x44b941[_0x56ea85(0x1b5)](_0x56ea85(0x1c5))&&(_0x4d4c9e=_0x4d4c9e['replace'](/\.tpl$/,''));const _0x4fb9b3=['.tsx',_0x56ea85(0x1bf),_0x56ea85(0x1b9),'.js','.json',_0x56ea85(0x1ea),_0x56ea85(0x1dc),_0x56ea85(0x1ce),_0x56ea85(0x1c5)];if(_0x4fb9b3[_0x56ea85(0x1ec)](_0x193830)||_0x44b941[_0x56ea85(0x1b5)](_0x56ea85(0x1c5))){const _0x47fec2=await a216_0x4b08e5[_0x56ea85(0x1e5)][_0x56ea85(0x1cf)](_0x44b941,'utf8'),_0x2a402f=this['replaceContent'](_0x47fec2,_0x3239f3,_0x49d959);await a216_0x4b08e5['promises'][_0x56ea85(0x1ed)](_0x4d4c9e,_0x2a402f,_0x56ea85(0x1c3));}else await a216_0x4b08e5['promises'][_0x56ea85(0x1d8)](_0x44b941,_0x4d4c9e);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bd599,_0x4cd836){const _0x3c9545=a217_0x21fd,_0x1ae5d8=_0x2bd599();while(!![]){try{const _0x103f52=parseInt(_0x3c9545(0x125))/0x1*(-parseInt(_0x3c9545(0x115))/0x2)+parseInt(_0x3c9545(0x128))/0x3+parseInt(_0x3c9545(0x114))/0x4+-parseInt(_0x3c9545(0x11e))/0x5*(-parseInt(_0x3c9545(0x12a))/0x6)+parseInt(_0x3c9545(0x12b))/0x7*(-parseInt(_0x3c9545(0x11f))/0x8)+parseInt(_0x3c9545(0x119))/0x9*(parseInt(_0x3c9545(0x116))/0xa)+-parseInt(_0x3c9545(0x117))/0xb;if(_0x103f52===_0x4cd836)break;else _0x1ae5d8['push'](_0x1ae5d8['shift']());}catch(_0x2c8af4){_0x1ae5d8['push'](_0x1ae5d8['shift']());}}}(a217_0xcb7e,0x1f644));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import a217_0x14d175 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';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function isUpdateNoticeDisabled(){const _0x45f299=a217_0x21fd,_0x29a739=process.env.RABETBASE_NO_UPDATE_NOTICE?.[_0x45f299(0x126)]()[_0x45f299(0x112)]();return _0x29a739==='1'||_0x29a739==='true'||_0x29a739===_0x45f299(0x113);}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),'.cache');}export function getUpdateNoticeCachePath(){const _0x2f935d=a217_0x21fd;return join(cacheRoot(),_0x2f935d(0x12d),_0x2f935d(0x118));}async function readUpdateNoticeCache(){const _0x4ac98b=a217_0x21fd;try{const _0x1e19db=await readFile(getUpdateNoticeCachePath(),_0x4ac98b(0x120)),_0x8878cb=JSON['parse'](_0x1e19db);if(!_0x8878cb||typeof _0x8878cb!=='object')return{};return _0x8878cb;}catch{return{};}}async function writeUpdateNoticeCache(_0x28d43e){const _0x5886af=a217_0x21fd;try{const _0x148072=getUpdateNoticeCachePath();await mkdir(dirname(_0x148072),{'recursive':!![]}),await writeFile(_0x148072,JSON[_0x5886af(0x129)](_0x28d43e,null,0x2)+'\x0a','utf8');}catch{}}function a217_0xcb7e(){const _0x470da1=['toLowerCase','yes','388752GUvguy','796LULVaA','151270XEHxRW','1624612SkotDA','update-check.json','45wzeKZS','\x20update','number','lastNotifiedVersion','valid','503095tLnjRJ','8tIvVaQ','utf8','https://www.npmjs.com/package/','\x20available,\x20current\x20','latest','checkedAt','223cSfRCZ','trim','gte','17829kcEdeU','stringify','12CSvihi','104846UAVCZY','lastNotifiedAt','rabetbase-cli'];a217_0xcb7e=function(){return _0x470da1;};return a217_0xcb7e();}function isFreshCheck(_0x1277e9,_0x1ab5d2){const _0x4ec421=a217_0x21fd;return typeof _0x1277e9[_0x4ec421(0x124)]===_0x4ec421(0x11b)&&_0x1ab5d2-_0x1277e9['checkedAt']<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x4aaaaa,_0x31d878,_0x583485){const _0x37c5ce=a217_0x21fd;return _0x4aaaaa[_0x37c5ce(0x11c)]===_0x31d878&&typeof _0x4aaaaa[_0x37c5ce(0x12c)]===_0x37c5ce(0x11b)&&_0x583485-_0x4aaaaa['lastNotifiedAt']<UPDATE_NOTICE_TTL_MS;}function a217_0x21fd(_0x4874e7,_0x3b903c){_0x4874e7=_0x4874e7-0x112;const _0xcb7ea6=a217_0xcb7e();let _0x21fd17=_0xcb7ea6[_0x4874e7];return _0x21fd17;}export function buildNpmVersionUrl(_0x226ffd){const _0x366739=a217_0x21fd;return _0x366739(0x121)+NPM_PACKAGE_NAME+'/v/'+_0x226ffd;}export async function resolveLatestUpdateNotice(){const _0xdedef=a217_0x21fd;if(isUpdateNoticeDisabled())return null;try{const _0x46539c=Date['now'](),_0x1d621a=getCliVersion(),_0x1924a6=await readUpdateNoticeCache();let _0x2f740d=isFreshCheck(_0x1924a6,_0x46539c)?_0x1924a6[_0xdedef(0x123)]?.[_0xdedef(0x126)]():undefined;if(!_0x2f740d&&!isFreshCheck(_0x1924a6,_0x46539c)){const _0x37edeb=await getCliVersionPolicy();_0x2f740d=_0x37edeb?.['stableVersion']?.[_0xdedef(0x126)]()||undefined,await writeUpdateNoticeCache({..._0x1924a6,'checkedAt':_0x46539c,'latest':_0x2f740d,'failed':!_0x2f740d});}if(!_0x2f740d||!a217_0x14d175[_0xdedef(0x11d)](_0x1d621a)||!a217_0x14d175['valid'](_0x2f740d))return null;if(a217_0x14d175[_0xdedef(0x127)](_0x1d621a,_0x2f740d))return null;if(isRecentlyNotified(_0x1924a6,_0x2f740d,_0x46539c))return null;const _0x431a07=CLI_BIN_NAME+_0xdedef(0x11a);return await writeUpdateNoticeCache({..._0x1924a6,'checkedAt':isFreshCheck(_0x1924a6,_0x46539c)?_0x1924a6[_0xdedef(0x124)]:_0x46539c,'latest':_0x2f740d,'failed':![],'lastNotifiedVersion':_0x2f740d,'lastNotifiedAt':_0x46539c}),{'command':_0x431a07,'current':_0x1d621a,'latest':_0x2f740d,'url':buildNpmVersionUrl(_0x2f740d),'message':CLI_BIN_NAME+'\x20'+_0x2f740d+_0xdedef(0x122)+_0x1d621a+',\x20run:\x20'+_0x431a07};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5701aa,_0x5a88f0){var _0x2b98b5=a218_0x11b4,_0x5f3875=_0x5701aa();while(!![]){try{var _0x56a535=-parseInt(_0x2b98b5(0x1c0))/0x1+-parseInt(_0x2b98b5(0x1bf))/0x2*(-parseInt(_0x2b98b5(0x1b9))/0x3)+parseInt(_0x2b98b5(0x1bd))/0x4+parseInt(_0x2b98b5(0x1bb))/0x5+-parseInt(_0x2b98b5(0x1b8))/0x6+parseInt(_0x2b98b5(0x1be))/0x7*(parseInt(_0x2b98b5(0x1bc))/0x8)+-parseInt(_0x2b98b5(0x1ba))/0x9;if(_0x56a535===_0x5a88f0)break;else _0x5f3875['push'](_0x5f3875['shift']());}catch(_0x39c181){_0x5f3875['push'](_0x5f3875['shift']());}}}(a218_0xcb1d,0xdb3b0));import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}function a218_0x11b4(_0x286fc6,_0x5bca6c){_0x286fc6=_0x286fc6-0x1b8;var _0xcb1df=a218_0xcb1d();var _0x11b446=_0xcb1df[_0x286fc6];return _0x11b446;}function a218_0xcb1d(){var _0x5f4240=['7243368jMfkoV','3nVKUmb','10185021xVulhC','1083765TOAsyz','72IhnDpk','3761300EJdsHZ','1396122OUFlNv','3275274zlUSvX','1352864qNChux'];a218_0xcb1d=function(){return _0x5f4240;};return a218_0xcb1d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xec55a,_0x38026e){var _0x12fbb7=a219_0x32cb,_0x473e17=_0xec55a();while(!![]){try{var _0x2dcc98=parseInt(_0x12fbb7(0x7f))/0x1*(-parseInt(_0x12fbb7(0x7a))/0x2)+parseInt(_0x12fbb7(0x7b))/0x3+parseInt(_0x12fbb7(0x7e))/0x4*(parseInt(_0x12fbb7(0x83))/0x5)+parseInt(_0x12fbb7(0x7d))/0x6*(-parseInt(_0x12fbb7(0x79))/0x7)+parseInt(_0x12fbb7(0x7c))/0x8+-parseInt(_0x12fbb7(0x81))/0x9*(parseInt(_0x12fbb7(0x82))/0xa)+parseInt(_0x12fbb7(0x78))/0xb*(parseInt(_0x12fbb7(0x80))/0xc);if(_0x2dcc98===_0x38026e)break;else _0x473e17['push'](_0x473e17['shift']());}catch(_0x409e25){_0x473e17['push'](_0x473e17['shift']());}}}(a219_0x12f5,0x9bb67));function a219_0x32cb(_0x5cdb88,_0x28a157){_0x5cdb88=_0x5cdb88-0x78;var _0x12f5af=a219_0x12f5();var _0x32cb8a=_0x12f5af[_0x5cdb88];return _0x32cb8a;}import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a219_0x12f5(){var _0x125c2e=['7ClytyW','106312URlYII','873330nVYAud','1794632yvEzlX','3827364SJsxGb','4iBVLPZ','8MrRmtd','204OOhmJS','673407LnuORX','70RIsWkI','4603505rgrlRq','510246mUmdQa'];a219_0x12f5=function(){return _0x125c2e;};return a219_0x12f5();}export async function withActiveCookie(_0x56dbbc,_0x5a1e10){setActiveCookie(_0x56dbbc);try{return await _0x5a1e10();}finally{clearActiveCookie();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a220_0x1c69(_0x3ae165,_0x52eb79){_0x3ae165=_0x3ae165-0xbb;var _0x1bf82e=a220_0x1bf8();var _0x1c69ed=_0x1bf82e[_0x3ae165];return _0x1c69ed;}(function(_0x118330,_0xc991dc){var _0x5d0459=a220_0x1c69,_0x45e1ca=_0x118330();while(!![]){try{var _0x5baa52=-parseInt(_0x5d0459(0xc1))/0x1+-parseInt(_0x5d0459(0xbc))/0x2*(parseInt(_0x5d0459(0xbe))/0x3)+parseInt(_0x5d0459(0xc2))/0x4+-parseInt(_0x5d0459(0xc0))/0x5+-parseInt(_0x5d0459(0xc3))/0x6+-parseInt(_0x5d0459(0xbb))/0x7+parseInt(_0x5d0459(0xbf))/0x8;if(_0x5baa52===_0xc991dc)break;else _0x45e1ca['push'](_0x45e1ca['shift']());}catch(_0x24c8de){_0x45e1ca['push'](_0x45e1ca['shift']());}}}(a220_0x1bf8,0xdb8b9));function a220_0x1bf8(){var _0x5c737d=['3372870ZdpQzV','172704yUsDED','2791420XsPxtr','3196752vxhmnI','4187337TUbIbj','63374aUwWpW','write','21oxlmwO','19211776ZJhrgG'];a220_0x1bf8=function(){return _0x5c737d;};return a220_0x1bf8();}export function writeCliSideChannelLine(_0x1203e2){var _0x360248=a220_0x1c69;process['stderr'][_0x360248(0xbd)](_0x1203e2+'\x0a');}
|