@lovrabet/rabetbase-cli 2.5.2-beta.7 → 2.5.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +2 -1
- package/lib/api/generate-sdk-config-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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.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-restore.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/dataset/user-deleted-field-list.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/table-diff-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/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.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/search.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/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/domain-routing-sync.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/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/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.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/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.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/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.d.ts +23 -0
- package/lib/config/region-config.js +1 -0
- package/lib/config/schema.d.ts +15 -0
- 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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +6 -0
- 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.d.ts +13 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- 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/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.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/page/lr-smart-jsx.d.ts +6 -0
- package/lib/core/page/lr-smart-jsx.js +1 -0
- 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/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.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/types/index.d.ts +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.d.ts +2 -8
- package/lib/utils/config.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/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +2 -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/skills/rabetbase/SKILL.md +6 -5
- package/skills/rabetbase/guides/page-development-workflow.md +3 -0
- package/skills/rabetbase/guides/sdk-client-generation.md +5 -5
- package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
- package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
- package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
- package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-pull.md +2 -0
- package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
- package/skills/rabetbase/references/rabetbase-config.md +10 -9
- package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
- package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/generate-api/client.ts.tpl +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b4f82,_0x4df1ae){const _0x36c3ec=a306_0x3de6,_0x32ab83=_0x2b4f82();while(!![]){try{const _0x3948d7=-parseInt(_0x36c3ec(0x1f9))/0x1+parseInt(_0x36c3ec(0x1f8))/0x2+-parseInt(_0x36c3ec(0x1f4))/0x3*(parseInt(_0x36c3ec(0x1f7))/0x4)+parseInt(_0x36c3ec(0x1fc))/0x5*(parseInt(_0x36c3ec(0x1f5))/0x6)+-parseInt(_0x36c3ec(0x1fa))/0x7+parseInt(_0x36c3ec(0x1f6))/0x8*(-parseInt(_0x36c3ec(0x1fb))/0x9)+parseInt(_0x36c3ec(0x1f3))/0xa;if(_0x3948d7===_0x4df1ae)break;else _0x32ab83['push'](_0x32ab83['shift']());}catch(_0x4f97d1){_0x32ab83['push'](_0x32ab83['shift']());}}}(a306_0x1e55,0x68ba0));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a306_0x3de6(_0x36aba7,_0x267fb9){_0x36aba7=_0x36aba7-0x1f3;const _0x1e5598=a306_0x1e55();let _0x3de62e=_0x1e5598[_0x36aba7];return _0x3de62e;}import{CliErrors}from'../errors.js';function a306_0x1e55(){const _0x4b32df=['5139421qffDUt','19827abbNte','405uMfWoo','13859300KNOqKU','1773747XpSFSB','16134CxQiMB','1192pShrfb','4jWhHpy','1433400MGlSDt','237780whoOhs'];a306_0x1e55=function(){return _0x4b32df;};return a306_0x1e55();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a307_0x29d9(){const _0x28880f=['/config.json','824292vywyYe','2dbuLfw','now','14009220WvalFk','10gnIKqW','270zUwgGK','6052320jqEfgC','1123178ojNihV','json','2185212etsaDW','/config/index.json','78552SzOFoX','node','application/json','6891850LvLsjA'];a307_0x29d9=function(){return _0x28880f;};return a307_0x29d9();}(function(_0x2417b7,_0x361f8d){const _0x9c32d1=a307_0x41ea,_0x1229f0=_0x2417b7();while(!![]){try{const _0x2a1516=parseInt(_0x9c32d1(0x1b1))/0x1*(-parseInt(_0x9c32d1(0x1bb))/0x2)+-parseInt(_0x9c32d1(0x1ba))/0x3+parseInt(_0x9c32d1(0x1b3))/0x4*(parseInt(_0x9c32d1(0x1be))/0x5)+parseInt(_0x9c32d1(0x1b0))/0x6+parseInt(_0x9c32d1(0x1b8))/0x7+-parseInt(_0x9c32d1(0x1b5))/0x8*(-parseInt(_0x9c32d1(0x1af))/0x9)+-parseInt(_0x9c32d1(0x1bd))/0xa;if(_0x2a1516===_0x361f8d)break;else _0x1229f0['push'](_0x1229f0['shift']());}catch(_0x5ab591){_0x1229f0['push'](_0x1229f0['shift']());}}}(a307_0x29d9,0x8dfce));import{getTemplateBaseUrl}from'../utils/config.js';export async function fetchCdnConfig(){const _0x405eda=a307_0x41ea,_0x21e242=getTemplateBaseUrl(),_0x591557=[_0x21e242+_0x405eda(0x1b9),_0x21e242+_0x405eda(0x1b4)];for(const _0x14a291 of _0x591557){try{const _0x55f16f=await fetch(_0x14a291,{'headers':{'Accept':_0x405eda(0x1b7)}});if(!_0x55f16f['ok'])continue;const _0x238aa5=await _0x55f16f[_0x405eda(0x1b2)]();if(!_0x238aa5['cli']?.['stableVersion']||!_0x238aa5['sdk']?.[_0x405eda(0x1b6)]?.['stableVersion'])continue;return _0x238aa5;}catch{}}return null;}function a307_0x41ea(_0x1de22e,_0x136a25){_0x1de22e=_0x1de22e-0x1af;const _0x29d972=a307_0x29d9();let _0x41eae8=_0x29d972[_0x1de22e];return _0x41eae8;}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL=0x3c*0x3e8;let hasCachedConfig=![];export async function getCdnConfig(){const _0x1c6b04=a307_0x41ea,_0x315b04=Date[_0x1c6b04(0x1bc)]();if(hasCachedConfig){const _0x2f11f7=cachedConfig?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x315b04-cacheTime<_0x2f11f7)return cachedConfig;}const _0x34e004=await fetchCdnConfig();return cachedConfig=_0x34e004,cacheTime=_0x315b04,hasCachedConfig=!![],_0x34e004;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0,hasCachedConfig=![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a308_0x5748c3=a308_0x38fa;(function(_0x14b6ac,_0xcf8f40){const _0x89ca11=a308_0x38fa,_0x53750e=_0x14b6ac();while(!![]){try{const _0x4e72b1=parseInt(_0x89ca11(0x152))/0x1*(-parseInt(_0x89ca11(0x145))/0x2)+-parseInt(_0x89ca11(0x146))/0x3+-parseInt(_0x89ca11(0x148))/0x4*(-parseInt(_0x89ca11(0x149))/0x5)+-parseInt(_0x89ca11(0x14a))/0x6*(-parseInt(_0x89ca11(0x150))/0x7)+-parseInt(_0x89ca11(0x143))/0x8+parseInt(_0x89ca11(0x14e))/0x9+parseInt(_0x89ca11(0x13e))/0xa*(-parseInt(_0x89ca11(0x154))/0xb);if(_0x4e72b1===_0xcf8f40)break;else _0x53750e['push'](_0x53750e['shift']());}catch(_0xf75a7f){_0x53750e['push'](_0x53750e['shift']());}}}(a308_0xe270,0x2b08d));import a308_0x5380d5 from'node:fs';import a308_0x50d77c from'node:path';import a308_0x4f00b7 from'semver';import{getCdnConfig}from'../utils/cdn-config.js';function a308_0x38fa(_0x38ca45,_0x5fdcaa){_0x38ca45=_0x38ca45-0x134;const _0xe2705c=a308_0xe270();let _0x38faeb=_0xe2705c[_0x38ca45];return _0x38faeb;}const FALLBACK_MIN_SDK_VERSION=a308_0x5748c3(0x155);function isNonNumericVersion(_0x461016){const _0x1da8c8=a308_0x5748c3,_0x5e5540=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x5e5540[_0x1da8c8(0x14d)](_0x5df2ae=>_0x5df2ae[_0x1da8c8(0x138)](_0x461016));}function getInstalledVersion(_0xd40069,_0x5c8f3a){const _0x2fb9b7=a308_0x5748c3;try{const _0xbb20aa=a308_0x50d77c[_0x2fb9b7(0x157)](_0xd40069,_0x2fb9b7(0x158),_0x5c8f3a,_0x2fb9b7(0x14b));if(a308_0x5380d5[_0x2fb9b7(0x137)](_0xbb20aa)){const _0x848d67=JSON['parse'](a308_0x5380d5[_0x2fb9b7(0x135)](_0xbb20aa,'utf-8'));return _0x848d67[_0x2fb9b7(0x144)]||null;}}catch{}return null;}function a308_0xe270(){const _0x198bdc=['coerce','314112ZbxLSo','version','10SBfQVr','743379yfEtoZ','\x1b[0m','436gqfelD','11255TjeNER','17124qfEHzG','package.json','\x1b[33m','some','2654208SvXuCi','utf8','707BXUfXe','log','13183ifhHlB','\x20\x20\x20Upgrade\x20command:\x20','44XjraQK','1.2.0','needsUpgrade','join','node_modules','parse','packageName','devDependencies','\x1b[1m','readFileSync','all','existsSync','test','npm\x20install\x20','@lovrabet/sdk','node','\x20\x20\x20Stable\x20version:\x20','minVersion','748210cEOHup','stableVersion','dependencies','sdk'];a308_0xe270=function(){return _0x198bdc;};return a308_0xe270();}async function getSdkStableVersion(){const _0x5e450c=a308_0x5748c3;try{const _0x332ae0=await getCdnConfig();return _0x332ae0?.[_0x5e450c(0x141)]?.['node']?.[_0x5e450c(0x13f)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x52d405=a308_0x5748c3;try{const _0x1f6752=await getCdnConfig();return _0x1f6752?.[_0x52d405(0x141)]?.[_0x52d405(0x13b)]?.[_0x52d405(0x15a)]||'@lovrabet/sdk';}catch{return _0x52d405(0x13a);}}export async function checkSdkVersion(_0x404627){const _0x13fbe4=a308_0x5748c3,_0x4e63c0=a308_0x50d77c[_0x13fbe4(0x157)](_0x404627,_0x13fbe4(0x14b)),[_0x24847f,_0x1f28fd]=await Promise[_0x13fbe4(0x136)]([getSdkStableVersion(),getSdkPackageName()]),_0x23c101=_0x24847f||FALLBACK_MIN_SDK_VERSION;if(!a308_0x5380d5[_0x13fbe4(0x137)](_0x4e63c0))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x23c101,'packageName':_0x1f28fd,'stableVersion':_0x24847f};try{const _0x351dd6=JSON['parse'](a308_0x5380d5[_0x13fbe4(0x135)](_0x4e63c0,_0x13fbe4(0x14f))),_0x5f5208=_0x351dd6[_0x13fbe4(0x140)]||{},_0x86496c=_0x351dd6[_0x13fbe4(0x15b)]||{},_0xd0aca4=_0x5f5208[_0x1f28fd]||_0x86496c[_0x1f28fd];if(!_0xd0aca4)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x23c101,'packageName':_0x1f28fd,'stableVersion':_0x24847f};let _0x29e1b3=getInstalledVersion(_0x404627,_0x1f28fd);!_0x29e1b3&&(_0x29e1b3=_0xd0aca4);if(isNonNumericVersion(_0xd0aca4))return{'installed':!![],'version':_0x29e1b3,'needsUpgrade':![],'minVersion':_0x23c101,'packageName':_0x1f28fd,'stableVersion':_0x24847f};const _0x4404b0=a308_0x4f00b7[_0x13fbe4(0x142)](_0x29e1b3),_0x20e4bd=a308_0x4f00b7[_0x13fbe4(0x142)](_0x23c101),_0x34361b=_0x4404b0&&_0x20e4bd?a308_0x4f00b7['lt'](_0x4404b0,_0x20e4bd):![];return{'installed':!![],'version':_0x29e1b3,'needsUpgrade':_0x34361b,'minVersion':_0x23c101,'packageName':_0x1f28fd,'stableVersion':_0x24847f};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x23c101,'packageName':_0x1f28fd,'stableVersion':_0x24847f};}}export function checkSdkVersionSync(_0x48f501){const _0x3ec9a8=a308_0x5748c3,_0x2c8891=a308_0x50d77c[_0x3ec9a8(0x157)](_0x48f501,_0x3ec9a8(0x14b)),_0x395320='@lovrabet/sdk';if(!a308_0x5380d5['existsSync'](_0x2c8891))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x395320,'stableVersion':null};try{const _0x1d8059=JSON[_0x3ec9a8(0x159)](a308_0x5380d5[_0x3ec9a8(0x135)](_0x2c8891,_0x3ec9a8(0x14f))),_0x4227cf=_0x1d8059[_0x3ec9a8(0x140)]||{},_0x1ec00f=_0x1d8059['devDependencies']||{},_0x2318b1=_0x4227cf[_0x395320]||_0x1ec00f[_0x395320];if(!_0x2318b1)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x395320,'stableVersion':null};let _0x12c2dc=getInstalledVersion(_0x48f501,_0x395320);!_0x12c2dc&&(_0x12c2dc=_0x2318b1);if(isNonNumericVersion(_0x2318b1))return{'installed':!![],'version':_0x12c2dc,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x395320,'stableVersion':null};const _0x114ec4=a308_0x4f00b7['coerce'](_0x12c2dc),_0x4fddd9=_0x114ec4?a308_0x4f00b7['lt'](_0x114ec4,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x12c2dc,'needsUpgrade':_0x4fddd9,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x395320,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x395320,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x5f4282){const _0x36e368=a308_0x5748c3;if(!_0x5f4282[_0x36e368(0x156)])return;const _0x37a08a=_0x36e368(0x14c),_0x126136=_0x36e368(0x147),_0x425d3e=_0x36e368(0x134),_0x3b120c=_0x5f4282[_0x36e368(0x15a)]||_0x36e368(0x13a),_0xfcb66f=_0x5f4282[_0x36e368(0x13f)]||_0x5f4282[_0x36e368(0x13d)],_0x467a0c=_0x36e368(0x139)+_0x3b120c+'@'+(_0xfcb66f||'latest');console['log'](),console[_0x36e368(0x151)](''+_0x37a08a+_0x425d3e+'↪\x20SDK\x20update\x20available'+_0x126136),console['log'](_0x37a08a+'\x20\x20\x20Current\x20version:\x20'+_0x3b120c+'@'+_0x5f4282[_0x36e368(0x144)]+_0x126136),console[_0x36e368(0x151)](_0x37a08a+_0x36e368(0x13c)+_0xfcb66f+_0x126136),console['log'](_0x37a08a+_0x36e368(0x153)+_0x467a0c+_0x126136),console['log']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a309_0x2044(_0xde91d5,_0x2b4d55){_0xde91d5=_0xde91d5-0x1ed;const _0x38982f=a309_0x3898();let _0x2044a3=_0x38982f[_0xde91d5];return _0x2044a3;}(function(_0x557df,_0xcc7392){const _0x1c4708=a309_0x2044,_0x4c1698=_0x557df();while(!![]){try{const _0x5b246c=parseInt(_0x1c4708(0x1fe))/0x1+parseInt(_0x1c4708(0x1f1))/0x2*(parseInt(_0x1c4708(0x20f))/0x3)+-parseInt(_0x1c4708(0x1fc))/0x4*(-parseInt(_0x1c4708(0x1ee))/0x5)+parseInt(_0x1c4708(0x1ef))/0x6*(-parseInt(_0x1c4708(0x1f9))/0x7)+-parseInt(_0x1c4708(0x1f0))/0x8*(parseInt(_0x1c4708(0x206))/0x9)+-parseInt(_0x1c4708(0x1f6))/0xa+-parseInt(_0x1c4708(0x1f2))/0xb;if(_0x5b246c===_0xcc7392)break;else _0x4c1698['push'](_0x4c1698['shift']());}catch(_0x1bd232){_0x4c1698['push'](_0x4c1698['shift']());}}}(a309_0x3898,0xcec11));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';function a309_0x3898(){const _0x21a8a7=['1224GsKJMB','belowMinimum','737031gvmWmk','currentVersion','../..','Upgrade\x20command:\x20','latest','log','version','\x20\x20\x20Current\x20CLI\x20version:\x20','18nngLHp','minimumVersionMessage','Current\x20CLI\x20version\x20is\x20below\x20the\x20service\x20compatibility\x20support\x20line.','\x1b[1m','minimumVersion','stableVersion','npm\x20install\x20-g\x20','\x20\x20\x20Stable\x20version:\x20','validation','123NPieXX','utf-8','Minimum\x20supported:\x20','\x1b[33m','coerce','↪\x20New\x20version\x20available','filter','↪\x20Critical\x20CLI\x20upgrade\x20required','package.json','\x1b[0m','\x20\x20\x20','25735vVsKLM','18gRygbv','1596584XAfFIY','45394PYHbzq','14674033MXZspH','parse','upgradeMessage','needsUpgrade','5381900zWeifT','\x20\x20\x20Recommended\x20stable:\x20','1.0.0','290234UzlXai','\x20\x20\x20Minimum\x20supported:\x20','Current\x20version:\x20'];a309_0x3898=function(){return _0x21a8a7;};return a309_0x3898();}import a309_0x576376 from'semver';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{CliErrors}from'../errors.js';export function getCliUpgradeCommand(_0x4437ff){const _0x209e05=a309_0x2044,_0x56550f=_0x4437ff[_0x209e05(0x20b)]||_0x209e05(0x202);return _0x209e05(0x20c)+NPM_PACKAGE_NAME+'@'+_0x56550f;}function getCurrentCliVersion(){const _0x53888d=a309_0x2044;try{const _0x2eb159=fileURLToPath(import.meta.url),_0x133125=resolve(dirname(_0x2eb159),_0x53888d(0x200)),_0x41e087=resolve(_0x133125,_0x53888d(0x217)),_0x2b0d9a=JSON[_0x53888d(0x1f3)](readFileSync(_0x41e087,_0x53888d(0x210)));return _0x2b0d9a[_0x53888d(0x204)]||_0x53888d(0x1f8);}catch{return _0x53888d(0x1f8);}}export async function checkCliVersion(){const _0x4309bb=a309_0x2044,_0x510c70=getCurrentCliVersion(),_0x706df3=await getCliVersionPolicy(),_0x44af7f=_0x706df3?.['stableVersion']||null,_0x7f378f=_0x706df3?.[_0x4309bb(0x20a)]||null;let _0x5898f8=![],_0x18617f=![];const _0x1a72c8=a309_0x576376[_0x4309bb(0x213)](_0x510c70);if(_0x1a72c8&&_0x44af7f)try{const _0x5d89fe=a309_0x576376[_0x4309bb(0x213)](_0x44af7f);if(_0x5d89fe)_0x5898f8=a309_0x576376['lt'](_0x1a72c8,_0x5d89fe);}catch{}if(_0x1a72c8&&_0x7f378f)try{const _0x84ce8f=a309_0x576376[_0x4309bb(0x213)](_0x7f378f);if(_0x84ce8f)_0x18617f=a309_0x576376['lt'](_0x1a72c8,_0x84ce8f);}catch{}return _0x18617f&&(_0x5898f8=!![]),{'currentVersion':_0x510c70,'stableVersion':_0x44af7f,'minimumVersion':_0x7f378f,'needsUpgrade':_0x5898f8,'belowMinimum':_0x18617f,'isPreRelease':![],'upgradeMessage':_0x706df3?.[_0x4309bb(0x1f4)],'minimumVersionMessage':_0x706df3?.[_0x4309bb(0x207)]};}export function printCliUpgradeWarning(_0x41a706){const _0x4e8a92=a309_0x2044;if(!_0x41a706[_0x4e8a92(0x1f5)]&&!_0x41a706[_0x4e8a92(0x1fd)])return;const _0x34085c='\x1b[31m',_0x18fdfd=_0x4e8a92(0x212),_0x4efe4a=_0x4e8a92(0x218),_0x1fd835=_0x4e8a92(0x209),_0x3ee099=getCliUpgradeCommand(_0x41a706);console[_0x4e8a92(0x203)](),_0x41a706[_0x4e8a92(0x1fd)]?(console[_0x4e8a92(0x203)](''+_0x34085c+_0x1fd835+_0x4e8a92(0x216)+_0x4efe4a),console[_0x4e8a92(0x203)](_0x34085c+'\x20\x20\x20Current\x20CLI\x20version:\x20'+_0x41a706['currentVersion']+_0x4efe4a),_0x41a706[_0x4e8a92(0x20a)]&&console[_0x4e8a92(0x203)](_0x34085c+_0x4e8a92(0x1fa)+_0x41a706['minimumVersion']+_0x4efe4a),_0x41a706[_0x4e8a92(0x20b)]&&_0x41a706['stableVersion']!==_0x41a706['minimumVersion']&&console[_0x4e8a92(0x203)](_0x34085c+_0x4e8a92(0x1f7)+_0x41a706['stableVersion']+_0x4efe4a),_0x41a706[_0x4e8a92(0x207)]&&console[_0x4e8a92(0x203)](_0x34085c+_0x4e8a92(0x1ed)+_0x41a706[_0x4e8a92(0x207)]+_0x4efe4a),console[_0x4e8a92(0x203)](_0x34085c+'\x20\x20\x20Upgrade\x20command:\x20'+_0x3ee099+_0x4efe4a)):(console[_0x4e8a92(0x203)](''+_0x18fdfd+_0x1fd835+_0x4e8a92(0x214)+_0x4efe4a),console[_0x4e8a92(0x203)](_0x18fdfd+_0x4e8a92(0x205)+_0x41a706['currentVersion']+_0x4efe4a),console[_0x4e8a92(0x203)](_0x18fdfd+_0x4e8a92(0x20d)+_0x41a706[_0x4e8a92(0x20b)]+_0x4efe4a),_0x41a706[_0x4e8a92(0x1f4)]&&console[_0x4e8a92(0x203)](_0x18fdfd+_0x4e8a92(0x1ed)+_0x41a706[_0x4e8a92(0x1f4)]+_0x4efe4a),console[_0x4e8a92(0x203)](_0x18fdfd+'\x20\x20\x20Upgrade\x20command:\x20'+_0x3ee099+_0x4efe4a)),console[_0x4e8a92(0x203)]();}export function assertCliVersionSupported(_0x27659c){const _0x17618a=a309_0x2044;if(!_0x27659c[_0x17618a(0x1fd)])return;const _0x485013=[_0x27659c['minimumVersionMessage'],_0x17618a(0x1fb)+_0x27659c[_0x17618a(0x1ff)],_0x27659c[_0x17618a(0x20a)]?_0x17618a(0x211)+_0x27659c[_0x17618a(0x20a)]:null,_0x17618a(0x201)+getCliUpgradeCommand(_0x27659c)][_0x17618a(0x215)](Boolean)['join']('\x0a');throw CliErrors[_0x17618a(0x20e)](_0x17618a(0x208),_0x485013);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59d6e1,_0x41fb85){const _0x1984f1=a310_0xa7a1,_0x33dadd=_0x59d6e1();while(!![]){try{const _0x3161d7=parseInt(_0x1984f1(0x13c))/0x1+parseInt(_0x1984f1(0x137))/0x2*(parseInt(_0x1984f1(0x12e))/0x3)+-parseInt(_0x1984f1(0x13f))/0x4*(-parseInt(_0x1984f1(0x12f))/0x5)+parseInt(_0x1984f1(0x139))/0x6*(-parseInt(_0x1984f1(0x13b))/0x7)+-parseInt(_0x1984f1(0x135))/0x8+parseInt(_0x1984f1(0x130))/0x9*(parseInt(_0x1984f1(0x131))/0xa)+parseInt(_0x1984f1(0x134))/0xb*(-parseInt(_0x1984f1(0x13d))/0xc);if(_0x3161d7===_0x41fb85)break;else _0x33dadd['push'](_0x33dadd['shift']());}catch(_0x36824c){_0x33dadd['push'](_0x33dadd['shift']());}}}(a310_0xbdd8,0x5b75d));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(_0xebba04){const _0x2ed2be=a310_0xa7a1;return typeof _0xebba04===_0x2ed2be(0x141)&&_0xebba04[_0x2ed2be(0x136)]()['length']>0x0?_0xebba04['trim']():null;}function a310_0xa7a1(_0x3ed0fb,_0x141d41){_0x3ed0fb=_0x3ed0fb-0x12d;const _0xbdd8a8=a310_0xbdd8();let _0xa7a1b2=_0xbdd8a8[_0x3ed0fb];return _0xa7a1b2;}function normalizeCliVersionPolicy(_0x140ece){const _0x25a00b=a310_0xa7a1;if(!_0x140ece||typeof _0x140ece!==_0x25a00b(0x132))return null;const _0x5e558b=_0x140ece,_0xcf7bf1=_0x5e558b[_0x25a00b(0x133)]&&typeof _0x5e558b[_0x25a00b(0x133)]===_0x25a00b(0x132)?_0x5e558b[_0x25a00b(0x133)]:_0x5e558b,_0x251b53=pickString(_0xcf7bf1[_0x25a00b(0x138)])||pickString(_0xcf7bf1['latestVersion'])||pickString(_0xcf7bf1['recommendedVersion']),_0x43bbd8=pickString(_0xcf7bf1[_0x25a00b(0x13a)])||pickString(_0xcf7bf1[_0x25a00b(0x140)]);if(!_0x251b53&&!_0x43bbd8)return null;return{'stableVersion':_0x251b53,'minimumVersion':_0x43bbd8,'upgradeMessage':pickString(_0xcf7bf1[_0x25a00b(0x13e)])||undefined,'minimumVersionMessage':pickString(_0xcf7bf1['minimumVersionMessage'])||undefined};}export async function fetchRabetbaseCdnConfig(){const _0x5d3bcd=a310_0xa7a1,_0x2126f5=new AbortController(),_0x285841=setTimeout(()=>_0x2126f5['abort'](),FETCH_TIMEOUT_MS);try{const _0x492310=await fetch(CLI_VERSION_POLICY_URL,{'headers':{'Accept':'application/json'},'signal':_0x2126f5[_0x5d3bcd(0x12d)]});if(!_0x492310['ok'])return null;const _0x3512d9=await _0x492310['json']();return _0x3512d9&&typeof _0x3512d9==='object'?_0x3512d9:null;}catch{return null;}finally{clearTimeout(_0x285841);}}function a310_0xbdd8(){const _0x32d998=['object','cli','25157sTRvMV','4387152kvefur','trim','2024QhHnel','stableVersion','2817048FVqGaa','minimumVersion','7XPAeAN','57462ePxlgd','2568rjJtoQ','upgradeMessage','4BYaEAr','minVersion','string','signal','1914eslOAq','3394145NtRXRU','18ttPIua','2499970lTUrud'];a310_0xbdd8=function(){return _0x32d998;};return a310_0xbdd8();}export async function fetchCliVersionPolicy(){return normalizeCliVersionPolicy(await fetchRabetbaseCdnConfig());}let cachedConfig=null,cacheTime=0x0,hasCachedConfig=![];export async function getRabetbaseCdnConfig(){const _0x508c6f=Date['now']();if(hasCachedConfig){const _0x3c2e45=cachedConfig?CACHE_TTL:FAILURE_CACHE_TTL;if(_0x508c6f-cacheTime<_0x3c2e45)return cachedConfig;}return cachedConfig=await fetchRabetbaseCdnConfig(),cacheTime=_0x508c6f,hasCachedConfig=!![],cachedConfig;}export async function getCliVersionPolicy(){return normalizeCliVersionPolicy(await getRabetbaseCdnConfig());}export function clearCliVersionPolicyCache(){cachedConfig=null,cacheTime=0x0,hasCachedConfig=![];}
|
package/lib/utils/config.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* 所有配置文件读写的底层实现统一在 context.ts 中。
|
|
5
5
|
* 本模块保留历史导出接口,供旧命令使用。
|
|
6
6
|
*/
|
|
7
|
+
import { type MultiAppConfig } from "../context.js";
|
|
7
8
|
export { getProjectConfigPath, getGlobalConfigPath } from "../context.js";
|
|
8
9
|
export { isInProject } from "../context.js";
|
|
9
10
|
export declare function readConfig(projectRoot?: string): Record<string, any> & {
|
|
@@ -13,14 +14,7 @@ export declare function readConfig(projectRoot?: string): Record<string, any> &
|
|
|
13
14
|
template_base_url?: string;
|
|
14
15
|
locale?: string;
|
|
15
16
|
};
|
|
16
|
-
export
|
|
17
|
-
name: string;
|
|
18
|
-
appcode: string;
|
|
19
|
-
isDefault: boolean;
|
|
20
|
-
env?: string;
|
|
21
|
-
apiDir?: string;
|
|
22
|
-
cookie?: string;
|
|
23
|
-
}
|
|
17
|
+
export type { MultiAppConfig } from "../context.js";
|
|
24
18
|
/**
|
|
25
19
|
* 获取配置的 AppCode
|
|
26
20
|
* 优先级:多应用 defaultApp > 项目 appcode > 项目 app > 全局 appcode > 全局 app
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a311_0x499c63=a311_0xd392;(function(_0x46530a,_0x528017){const _0x332864=a311_0xd392,_0x3aef18=_0x46530a();while(!![]){try{const _0x2cb09d=parseInt(_0x332864(0xf0))/0x1+parseInt(_0x332864(0xef))/0x2+-parseInt(_0x332864(0xf5))/0x3*(parseInt(_0x332864(0xf4))/0x4)+-parseInt(_0x332864(0xec))/0x5+parseInt(_0x332864(0xf3))/0x6*(-parseInt(_0x332864(0xeb))/0x7)+parseInt(_0x332864(0xee))/0x8+-parseInt(_0x332864(0xf1))/0x9*(-parseInt(_0x332864(0xea))/0xa);if(_0x2cb09d===_0x528017)break;else _0x3aef18['push'](_0x3aef18['shift']());}catch(_0x48a150){_0x3aef18['push'](_0x3aef18['shift']());}}}(a311_0x5ef4,0xb55f8));import{initEnv}from'../constant/env.js';function a311_0x5ef4(){const _0x33ab65=['env','1949336XvtnKR','548240nuRrIl','814915dXQTCB','45YeWgKg','string','1011804zlTqjp','12396cJXMxH','435XNEeGt','project','2776420jgeOHJ','7UJBAoF','6800095ahKHwW'];a311_0x5ef4=function(){return _0x33ab65;};return a311_0x5ef4();}import{readRawConfig,getConfigAppCode as a311_0x51ca35,getMultiAppConfigs as a311_0x4ff607,getTemplateBaseUrl as a311_0x30e844}from'../context.js';export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';function a311_0xd392(_0x38b90f,_0x41595a){_0x38b90f=_0x38b90f-0xea;const _0x5ef4b1=a311_0x5ef4();let _0xd392ff=_0x5ef4b1[_0x38b90f];return _0xd392ff;}export{isInProject}from'../context.js';export function readConfig(_0x17b66e){const _0x1cc422=a311_0xd392,_0x50dbfd=readRawConfig(_0x17b66e);return _0x50dbfd[_0x1cc422(0xed)]&&typeof _0x50dbfd[_0x1cc422(0xed)]===_0x1cc422(0xf2)&&initEnv(_0x50dbfd['env']),_0x50dbfd;}export function getConfigAppCode(){return a311_0x51ca35();}export function getMultiAppConfigs(_0x59302e=a311_0x499c63(0xf6)){return a311_0x4ff607(_0x59302e);}export function getTemplateBaseUrl(){return a311_0x30e844();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a312_0xed85(){const _0x499bf1=['37548hdRhZk','1039635iCyBGQ','282808IynJGv','273YNLEpG','object','number','trim','574626atkmkK','403208PQtPrN','isFinite','8FflqQC','420333ZXrTLp','string','11976Czirwi'];a312_0xed85=function(){return _0x499bf1;};return a312_0xed85();}(function(_0x2d4681,_0x40745d){const _0x1d277b=a312_0x4edc,_0x2f8454=_0x2d4681();while(!![]){try{const _0x1dd12e=-parseInt(_0x1d277b(0x18d))/0x1+parseInt(_0x1d277b(0x185))/0x2+-parseInt(_0x1d277b(0x188))/0x3*(-parseInt(_0x1d277b(0x187))/0x4)+-parseInt(_0x1d277b(0x18c))/0x5+parseInt(_0x1d277b(0x184))/0x6+parseInt(_0x1d277b(0x18e))/0x7*(parseInt(_0x1d277b(0x18a))/0x8)+parseInt(_0x1d277b(0x18b))/0x9;if(_0x1dd12e===_0x40745d)break;else _0x2f8454['push'](_0x2f8454['shift']());}catch(_0x578503){_0x2f8454['push'](_0x2f8454['shift']());}}}(a312_0xed85,0x247a9));function toFiniteNumber(_0x31a43a){const _0x2e7eef=a312_0x4edc;if(typeof _0x31a43a===_0x2e7eef(0x190)&&Number[_0x2e7eef(0x186)](_0x31a43a))return _0x31a43a;if(typeof _0x31a43a===_0x2e7eef(0x189)){const _0x1a6dc0=_0x31a43a[_0x2e7eef(0x183)]();if(!_0x1a6dc0)return undefined;const _0x1230a9=Number(_0x1a6dc0);if(Number['isFinite'](_0x1230a9))return _0x1230a9;}return undefined;}function a312_0x4edc(_0x59d712,_0x2bf77c){_0x59d712=_0x59d712-0x183;const _0xed8514=a312_0xed85();let _0x4edc71=_0xed8514[_0x59d712];return _0x4edc71;}export function normalizeEntityWithIdResponse(_0x4007b9){const _0x528bd3=a312_0x4edc,_0x13ace8=toFiniteNumber(_0x4007b9);if(_0x13ace8!==undefined)return{'id':_0x13ace8,'entity':{'id':_0x13ace8}};if(!_0x4007b9||typeof _0x4007b9!==_0x528bd3(0x18f))return{'id':undefined,'entity':{}};const _0x283fe2={..._0x4007b9},_0x567e27=toFiniteNumber(_0x283fe2['id']);return _0x567e27!==undefined&&(_0x283fe2['id']=_0x567e27),{'id':_0x567e27,'entity':_0x283fe2};}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a313_0x5d9c(){const _0xf354cd=['69772aTfmbm','17796JreADO','4619028TJkofz','isDirectory','470gaIxqM','178154VkgrAV','3108320QNsaCC','4419iMpFiL','3632HJHWVh','3zPchOG','9VBkWOZ','437353TkCwwV','11GBNuVy'];a313_0x5d9c=function(){return _0xf354cd;};return a313_0x5d9c();}(function(_0x402631,_0x1b9c2a){const _0x2b650f=a313_0x7dd5,_0x1890b6=_0x402631();while(!![]){try{const _0xad7dbd=-parseInt(_0x2b650f(0x1e8))/0x1*(parseInt(_0x2b650f(0x1e4))/0x2)+parseInt(_0x2b650f(0x1e9))/0x3*(-parseInt(_0x2b650f(0x1ec))/0x4)+-parseInt(_0x2b650f(0x1e3))/0x5*(-parseInt(_0x2b650f(0x1ed))/0x6)+parseInt(_0x2b650f(0x1ea))/0x7+parseInt(_0x2b650f(0x1e7))/0x8*(parseInt(_0x2b650f(0x1e6))/0x9)+-parseInt(_0x2b650f(0x1e5))/0xa*(-parseInt(_0x2b650f(0x1eb))/0xb)+-parseInt(_0x2b650f(0x1ee))/0xc;if(_0xad7dbd===_0x1b9c2a)break;else _0x1890b6['push'](_0x1890b6['shift']());}catch(_0xb950dd){_0x1890b6['push'](_0x1890b6['shift']());}}}(a313_0x5d9c,0x29a36));function a313_0x7dd5(_0x38b32a,_0x407744){_0x38b32a=_0x38b32a-0x1e2;const _0x5d9c07=a313_0x5d9c();let _0x7dd577=_0x5d9c07[_0x38b32a];return _0x7dd577;}import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x2617b3,_0x6474a0){const _0x557fac=a313_0x7dd5,_0xbf6195=statSync(_0x2617b3);if(_0xbf6195[_0x557fac(0x1e2)]()){!existsSync(_0x6474a0)&&mkdirSync(_0x6474a0,{'recursive':!![]});const _0x3d3f62=readdirSync(_0x2617b3);for(const _0x482c18 of _0x3d3f62){await copyDir(join(_0x2617b3,_0x482c18),join(_0x6474a0,_0x482c18));}}else copyFileSync(_0x2617b3,_0x6474a0);}export function ensureDir(_0x49c790){!existsSync(_0x49c790)&&mkdirSync(_0x49c790,{'recursive':!![]});}export function pathExists(_0x40d86a){return existsSync(_0x40d86a);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a314_0x50f1(_0x3fe418,_0x27088c){_0x3fe418=_0x3fe418-0x16f;const _0x1e2906=a314_0x1e29();let _0x50f149=_0x1e2906[_0x3fe418];return _0x50f149;}const a314_0x741183=a314_0x50f1;(function(_0x589b23,_0xe8211f){const _0x221ee2=a314_0x50f1,_0x2ad510=_0x589b23();while(!![]){try{const _0x3267cd=-parseInt(_0x221ee2(0x173))/0x1+-parseInt(_0x221ee2(0x18a))/0x2+-parseInt(_0x221ee2(0x177))/0x3+-parseInt(_0x221ee2(0x171))/0x4+-parseInt(_0x221ee2(0x172))/0x5*(parseInt(_0x221ee2(0x190))/0x6)+-parseInt(_0x221ee2(0x179))/0x7*(parseInt(_0x221ee2(0x18d))/0x8)+-parseInt(_0x221ee2(0x180))/0x9*(-parseInt(_0x221ee2(0x178))/0xa);if(_0x3267cd===_0xe8211f)break;else _0x2ad510['push'](_0x2ad510['shift']());}catch(_0x36093f){_0x2ad510['push'](_0x2ad510['shift']());}}}(a314_0x1e29,0x9dab5));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 _0x95a56b=getTemplateBaseUrl();return _0x95a56b+'/skills/guides.json';}const CACHE_DIR=join(homedir(),'.lovrabet',a314_0x741183(0x176));export async function fetchGuidesFromCDN(){const _0x4da087=a314_0x741183,_0x21cb2d=getGuidesCdnUrl(),_0x242b84=await fetch(_0x21cb2d,{'headers':{'Accept':_0x4da087(0x16f)}});if(!_0x242b84['ok'])throw new Error(_0x4da087(0x184)+_0x242b84['status']+'\x20'+_0x242b84[_0x4da087(0x18f)]);const _0x1a5d62=await _0x242b84[_0x4da087(0x18b)]();if(!_0x1a5d62[_0x4da087(0x17c)]||typeof _0x1a5d62[_0x4da087(0x17c)]!==_0x4da087(0x189))throw new Error(_0x4da087(0x187));return _0x1a5d62;}export function writeGuidesToProject(_0x35634d,_0xaa14af,_0x2fe354=a314_0x741183(0x17d),_0x4d1941){const _0x59ddb3=a314_0x741183,_0xeb05b9=join(_0xaa14af,_0x2fe354);mkdirSync(_0xeb05b9,{'recursive':!![]});for(const [_0x2ea63,_0x5919df]of Object[_0x59ddb3(0x18e)](_0x35634d[_0x59ddb3(0x17c)])){let _0x313358=_0x5919df[_0x59ddb3(0x185)];_0x5919df['lastUpdated']&&(_0x313358=appendUpdateTime(_0x313358,_0x5919df[_0x59ddb3(0x188)])),writeFileSync(join(_0xeb05b9,_0x2ea63+_0x59ddb3(0x181)),_0x313358,_0x59ddb3(0x191));}}export function appendUpdateTime(_0x270889,_0x2a13f1){const _0x5b01fb=a314_0x741183;return _0x270889=_0x270889[_0x5b01fb(0x192)](/\n*>更新时间:.*$/m,''),_0x270889[_0x5b01fb(0x17a)]()+(_0x5b01fb(0x183)+_0x2a13f1);}export function getSkillTemplate(_0x32f67a){const _0x22e7d0=a314_0x741183;return _0x32f67a[_0x22e7d0(0x17e)]?.[_0x22e7d0(0x185)]||'';}export function appendExtendContents(_0x313646,_0x573b14,_0x491cbd){const _0x2eb392=a314_0x741183,_0x2f42d6=[];for(const [,_0x5650ee]of Object[_0x2eb392(0x18e)](_0x573b14[_0x2eb392(0x17c)])){_0x5650ee[_0x2eb392(0x18c)]&&_0x2f42d6[_0x2eb392(0x174)](_0x5650ee[_0x2eb392(0x18c)][_0x2eb392(0x17a)]());}if(_0x2f42d6['length']===0x0)return _0x313646;return _0x313646[_0x2eb392(0x17a)]()+'\x0a\x0a'+_0x2f42d6[_0x2eb392(0x17f)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x2400a9,_0x3f56d5,_0x3396b7){const _0xbcb8e5=a314_0x741183,_0x2ca19a=getSkillTemplate(_0x2400a9);if(!_0x2ca19a)throw new Error(_0xbcb8e5(0x175));const _0x33e79a=dirname(_0x3f56d5);mkdirSync(_0x33e79a,{'recursive':!![]});let _0x3665a1=_0x2ca19a[_0xbcb8e5(0x192)](/\{\{IDE_NAME\}\}/g,_0x3396b7);_0x3665a1=appendExtendContents(_0x3665a1,_0x2400a9),_0x2400a9['skillTemplate'][_0xbcb8e5(0x188)]&&(_0x3665a1=appendUpdateTime(_0x3665a1,_0x2400a9[_0xbcb8e5(0x17e)][_0xbcb8e5(0x188)])),writeFileSync(_0x3f56d5,_0x3665a1,'utf-8');}function a314_0x1e29(){const _0x121901=['entries','statusText','385044NylfSs','utf-8','replace','application/json','title','1854992XSIMqP','85jCXhYj','725866Pahjbp','push','CDN\x20data\x20is\x20missing\x20skillTemplate','cache','269958rAYsOF','10YsySuV','1621242soMQWl','trimEnd','length','guides','.lovrabet/skill/guides','skillTemplate','join','38763693ARhzmF','.md','keys','\x0a\x0a>更新时间:','CDN\x20request\x20failed:\x20','content','map','CDN\x20returned\x20invalid\x20data','lastUpdated','object','2118200NMgFQq','json','extendContent','8ygqrtz'];a314_0x1e29=function(){return _0x121901;};return a314_0x1e29();}export async function installGuides(_0x4f90c7){const _0x2a04f9=a314_0x741183,_0x5c3db2=await fetchGuidesFromCDN();return writeGuidesToProject(_0x5c3db2,_0x4f90c7),Object[_0x2a04f9(0x182)](_0x5c3db2[_0x2a04f9(0x17c)])[_0x2a04f9(0x17b)];}export function getGuidesSummary(_0x3eb4ce){const _0x42796e=a314_0x741183;return Object[_0x42796e(0x18e)](_0x3eb4ce[_0x42796e(0x17c)])[_0x42796e(0x186)](([_0x59e714,_0x3e229f])=>({'key':_0x59e714,'title':_0x3e229f[_0x42796e(0x170)],'path':_0x3e229f['path']}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3ea5c2,_0xf0558c){const _0x132c7f=a315_0x5653,_0x41cdb1=_0x3ea5c2();while(!![]){try{const _0x47836e=-parseInt(_0x132c7f(0xdf))/0x1+-parseInt(_0x132c7f(0xd8))/0x2*(parseInt(_0x132c7f(0xd7))/0x3)+parseInt(_0x132c7f(0xdb))/0x4+parseInt(_0x132c7f(0xeb))/0x5+-parseInt(_0x132c7f(0xd3))/0x6+parseInt(_0x132c7f(0xd0))/0x7*(parseInt(_0x132c7f(0xd1))/0x8)+parseInt(_0x132c7f(0xe3))/0x9*(-parseInt(_0x132c7f(0xe7))/0xa);if(_0x47836e===_0xf0558c)break;else _0x41cdb1['push'](_0x41cdb1['shift']());}catch(_0x4eca3a){_0x41cdb1['push'](_0x41cdb1['shift']());}}}(a315_0x336f,0xae3be));function a315_0x5653(_0x5c6360,_0x3384fa){_0x5c6360=_0x5c6360-0xcd;const _0x336f4e=a315_0x336f();let _0x565319=_0x336f4e[_0x5c6360];return _0x565319;}export async function httpRequest(_0x37e102,_0x1eec41={}){const _0x1b7d51=a315_0x5653,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x1eec41;let _0x1f44ae=null;for(let _0x2c5ac0=0x0;_0x2c5ac0<=retries;_0x2c5ac0++){try{const _0x2e0f57=new AbortController(),_0x1abf6c=setTimeout(()=>_0x2e0f57[_0x1b7d51(0xcd)](),timeout),_0x85c95d=await fetch(_0x37e102,{'headers':headers,'signal':_0x2e0f57[_0x1b7d51(0xd2)]});clearTimeout(_0x1abf6c);let _0x25b393;const _0x1c4c6e=_0x85c95d[_0x1b7d51(0xd4)][_0x1b7d51(0xea)](_0x1b7d51(0xe4));return _0x1c4c6e?.[_0x1b7d51(0xe9)](_0x1b7d51(0xd6))?_0x25b393=await _0x85c95d[_0x1b7d51(0xe0)]():_0x25b393=await _0x85c95d[_0x1b7d51(0xe1)](),{'ok':_0x85c95d['ok'],'status':_0x85c95d['status'],'statusText':_0x85c95d[_0x1b7d51(0xe6)],'data':_0x25b393,'headers':_0x85c95d[_0x1b7d51(0xd4)],'url':_0x85c95d[_0x1b7d51(0xde)],'text':()=>_0x85c95d[_0x1b7d51(0xe1)]()};}catch(_0x10e0d8){_0x1f44ae=_0x10e0d8 instanceof Error?_0x10e0d8:new Error(String(_0x10e0d8));if(_0x2c5ac0===retries)break;if(shouldRetry(_0x10e0d8)){console[_0x1b7d51(0xd5)](_0x1b7d51(0xdc)+(_0x2c5ac0+0x1)+_0x1b7d51(0xe8)+retryDelay+'ms...'),await sleep(retryDelay);continue;}else break;}}throw _0x1f44ae||new Error(_0x1b7d51(0xe5));}function shouldRetry(_0xe28cc8){const _0xc9e8c7=a315_0x5653;if(_0xe28cc8 instanceof Error){if(_0xe28cc8[_0xc9e8c7(0xdd)]===_0xc9e8c7(0xe2))return![];if(_0xe28cc8['name']===_0xc9e8c7(0xcf)&&_0xe28cc8[_0xc9e8c7(0xce)][_0xc9e8c7(0xe9)](_0xc9e8c7(0xd9)))return!![];if(_0xe28cc8[_0xc9e8c7(0xce)]['includes']('ECONNRESET'))return!![];if(_0xe28cc8['message'][_0xc9e8c7(0xe9)](_0xc9e8c7(0xda)))return![];}return![];}function sleep(_0x356b62){return new Promise(_0x39c79d=>setTimeout(_0x39c79d,_0x356b62));}function a315_0x336f(){const _0x414f9f=['url','1104119xnDvlj','json','text','AbortError','1935VZyXSQ','content-type','Request\x20failed','statusText','35170kNntXK','\x20in\x20','includes','get','4721725aKxlCY','abort','message','TypeError','1352225ALKiqD','56CMOgpm','signal','5867160BbxraQ','headers','log','application/json','1509IHzyLW','308MlzEgn','fetch','ENOTFOUND','5330752ZoRcaR','*\x20Request\x20failed;\x20retry\x20','name'];a315_0x336f=function(){return _0x414f9f;};return a315_0x336f();}export function validateUrl(_0x329fe7){try{return new URL(_0x329fe7),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x106429,_0x5c570f){const _0x1178ab=a316_0x2746,_0x10f75c=_0x106429();while(!![]){try{const _0x54b0a6=-parseInt(_0x1178ab(0x6d))/0x1*(-parseInt(_0x1178ab(0x6c))/0x2)+-parseInt(_0x1178ab(0x6f))/0x3+parseInt(_0x1178ab(0x75))/0x4+parseInt(_0x1178ab(0x71))/0x5+-parseInt(_0x1178ab(0x6a))/0x6+parseInt(_0x1178ab(0x6b))/0x7*(-parseInt(_0x1178ab(0x72))/0x8)+-parseInt(_0x1178ab(0x77))/0x9;if(_0x54b0a6===_0x5c570f)break;else _0x10f75c['push'](_0x10f75c['shift']());}catch(_0x518c17){_0x10f75c['push'](_0x10f75c['shift']());}}}(a316_0x2eb5,0x32220));function env(_0x5c2e33){return process.env[`RABETBASE_${_0x5c2e33}`]||process.env[`LOVRABET_${_0x5c2e33}`]||undefined;}export function isNonInteractive(_0x36e5ab){const _0x3e873a=a316_0x2746;return!!(_0x36e5ab[_0x3e873a(0x79)]||_0x36e5ab['ci']||env('CI')===_0x3e873a(0x74)||process.env.CI===_0x3e873a(0x74)||!process[_0x3e873a(0x78)][_0x3e873a(0x6e)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0xbebb2e=a316_0x2746;if(!process[_0xbebb2e(0x70)][_0xbebb2e(0x6e)])return![];try{const _0x27387c=process[_0xbebb2e(0x70)][_0xbebb2e(0x76)];return process[_0xbebb2e(0x70)][_0xbebb2e(0x73)](!![]),process[_0xbebb2e(0x70)][_0xbebb2e(0x73)](_0x27387c??![]),!![];}catch{return![];}}function a316_0x2746(_0x13afbb,_0x554ff8){_0x13afbb=_0x13afbb-0x6a;const _0x2eb5fe=a316_0x2eb5();let _0x27460d=_0x2eb5fe[_0x13afbb];return _0x27460d;}function a316_0x2eb5(){const _0x155009=['1776880xWyBac','1065752zfBLmI','setRawMode','true','1268516TEbKKw','isRaw','1185327nvmYFd','stdout','nonInteractive','844554pWIkUc','14CVvlhr','189346ymAjIR','1LCHgjY','isTTY','68802dgdlBF','stdin'];a316_0x2eb5=function(){return _0x155009;};return a316_0x2eb5();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a317_0x3295(){const _0x55c265=['now','winstonLogger','Failed:\x20','98487RfSDVc','writeFileSync','222134KCooxi','6535ELgzDq','split','details','88ZKCCpa','Starting:\x20','addColors','parse','unknown','transports','combine','1561BUNQcb','File','blue','message','Failed\x20to\x20read\x20logs:','format','command','94563tNWZcZ','red','mkdirSync','setRawCommand','log','readLogs','utf8','initWinstonLogger','stringify','level','dirname','warn','green','rawCommand','setLogPath','duration','currentRawCommand','timestamp','toISOString','trim','logFilePath','readFileSync','success','createLogger','existsSync','error','logTask','252IpBIeD','getWinstonInstance','167461ajleac','3432BIMZrv','Completed:\x20','filter','16TxTiFQ','map','603220pXAIor','info'];a317_0x3295=function(){return _0x55c265;};return a317_0x3295();}const a317_0x15964d=a317_0x63ba;(function(_0x8798e3,_0xaab657){const _0x2a4b6b=a317_0x63ba,_0x2d007d=_0x8798e3();while(!![]){try{const _0x4935d0=-parseInt(_0x2a4b6b(0x1bb))/0x1+-parseInt(_0x2a4b6b(0x1c8))/0x2+-parseInt(_0x2a4b6b(0x1da))/0x3+-parseInt(_0x2a4b6b(0x1b9))/0x4*(-parseInt(_0x2a4b6b(0x1c9))/0x5)+parseInt(_0x2a4b6b(0x1bc))/0x6*(-parseInt(_0x2a4b6b(0x1d3))/0x7)+parseInt(_0x2a4b6b(0x1bf))/0x8*(-parseInt(_0x2a4b6b(0x1c6))/0x9)+parseInt(_0x2a4b6b(0x1c1))/0xa*(parseInt(_0x2a4b6b(0x1cc))/0xb);if(_0x4935d0===_0xaab657)break;else _0x2d007d['push'](_0x2d007d['shift']());}catch(_0x227aa0){_0x2d007d['push'](_0x2d007d['shift']());}}}(a317_0x3295,0x19bd2));import a317_0x3d4c6e from'winston';import a317_0x53b359 from'node:fs';function a317_0x63ba(_0x382dcc,_0x49af0f){_0x382dcc=_0x382dcc-0x1a2;const _0x329570=a317_0x3295();let _0x63ba20=_0x329570[_0x382dcc];return _0x63ba20;}import a317_0x109430 from'node:path';class Logger{['winstonLogger'];[a317_0x15964d(0x1b2)];['currentRawCommand']='';constructor(){const _0x3a7141=a317_0x15964d;this[_0x3a7141(0x1b2)]='';}[a317_0x15964d(0x1dd)](_0x5046cf){const _0x3778c4=a317_0x15964d;this[_0x3778c4(0x1ae)]=_0x5046cf;}[a317_0x15964d(0x1a5)](){const _0x17bb29=a317_0x15964d,_0x4f293e=a317_0x109430[_0x17bb29(0x1a8)](this['logFilePath']);!a317_0x53b359[_0x17bb29(0x1b6)](_0x4f293e)&&a317_0x53b359[_0x17bb29(0x1dc)](_0x4f293e,{'recursive':!![]});const _0x4dceb7=a317_0x3d4c6e[_0x17bb29(0x1d8)][_0x17bb29(0x1d2)](a317_0x3d4c6e[_0x17bb29(0x1d8)][_0x17bb29(0x1af)](),a317_0x3d4c6e['format']['errors']({'stack':!![]}),a317_0x3d4c6e['format']['printf'](_0x1f2512=>{const _0x2c9a5f=_0x17bb29,_0x26a7e6={'timestamp':_0x1f2512[_0x2c9a5f(0x1af)]||new Date()[_0x2c9a5f(0x1b0)](),'level':_0x1f2512[_0x2c9a5f(0x1a7)]||_0x2c9a5f(0x1c2),'command':_0x1f2512[_0x2c9a5f(0x1d9)]||_0x2c9a5f(0x1d0),'rawCommand':_0x1f2512[_0x2c9a5f(0x1ab)]||this[_0x2c9a5f(0x1ae)]||undefined,'message':_0x1f2512[_0x2c9a5f(0x1d6)]||'','duration':_0x1f2512[_0x2c9a5f(0x1ad)]||undefined,'details':_0x1f2512[_0x2c9a5f(0x1cb)]||undefined};return JSON[_0x2c9a5f(0x1a6)](_0x26a7e6);}));this[_0x17bb29(0x1c4)]=a317_0x3d4c6e[_0x17bb29(0x1b5)]({'level':'info','format':_0x4dceb7,'transports':[new a317_0x3d4c6e[(_0x17bb29(0x1d1))][(_0x17bb29(0x1d4))]({'filename':this[_0x17bb29(0x1b2)],'level':_0x17bb29(0x1c2)})],'silent':![]}),a317_0x3d4c6e[_0x17bb29(0x1ce)]({'success':_0x17bb29(0x1aa),'error':_0x17bb29(0x1db),'warn':'yellow','info':_0x17bb29(0x1d5)});}[a317_0x15964d(0x1ac)](_0x2e3416){const _0x530fd4=a317_0x15964d;this['logFilePath']=a317_0x109430['join'](_0x2e3416,'.lovrabet.log'),this[_0x530fd4(0x1c4)]&&this[_0x530fd4(0x1c4)]['clear'](),this[_0x530fd4(0x1a5)]();}[a317_0x15964d(0x1c2)](_0x2ff29d,_0x5ea352,_0x20905a){const _0x41d93e=a317_0x15964d;if(!this['logFilePath']||!this[_0x41d93e(0x1c4)])return;this['winstonLogger'][_0x41d93e(0x1c2)](_0x5ea352,{'command':_0x2ff29d,'details':_0x20905a});}[a317_0x15964d(0x1b4)](_0xe6d8f,_0x125d12,_0x293deb,_0x5edead){const _0x333e7d=a317_0x15964d;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x333e7d(0x1c4)][_0x333e7d(0x1a2)](_0x333e7d(0x1c2),_0x125d12,{'level':_0x333e7d(0x1b4),'command':_0xe6d8f,'duration':_0x293deb,'details':_0x5edead});}['error'](_0x470d9e,_0x9986ba,_0x2ec411){const _0x144615=a317_0x15964d;if(!this[_0x144615(0x1b2)]||!this[_0x144615(0x1c4)])return;this[_0x144615(0x1c4)][_0x144615(0x1b7)](_0x9986ba,{'command':_0x470d9e,'details':_0x2ec411});}[a317_0x15964d(0x1a9)](_0xe103f1,_0x409be9,_0x2e6a36){const _0x3fd35f=a317_0x15964d;if(!this['logFilePath']||!this[_0x3fd35f(0x1c4)])return;this[_0x3fd35f(0x1c4)][_0x3fd35f(0x1a9)](_0x409be9,{'command':_0xe103f1,'details':_0x2e6a36});}async[a317_0x15964d(0x1b8)](_0x950a35,_0x5985df,_0x39c4c4){const _0x4302af=a317_0x15964d,_0x38df80=Date[_0x4302af(0x1c3)]();this[_0x4302af(0x1c2)](_0x950a35,_0x4302af(0x1cd)+_0x5985df);try{const _0x3b665a=await _0x39c4c4(),_0x1565d9=Date['now']()-_0x38df80;return this[_0x4302af(0x1b4)](_0x950a35,_0x4302af(0x1bd)+_0x5985df,_0x1565d9),_0x3b665a;}catch(_0x2f2d3d){const _0x4437ec=Date[_0x4302af(0x1c3)]()-_0x38df80;this['error'](_0x950a35,_0x4302af(0x1c5)+_0x5985df,{'error':_0x2f2d3d instanceof Error?_0x2f2d3d[_0x4302af(0x1d6)]:String(_0x2f2d3d),'duration':_0x4437ec});throw _0x2f2d3d;}}[a317_0x15964d(0x1a3)](){const _0x27597b=a317_0x15964d;try{if(!a317_0x53b359[_0x27597b(0x1b6)](this[_0x27597b(0x1b2)]))return[];const _0x1af163=a317_0x53b359[_0x27597b(0x1b3)](this[_0x27597b(0x1b2)],_0x27597b(0x1a4));return _0x1af163[_0x27597b(0x1ca)]('\x0a')[_0x27597b(0x1be)](_0x3ccda5=>_0x3ccda5[_0x27597b(0x1b1)]())[_0x27597b(0x1c0)](_0x192e60=>JSON[_0x27597b(0x1cf)](_0x192e60));}catch(_0x3d1070){return console['warn'](_0x27597b(0x1d7),_0x3d1070),[];}}['clearLogs'](){const _0x476727=a317_0x15964d;try{a317_0x53b359['existsSync'](this[_0x476727(0x1b2)])&&a317_0x53b359[_0x476727(0x1c7)](this[_0x476727(0x1b2)],'',_0x476727(0x1a4));}catch(_0x263376){console[_0x476727(0x1a9)]('Failed\x20to\x20clear\x20logs:',_0x263376);}}[a317_0x15964d(0x1ba)](){const _0x2433c4=a317_0x15964d;return this[_0x2433c4(0x1c4)];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a91c4,_0x33f68f){const _0x1bcc98=a318_0x53b2,_0x3c5cdb=_0x3a91c4();while(!![]){try{const _0x432f11=parseInt(_0x1bcc98(0x11e))/0x1*(-parseInt(_0x1bcc98(0x11a))/0x2)+parseInt(_0x1bcc98(0x122))/0x3*(parseInt(_0x1bcc98(0x11c))/0x4)+-parseInt(_0x1bcc98(0x11f))/0x5*(-parseInt(_0x1bcc98(0x121))/0x6)+-parseInt(_0x1bcc98(0x117))/0x7+parseInt(_0x1bcc98(0x118))/0x8*(-parseInt(_0x1bcc98(0x124))/0x9)+-parseInt(_0x1bcc98(0x11b))/0xa+parseInt(_0x1bcc98(0x120))/0xb;if(_0x432f11===_0x33f68f)break;else _0x3c5cdb['push'](_0x3c5cdb['shift']());}catch(_0x365b63){_0x3c5cdb['push'](_0x3c5cdb['shift']());}}}(a318_0x1ada,0x628b5));import{CliErrors}from'../errors.js';function a318_0x53b2(_0x8ab3df,_0x415a6c){_0x8ab3df=_0x8ab3df-0x116;const _0x1ada74=a318_0x1ada();let _0x53b203=_0x1ada74[_0x8ab3df];return _0x53b203;}export function parseJsonParams(_0x4f4389){const _0x29ad14=a318_0x53b2;if(!_0x4f4389)return undefined;let _0x280d7b;try{_0x280d7b=JSON[_0x29ad14(0x11d)](_0x4f4389);}catch{throw CliErrors[_0x29ad14(0x119)]('Invalid\x20JSON\x20for\x20--params:\x20'+_0x4f4389);}if(!_0x280d7b||typeof _0x280d7b!==_0x29ad14(0x116)||Array[_0x29ad14(0x123)](_0x280d7b))throw CliErrors[_0x29ad14(0x119)]('--params\x20must\x20be\x20a\x20JSON\x20object','Example:\x20--params\x20\x27{\x22id\x22:123}\x27');return _0x280d7b;}function a318_0x1ada(){const _0x2e623b=['3908338QUmeuK','1118840TukKhy','validation','1040126tKVtlo','7604850EKkTLp','84ONKLlK','parse','1nJrHxw','5345KZAVAO','28729404bOWubQ','522RWELWG','33861ZEWHyS','isArray','45wCYiuP','object'];a318_0x1ada=function(){return _0x2e623b;};return a318_0x1ada();}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a319_0x1fd271=a319_0x4130;function a319_0x46a1(){const _0x1d48f3=['98698nPeLHC','win32','8godbHQ','341NxIlzY','10089QBwfXb','.cmd','100640ljuiyW','350128YsSbTS','209736zOKcXR','1856813gphDRm','10FLZVnl','606762Kkhtki','3iCjYkr'];a319_0x46a1=function(){return _0x1d48f3;};return a319_0x46a1();}(function(_0x4b013e,_0x23bd12){const _0x160322=a319_0x4130,_0x5e2986=_0x4b013e();while(!![]){try{const _0x57f8c9=parseInt(_0x160322(0x118))/0x1+parseInt(_0x160322(0x110))/0x2*(parseInt(_0x160322(0x10f))/0x3)+-parseInt(_0x160322(0x117))/0x4*(parseInt(_0x160322(0x11a))/0x5)+parseInt(_0x160322(0x11b))/0x6+parseInt(_0x160322(0x119))/0x7+parseInt(_0x160322(0x112))/0x8*(-parseInt(_0x160322(0x114))/0x9)+-parseInt(_0x160322(0x116))/0xa*(parseInt(_0x160322(0x113))/0xb);if(_0x57f8c9===_0x23bd12)break;else _0x5e2986['push'](_0x5e2986['shift']());}catch(_0x119bac){_0x5e2986['push'](_0x5e2986['shift']());}}}(a319_0x46a1,0x21856));export const isWindows=process['platform']===a319_0x1fd271(0x111);function a319_0x4130(_0x595815,_0x5da5e6){_0x595815=_0x595815-0x10f;const _0x46a131=a319_0x46a1();let _0x41308e=_0x46a131[_0x595815];return _0x41308e;}export function resolveNpmBin(_0x2cf22f){const _0xde51eb=a319_0x1fd271;return isWindows?_0x2cf22f+_0xde51eb(0x115):_0x2cf22f;}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x466f6f){return new Promise(_0x6f3d6e=>setTimeout(_0x6f3d6e,_0x466f6f));}
|
|
@@ -37,9 +37,10 @@ export declare class TemplateReplacer {
|
|
|
37
37
|
* - {ApiFileName}: API 配置文件名(不含扩展名)
|
|
38
38
|
* - {ConfigName}: 注册配置名称
|
|
39
39
|
* - {ClientConfigParam}: createClient 的参数
|
|
40
|
+
* - {SdkConfigFileName}: SDK 路由配置文件名(不含扩展名)
|
|
40
41
|
* - {CreatedAt}: ISO 时间戳格式
|
|
41
42
|
*/
|
|
42
|
-
static replaceApiContent(content: string, appCode: string, modelConfigs: RegisterModelConfig[], exampleModelName?: string, apiFileName?: string, configName?: string, clientConfigParam?: string, varPrefix?: string): string;
|
|
43
|
+
static replaceApiContent(content: string, appCode: string, modelConfigs: RegisterModelConfig[], exampleModelName?: string, apiFileName?: string, configName?: string, clientConfigParam?: string, varPrefix?: string, sdkConfigFileName?: string): string;
|
|
43
44
|
/**
|
|
44
45
|
* 处理整个模板目录,复制并替换内容
|
|
45
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a321_0x548473=a321_0x5b5a;function a321_0x2ce1(){const _0x2d909a=['524312YwnVcq','success','Template\x20content\x20replacement\x20failed','includes','charAt','sdk-config','.jsx','replaceApiContent','template','promises','45673332VtIIPK','toUpperCase','5190AkoTnc','28eVmXnl','1Prohjx','processDirectory','getSeconds','.md','padStart','alias','split','4399236FPWSfp','tableName:\x20\x22','toLowerCase','name','getHours','.tsx','alias:\x20\x22','2413564xqGPWW','processFile','push','readFile','toDisplayTitle','.json','.scss','api','message','\x0a\x20\x20\x20\x20{\x20','LOVRABET','\x20},','81ohoZBX','313330WlZZBt','toISOString','.tpl','10cYFQdH','join','pad','map','readdir','mkdir','extname','36tbYdvL','.ts','info','copyFile','processTemplate','3818936XAPgxd','now','endsWith','utf8','datasetCode','formatLocalTimestamp','default','isDirectory','replace','getMonth','pop','writeFile','Template\x20content\x20replacement\x20completed','toComponentName','YourModel','name:\x20\x22','replaceContent'];a321_0x2ce1=function(){return _0x2d909a;};return a321_0x2ce1();}(function(_0x50577c,_0x37363f){const _0x2b87fa=a321_0x5b5a,_0xffde26=_0x50577c();while(!![]){try{const _0x20bfcc=parseInt(_0x2b87fa(0xdf))/0x1*(-parseInt(_0x2b87fa(0xed))/0x2)+-parseInt(_0x2b87fa(0xe6))/0x3+-parseInt(_0x2b87fa(0x104))/0x4*(-parseInt(_0x2b87fa(0xfa))/0x5)+-parseInt(_0x2b87fa(0xdd))/0x6*(parseInt(_0x2b87fa(0xde))/0x7)+-parseInt(_0x2b87fa(0x11a))/0x8*(parseInt(_0x2b87fa(0xf9))/0x9)+-parseInt(_0x2b87fa(0xfd))/0xa*(parseInt(_0x2b87fa(0x109))/0xb)+parseInt(_0x2b87fa(0xdb))/0xc;if(_0x20bfcc===_0x37363f)break;else _0xffde26['push'](_0xffde26['shift']());}catch(_0x3271a3){_0xffde26['push'](_0xffde26['shift']());}}}(a321_0x2ce1,0xb8ac8));import a321_0x299cc8 from'node:fs';import a321_0x2a8358 from'node:path';function a321_0x5b5a(_0x2178ba,_0xc3cc6c){_0x2178ba=_0x2178ba-0xd7;const _0x2ce10f=a321_0x2ce1();let _0x5b5a54=_0x2ce10f[_0x2178ba];return _0x5b5a54;}import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a321_0x548473(0xff)](_0x3ba0b6){const _0xa03c51=a321_0x548473;return String(_0x3ba0b6)[_0xa03c51(0xe3)](0x2,'0');}static[a321_0x548473(0x10e)](_0x53dc12){const _0x2b0905=a321_0x548473,_0x9222a6=_0x53dc12['getFullYear'](),_0x503006=this[_0x2b0905(0xff)](_0x53dc12[_0x2b0905(0x112)]()+0x1),_0x5508b0=this[_0x2b0905(0xff)](_0x53dc12['getDate']()),_0x1b4e8f=this[_0x2b0905(0xff)](_0x53dc12[_0x2b0905(0xea)]()),_0x1d8144=this[_0x2b0905(0xff)](_0x53dc12['getMinutes']()),_0x3f04f4=this[_0x2b0905(0xff)](_0x53dc12[_0x2b0905(0xe1)]());return{'createdAt':_0x9222a6+'-'+_0x503006+'-'+_0x5508b0+'\x20'+_0x1b4e8f+':'+_0x1d8144+':'+_0x3f04f4,'createdDate':_0x9222a6+'-'+_0x503006+'-'+_0x5508b0,'createdTime':_0x1b4e8f+':'+_0x1d8144+':'+_0x3f04f4};}static[a321_0x548473(0x116)](_0x2fb007){const _0x26b71f=a321_0x548473,_0x2ff45f=_0x2fb007[_0x26b71f(0xe5)]('/')[_0x26b71f(0x113)]()||_0x2fb007;return _0x2ff45f['split']('-')['map'](_0x2ea5be=>_0x2ea5be[_0x26b71f(0x11e)](0x0)[_0x26b71f(0xdc)]()+_0x2ea5be['slice'](0x1)['toLowerCase']())['join']('');}static['toDisplayTitle'](_0x1012b7){const _0x44753d=a321_0x548473,_0xae36d4=_0x1012b7[_0x44753d(0xe5)]('/')[_0x44753d(0x113)]()||_0x1012b7;return _0xae36d4[_0x44753d(0xe5)]('-')['map'](_0x5de6d9=>_0x5de6d9[_0x44753d(0x11e)](0x0)[_0x44753d(0xdc)]()+_0x5de6d9['slice'](0x1)[_0x44753d(0xe8)]())[_0x44753d(0xfe)]('\x20');}static[a321_0x548473(0x119)](_0x54c44b,_0x70499c,_0x392738){const _0x1b3b42=a321_0x548473,_0x25a38e=this[_0x1b3b42(0x116)](_0x70499c),_0x525bd7=this[_0x1b3b42(0xf1)](_0x70499c),{createdAt:_0x4bc7c9,createdDate:_0x95e483,createdTime:_0x389481}=this[_0x1b3b42(0x10e)](new Date());let _0x83ef96=_0x54c44b[_0x1b3b42(0x111)](/\{CliVersion\}/g,CLI_VERSION)[_0x1b3b42(0x111)](/\{ComponentName\}/g,_0x25a38e)['replace'](/\{DisplayTitle\}/g,_0x525bd7)[_0x1b3b42(0x111)](/\{PageName\}/g,_0x70499c)[_0x1b3b42(0x111)](/\{TemplateName\}/g,_0x392738)[_0x1b3b42(0x111)](/\{CreatedAt\}/g,_0x4bc7c9)[_0x1b3b42(0x111)](/\{CreatedDate\}/g,_0x95e483)[_0x1b3b42(0x111)](/\{CreatedTime\}/g,_0x389481);return _0x83ef96;}static[a321_0x548473(0xd8)](_0x17bda2,_0x16e800,_0x4cf2e1,_0x3a7392,_0x170eb6,_0x593b17,_0x3e28c4,_0x56d451,_0x150ecc){const _0x5b20e9=a321_0x548473,_0x1482d=new Date(),_0xc214f5=_0x1482d[_0x5b20e9(0xfb)](),_0x2804e5=_0x4cf2e1[_0x5b20e9(0x100)](_0x351a71=>{const _0x2ffbdb=_0x5b20e9,_0x1749f0=['datasetCode:\x20\x22'+_0x351a71[_0x2ffbdb(0x10d)]+'\x22',_0x2ffbdb(0xe7)+_0x351a71['tableName']+'\x22',_0x2ffbdb(0x118)+_0x351a71[_0x2ffbdb(0xe9)]+'\x22'];return _0x351a71['alias']&&_0x1749f0[_0x2ffbdb(0xef)](_0x2ffbdb(0xec)+_0x351a71[_0x2ffbdb(0xe4)]+'\x22'),_0x2ffbdb(0xf6)+_0x1749f0[_0x2ffbdb(0xfe)](',\x20')+_0x2ffbdb(0xf8);})[_0x5b20e9(0xfe)](''),_0x5b7c4d=_0x3a7392||_0x4cf2e1[0x0]?.[_0x5b20e9(0xe4)]||_0x5b20e9(0x117);let _0x4f8693=_0x17bda2[_0x5b20e9(0x111)](/\{AppCode\}/g,_0x16e800)['replace'](/\{ModelConfigs\}/g,_0x2804e5)['replace'](/\{ExampleModelName\}/g,_0x5b7c4d)[_0x5b20e9(0x111)](/\{ApiFileName\}/g,_0x170eb6||_0x5b20e9(0xf4))[_0x5b20e9(0x111)](/\{ConfigName\}/g,_0x593b17||_0x5b20e9(0x10f))[_0x5b20e9(0x111)](/\{ClientConfigParam\}/g,_0x3e28c4||'')[_0x5b20e9(0x111)](/\{SdkConfigFileName\}/g,_0x150ecc||_0x5b20e9(0x11f))[_0x5b20e9(0x111)](/\{VarPrefix\}/g,_0x56d451||_0x5b20e9(0xf7))[_0x5b20e9(0x111)](/\{CreatedAt\}/g,_0xc214f5);return _0x4f8693;}static async[a321_0x548473(0x108)](_0x51a00d,_0x10b9f3,_0x26ce31,_0x22775e,_0x4f2316=!![]){const _0x4babc8=a321_0x548473,_0x5c7999=Date[_0x4babc8(0x10a)]();try{_0x4f2316&&logger[_0x4babc8(0x106)](_0x4babc8(0xd9),'Starting\x20template\x20content\x20replacement',{'templatePath':_0x51a00d,'targetPath':_0x10b9f3,'pageName':_0x26ce31,'templateName':_0x22775e});await a321_0x299cc8[_0x4babc8(0xda)][_0x4babc8(0x102)](_0x10b9f3,{'recursive':!![]}),await this[_0x4babc8(0xe0)](_0x51a00d,_0x10b9f3,_0x26ce31,_0x22775e);if(_0x4f2316){const _0x2d060b=Date['now']()-_0x5c7999;logger[_0x4babc8(0x11b)](_0x4babc8(0xd9),_0x4babc8(0x115),_0x2d060b,{'pageName':_0x26ce31,'templateName':_0x22775e});}}catch(_0x3fe995){if(_0x4f2316){const _0x2b59f1=Date[_0x4babc8(0x10a)]()-_0x5c7999;logger['error'](_0x4babc8(0xd9),_0x4babc8(0x11c),{'templatePath':_0x51a00d,'targetPath':_0x10b9f3,'pageName':_0x26ce31,'templateName':_0x22775e,'error':_0x3fe995 instanceof Error?_0x3fe995[_0x4babc8(0xf5)]:String(_0x3fe995),'duration':_0x2b59f1});}throw _0x3fe995;}}static async[a321_0x548473(0xe0)](_0x5a77d4,_0x580539,_0x4a986f,_0x509f50){const _0x5e9eda=a321_0x548473,_0x4ce40f=await a321_0x299cc8[_0x5e9eda(0xda)][_0x5e9eda(0x101)](_0x5a77d4,{'withFileTypes':!![]});for(const _0x12da4b of _0x4ce40f){const _0x451ecc=a321_0x2a8358[_0x5e9eda(0xfe)](_0x5a77d4,_0x12da4b[_0x5e9eda(0xe9)]);let _0x447b7b=a321_0x2a8358[_0x5e9eda(0xfe)](_0x580539,_0x12da4b[_0x5e9eda(0xe9)]);_0x12da4b[_0x5e9eda(0xe9)][_0x5e9eda(0x10b)](_0x5e9eda(0xfc))&&(_0x447b7b=a321_0x2a8358[_0x5e9eda(0xfe)](_0x580539,_0x12da4b[_0x5e9eda(0xe9)][_0x5e9eda(0x111)](/\.tpl$/,'')));if(_0x12da4b[_0x5e9eda(0x110)]())await a321_0x299cc8[_0x5e9eda(0xda)]['mkdir'](_0x447b7b,{'recursive':!![]}),await this[_0x5e9eda(0xe0)](_0x451ecc,_0x447b7b,_0x4a986f,_0x509f50);else _0x12da4b['isFile']()&&await this[_0x5e9eda(0xee)](_0x451ecc,_0x447b7b,_0x4a986f,_0x509f50);}}static async['processFile'](_0x2bc047,_0x5905f1,_0x2614e9,_0x458e0f){const _0x4ace64=a321_0x548473,_0x4eada6=a321_0x2a8358[_0x4ace64(0x103)](_0x2bc047)[_0x4ace64(0xe8)]();_0x2bc047[_0x4ace64(0x10b)]('.tpl')&&(_0x5905f1=_0x5905f1[_0x4ace64(0x111)](/\.tpl$/,''));const _0x1e6884=[_0x4ace64(0xeb),_0x4ace64(0x105),_0x4ace64(0xd7),'.js',_0x4ace64(0xf2),_0x4ace64(0xe2),'.css',_0x4ace64(0xf3),'.tpl'];if(_0x1e6884[_0x4ace64(0x11d)](_0x4eada6)||_0x2bc047[_0x4ace64(0x10b)](_0x4ace64(0xfc))){const _0x3262c9=await a321_0x299cc8[_0x4ace64(0xda)][_0x4ace64(0xf0)](_0x2bc047,_0x4ace64(0x10c)),_0x4c6a09=this['replaceContent'](_0x3262c9,_0x2614e9,_0x458e0f);await a321_0x299cc8[_0x4ace64(0xda)][_0x4ace64(0x114)](_0x5905f1,_0x4c6a09,'utf8');}else await a321_0x299cc8['promises'][_0x4ace64(0x107)](_0x2bc047,_0x5905f1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a2e30,_0x35105c){const _0x1b1df7=a322_0x26a0,_0x491424=_0x3a2e30();while(!![]){try{const _0x15db47=-parseInt(_0x1b1df7(0x11c))/0x1+-parseInt(_0x1b1df7(0x127))/0x2+parseInt(_0x1b1df7(0x124))/0x3*(-parseInt(_0x1b1df7(0x113))/0x4)+-parseInt(_0x1b1df7(0x11f))/0x5*(parseInt(_0x1b1df7(0x111))/0x6)+-parseInt(_0x1b1df7(0x11a))/0x7*(parseInt(_0x1b1df7(0x10e))/0x8)+-parseInt(_0x1b1df7(0x114))/0x9*(-parseInt(_0x1b1df7(0x118))/0xa)+parseInt(_0x1b1df7(0x11d))/0xb;if(_0x15db47===_0x35105c)break;else _0x491424['push'](_0x491424['shift']());}catch(_0x5121bc){_0x491424['push'](_0x491424['shift']());}}}(a322_0x56f7,0xcaff1));import{mkdir,readFile,writeFile}from'node:fs/promises';function a322_0x26a0(_0x1ee8d2,_0x5d3d58){_0x1ee8d2=_0x1ee8d2-0x10c;const _0x56f708=a322_0x56f7();let _0x26a005=_0x56f708[_0x1ee8d2];return _0x26a005;}import{homedir}from'node:os';import{dirname,join}from'node:path';import a322_0x3b02f2 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 a322_0x56f7(){const _0x9fbd64=['14659146UrMBxV','latest','checkedAt','stableVersion','10nXxZGA','now','38150ZxOEyZ','trim','265609bCbTlm','16264391DeTJLJ','lastNotifiedVersion','10gOehUx','stringify','parse','toLowerCase','valid','615oJCyYN','update-check.json','utf8','2513820duupgE','https://www.npmjs.com/package/','\x20available,\x20current\x20','number','24oLVVlS','object','lastNotifiedAt','1077654NwBUeE','\x20update','7372mbyzUr'];a322_0x56f7=function(){return _0x9fbd64;};return a322_0x56f7();}function isUpdateNoticeDisabled(){const _0x16409f=a322_0x26a0,_0x188378=process.env.RABETBASE_NO_UPDATE_NOTICE?.[_0x16409f(0x11b)]()[_0x16409f(0x122)]();return _0x188378==='1'||_0x188378==='true'||_0x188378==='yes';}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),'.cache');}export function getUpdateNoticeCachePath(){const _0x1ab0e9=a322_0x26a0;return join(cacheRoot(),'rabetbase-cli',_0x1ab0e9(0x125));}async function readUpdateNoticeCache(){const _0x5ea59e=a322_0x26a0;try{const _0x4828d5=await readFile(getUpdateNoticeCachePath(),'utf8'),_0x36e91e=JSON[_0x5ea59e(0x121)](_0x4828d5);if(!_0x36e91e||typeof _0x36e91e!==_0x5ea59e(0x10f))return{};return _0x36e91e;}catch{return{};}}async function writeUpdateNoticeCache(_0x5aba12){const _0x2d5654=a322_0x26a0;try{const _0x1ba0ee=getUpdateNoticeCachePath();await mkdir(dirname(_0x1ba0ee),{'recursive':!![]}),await writeFile(_0x1ba0ee,JSON[_0x2d5654(0x120)](_0x5aba12,null,0x2)+'\x0a',_0x2d5654(0x126));}catch{}}function isFreshCheck(_0x7f2df3,_0x4e0580){const _0x1f0ff3=a322_0x26a0;return typeof _0x7f2df3['checkedAt']==='number'&&_0x4e0580-_0x7f2df3[_0x1f0ff3(0x116)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x5cd044,_0x2a3867,_0x41b66d){const _0xeb9f9=a322_0x26a0;return _0x5cd044[_0xeb9f9(0x11e)]===_0x2a3867&&typeof _0x5cd044[_0xeb9f9(0x110)]===_0xeb9f9(0x10d)&&_0x41b66d-_0x5cd044[_0xeb9f9(0x110)]<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0x554fb1){const _0x55bf5c=a322_0x26a0;return _0x55bf5c(0x128)+NPM_PACKAGE_NAME+'/v/'+_0x554fb1;}export async function resolveLatestUpdateNotice(){const _0xb2c2f=a322_0x26a0;if(isUpdateNoticeDisabled())return null;try{const _0x55e0ad=Date[_0xb2c2f(0x119)](),_0x1d9111=getCliVersion(),_0x191432=await readUpdateNoticeCache();let _0x29bc34=isFreshCheck(_0x191432,_0x55e0ad)?_0x191432[_0xb2c2f(0x115)]?.[_0xb2c2f(0x11b)]():undefined;if(!_0x29bc34&&!isFreshCheck(_0x191432,_0x55e0ad)){const _0x500d02=await getCliVersionPolicy();_0x29bc34=_0x500d02?.[_0xb2c2f(0x117)]?.[_0xb2c2f(0x11b)]()||undefined,await writeUpdateNoticeCache({..._0x191432,'checkedAt':_0x55e0ad,'latest':_0x29bc34,'failed':!_0x29bc34});}if(!_0x29bc34||!a322_0x3b02f2[_0xb2c2f(0x123)](_0x1d9111)||!a322_0x3b02f2[_0xb2c2f(0x123)](_0x29bc34))return null;if(a322_0x3b02f2['gte'](_0x1d9111,_0x29bc34))return null;if(isRecentlyNotified(_0x191432,_0x29bc34,_0x55e0ad))return null;const _0x4b979c=CLI_BIN_NAME+_0xb2c2f(0x112);return await writeUpdateNoticeCache({..._0x191432,'checkedAt':isFreshCheck(_0x191432,_0x55e0ad)?_0x191432[_0xb2c2f(0x116)]:_0x55e0ad,'latest':_0x29bc34,'failed':![],'lastNotifiedVersion':_0x29bc34,'lastNotifiedAt':_0x55e0ad}),{'command':_0x4b979c,'current':_0x1d9111,'latest':_0x29bc34,'url':buildNpmVersionUrl(_0x29bc34),'message':CLI_BIN_NAME+'\x20'+_0x29bc34+_0xb2c2f(0x10c)+_0x1d9111+',\x20run:\x20'+_0x4b979c};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a323_0x5c3a(_0x32a266,_0x5bef78){_0x32a266=_0x32a266-0xf7;var _0x338af1=a323_0x338a();var _0x5c3adc=_0x338af1[_0x32a266];return _0x5c3adc;}(function(_0x2a65d1,_0x36b28d){var _0x57e1d9=a323_0x5c3a,_0x29b68a=_0x2a65d1();while(!![]){try{var _0x113e51=-parseInt(_0x57e1d9(0x100))/0x1*(parseInt(_0x57e1d9(0xfc))/0x2)+-parseInt(_0x57e1d9(0xfb))/0x3+-parseInt(_0x57e1d9(0xfd))/0x4+-parseInt(_0x57e1d9(0xfe))/0x5+parseInt(_0x57e1d9(0xff))/0x6+-parseInt(_0x57e1d9(0xf7))/0x7*(-parseInt(_0x57e1d9(0xf8))/0x8)+parseInt(_0x57e1d9(0xfa))/0x9*(parseInt(_0x57e1d9(0xf9))/0xa);if(_0x113e51===_0x36b28d)break;else _0x29b68a['push'](_0x29b68a['shift']());}catch(_0x4f7658){_0x29b68a['push'](_0x29b68a['shift']());}}}(a323_0x338a,0x8e6d8));function a323_0x338a(){var _0x58f70f=['3959480wGjWfZ','3302196YzBxma','1076874YqOJCp','7oInVIy','6000328znVkzm','9633160uquJBR','18qrmJzz','919647vfMBel','2izEXck','1873344mUbNuv'];a323_0x338a=function(){return _0x58f70f;};return a323_0x338a();}import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a324_0x35ad(_0x1e6a91,_0x3702c6){_0x1e6a91=_0x1e6a91-0x188;var _0x1535df=a324_0x1535();var _0x35adb9=_0x1535df[_0x1e6a91];return _0x35adb9;}(function(_0x2228fc,_0x22263e){var _0x51d8e1=a324_0x35ad,_0x4e5994=_0x2228fc();while(!![]){try{var _0x529dec=-parseInt(_0x51d8e1(0x190))/0x1*(parseInt(_0x51d8e1(0x191))/0x2)+parseInt(_0x51d8e1(0x18d))/0x3+parseInt(_0x51d8e1(0x18f))/0x4*(parseInt(_0x51d8e1(0x18a))/0x5)+parseInt(_0x51d8e1(0x18c))/0x6+parseInt(_0x51d8e1(0x18b))/0x7*(parseInt(_0x51d8e1(0x188))/0x8)+parseInt(_0x51d8e1(0x18e))/0x9*(parseInt(_0x51d8e1(0x189))/0xa)+-parseInt(_0x51d8e1(0x192))/0xb;if(_0x529dec===_0x22263e)break;else _0x4e5994['push'](_0x4e5994['shift']());}catch(_0x7d9a8f){_0x4e5994['push'](_0x4e5994['shift']());}}}(a324_0x1535,0x76aef));function a324_0x1535(){var _0x2874d9=['14qxmAPU','2003466xXWAhs','2870727UQGpwt','2067453VyEnlH','28GYXWfq','13355SZxJPq','2SMOUTR','24826549pYYToN','1201480FkfSYl','20Iuuyoa','504155zQCOVT'];a324_0x1535=function(){return _0x2874d9;};return a324_0x1535();}import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';export async function withActiveCookie(_0x2762a0,_0x3af75a){setActiveCookie(_0x2762a0);try{return await _0x3af75a();}finally{clearActiveCookie();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a325_0x9b7f(){var _0x154e28=['517CLRRfG','3cjVbQN','9071433PGleqa','27XDlRMy','958FtgBxD','stderr','418270NTqPzb','6089965sqKIjN','2196664oXZpuy','264hhARps','2171460YJZWNM','5744800UfdAwe'];a325_0x9b7f=function(){return _0x154e28;};return a325_0x9b7f();}function a325_0x40f2(_0x2dae63,_0x4d4273){_0x2dae63=_0x2dae63-0x1d7;var _0x9b7f61=a325_0x9b7f();var _0x40f2e0=_0x9b7f61[_0x2dae63];return _0x40f2e0;}(function(_0x47aefe,_0x5956e8){var _0x5cf7f1=a325_0x40f2,_0x16ce45=_0x47aefe();while(!![]){try{var _0x21c85b=parseInt(_0x5cf7f1(0x1d7))/0x1*(-parseInt(_0x5cf7f1(0x1de))/0x2)+-parseInt(_0x5cf7f1(0x1db))/0x3*(parseInt(_0x5cf7f1(0x1d9))/0x4)+parseInt(_0x5cf7f1(0x1e1))/0x5+-parseInt(_0x5cf7f1(0x1d8))/0x6+-parseInt(_0x5cf7f1(0x1dc))/0x7+-parseInt(_0x5cf7f1(0x1e2))/0x8*(-parseInt(_0x5cf7f1(0x1dd))/0x9)+-parseInt(_0x5cf7f1(0x1e0))/0xa*(-parseInt(_0x5cf7f1(0x1da))/0xb);if(_0x21c85b===_0x5956e8)break;else _0x16ce45['push'](_0x16ce45['shift']());}catch(_0x1bc4dc){_0x16ce45['push'](_0x16ce45['shift']());}}}(a325_0x9b7f,0xc02b6));export function writeCliSideChannelLine(_0x229f13){var _0x19e6c0=a325_0x40f2;process[_0x19e6c0(0x1df)]['write'](_0x229f13+'\x0a');}
|