@lovrabet/rabetbase-cli 2.5.11-beta.1 → 2.5.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.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/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.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/page-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/context.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/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.d.ts +1 -0
- 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-analysis.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/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.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.d.ts +2 -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/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.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/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/references/rabetbase-kb.md +1 -1
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x471457=a34_0x30ce;(function(_0x202742,_0x479d1a){const _0x854080=a34_0x30ce,_0x22106d=_0x202742();while(!![]){try{const _0x4ddac0=-parseInt(_0x854080(0x1cb))/0x1+parseInt(_0x854080(0x1d9))/0x2*(parseInt(_0x854080(0x1dd))/0x3)+parseInt(_0x854080(0x1da))/0x4*(parseInt(_0x854080(0x1e5))/0x5)+-parseInt(_0x854080(0x1cf))/0x6+-parseInt(_0x854080(0x1e1))/0x7+parseInt(_0x854080(0x1d0))/0x8*(-parseInt(_0x854080(0x1d1))/0x9)+parseInt(_0x854080(0x1e4))/0xa;if(_0x4ddac0===_0x479d1a)break;else _0x22106d['push'](_0x22106d['shift']());}catch(_0x3d38ac){_0x22106d['push'](_0x22106d['shift']());}}}(a34_0x48d7,0xa413a));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x30ce(_0x1270e6,_0x3f171d){_0x1270e6=_0x1270e6-0x1ca;const _0x48d732=a34_0x48d7();let _0x30cefb=_0x48d732[_0x1270e6];return _0x30cefb;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a34_0x48d7(){const _0x5b4728=['9578680mkORaF','15GJZqEW','POST','Updated','417671XFaHgv','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','number','\x20app\x20config\x20','1836432Drccon','50488CpOAkL','153oEncMz',',\x20appCode=','App\x20config\x20server\x20id\x20missing\x20for\x20key=','file','string','get','appCode','update','4QfBkrc','215712XERgMd','set','tags','1636716ZVtTby','isFinite','Created','apiError','4953956QoOPIa','write','create'];a34_0x48d7=function(){return _0x5b4728;};return a34_0x48d7();}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='/smartapi/app-config/create',UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':'app-config','command':a34_0x471457(0x1db),'description':a34_0x471457(0x1cc),'risk':a34_0x471457(0x1e2),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x471457(0x1d4),'type':a34_0x471457(0x1d5),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x41bf78){readKeyArg(_0x41bf78),readOptionalTags(_0x41bf78),assertSingleValueSource(_0x41bf78);},async 'dryRun'(_0x2d07a9){const _0x136d57=a34_0x471457,_0x4fdc57=readKeyArg(_0x2d07a9),_0x1fb75d=readOptionalTags(_0x2d07a9),_0x470b12=assertSingleValueSource(_0x2d07a9);await assertValueSourceReadable(_0x470b12);const _0x1628d1=await withAppConfigApiBoundary(_0x136d57(0x1d6),{'appCode':_0x2d07a9['appCode'],'key':_0x4fdc57},()=>getAppConfigByKey(_0x2d07a9[_0x136d57(0x1d7)],_0x4fdc57)),_0x793fb0=_0x1628d1?'update':_0x136d57(0x1e3),_0x11b8cf=_0x1628d1?projectAppConfig(_0x1628d1):null,_0x2d2908=plannedAppConfig({'appCode':_0x2d07a9[_0x136d57(0x1d7)],'key':_0x4fdc57,'tags':_0x1fb75d??_0x1628d1?.[_0x136d57(0x1dc)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x793fb0,'appCode':_0x2d07a9[_0x136d57(0x1d7)],'key':_0x4fdc57,'before':_0x11b8cf,'after':_0x2d2908,'dryRun':!![]}),{'method':_0x136d57(0x1e6),'url':_0x793fb0===_0x136d57(0x1d8)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x18e794){const _0x51515d=a34_0x471457,_0x4768a5=readKeyArg(_0x18e794),_0x592a3a=readOptionalTags(_0x18e794),_0x233614=await withAppConfigApiBoundary(_0x51515d(0x1d6),{'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5},()=>getAppConfigByKey(_0x18e794[_0x51515d(0x1d7)],_0x4768a5)),_0x55ca7c=_0x233614?projectAppConfig(_0x233614):null,_0x1f9fe2=_0x233614?_0x51515d(0x1d8):'create',{value:_0x2a74b4,warnings:_0x4ecaf0}=await readAppConfigValue(_0x18e794),_0x321d1f={'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5,'value':_0x2a74b4,'tags':_0x592a3a??_0x233614?.['tags']??undefined};await withAppConfigApiBoundary(_0x1f9fe2,{'appCode':_0x18e794['appCode'],'key':_0x4768a5},async()=>{const _0xebe1aa=_0x51515d;_0x233614?await updateAppConfig({..._0x321d1f,'id':requireAppConfigId(_0x233614,_0x4768a5,_0x18e794[_0xebe1aa(0x1d7)])}):await createAppConfig(_0x321d1f);});const _0x4f430c=await withAppConfigApiBoundary(_0x51515d(0x1d6),{'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5},()=>getAppConfigByKey(_0x18e794[_0x51515d(0x1d7)],_0x4768a5)),_0x533800=_0x4f430c?projectAppConfig(_0x4f430c):plannedAppConfig({'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5,'tags':_0x321d1f[_0x51515d(0x1dc)],'hasValue':_0x2a74b4!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x1f9fe2,'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5,'before':_0x55ca7c,'after':_0x533800,'dryRun':![],'warnings':_0x4ecaf0}),'message':(_0x1f9fe2===_0x51515d(0x1d8)?_0x51515d(0x1ca):_0x51515d(0x1df))+_0x51515d(0x1ce)+_0x4768a5};}};function requireAppConfigId(_0x54a510,_0x2121a7,_0x563598){const _0x5ea31f=a34_0x471457;if(typeof _0x54a510['id']===_0x5ea31f(0x1cd)&&Number[_0x5ea31f(0x1de)](_0x54a510['id'])&&_0x54a510['id']>0x0)return _0x54a510['id'];throw CliErrors[_0x5ea31f(0x1e0)](_0x5ea31f(0x1d3)+_0x2121a7+_0x5ea31f(0x1d2)+_0x563598);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x264bb6=a35_0x1002;(function(_0x5230c6,_0x2ef422){const _0xe8e788=a35_0x1002,_0x5d0ea2=_0x5230c6();while(!![]){try{const _0x31ea05=parseInt(_0xe8e788(0xdc))/0x1+-parseInt(_0xe8e788(0xbc))/0x2+parseInt(_0xe8e788(0xc9))/0x3*(parseInt(_0xe8e788(0xba))/0x4)+-parseInt(_0xe8e788(0xc1))/0x5*(-parseInt(_0xe8e788(0xbd))/0x6)+parseInt(_0xe8e788(0xd6))/0x7*(-parseInt(_0xe8e788(0xab))/0x8)+-parseInt(_0xe8e788(0xda))/0x9*(parseInt(_0xe8e788(0xe2))/0xa)+-parseInt(_0xe8e788(0xb0))/0xb;if(_0x31ea05===_0x2ef422)break;else _0x5d0ea2['push'](_0x5d0ea2['shift']());}catch(_0x4f13e4){_0x5d0ea2['push'](_0x5d0ea2['shift']());}}}(a35_0x566e,0x6c3b9));function a35_0x566e(){const _0x37f119=['argument','path','tags','value','\x20app\x20config.','error','key','Value\x20file\x20is\x20not\x20readable:\x20','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','21DqoVdy','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','reveal','validation','7029171lqRYmw','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','707803JWXeSN','name','url','Read\x20config\x20value\x20from\x20stdin','key:\x20','appCode','10DInBSC','length','str','appCode:\x20','args','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','push','Missing\x20app-config\x20key.','Environment\x20variable\x20is\x20not\x20set:\x20','609536hKxAyT','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Failed\x20to\x20','boolean','Config\x20tags\x20for\x20filtering/display\x20metadata','1313598BkKiKN','trim','Runtime\x20app-config\x20key','valueRedacted','bool','operation','stdin','flag','gmtCreate','hasValue','482948uqzzKT','value\x20is\x20redacted','925176GFWcMg','578352PJEVIG','once','from-env','apiError','25pDGjez','join','gmtModified','end','env','warnings','kind','file','21rKHvHq','dryRun','after','defineProperties'];a35_0x566e=function(){return _0x37f119;};return a35_0x566e();}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x264bb6(0xd3),'description':a35_0x264bb6(0xb2),'required':!![]};export const VALUE_ARG={'name':a35_0x264bb6(0xd0),'description':a35_0x264bb6(0xdb),'required':![]};export const TAGS_FLAG={'name':a35_0x264bb6(0xcf),'type':'string','description':a35_0x264bb6(0xaf)};export const STDIN_FLAG={'name':a35_0x264bb6(0xb6),'type':a35_0x264bb6(0xae),'description':a35_0x264bb6(0xdf),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x264bb6(0xbf),'type':'string','description':a35_0x264bb6(0xac)};export const REVEAL_FLAG={'name':a35_0x264bb6(0xd8),'type':a35_0x264bb6(0xae),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x45d924){const _0x21e76e=a35_0x264bb6,_0x57f069=_0x45d924[_0x21e76e(0xe6)][0x0]?.['trim']()??'';return validateKey(_0x57f069),_0x57f069;}export function readOptionalTags(_0x519c72){const _0x2f7a1b=a35_0x264bb6,_0x312580=_0x519c72[_0x2f7a1b(0xe4)](_0x2f7a1b(0xcf))[_0x2f7a1b(0xb1)]();if(!_0x312580)return undefined;if(_0x312580['length']>0x20)throw CliErrors[_0x2f7a1b(0xd9)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x312580;}export function validateKey(_0x4c3d50){const _0x5ca42f=a35_0x264bb6;if(!_0x4c3d50)throw CliErrors['validation'](_0x5ca42f(0xe9));if(_0x4c3d50['length']>0x100)throw CliErrors[_0x5ca42f(0xd9)](_0x5ca42f(0xd7));}export function projectAppConfig(_0x5d2f61,_0x2d93ab){const _0x192be4=a35_0x264bb6,_0x256f2e=_0x5d2f61['value']!==undefined&&_0x5d2f61[_0x192be4(0xd0)]!==null&&_0x5d2f61['value']!=='',_0x49cadd={'appCode':_0x5d2f61[_0x192be4(0xe1)],'key':_0x5d2f61['key'],'tags':_0x5d2f61[_0x192be4(0xcf)]??undefined,'hasValue':_0x256f2e,'valueRedacted':_0x256f2e&&!_0x2d93ab?.['reveal'],'gmtCreate':_0x5d2f61[_0x192be4(0xb8)],'gmtModified':_0x5d2f61[_0x192be4(0xc3)]};return _0x2d93ab?.[_0x192be4(0xd8)]&&(_0x49cadd['value']=_0x5d2f61[_0x192be4(0xd0)]??'',_0x49cadd[_0x192be4(0xb3)]=![]),_0x49cadd;}export function plannedAppConfig(_0x2438f5){const _0x305878=a35_0x264bb6,_0x4c8e6d=_0x2438f5[_0x305878(0xb9)]??!![];return{'appCode':_0x2438f5[_0x305878(0xe1)],'key':_0x2438f5[_0x305878(0xd3)],'tags':_0x2438f5[_0x305878(0xcf)]??undefined,'hasValue':_0x4c8e6d,'valueRedacted':_0x4c8e6d};}export function buildMutationData(_0x215291){const _0x305ae2=a35_0x264bb6;return{'operation':_0x215291[_0x305ae2(0xb5)],'selector':{'appCode':_0x215291[_0x305ae2(0xe1)],'key':_0x215291[_0x305ae2(0xd3)]},'before':_0x215291['before'],'after':_0x215291[_0x305ae2(0xcb)],'dryRun':_0x215291[_0x305ae2(0xca)],'warnings':_0x215291[_0x305ae2(0xc6)]??[]};}export async function withAppConfigApiBoundary(_0x5c424c,_0x1e3319,_0x5e0675){const _0x175174=a35_0x264bb6;try{return await _0x5e0675();}catch{const _0x1627e7=[_0x175174(0xe5)+_0x1e3319[_0x175174(0xe1)]];if(_0x1e3319['key'])_0x1627e7['push'](_0x175174(0xe0)+_0x1e3319[_0x175174(0xd3)]);_0x1627e7[_0x175174(0xe8)](_0x175174(0xbb));throw CliErrors[_0x175174(0xc0)](_0x175174(0xad)+_0x5c424c+_0x175174(0xd1),_0x1627e7[_0x175174(0xc2)](';\x20')+'.');}}function a35_0x1002(_0x308835,_0x707daa){_0x308835=_0x308835-0xab;const _0x566ede=a35_0x566e();let _0x1002fd=_0x566ede[_0x308835];return _0x1002fd;}export function asAppConfigDryRunResult(_0x1de12c,_0x3aa7c5){const _0x527146=a35_0x264bb6;return Object[_0x527146(0xcc)](_0x1de12c,{'method':{'value':_0x3aa7c5['method'],'enumerable':![]},'url':{'value':_0x3aa7c5[_0x527146(0xde)],'enumerable':![]}});}export function assertSingleValueSource(_0xab51d2){const _0x3426da=a35_0x264bb6,_0x5d292d=[];_0xab51d2['args'][_0x3426da(0xe3)]>0x1&&_0x5d292d[_0x3426da(0xe8)]({'kind':_0x3426da(0xcd),'value':_0xab51d2[_0x3426da(0xe6)]['slice'](0x1)['join']('\x20')});const _0x19952c=_0xab51d2[_0x3426da(0xb7)](_0x3426da(0xd0));_0x19952c!==undefined&&_0x19952c!==null&&_0x5d292d[_0x3426da(0xe8)]({'kind':_0x3426da(0xcd),'value':String(_0x19952c)});_0xab51d2[_0x3426da(0xb4)](_0x3426da(0xb6))&&_0x5d292d[_0x3426da(0xe8)]({'kind':'stdin'});const _0x4e3f2b=_0xab51d2[_0x3426da(0xe4)](_0x3426da(0xbf))[_0x3426da(0xb1)]();_0x4e3f2b&&_0x5d292d['push']({'kind':_0x3426da(0xc5),'name':_0x4e3f2b});const _0x5e3c44=_0xab51d2[_0x3426da(0xe4)](_0x3426da(0xc8))[_0x3426da(0xb1)]();_0x5e3c44&&_0x5d292d['push']({'kind':_0x3426da(0xc8),'path':_0x5e3c44});if(_0x5d292d[_0x3426da(0xe3)]===0x0)throw CliErrors['validation']('Missing\x20app-config\x20value\x20source.',_0x3426da(0xd5));if(_0x5d292d[_0x3426da(0xe3)]>0x1)throw CliErrors[_0x3426da(0xd9)]('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x3426da(0xe7));return _0x5d292d[0x0];}export async function assertValueSourceReadable(_0x4271b3){const _0x7e4d27=a35_0x264bb6;if(_0x4271b3[_0x7e4d27(0xc7)]===_0x7e4d27(0xc5)&&!(_0x4271b3[_0x7e4d27(0xdd)]in process.env))throw CliErrors['validation']('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x4271b3[_0x7e4d27(0xdd)]);if(_0x4271b3[_0x7e4d27(0xc7)]===_0x7e4d27(0xc8))try{await access(_0x4271b3['path']);}catch{throw CliErrors[_0x7e4d27(0xd9)](_0x7e4d27(0xd4)+_0x4271b3[_0x7e4d27(0xce)]);}}export async function readAppConfigValue(_0x35554c){const _0x1f5562=a35_0x264bb6,_0x2957df=assertSingleValueSource(_0x35554c),_0x3ef0aa=[];if(_0x2957df[_0x1f5562(0xc7)]===_0x1f5562(0xcd))return _0x3ef0aa[_0x1f5562(0xe8)]('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x2957df[_0x1f5562(0xd0)]??'','source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};if(_0x2957df['kind']===_0x1f5562(0xb6))return{'value':await readStdin(),'source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};if(_0x2957df[_0x1f5562(0xc7)]===_0x1f5562(0xc5)){if(!(_0x2957df[_0x1f5562(0xdd)]in process.env))throw CliErrors[_0x1f5562(0xd9)](_0x1f5562(0xea)+_0x2957df[_0x1f5562(0xdd)]);return{'value':process.env[_0x2957df.name]??'','source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};}return{'value':await readFile(_0x2957df[_0x1f5562(0xce)],'utf8'),'source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};}function readStdin(){return new Promise((_0x116ac2,_0x5b14d8)=>{const _0x575c72=a35_0x1002;let _0x28d462='';process['stdin']['setEncoding']('utf8'),process[_0x575c72(0xb6)]['on']('data',_0x2c2ae5=>{_0x28d462+=_0x2c2ae5;}),process['stdin'][_0x575c72(0xbe)](_0x575c72(0xc4),()=>_0x116ac2(_0x28d462)),process['stdin'][_0x575c72(0xbe)](_0x575c72(0xd2),_0x5b14d8);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2dee4d=a36_0x2042;(function(_0x144d45,_0x4d3c9b){const _0x27df1a=a36_0x2042,_0x37a8d3=_0x144d45();while(!![]){try{const _0x45b85=parseInt(_0x27df1a(0x1b6))/0x1+-parseInt(_0x27df1a(0x1b1))/0x2*(-parseInt(_0x27df1a(0x1b8))/0x3)+-parseInt(_0x27df1a(0x1b9))/0x4*(-parseInt(_0x27df1a(0x1ba))/0x5)+parseInt(_0x27df1a(0x1c5))/0x6+parseInt(_0x27df1a(0x1be))/0x7*(parseInt(_0x27df1a(0x1c6))/0x8)+parseInt(_0x27df1a(0x1bb))/0x9*(-parseInt(_0x27df1a(0x1bc))/0xa)+-parseInt(_0x27df1a(0x1b3))/0xb;if(_0x45b85===_0x4d3c9b)break;else _0x37a8d3['push'](_0x37a8d3['shift']());}catch(_0x59bc84){_0x37a8d3['push'](_0x37a8d3['shift']());}}}(a36_0x1d3b,0x82a95));function a36_0x2042(_0x19e88a,_0x146390){_0x19e88a=_0x19e88a-0x1b0;const _0x1d3be5=a36_0x1d3b();let _0x204237=_0x1d3be5[_0x19e88a];return _0x204237;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':a36_0x2dee4d(0x1b2),'risk':a36_0x2dee4d(0x1c2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x2dee4d(0x1c3),'type':a36_0x2dee4d(0x1bf),'description':a36_0x2dee4d(0x1c1),'default':![]}],async 'execute'(_0x4e36b0){const _0x153ca6=a36_0x2dee4d,{runAuthServer:_0x3b4554}=await import(_0x153ca6(0x1b0));return await _0x3b4554({'autoYes':_0x4e36b0['bool'](_0x153ca6(0x1c3)),'nonInteractive':_0x4e36b0[_0x153ca6(0x1b4)]}),{'ok':!![]};}},{'service':a36_0x2dee4d(0x1bd),'command':'logout','description':a36_0x2dee4d(0x1c4),'risk':a36_0x2dee4d(0x1c2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x296aa5){const _0x2192e8=a36_0x2dee4d;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x2192e8(0x1b7)](_0x2192e8(0x1b5))):console['log'](_0x2192e8(0x1c0)),{'ok':!![]};}}];function a36_0x1d3b(){const _0x435159=['785067gLFPWd','log','3069591ZKcLlB','1055588hhJbom','10dfkJGT','9EfDhtT','9895780GMetMo','auth','1009211qYkMPv','boolean','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','write','yes','Clear\x20login\x20session','4110006RCRcUD','24FbOJOk','../../auth/auth-server-ui.js','2onQMax','Login\x20via\x20browser','21216921FwYHGx','nonInteractive','✓\x20Logged\x20out'];a36_0x1d3b=function(){return _0x435159;};return a36_0x1d3b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a37_0x5859(){const _0x51e10a=['/HOOK/','COMMON','datasetId','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','stdin','\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','当前响应结果','alias','isInteger','write','修改后的请求参数','\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','/data/dataset/','nonInteractive','length','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Available\x20aliases:\x20','ENDPOINT','当前请求参数','Script\x20description','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','entries','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Invalid\x20function\x20name\x20\x22','functionNode','currentApp','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x22\x20not\x20found.\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[平台配置]\x20','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','close','965132ghHtDU','Alias\x20\x22','\x20function:\x20','Select\x20operation\x20type:','str','Select\x20dataset:','after','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x22\x20not\x20found\x20for\x20dataset\x20','File\x20already\x20exists:\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','/**\x0a\x20*\x20','No\x20model\x20aliases\x20found.\x20Run\x20`','\x22,\x20params\x20})\x0a','question','trim','map','description','datasetcode','Created\x20','2221065oHGEfy','string','1278498WXuwtK','validation','6093488uMqsID','profileName','.js','filePath','type','datasetCode','before','2ykqmPu','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','mergedCli','operationType','defaultApp','Script\x20type','scriptsRootDir','UNKNOWN','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Select\x20trigger\x20node:','operation-type','19316zedoGE','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','HOOK\x20requires\x20alias/operation/node\x20options.','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','read','修改后的响应结果','source','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','stderr','11707206CCSJDb','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','1905qHlKPy','tableName','selectedAppName','HOOK',']\x20(','bff','Invalid\x20dataset\x20selection.','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','2627199RmPKet','appCode','.js\x0a','code','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','/ENDPOINT/','apiDir','name','find','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','/COMMON/'];a37_0x5859=function(){return _0x51e10a;};return a37_0x5859();}const a37_0x30e755=a37_0x29ed;(function(_0x274b5a,_0x3f6be2){const _0x11a53e=a37_0x29ed,_0x2b0a61=_0x274b5a();while(!![]){try{const _0x2ca9ce=-parseInt(_0x11a53e(0x19c))/0x1*(-parseInt(_0x11a53e(0x1bb))/0x2)+parseInt(_0x11a53e(0x16f))/0x3+-parseInt(_0x11a53e(0x15b))/0x4*(parseInt(_0x11a53e(0x167))/0x5)+-parseInt(_0x11a53e(0x1b2))/0x6+parseInt(_0x11a53e(0x165))/0x7+-parseInt(_0x11a53e(0x1b4))/0x8+parseInt(_0x11a53e(0x1b0))/0x9;if(_0x2ca9ce===_0x3f6be2)break;else _0x2b0a61['push'](_0x2b0a61['shift']());}catch(_0x565526){_0x2b0a61['push'](_0x2b0a61['shift']());}}}(a37_0x5859,0xe6d52));function a37_0x29ed(_0x2c14f2,_0xa4e469){_0x2c14f2=_0x2c14f2-0x155;const _0x5859f3=a37_0x5859();let _0x29ed56=_0x5859f3[_0x2c14f2];return _0x29ed56;}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';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':a37_0x30e755(0x16c),'command':'create','description':a37_0x30e755(0x15e),'risk':a37_0x30e755(0x15f),'flags':[{'name':a37_0x30e755(0x1b8),'type':a37_0x30e755(0x1b1),'required':!![],'enum':['COMMON','ENDPOINT',a37_0x30e755(0x16a)],'description':a37_0x30e755(0x155)},{'name':a37_0x30e755(0x176),'type':a37_0x30e755(0x1b1),'required':!![],'description':a37_0x30e755(0x163)},{'name':a37_0x30e755(0x1ad),'type':'string','description':a37_0x30e755(0x18d)},{'name':a37_0x30e755(0x181),'type':a37_0x30e755(0x1b1),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x30e755(0x1ae),'type':'string','description':a37_0x30e755(0x1a6)},{'name':a37_0x30e755(0x15a),'type':'string','description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a37_0x30e755(0x1b1),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a37_0x30e755(0x1ba),a37_0x30e755(0x1a2)]}],async 'validate'(_0x111a67){const _0x3babaa=a37_0x30e755,_0x3d7c6a=_0x111a67[_0x3babaa(0x1a0)]('name');if(!isValidBffFunctionName(_0x3d7c6a))throw CliErrors[_0x3babaa(0x1b3)](_0x3babaa(0x191)+_0x3d7c6a+_0x3babaa(0x178));},async 'execute'(_0x745064){const _0x386af9=a37_0x30e755,_0x3bf740=loadBffProjectConfig(_0x745064[_0x386af9(0x170)]),_0x5aef45=_0x745064['str'](_0x386af9(0x1b8)),_0x3b81b5=_0x745064['str'](_0x386af9(0x176)),_0x5c1a24=_0x745064[_0x386af9(0x1a0)](_0x386af9(0x1ad))||undefined,_0x4ae82f=_0x5aef45==='HOOK'?await resolveHookOptions(_0x3bf740,_0x745064):undefined,_0x1e3253=buildFilePath(_0x3bf740,_0x5aef45,_0x3b81b5,_0x4ae82f);if(await fileExists(_0x1e3253))throw CliErrors[_0x386af9(0x1b3)](_0x386af9(0x1a5)+_0x1e3253);await mkdir(dirname(_0x1e3253),{'recursive':!![]});const _0x224563=generateTemplate(_0x5aef45,_0x3b81b5,_0x745064[_0x386af9(0x170)],_0x5c1a24,_0x4ae82f);await writeFile(_0x1e3253,_0x224563,'utf8');const _0x3cb251={'type':_0x5aef45,'name':_0x3b81b5,'path':_0x1e3253};if(_0x5c1a24)_0x3cb251['description']=_0x5c1a24;if(_0x4ae82f){if(_0x4ae82f['alias'])_0x3cb251[_0x386af9(0x181)]=_0x4ae82f[_0x386af9(0x181)];_0x3cb251[_0x386af9(0x1b9)]=_0x4ae82f[_0x386af9(0x1b9)],_0x3cb251[_0x386af9(0x1be)]=_0x4ae82f[_0x386af9(0x1be)],_0x3cb251['functionNode']=_0x4ae82f[_0x386af9(0x192)];}return{'ok':!![],'data':_0x3cb251,'message':_0x386af9(0x1af)+_0x5aef45+_0x386af9(0x19e)+_0x3b81b5};}};async function resolveHookOptions(_0x4bd916,_0x457a79){const _0xe227bd=a37_0x30e755,_0x5c5753=resolveApiModelSource(_0x457a79[_0xe227bd(0x175)],_0x457a79[_0xe227bd(0x170)],_0x457a79[_0xe227bd(0x169)]||_0x457a79['mergedCli']?.[_0xe227bd(0x193)]||_0x457a79[_0xe227bd(0x1bd)]?.[_0xe227bd(0x1bf)]),_0x3461ec=loadAliasMap(_0x457a79['apiDir'],undefined,_0x5c5753[_0xe227bd(0x1b7)],_0x5c5753[_0xe227bd(0x1b5)]),_0x5808a8=_0x3461ec['length']>0x0;let _0x132175,_0x529a38,_0x313442;const _0x20b693=_0x457a79[_0xe227bd(0x1a0)](_0xe227bd(0x181)),_0x5ab6f7=_0x457a79[_0xe227bd(0x1a0)](_0xe227bd(0x1ae));if(_0x20b693){const _0x4ddd8e=resolveAlias(_0x457a79['apiDir'],_0x20b693,undefined,_0x5c5753['filePath'],_0x5c5753[_0xe227bd(0x1b5)]);if(!_0x4ddd8e){const _0x4861e5=_0x5808a8?_0xe227bd(0x18a)+_0x3461ec[_0xe227bd(0x1ac)](_0x96fe93=>_0x96fe93[_0xe227bd(0x181)])['join'](',\x20'):_0xe227bd(0x1a8)+CLI_BIN_NAME+_0xe227bd(0x18e);throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x19d)+_0x20b693+_0xe227bd(0x197)+_0x4861e5);}_0x132175=_0x20b693,_0x529a38=_0x4ddd8e;}else{if(_0x5ab6f7){_0x529a38=_0x5ab6f7;const _0x1a1b0d=_0x3461ec[_0xe227bd(0x177)](_0x5d65ee=>_0x5d65ee['datasetCode']===_0x5ab6f7);_0x132175=_0x1a1b0d?.[_0xe227bd(0x181)];}else{if(_0x457a79[_0xe227bd(0x187)])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x5808a8){const _0xf6cc6=_0x3461ec[_0xe227bd(0x1ac)](_0xfae18f=>_0xfae18f[_0xe227bd(0x181)]+'\x20('+_0xfae18f[_0xe227bd(0x168)]+')'),_0x2fe9ce=await promptSelect(_0xe227bd(0x1a1),_0xf6cc6),_0x4b82a9=_0x3461ec[_0x2fe9ce];if(!_0x4b82a9)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x132175=_0x4b82a9[_0xe227bd(0x181)],_0x529a38=_0x4b82a9['datasetCode'];}else{const _0x27ad0c=await listDatasets(_0x457a79[_0xe227bd(0x170)]);if(_0x27ad0c[_0xe227bd(0x188)]===0x0)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x195));const _0x4fdc26=_0x27ad0c[_0xe227bd(0x1ac)](_0x8a9c47=>_0x8a9c47[_0xe227bd(0x176)]+'\x20['+(_0x8a9c47[_0xe227bd(0x161)]??_0xe227bd(0x157))+_0xe227bd(0x16b)+_0x8a9c47[_0xe227bd(0x172)]+')'),_0x610c6=await promptSelect(_0xe227bd(0x1a1),_0x4fdc26),_0x371907=_0x27ad0c[_0x610c6];if(!_0x371907)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x16d));_0x529a38=_0x371907[_0xe227bd(0x172)],_0x132175=undefined;}}}}const _0x580930=await listDatasets(_0x457a79[_0xe227bd(0x170)]),_0x358d66=_0x580930[_0xe227bd(0x177)](_0x4ca104=>_0x4ca104[_0xe227bd(0x172)]===_0x529a38);if(!_0x358d66)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x1a3)+_0x529a38+'\x22.\x20'+(_0x132175?_0xe227bd(0x16e)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x313442=_0x358d66['id'];const _0x16c433=_0x132175??_0x529a38,_0x173cf6=await listBffDatasetOperations(_0x457a79[_0xe227bd(0x170)],_0x313442),_0x35fb27=_0x173cf6?Object['keys'](_0x173cf6):[];if(_0x35fb27[_0xe227bd(0x188)]===0x0)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x189)+_0x16c433+'.');let _0x3f5b39;const _0x20ca1f=_0x457a79[_0xe227bd(0x1a0)]('operation-type');if(_0x20ca1f){if(!_0x35fb27['includes'](_0x20ca1f))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x20ca1f+_0xe227bd(0x1a4)+_0x16c433+'.\x20'+('Available:\x20'+_0x35fb27['join'](',\x20')));_0x3f5b39=_0x20ca1f;}else{if(_0x457a79[_0xe227bd(0x187)])throw CliErrors['validation'](_0xe227bd(0x166));const _0x472395=await promptSelect(_0xe227bd(0x19f),_0x35fb27);_0x3f5b39=_0x35fb27[_0x472395]??_0x35fb27[0x0];}let _0x1fc388=normalizeHookFunctionNode(_0x457a79[_0xe227bd(0x1a0)]('function-node'));if(!_0x1fc388){if(_0x457a79['str']('function-node'))throw CliErrors[_0xe227bd(0x1b3)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x457a79[_0xe227bd(0x187)])throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x162));const _0x174169=await promptSelect(_0xe227bd(0x159),[_0xe227bd(0x1ba),_0xe227bd(0x1a2)]);_0x1fc388=[_0xe227bd(0x1ba),_0xe227bd(0x1a2)][_0x174169]??_0xe227bd(0x1ba);}return{'alias':_0x132175,'datasetCode':_0x529a38,'datasetId':_0x313442,'operationType':_0x3f5b39,'functionNode':_0x1fc388};}async function promptSelect(_0x2153e2,_0x448d8a){const _0x1c8838=a37_0x30e755;if(_0x448d8a[_0x1c8838(0x188)]===0x1)return 0x0;for(const [_0x30579f,_0x2e5e36]of _0x448d8a[_0x1c8838(0x18f)]()){process['stderr'][_0x1c8838(0x183)]('\x20\x20'+(_0x30579f+0x1)+'.\x20'+_0x2e5e36+'\x0a');}const _0x288f88=createInterface({'input':process[_0x1c8838(0x17e)],'output':process[_0x1c8838(0x164)]});while(!![]){const _0x128f24=await new Promise(_0x59f3c0=>{const _0x3cbf66=_0x1c8838;_0x288f88[_0x3cbf66(0x1aa)](_0x2153e2+'\x20',_0x59f3c0);}),_0x30bf5d=Number['parseInt'](_0x128f24[_0x1c8838(0x1ab)](),0xa);if(Number[_0x1c8838(0x182)](_0x30bf5d)&&_0x30bf5d>=0x1&&_0x30bf5d<=_0x448d8a[_0x1c8838(0x188)])return _0x288f88[_0x1c8838(0x19b)](),_0x30bf5d-0x1;process[_0x1c8838(0x164)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x448d8a[_0x1c8838(0x188)]+'.\x0a');}}function buildFilePath(_0x63fc68,_0x578d7e,_0x1bd4c1,_0x4d3f7d){const _0x5d950a=a37_0x30e755;if(_0x578d7e===_0x5d950a(0x16a)){if(!_0x4d3f7d)throw CliErrors['validation'](_0x5d950a(0x15d));const _0x1148a4=_0x4d3f7d[_0x5d950a(0x181)]??_0x4d3f7d[_0x5d950a(0x1b9)];return join(_0x63fc68[_0x5d950a(0x156)],_0x5d950a(0x16a),_0x1148a4,_0x4d3f7d[_0x5d950a(0x1be)],_0x4d3f7d[_0x5d950a(0x192)],_0x1bd4c1+_0x5d950a(0x1b6));}return join(_0x63fc68[_0x5d950a(0x156)],_0x578d7e,_0x1bd4c1+'.js');}export function generateTemplate(_0x4c5ad1,_0x7cc6b3,_0x512973,_0x4b4557,_0x245b0e){const _0x46ecd0=a37_0x30e755,_0x154497=_0x4b4557?.[_0x46ecd0(0x1ab)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x9d72ca=getAppBaseUrl(_0x512973),_0x2b6ef5=_0x46ecd0(0x173);if(_0x4c5ad1===_0x46ecd0(0x17b))return _0x46ecd0(0x1a7)+_0x154497+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x7cc6b3+_0x46ecd0(0x199)+_0x9d72ca+_0x46ecd0(0x194)+_0x512973+_0x46ecd0(0x179)+_0x7cc6b3+_0x46ecd0(0x19a)+_0x7cc6b3+_0x46ecd0(0x1a9)+_0x2b6ef5+_0x46ecd0(0x185)+_0x7cc6b3+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x4c5ad1===_0x46ecd0(0x18b))return _0x46ecd0(0x1a7)+_0x154497+_0x46ecd0(0x196)+_0x7cc6b3+_0x46ecd0(0x15c)+_0x512973+'/'+_0x7cc6b3+_0x46ecd0(0x199)+_0x9d72ca+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x512973+_0x46ecd0(0x174)+_0x7cc6b3+_0x46ecd0(0x171)+_0x2b6ef5+_0x46ecd0(0x17f)+_0x7cc6b3+_0x46ecd0(0x17d);if(!_0x245b0e)throw CliErrors[_0x46ecd0(0x1b3)](_0x46ecd0(0x190));const _0x1ea3ca=_0x245b0e[_0x46ecd0(0x181)]??_0x245b0e['datasetCode'],_0x542b00=_0x245b0e[_0x46ecd0(0x192)]===_0x46ecd0(0x1ba)?_0x46ecd0(0x18c):_0x46ecd0(0x180),_0xe9ca03=_0x245b0e[_0x46ecd0(0x192)]===_0x46ecd0(0x1ba)?_0x46ecd0(0x184):_0x46ecd0(0x160);return _0x46ecd0(0x1a7)+_0x154497+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x7cc6b3+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x512973+'/'+_0x245b0e[_0x46ecd0(0x1b9)]+'/'+_0x245b0e[_0x46ecd0(0x1be)]+_0x46ecd0(0x199)+_0x9d72ca+_0x46ecd0(0x186)+_0x245b0e[_0x46ecd0(0x17c)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x512973+_0x46ecd0(0x17a)+_0x1ea3ca+'/'+_0x245b0e[_0x46ecd0(0x1be)]+'/'+_0x245b0e[_0x46ecd0(0x192)]+'/'+_0x7cc6b3+'.js\x0a\x20*\x20[触发节点]\x20'+_0x245b0e[_0x46ecd0(0x192)]+'\x0a'+_0x2b6ef5+_0x46ecd0(0x1bc)+_0x542b00+_0x46ecd0(0x198)+_0xe9ca03+_0x46ecd0(0x158)+_0x7cc6b3+_0x46ecd0(0x17d);}
|
|
1
|
+
const a37_0x5b05a3=a37_0x4cff;(function(_0x5b4521,_0x5d592d){const _0x72b440=a37_0x4cff,_0x472f2c=_0x5b4521();while(!![]){try{const _0x450a30=parseInt(_0x72b440(0x202))/0x1*(parseInt(_0x72b440(0x24e))/0x2)+-parseInt(_0x72b440(0x256))/0x3*(-parseInt(_0x72b440(0x1ff))/0x4)+-parseInt(_0x72b440(0x250))/0x5*(-parseInt(_0x72b440(0x21e))/0x6)+parseInt(_0x72b440(0x1ef))/0x7+parseInt(_0x72b440(0x248))/0x8+-parseInt(_0x72b440(0x222))/0x9*(parseInt(_0x72b440(0x21f))/0xa)+-parseInt(_0x72b440(0x245))/0xb;if(_0x450a30===_0x5d592d)break;else _0x472f2c['push'](_0x472f2c['shift']());}catch(_0x5b0782){_0x472f2c['push'](_0x472f2c['shift']());}}}(a37_0xeae6,0xa5cb4));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';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':a37_0x5b05a3(0x212),'command':a37_0x5b05a3(0x22c),'description':a37_0x5b05a3(0x24f),'risk':'read','flags':[{'name':'type','type':a37_0x5b05a3(0x227),'required':!![],'enum':[a37_0x5b05a3(0x1f4),a37_0x5b05a3(0x1f2),a37_0x5b05a3(0x1fe)],'description':a37_0x5b05a3(0x224)},{'name':a37_0x5b05a3(0x21c),'type':a37_0x5b05a3(0x227),'required':!![],'description':a37_0x5b05a3(0x226)},{'name':a37_0x5b05a3(0x230),'type':a37_0x5b05a3(0x227),'description':a37_0x5b05a3(0x23d)},{'name':a37_0x5b05a3(0x242),'type':'string','description':a37_0x5b05a3(0x24c)},{'name':'datasetcode','type':a37_0x5b05a3(0x227),'description':a37_0x5b05a3(0x214)},{'name':a37_0x5b05a3(0x204),'type':a37_0x5b05a3(0x227),'description':a37_0x5b05a3(0x1f3)},{'name':a37_0x5b05a3(0x21d),'type':a37_0x5b05a3(0x227),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a37_0x5b05a3(0x234)]}],async 'validate'(_0x295ccb){const _0x18ceec=a37_0x5b05a3,_0x570949=_0x295ccb[_0x18ceec(0x218)](_0x18ceec(0x21c));if(!isValidBffFunctionName(_0x570949))throw CliErrors[_0x18ceec(0x243)](_0x18ceec(0x233)+_0x570949+_0x18ceec(0x251));},async 'execute'(_0x28eb57){const _0x277561=a37_0x5b05a3,_0x3357a3=loadBffProjectConfig(_0x28eb57[_0x277561(0x1fd)]),_0x20e24e=_0x28eb57['str'](_0x277561(0x1f6)),_0x35196b=_0x28eb57[_0x277561(0x218)](_0x277561(0x21c)),_0x2202a7=_0x28eb57[_0x277561(0x218)](_0x277561(0x230))||undefined,_0x12b59a=_0x20e24e===_0x277561(0x1fe)?await resolveHookOptions(_0x3357a3,_0x28eb57):undefined,_0x3bf5ff=buildFilePath(_0x3357a3,_0x20e24e,_0x35196b,_0x12b59a);if(await fileExists(_0x3bf5ff))throw CliErrors['validation'](_0x277561(0x20d)+_0x3bf5ff);await mkdir(dirname(_0x3bf5ff),{'recursive':!![]});const _0x26fb43=generateTemplate(_0x20e24e,_0x35196b,_0x28eb57[_0x277561(0x1fd)],_0x2202a7,_0x12b59a);await writeFile(_0x3bf5ff,_0x26fb43,'utf8');const _0x48ca00={'type':_0x20e24e,'name':_0x35196b,'path':_0x3bf5ff};if(_0x2202a7)_0x48ca00[_0x277561(0x230)]=_0x2202a7;if(_0x12b59a){if(_0x12b59a[_0x277561(0x242)])_0x48ca00[_0x277561(0x242)]=_0x12b59a[_0x277561(0x242)];_0x48ca00['datasetCode']=_0x12b59a[_0x277561(0x201)],_0x48ca00[_0x277561(0x22b)]=_0x12b59a['operationType'],_0x48ca00['functionNode']=_0x12b59a['functionNode'];}return{'ok':!![],'data':_0x48ca00,'message':_0x277561(0x244)+_0x20e24e+_0x277561(0x219)+_0x35196b};}};async function resolveHookOptions(_0x5b6eb0,_0x2fd256){const _0x27fe54=a37_0x5b05a3,_0x2f8f59=resolveApiModelSource(_0x2fd256[_0x27fe54(0x253)],_0x2fd256[_0x27fe54(0x1fd)],_0x2fd256['selectedAppName']||_0x2fd256['mergedCli']?.['currentApp']||_0x2fd256[_0x27fe54(0x239)]?.[_0x27fe54(0x24b)]),_0x3c3641=loadAliasMap(_0x2fd256['apiDir'],undefined,_0x2f8f59[_0x27fe54(0x247)],_0x2f8f59[_0x27fe54(0x24a)]),_0x32c22c=_0x3c3641[_0x27fe54(0x206)]>0x0;let _0x187290,_0x39b752,_0x1a1284;const _0xef1128=_0x2fd256[_0x27fe54(0x218)]('alias'),_0x1dd64b=_0x2fd256[_0x27fe54(0x218)](_0x27fe54(0x20e));if(_0xef1128){const _0x1e202c=resolveAlias(_0x2fd256[_0x27fe54(0x253)],_0xef1128,undefined,_0x2f8f59[_0x27fe54(0x247)],_0x2f8f59['profileName']);if(!_0x1e202c){const _0x538628=_0x32c22c?_0x27fe54(0x254)+_0x3c3641[_0x27fe54(0x22d)](_0x371f6f=>_0x371f6f['alias'])[_0x27fe54(0x211)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0x27fe54(0x207)+_0xef1128+_0x27fe54(0x23c)+_0x538628);}_0x187290=_0xef1128,_0x39b752=_0x1e202c;}else{if(_0x1dd64b){_0x39b752=_0x1dd64b;const _0x432ec7=_0x3c3641[_0x27fe54(0x1f5)](_0x2a8640=>_0x2a8640[_0x27fe54(0x201)]===_0x1dd64b);_0x187290=_0x432ec7?.[_0x27fe54(0x242)];}else{if(_0x2fd256[_0x27fe54(0x23b)])throw CliErrors['validation'](_0x27fe54(0x217));else{if(_0x32c22c){const _0xf70949=_0x3c3641['map'](_0x3ade99=>_0x3ade99['alias']+'\x20('+_0x3ade99[_0x27fe54(0x241)]+')'),_0x295083=await promptSelect(_0x27fe54(0x258),_0xf70949),_0x19c63b=_0x3c3641[_0x295083];if(!_0x19c63b)throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x23e));_0x187290=_0x19c63b[_0x27fe54(0x242)],_0x39b752=_0x19c63b['datasetCode'];}else{const _0x322be6=await listDatasets(_0x2fd256[_0x27fe54(0x1fd)]);if(_0x322be6[_0x27fe54(0x206)]===0x0)throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x237));const _0x46ad7a=_0x322be6['map'](_0x419e94=>_0x419e94['name']+'\x20['+(_0x419e94['source']??'UNKNOWN')+']\x20('+_0x419e94[_0x27fe54(0x246)]+')'),_0x40b094=await promptSelect(_0x27fe54(0x258),_0x46ad7a),_0xad72b8=_0x322be6[_0x40b094];if(!_0xad72b8)throw CliErrors[_0x27fe54(0x243)]('Invalid\x20dataset\x20selection.');_0x39b752=_0xad72b8[_0x27fe54(0x246)],_0x187290=undefined;}}}}const _0x251a65=await listDatasets(_0x2fd256[_0x27fe54(0x1fd)]),_0xd38edd=_0x251a65[_0x27fe54(0x1f5)](_0x1015f6=>_0x1015f6[_0x27fe54(0x246)]===_0x39b752);if(!_0xd38edd)throw CliErrors[_0x27fe54(0x243)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x39b752+_0x27fe54(0x216)+(_0x187290?_0x27fe54(0x220)+CLI_BIN_NAME+_0x27fe54(0x209):''));_0x1a1284=_0xd38edd['id'];const _0x4f403f=_0x187290??_0x39b752,_0x433dc6=await listBffDatasetOperations(_0x2fd256[_0x27fe54(0x1fd)],_0x1a1284),_0x3deddc=_0x433dc6?Object[_0x27fe54(0x257)](_0x433dc6):[];if(_0x3deddc[_0x27fe54(0x206)]===0x0)throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x22a)+_0x4f403f+'.');let _0x45c655;const _0x402a88=_0x2fd256[_0x27fe54(0x218)](_0x27fe54(0x204));if(_0x402a88){if(!_0x3deddc[_0x27fe54(0x20a)](_0x402a88))throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x1f8)+_0x402a88+_0x27fe54(0x1fc)+_0x4f403f+'.\x20'+('Available:\x20'+_0x3deddc[_0x27fe54(0x211)](',\x20')));_0x45c655=_0x402a88;}else{if(_0x2fd256[_0x27fe54(0x23b)])throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x1ee));const _0x33304a=await promptSelect(_0x27fe54(0x23f),_0x3deddc);_0x45c655=_0x3deddc[_0x33304a]??_0x3deddc[0x0];}let _0x159bbf=normalizeHookFunctionNode(_0x2fd256['str'](_0x27fe54(0x21d)));if(!_0x159bbf){if(_0x2fd256[_0x27fe54(0x218)]('function-node'))throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x24d));if(_0x2fd256[_0x27fe54(0x23b)])throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x1ed));const _0x2d3bb8=await promptSelect(_0x27fe54(0x1fb),[_0x27fe54(0x223),_0x27fe54(0x234)]);_0x159bbf=['before',_0x27fe54(0x234)][_0x2d3bb8]??_0x27fe54(0x223);}return{'alias':_0x187290,'datasetCode':_0x39b752,'datasetId':_0x1a1284,'operationType':_0x45c655,'functionNode':_0x159bbf};}async function promptSelect(_0x263515,_0x1b0914){const _0x4c3748=a37_0x5b05a3;if(_0x1b0914[_0x4c3748(0x206)]===0x1)return 0x0;for(const [_0x31cfc9,_0x3ada1e]of _0x1b0914[_0x4c3748(0x21a)]()){process['stderr'][_0x4c3748(0x232)]('\x20\x20'+(_0x31cfc9+0x1)+'.\x20'+_0x3ada1e+'\x0a');}const _0x2ea7ab=createInterface({'input':process[_0x4c3748(0x229)],'output':process['stderr']});while(!![]){const _0x7893a6=await new Promise(_0x15f1a8=>{const _0x2e2937=_0x4c3748;_0x2ea7ab[_0x2e2937(0x210)](_0x263515+'\x20',_0x15f1a8);}),_0x37c2cc=Number[_0x4c3748(0x200)](_0x7893a6['trim'](),0xa);if(Number[_0x4c3748(0x225)](_0x37c2cc)&&_0x37c2cc>=0x1&&_0x37c2cc<=_0x1b0914['length'])return _0x2ea7ab[_0x4c3748(0x1f7)](),_0x37c2cc-0x1;process[_0x4c3748(0x231)][_0x4c3748(0x232)](_0x4c3748(0x1f1)+_0x1b0914[_0x4c3748(0x206)]+'.\x0a');}}function a37_0xeae6(){const _0x432058=['\x22.\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','str','\x20function:\x20','entries','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','name','function-node','1214562UEtOwe','370YdJnsV','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','62613knhsks','before','Script\x20type','isInteger','Function\x20name\x20(valid\x20JS\x20identifier)','string','当前响应结果','stdin','No\x20operation\x20types\x20found\x20for\x20dataset\x20','operationType','create','map','functionNode','当前请求参数','description','stderr','write','Invalid\x20function\x20name\x20\x22','after','修改后的请求参数','/ENDPOINT/','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','mergedCli','.js\x0a\x20*\x20[触发节点]\x20','nonInteractive','\x22\x20not\x20found.\x20','Script\x20description','Invalid\x20dataset\x20selection.','Select\x20operation\x20type:','\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','tableName','alias','validation','Created\x20','14624709iDTFqK','code','filePath','4293384mishHw','\x0a\x20*\x20[平台配置]\x20','profileName','defaultApp','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','806862TPZtLl','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','15fqpoqk','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x22,\x20params\x20})\x0a','apiDir','Available\x20aliases:\x20','/**\x0a\x20*\x20','105gFUsas','keys','Select\x20dataset:','/HOOK/','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','2393755zdZiqH','修改后的响应结果','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','ENDPOINT','Operation\x20type\x20(HOOK\x20only)','COMMON','find','type','close','Operation\x20type\x20\x22','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','.js','Select\x20trigger\x20node:','\x22\x20not\x20found\x20for\x20dataset\x20','appCode','HOOK','43048DRnohf','parseInt','datasetCode','1WAjwaH','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','operation-type','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','length','Alias\x20\x22','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x20api\x20pull`\x20to\x20refresh.','includes','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','File\x20already\x20exists:\x20','datasetcode','/data/dataset/','question','join','bff','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','scriptsRootDir'];a37_0xeae6=function(){return _0x432058;};return a37_0xeae6();}function a37_0x4cff(_0x2dc9d7,_0x492859){_0x2dc9d7=_0x2dc9d7-0x1ed;const _0xeae6a4=a37_0xeae6();let _0x4cffa2=_0xeae6a4[_0x2dc9d7];return _0x4cffa2;}function buildFilePath(_0x2e5285,_0x20dc11,_0x159ec3,_0x327992){const _0x3cd8fd=a37_0x5b05a3;if(_0x20dc11==='HOOK'){if(!_0x327992)throw CliErrors[_0x3cd8fd(0x243)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x41669f=_0x327992['alias']??_0x327992[_0x3cd8fd(0x201)];return join(_0x2e5285[_0x3cd8fd(0x215)],_0x3cd8fd(0x1fe),_0x41669f,_0x327992['operationType'],_0x327992[_0x3cd8fd(0x22e)],_0x159ec3+_0x3cd8fd(0x1fa));}return join(_0x2e5285[_0x3cd8fd(0x215)],_0x20dc11,_0x159ec3+_0x3cd8fd(0x1fa));}export function generateTemplate(_0xe6557a,_0x377bf0,_0x2d1c1e,_0x249a6d,_0x2319a2){const _0x222b76=a37_0x5b05a3,_0x5255a1=_0x249a6d?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x4d08b8=getAppBaseUrl(_0x2d1c1e),_0x28adbb='\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(_0xe6557a===_0x222b76(0x1f4))return _0x222b76(0x255)+_0x5255a1+_0x222b76(0x1f9)+_0x377bf0+'\x0a\x20*\x20[平台配置]\x20'+_0x4d08b8+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x2d1c1e+'/COMMON/'+_0x377bf0+_0x222b76(0x20c)+_0x377bf0+_0x222b76(0x252)+_0x28adbb+_0x222b76(0x240)+_0x377bf0+_0x222b76(0x21b);if(_0xe6557a===_0x222b76(0x1f2))return _0x222b76(0x255)+_0x5255a1+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x377bf0+_0x222b76(0x203)+_0x2d1c1e+'/'+_0x377bf0+_0x222b76(0x249)+_0x4d08b8+_0x222b76(0x20b)+_0x2d1c1e+_0x222b76(0x236)+_0x377bf0+'.js\x0a'+_0x28adbb+'\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'+_0x377bf0+_0x222b76(0x21b);if(!_0x2319a2)throw CliErrors[_0x222b76(0x243)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x2515eb=_0x2319a2[_0x222b76(0x242)]??_0x2319a2[_0x222b76(0x201)],_0x2adcb7=_0x2319a2[_0x222b76(0x22e)]===_0x222b76(0x223)?_0x222b76(0x22f):_0x222b76(0x228),_0x249f1b=_0x2319a2[_0x222b76(0x22e)]===_0x222b76(0x223)?_0x222b76(0x235):_0x222b76(0x1f0);return _0x222b76(0x255)+_0x5255a1+_0x222b76(0x213)+_0x377bf0+_0x222b76(0x208)+_0x2d1c1e+'/'+_0x2319a2[_0x222b76(0x201)]+'/'+_0x2319a2[_0x222b76(0x22b)]+_0x222b76(0x249)+_0x4d08b8+_0x222b76(0x20f)+_0x2319a2['datasetId']+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x2d1c1e+_0x222b76(0x259)+_0x2515eb+'/'+_0x2319a2[_0x222b76(0x22b)]+'/'+_0x2319a2['functionNode']+'/'+_0x377bf0+_0x222b76(0x23a)+_0x2319a2[_0x222b76(0x22e)]+'\x0a'+_0x28adbb+_0x222b76(0x238)+_0x2adcb7+_0x222b76(0x221)+_0x249f1b+_0x222b76(0x205)+_0x377bf0+_0x222b76(0x21b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x17d302=a38_0x5978;(function(_0x457bf0,_0x294614){const _0x29430d=a38_0x5978,_0x44ef0b=_0x457bf0();while(!![]){try{const _0x12a8c1=parseInt(_0x29430d(0x1d0))/0x1*(-parseInt(_0x29430d(0x1d8))/0x2)+parseInt(_0x29430d(0x1cb))/0x3*(-parseInt(_0x29430d(0x1db))/0x4)+parseInt(_0x29430d(0x1f6))/0x5+parseInt(_0x29430d(0x1d7))/0x6*(parseInt(_0x29430d(0x1dc))/0x7)+parseInt(_0x29430d(0x1ee))/0x8*(-parseInt(_0x29430d(0x1c9))/0x9)+-parseInt(_0x29430d(0x1fa))/0xa*(-parseInt(_0x29430d(0x1e9))/0xb)+parseInt(_0x29430d(0x1e1))/0xc;if(_0x12a8c1===_0x294614)break;else _0x44ef0b['push'](_0x44ef0b['shift']());}catch(_0x15476d){_0x44ef0b['push'](_0x44ef0b['shift']());}}}(a38_0x1fe0,0xa80b9));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';function a38_0x5978(_0x216f18,_0x17e58c){_0x216f18=_0x216f18-0x1c9;const _0x1fe00d=a38_0x1fe0();let _0x597863=_0x1fe00d[_0x216f18];return _0x597863;}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x17d302(0x1ed),'command':a38_0x17d302(0x1f5),'description':a38_0x17d302(0x1e3),'risk':a38_0x17d302(0x1fc),'flags':[{'name':'target','type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x55f71d){const _0x2ed66e=a38_0x17d302,_0x4fe3f8=loadBffProjectConfig(_0x55f71d['appCode']),_0x17e92a=await readBffLockFile(_0x4fe3f8[_0x2ed66e(0x1fb)]);if(!_0x17e92a)throw CliErrors[_0x2ed66e(0x1dd)](_0x2ed66e(0x1df));},async 'dryRun'(_0x5235ab){const _0x5d9d0c=a38_0x17d302,_0x237479=loadBffProjectConfig(_0x5235ab[_0x5d9d0c(0x1cf)]),_0xdd5355=await readBffLockFile(_0x237479[_0x5d9d0c(0x1fb)]);if(!_0xdd5355)throw CliErrors[_0x5d9d0c(0x1dd)](_0x5d9d0c(0x1f1));const {appLock:_0x56e8f7}=ensureLockScope(_0xdd5355,_0x5235ab[_0x5d9d0c(0x1cf)],_0x237479[_0x5d9d0c(0x1d4)],'delete'),_0x302bdf=_0x5235ab[_0x5d9d0c(0x1e0)](_0x5d9d0c(0x1d3)),_0x1501cc=Object[_0x5d9d0c(0x1de)](_0x56e8f7[_0x5d9d0c(0x1f3)]),_0x3e7607=resolveDeleteTarget(_0x302bdf,_0x1501cc),_0x4664b7=_0x56e8f7[_0x5d9d0c(0x1f3)][_0x3e7607];if(!_0x4664b7)throw CliErrors[_0x5d9d0c(0x1dd)](_0x5d9d0c(0x1e7)+_0x3e7607+'\x22.');const _0x5dcc89=resolveLocalFilePathFromLockKey(_0x237479,_0x3e7607),_0x4e469c=relative(_0x237479[_0x5d9d0c(0x1e4)],_0x5dcc89),_0x517109=join(_0x237479[_0x5d9d0c(0x1f9)],'<timestamp>',_0x4e469c);return{'method':'POST','url':'/api/management/library/scripts/delete','body':{'appCode':_0x5235ab['appCode'],'target':_0x3e7607,'remoteId':_0x4664b7[_0x5d9d0c(0x1f8)],'localFilePath':_0x5dcc89,'trashedPath':_0x517109},'description':_0x5d9d0c(0x1f4)+_0x3e7607+_0x5d9d0c(0x1f0)};},async 'execute'(_0x286c11){const _0xd1f8fd=a38_0x17d302,_0x919b1c=loadBffProjectConfig(_0x286c11[_0xd1f8fd(0x1cf)]),_0x561f24=await readBffLockFile(_0x919b1c[_0xd1f8fd(0x1fb)]);if(!_0x561f24)throw CliErrors[_0xd1f8fd(0x1dd)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x451e12,appLock:_0xa31f08}=ensureLockScope(_0x561f24,_0x286c11[_0xd1f8fd(0x1cf)],_0x919b1c['scriptsRoot'],_0xd1f8fd(0x1f5)),_0xf9aaab=JSON['parse'](JSON[_0xd1f8fd(0x1d2)](_0x451e12)),_0x341b1c=_0xf9aaab[_0xd1f8fd(0x1ec)][_0x286c11[_0xd1f8fd(0x1cf)]];if(!_0x341b1c)throw new Error(_0xd1f8fd(0x1cc)+_0x286c11[_0xd1f8fd(0x1cf)]+_0xd1f8fd(0x1e6));const _0x1368fb=_0x286c11[_0xd1f8fd(0x1e0)](_0xd1f8fd(0x1d3)),_0xaddace=Object[_0xd1f8fd(0x1de)](_0x341b1c[_0xd1f8fd(0x1f3)]),_0x4fcb08=resolveDeleteTarget(_0x1368fb,_0xaddace),_0x2b321c=_0x341b1c[_0xd1f8fd(0x1f3)][_0x4fcb08];if(!_0x2b321c)throw CliErrors[_0xd1f8fd(0x1dd)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x4fcb08+'\x22.');await deleteBffScript(_0x2b321c['remoteId']),delete _0x341b1c[_0xd1f8fd(0x1f3)][_0x4fcb08],_0x341b1c[_0xd1f8fd(0x1e8)]=new Date()[_0xd1f8fd(0x1e2)](),await writeBffLockFile(_0x919b1c[_0xd1f8fd(0x1fb)],_0xf9aaab);const _0x24db63=resolveLocalFilePathFromLockKey(_0x919b1c,_0x4fcb08);let _0x27c679;await fileExists(_0x24db63)&&(_0x27c679=await moveToTrash(_0x919b1c['projectRoot'],_0x919b1c[_0xd1f8fd(0x1f9)],_0x24db63),await cleanupEmptyDirectories(dirname(_0x24db63),_0x919b1c[_0xd1f8fd(0x1f2)]));await waitForDeleteSettlement(_0x919b1c['lockFilePath'],_0x286c11['appCode'],_0x4fcb08,_0x24db63),await sleep(0x96);const _0x1b8b0b={'deleted':_0x4fcb08,'remoteId':_0x2b321c[_0xd1f8fd(0x1f8)]};if(_0x27c679)_0x1b8b0b[_0xd1f8fd(0x1f7)]=_0x27c679;return{'ok':!![],'data':_0x1b8b0b,'message':_0xd1f8fd(0x1ca)+_0x4fcb08+(_0x27c679?_0xd1f8fd(0x1ef):'')};}};function resolveDeleteTarget(_0x18cc3d,_0x4f5d21){const _0x2d07a5=a38_0x17d302;if(_0x18cc3d[_0x2d07a5(0x1ce)]('/')){const _0x4a4f8c=_0x4f5d21[_0x2d07a5(0x1fd)](_0x36ab36=>_0x36ab36===_0x18cc3d);if(!_0x4a4f8c)throw CliErrors[_0x2d07a5(0x1dd)](_0x2d07a5(0x1ea)+_0x18cc3d);return _0x4a4f8c;}const _0x374323=_0x4f5d21[_0x2d07a5(0x1d1)](_0x37679a=>_0x37679a['split']('/')['at'](-0x1)===_0x18cc3d);if(_0x374323['length']===0x0)throw CliErrors[_0x2d07a5(0x1dd)](_0x2d07a5(0x1ea)+_0x18cc3d);if(_0x374323[_0x2d07a5(0x1da)]>0x1)throw CliErrors['validation']('Multiple\x20functions\x20match\x20\x22'+_0x18cc3d+_0x2d07a5(0x1e5)+_0x374323[_0x2d07a5(0x1d5)](_0x2288f9=>_0x2d07a5(0x1d9)+_0x2288f9)['join']('\x0a'));return _0x374323[0x0];}function a38_0x1fe0(){const _0x192f24=['appCode','86930SCZJyc','filter','stringify','target','scriptsRoot','map','Local\x20delete\x20not\x20settled\x20for\x20','195498VFbFbz','28PqqeHe','\x20\x20-\x20','length','1619308xgAyhr','119yvjLEv','validation','keys','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','str','28275492mRRmnw','toISOString','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','projectRoot','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x22\x20not\x20found\x20after\x20ensureLockScope.','No\x20lock\x20entry\x20found\x20for\x20\x22','lastSync','55yaBGfr','Function\x20not\x20found:\x20','replace','apps','bff','1824bwnNHo','\x20(local\x20file\x20moved\x20to\x20trash)','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Backend\x20Function\x20lock\x20file\x20not\x20found.','scriptsRootDir','functions','Would\x20delete\x20','delete','1763645Osoyid','trashedTo','remoteId','trashDir','1833710cNjbVB','lockFilePath','high-risk-write','find','41841imTuPm','Deleted\x20','9TFPWES','Lock\x20scope\x20for\x20app\x20\x22','startsWith','includes'];a38_0x1fe0=function(){return _0x192f24;};return a38_0x1fe0();}async function moveToTrash(_0x1e6aaa,_0x461947,_0x49ef0c){const _0x504cca=a38_0x17d302,_0x1d23d9=new Date()[_0x504cca(0x1e2)]()[_0x504cca(0x1eb)](/[:.]/g,'-'),_0x15fe6a=relative(_0x1e6aaa,_0x49ef0c),_0x102799=join(_0x461947,_0x1d23d9,_0x15fe6a);return await mkdir(dirname(_0x102799),{'recursive':!![]}),await rename(_0x49ef0c,_0x102799),_0x102799;}async function cleanupEmptyDirectories(_0xf6c1b4,_0x40cabb){const _0x3006a4=a38_0x17d302;let _0x2ef0b7=resolve(_0xf6c1b4);const _0x2b7267=resolve(_0x40cabb);while(_0x2ef0b7[_0x3006a4(0x1cd)](''+_0x2b7267+sep)||_0x2ef0b7===_0x2b7267){if(_0x2ef0b7===_0x2b7267)return;try{const _0x17c91c=await readdir(_0x2ef0b7);if(_0x17c91c['length']>0x0)return;await rmdir(_0x2ef0b7);}catch{return;}_0x2ef0b7=dirname(_0x2ef0b7);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x15eed0,_0x2c4a2c,_0x3c106a,_0x515140){const _0x10ac0c=a38_0x17d302;for(let _0x55bdc4=0x0;_0x55bdc4<DELETE_SETTLE_RETRY_COUNT;_0x55bdc4+=0x1){const _0x4c7903=await readBffLockFile(_0x15eed0),_0x1853dc=!!_0x4c7903?.[_0x10ac0c(0x1ec)]?.[_0x2c4a2c]?.[_0x10ac0c(0x1f3)]?.[_0x3c106a],_0x5db79a=await fileExists(_0x515140);if(!_0x1853dc&&!_0x5db79a)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x10ac0c(0x1d6)+_0x3c106a+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x5d7a86=a39_0xe015;(function(_0x53993c,_0x3f95f0){const _0x211466=a39_0xe015,_0x3cbe66=_0x53993c();while(!![]){try{const _0x14dd05=parseInt(_0x211466(0xbf))/0x1+parseInt(_0x211466(0xc8))/0x2*(parseInt(_0x211466(0xc2))/0x3)+parseInt(_0x211466(0xbb))/0x4+-parseInt(_0x211466(0xbe))/0x5*(parseInt(_0x211466(0xc9))/0x6)+parseInt(_0x211466(0xc0))/0x7+-parseInt(_0x211466(0xb8))/0x8*(-parseInt(_0x211466(0xb6))/0x9)+-parseInt(_0x211466(0xcd))/0xa;if(_0x14dd05===_0x3f95f0)break;else _0x3cbe66['push'](_0x3cbe66['shift']());}catch(_0xe02839){_0x3cbe66['push'](_0x3cbe66['shift']());}}}(a39_0x5c4d,0x5a922));function a39_0xe015(_0xc53c5f,_0x3b7c7a){_0xc53c5f=_0xc53c5f-0xb5;const _0x5c4d78=a39_0x5c4d();let _0xe0156b=_0x5c4d78[_0xc53c5f];return _0xe0156b;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x5d7a86(0xcc),'command':'detail','description':a39_0x5d7a86(0xc7),'risk':a39_0x5d7a86(0xb7),'flags':[{'name':'id','type':a39_0x5d7a86(0xca),'required':!![],'description':a39_0x5d7a86(0xc1)},{'name':a39_0x5d7a86(0xcf),'type':a39_0x5d7a86(0xb5),'description':a39_0x5d7a86(0xc4)}],async 'execute'(_0x3e3858){const _0x539b0a=a39_0x5d7a86,_0x1b29b9=await getBffScriptInfo(_0x3e3858[_0x539b0a(0xbc)]('id')),_0x171a18=_0x3e3858[_0x539b0a(0xbd)](_0x539b0a(0xcf));if(_0x171a18)return{'ok':!![],'data':_0x1b29b9};return{'ok':!![],'data':{'id':_0x1b29b9['id'],'functionName':_0x1b29b9[_0x539b0a(0xc5)]??'','version':_0x1b29b9[_0x539b0a(0xc3)]??'','updateUserName':_0x1b29b9[_0x539b0a(0xba)]??'','appCode':_0x1b29b9['appCode'],'scriptType':_0x1b29b9[_0x539b0a(0xb9)],'description':_0x1b29b9['description']||_0x539b0a(0xce),'createdTime':_0x1b29b9['createdTime']??'','updatedTime':_0x1b29b9[_0x539b0a(0xcb)]??'','scriptContent':_0x1b29b9[_0x539b0a(0xc6)]??''}};}};function a39_0x5c4d(){const _0x34ddee=['2965896gSZwbk','number','updatedTime','bff','4809580nykuDi','(none)','verbose','boolean','9nlJbMg','read','1735768XNGfBK','scriptType','updateUserName','1363616ZEUZFB','num','bool','5wCPizi','164476IrrrES','3110849TJRTcJ','Script\x20ID','42PHdSxT','version','Return\x20full\x20raw\x20script\x20object','functionName','scriptContent','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','25642kNopoG'];a39_0x5c4d=function(){return _0x34ddee;};return a39_0x5c4d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a0b66,_0x3f61ba){const _0x4676d8=a40_0x30b0,_0x44494e=_0x3a0b66();while(!![]){try{const _0xb42809=-parseInt(_0x4676d8(0x1ae))/0x1*(-parseInt(_0x4676d8(0x1b4))/0x2)+-parseInt(_0x4676d8(0x1b5))/0x3+-parseInt(_0x4676d8(0x1b1))/0x4*(-parseInt(_0x4676d8(0x1b9))/0x5)+parseInt(_0x4676d8(0x1b6))/0x6*(-parseInt(_0x4676d8(0x1b7))/0x7)+-parseInt(_0x4676d8(0x1b3))/0x8+-parseInt(_0x4676d8(0x1b2))/0x9*(-parseInt(_0x4676d8(0x1af))/0xa)+parseInt(_0x4676d8(0x1b8))/0xb*(parseInt(_0x4676d8(0x1b0))/0xc);if(_0xb42809===_0x3f61ba)break;else _0x44494e['push'](_0x44494e['shift']());}catch(_0x5e73d5){_0x44494e['push'](_0x44494e['shift']());}}}(a40_0x352f,0xdf2d1));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a40_0x30b0(_0xe01f3,_0x37667b){_0xe01f3=_0xe01f3-0x1ae;const _0x352f98=a40_0x352f();let _0x30b0e5=_0x352f98[_0xe01f3];return _0x30b0e5;}import{bffStatus}from'../../commands/bff/status.js';function a40_0x352f(){const _0x126279=['611824FJxfHc','2864600aECSfu','12ARryFd','4twWVBp','9tPTYcN','4112288bASvMM','4otCwsM','1960143FZysJP','48hzaZCB','404908LPpQgA','4482181MydhQR','3133595LVoxFz'];a40_0x352f=function(){return _0x126279;};return a40_0x352f();}import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x5a4ab6=a41_0x331d;function a41_0x331d(_0x279629,_0x3f1c88){_0x279629=_0x279629-0x1c9;const _0x15c468=a41_0x15c4();let _0x331dca=_0x15c468[_0x279629];return _0x331dca;}function a41_0x15c4(){const _0x41ed61=['450730vQuajv','Script\x20type\x20filter','4119696QSfVaB','List\x20Backend\x20Function\x20scripts','No\x20Backend\x20Function\x20scripts\x20found.','bool','COMMON','read','str','boolean','bff','7463922FvdAHK','82iNSkWC','6095704MUOQsa','7SFHkjR','Return\x20full\x20script\x20objects','90YdqIOO','verbose','type','map','name','string','appCode','46554ndBEky','list','1039807MGLtIx','623051erJkLU','ENDPOINT','Filter\x20by\x20script\x20name','9xtjtBS','(unnamed)'];a41_0x15c4=function(){return _0x41ed61;};return a41_0x15c4();}(function(_0x2db817,_0x22ec30){const _0x5b5658=a41_0x331d,_0xdaa847=_0x2db817();while(!![]){try{const _0x13b978=-parseInt(_0x5b5658(0x1e2))/0x1+parseInt(_0x5b5658(0x1d5))/0x2*(parseInt(_0x5b5658(0x1e0))/0x3)+parseInt(_0x5b5658(0x1cb))/0x4+parseInt(_0x5b5658(0x1c9))/0x5+-parseInt(_0x5b5658(0x1d4))/0x6*(-parseInt(_0x5b5658(0x1d7))/0x7)+-parseInt(_0x5b5658(0x1d6))/0x8*(parseInt(_0x5b5658(0x1e6))/0x9)+-parseInt(_0x5b5658(0x1d9))/0xa*(parseInt(_0x5b5658(0x1e3))/0xb);if(_0x13b978===_0x22ec30)break;else _0xdaa847['push'](_0xdaa847['shift']());}catch(_0x1151df){_0xdaa847['push'](_0xdaa847['shift']());}}}(a41_0x15c4,0xa8274));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x5a4ab6(0x1d3),'command':a41_0x5a4ab6(0x1e1),'description':a41_0x5a4ab6(0x1cc),'risk':a41_0x5a4ab6(0x1d0),'flags':[{'name':'type','type':a41_0x5a4ab6(0x1de),'description':a41_0x5a4ab6(0x1ca),'default':'ENDPOINT','enum':[a41_0x5a4ab6(0x1e4),a41_0x5a4ab6(0x1cf)]},{'name':a41_0x5a4ab6(0x1dd),'type':a41_0x5a4ab6(0x1de),'description':a41_0x5a4ab6(0x1e5)},{'name':a41_0x5a4ab6(0x1da),'type':a41_0x5a4ab6(0x1d2),'description':a41_0x5a4ab6(0x1d8)}],async 'execute'(_0x395748){const _0x166687=a41_0x5a4ab6,_0x34f5de=await listBffScripts(_0x395748[_0x166687(0x1df)],_0x395748[_0x166687(0x1d1)](_0x166687(0x1db)),{'scriptName':_0x395748[_0x166687(0x1d1)](_0x166687(0x1dd))||undefined}),_0x1e54d2=_0x395748[_0x166687(0x1ce)]('verbose');return{'ok':!![],'data':_0x1e54d2?_0x34f5de:_0x34f5de[_0x166687(0x1dc)](_0x301d32=>({'id':_0x301d32['id'],'functionName':_0x301d32['functionName']??'','description':_0x301d32['description']||_0x166687(0x1e7),'scriptType':_0x301d32['scriptType']})),'message':_0x34f5de['length']===0x0?_0x166687(0x1cd):undefined};}};
|
package/lib/commands/bff/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x1d42a5=a42_0x4841;function a42_0x4841(_0x2239cb,_0xb0ddaf){_0x2239cb=_0x2239cb-0x1dd;const _0x559dea=a42_0x559d();let _0x4841d4=_0x559dea[_0x2239cb];return _0x4841d4;}(function(_0x3ee016,_0x46bedc){const _0x49e85e=a42_0x4841,_0x31218b=_0x3ee016();while(!![]){try{const _0x471e97=-parseInt(_0x49e85e(0x207))/0x1*(parseInt(_0x49e85e(0x1fd))/0x2)+-parseInt(_0x49e85e(0x1f3))/0x3*(-parseInt(_0x49e85e(0x1ff))/0x4)+parseInt(_0x49e85e(0x1e6))/0x5*(-parseInt(_0x49e85e(0x1e8))/0x6)+-parseInt(_0x49e85e(0x1e7))/0x7*(-parseInt(_0x49e85e(0x1f4))/0x8)+-parseInt(_0x49e85e(0x1f0))/0x9*(parseInt(_0x49e85e(0x1e3))/0xa)+parseInt(_0x49e85e(0x1f6))/0xb*(parseInt(_0x49e85e(0x1df))/0xc)+parseInt(_0x49e85e(0x202))/0xd*(parseInt(_0x49e85e(0x1ea))/0xe);if(_0x471e97===_0x46bedc)break;else _0x31218b['push'](_0x31218b['shift']());}catch(_0xb5baa1){_0x31218b['push'](_0x31218b['shift']());}}}(a42_0x559d,0x44993));function a42_0x559d(){const _0x368362=['ERROR','--since','Filter\x20by\x20log\x20level','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','length','end-time','50602xurxXf','isSafeInteger','5864wykWMc','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','76726DAxDpq','read','level','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','validation','14HguddF','since','--limit','now','Found\x20','toUpperCase','start-time','bff','WARN','\x20must\x20be\x20a\x20positive\x20integer.','12WHOpje','DEBUG','--end-time','num','1696870NJRYkf','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','trim','5lTxXTa','1288erNtdT','2693466QjSYUq','INFO','1442BswIPy','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','flag','str','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','logs','27uDGjPj','number','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','849qgbvJN','21064owBRwf','string','944999NztfZU'];a42_0x559d=function(){return _0x368362;};return a42_0x559d();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x1d42a5(0x1e0),a42_0x1d42a5(0x1e9),a42_0x1d42a5(0x1dd),a42_0x1d42a5(0x1f7)];export function resolveBffLogQuery(_0x4da62f,_0x523a78=Date[a42_0x1d42a5(0x20a)]()){const _0x502a28=a42_0x1d42a5,_0x18af2d=_0x4da62f[_0x502a28(0x1ec)]('since'),_0x1860a1=_0x4da62f[_0x502a28(0x1ec)](_0x502a28(0x20d)),_0x4bfe2d=_0x4da62f[_0x502a28(0x1ec)](_0x502a28(0x1fc));if(_0x18af2d!==undefined&&_0x1860a1!==undefined)throw CliErrors[_0x502a28(0x206)](_0x502a28(0x201));const _0x2e66f7=_0x4bfe2d===undefined?_0x523a78:readPositiveInteger(_0x4da62f[_0x502a28(0x1e2)](_0x502a28(0x1fc)),_0x502a28(0x1e1)),_0x404ffd=_0x1860a1===undefined?_0x2e66f7-readSinceMinutes(_0x4da62f)*0xea60:readPositiveInteger(_0x4da62f[_0x502a28(0x1e2)](_0x502a28(0x20d)),'--start-time');if(_0x404ffd<=0x0)throw CliErrors[_0x502a28(0x206)](_0x502a28(0x1eb));if(_0x404ffd>_0x2e66f7)throw CliErrors[_0x502a28(0x206)](_0x502a28(0x1fa));const _0x12191c=readPositiveInteger(_0x4da62f[_0x502a28(0x1e2)]('limit',DEFAULT_LIMIT),_0x502a28(0x209));if(_0x12191c>MAX_LIMIT)throw CliErrors[_0x502a28(0x206)]('--limit\x20must\x20be\x20between\x201\x20and\x20'+MAX_LIMIT+'.');const _0xd8434e=_0x4da62f['str'](_0x502a28(0x204))['trim']()[_0x502a28(0x20c)]()||undefined,_0x53ab2d=_0x4da62f[_0x502a28(0x1ed)]('keyword')[_0x502a28(0x1e5)]()||undefined;return{'appCode':_0x4da62f['appCode'],'startTime':_0x404ffd,'endTime':_0x2e66f7,..._0x1860a1===undefined?{'sinceMinutes':readSinceMinutes(_0x4da62f)}:{},..._0xd8434e?{'level':_0xd8434e}:{},..._0x53ab2d?{'keyword':_0x53ab2d}:{},'limit':_0x12191c};}function readSinceMinutes(_0x3d47b3){const _0x27a67c=a42_0x1d42a5;return readPositiveInteger(_0x3d47b3[_0x27a67c(0x1e2)]('since',DEFAULT_SINCE_MINUTES),_0x27a67c(0x1f8));}function readPositiveInteger(_0x34429f,_0x58b462){const _0x2ce38d=a42_0x1d42a5;if(!Number[_0x2ce38d(0x1fe)](_0x34429f)||_0x34429f<=0x0)throw CliErrors[_0x2ce38d(0x206)](_0x58b462+_0x2ce38d(0x1de));return _0x34429f;}export const bffLogs={'service':a42_0x1d42a5(0x20e),'command':a42_0x1d42a5(0x1ef),'description':a42_0x1d42a5(0x1f2),'risk':a42_0x1d42a5(0x203),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x1d42a5(0x208),'type':a42_0x1d42a5(0x1f1),'description':a42_0x1d42a5(0x205)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x1d42a5(0x20d),'type':a42_0x1d42a5(0x1f1),'description':a42_0x1d42a5(0x1e4)},{'name':a42_0x1d42a5(0x1fc),'type':a42_0x1d42a5(0x1f1),'description':a42_0x1d42a5(0x1ee)},{'name':a42_0x1d42a5(0x204),'type':a42_0x1d42a5(0x1f5),'description':a42_0x1d42a5(0x1f9),'enum':LOG_LEVELS},{'name':'keyword','type':'string','description':a42_0x1d42a5(0x200)},{'name':'limit','type':a42_0x1d42a5(0x1f1),'description':'Maximum\x20log\x20lines\x20to\x20return\x20(1-'+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x2625ff){resolveBffLogQuery(_0x2625ff);},async 'execute'(_0x104321){const _0xac9f3c=a42_0x1d42a5,_0x1a0437=resolveBffLogQuery(_0x104321),{sinceMinutes:_0x2e1250,..._0x515dc1}=_0x1a0437,_0xc98d3d=await searchBffScriptLogs(_0x515dc1);return{'ok':!![],'data':{'query':_0x1a0437,'count':_0xc98d3d[_0xac9f3c(0x1fb)],'logs':_0xc98d3d},'message':_0xc98d3d[_0xac9f3c(0x1fb)]===0x0?'No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.':_0xac9f3c(0x20b)+_0xc98d3d[_0xac9f3c(0x1fb)]+'\x20Backend\x20Function\x20log\x20line(s).'};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a43_0x43b08b=a43_0x35f6;(function(_0x5c41de,_0x486d9a){const _0x57c4a9=a43_0x35f6,_0x408509=_0x5c41de();while(!![]){try{const _0x5ad49c=parseInt(_0x57c4a9(0x147))/0x1*(parseInt(_0x57c4a9(0x137))/0x2)+parseInt(_0x57c4a9(0x10c))/0x3+parseInt(_0x57c4a9(0x108))/0x4+parseInt(_0x57c4a9(0x169))/0x5*(parseInt(_0x57c4a9(0x143))/0x6)+-parseInt(_0x57c4a9(0x10a))/0x7*(parseInt(_0x57c4a9(0x15f))/0x8)+-parseInt(_0x57c4a9(0x15c))/0x9+-parseInt(_0x57c4a9(0x142))/0xa;if(_0x5ad49c===_0x486d9a)break;else _0x408509['push'](_0x408509['shift']());}catch(_0x1daf60){_0x408509['push'](_0x408509['shift']());}}}(a43_0x4def,0xd1f6a));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';function a43_0x4def(){const _0x34b905=['version','flatMap','cancelled','boolean','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','stringify','alias','HOOK/','functions','\x22:\x20','length','mode','message','2959716GpFyzT','toLowerCase','26985Sgehlr','newDirectory','1741626ZmMnUr','remoteId','lastSync','profileName','push','some','Pull\x20only\x20this\x20script\x20type','str','operationType','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','content','stdin','scriptType','includes','scriptContent','code','join','requires','conflict','datasetCode','get','/api/management/library/scripts/list?appCode=','.hook-directory-migrate-','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','\x20failed','entry','appCode','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','\x20--format\x20compress','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','entries','oldDirectoryPath','pull','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','nonInteractive','set','values','skipped','validation','dev','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','mergedCli','34sBMiRT','currentApp','Force\x20overwrite\x20local\x20unsynced\x20changes','split','question','yes','Pull\x20complete:\x20','sourceDirectoryPathByNewDirectory','string','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','type','14565020uhUzrZ','90YCfldH','functionNode','lockKey','close','34789KQOuCw','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','has','\x20conflict','\x22\x20to\x20\x22','lockFilePath','keyChanges','newDirectoryPath','.js','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','HOOK','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','GET','trim','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','oldLockKey','&type=','Force\x20pull\x20cancelled.','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','Failed\x20to\x20write\x20local\x20script\x20\x22','7133373mnOOuG','\x20skipped','require','248LRupKI','hookLocation','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','write','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','newLockKey','existed','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','Would\x20inspect\x20','rollback','438910JwKUUs','read','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','BFF_LOCAL_UNSYNCED','reverse','\x22;\x20temporary\x20directory\x20\x22','ino','oldDirectory','filter','bool','projectedFunctions','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','scriptsRootDir','push_local','unresolvable\x20target\x20path','scriptsRoot','defaultApp','would_pull','normalize','ENDPOINT','\x22\x20may\x20remain.','rekey','selectedAppName','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','COMMON','stderr','sourceFilePathByNewLockKey','ENOENT','\x20--name\x20','map','Could\x20not\x20restore\x20local\x20script\x20\x22','\x22:\x20both\x20target\x20\x22','\x20pulled','Lock\x20scope\x20for\x20app\x20\x22','force','filePath','Remote\x20script\x20missing\x20id.','migrations','apiDir','Cannot\x20migrate\x20HOOK\x20directory\x20\x22'];a43_0x4def=function(){return _0x34b905;};return a43_0x4def();}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_0x43b08b(0x12c),'description':a43_0x43b08b(0x15a),'risk':a43_0x43b08b(0x16a),'structuredErrors':!![],'flags':[{'name':a43_0x43b08b(0x141),'type':a43_0x43b08b(0x13f),'description':a43_0x43b08b(0x112),'enum':[a43_0x43b08b(0xeb),a43_0x43b08b(0xe6),'HOOK']},{'name':a43_0x43b08b(0xf5),'type':a43_0x43b08b(0xfe),'description':a43_0x43b08b(0x139)}],async 'dryRun'(_0x20dd77){const _0x475ea1=a43_0x43b08b,_0xf2e646=loadBffProjectConfig(_0x20dd77['appCode']),_0x1d0a83=await readBffLockFile(_0xf2e646[_0x475ea1(0x14c)]),{appLock:_0x16d7b4}=ensureLockScope(_0x1d0a83??createEmptyBffLock(),_0x20dd77[_0x475ea1(0x126)],_0xf2e646[_0x475ea1(0xe2)],'pull'),_0x57c231=normalizeBffType(_0x20dd77[_0x475ea1(0x113)](_0x475ea1(0x141)))??undefined,[_0x1c0d27,_0x539a11]=await Promise['all']([listBffScripts(_0x20dd77[_0x475ea1(0x126)],_0x57c231),getBffScriptStatistics(_0x20dd77[_0x475ea1(0x126)])]),_0x370ef4=_0x1c0d27[_0x475ea1(0x111)](_0x550e70=>normalizeBffType(_0x550e70[_0x475ea1(0x118)])===_0x475ea1(0x151)),_0x57e4fb=_0x370ef4?buildDatasetCodeToAliasMap(_0x20dd77[_0x475ea1(0xf9)],_0x20dd77[_0x475ea1(0x126)],_0x20dd77[_0x475ea1(0xe9)]||_0x20dd77[_0x475ea1(0x136)]?.[_0x475ea1(0x138)]||_0x20dd77[_0x475ea1(0x136)]?.[_0x475ea1(0xe3)]):new Map(),_0x5683b9=_0x370ef4?await planHookDirectoryMigration(_0xf2e646,_0x16d7b4,_0x57e4fb,await scanLocalBffFunctions(_0xf2e646,_0x475ea1(0x151))):undefined,_0x51eadf=createHookLocationMap(_0x539a11),_0x48f82f=[];for(const _0xdd5dc7 of _0x1c0d27){const _0x3dd6a9=resolveRemoteScriptTarget(_0xf2e646,_0xdd5dc7,_0x51eadf,_0x5683b9?.[_0x475ea1(0xdd)]??_0x16d7b4[_0x475ea1(0x103)],_0x57e4fb);if(!_0x3dd6a9){_0x48f82f['push']({'scriptType':_0xdd5dc7['scriptType'],'functionName':_0xdd5dc7['functionName']??'','status':_0x475ea1(0x132),'reason':_0x475ea1(0xe1)});continue;}const _0x13aa39=(_0x5683b9?.[_0x475ea1(0xdd)]??_0x16d7b4[_0x475ea1(0x103)])[_0x3dd6a9[_0x475ea1(0x145)]],_0x922e4=_0xdd5dc7[_0x475ea1(0x11a)]!=null?computeContentHash(_0xdd5dc7[_0x475ea1(0x11a)]):undefined,_0x5b6e58=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x5683b9,_0x3dd6a9)??_0x3dd6a9[_0x475ea1(0xf6)],_0x13aa39,_0x922e4),_0x28e73f=_0x5b6e58?localUnsyncedConflict(_0x3dd6a9,_0xdd5dc7['id']):undefined;_0x48f82f[_0x475ea1(0x110)]({'lockKey':_0x3dd6a9['lockKey'],'filePath':_0x3dd6a9[_0x475ea1(0xf6)],'remoteId':_0xdd5dc7['id']??null,'status':_0x28e73f?_0x475ea1(0x11e):_0x475ea1(0xe4),..._0x28e73f?{'conflict':_0x28e73f}:{},..._0x3dd6a9[_0x475ea1(0x160)]?{'alias':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x101)]??null,'datasetCode':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x11f)],'operationType':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x114)],'functionNode':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x144)]}:{}});}return{'method':_0x475ea1(0x154),'url':_0x475ea1(0x121)+_0x20dd77[_0x475ea1(0x126)]+(_0x57c231?_0x475ea1(0x158)+_0x57c231:'')+'¤tPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x20dd77['appCode'],'filterType':_0x57c231??null,..._0x5683b9&&_0x5683b9[_0x475ea1(0xf8)][_0x475ea1(0x105)]>0x0?{'hookDirectoryMigrations':_0x5683b9[_0x475ea1(0xf8)][_0x475ea1(0xf0)](_0x3f3809=>({'from':_0x3f3809['oldDirectory'],'to':_0x3f3809[_0x475ea1(0x10b)]}))}:{},'files':_0x48f82f},'description':_0x475ea1(0x167)+_0x48f82f[_0x475ea1(0x105)]+_0x475ea1(0x135)};},async 'execute'(_0x586e2a){const _0x383817=a43_0x43b08b,_0x2e6338=loadBffProjectConfig(_0x586e2a[_0x383817(0x126)]),_0x4ed4c7=await readBffLockFile(_0x2e6338['lockFilePath']),{lockData:_0x12af0b,appLock:_0xa95aa9}=ensureLockScope(_0x4ed4c7??createEmptyBffLock(),_0x586e2a[_0x383817(0x126)],_0x2e6338[_0x383817(0xe2)],_0x383817(0x12c)),_0x858031=normalizeBffType(_0x586e2a[_0x383817(0x113)](_0x383817(0x141)))??undefined;if(_0x586e2a[_0x383817(0x113)](_0x383817(0x141))&&!_0x858031)throw CliErrors[_0x383817(0x133)](_0x383817(0x12d));const [_0x2e1db6,_0x301d5d]=await Promise['all']([listBffScripts(_0x586e2a[_0x383817(0x126)],_0x858031),getBffScriptStatistics(_0x586e2a['appCode'])]);if(_0x2e1db6[_0x383817(0x105)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x383817(0xea)};const _0x4da893=_0x586e2a[_0x383817(0xdc)](_0x383817(0xf5));if(_0x4da893&&!_0x586e2a[_0x383817(0x12f)]){const _0x539935=await confirmForce();if(!_0x539935)throw CliErrors[_0x383817(0xfd)](_0x383817(0x159));}if(_0x4da893&&_0x586e2a[_0x383817(0x12f)]){}const _0x2e8489=_0x2e1db6[_0x383817(0x111)](_0x47f83e=>normalizeBffType(_0x47f83e[_0x383817(0x118)])===_0x383817(0x151)),_0xee4bbc=_0x2e8489?buildDatasetCodeToAliasMap(_0x586e2a[_0x383817(0xf9)],_0x586e2a[_0x383817(0x126)],_0x586e2a[_0x383817(0xe9)]||_0x586e2a[_0x383817(0x136)]?.[_0x383817(0x138)]||_0x586e2a[_0x383817(0x136)]?.[_0x383817(0xe3)]):new Map(),_0x340a95=createHookLocationMap(_0x301d5d),_0x63fa27=JSON['parse'](JSON[_0x383817(0x100)](_0x12af0b)),_0x14b735=_0x586e2a[_0x383817(0x126)],_0xad6be3=_0x63fa27['apps'][_0x14b735];if(!_0xad6be3)throw new Error(_0x383817(0xf4)+_0x14b735+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x3b48ca=_0x2e8489?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x2e6338,_0xad6be3,_0xee4bbc,await scanLocalBffFunctions(_0x2e6338,_0x383817(0x151))),_0xad6be3):undefined,_0x14e4b4=createPullFileTransaction(),_0x43709e=[],_0x1831a4=[],_0x193d8d=[],_0x38b54e=[];for(const _0x3b9675 of _0x2e1db6){const _0x36899c=resolveRemoteScriptTarget(_0x2e6338,_0x3b9675,_0x340a95,_0xad6be3[_0x383817(0x103)],_0xee4bbc);if(!_0x36899c){_0x1831a4['push']({'lockKey':_0x3b9675['scriptType']+'/'+_0x3b9675['functionName'],'reason':_0x383817(0xe1)});continue;}const _0x14f9b5=_0xad6be3['functions'][_0x36899c[_0x383817(0x145)]];try{if(!_0x3b9675['id'])throw new Error(_0x383817(0xf7));if(_0x3b9675[_0x383817(0x11a)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x229b3c=_0x3b9675[_0x383817(0x11a)],_0x488b57=computeContentHash(_0x229b3c);if(!_0x4da893){const _0x45de7a=await hasUnsyncedLocalChanges(_0x36899c[_0x383817(0xf6)],_0x14f9b5,_0x488b57);if(_0x45de7a){_0x193d8d[_0x383817(0x110)](localUnsyncedConflict(_0x36899c,_0x3b9675['id']));continue;}}await _0x14e4b4[_0x383817(0x162)](_0x36899c[_0x383817(0xf6)],_0x229b3c);const _0x5d443b={'hash':_0x488b57,'remoteId':_0x3b9675['id'],'version':_0x3b9675[_0x383817(0xfb)]};_0x36899c[_0x383817(0x141)]===_0x383817(0x151)&&_0x36899c['hookLocation']&&(_0x5d443b[_0x383817(0x101)]=_0x36899c[_0x383817(0x160)][_0x383817(0x101)],_0x5d443b[_0x383817(0x11f)]=_0x36899c[_0x383817(0x160)]['datasetCode'],_0x5d443b[_0x383817(0x114)]=_0x36899c[_0x383817(0x160)][_0x383817(0x114)],_0x5d443b[_0x383817(0x144)]=_0x36899c[_0x383817(0x160)][_0x383817(0x144)]),_0xad6be3['functions'][_0x36899c[_0x383817(0x145)]]=_0x5d443b,_0x43709e[_0x383817(0x110)]({'lockKey':_0x36899c[_0x383817(0x145)],'remoteId':_0x3b9675['id']});}catch(_0x216f03){_0x38b54e['push']({'lockKey':_0x36899c['lockKey'],'error':_0x216f03 instanceof Error?_0x216f03[_0x383817(0x107)]:String(_0x216f03)});}}_0xad6be3['lastSync']=new Date()['toISOString']();try{await writeBffLockFile(_0x2e6338[_0x383817(0x14c)],_0x63fa27);}catch(_0x5b4f57){const _0x31185c=[...await _0x14e4b4['rollback'](),...await _0x3b48ca?.[_0x383817(0x168)]()??[]];throw withRollbackErrors(_0x5b4f57,_0x383817(0x16b),_0x31185c);}return{'ok':_0x38b54e[_0x383817(0x105)]===0x0,'data':{'pulled':_0x43709e,'skipped':_0x1831a4,'conflicts':_0x193d8d,'failed':_0x38b54e},'message':formatPullMessage(_0x43709e[_0x383817(0x105)],_0x1831a4[_0x383817(0x105)],_0x193d8d[_0x383817(0x105)],_0x38b54e[_0x383817(0x105)])};}};function localUnsyncedConflict(_0x16eda9,_0x4f340c){const _0x52c39b=a43_0x43b08b,_0x483f78=_0x16eda9[_0x52c39b(0x145)]['split']('/')['at'](-0x1);return{'code':_0x52c39b(0x16c),'lockKey':_0x16eda9[_0x52c39b(0x145)],'filePath':_0x16eda9[_0x52c39b(0xf6)],..._0x4f340c!=null?{'remoteId':_0x4f340c}:{},'message':_0x52c39b(0x161),'nextAction':{'action':_0x52c39b(0xe0),'command':CLI_BIN_NAME+'\x20bff\x20push\x20--type\x20'+_0x16eda9[_0x52c39b(0x141)]+_0x52c39b(0xef)+_0x483f78+_0x52c39b(0x128),'requiresReview':!![],'message':'If\x20the\x20reviewed\x20local\x20script\x20should\x20win,\x20run\x20this\x20command\x20to\x20update\x20the\x20remote\x20script.\x20Do\x20not\x20use\x20--force\x20to\x20resolve\x20a\x20content\x20conflict.'}};}function formatPullMessage(_0x48ea72,_0x150890,_0x1befdd,_0x419c7e){const _0x13f259=a43_0x43b08b,_0x3e7e1c=[_0x13f259(0x13d)+_0x48ea72+_0x13f259(0xf3),_0x150890+_0x13f259(0x15d)];_0x1befdd>0x0&&_0x3e7e1c['push'](_0x1befdd+_0x13f259(0x14a)+(_0x1befdd===0x1?'':'s')+'\x20'+(_0x1befdd===0x1?_0x13f259(0x11d):_0x13f259(0x15e))+'\x20resolution');if(_0x419c7e>0x0)_0x3e7e1c['push'](_0x419c7e+_0x13f259(0x124));return _0x3e7e1c[_0x13f259(0x11c)](',\x20');}function a43_0x35f6(_0x1d02e1,_0x384ed5){_0x1d02e1=_0x1d02e1-0xda;const _0x4def8a=a43_0x4def();let _0x35f6f2=_0x4def8a[_0x1d02e1];return _0x35f6f2;}async function hasUnsyncedLocalChanges(_0x4ba554,_0xc613cc,_0x8d3c6b){if(!await fileExists(_0x4ba554))return![];const _0x2f1905=await computeFileHash(_0x4ba554);if(!_0xc613cc)return _0x8d3c6b?_0x2f1905!==_0x8d3c6b:!![];return _0x2f1905!==_0xc613cc['hash'];}function createPullFileTransaction(){const _0xf6ebeb=new Map(),_0x466851=async(_0x51f56b,_0x284626)=>{const _0x12b850=a43_0x35f6;try{if(_0x284626[_0x12b850(0x165)])await ensureParentDirectory(_0x51f56b),await writeFile(_0x51f56b,_0x284626[_0x12b850(0x116)]);else try{await unlink(_0x51f56b);}catch(_0x3e9217){if(_0x3e9217[_0x12b850(0x11b)]!==_0x12b850(0xee))throw _0x3e9217;}return undefined;}catch(_0x4e1604){return _0x4e1604 instanceof Error?_0x4e1604:new Error(String(_0x4e1604));}};return{async 'write'(_0x418b1a,_0xcf5af1){const _0x5135ea=a43_0x35f6;if(!_0xf6ebeb[_0x5135ea(0x149)](_0x418b1a))try{_0xf6ebeb[_0x5135ea(0x130)](_0x418b1a,{'existed':!![],'content':await readFile(_0x418b1a)});}catch(_0x4808de){if(_0x4808de[_0x5135ea(0x11b)]!=='ENOENT')throw _0x4808de;_0xf6ebeb[_0x5135ea(0x130)](_0x418b1a,{'existed':![]});}try{await ensureParentDirectory(_0x418b1a),await writeFile(_0x418b1a,_0xcf5af1,'utf8');}catch(_0x2dd1b3){const _0x2e3e12=await _0x466851(_0x418b1a,_0xf6ebeb[_0x5135ea(0x120)](_0x418b1a));if(!_0x2e3e12)_0xf6ebeb['delete'](_0x418b1a);throw withRollbackErrors(_0x2dd1b3,_0x5135ea(0x15b)+_0x418b1a+'\x22.',_0x2e3e12?[_0x2e3e12]:[]);}},async 'rollback'(){const _0x2e90ca=a43_0x35f6,_0x12f8c7=[];for(const [_0x72f6b9,_0x5d318f]of[..._0xf6ebeb[_0x2e90ca(0x12a)]()][_0x2e90ca(0x16d)]()){const _0x230d83=await _0x466851(_0x72f6b9,_0x5d318f);_0x230d83&&_0x12f8c7['push'](new Error(_0x2e90ca(0xf1)+_0x72f6b9+'\x22:\x20'+_0x230d83[_0x2e90ca(0x107)]));}return _0x12f8c7;}};}function withRollbackErrors(_0x46a7d2,_0x3d00ac,_0x2b0bbc){const _0x324400=a43_0x43b08b,_0x13bf94=_0x46a7d2 instanceof Error?_0x46a7d2:new Error(String(_0x46a7d2));if(_0x2b0bbc['length']===0x0)return _0x13bf94;return new AggregateError([_0x13bf94,..._0x2b0bbc],_0x3d00ac+'\x20Recovery\x20errors:\x20'+_0x2b0bbc[_0x324400(0xf0)](_0x1558db=>_0x1558db['message'])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x5e1a6f,_0x2bdc4e,_0x4ad510){const _0x177194=a43_0x43b08b,_0x29da15=resolveApiModelSource(_0x5e1a6f,_0x2bdc4e,_0x4ad510),_0x39ec33=loadAliasMap(_0x5e1a6f,undefined,_0x29da15[_0x177194(0xf6)],_0x29da15[_0x177194(0x10f)]);return assertUnambiguousHookAliases(_0x39ec33),new Map(_0x39ec33[_0x177194(0xf0)](_0x21ef19=>[_0x21ef19[_0x177194(0x11f)][_0x177194(0x109)](),_0x21ef19['alias']]));}async function planHookDirectoryMigration(_0x1f8ba8,_0xbc4ef3,_0x5b6b1f,_0xc93b7f){const _0x168528=a43_0x43b08b,_0x2959d8=new Map();for(const [_0x462440,_0x166ec9]of Object[_0x168528(0x12a)](_0xbc4ef3[_0x168528(0x103)])){const [_0x242e16,_0x55d6df,_0x2e2492,_0x4f698d,_0x40dfea,..._0x13c5ff]=_0x462440[_0x168528(0x13a)]('/');if(_0x242e16!=='HOOK'||!_0x55d6df||!_0x2e2492||!_0x4f698d||!_0x40dfea||_0x13c5ff[_0x168528(0x105)]>0x0||!_0x166ec9[_0x168528(0x11f)])continue;const _0x3b37aa=_0x5b6b1f[_0x168528(0x120)](_0x166ec9[_0x168528(0x11f)][_0x168528(0x109)]()),_0x2db6de=_0x3b37aa??_0x166ec9[_0x168528(0x11f)];if(!isSafeHookDirectorySegment(_0x55d6df))throw CliErrors['validation']('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x55d6df+'\x22\x20from\x20the\x20lock\x20file.');if(!isSafeHookDirectorySegment(_0x2db6de))throw CliErrors['validation'](_0x168528(0xfa)+_0x55d6df+_0x168528(0x115));if(_0x55d6df===_0x2db6de)continue;const _0x22936a=_0x2959d8[_0x168528(0x120)](_0x55d6df)??{'datasetCode':_0x166ec9[_0x168528(0x11f)],'alias':_0x3b37aa,'keyChanges':[]};if(_0x22936a[_0x168528(0x11f)]!==_0x166ec9[_0x168528(0x11f)])throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x55d6df+_0x168528(0xde));const _0x182a6a=_0x168528(0x102)+_0x2db6de+'/'+_0x2e2492+'/'+_0x4f698d+'/'+_0x40dfea;try{resolveLocalFilePathFromLockKey(_0x1f8ba8,_0x462440),resolveLocalFilePathFromLockKey(_0x1f8ba8,_0x182a6a);}catch(_0x180dc8){throw CliErrors[_0x168528(0x133)](_0x168528(0x148)+_0x462440+_0x168528(0x104)+(_0x180dc8 instanceof Error?_0x180dc8[_0x168528(0x107)]:String(_0x180dc8)));}_0x22936a[_0x168528(0x14d)][_0x168528(0x110)]({'oldLockKey':_0x462440,'newLockKey':_0x182a6a,'entry':_0x166ec9}),_0x2959d8[_0x168528(0x130)](_0x55d6df,_0x22936a);}const _0x323344=new Set([..._0x2959d8[_0x168528(0x131)]()][_0x168528(0xfc)](_0x5d1e2c=>_0x5d1e2c[_0x168528(0x14d)][_0x168528(0xf0)](_0x5e6d9f=>_0x5e6d9f[_0x168528(0x157)]))),_0x38280b=new Map(),_0x24243b=new Map();for(const [_0x328d7b,_0x36bef7]of _0x2959d8){const _0x5a1a92=_0x36bef7['alias']??_0x36bef7['datasetCode'],_0x325cf5=hookDirectoryIdentity(_0x5a1a92),_0x2daeac=_0x38280b[_0x168528(0x120)](_0x325cf5);if(_0x2daeac&&_0x2daeac!==_0x328d7b)throw CliErrors[_0x168528(0x133)](_0x168528(0x150)+_0x2daeac+'\x22\x20and\x20\x22'+_0x328d7b+'\x22:\x20both\x20target\x20\x22'+_0x5a1a92+_0x168528(0x140));_0x38280b[_0x168528(0x130)](_0x325cf5,_0x328d7b);for(const _0x5a1763 of _0x36bef7['keyChanges']){const _0x171c75=_0x24243b[_0x168528(0x120)](_0x5a1763['newLockKey']);if(_0x171c75&&_0x171c75!==_0x5a1763[_0x168528(0x157)])throw CliErrors[_0x168528(0x133)](_0x168528(0x129)+_0x171c75+'\x22\x20and\x20\x22'+_0x5a1763[_0x168528(0x157)]+_0x168528(0xf2)+_0x5a1763[_0x168528(0x164)]+_0x168528(0x12e));if(_0x323344['has'](_0x5a1763['newLockKey']))throw CliErrors[_0x168528(0x133)](_0x168528(0x152)+_0x5a1763[_0x168528(0x157)]+'\x22:\x20its\x20target\x20\x22'+_0x5a1763[_0x168528(0x164)]+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x24243b[_0x168528(0x130)](_0x5a1763[_0x168528(0x164)],_0x5a1763['oldLockKey']);}}const _0x451dfe=new Map();for(const [_0x210381,_0x145b2e]of _0x5b6b1f){_0x451dfe['set'](hookDirectoryIdentity(_0x145b2e),_0x210381);}const _0x115519=[];for(const [_0x21017e,_0x44cabd]of _0x2959d8){const _0x16b346=_0x44cabd[_0x168528(0x101)]??_0x44cabd[_0x168528(0x11f)],_0xd84c5=join(_0x1f8ba8[_0x168528(0xdf)],_0x168528(0x151),_0x21017e),_0x5d5fb5=join(_0x1f8ba8[_0x168528(0xdf)],'HOOK',_0x16b346),_0xdcb96e=await directoryExists(_0xd84c5),_0x201372=await directoryExists(_0x5d5fb5),_0x175960=_0xdcb96e?_0x201372?await sameDirectory(_0xd84c5,_0x5d5fb5)?'case-rename':undefined:'move':'rekey';if(!_0x175960)throw CliErrors[_0x168528(0x133)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x21017e+'\x22\x20to\x20\x22'+_0x16b346+_0x168528(0x127));const _0xcc062c=_0x451dfe[_0x168528(0x120)](hookDirectoryIdentity(_0x21017e));if(_0xcc062c&&_0xcc062c!==_0x44cabd[_0x168528(0x11f)][_0x168528(0x109)]()){const _0x3ec37d=new Set(_0x44cabd[_0x168528(0x14d)][_0x168528(0xf0)](_0x52ab8b=>_0x52ab8b['oldLockKey'])),_0x12b62c=_0xc93b7f[_0x168528(0xdb)](_0x5768a5=>_0x5768a5[_0x168528(0x141)]===_0x168528(0x151)&&_0x5768a5['alias']!=null&&hookDirectoryIdentity(_0x5768a5[_0x168528(0x101)])===hookDirectoryIdentity(_0x21017e)&&!_0x3ec37d[_0x168528(0x149)](_0x5768a5[_0x168528(0x145)]));if(_0x12b62c[_0x168528(0x105)]>0x0)throw CliErrors['validation'](_0x168528(0xfa)+_0x21017e+_0x168528(0x163));}const _0x268e6c=_0x451dfe[_0x168528(0x120)](hookDirectoryIdentity(_0x16b346));if(_0x268e6c&&_0x268e6c!==_0x44cabd[_0x168528(0x11f)][_0x168528(0x109)]())throw CliErrors[_0x168528(0x133)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x21017e+'\x22\x20to\x20\x22'+_0x16b346+_0x168528(0x153));for(const _0x52f992 of _0x44cabd[_0x168528(0x14d)]){const _0x1f2517=_0xbc4ef3[_0x168528(0x103)][_0x52f992[_0x168528(0x164)]];if(_0x1f2517&&!_0x323344[_0x168528(0x149)](_0x52f992[_0x168528(0x164)])&&!sameHookIdentity(_0x52f992[_0x168528(0x125)],_0x1f2517))throw CliErrors[_0x168528(0x133)](_0x168528(0xfa)+_0x21017e+_0x168528(0x14b)+_0x16b346+_0x168528(0xff));}_0x115519[_0x168528(0x110)]({'oldDirectory':_0x21017e,'newDirectory':_0x16b346,'oldDirectoryPath':_0xd84c5,'newDirectoryPath':_0x5d5fb5,'mode':_0x175960,'alias':_0x44cabd[_0x168528(0x101)],'keyChanges':_0x44cabd[_0x168528(0x14d)]});}const _0x2b922e={..._0xbc4ef3[_0x168528(0x103)]},_0x3893ad=new Map(),_0x11c2a4=new Map();for(const _0x3b1cc9 of _0x115519){const _0x1bf130=_0x3b1cc9['mode']!==_0x168528(0xe8);_0x1bf130&&_0x11c2a4[_0x168528(0x130)](hookDirectoryIdentity(_0x3b1cc9['newDirectory']),_0x3b1cc9[_0x168528(0x12b)]);for(const _0x3f9601 of _0x3b1cc9['keyChanges']){const _0x8d7456=_0x2b922e[_0x3f9601[_0x168528(0x164)]],_0x1c4698=_0x1bf130?_0x3f9601[_0x168528(0x125)]:_0x8d7456??_0x3f9601[_0x168528(0x125)];_0x2b922e[_0x3f9601['newLockKey']]=canonicalizeHookEntry(_0x1c4698,_0x3b1cc9['alias']),delete _0x2b922e[_0x3f9601[_0x168528(0x157)]],_0x1bf130&&_0x3893ad[_0x168528(0x130)](_0x3f9601[_0x168528(0x164)],resolveLocalFilePathFromLockKey(_0x1f8ba8,_0x3f9601[_0x168528(0x157)]));}}return{'migrations':_0x115519,'projectedFunctions':_0x2b922e,'sourceFilePathByNewLockKey':_0x3893ad,'sourceDirectoryPathByNewDirectory':_0x11c2a4};}function resolveMigratedSourceFilePath(_0x566827,_0x529907){const _0x15d5ee=a43_0x43b08b;if(!_0x566827||!_0x529907)return undefined;const _0x323b8e=_0x566827[_0x15d5ee(0xed)][_0x15d5ee(0x120)](_0x529907['lockKey']);if(_0x323b8e)return _0x323b8e;if(_0x529907['type']!=='HOOK')return undefined;const [,_0x1ae5bd,..._0xe325cf]=_0x529907['lockKey'][_0x15d5ee(0x13a)]('/');if(!_0x1ae5bd||_0xe325cf[_0x15d5ee(0x105)]===0x0)return undefined;const _0x3a07f9=_0x566827[_0x15d5ee(0x13e)][_0x15d5ee(0x120)](hookDirectoryIdentity(_0x1ae5bd));return _0x3a07f9?join(_0x3a07f9,..._0xe325cf)+_0x15d5ee(0x14f):undefined;}function sameHookIdentity(_0xf94da4,_0x372208){const _0x323ad6=a43_0x43b08b;return _0xf94da4[_0x323ad6(0x10d)]===_0x372208[_0x323ad6(0x10d)]&&_0xf94da4[_0x323ad6(0x11f)]===_0x372208[_0x323ad6(0x11f)]&&_0xf94da4[_0x323ad6(0x114)]===_0x372208[_0x323ad6(0x114)]&&_0xf94da4['functionNode']===_0x372208[_0x323ad6(0x144)];}function canonicalizeHookEntry(_0x357ef5,_0x200581){const {alias:_0x7cb840,..._0x5744e7}=_0x357ef5;return _0x200581?{..._0x5744e7,'alias':_0x200581}:_0x5744e7;}function hookDirectoryIdentity(_0x2f1784){const _0x1d9dd0=a43_0x43b08b;return _0x2f1784[_0x1d9dd0(0xe5)]('NFC')[_0x1d9dd0(0x109)]();}function isSafeHookDirectorySegment(_0xe03fe2){return isSafeLockKeySegment(_0xe03fe2);}async function sameDirectory(_0x3e745a,_0x4ab009){const _0x1805ec=a43_0x43b08b,[_0x14732e,_0xd0f1ba]=await Promise['all']([stat(_0x3e745a),stat(_0x4ab009)]);return _0x14732e[_0x1805ec(0x134)]===_0xd0f1ba[_0x1805ec(0x134)]&&_0x14732e['ino']===_0xd0f1ba[_0x1805ec(0x16f)];}async function applyHookDirectoryMigration(_0x26926e,_0x3de425){const _0x4efb6a=a43_0x43b08b,_0x4176e2=_0x3de425[_0x4efb6a(0x103)],_0x5372fe=_0x3de425[_0x4efb6a(0x10e)],_0x3d314d=[],_0x107dde=async()=>{const _0x14d566=_0x4efb6a,_0x3bcf13=[];_0x3de425['functions']=_0x4176e2,_0x3de425[_0x14d566(0x10e)]=_0x5372fe;for(const {migration:_0x407fa2,temporaryPath:_0x4902d8}of[..._0x3d314d]['reverse']()){try{_0x4902d8?(await rename(_0x407fa2[_0x14d566(0x14e)],_0x4902d8),await rename(_0x4902d8,_0x407fa2[_0x14d566(0x12b)])):await rename(_0x407fa2[_0x14d566(0x14e)],_0x407fa2[_0x14d566(0x12b)]);}catch(_0x555f2a){_0x3bcf13['push'](new Error(_0x14d566(0x123)+_0x407fa2[_0x14d566(0xda)]+'\x22\x20from\x20\x22'+_0x407fa2[_0x14d566(0x10b)]+'\x22:\x20'+(_0x555f2a instanceof Error?_0x555f2a[_0x14d566(0x107)]:String(_0x555f2a))));}}return _0x3bcf13;};try{for(const _0x185e89 of _0x26926e[_0x4efb6a(0xf8)]){if(_0x185e89[_0x4efb6a(0x106)]==='move')await ensureParentDirectory(_0x185e89[_0x4efb6a(0x14e)]),await rename(_0x185e89[_0x4efb6a(0x12b)],_0x185e89[_0x4efb6a(0x14e)]),_0x3d314d[_0x4efb6a(0x110)]({'migration':_0x185e89});else{if(_0x185e89[_0x4efb6a(0x106)]==='case-rename'){const _0x2ccd57=join(dirname(_0x185e89[_0x4efb6a(0x12b)]),_0x4efb6a(0x122)+randomUUID());await rename(_0x185e89[_0x4efb6a(0x12b)],_0x2ccd57);try{await rename(_0x2ccd57,_0x185e89[_0x4efb6a(0x14e)]);}catch(_0x572bb8){try{await rename(_0x2ccd57,_0x185e89[_0x4efb6a(0x12b)]);}catch(_0x2fda1f){throw withRollbackErrors(_0x572bb8,'Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22'+_0x185e89[_0x4efb6a(0xda)]+'\x22\x20to\x20\x22'+_0x185e89[_0x4efb6a(0x10b)]+_0x4efb6a(0x16e)+_0x2ccd57+_0x4efb6a(0xe7),[new Error('Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22'+_0x2ccd57+'\x22\x20to\x20\x22'+_0x185e89[_0x4efb6a(0xda)]+_0x4efb6a(0x104)+(_0x2fda1f instanceof Error?_0x2fda1f[_0x4efb6a(0x107)]:String(_0x2fda1f)))]);}throw _0x572bb8;}_0x3d314d[_0x4efb6a(0x110)]({'migration':_0x185e89,'temporaryPath':_0x2ccd57});}}}return _0x3de425['functions']=_0x26926e[_0x4efb6a(0xdd)],{'rollback':_0x107dde};}catch(_0xbfbb2c){const _0x587dd5=await _0x107dde();throw withRollbackErrors(_0xbfbb2c,_0x4efb6a(0x166),_0x587dd5);}}async function confirmForce(){const _0x58bd66=a43_0x43b08b,_0x2080b8=createInterface({'input':process[_0x58bd66(0x117)],'output':process[_0x58bd66(0xec)]}),_0x23fcd7=await new Promise(_0xfc74a4=>{const _0x22fdcf=_0x58bd66;_0x2080b8[_0x22fdcf(0x13b)](_0x22fdcf(0x156),_0xfc74a4);});return _0x2080b8[_0x58bd66(0x146)](),['y',_0x58bd66(0x13c)][_0x58bd66(0x119)](_0x23fcd7[_0x58bd66(0x155)]()[_0x58bd66(0x109)]());}
|
|
1
|
+
const a43_0x5e2799=a43_0x35d5;(function(_0x4ae0f8,_0x56df36){const _0x5150f6=a43_0x35d5,_0x13d3d2=_0x4ae0f8();while(!![]){try{const _0x41880a=parseInt(_0x5150f6(0xb5))/0x1*(parseInt(_0x5150f6(0xc5))/0x2)+parseInt(_0x5150f6(0xfc))/0x3*(parseInt(_0x5150f6(0xf2))/0x4)+parseInt(_0x5150f6(0xe9))/0x5*(parseInt(_0x5150f6(0x93))/0x6)+parseInt(_0x5150f6(0xd6))/0x7+parseInt(_0x5150f6(0x83))/0x8+parseInt(_0x5150f6(0xe4))/0x9+-parseInt(_0x5150f6(0x102))/0xa;if(_0x41880a===_0x56df36)break;else _0x13d3d2['push'](_0x13d3d2['shift']());}catch(_0x17093f){_0x13d3d2['push'](_0x13d3d2['shift']());}}}(a43_0x2f06,0xbf0fe));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';function a43_0x2f06(){const _0x29757c=['appCode','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','currentApp','flatMap','3KaeZFP','migrations','scriptsRootDir','Remote\x20script\x20missing\x20content.','lastSync','push_local','55787620zmXtbo','rollback','filePath','scriptsRoot','\x22\x20may\x20remain.','push','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.','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','sourceDirectoryPathByNewDirectory','ino','oldDirectoryPath','sourceFilePathByNewLockKey','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','split','apiDir','\x20Recovery\x20errors:\x20','\x20bff\x20push\x20--type\x20','HOOK/','force','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','existed','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','10947920BNJAGr','Pull\x20only\x20this\x20script\x20type','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','\x22\x20from\x20\x22','.js','&type=','scriptType','string','oldDirectory','dev','hookLocation','content','length','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','stringify','\x22\x20from\x20the\x20lock\x20file.','1083708FrBeOD','apps','Could\x20not\x20restore\x20local\x20script\x20\x22','has','\x20--format\x20compress','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','conflict','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','keyChanges','code','some','toLowerCase','newDirectory','functionNode','newLockKey','lockKey','nonInteractive','\x20failed','join','question','all','normalize','boolean','stderr','trim','Would\x20inspect\x20','profileName','Pull\x20complete:\x20','read','move','remoteId','mergedCli','str','Failed\x20to\x20write\x20local\x20script\x20\x22','8NgNRqg','type','operationType','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','yes','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','projectedFunctions','\x20resolution','\x22\x20to\x20\x22','HOOK','\x22:\x20','bool','map','case-rename','requires','cancelled','61260pUOiOu','parse','message','set','\x20skipped','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','utf8','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','NFC','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','values','¤tPage=1&pageSize=','functions','datasetCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','9970548ukCgNZ','would_pull','\x22:\x20its\x20target\x20\x22','includes','\x20pulled','lockFilePath','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','ENDPOINT','entry','ENOENT','\x22\x20and\x20\x22','delete','reverse','rekey','7707195Cwergq','Force\x20overwrite\x20local\x20unsynced\x20changes','oldLockKey','validation','\x20conflict','25pvmFOH','functionName','pull','\x22:\x20both\x20target\x20\x22','mode','/api/management/library/scripts/list?appCode=','entries','\x22;\x20temporary\x20directory\x20\x22','newDirectoryPath','6256052RluOHv','BFF_LOCAL_UNSYNCED','get','scriptContent','selectedAppName','alias'];a43_0x2f06=function(){return _0x29757c;};return a43_0x2f06();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':'bff','command':a43_0x5e2799(0xeb),'description':a43_0x5e2799(0x10f),'risk':a43_0x5e2799(0xaf),'structuredErrors':!![],'flags':[{'name':a43_0x5e2799(0xb6),'type':a43_0x5e2799(0x8a),'description':a43_0x5e2799(0x84),'enum':['COMMON',a43_0x5e2799(0xdd),'HOOK']},{'name':'force','type':a43_0x5e2799(0xa9),'description':a43_0x5e2799(0xe5)}],async 'dryRun'(_0x797d03){const _0xd6dabe=a43_0x5e2799,_0x38b4d9=loadBffProjectConfig(_0x797d03[_0xd6dabe(0xf8)]),_0x411f6f=await readBffLockFile(_0x38b4d9[_0xd6dabe(0xdb)]),{appLock:_0x51394b}=ensureLockScope(_0x411f6f??createEmptyBffLock(),_0x797d03['appCode'],_0x38b4d9[_0xd6dabe(0x105)],_0xd6dabe(0xeb)),_0x940b8c=normalizeBffType(_0x797d03['str'](_0xd6dabe(0xb6)))??undefined,[_0x4a8247,_0x342c34]=await Promise[_0xd6dabe(0xa7)]([listBffScripts(_0x797d03[_0xd6dabe(0xf8)],_0x940b8c),getBffScriptStatistics(_0x797d03[_0xd6dabe(0xf8)])]),_0x1c70ad=_0x4a8247[_0xd6dabe(0x9d)](_0x194429=>normalizeBffType(_0x194429[_0xd6dabe(0x89)])===_0xd6dabe(0xbe)),_0x1ff0ff=_0x1c70ad?buildDatasetCodeToAliasMap(_0x797d03[_0xd6dabe(0x111)],_0x797d03[_0xd6dabe(0xf8)],_0x797d03[_0xd6dabe(0xf6)]||_0x797d03[_0xd6dabe(0xb2)]?.[_0xd6dabe(0xfa)]||_0x797d03[_0xd6dabe(0xb2)]?.['defaultApp']):new Map(),_0x2e12cf=_0x1c70ad?await planHookDirectoryMigration(_0x38b4d9,_0x51394b,_0x1ff0ff,await scanLocalBffFunctions(_0x38b4d9,'HOOK')):undefined,_0xa7b11c=createHookLocationMap(_0x342c34),_0x3dfb06=[];for(const _0x294b53 of _0x4a8247){const _0x3b5842=resolveRemoteScriptTarget(_0x38b4d9,_0x294b53,_0xa7b11c,_0x2e12cf?.[_0xd6dabe(0xbb)]??_0x51394b[_0xd6dabe(0xd3)],_0x1ff0ff);if(!_0x3b5842){_0x3dfb06[_0xd6dabe(0x107)]({'scriptType':_0x294b53[_0xd6dabe(0x89)],'functionName':_0x294b53['functionName']??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x2ba799=(_0x2e12cf?.[_0xd6dabe(0xbb)]??_0x51394b[_0xd6dabe(0xd3)])[_0x3b5842[_0xd6dabe(0xa2)]],_0x3bbfff=_0x294b53[_0xd6dabe(0xf5)]!=null?computeContentHash(_0x294b53[_0xd6dabe(0xf5)]):undefined,_0x84478d=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x2e12cf,_0x3b5842)??_0x3b5842[_0xd6dabe(0x104)],_0x2ba799,_0x3bbfff),_0x3c9528=_0x84478d?localUnsyncedConflict(_0x3b5842,_0x294b53['id']):undefined;_0x3dfb06['push']({'lockKey':_0x3b5842[_0xd6dabe(0xa2)],'filePath':_0x3b5842['filePath'],'remoteId':_0x294b53['id']??null,'status':_0x3c9528?_0xd6dabe(0x99):_0xd6dabe(0xd7),..._0x3c9528?{'conflict':_0x3c9528}:{},..._0x3b5842['hookLocation']?{'alias':_0x3b5842[_0xd6dabe(0x8d)][_0xd6dabe(0xf7)]??null,'datasetCode':_0x3b5842[_0xd6dabe(0x8d)]['datasetCode'],'operationType':_0x3b5842[_0xd6dabe(0x8d)][_0xd6dabe(0xb7)],'functionNode':_0x3b5842[_0xd6dabe(0x8d)][_0xd6dabe(0xa0)]}:{}});}return{'method':'GET','url':_0xd6dabe(0xee)+_0x797d03[_0xd6dabe(0xf8)]+(_0x940b8c?_0xd6dabe(0x88)+_0x940b8c:'')+_0xd6dabe(0xd2)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x797d03[_0xd6dabe(0xf8)],'filterType':_0x940b8c??null,..._0x2e12cf&&_0x2e12cf[_0xd6dabe(0xfd)][_0xd6dabe(0x8f)]>0x0?{'hookDirectoryMigrations':_0x2e12cf[_0xd6dabe(0xfd)][_0xd6dabe(0xc1)](_0x2eb72f=>({'from':_0x2eb72f['oldDirectory'],'to':_0x2eb72f[_0xd6dabe(0x9f)]}))}:{},'files':_0x3dfb06},'description':_0xd6dabe(0xac)+_0x3dfb06['length']+_0xd6dabe(0xdc)};},async 'execute'(_0x1b3331){const _0x123023=a43_0x5e2799,_0x4ac574=loadBffProjectConfig(_0x1b3331[_0x123023(0xf8)]),_0x16ef84=await readBffLockFile(_0x4ac574['lockFilePath']),{lockData:_0x23ef0a,appLock:_0x5892e9}=ensureLockScope(_0x16ef84??createEmptyBffLock(),_0x1b3331[_0x123023(0xf8)],_0x4ac574[_0x123023(0x105)],_0x123023(0xeb)),_0x5a3b5a=normalizeBffType(_0x1b3331[_0x123023(0xb3)]('type'))??undefined;if(_0x1b3331['str'](_0x123023(0xb6))&&!_0x5a3b5a)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x108fd7,_0x385b97]=await Promise[_0x123023(0xa7)]([listBffScripts(_0x1b3331[_0x123023(0xf8)],_0x5a3b5a),getBffScriptStatistics(_0x1b3331[_0x123023(0xf8)])]);if(_0x108fd7[_0x123023(0x8f)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x123023(0xcd)};const _0x16b5b1=_0x1b3331[_0x123023(0xc0)](_0x123023(0x115));if(_0x16b5b1&&!_0x1b3331[_0x123023(0xa3)]){const _0x324aed=await confirmForce();if(!_0x324aed)throw CliErrors[_0x123023(0xc4)]('Force\x20pull\x20cancelled.');}if(_0x16b5b1&&_0x1b3331['nonInteractive']){}const _0x3378f9=_0x108fd7[_0x123023(0x9d)](_0x2d2522=>normalizeBffType(_0x2d2522['scriptType'])===_0x123023(0xbe)),_0x450531=_0x3378f9?buildDatasetCodeToAliasMap(_0x1b3331['apiDir'],_0x1b3331['appCode'],_0x1b3331[_0x123023(0xf6)]||_0x1b3331['mergedCli']?.[_0x123023(0xfa)]||_0x1b3331[_0x123023(0xb2)]?.['defaultApp']):new Map(),_0x416855=createHookLocationMap(_0x385b97),_0x5501da=JSON[_0x123023(0xc6)](JSON[_0x123023(0x91)](_0x23ef0a)),_0x1bc881=_0x1b3331[_0x123023(0xf8)],_0x207806=_0x5501da[_0x123023(0x94)][_0x1bc881];if(!_0x207806)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1bc881+_0x123023(0xd5));const _0x3095ca=_0x3378f9?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x4ac574,_0x207806,_0x450531,await scanLocalBffFunctions(_0x4ac574,_0x123023(0xbe))),_0x207806):undefined,_0x31877c=createPullFileTransaction(),_0xcd7a3b=[],_0x1a7484=[],_0x41b043=[],_0x2ff60f=[];for(const _0xad3bbb of _0x108fd7){const _0x2092c2=resolveRemoteScriptTarget(_0x4ac574,_0xad3bbb,_0x416855,_0x207806['functions'],_0x450531);if(!_0x2092c2){_0x1a7484['push']({'lockKey':_0xad3bbb['scriptType']+'/'+_0xad3bbb[_0x123023(0xea)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x56dc69=_0x207806['functions'][_0x2092c2[_0x123023(0xa2)]];try{if(!_0xad3bbb['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0xad3bbb[_0x123023(0xf5)]==null)throw new Error(_0x123023(0xff));const _0x57059c=_0xad3bbb['scriptContent'],_0x5dfb57=computeContentHash(_0x57059c);if(!_0x16b5b1){const _0x54c394=await hasUnsyncedLocalChanges(_0x2092c2[_0x123023(0x104)],_0x56dc69,_0x5dfb57);if(_0x54c394){_0x41b043[_0x123023(0x107)](localUnsyncedConflict(_0x2092c2,_0xad3bbb['id']));continue;}}await _0x31877c['write'](_0x2092c2[_0x123023(0x104)],_0x57059c);const _0x299344={'hash':_0x5dfb57,'remoteId':_0xad3bbb['id'],'version':_0xad3bbb['version']};_0x2092c2[_0x123023(0xb6)]===_0x123023(0xbe)&&_0x2092c2[_0x123023(0x8d)]&&(_0x299344[_0x123023(0xf7)]=_0x2092c2['hookLocation'][_0x123023(0xf7)],_0x299344[_0x123023(0xd4)]=_0x2092c2[_0x123023(0x8d)][_0x123023(0xd4)],_0x299344[_0x123023(0xb7)]=_0x2092c2[_0x123023(0x8d)][_0x123023(0xb7)],_0x299344['functionNode']=_0x2092c2[_0x123023(0x8d)][_0x123023(0xa0)]),_0x207806[_0x123023(0xd3)][_0x2092c2['lockKey']]=_0x299344,_0xcd7a3b['push']({'lockKey':_0x2092c2[_0x123023(0xa2)],'remoteId':_0xad3bbb['id']});}catch(_0x568639){_0x2ff60f['push']({'lockKey':_0x2092c2['lockKey'],'error':_0x568639 instanceof Error?_0x568639['message']:String(_0x568639)});}}_0x207806['lastSync']=new Date()['toISOString']();try{await writeBffLockFile(_0x4ac574[_0x123023(0xdb)],_0x5501da);}catch(_0x60c229){const _0x1f4e0f=[...await _0x31877c[_0x123023(0x103)](),...await _0x3095ca?.[_0x123023(0x103)]()??[]];throw withRollbackErrors(_0x60c229,'Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x1f4e0f);}return{'ok':_0x2ff60f[_0x123023(0x8f)]===0x0,'data':{'pulled':_0xcd7a3b,'skipped':_0x1a7484,'conflicts':_0x41b043,'failed':_0x2ff60f},'message':formatPullMessage(_0xcd7a3b[_0x123023(0x8f)],_0x1a7484['length'],_0x41b043[_0x123023(0x8f)],_0x2ff60f[_0x123023(0x8f)])};}};function a43_0x35d5(_0x385929,_0x269af0){_0x385929=_0x385929-0x80;const _0x2f066d=a43_0x2f06();let _0x35d59d=_0x2f066d[_0x385929];return _0x35d59d;}function localUnsyncedConflict(_0x1f67cf,_0xb6800b){const _0x516db4=a43_0x5e2799,_0x369553=_0x1f67cf[_0x516db4(0xa2)][_0x516db4(0x110)]('/')['at'](-0x1);return{'code':_0x516db4(0xf3),'lockKey':_0x1f67cf[_0x516db4(0xa2)],'filePath':_0x1f67cf[_0x516db4(0x104)],..._0xb6800b!=null?{'remoteId':_0xb6800b}:{},'message':_0x516db4(0x109),'nextAction':{'action':_0x516db4(0x101),'command':CLI_BIN_NAME+_0x516db4(0x113)+_0x1f67cf[_0x516db4(0xb6)]+'\x20--name\x20'+_0x369553+_0x516db4(0x97),'requiresReview':!![],'message':_0x516db4(0x108)}};}function formatPullMessage(_0x4bb318,_0x553ae0,_0x36041d,_0x567632){const _0x2e192f=a43_0x5e2799,_0x16ca18=[_0x2e192f(0xae)+_0x4bb318+_0x2e192f(0xda),_0x553ae0+_0x2e192f(0xc9)];_0x36041d>0x0&&_0x16ca18[_0x2e192f(0x107)](_0x36041d+_0x2e192f(0xe8)+(_0x36041d===0x1?'':'s')+'\x20'+(_0x36041d===0x1?_0x2e192f(0xc3):'require')+_0x2e192f(0xbc));if(_0x567632>0x0)_0x16ca18[_0x2e192f(0x107)](_0x567632+_0x2e192f(0xa4));return _0x16ca18['join'](',\x20');}async function hasUnsyncedLocalChanges(_0x1de41e,_0xf010fd,_0x521075){if(!await fileExists(_0x1de41e))return![];const _0x308081=await computeFileHash(_0x1de41e);if(!_0xf010fd)return _0x521075?_0x308081!==_0x521075:!![];return _0x308081!==_0xf010fd['hash'];}function createPullFileTransaction(){const _0x34c402=new Map(),_0x1f4c59=async(_0x2286a8,_0x2a9bca)=>{const _0x2e8cf9=a43_0x35d5;try{if(_0x2a9bca[_0x2e8cf9(0x81)])await ensureParentDirectory(_0x2286a8),await writeFile(_0x2286a8,_0x2a9bca[_0x2e8cf9(0x8e)]);else try{await unlink(_0x2286a8);}catch(_0x5e7540){if(_0x5e7540[_0x2e8cf9(0x9c)]!==_0x2e8cf9(0xdf))throw _0x5e7540;}return undefined;}catch(_0x233f6e){return _0x233f6e instanceof Error?_0x233f6e:new Error(String(_0x233f6e));}};return{async 'write'(_0xfaa6da,_0x14cdbe){const _0x54ae3f=a43_0x35d5;if(!_0x34c402[_0x54ae3f(0x96)](_0xfaa6da))try{_0x34c402[_0x54ae3f(0xc8)](_0xfaa6da,{'existed':!![],'content':await readFile(_0xfaa6da)});}catch(_0x36d9f8){if(_0x36d9f8[_0x54ae3f(0x9c)]!==_0x54ae3f(0xdf))throw _0x36d9f8;_0x34c402[_0x54ae3f(0xc8)](_0xfaa6da,{'existed':![]});}try{await ensureParentDirectory(_0xfaa6da),await writeFile(_0xfaa6da,_0x14cdbe,_0x54ae3f(0xcb));}catch(_0x16c71a){const _0x22f532=await _0x1f4c59(_0xfaa6da,_0x34c402[_0x54ae3f(0xf4)](_0xfaa6da));if(!_0x22f532)_0x34c402[_0x54ae3f(0xe1)](_0xfaa6da);throw withRollbackErrors(_0x16c71a,_0x54ae3f(0xb4)+_0xfaa6da+'\x22.',_0x22f532?[_0x22f532]:[]);}},async 'rollback'(){const _0x33e483=a43_0x35d5,_0x5d9adb=[];for(const [_0x30b7a5,_0x10f20d]of[..._0x34c402[_0x33e483(0xef)]()][_0x33e483(0xe2)]()){const _0x4c54e8=await _0x1f4c59(_0x30b7a5,_0x10f20d);_0x4c54e8&&_0x5d9adb['push'](new Error(_0x33e483(0x95)+_0x30b7a5+_0x33e483(0xbf)+_0x4c54e8[_0x33e483(0xc7)]));}return _0x5d9adb;}};}function withRollbackErrors(_0x2a77c3,_0x2f103e,_0x5d7fd0){const _0x1497d1=a43_0x5e2799,_0xb8b6fa=_0x2a77c3 instanceof Error?_0x2a77c3:new Error(String(_0x2a77c3));if(_0x5d7fd0[_0x1497d1(0x8f)]===0x0)return _0xb8b6fa;return new AggregateError([_0xb8b6fa,..._0x5d7fd0],_0x2f103e+_0x1497d1(0x112)+_0x5d7fd0[_0x1497d1(0xc1)](_0x57f38e=>_0x57f38e[_0x1497d1(0xc7)])[_0x1497d1(0xa5)](';\x20'));}function buildDatasetCodeToAliasMap(_0x5bd265,_0xcdc171,_0x155bbe){const _0x5d68da=a43_0x5e2799,_0x2f46b2=resolveApiModelSource(_0x5bd265,_0xcdc171,_0x155bbe),_0x4c7b3c=loadAliasMap(_0x5bd265,undefined,_0x2f46b2[_0x5d68da(0x104)],_0x2f46b2[_0x5d68da(0xad)]);return assertUnambiguousHookAliases(_0x4c7b3c),new Map(_0x4c7b3c[_0x5d68da(0xc1)](_0x12fdec=>[_0x12fdec[_0x5d68da(0xd4)][_0x5d68da(0x9e)](),_0x12fdec[_0x5d68da(0xf7)]]));}async function planHookDirectoryMigration(_0x45ca83,_0x261c8f,_0x3c4a72,_0x16bd38){const _0xd9cdf4=a43_0x5e2799,_0x52dca3=new Map();for(const [_0xa0854d,_0x2ae2ff]of Object[_0xd9cdf4(0xef)](_0x261c8f['functions'])){const [_0x3753bc,_0x16ff93,_0x52e889,_0x3a68d5,_0x502019,..._0x498913]=_0xa0854d['split']('/');if(_0x3753bc!==_0xd9cdf4(0xbe)||!_0x16ff93||!_0x52e889||!_0x3a68d5||!_0x502019||_0x498913['length']>0x0||!_0x2ae2ff[_0xd9cdf4(0xd4)])continue;const _0x234dfc=_0x3c4a72[_0xd9cdf4(0xf4)](_0x2ae2ff[_0xd9cdf4(0xd4)][_0xd9cdf4(0x9e)]()),_0x4a2bde=_0x234dfc??_0x2ae2ff[_0xd9cdf4(0xd4)];if(!isSafeHookDirectorySegment(_0x16ff93))throw CliErrors[_0xd9cdf4(0xe7)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x16ff93+_0xd9cdf4(0x92));if(!isSafeHookDirectorySegment(_0x4a2bde))throw CliErrors['validation'](_0xd9cdf4(0x85)+_0x16ff93+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x16ff93===_0x4a2bde)continue;const _0x4e8e28=_0x52dca3[_0xd9cdf4(0xf4)](_0x16ff93)??{'datasetCode':_0x2ae2ff[_0xd9cdf4(0xd4)],'alias':_0x234dfc,'keyChanges':[]};if(_0x4e8e28['datasetCode']!==_0x2ae2ff[_0xd9cdf4(0xd4)])throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x16ff93+_0xd9cdf4(0xcc));const _0x24860c=_0xd9cdf4(0x114)+_0x4a2bde+'/'+_0x52e889+'/'+_0x3a68d5+'/'+_0x502019;try{resolveLocalFilePathFromLockKey(_0x45ca83,_0xa0854d),resolveLocalFilePathFromLockKey(_0x45ca83,_0x24860c);}catch(_0x195997){throw CliErrors['validation'](_0xd9cdf4(0x98)+_0xa0854d+_0xd9cdf4(0xbf)+(_0x195997 instanceof Error?_0x195997[_0xd9cdf4(0xc7)]:String(_0x195997)));}_0x4e8e28[_0xd9cdf4(0x9b)][_0xd9cdf4(0x107)]({'oldLockKey':_0xa0854d,'newLockKey':_0x24860c,'entry':_0x2ae2ff}),_0x52dca3[_0xd9cdf4(0xc8)](_0x16ff93,_0x4e8e28);}const _0x3cb079=new Set([..._0x52dca3[_0xd9cdf4(0xd1)]()][_0xd9cdf4(0xfb)](_0x5843ad=>_0x5843ad[_0xd9cdf4(0x9b)][_0xd9cdf4(0xc1)](_0x4197b8=>_0x4197b8[_0xd9cdf4(0xe6)]))),_0x3245f3=new Map(),_0x5de385=new Map();for(const [_0x18655f,_0x73b485]of _0x52dca3){const _0x44b47b=_0x73b485[_0xd9cdf4(0xf7)]??_0x73b485['datasetCode'],_0x51c26c=hookDirectoryIdentity(_0x44b47b),_0x1bd16c=_0x3245f3[_0xd9cdf4(0xf4)](_0x51c26c);if(_0x1bd16c&&_0x1bd16c!==_0x18655f)throw CliErrors['validation'](_0xd9cdf4(0xba)+_0x1bd16c+_0xd9cdf4(0xe0)+_0x18655f+_0xd9cdf4(0xec)+_0x44b47b+'\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.');_0x3245f3['set'](_0x51c26c,_0x18655f);for(const _0x326b5d of _0x73b485[_0xd9cdf4(0x9b)]){const _0x4f8aa8=_0x5de385['get'](_0x326b5d[_0xd9cdf4(0xa1)]);if(_0x4f8aa8&&_0x4f8aa8!==_0x326b5d['oldLockKey'])throw CliErrors[_0xd9cdf4(0xe7)](_0xd9cdf4(0x90)+_0x4f8aa8+_0xd9cdf4(0xe0)+_0x326b5d[_0xd9cdf4(0xe6)]+'\x22:\x20both\x20target\x20\x22'+_0x326b5d[_0xd9cdf4(0xa1)]+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0x3cb079[_0xd9cdf4(0x96)](_0x326b5d[_0xd9cdf4(0xa1)]))throw CliErrors['validation'](_0xd9cdf4(0x82)+_0x326b5d[_0xd9cdf4(0xe6)]+_0xd9cdf4(0xd8)+_0x326b5d[_0xd9cdf4(0xa1)]+_0xd9cdf4(0x9a));_0x5de385['set'](_0x326b5d[_0xd9cdf4(0xa1)],_0x326b5d['oldLockKey']);}}const _0x2bda59=new Map();for(const [_0x2420e9,_0x40af87]of _0x3c4a72){_0x2bda59[_0xd9cdf4(0xc8)](hookDirectoryIdentity(_0x40af87),_0x2420e9);}const _0x14cba7=[];for(const [_0x101ad1,_0x50fbdd]of _0x52dca3){const _0xee7004=_0x50fbdd[_0xd9cdf4(0xf7)]??_0x50fbdd[_0xd9cdf4(0xd4)],_0x52fedc=join(_0x45ca83[_0xd9cdf4(0xfe)],_0xd9cdf4(0xbe),_0x101ad1),_0xf706cf=join(_0x45ca83[_0xd9cdf4(0xfe)],_0xd9cdf4(0xbe),_0xee7004),_0x51339f=await directoryExists(_0x52fedc),_0x93fbd3=await directoryExists(_0xf706cf),_0x4d7af6=_0x51339f?_0x93fbd3?await sameDirectory(_0x52fedc,_0xf706cf)?_0xd9cdf4(0xc2):undefined:'move':'rekey';if(!_0x4d7af6)throw CliErrors['validation'](_0xd9cdf4(0x85)+_0x101ad1+_0xd9cdf4(0xbd)+_0xee7004+_0xd9cdf4(0xd0));const _0x1ef4b4=_0x2bda59['get'](hookDirectoryIdentity(_0x101ad1));if(_0x1ef4b4&&_0x1ef4b4!==_0x50fbdd[_0xd9cdf4(0xd4)][_0xd9cdf4(0x9e)]()){const _0x182958=new Set(_0x50fbdd['keyChanges'][_0xd9cdf4(0xc1)](_0x2ffb04=>_0x2ffb04[_0xd9cdf4(0xe6)])),_0x1f95aa=_0x16bd38['filter'](_0x54473a=>_0x54473a[_0xd9cdf4(0xb6)]==='HOOK'&&_0x54473a[_0xd9cdf4(0xf7)]!=null&&hookDirectoryIdentity(_0x54473a[_0xd9cdf4(0xf7)])===hookDirectoryIdentity(_0x101ad1)&&!_0x182958[_0xd9cdf4(0x96)](_0x54473a[_0xd9cdf4(0xa2)]));if(_0x1f95aa[_0xd9cdf4(0x8f)]>0x0)throw CliErrors['validation'](_0xd9cdf4(0x85)+_0x101ad1+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x2dbfdf=_0x2bda59[_0xd9cdf4(0xf4)](hookDirectoryIdentity(_0xee7004));if(_0x2dbfdf&&_0x2dbfdf!==_0x50fbdd[_0xd9cdf4(0xd4)][_0xd9cdf4(0x9e)]())throw CliErrors[_0xd9cdf4(0xe7)](_0xd9cdf4(0x85)+_0x101ad1+_0xd9cdf4(0xbd)+_0xee7004+_0xd9cdf4(0xca));for(const _0x1b0c5d of _0x50fbdd['keyChanges']){const _0x82cace=_0x261c8f[_0xd9cdf4(0xd3)][_0x1b0c5d[_0xd9cdf4(0xa1)]];if(_0x82cace&&!_0x3cb079[_0xd9cdf4(0x96)](_0x1b0c5d[_0xd9cdf4(0xa1)])&&!sameHookIdentity(_0x1b0c5d[_0xd9cdf4(0xde)],_0x82cace))throw CliErrors[_0xd9cdf4(0xe7)](_0xd9cdf4(0x85)+_0x101ad1+'\x22\x20to\x20\x22'+_0xee7004+'\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.');}_0x14cba7[_0xd9cdf4(0x107)]({'oldDirectory':_0x101ad1,'newDirectory':_0xee7004,'oldDirectoryPath':_0x52fedc,'newDirectoryPath':_0xf706cf,'mode':_0x4d7af6,'alias':_0x50fbdd[_0xd9cdf4(0xf7)],'keyChanges':_0x50fbdd[_0xd9cdf4(0x9b)]});}const _0x117295={..._0x261c8f['functions']},_0x4b5553=new Map(),_0xcf6afc=new Map();for(const _0x2439ca of _0x14cba7){const _0x5ee22d=_0x2439ca[_0xd9cdf4(0xed)]!==_0xd9cdf4(0xe3);_0x5ee22d&&_0xcf6afc[_0xd9cdf4(0xc8)](hookDirectoryIdentity(_0x2439ca[_0xd9cdf4(0x9f)]),_0x2439ca[_0xd9cdf4(0x10d)]);for(const _0x47d024 of _0x2439ca[_0xd9cdf4(0x9b)]){const _0xef39f6=_0x117295[_0x47d024[_0xd9cdf4(0xa1)]],_0x214134=_0x5ee22d?_0x47d024[_0xd9cdf4(0xde)]:_0xef39f6??_0x47d024[_0xd9cdf4(0xde)];_0x117295[_0x47d024[_0xd9cdf4(0xa1)]]=canonicalizeHookEntry(_0x214134,_0x2439ca[_0xd9cdf4(0xf7)]),delete _0x117295[_0x47d024[_0xd9cdf4(0xe6)]],_0x5ee22d&&_0x4b5553[_0xd9cdf4(0xc8)](_0x47d024['newLockKey'],resolveLocalFilePathFromLockKey(_0x45ca83,_0x47d024[_0xd9cdf4(0xe6)]));}}return{'migrations':_0x14cba7,'projectedFunctions':_0x117295,'sourceFilePathByNewLockKey':_0x4b5553,'sourceDirectoryPathByNewDirectory':_0xcf6afc};}function resolveMigratedSourceFilePath(_0x206fd3,_0x47b9c1){const _0x7a7f65=a43_0x5e2799;if(!_0x206fd3||!_0x47b9c1)return undefined;const _0x553fe7=_0x206fd3[_0x7a7f65(0x10e)]['get'](_0x47b9c1[_0x7a7f65(0xa2)]);if(_0x553fe7)return _0x553fe7;if(_0x47b9c1[_0x7a7f65(0xb6)]!==_0x7a7f65(0xbe))return undefined;const [,_0x1c1979,..._0x234caa]=_0x47b9c1[_0x7a7f65(0xa2)][_0x7a7f65(0x110)]('/');if(!_0x1c1979||_0x234caa['length']===0x0)return undefined;const _0x13c9cf=_0x206fd3[_0x7a7f65(0x10b)][_0x7a7f65(0xf4)](hookDirectoryIdentity(_0x1c1979));return _0x13c9cf?join(_0x13c9cf,..._0x234caa)+_0x7a7f65(0x87):undefined;}function sameHookIdentity(_0x56b2ac,_0x3ded91){const _0x1fcb1b=a43_0x5e2799;return _0x56b2ac[_0x1fcb1b(0xb1)]===_0x3ded91['remoteId']&&_0x56b2ac[_0x1fcb1b(0xd4)]===_0x3ded91['datasetCode']&&_0x56b2ac['operationType']===_0x3ded91[_0x1fcb1b(0xb7)]&&_0x56b2ac[_0x1fcb1b(0xa0)]===_0x3ded91['functionNode'];}function canonicalizeHookEntry(_0x462148,_0x87094b){const {alias:_0x3a06a6,..._0xbeb018}=_0x462148;return _0x87094b?{..._0xbeb018,'alias':_0x87094b}:_0xbeb018;}function hookDirectoryIdentity(_0x595c8f){const _0x51e517=a43_0x5e2799;return _0x595c8f[_0x51e517(0xa8)](_0x51e517(0xcf))[_0x51e517(0x9e)]();}function isSafeHookDirectorySegment(_0x2de881){return isSafeLockKeySegment(_0x2de881);}async function sameDirectory(_0x388eba,_0x57060d){const _0x2143f1=a43_0x5e2799,[_0x5819ce,_0x2efd72]=await Promise[_0x2143f1(0xa7)]([stat(_0x388eba),stat(_0x57060d)]);return _0x5819ce['dev']===_0x2efd72[_0x2143f1(0x8c)]&&_0x5819ce['ino']===_0x2efd72[_0x2143f1(0x10c)];}async function applyHookDirectoryMigration(_0x12d402,_0x9d1b6){const _0x2cca64=a43_0x5e2799,_0x4c9482=_0x9d1b6[_0x2cca64(0xd3)],_0x501655=_0x9d1b6[_0x2cca64(0x100)],_0x2ec54c=[],_0x2b850f=async()=>{const _0x465869=_0x2cca64,_0x4126fe=[];_0x9d1b6[_0x465869(0xd3)]=_0x4c9482,_0x9d1b6[_0x465869(0x100)]=_0x501655;for(const {migration:_0xc8df3c,temporaryPath:_0x2cdb03}of[..._0x2ec54c][_0x465869(0xe2)]()){try{_0x2cdb03?(await rename(_0xc8df3c[_0x465869(0xf1)],_0x2cdb03),await rename(_0x2cdb03,_0xc8df3c[_0x465869(0x10d)])):await rename(_0xc8df3c[_0x465869(0xf1)],_0xc8df3c['oldDirectoryPath']);}catch(_0x46aa39){_0x4126fe[_0x465869(0x107)](new Error(_0x465869(0xce)+_0xc8df3c[_0x465869(0x8b)]+_0x465869(0x86)+_0xc8df3c[_0x465869(0x9f)]+'\x22:\x20'+(_0x46aa39 instanceof Error?_0x46aa39['message']:String(_0x46aa39))));}}return _0x4126fe;};try{for(const _0xb3857e of _0x12d402['migrations']){if(_0xb3857e[_0x2cca64(0xed)]===_0x2cca64(0xb0))await ensureParentDirectory(_0xb3857e[_0x2cca64(0xf1)]),await rename(_0xb3857e[_0x2cca64(0x10d)],_0xb3857e['newDirectoryPath']),_0x2ec54c['push']({'migration':_0xb3857e});else{if(_0xb3857e[_0x2cca64(0xed)]===_0x2cca64(0xc2)){const _0x3ba38e=join(dirname(_0xb3857e[_0x2cca64(0x10d)]),'.hook-directory-migrate-'+randomUUID());await rename(_0xb3857e[_0x2cca64(0x10d)],_0x3ba38e);try{await rename(_0x3ba38e,_0xb3857e[_0x2cca64(0xf1)]);}catch(_0x5148b1){try{await rename(_0x3ba38e,_0xb3857e[_0x2cca64(0x10d)]);}catch(_0x144c9c){throw withRollbackErrors(_0x5148b1,_0x2cca64(0xf9)+_0xb3857e[_0x2cca64(0x8b)]+_0x2cca64(0xbd)+_0xb3857e['newDirectory']+_0x2cca64(0xf0)+_0x3ba38e+_0x2cca64(0x106),[new Error(_0x2cca64(0xb8)+_0x3ba38e+'\x22\x20to\x20\x22'+_0xb3857e['oldDirectory']+'\x22:\x20'+(_0x144c9c instanceof Error?_0x144c9c[_0x2cca64(0xc7)]:String(_0x144c9c)))]);}throw _0x5148b1;}_0x2ec54c['push']({'migration':_0xb3857e,'temporaryPath':_0x3ba38e});}}}return _0x9d1b6[_0x2cca64(0xd3)]=_0x12d402[_0x2cca64(0xbb)],{'rollback':_0x2b850f};}catch(_0x3e6a28){const _0x3cdc87=await _0x2b850f();throw withRollbackErrors(_0x3e6a28,_0x2cca64(0x10a),_0x3cdc87);}}async function confirmForce(){const _0x26a1eb=a43_0x5e2799,_0x37059b=createInterface({'input':process['stdin'],'output':process[_0x26a1eb(0xaa)]}),_0xcc9f2c=await new Promise(_0x501f3f=>{const _0x2a0416=_0x26a1eb;_0x37059b[_0x2a0416(0xa6)](_0x2a0416(0x80),_0x501f3f);});return _0x37059b['close'](),['y',_0x26a1eb(0xb9)][_0x26a1eb(0xd9)](_0xcc9f2c[_0x26a1eb(0xab)]()['toLowerCase']());}
|