@lovrabet/rabetbase-cli 2.5.5-beta.2 → 2.5.5
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/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.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/detail.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.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.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.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.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/api-architecture-upgrade.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/feishu-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.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/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/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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.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 +3 -3
- package/skills/rabetbase/guides/independent-deployment.md +11 -1
- package/skills/rabetbase/references/rabetbase-config.md +16 -19
- package/skills/rabetbase/references/rabetbase-menu-visibility-update.md +5 -4
- package/skills/rabetbase/references/rabetbase-workspace.md +3 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x4946(){const _0x3b980a=['file','POST','538124idWrWM',',\x20appCode=','App\x20config\x20server\x20id\x20missing\x20for\x20key=','1523361LWMXBM','apiError','create','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','712waRIzB','get','9217194uDGjMK','1280525OPZSos','set','25095biZiWt','\x20app\x20config\x20','/smartapi/app-config/create','221360txxTYo','747mgqkJO','2yeXJDf','update','number','2654616mBGjSu','appCode','write','app-config','Created','tags'];a34_0x4946=function(){return _0x3b980a;};return a34_0x4946();}const a34_0x188b6e=a34_0x2983;(function(_0x1c2154,_0x324014){const _0x18710c=a34_0x2983,_0x56aab3=_0x1c2154();while(!![]){try{const _0x438786=parseInt(_0x18710c(0x20a))/0x1+parseInt(_0x18710c(0x1ff))/0x2*(-parseInt(_0x18710c(0x1f1))/0x3)+parseInt(_0x18710c(0x202))/0x4+parseInt(_0x18710c(0x1f8))/0x5+-parseInt(_0x18710c(0x1f7))/0x6+parseInt(_0x18710c(0x1fa))/0x7*(-parseInt(_0x18710c(0x1f5))/0x8)+parseInt(_0x18710c(0x1fe))/0x9*(parseInt(_0x18710c(0x1fd))/0xa);if(_0x438786===_0x324014)break;else _0x56aab3['push'](_0x56aab3['shift']());}catch(_0x5e3a08){_0x56aab3['push'](_0x56aab3['shift']());}}}(a34_0x4946,0xe3918));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x2983(_0x54abc2,_0x5158ed){_0x54abc2=_0x54abc2-0x1ef;const _0x494630=a34_0x4946();let _0x298372=_0x494630[_0x54abc2];return _0x298372;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a34_0x188b6e(0x1fc),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a34_0x188b6e(0x205),'command':a34_0x188b6e(0x1f9),'description':a34_0x188b6e(0x1f4),'risk':a34_0x188b6e(0x204),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x188b6e(0x208),'type':'string','description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x4497a8){readKeyArg(_0x4497a8),readOptionalTags(_0x4497a8),assertSingleValueSource(_0x4497a8);},async 'dryRun'(_0x1a0e22){const _0x4180d0=a34_0x188b6e,_0x23496b=readKeyArg(_0x1a0e22),_0x55a9e3=readOptionalTags(_0x1a0e22),_0x2df5bb=assertSingleValueSource(_0x1a0e22);await assertValueSourceReadable(_0x2df5bb);const _0x4354dc=await withAppConfigApiBoundary(_0x4180d0(0x1f6),{'appCode':_0x1a0e22['appCode'],'key':_0x23496b},()=>getAppConfigByKey(_0x1a0e22[_0x4180d0(0x203)],_0x23496b)),_0x5187b3=_0x4354dc?'update':_0x4180d0(0x1f3),_0x364a55=_0x4354dc?projectAppConfig(_0x4354dc):null,_0xb5efe4=plannedAppConfig({'appCode':_0x1a0e22[_0x4180d0(0x203)],'key':_0x23496b,'tags':_0x55a9e3??_0x4354dc?.[_0x4180d0(0x207)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x5187b3,'appCode':_0x1a0e22['appCode'],'key':_0x23496b,'before':_0x364a55,'after':_0xb5efe4,'dryRun':!![]}),{'method':_0x4180d0(0x209),'url':_0x5187b3===_0x4180d0(0x200)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x1ae7ac){const _0x3b2c12=a34_0x188b6e,_0x3ab147=readKeyArg(_0x1ae7ac),_0x468766=readOptionalTags(_0x1ae7ac),_0x2518b6=await withAppConfigApiBoundary(_0x3b2c12(0x1f6),{'appCode':_0x1ae7ac[_0x3b2c12(0x203)],'key':_0x3ab147},()=>getAppConfigByKey(_0x1ae7ac[_0x3b2c12(0x203)],_0x3ab147)),_0x23bae0=_0x2518b6?projectAppConfig(_0x2518b6):null,_0x2a5cf0=_0x2518b6?_0x3b2c12(0x200):_0x3b2c12(0x1f3),{value:_0x10c405,warnings:_0x482989}=await readAppConfigValue(_0x1ae7ac),_0x4bac4f={'appCode':_0x1ae7ac[_0x3b2c12(0x203)],'key':_0x3ab147,'value':_0x10c405,'tags':_0x468766??_0x2518b6?.[_0x3b2c12(0x207)]??undefined};await withAppConfigApiBoundary(_0x2a5cf0,{'appCode':_0x1ae7ac[_0x3b2c12(0x203)],'key':_0x3ab147},async()=>{const _0x3932df=_0x3b2c12;_0x2518b6?await updateAppConfig({..._0x4bac4f,'id':requireAppConfigId(_0x2518b6,_0x3ab147,_0x1ae7ac[_0x3932df(0x203)])}):await createAppConfig(_0x4bac4f);});const _0x1baee0=await withAppConfigApiBoundary(_0x3b2c12(0x1f6),{'appCode':_0x1ae7ac[_0x3b2c12(0x203)],'key':_0x3ab147},()=>getAppConfigByKey(_0x1ae7ac['appCode'],_0x3ab147)),_0x50e1a7=_0x1baee0?projectAppConfig(_0x1baee0):plannedAppConfig({'appCode':_0x1ae7ac[_0x3b2c12(0x203)],'key':_0x3ab147,'tags':_0x4bac4f['tags'],'hasValue':_0x10c405!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x2a5cf0,'appCode':_0x1ae7ac[_0x3b2c12(0x203)],'key':_0x3ab147,'before':_0x23bae0,'after':_0x50e1a7,'dryRun':![],'warnings':_0x482989}),'message':(_0x2a5cf0===_0x3b2c12(0x200)?'Updated':_0x3b2c12(0x206))+_0x3b2c12(0x1fb)+_0x3ab147};}};function requireAppConfigId(_0x200fc0,_0x31fef5,_0x49e466){const _0x1fd3d3=a34_0x188b6e;if(typeof _0x200fc0['id']===_0x1fd3d3(0x201)&&Number['isFinite'](_0x200fc0['id'])&&_0x200fc0['id']>0x0)return _0x200fc0['id'];throw CliErrors[_0x1fd3d3(0x1f2)](_0x1fd3d3(0x1f0)+_0x31fef5+_0x1fd3d3(0x1ef)+_0x49e466);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x19b524=a35_0x3486;(function(_0x82d491,_0x314f3d){const _0x3d6d39=a35_0x3486,_0x3dfff5=_0x82d491();while(!![]){try{const _0x4b4120=-parseInt(_0x3d6d39(0x1ea))/0x1*(-parseInt(_0x3d6d39(0x1e6))/0x2)+-parseInt(_0x3d6d39(0x1e0))/0x3*(parseInt(_0x3d6d39(0x1d5))/0x4)+parseInt(_0x3d6d39(0x1e7))/0x5*(parseInt(_0x3d6d39(0x20f))/0x6)+-parseInt(_0x3d6d39(0x1f8))/0x7+parseInt(_0x3d6d39(0x20e))/0x8*(parseInt(_0x3d6d39(0x1ec))/0x9)+-parseInt(_0x3d6d39(0x1f1))/0xa*(-parseInt(_0x3d6d39(0x1fb))/0xb)+parseInt(_0x3d6d39(0x1e2))/0xc*(parseInt(_0x3d6d39(0x1de))/0xd);if(_0x4b4120===_0x314f3d)break;else _0x3dfff5['push'](_0x3dfff5['shift']());}catch(_0x80b1be){_0x3dfff5['push'](_0x3dfff5['shift']());}}}(a35_0x5a39,0xa754a));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x19b524(0x216),'description':a35_0x19b524(0x1fa),'required':!![]};export const VALUE_ARG={'name':a35_0x19b524(0x1fd),'description':a35_0x19b524(0x20b),'required':![]};export const TAGS_FLAG={'name':a35_0x19b524(0x20c),'type':a35_0x19b524(0x200),'description':a35_0x19b524(0x1e8)};export const STDIN_FLAG={'name':a35_0x19b524(0x209),'type':a35_0x19b524(0x202),'description':a35_0x19b524(0x1f2),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':a35_0x19b524(0x200),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':'reveal','type':a35_0x19b524(0x202),'description':a35_0x19b524(0x1dd),'default':![]};export function readKeyArg(_0x443b57){const _0x901fb4=a35_0x19b524,_0x231f10=_0x443b57['args'][0x0]?.[_0x901fb4(0x1dc)]()??'';return validateKey(_0x231f10),_0x231f10;}export function readOptionalTags(_0x1a8c36){const _0x3449fe=a35_0x19b524,_0x4cbc16=_0x1a8c36['str'](_0x3449fe(0x20c))[_0x3449fe(0x1dc)]();if(!_0x4cbc16)return undefined;if(_0x4cbc16[_0x3449fe(0x1f5)]>0x20)throw CliErrors[_0x3449fe(0x1d8)](_0x3449fe(0x213));return _0x4cbc16;}export function validateKey(_0x1d481a){const _0x3c3b73=a35_0x19b524;if(!_0x1d481a)throw CliErrors[_0x3c3b73(0x1d8)](_0x3c3b73(0x203));if(_0x1d481a['length']>0x100)throw CliErrors[_0x3c3b73(0x1d8)](_0x3c3b73(0x1ef));}export function projectAppConfig(_0x1a3d90,_0x2c322f){const _0x19857c=a35_0x19b524,_0x2b173b=_0x1a3d90[_0x19857c(0x1fd)]!==undefined&&_0x1a3d90[_0x19857c(0x1fd)]!==null&&_0x1a3d90[_0x19857c(0x1fd)]!=='',_0x55f072={'appCode':_0x1a3d90[_0x19857c(0x1ff)],'key':_0x1a3d90[_0x19857c(0x216)],'tags':_0x1a3d90['tags']??undefined,'hasValue':_0x2b173b,'valueRedacted':_0x2b173b&&!_0x2c322f?.[_0x19857c(0x1f3)],'gmtCreate':_0x1a3d90[_0x19857c(0x1d6)],'gmtModified':_0x1a3d90[_0x19857c(0x1fc)]};return _0x2c322f?.[_0x19857c(0x1f3)]&&(_0x55f072['value']=_0x1a3d90[_0x19857c(0x1fd)]??'',_0x55f072['valueRedacted']=![]),_0x55f072;}function a35_0x3486(_0x4312e5,_0x266332){_0x4312e5=_0x4312e5-0x1d1;const _0x5a39e1=a35_0x5a39();let _0x348697=_0x5a39e1[_0x4312e5];return _0x348697;}export function plannedAppConfig(_0x18c934){const _0x57d994=a35_0x19b524,_0x6f26a3=_0x18c934[_0x57d994(0x1d1)]??!![];return{'appCode':_0x18c934[_0x57d994(0x1ff)],'key':_0x18c934['key'],'tags':_0x18c934[_0x57d994(0x20c)]??undefined,'hasValue':_0x6f26a3,'valueRedacted':_0x6f26a3};}export function buildMutationData(_0x188dad){const _0x5de46e=a35_0x19b524;return{'operation':_0x188dad['operation'],'selector':{'appCode':_0x188dad[_0x5de46e(0x1ff)],'key':_0x188dad[_0x5de46e(0x216)]},'before':_0x188dad[_0x5de46e(0x210)],'after':_0x188dad[_0x5de46e(0x1fe)],'dryRun':_0x188dad['dryRun'],'warnings':_0x188dad[_0x5de46e(0x214)]??[]};}function a35_0x5a39(){const _0x15a1dd=['method','stdin','data','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','tags','appCode:\x20','8rLRbrf','255294XzaHUB','before','from-env','str','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','warnings','utf8','key','hasValue','path','Value\x20file\x20is\x20not\x20readable:\x20','\x20app\x20config.','1468DThPJQ','gmtCreate','apiError','validation','url','join','args','trim','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','1703RiKaFI','setEncoding','4188pXQxYE','argument','58560qBvLOc','error','Environment\x20variable\x20is\x20not\x20set:\x20','kind','784676LhxXtl','5wwMUPP','Config\x20tags\x20for\x20filtering/display\x20metadata','App\x20config\x20value\x20source\x20is\x20ambiguous.','1rjvzCv','name','2899359oqypSb','bool','key:\x20','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','1420EYaSmw','Read\x20config\x20value\x20from\x20stdin','reveal','file','length','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Failed\x20to\x20','8780590WvZWbc','env','Runtime\x20app-config\x20key','81785CxGqnk','gmtModified','value','after','appCode','string','once','boolean','Missing\x20app-config\x20key.','push','defineProperties','end','Missing\x20app-config\x20value\x20source.'];a35_0x5a39=function(){return _0x15a1dd;};return a35_0x5a39();}export async function withAppConfigApiBoundary(_0x40b0d0,_0x3c0844,_0x193d11){const _0x3b4b72=a35_0x19b524;try{return await _0x193d11();}catch{const _0x3ee6ec=[_0x3b4b72(0x20d)+_0x3c0844[_0x3b4b72(0x1ff)]];if(_0x3c0844[_0x3b4b72(0x216)])_0x3ee6ec[_0x3b4b72(0x204)](_0x3b4b72(0x1ee)+_0x3c0844[_0x3b4b72(0x216)]);_0x3ee6ec['push']('value\x20is\x20redacted');throw CliErrors[_0x3b4b72(0x1d7)](_0x3b4b72(0x1f7)+_0x40b0d0+_0x3b4b72(0x1d4),_0x3ee6ec[_0x3b4b72(0x1da)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0xa3b692,_0x560420){const _0x4989c6=a35_0x19b524;return Object[_0x4989c6(0x205)](_0xa3b692,{'method':{'value':_0x560420[_0x4989c6(0x208)],'enumerable':![]},'url':{'value':_0x560420[_0x4989c6(0x1d9)],'enumerable':![]}});}export function assertSingleValueSource(_0x3cf2fe){const _0x1b302c=a35_0x19b524,_0x221524=[];_0x3cf2fe[_0x1b302c(0x1db)]['length']>0x1&&_0x221524['push']({'kind':'argument','value':_0x3cf2fe[_0x1b302c(0x1db)]['slice'](0x1)[_0x1b302c(0x1da)]('\x20')});const _0x204800=_0x3cf2fe['flag'](_0x1b302c(0x1fd));_0x204800!==undefined&&_0x204800!==null&&_0x221524[_0x1b302c(0x204)]({'kind':_0x1b302c(0x1e1),'value':String(_0x204800)});_0x3cf2fe[_0x1b302c(0x1ed)](_0x1b302c(0x209))&&_0x221524[_0x1b302c(0x204)]({'kind':_0x1b302c(0x209)});const _0x56dac9=_0x3cf2fe[_0x1b302c(0x212)](_0x1b302c(0x211))[_0x1b302c(0x1dc)]();_0x56dac9&&_0x221524['push']({'kind':_0x1b302c(0x1f9),'name':_0x56dac9});const _0x446849=_0x3cf2fe[_0x1b302c(0x212)]('file')[_0x1b302c(0x1dc)]();_0x446849&&_0x221524[_0x1b302c(0x204)]({'kind':'file','path':_0x446849});if(_0x221524[_0x1b302c(0x1f5)]===0x0)throw CliErrors[_0x1b302c(0x1d8)](_0x1b302c(0x207),'Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');if(_0x221524[_0x1b302c(0x1f5)]>0x1)throw CliErrors[_0x1b302c(0x1d8)](_0x1b302c(0x1e9),_0x1b302c(0x1f6));return _0x221524[0x0];}export async function assertValueSourceReadable(_0x1e57fa){const _0x1fa912=a35_0x19b524;if(_0x1e57fa['kind']===_0x1fa912(0x1f9)&&!(_0x1e57fa[_0x1fa912(0x1eb)]in process.env))throw CliErrors[_0x1fa912(0x1d8)](_0x1fa912(0x1e4)+_0x1e57fa[_0x1fa912(0x1eb)]);if(_0x1e57fa[_0x1fa912(0x1e5)]===_0x1fa912(0x1f4))try{await access(_0x1e57fa['path']);}catch{throw CliErrors[_0x1fa912(0x1d8)](_0x1fa912(0x1d3)+_0x1e57fa[_0x1fa912(0x1d2)]);}}export async function readAppConfigValue(_0x4be652){const _0x246964=a35_0x19b524,_0x5aa97c=assertSingleValueSource(_0x4be652),_0x3d388d=[];if(_0x5aa97c[_0x246964(0x1e5)]===_0x246964(0x1e1))return _0x3d388d[_0x246964(0x204)](_0x246964(0x1f0)),{'value':_0x5aa97c['value']??'','source':_0x5aa97c[_0x246964(0x1e5)],'warnings':_0x3d388d};if(_0x5aa97c[_0x246964(0x1e5)]===_0x246964(0x209))return{'value':await readStdin(),'source':_0x5aa97c['kind'],'warnings':_0x3d388d};if(_0x5aa97c[_0x246964(0x1e5)]===_0x246964(0x1f9)){if(!(_0x5aa97c[_0x246964(0x1eb)]in process.env))throw CliErrors['validation'](_0x246964(0x1e4)+_0x5aa97c[_0x246964(0x1eb)]);return{'value':process.env[_0x5aa97c.name]??'','source':_0x5aa97c[_0x246964(0x1e5)],'warnings':_0x3d388d};}return{'value':await readFile(_0x5aa97c[_0x246964(0x1d2)],'utf8'),'source':_0x5aa97c[_0x246964(0x1e5)],'warnings':_0x3d388d};}function readStdin(){return new Promise((_0x343da2,_0x9fcb1b)=>{const _0x1650fe=a35_0x3486;let _0x17f3a4='';process[_0x1650fe(0x209)][_0x1650fe(0x1df)](_0x1650fe(0x215)),process[_0x1650fe(0x209)]['on'](_0x1650fe(0x20a),_0x546faa=>{_0x17f3a4+=_0x546faa;}),process[_0x1650fe(0x209)][_0x1650fe(0x201)](_0x1650fe(0x206),()=>_0x343da2(_0x17f3a4)),process[_0x1650fe(0x209)]['once'](_0x1650fe(0x1e3),_0x9fcb1b);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a36_0x5f3a(_0x4c7fc8,_0x4251e8){_0x4c7fc8=_0x4c7fc8-0x81;const _0x4762d=a36_0x4762();let _0x5f3ab5=_0x4762d[_0x4c7fc8];return _0x5f3ab5;}const a36_0x5c9ea2=a36_0x5f3a;(function(_0x255224,_0x594a1a){const _0x461b29=a36_0x5f3a,_0x2b31c2=_0x255224();while(!![]){try{const _0x407f76=-parseInt(_0x461b29(0x8a))/0x1+-parseInt(_0x461b29(0x90))/0x2*(parseInt(_0x461b29(0x83))/0x3)+-parseInt(_0x461b29(0x8e))/0x4+parseInt(_0x461b29(0x82))/0x5*(parseInt(_0x461b29(0x94))/0x6)+parseInt(_0x461b29(0x87))/0x7*(-parseInt(_0x461b29(0x84))/0x8)+parseInt(_0x461b29(0x91))/0x9+-parseInt(_0x461b29(0x86))/0xa;if(_0x407f76===_0x594a1a)break;else _0x2b31c2['push'](_0x2b31c2['shift']());}catch(_0x256a7a){_0x2b31c2['push'](_0x2b31c2['shift']());}}}(a36_0x4762,0xc0fd9));function a36_0x4762(){const _0xf5fd7e=['84Axcsup','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','✓\x20Logged\x20out','16767vkPNbs','auth','Login\x20via\x20browser','bool','579800fnEuCB','write','118046RzskGY','12410433nRDWqw','nonInteractive','yes','6eiucXH','login','3015875cJiISp','3jEPYsD','642496jeUSkB','Clear\x20login\x20session','71390oOJpTX'];a36_0x4762=function(){return _0xf5fd7e;};return a36_0x4762();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a36_0x5c9ea2(0x8b),'command':a36_0x5c9ea2(0x81),'description':a36_0x5c9ea2(0x8c),'risk':a36_0x5c9ea2(0x8f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':'boolean','description':a36_0x5c9ea2(0x88),'default':![]}],async 'execute'(_0x5c7cde){const _0x327ba0=a36_0x5c9ea2,{runAuthServer:_0x9d77d4}=await import('../../auth/auth-server-ui.js');return await _0x9d77d4({'autoYes':_0x5c7cde[_0x327ba0(0x8d)](_0x327ba0(0x93)),'nonInteractive':_0x5c7cde[_0x327ba0(0x92)]}),{'ok':!![]};}},{'service':a36_0x5c9ea2(0x8b),'command':'logout','description':a36_0x5c9ea2(0x85),'risk':a36_0x5c9ea2(0x8f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3ae9e6){const _0x4f8424=a36_0x5c9ea2;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x4f8424(0x89))):console['log']('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x64b9f2=a37_0x506d;(function(_0x1868e1,_0x3ee78a){const _0x24e302=a37_0x506d,_0x2ad185=_0x1868e1();while(!![]){try{const _0x27c26e=-parseInt(_0x24e302(0xc8))/0x1*(parseInt(_0x24e302(0xa0))/0x2)+parseInt(_0x24e302(0x73))/0x3+parseInt(_0x24e302(0x97))/0x4*(parseInt(_0x24e302(0x85))/0x5)+-parseInt(_0x24e302(0xaa))/0x6+-parseInt(_0x24e302(0xab))/0x7*(parseInt(_0x24e302(0x92))/0x8)+parseInt(_0x24e302(0xad))/0x9+parseInt(_0x24e302(0xcc))/0xa;if(_0x27c26e===_0x3ee78a)break;else _0x2ad185['push'](_0x2ad185['shift']());}catch(_0x1d11f7){_0x2ad185['push'](_0x2ad185['shift']());}}}(a37_0x5768,0x8c896));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a37_0x506d(_0x4fd697,_0x571178){_0x4fd697=_0x4fd697-0x6b;const _0x576847=a37_0x5768();let _0x506d02=_0x576847[_0x4fd697];return _0x506d02;}import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a37_0x5768(){const _0x1a5a29=['description','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Operation\x20type\x20(HOOK\x20only)','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','close','function-node','bff','No\x20datasets\x20found\x20for\x20this\x20app.','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','scriptsRootDir','HOOK\x20requires\x20alias/operation/node\x20options.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','join','profileName','parseInt','string','524637AdubeM','read','stderr','ENDPOINT','\x22\x20not\x20found\x20for\x20dataset\x20','.js\x0a\x20*\x20[触发节点]\x20','当前请求参数','nonInteractive','.js\x0a','alias','UNKNOWN','length','datasetId','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Trigger\x20node\x20(HOOK\x20only)','Select\x20dataset:','entries','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','35HiWTVv','operationType','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','operation-type','/**\x0a\x20*\x20','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Created\x20','keys','HOOK','Dataset\x20not\x20found\x20for\x20code\x20\x22','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Operation\x20type\x20\x22','selectedAppName','2213528oXckTq','create','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','currentApp','Select\x20trigger\x20node:','465204zTHQiW','map','\x22\x20not\x20found.\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','mergedCli','.js','datasetCode','Invalid\x20function\x20name\x20\x22','validation','2XCsuoS','Select\x20operation\x20type:','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','Function\x20name\x20(valid\x20JS\x20identifier)','isInteger','当前响应结果','question','before','COMMON','str','2831526YqeGFP','28iUlvTv','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','3850839qBhZmB','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','name','修改后的响应结果','filePath','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','\x20function:\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','File\x20already\x20exists:\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x0a\x20*\x20[平台配置]\x20','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','defaultApp','code','tableName','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','apiDir','type','\x22.\x20','functionNode','Available\x20aliases:\x20','appCode','write','after','/ENDPOINT/','1131848QBEZJD','find','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','No\x20operation\x20types\x20found\x20for\x20dataset\x20','18693140yPamPV','Invalid\x20dataset\x20selection.','datasetcode','trim'];a37_0x5768=function(){return _0x1a5a29;};return a37_0x5768();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x64b9f2(0xd7),'command':a37_0x64b9f2(0x93),'description':a37_0x64b9f2(0xbe),'risk':a37_0x64b9f2(0x74),'flags':[{'name':a37_0x64b9f2(0xc0),'type':a37_0x64b9f2(0x72),'required':!![],'enum':[a37_0x64b9f2(0xa8),a37_0x64b9f2(0x76),a37_0x64b9f2(0x8d)],'description':'Script\x20type'},{'name':a37_0x64b9f2(0xb0),'type':a37_0x64b9f2(0x72),'required':!![],'description':a37_0x64b9f2(0xa3)},{'name':a37_0x64b9f2(0xd0),'type':'string','description':'Script\x20description'},{'name':'alias','type':a37_0x64b9f2(0x72),'description':a37_0x64b9f2(0x9a)},{'name':a37_0x64b9f2(0xce),'type':'string','description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a37_0x64b9f2(0x88),'type':a37_0x64b9f2(0x72),'description':a37_0x64b9f2(0xd3)},{'name':a37_0x64b9f2(0xd6),'type':a37_0x64b9f2(0x72),'description':a37_0x64b9f2(0x81),'enum':[a37_0x64b9f2(0xa7),a37_0x64b9f2(0xc6)]}],async 'validate'(_0x163cc){const _0x2d297f=a37_0x64b9f2,_0x5c8d5c=_0x163cc['str'](_0x2d297f(0xb0));if(!isValidBffFunctionName(_0x5c8d5c))throw CliErrors[_0x2d297f(0x9f)](_0x2d297f(0x9e)+_0x5c8d5c+_0x2d297f(0xb5));},async 'execute'(_0x5984f5){const _0x3251c4=a37_0x64b9f2,_0x432eb5=loadBffProjectConfig(_0x5984f5[_0x3251c4(0xc4)]),_0x557c66=_0x5984f5[_0x3251c4(0xa9)](_0x3251c4(0xc0)),_0x296a40=_0x5984f5[_0x3251c4(0xa9)](_0x3251c4(0xb0)),_0xa318ea=_0x5984f5[_0x3251c4(0xa9)](_0x3251c4(0xd0))||undefined,_0x2807ed=_0x557c66==='HOOK'?await resolveHookOptions(_0x432eb5,_0x5984f5):undefined,_0x33cc1d=buildFilePath(_0x432eb5,_0x557c66,_0x296a40,_0x2807ed);if(await fileExists(_0x33cc1d))throw CliErrors[_0x3251c4(0x9f)](_0x3251c4(0xb6)+_0x33cc1d);await mkdir(dirname(_0x33cc1d),{'recursive':!![]});const _0x2afacd=generateTemplate(_0x557c66,_0x296a40,_0x5984f5[_0x3251c4(0xc4)],_0xa318ea,_0x2807ed);await writeFile(_0x33cc1d,_0x2afacd,'utf8');const _0x4161e7={'type':_0x557c66,'name':_0x296a40,'path':_0x33cc1d};if(_0xa318ea)_0x4161e7['description']=_0xa318ea;if(_0x2807ed){if(_0x2807ed[_0x3251c4(0x7c)])_0x4161e7[_0x3251c4(0x7c)]=_0x2807ed[_0x3251c4(0x7c)];_0x4161e7[_0x3251c4(0x9d)]=_0x2807ed[_0x3251c4(0x9d)],_0x4161e7['operationType']=_0x2807ed[_0x3251c4(0x86)],_0x4161e7[_0x3251c4(0xc2)]=_0x2807ed['functionNode'];}return{'ok':!![],'data':_0x4161e7,'message':_0x3251c4(0x8b)+_0x557c66+_0x3251c4(0xb4)+_0x296a40};}};async function resolveHookOptions(_0x563572,_0x3a2b55){const _0x193492=a37_0x64b9f2,_0xf6e2ff=resolveApiModelSource(_0x3a2b55['apiDir'],_0x3a2b55['appCode'],_0x3a2b55[_0x193492(0x91)]||_0x3a2b55['mergedCli']?.[_0x193492(0x95)]||_0x3a2b55[_0x193492(0x9b)]?.[_0x193492(0xbb)]),_0x5c5130=loadAliasMap(_0x3a2b55[_0x193492(0xbf)],undefined,_0xf6e2ff[_0x193492(0xb2)],_0xf6e2ff[_0x193492(0x70)]),_0x319730=_0x5c5130[_0x193492(0x7e)]>0x0;let _0x3a0b9f,_0x24346b,_0x1f7310;const _0x52ff15=_0x3a2b55['str'](_0x193492(0x7c)),_0x3023ce=_0x3a2b55['str'](_0x193492(0xce));if(_0x52ff15){const _0x17fa53=resolveAlias(_0x3a2b55['apiDir'],_0x52ff15,undefined,_0xf6e2ff['filePath'],_0xf6e2ff[_0x193492(0x70)]);if(!_0x17fa53){const _0x36402a=_0x319730?_0x193492(0xc3)+_0x5c5130[_0x193492(0x98)](_0x444091=>_0x444091[_0x193492(0x7c)])['join'](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x193492(0x9f)]('Alias\x20\x22'+_0x52ff15+_0x193492(0x99)+_0x36402a);}_0x3a0b9f=_0x52ff15,_0x24346b=_0x17fa53;}else{if(_0x3023ce){_0x24346b=_0x3023ce;const _0x4e5204=_0x5c5130[_0x193492(0xc9)](_0x5742a4=>_0x5742a4[_0x193492(0x9d)]===_0x3023ce);_0x3a0b9f=_0x4e5204?.[_0x193492(0x7c)];}else{if(_0x3a2b55[_0x193492(0x7a)])throw CliErrors[_0x193492(0x9f)](_0x193492(0x80));else{if(_0x319730){const _0x34ec80=_0x5c5130[_0x193492(0x98)](_0x1efce9=>_0x1efce9[_0x193492(0x7c)]+'\x20('+_0x1efce9[_0x193492(0xbd)]+')'),_0xd6547f=await promptSelect(_0x193492(0x82),_0x34ec80),_0xe8e0fa=_0x5c5130[_0xd6547f];if(!_0xe8e0fa)throw CliErrors[_0x193492(0x9f)]('Invalid\x20dataset\x20selection.');_0x3a0b9f=_0xe8e0fa['alias'],_0x24346b=_0xe8e0fa[_0x193492(0x9d)];}else{const _0x4e2d4c=await listDatasets(_0x3a2b55['appCode']);if(_0x4e2d4c[_0x193492(0x7e)]===0x0)throw CliErrors[_0x193492(0x9f)](_0x193492(0xd8));const _0x265438=_0x4e2d4c[_0x193492(0x98)](_0x4171a7=>_0x4171a7[_0x193492(0xb0)]+'\x20['+(_0x4171a7['source']??_0x193492(0x7d))+']\x20('+_0x4171a7[_0x193492(0xbc)]+')'),_0x2fec4e=await promptSelect(_0x193492(0x82),_0x265438),_0x599493=_0x4e2d4c[_0x2fec4e];if(!_0x599493)throw CliErrors[_0x193492(0x9f)](_0x193492(0xcd));_0x24346b=_0x599493[_0x193492(0xbc)],_0x3a0b9f=undefined;}}}}const _0x741f46=await listDatasets(_0x3a2b55[_0x193492(0xc4)]),_0x391f81=_0x741f46[_0x193492(0xc9)](_0x7f7d59=>_0x7f7d59[_0x193492(0xbc)]===_0x24346b);if(!_0x391f81)throw CliErrors['validation'](_0x193492(0x8e)+_0x24346b+_0x193492(0xc1)+(_0x3a0b9f?_0x193492(0x94)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x1f7310=_0x391f81['id'];const _0x36c9a6=_0x3a0b9f??_0x24346b,_0x3acaeb=await listBffDatasetOperations(_0x3a2b55['appCode'],_0x1f7310),_0x3fa512=_0x3acaeb?Object[_0x193492(0x8c)](_0x3acaeb):[];if(_0x3fa512[_0x193492(0x7e)]===0x0)throw CliErrors[_0x193492(0x9f)](_0x193492(0xcb)+_0x36c9a6+'.');let _0x2212d9;const _0x2fe76b=_0x3a2b55[_0x193492(0xa9)](_0x193492(0x88));if(_0x2fe76b){if(!_0x3fa512['includes'](_0x2fe76b))throw CliErrors['validation'](_0x193492(0x90)+_0x2fe76b+_0x193492(0x77)+_0x36c9a6+'.\x20'+('Available:\x20'+_0x3fa512[_0x193492(0x6f)](',\x20')));_0x2212d9=_0x2fe76b;}else{if(_0x3a2b55[_0x193492(0x7a)])throw CliErrors[_0x193492(0x9f)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xb51575=await promptSelect(_0x193492(0xa1),_0x3fa512);_0x2212d9=_0x3fa512[_0xb51575]??_0x3fa512[0x0];}let _0x32b648=normalizeHookFunctionNode(_0x3a2b55[_0x193492(0xa9)]('function-node'));if(!_0x32b648){if(_0x3a2b55[_0x193492(0xa9)]('function-node'))throw CliErrors['validation'](_0x193492(0xaf));if(_0x3a2b55[_0x193492(0x7a)])throw CliErrors['validation'](_0x193492(0xd1));const _0x439e90=await promptSelect(_0x193492(0x96),[_0x193492(0xa7),'after']);_0x32b648=['before','after'][_0x439e90]??_0x193492(0xa7);}return{'alias':_0x3a0b9f,'datasetCode':_0x24346b,'datasetId':_0x1f7310,'operationType':_0x2212d9,'functionNode':_0x32b648};}async function promptSelect(_0x19c5a8,_0x5c5b9b){const _0x441469=a37_0x64b9f2;if(_0x5c5b9b[_0x441469(0x7e)]===0x1)return 0x0;for(const [_0x35ffaf,_0x48cc91]of _0x5c5b9b[_0x441469(0x83)]()){process[_0x441469(0x75)][_0x441469(0xc5)]('\x20\x20'+(_0x35ffaf+0x1)+'.\x20'+_0x48cc91+'\x0a');}const _0x371d48=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x4f2c8c=await new Promise(_0x462a3a=>{const _0x82f042=_0x441469;_0x371d48[_0x82f042(0xa6)](_0x19c5a8+'\x20',_0x462a3a);}),_0x4b3503=Number[_0x441469(0x71)](_0x4f2c8c['trim'](),0xa);if(Number[_0x441469(0xa4)](_0x4b3503)&&_0x4b3503>=0x1&&_0x4b3503<=_0x5c5b9b['length'])return _0x371d48[_0x441469(0xd5)](),_0x4b3503-0x1;process[_0x441469(0x75)][_0x441469(0xc5)](_0x441469(0x84)+_0x5c5b9b[_0x441469(0x7e)]+'.\x0a');}}function buildFilePath(_0x83f117,_0x59b490,_0xaf577c,_0x21d43e){const _0x3d1020=a37_0x64b9f2;if(_0x59b490===_0x3d1020(0x8d)){if(!_0x21d43e)throw CliErrors['validation'](_0x3d1020(0x6d));const _0xbe3a2f=_0x21d43e['alias']??_0x21d43e[_0x3d1020(0x9d)];return join(_0x83f117[_0x3d1020(0x6c)],'HOOK',_0xbe3a2f,_0x21d43e[_0x3d1020(0x86)],_0x21d43e[_0x3d1020(0xc2)],_0xaf577c+'.js');}return join(_0x83f117[_0x3d1020(0x6c)],_0x59b490,_0xaf577c+_0x3d1020(0x9c));}export function generateTemplate(_0x14677f,_0x4c07e4,_0x1b3495,_0x3f7662,_0x360541){const _0x4fb349=a37_0x64b9f2,_0x4c90c8=_0x3f7662?.[_0x4fb349(0xcf)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x5e3dd4=getAppBaseUrl(_0x1b3495),_0x841654=_0x4fb349(0xba);if(_0x14677f==='COMMON')return'/**\x0a\x20*\x20'+_0x4c90c8+_0x4fb349(0x6e)+_0x4c07e4+'\x0a\x20*\x20[平台配置]\x20'+_0x5e3dd4+_0x4fb349(0x6b)+_0x1b3495+'/COMMON/'+_0x4c07e4+_0x4fb349(0xa2)+_0x4c07e4+'\x22,\x20params\x20})\x0a'+_0x841654+_0x4fb349(0xb7)+_0x4c07e4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x14677f===_0x4fb349(0x76))return _0x4fb349(0x89)+_0x4c90c8+_0x4fb349(0xae)+_0x4c07e4+_0x4fb349(0xca)+_0x1b3495+'/'+_0x4c07e4+_0x4fb349(0xb9)+_0x5e3dd4+_0x4fb349(0x6b)+_0x1b3495+_0x4fb349(0xc7)+_0x4c07e4+_0x4fb349(0x7b)+_0x841654+_0x4fb349(0x8a)+_0x4c07e4+_0x4fb349(0xac);if(!_0x360541)throw CliErrors['validation'](_0x4fb349(0x8f));const _0x4b15c2=_0x360541['alias']??_0x360541[_0x4fb349(0x9d)],_0x45434b=_0x360541['functionNode']==='before'?_0x4fb349(0x79):_0x4fb349(0xa5),_0x299857=_0x360541[_0x4fb349(0xc2)]===_0x4fb349(0xa7)?'修改后的请求参数':_0x4fb349(0xb1);return'/**\x0a\x20*\x20'+_0x4c90c8+_0x4fb349(0xb3)+_0x4c07e4+_0x4fb349(0x87)+_0x1b3495+'/'+_0x360541['datasetCode']+'/'+_0x360541['operationType']+_0x4fb349(0xb9)+_0x5e3dd4+'/data/dataset/'+_0x360541[_0x4fb349(0x7f)]+_0x4fb349(0xb8)+_0x1b3495+'/HOOK/'+_0x4b15c2+'/'+_0x360541['operationType']+'/'+_0x360541[_0x4fb349(0xc2)]+'/'+_0x4c07e4+_0x4fb349(0x78)+_0x360541[_0x4fb349(0xc2)]+'\x0a'+_0x841654+_0x4fb349(0xd4)+_0x45434b+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x299857+_0x4fb349(0xd2)+_0x4c07e4+_0x4fb349(0xac);}
|
|
1
|
+
const a37_0x538221=a37_0x1409;(function(_0xd0a997,_0x543bcf){const _0x2577cb=a37_0x1409,_0x599f6f=_0xd0a997();while(!![]){try{const _0x241624=-parseInt(_0x2577cb(0x104))/0x1*(parseInt(_0x2577cb(0xd4))/0x2)+-parseInt(_0x2577cb(0x119))/0x3+-parseInt(_0x2577cb(0xf5))/0x4+parseInt(_0x2577cb(0x106))/0x5*(parseInt(_0x2577cb(0xf7))/0x6)+-parseInt(_0x2577cb(0xeb))/0x7*(parseInt(_0x2577cb(0xf3))/0x8)+parseInt(_0x2577cb(0xb9))/0x9*(-parseInt(_0x2577cb(0x116))/0xa)+parseInt(_0x2577cb(0xdb))/0xb;if(_0x241624===_0x543bcf)break;else _0x599f6f['push'](_0x599f6f['shift']());}catch(_0x1981b7){_0x599f6f['push'](_0x599f6f['shift']());}}}(a37_0x157c,0xda0c8));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a37_0x1409(_0x20e7f6,_0x4833bb){_0x20e7f6=_0x20e7f6-0xb4;const _0x157c0b=a37_0x157c();let _0x140931=_0x157c0b[_0x20e7f6];return _0x140931;}import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':a37_0x538221(0xea),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':'read','flags':[{'name':'type','type':a37_0x538221(0xc6),'required':!![],'enum':['COMMON',a37_0x538221(0xd3),a37_0x538221(0xf9)],'description':a37_0x538221(0xbd)},{'name':a37_0x538221(0x109),'type':a37_0x538221(0xc6),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a37_0x538221(0xfe),'type':a37_0x538221(0xc6),'description':a37_0x538221(0x113)},{'name':a37_0x538221(0xe5),'type':a37_0x538221(0xc6),'description':a37_0x538221(0xb7)},{'name':a37_0x538221(0xd0),'type':'string','description':a37_0x538221(0xd9)},{'name':a37_0x538221(0xd8),'type':a37_0x538221(0xc6),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a37_0x538221(0xfc)]}],async 'validate'(_0x4f4ec6){const _0xa7c966=a37_0x538221,_0xd7571f=_0x4f4ec6[_0xa7c966(0xe9)]('name');if(!isValidBffFunctionName(_0xd7571f))throw CliErrors['validation'](_0xa7c966(0xed)+_0xd7571f+_0xa7c966(0xde));},async 'execute'(_0x36eb53){const _0x5963d5=a37_0x538221,_0x186ca1=loadBffProjectConfig(_0x36eb53[_0x5963d5(0xdf)]),_0x4d5c7e=_0x36eb53['str'](_0x5963d5(0x10a)),_0x14da7c=_0x36eb53[_0x5963d5(0xe9)](_0x5963d5(0x109)),_0xdaf733=_0x36eb53[_0x5963d5(0xe9)](_0x5963d5(0xfe))||undefined,_0x399d4e=_0x4d5c7e==='HOOK'?await resolveHookOptions(_0x186ca1,_0x36eb53):undefined,_0x2a6857=buildFilePath(_0x186ca1,_0x4d5c7e,_0x14da7c,_0x399d4e);if(await fileExists(_0x2a6857))throw CliErrors[_0x5963d5(0xd6)](_0x5963d5(0xfa)+_0x2a6857);await mkdir(dirname(_0x2a6857),{'recursive':!![]});const _0x26c09d=generateTemplate(_0x4d5c7e,_0x14da7c,_0x36eb53['appCode'],_0xdaf733,_0x399d4e);await writeFile(_0x2a6857,_0x26c09d,'utf8');const _0x92c8df={'type':_0x4d5c7e,'name':_0x14da7c,'path':_0x2a6857};if(_0xdaf733)_0x92c8df['description']=_0xdaf733;if(_0x399d4e){if(_0x399d4e[_0x5963d5(0xe5)])_0x92c8df[_0x5963d5(0xe5)]=_0x399d4e[_0x5963d5(0xe5)];_0x92c8df['datasetCode']=_0x399d4e['datasetCode'],_0x92c8df['operationType']=_0x399d4e[_0x5963d5(0x10b)],_0x92c8df[_0x5963d5(0xc1)]=_0x399d4e[_0x5963d5(0xc1)];}return{'ok':!![],'data':_0x92c8df,'message':_0x5963d5(0x10e)+_0x4d5c7e+_0x5963d5(0xda)+_0x14da7c};}};function a37_0x157c(){const _0x50db7d=['179IpqhDw','code','4865BRycCA','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','datasetId','name','type','operationType','nonInteractive','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','Created\x20','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','entries','before','\x20api\x20pull`\x20to\x20refresh.','Script\x20description','trim','mergedCli','70BFrbUM','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','includes','612759VMirnm','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Select\x20dataset:','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','当前请求参数','68868juADRs','profileName','No\x20operation\x20types\x20found\x20for\x20dataset\x20','defaultApp','Script\x20type','Select\x20trigger\x20node:','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','No\x20datasets\x20found\x20for\x20this\x20app.','functionNode','修改后的请求参数','Invalid\x20dataset\x20selection.','keys','datasetCode','string','find','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','COMMON','stderr','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','join','/**\x0a\x20*\x20','apiDir','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','datasetcode','.js','\x0a\x20*\x20[平台配置]\x20','ENDPOINT','19462RkhPin','当前响应结果','validation','source','operation-type','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20function:\x20','49392211BpFlcX','.js\x0a','No\x20model\x20aliases\x20found.\x20Run\x20`','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','appCode','function-node','修改后的响应结果','close',']\x20(','UNKNOWN','alias','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','/ENDPOINT/','Available:\x20','str','create','7jvCPYS','\x22,\x20params\x20})\x0a','Invalid\x20function\x20name\x20\x22','/HOOK/','parseInt','selectedAppName','write','currentApp','5966536xJJgRa','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','5017648TcHZie','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','2484oAuHTb','map','HOOK','File\x20already\x20exists:\x20','stdin','after','Dataset\x20not\x20found\x20for\x20code\x20\x22','description','Available\x20aliases:\x20','scriptsRootDir','/COMMON/','length','\x0a\x20*\x20[接口路径]\x20POST\x20/api/'];a37_0x157c=function(){return _0x50db7d;};return a37_0x157c();}async function resolveHookOptions(_0x59f0d7,_0x3920b9){const _0x17a868=a37_0x538221,_0x3266d5=resolveApiModelSource(_0x3920b9[_0x17a868(0xce)],_0x3920b9[_0x17a868(0xdf)],_0x3920b9[_0x17a868(0xf0)]||_0x3920b9[_0x17a868(0x115)]?.[_0x17a868(0xf2)]||_0x3920b9[_0x17a868(0x115)]?.[_0x17a868(0xbc)]),_0x3c3694=loadAliasMap(_0x3920b9[_0x17a868(0xce)],undefined,_0x3266d5['filePath'],_0x3266d5['profileName']),_0x498034=_0x3c3694[_0x17a868(0x102)]>0x0;let _0x30c800,_0x316d8f,_0x2573df;const _0x5e0a2c=_0x3920b9[_0x17a868(0xe9)](_0x17a868(0xe5)),_0x2bd05c=_0x3920b9[_0x17a868(0xe9)](_0x17a868(0xd0));if(_0x5e0a2c){const _0x3e454a=resolveAlias(_0x3920b9[_0x17a868(0xce)],_0x5e0a2c,undefined,_0x3266d5['filePath'],_0x3266d5[_0x17a868(0xba)]);if(!_0x3e454a){const _0x49af84=_0x498034?_0x17a868(0xff)+_0x3c3694['map'](_0x52351a=>_0x52351a['alias'])[_0x17a868(0xcc)](',\x20'):_0x17a868(0xdd)+CLI_BIN_NAME+_0x17a868(0xb6);throw CliErrors['validation']('Alias\x20\x22'+_0x5e0a2c+'\x22\x20not\x20found.\x20'+_0x49af84);}_0x30c800=_0x5e0a2c,_0x316d8f=_0x3e454a;}else{if(_0x2bd05c){_0x316d8f=_0x2bd05c;const _0x18121e=_0x3c3694[_0x17a868(0xc7)](_0x1e597b=>_0x1e597b[_0x17a868(0xc5)]===_0x2bd05c);_0x30c800=_0x18121e?.[_0x17a868(0xe5)];}else{if(_0x3920b9['nonInteractive'])throw CliErrors[_0x17a868(0xd6)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x498034){const _0x156aa7=_0x3c3694[_0x17a868(0xf8)](_0x5c2e63=>_0x5c2e63[_0x17a868(0xe5)]+'\x20('+_0x5c2e63['tableName']+')'),_0x402354=await promptSelect(_0x17a868(0xb5),_0x156aa7),_0x1e44f4=_0x3c3694[_0x402354];if(!_0x1e44f4)throw CliErrors[_0x17a868(0xd6)](_0x17a868(0xc3));_0x30c800=_0x1e44f4['alias'],_0x316d8f=_0x1e44f4[_0x17a868(0xc5)];}else{const _0x2f537f=await listDatasets(_0x3920b9[_0x17a868(0xdf)]);if(_0x2f537f[_0x17a868(0x102)]===0x0)throw CliErrors[_0x17a868(0xd6)](_0x17a868(0xc0));const _0x3d9149=_0x2f537f[_0x17a868(0xf8)](_0x4a17e5=>_0x4a17e5[_0x17a868(0x109)]+'\x20['+(_0x4a17e5[_0x17a868(0xd7)]??_0x17a868(0xe4))+_0x17a868(0xe3)+_0x4a17e5[_0x17a868(0x105)]+')'),_0x245b70=await promptSelect(_0x17a868(0xb5),_0x3d9149),_0x447133=_0x2f537f[_0x245b70];if(!_0x447133)throw CliErrors[_0x17a868(0xd6)](_0x17a868(0xc3));_0x316d8f=_0x447133['code'],_0x30c800=undefined;}}}}const _0x2ba811=await listDatasets(_0x3920b9[_0x17a868(0xdf)]),_0xd71cae=_0x2ba811[_0x17a868(0xc7)](_0x4a59ec=>_0x4a59ec[_0x17a868(0x105)]===_0x316d8f);if(!_0xd71cae)throw CliErrors[_0x17a868(0xd6)](_0x17a868(0xfd)+_0x316d8f+'\x22.\x20'+(_0x30c800?'The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x17a868(0x112):''));_0x2573df=_0xd71cae['id'];const _0x23cb08=_0x30c800??_0x316d8f,_0x5a73c1=await listBffDatasetOperations(_0x3920b9[_0x17a868(0xdf)],_0x2573df),_0x2876c8=_0x5a73c1?Object[_0x17a868(0xc4)](_0x5a73c1):[];if(_0x2876c8[_0x17a868(0x102)]===0x0)throw CliErrors[_0x17a868(0xd6)](_0x17a868(0xbb)+_0x23cb08+'.');let _0x588f5b;const _0x14ef59=_0x3920b9[_0x17a868(0xe9)](_0x17a868(0xd8));if(_0x14ef59){if(!_0x2876c8[_0x17a868(0x118)](_0x14ef59))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x14ef59+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x23cb08+'.\x20'+(_0x17a868(0xe8)+_0x2876c8[_0x17a868(0xcc)](',\x20')));_0x588f5b=_0x14ef59;}else{if(_0x3920b9[_0x17a868(0x10c)])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x5c0e0=await promptSelect('Select\x20operation\x20type:',_0x2876c8);_0x588f5b=_0x2876c8[_0x5c0e0]??_0x2876c8[0x0];}let _0x2e95c3=normalizeHookFunctionNode(_0x3920b9[_0x17a868(0xe9)](_0x17a868(0xe0)));if(!_0x2e95c3){if(_0x3920b9[_0x17a868(0xe9)](_0x17a868(0xe0)))throw CliErrors[_0x17a868(0xd6)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x3920b9[_0x17a868(0x10c)])throw CliErrors[_0x17a868(0xd6)](_0x17a868(0xf4));const _0xe154aa=await promptSelect(_0x17a868(0xbe),['before',_0x17a868(0xfc)]);_0x2e95c3=[_0x17a868(0x111),_0x17a868(0xfc)][_0xe154aa]??_0x17a868(0x111);}return{'alias':_0x30c800,'datasetCode':_0x316d8f,'datasetId':_0x2573df,'operationType':_0x588f5b,'functionNode':_0x2e95c3};}async function promptSelect(_0xe2c5e4,_0x2249cb){const _0x397a97=a37_0x538221;if(_0x2249cb[_0x397a97(0x102)]===0x1)return 0x0;for(const [_0x2668d2,_0x58561b]of _0x2249cb[_0x397a97(0x110)]()){process[_0x397a97(0xca)][_0x397a97(0xf1)]('\x20\x20'+(_0x2668d2+0x1)+'.\x20'+_0x58561b+'\x0a');}const _0x6c028b=createInterface({'input':process[_0x397a97(0xfb)],'output':process[_0x397a97(0xca)]});while(!![]){const _0x193d29=await new Promise(_0x226ef6=>{_0x6c028b['question'](_0xe2c5e4+'\x20',_0x226ef6);}),_0xdcc614=Number[_0x397a97(0xef)](_0x193d29[_0x397a97(0x114)](),0xa);if(Number['isInteger'](_0xdcc614)&&_0xdcc614>=0x1&&_0xdcc614<=_0x2249cb[_0x397a97(0x102)])return _0x6c028b[_0x397a97(0xe2)](),_0xdcc614-0x1;process['stderr'][_0x397a97(0xf1)](_0x397a97(0x107)+_0x2249cb['length']+'.\x0a');}}function buildFilePath(_0x2f91df,_0x12c3ec,_0x183510,_0xa8cd1c){const _0x148c4f=a37_0x538221;if(_0x12c3ec===_0x148c4f(0xf9)){if(!_0xa8cd1c)throw CliErrors[_0x148c4f(0xd6)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x141267=_0xa8cd1c[_0x148c4f(0xe5)]??_0xa8cd1c[_0x148c4f(0xc5)];return join(_0x2f91df[_0x148c4f(0x100)],_0x148c4f(0xf9),_0x141267,_0xa8cd1c[_0x148c4f(0x10b)],_0xa8cd1c[_0x148c4f(0xc1)],_0x183510+_0x148c4f(0xd1));}return join(_0x2f91df[_0x148c4f(0x100)],_0x12c3ec,_0x183510+'.js');}export function generateTemplate(_0x2708f8,_0xd54088,_0xa0e00e,_0x5b5d62,_0x5bcf71){const _0x503cd8=a37_0x538221,_0x32b284=_0x5b5d62?.[_0x503cd8(0x114)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x3397cb=getAppBaseUrl(_0xa0e00e),_0xeb3997=_0x503cd8(0xbf);if(_0x2708f8===_0x503cd8(0xc9))return'/**\x0a\x20*\x20'+_0x32b284+_0x503cd8(0x11a)+_0xd54088+_0x503cd8(0xd2)+_0x3397cb+_0x503cd8(0xe6)+_0xa0e00e+_0x503cd8(0x101)+_0xd54088+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0xd54088+_0x503cd8(0xec)+_0xeb3997+_0x503cd8(0xcf)+_0xd54088+_0x503cd8(0xcb);if(_0x2708f8===_0x503cd8(0xd3))return _0x503cd8(0xcd)+_0x32b284+_0x503cd8(0x10d)+_0xd54088+_0x503cd8(0xc8)+_0xa0e00e+'/'+_0xd54088+_0x503cd8(0xd2)+_0x3397cb+_0x503cd8(0xe6)+_0xa0e00e+_0x503cd8(0xe7)+_0xd54088+_0x503cd8(0xdc)+_0xeb3997+_0x503cd8(0xb4)+_0xd54088+_0x503cd8(0xcb);if(!_0x5bcf71)throw CliErrors[_0x503cd8(0xd6)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x262c67=_0x5bcf71['alias']??_0x5bcf71[_0x503cd8(0xc5)],_0x3262b1=_0x5bcf71['functionNode']===_0x503cd8(0x111)?_0x503cd8(0xb8):_0x503cd8(0xd5),_0x4f8731=_0x5bcf71[_0x503cd8(0xc1)]===_0x503cd8(0x111)?_0x503cd8(0xc2):_0x503cd8(0xe1);return _0x503cd8(0xcd)+_0x32b284+_0x503cd8(0xf6)+_0xd54088+_0x503cd8(0x103)+_0xa0e00e+'/'+_0x5bcf71['datasetCode']+'/'+_0x5bcf71[_0x503cd8(0x10b)]+'\x0a\x20*\x20[平台配置]\x20'+_0x3397cb+'/data/dataset/'+_0x5bcf71[_0x503cd8(0x108)]+_0x503cd8(0x10f)+_0xa0e00e+_0x503cd8(0xee)+_0x262c67+'/'+_0x5bcf71['operationType']+'/'+_0x5bcf71['functionNode']+'/'+_0xd54088+'.js\x0a\x20*\x20[触发节点]\x20'+_0x5bcf71['functionNode']+'\x0a'+_0xeb3997+_0x503cd8(0x11b)+_0x3262b1+_0x503cd8(0x11c)+_0x4f8731+_0x503cd8(0x117)+_0xd54088+_0x503cd8(0xcb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x155e2c=a38_0x4b2d;function a38_0x5ef2(){const _0x200fdd=['/api/management/library/scripts/delete','trashDir','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','remoteId','<timestamp>','lockFilePath','Multiple\x20functions\x20match\x20\x22','target','scriptsRootDir','3626akcpVQ','toISOString','high-risk-write','join','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','2376yOkbsK','Function\x20not\x20found:\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','9792LmKKSz','1062786vjZRww','2674005rCWafe','str','\x20\x20-\x20','filter','Backend\x20Function\x20lock\x20file\x20not\x20found.','POST','No\x20lock\x20entry\x20found\x20for\x20\x22','3474264OPKtaa','Would\x20delete\x20','split','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','bff','keys','validation','2ywNCDM','9528RnQZJk','scriptsRoot','length','Lock\x20scope\x20for\x20app\x20\x22','appCode','35777KrEqrR','functions','353510WYxHcF','string','replace','Local\x20delete\x20not\x20settled\x20for\x20','trashedTo','projectRoot','map','delete','apps'];a38_0x5ef2=function(){return _0x200fdd;};return a38_0x5ef2();}(function(_0x513d3f,_0x46e55a){const _0x8cdf65=a38_0x4b2d,_0x491495=_0x513d3f();while(!![]){try{const _0x146844=-parseInt(_0x8cdf65(0xa4))/0x1+-parseInt(_0x8cdf65(0xd0))/0x2*(parseInt(_0x8cdf65(0xc1))/0x3)+-parseInt(_0x8cdf65(0xc9))/0x4+parseInt(_0x8cdf65(0xc2))/0x5+parseInt(_0x8cdf65(0xd1))/0x6*(parseInt(_0x8cdf65(0xb8))/0x7)+-parseInt(_0x8cdf65(0xbd))/0x8*(-parseInt(_0x8cdf65(0xc0))/0x9)+parseInt(_0x8cdf65(0xa6))/0xa;if(_0x146844===_0x46e55a)break;else _0x491495['push'](_0x491495['shift']());}catch(_0x19ffee){_0x491495['push'](_0x491495['shift']());}}}(a38_0x5ef2,0x6fa33));function a38_0x4b2d(_0x393afd,_0x136871){_0x393afd=_0x393afd-0xa4;const _0x5ef214=a38_0x5ef2();let _0x4b2de8=_0x5ef214[_0x393afd];return _0x4b2de8;}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';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':a38_0x155e2c(0xcd),'command':a38_0x155e2c(0xad),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a38_0x155e2c(0xba),'flags':[{'name':a38_0x155e2c(0xb6),'type':a38_0x155e2c(0xa7),'required':!![],'description':a38_0x155e2c(0xcc)}],async 'validate'(_0x15bffd){const _0x5766fd=a38_0x155e2c,_0x4cdb0a=loadBffProjectConfig(_0x15bffd[_0x5766fd(0xd5)]),_0x169be4=await readBffLockFile(_0x4cdb0a['lockFilePath']);if(!_0x169be4)throw CliErrors[_0x5766fd(0xcf)](_0x5766fd(0xbc));},async 'dryRun'(_0x355165){const _0x3950c1=a38_0x155e2c,_0xd86639=loadBffProjectConfig(_0x355165[_0x3950c1(0xd5)]),_0x5df001=await readBffLockFile(_0xd86639[_0x3950c1(0xb4)]);if(!_0x5df001)throw CliErrors[_0x3950c1(0xcf)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x41b6d2}=ensureLockScope(_0x5df001,_0x355165[_0x3950c1(0xd5)],_0xd86639['scriptsRoot'],'delete'),_0x2dd52b=_0x355165[_0x3950c1(0xc3)](_0x3950c1(0xb6)),_0x49f406=Object[_0x3950c1(0xce)](_0x41b6d2['functions']),_0x18aa23=resolveDeleteTarget(_0x2dd52b,_0x49f406),_0x132cbe=_0x41b6d2[_0x3950c1(0xa5)][_0x18aa23];if(!_0x132cbe)throw CliErrors[_0x3950c1(0xcf)](_0x3950c1(0xc8)+_0x18aa23+'\x22.');const _0x196115=resolveLocalFilePathFromLockKey(_0xd86639,_0x18aa23),_0x54070b=relative(_0xd86639[_0x3950c1(0xab)],_0x196115),_0x151e3c=join(_0xd86639[_0x3950c1(0xb0)],_0x3950c1(0xb3),_0x54070b);return{'method':_0x3950c1(0xc7),'url':_0x3950c1(0xaf),'body':{'appCode':_0x355165[_0x3950c1(0xd5)],'target':_0x18aa23,'remoteId':_0x132cbe[_0x3950c1(0xb2)],'localFilePath':_0x196115,'trashedPath':_0x151e3c},'description':_0x3950c1(0xca)+_0x18aa23+_0x3950c1(0xb1)};},async 'execute'(_0x12fb77){const _0x195d54=a38_0x155e2c,_0x34c5f0=loadBffProjectConfig(_0x12fb77[_0x195d54(0xd5)]),_0x500c74=await readBffLockFile(_0x34c5f0[_0x195d54(0xb4)]);if(!_0x500c74)throw CliErrors[_0x195d54(0xcf)](_0x195d54(0xc6));const {lockData:_0x41afc3,appLock:_0x570ac1}=ensureLockScope(_0x500c74,_0x12fb77['appCode'],_0x34c5f0[_0x195d54(0xd2)],_0x195d54(0xad)),_0xd67b0e=JSON['parse'](JSON['stringify'](_0x41afc3)),_0x233445=_0xd67b0e[_0x195d54(0xae)][_0x12fb77[_0x195d54(0xd5)]];if(!_0x233445)throw new Error(_0x195d54(0xd4)+_0x12fb77[_0x195d54(0xd5)]+_0x195d54(0xbf));const _0x20c9e8=_0x12fb77[_0x195d54(0xc3)]('target'),_0x3b7a4c=Object[_0x195d54(0xce)](_0x233445[_0x195d54(0xa5)]),_0x58a4de=resolveDeleteTarget(_0x20c9e8,_0x3b7a4c),_0x2ed99d=_0x233445[_0x195d54(0xa5)][_0x58a4de];if(!_0x2ed99d)throw CliErrors[_0x195d54(0xcf)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x58a4de+'\x22.');await deleteBffScript(_0x2ed99d[_0x195d54(0xb2)]),delete _0x233445['functions'][_0x58a4de],_0x233445['lastSync']=new Date()[_0x195d54(0xb9)](),await writeBffLockFile(_0x34c5f0[_0x195d54(0xb4)],_0xd67b0e);const _0x3bb4cf=resolveLocalFilePathFromLockKey(_0x34c5f0,_0x58a4de);let _0x334eee;await fileExists(_0x3bb4cf)&&(_0x334eee=await moveToTrash(_0x34c5f0[_0x195d54(0xab)],_0x34c5f0[_0x195d54(0xb0)],_0x3bb4cf),await cleanupEmptyDirectories(dirname(_0x3bb4cf),_0x34c5f0[_0x195d54(0xb7)]));await waitForDeleteSettlement(_0x34c5f0[_0x195d54(0xb4)],_0x12fb77[_0x195d54(0xd5)],_0x58a4de,_0x3bb4cf),await sleep(0x96);const _0x50809d={'deleted':_0x58a4de,'remoteId':_0x2ed99d['remoteId']};if(_0x334eee)_0x50809d[_0x195d54(0xaa)]=_0x334eee;return{'ok':!![],'data':_0x50809d,'message':'Deleted\x20'+_0x58a4de+(_0x334eee?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x39a169,_0x5cdc2b){const _0x31c342=a38_0x155e2c;if(_0x39a169['includes']('/')){const _0x3ca07e=_0x5cdc2b['find'](_0x54f25b=>_0x54f25b===_0x39a169);if(!_0x3ca07e)throw CliErrors[_0x31c342(0xcf)](_0x31c342(0xbe)+_0x39a169);return _0x3ca07e;}const _0x5f2e76=_0x5cdc2b[_0x31c342(0xc5)](_0x2039ca=>_0x2039ca[_0x31c342(0xcb)]('/')['at'](-0x1)===_0x39a169);if(_0x5f2e76['length']===0x0)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x39a169);if(_0x5f2e76[_0x31c342(0xd3)]>0x1)throw CliErrors[_0x31c342(0xcf)](_0x31c342(0xb5)+_0x39a169+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x5f2e76[_0x31c342(0xac)](_0x24bfba=>_0x31c342(0xc4)+_0x24bfba)[_0x31c342(0xbb)]('\x0a'));return _0x5f2e76[0x0];}async function moveToTrash(_0x10bbf7,_0xfe74c6,_0x21ed54){const _0x3cb261=a38_0x155e2c,_0x42cb31=new Date()[_0x3cb261(0xb9)]()[_0x3cb261(0xa8)](/[:.]/g,'-'),_0x505b1c=relative(_0x10bbf7,_0x21ed54),_0x34541f=join(_0xfe74c6,_0x42cb31,_0x505b1c);return await mkdir(dirname(_0x34541f),{'recursive':!![]}),await rename(_0x21ed54,_0x34541f),_0x34541f;}async function cleanupEmptyDirectories(_0x24368a,_0x5992f5){const _0x325896=a38_0x155e2c;let _0x17a78e=resolve(_0x24368a);const _0x124431=resolve(_0x5992f5);while(_0x17a78e['startsWith'](''+_0x124431+sep)||_0x17a78e===_0x124431){if(_0x17a78e===_0x124431)return;try{const _0x17310c=await readdir(_0x17a78e);if(_0x17310c[_0x325896(0xd3)]>0x0)return;await rmdir(_0x17a78e);}catch{return;}_0x17a78e=dirname(_0x17a78e);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3768d7,_0x390fb0,_0x435aff,_0x3dd3e3){const _0xf1ea26=a38_0x155e2c;for(let _0x1d5298=0x0;_0x1d5298<DELETE_SETTLE_RETRY_COUNT;_0x1d5298+=0x1){const _0x444d4a=await readBffLockFile(_0x3768d7),_0x18144b=!!_0x444d4a?.[_0xf1ea26(0xae)]?.[_0x390fb0]?.[_0xf1ea26(0xa5)]?.[_0x435aff],_0x12eb97=await fileExists(_0x3dd3e3);if(!_0x18144b&&!_0x12eb97)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0xf1ea26(0xa9)+_0x435aff+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a39_0x379d4c=a39_0x3299;(function(_0x36ae83,_0x5a8b48){const _0x549510=a39_0x3299,_0x40935a=_0x36ae83();while(!![]){try{const _0x2e2952=-parseInt(_0x549510(0xa7))/0x1*(parseInt(_0x549510(0x9f))/0x2)+parseInt(_0x549510(0xa0))/0x3*(parseInt(_0x549510(0x9d))/0x4)+parseInt(_0x549510(0x9e))/0x5*(-parseInt(_0x549510(0x9a))/0x6)+parseInt(_0x549510(0xa2))/0x7*(parseInt(_0x549510(0x90))/0x8)+-parseInt(_0x549510(0xa3))/0x9*(parseInt(_0x549510(0x8c))/0xa)+parseInt(_0x549510(0xa1))/0xb*(parseInt(_0x549510(0x8b))/0xc)+-parseInt(_0x549510(0x8a))/0xd*(-parseInt(_0x549510(0x8d))/0xe);if(_0x2e2952===_0x5a8b48)break;else _0x40935a['push'](_0x40935a['shift']());}catch(_0x44a572){_0x40935a['push'](_0x40935a['shift']());}}}(a39_0x3a5d,0x1cf87));import{getBffScriptInfo}from'../../core/api-client.js';function a39_0x3a5d(){const _0x2837c4=['40BRPPFe','126xCXpmK','updateUserName','verbose','8BeVRXt','number','functionName','createdTime','read','boolean','scriptType','Script\x20ID','version','(none)','6JaYiex','updatedTime','num','468584pombxd','943510PbsYDo','70106pKwqWb','3YrhSkp','16291TYitkM','447083obsqZu','189603LRgDFI','scriptContent','bff','description','3jMSfNj','detail','424034PLNqHx','180aVltWt'];a39_0x3a5d=function(){return _0x2837c4;};return a39_0x3a5d();}function a39_0x3299(_0xeb236d,_0x93de10){_0xeb236d=_0xeb236d-0x89;const _0x3a5daf=a39_0x3a5d();let _0x329971=_0x3a5daf[_0xeb236d];return _0x329971;}export const bffDetail={'service':a39_0x379d4c(0xa5),'command':a39_0x379d4c(0x89),'description':'Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','risk':a39_0x379d4c(0x94),'flags':[{'name':'id','type':a39_0x379d4c(0x91),'required':!![],'description':a39_0x379d4c(0x97)},{'name':a39_0x379d4c(0x8f),'type':a39_0x379d4c(0x95),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x542717){const _0x559cf6=a39_0x379d4c,_0x483779=await getBffScriptInfo(_0x542717[_0x559cf6(0x9c)]('id')),_0x25646c=_0x542717['bool']('verbose');if(_0x25646c)return{'ok':!![],'data':_0x483779};return{'ok':!![],'data':{'id':_0x483779['id'],'functionName':_0x483779[_0x559cf6(0x92)]??'','version':_0x483779[_0x559cf6(0x98)]??'','updateUserName':_0x483779[_0x559cf6(0x8e)]??'','appCode':_0x483779['appCode'],'scriptType':_0x483779[_0x559cf6(0x96)],'description':_0x483779[_0x559cf6(0xa6)]||_0x559cf6(0x99),'createdTime':_0x483779[_0x559cf6(0x93)]??'','updatedTime':_0x483779[_0x559cf6(0x9b)]??'','scriptContent':_0x483779[_0x559cf6(0xa4)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3619db,_0x4f35bf){const _0x7ab8ab=a40_0x35e4,_0x1b266b=_0x3619db();while(!![]){try{const _0x19f279=-parseInt(_0x7ab8ab(0x198))/0x1*(-parseInt(_0x7ab8ab(0x1a0))/0x2)+-parseInt(_0x7ab8ab(0x19b))/0x3*(parseInt(_0x7ab8ab(0x19a))/0x4)+parseInt(_0x7ab8ab(0x197))/0x5+parseInt(_0x7ab8ab(0x19e))/0x6*(-parseInt(_0x7ab8ab(0x196))/0x7)+-parseInt(_0x7ab8ab(0x195))/0x8*(parseInt(_0x7ab8ab(0x19f))/0x9)+-parseInt(_0x7ab8ab(0x1a1))/0xa*(parseInt(_0x7ab8ab(0x19c))/0xb)+-parseInt(_0x7ab8ab(0x19d))/0xc*(-parseInt(_0x7ab8ab(0x199))/0xd);if(_0x19f279===_0x4f35bf)break;else _0x1b266b['push'](_0x1b266b['shift']());}catch(_0x438066){_0x1b266b['push'](_0x1b266b['shift']());}}}(a40_0x115d,0x5039b));function a40_0x35e4(_0x2575d9,_0x11bc32){_0x2575d9=_0x2575d9-0x195;const _0x115da8=a40_0x115d();let _0x35e450=_0x115da8[_0x2575d9];return _0x35e450;}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a40_0x115d(){const _0x3d520a=['3688ClXjAf','145789VlZEtU','2440770LLQNOx','2355aeYsKG','13zhDDbe','207516FgOPBY','27ntbiFo','22WbmEMF','11394072yyRLru','72XyBezQ','11349dmPVja','254tORfSo','549930UHfClo'];a40_0x115d=function(){return _0x3d520a;};return a40_0x115d();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';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
|
-
const
|
|
1
|
+
const a41_0x1bc7c8=a41_0x398b;function a41_0x398b(_0x4d1499,_0x1b2c39){_0x4d1499=_0x4d1499-0x18c;const _0x16c3ec=a41_0x16c3();let _0x398bc9=_0x16c3ec[_0x4d1499];return _0x398bc9;}(function(_0x559e0b,_0x5df6fc){const _0x218733=a41_0x398b,_0x273370=_0x559e0b();while(!![]){try{const _0x32e283=-parseInt(_0x218733(0x1a7))/0x1*(-parseInt(_0x218733(0x1a0))/0x2)+parseInt(_0x218733(0x18e))/0x3*(parseInt(_0x218733(0x1a8))/0x4)+-parseInt(_0x218733(0x1a5))/0x5*(-parseInt(_0x218733(0x199))/0x6)+parseInt(_0x218733(0x1a4))/0x7*(-parseInt(_0x218733(0x1aa))/0x8)+-parseInt(_0x218733(0x19d))/0x9+-parseInt(_0x218733(0x194))/0xa*(parseInt(_0x218733(0x19e))/0xb)+parseInt(_0x218733(0x197))/0xc*(parseInt(_0x218733(0x190))/0xd);if(_0x32e283===_0x5df6fc)break;else _0x273370['push'](_0x273370['shift']());}catch(_0x2e8920){_0x273370['push'](_0x273370['shift']());}}}(a41_0x16c3,0x4aa60));import{listBffScripts}from'../../core/api-client.js';function a41_0x16c3(){const _0x5a3b87=['7ITMQCA','722695GOapHK','verbose','167225ZEjukH','16hyxCEn','No\x20Backend\x20Function\x20scripts\x20found.','3818104NrFiLb','length','(unnamed)','boolean','str','402321eQpghR','Filter\x20by\x20script\x20name','673348hgiiME','functionName','COMMON','read','10mgieYJ','scriptType','map','156ccOHCT','bool','6sbEuKZ','string','List\x20Backend\x20Function\x20scripts','list','2908683MTXUmt','4568630hvUKiw','description','2oPxvek','name','type','ENDPOINT'];a41_0x16c3=function(){return _0x5a3b87;};return a41_0x16c3();}export const bffList={'service':'bff','command':a41_0x1bc7c8(0x19c),'description':a41_0x1bc7c8(0x19b),'risk':a41_0x1bc7c8(0x193),'flags':[{'name':a41_0x1bc7c8(0x1a2),'type':a41_0x1bc7c8(0x19a),'description':'Script\x20type\x20filter','default':a41_0x1bc7c8(0x1a3),'enum':[a41_0x1bc7c8(0x1a3),a41_0x1bc7c8(0x192)]},{'name':a41_0x1bc7c8(0x1a1),'type':a41_0x1bc7c8(0x19a),'description':a41_0x1bc7c8(0x18f)},{'name':a41_0x1bc7c8(0x1a6),'type':a41_0x1bc7c8(0x18c),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x14a029){const _0x49a77e=a41_0x1bc7c8,_0x37de7b=await listBffScripts(_0x14a029['appCode'],_0x14a029[_0x49a77e(0x18d)](_0x49a77e(0x1a2)),{'scriptName':_0x14a029[_0x49a77e(0x18d)](_0x49a77e(0x1a1))||undefined}),_0x2ba953=_0x14a029[_0x49a77e(0x198)]('verbose');return{'ok':!![],'data':_0x2ba953?_0x37de7b:_0x37de7b[_0x49a77e(0x196)](_0x1b6758=>({'id':_0x1b6758['id'],'functionName':_0x1b6758[_0x49a77e(0x191)]??'','description':_0x1b6758[_0x49a77e(0x19f)]||_0x49a77e(0x1ac),'scriptType':_0x1b6758[_0x49a77e(0x195)]})),'message':_0x37de7b[_0x49a77e(0x1ab)]===0x0?_0x49a77e(0x1a9):undefined};}};
|
package/lib/commands/bff/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x11cdc4=a42_0x4494;(function(_0xcb18a0,_0x96ce5b){const _0x183524=a42_0x4494,_0x4d0a5c=_0xcb18a0();while(!![]){try{const _0x5989a1=parseInt(_0x183524(0x1c2))/0x1+-parseInt(_0x183524(0x1b6))/0x2+-parseInt(_0x183524(0x1c3))/0x3+parseInt(_0x183524(0x1da))/0x4*(parseInt(_0x183524(0x1d9))/0x5)+parseInt(_0x183524(0x1c0))/0x6+-parseInt(_0x183524(0x1d6))/0x7+parseInt(_0x183524(0x1d1))/0x8*(parseInt(_0x183524(0x1bf))/0x9);if(_0x5989a1===_0x96ce5b)break;else _0x4d0a5c['push'](_0x4d0a5c['shift']());}catch(_0xdc8164){_0x4d0a5c['push'](_0x4d0a5c['shift']());}}}(a42_0x207b,0x58a3d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';function a42_0x4494(_0x28718c,_0x54b8c0){_0x28718c=_0x28718c-0x1b2;const _0x207bf2=a42_0x207b();let _0x449484=_0x207bf2[_0x28718c];return _0x449484;}function a42_0x207b(){const _0xf1418f=['--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','flag','10RwNvSj','1151740GBVBix','WARN','isSafeInteger','--since','level','Filter\x20by\x20log\x20level','number','string','INFO','--end-time','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','1128630zCwGqQ','validation','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','appCode','\x20must\x20be\x20a\x20positive\x20integer.','end-time','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','--start-time','start-time','150669TdqnKA','1094214EqHBSk','Found\x20','537629jevuiz','1275021LdXBXD','read','since','Maximum\x20log\x20lines\x20to\x20return\x20(1-','--limit\x20must\x20be\x20between\x201\x20and\x20','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','ERROR','trim','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','str','num','length','toUpperCase','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','232yXZnnQ','keyword','\x20Backend\x20Function\x20log\x20line(s).','logs','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','3002762LqciDa'];a42_0x207b=function(){return _0xf1418f;};return a42_0x207b();}import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=['DEBUG',a42_0x11cdc4(0x1b3),a42_0x11cdc4(0x1db),a42_0x11cdc4(0x1c9)];export function resolveBffLogQuery(_0x4bf8d1,_0x191e73=Date['now']()){const _0x408008=a42_0x11cdc4,_0x67d3f0=_0x4bf8d1[_0x408008(0x1d8)](_0x408008(0x1c5)),_0x150631=_0x4bf8d1[_0x408008(0x1d8)]('start-time'),_0x2b556b=_0x4bf8d1[_0x408008(0x1d8)](_0x408008(0x1bb));if(_0x67d3f0!==undefined&&_0x150631!==undefined)throw CliErrors[_0x408008(0x1b7)](_0x408008(0x1d7));const _0x396a88=_0x2b556b===undefined?_0x191e73:readPositiveInteger(_0x4bf8d1['num'](_0x408008(0x1bb)),_0x408008(0x1b4)),_0x1620ac=_0x150631===undefined?_0x396a88-readSinceMinutes(_0x4bf8d1)*0xea60:readPositiveInteger(_0x4bf8d1[_0x408008(0x1cd)](_0x408008(0x1be)),_0x408008(0x1bd));if(_0x1620ac<=0x0)throw CliErrors[_0x408008(0x1b7)](_0x408008(0x1c8));if(_0x1620ac>_0x396a88)throw CliErrors[_0x408008(0x1b7)](_0x408008(0x1d5));const _0x3ef6f5=readPositiveInteger(_0x4bf8d1[_0x408008(0x1cd)]('limit',DEFAULT_LIMIT),'--limit');if(_0x3ef6f5>MAX_LIMIT)throw CliErrors[_0x408008(0x1b7)](_0x408008(0x1c7)+MAX_LIMIT+'.');const _0x312f9a=_0x4bf8d1['str']('level')[_0x408008(0x1ca)]()[_0x408008(0x1cf)]()||undefined,_0x28e037=_0x4bf8d1[_0x408008(0x1cc)](_0x408008(0x1d2))[_0x408008(0x1ca)]()||undefined;return{'appCode':_0x4bf8d1[_0x408008(0x1b9)],'startTime':_0x1620ac,'endTime':_0x396a88,..._0x150631===undefined?{'sinceMinutes':readSinceMinutes(_0x4bf8d1)}:{},..._0x312f9a?{'level':_0x312f9a}:{},..._0x28e037?{'keyword':_0x28e037}:{},'limit':_0x3ef6f5};}function readSinceMinutes(_0x131451){const _0x59dfb7=a42_0x11cdc4;return readPositiveInteger(_0x131451[_0x59dfb7(0x1cd)](_0x59dfb7(0x1c5),DEFAULT_SINCE_MINUTES),_0x59dfb7(0x1dd));}function readPositiveInteger(_0x3fd41e,_0x24518c){const _0x216563=a42_0x11cdc4;if(!Number[_0x216563(0x1dc)](_0x3fd41e)||_0x3fd41e<=0x0)throw CliErrors[_0x216563(0x1b7)](_0x24518c+_0x216563(0x1ba));return _0x3fd41e;}export const bffLogs={'service':'bff','command':a42_0x11cdc4(0x1d4),'description':a42_0x11cdc4(0x1cb),'risk':a42_0x11cdc4(0x1c4),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x11cdc4(0x1c5),'type':a42_0x11cdc4(0x1e0),'description':a42_0x11cdc4(0x1bc)+DEFAULT_SINCE_MINUTES+')'},{'name':'start-time','type':'number','description':a42_0x11cdc4(0x1b8)},{'name':a42_0x11cdc4(0x1bb),'type':a42_0x11cdc4(0x1e0),'description':a42_0x11cdc4(0x1d0)},{'name':a42_0x11cdc4(0x1de),'type':a42_0x11cdc4(0x1b2),'description':a42_0x11cdc4(0x1df),'enum':LOG_LEVELS},{'name':a42_0x11cdc4(0x1d2),'type':a42_0x11cdc4(0x1b2),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':'limit','type':'number','description':a42_0x11cdc4(0x1c6)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x37bb60){resolveBffLogQuery(_0x37bb60);},async 'execute'(_0x4e10c0){const _0x62a208=a42_0x11cdc4,_0x3e1bb8=resolveBffLogQuery(_0x4e10c0),{sinceMinutes:_0x445a95,..._0x151648}=_0x3e1bb8,_0x5eac0f=await searchBffScriptLogs(_0x151648);return{'ok':!![],'data':{'query':_0x3e1bb8,'count':_0x5eac0f[_0x62a208(0x1ce)],'logs':_0x5eac0f},'message':_0x5eac0f[_0x62a208(0x1ce)]===0x0?_0x62a208(0x1b5):_0x62a208(0x1c1)+_0x5eac0f[_0x62a208(0x1ce)]+_0x62a208(0x1d3)};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a43_0x1c3654=a43_0x1da4;(function(_0xa6b30d,_0x34f9b2){const _0xb79229=a43_0x1da4,_0x599d83=_0xa6b30d();while(!![]){try{const _0x261c94=-parseInt(_0xb79229(0x1c2))/0x1+-parseInt(_0xb79229(0x20d))/0x2*(parseInt(_0xb79229(0x1f6))/0x3)+-parseInt(_0xb79229(0x1dd))/0x4+parseInt(_0xb79229(0x1dc))/0x5*(parseInt(_0xb79229(0x1f3))/0x6)+-parseInt(_0xb79229(0x22d))/0x7+-parseInt(_0xb79229(0x22f))/0x8*(-parseInt(_0xb79229(0x1ef))/0x9)+parseInt(_0xb79229(0x256))/0xa;if(_0x261c94===_0x34f9b2)break;else _0x599d83['push'](_0x599d83['shift']());}catch(_0x264225){_0x599d83['push'](_0x599d83['shift']());}}}(a43_0x1f25,0xc23c5));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{resolveApiModelSource}from'../../api/model-source.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';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a43_0x1f25(){const _0x1d1a38=['oldDirectory','apiDir','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','would_pull','normalize','Remote\x20script\x20missing\x20content.','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','\x22:\x20both\x20target\x20\x22','¤tPage=1&pageSize=','move','\x20Recovery\x20errors:\x20','push_local','functionName','trim','toLowerCase','toISOString','keyChanges','3348415DQBgSq','6099636qdhJgr','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','values','bool','entry','\x22\x20and\x20\x22','\x22\x20may\x20remain.','dev','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','read','conflict','hookLocation','unresolvable\x20target\x20path','split','all','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','ENOENT','\x22\x20from\x20the\x20lock\x20file.','135981aZkkKP','migrations','delete','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','6gwRHuq','NFC','\x20resolution','36888NirMCJ','\x22;\x20temporary\x20directory\x20\x22','mode','selectedAppName','type','\x20failed','ENDPOINT','lockKey','Force\x20overwrite\x20local\x20unsynced\x20changes','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','some','\x20bff\x20push\x20--type\x20','defaultApp','get','.js','case-rename','BFF_LOCAL_UNSYNCED','code','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','HOOK','stderr','filter','requires','220TBHEWe','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','bff','newDirectoryPath','ino','includes','version','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','scriptsRootDir','write','pull','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','join','oldLockKey','\x20conflict','message','\x22:\x20its\x20target\x20\x22','rollback','currentApp','scriptContent','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','lastSync','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','.hook-directory-migrate-','profileName','newLockKey','stdin','COMMON','functionNode','\x22\x20not\x20found\x20after\x20ensureLockScope.','Remote\x20script\x20missing\x20id.','map','2992171MpgknX','string','664IMHxsC','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','oldDirectoryPath','reverse','scriptType','flatMap','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','Pull\x20only\x20this\x20script\x20type','has','datasetCode','Could\x20not\x20restore\x20local\x20script\x20\x22','Would\x20inspect\x20','newDirectory','alias','operationType','functions','filePath','sourceFilePathByNewLockKey','set','/api/management/library/scripts/list?appCode=','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','\x22\x20to\x20\x22','question','projectedFunctions','cancelled','length','\x22\x20from\x20\x22','hash','lockFilePath','push','GET','content','mergedCli','validation','boolean','parse','str','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','26033800XYQMAo','force','remoteId','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','\x22:\x20','426599NQOILQ','nonInteractive','rekey','Lock\x20scope\x20for\x20app\x20\x22','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','\x20pulled','&type=','appCode'];a43_0x1f25=function(){return _0x1d1a38;};return a43_0x1f25();}export const bffPull={'service':a43_0x1c3654(0x20f),'command':a43_0x1c3654(0x217),'description':a43_0x1c3654(0x1ec),'risk':a43_0x1c3654(0x1e6),'structuredErrors':!![],'flags':[{'name':a43_0x1c3654(0x1fa),'type':a43_0x1c3654(0x22e),'description':a43_0x1c3654(0x236),'enum':[a43_0x1c3654(0x228),a43_0x1c3654(0x1fc),a43_0x1c3654(0x209)]},{'name':a43_0x1c3654(0x257),'type':a43_0x1c3654(0x251),'description':a43_0x1c3654(0x1fe)}],async 'dryRun'(_0x3d1365){const _0xee76e5=a43_0x1c3654,_0x4b3dad=loadBffProjectConfig(_0x3d1365[_0xee76e5(0x1c9)]),_0x223ad6=await readBffLockFile(_0x4b3dad[_0xee76e5(0x24b)]),{appLock:_0x35d109}=ensureLockScope(_0x223ad6??createEmptyBffLock(),_0x3d1365[_0xee76e5(0x1c9)],_0x4b3dad['scriptsRoot'],'pull'),_0x432768=normalizeBffType(_0x3d1365['str']('type'))??undefined,[_0x2333dd,_0x360a2a]=await Promise['all']([listBffScripts(_0x3d1365['appCode'],_0x432768),getBffScriptStatistics(_0x3d1365[_0xee76e5(0x1c9)])]),_0x2566f7=_0x2333dd['some'](_0x2d88d1=>normalizeBffType(_0x2d88d1[_0xee76e5(0x233)])===_0xee76e5(0x209)),_0x26de0b=_0x2566f7?buildDatasetCodeToAliasMap(_0x3d1365[_0xee76e5(0x1cb)],_0x3d1365['appCode'],_0x3d1365[_0xee76e5(0x1f9)]||_0x3d1365['mergedCli']?.[_0xee76e5(0x21f)]||_0x3d1365[_0xee76e5(0x24f)]?.['defaultApp']):new Map(),_0x40b653=_0x2566f7?await planHookDirectoryMigration(_0x4b3dad,_0x35d109,_0x26de0b,await scanLocalBffFunctions(_0x4b3dad,_0xee76e5(0x209))):undefined,_0x10e7cc=createHookLocationMap(_0x360a2a),_0x3f9aca=[];for(const _0x1e4c0a of _0x2333dd){const _0x380ea6=resolveRemoteScriptTarget(_0x4b3dad,_0x1e4c0a,_0x10e7cc,_0x40b653?.[_0xee76e5(0x246)]??_0x35d109[_0xee76e5(0x23e)],_0x26de0b);if(!_0x380ea6){_0x3f9aca[_0xee76e5(0x24c)]({'scriptType':_0x1e4c0a[_0xee76e5(0x233)],'functionName':_0x1e4c0a[_0xee76e5(0x1d7)]??'','status':'skipped','reason':_0xee76e5(0x1e9)});continue;}const _0x4dbd24=(_0x40b653?.[_0xee76e5(0x246)]??_0x35d109[_0xee76e5(0x23e)])[_0x380ea6[_0xee76e5(0x1fd)]],_0x388f35=_0x1e4c0a[_0xee76e5(0x220)]!=null?computeContentHash(_0x1e4c0a[_0xee76e5(0x220)]):undefined,_0x20c2ff=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x40b653,_0x380ea6)??_0x380ea6['filePath'],_0x4dbd24,_0x388f35),_0x6a53e6=_0x20c2ff?localUnsyncedConflict(_0x380ea6,_0x1e4c0a['id']):undefined;_0x3f9aca[_0xee76e5(0x24c)]({'lockKey':_0x380ea6[_0xee76e5(0x1fd)],'filePath':_0x380ea6[_0xee76e5(0x23f)],'remoteId':_0x1e4c0a['id']??null,'status':_0x6a53e6?_0xee76e5(0x1e7):_0xee76e5(0x1ce),..._0x6a53e6?{'conflict':_0x6a53e6}:{},..._0x380ea6[_0xee76e5(0x1e8)]?{'alias':_0x380ea6[_0xee76e5(0x1e8)]['alias']??null,'datasetCode':_0x380ea6['hookLocation'][_0xee76e5(0x238)],'operationType':_0x380ea6['hookLocation'][_0xee76e5(0x23d)],'functionNode':_0x380ea6[_0xee76e5(0x1e8)][_0xee76e5(0x229)]}:{}});}return{'method':_0xee76e5(0x24d),'url':_0xee76e5(0x242)+_0x3d1365[_0xee76e5(0x1c9)]+(_0x432768?_0xee76e5(0x1c8)+_0x432768:'')+_0xee76e5(0x1d3)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x3d1365[_0xee76e5(0x1c9)],'filterType':_0x432768??null,..._0x40b653&&_0x40b653[_0xee76e5(0x1f0)][_0xee76e5(0x248)]>0x0?{'hookDirectoryMigrations':_0x40b653[_0xee76e5(0x1f0)][_0xee76e5(0x22c)](_0x2ef9ac=>({'from':_0x2ef9ac['oldDirectory'],'to':_0x2ef9ac['newDirectory']}))}:{},'files':_0x3f9aca},'description':_0xee76e5(0x23a)+_0x3f9aca[_0xee76e5(0x248)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x4eb194){const _0x1cc277=a43_0x1c3654,_0x32033f=loadBffProjectConfig(_0x4eb194[_0x1cc277(0x1c9)]),_0x40217b=await readBffLockFile(_0x32033f[_0x1cc277(0x24b)]),{lockData:_0x153b87,appLock:_0x15e587}=ensureLockScope(_0x40217b??createEmptyBffLock(),_0x4eb194[_0x1cc277(0x1c9)],_0x32033f['scriptsRoot'],'pull'),_0x5b82bb=normalizeBffType(_0x4eb194['str'](_0x1cc277(0x1fa)))??undefined;if(_0x4eb194[_0x1cc277(0x253)](_0x1cc277(0x1fa))&&!_0x5b82bb)throw CliErrors['validation'](_0x1cc277(0x1de));const [_0x131f44,_0x2f31ac]=await Promise['all']([listBffScripts(_0x4eb194[_0x1cc277(0x1c9)],_0x5b82bb),getBffScriptStatistics(_0x4eb194[_0x1cc277(0x1c9)])]);if(_0x131f44[_0x1cc277(0x248)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x1cc277(0x1d1)};const _0x241196=_0x4eb194[_0x1cc277(0x1e0)]('force');if(_0x241196&&!_0x4eb194[_0x1cc277(0x1c3)]){const _0x3b1a18=await confirmForce();if(!_0x3b1a18)throw CliErrors[_0x1cc277(0x247)]('Force\x20pull\x20cancelled.');}if(_0x241196&&_0x4eb194[_0x1cc277(0x1c3)]){}const _0x2dd2f3=_0x131f44[_0x1cc277(0x200)](_0x343101=>normalizeBffType(_0x343101[_0x1cc277(0x233)])==='HOOK'),_0x12330a=_0x2dd2f3?buildDatasetCodeToAliasMap(_0x4eb194['apiDir'],_0x4eb194['appCode'],_0x4eb194['selectedAppName']||_0x4eb194['mergedCli']?.[_0x1cc277(0x21f)]||_0x4eb194[_0x1cc277(0x24f)]?.[_0x1cc277(0x202)]):new Map(),_0x2f77b5=createHookLocationMap(_0x2f31ac),_0x195a92=JSON[_0x1cc277(0x252)](JSON['stringify'](_0x153b87)),_0xed4686=_0x4eb194[_0x1cc277(0x1c9)],_0x41179b=_0x195a92['apps'][_0xed4686];if(!_0x41179b)throw new Error(_0x1cc277(0x1c5)+_0xed4686+_0x1cc277(0x22a));const _0x305ec5=_0x2dd2f3?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x32033f,_0x41179b,_0x12330a,await scanLocalBffFunctions(_0x32033f,_0x1cc277(0x209))),_0x41179b):undefined,_0x1777a4=createPullFileTransaction(),_0x202215=[],_0x7a9803=[],_0x49804c=[],_0x5ea391=[];for(const _0x4491cc of _0x131f44){const _0x29746c=resolveRemoteScriptTarget(_0x32033f,_0x4491cc,_0x2f77b5,_0x41179b['functions'],_0x12330a);if(!_0x29746c){_0x7a9803[_0x1cc277(0x24c)]({'lockKey':_0x4491cc[_0x1cc277(0x233)]+'/'+_0x4491cc[_0x1cc277(0x1d7)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x231d23=_0x41179b[_0x1cc277(0x23e)][_0x29746c[_0x1cc277(0x1fd)]];try{if(!_0x4491cc['id'])throw new Error(_0x1cc277(0x22b));if(_0x4491cc[_0x1cc277(0x220)]==null)throw new Error(_0x1cc277(0x1d0));const _0x5be011=_0x4491cc[_0x1cc277(0x220)],_0x726622=computeContentHash(_0x5be011);if(!_0x241196){const _0x208fcd=await hasUnsyncedLocalChanges(_0x29746c[_0x1cc277(0x23f)],_0x231d23,_0x726622);if(_0x208fcd){_0x49804c['push'](localUnsyncedConflict(_0x29746c,_0x4491cc['id']));continue;}}await _0x1777a4[_0x1cc277(0x216)](_0x29746c[_0x1cc277(0x23f)],_0x5be011);const _0x35b62e={'hash':_0x726622,'remoteId':_0x4491cc['id'],'version':_0x4491cc[_0x1cc277(0x213)]};_0x29746c[_0x1cc277(0x1fa)]===_0x1cc277(0x209)&&_0x29746c['hookLocation']&&(_0x35b62e[_0x1cc277(0x23c)]=_0x29746c[_0x1cc277(0x1e8)][_0x1cc277(0x23c)],_0x35b62e[_0x1cc277(0x238)]=_0x29746c[_0x1cc277(0x1e8)]['datasetCode'],_0x35b62e['operationType']=_0x29746c[_0x1cc277(0x1e8)][_0x1cc277(0x23d)],_0x35b62e[_0x1cc277(0x229)]=_0x29746c[_0x1cc277(0x1e8)][_0x1cc277(0x229)]),_0x41179b[_0x1cc277(0x23e)][_0x29746c[_0x1cc277(0x1fd)]]=_0x35b62e,_0x202215[_0x1cc277(0x24c)]({'lockKey':_0x29746c[_0x1cc277(0x1fd)],'remoteId':_0x4491cc['id']});}catch(_0x1b8448){_0x5ea391[_0x1cc277(0x24c)]({'lockKey':_0x29746c['lockKey'],'error':_0x1b8448 instanceof Error?_0x1b8448[_0x1cc277(0x21c)]:String(_0x1b8448)});}}_0x41179b['lastSync']=new Date()[_0x1cc277(0x1da)]();try{await writeBffLockFile(_0x32033f[_0x1cc277(0x24b)],_0x195a92);}catch(_0x5533be){const _0x564fb9=[...await _0x1777a4[_0x1cc277(0x21e)](),...await _0x305ec5?.[_0x1cc277(0x21e)]()??[]];throw withRollbackErrors(_0x5533be,_0x1cc277(0x208),_0x564fb9);}return{'ok':_0x5ea391[_0x1cc277(0x248)]===0x0,'data':{'pulled':_0x202215,'skipped':_0x7a9803,'conflicts':_0x49804c,'failed':_0x5ea391},'message':formatPullMessage(_0x202215[_0x1cc277(0x248)],_0x7a9803[_0x1cc277(0x248)],_0x49804c['length'],_0x5ea391[_0x1cc277(0x248)])};}};function localUnsyncedConflict(_0x13f490,_0x40841c){const _0x539297=a43_0x1c3654,_0x138aac=_0x13f490[_0x539297(0x1fd)]['split']('/')['at'](-0x1);return{'code':_0x539297(0x206),'lockKey':_0x13f490[_0x539297(0x1fd)],'filePath':_0x13f490[_0x539297(0x23f)],..._0x40841c!=null?{'remoteId':_0x40841c}:{},'message':_0x539297(0x218),'nextAction':{'action':_0x539297(0x1d6),'command':CLI_BIN_NAME+_0x539297(0x201)+_0x13f490[_0x539297(0x1fa)]+'\x20--name\x20'+_0x138aac+'\x20--format\x20compress','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 a43_0x1da4(_0x334c1c,_0x133499){_0x334c1c=_0x334c1c-0x1c2;const _0x1f253b=a43_0x1f25();let _0x1da4f3=_0x1f253b[_0x334c1c];return _0x1da4f3;}function formatPullMessage(_0x46dd15,_0x2500d1,_0x531d6a,_0x3a18d4){const _0x4ce93d=a43_0x1c3654,_0x1202ec=['Pull\x20complete:\x20'+_0x46dd15+_0x4ce93d(0x1c7),_0x2500d1+'\x20skipped'];_0x531d6a>0x0&&_0x1202ec['push'](_0x531d6a+_0x4ce93d(0x21b)+(_0x531d6a===0x1?'':'s')+'\x20'+(_0x531d6a===0x1?_0x4ce93d(0x20c):'require')+_0x4ce93d(0x1f5));if(_0x3a18d4>0x0)_0x1202ec[_0x4ce93d(0x24c)](_0x3a18d4+_0x4ce93d(0x1fb));return _0x1202ec[_0x4ce93d(0x219)](',\x20');}async function hasUnsyncedLocalChanges(_0x497ec8,_0x96ac7c,_0x1f7693){const _0x544482=a43_0x1c3654;if(!await fileExists(_0x497ec8))return![];const _0x3892eb=await computeFileHash(_0x497ec8);if(!_0x96ac7c)return _0x1f7693?_0x3892eb!==_0x1f7693:!![];return _0x3892eb!==_0x96ac7c[_0x544482(0x24a)];}function createPullFileTransaction(){const _0x5b58fd=new Map(),_0x94881e=async(_0x42b64e,_0x3b5e2c)=>{const _0x4dbb05=a43_0x1da4;try{if(_0x3b5e2c['existed'])await ensureParentDirectory(_0x42b64e),await writeFile(_0x42b64e,_0x3b5e2c[_0x4dbb05(0x24e)]);else try{await unlink(_0x42b64e);}catch(_0x17beeb){if(_0x17beeb['code']!=='ENOENT')throw _0x17beeb;}return undefined;}catch(_0x596a7d){return _0x596a7d instanceof Error?_0x596a7d:new Error(String(_0x596a7d));}};return{async 'write'(_0x3382a2,_0x1f8241){const _0x1410f3=a43_0x1da4;if(!_0x5b58fd['has'](_0x3382a2))try{_0x5b58fd[_0x1410f3(0x241)](_0x3382a2,{'existed':!![],'content':await readFile(_0x3382a2)});}catch(_0x4b54db){if(_0x4b54db[_0x1410f3(0x207)]!==_0x1410f3(0x1ed))throw _0x4b54db;_0x5b58fd['set'](_0x3382a2,{'existed':![]});}try{await ensureParentDirectory(_0x3382a2),await writeFile(_0x3382a2,_0x1f8241,'utf8');}catch(_0x318824){const _0x13fede=await _0x94881e(_0x3382a2,_0x5b58fd[_0x1410f3(0x203)](_0x3382a2));if(!_0x13fede)_0x5b58fd[_0x1410f3(0x1f1)](_0x3382a2);throw withRollbackErrors(_0x318824,'Failed\x20to\x20write\x20local\x20script\x20\x22'+_0x3382a2+'\x22.',_0x13fede?[_0x13fede]:[]);}},async 'rollback'(){const _0x1167e8=a43_0x1da4,_0x25727b=[];for(const [_0x443352,_0x2a1fcd]of[..._0x5b58fd['entries']()][_0x1167e8(0x232)]()){const _0x2b83ac=await _0x94881e(_0x443352,_0x2a1fcd);_0x2b83ac&&_0x25727b['push'](new Error(_0x1167e8(0x239)+_0x443352+_0x1167e8(0x25b)+_0x2b83ac[_0x1167e8(0x21c)]));}return _0x25727b;}};}function withRollbackErrors(_0x3481fb,_0x4a268f,_0x502801){const _0x4c9716=a43_0x1c3654,_0x200090=_0x3481fb instanceof Error?_0x3481fb:new Error(String(_0x3481fb));if(_0x502801[_0x4c9716(0x248)]===0x0)return _0x200090;return new AggregateError([_0x200090,..._0x502801],_0x4a268f+_0x4c9716(0x1d5)+_0x502801[_0x4c9716(0x22c)](_0x5a0e90=>_0x5a0e90[_0x4c9716(0x21c)])[_0x4c9716(0x219)](';\x20'));}function buildDatasetCodeToAliasMap(_0x13a4d1,_0xb4003,_0x10aed5){const _0x3043f9=a43_0x1c3654,_0x465c62=resolveApiModelSource(_0x13a4d1,_0xb4003,_0x10aed5),_0x323a62=loadAliasMap(_0x13a4d1,undefined,_0x465c62[_0x3043f9(0x23f)],_0x465c62[_0x3043f9(0x225)]);return assertUnambiguousHookAliases(_0x323a62),new Map(_0x323a62[_0x3043f9(0x22c)](_0xe07cb=>[_0xe07cb[_0x3043f9(0x238)][_0x3043f9(0x1d9)](),_0xe07cb['alias']]));}async function planHookDirectoryMigration(_0x1c5cc3,_0x129f6c,_0xdf2ad3,_0xac8e8a){const _0x693d1f=a43_0x1c3654,_0x57dc20=new Map();for(const [_0x14e4e0,_0x26c282]of Object['entries'](_0x129f6c['functions'])){const [_0x55bd18,_0x19a866,_0x10b64e,_0x13554a,_0x1843fe,..._0x1a19ad]=_0x14e4e0[_0x693d1f(0x1ea)]('/');if(_0x55bd18!==_0x693d1f(0x209)||!_0x19a866||!_0x10b64e||!_0x13554a||!_0x1843fe||_0x1a19ad[_0x693d1f(0x248)]>0x0||!_0x26c282[_0x693d1f(0x238)])continue;const _0x55c374=_0xdf2ad3[_0x693d1f(0x203)](_0x26c282[_0x693d1f(0x238)][_0x693d1f(0x1d9)]()),_0x1294db=_0x55c374??_0x26c282[_0x693d1f(0x238)];if(!isSafeHookDirectorySegment(_0x19a866))throw CliErrors[_0x693d1f(0x250)](_0x693d1f(0x254)+_0x19a866+_0x693d1f(0x1ee));if(!isSafeHookDirectorySegment(_0x1294db))throw CliErrors[_0x693d1f(0x250)](_0x693d1f(0x1c6)+_0x19a866+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x19a866===_0x1294db)continue;const _0x497d47=_0x57dc20[_0x693d1f(0x203)](_0x19a866)??{'datasetCode':_0x26c282[_0x693d1f(0x238)],'alias':_0x55c374,'keyChanges':[]};if(_0x497d47[_0x693d1f(0x238)]!==_0x26c282['datasetCode'])throw CliErrors[_0x693d1f(0x250)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x19a866+_0x693d1f(0x214));const _0xda0eb9='HOOK/'+_0x1294db+'/'+_0x10b64e+'/'+_0x13554a+'/'+_0x1843fe;try{resolveLocalFilePathFromLockKey(_0x1c5cc3,_0x14e4e0),resolveLocalFilePathFromLockKey(_0x1c5cc3,_0xda0eb9);}catch(_0x34e0cb){throw CliErrors['validation'](_0x693d1f(0x1cc)+_0x14e4e0+'\x22:\x20'+(_0x34e0cb instanceof Error?_0x34e0cb[_0x693d1f(0x21c)]:String(_0x34e0cb)));}_0x497d47[_0x693d1f(0x1db)][_0x693d1f(0x24c)]({'oldLockKey':_0x14e4e0,'newLockKey':_0xda0eb9,'entry':_0x26c282}),_0x57dc20[_0x693d1f(0x241)](_0x19a866,_0x497d47);}const _0x4efd39=new Set([..._0x57dc20[_0x693d1f(0x1df)]()][_0x693d1f(0x234)](_0x588f8f=>_0x588f8f[_0x693d1f(0x1db)][_0x693d1f(0x22c)](_0x2c2cde=>_0x2c2cde[_0x693d1f(0x21a)]))),_0x4973fc=new Map(),_0x2cd365=new Map();for(const [_0x55dc5d,_0x50cb5]of _0x57dc20){const _0x2ccd1e=_0x50cb5[_0x693d1f(0x23c)]??_0x50cb5['datasetCode'],_0x4320b1=hookDirectoryIdentity(_0x2ccd1e),_0x4162b8=_0x4973fc[_0x693d1f(0x203)](_0x4320b1);if(_0x4162b8&&_0x4162b8!==_0x55dc5d)throw CliErrors[_0x693d1f(0x250)](_0x693d1f(0x235)+_0x4162b8+_0x693d1f(0x1e2)+_0x55dc5d+_0x693d1f(0x1d2)+_0x2ccd1e+_0x693d1f(0x1ff));_0x4973fc['set'](_0x4320b1,_0x55dc5d);for(const _0x326ba2 of _0x50cb5[_0x693d1f(0x1db)]){const _0x52fcbb=_0x2cd365[_0x693d1f(0x203)](_0x326ba2[_0x693d1f(0x226)]);if(_0x52fcbb&&_0x52fcbb!==_0x326ba2[_0x693d1f(0x21a)])throw CliErrors['validation'](_0x693d1f(0x223)+_0x52fcbb+_0x693d1f(0x1e2)+_0x326ba2[_0x693d1f(0x21a)]+_0x693d1f(0x1d2)+_0x326ba2[_0x693d1f(0x226)]+_0x693d1f(0x1e5));if(_0x4efd39['has'](_0x326ba2[_0x693d1f(0x226)]))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x326ba2['oldLockKey']+_0x693d1f(0x21d)+_0x326ba2[_0x693d1f(0x226)]+_0x693d1f(0x1cd));_0x2cd365['set'](_0x326ba2[_0x693d1f(0x226)],_0x326ba2[_0x693d1f(0x21a)]);}}const _0x276c57=new Map();for(const [_0x414a7b,_0x355289]of _0xdf2ad3){_0x276c57['set'](hookDirectoryIdentity(_0x355289),_0x414a7b);}const _0x240b44=[];for(const [_0x401da0,_0x3b71b4]of _0x57dc20){const _0x1f8dd2=_0x3b71b4['alias']??_0x3b71b4['datasetCode'],_0x2487e9=join(_0x1c5cc3[_0x693d1f(0x215)],'HOOK',_0x401da0),_0x15cf01=join(_0x1c5cc3[_0x693d1f(0x215)],_0x693d1f(0x209),_0x1f8dd2),_0xec51cc=await directoryExists(_0x2487e9),_0x3618a5=await directoryExists(_0x15cf01),_0x2bf801=_0xec51cc?_0x3618a5?await sameDirectory(_0x2487e9,_0x15cf01)?_0x693d1f(0x205):undefined:_0x693d1f(0x1d4):_0x693d1f(0x1c4);if(!_0x2bf801)throw CliErrors['validation'](_0x693d1f(0x1c6)+_0x401da0+_0x693d1f(0x244)+_0x1f8dd2+'\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.');const _0x1a031b=_0x276c57[_0x693d1f(0x203)](hookDirectoryIdentity(_0x401da0));if(_0x1a031b&&_0x1a031b!==_0x3b71b4[_0x693d1f(0x238)][_0x693d1f(0x1d9)]()){const _0xeb6e78=new Set(_0x3b71b4[_0x693d1f(0x1db)][_0x693d1f(0x22c)](_0x191bcd=>_0x191bcd[_0x693d1f(0x21a)])),_0x2beabe=_0xac8e8a[_0x693d1f(0x20b)](_0x2d38ad=>_0x2d38ad['type']==='HOOK'&&_0x2d38ad[_0x693d1f(0x23c)]!=null&&hookDirectoryIdentity(_0x2d38ad[_0x693d1f(0x23c)])===hookDirectoryIdentity(_0x401da0)&&!_0xeb6e78[_0x693d1f(0x237)](_0x2d38ad['lockKey']));if(_0x2beabe['length']>0x0)throw CliErrors[_0x693d1f(0x250)](_0x693d1f(0x1c6)+_0x401da0+_0x693d1f(0x230));}const _0x453822=_0x276c57[_0x693d1f(0x203)](hookDirectoryIdentity(_0x1f8dd2));if(_0x453822&&_0x453822!==_0x3b71b4[_0x693d1f(0x238)][_0x693d1f(0x1d9)]())throw CliErrors[_0x693d1f(0x250)](_0x693d1f(0x1c6)+_0x401da0+_0x693d1f(0x244)+_0x1f8dd2+_0x693d1f(0x259));for(const _0x4016e1 of _0x3b71b4['keyChanges']){const _0x13aeec=_0x129f6c[_0x693d1f(0x23e)][_0x4016e1[_0x693d1f(0x226)]];if(_0x13aeec&&!_0x4efd39[_0x693d1f(0x237)](_0x4016e1[_0x693d1f(0x226)])&&!sameHookIdentity(_0x4016e1['entry'],_0x13aeec))throw CliErrors[_0x693d1f(0x250)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x401da0+_0x693d1f(0x244)+_0x1f8dd2+_0x693d1f(0x221));}_0x240b44[_0x693d1f(0x24c)]({'oldDirectory':_0x401da0,'newDirectory':_0x1f8dd2,'oldDirectoryPath':_0x2487e9,'newDirectoryPath':_0x15cf01,'mode':_0x2bf801,'alias':_0x3b71b4[_0x693d1f(0x23c)],'keyChanges':_0x3b71b4[_0x693d1f(0x1db)]});}const _0x191e04={..._0x129f6c['functions']},_0x3f6b21=new Map(),_0x83a8ce=new Map();for(const _0x51e971 of _0x240b44){const _0x38e0c7=_0x51e971[_0x693d1f(0x1f8)]!==_0x693d1f(0x1c4);_0x38e0c7&&_0x83a8ce[_0x693d1f(0x241)](hookDirectoryIdentity(_0x51e971[_0x693d1f(0x23b)]),_0x51e971[_0x693d1f(0x231)]);for(const _0x4a433f of _0x51e971[_0x693d1f(0x1db)]){const _0x189ffb=_0x191e04[_0x4a433f[_0x693d1f(0x226)]],_0x31e357=_0x38e0c7?_0x4a433f[_0x693d1f(0x1e1)]:_0x189ffb??_0x4a433f['entry'];_0x191e04[_0x4a433f[_0x693d1f(0x226)]]=canonicalizeHookEntry(_0x31e357,_0x51e971['alias']),delete _0x191e04[_0x4a433f[_0x693d1f(0x21a)]],_0x38e0c7&&_0x3f6b21[_0x693d1f(0x241)](_0x4a433f[_0x693d1f(0x226)],resolveLocalFilePathFromLockKey(_0x1c5cc3,_0x4a433f[_0x693d1f(0x21a)]));}}return{'migrations':_0x240b44,'projectedFunctions':_0x191e04,'sourceFilePathByNewLockKey':_0x3f6b21,'sourceDirectoryPathByNewDirectory':_0x83a8ce};}function resolveMigratedSourceFilePath(_0x1d48d1,_0x39aa7a){const _0x646ca7=a43_0x1c3654;if(!_0x1d48d1||!_0x39aa7a)return undefined;const _0x131232=_0x1d48d1[_0x646ca7(0x240)][_0x646ca7(0x203)](_0x39aa7a['lockKey']);if(_0x131232)return _0x131232;if(_0x39aa7a[_0x646ca7(0x1fa)]!==_0x646ca7(0x209))return undefined;const [,_0x592dd0,..._0x4b22ec]=_0x39aa7a[_0x646ca7(0x1fd)][_0x646ca7(0x1ea)]('/');if(!_0x592dd0||_0x4b22ec[_0x646ca7(0x248)]===0x0)return undefined;const _0x408565=_0x1d48d1['sourceDirectoryPathByNewDirectory'][_0x646ca7(0x203)](hookDirectoryIdentity(_0x592dd0));return _0x408565?join(_0x408565,..._0x4b22ec)+_0x646ca7(0x204):undefined;}function sameHookIdentity(_0x47f1b0,_0x519dda){const _0x1e42fb=a43_0x1c3654;return _0x47f1b0[_0x1e42fb(0x258)]===_0x519dda[_0x1e42fb(0x258)]&&_0x47f1b0[_0x1e42fb(0x238)]===_0x519dda[_0x1e42fb(0x238)]&&_0x47f1b0[_0x1e42fb(0x23d)]===_0x519dda[_0x1e42fb(0x23d)]&&_0x47f1b0[_0x1e42fb(0x229)]===_0x519dda['functionNode'];}function canonicalizeHookEntry(_0x1a61cd,_0x2b800b){const {alias:_0x43a919,..._0x120375}=_0x1a61cd;return _0x2b800b?{..._0x120375,'alias':_0x2b800b}:_0x120375;}function hookDirectoryIdentity(_0x338dff){const _0x1ce4c8=a43_0x1c3654;return _0x338dff[_0x1ce4c8(0x1cf)](_0x1ce4c8(0x1f4))['toLowerCase']();}function isSafeHookDirectorySegment(_0x324c96){return isSafeLockKeySegment(_0x324c96);}async function sameDirectory(_0x1f6fbf,_0x4891a4){const _0x22f76b=a43_0x1c3654,[_0x1625d9,_0x35960f]=await Promise[_0x22f76b(0x1eb)]([stat(_0x1f6fbf),stat(_0x4891a4)]);return _0x1625d9[_0x22f76b(0x1e4)]===_0x35960f[_0x22f76b(0x1e4)]&&_0x1625d9['ino']===_0x35960f[_0x22f76b(0x211)];}async function applyHookDirectoryMigration(_0x1cba2e,_0x88163b){const _0x488e6a=a43_0x1c3654,_0x42ce40=_0x88163b['functions'],_0x5b6780=_0x88163b[_0x488e6a(0x222)],_0x291646=[],_0xc4ab7c=async()=>{const _0x15f89d=_0x488e6a,_0x3fca0c=[];_0x88163b[_0x15f89d(0x23e)]=_0x42ce40,_0x88163b[_0x15f89d(0x222)]=_0x5b6780;for(const {migration:_0x1a658d,temporaryPath:_0x2dae7b}of[..._0x291646][_0x15f89d(0x232)]()){try{_0x2dae7b?(await rename(_0x1a658d['newDirectoryPath'],_0x2dae7b),await rename(_0x2dae7b,_0x1a658d['oldDirectoryPath'])):await rename(_0x1a658d['newDirectoryPath'],_0x1a658d[_0x15f89d(0x231)]);}catch(_0x45e6be){_0x3fca0c[_0x15f89d(0x24c)](new Error(_0x15f89d(0x20e)+_0x1a658d[_0x15f89d(0x1ca)]+_0x15f89d(0x249)+_0x1a658d['newDirectory']+'\x22:\x20'+(_0x45e6be instanceof Error?_0x45e6be[_0x15f89d(0x21c)]:String(_0x45e6be))));}}return _0x3fca0c;};try{for(const _0x2dc727 of _0x1cba2e['migrations']){if(_0x2dc727[_0x488e6a(0x1f8)]===_0x488e6a(0x1d4))await ensureParentDirectory(_0x2dc727['newDirectoryPath']),await rename(_0x2dc727[_0x488e6a(0x231)],_0x2dc727[_0x488e6a(0x210)]),_0x291646[_0x488e6a(0x24c)]({'migration':_0x2dc727});else{if(_0x2dc727[_0x488e6a(0x1f8)]===_0x488e6a(0x205)){const _0x484d07=join(dirname(_0x2dc727[_0x488e6a(0x231)]),_0x488e6a(0x224)+randomUUID());await rename(_0x2dc727[_0x488e6a(0x231)],_0x484d07);try{await rename(_0x484d07,_0x2dc727[_0x488e6a(0x210)]);}catch(_0x191ed4){try{await rename(_0x484d07,_0x2dc727[_0x488e6a(0x231)]);}catch(_0x5c4c79){throw withRollbackErrors(_0x191ed4,_0x488e6a(0x255)+_0x2dc727[_0x488e6a(0x1ca)]+_0x488e6a(0x244)+_0x2dc727[_0x488e6a(0x23b)]+_0x488e6a(0x1f7)+_0x484d07+_0x488e6a(0x1e3),[new Error(_0x488e6a(0x25a)+_0x484d07+'\x22\x20to\x20\x22'+_0x2dc727['oldDirectory']+_0x488e6a(0x25b)+(_0x5c4c79 instanceof Error?_0x5c4c79[_0x488e6a(0x21c)]:String(_0x5c4c79)))]);}throw _0x191ed4;}_0x291646[_0x488e6a(0x24c)]({'migration':_0x2dc727,'temporaryPath':_0x484d07});}}}return _0x88163b[_0x488e6a(0x23e)]=_0x1cba2e[_0x488e6a(0x246)],{'rollback':_0xc4ab7c};}catch(_0x425b69){const _0x2fc7a7=await _0xc4ab7c();throw withRollbackErrors(_0x425b69,_0x488e6a(0x243),_0x2fc7a7);}}async function confirmForce(){const _0x458b1f=a43_0x1c3654,_0x42b064=createInterface({'input':process[_0x458b1f(0x227)],'output':process[_0x458b1f(0x20a)]}),_0x57188b=await new Promise(_0x53a7ad=>{const _0x4d2f79=_0x458b1f;_0x42b064[_0x4d2f79(0x245)](_0x4d2f79(0x1f2),_0x53a7ad);});return _0x42b064['close'](),['y','yes'][_0x458b1f(0x212)](_0x57188b[_0x458b1f(0x1d8)]()['toLowerCase']());}
|
|
1
|
+
const a43_0x3d35be=a43_0x73b8;(function(_0x4aa9d1,_0x4a3ca4){const _0x5408e2=a43_0x73b8,_0x443e20=_0x4aa9d1();while(!![]){try{const _0x454527=-parseInt(_0x5408e2(0xb6))/0x1+parseInt(_0x5408e2(0x11d))/0x2*(parseInt(_0x5408e2(0xcf))/0x3)+parseInt(_0x5408e2(0x118))/0x4*(-parseInt(_0x5408e2(0x115))/0x5)+parseInt(_0x5408e2(0xc0))/0x6*(-parseInt(_0x5408e2(0xec))/0x7)+parseInt(_0x5408e2(0x10b))/0x8*(parseInt(_0x5408e2(0xcb))/0x9)+-parseInt(_0x5408e2(0x121))/0xa+parseInt(_0x5408e2(0xe6))/0xb;if(_0x454527===_0x4a3ca4)break;else _0x443e20['push'](_0x443e20['shift']());}catch(_0x269244){_0x443e20['push'](_0x443e20['shift']());}}}(a43_0x79aa,0x86908));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';function a43_0x73b8(_0x237e92,_0x209179){_0x237e92=_0x237e92-0xb1;const _0x79aa3e=a43_0x79aa();let _0x73b860=_0x79aa3e[_0x237e92];return _0x73b860;}import{BFF_LIST_PAGE_SIZE,listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.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';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':a43_0x3d35be(0xe2),'command':a43_0x3d35be(0x108),'description':a43_0x3d35be(0x146),'risk':a43_0x3d35be(0xb3),'structuredErrors':!![],'flags':[{'name':a43_0x3d35be(0x139),'type':a43_0x3d35be(0x12c),'description':a43_0x3d35be(0x102),'enum':['COMMON','ENDPOINT',a43_0x3d35be(0x13f)]},{'name':a43_0x3d35be(0xed),'type':a43_0x3d35be(0xd5),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x1262bc){const _0xf10050=a43_0x3d35be,_0x432ed0=loadBffProjectConfig(_0x1262bc[_0xf10050(0x132)]),_0x105fd7=await readBffLockFile(_0x432ed0[_0xf10050(0xd7)]),{appLock:_0x2feb73}=ensureLockScope(_0x105fd7??createEmptyBffLock(),_0x1262bc[_0xf10050(0x132)],_0x432ed0[_0xf10050(0x111)],'pull'),_0x154cec=normalizeBffType(_0x1262bc[_0xf10050(0xba)]('type'))??undefined,[_0x44f433,_0x2d09fd]=await Promise[_0xf10050(0xbd)]([listBffScripts(_0x1262bc[_0xf10050(0x132)],_0x154cec),getBffScriptStatistics(_0x1262bc['appCode'])]),_0x22afbd=_0x44f433[_0xf10050(0x12f)](_0x48f9e7=>normalizeBffType(_0x48f9e7[_0xf10050(0xb2)])==='HOOK'),_0x4873f3=_0x22afbd?buildDatasetCodeToAliasMap(_0x1262bc[_0xf10050(0x112)],_0x1262bc[_0xf10050(0x132)],_0x1262bc[_0xf10050(0x104)]||_0x1262bc[_0xf10050(0x109)]?.[_0xf10050(0xd9)]||_0x1262bc[_0xf10050(0x109)]?.[_0xf10050(0xca)]):new Map(),_0x55f45f=_0x22afbd?await planHookDirectoryMigration(_0x432ed0,_0x2feb73,_0x4873f3,await scanLocalBffFunctions(_0x432ed0,'HOOK')):undefined,_0x46d321=createHookLocationMap(_0x2d09fd),_0x2e3f00=[];for(const _0x293d23 of _0x44f433){const _0x504de=resolveRemoteScriptTarget(_0x432ed0,_0x293d23,_0x46d321,_0x55f45f?.['projectedFunctions']??_0x2feb73['functions'],_0x4873f3);if(!_0x504de){_0x2e3f00['push']({'scriptType':_0x293d23[_0xf10050(0xb2)],'functionName':_0x293d23[_0xf10050(0x13a)]??'','status':_0xf10050(0x128),'reason':_0xf10050(0x130)});continue;}const _0x40dfc4=(_0x55f45f?.[_0xf10050(0xde)]??_0x2feb73['functions'])[_0x504de['lockKey']],_0x507384=_0x293d23[_0xf10050(0x12d)]!=null?computeContentHash(_0x293d23[_0xf10050(0x12d)]):undefined,_0x580892=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x55f45f,_0x504de)??_0x504de[_0xf10050(0x113)],_0x40dfc4,_0x507384),_0x2c8b12=_0x580892?localUnsyncedConflict(_0x504de,_0x293d23['id']):undefined;_0x2e3f00[_0xf10050(0xce)]({'lockKey':_0x504de[_0xf10050(0x11c)],'filePath':_0x504de[_0xf10050(0x113)],'remoteId':_0x293d23['id']??null,'status':_0x2c8b12?_0xf10050(0x13c):'would_pull',..._0x2c8b12?{'conflict':_0x2c8b12}:{},..._0x504de['hookLocation']?{'alias':_0x504de['hookLocation'][_0xf10050(0xf8)]??null,'datasetCode':_0x504de[_0xf10050(0x125)][_0xf10050(0xef)],'operationType':_0x504de[_0xf10050(0x125)]['operationType'],'functionNode':_0x504de[_0xf10050(0x125)]['functionNode']}:{}});}return{'method':_0xf10050(0x133),'url':_0xf10050(0xdc)+_0x1262bc[_0xf10050(0x132)]+(_0x154cec?_0xf10050(0x131)+_0x154cec:'')+_0xf10050(0x119)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x1262bc[_0xf10050(0x132)],'filterType':_0x154cec??null,..._0x55f45f&&_0x55f45f[_0xf10050(0x110)][_0xf10050(0x10c)]>0x0?{'hookDirectoryMigrations':_0x55f45f[_0xf10050(0x110)][_0xf10050(0xbc)](_0x5ba4a7=>({'from':_0x5ba4a7[_0xf10050(0xfe)],'to':_0x5ba4a7[_0xf10050(0x142)]}))}:{},'files':_0x2e3f00},'description':_0xf10050(0xdf)+_0x2e3f00[_0xf10050(0x10c)]+_0xf10050(0x123)};},async 'execute'(_0x41be60){const _0x309960=a43_0x3d35be,_0x110a84=loadBffProjectConfig(_0x41be60[_0x309960(0x132)]),_0x191d45=await readBffLockFile(_0x110a84['lockFilePath']),{lockData:_0x132958,appLock:_0x53851b}=ensureLockScope(_0x191d45??createEmptyBffLock(),_0x41be60[_0x309960(0x132)],_0x110a84[_0x309960(0x111)],_0x309960(0x108)),_0x182daf=normalizeBffType(_0x41be60[_0x309960(0xba)](_0x309960(0x139)))??undefined;if(_0x41be60[_0x309960(0xba)](_0x309960(0x139))&&!_0x182daf)throw CliErrors[_0x309960(0x10a)](_0x309960(0xdb));const [_0x3610d5,_0x303257]=await Promise['all']([listBffScripts(_0x41be60[_0x309960(0x132)],_0x182daf),getBffScriptStatistics(_0x41be60[_0x309960(0x132)])]);if(_0x3610d5[_0x309960(0x10c)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0x54a4cd=_0x41be60[_0x309960(0xc1)](_0x309960(0xed));if(_0x54a4cd&&!_0x41be60['nonInteractive']){const _0x15d477=await confirmForce();if(!_0x15d477)throw CliErrors[_0x309960(0xf4)](_0x309960(0xfa));}if(_0x54a4cd&&_0x41be60[_0x309960(0xfc)]){}const _0x3c0e5a=_0x3610d5[_0x309960(0x12f)](_0x199cf6=>normalizeBffType(_0x199cf6[_0x309960(0xb2)])==='HOOK'),_0x439d39=_0x3c0e5a?buildDatasetCodeToAliasMap(_0x41be60[_0x309960(0x112)],_0x41be60['appCode'],_0x41be60[_0x309960(0x104)]||_0x41be60[_0x309960(0x109)]?.[_0x309960(0xd9)]||_0x41be60[_0x309960(0x109)]?.[_0x309960(0xca)]):new Map(),_0x3b4459=createHookLocationMap(_0x303257),_0x42dcba=JSON[_0x309960(0xf2)](JSON[_0x309960(0x129)](_0x132958)),_0x33a04b=_0x41be60[_0x309960(0x132)],_0x4f9909=_0x42dcba[_0x309960(0xd4)][_0x33a04b];if(!_0x4f9909)throw new Error(_0x309960(0xcc)+_0x33a04b+_0x309960(0x12a));const _0x4669f2=_0x3c0e5a?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x110a84,_0x4f9909,_0x439d39,await scanLocalBffFunctions(_0x110a84,_0x309960(0x13f))),_0x4f9909):undefined,_0x3f08e9=createPullFileTransaction(),_0x505331=[],_0x795c8b=[],_0x583dac=[],_0x5596c0=[];for(const _0x4730b9 of _0x3610d5){const _0x4d0aea=resolveRemoteScriptTarget(_0x110a84,_0x4730b9,_0x3b4459,_0x4f9909[_0x309960(0xd8)],_0x439d39);if(!_0x4d0aea){_0x795c8b[_0x309960(0xce)]({'lockKey':_0x4730b9['scriptType']+'/'+_0x4730b9['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x164084=_0x4f9909['functions'][_0x4d0aea[_0x309960(0x11c)]];try{if(!_0x4730b9['id'])throw new Error(_0x309960(0xd2));if(_0x4730b9[_0x309960(0x12d)]==null)throw new Error(_0x309960(0x120));const _0x249360=_0x4730b9[_0x309960(0x12d)],_0x362b98=computeContentHash(_0x249360);if(!_0x54a4cd){const _0x260d44=await hasUnsyncedLocalChanges(_0x4d0aea[_0x309960(0x113)],_0x164084,_0x362b98);if(_0x260d44){_0x583dac[_0x309960(0xce)](localUnsyncedConflict(_0x4d0aea,_0x4730b9['id']));continue;}}await _0x3f08e9[_0x309960(0x140)](_0x4d0aea['filePath'],_0x249360);const _0x4e5fc3={'hash':_0x362b98,'remoteId':_0x4730b9['id'],'version':_0x4730b9[_0x309960(0xf9)]};_0x4d0aea['type']===_0x309960(0x13f)&&_0x4d0aea[_0x309960(0x125)]&&(_0x4e5fc3[_0x309960(0xf8)]=_0x4d0aea['hookLocation'][_0x309960(0xf8)],_0x4e5fc3[_0x309960(0xef)]=_0x4d0aea[_0x309960(0x125)][_0x309960(0xef)],_0x4e5fc3[_0x309960(0xb5)]=_0x4d0aea[_0x309960(0x125)][_0x309960(0xb5)],_0x4e5fc3[_0x309960(0xe4)]=_0x4d0aea[_0x309960(0x125)][_0x309960(0xe4)]),_0x4f9909[_0x309960(0xd8)][_0x4d0aea[_0x309960(0x11c)]]=_0x4e5fc3,_0x505331[_0x309960(0xce)]({'lockKey':_0x4d0aea['lockKey'],'remoteId':_0x4730b9['id']});}catch(_0x2f3988){_0x5596c0[_0x309960(0xce)]({'lockKey':_0x4d0aea['lockKey'],'error':_0x2f3988 instanceof Error?_0x2f3988[_0x309960(0x145)]:String(_0x2f3988)});}}_0x4f9909['lastSync']=new Date()[_0x309960(0x117)]();try{await writeBffLockFile(_0x110a84[_0x309960(0xd7)],_0x42dcba);}catch(_0x44ad0e){const _0x21215a=[...await _0x3f08e9['rollback'](),...await _0x4669f2?.[_0x309960(0xf1)]()??[]];throw withRollbackErrors(_0x44ad0e,_0x309960(0x10f),_0x21215a);}return{'ok':_0x5596c0[_0x309960(0x10c)]===0x0,'data':{'pulled':_0x505331,'skipped':_0x795c8b,'conflicts':_0x583dac,'failed':_0x5596c0},'message':formatPullMessage(_0x505331[_0x309960(0x10c)],_0x795c8b['length'],_0x583dac[_0x309960(0x10c)],_0x5596c0['length'])};}};function a43_0x79aa(){const _0x25a467=['scriptType','read','set','operationType','492346ywSScI','\x20--name\x20','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','\x22\x20may\x20remain.','str','content','map','all','ino','require','993666AQzaiu','bool','\x20pulled','move','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','entries','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','stdin','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','sourceFilePathByNewLockKey','defaultApp','200493spKYkb','Lock\x20scope\x20for\x20app\x20\x22','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','push','1464591cSaQIn','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','remoteId','Remote\x20script\x20missing\x20id.','Could\x20not\x20restore\x20local\x20script\x20\x22','apps','boolean','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','lockFilePath','functions','currentApp','\x20failed','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','/api/management/library/scripts/list?appCode=','case-rename','projectedFunctions','Would\x20inspect\x20','\x22;\x20temporary\x20directory\x20\x22','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','bff','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','functionNode','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','4617624fSloLF','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.','delete','yes','Failed\x20to\x20write\x20local\x20script\x20\x22','stderr','7iyVyFJ','force','trim','datasetCode','\x20conflict','rollback','parse','toLowerCase','cancelled','requires','ENOENT','\x22\x20to\x20\x22','alias','version','Force\x20pull\x20cancelled.','split','nonInteractive','.hook-directory-migrate-','oldDirectory','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','has','entry','Pull\x20only\x20this\x20script\x20type','\x22:\x20','selectedAppName','oldDirectoryPath','question','Pull\x20complete:\x20','pull','mergedCli','validation','256gKfbSU','length','scriptsRootDir','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','migrations','scriptsRoot','apiDir','filePath','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','603870ULNEkf','get','toISOString','24GFqhhu','¤tPage=1&pageSize=','reverse','HOOK/','lockKey','4tuAzGU','\x22\x20from\x20\x22','newDirectoryPath','Remote\x20script\x20missing\x20content.','1752650BUXvEn','flatMap','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','lastSync','hookLocation','dev','normalize','skipped','stringify','\x22\x20not\x20found\x20after\x20ensureLockScope.','mode','string','scriptContent','newLockKey','some','unresolvable\x20target\x20path','&type=','appCode','GET','sourceDirectoryPathByNewDirectory','keyChanges','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','\x22:\x20both\x20target\x20\x22','join','type','functionName','values','conflict','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','close','HOOK','write','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','newDirectory','push_local','oldLockKey','message','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','code'];a43_0x79aa=function(){return _0x25a467;};return a43_0x79aa();}function localUnsyncedConflict(_0x5684bb,_0x151bba){const _0x4f1b70=a43_0x3d35be,_0x5997b7=_0x5684bb[_0x4f1b70(0x11c)][_0x4f1b70(0xfb)]('/')['at'](-0x1);return{'code':'BFF_LOCAL_UNSYNCED','lockKey':_0x5684bb[_0x4f1b70(0x11c)],'filePath':_0x5684bb[_0x4f1b70(0x113)],..._0x151bba!=null?{'remoteId':_0x151bba}:{},'message':'Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','nextAction':{'action':_0x4f1b70(0x143),'command':CLI_BIN_NAME+'\x20bff\x20push\x20--type\x20'+_0x5684bb[_0x4f1b70(0x139)]+_0x4f1b70(0xb7)+_0x5997b7+'\x20--format\x20compress','requiresReview':!![],'message':_0x4f1b70(0xe7)}};}function formatPullMessage(_0x39ba64,_0x2dee51,_0x20ad36,_0x61702c){const _0x48ac2f=a43_0x3d35be,_0x52bf5c=[_0x48ac2f(0x107)+_0x39ba64+_0x48ac2f(0xc2),_0x2dee51+'\x20skipped'];_0x20ad36>0x0&&_0x52bf5c[_0x48ac2f(0xce)](_0x20ad36+_0x48ac2f(0xf0)+(_0x20ad36===0x1?'':'s')+'\x20'+(_0x20ad36===0x1?_0x48ac2f(0xf5):_0x48ac2f(0xbf))+'\x20resolution');if(_0x61702c>0x0)_0x52bf5c[_0x48ac2f(0xce)](_0x61702c+_0x48ac2f(0xda));return _0x52bf5c[_0x48ac2f(0x138)](',\x20');}async function hasUnsyncedLocalChanges(_0x4322ce,_0x46a90d,_0x1c4a86){if(!await fileExists(_0x4322ce))return![];const _0x155273=await computeFileHash(_0x4322ce);if(!_0x46a90d)return _0x1c4a86?_0x155273!==_0x1c4a86:!![];return _0x155273!==_0x46a90d['hash'];}function createPullFileTransaction(){const _0x23c938=new Map(),_0xc6859a=async(_0x1c727f,_0x236bbf)=>{const _0x30743c=a43_0x73b8;try{if(_0x236bbf['existed'])await ensureParentDirectory(_0x1c727f),await writeFile(_0x1c727f,_0x236bbf[_0x30743c(0xbb)]);else try{await unlink(_0x1c727f);}catch(_0x5669fa){if(_0x5669fa[_0x30743c(0xb1)]!==_0x30743c(0xf6))throw _0x5669fa;}return undefined;}catch(_0x228946){return _0x228946 instanceof Error?_0x228946:new Error(String(_0x228946));}};return{async 'write'(_0x448719,_0x274fac){const _0x46ae6b=a43_0x73b8;if(!_0x23c938[_0x46ae6b(0x100)](_0x448719))try{_0x23c938[_0x46ae6b(0xb4)](_0x448719,{'existed':!![],'content':await readFile(_0x448719)});}catch(_0x2f410f){if(_0x2f410f['code']!==_0x46ae6b(0xf6))throw _0x2f410f;_0x23c938['set'](_0x448719,{'existed':![]});}try{await ensureParentDirectory(_0x448719),await writeFile(_0x448719,_0x274fac,'utf8');}catch(_0x2a21dc){const _0x2662be=await _0xc6859a(_0x448719,_0x23c938[_0x46ae6b(0x116)](_0x448719));if(!_0x2662be)_0x23c938[_0x46ae6b(0xe8)](_0x448719);throw withRollbackErrors(_0x2a21dc,_0x46ae6b(0xea)+_0x448719+'\x22.',_0x2662be?[_0x2662be]:[]);}},async 'rollback'(){const _0x11dc36=a43_0x73b8,_0x405c86=[];for(const [_0x4e2650,_0x191860]of[..._0x23c938[_0x11dc36(0xc5)]()]['reverse']()){const _0x4a88cd=await _0xc6859a(_0x4e2650,_0x191860);_0x4a88cd&&_0x405c86[_0x11dc36(0xce)](new Error(_0x11dc36(0xd3)+_0x4e2650+_0x11dc36(0x103)+_0x4a88cd[_0x11dc36(0x145)]));}return _0x405c86;}};}function withRollbackErrors(_0x316f46,_0x177d53,_0xa0f85f){const _0x2a52fc=a43_0x3d35be,_0x5aadcf=_0x316f46 instanceof Error?_0x316f46:new Error(String(_0x316f46));if(_0xa0f85f['length']===0x0)return _0x5aadcf;return new AggregateError([_0x5aadcf,..._0xa0f85f],_0x177d53+'\x20Recovery\x20errors:\x20'+_0xa0f85f[_0x2a52fc(0xbc)](_0x386bd5=>_0x386bd5[_0x2a52fc(0x145)])[_0x2a52fc(0x138)](';\x20'));}function buildDatasetCodeToAliasMap(_0x13cc2e,_0x2ebcdb,_0x2448f7){const _0x5f4703=a43_0x3d35be,_0x5ebc6b=resolveApiModelSource(_0x13cc2e,_0x2ebcdb,_0x2448f7),_0x959d62=loadAliasMap(_0x13cc2e,undefined,_0x5ebc6b['filePath'],_0x5ebc6b['profileName']);return assertUnambiguousHookAliases(_0x959d62),new Map(_0x959d62[_0x5f4703(0xbc)](_0x25dda7=>[_0x25dda7[_0x5f4703(0xef)][_0x5f4703(0xf3)](),_0x25dda7[_0x5f4703(0xf8)]]));}async function planHookDirectoryMigration(_0xd22ca7,_0x4f63fa,_0x221bb1,_0x15b831){const _0x228a1b=a43_0x3d35be,_0x32222a=new Map();for(const [_0x1a730c,_0x4c5822]of Object[_0x228a1b(0xc5)](_0x4f63fa[_0x228a1b(0xd8)])){const [_0x1d73a7,_0x35121a,_0xe6f95c,_0xce39e2,_0x717363,..._0x3193c2]=_0x1a730c[_0x228a1b(0xfb)]('/');if(_0x1d73a7!==_0x228a1b(0x13f)||!_0x35121a||!_0xe6f95c||!_0xce39e2||!_0x717363||_0x3193c2[_0x228a1b(0x10c)]>0x0||!_0x4c5822[_0x228a1b(0xef)])continue;const _0x34c0cd=_0x221bb1['get'](_0x4c5822[_0x228a1b(0xef)][_0x228a1b(0xf3)]()),_0x5999fc=_0x34c0cd??_0x4c5822[_0x228a1b(0xef)];if(!isSafeHookDirectorySegment(_0x35121a))throw CliErrors['validation']('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x35121a+'\x22\x20from\x20the\x20lock\x20file.');if(!isSafeHookDirectorySegment(_0x5999fc))throw CliErrors['validation'](_0x228a1b(0xd0)+_0x35121a+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x35121a===_0x5999fc)continue;const _0x42e238=_0x32222a[_0x228a1b(0x116)](_0x35121a)??{'datasetCode':_0x4c5822['datasetCode'],'alias':_0x34c0cd,'keyChanges':[]};if(_0x42e238[_0x228a1b(0xef)]!==_0x4c5822[_0x228a1b(0xef)])throw CliErrors['validation'](_0x228a1b(0xd0)+_0x35121a+_0x228a1b(0xcd));const _0x2be28b=_0x228a1b(0x11b)+_0x5999fc+'/'+_0xe6f95c+'/'+_0xce39e2+'/'+_0x717363;try{resolveLocalFilePathFromLockKey(_0xd22ca7,_0x1a730c),resolveLocalFilePathFromLockKey(_0xd22ca7,_0x2be28b);}catch(_0x3149fc){throw CliErrors[_0x228a1b(0x10a)](_0x228a1b(0xb8)+_0x1a730c+_0x228a1b(0x103)+(_0x3149fc instanceof Error?_0x3149fc[_0x228a1b(0x145)]:String(_0x3149fc)));}_0x42e238[_0x228a1b(0x135)][_0x228a1b(0xce)]({'oldLockKey':_0x1a730c,'newLockKey':_0x2be28b,'entry':_0x4c5822}),_0x32222a[_0x228a1b(0xb4)](_0x35121a,_0x42e238);}const _0x4b1702=new Set([..._0x32222a[_0x228a1b(0x13b)]()][_0x228a1b(0x122)](_0x234a0d=>_0x234a0d[_0x228a1b(0x135)][_0x228a1b(0xbc)](_0x416710=>_0x416710['oldLockKey']))),_0x1657a7=new Map(),_0x38ef50=new Map();for(const [_0x5b4b86,_0x4daea5]of _0x32222a){const _0x174e51=_0x4daea5[_0x228a1b(0xf8)]??_0x4daea5[_0x228a1b(0xef)],_0x44a717=hookDirectoryIdentity(_0x174e51),_0x4b0d4e=_0x1657a7[_0x228a1b(0x116)](_0x44a717);if(_0x4b0d4e&&_0x4b0d4e!==_0x5b4b86)throw CliErrors['validation'](_0x228a1b(0x10e)+_0x4b0d4e+'\x22\x20and\x20\x22'+_0x5b4b86+'\x22:\x20both\x20target\x20\x22'+_0x174e51+_0x228a1b(0x141));_0x1657a7[_0x228a1b(0xb4)](_0x44a717,_0x5b4b86);for(const _0x27eb08 of _0x4daea5[_0x228a1b(0x135)]){const _0x19315e=_0x38ef50[_0x228a1b(0x116)](_0x27eb08[_0x228a1b(0x12e)]);if(_0x19315e&&_0x19315e!==_0x27eb08[_0x228a1b(0x144)])throw CliErrors['validation'](_0x228a1b(0xe1)+_0x19315e+'\x22\x20and\x20\x22'+_0x27eb08[_0x228a1b(0x144)]+_0x228a1b(0x137)+_0x27eb08[_0x228a1b(0x12e)]+_0x228a1b(0xc8));if(_0x4b1702[_0x228a1b(0x100)](_0x27eb08[_0x228a1b(0x12e)]))throw CliErrors['validation'](_0x228a1b(0xd6)+_0x27eb08[_0x228a1b(0x144)]+'\x22:\x20its\x20target\x20\x22'+_0x27eb08[_0x228a1b(0x12e)]+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x38ef50[_0x228a1b(0xb4)](_0x27eb08[_0x228a1b(0x12e)],_0x27eb08[_0x228a1b(0x144)]);}}const _0x420fca=new Map();for(const [_0x1acbb3,_0x1aa4e6]of _0x221bb1){_0x420fca[_0x228a1b(0xb4)](hookDirectoryIdentity(_0x1aa4e6),_0x1acbb3);}const _0x230ac3=[];for(const [_0x409e7b,_0x4518e8]of _0x32222a){const _0x10564b=_0x4518e8[_0x228a1b(0xf8)]??_0x4518e8['datasetCode'],_0x5790f2=join(_0xd22ca7['scriptsRootDir'],'HOOK',_0x409e7b),_0x31ec6a=join(_0xd22ca7[_0x228a1b(0x10d)],_0x228a1b(0x13f),_0x10564b),_0x1ac286=await directoryExists(_0x5790f2),_0x11a7e5=await directoryExists(_0x31ec6a),_0x5aa88d=_0x1ac286?_0x11a7e5?await sameDirectory(_0x5790f2,_0x31ec6a)?'case-rename':undefined:'move':'rekey';if(!_0x5aa88d)throw CliErrors[_0x228a1b(0x10a)](_0x228a1b(0xd0)+_0x409e7b+_0x228a1b(0xf7)+_0x10564b+_0x228a1b(0x13d));const _0x25d2ca=_0x420fca[_0x228a1b(0x116)](hookDirectoryIdentity(_0x409e7b));if(_0x25d2ca&&_0x25d2ca!==_0x4518e8[_0x228a1b(0xef)][_0x228a1b(0xf3)]()){const _0x111b4c=new Set(_0x4518e8[_0x228a1b(0x135)][_0x228a1b(0xbc)](_0x290ccc=>_0x290ccc[_0x228a1b(0x144)])),_0x5a2f6f=_0x15b831['filter'](_0x266b90=>_0x266b90[_0x228a1b(0x139)]===_0x228a1b(0x13f)&&_0x266b90[_0x228a1b(0xf8)]!=null&&hookDirectoryIdentity(_0x266b90[_0x228a1b(0xf8)])===hookDirectoryIdentity(_0x409e7b)&&!_0x111b4c[_0x228a1b(0x100)](_0x266b90['lockKey']));if(_0x5a2f6f[_0x228a1b(0x10c)]>0x0)throw CliErrors[_0x228a1b(0x10a)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x409e7b+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x5071cd=_0x420fca['get'](hookDirectoryIdentity(_0x10564b));if(_0x5071cd&&_0x5071cd!==_0x4518e8['datasetCode'][_0x228a1b(0xf3)]())throw CliErrors['validation'](_0x228a1b(0xd0)+_0x409e7b+'\x22\x20to\x20\x22'+_0x10564b+_0x228a1b(0xff));for(const _0x5cfcec of _0x4518e8[_0x228a1b(0x135)]){const _0x5cf604=_0x4f63fa[_0x228a1b(0xd8)][_0x5cfcec['newLockKey']];if(_0x5cf604&&!_0x4b1702['has'](_0x5cfcec[_0x228a1b(0x12e)])&&!sameHookIdentity(_0x5cfcec[_0x228a1b(0x101)],_0x5cf604))throw CliErrors['validation'](_0x228a1b(0xd0)+_0x409e7b+_0x228a1b(0xf7)+_0x10564b+_0x228a1b(0xe3));}_0x230ac3[_0x228a1b(0xce)]({'oldDirectory':_0x409e7b,'newDirectory':_0x10564b,'oldDirectoryPath':_0x5790f2,'newDirectoryPath':_0x31ec6a,'mode':_0x5aa88d,'alias':_0x4518e8['alias'],'keyChanges':_0x4518e8[_0x228a1b(0x135)]});}const _0x59283f={..._0x4f63fa['functions']},_0x3867e5=new Map(),_0x139feb=new Map();for(const _0x3cdc31 of _0x230ac3){const _0x40977f=_0x3cdc31['mode']!=='rekey';_0x40977f&&_0x139feb[_0x228a1b(0xb4)](hookDirectoryIdentity(_0x3cdc31[_0x228a1b(0x142)]),_0x3cdc31[_0x228a1b(0x105)]);for(const _0x4a1dbf of _0x3cdc31[_0x228a1b(0x135)]){const _0x1402fc=_0x59283f[_0x4a1dbf[_0x228a1b(0x12e)]],_0x5d7f9c=_0x40977f?_0x4a1dbf[_0x228a1b(0x101)]:_0x1402fc??_0x4a1dbf['entry'];_0x59283f[_0x4a1dbf[_0x228a1b(0x12e)]]=canonicalizeHookEntry(_0x5d7f9c,_0x3cdc31[_0x228a1b(0xf8)]),delete _0x59283f[_0x4a1dbf[_0x228a1b(0x144)]],_0x40977f&&_0x3867e5['set'](_0x4a1dbf[_0x228a1b(0x12e)],resolveLocalFilePathFromLockKey(_0xd22ca7,_0x4a1dbf[_0x228a1b(0x144)]));}}return{'migrations':_0x230ac3,'projectedFunctions':_0x59283f,'sourceFilePathByNewLockKey':_0x3867e5,'sourceDirectoryPathByNewDirectory':_0x139feb};}function resolveMigratedSourceFilePath(_0x4290e4,_0x4d41a5){const _0x1fadb1=a43_0x3d35be;if(!_0x4290e4||!_0x4d41a5)return undefined;const _0x6bf234=_0x4290e4[_0x1fadb1(0xc9)][_0x1fadb1(0x116)](_0x4d41a5[_0x1fadb1(0x11c)]);if(_0x6bf234)return _0x6bf234;if(_0x4d41a5['type']!==_0x1fadb1(0x13f))return undefined;const [,_0x140540,..._0x1a2c8f]=_0x4d41a5[_0x1fadb1(0x11c)][_0x1fadb1(0xfb)]('/');if(!_0x140540||_0x1a2c8f[_0x1fadb1(0x10c)]===0x0)return undefined;const _0x2676bf=_0x4290e4[_0x1fadb1(0x134)]['get'](hookDirectoryIdentity(_0x140540));return _0x2676bf?join(_0x2676bf,..._0x1a2c8f)+'.js':undefined;}function sameHookIdentity(_0x1c78d2,_0x491df3){const _0x1a045b=a43_0x3d35be;return _0x1c78d2[_0x1a045b(0xd1)]===_0x491df3[_0x1a045b(0xd1)]&&_0x1c78d2[_0x1a045b(0xef)]===_0x491df3[_0x1a045b(0xef)]&&_0x1c78d2[_0x1a045b(0xb5)]===_0x491df3[_0x1a045b(0xb5)]&&_0x1c78d2[_0x1a045b(0xe4)]===_0x491df3[_0x1a045b(0xe4)];}function canonicalizeHookEntry(_0x5f4dd9,_0x381b65){const {alias:_0xe31a78,..._0x41cacf}=_0x5f4dd9;return _0x381b65?{..._0x41cacf,'alias':_0x381b65}:_0x41cacf;}function hookDirectoryIdentity(_0x2d51b0){const _0x83b3ec=a43_0x3d35be;return _0x2d51b0[_0x83b3ec(0x127)]('NFC')[_0x83b3ec(0xf3)]();}function isSafeHookDirectorySegment(_0x555a92){return isSafeLockKeySegment(_0x555a92);}async function sameDirectory(_0x540046,_0xf330a3){const _0x3bbfc2=a43_0x3d35be,[_0x3e10f8,_0x238c8b]=await Promise[_0x3bbfc2(0xbd)]([stat(_0x540046),stat(_0xf330a3)]);return _0x3e10f8['dev']===_0x238c8b[_0x3bbfc2(0x126)]&&_0x3e10f8['ino']===_0x238c8b[_0x3bbfc2(0xbe)];}async function applyHookDirectoryMigration(_0x157d97,_0x5a9975){const _0x369835=a43_0x3d35be,_0x58b427=_0x5a9975[_0x369835(0xd8)],_0x2e0c70=_0x5a9975[_0x369835(0x124)],_0x4d74fb=[],_0x119855=async()=>{const _0x5718be=_0x369835,_0x4ace4d=[];_0x5a9975[_0x5718be(0xd8)]=_0x58b427,_0x5a9975[_0x5718be(0x124)]=_0x2e0c70;for(const {migration:_0x3a8462,temporaryPath:_0x3f1ccd}of[..._0x4d74fb][_0x5718be(0x11a)]()){try{_0x3f1ccd?(await rename(_0x3a8462[_0x5718be(0x11f)],_0x3f1ccd),await rename(_0x3f1ccd,_0x3a8462[_0x5718be(0x105)])):await rename(_0x3a8462['newDirectoryPath'],_0x3a8462[_0x5718be(0x105)]);}catch(_0x3849cc){_0x4ace4d['push'](new Error(_0x5718be(0x114)+_0x3a8462['oldDirectory']+_0x5718be(0x11e)+_0x3a8462['newDirectory']+_0x5718be(0x103)+(_0x3849cc instanceof Error?_0x3849cc['message']:String(_0x3849cc))));}}return _0x4ace4d;};try{for(const _0x4bb80f of _0x157d97[_0x369835(0x110)]){if(_0x4bb80f[_0x369835(0x12b)]===_0x369835(0xc3))await ensureParentDirectory(_0x4bb80f[_0x369835(0x11f)]),await rename(_0x4bb80f[_0x369835(0x105)],_0x4bb80f['newDirectoryPath']),_0x4d74fb[_0x369835(0xce)]({'migration':_0x4bb80f});else{if(_0x4bb80f['mode']===_0x369835(0xdd)){const _0x42b9a9=join(dirname(_0x4bb80f[_0x369835(0x105)]),_0x369835(0xfd)+randomUUID());await rename(_0x4bb80f['oldDirectoryPath'],_0x42b9a9);try{await rename(_0x42b9a9,_0x4bb80f['newDirectoryPath']);}catch(_0x436011){try{await rename(_0x42b9a9,_0x4bb80f[_0x369835(0x105)]);}catch(_0x1f95cf){throw withRollbackErrors(_0x436011,_0x369835(0xc6)+_0x4bb80f[_0x369835(0xfe)]+_0x369835(0xf7)+_0x4bb80f[_0x369835(0x142)]+_0x369835(0xe0)+_0x42b9a9+_0x369835(0xb9),[new Error(_0x369835(0x136)+_0x42b9a9+_0x369835(0xf7)+_0x4bb80f[_0x369835(0xfe)]+_0x369835(0x103)+(_0x1f95cf instanceof Error?_0x1f95cf[_0x369835(0x145)]:String(_0x1f95cf)))]);}throw _0x436011;}_0x4d74fb[_0x369835(0xce)]({'migration':_0x4bb80f,'temporaryPath':_0x42b9a9});}}}return _0x5a9975[_0x369835(0xd8)]=_0x157d97[_0x369835(0xde)],{'rollback':_0x119855};}catch(_0x3a134a){const _0x177d01=await _0x119855();throw withRollbackErrors(_0x3a134a,_0x369835(0xe5),_0x177d01);}}async function confirmForce(){const _0xe1ff76=a43_0x3d35be,_0x32ea8d=createInterface({'input':process[_0xe1ff76(0xc7)],'output':process[_0xe1ff76(0xeb)]}),_0x17ac39=await new Promise(_0xbae3d6=>{const _0x123890=_0xe1ff76;_0x32ea8d[_0x123890(0x106)](_0x123890(0xc4),_0xbae3d6);});return _0x32ea8d[_0xe1ff76(0x13e)](),['y',_0xe1ff76(0xe9)]['includes'](_0x17ac39[_0xe1ff76(0xee)]()[_0xe1ff76(0xf3)]());}
|