@lovrabet/rabetbase-cli 2.5.5-beta.3 → 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 +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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_0x1f9f96=a37_0x2587;(function(_0x5832ef,_0x1227f2){const _0x440bc5=a37_0x2587,_0x57d67c=_0x5832ef();while(!![]){try{const _0x4941d2=-parseInt(_0x440bc5(0x134))/0x1+parseInt(_0x440bc5(0x121))/0x2+-parseInt(_0x440bc5(0xf6))/0x3*(parseInt(_0x440bc5(0xe3))/0x4)+parseInt(_0x440bc5(0x13a))/0x5*(-parseInt(_0x440bc5(0xfb))/0x6)+parseInt(_0x440bc5(0x12d))/0x7*(-parseInt(_0x440bc5(0x123))/0x8)+-parseInt(_0x440bc5(0x141))/0x9+parseInt(_0x440bc5(0xe8))/0xa;if(_0x4941d2===_0x1227f2)break;else _0x57d67c['push'](_0x57d67c['shift']());}catch(_0x2c4f52){_0x57d67c['push'](_0x57d67c['shift']());}}}(a37_0x7166,0x19b89));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';function a37_0x2587(_0x7acaac,_0x2e7074){_0x7acaac=_0x7acaac-0xe0;const _0x716600=a37_0x7166();let _0x25875b=_0x716600[_0x7acaac];return _0x25875b;}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';function a37_0x7166(){const _0x172514=['Operation\x20type\x20\x22','datasetCode','Trigger\x20node\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','operation-type','before','write','当前请求参数','COMMON','string','parseInt','/data/dataset/','join','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Script\x20type','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','datasetcode','修改后的响应结果','\x20function:\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','333856ZAQlqV','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','1297192LAxBzs','apiDir','Created\x20','close','length','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','find','name','/**\x0a\x20*\x20','trim','7FRkSuE','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22\x20not\x20found.\x20','HOOK\x20requires\x20alias/operation/node\x20options.','tableName','description','code','14270LrkBfY','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','stdin','\x0a\x20*\x20[平台配置]\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','profileName','10TlOJko','scriptsRootDir','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','mergedCli','Operation\x20type\x20(HOOK\x20only)','修改后的请求参数','\x20api\x20pull`\x20to\x20refresh.','363024AsesYk','filePath','read','HOOK','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','478980wTRTmT','Select\x20dataset:','\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','nonInteractive','Script\x20description','4102830OXBdkF','after','No\x20datasets\x20found\x20for\x20this\x20app.','currentApp','当前响应结果','appCode','validation','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','str','stderr','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','.js','map','/HOOK/','3GRsxaW','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','/ENDPOINT/',']\x20(','406074hLnsXj','alias','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Function\x20name\x20(valid\x20JS\x20identifier)','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','source','question','operationType','ENDPOINT','functionNode','datasetId','Select\x20trigger\x20node:','.js\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>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Invalid\x20dataset\x20selection.'];a37_0x7166=function(){return _0x172514;};return a37_0x7166();}import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':'create','description':a37_0x1f9f96(0x119),'risk':a37_0x1f9f96(0xe0),'flags':[{'name':'type','type':a37_0x1f9f96(0x115),'required':!![],'enum':[a37_0x1f9f96(0x114),'ENDPOINT',a37_0x1f9f96(0xe1)],'description':a37_0x1f9f96(0x11b)},{'name':a37_0x1f9f96(0x12a),'type':a37_0x1f9f96(0x115),'required':!![],'description':a37_0x1f9f96(0x100)},{'name':'description','type':a37_0x1f9f96(0x115),'description':a37_0x1f9f96(0xe7)},{'name':a37_0x1f9f96(0xfc),'type':a37_0x1f9f96(0x115),'description':a37_0x1f9f96(0xff)},{'name':a37_0x1f9f96(0x11d),'type':a37_0x1f9f96(0x115),'description':a37_0x1f9f96(0x11a)},{'name':'operation-type','type':a37_0x1f9f96(0x115),'description':a37_0x1f9f96(0x13e)},{'name':'function-node','type':a37_0x1f9f96(0x115),'description':a37_0x1f9f96(0x10e),'enum':['before',a37_0x1f9f96(0xe9)]}],async 'validate'(_0x558338){const _0x2a07f4=a37_0x1f9f96,_0x2e7688=_0x558338[_0x2a07f4(0xf0)]('name');if(!isValidBffFunctionName(_0x2e7688))throw CliErrors[_0x2a07f4(0xee)]('Invalid\x20function\x20name\x20\x22'+_0x2e7688+_0x2a07f4(0x135));},async 'execute'(_0xf3bb2a){const _0x2cc3d5=a37_0x1f9f96,_0x18a4e9=loadBffProjectConfig(_0xf3bb2a[_0x2cc3d5(0xed)]),_0x71f342=_0xf3bb2a[_0x2cc3d5(0xf0)]('type'),_0x5f2a4a=_0xf3bb2a[_0x2cc3d5(0xf0)](_0x2cc3d5(0x12a)),_0x25d373=_0xf3bb2a[_0x2cc3d5(0xf0)](_0x2cc3d5(0x132))||undefined,_0x3080ac=_0x71f342==='HOOK'?await resolveHookOptions(_0x18a4e9,_0xf3bb2a):undefined,_0x718e69=buildFilePath(_0x18a4e9,_0x71f342,_0x5f2a4a,_0x3080ac);if(await fileExists(_0x718e69))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x718e69);await mkdir(dirname(_0x718e69),{'recursive':!![]});const _0x5ef80f=generateTemplate(_0x71f342,_0x5f2a4a,_0xf3bb2a[_0x2cc3d5(0xed)],_0x25d373,_0x3080ac);await writeFile(_0x718e69,_0x5ef80f,'utf8');const _0x51a97d={'type':_0x71f342,'name':_0x5f2a4a,'path':_0x718e69};if(_0x25d373)_0x51a97d[_0x2cc3d5(0x132)]=_0x25d373;if(_0x3080ac){if(_0x3080ac['alias'])_0x51a97d[_0x2cc3d5(0xfc)]=_0x3080ac['alias'];_0x51a97d['datasetCode']=_0x3080ac['datasetCode'],_0x51a97d['operationType']=_0x3080ac[_0x2cc3d5(0x104)],_0x51a97d[_0x2cc3d5(0x106)]=_0x3080ac[_0x2cc3d5(0x106)];}return{'ok':!![],'data':_0x51a97d,'message':_0x2cc3d5(0x125)+_0x71f342+_0x2cc3d5(0x11f)+_0x5f2a4a};}};async function resolveHookOptions(_0x17ba31,_0x35e704){const _0x561c20=a37_0x1f9f96,_0x4111b3=resolveApiModelSource(_0x35e704['apiDir'],_0x35e704['appCode'],_0x35e704['selectedAppName']||_0x35e704[_0x561c20(0x13d)]?.[_0x561c20(0xeb)]||_0x35e704['mergedCli']?.['defaultApp']),_0xeafa54=loadAliasMap(_0x35e704[_0x561c20(0x124)],undefined,_0x4111b3[_0x561c20(0x142)],_0x4111b3[_0x561c20(0x139)]),_0x411fe4=_0xeafa54[_0x561c20(0x127)]>0x0;let _0x47a393,_0x3b6a77,_0x442981;const _0x589f2a=_0x35e704['str'](_0x561c20(0xfc)),_0xa8f03d=_0x35e704['str']('datasetcode');if(_0x589f2a){const _0x2acef1=resolveAlias(_0x35e704['apiDir'],_0x589f2a,undefined,_0x4111b3[_0x561c20(0x142)],_0x4111b3[_0x561c20(0x139)]);if(!_0x2acef1){const _0x5ac60f=_0x411fe4?'Available\x20aliases:\x20'+_0xeafa54[_0x561c20(0xf4)](_0x1b59fe=>_0x1b59fe['alias'])['join'](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x561c20(0xf2);throw CliErrors[_0x561c20(0xee)]('Alias\x20\x22'+_0x589f2a+_0x561c20(0x12f)+_0x5ac60f);}_0x47a393=_0x589f2a,_0x3b6a77=_0x2acef1;}else{if(_0xa8f03d){_0x3b6a77=_0xa8f03d;const _0x18babb=_0xeafa54[_0x561c20(0x129)](_0x4dcb1e=>_0x4dcb1e['datasetCode']===_0xa8f03d);_0x47a393=_0x18babb?.[_0x561c20(0xfc)];}else{if(_0x35e704[_0x561c20(0xe6)])throw CliErrors[_0x561c20(0xee)](_0x561c20(0x12e));else{if(_0x411fe4){const _0x44430d=_0xeafa54['map'](_0x30fe18=>_0x30fe18[_0x561c20(0xfc)]+'\x20('+_0x30fe18[_0x561c20(0x131)]+')'),_0xfea620=await promptSelect(_0x561c20(0xe4),_0x44430d),_0x4c1caa=_0xeafa54[_0xfea620];if(!_0x4c1caa)throw CliErrors[_0x561c20(0xee)](_0x561c20(0x10b));_0x47a393=_0x4c1caa[_0x561c20(0xfc)],_0x3b6a77=_0x4c1caa[_0x561c20(0x10d)];}else{const _0x1628c5=await listDatasets(_0x35e704[_0x561c20(0xed)]);if(_0x1628c5[_0x561c20(0x127)]===0x0)throw CliErrors[_0x561c20(0xee)](_0x561c20(0xea));const _0x398854=_0x1628c5[_0x561c20(0xf4)](_0x1f0260=>_0x1f0260[_0x561c20(0x12a)]+'\x20['+(_0x1f0260[_0x561c20(0x102)]??'UNKNOWN')+_0x561c20(0xfa)+_0x1f0260[_0x561c20(0x133)]+')'),_0x1363b3=await promptSelect(_0x561c20(0xe4),_0x398854),_0x431455=_0x1628c5[_0x1363b3];if(!_0x431455)throw CliErrors[_0x561c20(0xee)](_0x561c20(0x10b));_0x3b6a77=_0x431455[_0x561c20(0x133)],_0x47a393=undefined;}}}}const _0x13bf09=await listDatasets(_0x35e704[_0x561c20(0xed)]),_0x5bc449=_0x13bf09['find'](_0x1f464a=>_0x1f464a['code']===_0x3b6a77);if(!_0x5bc449)throw CliErrors[_0x561c20(0xee)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x3b6a77+'\x22.\x20'+(_0x47a393?_0x561c20(0x13c)+CLI_BIN_NAME+_0x561c20(0x140):''));_0x442981=_0x5bc449['id'];const _0x2bb9e5=_0x47a393??_0x3b6a77,_0x9cc38c=await listBffDatasetOperations(_0x35e704[_0x561c20(0xed)],_0x442981),_0x5f464a=_0x9cc38c?Object['keys'](_0x9cc38c):[];if(_0x5f464a[_0x561c20(0x127)]===0x0)throw CliErrors[_0x561c20(0xee)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x2bb9e5+'.');let _0xeca1c0;const _0x299f3a=_0x35e704[_0x561c20(0xf0)](_0x561c20(0x110));if(_0x299f3a){if(!_0x5f464a['includes'](_0x299f3a))throw CliErrors[_0x561c20(0xee)](_0x561c20(0x10c)+_0x299f3a+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x2bb9e5+'.\x20'+('Available:\x20'+_0x5f464a[_0x561c20(0x118)](',\x20')));_0xeca1c0=_0x299f3a;}else{if(_0x35e704[_0x561c20(0xe6)])throw CliErrors['validation'](_0x561c20(0xfd));const _0x1b98d2=await promptSelect('Select\x20operation\x20type:',_0x5f464a);_0xeca1c0=_0x5f464a[_0x1b98d2]??_0x5f464a[0x0];}let _0x555be5=normalizeHookFunctionNode(_0x35e704[_0x561c20(0xf0)]('function-node'));if(!_0x555be5){if(_0x35e704[_0x561c20(0xf0)]('function-node'))throw CliErrors[_0x561c20(0xee)](_0x561c20(0xef));if(_0x35e704[_0x561c20(0xe6)])throw CliErrors[_0x561c20(0xee)](_0x561c20(0x122));const _0x329375=await promptSelect(_0x561c20(0x108),[_0x561c20(0x111),_0x561c20(0xe9)]);_0x555be5=[_0x561c20(0x111),'after'][_0x329375]??'before';}return{'alias':_0x47a393,'datasetCode':_0x3b6a77,'datasetId':_0x442981,'operationType':_0xeca1c0,'functionNode':_0x555be5};}async function promptSelect(_0x40bf74,_0x5d83ed){const _0x418c9b=a37_0x1f9f96;if(_0x5d83ed[_0x418c9b(0x127)]===0x1)return 0x0;for(const [_0x484d21,_0x5b2e29]of _0x5d83ed['entries']()){process[_0x418c9b(0xf1)][_0x418c9b(0x112)]('\x20\x20'+(_0x484d21+0x1)+'.\x20'+_0x5b2e29+'\x0a');}const _0xdf7d94=createInterface({'input':process[_0x418c9b(0x136)],'output':process[_0x418c9b(0xf1)]});while(!![]){const _0x59fd94=await new Promise(_0x482915=>{const _0x385bd1=_0x418c9b;_0xdf7d94[_0x385bd1(0x103)](_0x40bf74+'\x20',_0x482915);}),_0x6c5fe6=Number[_0x418c9b(0x116)](_0x59fd94[_0x418c9b(0x12c)](),0xa);if(Number['isInteger'](_0x6c5fe6)&&_0x6c5fe6>=0x1&&_0x6c5fe6<=_0x5d83ed['length'])return _0xdf7d94[_0x418c9b(0x126)](),_0x6c5fe6-0x1;process[_0x418c9b(0xf1)][_0x418c9b(0x112)](_0x418c9b(0x128)+_0x5d83ed[_0x418c9b(0x127)]+'.\x0a');}}function buildFilePath(_0x3eb6af,_0x1b9aa0,_0x44bb67,_0x2b6724){const _0x1f8d5f=a37_0x1f9f96;if(_0x1b9aa0===_0x1f8d5f(0xe1)){if(!_0x2b6724)throw CliErrors[_0x1f8d5f(0xee)](_0x1f8d5f(0x130));const _0x3e80f5=_0x2b6724['alias']??_0x2b6724['datasetCode'];return join(_0x3eb6af['scriptsRootDir'],'HOOK',_0x3e80f5,_0x2b6724['operationType'],_0x2b6724[_0x1f8d5f(0x106)],_0x44bb67+'.js');}return join(_0x3eb6af[_0x1f8d5f(0x13b)],_0x1b9aa0,_0x44bb67+_0x1f8d5f(0xf3));}export function generateTemplate(_0x18250f,_0x37281e,_0x41d34b,_0x255a72,_0x4dc217){const _0x4347fe=a37_0x1f9f96,_0xec3331=_0x255a72?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0xd6c9a3=getAppBaseUrl(_0x41d34b),_0x328cc6='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x18250f===_0x4347fe(0x114))return _0x4347fe(0x12b)+_0xec3331+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x37281e+_0x4347fe(0x137)+_0xd6c9a3+_0x4347fe(0x138)+_0x41d34b+'/COMMON/'+_0x37281e+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x37281e+'\x22,\x20params\x20})\x0a'+_0x328cc6+_0x4347fe(0x10a)+_0x37281e+_0x4347fe(0x11c);if(_0x18250f===_0x4347fe(0x105))return _0x4347fe(0x12b)+_0xec3331+_0x4347fe(0xf8)+_0x37281e+_0x4347fe(0x120)+_0x41d34b+'/'+_0x37281e+'\x0a\x20*\x20[平台配置]\x20'+_0xd6c9a3+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x41d34b+_0x4347fe(0xf9)+_0x37281e+'.js\x0a'+_0x328cc6+_0x4347fe(0xe5)+_0x37281e+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x4dc217)throw CliErrors[_0x4347fe(0xee)](_0x4347fe(0xf7));const _0x161dde=_0x4dc217['alias']??_0x4dc217[_0x4347fe(0x10d)],_0x262ac3=_0x4dc217[_0x4347fe(0x106)]===_0x4347fe(0x111)?_0x4347fe(0x113):_0x4347fe(0xec),_0xa2188a=_0x4dc217[_0x4347fe(0x106)]===_0x4347fe(0x111)?_0x4347fe(0x13f):_0x4347fe(0x11e);return _0x4347fe(0x12b)+_0xec3331+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x37281e+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x41d34b+'/'+_0x4dc217['datasetCode']+'/'+_0x4dc217[_0x4347fe(0x104)]+_0x4347fe(0x137)+_0xd6c9a3+_0x4347fe(0x117)+_0x4dc217[_0x4347fe(0x107)]+_0x4347fe(0x101)+_0x41d34b+_0x4347fe(0xf5)+_0x161dde+'/'+_0x4dc217[_0x4347fe(0x104)]+'/'+_0x4dc217[_0x4347fe(0x106)]+'/'+_0x37281e+_0x4347fe(0x109)+_0x4dc217['functionNode']+'\x0a'+_0x328cc6+_0x4347fe(0x10f)+_0x262ac3+_0x4347fe(0xfe)+_0xa2188a+_0x4347fe(0xe2)+_0x37281e+_0x4347fe(0x11c);}
|
|
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
|
-
const
|
|
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
|
-
(function(
|
|
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
|
-
function
|
|
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_0x24931b=a43_0x1c53;(function(_0x345143,_0x2024df){const _0x3a77d7=a43_0x1c53,_0xbabe16=_0x345143();while(!![]){try{const _0x2f54d8=parseInt(_0x3a77d7(0x150))/0x1+parseInt(_0x3a77d7(0x154))/0x2+parseInt(_0x3a77d7(0x134))/0x3*(-parseInt(_0x3a77d7(0x14f))/0x4)+parseInt(_0x3a77d7(0x14e))/0x5*(-parseInt(_0x3a77d7(0x192))/0x6)+parseInt(_0x3a77d7(0x184))/0x7+parseInt(_0x3a77d7(0x13d))/0x8*(-parseInt(_0x3a77d7(0x17a))/0x9)+parseInt(_0x3a77d7(0x1a4))/0xa*(parseInt(_0x3a77d7(0x1b1))/0xb);if(_0x2f54d8===_0x2024df)break;else _0xbabe16['push'](_0xbabe16['shift']());}catch(_0x2c8005){_0xbabe16['push'](_0xbabe16['shift']());}}}(a43_0x3d31,0xd5357));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';export const bffPull={'service':'bff','command':a43_0x24931b(0x173),'description':a43_0x24931b(0x17d),'risk':a43_0x24931b(0x18e),'structuredErrors':!![],'flags':[{'name':'type','type':a43_0x24931b(0x13a),'description':a43_0x24931b(0x15c),'enum':[a43_0x24931b(0x199),a43_0x24931b(0x1be),'HOOK']},{'name':'force','type':a43_0x24931b(0x151),'description':a43_0x24931b(0x1c3)}],async 'dryRun'(_0x11fc01){const _0x2ae861=a43_0x24931b,_0x400bbc=loadBffProjectConfig(_0x11fc01[_0x2ae861(0x158)]),_0x3b79cd=await readBffLockFile(_0x400bbc[_0x2ae861(0x18f)]),{appLock:_0xb2bc6a}=ensureLockScope(_0x3b79cd??createEmptyBffLock(),_0x11fc01[_0x2ae861(0x158)],_0x400bbc[_0x2ae861(0x1b5)],_0x2ae861(0x173)),_0x4dfc5c=normalizeBffType(_0x11fc01[_0x2ae861(0x12e)]('type'))??undefined,[_0x41ae8f,_0x521fc0]=await Promise['all']([listBffScripts(_0x11fc01['appCode'],_0x4dfc5c),getBffScriptStatistics(_0x11fc01[_0x2ae861(0x158)])]),_0x3153dd=_0x41ae8f[_0x2ae861(0x196)](_0x34a9a6=>normalizeBffType(_0x34a9a6['scriptType'])===_0x2ae861(0x178)),_0x3c962f=_0x3153dd?buildDatasetCodeToAliasMap(_0x11fc01[_0x2ae861(0x182)],_0x11fc01['appCode'],_0x11fc01[_0x2ae861(0x191)]||_0x11fc01['mergedCli']?.['currentApp']||_0x11fc01[_0x2ae861(0x185)]?.[_0x2ae861(0x16b)]):new Map(),_0x392d57=_0x3153dd?await planHookDirectoryMigration(_0x400bbc,_0xb2bc6a,_0x3c962f,await scanLocalBffFunctions(_0x400bbc,_0x2ae861(0x178))):undefined,_0x1b4fbe=createHookLocationMap(_0x521fc0),_0xc8d4c5=[];for(const _0x4fb349 of _0x41ae8f){const _0x3ddd63=resolveRemoteScriptTarget(_0x400bbc,_0x4fb349,_0x1b4fbe,_0x392d57?.[_0x2ae861(0x1b7)]??_0xb2bc6a[_0x2ae861(0x1c2)],_0x3c962f);if(!_0x3ddd63){_0xc8d4c5[_0x2ae861(0x15b)]({'scriptType':_0x4fb349[_0x2ae861(0x15e)],'functionName':_0x4fb349['functionName']??'','status':_0x2ae861(0x1af),'reason':_0x2ae861(0x1bd)});continue;}const _0x34f395=(_0x392d57?.['projectedFunctions']??_0xb2bc6a[_0x2ae861(0x1c2)])[_0x3ddd63[_0x2ae861(0x19a)]],_0x995a18=_0x4fb349[_0x2ae861(0x161)]!=null?computeContentHash(_0x4fb349[_0x2ae861(0x161)]):undefined,_0x1bbd13=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x392d57,_0x3ddd63)??_0x3ddd63['filePath'],_0x34f395,_0x995a18),_0x46151d=_0x1bbd13?localUnsyncedConflict(_0x3ddd63,_0x4fb349['id']):undefined;_0xc8d4c5['push']({'lockKey':_0x3ddd63[_0x2ae861(0x19a)],'filePath':_0x3ddd63['filePath'],'remoteId':_0x4fb349['id']??null,'status':_0x46151d?_0x2ae861(0x145):_0x2ae861(0x130),..._0x46151d?{'conflict':_0x46151d}:{},..._0x3ddd63[_0x2ae861(0x136)]?{'alias':_0x3ddd63[_0x2ae861(0x136)][_0x2ae861(0x15a)]??null,'datasetCode':_0x3ddd63[_0x2ae861(0x136)][_0x2ae861(0x1a7)],'operationType':_0x3ddd63[_0x2ae861(0x136)][_0x2ae861(0x140)],'functionNode':_0x3ddd63[_0x2ae861(0x136)]['functionNode']}:{}});}return{'method':_0x2ae861(0x1b4),'url':_0x2ae861(0x13c)+_0x11fc01[_0x2ae861(0x158)]+(_0x4dfc5c?'&type='+_0x4dfc5c:'')+_0x2ae861(0x146)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x11fc01[_0x2ae861(0x158)],'filterType':_0x4dfc5c??null,..._0x392d57&&_0x392d57[_0x2ae861(0x1c1)][_0x2ae861(0x1a8)]>0x0?{'hookDirectoryMigrations':_0x392d57[_0x2ae861(0x1c1)][_0x2ae861(0x155)](_0x2915b7=>({'from':_0x2915b7[_0x2ae861(0x17e)],'to':_0x2915b7[_0x2ae861(0x177)]}))}:{},'files':_0xc8d4c5},'description':_0x2ae861(0x17c)+_0xc8d4c5[_0x2ae861(0x1a8)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x2e7ee5){const _0x31cf21=a43_0x24931b,_0x4d07d5=loadBffProjectConfig(_0x2e7ee5[_0x31cf21(0x158)]),_0x659386=await readBffLockFile(_0x4d07d5[_0x31cf21(0x18f)]),{lockData:_0x1aecd1,appLock:_0x451733}=ensureLockScope(_0x659386??createEmptyBffLock(),_0x2e7ee5[_0x31cf21(0x158)],_0x4d07d5[_0x31cf21(0x1b5)],_0x31cf21(0x173)),_0xe6221=normalizeBffType(_0x2e7ee5[_0x31cf21(0x12e)](_0x31cf21(0x1a2)))??undefined;if(_0x2e7ee5[_0x31cf21(0x12e)](_0x31cf21(0x1a2))&&!_0xe6221)throw CliErrors[_0x31cf21(0x1b3)](_0x31cf21(0x179));const [_0x2a0a4f,_0x53f432]=await Promise[_0x31cf21(0x16d)]([listBffScripts(_0x2e7ee5['appCode'],_0xe6221),getBffScriptStatistics(_0x2e7ee5[_0x31cf21(0x158)])]);if(_0x2a0a4f['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x31cf21(0x143)};const _0x120c69=_0x2e7ee5[_0x31cf21(0x19b)](_0x31cf21(0x1a0));if(_0x120c69&&!_0x2e7ee5['nonInteractive']){const _0x504c69=await confirmForce();if(!_0x504c69)throw CliErrors[_0x31cf21(0x166)]('Force\x20pull\x20cancelled.');}if(_0x120c69&&_0x2e7ee5['nonInteractive']){}const _0x5bf8f5=_0x2a0a4f[_0x31cf21(0x196)](_0x3e140f=>normalizeBffType(_0x3e140f[_0x31cf21(0x15e)])===_0x31cf21(0x178)),_0x470dce=_0x5bf8f5?buildDatasetCodeToAliasMap(_0x2e7ee5[_0x31cf21(0x182)],_0x2e7ee5['appCode'],_0x2e7ee5['selectedAppName']||_0x2e7ee5[_0x31cf21(0x185)]?.[_0x31cf21(0x1aa)]||_0x2e7ee5['mergedCli']?.[_0x31cf21(0x16b)]):new Map(),_0x3bd529=createHookLocationMap(_0x53f432),_0x9fd600=JSON[_0x31cf21(0x162)](JSON[_0x31cf21(0x14b)](_0x1aecd1)),_0x2fc625=_0x2e7ee5['appCode'],_0x33d4a1=_0x9fd600['apps'][_0x2fc625];if(!_0x33d4a1)throw new Error(_0x31cf21(0x171)+_0x2fc625+_0x31cf21(0x157));const _0x1d2e24=_0x5bf8f5?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x4d07d5,_0x33d4a1,_0x470dce,await scanLocalBffFunctions(_0x4d07d5,_0x31cf21(0x178))),_0x33d4a1):undefined,_0xe0299c=createPullFileTransaction(),_0xbfc9f3=[],_0xe69fcb=[],_0x54ff2a=[],_0x5c14aa=[];for(const _0x356bfb of _0x2a0a4f){const _0x19e0cd=resolveRemoteScriptTarget(_0x4d07d5,_0x356bfb,_0x3bd529,_0x33d4a1['functions'],_0x470dce);if(!_0x19e0cd){_0xe69fcb[_0x31cf21(0x15b)]({'lockKey':_0x356bfb[_0x31cf21(0x15e)]+'/'+_0x356bfb['functionName'],'reason':_0x31cf21(0x1bd)});continue;}const _0x5b38ba=_0x33d4a1['functions'][_0x19e0cd[_0x31cf21(0x19a)]];try{if(!_0x356bfb['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x356bfb[_0x31cf21(0x161)]==null)throw new Error(_0x31cf21(0x1b2));const _0x4fac7c=_0x356bfb['scriptContent'],_0x3e6cf8=computeContentHash(_0x4fac7c);if(!_0x120c69){const _0x2a99b4=await hasUnsyncedLocalChanges(_0x19e0cd[_0x31cf21(0x1a3)],_0x5b38ba,_0x3e6cf8);if(_0x2a99b4){_0x54ff2a[_0x31cf21(0x15b)](localUnsyncedConflict(_0x19e0cd,_0x356bfb['id']));continue;}}await _0xe0299c['write'](_0x19e0cd[_0x31cf21(0x1a3)],_0x4fac7c);const _0x39f943={'hash':_0x3e6cf8,'remoteId':_0x356bfb['id'],'version':_0x356bfb[_0x31cf21(0x167)]};_0x19e0cd['type']===_0x31cf21(0x178)&&_0x19e0cd['hookLocation']&&(_0x39f943[_0x31cf21(0x15a)]=_0x19e0cd[_0x31cf21(0x136)]['alias'],_0x39f943[_0x31cf21(0x1a7)]=_0x19e0cd[_0x31cf21(0x136)][_0x31cf21(0x1a7)],_0x39f943[_0x31cf21(0x140)]=_0x19e0cd[_0x31cf21(0x136)][_0x31cf21(0x140)],_0x39f943['functionNode']=_0x19e0cd[_0x31cf21(0x136)][_0x31cf21(0x18b)]),_0x33d4a1[_0x31cf21(0x1c2)][_0x19e0cd['lockKey']]=_0x39f943,_0xbfc9f3[_0x31cf21(0x15b)]({'lockKey':_0x19e0cd[_0x31cf21(0x19a)],'remoteId':_0x356bfb['id']});}catch(_0x2b96a9){_0x5c14aa[_0x31cf21(0x15b)]({'lockKey':_0x19e0cd[_0x31cf21(0x19a)],'error':_0x2b96a9 instanceof Error?_0x2b96a9[_0x31cf21(0x144)]:String(_0x2b96a9)});}}_0x33d4a1[_0x31cf21(0x12f)]=new Date()[_0x31cf21(0x149)]();try{await writeBffLockFile(_0x4d07d5['lockFilePath'],_0x9fd600);}catch(_0x38bf0c){const _0x37ca74=[...await _0xe0299c[_0x31cf21(0x19d)](),...await _0x1d2e24?.[_0x31cf21(0x19d)]()??[]];throw withRollbackErrors(_0x38bf0c,_0x31cf21(0x169),_0x37ca74);}return{'ok':_0x5c14aa[_0x31cf21(0x1a8)]===0x0,'data':{'pulled':_0xbfc9f3,'skipped':_0xe69fcb,'conflicts':_0x54ff2a,'failed':_0x5c14aa},'message':formatPullMessage(_0xbfc9f3['length'],_0xe69fcb[_0x31cf21(0x1a8)],_0x54ff2a[_0x31cf21(0x1a8)],_0x5c14aa[_0x31cf21(0x1a8)])};}};function localUnsyncedConflict(_0x4cf330,_0x5f36c3){const _0x41ee1a=a43_0x24931b,_0x32c903=_0x4cf330['lockKey'][_0x41ee1a(0x13b)]('/')['at'](-0x1);return{'code':'BFF_LOCAL_UNSYNCED','lockKey':_0x4cf330['lockKey'],'filePath':_0x4cf330['filePath'],..._0x5f36c3!=null?{'remoteId':_0x5f36c3}:{},'message':_0x41ee1a(0x195),'nextAction':{'action':_0x41ee1a(0x160),'command':CLI_BIN_NAME+_0x41ee1a(0x1bb)+_0x4cf330[_0x41ee1a(0x1a2)]+_0x41ee1a(0x180)+_0x32c903+_0x41ee1a(0x190),'requiresReview':!![],'message':_0x41ee1a(0x19e)}};}function formatPullMessage(_0x11b697,_0x2ed6ed,_0x467014,_0x5efeb0){const _0x5b7926=a43_0x24931b,_0x4c23f8=['Pull\x20complete:\x20'+_0x11b697+_0x5b7926(0x1ae),_0x2ed6ed+_0x5b7926(0x139)];_0x467014>0x0&&_0x4c23f8[_0x5b7926(0x15b)](_0x467014+'\x20conflict'+(_0x467014===0x1?'':'s')+'\x20'+(_0x467014===0x1?_0x5b7926(0x135):_0x5b7926(0x1a6))+_0x5b7926(0x186));if(_0x5efeb0>0x0)_0x4c23f8['push'](_0x5efeb0+_0x5b7926(0x165));return _0x4c23f8[_0x5b7926(0x18d)](',\x20');}function a43_0x3d31(){const _0x1445eb=['Lock\x20scope\x20for\x20app\x20\x22','question','pull','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','delete','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','newDirectory','HOOK','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','603423MtSDeV','newDirectoryPath','Would\x20inspect\x20','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','oldDirectory','hash','\x20--name\x20','dev','apiDir','\x22\x20from\x20\x22','2808050oKsCja','mergedCli','\x20resolution','\x22:\x20its\x20target\x20\x22','ino','entry','reverse','functionNode','stdin','join','read','lockFilePath','\x20--format\x20compress','selectedAppName','635118GxZEaz','.hook-directory-migrate-','\x22:\x20both\x20target\x20\x22','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','some','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','newLockKey','COMMON','lockKey','bool','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','rollback','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.','oldLockKey','force','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','type','filePath','18323950OUzjDs','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','require','datasetCode','length','sourceFilePathByNewLockKey','currentApp','\x20Recovery\x20errors:\x20','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','ENOENT','\x20pulled','skipped','get','11skoxYi','Remote\x20script\x20missing\x20content.','validation','GET','scriptsRoot','.js','projectedFunctions','close','entries','existed','\x20bff\x20push\x20--type\x20','oldDirectoryPath','unresolvable\x20target\x20path','ENDPOINT','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','scriptsRootDir','migrations','functions','Force\x20overwrite\x20local\x20unsynced\x20changes','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','str','lastSync','would_pull','sourceDirectoryPathByNewDirectory','trim','rekey','2320314LuPEfc','requires','hookLocation','toLowerCase','profileName','\x20skipped','string','split','/api/management/library/scripts/list?appCode=','88lBvqUZ','case-rename','keyChanges','operationType','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','has','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','message','conflict','¤tPage=1&pageSize=','NFC','\x22\x20and\x20\x22','toISOString','includes','stringify','\x22\x20may\x20remain.','content','5VkyJZH','8yTaOTI','435368PGlsxe','boolean','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','\x22\x20to\x20\x22','1189272BwOvOB','map','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','\x22\x20not\x20found\x20after\x20ensureLockScope.','appCode','move','alias','push','Pull\x20only\x20this\x20script\x20type','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','scriptType','\x22\x20from\x20the\x20lock\x20file.','push_local','scriptContent','parse','code','Failed\x20to\x20write\x20local\x20script\x20\x22','\x20failed','cancelled','version','remoteId','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','defaultApp','\x22:\x20','all','set','mode','filter'];a43_0x3d31=function(){return _0x1445eb;};return a43_0x3d31();}async function hasUnsyncedLocalChanges(_0x5b7217,_0x29cd6c,_0x333232){const _0x5140cf=a43_0x24931b;if(!await fileExists(_0x5b7217))return![];const _0x5e90c3=await computeFileHash(_0x5b7217);if(!_0x29cd6c)return _0x333232?_0x5e90c3!==_0x333232:!![];return _0x5e90c3!==_0x29cd6c[_0x5140cf(0x17f)];}function a43_0x1c53(_0x17d6c9,_0x1c7ce8){_0x17d6c9=_0x17d6c9-0x12d;const _0x3d318b=a43_0x3d31();let _0x1c5317=_0x3d318b[_0x17d6c9];return _0x1c5317;}function createPullFileTransaction(){const _0x430bea=new Map(),_0x11b305=async(_0x328795,_0x36d659)=>{const _0x1273f9=a43_0x1c53;try{if(_0x36d659[_0x1273f9(0x1ba)])await ensureParentDirectory(_0x328795),await writeFile(_0x328795,_0x36d659[_0x1273f9(0x14d)]);else try{await unlink(_0x328795);}catch(_0x3c9592){if(_0x3c9592[_0x1273f9(0x163)]!==_0x1273f9(0x1ad))throw _0x3c9592;}return undefined;}catch(_0x219a9a){return _0x219a9a instanceof Error?_0x219a9a:new Error(String(_0x219a9a));}};return{async 'write'(_0x230627,_0x49b5c5){const _0xf86015=a43_0x1c53;if(!_0x430bea[_0xf86015(0x142)](_0x230627))try{_0x430bea[_0xf86015(0x16e)](_0x230627,{'existed':!![],'content':await readFile(_0x230627)});}catch(_0x2cf0c7){if(_0x2cf0c7[_0xf86015(0x163)]!==_0xf86015(0x1ad))throw _0x2cf0c7;_0x430bea[_0xf86015(0x16e)](_0x230627,{'existed':![]});}try{await ensureParentDirectory(_0x230627),await writeFile(_0x230627,_0x49b5c5,'utf8');}catch(_0x372c62){const _0x2c1faf=await _0x11b305(_0x230627,_0x430bea['get'](_0x230627));if(!_0x2c1faf)_0x430bea[_0xf86015(0x175)](_0x230627);throw withRollbackErrors(_0x372c62,_0xf86015(0x164)+_0x230627+'\x22.',_0x2c1faf?[_0x2c1faf]:[]);}},async 'rollback'(){const _0xb13fe9=a43_0x1c53,_0x5d6053=[];for(const [_0x435612,_0x33e5ea]of[..._0x430bea[_0xb13fe9(0x1b9)]()][_0xb13fe9(0x18a)]()){const _0xa7103c=await _0x11b305(_0x435612,_0x33e5ea);_0xa7103c&&_0x5d6053[_0xb13fe9(0x15b)](new Error('Could\x20not\x20restore\x20local\x20script\x20\x22'+_0x435612+_0xb13fe9(0x16c)+_0xa7103c[_0xb13fe9(0x144)]));}return _0x5d6053;}};}function withRollbackErrors(_0x29802f,_0x4b9994,_0x4cc174){const _0x285d78=a43_0x24931b,_0x5c400a=_0x29802f instanceof Error?_0x29802f:new Error(String(_0x29802f));if(_0x4cc174[_0x285d78(0x1a8)]===0x0)return _0x5c400a;return new AggregateError([_0x5c400a,..._0x4cc174],_0x4b9994+_0x285d78(0x1ab)+_0x4cc174['map'](_0x3cacef=>_0x3cacef[_0x285d78(0x144)])[_0x285d78(0x18d)](';\x20'));}function buildDatasetCodeToAliasMap(_0x3f59c4,_0x51ce40,_0xb732cb){const _0x196d90=a43_0x24931b,_0x11995e=resolveApiModelSource(_0x3f59c4,_0x51ce40,_0xb732cb),_0x3d2688=loadAliasMap(_0x3f59c4,undefined,_0x11995e[_0x196d90(0x1a3)],_0x11995e[_0x196d90(0x138)]);return assertUnambiguousHookAliases(_0x3d2688),new Map(_0x3d2688[_0x196d90(0x155)](_0x2c8db4=>[_0x2c8db4[_0x196d90(0x1a7)]['toLowerCase'](),_0x2c8db4[_0x196d90(0x15a)]]));}async function planHookDirectoryMigration(_0x13a586,_0x5cdf2f,_0x3656e4,_0x5832af){const _0x31834b=a43_0x24931b,_0xc87570=new Map();for(const [_0x3f8a39,_0x534a76]of Object['entries'](_0x5cdf2f[_0x31834b(0x1c2)])){const [_0x3b4026,_0x28e98a,_0x386c9c,_0x523d1b,_0x2e1078,..._0x4948aa]=_0x3f8a39[_0x31834b(0x13b)]('/');if(_0x3b4026!==_0x31834b(0x178)||!_0x28e98a||!_0x386c9c||!_0x523d1b||!_0x2e1078||_0x4948aa[_0x31834b(0x1a8)]>0x0||!_0x534a76['datasetCode'])continue;const _0x48546d=_0x3656e4[_0x31834b(0x1b0)](_0x534a76['datasetCode'][_0x31834b(0x137)]()),_0xb26d32=_0x48546d??_0x534a76['datasetCode'];if(!isSafeHookDirectorySegment(_0x28e98a))throw CliErrors['validation'](_0x31834b(0x15d)+_0x28e98a+_0x31834b(0x15f));if(!isSafeHookDirectorySegment(_0xb26d32))throw CliErrors[_0x31834b(0x1b3)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x28e98a+_0x31834b(0x1a1));if(_0x28e98a===_0xb26d32)continue;const _0x44af37=_0xc87570[_0x31834b(0x1b0)](_0x28e98a)??{'datasetCode':_0x534a76[_0x31834b(0x1a7)],'alias':_0x48546d,'keyChanges':[]};if(_0x44af37[_0x31834b(0x1a7)]!==_0x534a76[_0x31834b(0x1a7)])throw CliErrors[_0x31834b(0x1b3)](_0x31834b(0x197)+_0x28e98a+_0x31834b(0x141));const _0x1c42a3='HOOK/'+_0xb26d32+'/'+_0x386c9c+'/'+_0x523d1b+'/'+_0x2e1078;try{resolveLocalFilePathFromLockKey(_0x13a586,_0x3f8a39),resolveLocalFilePathFromLockKey(_0x13a586,_0x1c42a3);}catch(_0x5bd3a5){throw CliErrors['validation']('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x3f8a39+_0x31834b(0x16c)+(_0x5bd3a5 instanceof Error?_0x5bd3a5[_0x31834b(0x144)]:String(_0x5bd3a5)));}_0x44af37[_0x31834b(0x13f)][_0x31834b(0x15b)]({'oldLockKey':_0x3f8a39,'newLockKey':_0x1c42a3,'entry':_0x534a76}),_0xc87570[_0x31834b(0x16e)](_0x28e98a,_0x44af37);}const _0x26730d=new Set([..._0xc87570['values']()]['flatMap'](_0x27aafa=>_0x27aafa[_0x31834b(0x13f)]['map'](_0x23f4c8=>_0x23f4c8['oldLockKey']))),_0x2a0cd3=new Map(),_0x5f504b=new Map();for(const [_0x5c2ca4,_0x40bd11]of _0xc87570){const _0x2dd0ae=_0x40bd11[_0x31834b(0x15a)]??_0x40bd11[_0x31834b(0x1a7)],_0x4b5d59=hookDirectoryIdentity(_0x2dd0ae),_0x27b5f6=_0x2a0cd3[_0x31834b(0x1b0)](_0x4b5d59);if(_0x27b5f6&&_0x27b5f6!==_0x5c2ca4)throw CliErrors[_0x31834b(0x1b3)]('Cannot\x20migrate\x20HOOK\x20directories\x20\x22'+_0x27b5f6+_0x31834b(0x148)+_0x5c2ca4+'\x22:\x20both\x20target\x20\x22'+_0x2dd0ae+_0x31834b(0x174));_0x2a0cd3['set'](_0x4b5d59,_0x5c2ca4);for(const _0x561e97 of _0x40bd11[_0x31834b(0x13f)]){const _0x402d4c=_0x5f504b[_0x31834b(0x1b0)](_0x561e97[_0x31834b(0x198)]);if(_0x402d4c&&_0x402d4c!==_0x561e97[_0x31834b(0x19f)])throw CliErrors[_0x31834b(0x1b3)](_0x31834b(0x12d)+_0x402d4c+_0x31834b(0x148)+_0x561e97[_0x31834b(0x19f)]+_0x31834b(0x194)+_0x561e97['newLockKey']+_0x31834b(0x176));if(_0x26730d['has'](_0x561e97[_0x31834b(0x198)]))throw CliErrors[_0x31834b(0x1b3)]('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x561e97[_0x31834b(0x19f)]+_0x31834b(0x187)+_0x561e97[_0x31834b(0x198)]+_0x31834b(0x1ac));_0x5f504b[_0x31834b(0x16e)](_0x561e97[_0x31834b(0x198)],_0x561e97[_0x31834b(0x19f)]);}}const _0x31fdc1=new Map();for(const [_0x583420,_0x125599]of _0x3656e4){_0x31fdc1[_0x31834b(0x16e)](hookDirectoryIdentity(_0x125599),_0x583420);}const _0x3c897d=[];for(const [_0x24904d,_0x2d2bb0]of _0xc87570){const _0x58fb5b=_0x2d2bb0[_0x31834b(0x15a)]??_0x2d2bb0[_0x31834b(0x1a7)],_0x5f2ca8=join(_0x13a586[_0x31834b(0x1c0)],'HOOK',_0x24904d),_0x23a1e7=join(_0x13a586['scriptsRootDir'],_0x31834b(0x178),_0x58fb5b),_0x47eddf=await directoryExists(_0x5f2ca8),_0x2046de=await directoryExists(_0x23a1e7),_0x281e0b=_0x47eddf?_0x2046de?await sameDirectory(_0x5f2ca8,_0x23a1e7)?_0x31834b(0x13e):undefined:_0x31834b(0x159):_0x31834b(0x133);if(!_0x281e0b)throw CliErrors[_0x31834b(0x1b3)](_0x31834b(0x197)+_0x24904d+_0x31834b(0x153)+_0x58fb5b+_0x31834b(0x16a));const _0xf8a4c8=_0x31fdc1[_0x31834b(0x1b0)](hookDirectoryIdentity(_0x24904d));if(_0xf8a4c8&&_0xf8a4c8!==_0x2d2bb0[_0x31834b(0x1a7)][_0x31834b(0x137)]()){const _0x1e7555=new Set(_0x2d2bb0[_0x31834b(0x13f)][_0x31834b(0x155)](_0x357a24=>_0x357a24[_0x31834b(0x19f)])),_0x16ab13=_0x5832af[_0x31834b(0x170)](_0x640f4c=>_0x640f4c[_0x31834b(0x1a2)]===_0x31834b(0x178)&&_0x640f4c[_0x31834b(0x15a)]!=null&&hookDirectoryIdentity(_0x640f4c[_0x31834b(0x15a)])===hookDirectoryIdentity(_0x24904d)&&!_0x1e7555[_0x31834b(0x142)](_0x640f4c['lockKey']));if(_0x16ab13['length']>0x0)throw CliErrors[_0x31834b(0x1b3)](_0x31834b(0x197)+_0x24904d+_0x31834b(0x19c));}const _0xefa526=_0x31fdc1[_0x31834b(0x1b0)](hookDirectoryIdentity(_0x58fb5b));if(_0xefa526&&_0xefa526!==_0x2d2bb0[_0x31834b(0x1a7)][_0x31834b(0x137)]())throw CliErrors['validation'](_0x31834b(0x197)+_0x24904d+_0x31834b(0x153)+_0x58fb5b+_0x31834b(0x1a5));for(const _0xa706d2 of _0x2d2bb0[_0x31834b(0x13f)]){const _0x41adf3=_0x5cdf2f['functions'][_0xa706d2[_0x31834b(0x198)]];if(_0x41adf3&&!_0x26730d[_0x31834b(0x142)](_0xa706d2[_0x31834b(0x198)])&&!sameHookIdentity(_0xa706d2[_0x31834b(0x189)],_0x41adf3))throw CliErrors[_0x31834b(0x1b3)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x24904d+_0x31834b(0x153)+_0x58fb5b+_0x31834b(0x152));}_0x3c897d[_0x31834b(0x15b)]({'oldDirectory':_0x24904d,'newDirectory':_0x58fb5b,'oldDirectoryPath':_0x5f2ca8,'newDirectoryPath':_0x23a1e7,'mode':_0x281e0b,'alias':_0x2d2bb0[_0x31834b(0x15a)],'keyChanges':_0x2d2bb0[_0x31834b(0x13f)]});}const _0x496a0d={..._0x5cdf2f[_0x31834b(0x1c2)]},_0x33a27c=new Map(),_0x389b90=new Map();for(const _0x210164 of _0x3c897d){const _0x580cb9=_0x210164['mode']!==_0x31834b(0x133);_0x580cb9&&_0x389b90[_0x31834b(0x16e)](hookDirectoryIdentity(_0x210164[_0x31834b(0x177)]),_0x210164[_0x31834b(0x1bc)]);for(const _0x27426b of _0x210164[_0x31834b(0x13f)]){const _0x3c8f6b=_0x496a0d[_0x27426b[_0x31834b(0x198)]],_0x362585=_0x580cb9?_0x27426b[_0x31834b(0x189)]:_0x3c8f6b??_0x27426b[_0x31834b(0x189)];_0x496a0d[_0x27426b['newLockKey']]=canonicalizeHookEntry(_0x362585,_0x210164[_0x31834b(0x15a)]),delete _0x496a0d[_0x27426b['oldLockKey']],_0x580cb9&&_0x33a27c[_0x31834b(0x16e)](_0x27426b[_0x31834b(0x198)],resolveLocalFilePathFromLockKey(_0x13a586,_0x27426b['oldLockKey']));}}return{'migrations':_0x3c897d,'projectedFunctions':_0x496a0d,'sourceFilePathByNewLockKey':_0x33a27c,'sourceDirectoryPathByNewDirectory':_0x389b90};}function resolveMigratedSourceFilePath(_0xdc9b3b,_0x2c8ff1){const _0x411685=a43_0x24931b;if(!_0xdc9b3b||!_0x2c8ff1)return undefined;const _0x7d0ecb=_0xdc9b3b[_0x411685(0x1a9)]['get'](_0x2c8ff1['lockKey']);if(_0x7d0ecb)return _0x7d0ecb;if(_0x2c8ff1['type']!==_0x411685(0x178))return undefined;const [,_0x538283,..._0x2d0dd9]=_0x2c8ff1[_0x411685(0x19a)][_0x411685(0x13b)]('/');if(!_0x538283||_0x2d0dd9[_0x411685(0x1a8)]===0x0)return undefined;const _0x1c6695=_0xdc9b3b[_0x411685(0x131)]['get'](hookDirectoryIdentity(_0x538283));return _0x1c6695?join(_0x1c6695,..._0x2d0dd9)+_0x411685(0x1b6):undefined;}function sameHookIdentity(_0x4e1220,_0x255139){const _0x314367=a43_0x24931b;return _0x4e1220[_0x314367(0x168)]===_0x255139[_0x314367(0x168)]&&_0x4e1220[_0x314367(0x1a7)]===_0x255139['datasetCode']&&_0x4e1220[_0x314367(0x140)]===_0x255139[_0x314367(0x140)]&&_0x4e1220[_0x314367(0x18b)]===_0x255139['functionNode'];}function canonicalizeHookEntry(_0x57418a,_0x30e430){const {alias:_0x3c34df,..._0x519bd5}=_0x57418a;return _0x30e430?{..._0x519bd5,'alias':_0x30e430}:_0x519bd5;}function hookDirectoryIdentity(_0x3e1f9c){const _0x500dc4=a43_0x24931b;return _0x3e1f9c['normalize'](_0x500dc4(0x147))[_0x500dc4(0x137)]();}function isSafeHookDirectorySegment(_0x3c5c5c){return isSafeLockKeySegment(_0x3c5c5c);}async function sameDirectory(_0xcf3a5e,_0x2c9ca6){const _0x5d96e0=a43_0x24931b,[_0x589e4f,_0x37b295]=await Promise[_0x5d96e0(0x16d)]([stat(_0xcf3a5e),stat(_0x2c9ca6)]);return _0x589e4f[_0x5d96e0(0x181)]===_0x37b295[_0x5d96e0(0x181)]&&_0x589e4f['ino']===_0x37b295[_0x5d96e0(0x188)];}async function applyHookDirectoryMigration(_0x38a731,_0x51a5d8){const _0x15a1ae=a43_0x24931b,_0x4938b4=_0x51a5d8[_0x15a1ae(0x1c2)],_0x1059ca=_0x51a5d8[_0x15a1ae(0x12f)],_0x5d4b9e=[],_0x494612=async()=>{const _0x2acb31=_0x15a1ae,_0x370a47=[];_0x51a5d8[_0x2acb31(0x1c2)]=_0x4938b4,_0x51a5d8[_0x2acb31(0x12f)]=_0x1059ca;for(const {migration:_0x1ecb78,temporaryPath:_0x392215}of[..._0x5d4b9e][_0x2acb31(0x18a)]()){try{_0x392215?(await rename(_0x1ecb78[_0x2acb31(0x17b)],_0x392215),await rename(_0x392215,_0x1ecb78[_0x2acb31(0x1bc)])):await rename(_0x1ecb78[_0x2acb31(0x17b)],_0x1ecb78[_0x2acb31(0x1bc)]);}catch(_0x1ea17a){_0x370a47[_0x2acb31(0x15b)](new Error('Could\x20not\x20restore\x20HOOK\x20directory\x20\x22'+_0x1ecb78['oldDirectory']+_0x2acb31(0x183)+_0x1ecb78['newDirectory']+_0x2acb31(0x16c)+(_0x1ea17a instanceof Error?_0x1ea17a[_0x2acb31(0x144)]:String(_0x1ea17a))));}}return _0x370a47;};try{for(const _0x29b3f7 of _0x38a731['migrations']){if(_0x29b3f7['mode']===_0x15a1ae(0x159))await ensureParentDirectory(_0x29b3f7[_0x15a1ae(0x17b)]),await rename(_0x29b3f7[_0x15a1ae(0x1bc)],_0x29b3f7[_0x15a1ae(0x17b)]),_0x5d4b9e[_0x15a1ae(0x15b)]({'migration':_0x29b3f7});else{if(_0x29b3f7[_0x15a1ae(0x16f)]===_0x15a1ae(0x13e)){const _0x4489e9=join(dirname(_0x29b3f7[_0x15a1ae(0x1bc)]),_0x15a1ae(0x193)+randomUUID());await rename(_0x29b3f7[_0x15a1ae(0x1bc)],_0x4489e9);try{await rename(_0x4489e9,_0x29b3f7[_0x15a1ae(0x17b)]);}catch(_0x38b0c1){try{await rename(_0x4489e9,_0x29b3f7[_0x15a1ae(0x1bc)]);}catch(_0x3ea809){throw withRollbackErrors(_0x38b0c1,_0x15a1ae(0x156)+_0x29b3f7['oldDirectory']+_0x15a1ae(0x153)+_0x29b3f7[_0x15a1ae(0x177)]+'\x22;\x20temporary\x20directory\x20\x22'+_0x4489e9+_0x15a1ae(0x14c),[new Error('Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22'+_0x4489e9+_0x15a1ae(0x153)+_0x29b3f7[_0x15a1ae(0x17e)]+'\x22:\x20'+(_0x3ea809 instanceof Error?_0x3ea809[_0x15a1ae(0x144)]:String(_0x3ea809)))]);}throw _0x38b0c1;}_0x5d4b9e[_0x15a1ae(0x15b)]({'migration':_0x29b3f7,'temporaryPath':_0x4489e9});}}}return _0x51a5d8[_0x15a1ae(0x1c2)]=_0x38a731[_0x15a1ae(0x1b7)],{'rollback':_0x494612};}catch(_0x8c45a1){const _0x3bd0d4=await _0x494612();throw withRollbackErrors(_0x8c45a1,_0x15a1ae(0x1bf),_0x3bd0d4);}}async function confirmForce(){const _0x55ade6=a43_0x24931b,_0x37a9cb=createInterface({'input':process[_0x55ade6(0x18c)],'output':process['stderr']}),_0x3fe47c=await new Promise(_0x45c4f3=>{const _0x3a15b1=_0x55ade6;_0x37a9cb[_0x3a15b1(0x172)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x45c4f3);});return _0x37a9cb[_0x55ade6(0x1b8)](),['y','yes'][_0x55ade6(0x14a)](_0x3fe47c[_0x55ade6(0x132)]()[_0x55ade6(0x137)]());}
|
|
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)]());}
|