@lovrabet/rabetbase-cli 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.d.ts +2 -0
- package/lib/commands/db/diff-refresh-start.js +1 -0
- package/lib/commands/db/diff-refresh-status.d.ts +2 -0
- package/lib/commands/db/diff-refresh-status.js +1 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.d.ts +2 -0
- package/lib/commands/notification/config-create.js +1 -0
- package/lib/commands/notification/config-delete.d.ts +2 -0
- package/lib/commands/notification/config-delete.js +1 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.d.ts +2 -0
- package/lib/commands/notification/config-update.js +1 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.d.ts +97 -0
- package/lib/commands/notification/shared.js +1 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
- package/lib/commands/project/create/materialize-project-template.js +1 -0
- package/lib/commands/project/create/project-name.d.ts +2 -0
- package/lib/commands/project/create/project-name.js +1 -0
- package/lib/commands/project/create/project-template-archive.d.ts +6 -0
- package/lib/commands/project/create/project-template-archive.js +1 -0
- package/lib/commands/project/create/project-template-path.d.ts +1 -3
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +2 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/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/schema.js +1 -1
- package/lib/constant/cdn.d.ts +2 -0
- 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.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +29 -2
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.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/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.d.ts +13 -0
- package/lib/utils/cli-version-policy.js +1 -1
- 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/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 +9 -4
- package/skills/rabetbase/SKILL.md +33 -22
- package/skills/rabetbase/guides/backend-function.md +5 -3
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/conflict-detection.md +2 -2
- package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
- package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
- package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
- package/skills/rabetbase/guides/sql-mybatis.md +2 -2
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
- package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
- package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +5 -3
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-run.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
- package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
- package/skills/rabetbase.manifest.json +5 -5
- package/templates/README.md +14 -2
- package/lib/commands/project/create/non-interactive.d.ts +0 -9
- package/lib/commands/project/create/non-interactive.js +0 -1
- package/lib/utils/copy-directory.d.ts +0 -1
- package/lib/utils/copy-directory.js +0 -1
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
- package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
- package/templates/projects/sub-app-react-demo/README.md +0 -246
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
- package/templates/projects/sub-app-react-demo/index.html +0 -27
- package/templates/projects/sub-app-react-demo/package.json +0 -34
- package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
- package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
- package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
- package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
- package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
- package/templates/projects/sub-app-react-demo/src/style.css +0 -108
- package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
- package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
- package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x2f38f3=a34_0x6099;(function(_0x57202e,_0x3f2a9b){const _0x460af4=a34_0x6099,_0x55df6f=_0x57202e();while(!![]){try{const _0x12ecdb=-parseInt(_0x460af4(0x72))/0x1+parseInt(_0x460af4(0x74))/0x2+parseInt(_0x460af4(0x70))/0x3+-parseInt(_0x460af4(0x77))/0x4+parseInt(_0x460af4(0x81))/0x5*(-parseInt(_0x460af4(0x8d))/0x6)+parseInt(_0x460af4(0x76))/0x7+-parseInt(_0x460af4(0x89))/0x8*(-parseInt(_0x460af4(0x86))/0x9);if(_0x12ecdb===_0x3f2a9b)break;else _0x55df6f['push'](_0x55df6f['shift']());}catch(_0x52f274){_0x55df6f['push'](_0x55df6f['shift']());}}}(a34_0x34fb,0x77a87));function a34_0x34fb(){const _0xc0953c=['bff','No\x20BFF\x20scripts\x20found.','1989nrwUOg','length','ENDPOINT','25072VlSQpB','type','Script\x20type\x20filter','Filter\x20by\x20script\x20name','1002nxhkAl','map','description','1599252sGhMvf','list','740426BLoWwD','str','1127116BktGba','boolean','505267CsRwZv','1794780DlNAfh','Return\x20full\x20script\x20objects','bool','string','verbose','read','scriptType','(unnamed)','appCode','functionName','5455MDOhmH','name','COMMON'];a34_0x34fb=function(){return _0xc0953c;};return a34_0x34fb();}import{listBffScripts}from'../../core/api-client.js';function a34_0x6099(_0x577404,_0x47e507){_0x577404=_0x577404-0x6f;const _0x34fbf4=a34_0x34fb();let _0x609956=_0x34fbf4[_0x577404];return _0x609956;}export const bffList={'service':a34_0x2f38f3(0x84),'command':a34_0x2f38f3(0x71),'description':'List\x20BFF\x20scripts','risk':a34_0x2f38f3(0x7c),'flags':[{'name':a34_0x2f38f3(0x8a),'type':a34_0x2f38f3(0x7a),'description':a34_0x2f38f3(0x8b),'default':a34_0x2f38f3(0x88),'enum':[a34_0x2f38f3(0x88),a34_0x2f38f3(0x83)]},{'name':a34_0x2f38f3(0x82),'type':a34_0x2f38f3(0x7a),'description':a34_0x2f38f3(0x8c)},{'name':a34_0x2f38f3(0x7b),'type':a34_0x2f38f3(0x75),'description':a34_0x2f38f3(0x78)}],async 'execute'(_0x16b89b){const _0x3b34d7=a34_0x2f38f3,_0x2c37c0=await listBffScripts(_0x16b89b[_0x3b34d7(0x7f)],_0x16b89b[_0x3b34d7(0x73)](_0x3b34d7(0x8a)),{'scriptName':_0x16b89b[_0x3b34d7(0x73)](_0x3b34d7(0x82))||undefined}),_0x512c39=_0x16b89b[_0x3b34d7(0x79)](_0x3b34d7(0x7b));return{'ok':!![],'data':_0x512c39?_0x2c37c0:_0x2c37c0[_0x3b34d7(0x8e)](_0x2fe809=>({'id':_0x2fe809['id'],'functionName':_0x2fe809[_0x3b34d7(0x80)]??'','description':_0x2fe809[_0x3b34d7(0x6f)]||_0x3b34d7(0x7e),'scriptType':_0x2fe809[_0x3b34d7(0x7d)]})),'message':_0x2c37c0[_0x3b34d7(0x87)]===0x0?_0x3b34d7(0x85):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x29c5d1=a35_0x2680;(function(_0x178565,_0x33748c){const _0x23073c=a35_0x2680,_0x5e8110=_0x178565();while(!![]){try{const _0x376241=-parseInt(_0x23073c(0x16e))/0x1*(parseInt(_0x23073c(0x154))/0x2)+parseInt(_0x23073c(0x158))/0x3*(-parseInt(_0x23073c(0x15f))/0x4)+-parseInt(_0x23073c(0x14e))/0x5*(parseInt(_0x23073c(0x14c))/0x6)+parseInt(_0x23073c(0x151))/0x7*(parseInt(_0x23073c(0x164))/0x8)+-parseInt(_0x23073c(0x13b))/0x9+-parseInt(_0x23073c(0x15d))/0xa*(-parseInt(_0x23073c(0x13d))/0xb)+parseInt(_0x23073c(0x186))/0xc;if(_0x376241===_0x33748c)break;else _0x5e8110['push'](_0x5e8110['shift']());}catch(_0x1a3940){_0x5e8110['push'](_0x5e8110['shift']());}}}(a35_0x3cd8,0xeee67));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';function a35_0x2680(_0x5de1c6,_0x5935bb){_0x5de1c6=_0x5de1c6-0x13b;const _0x3cd8fb=a35_0x3cd8();let _0x2680a8=_0x3cd8fb[_0x5de1c6];return _0x2680a8;}function a35_0x3cd8(){const _0x5ef392=['length','lockKey','Pull\x20complete:\x20','all','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','type','12TdEeyg','lockFilePath','1935995HRjTlU','validation','stdin','1375451KIOoJi','force','functions','7946BIAJhM','stringify','\x20skipped,\x20','local\x20unsynced\x20changes','339XVvWnk','hookLocation','parse','bool','\x22\x20not\x20found\x20after\x20ensureLockScope.','42380LHUHFr','utf8','14956qQEZuc','operationType','filePath','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','&type=','56zcvScw','ENDPOINT','unresolvable\x20target\x20path','yes','GET','conflict','message','str','question','nonInteractive','91imQvPe','apps','alias','functionNode','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','scriptContent','HOOK','lastSync','push','Remote\x20script\x20missing\x20content.','close','would_pull','toLowerCase','hash','string','read','toISOString','\x20failed','Force\x20pull\x20cancelled.','Remote\x20script\x20missing\x20id.','Pull\x20only\x20this\x20script\x20type','scriptsRoot','Lock\x20scope\x20for\x20app\x20\x22','functionName','3332868Ozwhni','No\x20remote\x20BFF\x20scripts\x20found.','Force\x20overwrite\x20local\x20unsynced\x20changes','bff','datasetCode','skipped','stderr','version','COMMON','\x20remote\x20BFF\x20script(s)\x20for\x20pull','3526605qWBBYa','/api/management/library/scripts/list?appCode=','3311rWefuz','trim','apiDir','map','includes','Would\x20inspect\x20','appCode','pull','scriptType'];a35_0x3cd8=function(){return _0x5ef392;};return a35_0x3cd8();}export const bffPull={'service':a35_0x29c5d1(0x189),'command':a35_0x29c5d1(0x144),'description':a35_0x29c5d1(0x162),'risk':a35_0x29c5d1(0x17d),'flags':[{'name':a35_0x29c5d1(0x14b),'type':a35_0x29c5d1(0x17c),'description':a35_0x29c5d1(0x182),'enum':[a35_0x29c5d1(0x18e),a35_0x29c5d1(0x165),a35_0x29c5d1(0x174)]},{'name':a35_0x29c5d1(0x152),'type':'boolean','description':a35_0x29c5d1(0x188)}],async 'dryRun'(_0x2de050){const _0x5471ea=a35_0x29c5d1,_0x31e3f4=loadBffProjectConfig(_0x2de050['appCode']),_0x2a1e11=await readBffLockFile(_0x31e3f4[_0x5471ea(0x14d)]),{appLock:_0x558a9d}=ensureLockScope(_0x2a1e11??createEmptyBffLock(),_0x2de050['appCode'],_0x31e3f4[_0x5471ea(0x183)],'pull'),_0x255b9f=normalizeBffType(_0x2de050[_0x5471ea(0x16b)](_0x5471ea(0x14b)))??undefined,_0x317657=buildDatasetCodeToAliasMap(_0x2de050[_0x5471ea(0x13f)],_0x2de050[_0x5471ea(0x143)]),[_0x5cc8bf,_0x1459a4]=await Promise[_0x5471ea(0x149)]([listBffScripts(_0x2de050[_0x5471ea(0x143)],_0x255b9f),getBffScriptStatistics(_0x2de050[_0x5471ea(0x143)])]),_0x2a0aa5=createHookLocationMap(_0x1459a4),_0x25f7f2=[];for(const _0x5a6642 of _0x5cc8bf){const _0x495f28=resolveRemoteScriptTarget(_0x31e3f4,_0x5a6642,_0x2a0aa5,_0x558a9d[_0x5471ea(0x153)],_0x317657);if(!_0x495f28){_0x25f7f2[_0x5471ea(0x176)]({'scriptType':_0x5a6642[_0x5471ea(0x145)],'functionName':_0x5a6642[_0x5471ea(0x185)]??'','status':_0x5471ea(0x18b),'reason':_0x5471ea(0x166)});continue;}const _0x3b6940=_0x558a9d[_0x5471ea(0x153)][_0x495f28[_0x5471ea(0x147)]],_0x4c6568=_0x5a6642[_0x5471ea(0x173)]!=null?computeContentHash(_0x5a6642[_0x5471ea(0x173)]):undefined,_0x360630=await hasUnsyncedLocalChanges(_0x495f28[_0x5471ea(0x161)],_0x3b6940,_0x4c6568);_0x25f7f2[_0x5471ea(0x176)]({'lockKey':_0x495f28[_0x5471ea(0x147)],'filePath':_0x495f28[_0x5471ea(0x161)],'remoteId':_0x5a6642['id']??null,'status':_0x360630?_0x5471ea(0x169):_0x5471ea(0x179)});}return{'method':_0x5471ea(0x168),'url':_0x5471ea(0x13c)+_0x2de050[_0x5471ea(0x143)]+(_0x255b9f?_0x5471ea(0x163)+_0x255b9f:''),'body':{'appCode':_0x2de050['appCode'],'filterType':_0x255b9f??null,'files':_0x25f7f2},'description':_0x5471ea(0x142)+_0x25f7f2['length']+_0x5471ea(0x18f)};},async 'execute'(_0x30e588){const _0x43ede1=a35_0x29c5d1,_0x1db596=loadBffProjectConfig(_0x30e588[_0x43ede1(0x143)]),_0x3bcf91=await readBffLockFile(_0x1db596[_0x43ede1(0x14d)]),{lockData:_0x40a4c1,appLock:_0x272889}=ensureLockScope(_0x3bcf91??createEmptyBffLock(),_0x30e588[_0x43ede1(0x143)],_0x1db596[_0x43ede1(0x183)],_0x43ede1(0x144)),_0x12e131=normalizeBffType(_0x30e588[_0x43ede1(0x16b)](_0x43ede1(0x14b)))??undefined;if(_0x30e588[_0x43ede1(0x16b)](_0x43ede1(0x14b))&&!_0x12e131)throw CliErrors[_0x43ede1(0x14f)](_0x43ede1(0x14a));const [_0x1d9227,_0x11fd22]=await Promise[_0x43ede1(0x149)]([listBffScripts(_0x30e588[_0x43ede1(0x143)],_0x12e131),getBffScriptStatistics(_0x30e588[_0x43ede1(0x143)])]);if(_0x1d9227[_0x43ede1(0x146)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x43ede1(0x187)};const _0x364d2e=_0x30e588[_0x43ede1(0x15b)]('force');if(_0x364d2e&&!_0x30e588[_0x43ede1(0x16d)]){const _0x1fb22e=await confirmForce();if(!_0x1fb22e)throw CliErrors['cancelled'](_0x43ede1(0x180));}if(_0x364d2e&&_0x30e588[_0x43ede1(0x16d)]){}const _0x35e752=buildDatasetCodeToAliasMap(_0x30e588[_0x43ede1(0x13f)],_0x30e588[_0x43ede1(0x143)]),_0x29a649=createHookLocationMap(_0x11fd22),_0x244ccc=JSON[_0x43ede1(0x15a)](JSON[_0x43ede1(0x155)](_0x40a4c1)),_0x57a618=_0x30e588[_0x43ede1(0x143)],_0xccdc76=_0x244ccc[_0x43ede1(0x16f)][_0x57a618];if(!_0xccdc76)throw new Error(_0x43ede1(0x184)+_0x57a618+_0x43ede1(0x15c));const _0x87669e=[],_0x4c63c7=[],_0x17de35=[];for(const _0x1b9791 of _0x1d9227){const _0x3cd6fb=resolveRemoteScriptTarget(_0x1db596,_0x1b9791,_0x29a649,_0x272889['functions'],_0x35e752);if(!_0x3cd6fb){_0x4c63c7[_0x43ede1(0x176)]({'lockKey':_0x1b9791['scriptType']+'/'+_0x1b9791[_0x43ede1(0x185)],'reason':_0x43ede1(0x166)});continue;}const _0x4b9115=_0x272889[_0x43ede1(0x153)][_0x3cd6fb[_0x43ede1(0x147)]];try{if(!_0x1b9791['id'])throw new Error(_0x43ede1(0x181));if(_0x1b9791[_0x43ede1(0x173)]==null)throw new Error(_0x43ede1(0x177));const _0x30ad59=_0x1b9791[_0x43ede1(0x173)],_0x2e71f5=computeContentHash(_0x30ad59);if(!_0x364d2e){const _0x16ce1a=await hasUnsyncedLocalChanges(_0x3cd6fb[_0x43ede1(0x161)],_0x4b9115,_0x2e71f5);if(_0x16ce1a){_0x4c63c7[_0x43ede1(0x176)]({'lockKey':_0x3cd6fb[_0x43ede1(0x147)],'reason':_0x43ede1(0x157)});continue;}}await ensureParentDirectory(_0x3cd6fb[_0x43ede1(0x161)]),await writeFile(_0x3cd6fb[_0x43ede1(0x161)],_0x30ad59,_0x43ede1(0x15e));const _0x12bf5e={'hash':_0x2e71f5,'remoteId':_0x1b9791['id'],'version':_0x1b9791[_0x43ede1(0x18d)]};_0x3cd6fb[_0x43ede1(0x14b)]===_0x43ede1(0x174)&&_0x3cd6fb['hookLocation']&&(_0x12bf5e[_0x43ede1(0x170)]=_0x3cd6fb[_0x43ede1(0x159)][_0x43ede1(0x170)],_0x12bf5e[_0x43ede1(0x18a)]=_0x3cd6fb[_0x43ede1(0x159)][_0x43ede1(0x18a)],_0x12bf5e['operationType']=_0x3cd6fb[_0x43ede1(0x159)][_0x43ede1(0x160)],_0x12bf5e[_0x43ede1(0x171)]=_0x3cd6fb[_0x43ede1(0x159)]['functionNode']),_0xccdc76[_0x43ede1(0x153)][_0x3cd6fb['lockKey']]=_0x12bf5e,_0x87669e['push']({'lockKey':_0x3cd6fb[_0x43ede1(0x147)],'remoteId':_0x1b9791['id']});}catch(_0x28447c){_0x17de35[_0x43ede1(0x176)]({'lockKey':_0x3cd6fb[_0x43ede1(0x147)],'error':_0x28447c instanceof Error?_0x28447c[_0x43ede1(0x16a)]:String(_0x28447c)});}}return _0xccdc76[_0x43ede1(0x175)]=new Date()[_0x43ede1(0x17e)](),await writeBffLockFile(_0x1db596[_0x43ede1(0x14d)],_0x244ccc),{'ok':_0x17de35[_0x43ede1(0x146)]===0x0,'data':{'pulled':_0x87669e,'skipped':_0x4c63c7,'failed':_0x17de35},'message':_0x43ede1(0x148)+_0x87669e[_0x43ede1(0x146)]+'\x20pulled,\x20'+_0x4c63c7[_0x43ede1(0x146)]+_0x43ede1(0x156)+_0x17de35[_0x43ede1(0x146)]+_0x43ede1(0x17f)};}};async function hasUnsyncedLocalChanges(_0x58e624,_0x34192a,_0x5394ae){const _0x757c83=a35_0x29c5d1;if(!await fileExists(_0x58e624))return![];const _0x128feb=await computeFileHash(_0x58e624);if(!_0x34192a)return _0x5394ae?_0x128feb!==_0x5394ae:!![];return _0x128feb!==_0x34192a[_0x757c83(0x17b)];}function buildDatasetCodeToAliasMap(_0x52b366,_0x4fd397){const _0x16dd17=a35_0x29c5d1,_0x30ef3b=loadAliasMap(_0x52b366,undefined,resolveApiFilePath(_0x52b366,_0x4fd397));return new Map(_0x30ef3b[_0x16dd17(0x140)](_0x173b82=>[_0x173b82[_0x16dd17(0x18a)],_0x173b82[_0x16dd17(0x170)]]));}async function confirmForce(){const _0x3c88da=a35_0x29c5d1,_0x2254aa=createInterface({'input':process[_0x3c88da(0x150)],'output':process[_0x3c88da(0x18c)]}),_0x5b2402=await new Promise(_0x4d2b1a=>{const _0x5d6af=_0x3c88da;_0x2254aa[_0x5d6af(0x16c)](_0x5d6af(0x172),_0x4d2b1a);});return _0x2254aa[_0x3c88da(0x178)](),['y',_0x3c88da(0x167)][_0x3c88da(0x141)](_0x5b2402[_0x3c88da(0x13e)]()[_0x3c88da(0x17a)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x11dafd=a36_0x5b7c;function a36_0x340b(){const _0x44255a=['\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','toISOString','get','9hXZFuq','force','COMMON','8312UeWQwT','aliasToDatasetCode','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','datasetCode','\x20skipped,\x20','Lock\x20scope\x20for\x20app\x20\x22','alias','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','version','name','attempted','datasetId','Cannot\x20resolve\x20dataset\x20for\x20\x22','functionNode','functions','every','Runtime\x20script\x20cache\x20cleared.','filePath','Local\x20function\x20not\x20found:\x20','\x20uploaded,\x20','boolean','Push\x20only\x20this\x20script\x20type','set','map','lockKey','13104HNfwiE','validation','length','has','cleared','177774fJDSeu','Run\x20`','738663xSshyk','description',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','utf8','parse','join','appCode','hash','push','string','create','would_push','/api/management/library/scripts/save','Push\x20local\x20BFF\x20scripts\x20to\x20remote','apps','remoteId','some','lockFilePath','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','values','Force\x20push\x20ignoring\x20hash\x20protection','runtime\x20cache\x20not\x20needed','63aKoxqa','HOOK','scriptsRoot','message','294480psrrfu','774025bmjUGL','runtime\x20cache\x20clear\x20failed','Would\x20inspect\x20','1374360tWasHj','operationType','Push\x20complete:\x20','status','code','datasetCodeToDataset','type','bool'];a36_0x340b=function(){return _0x44255a;};return a36_0x340b();}(function(_0x490401,_0x4e98f0){const _0x331eb7=a36_0x5b7c,_0x2993a1=_0x490401();while(!![]){try{const _0x42c07f=parseInt(_0x331eb7(0x1bb))/0x1+parseInt(_0x331eb7(0x1a9))/0x2+parseInt(_0x331eb7(0x18f))/0x3+parseInt(_0x331eb7(0x188))/0x4+-parseInt(_0x331eb7(0x1aa))/0x5+parseInt(_0x331eb7(0x18d))/0x6*(-parseInt(_0x331eb7(0x1a5))/0x7)+-parseInt(_0x331eb7(0x1ad))/0x8*(-parseInt(_0x331eb7(0x1b8))/0x9);if(_0x42c07f===_0x4e98f0)break;else _0x2993a1['push'](_0x2993a1['shift']());}catch(_0x56f9e3){_0x2993a1['push'](_0x2993a1['shift']());}}}(a36_0x340b,0x25ef2));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a36_0x11dafd(0x197),'description':a36_0x11dafd(0x19c),'risk':'high-risk-write','flags':[{'name':a36_0x11dafd(0x1b3),'type':a36_0x11dafd(0x198),'description':a36_0x11dafd(0x184),'enum':[a36_0x11dafd(0x1ba),'ENDPOINT',a36_0x11dafd(0x1a6)]},{'name':a36_0x11dafd(0x1c4),'type':a36_0x11dafd(0x198),'description':a36_0x11dafd(0x1a1)},{'name':a36_0x11dafd(0x1b9),'type':a36_0x11dafd(0x183),'description':a36_0x11dafd(0x1a3)}],async 'dryRun'(_0x53ba16){const _0x11b083=a36_0x11dafd,_0x33c645=loadBffProjectConfig(_0x53ba16[_0x11b083(0x195)]),_0x40ece9=await readBffLockFile(_0x33c645['lockFilePath']),{appLock:_0x3ab123}=ensureLockScope(_0x40ece9??createEmptyBffLock(),_0x53ba16[_0x11b083(0x195)],_0x33c645[_0x11b083(0x1a7)],_0x11b083(0x197)),_0x5411bd=await getTargetFunctions(_0x33c645,_0x53ba16),_0x24d58=_0x53ba16[_0x11b083(0x1b4)](_0x11b083(0x1b9)),_0x5ada05=[];for(const _0x1e3a8b of _0x5411bd){const _0x48f8fb=await computeFileHash(_0x1e3a8b['filePath']),_0x53f2ea=_0x3ab123[_0x11b083(0x17d)][_0x1e3a8b[_0x11b083(0x187)]],_0x1db251=!!_0x53f2ea&&_0x53f2ea[_0x11b083(0x196)]===_0x48f8fb;_0x5ada05[_0x11b083(0x197)]({'lockKey':_0x1e3a8b[_0x11b083(0x187)],'filePath':_0x1e3a8b[_0x11b083(0x180)],'remoteId':_0x53f2ea?.[_0x11b083(0x19e)]??null,'mode':_0x53f2ea?.[_0x11b083(0x19e)]?'update':_0x11b083(0x199),'status':!_0x24d58&&_0x1db251?'unchanged':_0x11b083(0x19a)});}return{'method':'POST','url':_0x11b083(0x19b),'body':{'appCode':_0x53ba16[_0x11b083(0x195)],'force':_0x24d58,'files':_0x5ada05,'cacheClearAtRuntime':_0x5ada05['some'](_0x1dae05=>_0x1dae05[_0x11b083(0x1b0)]==='would_push'),'cacheClearAtRuntimeTimes':_0x5ada05['some'](_0x5a2127=>_0x5a2127[_0x11b083(0x1b0)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x11b083(0x1ac)+_0x5ada05['length']+_0x11b083(0x1bd)};},async 'execute'(_0x216172){const _0x5de229=a36_0x11dafd,_0x2e204d=loadBffProjectConfig(_0x216172[_0x5de229(0x195)]),_0xfad9e9=await readBffLockFile(_0x2e204d[_0x5de229(0x1a0)]),{lockData:_0xb4f82d,appLock:_0x108bed}=ensureLockScope(_0xfad9e9??createEmptyBffLock(),_0x216172[_0x5de229(0x195)],_0x2e204d[_0x5de229(0x1a7)],_0x5de229(0x197)),_0x3662f6=await getTargetFunctions(_0x2e204d,_0x216172);if(_0x3662f6[_0x5de229(0x18a)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x22fa79=_0x216172[_0x5de229(0x1b4)]('force'),_0x1a13ec=JSON[_0x5de229(0x193)](JSON['stringify'](_0xb4f82d)),_0x11d1ca=_0x1a13ec[_0x5de229(0x19d)][_0x216172[_0x5de229(0x195)]];if(!_0x11d1ca)throw new Error(_0x5de229(0x1c0)+_0x216172[_0x5de229(0x195)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x403618=await buildHookMaps(_0x216172[_0x5de229(0x195)],_0x216172['apiDir'],_0x3662f6,_0x11d1ca),_0x2e713c=[],_0x1f42bb=[],_0x304d9d=[];for(const _0x522ef9 of _0x3662f6){const _0xa7c061=await computeFileHash(_0x522ef9[_0x5de229(0x180)]),_0x2404a6=_0x11d1ca[_0x5de229(0x17d)][_0x522ef9['lockKey']];if(!_0x22fa79&&_0x2404a6&&_0x2404a6[_0x5de229(0x196)]===_0xa7c061){_0x1f42bb[_0x5de229(0x197)]({'lockKey':_0x522ef9['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x216172[_0x5de229(0x195)],_0x522ef9,_0x11d1ca,_0x403618);const _0x4bed0a=_0x11d1ca[_0x5de229(0x17d)][_0x522ef9[_0x5de229(0x187)]];_0x2e713c[_0x5de229(0x197)]({'lockKey':_0x522ef9[_0x5de229(0x187)],'remoteId':_0x4bed0a?.[_0x5de229(0x19e)]??0x0});}catch(_0x4b2cdb){_0x304d9d[_0x5de229(0x197)]({'lockKey':_0x522ef9[_0x5de229(0x187)],'error':_0x4b2cdb instanceof Error?_0x4b2cdb['message']:String(_0x4b2cdb)});}}_0x11d1ca['lastSync']=new Date()[_0x5de229(0x1b6)](),await writeBffLockFile(_0x2e204d[_0x5de229(0x1a0)],_0x1a13ec),await waitForUploadedLockEntries(_0x2e204d[_0x5de229(0x1a0)],_0x216172['appCode'],_0x2e713c['map'](_0x24ce7f=>_0x24ce7f['lockKey']));let _0x660f3a={'attempted':![],'cleared':![]};if(_0x2e713c['length']>0x0)try{let _0xc05ea8='';for(let _0x4bc848=0x0;_0x4bc848<CACHE_CLEAR_ATTEMPTS;_0x4bc848+=0x1){_0xc05ea8=await clearBffScriptCache(),_0x4bc848<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x660f3a={'attempted':!![],'cleared':!![],'message':_0xc05ea8||_0x5de229(0x17f)};}catch(_0x5ba9b3){_0x660f3a={'attempted':!![],'cleared':![],'error':_0x5ba9b3 instanceof Error?_0x5ba9b3[_0x5de229(0x1a8)]:String(_0x5ba9b3)};}const _0x2d5a66=_0x304d9d['length']===0x0&&(_0x660f3a[_0x5de229(0x1c5)]?_0x660f3a[_0x5de229(0x18c)]:!![]),_0x15bb09=_0x660f3a[_0x5de229(0x1c5)]?_0x660f3a[_0x5de229(0x18c)]?'runtime\x20cache\x20cleared':_0x5de229(0x1ab):_0x5de229(0x1a4);return{'ok':_0x2d5a66,'data':{'uploaded':_0x2e713c,'skipped':_0x1f42bb,'failed':_0x304d9d,'cacheClear':_0x660f3a},'message':_0x5de229(0x1af)+_0x2e713c[_0x5de229(0x18a)]+_0x5de229(0x182)+_0x1f42bb[_0x5de229(0x18a)]+_0x5de229(0x1bf)+_0x304d9d[_0x5de229(0x18a)]+'\x20failed,\x20'+_0x15bb09};}};async function getTargetFunctions(_0x237faf,_0x4ed7d4){const _0x5c10b6=a36_0x11dafd,_0x2b330b=_0x4ed7d4['str']('type'),_0x2ffca6=_0x4ed7d4['str']('name'),_0x47fce0=normalizeBffType(_0x2b330b)??undefined;if(_0x2ffca6&&!_0x47fce0)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x27ab48=await scanLocalBffFunctions(_0x237faf,_0x47fce0);if(_0x2ffca6){const _0x525210=_0x27ab48['filter'](_0x1030ec=>_0x1030ec[_0x5c10b6(0x1c4)]===_0x2ffca6);if(_0x525210[_0x5c10b6(0x18a)]===0x0)throw CliErrors[_0x5c10b6(0x189)](_0x5c10b6(0x181)+_0x47fce0+'/'+_0x2ffca6);return _0x525210;}return _0x27ab48;}function a36_0x5b7c(_0x4aec88,_0x1a2d47){_0x4aec88=_0x4aec88-0x17c;const _0x340b3f=a36_0x340b();let _0x5b7ccb=_0x340b3f[_0x4aec88];return _0x5b7ccb;}async function buildHookMaps(_0x1ce1b6,_0x2846b9,_0x2c7a4a,_0x5c242f){const _0x1d208f=a36_0x11dafd,_0x50e06b=_0x2c7a4a[_0x1d208f(0x19f)](_0x2882f6=>_0x2882f6[_0x1d208f(0x1b3)]===_0x1d208f(0x1a6));if(!_0x50e06b)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x942edd=loadAliasMap(_0x2846b9,undefined,resolveApiFilePath(_0x2846b9,_0x1ce1b6)),_0x351223=new Map(_0x942edd[_0x1d208f(0x186)](_0x512f00=>[_0x512f00[_0x1d208f(0x1c1)],_0x512f00[_0x1d208f(0x1be)]]));for(const _0x1611dd of Object[_0x1d208f(0x1a2)](_0x5c242f['functions'])){_0x1611dd[_0x1d208f(0x1c1)]&&_0x1611dd[_0x1d208f(0x1be)]&&!_0x351223[_0x1d208f(0x18b)](_0x1611dd[_0x1d208f(0x1c1)])&&_0x351223[_0x1d208f(0x185)](_0x1611dd[_0x1d208f(0x1c1)],_0x1611dd['datasetCode']);}const _0x197223=await listDatasets(_0x1ce1b6),_0x87605c=new Map(_0x197223[_0x1d208f(0x186)](_0x2b95a8=>[_0x2b95a8[_0x1d208f(0x1b1)],_0x2b95a8]));return{'aliasToDatasetCode':_0x351223,'datasetCodeToDataset':_0x87605c};}async function uploadSingleFunction(_0x5c826a,_0x105b9,_0x413812,_0x5b797c){const _0x33559c=a36_0x11dafd,_0x448d41=await readFile(_0x105b9['filePath'],_0x33559c(0x192)),_0xfbef63=await computeFileHash(_0x105b9[_0x33559c(0x180)]),_0x1af37f=_0x413812[_0x33559c(0x17d)][_0x105b9['lockKey']];if(_0x1af37f?.['remoteId']&&_0x1af37f[_0x33559c(0x1c3)]==null)throw CliErrors[_0x33559c(0x189)](_0x105b9[_0x33559c(0x187)]+_0x33559c(0x191));let _0x3b0b32=extractScriptDescription(_0x448d41);if(!_0x3b0b32&&_0x1af37f?.[_0x33559c(0x19e)]){const _0x1874dd=await getBffScriptInfo(_0x1af37f[_0x33559c(0x19e)]);_0x3b0b32=_0x1874dd[_0x33559c(0x190)]||undefined;}const _0x3663b1={'appCode':_0x5c826a,'functionName':_0x105b9[_0x33559c(0x1c4)],'scriptType':_0x105b9['type'],'scriptContent':_0x448d41};if(_0x1af37f?.[_0x33559c(0x19e)])_0x3663b1['id']=_0x1af37f[_0x33559c(0x19e)];if(_0x1af37f?.[_0x33559c(0x1c3)]!=null)_0x3663b1[_0x33559c(0x1c3)]=_0x1af37f[_0x33559c(0x1c3)];if(_0x3b0b32)_0x3663b1[_0x33559c(0x190)]=_0x3b0b32;if(_0x105b9['type']===_0x33559c(0x1a6)){const _0x371375=_0x105b9[_0x33559c(0x1c1)];if(!_0x371375||!_0x105b9[_0x33559c(0x1ae)]||!_0x105b9['functionNode'])throw CliErrors[_0x33559c(0x189)]('Incomplete\x20HOOK\x20path:\x20'+_0x105b9[_0x33559c(0x187)]);const _0x31909c=_0x5b797c[_0x33559c(0x1bc)][_0x33559c(0x1b7)](_0x371375)??_0x1af37f?.[_0x33559c(0x1be)]??_0x371375,_0x56a2e8=_0x5b797c[_0x33559c(0x1b2)][_0x33559c(0x1b7)](_0x31909c);if(!_0x56a2e8)throw CliErrors[_0x33559c(0x189)](_0x33559c(0x1c7)+_0x371375+'\x22.\x20'+(_0x33559c(0x18e)+CLI_BIN_NAME+_0x33559c(0x1b5)));_0x3663b1[_0x33559c(0x1c6)]=_0x56a2e8['id'],_0x3663b1[_0x33559c(0x1ae)]=_0x105b9['operationType'],_0x3663b1[_0x33559c(0x17c)]=_0x105b9[_0x33559c(0x17c)];}const _0x453c44=await saveBffScript(_0x3663b1),_0x125c12=_0x453c44['id'],_0x397dd0=_0x453c44['script']??await getBffScriptInfo(_0x125c12),_0x382fc3={'hash':_0xfbef63,'remoteId':_0x125c12,'version':_0x397dd0[_0x33559c(0x1c3)]};if(_0x105b9[_0x33559c(0x1b3)]===_0x33559c(0x1a6)){const _0x578805=_0x105b9[_0x33559c(0x1c1)],_0x51471a=_0x5b797c['aliasToDatasetCode'][_0x33559c(0x1b7)](_0x578805)??_0x1af37f?.[_0x33559c(0x1be)]??_0x578805;_0x5b797c['aliasToDatasetCode'][_0x33559c(0x18b)](_0x578805)?_0x382fc3[_0x33559c(0x1c1)]=_0x578805:_0x382fc3[_0x33559c(0x1c1)]=_0x1af37f?.['alias'],_0x382fc3['datasetCode']=_0x51471a,_0x382fc3[_0x33559c(0x1ae)]=_0x105b9[_0x33559c(0x1ae)],_0x382fc3['functionNode']=_0x105b9[_0x33559c(0x17c)];}_0x413812[_0x33559c(0x17d)][_0x105b9[_0x33559c(0x187)]]=_0x382fc3;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x13010c,_0x2edb79,_0x2cc611){const _0x5a7fe6=a36_0x11dafd;if(_0x2cc611[_0x5a7fe6(0x18a)]===0x0)return;for(let _0x2c61fd=0x0;_0x2c61fd<LOCK_SETTLE_RETRY_COUNT;_0x2c61fd+=0x1){const _0x50fede=await readBffLockFile(_0x13010c),_0x184b13=_0x50fede?.[_0x5a7fe6(0x19d)]?.[_0x2edb79]?.[_0x5a7fe6(0x17d)]??{},_0x3039b1=_0x2cc611[_0x5a7fe6(0x17e)](_0x406d4d=>!!_0x184b13[_0x406d4d]?.[_0x5a7fe6(0x19e)]);if(_0x3039b1)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x5a7fe6(0x1c2)+_0x2cc611[_0x5a7fe6(0x194)](',\x20')+'.');}
|
|
1
|
+
const a36_0x315c8d=a36_0x3ff7;(function(_0x44813d,_0x144f93){const _0x3e4fec=a36_0x3ff7,_0x369e73=_0x44813d();while(!![]){try{const _0xdea518=-parseInt(_0x3e4fec(0x93))/0x1*(parseInt(_0x3e4fec(0x9a))/0x2)+parseInt(_0x3e4fec(0x86))/0x3+parseInt(_0x3e4fec(0xaf))/0x4+parseInt(_0x3e4fec(0x91))/0x5*(parseInt(_0x3e4fec(0x87))/0x6)+parseInt(_0x3e4fec(0xb1))/0x7*(parseInt(_0x3e4fec(0xac))/0x8)+parseInt(_0x3e4fec(0xa9))/0x9+-parseInt(_0x3e4fec(0xad))/0xa*(parseInt(_0x3e4fec(0xc9))/0xb);if(_0xdea518===_0x144f93)break;else _0x369e73['push'](_0x369e73['shift']());}catch(_0x2baa6d){_0x369e73['push'](_0x369e73['shift']());}}}(a36_0xd0d0,0x52278));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a36_0x3ff7(_0x574732,_0x24250e){_0x574732=_0x574732-0x80;const _0xd0d0c1=a36_0xd0d0();let _0x3ff7b6=_0xd0d0c1[_0x574732];return _0x3ff7b6;}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;function a36_0xd0d0(){const _0x23dbee=['functions','apps','/api/management/library/scripts/save','write','lockKey','get',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','operationType','remoteId','script','appCode','apiDir','1288215xREgvp','121158HbwUMZ','join','scriptsRoot','ENDPOINT','string','utf8','datasetCode','toISOString','code','aliasToDatasetCode','15jSNPou','str','22521PbjcOS','HOOK','unchanged','has','cleared','Lock\x20scope\x20for\x20app\x20\x22','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','42CECWxk','Incomplete\x20HOOK\x20path:\x20','No\x20local\x20BFF\x20functions\x20found.','status','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Run\x20`','lockFilePath','push','parse','create','set','functionNode','would_push','filePath','Runtime\x20script\x20cache\x20cleared.','5017005gdBjIG','some','\x20failed,\x20','8XhKTdh','20pjlfQH','update','899180xFpbIn','Would\x20inspect\x20','327719VTFyAK','\x22\x20not\x20found\x20after\x20ensureLockScope.','message','runtime\x20cache\x20cleared','every','type','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','runtime\x20cache\x20not\x20needed','\x20uploaded,\x20','version','filter','Force\x20push\x20ignoring\x20hash\x20protection','map','stringify','hash','attempted','alias','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','Push\x20complete:\x20','Push\x20only\x20this\x20script\x20type','values','force','\x22.\x20','validation','2802778cjeCru','length','description','bool','name'];a36_0xd0d0=function(){return _0x23dbee;};return a36_0xd0d0();}export const bffPush={'service':'bff','command':a36_0x315c8d(0xa1),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a36_0x315c8d(0xd1),'flags':[{'name':a36_0x315c8d(0xb6),'type':'string','description':a36_0x315c8d(0xc4),'enum':['COMMON',a36_0x315c8d(0x8a),a36_0x315c8d(0x94)]},{'name':'name','type':a36_0x315c8d(0x8b),'description':a36_0x315c8d(0x9e)},{'name':'force','type':'boolean','description':a36_0x315c8d(0xbc)}],async 'dryRun'(_0x18c18c){const _0x5d1228=a36_0x315c8d,_0x204fbb=loadBffProjectConfig(_0x18c18c['appCode']),_0x6be443=await readBffLockFile(_0x204fbb['lockFilePath']),{appLock:_0x5bc0b8}=ensureLockScope(_0x6be443??createEmptyBffLock(),_0x18c18c[_0x5d1228(0x84)],_0x204fbb[_0x5d1228(0x89)],_0x5d1228(0xa1)),_0x509024=await getTargetFunctions(_0x204fbb,_0x18c18c),_0x4f4802=_0x18c18c[_0x5d1228(0xcc)](_0x5d1228(0xc6)),_0x5d54d7=[];for(const _0x2a22fe of _0x509024){const _0x511225=await computeFileHash(_0x2a22fe[_0x5d1228(0xa7)]),_0x413c13=_0x5bc0b8[_0x5d1228(0xce)][_0x2a22fe[_0x5d1228(0xd2)]],_0xc2999e=!!_0x413c13&&_0x413c13[_0x5d1228(0xbf)]===_0x511225;_0x5d54d7['push']({'lockKey':_0x2a22fe[_0x5d1228(0xd2)],'filePath':_0x2a22fe['filePath'],'remoteId':_0x413c13?.['remoteId']??null,'mode':_0x413c13?.[_0x5d1228(0x82)]?_0x5d1228(0xae):_0x5d1228(0xa3),'status':!_0x4f4802&&_0xc2999e?'unchanged':'would_push'});}return{'method':'POST','url':_0x5d1228(0xd0),'body':{'appCode':_0x18c18c[_0x5d1228(0x84)],'force':_0x4f4802,'files':_0x5d54d7,'cacheClearAtRuntime':_0x5d54d7[_0x5d1228(0xaa)](_0x50f2d6=>_0x50f2d6[_0x5d1228(0x9d)]===_0x5d1228(0xa6)),'cacheClearAtRuntimeTimes':_0x5d54d7[_0x5d1228(0xaa)](_0x5bcd0a=>_0x5bcd0a[_0x5d1228(0x9d)]===_0x5d1228(0xa6))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x5d1228(0xb0)+_0x5d54d7[_0x5d1228(0xca)]+'\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x433a2f){const _0x5bd3a1=a36_0x315c8d,_0x47eeea=loadBffProjectConfig(_0x433a2f[_0x5bd3a1(0x84)]),_0x518dc3=await readBffLockFile(_0x47eeea[_0x5bd3a1(0xa0)]),{lockData:_0x58cabe,appLock:_0x2e3a4}=ensureLockScope(_0x518dc3??createEmptyBffLock(),_0x433a2f[_0x5bd3a1(0x84)],_0x47eeea[_0x5bd3a1(0x89)],_0x5bd3a1(0xa1)),_0x25c767=await getTargetFunctions(_0x47eeea,_0x433a2f);if(_0x25c767[_0x5bd3a1(0xca)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x5bd3a1(0x9c)};const _0x9cea14=_0x433a2f['bool'](_0x5bd3a1(0xc6)),_0x26218c=JSON[_0x5bd3a1(0xa2)](JSON[_0x5bd3a1(0xbe)](_0x58cabe)),_0x483f72=_0x26218c[_0x5bd3a1(0xcf)][_0x433a2f['appCode']];if(!_0x483f72)throw new Error(_0x5bd3a1(0x98)+_0x433a2f['appCode']+_0x5bd3a1(0xb2));const _0x45dae6=await buildHookMaps(_0x433a2f[_0x5bd3a1(0x84)],_0x433a2f[_0x5bd3a1(0x85)],_0x25c767,_0x483f72),_0x2fa18f=[],_0x1dda1c=[],_0x47ab0a=[];for(const _0x22d811 of _0x25c767){const _0x4ef952=await computeFileHash(_0x22d811[_0x5bd3a1(0xa7)]),_0x34a637=_0x483f72['functions'][_0x22d811[_0x5bd3a1(0xd2)]];if(!_0x9cea14&&_0x34a637&&_0x34a637[_0x5bd3a1(0xbf)]===_0x4ef952){_0x1dda1c[_0x5bd3a1(0xa1)]({'lockKey':_0x22d811[_0x5bd3a1(0xd2)],'reason':_0x5bd3a1(0x95)});continue;}try{await uploadSingleFunction(_0x433a2f[_0x5bd3a1(0x84)],_0x22d811,_0x483f72,_0x45dae6);const _0xd65939=_0x483f72[_0x5bd3a1(0xce)][_0x22d811[_0x5bd3a1(0xd2)]];_0x2fa18f[_0x5bd3a1(0xa1)]({'lockKey':_0x22d811[_0x5bd3a1(0xd2)],'remoteId':_0xd65939?.[_0x5bd3a1(0x82)]??0x0});}catch(_0x30df73){_0x47ab0a['push']({'lockKey':_0x22d811[_0x5bd3a1(0xd2)],'error':_0x30df73 instanceof Error?_0x30df73['message']:String(_0x30df73)});}}_0x483f72['lastSync']=new Date()[_0x5bd3a1(0x8e)](),await writeBffLockFile(_0x47eeea[_0x5bd3a1(0xa0)],_0x26218c),await waitForUploadedLockEntries(_0x47eeea[_0x5bd3a1(0xa0)],_0x433a2f[_0x5bd3a1(0x84)],_0x2fa18f[_0x5bd3a1(0xbd)](_0x9de0bf=>_0x9de0bf[_0x5bd3a1(0xd2)]));let _0x56dd24={'attempted':![],'cleared':![]};if(_0x2fa18f[_0x5bd3a1(0xca)]>0x0)try{let _0x6c1b59='';for(let _0x4e458a=0x0;_0x4e458a<CACHE_CLEAR_ATTEMPTS;_0x4e458a+=0x1){_0x6c1b59=await clearBffScriptCache(),_0x4e458a<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x56dd24={'attempted':!![],'cleared':!![],'message':_0x6c1b59||_0x5bd3a1(0xa8)};}catch(_0x248998){_0x56dd24={'attempted':!![],'cleared':![],'error':_0x248998 instanceof Error?_0x248998[_0x5bd3a1(0xb3)]:String(_0x248998)};}const _0x4db34b=_0x47ab0a['length']===0x0&&(_0x56dd24[_0x5bd3a1(0xc0)]?_0x56dd24[_0x5bd3a1(0x97)]:!![]),_0x1360c2=_0x56dd24[_0x5bd3a1(0xc0)]?_0x56dd24[_0x5bd3a1(0x97)]?_0x5bd3a1(0xb4):'runtime\x20cache\x20clear\x20failed':_0x5bd3a1(0xb8);return{'ok':_0x4db34b,'data':{'uploaded':_0x2fa18f,'skipped':_0x1dda1c,'failed':_0x47ab0a,'cacheClear':_0x56dd24},'message':_0x5bd3a1(0xc3)+_0x2fa18f['length']+_0x5bd3a1(0xb9)+_0x1dda1c[_0x5bd3a1(0xca)]+'\x20skipped,\x20'+_0x47ab0a[_0x5bd3a1(0xca)]+_0x5bd3a1(0xab)+_0x1360c2};}};async function getTargetFunctions(_0x17a2cc,_0x335e58){const _0xcd4984=a36_0x315c8d,_0x5b3116=_0x335e58['str']('type'),_0x27f172=_0x335e58[_0xcd4984(0x92)](_0xcd4984(0xcd)),_0x1c929e=normalizeBffType(_0x5b3116)??undefined;if(_0x27f172&&!_0x1c929e)throw CliErrors[_0xcd4984(0xc8)](_0xcd4984(0x99));const _0x35163a=await scanLocalBffFunctions(_0x17a2cc,_0x1c929e);if(_0x27f172){const _0x361ec7=_0x35163a[_0xcd4984(0xbb)](_0x4d82a2=>_0x4d82a2[_0xcd4984(0xcd)]===_0x27f172);if(_0x361ec7[_0xcd4984(0xca)]===0x0)throw CliErrors[_0xcd4984(0xc8)]('Local\x20function\x20not\x20found:\x20'+_0x1c929e+'/'+_0x27f172);return _0x361ec7;}return _0x35163a;}async function buildHookMaps(_0x50466b,_0x5cb74e,_0x275ccc,_0x3d1d39){const _0x4d0695=a36_0x315c8d,_0x19c487=_0x275ccc[_0x4d0695(0xaa)](_0x45e51b=>_0x45e51b[_0x4d0695(0xb6)]===_0x4d0695(0x94));if(!_0x19c487)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x247e69=loadAliasMap(_0x5cb74e,undefined,resolveApiFilePath(_0x5cb74e,_0x50466b)),_0x5246af=new Map(_0x247e69[_0x4d0695(0xbd)](_0xdcaedb=>[_0xdcaedb[_0x4d0695(0xc1)],_0xdcaedb[_0x4d0695(0x8d)]]));for(const _0x393366 of Object[_0x4d0695(0xc5)](_0x3d1d39[_0x4d0695(0xce)])){_0x393366[_0x4d0695(0xc1)]&&_0x393366[_0x4d0695(0x8d)]&&!_0x5246af[_0x4d0695(0x96)](_0x393366['alias'])&&_0x5246af[_0x4d0695(0xa4)](_0x393366[_0x4d0695(0xc1)],_0x393366[_0x4d0695(0x8d)]);}const _0x5dd45e=await listDatasets(_0x50466b),_0x254400=new Map(_0x5dd45e['map'](_0x1bf8ca=>[_0x1bf8ca[_0x4d0695(0x8f)],_0x1bf8ca]));return{'aliasToDatasetCode':_0x5246af,'datasetCodeToDataset':_0x254400};}async function uploadSingleFunction(_0x6593db,_0x43e22f,_0x1d5a6b,_0x3bc97f){const _0x1db2cd=a36_0x315c8d,_0x14e87d=await readFile(_0x43e22f[_0x1db2cd(0xa7)],_0x1db2cd(0x8c)),_0x22fdb3=await computeFileHash(_0x43e22f[_0x1db2cd(0xa7)]),_0x30cacc=_0x1d5a6b[_0x1db2cd(0xce)][_0x43e22f[_0x1db2cd(0xd2)]];if(_0x30cacc?.[_0x1db2cd(0x82)]&&_0x30cacc['version']==null)throw CliErrors[_0x1db2cd(0xc8)](_0x43e22f['lockKey']+_0x1db2cd(0x80));let _0x3dffcf=extractScriptDescription(_0x14e87d);if(!_0x3dffcf&&_0x30cacc?.[_0x1db2cd(0x82)]){const _0x28de0d=await getBffScriptInfo(_0x30cacc[_0x1db2cd(0x82)]);_0x3dffcf=_0x28de0d[_0x1db2cd(0xcb)]||undefined;}const _0x5c98da={'appCode':_0x6593db,'functionName':_0x43e22f[_0x1db2cd(0xcd)],'scriptType':_0x43e22f[_0x1db2cd(0xb6)],'scriptContent':_0x14e87d};if(_0x30cacc?.[_0x1db2cd(0x82)])_0x5c98da['id']=_0x30cacc[_0x1db2cd(0x82)];if(_0x30cacc?.['version']!=null)_0x5c98da[_0x1db2cd(0xba)]=_0x30cacc[_0x1db2cd(0xba)];if(_0x3dffcf)_0x5c98da['description']=_0x3dffcf;if(_0x43e22f['type']===_0x1db2cd(0x94)){const _0x46ff39=_0x43e22f['alias'];if(!_0x46ff39||!_0x43e22f[_0x1db2cd(0x81)]||!_0x43e22f[_0x1db2cd(0xa5)])throw CliErrors[_0x1db2cd(0xc8)](_0x1db2cd(0x9b)+_0x43e22f['lockKey']);const _0x47a86d=_0x3bc97f[_0x1db2cd(0x90)][_0x1db2cd(0xd3)](_0x46ff39)??_0x30cacc?.[_0x1db2cd(0x8d)]??_0x46ff39,_0x16f919=_0x3bc97f['datasetCodeToDataset'][_0x1db2cd(0xd3)](_0x47a86d);if(!_0x16f919)throw CliErrors[_0x1db2cd(0xc8)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x46ff39+_0x1db2cd(0xc7)+(_0x1db2cd(0x9f)+CLI_BIN_NAME+_0x1db2cd(0xb7)));_0x5c98da['datasetId']=_0x16f919['id'],_0x5c98da[_0x1db2cd(0x81)]=_0x43e22f[_0x1db2cd(0x81)],_0x5c98da[_0x1db2cd(0xa5)]=_0x43e22f[_0x1db2cd(0xa5)];}const _0x1a4ed0=await saveBffScript(_0x5c98da),_0xa1673=_0x1a4ed0['id'],_0xc99a37=_0x1a4ed0[_0x1db2cd(0x83)]??await getBffScriptInfo(_0xa1673),_0x1512e4={'hash':_0x22fdb3,'remoteId':_0xa1673,'version':_0xc99a37['version']};if(_0x43e22f['type']===_0x1db2cd(0x94)){const _0x2c3019=_0x43e22f[_0x1db2cd(0xc1)],_0x44a2dc=_0x3bc97f['aliasToDatasetCode'][_0x1db2cd(0xd3)](_0x2c3019)??_0x30cacc?.[_0x1db2cd(0x8d)]??_0x2c3019;_0x3bc97f['aliasToDatasetCode'][_0x1db2cd(0x96)](_0x2c3019)?_0x1512e4[_0x1db2cd(0xc1)]=_0x2c3019:_0x1512e4[_0x1db2cd(0xc1)]=_0x30cacc?.['alias'],_0x1512e4[_0x1db2cd(0x8d)]=_0x44a2dc,_0x1512e4[_0x1db2cd(0x81)]=_0x43e22f[_0x1db2cd(0x81)],_0x1512e4['functionNode']=_0x43e22f[_0x1db2cd(0xa5)];}_0x1d5a6b[_0x1db2cd(0xce)][_0x43e22f[_0x1db2cd(0xd2)]]=_0x1512e4;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x12d58a,_0xc586ec,_0x14e664){const _0x468dea=a36_0x315c8d;if(_0x14e664[_0x468dea(0xca)]===0x0)return;for(let _0x31eabf=0x0;_0x31eabf<LOCK_SETTLE_RETRY_COUNT;_0x31eabf+=0x1){const _0x1c7df1=await readBffLockFile(_0x12d58a),_0x1abf4e=_0x1c7df1?.[_0x468dea(0xcf)]?.[_0xc586ec]?.['functions']??{},_0x1d68f0=_0x14e664[_0x468dea(0xb5)](_0x2e7ca7=>!!_0x1abf4e[_0x2e7ca7]?.[_0x468dea(0x82)]);if(_0x1d68f0)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x468dea(0xc2)+_0x14e664[_0x468dea(0x88)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x34fa84=a37_0x2960;(function(_0x324583,_0x528218){const _0xdf90e5=a37_0x2960,_0x2c4f06=_0x324583();while(!![]){try{const _0x1d371b=-parseInt(_0xdf90e5(0x1e7))/0x1*(-parseInt(_0xdf90e5(0x1f7))/0x2)+-parseInt(_0xdf90e5(0x1f4))/0x3*(-parseInt(_0xdf90e5(0x1f8))/0x4)+parseInt(_0xdf90e5(0x1ff))/0x5*(parseInt(_0xdf90e5(0x201))/0x6)+parseInt(_0xdf90e5(0x1ee))/0x7+-parseInt(_0xdf90e5(0x203))/0x8+-parseInt(_0xdf90e5(0x1ea))/0x9*(parseInt(_0xdf90e5(0x1e5))/0xa)+parseInt(_0xdf90e5(0x205))/0xb;if(_0x1d371b===_0x528218)break;else _0x2c4f06['push'](_0x2c4f06['shift']());}catch(_0x31e063){_0x2c4f06['push'](_0x2c4f06['shift']());}}}(a37_0xbc65,0x7cbb3));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a37_0x2960(_0x5c42df,_0x3368e2){_0x5c42df=_0x5c42df-0x1e5;const _0xbc6500=a37_0xbc65();let _0x2960b8=_0xbc6500[_0x5c42df];return _0x2960b8;}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0xbc65(){const _0x1be4cc=['\x20unchanged','All\x20BFF\x20scripts\x20are\x20in\x20sync.','alias','9735Czqfgd','has','2694tasWcR','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','7374832fXUuIl','scriptsRoot','4071870YekrKi','hash','lockFilePath','remote','2280NTsmYU','lockKey','107721Vopeyj','bff','datasetCode','22635ItSKMT','bool','\x20modified,\x20','length','4132849qoFWgI','\x20added,\x20','status','read','boolean','apiDir','18SZSJno','appCode','functions','2RbitTX','42448Nyiyde','push','filePath','\x20remote-only'];a37_0xbc65=function(){return _0x1be4cc;};return a37_0xbc65();}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a37_0x34fa84(0x1e8),'command':a37_0x34fa84(0x1f0),'description':a37_0x34fa84(0x202),'risk':a37_0x34fa84(0x1f1),'flags':[{'name':a37_0x34fa84(0x208),'type':a37_0x34fa84(0x1f2),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x4296ea){const _0x2d29e2=a37_0x34fa84,_0x5045e8=loadBffProjectConfig(_0x4296ea['appCode']),_0x1bcf05=await readBffLockFile(_0x5045e8[_0x2d29e2(0x207)]),{appLock:_0x264a5f}=ensureLockScope(_0x1bcf05??createEmptyBffLock(),_0x4296ea[_0x2d29e2(0x1f5)],_0x5045e8[_0x2d29e2(0x204)],_0x2d29e2(0x1f0)),_0x2acdbd=await scanLocalBffFunctions(_0x5045e8),_0x585a58=[],_0x4c3c1d=[],_0x3f9888=[];for(const _0x499cdb of _0x2acdbd){const _0x33d128=await computeFileHash(_0x499cdb[_0x2d29e2(0x1fa)]),_0x243e05=_0x264a5f[_0x2d29e2(0x1f6)][_0x499cdb[_0x2d29e2(0x1e6)]];if(!_0x243e05)_0x585a58[_0x2d29e2(0x1f9)](_0x499cdb[_0x2d29e2(0x1e6)]);else _0x243e05[_0x2d29e2(0x206)]!==_0x33d128?_0x4c3c1d[_0x2d29e2(0x1f9)](_0x499cdb[_0x2d29e2(0x1e6)]):_0x3f9888[_0x2d29e2(0x1f9)](_0x499cdb['lockKey']);}const _0x1cb6ab=[];if(_0x4296ea[_0x2d29e2(0x1eb)](_0x2d29e2(0x208))){const _0x161097=loadAliasMap(_0x4296ea[_0x2d29e2(0x1f3)],undefined,resolveApiFilePath(_0x4296ea[_0x2d29e2(0x1f3)],_0x4296ea[_0x2d29e2(0x1f5)])),_0x4e2b4e=new Map(_0x161097['map'](_0x273406=>[_0x273406[_0x2d29e2(0x1e9)],_0x273406[_0x2d29e2(0x1fe)]])),[_0x51c20b,_0x11c013]=await Promise['all']([listBffScripts(_0x4296ea[_0x2d29e2(0x1f5)]),getBffScriptStatistics(_0x4296ea[_0x2d29e2(0x1f5)])]),_0x5d3ec4=createHookLocationMap(_0x11c013),_0x48adbd=new Set(_0x2acdbd['map'](_0x546197=>_0x546197[_0x2d29e2(0x1e6)]));for(const _0x428075 of _0x51c20b){const _0x2b45fc=resolveRemoteScriptTarget(_0x5045e8,_0x428075,_0x5d3ec4,_0x264a5f['functions'],_0x4e2b4e);_0x2b45fc&&!_0x48adbd[_0x2d29e2(0x200)](_0x2b45fc[_0x2d29e2(0x1e6)])&&_0x1cb6ab['push'](_0x2b45fc['lockKey']);}}const _0x11fe08=_0x585a58[_0x2d29e2(0x1ed)]===0x0&&_0x4c3c1d[_0x2d29e2(0x1ed)]===0x0&&_0x1cb6ab[_0x2d29e2(0x1ed)]===0x0;return{'ok':!![],'data':{'added':_0x585a58,'modified':_0x4c3c1d,'unchanged':_0x3f9888,'remoteOnly':_0x1cb6ab},'message':_0x11fe08?_0x2d29e2(0x1fd):_0x585a58[_0x2d29e2(0x1ed)]+_0x2d29e2(0x1ef)+_0x4c3c1d[_0x2d29e2(0x1ed)]+_0x2d29e2(0x1ec)+_0x3f9888[_0x2d29e2(0x1ed)]+_0x2d29e2(0x1fc)+(_0x1cb6ab[_0x2d29e2(0x1ed)]>0x0?',\x20'+_0x1cb6ab['length']+_0x2d29e2(0x1fb):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x41e5cb=a38_0x1ce4;(function(_0x1eb971,_0x17c384){const _0x1867f2=a38_0x1ce4,_0x1340fc=_0x1eb971();while(!![]){try{const _0x402ccb=-parseInt(_0x1867f2(0x184))/0x1*(-parseInt(_0x1867f2(0x192))/0x2)+-parseInt(_0x1867f2(0x1a0))/0x3+parseInt(_0x1867f2(0x18a))/0x4+parseInt(_0x1867f2(0x190))/0x5+-parseInt(_0x1867f2(0x19d))/0x6+-parseInt(_0x1867f2(0x19a))/0x7*(-parseInt(_0x1867f2(0x18d))/0x8)+-parseInt(_0x1867f2(0x198))/0x9;if(_0x402ccb===_0x17c384)break;else _0x1340fc['push'](_0x1340fc['shift']());}catch(_0x109739){_0x1340fc['push'](_0x1340fc['shift']());}}}(a38_0x138a,0x3967b));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a38_0x138a(){const _0x3adc00=['Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','\x20installed','\x20is\x20already\x20current','Built-in\x20Skill\x20install\x20failed\x20[','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','41652SKNBru','changed','30478sfSnKL','installedPath','skillVersion','594840sNWDuc','apiError','\x20via\x20skills@latest','1001445WSnFSa','code','install','\x20at\x20','CLI\x20Built-in\x20Skill\x20','51074plDgnB','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','info','cli-skill-install','pipe','unknown','165600dhbPbU','cli-skill','cwd','528INXKQo','inherit','error','953640IOdcpB','repairCommand','6HiWORw'];a38_0x138a=function(){return _0x3adc00;};return a38_0x138a();}import{logger}from'../../utils/logger.js';function a38_0x1ce4(_0x2ce286,_0x252b3d){_0x2ce286=_0x2ce286-0x182;const _0x138a4a=a38_0x138a();let _0x1ce4ba=_0x138a4a[_0x2ce286];return _0x1ce4ba;}export const cliSkillDefinitions=[{'service':a38_0x41e5cb(0x18b),'command':a38_0x41e5cb(0x1a2),'description':a38_0x41e5cb(0x197),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x57715f){const _0x589148=a38_0x41e5cb;logger['setLogPath'](process[_0x589148(0x18c)]()),logger[_0x589148(0x186)](_0x589148(0x187),_0x589148(0x185));const _0x532d9f=installBuiltinSkill({'stdio':_0x57715f['nonInteractive']?_0x589148(0x188):_0x589148(0x18e)});if(!_0x532d9f['ok'])throw CliErrors[_0x589148(0x19e)](_0x589148(0x196)+_0x532d9f[_0x589148(0x1a1)]+']:\x20'+(_0x532d9f[_0x589148(0x18f)]||_0x589148(0x189)),_0x589148(0x193)+_0x532d9f[_0x589148(0x191)]);return console['log'](_0x532d9f[_0x589148(0x199)]?_0x589148(0x183)+_0x532d9f[_0x589148(0x19c)]+_0x589148(0x194)+(_0x532d9f[_0x589148(0x19b)]?_0x589148(0x182)+_0x532d9f['installedPath']:_0x589148(0x19f)):'CLI\x20Built-in\x20Skill\x20'+_0x532d9f[_0x589148(0x19c)]+_0x589148(0x195)+(_0x532d9f['installedPath']?_0x589148(0x182)+_0x532d9f[_0x589148(0x19b)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x4dbf41=a39_0x5cef;(function(_0x2690d0,_0x7ae4dc){const _0x2cb7a2=a39_0x5cef,_0x1731ec=_0x2690d0();while(!![]){try{const _0x2a5b82=-parseInt(_0x2cb7a2(0x1a3))/0x1+parseInt(_0x2cb7a2(0x173))/0x2+-parseInt(_0x2cb7a2(0x192))/0x3+parseInt(_0x2cb7a2(0x1b0))/0x4+-parseInt(_0x2cb7a2(0x183))/0x5+-parseInt(_0x2cb7a2(0x1a6))/0x6+parseInt(_0x2cb7a2(0x184))/0x7;if(_0x2a5b82===_0x7ae4dc)break;else _0x1731ec['push'](_0x1731ec['shift']());}catch(_0x5c5f09){_0x1731ec['push'](_0x1731ec['shift']());}}}(a39_0x18aa,0x3d278));function a39_0x18aa(){const _0xc960df=['install','...','succeed','Updated\x20to\x20v','284950zXHNsc','1057287lYLaxw','warn','Already\x20on\x20requested\x20version\x20(v','beta','length','fail','yellow','toLowerCase','skillVersion','timeout','fromEntries','\x20install\x20-g\x20','expected\x20','info','72138hhGsJQ','https://registry.npmjs.org/-/package/','Version\x20comparison\x20failed','npm','/dist-tags','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','state','message','gray','green','\x20cli-skill\x20install','bool','map','Updating\x20via\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','version','\x20\x20Try\x20manually:\x20','90625YkQWBo','Already\x20up\x20to\x20date\x20(v','execPath','268128AcHmnj','slice','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','boolean','latest','log',',\x20found\x20','red','Update\x20failed','10668pngqvG','error','Checking\x20CLI\x20Built-in\x20Skill...','\x20→\x20','string','current','source','code','valid','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','\x20\x20Run\x20manually:\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','read','object','run','pipe','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','bun','626258bqOnoo','includes','\x20is\x20up\x20to\x20date.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Requested\x20version:\x20','json','start','Beta\x20version:\x20','Checking\x20for\x20updates...','unknown','validation','trim'];a39_0x18aa=function(){return _0xc960df;};return a39_0x18aa();}import a39_0x5eaf3e from'chalk';import a39_0x58d3c3 from'ora';import a39_0x2daeaf from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x1c561d=a39_0x5cef;return GIT_COMMIT!==_0x1c561d(0x17c)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x1c561d(0x1a7)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x5e1056=a39_0x5cef,_0x27bb1d=process[_0x5e1056(0x1a5)][_0x5e1056(0x18b)]();if(_0x27bb1d[_0x5e1056(0x174)](_0x5e1056(0x172)))return'bun';return _0x5e1056(0x195);}const updateFlags=[{'name':a39_0x4dbf41(0x187),'type':a39_0x4dbf41(0x1aa),'description':a39_0x4dbf41(0x1a0),'default':![]},{'name':a39_0x4dbf41(0x1a1),'type':'string','description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x558648){const _0x3fe51a=a39_0x4dbf41;return _0x558648['str'](_0x3fe51a(0x1a1))[_0x3fe51a(0x17e)]();}async function validateUpdateFlags(_0x274c2a){const _0x47fb86=a39_0x4dbf41,_0x6978b0=_0x274c2a[_0x47fb86(0x19d)](_0x47fb86(0x187)),_0x33d79d=getRequestedVersion(_0x274c2a);if(_0x6978b0&&_0x33d79d)throw CliErrors['validation'](_0x47fb86(0x171),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x33d79d&&!a39_0x2daeaf[_0x47fb86(0x169)](_0x33d79d))throw CliErrors[_0x47fb86(0x17d)]('Invalid\x20version:\x20'+_0x33d79d,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x2a8248=a39_0x4dbf41;try{const _0x2564a4=await fetch(_0x2a8248(0x193)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2a8248(0x196),{'signal':AbortSignal[_0x2a8248(0x18d)](0x2710)});if(!_0x2564a4['ok'])return null;const _0x972db9=await _0x2564a4[_0x2a8248(0x178)]();if(!_0x972db9||typeof _0x972db9!==_0x2a8248(0x16e))return null;return Object[_0x2a8248(0x18e)](Object['entries'](_0x972db9)['filter'](([,_0xea7176])=>typeof _0xea7176===_0x2a8248(0x165)&&_0xea7176['trim']()[_0x2a8248(0x188)]>0x0)[_0x2a8248(0x19e)](([_0xb7da57,_0x58fec6])=>[_0xb7da57,String(_0x58fec6)[_0x2a8248(0x17e)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0xbdd93c){const _0x19b5d1=await fetchNpmDistTags();return _0x19b5d1?.[_0xbdd93c]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}function a39_0x5cef(_0x1b0e13,_0x182f68){_0x1b0e13=_0x1b0e13-0x163;const _0x18aaa1=a39_0x18aa();let _0x5cefef=_0x18aaa1[_0x1b0e13];return _0x5cefef;}async function resolveTargetVersion(_0x4afba0){const _0x3d76d3=a39_0x4dbf41,_0x5919d1=getRequestedVersion(_0x4afba0);if(_0x5919d1)return{'version':_0x5919d1,'source':_0x3d76d3(0x1a1)};if(_0x4afba0[_0x3d76d3(0x19d)]('beta')){const _0x1e67e9=await fetchNpmDistTagVersion(_0x3d76d3(0x187));if(!_0x1e67e9)return null;return{'version':_0x1e67e9,'source':_0x3d76d3(0x187)};}const _0x2db6=await fetchLatestVersion();if(!_0x2db6)return null;return{'version':_0x2db6,'source':_0x3d76d3(0x1ab)};}function shouldInstallTarget(_0x1200d3,_0x577198){const _0x40dcd2=a39_0x4dbf41;if(_0x577198[_0x40dcd2(0x167)]===_0x40dcd2(0x1a1)||_0x577198[_0x40dcd2(0x167)]===_0x40dcd2(0x187))return!a39_0x2daeaf['eq'](_0x1200d3,_0x577198[_0x40dcd2(0x1a1)]);return a39_0x2daeaf['lt'](_0x1200d3,_0x577198[_0x40dcd2(0x1a1)]);}function getInstallPlanLabel(_0x10febc,_0x1e57ab){const _0xf9fbe7=a39_0x4dbf41;switch(_0x1e57ab[_0xf9fbe7(0x167)]){case _0xf9fbe7(0x187):return _0xf9fbe7(0x17a)+a39_0x5eaf3e[_0xf9fbe7(0x18a)](_0x10febc)+'\x20→\x20'+a39_0x5eaf3e[_0xf9fbe7(0x19b)](_0x1e57ab[_0xf9fbe7(0x1a1)]);case _0xf9fbe7(0x1a1):return _0xf9fbe7(0x177)+a39_0x5eaf3e[_0xf9fbe7(0x18a)](_0x10febc)+_0xf9fbe7(0x164)+a39_0x5eaf3e['green'](_0x1e57ab[_0xf9fbe7(0x1a1)]);case'latest':default:return'Update\x20available:\x20'+a39_0x5eaf3e[_0xf9fbe7(0x18a)](_0x10febc)+_0xf9fbe7(0x164)+a39_0x5eaf3e[_0xf9fbe7(0x19b)](_0x1e57ab[_0xf9fbe7(0x1a1)]);}}function repairCurrentBuiltinSkill(){const _0x233cca=a39_0x4dbf41;console[_0x233cca(0x1ac)](a39_0x5eaf3e['gray'](_0x233cca(0x163)));const _0x51b6d1=installBuiltinSkill();if(_0x51b6d1['ok'])return console[_0x233cca(0x1ac)](a39_0x5eaf3e[_0x233cca(0x19a)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x51b6d1[_0x233cca(0x18c)]+_0x233cca(0x175))),!![];return console['warn'](a39_0x5eaf3e[_0x233cca(0x18a)](_0x233cca(0x16a)+_0x51b6d1[_0x233cca(0x168)]+']:\x20'+(_0x51b6d1[_0x233cca(0x1b1)]||_0x233cca(0x17c)))),console[_0x233cca(0x1ac)](a39_0x5eaf3e[_0x233cca(0x19a)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x233cca(0x19c))),![];}function verifyUpdatedBuiltinSkill(_0x4cfc78){const _0x5c8276=a39_0x4dbf41,_0x1b6380=inspectInstalledBuiltinSkillVersion(_0x4cfc78);if(_0x1b6380[_0x5c8276(0x198)]===_0x5c8276(0x166))return console['log'](a39_0x5eaf3e[_0x5c8276(0x19a)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x4cfc78+_0x5c8276(0x175))),!![];const _0x48811e=_0x1b6380[_0x5c8276(0x18c)]?_0x5c8276(0x190)+_0x4cfc78+_0x5c8276(0x1ad)+_0x1b6380[_0x5c8276(0x18c)]:_0x5c8276(0x190)+_0x4cfc78+',\x20state\x20'+_0x1b6380[_0x5c8276(0x198)];return console[_0x5c8276(0x185)](a39_0x5eaf3e[_0x5c8276(0x18a)](_0x5c8276(0x1a8)+_0x48811e)),console[_0x5c8276(0x1ac)](a39_0x5eaf3e[_0x5c8276(0x19a)](_0x5c8276(0x16b)+_0x1b6380['repairCommand'])),![];}async function execute(_0x3c74f6){const _0x1379ea=a39_0x4dbf41;await validateUpdateFlags(_0x3c74f6);const _0x2ea98b=getCurrentVersion();console['log']('Current\x20version:\x20'+_0x2ea98b);const _0x540506=a39_0x58d3c3(_0x1379ea(0x17b))[_0x1379ea(0x179)](),_0xc4652d=await resolveTargetVersion(_0x3c74f6);if(!_0xc4652d){const _0x1f6233=_0x3c74f6[_0x1379ea(0x19d)]('beta')?_0x1379ea(0x16c):_0x1379ea(0x1a9);return _0x540506[_0x1379ea(0x189)](_0x1f6233),console[_0x1379ea(0x1ac)](a39_0x5eaf3e[_0x1379ea(0x19a)](_0x1379ea(0x176)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x1f6233};}const _0x45c8c5=a39_0x2daeaf[_0x1379ea(0x169)](VERSION),_0x1b706f=a39_0x2daeaf[_0x1379ea(0x169)](_0xc4652d[_0x1379ea(0x1a1)]);if(!_0x45c8c5||!_0x1b706f)return _0x540506[_0x1379ea(0x189)]('Version\x20comparison\x20failed'),{'ok':![],'message':_0x1379ea(0x194)};if(!shouldInstallTarget(_0x45c8c5,_0xc4652d)){const _0x2579dd=_0xc4652d[_0x1379ea(0x167)]===_0x1379ea(0x1a1)?_0x1379ea(0x186)+_0xc4652d[_0x1379ea(0x1a1)]+')':_0x1379ea(0x1a4)+_0xc4652d[_0x1379ea(0x1a1)]+')';return _0x540506[_0x1379ea(0x181)](_0x2579dd),{'ok':repairCurrentBuiltinSkill()};}_0x540506[_0x1379ea(0x191)](getInstallPlanLabel(_0x2ea98b,_0xc4652d));const _0x1c4341=detectPackageManager(),_0x41026a=_0x1c4341==='npm'?resolveNpmBin('npm'):_0x1c4341,_0x3c3a47=a39_0x58d3c3(_0x1379ea(0x19f)+_0x1c4341+_0x1379ea(0x180))[_0x1379ea(0x179)]();try{return await execa(_0x41026a,[_0x1379ea(0x17f),'-g',NPM_PACKAGE_NAME+'@'+_0xc4652d[_0x1379ea(0x1a1)]],{'stdio':_0x1379ea(0x170)}),_0x3c3a47['succeed'](_0x1379ea(0x182)+_0xc4652d['version']),console[_0x1379ea(0x1ac)](a39_0x5eaf3e['gray']('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0xc4652d[_0x1379ea(0x1a1)])};}catch(_0x813dd1){return _0x3c3a47[_0x1379ea(0x189)](_0x1379ea(0x1af)),console[_0x1379ea(0x1b1)](a39_0x5eaf3e[_0x1379ea(0x1ae)]('\x20\x20'+_0x813dd1['message'])),console[_0x1379ea(0x1ac)](a39_0x5eaf3e[_0x1379ea(0x19a)](_0x1379ea(0x1a2)+_0x1c4341+_0x1379ea(0x18f)+NPM_PACKAGE_NAME+'@'+_0xc4652d[_0x1379ea(0x1a1)])),{'ok':![],'message':_0x813dd1[_0x1379ea(0x199)]};}}export const updateDefinition={'service':'update','command':a39_0x4dbf41(0x16f),'description':a39_0x4dbf41(0x197),'risk':a39_0x4dbf41(0x16d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a39_0x3aac49=a39_0x30b8;(function(_0x362ed9,_0x351f0b){const _0x598c0e=a39_0x30b8,_0x22a262=_0x362ed9();while(!![]){try{const _0x53f0a0=-parseInt(_0x598c0e(0x1af))/0x1*(-parseInt(_0x598c0e(0x1c9))/0x2)+parseInt(_0x598c0e(0x1ce))/0x3+parseInt(_0x598c0e(0x1d9))/0x4*(-parseInt(_0x598c0e(0x19f))/0x5)+parseInt(_0x598c0e(0x1db))/0x6*(parseInt(_0x598c0e(0x1c6))/0x7)+parseInt(_0x598c0e(0x1c0))/0x8*(parseInt(_0x598c0e(0x1e3))/0x9)+parseInt(_0x598c0e(0x1ed))/0xa+-parseInt(_0x598c0e(0x1c5))/0xb*(parseInt(_0x598c0e(0x1f0))/0xc);if(_0x53f0a0===_0x351f0b)break;else _0x22a262['push'](_0x22a262['shift']());}catch(_0x437537){_0x22a262['push'](_0x22a262['shift']());}}}(a39_0x4b13,0xedd0f));import a39_0x5d9e80 from'chalk';import a39_0x3e40a9 from'ora';import a39_0x5c8bff from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x487b49=a39_0x30b8;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x487b49(0x1eb)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x2739df=a39_0x30b8,_0x2b9d77=process[_0x2739df(0x1b3)][_0x2739df(0x1be)]();if(_0x2b9d77['includes'](_0x2739df(0x1e8)))return _0x2739df(0x1e8);return _0x2739df(0x1a4);}const updateFlags=[{'name':'beta','type':'boolean','description':a39_0x3aac49(0x1b9),'default':![]},{'name':'version','type':a39_0x3aac49(0x1a7),'description':a39_0x3aac49(0x1e5)}];function getRequestedVersion(_0x3bba89){const _0x1af701=a39_0x3aac49;return _0x3bba89['str']('version')[_0x1af701(0x1c7)]();}async function validateUpdateFlags(_0x34393c){const _0x16c529=a39_0x3aac49,_0x416cd7=_0x34393c['bool'](_0x16c529(0x1aa)),_0x57caf2=getRequestedVersion(_0x34393c);if(_0x416cd7&&_0x57caf2)throw CliErrors[_0x16c529(0x1e2)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x57caf2&&!a39_0x5c8bff[_0x16c529(0x1b1)](_0x57caf2))throw CliErrors[_0x16c529(0x1e2)]('Invalid\x20version:\x20'+_0x57caf2,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x241904=a39_0x3aac49;try{const _0x2cfc4f=await fetch(_0x241904(0x1c8)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x241904(0x1e9),{'signal':AbortSignal[_0x241904(0x1d6)](0x2710)});if(!_0x2cfc4f['ok'])return null;const _0x433da2=await _0x2cfc4f['json']();if(!_0x433da2||typeof _0x433da2!==_0x241904(0x1ad))return null;return Object['fromEntries'](Object[_0x241904(0x1cb)](_0x433da2)[_0x241904(0x1e0)](([,_0x5863e9])=>typeof _0x5863e9===_0x241904(0x1a7)&&_0x5863e9[_0x241904(0x1c7)]()[_0x241904(0x1d3)]>0x0)['map'](([_0x4dd689,_0x1a2641])=>[_0x4dd689,String(_0x1a2641)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x22fc1e){const _0x43c53a=await fetchNpmDistTags();return _0x43c53a?.[_0x22fc1e]??null;}async function fetchLatestVersion(){const _0x56619c=a39_0x3aac49;return fetchNpmDistTagVersion(_0x56619c(0x1a8));}async function resolveTargetVersion(_0xce40dc){const _0x29cca8=a39_0x3aac49,_0x36f8fb=getRequestedVersion(_0xce40dc);if(_0x36f8fb)return{'version':_0x36f8fb,'source':'version'};if(_0xce40dc[_0x29cca8(0x1ae)]('beta')){const _0xb9326=await fetchNpmDistTagVersion(_0x29cca8(0x1aa));if(!_0xb9326)return null;return{'version':_0xb9326,'source':_0x29cca8(0x1aa)};}const _0x2fb348=await fetchLatestVersion();if(!_0x2fb348)return null;return{'version':_0x2fb348,'source':_0x29cca8(0x1a8)};}function a39_0x4b13(){const _0x31e841=['yellow','Already\x20on\x20requested\x20version\x20(v','1648989kmESVP','skillVersion','error','state','\x20\x20Try\x20manually:\x20','length','Updating\x20via\x20','Updated\x20to\x20v','timeout','\x20is\x20up\x20to\x20date.','Checking\x20for\x20updates...','28roQmlm','warn','12ZkvwuT','source','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','\x20→\x20','info','filter','repairCommand','validation','1856988zuaCFQ','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','Install\x20a\x20specific\x20CLI\x20version','fail','start','bun','/dist-tags','\x20install\x20-g\x20','slice','message','2156220icrpSg','\x20\x20CLI\x20Built-in\x20Skill\x20','current','18459108RRhcTr','923870JozmsF','log','expected\x20','gray','Beta\x20version:\x20','npm','code','pipe','string','latest','install','beta','@latest','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','object','bool','22843QahQEN','run','valid','...','execPath','\x20\x20Run\x20manually:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','read','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','succeed','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','version','Already\x20up\x20to\x20date\x20(v','Update\x20available:\x20',',\x20state\x20','toLowerCase','green','16aeEeMd','Current\x20version:\x20','Version\x20comparison\x20failed',',\x20found\x20','unknown','11KzGVEY','5759509czxJnS','trim','https://registry.npmjs.org/-/package/','86EccXen','Update\x20failed','entries'];a39_0x4b13=function(){return _0x31e841;};return a39_0x4b13();}function shouldInstallTarget(_0x46c1da,_0x57ff65){const _0x181b69=a39_0x3aac49;if(_0x57ff65[_0x181b69(0x1dc)]==='version'||_0x57ff65['source']===_0x181b69(0x1aa))return!a39_0x5c8bff['eq'](_0x46c1da,_0x57ff65[_0x181b69(0x1ba)]);return a39_0x5c8bff['lt'](_0x46c1da,_0x57ff65[_0x181b69(0x1ba)]);}function getInstallPlanLabel(_0x452056,_0x531ad3){const _0x3a4df4=a39_0x3aac49;switch(_0x531ad3[_0x3a4df4(0x1dc)]){case'beta':return _0x3a4df4(0x1a3)+a39_0x5d9e80[_0x3a4df4(0x1cc)](_0x452056)+_0x3a4df4(0x1de)+a39_0x5d9e80[_0x3a4df4(0x1bf)](_0x531ad3[_0x3a4df4(0x1ba)]);case _0x3a4df4(0x1ba):return'Requested\x20version:\x20'+a39_0x5d9e80['yellow'](_0x452056)+'\x20→\x20'+a39_0x5d9e80['green'](_0x531ad3['version']);case _0x3a4df4(0x1a8):default:return _0x3a4df4(0x1bc)+a39_0x5d9e80['yellow'](_0x452056)+_0x3a4df4(0x1de)+a39_0x5d9e80[_0x3a4df4(0x1bf)](_0x531ad3['version']);}}function repairCurrentBuiltinSkill(){const _0xac0d2d=a39_0x3aac49;console[_0xac0d2d(0x1a0)](a39_0x5d9e80['gray']('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x458f26=installBuiltinSkill();if(_0x458f26['ok'])return console[_0xac0d2d(0x1a0)](a39_0x5d9e80[_0xac0d2d(0x1a2)](_0xac0d2d(0x1ee)+_0x458f26[_0xac0d2d(0x1cf)]+_0xac0d2d(0x1d7))),!![];return console[_0xac0d2d(0x1da)](a39_0x5d9e80[_0xac0d2d(0x1cc)](_0xac0d2d(0x1e4)+_0x458f26[_0xac0d2d(0x1a5)]+']:\x20'+(_0x458f26[_0xac0d2d(0x1d0)]||_0xac0d2d(0x1c4)))),console[_0xac0d2d(0x1a0)](a39_0x5d9e80['gray'](_0xac0d2d(0x1b4)+CLI_BIN_NAME+'\x20cli-skill\x20install')),![];}function verifyUpdatedBuiltinSkill(_0xc11ec){const _0x1d61c1=a39_0x3aac49,_0x14a1db=inspectInstalledBuiltinSkillVersion(_0xc11ec);if(_0x14a1db[_0x1d61c1(0x1d1)]===_0x1d61c1(0x1ef))return console[_0x1d61c1(0x1a0)](a39_0x5d9e80['gray'](_0x1d61c1(0x1ee)+_0xc11ec+'\x20is\x20up\x20to\x20date.')),!![];const _0x319a80=_0x14a1db[_0x1d61c1(0x1cf)]?_0x1d61c1(0x1a1)+_0xc11ec+_0x1d61c1(0x1c3)+_0x14a1db[_0x1d61c1(0x1cf)]:_0x1d61c1(0x1a1)+_0xc11ec+_0x1d61c1(0x1bd)+_0x14a1db[_0x1d61c1(0x1d1)];return console['warn'](a39_0x5d9e80[_0x1d61c1(0x1cc)](_0x1d61c1(0x1dd)+_0x319a80)),console[_0x1d61c1(0x1a0)](a39_0x5d9e80[_0x1d61c1(0x1a2)](_0x1d61c1(0x1b4)+_0x14a1db[_0x1d61c1(0x1e1)])),![];}async function execute(_0x4d26c0){const _0x197a75=a39_0x3aac49;await validateUpdateFlags(_0x4d26c0);const _0x6d94ed=getCurrentVersion();console[_0x197a75(0x1a0)](_0x197a75(0x1c1)+_0x6d94ed);const _0x37baa5=a39_0x3e40a9(_0x197a75(0x1d8))[_0x197a75(0x1e7)](),_0x163475=await resolveTargetVersion(_0x4d26c0);if(!_0x163475){const _0x8406fe=_0x4d26c0[_0x197a75(0x1ae)]('beta')?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x197a75(0x1b7);return _0x37baa5[_0x197a75(0x1e6)](_0x8406fe),console['log'](a39_0x5d9e80[_0x197a75(0x1a2)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x197a75(0x1ab))),{'ok':![],'message':_0x8406fe};}const _0x4abb40=a39_0x5c8bff[_0x197a75(0x1b1)](VERSION),_0x4f7d75=a39_0x5c8bff['valid'](_0x163475[_0x197a75(0x1ba)]);if(!_0x4abb40||!_0x4f7d75)return _0x37baa5[_0x197a75(0x1e6)](_0x197a75(0x1c2)),{'ok':![],'message':_0x197a75(0x1c2)};if(!shouldInstallTarget(_0x4abb40,_0x163475)){const _0x2d4b6e=_0x163475[_0x197a75(0x1dc)]===_0x197a75(0x1ba)?_0x197a75(0x1cd)+_0x163475[_0x197a75(0x1ba)]+')':_0x197a75(0x1bb)+_0x163475[_0x197a75(0x1ba)]+')';return _0x37baa5[_0x197a75(0x1b8)](_0x2d4b6e),{'ok':repairCurrentBuiltinSkill()};}_0x37baa5[_0x197a75(0x1df)](getInstallPlanLabel(_0x6d94ed,_0x163475));const _0x2be927=detectPackageManager(),_0x396de7=_0x2be927===_0x197a75(0x1a4)?resolveNpmBin(_0x197a75(0x1a4)):_0x2be927,_0x2557a4=a39_0x3e40a9(_0x197a75(0x1d4)+_0x2be927+_0x197a75(0x1b2))[_0x197a75(0x1e7)]();try{return await execa(_0x396de7,[_0x197a75(0x1a9),'-g',NPM_PACKAGE_NAME+'@'+_0x163475[_0x197a75(0x1ba)]],{'stdio':_0x197a75(0x1a6)}),_0x2557a4[_0x197a75(0x1b8)](_0x197a75(0x1d5)+_0x163475[_0x197a75(0x1ba)]),console['log'](a39_0x5d9e80[_0x197a75(0x1a2)](_0x197a75(0x1ac))),{'ok':verifyUpdatedBuiltinSkill(_0x163475[_0x197a75(0x1ba)])};}catch(_0x1b1112){return _0x2557a4[_0x197a75(0x1e6)](_0x197a75(0x1ca)),console[_0x197a75(0x1d0)](a39_0x5d9e80['red']('\x20\x20'+_0x1b1112[_0x197a75(0x1ec)])),console['log'](a39_0x5d9e80[_0x197a75(0x1a2)](_0x197a75(0x1d2)+_0x2be927+_0x197a75(0x1ea)+NPM_PACKAGE_NAME+'@'+_0x163475[_0x197a75(0x1ba)])),{'ok':![],'message':_0x1b1112[_0x197a75(0x1ec)]};}}function a39_0x30b8(_0x38f063,_0x3761e6){_0x38f063=_0x38f063-0x19f;const _0x4b13e7=a39_0x4b13();let _0x30b8d1=_0x4b13e7[_0x38f063];return _0x30b8d1;}export const updateDefinition={'service':'update','command':a39_0x3aac49(0x1b0),'description':a39_0x3aac49(0x1b5),'risk':a39_0x3aac49(0x1b6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a40_0xc55e(){const _0x318a6d=['45gHTjPk','1068312yvpUdC','1031196zqcSkV','2meZloU','2168310AWyweq','7QVbhik','692024Xujatk','50329OGFeYB','1485880frFAna','1171852dkVxOO'];a40_0xc55e=function(){return _0x318a6d;};return a40_0xc55e();}(function(_0x31f2a3,_0x45c500){const _0x14c9ce=a40_0x2e6a,_0x10de6d=_0x31f2a3();while(!![]){try{const _0x46b319=parseInt(_0x14c9ce(0x157))/0x1*(parseInt(_0x14c9ce(0x153))/0x2)+parseInt(_0x14c9ce(0x151))/0x3+parseInt(_0x14c9ce(0x159))/0x4+parseInt(_0x14c9ce(0x154))/0x5+parseInt(_0x14c9ce(0x152))/0x6*(-parseInt(_0x14c9ce(0x155))/0x7)+parseInt(_0x14c9ce(0x156))/0x8*(-parseInt(_0x14c9ce(0x150))/0x9)+-parseInt(_0x14c9ce(0x158))/0xa;if(_0x46b319===_0x45c500)break;else _0x10de6d['push'](_0x10de6d['shift']());}catch(_0x3489d9){_0x10de6d['push'](_0x10de6d['shift']());}}}(a40_0xc55e,0x5ccb9));import{codegenSdk}from'../../commands/codegen/sdk.js';function a40_0x2e6a(_0xca8dd2,_0x160060){_0xca8dd2=_0xca8dd2-0x150;const _0xc55ef7=a40_0xc55e();let _0x2e6a6b=_0xc55ef7[_0xca8dd2];return _0x2e6a6b;}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a41_0x2a8c(_0xcc0b48,_0x4ff363){_0xcc0b48=_0xcc0b48-0x14c;const _0x5863ba=a41_0x5863();let _0x2a8c64=_0x5863ba[_0xcc0b48];return _0x2a8c64;}const a41_0x175ebb=a41_0x2a8c;(function(_0x571d64,_0x406045){const _0x14043f=a41_0x2a8c,_0x132441=_0x571d64();while(!![]){try{const _0x3b6c17=-parseInt(_0x14043f(0x159))/0x1*(parseInt(_0x14043f(0x164))/0x2)+-parseInt(_0x14043f(0x15d))/0x3*(parseInt(_0x14043f(0x14f))/0x4)+parseInt(_0x14043f(0x156))/0x5*(-parseInt(_0x14043f(0x15f))/0x6)+parseInt(_0x14043f(0x152))/0x7+-parseInt(_0x14043f(0x15e))/0x8*(-parseInt(_0x14043f(0x15b))/0x9)+-parseInt(_0x14043f(0x163))/0xa*(parseInt(_0x14043f(0x155))/0xb)+parseInt(_0x14043f(0x160))/0xc*(parseInt(_0x14043f(0x154))/0xd);if(_0x3b6c17===_0x406045)break;else _0x132441['push'](_0x132441['shift']());}catch(_0x19bde4){_0x132441['push'](_0x132441['shift']());}}}(a41_0x5863,0x28644));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':a41_0x175ebb(0x14d),'description':a41_0x175ebb(0x165),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a41_0x175ebb(0x15c),'type':a41_0x175ebb(0x151),'required':!![],'description':a41_0x175ebb(0x14c)},{'name':a41_0x175ebb(0x150),'type':'boolean','description':a41_0x175ebb(0x161)}],async 'execute'(_0x32eb34){const _0x22fec8=a41_0x175ebb,{dataset:_0x26c652,operation:_0x11e823}=await getOperationDetail(_0x32eb34[_0x22fec8(0x157)],_0x32eb34[_0x22fec8(0x158)](_0x22fec8(0x14e)),_0x32eb34['str'](_0x22fec8(0x15c))),_0x6b5de4=generateSdkCode(_0x26c652,_0x11e823,{'includeImports':!_0x32eb34[_0x22fec8(0x162)](_0x22fec8(0x150))});return{'ok':!![],'data':{'dataset':{'name':_0x26c652[_0x22fec8(0x15a)],'code':_0x26c652[_0x22fec8(0x14e)],'tableName':_0x26c652[_0x22fec8(0x153)]},'operation':_0x32eb34[_0x22fec8(0x158)](_0x22fec8(0x15c)),'code':_0x6b5de4}};}};function a41_0x5863(){const _0x139b3c=['string','311024KGiFPK','tableName','13yrgYeI','33wIjvGx','12185grHJTA','appCode','str','176bCNcbp','name','387VwXrZC','operation','365196LuuWZa','11288agqgwr','348jjBSSU','6671988htpfXU','Omit\x20import\x20statements\x20from\x20generated\x20code','bool','587540KduUGT','640SoYbtz','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','sdk','code','4EMZIfw','skip-imports'];a41_0x5863=function(){return _0x139b3c;};return a41_0x5863();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x3e6b24=a42_0x52c5;function a42_0x52c5(_0x204323,_0x598eb1){_0x204323=_0x204323-0x9a;const _0x3c7d3f=a42_0x3c7d();let _0x52c5be=_0x3c7d3f[_0x204323];return _0x52c5be;}(function(_0x417cf0,_0x254b01){const _0x2d94dd=a42_0x52c5,_0x28fbed=_0x417cf0();while(!![]){try{const _0x5a62ec=parseInt(_0x2d94dd(0xa2))/0x1+parseInt(_0x2d94dd(0xa5))/0x2*(parseInt(_0x2d94dd(0xab))/0x3)+parseInt(_0x2d94dd(0xaf))/0x4*(parseInt(_0x2d94dd(0xaa))/0x5)+-parseInt(_0x2d94dd(0x9a))/0x6+parseInt(_0x2d94dd(0x9e))/0x7*(-parseInt(_0x2d94dd(0xa7))/0x8)+parseInt(_0x2d94dd(0xa8))/0x9+-parseInt(_0x2d94dd(0x9d))/0xa*(parseInt(_0x2d94dd(0xa3))/0xb);if(_0x5a62ec===_0x254b01)break;else _0x28fbed['push'](_0x28fbed['shift']());}catch(_0x582e7e){_0x28fbed['push'](_0x28fbed['shift']());}}}(a42_0x3c7d,0x646a6));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a42_0x3e6b24(0xa4),'command':a42_0x3e6b24(0xa9),'description':a42_0x3e6b24(0xb2),'risk':a42_0x3e6b24(0xae),'flags':[SQLCODE_FLAG,{'name':a42_0x3e6b24(0xa0),'type':a42_0x3e6b24(0xb1),'description':a42_0x3e6b24(0x9f),'default':'sdk','enum':[a42_0x3e6b24(0x9b),a42_0x3e6b24(0x9c)]},{'name':a42_0x3e6b24(0xa1),'type':'boolean','description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x224b4c){const _0xf7d392=a42_0x3e6b24,_0x237c81=await getSqlQueryInfo(_0x224b4c['appCode'],_0x224b4c[_0xf7d392(0xad)](_0xf7d392(0xac))),_0x4b0c6e=_0x224b4c[_0xf7d392(0xad)](_0xf7d392(0xa0))||'sdk',_0xd897df=generateSqlCodeTemplate(_0x237c81,{'target':_0x4b0c6e,'includeImports':!_0x224b4c['bool'](_0xf7d392(0xa1))});return{'ok':!![],'data':{'sqlCode':_0x237c81[_0xf7d392(0xb0)],'sqlName':_0x237c81[_0xf7d392(0xa6)],'target':_0x4b0c6e,'code':_0xd897df}};}};function a42_0x3c7d(){const _0x1db4d1=['1266lXEojs','sqlcode','str','read','43240BLspap','sqlCode','string','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','49548ERXRtV','sdk','bff','5150260bqFXsA','5866PeGKun','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','target','no-imports','677011DzYYbH','22ocpZiz','codegen','2678onbHcn','sqlName','7128hAhyuW','6739299MRXagJ','sql','95jQOhmS'];a42_0x3c7d=function(){return _0x1db4d1;};return a42_0x3c7d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e2936,_0x6fedb9){const _0x1388cb=a43_0x3c4b,_0x4bdb52=_0x1e2936();while(!![]){try{const _0x2577cb=-parseInt(_0x1388cb(0x8b))/0x1*(-parseInt(_0x1388cb(0xa0))/0x2)+-parseInt(_0x1388cb(0x87))/0x3*(parseInt(_0x1388cb(0xa2))/0x4)+-parseInt(_0x1388cb(0x8d))/0x5+-parseInt(_0x1388cb(0x94))/0x6+-parseInt(_0x1388cb(0x86))/0x7+-parseInt(_0x1388cb(0xa3))/0x8+-parseInt(_0x1388cb(0x80))/0x9*(-parseInt(_0x1388cb(0x81))/0xa);if(_0x2577cb===_0x6fedb9)break;else _0x4bdb52['push'](_0x4bdb52['shift']());}catch(_0x3fb04e){_0x4bdb52['push'](_0x4bdb52['shift']());}}}(a43_0xa722,0xd6f43));import{CliErrors}from'../../errors.js';function a43_0xa722(){const _0x21e019=['global','project','string','bool','\x20<name>','App\x20code','5718996adTOqd','projectConfig','Usage:\x20','boolean','Added','\x20app\x20\x22','length','globalConfig','App\x20\x22','\x20Default\x20app\x20changed\x20to\x20\x22','Use\x20global\x20config\x20scope','object','2058184tQFKNw','appcode','552532LZLtTR','12349080YcbMRa','defaultApp','keys','\x20<name>\x20--appcode\x20<code>','\x20Note:\x20app\x20\x22','\x22\x20still\x20defined\x20in\x20','both','trim','46525743pPqNCI','10AyMWza','Missing\x20app\x20name.','apps','Updated','Removed\x20app\x20\x22','3672907mhAWnp','24LBGtFi','\x22\x20(appcode:\x20','validation','inherit','1OCnMbc','\x22\x20not\x20found.','5958010JeMLzy'];a43_0xa722=function(){return _0x21e019;};return a43_0xa722();}import{CLI_BIN_NAME}from'../../constant/cli.js';function a43_0x3c4b(_0x3ed86d,_0x3d8bb7){_0x3ed86d=_0x3ed86d-0x80;const _0xa722c5=a43_0xa722();let _0x3c4bb2=_0xa722c5[_0x3ed86d];return _0x3c4bb2;}import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x5d925b=a43_0x3c4b;return[{'name':_0x5d925b(0xa1),'type':_0x5d925b(0x90),'description':_0x5d925b(0x93),'required':!![]},{'name':_0x5d925b(0x8e),'type':_0x5d925b(0x97),'description':_0x5d925b(0x9e),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x1d0c36=a43_0x3c4b;return[{'name':'global','type':_0x1d0c36(0x97),'description':_0x1d0c36(0x9e),'default':![]}];}export async function validateAppName(_0x182a97,_0x109938){const _0x11e52f=a43_0x3c4b,_0x1d9e16=_0x182a97['args'][0x0]?.[_0x11e52f(0xaa)]();if(!_0x1d9e16)throw CliErrors[_0x11e52f(0x89)]('Missing\x20app\x20name.',_0x11e52f(0x96)+CLI_BIN_NAME+'\x20'+_0x109938+_0x11e52f(0x92));}export async function runAppAdd(_0x5d4ea4,_0xc25aa5){const _0x1799e3=a43_0x3c4b,_0x3f93f0=_0x5d4ea4['args'][0x0]?.[_0x1799e3(0xaa)]();if(!_0x3f93f0)throw CliErrors[_0x1799e3(0x89)]('Missing\x20app\x20name.',_0x1799e3(0x96)+CLI_BIN_NAME+'\x20'+_0xc25aa5+'\x20<name>\x20--appcode\x20<code>');const _0x140143=_0x5d4ea4['str']('appcode');if(!_0x140143)throw CliErrors['flagMissing']('appcode','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0xc25aa5+_0x1799e3(0xa6));const _0x1f29e0={'global':_0x5d4ea4['bool'](_0x1799e3(0x8e))},_0x413fe4=readConfig(_0x1f29e0);if(!_0x413fe4[_0x1799e3(0x83)])_0x413fe4[_0x1799e3(0x83)]={};const _0x3fbf45={'appcode':_0x140143,...collectAppProfileOverrides(_0x4ca4e6=>_0x5d4ea4['str'](_0x4ca4e6))},_0x503479=_0x413fe4[_0x1799e3(0x83)],_0xa6ccdf=!!_0x503479[_0x3f93f0];_0x503479[_0x3f93f0]=_0x3fbf45;if(!_0x413fe4[_0x1799e3(0xa4)])_0x413fe4[_0x1799e3(0xa4)]=_0x3f93f0;writeConfig(_0x413fe4,_0x1f29e0);const _0x47c7af=!_0xa6ccdf&&_0x413fe4[_0x1799e3(0xa4)]===_0x3f93f0?'\x20Set\x20as\x20default\x20app.':'',_0x592c76=(_0xa6ccdf?_0x1799e3(0x84):_0x1799e3(0x98))+_0x1799e3(0x99)+_0x3f93f0+_0x1799e3(0x88)+_0x140143+')'+scopeLabel(_0x1f29e0)+'.'+_0x47c7af;return{'ok':!![],'message':_0x592c76};}export async function runAppRemove(_0x407857,_0xbf6579){const _0x5d2bc2=a43_0x3c4b,_0x36f317=_0x407857['args'][0x0]?.[_0x5d2bc2(0xaa)]();if(!_0x36f317)throw CliErrors['validation'](_0x5d2bc2(0x82),_0x5d2bc2(0x96)+CLI_BIN_NAME+'\x20'+_0xbf6579+'\x20<name>\x20[--global]');const _0x3e9d1b=_0x407857[_0x5d2bc2(0x91)](_0x5d2bc2(0x8e)),{config:_0x2a4ee4,layers:_0x2b394d}=readRawConfigWithLayers(),_0x5b5280=_0x2a4ee4[_0x5d2bc2(0x83)]??{};if(!_0x5b5280[_0x36f317])throw CliErrors['validation'](_0x5d2bc2(0x9c)+_0x36f317+_0x5d2bc2(0x8c));const _0x3ab98a=_0x2b394d[_0x5d2bc2(0x9b)][_0x5d2bc2(0x83)]&&typeof _0x2b394d['globalConfig'][_0x5d2bc2(0x83)]===_0x5d2bc2(0x9f)?_0x2b394d[_0x5d2bc2(0x9b)][_0x5d2bc2(0x83)]:{},_0x4ef697=_0x2b394d['projectConfig'][_0x5d2bc2(0x83)]&&typeof _0x2b394d[_0x5d2bc2(0x95)][_0x5d2bc2(0x83)]==='object'?_0x2b394d['projectConfig'][_0x5d2bc2(0x83)]:{},_0xf7280c=appDefinedIn(_0x36f317,_0x3ab98a,_0x4ef697,_0x2b394d[_0x5d2bc2(0x95)][_0x5d2bc2(0x8a)]===![]),_0x2996cb=resolveAppScopeForWrite(_0x36f317,_0x3e9d1b,_0x2b394d),_0x2bf90b={'global':_0x2996cb===_0x5d2bc2(0x8e)},_0x41079c=readConfig(_0x2bf90b),_0x4ea3f6=_0x41079c[_0x5d2bc2(0x83)];if(!_0x4ea3f6||!_0x4ea3f6[_0x36f317])throw CliErrors[_0x5d2bc2(0x89)](_0x5d2bc2(0x9c)+_0x36f317+'\x22\x20not\x20found.');delete _0x4ea3f6[_0x36f317];let _0x4ada49='';if(_0x41079c[_0x5d2bc2(0xa4)]===_0x36f317){const _0x3936a1=Object[_0x5d2bc2(0xa5)](_0x4ea3f6);_0x41079c['defaultApp']=_0x3936a1[_0x5d2bc2(0x9a)]>0x0?_0x3936a1[0x0]:undefined,_0x41079c[_0x5d2bc2(0xa4)]?_0x4ada49=_0x5d2bc2(0x9d)+_0x41079c['defaultApp']+'\x22.':delete _0x41079c[_0x5d2bc2(0xa4)];}Object[_0x5d2bc2(0xa5)](_0x4ea3f6)[_0x5d2bc2(0x9a)]===0x0&&(delete _0x41079c['apps'],delete _0x41079c[_0x5d2bc2(0xa4)]);writeConfig(_0x41079c,_0x2bf90b);const _0x45db50=_0xf7280c===_0x5d2bc2(0xa9)?_0x5d2bc2(0xa7)+_0x36f317+_0x5d2bc2(0xa8)+(_0x2996cb===_0x5d2bc2(0x8f)?_0x5d2bc2(0x8e):_0x5d2bc2(0x8f))+'\x20config.':'';return{'ok':!![],'message':_0x5d2bc2(0x85)+_0x36f317+'\x22'+scopeLabel(_0x2bf90b)+'.'+_0x4ada49+_0x45db50};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25f571,_0x233b65){const _0x31f4bc=a44_0x4462,_0x44e628=_0x25f571();while(!![]){try{const _0x59d81f=parseInt(_0x31f4bc(0x161))/0x1+parseInt(_0x31f4bc(0x171))/0x2*(parseInt(_0x31f4bc(0x159))/0x3)+-parseInt(_0x31f4bc(0x16c))/0x4+parseInt(_0x31f4bc(0x15d))/0x5+-parseInt(_0x31f4bc(0x157))/0x6*(parseInt(_0x31f4bc(0x14f))/0x7)+parseInt(_0x31f4bc(0x16a))/0x8+parseInt(_0x31f4bc(0x151))/0x9*(-parseInt(_0x31f4bc(0x14e))/0xa);if(_0x59d81f===_0x233b65)break;else _0x44e628['push'](_0x44e628['shift']());}catch(_0x405cb8){_0x44e628['push'](_0x44e628['shift']());}}}(a44_0x4c19,0x225dd));import{input,checkbox,select}from'@inquirer/prompts';import a44_0x54075f from'chalk';import{validateAppcode}from'../../commands/common/validate.js';function a44_0x4462(_0x2d1fd7,_0x47e5a5){_0x2d1fd7=_0x2d1fd7-0x14e;const _0x4c1912=a44_0x4c19();let _0x44622f=_0x4c1912[_0x2d1fd7];return _0x44622f;}import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x2f2dda=a44_0x4462,_0x3c461b=await input({'message':_0x2f2dda(0x166),'validate':_0xbd3db9=>{const _0x5642c0=_0x2f2dda,_0x196b1e=validateAppcode(_0xbd3db9['trim']());return _0x196b1e[_0x5642c0(0x15e)]||_0x196b1e[_0x5642c0(0x15c)]||'Invalid\x20App\x20Code';}});return _0x3c461b[_0x2f2dda(0x172)]();}export async function promptAppSelection(_0x54dd6e){const _0x468dc1=a44_0x4462,_0x4bf1a2=[{'name':a44_0x54075f[_0x468dc1(0x16b)]('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x54dd6e[_0x468dc1(0x15b)]((_0x6d7734,_0x237b01)=>({'name':_0x6d7734[_0x468dc1(0x15f)]+'\x20\x20'+a44_0x54075f[_0x468dc1(0x15a)]('('+_0x6d7734['appCode']+')'),'value':_0x237b01}))],_0x3165aa=await checkbox({'message':_0x468dc1(0x167)+a44_0x54075f[_0x468dc1(0x164)](_0x54dd6e[_0x468dc1(0x168)])+'\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','choices':_0x4bf1a2,'loop':![]});if(_0x3165aa[_0x468dc1(0x169)](-0x1))return _0x468dc1(0x160);if(_0x3165aa[_0x468dc1(0x168)]===0x0)return'custom';return _0x3165aa[_0x468dc1(0x15b)](_0x1932af=>_0x54dd6e[_0x1932af]);}function a44_0x4c19(){const _0x1d2347=['skip','450573YSZiRL','gray','map','message','480555boFDCD','valid','appName','custom','120755cilbBB','\x0a未找到可用应用。','✎\x20自定义输入\x20appcode','cyan','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','请输入\x20App\x20Code:','获取到\x20','length','includes','1475288MVCaZp','yellow','877296yQapvy','find','(跳过,稍后配置)','✎\x20手动输入','\x20\x20(','2zQkMaa','trim','170oFJugR','6062rHQfMP','\x0a无法获取远程应用列表,请手动输入。','59139aiVUhn','未找到可用应用。','正在获取可用应用列表...','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','appCode','App\x20Code:','552pcOgBo'];a44_0x4c19=function(){return _0x1d2347;};return a44_0x4c19();}export async function promptSingleAppSelection(_0x17f95a){const _0x4bfa80=a44_0x4462,_0x205f56=[{'name':a44_0x54075f['gray'](_0x4bfa80(0x165)),'value':'skip'},{'name':a44_0x54075f['yellow'](_0x4bfa80(0x163)),'value':_0x4bfa80(0x160)},..._0x17f95a['map'](_0x23e174=>({'name':_0x23e174[_0x4bfa80(0x15f)]+'\x20\x20'+a44_0x54075f['gray']('('+_0x23e174[_0x4bfa80(0x155)]+')'),'value':_0x23e174[_0x4bfa80(0x155)]}))],_0x130499=await select({'message':'请选择要绑定的应用:','choices':_0x205f56});if(_0x130499===_0x4bfa80(0x158))return _0x4bfa80(0x158);if(_0x130499===_0x4bfa80(0x160))return'custom';return _0x17f95a[_0x4bfa80(0x16d)](_0x2976f3=>_0x2976f3[_0x4bfa80(0x155)]===_0x130499);}export async function selectSingleAppcode(_0xcddc95){const _0x2389f6=a44_0x4462;if(!_0xcddc95)return writeCliSideChannelLine(a44_0x54075f[_0x2389f6(0x15a)](_0x2389f6(0x154))),_fallbackOrSkip();writeCliSideChannelLine('正在获取可用应用列表...');let _0xd294f;try{_0xd294f=await withActiveCookie(_0xcddc95,()=>listRemoteApps());}catch(_0x17e38f){writeCliSideChannelLine(a44_0x54075f['yellow']('无法获取远程应用列表,请手动输入。'));if(_0x17e38f instanceof Error)writeCliSideChannelLine(a44_0x54075f['gray'](_0x2389f6(0x170)+_0x17e38f['message']+')'));return _fallbackOrSkip();}if(_0xd294f[_0x2389f6(0x168)]===0x0)return writeCliSideChannelLine(a44_0x54075f[_0x2389f6(0x16b)](_0x2389f6(0x152))),_fallbackOrSkip();const _0x401113=await promptSingleAppSelection(_0xd294f);if(_0x401113===_0x2389f6(0x158))return'';if(_0x401113===_0x2389f6(0x160))return promptCustomAppcode();return _0x401113[_0x2389f6(0x155)];}export async function selectMultipleApps(_0x30cd7e){const _0x1d3e35=a44_0x4462;writeCliSideChannelLine(_0x1d3e35(0x153));let _0x42bf61;try{_0x42bf61=await withActiveCookie(_0x30cd7e,()=>listRemoteApps());}catch(_0x40fc8f){writeCliSideChannelLine(_0x1d3e35(0x150));if(_0x40fc8f instanceof Error)writeCliSideChannelLine(_0x1d3e35(0x170)+_0x40fc8f[_0x1d3e35(0x15c)]+')');return _0x1d3e35(0x160);}if(_0x42bf61[_0x1d3e35(0x168)]===0x0)return writeCliSideChannelLine(_0x1d3e35(0x162)),_0x1d3e35(0x160);return promptAppSelection(_0x42bf61);}async function _fallbackOrSkip(){const _0x16512e=a44_0x4462,_0x5f3e82=await select({'message':_0x16512e(0x156),'choices':[{'name':a44_0x54075f['gray'](_0x16512e(0x16e)),'value':_0x16512e(0x158)},{'name':a44_0x54075f[_0x16512e(0x16b)](_0x16512e(0x16f)),'value':'manual'}]});if(_0x5f3e82===_0x16512e(0x158))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a45_0x5e0e(){const _0x5badee=['has','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','\x20completed\x20successfully.','13335JKjlOm','7976768toTWNv','Task\x20','\x20failed.','4qcLJKy','Async\x20task\x20','4139136NJqwyk','3527502qXqBGs','FAILED','errorMessage','replace','560944CeCdXr','\x20--appcode\x20','string','taskId','\x20task\x20status\x20--task-id\x20','\x20is\x20processing.','status','3uPDfok','SUCCESS','684TncBKT','1664735QbJXRL','PROCESSING','16959020VcqHWC','\x20is\x20pending.','PENDING','apiError','trim','\x20response\x20did\x20not\x20contain\x20a\x20status.'];a45_0x5e0e=function(){return _0x5badee;};return a45_0x5e0e();}const a45_0x26f35d=a45_0x482a;(function(_0x4f0dea,_0x44374f){const _0x20bfde=a45_0x482a,_0x52e191=_0x4f0dea();while(!![]){try{const _0x180549=-parseInt(_0x20bfde(0x165))/0x1*(-parseInt(_0x20bfde(0x15e))/0x2)+parseInt(_0x20bfde(0x17a))/0x3*(parseInt(_0x20bfde(0x177))/0x4)+parseInt(_0x20bfde(0x168))/0x5+parseInt(_0x20bfde(0x167))/0x6*(-parseInt(_0x20bfde(0x173))/0x7)+parseInt(_0x20bfde(0x174))/0x8+-parseInt(_0x20bfde(0x179))/0x9+-parseInt(_0x20bfde(0x16a))/0xa;if(_0x180549===_0x44374f)break;else _0x52e191['push'](_0x52e191['shift']());}catch(_0x3189a6){_0x52e191['push'](_0x52e191['shift']());}}}(a45_0x5e0e,0xedded));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a45_0x26f35d(0x166),a45_0x26f35d(0x17b)]),NON_TERMINAL_STATUSES=new Set(['PENDING',a45_0x26f35d(0x169)]);export function normalizeAsyncTask(_0x11d212){const _0x18d571=a45_0x26f35d,_0xfb3591=typeof _0x11d212?.[_0x18d571(0x161)]===_0x18d571(0x160)?_0x11d212[_0x18d571(0x161)][_0x18d571(0x16e)]():'';if(!_0xfb3591)throw CliErrors[_0x18d571(0x16d)](_0x18d571(0x171));const _0x4ebffc=typeof _0x11d212[_0x18d571(0x164)]===_0x18d571(0x160)?_0x11d212[_0x18d571(0x164)][_0x18d571(0x16e)]()['toUpperCase']():'';if(!_0x4ebffc)throw CliErrors[_0x18d571(0x16d)](_0x18d571(0x178)+_0xfb3591+_0x18d571(0x16f));return{'taskId':_0xfb3591,'status':_0x4ebffc,'errorMessage':typeof _0x11d212['errorMessage']===_0x18d571(0x160)&&_0x11d212['errorMessage'][_0x18d571(0x16e)]()?_0x11d212[_0x18d571(0x17c)]['trim']():null,'isTerminal':TERMINAL_STATUSES[_0x18d571(0x170)](_0x4ebffc),'knownStatus':TERMINAL_STATUSES[_0x18d571(0x170)](_0x4ebffc)||NON_TERMINAL_STATUSES[_0x18d571(0x170)](_0x4ebffc)};}function a45_0x482a(_0x551a78,_0x2bd5f4){_0x551a78=_0x551a78-0x15e;const _0x5e0ed3=a45_0x5e0e();let _0x482a81=_0x5e0ed3[_0x551a78];return _0x482a81;}export function buildAsyncTaskStatusCommand(_0x321144,_0x560c6a){const _0x6abe85=a45_0x26f35d;return CLI_BIN_NAME+_0x6abe85(0x162)+quoteShellArg(_0x321144)+_0x6abe85(0x15f)+quoteShellArg(_0x560c6a)+'\x20--format\x20compress';}export function asyncTaskMessage(_0x27699b){const _0xf2f0a3=a45_0x26f35d;switch(_0x27699b[_0xf2f0a3(0x164)]){case _0xf2f0a3(0x16c):return _0xf2f0a3(0x175)+_0x27699b[_0xf2f0a3(0x161)]+_0xf2f0a3(0x16b);case _0xf2f0a3(0x169):return _0xf2f0a3(0x175)+_0x27699b[_0xf2f0a3(0x161)]+_0xf2f0a3(0x163);case _0xf2f0a3(0x166):return _0xf2f0a3(0x175)+_0x27699b[_0xf2f0a3(0x161)]+_0xf2f0a3(0x172);case _0xf2f0a3(0x17b):return _0x27699b[_0xf2f0a3(0x17c)]?'Task\x20'+_0x27699b[_0xf2f0a3(0x161)]+'\x20failed:\x20'+_0x27699b[_0xf2f0a3(0x17c)]:_0xf2f0a3(0x175)+_0x27699b['taskId']+_0xf2f0a3(0x176);default:return _0xf2f0a3(0x175)+_0x27699b['taskId']+'\x20returned\x20unknown\x20status\x20'+_0x27699b['status']+'.';}}function quoteShellArg(_0x89ef5b){const _0x17ba74=a45_0x26f35d;return'\x27'+_0x89ef5b[_0x17ba74(0x17d)](/'/g,'\x27\x5c\x27\x27')+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5287de,_0x413b2a){var _0x44cc37=a46_0x284e,_0x5e7651=_0x5287de();while(!![]){try{var _0x2ff2a6=parseInt(_0x44cc37(0x1a4))/0x1*(-parseInt(_0x44cc37(0x1a9))/0x2)+parseInt(_0x44cc37(0x19f))/0x3+parseInt(_0x44cc37(0x1a2))/0x4*(-parseInt(_0x44cc37(0x1a1))/0x5)+parseInt(_0x44cc37(0x1a3))/0x6*(-parseInt(_0x44cc37(0x1a8))/0x7)+-parseInt(_0x44cc37(0x1a0))/0x8*(parseInt(_0x44cc37(0x1a5))/0x9)+-parseInt(_0x44cc37(0x19d))/0xa+parseInt(_0x44cc37(0x1a6))/0xb*(parseInt(_0x44cc37(0x19e))/0xc);if(_0x2ff2a6===_0x413b2a)break;else _0x5e7651['push'](_0x5e7651['shift']());}catch(_0x16ec80){_0x5e7651['push'](_0x5e7651['shift']());}}}(a46_0x4948,0x81217));function a46_0x284e(_0x2aaa9b,_0x179c1d){_0x2aaa9b=_0x2aaa9b-0x19c;var _0x4948ef=a46_0x4948();var _0x284e6c=_0x4948ef[_0x2aaa9b];return _0x284e6c;}function a46_0x4948(){var _0x39855b=['90ySzeFP','774961pcQkBM','url','105YxQGja','793700urwmuY','method','defineProperties','10192690vFgKrX','408CzhGoM','2044077rxjQOn','112336OazBly','50aVdXKK','221996mwUfHu','174498TffEBt','1sueAwO'];a46_0x4948=function(){return _0x39855b;};return a46_0x4948();}export function asDryRunResult(_0x2dce11,_0x5d3f82){var _0x3882ab=a46_0x284e;return Object[_0x3882ab(0x19c)](_0x2dce11,{'method':{'value':_0x5d3f82[_0x3882ab(0x1aa)],'enumerable':![]},'url':{'value':_0x5d3f82[_0x3882ab(0x1a7)],'enumerable':![]},..._0x5d3f82['description']?{'description':{'value':_0x5d3f82['description'],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x4ae170=a47_0x2665;(function(_0x1d9825,_0x4d0449){const _0x430c47=a47_0x2665,_0x1274c3=_0x1d9825();while(!![]){try{const _0x3386bd=parseInt(_0x430c47(0x1f0))/0x1*(-parseInt(_0x430c47(0x1f5))/0x2)+parseInt(_0x430c47(0x1ef))/0x3*(-parseInt(_0x430c47(0x1f3))/0x4)+parseInt(_0x430c47(0x1e0))/0x5+-parseInt(_0x430c47(0x1e5))/0x6*(-parseInt(_0x430c47(0x1ed))/0x7)+-parseInt(_0x430c47(0x1e1))/0x8+parseInt(_0x430c47(0x1e6))/0x9+parseInt(_0x430c47(0x1ea))/0xa;if(_0x3386bd===_0x4d0449)break;else _0x1274c3['push'](_0x1274c3['shift']());}catch(_0x3b1d11){_0x1274c3['push'](_0x1274c3['shift']());}}}(a47_0x6ef2,0x54a2f));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a47_0x4ae170(0x1e8)};export const CODE_FLAG={'name':a47_0x4ae170(0x1eb),'type':a47_0x4ae170(0x1e3),'required':!![],'description':a47_0x4ae170(0x1de),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a47_0x4ae170(0x1de)};export const SQLCODE_FLAG={'name':a47_0x4ae170(0x1e9),'type':a47_0x4ae170(0x1e3),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a47_0x4ae170(0x1f4)}};export const APPCODE_FLAG_OPTIONAL={'name':a47_0x4ae170(0x1df),'type':a47_0x4ae170(0x1e3),'required':![],'description':a47_0x4ae170(0x1e2)};function a47_0x6ef2(){const _0x2bd455=['a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','sqlcode','1699270skLLWv','code','number','1036217xITIvr','dbtype','278691RWGuKP','36RZylpT','App\x20code\x20(e.g.\x20app-xxxxx)','Database\x20product\x20type','4FHFAgS','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','11486aOsywL','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','appcode','486370kjlGOM','4523272wppebX','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','string','MYSQL','24ulqAHn','3171600DjmrNB','POSTGRESQL'];a47_0x6ef2=function(){return _0x2bd455;};return a47_0x6ef2();}export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a47_0x4ae170(0x1f1)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a47_0x4ae170(0x1ec),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};function a47_0x2665(_0x156116,_0x1c385e){_0x156116=_0x156116-0x1de;const _0x6ef242=a47_0x6ef2();let _0x266548=_0x6ef242[_0x156116];return _0x266548;}export const DB_TYPE_FLAG={'name':a47_0x4ae170(0x1ee),'type':a47_0x4ae170(0x1e3),'required':!![],'description':a47_0x4ae170(0x1f2),'enum':[a47_0x4ae170(0x1e4),a47_0x4ae170(0x1e7)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x619d(){const _0x152f12=['42rnOqMp','37592mDMqrV','validation','94612KINeOn','259vqJvmu','1190888geicmC','\x20MB','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','size','isFile','4238574CXDQlo','8226qUlAWY','695933uDjFZP','10MMNARg','\x20path\x20is\x20required.','ceil','1170qiYiBE','19884216PjCYzC','File\x20is\x20not\x20a\x20regular\x20file:\x20'];a48_0x619d=function(){return _0x152f12;};return a48_0x619d();}(function(_0x49ce9a,_0x3fa2f9){const _0x2651bf=a48_0x4555,_0x3ddab9=_0x49ce9a();while(!![]){try{const _0x3b591d=-parseInt(_0x2651bf(0x16b))/0x1+-parseInt(_0x2651bf(0x162))/0x2*(parseInt(_0x2651bf(0x15f))/0x3)+parseInt(_0x2651bf(0x164))/0x4*(parseInt(_0x2651bf(0x16c))/0x5)+-parseInt(_0x2651bf(0x169))/0x6+parseInt(_0x2651bf(0x163))/0x7*(parseInt(_0x2651bf(0x160))/0x8)+parseInt(_0x2651bf(0x16a))/0x9*(-parseInt(_0x2651bf(0x15c))/0xa)+parseInt(_0x2651bf(0x15d))/0xb;if(_0x3b591d===_0x3fa2f9)break;else _0x3ddab9['push'](_0x3ddab9['shift']());}catch(_0x20a23a){_0x3ddab9['push'](_0x3ddab9['shift']());}}}(a48_0x619d,0x62f83));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x165193){const _0x4d4265=a48_0x4555;if(_0x165193>=BYTES_PER_MB){const _0x3aa315=Math[_0x4d4265(0x15b)](_0x165193/BYTES_PER_MB*0x64)/0x64;return _0x3aa315['toFixed'](0x2)+_0x4d4265(0x165);}return _0x165193+'\x20B';}function a48_0x4555(_0x4448d7,_0x41715f){_0x4448d7=_0x4448d7-0x15a;const _0x619d9e=a48_0x619d();let _0x4555e4=_0x619d9e[_0x4448d7];return _0x4555e4;}export function requireDevelopmentUploadFile(_0x357da1,_0x463316){const _0x580e3b=a48_0x4555,_0x40a624=_0x357da1['trim']();if(!_0x40a624)throw CliErrors[_0x580e3b(0x161)](_0x463316+_0x580e3b(0x15a));if(!existsSync(_0x40a624))throw CliErrors[_0x580e3b(0x161)]('File\x20not\x20found:\x20'+_0x40a624);const _0x335aef=statSync(_0x40a624);if(!_0x335aef[_0x580e3b(0x168)]())throw CliErrors['validation'](_0x580e3b(0x15e)+_0x40a624);if(_0x335aef['size']>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x580e3b(0x161)](_0x580e3b(0x166)+_0x40a624+'\x20('+formatBytes(_0x335aef[_0x580e3b(0x167)])+')');return{'path':_0x40a624,'size':_0x335aef[_0x580e3b(0x167)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a49_0x3fdf(){const _0x1975b2=['4031024QLAJGQ','11393170IVAMZV','3yOydVw','App\x20Code\x20cannot\x20be\x20empty','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','length','App\x20Code\x20cannot\x20exceed\x20100\x20characters','1215795YsHvbf','7AMTWCO','2058572cETWVl','5DPxfDq','515178gCmwYB','11DnzKhJ','4053771rxsZvy','3943878MWTLSe','test'];a49_0x3fdf=function(){return _0x1975b2;};return a49_0x3fdf();}function a49_0xf770(_0x13dace,_0x5abbee){_0x13dace=_0x13dace-0xe8;const _0x3fdf1c=a49_0x3fdf();let _0xf770f8=_0x3fdf1c[_0x13dace];return _0xf770f8;}(function(_0x51c209,_0x4aa64c){const _0x105c91=a49_0xf770,_0x12cf78=_0x51c209();while(!![]){try{const _0x58e8a3=parseInt(_0x105c91(0xf4))/0x1*(parseInt(_0x105c91(0xed))/0x2)+-parseInt(_0x105c91(0xe9))/0x3+-parseInt(_0x105c91(0xeb))/0x4*(parseInt(_0x105c91(0xec))/0x5)+parseInt(_0x105c91(0xf0))/0x6*(-parseInt(_0x105c91(0xea))/0x7)+parseInt(_0x105c91(0xf2))/0x8+-parseInt(_0x105c91(0xef))/0x9+-parseInt(_0x105c91(0xf3))/0xa*(-parseInt(_0x105c91(0xee))/0xb);if(_0x58e8a3===_0x4aa64c)break;else _0x12cf78['push'](_0x12cf78['shift']());}catch(_0x10f05b){_0x12cf78['push'](_0x12cf78['shift']());}}}(a49_0x3fdf,0x5ece2));export function validateAppcode(_0x482d8a){const _0x540e9b=a49_0xf770,_0x54b48b=_0x482d8a['trim']();if(!_0x54b48b)return{'valid':![],'message':_0x540e9b(0xf5)};if(_0x54b48b[_0x540e9b(0xf7)]>0x64)return{'valid':![],'message':_0x540e9b(0xe8)};if(!/^[A-Za-z0-9_-]+$/[_0x540e9b(0xf1)](_0x54b48b))return{'valid':![],'message':_0x540e9b(0xf6)};return{'valid':!![]};}
|