@lovrabet/rabetbase-cli 2.5.2 → 2.5.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +2 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.d.ts +7 -0
- package/lib/commands/bff/logs.js +1 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.d.ts +21 -0
- package/lib/commands/dataset/batch-design.js +1 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.d.ts +2 -0
- package/lib/commands/flow/create.js +1 -0
- package/lib/commands/flow/detail.d.ts +2 -0
- package/lib/commands/flow/detail.js +1 -0
- package/lib/commands/flow/index.d.ts +3 -0
- package/lib/commands/flow/index.js +1 -0
- package/lib/commands/flow/list.d.ts +2 -0
- package/lib/commands/flow/list.js +1 -0
- package/lib/commands/flow/publish.d.ts +2 -0
- package/lib/commands/flow/publish.js +1 -0
- package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
- package/lib/commands/flow/runtime-resources-shared.js +1 -0
- package/lib/commands/flow/runtime-role-list.d.ts +2 -0
- package/lib/commands/flow/runtime-role-list.js +1 -0
- package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
- package/lib/commands/flow/runtime-role-user-list.js +1 -0
- package/lib/commands/flow/runtime-user-search.d.ts +2 -0
- package/lib/commands/flow/runtime-user-search.js +1 -0
- package/lib/commands/flow/shared.d.ts +41 -0
- package/lib/commands/flow/shared.js +1 -0
- package/lib/commands/flow/update.d.ts +2 -0
- package/lib/commands/flow/update.js +1 -0
- package/lib/commands/flow/validate.d.ts +3 -0
- package/lib/commands/flow/validate.js +1 -0
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.d.ts +23 -0
- package/lib/config/region-config.js +1 -0
- package/lib/config/schema.d.ts +15 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +6 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +13 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +172 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.d.ts +55 -0
- package/lib/core/bff/hook-directory.js +1 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +15 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.d.ts +628 -0
- package/lib/core/flow-config.js +1 -0
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.d.ts +6 -0
- package/lib/core/page/lr-smart-jsx.js +1 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +2 -8
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +2 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +27 -8
- package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
- package/skills/rabetbase/guides/backend-function.md +19 -9
- package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
- package/skills/rabetbase/guides/conflict-detection.md +2 -0
- package/skills/rabetbase/guides/page-development-workflow.md +3 -0
- package/skills/rabetbase/guides/sdk-client-generation.md +6 -5
- package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
- package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
- package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
- package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
- package/skills/rabetbase/references/rabetbase-bff-pull.md +9 -3
- package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
- package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
- package/skills/rabetbase/references/rabetbase-config.md +10 -9
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
- package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
- package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
- package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
- package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
- package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
- package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
- package/skills/rabetbase.manifest.json +9 -3
- package/templates/generate-api/client.ts.tpl +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x32af4f=a32_0x3139;(function(_0x57297a,_0x28e51d){const _0xe04cc4=a32_0x3139,_0x1a3de4=_0x57297a();while(!![]){try{const _0x42d5bb=parseInt(_0xe04cc4(0x159))/0x1+-parseInt(_0xe04cc4(0x15e))/0x2+-parseInt(_0xe04cc4(0x143))/0x3*(-parseInt(_0xe04cc4(0x170))/0x4)+parseInt(_0xe04cc4(0x16b))/0x5*(parseInt(_0xe04cc4(0x14e))/0x6)+-parseInt(_0xe04cc4(0x161))/0x7*(-parseInt(_0xe04cc4(0x175))/0x8)+-parseInt(_0xe04cc4(0x165))/0x9*(-parseInt(_0xe04cc4(0x142))/0xa)+parseInt(_0xe04cc4(0x177))/0xb*(-parseInt(_0xe04cc4(0x174))/0xc);if(_0x42d5bb===_0x28e51d)break;else _0x1a3de4['push'](_0x1a3de4['shift']());}catch(_0x2ddd80){_0x1a3de4['push'](_0x1a3de4['shift']());}}}(a32_0x4001,0x630be));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a32_0x3139(_0x2e0962,_0x592b07){_0x2e0962=_0x2e0962-0x142;const _0x4001f6=a32_0x4001();let _0x3139d6=_0x4001f6[_0x2e0962];return _0x3139d6;}function a32_0x4001(){const _0x181709=['Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','1539016RIyGck','\x20(local\x20file\x20moved\x20to\x20trash)','map','10829AASkMW','find','functions','stringify','45LDaGVt','keys','\x20\x20-\x20','validation','No\x20lock\x20entry\x20found\x20for\x20\x22','startsWith','1467705PTjaXQ','target','split','Function\x20not\x20found:\x20','filter','4CQHioN','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','/api/management/library/scripts/delete','scriptsRootDir','7536bDCbxd','3704JDdEqt','trashDir','26708sNUzDZ','scriptsRoot','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','1360460nctSFS','632013prfVCL','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','toISOString','POST','trashedTo','join','replace','remoteId','delete','high-risk-write','string','12RNqHug','appCode','str','apps','length','parse','Would\x20delete\x20','Multiple\x20functions\x20match\x20\x22','Lock\x20scope\x20for\x20app\x20\x22','Backend\x20Function\x20lock\x20file\x20not\x20found.','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','505742elTBPl','projectRoot','lockFilePath','bff'];a32_0x4001=function(){return _0x181709;};return a32_0x4001();}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a32_0x32af4f(0x15c),'command':a32_0x32af4f(0x14b),'description':a32_0x32af4f(0x144),'risk':a32_0x32af4f(0x14c),'flags':[{'name':'target','type':a32_0x32af4f(0x14d),'required':!![],'description':a32_0x32af4f(0x171)}],async 'validate'(_0xb9588d){const _0x27663b=a32_0x32af4f,_0x126e02=loadBffProjectConfig(_0xb9588d[_0x27663b(0x14f)]),_0x3848db=await readBffLockFile(_0x126e02['lockFilePath']);if(!_0x3848db)throw CliErrors[_0x27663b(0x168)](_0x27663b(0x15d));},async 'dryRun'(_0x4ef389){const _0x5af110=a32_0x32af4f,_0xcab1b1=loadBffProjectConfig(_0x4ef389['appCode']),_0x39592e=await readBffLockFile(_0xcab1b1[_0x5af110(0x15b)]);if(!_0x39592e)throw CliErrors[_0x5af110(0x168)](_0x5af110(0x157));const {appLock:_0x1b466d}=ensureLockScope(_0x39592e,_0x4ef389[_0x5af110(0x14f)],_0xcab1b1['scriptsRoot'],_0x5af110(0x14b)),_0x2d22e1=_0x4ef389[_0x5af110(0x150)](_0x5af110(0x16c)),_0x3e5b8d=Object[_0x5af110(0x166)](_0x1b466d[_0x5af110(0x163)]),_0x452660=resolveDeleteTarget(_0x2d22e1,_0x3e5b8d),_0x4445e7=_0x1b466d['functions'][_0x452660];if(!_0x4445e7)throw CliErrors[_0x5af110(0x168)](_0x5af110(0x169)+_0x452660+'\x22.');const _0x4e76b4=resolveLocalFilePathFromLockKey(_0xcab1b1,_0x452660),_0x120e4e=relative(_0xcab1b1[_0x5af110(0x15a)],_0x4e76b4),_0x55cc72=join(_0xcab1b1[_0x5af110(0x176)],'<timestamp>',_0x120e4e);return{'method':_0x5af110(0x146),'url':_0x5af110(0x172),'body':{'appCode':_0x4ef389['appCode'],'target':_0x452660,'remoteId':_0x4445e7[_0x5af110(0x14a)],'localFilePath':_0x4e76b4,'trashedPath':_0x55cc72},'description':_0x5af110(0x154)+_0x452660+_0x5af110(0x179)};},async 'execute'(_0xf43c7d){const _0x591c9a=a32_0x32af4f,_0xaa0da5=loadBffProjectConfig(_0xf43c7d[_0x591c9a(0x14f)]),_0x33c727=await readBffLockFile(_0xaa0da5['lockFilePath']);if(!_0x33c727)throw CliErrors[_0x591c9a(0x168)](_0x591c9a(0x157));const {lockData:_0x5c68b0,appLock:_0x4e0c30}=ensureLockScope(_0x33c727,_0xf43c7d[_0x591c9a(0x14f)],_0xaa0da5[_0x591c9a(0x178)],_0x591c9a(0x14b)),_0x27f179=JSON[_0x591c9a(0x153)](JSON[_0x591c9a(0x164)](_0x5c68b0)),_0x2b4bef=_0x27f179[_0x591c9a(0x151)][_0xf43c7d[_0x591c9a(0x14f)]];if(!_0x2b4bef)throw new Error(_0x591c9a(0x156)+_0xf43c7d[_0x591c9a(0x14f)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x55e2db=_0xf43c7d['str'](_0x591c9a(0x16c)),_0x3009c5=Object[_0x591c9a(0x166)](_0x2b4bef['functions']),_0x141846=resolveDeleteTarget(_0x55e2db,_0x3009c5),_0x1bb261=_0x2b4bef[_0x591c9a(0x163)][_0x141846];if(!_0x1bb261)throw CliErrors[_0x591c9a(0x168)](_0x591c9a(0x169)+_0x141846+'\x22.');await deleteBffScript(_0x1bb261[_0x591c9a(0x14a)]),delete _0x2b4bef[_0x591c9a(0x163)][_0x141846],_0x2b4bef['lastSync']=new Date()[_0x591c9a(0x145)](),await writeBffLockFile(_0xaa0da5[_0x591c9a(0x15b)],_0x27f179);const _0x56b7e5=resolveLocalFilePathFromLockKey(_0xaa0da5,_0x141846);let _0x5b022c;await fileExists(_0x56b7e5)&&(_0x5b022c=await moveToTrash(_0xaa0da5[_0x591c9a(0x15a)],_0xaa0da5[_0x591c9a(0x176)],_0x56b7e5),await cleanupEmptyDirectories(dirname(_0x56b7e5),_0xaa0da5[_0x591c9a(0x173)]));await waitForDeleteSettlement(_0xaa0da5[_0x591c9a(0x15b)],_0xf43c7d[_0x591c9a(0x14f)],_0x141846,_0x56b7e5),await sleep(0x96);const _0x4eef80={'deleted':_0x141846,'remoteId':_0x1bb261[_0x591c9a(0x14a)]};if(_0x5b022c)_0x4eef80[_0x591c9a(0x147)]=_0x5b022c;return{'ok':!![],'data':_0x4eef80,'message':'Deleted\x20'+_0x141846+(_0x5b022c?_0x591c9a(0x15f):'')};}};function resolveDeleteTarget(_0x525e31,_0x4a3e85){const _0x234f5e=a32_0x32af4f;if(_0x525e31['includes']('/')){const _0x1568a7=_0x4a3e85[_0x234f5e(0x162)](_0x549d7e=>_0x549d7e===_0x525e31);if(!_0x1568a7)throw CliErrors['validation'](_0x234f5e(0x16e)+_0x525e31);return _0x1568a7;}const _0x34ea38=_0x4a3e85[_0x234f5e(0x16f)](_0x4ac6a2=>_0x4ac6a2[_0x234f5e(0x16d)]('/')['at'](-0x1)===_0x525e31);if(_0x34ea38[_0x234f5e(0x152)]===0x0)throw CliErrors[_0x234f5e(0x168)]('Function\x20not\x20found:\x20'+_0x525e31);if(_0x34ea38['length']>0x1)throw CliErrors[_0x234f5e(0x168)](_0x234f5e(0x155)+_0x525e31+_0x234f5e(0x158)+_0x34ea38[_0x234f5e(0x160)](_0x44dfd6=>_0x234f5e(0x167)+_0x44dfd6)[_0x234f5e(0x148)]('\x0a'));return _0x34ea38[0x0];}async function moveToTrash(_0x3a44a7,_0x12ca74,_0x2946cf){const _0xb26f76=a32_0x32af4f,_0x10d4ee=new Date()[_0xb26f76(0x145)]()[_0xb26f76(0x149)](/[:.]/g,'-'),_0x31825d=relative(_0x3a44a7,_0x2946cf),_0x30f124=join(_0x12ca74,_0x10d4ee,_0x31825d);return await mkdir(dirname(_0x30f124),{'recursive':!![]}),await rename(_0x2946cf,_0x30f124),_0x30f124;}async function cleanupEmptyDirectories(_0x1db6f7,_0x55f3a5){const _0x1a9369=a32_0x32af4f;let _0x425b01=resolve(_0x1db6f7);const _0x47c846=resolve(_0x55f3a5);while(_0x425b01[_0x1a9369(0x16a)](''+_0x47c846+sep)||_0x425b01===_0x47c846){if(_0x425b01===_0x47c846)return;try{const _0x429b93=await readdir(_0x425b01);if(_0x429b93[_0x1a9369(0x152)]>0x0)return;await rmdir(_0x425b01);}catch{return;}_0x425b01=dirname(_0x425b01);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3dd83b,_0x1b40a7,_0x2173ec,_0x1d7fd0){const _0x8a11e8=a32_0x32af4f;for(let _0x513ef0=0x0;_0x513ef0<DELETE_SETTLE_RETRY_COUNT;_0x513ef0+=0x1){const _0x49ed84=await readBffLockFile(_0x3dd83b),_0x528978=!!_0x49ed84?.[_0x8a11e8(0x151)]?.[_0x1b40a7]?.[_0x8a11e8(0x163)]?.[_0x2173ec],_0x5ab59c=await fileExists(_0x1d7fd0);if(!_0x528978&&!_0x5ab59c)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x2173ec+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x280e(_0x5b1cb9,_0x3eee8b){_0x5b1cb9=_0x5b1cb9-0x125;const _0x129664=a33_0x1296();let _0x280eae=_0x129664[_0x5b1cb9];return _0x280eae;}const a33_0x592c54=a33_0x280e;(function(_0x4cda98,_0x194fd8){const _0x309c53=a33_0x280e,_0x14e694=_0x4cda98();while(!![]){try{const _0x2a9bf3=parseInt(_0x309c53(0x12c))/0x1+parseInt(_0x309c53(0x12b))/0x2*(-parseInt(_0x309c53(0x136))/0x3)+-parseInt(_0x309c53(0x132))/0x4+-parseInt(_0x309c53(0x127))/0x5*(-parseInt(_0x309c53(0x13c))/0x6)+parseInt(_0x309c53(0x126))/0x7*(parseInt(_0x309c53(0x125))/0x8)+parseInt(_0x309c53(0x139))/0x9+-parseInt(_0x309c53(0x12a))/0xa;if(_0x2a9bf3===_0x194fd8)break;else _0x14e694['push'](_0x14e694['shift']());}catch(_0x5b57d8){_0x14e694['push'](_0x14e694['shift']());}}}(a33_0x1296,0xde1c4));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x592c54(0x138),'command':a33_0x592c54(0x128),'description':a33_0x592c54(0x131),'risk':'read','flags':[{'name':'id','type':a33_0x592c54(0x135),'required':!![],'description':a33_0x592c54(0x12e)},{'name':a33_0x592c54(0x133),'type':a33_0x592c54(0x12f),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x3e277e){const _0x185bdf=a33_0x592c54,_0x2e78cf=await getBffScriptInfo(_0x3e277e[_0x185bdf(0x13b)]('id')),_0x20cc97=_0x3e277e['bool'](_0x185bdf(0x133));if(_0x20cc97)return{'ok':!![],'data':_0x2e78cf};return{'ok':!![],'data':{'id':_0x2e78cf['id'],'functionName':_0x2e78cf['functionName']??'','version':_0x2e78cf['version']??'','updateUserName':_0x2e78cf[_0x185bdf(0x137)]??'','appCode':_0x2e78cf[_0x185bdf(0x13d)],'scriptType':_0x2e78cf[_0x185bdf(0x129)],'description':_0x2e78cf[_0x185bdf(0x12d)]||'(none)','createdTime':_0x2e78cf[_0x185bdf(0x134)]??'','updatedTime':_0x2e78cf[_0x185bdf(0x130)]??'','scriptContent':_0x2e78cf[_0x185bdf(0x13a)]??''}};}};function a33_0x1296(){const _0x388c55=['2417760ovzjOR','scriptContent','num','12QZUauD','appCode','53488vRpsAJ','1561dcfcHI','552395QlyLgx','detail','scriptType','6477140WkUlIB','2TNTjaD','628802rukmVO','description','Script\x20ID','boolean','updatedTime','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','2967356naFJdD','verbose','createdTime','number','930183XcVUOm','updateUserName','bff'];a33_0x1296=function(){return _0x388c55;};return a33_0x1296();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x191737,_0x406fd0){const _0x1e47a2=a34_0x38ac,_0x52fd8e=_0x191737();while(!![]){try{const _0x560eff=-parseInt(_0x1e47a2(0x1c0))/0x1+parseInt(_0x1e47a2(0x1c2))/0x2+-parseInt(_0x1e47a2(0x1bf))/0x3*(-parseInt(_0x1e47a2(0x1c4))/0x4)+parseInt(_0x1e47a2(0x1be))/0x5+-parseInt(_0x1e47a2(0x1bd))/0x6+parseInt(_0x1e47a2(0x1c5))/0x7+parseInt(_0x1e47a2(0x1c1))/0x8*(-parseInt(_0x1e47a2(0x1c3))/0x9);if(_0x560eff===_0x406fd0)break;else _0x52fd8e['push'](_0x52fd8e['shift']());}catch(_0x3372e4){_0x52fd8e['push'](_0x52fd8e['shift']());}}}(a34_0x1fcc,0x9b48a));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a34_0x38ac(_0x7be074,_0x2a1152){_0x7be074=_0x7be074-0x1bd;const _0x1fcc06=a34_0x1fcc();let _0x38ac52=_0x1fcc06[_0x7be074];return _0x38ac52;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';function a34_0x1fcc(){const _0x428b2d=['4340042bRbdfo','6761778EatROh','4877405ODxGMj','1621026pKYIpA','733112dndmYf','4072ekOFYV','1519706yESZrg','7065VVLAVf','4SKWpwd'];a34_0x1fcc=function(){return _0x428b2d;};return a34_0x1fcc();}import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a35_0x319be2=a35_0x5f4c;function a35_0x3d39(){const _0x53acd9=['COMMON','10YLHuaS','2712GJzKFu','1rwoFMh','name','ENDPOINT','No\x20Backend\x20Function\x20scripts\x20found.','functionName','12zZhAml','4374VNCJNL','length','2060388puvMuK','map','602277FQSnAn','type','bff','28535ddEspw','appCode','Filter\x20by\x20script\x20name','1581362zeuixa','7eHCSVl','verbose','scriptType','str','2637459HZANOj','2460318wCHwKG','read','list','description','Script\x20type\x20filter','string'];a35_0x3d39=function(){return _0x53acd9;};return a35_0x3d39();}(function(_0x1193ef,_0x20ea44){const _0x1c66cb=a35_0x5f4c,_0x49e746=_0x1193ef();while(!![]){try{const _0xf017c4=-parseInt(_0x1c66cb(0x9d))/0x1*(-parseInt(_0x1c66cb(0x8e))/0x2)+parseInt(_0x1c66cb(0x88))/0x3+-parseInt(_0x1c66cb(0x83))/0x4*(parseInt(_0x1c66cb(0x8b))/0x5)+-parseInt(_0x1c66cb(0x94))/0x6*(parseInt(_0x1c66cb(0x8f))/0x7)+parseInt(_0x1c66cb(0x9c))/0x8*(-parseInt(_0x1c66cb(0x84))/0x9)+parseInt(_0x1c66cb(0x9b))/0xa*(parseInt(_0x1c66cb(0x93))/0xb)+parseInt(_0x1c66cb(0x86))/0xc;if(_0xf017c4===_0x20ea44)break;else _0x49e746['push'](_0x49e746['shift']());}catch(_0x2d2a3c){_0x49e746['push'](_0x49e746['shift']());}}}(a35_0x3d39,0xc5fe4));function a35_0x5f4c(_0x403537,_0x1ea75c){_0x403537=_0x403537-0x80;const _0x3d39cb=a35_0x3d39();let _0x5f4c05=_0x3d39cb[_0x403537];return _0x5f4c05;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x319be2(0x8a),'command':a35_0x319be2(0x96),'description':'List\x20Backend\x20Function\x20scripts','risk':a35_0x319be2(0x95),'flags':[{'name':'type','type':a35_0x319be2(0x99),'description':a35_0x319be2(0x98),'default':'ENDPOINT','enum':[a35_0x319be2(0x80),a35_0x319be2(0x9a)]},{'name':a35_0x319be2(0x9e),'type':a35_0x319be2(0x99),'description':a35_0x319be2(0x8d)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x46c463){const _0x39c8ab=a35_0x319be2,_0x35196b=await listBffScripts(_0x46c463[_0x39c8ab(0x8c)],_0x46c463[_0x39c8ab(0x92)](_0x39c8ab(0x89)),{'scriptName':_0x46c463[_0x39c8ab(0x92)](_0x39c8ab(0x9e))||undefined}),_0xd8d0c=_0x46c463['bool'](_0x39c8ab(0x90));return{'ok':!![],'data':_0xd8d0c?_0x35196b:_0x35196b[_0x39c8ab(0x87)](_0x4cdae2=>({'id':_0x4cdae2['id'],'functionName':_0x4cdae2[_0x39c8ab(0x82)]??'','description':_0x4cdae2[_0x39c8ab(0x97)]||'(unnamed)','scriptType':_0x4cdae2[_0x39c8ab(0x91)]})),'message':_0x35196b[_0x39c8ab(0x85)]===0x0?_0x39c8ab(0x81):undefined};}};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BffScriptLogQuery } from "../../core/api-client.js";
|
|
2
|
+
import type { CommandDefinition, RuntimeContext } from "../../framework/types.js";
|
|
3
|
+
export interface ResolvedBffLogQuery extends BffScriptLogQuery {
|
|
4
|
+
sinceMinutes?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveBffLogQuery(ctx: RuntimeContext, now?: number): ResolvedBffLogQuery;
|
|
7
|
+
export declare const bffLogs: CommandDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a36_0x5d302b=a36_0x59ad;function a36_0x59ad(_0x5cdd10,_0x54073e){_0x5cdd10=_0x5cdd10-0x18c;const _0xe86340=a36_0xe863();let _0x59ade1=_0xe86340[_0x5cdd10];return _0x59ade1;}(function(_0x1da448,_0x29a309){const _0x2248bb=a36_0x59ad,_0x309e05=_0x1da448();while(!![]){try{const _0x292ca4=parseInt(_0x2248bb(0x19c))/0x1*(-parseInt(_0x2248bb(0x1b3))/0x2)+parseInt(_0x2248bb(0x1b0))/0x3*(parseInt(_0x2248bb(0x195))/0x4)+parseInt(_0x2248bb(0x18f))/0x5*(-parseInt(_0x2248bb(0x1a7))/0x6)+parseInt(_0x2248bb(0x18d))/0x7*(parseInt(_0x2248bb(0x198))/0x8)+-parseInt(_0x2248bb(0x1a0))/0x9*(parseInt(_0x2248bb(0x1aa))/0xa)+-parseInt(_0x2248bb(0x196))/0xb+-parseInt(_0x2248bb(0x1b6))/0xc;if(_0x292ca4===_0x29a309)break;else _0x309e05['push'](_0x309e05['shift']());}catch(_0x7fe018){_0x309e05['push'](_0x309e05['shift']());}}}(a36_0xe863,0xd4659));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a36_0x5d302b(0x1a1),a36_0x5d302b(0x19f),'WARN',a36_0x5d302b(0x1ad)];export function resolveBffLogQuery(_0x18d0fd,_0x3fa1a4=Date[a36_0x5d302b(0x1b8)]()){const _0x10f64f=a36_0x5d302b,_0x2a6f74=_0x18d0fd[_0x10f64f(0x1af)](_0x10f64f(0x18e)),_0x1e784c=_0x18d0fd[_0x10f64f(0x1af)](_0x10f64f(0x1a8)),_0x3eb225=_0x18d0fd[_0x10f64f(0x1af)]('end-time');if(_0x2a6f74!==undefined&&_0x1e784c!==undefined)throw CliErrors[_0x10f64f(0x1ae)](_0x10f64f(0x19b));const _0x3e01cf=_0x3eb225===undefined?_0x3fa1a4:readPositiveInteger(_0x18d0fd['num'](_0x10f64f(0x1b2)),'--end-time'),_0x502d47=_0x1e784c===undefined?_0x3e01cf-readSinceMinutes(_0x18d0fd)*0xea60:readPositiveInteger(_0x18d0fd[_0x10f64f(0x190)](_0x10f64f(0x1a8)),_0x10f64f(0x1b9));if(_0x502d47<=0x0)throw CliErrors[_0x10f64f(0x1ae)](_0x10f64f(0x191));if(_0x502d47>_0x3e01cf)throw CliErrors[_0x10f64f(0x1ae)]('--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.');const _0x1d2ad7=readPositiveInteger(_0x18d0fd[_0x10f64f(0x190)](_0x10f64f(0x1a4),DEFAULT_LIMIT),'--limit');if(_0x1d2ad7>MAX_LIMIT)throw CliErrors['validation'](_0x10f64f(0x19d)+MAX_LIMIT+'.');const _0xd26123=_0x18d0fd[_0x10f64f(0x1b7)]('level')[_0x10f64f(0x193)]()['toUpperCase']()||undefined,_0x5d7a57=_0x18d0fd[_0x10f64f(0x1b7)](_0x10f64f(0x1a3))[_0x10f64f(0x193)]()||undefined;return{'appCode':_0x18d0fd[_0x10f64f(0x1ac)],'startTime':_0x502d47,'endTime':_0x3e01cf,..._0x1e784c===undefined?{'sinceMinutes':readSinceMinutes(_0x18d0fd)}:{},..._0xd26123?{'level':_0xd26123}:{},..._0x5d7a57?{'keyword':_0x5d7a57}:{},'limit':_0x1d2ad7};}function readSinceMinutes(_0x155038){const _0x2fc33e=a36_0x5d302b;return readPositiveInteger(_0x155038['num'](_0x2fc33e(0x18e),DEFAULT_SINCE_MINUTES),_0x2fc33e(0x1a6));}function a36_0xe863(){const _0x27f54a=['--since','1308IwpRGw','start-time','read','41830oQJflt','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','appCode','ERROR','validation','flag','39bMNSZd','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','end-time','19498HkkZoJ','Found\x20','length','161172GpfPVx','str','now','--start-time','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','number','145523QmgzGZ','since','23995olFpag','num','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','trim','Maximum\x20log\x20lines\x20to\x20return\x20(1-','532324kHUmjU','71181PkSFaF','logs','568WdeIVx','Filter\x20by\x20log\x20level','isSafeInteger','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','20GbapxR','--limit\x20must\x20be\x20between\x201\x20and\x20','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','INFO','2313ESeDPb','DEBUG','string','keyword','limit','\x20must\x20be\x20a\x20positive\x20integer.'];a36_0xe863=function(){return _0x27f54a;};return a36_0xe863();}function readPositiveInteger(_0x81d0ac,_0xaf65b8){const _0x1df005=a36_0x5d302b;if(!Number[_0x1df005(0x19a)](_0x81d0ac)||_0x81d0ac<=0x0)throw CliErrors[_0x1df005(0x1ae)](_0xaf65b8+_0x1df005(0x1a5));return _0x81d0ac;}export const bffLogs={'service':'bff','command':a36_0x5d302b(0x197),'description':a36_0x5d302b(0x19e),'risk':a36_0x5d302b(0x1a9),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a36_0x5d302b(0x18e),'type':'number','description':a36_0x5d302b(0x1ba)+DEFAULT_SINCE_MINUTES+')'},{'name':a36_0x5d302b(0x1a8),'type':a36_0x5d302b(0x18c),'description':a36_0x5d302b(0x1b1)},{'name':a36_0x5d302b(0x1b2),'type':a36_0x5d302b(0x18c),'description':a36_0x5d302b(0x1ab)},{'name':'level','type':'string','description':a36_0x5d302b(0x199),'enum':LOG_LEVELS},{'name':a36_0x5d302b(0x1a3),'type':a36_0x5d302b(0x1a2),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':a36_0x5d302b(0x1a4),'type':a36_0x5d302b(0x18c),'description':a36_0x5d302b(0x194)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x3c0b08){resolveBffLogQuery(_0x3c0b08);},async 'execute'(_0x12a447){const _0x29d481=a36_0x5d302b,_0x40e7de=resolveBffLogQuery(_0x12a447),{sinceMinutes:_0x152a0f,..._0x2d7e03}=_0x40e7de,_0x2b8f0b=await searchBffScriptLogs(_0x2d7e03);return{'ok':!![],'data':{'query':_0x40e7de,'count':_0x2b8f0b['length'],'logs':_0x2b8f0b},'message':_0x2b8f0b[_0x29d481(0x1b5)]===0x0?_0x29d481(0x192):_0x29d481(0x1b4)+_0x2b8f0b['length']+'\x20Backend\x20Function\x20log\x20line(s).'};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x333617=a36_0xc9f9;(function(_0x494dcc,_0x27ab24){const _0x2e447d=a36_0xc9f9,_0x465063=_0x494dcc();while(!![]){try{const _0x2b969d=parseInt(_0x2e447d(0x234))/0x1+-parseInt(_0x2e447d(0x227))/0x2*(-parseInt(_0x2e447d(0x212))/0x3)+-parseInt(_0x2e447d(0x1f5))/0x4+parseInt(_0x2e447d(0x221))/0x5*(-parseInt(_0x2e447d(0x225))/0x6)+-parseInt(_0x2e447d(0x223))/0x7*(parseInt(_0x2e447d(0x22a))/0x8)+parseInt(_0x2e447d(0x1fb))/0x9+-parseInt(_0x2e447d(0x20b))/0xa*(-parseInt(_0x2e447d(0x235))/0xb);if(_0x2b969d===_0x27ab24)break;else _0x465063['push'](_0x465063['shift']());}catch(_0x16d829){_0x465063['push'](_0x465063['shift']());}}}(a36_0x4d15,0x47074));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';function a36_0xc9f9(_0x366476,_0x44bc2b){_0x366476=_0x366476-0x1f2;const _0x4d1554=a36_0x4d15();let _0xc9f90a=_0x4d1554[_0x366476];return _0xc9f90a;}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';function a36_0x4d15(){const _0x3da48d=['functions','\x20failed','local\x20unsynced\x20changes','type','lockKey','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','validation','Pull\x20complete:\x20','would_pull','HOOK','functionName','Force\x20pull\x20cancelled.','question','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','bff','410VQKHLv','functionNode','force','Force\x20overwrite\x20local\x20unsynced\x20changes','operationType','read','includes','3INQzpM','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','toLowerCase','length','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','close','scriptContent','Would\x20inspect\x20','stringify','stdin','appCode','bool','\x22\x20not\x20found\x20after\x20ensureLockScope.','parse','string','32415zlulRs','cancelled','146741SPsTKB','datasetCode','318NLwMFB','push','791950lBbFDp','hash','lastSync','40jqLMUZ','filePath','alias','lockFilePath','boolean','version','/api/management/library/scripts/list?appCode=','conflict','hookLocation','Remote\x20script\x20missing\x20id.','353724BqhGeK','6028AIOUVf','\x20pulled,\x20','unresolvable\x20target\x20path','\x20skipped,\x20','scriptsRoot','trim','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','utf8','GET','yes','COMMON','message','622044ViNUim','map','nonInteractive','str','pull','all','1104210Zgysth'];a36_0x4d15=function(){return _0x3da48d;};return a36_0x4d15();}import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x333617(0x20a),'command':a36_0x333617(0x1f9),'description':a36_0x333617(0x201),'risk':a36_0x333617(0x210),'flags':[{'name':a36_0x333617(0x1ff),'type':a36_0x333617(0x220),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a36_0x333617(0x1f3),'ENDPOINT',a36_0x333617(0x205)]},{'name':a36_0x333617(0x20d),'type':a36_0x333617(0x22e),'description':a36_0x333617(0x20e)}],async 'dryRun'(_0x23274){const _0x41c984=a36_0x333617,_0x1b982c=loadBffProjectConfig(_0x23274['appCode']),_0xe8dd3c=await readBffLockFile(_0x1b982c[_0x41c984(0x22d)]),{appLock:_0x144441}=ensureLockScope(_0xe8dd3c??createEmptyBffLock(),_0x23274[_0x41c984(0x21c)],_0x1b982c[_0x41c984(0x239)],'pull'),_0x3975fe=normalizeBffType(_0x23274[_0x41c984(0x1f8)](_0x41c984(0x1ff)))??undefined,_0x42d08d=buildDatasetCodeToAliasMap(_0x23274['apiDir'],_0x23274[_0x41c984(0x21c)]),[_0x6485f0,_0x26467b]=await Promise['all']([listBffScripts(_0x23274['appCode'],_0x3975fe),getBffScriptStatistics(_0x23274['appCode'])]),_0x264611=createHookLocationMap(_0x26467b),_0x151a29=[];for(const _0x3bd6d of _0x6485f0){const _0x4aa698=resolveRemoteScriptTarget(_0x1b982c,_0x3bd6d,_0x264611,_0x144441[_0x41c984(0x1fc)],_0x42d08d);if(!_0x4aa698){_0x151a29[_0x41c984(0x226)]({'scriptType':_0x3bd6d['scriptType'],'functionName':_0x3bd6d[_0x41c984(0x206)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x5432d3=_0x144441[_0x41c984(0x1fc)][_0x4aa698[_0x41c984(0x200)]],_0x39f4cc=_0x3bd6d['scriptContent']!=null?computeContentHash(_0x3bd6d['scriptContent']):undefined,_0x189677=await hasUnsyncedLocalChanges(_0x4aa698['filePath'],_0x5432d3,_0x39f4cc);_0x151a29[_0x41c984(0x226)]({'lockKey':_0x4aa698[_0x41c984(0x200)],'filePath':_0x4aa698[_0x41c984(0x22b)],'remoteId':_0x3bd6d['id']??null,'status':_0x189677?_0x41c984(0x231):_0x41c984(0x204)});}return{'method':_0x41c984(0x23d),'url':_0x41c984(0x230)+_0x23274['appCode']+(_0x3975fe?'&type='+_0x3975fe:''),'body':{'appCode':_0x23274[_0x41c984(0x21c)],'filterType':_0x3975fe??null,'files':_0x151a29},'description':_0x41c984(0x219)+_0x151a29['length']+_0x41c984(0x209)};},async 'execute'(_0x29646f){const _0xa23258=a36_0x333617,_0x16b9b4=loadBffProjectConfig(_0x29646f[_0xa23258(0x21c)]),_0x3e66d2=await readBffLockFile(_0x16b9b4[_0xa23258(0x22d)]),{lockData:_0x42a8fd,appLock:_0x4ad180}=ensureLockScope(_0x3e66d2??createEmptyBffLock(),_0x29646f[_0xa23258(0x21c)],_0x16b9b4[_0xa23258(0x239)],'pull'),_0x43f65a=normalizeBffType(_0x29646f[_0xa23258(0x1f8)](_0xa23258(0x1ff)))??undefined;if(_0x29646f[_0xa23258(0x1f8)](_0xa23258(0x1ff))&&!_0x43f65a)throw CliErrors[_0xa23258(0x202)](_0xa23258(0x216));const [_0x5645f6,_0x3d90ee]=await Promise[_0xa23258(0x1fa)]([listBffScripts(_0x29646f['appCode'],_0x43f65a),getBffScriptStatistics(_0x29646f['appCode'])]);if(_0x5645f6['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xa23258(0x213)};const _0x39f8e9=_0x29646f[_0xa23258(0x21d)](_0xa23258(0x20d));if(_0x39f8e9&&!_0x29646f[_0xa23258(0x1f7)]){const _0x42ffbe=await confirmForce();if(!_0x42ffbe)throw CliErrors[_0xa23258(0x222)](_0xa23258(0x207));}if(_0x39f8e9&&_0x29646f['nonInteractive']){}const _0x2109bf=buildDatasetCodeToAliasMap(_0x29646f['apiDir'],_0x29646f['appCode']),_0x984245=createHookLocationMap(_0x3d90ee),_0x2e8b7c=JSON[_0xa23258(0x21f)](JSON[_0xa23258(0x21a)](_0x42a8fd)),_0xc20faa=_0x29646f[_0xa23258(0x21c)],_0x185697=_0x2e8b7c['apps'][_0xc20faa];if(!_0x185697)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0xc20faa+_0xa23258(0x21e));const _0x50eeb3=[],_0x24ea3=[],_0x127456=[];for(const _0x199f7a of _0x5645f6){const _0xfad93=resolveRemoteScriptTarget(_0x16b9b4,_0x199f7a,_0x984245,_0x4ad180[_0xa23258(0x1fc)],_0x2109bf);if(!_0xfad93){_0x24ea3[_0xa23258(0x226)]({'lockKey':_0x199f7a['scriptType']+'/'+_0x199f7a[_0xa23258(0x206)],'reason':_0xa23258(0x237)});continue;}const _0x5ea2fe=_0x4ad180[_0xa23258(0x1fc)][_0xfad93['lockKey']];try{if(!_0x199f7a['id'])throw new Error(_0xa23258(0x233));if(_0x199f7a[_0xa23258(0x218)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x2250e2=_0x199f7a[_0xa23258(0x218)],_0x18b28=computeContentHash(_0x2250e2);if(!_0x39f8e9){const _0x395e50=await hasUnsyncedLocalChanges(_0xfad93[_0xa23258(0x22b)],_0x5ea2fe,_0x18b28);if(_0x395e50){_0x24ea3[_0xa23258(0x226)]({'lockKey':_0xfad93[_0xa23258(0x200)],'reason':_0xa23258(0x1fe)});continue;}}await ensureParentDirectory(_0xfad93['filePath']),await writeFile(_0xfad93['filePath'],_0x2250e2,_0xa23258(0x23c));const _0x330e48={'hash':_0x18b28,'remoteId':_0x199f7a['id'],'version':_0x199f7a[_0xa23258(0x22f)]};_0xfad93[_0xa23258(0x1ff)]==='HOOK'&&_0xfad93[_0xa23258(0x232)]&&(_0x330e48[_0xa23258(0x22c)]=_0xfad93['hookLocation'][_0xa23258(0x22c)],_0x330e48[_0xa23258(0x224)]=_0xfad93[_0xa23258(0x232)][_0xa23258(0x224)],_0x330e48[_0xa23258(0x20f)]=_0xfad93[_0xa23258(0x232)][_0xa23258(0x20f)],_0x330e48[_0xa23258(0x20c)]=_0xfad93['hookLocation'][_0xa23258(0x20c)]),_0x185697['functions'][_0xfad93[_0xa23258(0x200)]]=_0x330e48,_0x50eeb3[_0xa23258(0x226)]({'lockKey':_0xfad93[_0xa23258(0x200)],'remoteId':_0x199f7a['id']});}catch(_0x410bb2){_0x127456[_0xa23258(0x226)]({'lockKey':_0xfad93[_0xa23258(0x200)],'error':_0x410bb2 instanceof Error?_0x410bb2[_0xa23258(0x1f4)]:String(_0x410bb2)});}}return _0x185697[_0xa23258(0x229)]=new Date()['toISOString'](),await writeBffLockFile(_0x16b9b4[_0xa23258(0x22d)],_0x2e8b7c),{'ok':_0x127456[_0xa23258(0x215)]===0x0,'data':{'pulled':_0x50eeb3,'skipped':_0x24ea3,'failed':_0x127456},'message':_0xa23258(0x203)+_0x50eeb3['length']+_0xa23258(0x236)+_0x24ea3[_0xa23258(0x215)]+_0xa23258(0x238)+_0x127456['length']+_0xa23258(0x1fd)};}};async function hasUnsyncedLocalChanges(_0x3b3ed1,_0xf5a8ee,_0xf9f636){const _0x9811ee=a36_0x333617;if(!await fileExists(_0x3b3ed1))return![];const _0x4eda41=await computeFileHash(_0x3b3ed1);if(!_0xf5a8ee)return _0xf9f636?_0x4eda41!==_0xf9f636:!![];return _0x4eda41!==_0xf5a8ee[_0x9811ee(0x228)];}function buildDatasetCodeToAliasMap(_0x2ade7e,_0x513a2c){const _0x63846e=a36_0x333617,_0x47ef7e=loadAliasMap(_0x2ade7e,undefined,resolveApiFilePath(_0x2ade7e,_0x513a2c));return new Map(_0x47ef7e[_0x63846e(0x1f6)](_0x5aec11=>[_0x5aec11[_0x63846e(0x224)],_0x5aec11[_0x63846e(0x22c)]]));}async function confirmForce(){const _0x5296d1=a36_0x333617,_0x492061=createInterface({'input':process[_0x5296d1(0x21b)],'output':process['stderr']}),_0x2e187e=await new Promise(_0x5c3747=>{const _0x1edada=_0x5296d1;_0x492061[_0x1edada(0x208)](_0x1edada(0x23b),_0x5c3747);});return _0x492061[_0x5296d1(0x217)](),['y',_0x5296d1(0x1f2)][_0x5296d1(0x211)](_0x2e187e[_0x5296d1(0x23a)]()[_0x5296d1(0x214)]());}
|
|
1
|
+
const a37_0x388fe5=a37_0xc32f;(function(_0x21c068,_0x1db5d0){const _0x4fd599=a37_0xc32f,_0x30221f=_0x21c068();while(!![]){try{const _0x3bc70a=-parseInt(_0x4fd599(0x12c))/0x1*(parseInt(_0x4fd599(0x18f))/0x2)+parseInt(_0x4fd599(0x11c))/0x3*(parseInt(_0x4fd599(0x19c))/0x4)+parseInt(_0x4fd599(0x11d))/0x5*(parseInt(_0x4fd599(0x159))/0x6)+-parseInt(_0x4fd599(0x191))/0x7+parseInt(_0x4fd599(0x14f))/0x8*(-parseInt(_0x4fd599(0x11a))/0x9)+parseInt(_0x4fd599(0x16d))/0xa+parseInt(_0x4fd599(0x136))/0xb*(parseInt(_0x4fd599(0x187))/0xc);if(_0x3bc70a===_0x1db5d0)break;else _0x30221f['push'](_0x30221f['shift']());}catch(_0x15a9a8){_0x30221f['push'](_0x30221f['shift']());}}}(a37_0xc97c,0xebbcc));import{createInterface}from'node:readline';import{readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{randomUUID}from'node:crypto';import{dirname,join}from'node:path';import{BFF_LIST_PAGE_SIZE,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,directoryExists,ensureParentDirectory,fileExists,isSafeLockKeySegment,normalizeBffType,resolveLocalFilePathFromLockKey,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{assertUnambiguousHookAliases}from'../../core/bff/hook-directory.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a37_0xc32f(_0x4e4516,_0x3ce64f){_0x4e4516=_0x4e4516-0x11a;const _0xc97c18=a37_0xc97c();let _0xc32f37=_0xc97c18[_0x4e4516];return _0xc32f37;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':a37_0x388fe5(0x135),'command':a37_0x388fe5(0x15a),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':a37_0x388fe5(0x172),'structuredErrors':!![],'flags':[{'name':'type','type':a37_0x388fe5(0x19b),'description':a37_0x388fe5(0x183),'enum':['COMMON',a37_0x388fe5(0x13d),'HOOK']},{'name':a37_0x388fe5(0x14d),'type':'boolean','description':a37_0x388fe5(0x11e)}],async 'dryRun'(_0xb31f22){const _0x56b758=a37_0x388fe5,_0x3105d6=loadBffProjectConfig(_0xb31f22[_0x56b758(0x17e)]),_0x3c7693=await readBffLockFile(_0x3105d6[_0x56b758(0x139)]),{appLock:_0x2313a9}=ensureLockScope(_0x3c7693??createEmptyBffLock(),_0xb31f22[_0x56b758(0x17e)],_0x3105d6[_0x56b758(0x170)],_0x56b758(0x15a)),_0x4990cb=normalizeBffType(_0xb31f22[_0x56b758(0x120)]('type'))??undefined,[_0x2c75c4,_0x1ea3d7]=await Promise[_0x56b758(0x174)]([listBffScripts(_0xb31f22[_0x56b758(0x17e)],_0x4990cb),getBffScriptStatistics(_0xb31f22[_0x56b758(0x17e)])]),_0x52c9da=_0x2c75c4[_0x56b758(0x15e)](_0x1f3d83=>normalizeBffType(_0x1f3d83[_0x56b758(0x16e)])===_0x56b758(0x1a3)),_0x56f43c=_0x52c9da?buildDatasetCodeToAliasMap(_0xb31f22['apiDir'],_0xb31f22[_0x56b758(0x17e)]):new Map(),_0x1c9cb3=_0x52c9da?await planHookDirectoryMigration(_0x3105d6,_0x2313a9,_0x56f43c,await scanLocalBffFunctions(_0x3105d6,_0x56b758(0x1a3))):undefined,_0x4cdbe4=createHookLocationMap(_0x1ea3d7),_0x2dff39=[];for(const _0x3b225e of _0x2c75c4){const _0x2735f8=resolveRemoteScriptTarget(_0x3105d6,_0x3b225e,_0x4cdbe4,_0x1c9cb3?.[_0x56b758(0x198)]??_0x2313a9[_0x56b758(0x121)],_0x56f43c);if(!_0x2735f8){_0x2dff39['push']({'scriptType':_0x3b225e[_0x56b758(0x16e)],'functionName':_0x3b225e['functionName']??'','status':_0x56b758(0x1aa),'reason':_0x56b758(0x143)});continue;}const _0x3234cb=(_0x1c9cb3?.['projectedFunctions']??_0x2313a9[_0x56b758(0x121)])[_0x2735f8[_0x56b758(0x123)]],_0x4c122f=_0x3b225e['scriptContent']!=null?computeContentHash(_0x3b225e[_0x56b758(0x144)]):undefined,_0x4301c8=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x1c9cb3,_0x2735f8)??_0x2735f8[_0x56b758(0x13e)],_0x3234cb,_0x4c122f),_0x29b703=_0x4301c8?localUnsyncedConflict(_0x2735f8,_0x3b225e['id']):undefined;_0x2dff39[_0x56b758(0x13f)]({'lockKey':_0x2735f8[_0x56b758(0x123)],'filePath':_0x2735f8[_0x56b758(0x13e)],'remoteId':_0x3b225e['id']??null,'status':_0x29b703?_0x56b758(0x1a4):_0x56b758(0x169),..._0x29b703?{'conflict':_0x29b703}:{},..._0x2735f8['hookLocation']?{'alias':_0x2735f8['hookLocation'][_0x56b758(0x134)]??null,'datasetCode':_0x2735f8['hookLocation'][_0x56b758(0x19d)],'operationType':_0x2735f8[_0x56b758(0x161)][_0x56b758(0x12b)],'functionNode':_0x2735f8[_0x56b758(0x161)][_0x56b758(0x1a6)]}:{}});}return{'method':_0x56b758(0x175),'url':'/api/management/library/scripts/list?appCode='+_0xb31f22[_0x56b758(0x17e)]+(_0x4990cb?_0x56b758(0x167)+_0x4990cb:'')+'¤tPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0xb31f22[_0x56b758(0x17e)],'filterType':_0x4990cb??null,..._0x1c9cb3&&_0x1c9cb3['migrations'][_0x56b758(0x127)]>0x0?{'hookDirectoryMigrations':_0x1c9cb3[_0x56b758(0x168)][_0x56b758(0x128)](_0x318e98=>({'from':_0x318e98[_0x56b758(0x130)],'to':_0x318e98[_0x56b758(0x182)]}))}:{},'files':_0x2dff39},'description':'Would\x20inspect\x20'+_0x2dff39[_0x56b758(0x127)]+_0x56b758(0x19a)};},async 'execute'(_0x5d1edc){const _0x1d83c9=a37_0x388fe5,_0x30bf65=loadBffProjectConfig(_0x5d1edc[_0x1d83c9(0x17e)]),_0x4115d9=await readBffLockFile(_0x30bf65['lockFilePath']),{lockData:_0x167b1c,appLock:_0x19ec63}=ensureLockScope(_0x4115d9??createEmptyBffLock(),_0x5d1edc['appCode'],_0x30bf65['scriptsRoot'],_0x1d83c9(0x15a)),_0x568fe4=normalizeBffType(_0x5d1edc[_0x1d83c9(0x120)](_0x1d83c9(0x14a)))??undefined;if(_0x5d1edc[_0x1d83c9(0x120)](_0x1d83c9(0x14a))&&!_0x568fe4)throw CliErrors[_0x1d83c9(0x178)](_0x1d83c9(0x14c));const [_0x333a5c,_0x557fe7]=await Promise[_0x1d83c9(0x174)]([listBffScripts(_0x5d1edc[_0x1d83c9(0x17e)],_0x568fe4),getBffScriptStatistics(_0x5d1edc[_0x1d83c9(0x17e)])]);if(_0x333a5c[_0x1d83c9(0x127)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x1d83c9(0x156)};const _0x46a419=_0x5d1edc['bool']('force');if(_0x46a419&&!_0x5d1edc[_0x1d83c9(0x196)]){const _0x13f8b4=await confirmForce();if(!_0x13f8b4)throw CliErrors['cancelled'](_0x1d83c9(0x153));}if(_0x46a419&&_0x5d1edc[_0x1d83c9(0x196)]){}const _0x2ead55=_0x333a5c[_0x1d83c9(0x15e)](_0x1687af=>normalizeBffType(_0x1687af['scriptType'])===_0x1d83c9(0x1a3)),_0xe3b6e9=_0x2ead55?buildDatasetCodeToAliasMap(_0x5d1edc[_0x1d83c9(0x1a5)],_0x5d1edc[_0x1d83c9(0x17e)]):new Map(),_0x35e7e0=createHookLocationMap(_0x557fe7),_0x1819f5=JSON[_0x1d83c9(0x13a)](JSON[_0x1d83c9(0x16b)](_0x167b1c)),_0x546923=_0x5d1edc[_0x1d83c9(0x17e)],_0x32ca42=_0x1819f5[_0x1d83c9(0x19f)][_0x546923];if(!_0x32ca42)throw new Error(_0x1d83c9(0x16c)+_0x546923+_0x1d83c9(0x15f));const _0x16890a=_0x2ead55?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x30bf65,_0x32ca42,_0xe3b6e9,await scanLocalBffFunctions(_0x30bf65,_0x1d83c9(0x1a3))),_0x32ca42):undefined,_0x14de53=createPullFileTransaction(),_0x822413=[],_0x2acba9=[],_0x5bd3a9=[],_0x2e9154=[];for(const _0x3aad22 of _0x333a5c){const _0x31de3b=resolveRemoteScriptTarget(_0x30bf65,_0x3aad22,_0x35e7e0,_0x32ca42['functions'],_0xe3b6e9);if(!_0x31de3b){_0x2acba9['push']({'lockKey':_0x3aad22[_0x1d83c9(0x16e)]+'/'+_0x3aad22['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x736453=_0x32ca42[_0x1d83c9(0x121)][_0x31de3b[_0x1d83c9(0x123)]];try{if(!_0x3aad22['id'])throw new Error(_0x1d83c9(0x124));if(_0x3aad22[_0x1d83c9(0x144)]==null)throw new Error(_0x1d83c9(0x140));const _0x4c6ce9=_0x3aad22[_0x1d83c9(0x144)],_0x4c7672=computeContentHash(_0x4c6ce9);if(!_0x46a419){const _0x421c4f=await hasUnsyncedLocalChanges(_0x31de3b[_0x1d83c9(0x13e)],_0x736453,_0x4c7672);if(_0x421c4f){_0x5bd3a9[_0x1d83c9(0x13f)](localUnsyncedConflict(_0x31de3b,_0x3aad22['id']));continue;}}await _0x14de53[_0x1d83c9(0x148)](_0x31de3b[_0x1d83c9(0x13e)],_0x4c6ce9);const _0x34ffee={'hash':_0x4c7672,'remoteId':_0x3aad22['id'],'version':_0x3aad22[_0x1d83c9(0x145)]};_0x31de3b[_0x1d83c9(0x14a)]===_0x1d83c9(0x1a3)&&_0x31de3b['hookLocation']&&(_0x34ffee['alias']=_0x31de3b[_0x1d83c9(0x161)]['alias'],_0x34ffee[_0x1d83c9(0x19d)]=_0x31de3b[_0x1d83c9(0x161)][_0x1d83c9(0x19d)],_0x34ffee[_0x1d83c9(0x12b)]=_0x31de3b[_0x1d83c9(0x161)][_0x1d83c9(0x12b)],_0x34ffee[_0x1d83c9(0x1a6)]=_0x31de3b[_0x1d83c9(0x161)][_0x1d83c9(0x1a6)]),_0x32ca42[_0x1d83c9(0x121)][_0x31de3b['lockKey']]=_0x34ffee,_0x822413['push']({'lockKey':_0x31de3b[_0x1d83c9(0x123)],'remoteId':_0x3aad22['id']});}catch(_0x425c4e){_0x2e9154[_0x1d83c9(0x13f)]({'lockKey':_0x31de3b[_0x1d83c9(0x123)],'error':_0x425c4e instanceof Error?_0x425c4e[_0x1d83c9(0x15d)]:String(_0x425c4e)});}}_0x32ca42['lastSync']=new Date()[_0x1d83c9(0x162)]();try{await writeBffLockFile(_0x30bf65[_0x1d83c9(0x139)],_0x1819f5);}catch(_0x5f4e55){const _0x3e531d=[...await _0x14de53['rollback'](),...await _0x16890a?.[_0x1d83c9(0x1a9)]()??[]];throw withRollbackErrors(_0x5f4e55,_0x1d83c9(0x14e),_0x3e531d);}return{'ok':_0x2e9154[_0x1d83c9(0x127)]===0x0,'data':{'pulled':_0x822413,'skipped':_0x2acba9,'conflicts':_0x5bd3a9,'failed':_0x2e9154},'message':formatPullMessage(_0x822413['length'],_0x2acba9[_0x1d83c9(0x127)],_0x5bd3a9[_0x1d83c9(0x127)],_0x2e9154['length'])};}};function localUnsyncedConflict(_0x2aa6a6,_0x3c00b5){const _0x1afc89=a37_0x388fe5,_0x20bd68=_0x2aa6a6[_0x1afc89(0x123)][_0x1afc89(0x131)]('/')['at'](-0x1);return{'code':_0x1afc89(0x199),'lockKey':_0x2aa6a6[_0x1afc89(0x123)],'filePath':_0x2aa6a6[_0x1afc89(0x13e)],..._0x3c00b5!=null?{'remoteId':_0x3c00b5}:{},'message':_0x1afc89(0x173),'nextAction':{'action':_0x1afc89(0x15c),'command':CLI_BIN_NAME+_0x1afc89(0x1a2)+_0x2aa6a6[_0x1afc89(0x14a)]+_0x1afc89(0x1a1)+_0x20bd68+_0x1afc89(0x126),'requiresReview':!![],'message':'If\x20the\x20reviewed\x20local\x20script\x20should\x20win,\x20run\x20this\x20command\x20to\x20update\x20the\x20remote\x20script.\x20Do\x20not\x20use\x20--force\x20to\x20resolve\x20a\x20content\x20conflict.'}};}function formatPullMessage(_0x1159ad,_0x2a9f44,_0x23b771,_0x17617f){const _0x59f02c=a37_0x388fe5,_0x5e0510=[_0x59f02c(0x171)+_0x1159ad+_0x59f02c(0x17d),_0x2a9f44+_0x59f02c(0x163)];_0x23b771>0x0&&_0x5e0510[_0x59f02c(0x13f)](_0x23b771+_0x59f02c(0x18d)+(_0x23b771===0x1?'':'s')+'\x20'+(_0x23b771===0x1?_0x59f02c(0x184):_0x59f02c(0x15b))+_0x59f02c(0x11f));if(_0x17617f>0x0)_0x5e0510['push'](_0x17617f+_0x59f02c(0x193));return _0x5e0510['join'](',\x20');}async function hasUnsyncedLocalChanges(_0x17d15a,_0x19bc6c,_0x3a8417){const _0x771d65=a37_0x388fe5;if(!await fileExists(_0x17d15a))return![];const _0x31518a=await computeFileHash(_0x17d15a);if(!_0x19bc6c)return _0x3a8417?_0x31518a!==_0x3a8417:!![];return _0x31518a!==_0x19bc6c[_0x771d65(0x1ab)];}function createPullFileTransaction(){const _0x2c5790=new Map(),_0x563309=async(_0x3a08ce,_0x54db8e)=>{const _0x19cfc5=a37_0xc32f;try{if(_0x54db8e[_0x19cfc5(0x17a)])await ensureParentDirectory(_0x3a08ce),await writeFile(_0x3a08ce,_0x54db8e[_0x19cfc5(0x165)]);else try{await unlink(_0x3a08ce);}catch(_0x39c96c){if(_0x39c96c[_0x19cfc5(0x188)]!==_0x19cfc5(0x14b))throw _0x39c96c;}return undefined;}catch(_0x20fc64){return _0x20fc64 instanceof Error?_0x20fc64:new Error(String(_0x20fc64));}};return{async 'write'(_0xda249d,_0x4a4327){const _0x48fa2b=a37_0xc32f;if(!_0x2c5790[_0x48fa2b(0x180)](_0xda249d))try{_0x2c5790[_0x48fa2b(0x189)](_0xda249d,{'existed':!![],'content':await readFile(_0xda249d)});}catch(_0x6194ef){if(_0x6194ef[_0x48fa2b(0x188)]!==_0x48fa2b(0x14b))throw _0x6194ef;_0x2c5790[_0x48fa2b(0x189)](_0xda249d,{'existed':![]});}try{await ensureParentDirectory(_0xda249d),await writeFile(_0xda249d,_0x4a4327,_0x48fa2b(0x158));}catch(_0x396c3f){const _0x4a3c0f=await _0x563309(_0xda249d,_0x2c5790[_0x48fa2b(0x157)](_0xda249d));if(!_0x4a3c0f)_0x2c5790[_0x48fa2b(0x12e)](_0xda249d);throw withRollbackErrors(_0x396c3f,_0x48fa2b(0x152)+_0xda249d+'\x22.',_0x4a3c0f?[_0x4a3c0f]:[]);}},async 'rollback'(){const _0x3bada8=a37_0xc32f,_0x27ca3c=[];for(const [_0x576a3a,_0x135898]of[..._0x2c5790['entries']()]['reverse']()){const _0x2025c2=await _0x563309(_0x576a3a,_0x135898);_0x2025c2&&_0x27ca3c['push'](new Error('Could\x20not\x20restore\x20local\x20script\x20\x22'+_0x576a3a+_0x3bada8(0x155)+_0x2025c2[_0x3bada8(0x15d)]));}return _0x27ca3c;}};}function withRollbackErrors(_0x4194ef,_0xb0d1aa,_0x4b8ec3){const _0x1eb9ff=a37_0x388fe5,_0xedfe2b=_0x4194ef instanceof Error?_0x4194ef:new Error(String(_0x4194ef));if(_0x4b8ec3[_0x1eb9ff(0x127)]===0x0)return _0xedfe2b;return new AggregateError([_0xedfe2b,..._0x4b8ec3],_0xb0d1aa+_0x1eb9ff(0x138)+_0x4b8ec3['map'](_0x368671=>_0x368671[_0x1eb9ff(0x15d)])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x4c7c0f,_0x264e8b){const _0xab3b50=a37_0x388fe5,_0x318528=loadAliasMap(_0x4c7c0f,undefined,resolveApiFilePath(_0x4c7c0f,_0x264e8b));return assertUnambiguousHookAliases(_0x318528),new Map(_0x318528[_0xab3b50(0x128)](_0xc16d5c=>[_0xc16d5c[_0xab3b50(0x19d)][_0xab3b50(0x1a0)](),_0xc16d5c[_0xab3b50(0x134)]]));}async function planHookDirectoryMigration(_0x5f0b50,_0x9d1ee1,_0x252769,_0x8000a9){const _0x252a3f=a37_0x388fe5,_0x23156d=new Map();for(const [_0x4f6481,_0x412830]of Object['entries'](_0x9d1ee1[_0x252a3f(0x121)])){const [_0xbdba65,_0x25c8d9,_0x3e7042,_0x4e7754,_0x5586e3,..._0xdf7f44]=_0x4f6481[_0x252a3f(0x131)]('/');if(_0xbdba65!==_0x252a3f(0x1a3)||!_0x25c8d9||!_0x3e7042||!_0x4e7754||!_0x5586e3||_0xdf7f44['length']>0x0||!_0x412830[_0x252a3f(0x19d)])continue;const _0x5e0bef=_0x252769[_0x252a3f(0x157)](_0x412830[_0x252a3f(0x19d)][_0x252a3f(0x1a0)]()),_0xa70268=_0x5e0bef??_0x412830['datasetCode'];if(!isSafeHookDirectorySegment(_0x25c8d9))throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x154)+_0x25c8d9+'\x22\x20from\x20the\x20lock\x20file.');if(!isSafeHookDirectorySegment(_0xa70268))throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x25c8d9+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x25c8d9===_0xa70268)continue;const _0x2383e9=_0x23156d[_0x252a3f(0x157)](_0x25c8d9)??{'datasetCode':_0x412830[_0x252a3f(0x19d)],'alias':_0x5e0bef,'keyChanges':[]};if(_0x2383e9[_0x252a3f(0x19d)]!==_0x412830[_0x252a3f(0x19d)])throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x25c8d9+_0x252a3f(0x137));const _0x1613dd=_0x252a3f(0x194)+_0xa70268+'/'+_0x3e7042+'/'+_0x4e7754+'/'+_0x5586e3;try{resolveLocalFilePathFromLockKey(_0x5f0b50,_0x4f6481),resolveLocalFilePathFromLockKey(_0x5f0b50,_0x1613dd);}catch(_0x34ba68){throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x186)+_0x4f6481+_0x252a3f(0x155)+(_0x34ba68 instanceof Error?_0x34ba68[_0x252a3f(0x15d)]:String(_0x34ba68)));}_0x2383e9[_0x252a3f(0x179)]['push']({'oldLockKey':_0x4f6481,'newLockKey':_0x1613dd,'entry':_0x412830}),_0x23156d[_0x252a3f(0x189)](_0x25c8d9,_0x2383e9);}const _0x57ca33=new Set([..._0x23156d[_0x252a3f(0x11b)]()][_0x252a3f(0x133)](_0x159f09=>_0x159f09[_0x252a3f(0x179)][_0x252a3f(0x128)](_0x18bd17=>_0x18bd17[_0x252a3f(0x192)]))),_0x4cd525=new Map(),_0x15fa76=new Map();for(const [_0x6a83ad,_0x5edfee]of _0x23156d){const _0x5dbf39=_0x5edfee['alias']??_0x5edfee[_0x252a3f(0x19d)],_0x1439a3=hookDirectoryIdentity(_0x5dbf39),_0x3fca59=_0x4cd525[_0x252a3f(0x157)](_0x1439a3);if(_0x3fca59&&_0x3fca59!==_0x6a83ad)throw CliErrors[_0x252a3f(0x178)]('Cannot\x20migrate\x20HOOK\x20directories\x20\x22'+_0x3fca59+_0x252a3f(0x160)+_0x6a83ad+_0x252a3f(0x1a8)+_0x5dbf39+_0x252a3f(0x141));_0x4cd525[_0x252a3f(0x189)](_0x1439a3,_0x6a83ad);for(const _0x2d0cbc of _0x5edfee[_0x252a3f(0x179)]){const _0x5cd9ab=_0x15fa76[_0x252a3f(0x157)](_0x2d0cbc[_0x252a3f(0x17f)]);if(_0x5cd9ab&&_0x5cd9ab!==_0x2d0cbc[_0x252a3f(0x192)])throw CliErrors[_0x252a3f(0x178)]('Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22'+_0x5cd9ab+_0x252a3f(0x160)+_0x2d0cbc[_0x252a3f(0x192)]+_0x252a3f(0x1a8)+_0x2d0cbc[_0x252a3f(0x17f)]+_0x252a3f(0x146));if(_0x57ca33[_0x252a3f(0x180)](_0x2d0cbc[_0x252a3f(0x17f)]))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x2d0cbc['oldLockKey']+_0x252a3f(0x151)+_0x2d0cbc['newLockKey']+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x15fa76[_0x252a3f(0x189)](_0x2d0cbc['newLockKey'],_0x2d0cbc['oldLockKey']);}}const _0x40550b=new Map();for(const [_0x202bb1,_0x2e856a]of _0x252769){_0x40550b[_0x252a3f(0x189)](hookDirectoryIdentity(_0x2e856a),_0x202bb1);}const _0x1e3038=[];for(const [_0x48c375,_0x16fab1]of _0x23156d){const _0xb23a70=_0x16fab1[_0x252a3f(0x134)]??_0x16fab1[_0x252a3f(0x19d)],_0x356f57=join(_0x5f0b50[_0x252a3f(0x18c)],_0x252a3f(0x1a3),_0x48c375),_0x48adf0=join(_0x5f0b50[_0x252a3f(0x18c)],_0x252a3f(0x1a3),_0xb23a70),_0x2e657e=await directoryExists(_0x356f57),_0x2a04e2=await directoryExists(_0x48adf0),_0x42db59=_0x2e657e?_0x2a04e2?await sameDirectory(_0x356f57,_0x48adf0)?_0x252a3f(0x185):undefined:'move':_0x252a3f(0x1ad);if(!_0x42db59)throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x166)+_0xb23a70+_0x252a3f(0x190));const _0x8237bd=_0x40550b['get'](hookDirectoryIdentity(_0x48c375));if(_0x8237bd&&_0x8237bd!==_0x16fab1[_0x252a3f(0x19d)][_0x252a3f(0x1a0)]()){const _0x6a5bb1=new Set(_0x16fab1[_0x252a3f(0x179)]['map'](_0x196bc4=>_0x196bc4[_0x252a3f(0x192)])),_0x50b983=_0x8000a9[_0x252a3f(0x12a)](_0x5a7018=>_0x5a7018[_0x252a3f(0x14a)]===_0x252a3f(0x1a3)&&_0x5a7018[_0x252a3f(0x134)]!=null&&hookDirectoryIdentity(_0x5a7018[_0x252a3f(0x134)])===hookDirectoryIdentity(_0x48c375)&&!_0x6a5bb1[_0x252a3f(0x180)](_0x5a7018[_0x252a3f(0x123)]));if(_0x50b983['length']>0x0)throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x129));}const _0x49e5ae=_0x40550b[_0x252a3f(0x157)](hookDirectoryIdentity(_0xb23a70));if(_0x49e5ae&&_0x49e5ae!==_0x16fab1[_0x252a3f(0x19d)][_0x252a3f(0x1a0)]())throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x166)+_0xb23a70+_0x252a3f(0x164));for(const _0x2bacb0 of _0x16fab1[_0x252a3f(0x179)]){const _0x4dfa32=_0x9d1ee1[_0x252a3f(0x121)][_0x2bacb0[_0x252a3f(0x17f)]];if(_0x4dfa32&&!_0x57ca33['has'](_0x2bacb0[_0x252a3f(0x17f)])&&!sameHookIdentity(_0x2bacb0[_0x252a3f(0x177)],_0x4dfa32))throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x166)+_0xb23a70+_0x252a3f(0x12f));}_0x1e3038[_0x252a3f(0x13f)]({'oldDirectory':_0x48c375,'newDirectory':_0xb23a70,'oldDirectoryPath':_0x356f57,'newDirectoryPath':_0x48adf0,'mode':_0x42db59,'alias':_0x16fab1['alias'],'keyChanges':_0x16fab1['keyChanges']});}const _0x41923a={..._0x9d1ee1['functions']},_0x2a410=new Map(),_0x19e943=new Map();for(const _0x12443f of _0x1e3038){const _0x22cd15=_0x12443f[_0x252a3f(0x19e)]!==_0x252a3f(0x1ad);_0x22cd15&&_0x19e943[_0x252a3f(0x189)](hookDirectoryIdentity(_0x12443f[_0x252a3f(0x182)]),_0x12443f[_0x252a3f(0x149)]);for(const _0x3653a7 of _0x12443f[_0x252a3f(0x179)]){const _0x4edb68=_0x41923a[_0x3653a7['newLockKey']],_0x25942d=_0x22cd15?_0x3653a7[_0x252a3f(0x177)]:_0x4edb68??_0x3653a7[_0x252a3f(0x177)];_0x41923a[_0x3653a7[_0x252a3f(0x17f)]]=canonicalizeHookEntry(_0x25942d,_0x12443f[_0x252a3f(0x134)]),delete _0x41923a[_0x3653a7[_0x252a3f(0x192)]],_0x22cd15&&_0x2a410['set'](_0x3653a7[_0x252a3f(0x17f)],resolveLocalFilePathFromLockKey(_0x5f0b50,_0x3653a7[_0x252a3f(0x192)]));}}return{'migrations':_0x1e3038,'projectedFunctions':_0x41923a,'sourceFilePathByNewLockKey':_0x2a410,'sourceDirectoryPathByNewDirectory':_0x19e943};}function resolveMigratedSourceFilePath(_0x40dcd8,_0x24864f){const _0x5ae936=a37_0x388fe5;if(!_0x40dcd8||!_0x24864f)return undefined;const _0x53cc1a=_0x40dcd8[_0x5ae936(0x125)][_0x5ae936(0x157)](_0x24864f[_0x5ae936(0x123)]);if(_0x53cc1a)return _0x53cc1a;if(_0x24864f['type']!==_0x5ae936(0x1a3))return undefined;const [,_0x1bc043,..._0x4c147e]=_0x24864f[_0x5ae936(0x123)][_0x5ae936(0x131)]('/');if(!_0x1bc043||_0x4c147e['length']===0x0)return undefined;const _0x11d93c=_0x40dcd8[_0x5ae936(0x181)][_0x5ae936(0x157)](hookDirectoryIdentity(_0x1bc043));return _0x11d93c?join(_0x11d93c,..._0x4c147e)+_0x5ae936(0x18b):undefined;}function sameHookIdentity(_0x155a20,_0x19dc85){const _0x5c10d6=a37_0x388fe5;return _0x155a20[_0x5c10d6(0x12d)]===_0x19dc85[_0x5c10d6(0x12d)]&&_0x155a20[_0x5c10d6(0x19d)]===_0x19dc85[_0x5c10d6(0x19d)]&&_0x155a20['operationType']===_0x19dc85[_0x5c10d6(0x12b)]&&_0x155a20[_0x5c10d6(0x1a6)]===_0x19dc85[_0x5c10d6(0x1a6)];}function canonicalizeHookEntry(_0x23dcd9,_0x4c07fe){const {alias:_0x346f4c,..._0xab5d28}=_0x23dcd9;return _0x4c07fe?{..._0xab5d28,'alias':_0x4c07fe}:_0xab5d28;}function hookDirectoryIdentity(_0x380c63){const _0x562763=a37_0x388fe5;return _0x380c63['normalize'](_0x562763(0x18a))['toLowerCase']();}function a37_0xc97c(){const _0x3ae493=['14007540RjkcFA','code','set','NFC','.js','scriptsRootDir','\x20conflict','stdin','2yLRCZf','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','5022514BnFjvx','oldLockKey','\x20failed','HOOK/','ino','nonInteractive','yes','projectedFunctions','BFF_LOCAL_UNSYNCED','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','string','4544IdEQlY','datasetCode','mode','apps','toLowerCase','\x20--name\x20','\x20bff\x20push\x20--type\x20','HOOK','conflict','apiDir','functionNode','\x22;\x20temporary\x20directory\x20\x22','\x22:\x20both\x20target\x20\x22','rollback','skipped','hash','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','rekey','197937hCtPrT','values','2118ljGJsD','5711105etqyYx','Force\x20overwrite\x20local\x20unsynced\x20changes','\x20resolution','str','functions','\x22\x20from\x20\x22','lockKey','Remote\x20script\x20missing\x20id.','sourceFilePathByNewLockKey','\x20--format\x20compress','length','map','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','filter','operationType','1121699rfgOGu','remoteId','delete','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','oldDirectory','split','close','flatMap','alias','bff','11CEcicB','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','\x20Recovery\x20errors:\x20','lockFilePath','parse','stderr','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','ENDPOINT','filePath','push','Remote\x20script\x20missing\x20content.','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','trim','unresolvable\x20target\x20path','scriptContent','version','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','write','oldDirectoryPath','type','ENOENT','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','force','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','352ivBqBb','newDirectoryPath','\x22:\x20its\x20target\x20\x22','Failed\x20to\x20write\x20local\x20script\x20\x22','Force\x20pull\x20cancelled.','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','\x22:\x20','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','get','utf8','6sZsGEl','pull','require','push_local','message','some','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x22\x20and\x20\x22','hookLocation','toISOString','\x20skipped','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','content','\x22\x20to\x20\x22','&type=','migrations','would_pull','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','stringify','Lock\x20scope\x20for\x20app\x20\x22','6609410FeGDiL','scriptType','question','scriptsRoot','Pull\x20complete:\x20','read','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','all','GET','dev','entry','validation','keyChanges','existed','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','lastSync','\x20pulled','appCode','newLockKey','has','sourceDirectoryPathByNewDirectory','newDirectory','Pull\x20only\x20this\x20script\x20type','requires','case-rename','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'];a37_0xc97c=function(){return _0x3ae493;};return a37_0xc97c();}function isSafeHookDirectorySegment(_0x651970){return isSafeLockKeySegment(_0x651970);}async function sameDirectory(_0x2cc64f,_0x4f41a1){const _0x254ec2=a37_0x388fe5,[_0x569352,_0x541ba2]=await Promise[_0x254ec2(0x174)]([stat(_0x2cc64f),stat(_0x4f41a1)]);return _0x569352['dev']===_0x541ba2[_0x254ec2(0x176)]&&_0x569352[_0x254ec2(0x195)]===_0x541ba2[_0x254ec2(0x195)];}async function applyHookDirectoryMigration(_0x4622c8,_0x4c8ac7){const _0x356e37=a37_0x388fe5,_0x34e6f0=_0x4c8ac7[_0x356e37(0x121)],_0x5c6be4=_0x4c8ac7['lastSync'],_0x2b3c23=[],_0x2850e8=async()=>{const _0x36bb52=_0x356e37,_0x568c49=[];_0x4c8ac7[_0x36bb52(0x121)]=_0x34e6f0,_0x4c8ac7[_0x36bb52(0x17c)]=_0x5c6be4;for(const {migration:_0x50c799,temporaryPath:_0x1acd3b}of[..._0x2b3c23]['reverse']()){try{_0x1acd3b?(await rename(_0x50c799[_0x36bb52(0x150)],_0x1acd3b),await rename(_0x1acd3b,_0x50c799[_0x36bb52(0x149)])):await rename(_0x50c799[_0x36bb52(0x150)],_0x50c799['oldDirectoryPath']);}catch(_0x3a5ff2){_0x568c49['push'](new Error(_0x36bb52(0x147)+_0x50c799[_0x36bb52(0x130)]+_0x36bb52(0x122)+_0x50c799[_0x36bb52(0x182)]+_0x36bb52(0x155)+(_0x3a5ff2 instanceof Error?_0x3a5ff2[_0x36bb52(0x15d)]:String(_0x3a5ff2))));}}return _0x568c49;};try{for(const _0x119122 of _0x4622c8[_0x356e37(0x168)]){if(_0x119122['mode']==='move')await ensureParentDirectory(_0x119122[_0x356e37(0x150)]),await rename(_0x119122[_0x356e37(0x149)],_0x119122['newDirectoryPath']),_0x2b3c23[_0x356e37(0x13f)]({'migration':_0x119122});else{if(_0x119122[_0x356e37(0x19e)]===_0x356e37(0x185)){const _0x82798e=join(dirname(_0x119122['oldDirectoryPath']),'.hook-directory-migrate-'+randomUUID());await rename(_0x119122[_0x356e37(0x149)],_0x82798e);try{await rename(_0x82798e,_0x119122[_0x356e37(0x150)]);}catch(_0x4de02c){try{await rename(_0x82798e,_0x119122[_0x356e37(0x149)]);}catch(_0x3d9543){throw withRollbackErrors(_0x4de02c,_0x356e37(0x16a)+_0x119122['oldDirectory']+_0x356e37(0x166)+_0x119122['newDirectory']+_0x356e37(0x1a7)+_0x82798e+'\x22\x20may\x20remain.',[new Error(_0x356e37(0x1ac)+_0x82798e+_0x356e37(0x166)+_0x119122['oldDirectory']+_0x356e37(0x155)+(_0x3d9543 instanceof Error?_0x3d9543[_0x356e37(0x15d)]:String(_0x3d9543)))]);}throw _0x4de02c;}_0x2b3c23[_0x356e37(0x13f)]({'migration':_0x119122,'temporaryPath':_0x82798e});}}}return _0x4c8ac7['functions']=_0x4622c8[_0x356e37(0x198)],{'rollback':_0x2850e8};}catch(_0x27d8b1){const _0x4cba80=await _0x2850e8();throw withRollbackErrors(_0x27d8b1,_0x356e37(0x17b),_0x4cba80);}}async function confirmForce(){const _0x237845=a37_0x388fe5,_0x272b77=createInterface({'input':process[_0x237845(0x18e)],'output':process[_0x237845(0x13b)]}),_0x35bfc4=await new Promise(_0x245d79=>{const _0x56cebc=_0x237845;_0x272b77[_0x56cebc(0x16f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x245d79);});return _0x272b77[_0x237845(0x132)](),['y',_0x237845(0x197)]['includes'](_0x35bfc4[_0x237845(0x142)]()[_0x237845(0x1a0)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x3c8ed0=a37_0x3770;(function(_0x112c01,_0x180608){const _0x4a3be3=a37_0x3770,_0x4bb83e=_0x112c01();while(!![]){try{const _0x4641f8=-parseInt(_0x4a3be3(0x156))/0x1*(-parseInt(_0x4a3be3(0x152))/0x2)+parseInt(_0x4a3be3(0x12b))/0x3*(parseInt(_0x4a3be3(0x169))/0x4)+parseInt(_0x4a3be3(0x161))/0x5+parseInt(_0x4a3be3(0x13d))/0x6+-parseInt(_0x4a3be3(0x157))/0x7*(parseInt(_0x4a3be3(0x122))/0x8)+-parseInt(_0x4a3be3(0x11b))/0x9+-parseInt(_0x4a3be3(0x15f))/0xa*(-parseInt(_0x4a3be3(0x12d))/0xb);if(_0x4641f8===_0x180608)break;else _0x4bb83e['push'](_0x4bb83e['shift']());}catch(_0x5ee488){_0x4bb83e['push'](_0x4bb83e['shift']());}}}(a37_0x4876,0x5eac9));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':'push','description':a37_0x3c8ed0(0x11e),'risk':'write','flags':[{'name':a37_0x3c8ed0(0x11f),'type':a37_0x3c8ed0(0x144),'description':a37_0x3c8ed0(0x11d),'enum':['COMMON',a37_0x3c8ed0(0x159),a37_0x3c8ed0(0x160)]},{'name':a37_0x3c8ed0(0x14b),'type':a37_0x3c8ed0(0x144),'description':a37_0x3c8ed0(0x149)},{'name':a37_0x3c8ed0(0x134),'type':a37_0x3c8ed0(0x137),'description':a37_0x3c8ed0(0x16f)}],async 'dryRun'(_0xe9672e){const _0x11ba41=a37_0x3c8ed0,_0x40137a=loadBffProjectConfig(_0xe9672e[_0x11ba41(0x15a)]),_0x53e867=await readBffLockFile(_0x40137a['lockFilePath']),{appLock:_0x2d5f8b}=ensureLockScope(_0x53e867??createEmptyBffLock(),_0xe9672e[_0x11ba41(0x15a)],_0x40137a[_0x11ba41(0x121)],_0x11ba41(0x141)),_0xa37bcc=await getTargetFunctions(_0x40137a,_0xe9672e),_0x88d7fa=_0xe9672e[_0x11ba41(0x145)](_0x11ba41(0x134)),_0x436eb6=[];for(const _0x1af01e of _0xa37bcc){const _0x759588=await computeFileHash(_0x1af01e[_0x11ba41(0x166)]),_0x1c471f=_0x2d5f8b[_0x11ba41(0x139)][_0x1af01e[_0x11ba41(0x119)]],_0x2b74d6=!!_0x1c471f&&_0x1c471f['hash']===_0x759588,_0x62430=!_0x88d7fa&&_0x2b74d6?_0x11ba41(0x14a):_0x11ba41(0x12c);_0x436eb6[_0x11ba41(0x141)]({'lockKey':_0x1af01e[_0x11ba41(0x119)],'filePath':_0x1af01e['filePath'],'remoteId':_0x1c471f?.[_0x11ba41(0x14f)]??null,'mode':_0x1c471f?.[_0x11ba41(0x14f)]?_0x11ba41(0x128):_0x11ba41(0x153),'status':_0x62430});}return{'method':_0x11ba41(0x13a),'url':_0x11ba41(0x143),'body':{'appCode':_0xe9672e[_0x11ba41(0x15a)],'force':_0x88d7fa,'files':_0x436eb6,'cacheClearAtRuntime':_0x436eb6[_0x11ba41(0x170)](_0x4347ae=>_0x4347ae[_0x11ba41(0x151)]===_0x11ba41(0x12c)),'cacheClearAtRuntimeTimes':_0x436eb6[_0x11ba41(0x170)](_0x2b914c=>_0x2b914c['status']===_0x11ba41(0x12c))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x436eb6['length']+'\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x1db940){const _0x1277c8=a37_0x3c8ed0,_0x356bde=loadBffProjectConfig(_0x1db940[_0x1277c8(0x15a)]),_0xb732bf=await readBffLockFile(_0x356bde[_0x1277c8(0x162)]),{lockData:_0xa18f0f,appLock:_0x106bb9}=ensureLockScope(_0xb732bf??createEmptyBffLock(),_0x1db940['appCode'],_0x356bde['scriptsRoot'],'push'),_0x3b2d4e=await getTargetFunctions(_0x356bde,_0x1db940);if(_0x3b2d4e[_0x1277c8(0x148)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x1277c8(0x12a)};const _0x592f60=_0x1db940[_0x1277c8(0x145)](_0x1277c8(0x134)),_0x27aaf5=JSON[_0x1277c8(0x158)](JSON[_0x1277c8(0x135)](_0xa18f0f)),_0x5696ca=_0x27aaf5[_0x1277c8(0x163)][_0x1db940[_0x1277c8(0x15a)]];if(!_0x5696ca)throw new Error(_0x1277c8(0x16a)+_0x1db940['appCode']+_0x1277c8(0x13b));const _0x26f355=await buildHookMaps(_0x1db940[_0x1277c8(0x15a)],_0x1db940[_0x1277c8(0x15c)],_0x3b2d4e,_0x5696ca),_0xcdb64c=[],_0x5ad127=[],_0x54983e=[];for(const _0x2030cc of _0x3b2d4e){const _0x36ec51=await computeFileHash(_0x2030cc[_0x1277c8(0x166)]),_0x94c5e4=_0x5696ca[_0x1277c8(0x139)][_0x2030cc[_0x1277c8(0x119)]];if(!_0x592f60&&_0x94c5e4&&_0x94c5e4[_0x1277c8(0x14c)]===_0x36ec51){_0x5ad127[_0x1277c8(0x141)]({'lockKey':_0x2030cc['lockKey'],'reason':_0x1277c8(0x14a)});continue;}try{await uploadSingleFunction(_0x1db940['appCode'],_0x2030cc,_0x5696ca,_0x26f355);const _0x1cd50a=_0x5696ca[_0x1277c8(0x139)][_0x2030cc['lockKey']];_0xcdb64c['push']({'lockKey':_0x2030cc[_0x1277c8(0x119)],'remoteId':_0x1cd50a?.[_0x1277c8(0x14f)]??0x0});}catch(_0x32dcd4){_0x54983e[_0x1277c8(0x141)]({'lockKey':_0x2030cc['lockKey'],'error':_0x32dcd4 instanceof Error?_0x32dcd4[_0x1277c8(0x150)]:String(_0x32dcd4)});}}_0x5696ca[_0x1277c8(0x155)]=new Date()[_0x1277c8(0x129)](),await writeBffLockFile(_0x356bde['lockFilePath'],_0x27aaf5),await waitForUploadedLockEntries(_0x356bde[_0x1277c8(0x162)],_0x1db940[_0x1277c8(0x15a)],_0xcdb64c[_0x1277c8(0x11a)](_0x5b4f52=>_0x5b4f52[_0x1277c8(0x119)]));let _0x5bd4fb={'attempted':![],'cleared':![]};if(_0xcdb64c[_0x1277c8(0x148)]>0x0)try{let _0x55f5a3='';for(let _0x24a02c=0x0;_0x24a02c<CACHE_CLEAR_ATTEMPTS;_0x24a02c+=0x1){_0x55f5a3=await clearBffScriptCache(),_0x24a02c<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5bd4fb={'attempted':!![],'cleared':!![],'message':_0x55f5a3||_0x1277c8(0x125)};}catch(_0x1a6eea){_0x5bd4fb={'attempted':!![],'cleared':![],'error':_0x1a6eea instanceof Error?_0x1a6eea[_0x1277c8(0x150)]:String(_0x1a6eea)};}const _0x40a083=_0x54983e[_0x1277c8(0x148)]===0x0&&(_0x5bd4fb[_0x1277c8(0x13f)]?_0x5bd4fb[_0x1277c8(0x126)]:!![]),_0x13f81e=_0x40a083,_0x4662ae=_0x5bd4fb[_0x1277c8(0x13f)]?_0x5bd4fb[_0x1277c8(0x126)]?_0x1277c8(0x14e):_0x1277c8(0x16c):_0x1277c8(0x13e);return{'ok':_0x13f81e,'data':{'uploaded':_0xcdb64c,'skipped':_0x5ad127,'failed':_0x54983e,'cacheClear':_0x5bd4fb},'message':_0x1277c8(0x167)+_0xcdb64c['length']+_0x1277c8(0x123)+_0x5ad127[_0x1277c8(0x148)]+_0x1277c8(0x13c)+_0x54983e[_0x1277c8(0x148)]+'\x20failed,\x20'+_0x4662ae};}};function a37_0x3770(_0x16c030,_0x2fd285){_0x16c030=_0x16c030-0x119;const _0x487628=a37_0x4876();let _0x3770d3=_0x487628[_0x16c030];return _0x3770d3;}async function getTargetFunctions(_0x49980f,_0x2259fd){const _0xb208b0=a37_0x3c8ed0,_0x1258f6=_0x2259fd[_0xb208b0(0x130)](_0xb208b0(0x11f)),_0x2b918f=_0x2259fd[_0xb208b0(0x130)](_0xb208b0(0x14b)),_0x1f9552=normalizeBffType(_0x1258f6)??undefined;if(_0x2b918f&&!_0x1f9552)throw CliErrors[_0xb208b0(0x16e)](_0xb208b0(0x120));const _0x4b5854=await scanLocalBffFunctions(_0x49980f,_0x1f9552);if(_0x2b918f){const _0x7c8c70=_0x4b5854[_0xb208b0(0x127)](_0x15adc3=>_0x15adc3[_0xb208b0(0x14b)]===_0x2b918f);if(_0x7c8c70[_0xb208b0(0x148)]===0x0)throw CliErrors[_0xb208b0(0x16e)](_0xb208b0(0x12e)+_0x1f9552+'/'+_0x2b918f);return _0x7c8c70;}return _0x4b5854;}async function buildHookMaps(_0x51a666,_0x3b7f23,_0x27657b,_0x788c05){const _0x417fef=a37_0x3c8ed0,_0x3b15f1=_0x27657b[_0x417fef(0x170)](_0x46490c=>_0x46490c[_0x417fef(0x11f)]===_0x417fef(0x160));if(!_0x3b15f1)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xa4e581=loadAliasMap(_0x3b7f23,undefined,resolveApiFilePath(_0x3b7f23,_0x51a666)),_0x64ed0c=new Map(_0xa4e581[_0x417fef(0x11a)](_0x264c9e=>[_0x264c9e['alias'],_0x264c9e[_0x417fef(0x136)]]));for(const _0x3a4f81 of Object['values'](_0x788c05[_0x417fef(0x139)])){_0x3a4f81[_0x417fef(0x14d)]&&_0x3a4f81[_0x417fef(0x136)]&&!_0x64ed0c['has'](_0x3a4f81[_0x417fef(0x14d)])&&_0x64ed0c[_0x417fef(0x146)](_0x3a4f81[_0x417fef(0x14d)],_0x3a4f81[_0x417fef(0x136)]);}const _0x48e064=await listDatasets(_0x51a666),_0x371d56=new Map(_0x48e064['map'](_0x4c4fd7=>[_0x4c4fd7[_0x417fef(0x15d)],_0x4c4fd7]));return{'aliasToDatasetCode':_0x64ed0c,'datasetCodeToDataset':_0x371d56};}function a37_0x4876(){const _0x5ecf49=['datasetId','apiDir','code','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','121530JTYXYx','HOOK','3167520mlrkdD','lockFilePath','apps','Cannot\x20resolve\x20dataset\x20for\x20\x22','aliasToDatasetCode','filePath','Push\x20complete:\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','4dgttYL','Lock\x20scope\x20for\x20app\x20\x22','utf8','runtime\x20cache\x20clear\x20failed','script','validation','Force\x20push\x20ignoring\x20hash\x20protection','some','lockKey','map','4101318qzEMGi','functionNode','Push\x20only\x20this\x20script\x20type','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','type','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','scriptsRoot','2859784VgdXuw','\x20uploaded,\x20','operationType','Runtime\x20script\x20cache\x20cleared.','cleared','filter','update','toISOString','No\x20local\x20Backend\x20Function\x20scripts\x20found.','275691OgMVsP','would_push','33YugwBE','Local\x20function\x20not\x20found:\x20','datasetCodeToDataset','str','every','description','Incomplete\x20HOOK\x20path:\x20','force','stringify','datasetCode','boolean','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','functions','POST','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20skipped,\x20','345528mEYNiw','runtime\x20cache\x20not\x20needed','attempted','get','push','version','/api/management/library/scripts/save','string','bool','set','join','length','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','unchanged','name','hash','alias','runtime\x20cache\x20cleared','remoteId','message','status','381512MgUisN','create','Run\x20`','lastSync','2SFIRjp','7bMGcPO','parse','ENDPOINT','appCode'];a37_0x4876=function(){return _0x5ecf49;};return a37_0x4876();}async function uploadSingleFunction(_0x610284,_0x5a7628,_0x1dc151,_0x152f86){const _0x9c7ef6=a37_0x3c8ed0,_0x56d5b4=await readFile(_0x5a7628[_0x9c7ef6(0x166)],_0x9c7ef6(0x16b)),_0xf4347=await computeFileHash(_0x5a7628['filePath']),_0x1936ae=_0x1dc151[_0x9c7ef6(0x139)][_0x5a7628[_0x9c7ef6(0x119)]];if(_0x1936ae?.['remoteId']&&_0x1936ae['version']==null)throw CliErrors['validation'](_0x5a7628[_0x9c7ef6(0x119)]+_0x9c7ef6(0x168));let _0x50019d=extractScriptDescription(_0x56d5b4);if(!_0x50019d&&_0x1936ae?.[_0x9c7ef6(0x14f)]){const _0x55e911=await getBffScriptInfo(_0x1936ae[_0x9c7ef6(0x14f)]);_0x50019d=_0x55e911[_0x9c7ef6(0x132)]||undefined;}const _0x49447b={'appCode':_0x610284,'functionName':_0x5a7628[_0x9c7ef6(0x14b)],'scriptType':_0x5a7628[_0x9c7ef6(0x11f)],'scriptContent':_0x56d5b4};if(_0x1936ae?.['remoteId'])_0x49447b['id']=_0x1936ae[_0x9c7ef6(0x14f)];if(_0x1936ae?.[_0x9c7ef6(0x142)]!=null)_0x49447b[_0x9c7ef6(0x142)]=_0x1936ae[_0x9c7ef6(0x142)];if(_0x50019d)_0x49447b['description']=_0x50019d;if(_0x5a7628[_0x9c7ef6(0x11f)]===_0x9c7ef6(0x160)){const _0x3ef9b8=_0x5a7628[_0x9c7ef6(0x14d)];if(!_0x3ef9b8||!_0x5a7628[_0x9c7ef6(0x124)]||!_0x5a7628['functionNode'])throw CliErrors[_0x9c7ef6(0x16e)](_0x9c7ef6(0x133)+_0x5a7628['lockKey']);const _0x4b92c9=_0x152f86['aliasToDatasetCode'][_0x9c7ef6(0x140)](_0x3ef9b8)??_0x1936ae?.[_0x9c7ef6(0x136)]??_0x3ef9b8,_0x15a940=_0x152f86[_0x9c7ef6(0x12f)][_0x9c7ef6(0x140)](_0x4b92c9);if(!_0x15a940)throw CliErrors[_0x9c7ef6(0x16e)](_0x9c7ef6(0x164)+_0x3ef9b8+'\x22.\x20'+(_0x9c7ef6(0x154)+CLI_BIN_NAME+_0x9c7ef6(0x138)));_0x49447b[_0x9c7ef6(0x15b)]=_0x15a940['id'],_0x49447b[_0x9c7ef6(0x124)]=_0x5a7628[_0x9c7ef6(0x124)],_0x49447b['functionNode']=_0x5a7628[_0x9c7ef6(0x11c)];}const _0x5a84ef=await saveBffScript(_0x49447b),_0x554643=_0x5a84ef['id'],_0xcffe15=_0x5a84ef[_0x9c7ef6(0x16d)]??await getBffScriptInfo(_0x554643),_0x397f2d={'hash':_0xf4347,'remoteId':_0x554643,'version':_0xcffe15[_0x9c7ef6(0x142)]};if(_0x5a7628[_0x9c7ef6(0x11f)]===_0x9c7ef6(0x160)){const _0x1f0618=_0x5a7628[_0x9c7ef6(0x14d)],_0xa9a02c=_0x152f86[_0x9c7ef6(0x165)]['get'](_0x1f0618)??_0x1936ae?.[_0x9c7ef6(0x136)]??_0x1f0618;_0x152f86[_0x9c7ef6(0x165)]['has'](_0x1f0618)?_0x397f2d[_0x9c7ef6(0x14d)]=_0x1f0618:_0x397f2d[_0x9c7ef6(0x14d)]=_0x1936ae?.[_0x9c7ef6(0x14d)],_0x397f2d[_0x9c7ef6(0x136)]=_0xa9a02c,_0x397f2d[_0x9c7ef6(0x124)]=_0x5a7628['operationType'],_0x397f2d['functionNode']=_0x5a7628[_0x9c7ef6(0x11c)];}_0x1dc151[_0x9c7ef6(0x139)][_0x5a7628[_0x9c7ef6(0x119)]]=_0x397f2d;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x21ab93,_0x2000f3,_0x227363){const _0x4eca22=a37_0x3c8ed0;if(_0x227363[_0x4eca22(0x148)]===0x0)return;for(let _0x3396f7=0x0;_0x3396f7<LOCK_SETTLE_RETRY_COUNT;_0x3396f7+=0x1){const _0xa7b8ef=await readBffLockFile(_0x21ab93),_0x272910=_0xa7b8ef?.[_0x4eca22(0x163)]?.[_0x2000f3]?.[_0x4eca22(0x139)]??{},_0x27794c=_0x227363[_0x4eca22(0x131)](_0x5a984f=>!!_0x272910[_0x5a984f]?.['remoteId']);if(_0x27794c)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x4eca22(0x15e)+_0x227363[_0x4eca22(0x147)](',\x20')+'.');}
|
|
1
|
+
const a38_0x391df8=a38_0x4a08;(function(_0x22d0da,_0x54c554){const _0x4550dd=a38_0x4a08,_0x65cb4f=_0x22d0da();while(!![]){try{const _0x36099e=parseInt(_0x4550dd(0xab))/0x1+parseInt(_0x4550dd(0xbe))/0x2*(parseInt(_0x4550dd(0xb0))/0x3)+parseInt(_0x4550dd(0xc2))/0x4*(parseInt(_0x4550dd(0xa6))/0x5)+parseInt(_0x4550dd(0x8d))/0x6+parseInt(_0x4550dd(0xda))/0x7*(-parseInt(_0x4550dd(0xca))/0x8)+-parseInt(_0x4550dd(0x73))/0x9*(parseInt(_0x4550dd(0x75))/0xa)+parseInt(_0x4550dd(0xb2))/0xb*(-parseInt(_0x4550dd(0xa7))/0xc);if(_0x36099e===_0x54c554)break;else _0x65cb4f['push'](_0x65cb4f['shift']());}catch(_0x1af402){_0x65cb4f['push'](_0x65cb4f['shift']());}}}(a38_0x4ef9,0x8d97a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,getBffScriptStatistics,getPlatformErrorCode,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{buildHookDirectoryIndexes,assertUnambiguousHookAliases,assertUnambiguousHookDirectoryMappings,preflightPushHookDirectories,trackedHookDirectoryMappings}from'../../core/bff/hook-directory.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription,snakeToCamel}from'../../core/bff/utils.js';function a38_0x4ef9(){const _0x18b57c=['Local\x20function\x20not\x20found:\x20','functions','toISOString','flatMap','runtime\x20cache\x20not\x20needed','117ivvmax','\x20skipped','766430LenQDN','script','str','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','requires','validation',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','string','Force\x20push\x20ignoring\x20hash\x20protection','Review\x20the\x20current\x20remote\x20source,\x20merge\x20it\x20into\x20the\x20local\x20script,\x20then\x20retry\x20push.\x20Do\x20not\x20use\x20--force\x20unless\x20you\x20intentionally\x20discard\x20local\x20changes.','afterScriptId','operationType','runtime\x20cache\x20cleared','apps','write','join','has','attempted','datasetCode','BFF_REMOTE_VERSION_CHANGED','functionNode','Dataset\x20metadata\x20is\x20unavailable;\x20the\x20existing\x20script\x20and\x20binding\x20were\x20verified.\x20Update\x20by\x20script\x20ID\x20without\x20rebinding.','delete','appCode','2136192voIgBo','before','bff','size','apiDir','name','push','type','/api/management/library/scripts/save','lockFilePath','startsWith','HOOK','Multiple\x20HOOK\x20directories\x20reference\x20the\x20same\x20missing\x20Dataset.\x20Resolve\x20duplicate\x20directories\x20before\x20pushing.','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','runtime\x20cache\x20clear\x20failed','every','Push\x20only\x20this\x20script\x20type','ENDPOINT','BFF_REMOTE_VERSION_MISSING','failed','some','bool','beforeScriptId','conflict','remoteId','85ourvEv','9892752voMlLl','version','lockKey','utf8','891496ENMDFr','dataset','alias','Push\x20complete:\x20','\x20conflict','6bPaoQR','scriptsRoot','11LGBWMI','require','\x20failed','HOOK_DATASET_NOT_FOUND:','warnings','scriptType','hash','get','COMMON','values','POST','datasetId','576454iUapdH','cleared','\x20--format\x20compress','filter','219892LiSKAK','description','length','\x22\x20not\x20found\x20after\x20ensureLockScope.','Runtime\x20script\x20cache\x20cleared.','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','message','update','2862448MDZAJh','test','The\x20local\x20sync\x20lock\x20has\x20no\x20remote\x20version\x20for\x20this\x20script.','set','existingHooks','No\x20local\x20Backend\x20Function\x20scripts\x20found.','stringify','would_push','force','map','Cannot\x20verify\x20existing\x20HOOK\x20binding:\x20','resolutions','filePath','failures','parse','status','7daAcAu','create','functionName'];a38_0x4ef9=function(){return _0x18b57c;};return a38_0x4ef9();}import{sleep}from'../../utils/sleep.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a38_0x391df8(0x8f),'command':a38_0x391df8(0x93),'description':a38_0x391df8(0x78),'risk':a38_0x391df8(0x83),'structuredErrors':!![],'flags':[{'name':a38_0x391df8(0x94),'type':a38_0x391df8(0x7c),'description':a38_0x391df8(0x9d),'enum':[a38_0x391df8(0xba),a38_0x391df8(0x9e),a38_0x391df8(0x98)]},{'name':a38_0x391df8(0x92),'type':a38_0x391df8(0x7c),'description':a38_0x391df8(0x9a)},{'name':a38_0x391df8(0xd2),'type':'boolean','description':a38_0x391df8(0x7d)}],async 'dryRun'(_0x387d59){const _0x3be4f8=a38_0x391df8,_0x1507bb=loadBffProjectConfig(_0x387d59[_0x3be4f8(0x8c)]),_0x24e3ff=await readBffLockFile(_0x1507bb[_0x3be4f8(0x96)]),{appLock:_0x1cec24}=ensureLockScope(_0x24e3ff??createEmptyBffLock(),_0x387d59[_0x3be4f8(0x8c)],_0x1507bb[_0x3be4f8(0xb1)],'push'),_0x45f75d=await getTargetFunctions(_0x1507bb,_0x387d59),_0x3ade05=_0x45f75d[_0x3be4f8(0xa1)](_0x4886c9=>_0x4886c9[_0x3be4f8(0x94)]===_0x3be4f8(0x98))?await scanLocalBffFunctions(_0x1507bb,'HOOK'):_0x45f75d,_0x28464e=await buildHookMaps(_0x387d59[_0x3be4f8(0x8c)],_0x387d59['apiDir'],_0x3ade05,_0x1cec24),_0x154941=_0x387d59['bool']('force'),_0x34bd6c=[];for(const _0x4eba69 of _0x45f75d){const _0x42c717=await computeFileHash(_0x4eba69['filePath']),_0x498942=_0x1cec24[_0x3be4f8(0xde)][_0x4eba69['lockKey']],_0x3f7a7e=!!_0x498942&&_0x498942[_0x3be4f8(0xb8)]===_0x42c717,_0x12cae5=_0x28464e[_0x3be4f8(0xd5)][_0x3be4f8(0xb9)](_0x4eba69[_0x3be4f8(0xa9)]),_0x541674=!!_0x498942?.[_0x3be4f8(0xa5)]&&_0x498942['version']==null&&(_0x154941||!_0x3f7a7e),_0x1f5aa2=_0x541674?missingRemoteVersionConflict(_0x4eba69,_0x498942):undefined,_0x3340cc=_0x28464e[_0x3be4f8(0xd7)][_0x3be4f8(0x85)](_0x4eba69[_0x3be4f8(0xa9)])?_0x3be4f8(0xa0):!_0x154941&&_0x3f7a7e?'unchanged':_0x1f5aa2?_0x3be4f8(0xa4):'would_push';_0x34bd6c[_0x3be4f8(0x93)]({'lockKey':_0x4eba69[_0x3be4f8(0xa9)],'filePath':_0x4eba69['filePath'],'remoteId':_0x498942?.[_0x3be4f8(0xa5)]??null,'mode':_0x498942?.[_0x3be4f8(0xa5)]?_0x3be4f8(0xc9):_0x3be4f8(0xdb),'status':_0x3340cc,..._0x28464e[_0x3be4f8(0xd7)][_0x3be4f8(0x85)](_0x4eba69[_0x3be4f8(0xa9)])?{'error':_0x28464e[_0x3be4f8(0xd7)][_0x3be4f8(0xb9)](_0x4eba69[_0x3be4f8(0xa9)])}:{},..._0x1f5aa2?{'conflict':_0x1f5aa2}:{},..._0x28464e[_0x3be4f8(0xce)]['has'](_0x4eba69[_0x3be4f8(0xa9)])?{'datasetCode':_0x498942?.['datasetCode'],'bindingPreserved':!![],'warnings':[existingHookWarning(_0x4eba69[_0x3be4f8(0xa9)])]}:{},..._0x12cae5?{'alias':_0x12cae5[_0x3be4f8(0xad)]??null,'datasetCode':_0x12cae5[_0x3be4f8(0x87)],'operationType':_0x4eba69[_0x3be4f8(0x80)],'functionNode':_0x4eba69[_0x3be4f8(0x89)],'warnings':_0x12cae5[_0x3be4f8(0xb6)]}:{}});}return{'method':_0x3be4f8(0xbc),'url':_0x3be4f8(0x95),'body':{'appCode':_0x387d59[_0x3be4f8(0x8c)],'force':_0x154941,'files':_0x34bd6c,'cacheClearAtRuntime':_0x34bd6c[_0x3be4f8(0xa1)](_0xb97ffb=>_0xb97ffb[_0x3be4f8(0xd9)]===_0x3be4f8(0xd1)),'cacheClearAtRuntimeTimes':_0x34bd6c['some'](_0x55c59e=>_0x55c59e['status']===_0x3be4f8(0xd1))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x34bd6c[_0x3be4f8(0xc4)]+_0x3be4f8(0xc7)};},async 'execute'(_0x1309d3){const _0x3ea39f=a38_0x391df8,_0x16b532=loadBffProjectConfig(_0x1309d3[_0x3ea39f(0x8c)]),_0x387f34=await readBffLockFile(_0x16b532[_0x3ea39f(0x96)]),{lockData:_0x57e95c,appLock:_0x561115}=ensureLockScope(_0x387f34??createEmptyBffLock(),_0x1309d3['appCode'],_0x16b532[_0x3ea39f(0xb1)],_0x3ea39f(0x93)),_0x5c3fad=await getTargetFunctions(_0x16b532,_0x1309d3);if(_0x5c3fad[_0x3ea39f(0xc4)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x3ea39f(0xcf)};const _0x38f18c=_0x1309d3[_0x3ea39f(0xa2)](_0x3ea39f(0xd2)),_0xa700bf=JSON[_0x3ea39f(0xd8)](JSON[_0x3ea39f(0xd0)](_0x57e95c)),_0x53d80d=_0xa700bf['apps'][_0x1309d3[_0x3ea39f(0x8c)]];if(!_0x53d80d)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1309d3[_0x3ea39f(0x8c)]+_0x3ea39f(0xc5));const _0x3631a7=_0x5c3fad[_0x3ea39f(0xa1)](_0x5757de=>_0x5757de[_0x3ea39f(0x94)]===_0x3ea39f(0x98))?await scanLocalBffFunctions(_0x16b532,'HOOK'):_0x5c3fad,_0x5b47d0=await buildHookMaps(_0x1309d3['appCode'],_0x1309d3[_0x3ea39f(0x91)],_0x3631a7,_0x53d80d),_0x5ec21c=[],_0x451190=[],_0x2065f3=[],_0x3fcc2b=[];for(const _0x69316 of _0x5c3fad){const _0x2ae4d5=_0x5b47d0[_0x3ea39f(0xd7)][_0x3ea39f(0xb9)](_0x69316[_0x3ea39f(0xa9)]);if(_0x2ae4d5){_0x3fcc2b[_0x3ea39f(0x93)]({'lockKey':_0x69316['lockKey'],'error':_0x2ae4d5});continue;}const _0x347cce=await computeFileHash(_0x69316['filePath']),_0x2d519d=_0x53d80d[_0x3ea39f(0xde)][_0x69316['lockKey']];if(!_0x38f18c&&_0x2d519d&&_0x2d519d[_0x3ea39f(0xb8)]===_0x347cce){_0x451190['push']({'lockKey':_0x69316[_0x3ea39f(0xa9)],'reason':'unchanged'});continue;}if(_0x2d519d?.['remoteId']&&_0x2d519d['version']==null){_0x2065f3[_0x3ea39f(0x93)](missingRemoteVersionConflict(_0x69316,_0x2d519d));continue;}try{await uploadSingleFunction(_0x1309d3[_0x3ea39f(0x8c)],_0x69316,_0x53d80d,_0x5b47d0);const _0x33906d=_0x53d80d[_0x3ea39f(0xde)][_0x69316['lockKey']];_0x5ec21c[_0x3ea39f(0x93)]({'lockKey':_0x69316[_0x3ea39f(0xa9)],'remoteId':_0x33906d?.[_0x3ea39f(0xa5)]??0x0});}catch(_0x2a59e1){const _0x25b551=remoteVersionChangedConflict(_0x69316,_0x2d519d,_0x2a59e1);if(_0x25b551){_0x2065f3[_0x3ea39f(0x93)](_0x25b551);continue;}_0x3fcc2b['push']({'lockKey':_0x69316[_0x3ea39f(0xa9)],'error':_0x2a59e1 instanceof Error?_0x2a59e1[_0x3ea39f(0xc8)]:String(_0x2a59e1)});}}_0x53d80d['lastSync']=new Date()[_0x3ea39f(0x70)](),await writeBffLockFile(_0x16b532['lockFilePath'],_0xa700bf),await waitForUploadedLockEntries(_0x16b532['lockFilePath'],_0x1309d3[_0x3ea39f(0x8c)],_0x5ec21c[_0x3ea39f(0xd3)](_0x45d214=>_0x45d214[_0x3ea39f(0xa9)]));let _0x141eb9={'attempted':![],'cleared':![]};if(_0x5ec21c[_0x3ea39f(0xc4)]>0x0)try{let _0x2da719='';for(let _0x3b97cc=0x0;_0x3b97cc<CACHE_CLEAR_ATTEMPTS;_0x3b97cc+=0x1){_0x2da719=await clearBffScriptCache(),_0x3b97cc<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x141eb9={'attempted':!![],'cleared':!![],'message':_0x2da719||_0x3ea39f(0xc6)};}catch(_0x2f43b2){_0x141eb9={'attempted':!![],'cleared':![],'error':_0x2f43b2 instanceof Error?_0x2f43b2[_0x3ea39f(0xc8)]:String(_0x2f43b2)};}const _0x36a592=_0x3fcc2b['length']===0x0&&(_0x141eb9[_0x3ea39f(0x86)]?_0x141eb9[_0x3ea39f(0xbf)]:!![]),_0x484a8b=_0x36a592,_0x4f63e2=_0x141eb9['attempted']?_0x141eb9['cleared']?_0x3ea39f(0x81):_0x3ea39f(0x9b):_0x3ea39f(0x72);return{'ok':_0x484a8b,'data':{'uploaded':_0x5ec21c,'skipped':_0x451190,'conflicts':_0x2065f3,'failed':_0x3fcc2b,'cacheClear':_0x141eb9,'warnings':[...[..._0x5b47d0[_0x3ea39f(0xd5)][_0x3ea39f(0xbb)]()][_0x3ea39f(0x71)](_0x1524ab=>_0x1524ab[_0x3ea39f(0xb6)]),...[..._0x5b47d0[_0x3ea39f(0xce)]][_0x3ea39f(0xd3)](existingHookWarning)]},'message':formatPushMessage(_0x5ec21c['length'],_0x451190['length'],_0x2065f3[_0x3ea39f(0xc4)],_0x3fcc2b[_0x3ea39f(0xc4)],_0x4f63e2)};}};function missingRemoteVersionConflict(_0x1718ac,_0x18f2a7){const _0x3d04c1=a38_0x391df8;return remoteVersionConflict(_0x1718ac,_0x18f2a7,_0x3d04c1(0x9f),_0x3d04c1(0xcc));}function remoteVersionChangedConflict(_0x3069b7,_0x14dbca,_0x4c08de){const _0x159fe8=a38_0x391df8;if(!_0x14dbca?.[_0x159fe8(0xa5)]||_0x14dbca[_0x159fe8(0xa8)]==null||!isRemoteVersionConflict(_0x4c08de))return undefined;return remoteVersionConflict(_0x3069b7,_0x14dbca,_0x159fe8(0x88),'Remote\x20script\x20version\x20changed\x20since\x20the\x20last\x20pull.');}function remoteVersionConflict(_0x39b11b,_0x1dbe18,_0x1cf75a,_0x2445a2){const _0x3acdb0=a38_0x391df8;return{'code':_0x1cf75a,'lockKey':_0x39b11b[_0x3acdb0(0xa9)],'filePath':_0x39b11b[_0x3acdb0(0xd6)],'remoteId':_0x1dbe18['remoteId'],..._0x1dbe18[_0x3acdb0(0xa8)]!=null?{'expectedVersion':_0x1dbe18['version']}:{},'message':_0x2445a2,'nextAction':{'action':'review_remote_and_merge','command':CLI_BIN_NAME+'\x20bff\x20detail\x20--id\x20'+_0x1dbe18[_0x3acdb0(0xa5)]+_0x3acdb0(0xc0),'requiresReview':!![],'message':_0x3acdb0(0x7e)}};}function isRemoteVersionConflict(_0x38dd39){const _0x166f56=a38_0x391df8,_0xcfc6c5=_0x38dd39 instanceof Error?_0x38dd39[_0x166f56(0xc8)]:String(_0x38dd39),_0x47faa3=getPlatformErrorCode(_0x38dd39)??'';return[_0xcfc6c5,_0x47faa3]['some'](_0x22df07=>/(?:version|optimistic)[\s_-]*(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)|(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)[\s_-]*(?:version|optimistic)/i[_0x166f56(0xcb)](_0x22df07));}function a38_0x4a08(_0x252b35,_0x3b8e96){_0x252b35=_0x252b35-0x70;const _0x4ef9b1=a38_0x4ef9();let _0x4a0804=_0x4ef9b1[_0x252b35];return _0x4a0804;}function formatPushMessage(_0x252e95,_0x446291,_0x262129,_0x21a451,_0x27ab6d){const _0x512bfd=a38_0x391df8,_0x1c8e52=[_0x512bfd(0xae)+_0x252e95+'\x20uploaded',_0x446291+_0x512bfd(0x74)];_0x262129>0x0&&_0x1c8e52[_0x512bfd(0x93)](_0x262129+_0x512bfd(0xaf)+(_0x262129===0x1?'':'s')+'\x20'+(_0x262129===0x1?_0x512bfd(0x79):_0x512bfd(0xb3))+'\x20resolution');if(_0x21a451>0x0)_0x1c8e52[_0x512bfd(0x93)](_0x21a451+_0x512bfd(0xb4));return _0x1c8e52[_0x512bfd(0x93)](_0x27ab6d),_0x1c8e52[_0x512bfd(0x84)](',\x20');}async function getTargetFunctions(_0x184dde,_0x178244){const _0x32c976=a38_0x391df8,_0x28da77=_0x178244[_0x32c976(0x77)](_0x32c976(0x94)),_0x2bc9e1=_0x178244[_0x32c976(0x77)](_0x32c976(0x92)),_0x528987=normalizeBffType(_0x28da77)??undefined;if(_0x2bc9e1&&!_0x528987)throw CliErrors[_0x32c976(0x7a)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4d1498=await scanLocalBffFunctions(_0x184dde,_0x528987);if(_0x2bc9e1){const _0x343f57=_0x4d1498[_0x32c976(0xc1)](_0x4e97f2=>_0x4e97f2[_0x32c976(0x92)]===_0x2bc9e1);if(_0x343f57[_0x32c976(0xc4)]===0x0)throw CliErrors['validation'](_0x32c976(0xdd)+_0x528987+'/'+_0x2bc9e1);return _0x343f57;}return _0x4d1498;}function existingHookWarning(_0xeb4781){const _0xec1948=a38_0x391df8;return{'code':'EXISTING_HOOK_BINDING_PRESERVED','lockKey':_0xeb4781,'message':_0xec1948(0x8a)};}async function buildHookMaps(_0x263cc3,_0x11663c,_0x532461,_0xa09f01){const _0x28a0e0=a38_0x391df8,_0x40e7af=_0x532461['some'](_0x96aaf=>_0x96aaf[_0x28a0e0(0x94)]===_0x28a0e0(0x98));if(!_0x40e7af)return{'resolutions':new Map(),'failures':new Map(),'existingHooks':new Set()};const _0x10ccfe=loadAliasMap(_0x11663c,undefined,resolveApiFilePath(_0x11663c,_0x263cc3));assertUnambiguousHookAliases(_0x10ccfe);const _0x2329a2=[..._0x10ccfe['map'](_0x1b352e=>[_0x1b352e[_0x28a0e0(0xad)],_0x1b352e[_0x28a0e0(0x87)]]),...trackedHookDirectoryMappings(_0xa09f01)['map'](_0x481ea9=>[_0x481ea9['alias'],_0x481ea9[_0x28a0e0(0x87)]])],_0x3b9ab4=await listDatasets(_0x263cc3);assertUnambiguousHookDirectoryMappings(_0x2329a2['map'](([_0x10b308,_0x13c36b])=>({'alias':_0x10b308,'datasetCode':_0x13c36b})));const _0x6633fc=buildHookDirectoryIndexes(_0x3b9ab4,_0x2329a2),_0x4073dd=new Map(),_0x3aca43=preflightPushHookDirectories(_0x532461,_0xa09f01,_0x6633fc,_0x4073dd),_0x21f7aa=new Set(),_0x23a9e8=_0x532461[_0x28a0e0(0xc1)](_0x275450=>_0x4073dd[_0x28a0e0(0xb9)](_0x275450['lockKey'])?.[_0x28a0e0(0x97)](_0x28a0e0(0xb5))&&_0xa09f01[_0x28a0e0(0xde)][_0x275450['lockKey']]?.[_0x28a0e0(0xa5)]&&_0xa09f01[_0x28a0e0(0xde)][_0x275450[_0x28a0e0(0xa9)]]?.[_0x28a0e0(0x87)]);if(_0x23a9e8[_0x28a0e0(0xc4)]>0x0){let _0x2937c1;try{_0x2937c1=await getBffScriptStatistics(_0x263cc3);}catch(_0x634a95){for(const _0x571e00 of _0x23a9e8)_0x4073dd[_0x28a0e0(0xcd)](_0x571e00[_0x28a0e0(0xa9)],_0x28a0e0(0xd4)+(_0x634a95 instanceof Error?_0x634a95[_0x28a0e0(0xc8)]:String(_0x634a95)));return{'resolutions':_0x3aca43,'failures':_0x4073dd,'existingHooks':_0x21f7aa};}for(const _0x3807ff of _0x23a9e8){const _0x8b0854=_0xa09f01['functions'][_0x3807ff[_0x28a0e0(0xa9)]];try{const _0x1fcaa4=new Set(_0x532461['filter'](_0x2ae0b6=>_0x2ae0b6[_0x28a0e0(0x94)]==='HOOK'&&_0xa09f01[_0x28a0e0(0xde)][_0x2ae0b6[_0x28a0e0(0xa9)]]?.['datasetCode']===_0x8b0854[_0x28a0e0(0x87)])[_0x28a0e0(0xd3)](_0x48f940=>_0x48f940[_0x28a0e0(0xad)]));if(_0x1fcaa4[_0x28a0e0(0x90)]>0x1)throw CliErrors[_0x28a0e0(0x7a)](_0x28a0e0(0x99));const _0x3a6da9=_0x2937c1[_0x28a0e0(0x71)](_0x45d75d=>[{'datasetCode':_0x45d75d[_0x28a0e0(0x87)],'operationType':snakeToCamel(_0x45d75d[_0x28a0e0(0x80)]),'functionNode':_0x28a0e0(0x8e),'id':_0x45d75d[_0x28a0e0(0xa3)]},{'datasetCode':_0x45d75d[_0x28a0e0(0x87)],'operationType':snakeToCamel(_0x45d75d['operationType']),'functionNode':'after','id':_0x45d75d[_0x28a0e0(0x7f)]}])[_0x28a0e0(0xc1)](_0x47651c=>_0x47651c['id']===_0x8b0854[_0x28a0e0(0xa5)]),_0x57e1e3=await getBffScriptInfo(_0x8b0854[_0x28a0e0(0xa5)]);if(_0x57e1e3['id']!==_0x8b0854['remoteId']||_0x57e1e3[_0x28a0e0(0x8c)]!==_0x263cc3||_0x57e1e3[_0x28a0e0(0xb7)]!==_0x28a0e0(0x98)||_0x57e1e3[_0x28a0e0(0xdc)]!==_0x3807ff[_0x28a0e0(0x92)]||_0x8b0854['version']==null||_0x57e1e3['version']!==_0x8b0854['version']||_0x3a6da9[_0x28a0e0(0xc4)]!==0x1||_0x3a6da9[0x0][_0x28a0e0(0x87)]!==_0x8b0854[_0x28a0e0(0x87)]||_0x3a6da9[0x0][_0x28a0e0(0x80)]!==_0x3807ff[_0x28a0e0(0x80)]||_0x3a6da9[0x0][_0x28a0e0(0x89)]!==_0x3807ff[_0x28a0e0(0x89)]||_0x8b0854['operationType']!==_0x3807ff[_0x28a0e0(0x80)]||_0x8b0854[_0x28a0e0(0x89)]!==_0x3807ff[_0x28a0e0(0x89)])throw CliErrors[_0x28a0e0(0x7a)]('Existing\x20HOOK\x20identity,\x20version\x20or\x20binding\x20does\x20not\x20match\x20the\x20local\x20lock.\x20Pull\x20and\x20review\x20before\x20pushing.');_0x21f7aa['add'](_0x3807ff[_0x28a0e0(0xa9)]),_0x4073dd[_0x28a0e0(0x8b)](_0x3807ff[_0x28a0e0(0xa9)]);}catch(_0x797f15){_0x4073dd[_0x28a0e0(0xcd)](_0x3807ff[_0x28a0e0(0xa9)],_0x797f15 instanceof Error?_0x797f15[_0x28a0e0(0xc8)]:String(_0x797f15));}}}return{'resolutions':_0x3aca43,'failures':_0x4073dd,'existingHooks':_0x21f7aa};}async function uploadSingleFunction(_0x147fc3,_0x3e6536,_0x157722,_0x2497c9){const _0x2c1f6a=a38_0x391df8,_0x43f884=await readFile(_0x3e6536[_0x2c1f6a(0xd6)],_0x2c1f6a(0xaa)),_0x2720f9=await computeFileHash(_0x3e6536[_0x2c1f6a(0xd6)]),_0x43ecf4=_0x157722[_0x2c1f6a(0xde)][_0x3e6536[_0x2c1f6a(0xa9)]];if(_0x43ecf4?.['remoteId']&&_0x43ecf4[_0x2c1f6a(0xa8)]==null)throw CliErrors[_0x2c1f6a(0x7a)](_0x3e6536[_0x2c1f6a(0xa9)]+_0x2c1f6a(0x7b));let _0x3e02e9=extractScriptDescription(_0x43f884);if(!_0x3e02e9&&_0x43ecf4?.[_0x2c1f6a(0xa5)]){const _0x5aa462=await getBffScriptInfo(_0x43ecf4[_0x2c1f6a(0xa5)]);_0x3e02e9=_0x5aa462[_0x2c1f6a(0xc3)]||undefined;}const _0x28f942={'appCode':_0x147fc3,'functionName':_0x3e6536[_0x2c1f6a(0x92)],'scriptType':_0x3e6536[_0x2c1f6a(0x94)],'scriptContent':_0x43f884};if(_0x43ecf4?.[_0x2c1f6a(0xa5)])_0x28f942['id']=_0x43ecf4[_0x2c1f6a(0xa5)];if(_0x43ecf4?.[_0x2c1f6a(0xa8)]!=null)_0x28f942['version']=_0x43ecf4[_0x2c1f6a(0xa8)];if(_0x3e02e9)_0x28f942[_0x2c1f6a(0xc3)]=_0x3e02e9;if(_0x3e6536['type']===_0x2c1f6a(0x98)){const _0x4b2e02=_0x2497c9[_0x2c1f6a(0xd5)][_0x2c1f6a(0xb9)](_0x3e6536[_0x2c1f6a(0xa9)]);if(!_0x4b2e02&&!_0x2497c9['existingHooks'][_0x2c1f6a(0x85)](_0x3e6536['lockKey'])||!_0x3e6536[_0x2c1f6a(0x80)]||!_0x3e6536[_0x2c1f6a(0x89)])throw CliErrors[_0x2c1f6a(0x7a)]('Incomplete\x20HOOK\x20path:\x20'+_0x3e6536[_0x2c1f6a(0xa9)]);_0x4b2e02&&(_0x28f942[_0x2c1f6a(0xbd)]=_0x4b2e02[_0x2c1f6a(0xac)]['id'],_0x28f942[_0x2c1f6a(0x80)]=_0x3e6536['operationType']),_0x28f942['functionNode']=_0x3e6536[_0x2c1f6a(0x89)];}const _0x52c682=await saveBffScript(_0x28f942),_0x5a964a=_0x52c682['id'],_0x37e130=_0x52c682[_0x2c1f6a(0x76)]??await getBffScriptInfo(_0x5a964a),_0x5aa78f={'hash':_0x2720f9,'remoteId':_0x5a964a,'version':_0x37e130['version']};if(_0x3e6536['type']===_0x2c1f6a(0x98)){const _0x1c992a=_0x2497c9['resolutions'][_0x2c1f6a(0xb9)](_0x3e6536['lockKey']);if(!_0x1c992a){_0x157722[_0x2c1f6a(0xde)][_0x3e6536['lockKey']]={..._0x43ecf4,..._0x5aa78f};return;}_0x5aa78f[_0x2c1f6a(0xad)]=_0x1c992a[_0x2c1f6a(0xad)]??_0x43ecf4?.['alias'],_0x5aa78f[_0x2c1f6a(0x87)]=_0x1c992a['datasetCode'],_0x5aa78f[_0x2c1f6a(0x80)]=_0x3e6536[_0x2c1f6a(0x80)],_0x5aa78f['functionNode']=_0x3e6536[_0x2c1f6a(0x89)];}_0x157722[_0x2c1f6a(0xde)][_0x3e6536[_0x2c1f6a(0xa9)]]=_0x5aa78f;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3c3ec6,_0x57dd67,_0x4f1bca){const _0x509ff4=a38_0x391df8;if(_0x4f1bca[_0x509ff4(0xc4)]===0x0)return;for(let _0x321dfe=0x0;_0x321dfe<LOCK_SETTLE_RETRY_COUNT;_0x321dfe+=0x1){const _0x4c66b8=await readBffLockFile(_0x3c3ec6),_0x2a55c5=_0x4c66b8?.[_0x509ff4(0x82)]?.[_0x57dd67]?.['functions']??{},_0x3d45ea=_0x4f1bca[_0x509ff4(0x9c)](_0x2051b3=>!!_0x2a55c5[_0x2051b3]?.[_0x509ff4(0xa5)]);if(_0x3d45ea)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x4f1bca[_0x509ff4(0x84)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x216da6=a39_0x5096;(function(_0x1b8e85,_0x35c72c){const _0x23c0ea=a39_0x5096,_0x14bd2f=_0x1b8e85();while(!![]){try{const _0x2e9e0f=-parseInt(_0x23c0ea(0xae))/0x1+parseInt(_0x23c0ea(0xc1))/0x2*(-parseInt(_0x23c0ea(0xb8))/0x3)+parseInt(_0x23c0ea(0xad))/0x4+-parseInt(_0x23c0ea(0xb0))/0x5*(parseInt(_0x23c0ea(0xa6))/0x6)+-parseInt(_0x23c0ea(0xbe))/0x7*(-parseInt(_0x23c0ea(0xc0))/0x8)+parseInt(_0x23c0ea(0xb4))/0x9*(parseInt(_0x23c0ea(0xb7))/0xa)+-parseInt(_0x23c0ea(0xc2))/0xb*(-parseInt(_0x23c0ea(0xb6))/0xc);if(_0x2e9e0f===_0x35c72c)break;else _0x14bd2f['push'](_0x14bd2f['shift']());}catch(_0x2427b6){_0x14bd2f['push'](_0x14bd2f['shift']());}}}(a39_0x4c5d,0xdce47));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';function a39_0x5096(_0x2f5df8,_0x4dc258){_0x2f5df8=_0x2f5df8-0xa6;const _0x4c5d58=a39_0x4c5d();let _0x509627=_0x4c5d58[_0x2f5df8];return _0x509627;}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':'bff','command':a39_0x216da6(0xb9),'description':a39_0x216da6(0xbd),'risk':'read','flags':[{'name':'remote','type':'boolean','description':a39_0x216da6(0xa8)}],async 'execute'(_0x52faf0){const _0x438496=a39_0x216da6,_0x3e3fc8=loadBffProjectConfig(_0x52faf0['appCode']),_0x27b6c2=await readBffLockFile(_0x3e3fc8['lockFilePath']),{appLock:_0x16ebd3}=ensureLockScope(_0x27b6c2??createEmptyBffLock(),_0x52faf0[_0x438496(0xbf)],_0x3e3fc8[_0x438496(0xab)],_0x438496(0xb9)),_0x2d0e6b=await scanLocalBffFunctions(_0x3e3fc8),_0xa3109=[],_0x54e05b=[],_0x683076=[];for(const _0x4676bd of _0x2d0e6b){const _0x2dd086=await computeFileHash(_0x4676bd[_0x438496(0xb1)]),_0xe12950=_0x16ebd3['functions'][_0x4676bd['lockKey']];if(!_0xe12950)_0xa3109['push'](_0x4676bd[_0x438496(0xaf)]);else _0xe12950['hash']!==_0x2dd086?_0x54e05b[_0x438496(0xa7)](_0x4676bd[_0x438496(0xaf)]):_0x683076['push'](_0x4676bd['lockKey']);}const _0x2272d4=[];if(_0x52faf0['bool']('remote')){const _0x112c84=loadAliasMap(_0x52faf0[_0x438496(0xba)],undefined,resolveApiFilePath(_0x52faf0[_0x438496(0xba)],_0x52faf0[_0x438496(0xbf)])),_0x49f374=new Map(_0x112c84['map'](_0x496d3a=>[_0x496d3a[_0x438496(0xbc)],_0x496d3a[_0x438496(0xbb)]])),[_0x9c1468,_0x2714ca]=await Promise[_0x438496(0xac)]([listBffScripts(_0x52faf0[_0x438496(0xbf)]),getBffScriptStatistics(_0x52faf0[_0x438496(0xbf)])]),_0x208d35=createHookLocationMap(_0x2714ca),_0x504bf9=new Set(_0x2d0e6b['map'](_0x1ed965=>_0x1ed965[_0x438496(0xaf)]));for(const _0x52fe16 of _0x9c1468){const _0x2e0e85=resolveRemoteScriptTarget(_0x3e3fc8,_0x52fe16,_0x208d35,_0x16ebd3['functions'],_0x49f374);_0x2e0e85&&!_0x504bf9[_0x438496(0xaa)](_0x2e0e85['lockKey'])&&_0x2272d4[_0x438496(0xa7)](_0x2e0e85[_0x438496(0xaf)]);}}const _0x2dc4f6=_0xa3109[_0x438496(0xa9)]===0x0&&_0x54e05b[_0x438496(0xa9)]===0x0&&_0x2272d4[_0x438496(0xa9)]===0x0;return{'ok':!![],'data':{'added':_0xa3109,'modified':_0x54e05b,'unchanged':_0x683076,'remoteOnly':_0x2272d4},'message':_0x2dc4f6?_0x438496(0xb5):_0xa3109['length']+_0x438496(0xb2)+_0x54e05b[_0x438496(0xa9)]+'\x20modified,\x20'+_0x683076['length']+'\x20unchanged'+(_0x2272d4['length']>0x0?',\x20'+_0x2272d4[_0x438496(0xa9)]+_0x438496(0xb3):'')};}};function a39_0x4c5d(){const _0x517691=['6337644QplhnO','19182aHZRwQ','lockKey','375385QGQOaP','filePath','\x20added,\x20','\x20remote-only','16299AkCxdY','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','349344lgmmxh','1910lrWJHW','4541559sXpcnH','status','apiDir','alias','datasetCode','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','34041zKAMhE','appCode','56XdNqCz','2XEfdyg','264RLtpvc','18EmDyra','push','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','length','has','scriptsRoot','all'];a39_0x4c5d=function(){return _0x517691;};return a39_0x4c5d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0xacb3dd=a40_0x252c;function a40_0x2a23(){const _0x95b42f=['191201KEJhuL','4462645hMVKsq','cli-skill-install','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','\x20is\x20already\x20current','inherit','apiError',']:\x20','info','\x20installed','read','3jdDSZm','nonInteractive','1852398kWbwMo','\x20at\x20','175340WMFopE','skillVersion','4559232JOOTvW','Built-in\x20Skill\x20install\x20failed\x20[','CLI\x20Built-in\x20Skill\x20','576nhgAtR','\x20via\x20skills@latest','2366154ISKPNa','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','193779EVPGJu','pipe','installedPath','code','changed'];a40_0x2a23=function(){return _0x95b42f;};return a40_0x2a23();}(function(_0x412e39,_0x25c955){const _0x36d4fe=a40_0x252c,_0x39bf87=_0x412e39();while(!![]){try{const _0x3713e3=parseInt(_0x36d4fe(0x142))/0x1+parseInt(_0x36d4fe(0x132))/0x2+-parseInt(_0x36d4fe(0x130))/0x3*(-parseInt(_0x36d4fe(0x134))/0x4)+-parseInt(_0x36d4fe(0x143))/0x5+-parseInt(_0x36d4fe(0x136))/0x6+-parseInt(_0x36d4fe(0x13b))/0x7+-parseInt(_0x36d4fe(0x139))/0x8*(-parseInt(_0x36d4fe(0x13d))/0x9);if(_0x3713e3===_0x25c955)break;else _0x39bf87['push'](_0x39bf87['shift']());}catch(_0x5b25aa){_0x39bf87['push'](_0x39bf87['shift']());}}}(a40_0x2a23,0xb0094));function a40_0x252c(_0x7b80c7,_0x5601bf){_0x7b80c7=_0x7b80c7-0x12e;const _0x2a236a=a40_0x2a23();let _0x252cd2=_0x2a236a[_0x7b80c7];return _0x252cd2;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':a40_0xacb3dd(0x145),'risk':a40_0xacb3dd(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3c1af0){const _0x5dfe05=a40_0xacb3dd;logger['setLogPath'](process['cwd']()),logger[_0x5dfe05(0x14a)](_0x5dfe05(0x144),_0x5dfe05(0x13c));const _0x44f421=installBuiltinSkill({'stdio':_0x3c1af0[_0x5dfe05(0x131)]?_0x5dfe05(0x13e):_0x5dfe05(0x147)});if(!_0x44f421['ok'])throw CliErrors[_0x5dfe05(0x148)](_0x5dfe05(0x137)+_0x44f421[_0x5dfe05(0x140)]+_0x5dfe05(0x149)+(_0x44f421['error']||'unknown'),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x44f421['repairCommand']);return console['log'](_0x44f421[_0x5dfe05(0x141)]?'CLI\x20Built-in\x20Skill\x20'+_0x44f421[_0x5dfe05(0x135)]+_0x5dfe05(0x12e)+(_0x44f421['installedPath']?_0x5dfe05(0x133)+_0x44f421[_0x5dfe05(0x13f)]:_0x5dfe05(0x13a)):_0x5dfe05(0x138)+_0x44f421['skillVersion']+_0x5dfe05(0x146)+(_0x44f421[_0x5dfe05(0x13f)]?'\x20at\x20'+_0x44f421[_0x5dfe05(0x13f)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x327f92=a40_0x35b5;(function(_0x7f6513,_0x515a06){const _0x4e3a19=a40_0x35b5,_0x54ddc2=_0x7f6513();while(!![]){try{const _0x1b3ccb=-parseInt(_0x4e3a19(0x148))/0x1*(-parseInt(_0x4e3a19(0x10e))/0x2)+parseInt(_0x4e3a19(0x143))/0x3*(-parseInt(_0x4e3a19(0x10f))/0x4)+-parseInt(_0x4e3a19(0x14e))/0x5+-parseInt(_0x4e3a19(0x140))/0x6+parseInt(_0x4e3a19(0x136))/0x7+parseInt(_0x4e3a19(0x113))/0x8+-parseInt(_0x4e3a19(0x15d))/0x9;if(_0x1b3ccb===_0x515a06)break;else _0x54ddc2['push'](_0x54ddc2['shift']());}catch(_0x338f85){_0x54ddc2['push'](_0x54ddc2['shift']());}}}(a40_0x2724,0x86926));import a40_0xbd8660 from'chalk';import a40_0x12f130 from'ora';import a40_0x3a0dab from'semver';function a40_0x2724(){const _0x4faed6=['apiError','Install\x20a\x20specific\x20CLI\x20version','bun','Beta\x20version:\x20','beta','Already\x20on\x20requested\x20version\x20(v','@latest','update','message','npm','Run:\x20',']:\x20','gray','state','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','map','version','validation','boolean','Current\x20version:\x20','yellow','...',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','red','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','Version\x20comparison\x20failed','\x20install\x20-g\x20',',\x20state\x20','\x20is\x20up\x20to\x20date.','run','trim','string','5415039zRveuH','install','Updated\x20to\x20v','Invalid\x20version:\x20','/dist-tags','current','Updating\x20via\x20','Current\x20version\x20v','https://registry.npmjs.org/-/package/','code','4661058FFYTkb','Already\x20up\x20to\x20date\x20(v','succeed','21UwtuRf','latest','fromEntries','expected\x20','length','16MZcpwt','\x20→\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20\x20CLI\x20Built-in\x20Skill\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','timeout','4422210sgYpDs','entries','log','str',',\x20found\x20','json','green','CLI\x20updated\x20to\x20v',',\x20then\x20verify\x20with:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','valid','info','\x20doctor','skillVersion','unknown','1666116oVgDki','start','toLowerCase','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','source','object','error','bool','fail','124144OFKblF','169408xxWhCl','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','filter','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','7418800lQfOvX','pipe'];a40_0x2724=function(){return _0x4faed6;};return a40_0x2724();}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 _0x75cf93=a40_0x35b5;return GIT_COMMIT!==_0x75cf93(0x15c)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x368281=a40_0x35b5,_0x18ff8e=process['execPath'][_0x368281(0x15f)]();if(_0x18ff8e['includes']('bun'))return _0x368281(0x117);return _0x368281(0x11e);}const updateFlags=[{'name':a40_0x327f92(0x119),'type':a40_0x327f92(0x127),'description':a40_0x327f92(0x14a),'default':![]},{'name':'version','type':a40_0x327f92(0x135),'description':a40_0x327f92(0x116)}];function getRequestedVersion(_0x4a6e4a){const _0x402a6d=a40_0x327f92;return _0x4a6e4a[_0x402a6d(0x151)]('version')[_0x402a6d(0x134)]();}async function validateUpdateFlags(_0x112d76){const _0x542e87=a40_0x327f92,_0x1c1bb9=_0x112d76[_0x542e87(0x10c)]('beta'),_0x2a947f=getRequestedVersion(_0x112d76);if(_0x1c1bb9&&_0x2a947f)throw CliErrors[_0x542e87(0x126)](_0x542e87(0x107),_0x542e87(0x112));if(_0x2a947f&&!a40_0x3a0dab[_0x542e87(0x158)](_0x2a947f))throw CliErrors[_0x542e87(0x126)](_0x542e87(0x139)+_0x2a947f,_0x542e87(0x14c));}async function fetchNpmDistTags(){const _0x4ac8cd=a40_0x327f92;try{const _0x3e9255=await fetch(_0x4ac8cd(0x13e)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x4ac8cd(0x13a),{'signal':AbortSignal[_0x4ac8cd(0x14d)](0x2710)});if(!_0x3e9255['ok'])return null;const _0x22930e=await _0x3e9255[_0x4ac8cd(0x153)]();if(!_0x22930e||typeof _0x22930e!==_0x4ac8cd(0x10a))return null;return Object[_0x4ac8cd(0x145)](Object[_0x4ac8cd(0x14f)](_0x22930e)[_0x4ac8cd(0x111)](([,_0x18cb3b])=>typeof _0x18cb3b===_0x4ac8cd(0x135)&&_0x18cb3b[_0x4ac8cd(0x134)]()[_0x4ac8cd(0x147)]>0x0)[_0x4ac8cd(0x124)](([_0x146f29,_0x54e98d])=>[_0x146f29,String(_0x54e98d)[_0x4ac8cd(0x134)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x54d531){const _0x15c610=await fetchNpmDistTags();return _0x15c610?.[_0x54d531]??null;}async function fetchLatestVersion(){const _0xcc95ef=a40_0x327f92;return fetchNpmDistTagVersion(_0xcc95ef(0x144));}async function resolveTargetVersion(_0x57a3ce){const _0x323661=a40_0x327f92,_0x4d8beb=getRequestedVersion(_0x57a3ce);if(_0x4d8beb)return{'version':_0x4d8beb,'source':'version'};if(_0x57a3ce[_0x323661(0x10c)](_0x323661(0x119))){const _0x43d133=await fetchNpmDistTagVersion(_0x323661(0x119));if(!_0x43d133)return null;return{'version':_0x43d133,'source':'beta'};}const _0x24f7d2=await fetchLatestVersion();if(!_0x24f7d2)return null;return{'version':_0x24f7d2,'source':'latest'};}function shouldInstallTarget(_0x3c5db7,_0x1dac58){const _0x53fb9b=a40_0x327f92;if(_0x1dac58[_0x53fb9b(0x109)]===_0x53fb9b(0x125)||_0x1dac58[_0x53fb9b(0x109)]==='beta')return!a40_0x3a0dab['eq'](_0x3c5db7,_0x1dac58[_0x53fb9b(0x125)]);return a40_0x3a0dab['lt'](_0x3c5db7,_0x1dac58['version']);}function a40_0x35b5(_0x16772b,_0x343373){_0x16772b=_0x16772b-0x107;const _0x2724f4=a40_0x2724();let _0x35b5d8=_0x2724f4[_0x16772b];return _0x35b5d8;}function getInstallPlanLabel(_0x5a4fc7,_0x3e34d9){const _0x453d5e=a40_0x327f92;switch(_0x3e34d9[_0x453d5e(0x109)]){case _0x453d5e(0x119):return _0x453d5e(0x118)+a40_0xbd8660[_0x453d5e(0x129)](_0x5a4fc7)+_0x453d5e(0x149)+a40_0xbd8660[_0x453d5e(0x154)](_0x3e34d9[_0x453d5e(0x125)]);case _0x453d5e(0x125):return'Requested\x20version:\x20'+a40_0xbd8660[_0x453d5e(0x129)](_0x5a4fc7)+'\x20→\x20'+a40_0xbd8660['green'](_0x3e34d9[_0x453d5e(0x125)]);case _0x453d5e(0x144):default:return'Update\x20available:\x20'+a40_0xbd8660[_0x453d5e(0x129)](_0x5a4fc7)+_0x453d5e(0x149)+a40_0xbd8660[_0x453d5e(0x154)](_0x3e34d9['version']);}}function repairCurrentBuiltinSkill(){const _0x501a89=a40_0x327f92;console[_0x501a89(0x150)](a40_0xbd8660[_0x501a89(0x121)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x5e871f=installBuiltinSkill();if(_0x5e871f['ok']){console[_0x501a89(0x150)](a40_0xbd8660[_0x501a89(0x121)](_0x501a89(0x14b)+_0x5e871f[_0x501a89(0x15b)]+_0x501a89(0x132)));return;}throw CliErrors[_0x501a89(0x115)](_0x501a89(0x12e)+_0x5e871f[_0x501a89(0x13f)]+_0x501a89(0x120)+(_0x5e871f['error']||_0x501a89(0x15c)),'Run:\x20'+_0x5e871f['repairCommand']+_0x501a89(0x156)+CLI_BIN_NAME+'\x20doctor');}function verifyUpdatedBuiltinSkill(_0x26d0b2){const _0x2a5c8d=a40_0x327f92,_0x2325b8=inspectInstalledBuiltinSkillVersion(_0x26d0b2);if(_0x2325b8[_0x2a5c8d(0x122)]===_0x2a5c8d(0x13b)){console[_0x2a5c8d(0x150)](a40_0xbd8660[_0x2a5c8d(0x121)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x26d0b2+_0x2a5c8d(0x132)));return;}const _0x2f6747=_0x2325b8[_0x2a5c8d(0x15b)]?_0x2a5c8d(0x146)+_0x26d0b2+_0x2a5c8d(0x152)+_0x2325b8['skillVersion']:_0x2a5c8d(0x146)+_0x26d0b2+_0x2a5c8d(0x131)+_0x2325b8[_0x2a5c8d(0x122)];throw CliErrors[_0x2a5c8d(0x115)](_0x2a5c8d(0x155)+_0x26d0b2+_0x2a5c8d(0x12b)+_0x2f6747,_0x2a5c8d(0x11f)+_0x2325b8['repairCommand']+_0x2a5c8d(0x156)+CLI_BIN_NAME+_0x2a5c8d(0x15a));}async function execute(_0x32a3e3){const _0x3da52d=a40_0x327f92;await validateUpdateFlags(_0x32a3e3);const _0x10487e=getCurrentVersion();console[_0x3da52d(0x150)](_0x3da52d(0x128)+_0x10487e);const _0x257bfc=a40_0x12f130('Checking\x20for\x20updates...')[_0x3da52d(0x15e)](),_0x9593=await resolveTargetVersion(_0x32a3e3);if(!_0x9593){const _0x453d96=_0x32a3e3['bool'](_0x3da52d(0x119))?_0x3da52d(0x110):_0x3da52d(0x123);return _0x257bfc[_0x3da52d(0x10d)](_0x453d96),console['log'](a40_0xbd8660[_0x3da52d(0x121)](_0x3da52d(0x108)+NPM_PACKAGE_NAME+_0x3da52d(0x11b))),{'ok':![],'message':_0x453d96};}const _0x153eb4=a40_0x3a0dab[_0x3da52d(0x158)](VERSION),_0x484bb0=a40_0x3a0dab[_0x3da52d(0x158)](_0x9593['version']);if(!_0x153eb4||!_0x484bb0)return _0x257bfc[_0x3da52d(0x10d)](_0x3da52d(0x12f)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x153eb4,_0x9593)){const _0x5a6849=_0x9593[_0x3da52d(0x109)]===_0x3da52d(0x125)?_0x3da52d(0x11a)+_0x9593['version']+')':a40_0x3a0dab['gt'](_0x153eb4,_0x484bb0)?_0x3da52d(0x13d)+_0x10487e+_0x3da52d(0x157)+_0x9593[_0x3da52d(0x125)]:_0x3da52d(0x141)+_0x9593[_0x3da52d(0x125)]+')';return _0x257bfc[_0x3da52d(0x142)](_0x5a6849),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x257bfc[_0x3da52d(0x159)](getInstallPlanLabel(_0x10487e,_0x9593));const _0x486e3d=detectPackageManager(),_0x9f35fa=_0x486e3d===_0x3da52d(0x11e)?resolveNpmBin(_0x3da52d(0x11e)):_0x486e3d,_0x2b8897=a40_0x12f130(_0x3da52d(0x13c)+_0x486e3d+_0x3da52d(0x12a))[_0x3da52d(0x15e)]();try{await execa(_0x9f35fa,[_0x3da52d(0x137),'-g',NPM_PACKAGE_NAME+'@'+_0x9593[_0x3da52d(0x125)]],{'stdio':_0x3da52d(0x114)}),_0x2b8897[_0x3da52d(0x142)](_0x3da52d(0x138)+_0x9593[_0x3da52d(0x125)]),console[_0x3da52d(0x150)](a40_0xbd8660[_0x3da52d(0x121)](_0x3da52d(0x12d)));}catch(_0x12936b){return _0x2b8897[_0x3da52d(0x10d)]('Update\x20failed'),console[_0x3da52d(0x10b)](a40_0xbd8660[_0x3da52d(0x12c)]('\x20\x20'+_0x12936b[_0x3da52d(0x11d)])),console[_0x3da52d(0x150)](a40_0xbd8660[_0x3da52d(0x121)]('\x20\x20Try\x20manually:\x20'+_0x486e3d+_0x3da52d(0x130)+NPM_PACKAGE_NAME+'@'+_0x9593[_0x3da52d(0x125)])),{'ok':![],'message':_0x12936b[_0x3da52d(0x11d)]};}return verifyUpdatedBuiltinSkill(_0x9593[_0x3da52d(0x125)]),{'ok':!![]};}export const updateDefinition={'service':a40_0x327f92(0x11c),'command':a40_0x327f92(0x133),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a41_0x13f6a6=a41_0x595f;function a41_0x595f(_0x5beb32,_0xd843b7){_0x5beb32=_0x5beb32-0x64;const _0x11147c=a41_0x1114();let _0x595fe9=_0x11147c[_0x5beb32];return _0x595fe9;}(function(_0x4ffcce,_0x4bd1fe){const _0x5b1c73=a41_0x595f,_0x533cd4=_0x4ffcce();while(!![]){try{const _0x2d78b3=-parseInt(_0x5b1c73(0x65))/0x1*(-parseInt(_0x5b1c73(0x90))/0x2)+-parseInt(_0x5b1c73(0x7c))/0x3+-parseInt(_0x5b1c73(0xb3))/0x4+parseInt(_0x5b1c73(0x88))/0x5+parseInt(_0x5b1c73(0x8c))/0x6+-parseInt(_0x5b1c73(0x68))/0x7+-parseInt(_0x5b1c73(0x6d))/0x8*(-parseInt(_0x5b1c73(0x6a))/0x9);if(_0x2d78b3===_0x4bd1fe)break;else _0x533cd4['push'](_0x533cd4['shift']());}catch(_0x461923){_0x533cd4['push'](_0x533cd4['shift']());}}}(a41_0x1114,0xb8f15));import a41_0x38cd94 from'chalk';import a41_0x501352 from'ora';function a41_0x1114(){const _0xe6603a=['yellow','bool','1GXRtMQ','beta','bun','4372830PqURtS','code','9pJQkIG',',\x20then\x20verify\x20with:\x20','Invalid\x20version:\x20','12112312lbyjYV','slice','install','apiError','start','length','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20install\x20-g\x20','Install\x20a\x20specific\x20CLI\x20version','log','\x20doctor','...','Updated\x20to\x20v','validation','3331428HjxSWW','toLowerCase','\x20\x20CLI\x20Built-in\x20Skill\x20','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','execPath','\x20\x20Try\x20manually:\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','update','str','message','current','boolean','237675UYPBDk','object','Already\x20on\x20requested\x20version\x20(v','green','8253360SqRkHX','Current\x20version:\x20','info','Current\x20version\x20v','904746DaDDjG','trim','fail','valid',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','repairCommand','succeed','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','unknown','latest','Run:\x20','timeout','json','Checking\x20CLI\x20Built-in\x20Skill...','skillVersion','Update\x20failed','red','fromEntries','Update\x20available:\x20','version','CLI\x20updated\x20to\x20v','Beta\x20version:\x20','npm','\x20→\x20','map','error','gray','pipe','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20is\x20up\x20to\x20date.','state','source','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','expected\x20','Checking\x20for\x20updates...','3587264QdWiXb','Version\x20comparison\x20failed'];a41_0x1114=function(){return _0xe6603a;};return a41_0x1114();}import a41_0x382b3c 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 _0x4279f9=a41_0x595f;return GIT_COMMIT!==_0x4279f9(0x98)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4279f9(0x6e)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3a1ce0=a41_0x595f,_0x1d772a=process[_0x3a1ce0(0x80)][_0x3a1ce0(0x7d)]();if(_0x1d772a['includes'](_0x3a1ce0(0x67)))return _0x3a1ce0(0x67);return _0x3a1ce0(0xa6);}const updateFlags=[{'name':'beta','type':a41_0x13f6a6(0x87),'description':a41_0x13f6a6(0x74),'default':![]},{'name':a41_0x13f6a6(0xa3),'type':'string','description':a41_0x13f6a6(0x76)}];function getRequestedVersion(_0x5c27c1){const _0x374f84=a41_0x13f6a6;return _0x5c27c1[_0x374f84(0x84)](_0x374f84(0xa3))[_0x374f84(0x91)]();}async function validateUpdateFlags(_0x4a21ad){const _0x2fa454=a41_0x13f6a6,_0x129a70=_0x4a21ad[_0x2fa454(0x64)]('beta'),_0x4dcd75=getRequestedVersion(_0x4a21ad);if(_0x129a70&&_0x4dcd75)throw CliErrors[_0x2fa454(0x7b)](_0x2fa454(0x7f),_0x2fa454(0x73));if(_0x4dcd75&&!a41_0x382b3c[_0x2fa454(0x93)](_0x4dcd75))throw CliErrors[_0x2fa454(0x7b)](_0x2fa454(0x6c)+_0x4dcd75,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x58de07=a41_0x13f6a6;try{const _0x3e59cf=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x58de07(0x9b)](0x2710)});if(!_0x3e59cf['ok'])return null;const _0x3811b2=await _0x3e59cf[_0x58de07(0x9c)]();if(!_0x3811b2||typeof _0x3811b2!==_0x58de07(0x89))return null;return Object[_0x58de07(0xa1)](Object['entries'](_0x3811b2)['filter'](([,_0x457855])=>typeof _0x457855==='string'&&_0x457855[_0x58de07(0x91)]()[_0x58de07(0x72)]>0x0)[_0x58de07(0xa8)](([_0x5f514c,_0xec8c82])=>[_0x5f514c,String(_0xec8c82)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x35e0dc){const _0x6374f=await fetchNpmDistTags();return _0x6374f?.[_0x35e0dc]??null;}async function fetchLatestVersion(){const _0x21d936=a41_0x13f6a6;return fetchNpmDistTagVersion(_0x21d936(0x99));}async function resolveTargetVersion(_0x2a7385){const _0x105108=a41_0x13f6a6,_0x3585ca=getRequestedVersion(_0x2a7385);if(_0x3585ca)return{'version':_0x3585ca,'source':_0x105108(0xa3)};if(_0x2a7385['bool']('beta')){const _0xd7417b=await fetchNpmDistTagVersion('beta');if(!_0xd7417b)return null;return{'version':_0xd7417b,'source':'beta'};}const _0x3b1369=await fetchLatestVersion();if(!_0x3b1369)return null;return{'version':_0x3b1369,'source':_0x105108(0x99)};}function shouldInstallTarget(_0x3a3868,_0x5e4e7c){const _0x4e6605=a41_0x13f6a6;if(_0x5e4e7c[_0x4e6605(0xaf)]==='version'||_0x5e4e7c[_0x4e6605(0xaf)]===_0x4e6605(0x66))return!a41_0x382b3c['eq'](_0x3a3868,_0x5e4e7c['version']);return a41_0x382b3c['lt'](_0x3a3868,_0x5e4e7c[_0x4e6605(0xa3)]);}function getInstallPlanLabel(_0x3cf037,_0x20c343){const _0x36d350=a41_0x13f6a6;switch(_0x20c343[_0x36d350(0xaf)]){case _0x36d350(0x66):return _0x36d350(0xa5)+a41_0x38cd94[_0x36d350(0xb5)](_0x3cf037)+'\x20→\x20'+a41_0x38cd94['green'](_0x20c343['version']);case'version':return'Requested\x20version:\x20'+a41_0x38cd94[_0x36d350(0xb5)](_0x3cf037)+_0x36d350(0xa7)+a41_0x38cd94[_0x36d350(0x8b)](_0x20c343[_0x36d350(0xa3)]);case _0x36d350(0x99):default:return _0x36d350(0xa2)+a41_0x38cd94[_0x36d350(0xb5)](_0x3cf037)+_0x36d350(0xa7)+a41_0x38cd94[_0x36d350(0x8b)](_0x20c343[_0x36d350(0xa3)]);}}function repairCurrentBuiltinSkill(){const _0xff0499=a41_0x13f6a6;console[_0xff0499(0x77)](a41_0x38cd94[_0xff0499(0xaa)](_0xff0499(0x9d)));const _0x35c217=installBuiltinSkill();if(_0x35c217['ok']){console[_0xff0499(0x77)](a41_0x38cd94['gray'](_0xff0499(0x7e)+_0x35c217[_0xff0499(0x9e)]+_0xff0499(0xad)));return;}throw CliErrors[_0xff0499(0x70)](_0xff0499(0x97)+_0x35c217[_0xff0499(0x69)]+']:\x20'+(_0x35c217[_0xff0499(0xa9)]||_0xff0499(0x98)),_0xff0499(0x9a)+_0x35c217[_0xff0499(0x95)]+_0xff0499(0x6b)+CLI_BIN_NAME+_0xff0499(0x78));}function verifyUpdatedBuiltinSkill(_0x47761e){const _0x2823cd=a41_0x13f6a6,_0x2f6210=inspectInstalledBuiltinSkillVersion(_0x47761e);if(_0x2f6210[_0x2823cd(0xae)]===_0x2823cd(0x86)){console[_0x2823cd(0x77)](a41_0x38cd94[_0x2823cd(0xaa)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x47761e+_0x2823cd(0xad)));return;}const _0x400ce6=_0x2f6210[_0x2823cd(0x9e)]?_0x2823cd(0xb1)+_0x47761e+',\x20found\x20'+_0x2f6210[_0x2823cd(0x9e)]:_0x2823cd(0xb1)+_0x47761e+',\x20state\x20'+_0x2f6210[_0x2823cd(0xae)];throw CliErrors['apiError'](_0x2823cd(0xa4)+_0x47761e+_0x2823cd(0x94)+_0x400ce6,'Run:\x20'+_0x2f6210[_0x2823cd(0x95)]+',\x20then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x2823cd(0x78));}async function execute(_0x42cb84){const _0x4d5517=a41_0x13f6a6;await validateUpdateFlags(_0x42cb84);const _0x339b4a=getCurrentVersion();console[_0x4d5517(0x77)](_0x4d5517(0x8d)+_0x339b4a);const _0x3fbb7c=a41_0x501352(_0x4d5517(0xb2))[_0x4d5517(0x71)](),_0x3b65d8=await resolveTargetVersion(_0x42cb84);if(!_0x3b65d8){const _0x103083=_0x42cb84['bool'](_0x4d5517(0x66))?_0x4d5517(0xb0):'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x3fbb7c[_0x4d5517(0x92)](_0x103083),console[_0x4d5517(0x77)](a41_0x38cd94[_0x4d5517(0xaa)](_0x4d5517(0x82)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x103083};}const _0x4a2a3a=a41_0x382b3c[_0x4d5517(0x93)](VERSION),_0x415964=a41_0x382b3c[_0x4d5517(0x93)](_0x3b65d8[_0x4d5517(0xa3)]);if(!_0x4a2a3a||!_0x415964)return _0x3fbb7c[_0x4d5517(0x92)](_0x4d5517(0xb4)),{'ok':![],'message':_0x4d5517(0xb4)};if(!shouldInstallTarget(_0x4a2a3a,_0x3b65d8)){const _0x453f69=_0x3b65d8[_0x4d5517(0xaf)]===_0x4d5517(0xa3)?_0x4d5517(0x8a)+_0x3b65d8[_0x4d5517(0xa3)]+')':a41_0x382b3c['gt'](_0x4a2a3a,_0x415964)?_0x4d5517(0x8f)+_0x339b4a+'\x20is\x20newer\x20than\x20npm\x20latest\x20v'+_0x3b65d8[_0x4d5517(0xa3)]:'Already\x20up\x20to\x20date\x20(v'+_0x3b65d8[_0x4d5517(0xa3)]+')';return _0x3fbb7c[_0x4d5517(0x96)](_0x453f69),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x3fbb7c[_0x4d5517(0x8e)](getInstallPlanLabel(_0x339b4a,_0x3b65d8));const _0x45566c=detectPackageManager(),_0x1fbf36=_0x45566c===_0x4d5517(0xa6)?resolveNpmBin(_0x4d5517(0xa6)):_0x45566c,_0x205729=a41_0x501352('Updating\x20via\x20'+_0x45566c+_0x4d5517(0x79))[_0x4d5517(0x71)]();try{await execa(_0x1fbf36,[_0x4d5517(0x6f),'-g',NPM_PACKAGE_NAME+'@'+_0x3b65d8[_0x4d5517(0xa3)]],{'stdio':_0x4d5517(0xab)}),_0x205729['succeed'](_0x4d5517(0x7a)+_0x3b65d8['version']),console[_0x4d5517(0x77)](a41_0x38cd94[_0x4d5517(0xaa)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x571a67){return _0x205729['fail'](_0x4d5517(0x9f)),console['error'](a41_0x38cd94[_0x4d5517(0xa0)]('\x20\x20'+_0x571a67[_0x4d5517(0x85)])),console['log'](a41_0x38cd94['gray'](_0x4d5517(0x81)+_0x45566c+_0x4d5517(0x75)+NPM_PACKAGE_NAME+'@'+_0x3b65d8['version'])),{'ok':![],'message':_0x571a67['message']};}return verifyUpdatedBuiltinSkill(_0x3b65d8[_0x4d5517(0xa3)]),{'ok':!![]};}export const updateDefinition={'service':a41_0x13f6a6(0x83),'command':'run','description':a41_0x13f6a6(0xac),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4305fd,_0x50e119){const _0x36678f=a42_0x3ad1,_0x3f06c3=_0x4305fd();while(!![]){try{const _0xa708d9=parseInt(_0x36678f(0x1d7))/0x1+-parseInt(_0x36678f(0x1d5))/0x2*(-parseInt(_0x36678f(0x1d6))/0x3)+parseInt(_0x36678f(0x1d9))/0x4+-parseInt(_0x36678f(0x1da))/0x5+parseInt(_0x36678f(0x1d8))/0x6+parseInt(_0x36678f(0x1dc))/0x7*(parseInt(_0x36678f(0x1db))/0x8)+-parseInt(_0x36678f(0x1dd))/0x9;if(_0xa708d9===_0x50e119)break;else _0x3f06c3['push'](_0x3f06c3['shift']());}catch(_0x95f2cb){_0x3f06c3['push'](_0x3f06c3['shift']());}}}(a42_0x5471,0xbd048));function a42_0x3ad1(_0x54e108,_0x348f1d){_0x54e108=_0x54e108-0x1d5;const _0x5471e6=a42_0x5471();let _0x3ad1f2=_0x5471e6[_0x54e108];return _0x3ad1f2;}import{codegenSdk}from'../../commands/codegen/sdk.js';function a42_0x5471(){const _0x1c5c08=['21682XttIoR','354JEkEgt','920864Pfuofa','7628880cFZLeK','3766456Qeanzj','2246330Tpnfsr','10359672NypPFb','7kdXdXe','40362057CPlWzz'];a42_0x5471=function(){return _0x1c5c08;};return a42_0x5471();}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x2e7562=a43_0x3b94;(function(_0xfc7b64,_0x496a9b){const _0x37370a=a43_0x3b94,_0x58b027=_0xfc7b64();while(!![]){try{const _0x1856cc=-parseInt(_0x37370a(0x19c))/0x1+-parseInt(_0x37370a(0x19e))/0x2+parseInt(_0x37370a(0x1a7))/0x3+-parseInt(_0x37370a(0x1a6))/0x4+-parseInt(_0x37370a(0x196))/0x5+-parseInt(_0x37370a(0x1a5))/0x6+parseInt(_0x37370a(0x1a1))/0x7*(parseInt(_0x37370a(0x1a0))/0x8);if(_0x1856cc===_0x496a9b)break;else _0x58b027['push'](_0x58b027['shift']());}catch(_0xcf219c){_0x58b027['push'](_0x58b027['shift']());}}}(a43_0xd8f7,0xb59a2));function a43_0x3b94(_0x43b6bb,_0xabd8c2){_0x43b6bb=_0x43b6bb-0x195;const _0xd8f792=a43_0xd8f7();let _0x3b94e5=_0xd8f792[_0x43b6bb];return _0x3b94e5;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a43_0xd8f7(){const _0x3ddd0e=['alias','bool','6084654cmgHdR','5613156WtBuVl','2518554rXqANC','skip-imports','1663030uppCKA','code','name','Omit\x20import\x20statements\x20from\x20generated\x20code','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','string','1248139PBhCiZ','str','87084zWOLkQ','read','424NirJhZ','521171tWyubk','operation'];a43_0xd8f7=function(){return _0x3ddd0e;};return a43_0xd8f7();}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':'sdk','description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a43_0x2e7562(0x19f),'flags':[CODE_FLAG_OPTIONAL,{'name':a43_0x2e7562(0x1a3),'type':a43_0x2e7562(0x19b),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a43_0x2e7562(0x1a2),'type':a43_0x2e7562(0x19b),'required':!![],'description':a43_0x2e7562(0x19a)},{'name':a43_0x2e7562(0x195),'type':'boolean','description':a43_0x2e7562(0x199)}],async 'execute'(_0x3e23ed){const _0x5dc275=a43_0x2e7562,{dataset:_0x1f9032,operation:_0x1c81ce}=await getOperationDetail(_0x3e23ed['appCode'],_0x3e23ed['str'](_0x5dc275(0x197)),_0x3e23ed[_0x5dc275(0x19d)]('operation')),_0x341d7c=generateSdkCode(_0x1f9032,_0x1c81ce,{'includeImports':!_0x3e23ed[_0x5dc275(0x1a4)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x1f9032[_0x5dc275(0x198)],'code':_0x1f9032[_0x5dc275(0x197)],'tableName':_0x1f9032['tableName']},'operation':_0x3e23ed[_0x5dc275(0x19d)]('operation'),'code':_0x341d7c}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x162cf9=a44_0x89d6;(function(_0x28a58e,_0x2493f1){const _0x276642=a44_0x89d6,_0x9b0da5=_0x28a58e();while(!![]){try{const _0x26aff8=parseInt(_0x276642(0xc7))/0x1+parseInt(_0x276642(0xbd))/0x2*(-parseInt(_0x276642(0xca))/0x3)+-parseInt(_0x276642(0xce))/0x4*(parseInt(_0x276642(0xbc))/0x5)+-parseInt(_0x276642(0xc3))/0x6+-parseInt(_0x276642(0xcb))/0x7+-parseInt(_0x276642(0xc6))/0x8*(-parseInt(_0x276642(0xcf))/0x9)+parseInt(_0x276642(0xbb))/0xa*(parseInt(_0x276642(0xc8))/0xb);if(_0x26aff8===_0x2493f1)break;else _0x9b0da5['push'](_0x9b0da5['shift']());}catch(_0x59785e){_0x9b0da5['push'](_0x9b0da5['shift']());}}}(a44_0x2a81,0x3204b));function a44_0x89d6(_0x24c1c9,_0xd16101){_0x24c1c9=_0x24c1c9-0xba;const _0x2a8140=a44_0x2a81();let _0x89d604=_0x2a8140[_0x24c1c9];return _0x89d604;}function a44_0x2a81(){const _0x35e14=['target','3590890hZfuxe','30togQYE','129432MqKtIy','no-imports','string','sqlcode','read','sqlName','362898dxyLhn','sql','Omit\x20import\x20statements\x20from\x20generated\x20code','3392MKMALp','352697FRRnDP','11DFFNxF','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','12kFZSIM','2112558qMAwVy','sdk','sqlCode','72812jBuSua','4743nGFAmN','bff','boolean','appCode'];a44_0x2a81=function(){return _0x35e14;};return a44_0x2a81();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':'codegen','command':a44_0x162cf9(0xc4),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a44_0x162cf9(0xc1),'flags':[SQLCODE_FLAG,{'name':'target','type':a44_0x162cf9(0xbf),'description':a44_0x162cf9(0xc9),'default':a44_0x162cf9(0xcc),'enum':[a44_0x162cf9(0xcc),a44_0x162cf9(0xd0)]},{'name':a44_0x162cf9(0xbe),'type':a44_0x162cf9(0xd1),'description':a44_0x162cf9(0xc5)}],async 'execute'(_0x112948){const _0x36b45f=a44_0x162cf9,_0x245c32=await getSqlQueryInfo(_0x112948[_0x36b45f(0xd2)],_0x112948['str'](_0x36b45f(0xc0))),_0x16041a=_0x112948['str'](_0x36b45f(0xba))||'sdk',_0x5d6731=generateSqlCodeTemplate(_0x245c32,{'target':_0x16041a,'includeImports':!_0x112948['bool']('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x245c32[_0x36b45f(0xcd)],'sqlName':_0x245c32[_0x36b45f(0xc2)],'target':_0x16041a,'code':_0x5d6731}};}};
|