@lovrabet/rabetbase-cli 2.3.16-beta.4 → 2.3.16-beta.6
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.d.ts +9 -0
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.d.ts +2 -0
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +8 -0
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.d.ts +13 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +25 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.d.ts +2 -0
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.d.ts +1 -0
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.d.ts +51 -0
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.d.ts +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.d.ts +5 -0
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.d.ts +1 -0
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.d.ts +12 -0
- package/lib/cli-flags.js +1 -1
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.d.ts +2 -0
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.d.ts +2 -0
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.d.ts +2 -0
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.d.ts +2 -0
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.d.ts +18 -0
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.d.ts +5 -0
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.d.ts +10 -0
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.d.ts +2 -0
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.d.ts +11 -0
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +46 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.d.ts +2 -0
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.d.ts +2 -0
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.d.ts +2 -0
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.d.ts +105 -0
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.d.ts +4 -0
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.d.ts +2 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.d.ts +2 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.d.ts +5 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.d.ts +2 -0
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.d.ts +2 -0
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.d.ts +2 -0
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.d.ts +2 -0
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +8 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.d.ts +2 -0
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.d.ts +2 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.d.ts +2 -0
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.d.ts +2 -0
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.d.ts +17 -0
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.d.ts +17 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.d.ts +11 -0
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.d.ts +12 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +26 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.d.ts +13 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.d.ts +5 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.d.ts +5 -0
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.d.ts +5 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.d.ts +5 -0
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.d.ts +16 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.d.ts +7 -0
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.d.ts +7 -0
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.d.ts +8 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.d.ts +33 -0
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.d.ts +18 -0
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.d.ts +11 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.d.ts +2 -0
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.d.ts +2 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.d.ts +26 -0
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.d.ts +27 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.d.ts +3 -0
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.d.ts +2 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +2 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.d.ts +2 -0
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.d.ts +2 -0
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.d.ts +2 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.d.ts +2 -0
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.d.ts +128 -0
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.d.ts +2 -0
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.d.ts +53 -0
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.d.ts +17 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.d.ts +2 -0
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.d.ts +30 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.d.ts +2 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.d.ts +2 -0
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.d.ts +2 -0
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.d.ts +2 -0
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.d.ts +2 -0
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.d.ts +2 -0
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.d.ts +2 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.d.ts +5 -0
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.d.ts +2 -0
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.d.ts +15 -0
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.d.ts +2 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.d.ts +2 -0
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.d.ts +2 -0
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.d.ts +2 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.d.ts +11 -0
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.d.ts +23 -0
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.d.ts +32 -0
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.d.ts +2 -0
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.d.ts +2 -0
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.d.ts +2 -0
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.d.ts +2 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.d.ts +2 -0
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.d.ts +33 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.d.ts +2 -0
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.d.ts +5 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.d.ts +2 -0
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.d.ts +2 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.d.ts +3 -0
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.d.ts +2 -0
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.d.ts +2 -0
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.d.ts +2 -0
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.d.ts +17 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.d.ts +2 -0
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.d.ts +2 -0
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.d.ts +2 -0
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.d.ts +2 -0
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.d.ts +27 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.d.ts +12 -0
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.d.ts +12 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.d.ts +10 -0
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.d.ts +12 -0
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.d.ts +28 -0
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.d.ts +69 -0
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.d.ts +17 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.d.ts +7 -0
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/types.d.ts +162 -0
- package/lib/commands/menu/shared/update-core.d.ts +11 -0
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.d.ts +6 -0
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.d.ts +2 -0
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.d.ts +2 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.d.ts +2 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.d.ts +2 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.d.ts +2 -0
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.d.ts +2 -0
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.d.ts +2 -0
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.d.ts +2 -0
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.d.ts +2 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.d.ts +2 -0
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +105 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.d.ts +2 -0
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.d.ts +2 -0
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.d.ts +2 -0
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.d.ts +2 -0
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.d.ts +2 -0
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.d.ts +2 -0
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.d.ts +2 -0
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.d.ts +2 -0
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.d.ts +74 -0
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.d.ts +1 -0
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +6 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.d.ts +9 -0
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.d.ts +4 -0
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.d.ts +1 -0
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.d.ts +2 -0
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.d.ts +1 -0
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +66 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.d.ts +2 -0
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.d.ts +2 -0
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.d.ts +2 -0
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.d.ts +2 -0
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.d.ts +2 -0
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +107 -0
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.d.ts +2 -0
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.d.ts +2 -0
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.d.ts +2 -0
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.d.ts +2 -0
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.d.ts +2 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.d.ts +5 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.d.ts +10 -0
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.d.ts +5 -0
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.d.ts +2 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +2 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +5 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.d.ts +2 -0
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.d.ts +5 -0
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.d.ts +5 -0
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.d.ts +23 -0
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.d.ts +5 -0
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.d.ts +2 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.d.ts +2 -0
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.d.ts +2 -0
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.d.ts +2 -0
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.d.ts +2 -0
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.d.ts +10 -0
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.d.ts +6 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.d.ts +11 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.d.ts +6 -0
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.d.ts +50 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +1 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.d.ts +34 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +10 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +14 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +11 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +1 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.d.ts +5 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.d.ts +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.d.ts +36 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.d.ts +5 -0
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +61 -0
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +102 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.d.ts +31 -0
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1018 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +8 -0
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +28 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +7 -0
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +25 -0
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +92 -0
- package/lib/core/bff/utils.d.ts +25 -0
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.d.ts +43 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.d.ts +6 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.d.ts +4 -0
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.d.ts +8 -0
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/types.d.ts +22 -0
- package/lib/core/sql-index-auditor.d.ts +33 -0
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.d.ts +7 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.d.ts +7 -0
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.d.ts +5 -0
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.d.ts +14 -0
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/types.d.ts +43 -0
- package/lib/core/sql-sync/utils.d.ts +10 -0
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.d.ts +34 -0
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +2 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.d.ts +9 -0
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.d.ts +3 -0
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.d.ts +3 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +4 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +11 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +15 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.d.ts +2 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.d.ts +14 -0
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.d.ts +36 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +3 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +63 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +1 -0
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +4 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.d.ts +5 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +7 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +5 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +8 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +50 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/main.d.ts +41 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +99 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.d.ts +44 -0
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.d.ts +12 -0
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.d.ts +8 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +93 -0
- package/lib/utils/ai_config.d.ts +47 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.d.ts +42 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.d.ts +23 -0
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.d.ts +37 -0
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +9 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.d.ts +42 -0
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.d.ts +1 -0
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.d.ts +30 -0
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.d.ts +25 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.d.ts +80 -0
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.d.ts +30 -0
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.d.ts +7 -0
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.d.ts +62 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.d.ts +15 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +21 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.d.ts +38 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.d.ts +1 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.d.ts +55 -0
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.d.ts +1 -0
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { AppConfigItem } from "../../core/api-client.js";
|
|
2
|
+
import type { CommandDefinition, DryRunResult, RuntimeContext } from "../../framework/types.js";
|
|
3
|
+
export interface AppConfigProjection {
|
|
4
|
+
appCode: string;
|
|
5
|
+
key: string;
|
|
6
|
+
tags?: string | null;
|
|
7
|
+
hasValue: boolean;
|
|
8
|
+
valueRedacted: boolean;
|
|
9
|
+
gmtCreate?: string;
|
|
10
|
+
gmtModified?: string;
|
|
11
|
+
value?: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface AppConfigMutationData {
|
|
14
|
+
operation: "create" | "update" | "delete";
|
|
15
|
+
selector: {
|
|
16
|
+
appCode: string;
|
|
17
|
+
key: string;
|
|
18
|
+
};
|
|
19
|
+
before: AppConfigProjection | null;
|
|
20
|
+
after: AppConfigProjection | null;
|
|
21
|
+
dryRun: boolean;
|
|
22
|
+
warnings: string[];
|
|
23
|
+
}
|
|
24
|
+
type AppConfigContext = Parameters<NonNullable<CommandDefinition["execute"]>>[0];
|
|
25
|
+
type ValueSource = {
|
|
26
|
+
kind: "argument";
|
|
27
|
+
value?: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "stdin";
|
|
30
|
+
} | {
|
|
31
|
+
kind: "env";
|
|
32
|
+
name: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "file";
|
|
35
|
+
path: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const KEY_ARG: {
|
|
38
|
+
readonly name: "key";
|
|
39
|
+
readonly description: "Runtime app-config key";
|
|
40
|
+
readonly required: true;
|
|
41
|
+
};
|
|
42
|
+
export declare const VALUE_ARG: {
|
|
43
|
+
readonly name: "value";
|
|
44
|
+
readonly description: "Sensitive config value. Prefer --stdin, --from-env, or --file for secrets.";
|
|
45
|
+
readonly required: false;
|
|
46
|
+
};
|
|
47
|
+
export declare const TAGS_FLAG: {
|
|
48
|
+
readonly name: "tags";
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly description: "Config tags for filtering/display metadata";
|
|
51
|
+
};
|
|
52
|
+
export declare const STDIN_FLAG: {
|
|
53
|
+
readonly name: "stdin";
|
|
54
|
+
readonly type: "boolean";
|
|
55
|
+
readonly description: "Read config value from stdin";
|
|
56
|
+
readonly default: false;
|
|
57
|
+
};
|
|
58
|
+
export declare const FROM_ENV_FLAG: {
|
|
59
|
+
readonly name: "from-env";
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly description: "Read config value from the named environment variable";
|
|
62
|
+
};
|
|
63
|
+
export declare const REVEAL_FLAG: {
|
|
64
|
+
readonly name: "reveal";
|
|
65
|
+
readonly type: "boolean";
|
|
66
|
+
readonly description: "Reveal the sensitive value for this single key";
|
|
67
|
+
readonly default: false;
|
|
68
|
+
};
|
|
69
|
+
export declare function readKeyArg(ctx: RuntimeContext | AppConfigContext): string;
|
|
70
|
+
export declare function readOptionalTags(ctx: RuntimeContext | AppConfigContext): string | undefined;
|
|
71
|
+
export declare function validateKey(key: string): void;
|
|
72
|
+
export declare function projectAppConfig(item: AppConfigItem, options?: {
|
|
73
|
+
reveal?: boolean;
|
|
74
|
+
}): AppConfigProjection;
|
|
75
|
+
export declare function plannedAppConfig(params: {
|
|
76
|
+
appCode: string;
|
|
77
|
+
key: string;
|
|
78
|
+
tags?: string | null;
|
|
79
|
+
hasValue?: boolean;
|
|
80
|
+
}): AppConfigProjection;
|
|
81
|
+
export declare function buildMutationData(params: {
|
|
82
|
+
operation: AppConfigMutationData["operation"];
|
|
83
|
+
appCode: string;
|
|
84
|
+
key: string;
|
|
85
|
+
before: AppConfigProjection | null;
|
|
86
|
+
after: AppConfigProjection | null;
|
|
87
|
+
dryRun: boolean;
|
|
88
|
+
warnings?: string[];
|
|
89
|
+
}): AppConfigMutationData;
|
|
90
|
+
export declare function withAppConfigApiBoundary<T>(operation: string, selector: {
|
|
91
|
+
appCode: string;
|
|
92
|
+
key?: string;
|
|
93
|
+
}, fn: () => Promise<T>): Promise<T>;
|
|
94
|
+
export declare function asAppConfigDryRunResult(data: AppConfigMutationData, backend: {
|
|
95
|
+
method: "POST";
|
|
96
|
+
url: string;
|
|
97
|
+
}): DryRunResult & AppConfigMutationData;
|
|
98
|
+
export declare function assertSingleValueSource(ctx: AppConfigContext): ValueSource;
|
|
99
|
+
export declare function assertValueSourceReadable(source: ValueSource): Promise<void>;
|
|
100
|
+
export declare function readAppConfigValue(ctx: AppConfigContext): Promise<{
|
|
101
|
+
value: string;
|
|
102
|
+
source: ValueSource["kind"];
|
|
103
|
+
warnings: string[];
|
|
104
|
+
}>;
|
|
105
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x570d2e=a28_0x97b0;(function(_0x5acf81,_0x2409c0){const _0x1d7202=a28_0x97b0,_0x53e9eb=_0x5acf81();while(!![]){try{const _0x38e02c=parseInt(_0x1d7202(0x79))/0x1*(parseInt(_0x1d7202(0xb8))/0x2)+parseInt(_0x1d7202(0x98))/0x3*(parseInt(_0x1d7202(0xb5))/0x4)+parseInt(_0x1d7202(0x9a))/0x5*(parseInt(_0x1d7202(0xb4))/0x6)+-parseInt(_0x1d7202(0x93))/0x7+parseInt(_0x1d7202(0x96))/0x8*(-parseInt(_0x1d7202(0xb6))/0x9)+parseInt(_0x1d7202(0x95))/0xa+-parseInt(_0x1d7202(0xa5))/0xb;if(_0x38e02c===_0x2409c0)break;else _0x53e9eb['push'](_0x53e9eb['shift']());}catch(_0x5d4a7f){_0x53e9eb['push'](_0x53e9eb['shift']());}}}(a28_0x4de2,0x8810c));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a28_0x570d2e(0x82),'required':!![]};export const VALUE_ARG={'name':'value','description':a28_0x570d2e(0xaf),'required':![]};export const TAGS_FLAG={'name':a28_0x570d2e(0x87),'type':a28_0x570d2e(0xb9),'description':a28_0x570d2e(0x94)};export const STDIN_FLAG={'name':a28_0x570d2e(0x88),'type':a28_0x570d2e(0xa1),'description':a28_0x570d2e(0x8a),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x570d2e(0x8c),'type':'string','description':a28_0x570d2e(0xb1)};export const REVEAL_FLAG={'name':a28_0x570d2e(0xad),'type':'boolean','description':a28_0x570d2e(0x97),'default':![]};export function readKeyArg(_0x2c0dd1){const _0x3287aa=a28_0x570d2e,_0x40d246=_0x2c0dd1['args'][0x0]?.[_0x3287aa(0xba)]()??'';return validateKey(_0x40d246),_0x40d246;}function a28_0x4de2(){const _0x6872bd=['\x20app\x20config.','boolean','warnings','bool','value','208747kfwlKx','valueRedacted','defineProperties','env','Failed\x20to\x20','path','Missing\x20app-config\x20key.','gmtCreate','reveal','validation','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Environment\x20variable\x20is\x20not\x20set:\x20','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','flag','end','252AalKUA','144drrdRf','15858DpbfzJ','file','2558EMpRKw','string','trim','appCode','App\x20config\x20value\x20source\x20is\x20ambiguous.','854lXCLvD','method','str','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','length','key:\x20','gmtModified','push','kind','Runtime\x20app-config\x20key','setEncoding','operation','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','url','tags','stdin','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Read\x20config\x20value\x20from\x20stdin','Missing\x20app-config\x20value\x20source.','from-env','value\x20is\x20redacted','dryRun','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','utf8','argument','key','5910604eUmLbn','Config\x20tags\x20for\x20filtering/display\x20metadata','9487090wuRbyH','4064JtGaDw','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','5508FJMCdP','data','24845aeaPGG','hasValue','name','Value\x20file\x20is\x20not\x20readable:\x20','args','once'];a28_0x4de2=function(){return _0x6872bd;};return a28_0x4de2();}export function readOptionalTags(_0x4323f8){const _0x1c005a=a28_0x570d2e,_0x38ecb7=_0x4323f8[_0x1c005a(0x7b)](_0x1c005a(0x87))[_0x1c005a(0xba)]();if(!_0x38ecb7)return undefined;if(_0x38ecb7[_0x1c005a(0x7d)]>0x20)throw CliErrors[_0x1c005a(0xae)](_0x1c005a(0x7c));return _0x38ecb7;}export function validateKey(_0x25094f){const _0x5e802a=a28_0x570d2e;if(!_0x25094f)throw CliErrors[_0x5e802a(0xae)](_0x5e802a(0xab));if(_0x25094f[_0x5e802a(0x7d)]>0x100)throw CliErrors[_0x5e802a(0xae)](_0x5e802a(0x8f));}function a28_0x97b0(_0x580728,_0x213fcc){_0x580728=_0x580728-0x77;const _0x4de2de=a28_0x4de2();let _0x97b00b=_0x4de2de[_0x580728];return _0x97b00b;}export function projectAppConfig(_0x3ead4f,_0x35038b){const _0x244fd2=a28_0x570d2e,_0x165bfb=_0x3ead4f[_0x244fd2(0xa4)]!==undefined&&_0x3ead4f[_0x244fd2(0xa4)]!==null&&_0x3ead4f['value']!=='',_0x55753b={'appCode':_0x3ead4f[_0x244fd2(0x77)],'key':_0x3ead4f[_0x244fd2(0x92)],'tags':_0x3ead4f[_0x244fd2(0x87)]??undefined,'hasValue':_0x165bfb,'valueRedacted':_0x165bfb&&!_0x35038b?.[_0x244fd2(0xad)],'gmtCreate':_0x3ead4f[_0x244fd2(0xac)],'gmtModified':_0x3ead4f[_0x244fd2(0x7f)]};return _0x35038b?.[_0x244fd2(0xad)]&&(_0x55753b[_0x244fd2(0xa4)]=_0x3ead4f[_0x244fd2(0xa4)]??'',_0x55753b[_0x244fd2(0xa6)]=![]),_0x55753b;}export function plannedAppConfig(_0x4a6b80){const _0x8ffc15=a28_0x570d2e,_0x2c111d=_0x4a6b80[_0x8ffc15(0x9b)]??!![];return{'appCode':_0x4a6b80[_0x8ffc15(0x77)],'key':_0x4a6b80[_0x8ffc15(0x92)],'tags':_0x4a6b80[_0x8ffc15(0x87)]??undefined,'hasValue':_0x2c111d,'valueRedacted':_0x2c111d};}export function buildMutationData(_0x46dd66){const _0x3bf67f=a28_0x570d2e;return{'operation':_0x46dd66[_0x3bf67f(0x84)],'selector':{'appCode':_0x46dd66[_0x3bf67f(0x77)],'key':_0x46dd66[_0x3bf67f(0x92)]},'before':_0x46dd66['before'],'after':_0x46dd66['after'],'dryRun':_0x46dd66[_0x3bf67f(0x8e)],'warnings':_0x46dd66[_0x3bf67f(0xa2)]??[]};}export async function withAppConfigApiBoundary(_0x53be6b,_0x250510,_0x3e73ae){const _0x34cbb5=a28_0x570d2e;try{return await _0x3e73ae();}catch{const _0x3af774=['appCode:\x20'+_0x250510['appCode']];if(_0x250510[_0x34cbb5(0x92)])_0x3af774[_0x34cbb5(0x80)](_0x34cbb5(0x7e)+_0x250510['key']);_0x3af774['push'](_0x34cbb5(0x8d));throw CliErrors['apiError'](_0x34cbb5(0xa9)+_0x53be6b+_0x34cbb5(0xa0),_0x3af774['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x4d6219,_0x1202ff){const _0x29d0f1=a28_0x570d2e;return Object[_0x29d0f1(0xa7)](_0x4d6219,{'method':{'value':_0x1202ff[_0x29d0f1(0x7a)],'enumerable':![]},'url':{'value':_0x1202ff[_0x29d0f1(0x86)],'enumerable':![]}});}export function assertSingleValueSource(_0x54509a){const _0x453659=a28_0x570d2e,_0x49e7f0=[];_0x54509a[_0x453659(0x9e)]['length']>0x1&&_0x49e7f0[_0x453659(0x80)]({'kind':'argument','value':_0x54509a[_0x453659(0x9e)]['slice'](0x1)['join']('\x20')});const _0x2bc1bd=_0x54509a[_0x453659(0xb2)](_0x453659(0xa4));_0x2bc1bd!==undefined&&_0x2bc1bd!==null&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0x91),'value':String(_0x2bc1bd)});_0x54509a[_0x453659(0xa3)](_0x453659(0x88))&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0x88)});const _0xac0f0e=_0x54509a['str'](_0x453659(0x8c))['trim']();_0xac0f0e&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0xa8),'name':_0xac0f0e});const _0x43b13f=_0x54509a[_0x453659(0x7b)](_0x453659(0xb7))[_0x453659(0xba)]();_0x43b13f&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0xb7),'path':_0x43b13f});if(_0x49e7f0['length']===0x0)throw CliErrors[_0x453659(0xae)](_0x453659(0x8b),_0x453659(0x89));if(_0x49e7f0[_0x453659(0x7d)]>0x1)throw CliErrors[_0x453659(0xae)](_0x453659(0x78),_0x453659(0x85));return _0x49e7f0[0x0];}export async function assertValueSourceReadable(_0x1e053e){const _0x3970cb=a28_0x570d2e;if(_0x1e053e[_0x3970cb(0x81)]===_0x3970cb(0xa8)&&!(_0x1e053e['name']in process.env))throw CliErrors[_0x3970cb(0xae)](_0x3970cb(0xb0)+_0x1e053e[_0x3970cb(0x9c)]);if(_0x1e053e[_0x3970cb(0x81)]===_0x3970cb(0xb7))try{await access(_0x1e053e[_0x3970cb(0xaa)]);}catch{throw CliErrors[_0x3970cb(0xae)](_0x3970cb(0x9d)+_0x1e053e['path']);}}export async function readAppConfigValue(_0x1f5f26){const _0x1b45ec=a28_0x570d2e,_0x1b9948=assertSingleValueSource(_0x1f5f26),_0x41ec6e=[];if(_0x1b9948[_0x1b45ec(0x81)]===_0x1b45ec(0x91))return _0x41ec6e['push']('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x1b9948[_0x1b45ec(0xa4)]??'','source':_0x1b9948['kind'],'warnings':_0x41ec6e};if(_0x1b9948[_0x1b45ec(0x81)]===_0x1b45ec(0x88))return{'value':await readStdin(),'source':_0x1b9948['kind'],'warnings':_0x41ec6e};if(_0x1b9948[_0x1b45ec(0x81)]===_0x1b45ec(0xa8)){if(!(_0x1b9948[_0x1b45ec(0x9c)]in process.env))throw CliErrors[_0x1b45ec(0xae)](_0x1b45ec(0xb0)+_0x1b9948[_0x1b45ec(0x9c)]);return{'value':process.env[_0x1b9948.name]??'','source':_0x1b9948[_0x1b45ec(0x81)],'warnings':_0x41ec6e};}return{'value':await readFile(_0x1b9948[_0x1b45ec(0xaa)],'utf8'),'source':_0x1b9948['kind'],'warnings':_0x41ec6e};}function readStdin(){return new Promise((_0x5a3a38,_0x1c5ed3)=>{const _0x421c4a=a28_0x97b0;let _0x4aa766='';process[_0x421c4a(0x88)][_0x421c4a(0x83)](_0x421c4a(0x90)),process['stdin']['on'](_0x421c4a(0x99),_0x39bb8f=>{_0x4aa766+=_0x39bb8f;}),process[_0x421c4a(0x88)]['once'](_0x421c4a(0xb3),()=>_0x5a3a38(_0x4aa766)),process['stdin'][_0x421c4a(0x9f)]('error',_0x1c5ed3);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0xfb5482=a29_0xa60a;(function(_0x4864df,_0x50167b){const _0x21cfba=a29_0xa60a,_0x146a99=_0x4864df();while(!![]){try{const _0x19d9e5=-parseInt(_0x21cfba(0x119))/0x1*(parseInt(_0x21cfba(0x114))/0x2)+-parseInt(_0x21cfba(0x111))/0x3*(-parseInt(_0x21cfba(0x11e))/0x4)+-parseInt(_0x21cfba(0x115))/0x5+parseInt(_0x21cfba(0x110))/0x6*(-parseInt(_0x21cfba(0x120))/0x7)+parseInt(_0x21cfba(0x10e))/0x8+-parseInt(_0x21cfba(0x10b))/0x9+parseInt(_0x21cfba(0x11b))/0xa;if(_0x19d9e5===_0x50167b)break;else _0x146a99['push'](_0x146a99['shift']());}catch(_0x1008cf){_0x146a99['push'](_0x146a99['shift']());}}}(a29_0x350e,0x67907));function a29_0x350e(){const _0x10db33=['nonInteractive','✓\x20Logged\x20out','read','1346EkYgvZ','yes','13825430Fbzxnl','auth','log','14788sVUMNn','boolean','1186507dbJSMH','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','6280641ufzARy','write','../../auth/auth-server-ui.js','2370160CIslJq','Clear\x20login\x20session','18UsjTfU','171vYBpBr','logout','bool','230jkqNsf','521005zRKfhe'];a29_0x350e=function(){return _0x10db33;};return a29_0x350e();}function a29_0xa60a(_0x3f4a59,_0x314f20){_0x3f4a59=_0x3f4a59-0x10a;const _0x350e10=a29_0x350e();let _0xa60a31=_0x350e10[_0x3f4a59];return _0xa60a31;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':'Login\x20via\x20browser','risk':a29_0xfb5482(0x118),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0xfb5482(0x11a),'type':a29_0xfb5482(0x11f),'description':a29_0xfb5482(0x10a),'default':![]}],async 'execute'(_0x3dc64b){const _0x297ba9=a29_0xfb5482,{runAuthServer:_0x349376}=await import(_0x297ba9(0x10d));return await _0x349376({'autoYes':_0x3dc64b[_0x297ba9(0x113)](_0x297ba9(0x11a)),'nonInteractive':_0x3dc64b[_0x297ba9(0x116)]}),{'ok':!![]};}},{'service':a29_0xfb5482(0x11c),'command':a29_0xfb5482(0x112),'description':a29_0xfb5482(0x10f),'risk':a29_0xfb5482(0x10c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x246abb){const _0x2121c5=a29_0xfb5482;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x2121c5(0x117))):console[_0x2121c5(0x11d)](_0x2121c5(0x121)),{'ok':!![]};}}];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BffScriptType, HookCreationOptions } from "../../core/bff/types.js";
|
|
2
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
3
|
+
export declare const bffCreate: CommandDefinition;
|
|
4
|
+
export declare function generateTemplate(scriptType: BffScriptType, functionName: string, appCode: string, description?: string, hookOptions?: HookCreationOptions): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x3474b0=a30_0x40e2;(function(_0x151c01,_0x36bb5e){const _0x513ee2=a30_0x40e2,_0x327572=_0x151c01();while(!![]){try{const _0x2a7b5c=parseInt(_0x513ee2(0x108))/0x1*(parseInt(_0x513ee2(0xf5))/0x2)+parseInt(_0x513ee2(0x122))/0x3*(parseInt(_0x513ee2(0x13f))/0x4)+-parseInt(_0x513ee2(0x12e))/0x5+-parseInt(_0x513ee2(0x112))/0x6+parseInt(_0x513ee2(0x10f))/0x7*(parseInt(_0x513ee2(0xef))/0x8)+-parseInt(_0x513ee2(0x136))/0x9+-parseInt(_0x513ee2(0x110))/0xa*(parseInt(_0x513ee2(0x140))/0xb);if(_0x2a7b5c===_0x36bb5e)break;else _0x327572['push'](_0x327572['shift']());}catch(_0x5c5887){_0x327572['push'](_0x327572['shift']());}}}(a30_0x2898,0xb647a));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{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a30_0x2898(){const _0x576e18=['parseInt','Invalid\x20dataset\x20selection.','ENDPOINT','code','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x0a\x20*\x20[脚本名称]\x20','str','94675dNyeJM','apiDir','question','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','operation-type','appCode','after','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','11762631cCBzDs','HOOK\x20requires\x20alias/operation/node\x20options.','stderr','string','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Trigger\x20node\x20(HOOK\x20only)','No\x20datasets\x20found\x20for\x20this\x20app.','scriptsRootDir','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','5567612WZxEmK','231bEGqDm','validation','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','alias','join','Operation\x20type\x20\x22','8241272lQyumE','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x20api\x20pull`\x20to\x20refresh.','bff','description','type','8kyUSyG','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x20function:\x20','Operation\x20type\x20(HOOK\x20only)','Select\x20dataset:','operationType','before','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','includes','Script\x20description','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','.js','\x0a\x20*\x20[触发节点]\x20','name','UNKNOWN','HOOK','234564ZyRayM','nonInteractive','Invalid\x20function\x20name\x20\x22','read','map','Select\x20trigger\x20node:','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','7VsPomq','596280pqroPI','Available\x20aliases:\x20','213708hdhONm','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','isInteger','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','length','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','find','trim','\x22.\x20','functionNode','datasetcode','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','write','\x22\x20not\x20found.\x20','create','datasetCode','3jlhJva','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Function\x20name\x20(valid\x20JS\x20identifier)',']\x20('];a30_0x2898=function(){return _0x576e18;};return a30_0x2898();}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a30_0x40e2(_0x30e503,_0x5cb380){_0x30e503=_0x30e503-0xea;const _0x289819=a30_0x2898();let _0x40e2eb=_0x289819[_0x30e503];return _0x40e2eb;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x3474b0(0xf2),'command':a30_0x3474b0(0x120),'description':a30_0x3474b0(0xf6),'risk':a30_0x3474b0(0x10b),'flags':[{'name':a30_0x3474b0(0xf4),'type':a30_0x3474b0(0x139),'required':!![],'enum':['COMMON',a30_0x3474b0(0x129),a30_0x3474b0(0x107)],'description':a30_0x3474b0(0x101)},{'name':a30_0x3474b0(0x105),'type':a30_0x3474b0(0x139),'required':!![],'description':a30_0x3474b0(0x125)},{'name':a30_0x3474b0(0xf3),'type':a30_0x3474b0(0x139),'description':a30_0x3474b0(0xfe)},{'name':a30_0x3474b0(0xec),'type':a30_0x3474b0(0x139),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x3474b0(0x11c),'type':a30_0x3474b0(0x139),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a30_0x3474b0(0x132),'type':'string','description':a30_0x3474b0(0xf8)},{'name':'function-node','type':'string','description':a30_0x3474b0(0x13b),'enum':[a30_0x3474b0(0xfb),a30_0x3474b0(0x134)]}],async 'validate'(_0x100f85){const _0x25703a=a30_0x3474b0,_0x33ae00=_0x100f85['str']('name');if(!isValidBffFunctionName(_0x33ae00))throw CliErrors['validation'](_0x25703a(0x10a)+_0x33ae00+_0x25703a(0x131));},async 'execute'(_0x435f8e){const _0x368b29=a30_0x3474b0,_0x2551b0=loadBffProjectConfig(_0x435f8e[_0x368b29(0x133)]),_0x103d6c=_0x435f8e['str'](_0x368b29(0xf4)),_0x49e77c=_0x435f8e[_0x368b29(0x12d)]('name'),_0x3d9382=_0x435f8e[_0x368b29(0x12d)](_0x368b29(0xf3))||undefined,_0x507220=_0x103d6c===_0x368b29(0x107)?await resolveHookOptions(_0x2551b0,_0x435f8e):undefined,_0x7eefa8=buildFilePath(_0x2551b0,_0x103d6c,_0x49e77c,_0x507220);if(await fileExists(_0x7eefa8))throw CliErrors[_0x368b29(0xea)]('File\x20already\x20exists:\x20'+_0x7eefa8);await mkdir(dirname(_0x7eefa8),{'recursive':!![]});const _0x30d304=generateTemplate(_0x103d6c,_0x49e77c,_0x435f8e['appCode'],_0x3d9382,_0x507220);await writeFile(_0x7eefa8,_0x30d304,'utf8');const _0x405b91={'type':_0x103d6c,'name':_0x49e77c,'path':_0x7eefa8};if(_0x3d9382)_0x405b91[_0x368b29(0xf3)]=_0x3d9382;if(_0x507220){if(_0x507220['alias'])_0x405b91[_0x368b29(0xec)]=_0x507220[_0x368b29(0xec)];_0x405b91[_0x368b29(0x121)]=_0x507220[_0x368b29(0x121)],_0x405b91[_0x368b29(0xfa)]=_0x507220['operationType'],_0x405b91[_0x368b29(0x11b)]=_0x507220[_0x368b29(0x11b)];}return{'ok':!![],'data':_0x405b91,'message':'Created\x20'+_0x103d6c+_0x368b29(0xf7)+_0x49e77c};}};async function resolveHookOptions(_0x3cd519,_0x33a54f){const _0x40b058=a30_0x3474b0,_0x2079c7=loadAliasMap(_0x33a54f[_0x40b058(0x12f)],undefined,resolveApiFilePath(_0x33a54f[_0x40b058(0x12f)],_0x33a54f[_0x40b058(0x133)])),_0x38061d=_0x2079c7[_0x40b058(0x116)]>0x0;let _0x4a653f,_0xddcb59,_0x257280;const _0x930ac2=_0x33a54f[_0x40b058(0x12d)](_0x40b058(0xec)),_0x1e1a62=_0x33a54f[_0x40b058(0x12d)](_0x40b058(0x11c));if(_0x930ac2){const _0x4d7f27=resolveAlias(_0x33a54f[_0x40b058(0x12f)],_0x930ac2,undefined,resolveApiFilePath(_0x33a54f[_0x40b058(0x12f)],_0x33a54f['appCode']));if(!_0x4d7f27){const _0x4adaf1=_0x38061d?_0x40b058(0x111)+_0x2079c7[_0x40b058(0x10c)](_0x3ccb38=>_0x3ccb38['alias'])[_0x40b058(0xed)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x40b058(0x113);throw CliErrors[_0x40b058(0xea)]('Alias\x20\x22'+_0x930ac2+_0x40b058(0x11f)+_0x4adaf1);}_0x4a653f=_0x930ac2,_0xddcb59=_0x4d7f27;}else{if(_0x1e1a62){_0xddcb59=_0x1e1a62;const _0x5f1084=_0x2079c7[_0x40b058(0x118)](_0x289450=>_0x289450[_0x40b058(0x121)]===_0x1e1a62);_0x4a653f=_0x5f1084?.['alias'];}else{if(_0x33a54f['nonInteractive'])throw CliErrors[_0x40b058(0xea)](_0x40b058(0x100));else{if(_0x38061d){const _0x162185=_0x2079c7[_0x40b058(0x10c)](_0x133fbb=>_0x133fbb['alias']+'\x20('+_0x133fbb['tableName']+')'),_0x55d99c=await promptSelect(_0x40b058(0xf9),_0x162185),_0x4d75d6=_0x2079c7[_0x55d99c];if(!_0x4d75d6)throw CliErrors[_0x40b058(0xea)]('Invalid\x20dataset\x20selection.');_0x4a653f=_0x4d75d6[_0x40b058(0xec)],_0xddcb59=_0x4d75d6[_0x40b058(0x121)];}else{const _0x5409b2=await listDatasets(_0x33a54f[_0x40b058(0x133)]);if(_0x5409b2[_0x40b058(0x116)]===0x0)throw CliErrors[_0x40b058(0xea)](_0x40b058(0x13c));const _0x19d629=_0x5409b2[_0x40b058(0x10c)](_0x5a44b1=>_0x5a44b1[_0x40b058(0x105)]+'\x20['+(_0x5a44b1['source']??_0x40b058(0x106))+_0x40b058(0x126)+_0x5a44b1[_0x40b058(0x12a)]+')'),_0x18e1cd=await promptSelect('Select\x20dataset:',_0x19d629),_0x4954db=_0x5409b2[_0x18e1cd];if(!_0x4954db)throw CliErrors[_0x40b058(0xea)](_0x40b058(0x128));_0xddcb59=_0x4954db['code'],_0x4a653f=undefined;}}}}const _0x518192=await listDatasets(_0x33a54f[_0x40b058(0x133)]),_0x155c3b=_0x518192[_0x40b058(0x118)](_0x15f370=>_0x15f370[_0x40b058(0x12a)]===_0xddcb59);if(!_0x155c3b)throw CliErrors[_0x40b058(0xea)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0xddcb59+_0x40b058(0x11a)+(_0x4a653f?_0x40b058(0x102)+CLI_BIN_NAME+_0x40b058(0xf1):''));_0x257280=_0x155c3b['id'];const _0x11338c=_0x4a653f??_0xddcb59,_0x55f859=await listBffDatasetOperations(_0x33a54f[_0x40b058(0x133)],_0x257280),_0x107c24=_0x55f859?Object['keys'](_0x55f859):[];if(_0x107c24[_0x40b058(0x116)]===0x0)throw CliErrors[_0x40b058(0xea)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x11338c+'.');let _0x5eabf8;const _0x239e5d=_0x33a54f[_0x40b058(0x12d)](_0x40b058(0x132));if(_0x239e5d){if(!_0x107c24[_0x40b058(0xfd)](_0x239e5d))throw CliErrors[_0x40b058(0xea)](_0x40b058(0xee)+_0x239e5d+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x11338c+'.\x20'+('Available:\x20'+_0x107c24[_0x40b058(0xed)](',\x20')));_0x5eabf8=_0x239e5d;}else{if(_0x33a54f[_0x40b058(0x109)])throw CliErrors[_0x40b058(0xea)](_0x40b058(0x135));const _0x26cef9=await promptSelect('Select\x20operation\x20type:',_0x107c24);_0x5eabf8=_0x107c24[_0x26cef9]??_0x107c24[0x0];}let _0x1eb4c6=normalizeHookFunctionNode(_0x33a54f[_0x40b058(0x12d)]('function-node'));if(!_0x1eb4c6){if(_0x33a54f['str']('function-node'))throw CliErrors[_0x40b058(0xea)](_0x40b058(0xfc));if(_0x33a54f['nonInteractive'])throw CliErrors[_0x40b058(0xea)](_0x40b058(0x10e));const _0x682fd7=await promptSelect(_0x40b058(0x10d),[_0x40b058(0xfb),_0x40b058(0x134)]);_0x1eb4c6=[_0x40b058(0xfb),_0x40b058(0x134)][_0x682fd7]??_0x40b058(0xfb);}return{'alias':_0x4a653f,'datasetCode':_0xddcb59,'datasetId':_0x257280,'operationType':_0x5eabf8,'functionNode':_0x1eb4c6};}async function promptSelect(_0x1d4df6,_0x4c1bdc){const _0x566272=a30_0x3474b0;if(_0x4c1bdc['length']===0x1)return 0x0;for(const [_0x5b037a,_0x5825e3]of _0x4c1bdc['entries']()){process[_0x566272(0x138)][_0x566272(0x11e)]('\x20\x20'+(_0x5b037a+0x1)+'.\x20'+_0x5825e3+'\x0a');}const _0x69b7b8=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x2b2c53=await new Promise(_0x3e74b0=>{const _0x1622ba=_0x566272;_0x69b7b8[_0x1622ba(0x130)](_0x1d4df6+'\x20',_0x3e74b0);}),_0x7a5078=Number[_0x566272(0x127)](_0x2b2c53[_0x566272(0x119)](),0xa);if(Number[_0x566272(0x114)](_0x7a5078)&&_0x7a5078>=0x1&&_0x7a5078<=_0x4c1bdc[_0x566272(0x116)])return _0x69b7b8['close'](),_0x7a5078-0x1;process['stderr'][_0x566272(0x11e)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x4c1bdc[_0x566272(0x116)]+'.\x0a');}}function buildFilePath(_0x340946,_0x43f20b,_0x5b2561,_0x1c712c){const _0x3a5114=a30_0x3474b0;if(_0x43f20b==='HOOK'){if(!_0x1c712c)throw CliErrors['validation'](_0x3a5114(0x137));const _0x1f3a1e=_0x1c712c[_0x3a5114(0xec)]??_0x1c712c['datasetCode'];return join(_0x340946[_0x3a5114(0x13d)],_0x3a5114(0x107),_0x1f3a1e,_0x1c712c[_0x3a5114(0xfa)],_0x1c712c[_0x3a5114(0x11b)],_0x5b2561+'.js');}return join(_0x340946[_0x3a5114(0x13d)],_0x43f20b,_0x5b2561+_0x3a5114(0x103));}export function generateTemplate(_0x34aa63,_0x466942,_0x38d3fc,_0x124ceb,_0x3fa669){const _0x23419e=a30_0x3474b0,_0x9a890f=_0x124ceb?.['trim']()||'TODO:\x20add\x20script\x20description';if(_0x34aa63==='COMMON')return _0x23419e(0x124)+_0x9a890f+_0x23419e(0x12c)+_0x466942+_0x23419e(0x12b)+_0x466942+_0x23419e(0x123)+_0x466942+_0x23419e(0x13a);if(_0x34aa63===_0x23419e(0x129))return _0x23419e(0xff)+_0x9a890f+_0x23419e(0x117)+_0x38d3fc+'/'+_0x466942+_0x23419e(0xeb)+_0x466942+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x3fa669)throw CliErrors[_0x23419e(0xea)](_0x23419e(0x115));return _0x23419e(0x11d)+_0x9a890f+_0x23419e(0x13e)+_0x38d3fc+'/'+_0x3fa669[_0x23419e(0x121)]+'/'+_0x3fa669['operationType']+_0x23419e(0x104)+_0x3fa669[_0x23419e(0x11b)]+_0x23419e(0xf0)+_0x466942+_0x23419e(0x13a);}
|
|
1
|
+
const a30_0x5bb153=a30_0x2ceb;(function(_0x5e0af1,_0x57796f){const _0x3f44bd=a30_0x2ceb,_0x29eadb=_0x5e0af1();while(!![]){try{const _0x42d915=parseInt(_0x3f44bd(0x80))/0x1+parseInt(_0x3f44bd(0xa5))/0x2*(-parseInt(_0x3f44bd(0x81))/0x3)+parseInt(_0x3f44bd(0x8f))/0x4+-parseInt(_0x3f44bd(0xce))/0x5*(parseInt(_0x3f44bd(0xc0))/0x6)+-parseInt(_0x3f44bd(0x9e))/0x7+parseInt(_0x3f44bd(0xa6))/0x8+parseInt(_0x3f44bd(0x72))/0x9*(parseInt(_0x3f44bd(0x7b))/0xa);if(_0x42d915===_0x57796f)break;else _0x29eadb['push'](_0x29eadb['shift']());}catch(_0x430f37){_0x29eadb['push'](_0x29eadb['shift']());}}}(a30_0x3c44,0x4a9c6));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{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a30_0x2ceb(_0x3700c1,_0x500db7){_0x3700c1=_0x3700c1-0x72;const _0x3c4441=a30_0x3c44();let _0x2ceb3e=_0x3c4441[_0x3700c1];return _0x2ceb3e;}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a30_0x3c44(){const _0x393467=['/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','3713269UEvTUD','appCode','create','validation','alias','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','apiDir','218YXnxOt','3961352hOPDrt','Select\x20dataset:','function-node','Invalid\x20dataset\x20selection.','datasetcode','str','No\x20api.ts\x20found.\x20Run\x20`','Select\x20operation\x20type:','\x22\x20not\x20found.\x20','find','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','HOOK','string','close','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','before','HOOK\x20requires\x20alias/operation/node\x20options.','write','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Alias\x20\x22','Dataset\x20not\x20found\x20for\x20code\x20\x22','datasetCode','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','isInteger','operation-type','234084kgfnHd','description','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','type','ENDPOINT','scriptsRootDir','File\x20already\x20exists:\x20','keys','includes','\x22.\x20','stderr','nonInteractive','length','join','50DeuaeZ','9LXwZVf','bff',']\x20(','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20function:\x20','\x0a\x20*\x20[触发节点]\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','TODO:\x20add\x20script\x20description','1318310aOKeBi','Function\x20name\x20(valid\x20JS\x20identifier)','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Script\x20description','293898WJWEfr','411mBFqHU','COMMON','map','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Trigger\x20node\x20(HOOK\x20only)','functionNode','trim','\x0a\x20*\x20[脚本名称]\x20','name','Operation\x20type\x20\x22','.js','Invalid\x20function\x20name\x20\x22','parseInt','1280992Dlehqv','after','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','code','No\x20operation\x20types\x20found\x20for\x20dataset\x20','\x22\x20not\x20found\x20for\x20dataset\x20','utf8','Available:\x20','operationType','Available\x20aliases:\x20','No\x20datasets\x20found\x20for\x20this\x20app.'];a30_0x3c44=function(){return _0x393467;};return a30_0x3c44();}export const bffCreate={'service':a30_0x5bb153(0x73),'command':a30_0x5bb153(0xa0),'description':a30_0x5bb153(0x84),'risk':'read','flags':[{'name':a30_0x5bb153(0xc3),'type':a30_0x5bb153(0xb2),'required':!![],'enum':[a30_0x5bb153(0x82),a30_0x5bb153(0xc4),'HOOK'],'description':'Script\x20type'},{'name':a30_0x5bb153(0x8a),'type':a30_0x5bb153(0xb2),'required':!![],'description':a30_0x5bb153(0x7c)},{'name':a30_0x5bb153(0xc1),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0x7f)},{'name':a30_0x5bb153(0xa2),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0xb5)},{'name':a30_0x5bb153(0xaa),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0x9d)},{'name':'operation-type','type':a30_0x5bb153(0xb2),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a30_0x5bb153(0xa8),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0x86),'enum':['before',a30_0x5bb153(0x90)]}],async 'validate'(_0x561796){const _0x31d6d4=a30_0x5bb153,_0x337f10=_0x561796[_0x31d6d4(0xab)]('name');if(!isValidBffFunctionName(_0x337f10))throw CliErrors['validation'](_0x31d6d4(0x8d)+_0x337f10+_0x31d6d4(0x93));},async 'execute'(_0x34db0b){const _0x4c082c=a30_0x5bb153,_0x2a2a2f=loadBffProjectConfig(_0x34db0b[_0x4c082c(0x9f)]),_0x5228ae=_0x34db0b[_0x4c082c(0xab)](_0x4c082c(0xc3)),_0x5e0635=_0x34db0b[_0x4c082c(0xab)](_0x4c082c(0x8a)),_0x17d5d3=_0x34db0b[_0x4c082c(0xab)](_0x4c082c(0xc1))||undefined,_0x136207=_0x5228ae===_0x4c082c(0xb1)?await resolveHookOptions(_0x2a2a2f,_0x34db0b):undefined,_0x457dff=buildFilePath(_0x2a2a2f,_0x5228ae,_0x5e0635,_0x136207);if(await fileExists(_0x457dff))throw CliErrors[_0x4c082c(0xa1)](_0x4c082c(0xc6)+_0x457dff);await mkdir(dirname(_0x457dff),{'recursive':!![]});const _0x265ccd=generateTemplate(_0x5228ae,_0x5e0635,_0x34db0b[_0x4c082c(0x9f)],_0x17d5d3,_0x136207);await writeFile(_0x457dff,_0x265ccd,_0x4c082c(0x97));const _0x3d3765={'type':_0x5228ae,'name':_0x5e0635,'path':_0x457dff};if(_0x17d5d3)_0x3d3765['description']=_0x17d5d3;if(_0x136207){if(_0x136207[_0x4c082c(0xa2)])_0x3d3765[_0x4c082c(0xa2)]=_0x136207[_0x4c082c(0xa2)];_0x3d3765['datasetCode']=_0x136207[_0x4c082c(0xbc)],_0x3d3765[_0x4c082c(0x99)]=_0x136207[_0x4c082c(0x99)],_0x3d3765[_0x4c082c(0x87)]=_0x136207[_0x4c082c(0x87)];}return{'ok':!![],'data':_0x3d3765,'message':'Created\x20'+_0x5228ae+_0x4c082c(0x76)+_0x5e0635};}};async function resolveHookOptions(_0x50504f,_0x3e49f5){const _0x3acff0=a30_0x5bb153,_0x89defe=loadAliasMap(_0x3e49f5['apiDir'],undefined,resolveApiFilePath(_0x3e49f5[_0x3acff0(0xa4)],_0x3e49f5['appCode'])),_0x432ba0=_0x89defe[_0x3acff0(0xcc)]>0x0;let _0x23c660,_0x1681e0,_0x533d25;const _0x36a172=_0x3e49f5[_0x3acff0(0xab)](_0x3acff0(0xa2)),_0x6bcf91=_0x3e49f5[_0x3acff0(0xab)]('datasetcode');if(_0x36a172){const _0x718b91=resolveAlias(_0x3e49f5[_0x3acff0(0xa4)],_0x36a172,undefined,resolveApiFilePath(_0x3e49f5['apiDir'],_0x3e49f5['appCode']));if(!_0x718b91){const _0x4fa23a=_0x432ba0?_0x3acff0(0x9a)+_0x89defe[_0x3acff0(0x83)](_0x1e6d4a=>_0x1e6d4a[_0x3acff0(0xa2)])[_0x3acff0(0xcd)](',\x20'):_0x3acff0(0xac)+CLI_BIN_NAME+_0x3acff0(0x85);throw CliErrors['validation'](_0x3acff0(0xba)+_0x36a172+_0x3acff0(0xae)+_0x4fa23a);}_0x23c660=_0x36a172,_0x1681e0=_0x718b91;}else{if(_0x6bcf91){_0x1681e0=_0x6bcf91;const _0x4b4b1b=_0x89defe['find'](_0x1f9842=>_0x1f9842['datasetCode']===_0x6bcf91);_0x23c660=_0x4b4b1b?.[_0x3acff0(0xa2)];}else{if(_0x3e49f5['nonInteractive'])throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x79));else{if(_0x432ba0){const _0x3cb5cb=_0x89defe[_0x3acff0(0x83)](_0x2f3079=>_0x2f3079[_0x3acff0(0xa2)]+'\x20('+_0x2f3079['tableName']+')'),_0x57ab8a=await promptSelect(_0x3acff0(0xa7),_0x3cb5cb),_0x4ce7f6=_0x89defe[_0x57ab8a];if(!_0x4ce7f6)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0xa9));_0x23c660=_0x4ce7f6[_0x3acff0(0xa2)],_0x1681e0=_0x4ce7f6[_0x3acff0(0xbc)];}else{const _0x594821=await listDatasets(_0x3e49f5[_0x3acff0(0x9f)]);if(_0x594821[_0x3acff0(0xcc)]===0x0)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x9b));const _0x461dc5=_0x594821['map'](_0x2c069b=>_0x2c069b[_0x3acff0(0x8a)]+'\x20['+(_0x2c069b['source']??'UNKNOWN')+_0x3acff0(0x74)+_0x2c069b[_0x3acff0(0x94)]+')'),_0x1da95a=await promptSelect('Select\x20dataset:',_0x461dc5),_0x18252e=_0x594821[_0x1da95a];if(!_0x18252e)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0xa9));_0x1681e0=_0x18252e['code'],_0x23c660=undefined;}}}}const _0x10b8c5=await listDatasets(_0x3e49f5[_0x3acff0(0x9f)]),_0x55a2e8=_0x10b8c5[_0x3acff0(0xaf)](_0x18cd19=>_0x18cd19[_0x3acff0(0x94)]===_0x1681e0);if(!_0x55a2e8)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0xbb)+_0x1681e0+_0x3acff0(0xc9)+(_0x23c660?_0x3acff0(0xbd)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x533d25=_0x55a2e8['id'];const _0x55a915=_0x23c660??_0x1681e0,_0x39196f=await listBffDatasetOperations(_0x3e49f5[_0x3acff0(0x9f)],_0x533d25),_0x1f7d50=_0x39196f?Object[_0x3acff0(0xc7)](_0x39196f):[];if(_0x1f7d50[_0x3acff0(0xcc)]===0x0)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x95)+_0x55a915+'.');let _0x14ae8a;const _0x3f404c=_0x3e49f5[_0x3acff0(0xab)](_0x3acff0(0xbf));if(_0x3f404c){if(!_0x1f7d50[_0x3acff0(0xc8)](_0x3f404c))throw CliErrors['validation'](_0x3acff0(0x8b)+_0x3f404c+_0x3acff0(0x96)+_0x55a915+'.\x20'+(_0x3acff0(0x98)+_0x1f7d50['join'](',\x20')));_0x14ae8a=_0x3f404c;}else{if(_0x3e49f5[_0x3acff0(0xcb)])throw CliErrors[_0x3acff0(0xa1)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x554aa9=await promptSelect(_0x3acff0(0xad),_0x1f7d50);_0x14ae8a=_0x1f7d50[_0x554aa9]??_0x1f7d50[0x0];}let _0x63158b=normalizeHookFunctionNode(_0x3e49f5[_0x3acff0(0xab)](_0x3acff0(0xa8)));if(!_0x63158b){if(_0x3e49f5[_0x3acff0(0xab)]('function-node'))throw CliErrors['validation'](_0x3acff0(0xb9));if(_0x3e49f5['nonInteractive'])throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x75));const _0x361d7b=await promptSelect('Select\x20trigger\x20node:',[_0x3acff0(0xb6),_0x3acff0(0x90)]);_0x63158b=[_0x3acff0(0xb6),_0x3acff0(0x90)][_0x361d7b]??_0x3acff0(0xb6);}return{'alias':_0x23c660,'datasetCode':_0x1681e0,'datasetId':_0x533d25,'operationType':_0x14ae8a,'functionNode':_0x63158b};}async function promptSelect(_0x362896,_0x41ae10){const _0x956f74=a30_0x5bb153;if(_0x41ae10['length']===0x1)return 0x0;for(const [_0x1f5f03,_0x52aceb]of _0x41ae10['entries']()){process['stderr'][_0x956f74(0xb8)]('\x20\x20'+(_0x1f5f03+0x1)+'.\x20'+_0x52aceb+'\x0a');}const _0x228d74=createInterface({'input':process['stdin'],'output':process[_0x956f74(0xca)]});while(!![]){const _0x442132=await new Promise(_0x5a38ec=>{_0x228d74['question'](_0x362896+'\x20',_0x5a38ec);}),_0xee749a=Number[_0x956f74(0x8e)](_0x442132[_0x956f74(0x88)](),0xa);if(Number[_0x956f74(0xbe)](_0xee749a)&&_0xee749a>=0x1&&_0xee749a<=_0x41ae10[_0x956f74(0xcc)])return _0x228d74[_0x956f74(0xb3)](),_0xee749a-0x1;process[_0x956f74(0xca)][_0x956f74(0xb8)](_0x956f74(0x78)+_0x41ae10['length']+'.\x0a');}}function buildFilePath(_0x2128b4,_0x567ed6,_0x1f6ab3,_0x2a3f01){const _0x10feee=a30_0x5bb153;if(_0x567ed6===_0x10feee(0xb1)){if(!_0x2a3f01)throw CliErrors[_0x10feee(0xa1)](_0x10feee(0xb7));const _0x4dfb33=_0x2a3f01[_0x10feee(0xa2)]??_0x2a3f01[_0x10feee(0xbc)];return join(_0x2128b4[_0x10feee(0xc5)],'HOOK',_0x4dfb33,_0x2a3f01['operationType'],_0x2a3f01[_0x10feee(0x87)],_0x1f6ab3+'.js');}return join(_0x2128b4['scriptsRootDir'],_0x567ed6,_0x1f6ab3+_0x10feee(0x8c));}export function generateTemplate(_0x5cad57,_0x3542ee,_0x74fa17,_0x2a3a6d,_0x379ef4){const _0x4743f8=a30_0x5bb153,_0x465a90=_0x2a3a6d?.[_0x4743f8(0x88)]()||_0x4743f8(0x7a);if(_0x5cad57===_0x4743f8(0x82))return _0x4743f8(0x9c)+_0x465a90+_0x4743f8(0x89)+_0x3542ee+_0x4743f8(0x7e)+_0x3542ee+_0x4743f8(0xb0)+_0x3542ee+_0x4743f8(0x7d);if(_0x5cad57===_0x4743f8(0xc4))return _0x4743f8(0xc2)+_0x465a90+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x74fa17+'/'+_0x3542ee+_0x4743f8(0xa3)+_0x3542ee+_0x4743f8(0x7d);if(!_0x379ef4)throw CliErrors[_0x4743f8(0xa1)](_0x4743f8(0xb4));return _0x4743f8(0x92)+_0x465a90+_0x4743f8(0x91)+_0x74fa17+'/'+_0x379ef4[_0x4743f8(0xbc)]+'/'+_0x379ef4[_0x4743f8(0x99)]+_0x4743f8(0x77)+_0x379ef4[_0x4743f8(0x87)]+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x3542ee+_0x4743f8(0x7d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a31_0x41e935=a31_0x5185;(function(_0x224397,_0x3dd9b2){const _0x4a9b90=a31_0x5185,_0x219250=_0x224397();while(!![]){try{const _0x2531d0=-parseInt(_0x4a9b90(0xe9))/0x1*(-parseInt(_0x4a9b90(0xe6))/0x2)+-parseInt(_0x4a9b90(0xbf))/0x3+parseInt(_0x4a9b90(0xc4))/0x4+-parseInt(_0x4a9b90(0xe3))/0x5+parseInt(_0x4a9b90(0xcc))/0x6+-parseInt(_0x4a9b90(0xd3))/0x7*(-parseInt(_0x4a9b90(0xde))/0x8)+-parseInt(_0x4a9b90(0xe5))/0x9;if(_0x2531d0===_0x3dd9b2)break;else _0x219250['push'](_0x219250['shift']());}catch(_0x4e1504){_0x219250['push'](_0x219250['shift']());}}}(a31_0x4837,0x5df5c));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a31_0x4837(){const _0x55036b=['delete','projectRoot','trashDir','776lGOniQ','/api/management/library/scripts/delete','Deleted\x20','length','parse','2860005VjKkdy','POST','7285140MwlPUj','18yqXVAO','bff','functions','23683UWbyCR','lastSync','keys','trashedTo','BFF\x20lock\x20file\x20not\x20found.','replace','startsWith','str','stringify','remoteId','93432icuNHp','find','high-risk-write','Lock\x20scope\x20for\x20app\x20\x22','join','2413068jIFQzq','apps','lockFilePath','target','No\x20lock\x20entry\x20found\x20for\x20\x22','\x20(local\x20file\x20moved\x20to\x20trash)','<timestamp>','includes','2441448PDFcAo','scriptsRoot','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x22\x20not\x20found\x20after\x20ensureLockScope.','scriptsRootDir','Function\x20not\x20found:\x20','Local\x20delete\x20not\x20settled\x20for\x20','41433WGpPrK','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','toISOString','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','filter','validation','map','appCode'];a31_0x4837=function(){return _0x55036b;};return a31_0x4837();}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 a31_0x5185(_0x531ec1,_0x40e83b){_0x531ec1=_0x531ec1-0xb8;const _0x48377e=a31_0x4837();let _0x5185ac=_0x48377e[_0x531ec1];return _0x5185ac;}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0x41e935(0xe7),'command':a31_0x41e935(0xdb),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a31_0x41e935(0xc1),'flags':[{'name':a31_0x41e935(0xc7),'type':'string','required':!![],'description':a31_0x41e935(0xd6)}],async 'validate'(_0x577ef0){const _0x5663ee=a31_0x41e935,_0x50b5ae=loadBffProjectConfig(_0x577ef0['appCode']),_0x4ebb69=await readBffLockFile(_0x50b5ae[_0x5663ee(0xc6)]);if(!_0x4ebb69)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x382f58){const _0x8eab02=a31_0x41e935,_0x561bcd=loadBffProjectConfig(_0x382f58[_0x8eab02(0xda)]),_0x235278=await readBffLockFile(_0x561bcd[_0x8eab02(0xc6)]);if(!_0x235278)throw CliErrors[_0x8eab02(0xd8)]('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x12229d}=ensureLockScope(_0x235278,_0x382f58[_0x8eab02(0xda)],_0x561bcd[_0x8eab02(0xcd)],'delete'),_0x4a84ac=_0x382f58[_0x8eab02(0xbc)](_0x8eab02(0xc7)),_0x5b5eb6=Object[_0x8eab02(0xeb)](_0x12229d['functions']),_0x4821ce=resolveDeleteTarget(_0x4a84ac,_0x5b5eb6),_0x115757=_0x12229d['functions'][_0x4821ce];if(!_0x115757)throw CliErrors[_0x8eab02(0xd8)](_0x8eab02(0xc8)+_0x4821ce+'\x22.');const _0x31e25f=resolveLocalFilePathFromLockKey(_0x561bcd,_0x4821ce),_0x433dcb=relative(_0x561bcd[_0x8eab02(0xdc)],_0x31e25f),_0x39d5f2=join(_0x561bcd['trashDir'],_0x8eab02(0xca),_0x433dcb);return{'method':_0x8eab02(0xe4),'url':_0x8eab02(0xdf),'body':{'appCode':_0x382f58['appCode'],'target':_0x4821ce,'remoteId':_0x115757[_0x8eab02(0xbe)],'localFilePath':_0x31e25f,'trashedPath':_0x39d5f2},'description':'Would\x20delete\x20'+_0x4821ce+_0x8eab02(0xd4)};},async 'execute'(_0x18d02a){const _0x4b1159=a31_0x41e935,_0x31ddf7=loadBffProjectConfig(_0x18d02a[_0x4b1159(0xda)]),_0x8f01bf=await readBffLockFile(_0x31ddf7[_0x4b1159(0xc6)]);if(!_0x8f01bf)throw CliErrors[_0x4b1159(0xd8)](_0x4b1159(0xb9));const {lockData:_0x4c8835,appLock:_0x2b1813}=ensureLockScope(_0x8f01bf,_0x18d02a[_0x4b1159(0xda)],_0x31ddf7['scriptsRoot'],_0x4b1159(0xdb)),_0x31cdb8=JSON[_0x4b1159(0xe2)](JSON[_0x4b1159(0xbd)](_0x4c8835)),_0x4647bc=_0x31cdb8['apps'][_0x18d02a[_0x4b1159(0xda)]];if(!_0x4647bc)throw new Error(_0x4b1159(0xc2)+_0x18d02a[_0x4b1159(0xda)]+_0x4b1159(0xcf));const _0x1d2e83=_0x18d02a[_0x4b1159(0xbc)](_0x4b1159(0xc7)),_0x34aeb7=Object[_0x4b1159(0xeb)](_0x4647bc[_0x4b1159(0xe8)]),_0x83c984=resolveDeleteTarget(_0x1d2e83,_0x34aeb7),_0x163424=_0x4647bc[_0x4b1159(0xe8)][_0x83c984];if(!_0x163424)throw CliErrors[_0x4b1159(0xd8)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x83c984+'\x22.');await deleteBffScript(_0x163424[_0x4b1159(0xbe)]),delete _0x4647bc[_0x4b1159(0xe8)][_0x83c984],_0x4647bc[_0x4b1159(0xea)]=new Date()['toISOString'](),await writeBffLockFile(_0x31ddf7['lockFilePath'],_0x31cdb8);const _0x45ba9c=resolveLocalFilePathFromLockKey(_0x31ddf7,_0x83c984);let _0x86715;await fileExists(_0x45ba9c)&&(_0x86715=await moveToTrash(_0x31ddf7[_0x4b1159(0xdc)],_0x31ddf7[_0x4b1159(0xdd)],_0x45ba9c),await cleanupEmptyDirectories(dirname(_0x45ba9c),_0x31ddf7[_0x4b1159(0xd0)]));await waitForDeleteSettlement(_0x31ddf7['lockFilePath'],_0x18d02a[_0x4b1159(0xda)],_0x83c984,_0x45ba9c),await sleep(0x96);const _0x47eb37={'deleted':_0x83c984,'remoteId':_0x163424['remoteId']};if(_0x86715)_0x47eb37[_0x4b1159(0xb8)]=_0x86715;return{'ok':!![],'data':_0x47eb37,'message':_0x4b1159(0xe0)+_0x83c984+(_0x86715?_0x4b1159(0xc9):'')};}};function resolveDeleteTarget(_0x207389,_0x560d48){const _0x3d55d6=a31_0x41e935;if(_0x207389[_0x3d55d6(0xcb)]('/')){const _0x4bbb55=_0x560d48[_0x3d55d6(0xc0)](_0x4afef4=>_0x4afef4===_0x207389);if(!_0x4bbb55)throw CliErrors['validation'](_0x3d55d6(0xd1)+_0x207389);return _0x4bbb55;}const _0x4e50bd=_0x560d48[_0x3d55d6(0xd7)](_0x11ef7b=>_0x11ef7b['split']('/')['at'](-0x1)===_0x207389);if(_0x4e50bd[_0x3d55d6(0xe1)]===0x0)throw CliErrors[_0x3d55d6(0xd8)](_0x3d55d6(0xd1)+_0x207389);if(_0x4e50bd['length']>0x1)throw CliErrors[_0x3d55d6(0xd8)]('Multiple\x20functions\x20match\x20\x22'+_0x207389+_0x3d55d6(0xce)+_0x4e50bd[_0x3d55d6(0xd9)](_0x40b8fb=>'\x20\x20-\x20'+_0x40b8fb)[_0x3d55d6(0xc3)]('\x0a'));return _0x4e50bd[0x0];}async function moveToTrash(_0x5bca3c,_0x2b3d86,_0x46027f){const _0x3e8311=a31_0x41e935,_0x40b725=new Date()[_0x3e8311(0xd5)]()[_0x3e8311(0xba)](/[:.]/g,'-'),_0x44dd9e=relative(_0x5bca3c,_0x46027f),_0x59af3d=join(_0x2b3d86,_0x40b725,_0x44dd9e);return await mkdir(dirname(_0x59af3d),{'recursive':!![]}),await rename(_0x46027f,_0x59af3d),_0x59af3d;}async function cleanupEmptyDirectories(_0x3e6ce8,_0x3ea4a4){const _0x4d9bd2=a31_0x41e935;let _0x49f41d=resolve(_0x3e6ce8);const _0x2a4a95=resolve(_0x3ea4a4);while(_0x49f41d[_0x4d9bd2(0xbb)](''+_0x2a4a95+sep)||_0x49f41d===_0x2a4a95){if(_0x49f41d===_0x2a4a95)return;try{const _0x131ebc=await readdir(_0x49f41d);if(_0x131ebc[_0x4d9bd2(0xe1)]>0x0)return;await rmdir(_0x49f41d);}catch{return;}_0x49f41d=dirname(_0x49f41d);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3f7646,_0x4cedbe,_0x26d2bf,_0x4dfa97){const _0x56974e=a31_0x41e935;for(let _0x3f94b2=0x0;_0x3f94b2<DELETE_SETTLE_RETRY_COUNT;_0x3f94b2+=0x1){const _0x4e940f=await readBffLockFile(_0x3f7646),_0x516f82=!!_0x4e940f?.[_0x56974e(0xc5)]?.[_0x4cedbe]?.['functions']?.[_0x26d2bf],_0x2cb427=await fileExists(_0x4dfa97);if(!_0x516f82&&!_0x2cb427)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x56974e(0xd2)+_0x26d2bf+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x9eacc2=a32_0x341f;(function(_0x42921f,_0x40b78a){const _0x82151f=a32_0x341f,_0x4d904e=_0x42921f();while(!![]){try{const _0xa30fd=-parseInt(_0x82151f(0x198))/0x1+-parseInt(_0x82151f(0x18f))/0x2*(parseInt(_0x82151f(0x18a))/0x3)+parseInt(_0x82151f(0x19a))/0x4+parseInt(_0x82151f(0x199))/0x5+-parseInt(_0x82151f(0x18b))/0x6+parseInt(_0x82151f(0x189))/0x7+-parseInt(_0x82151f(0x19f))/0x8*(-parseInt(_0x82151f(0x19d))/0x9);if(_0xa30fd===_0x40b78a)break;else _0x4d904e['push'](_0x4d904e['shift']());}catch(_0x55d7a6){_0x4d904e['push'](_0x4d904e['shift']());}}}(a32_0x2383,0x7c60f));function a32_0x341f(_0x2ea074,_0x14cb4d){_0x2ea074=_0x2ea074-0x189;const _0x238340=a32_0x2383();let _0x341f89=_0x238340[_0x2ea074];return _0x341f89;}import{getBffScriptInfo}from'../../core/api-client.js';function a32_0x2383(){const _0x3ba04f=['2002925yyOknE','118340OCnfhp','Script\x20ID','description','9113733YbFZjI','updatedTime','8XlmdlU','3969126nJaycl','5013wpQlTi','2479062JVytHg','boolean','detail','num','534ZzgNbW','verbose','scriptContent','Return\x20full\x20raw\x20script\x20object','(none)','appCode','bool','scriptType','Get\x20BFF\x20script\x20details\x20by\x20ID','641036FCMeIs'];a32_0x2383=function(){return _0x3ba04f;};return a32_0x2383();}export const bffDetail={'service':'bff','command':a32_0x9eacc2(0x18d),'description':a32_0x9eacc2(0x197),'risk':'read','flags':[{'name':'id','type':'number','required':!![],'description':a32_0x9eacc2(0x19b)},{'name':a32_0x9eacc2(0x190),'type':a32_0x9eacc2(0x18c),'description':a32_0x9eacc2(0x192)}],async 'execute'(_0x568ae9){const _0x38f486=a32_0x9eacc2,_0x2ba0fb=await getBffScriptInfo(_0x568ae9[_0x38f486(0x18e)]('id')),_0x18a8db=_0x568ae9[_0x38f486(0x195)](_0x38f486(0x190));if(_0x18a8db)return{'ok':!![],'data':_0x2ba0fb};return{'ok':!![],'data':{'id':_0x2ba0fb['id'],'appCode':_0x2ba0fb[_0x38f486(0x194)],'scriptType':_0x2ba0fb[_0x38f486(0x196)],'description':_0x2ba0fb[_0x38f486(0x19c)]||_0x38f486(0x193),'createdTime':_0x2ba0fb['createdTime']??'','updatedTime':_0x2ba0fb[_0x38f486(0x19e)]??'','scriptContent':_0x2ba0fb[_0x38f486(0x191)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x75be65,_0x324838){const _0x4c3c45=a33_0x20d0,_0x3a930a=_0x75be65();while(!![]){try{const _0x22ac18=-parseInt(_0x4c3c45(0x10b))/0x1+parseInt(_0x4c3c45(0x10d))/0x2+parseInt(_0x4c3c45(0x104))/0x3*(-parseInt(_0x4c3c45(0x10f))/0x4)+-parseInt(_0x4c3c45(0x10a))/0x5*(parseInt(_0x4c3c45(0x10c))/0x6)+-parseInt(_0x4c3c45(0x107))/0x7*(-parseInt(_0x4c3c45(0x105))/0x8)+parseInt(_0x4c3c45(0x108))/0x9*(-parseInt(_0x4c3c45(0x109))/0xa)+-parseInt(_0x4c3c45(0x106))/0xb*(-parseInt(_0x4c3c45(0x10e))/0xc);if(_0x22ac18===_0x324838)break;else _0x3a930a['push'](_0x3a930a['shift']());}catch(_0x38ecc3){_0x3a930a['push'](_0x3a930a['shift']());}}}(a33_0x3e27,0xd587c));import{bffList}from'../../commands/bff/list.js';function a33_0x3e27(){const _0x54fa73=['828ZvAPGL','12iBgCnp','1412514pNJxXJ','991912CvPVAV','520388JHUGiu','7AYFooO','1476198tfaTXX','20sqAlco','605DXjIDm','1406805GTDqxF','1578QMhvOt','1331130CHvbet'];a33_0x3e27=function(){return _0x54fa73;};return a33_0x3e27();}function a33_0x20d0(_0x17eee5,_0x4c19b4){_0x17eee5=_0x17eee5-0x104;const _0x3e27d9=a33_0x3e27();let _0x20d074=_0x3e27d9[_0x17eee5];return _0x20d074;}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x480370=a34_0x750d;function a34_0x750d(_0x43eb75,_0x55f17d){_0x43eb75=_0x43eb75-0x1ce;const _0x3567cc=a34_0x3567();let _0x750da7=_0x3567cc[_0x43eb75];return _0x750da7;}(function(_0x13cf10,_0x422208){const _0x2edec7=a34_0x750d,_0x37a849=_0x13cf10();while(!![]){try{const _0x25d687=-parseInt(_0x2edec7(0x1d3))/0x1*(parseInt(_0x2edec7(0x1e8))/0x2)+parseInt(_0x2edec7(0x1d6))/0x3*(parseInt(_0x2edec7(0x1dd))/0x4)+parseInt(_0x2edec7(0x1d2))/0x5*(-parseInt(_0x2edec7(0x1eb))/0x6)+parseInt(_0x2edec7(0x1ea))/0x7*(parseInt(_0x2edec7(0x1e3))/0x8)+-parseInt(_0x2edec7(0x1dc))/0x9*(-parseInt(_0x2edec7(0x1df))/0xa)+-parseInt(_0x2edec7(0x1e2))/0xb*(parseInt(_0x2edec7(0x1cf))/0xc)+-parseInt(_0x2edec7(0x1e6))/0xd*(-parseInt(_0x2edec7(0x1ed))/0xe);if(_0x25d687===_0x422208)break;else _0x37a849['push'](_0x37a849['shift']());}catch(_0x443a48){_0x37a849['push'](_0x37a849['shift']());}}}(a34_0x3567,0x6960a));function a34_0x3567(){const _0x3a7cc1=['133ifPbTt','234fDdlTZ','str','11914arjoKn','verbose','120VKwJiS','length','scriptType','58570fKVToN','1JECDtt','type','Script\x20type\x20filter','8109hoVIHY','bool','name','ENDPOINT','map','description','1526193sCvDRm','104yErhsf','bff','10qrFmCm','string','functionName','602195qeBfDq','205592GjdelF','read','COMMON','16367uaQmZF','list','727246kdNtcJ','List\x20BFF\x20scripts'];a34_0x3567=function(){return _0x3a7cc1;};return a34_0x3567();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a34_0x480370(0x1de),'command':a34_0x480370(0x1e7),'description':a34_0x480370(0x1e9),'risk':a34_0x480370(0x1e4),'flags':[{'name':a34_0x480370(0x1d4),'type':'string','description':a34_0x480370(0x1d5),'default':a34_0x480370(0x1d9),'enum':[a34_0x480370(0x1d9),a34_0x480370(0x1e5)]},{'name':'name','type':a34_0x480370(0x1e0),'description':'Filter\x20by\x20script\x20name'},{'name':a34_0x480370(0x1ce),'type':'boolean','description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x402fdb){const _0x306285=a34_0x480370,_0x4d716a=await listBffScripts(_0x402fdb['appCode'],_0x402fdb[_0x306285(0x1ec)](_0x306285(0x1d4)),{'scriptName':_0x402fdb[_0x306285(0x1ec)](_0x306285(0x1d8))||undefined}),_0x2d2212=_0x402fdb[_0x306285(0x1d7)]('verbose');return{'ok':!![],'data':_0x2d2212?_0x4d716a:_0x4d716a[_0x306285(0x1da)](_0x2f5942=>({'id':_0x2f5942['id'],'functionName':_0x2f5942[_0x306285(0x1e1)]??'','description':_0x2f5942[_0x306285(0x1db)]||'(unnamed)','scriptType':_0x2f5942[_0x306285(0x1d1)]})),'message':_0x4d716a[_0x306285(0x1d0)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x1ba252=a35_0x906a;(function(_0x145f97,_0x1ca1be){const _0x94150e=a35_0x906a,_0x41d247=_0x145f97();while(!![]){try{const _0x37d465=parseInt(_0x94150e(0x224))/0x1*(-parseInt(_0x94150e(0x22a))/0x2)+parseInt(_0x94150e(0x1eb))/0x3*(-parseInt(_0x94150e(0x232))/0x4)+parseInt(_0x94150e(0x1ff))/0x5+parseInt(_0x94150e(0x219))/0x6+-parseInt(_0x94150e(0x1fc))/0x7*(-parseInt(_0x94150e(0x212))/0x8)+-parseInt(_0x94150e(0x1ee))/0x9+parseInt(_0x94150e(0x202))/0xa*(parseInt(_0x94150e(0x1f5))/0xb);if(_0x37d465===_0x1ca1be)break;else _0x41d247['push'](_0x41d247['shift']());}catch(_0x157f98){_0x41d247['push'](_0x41d247['shift']());}}}(a35_0x8ce6,0xcf64a));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a35_0x1ba252(0x1f4),'command':a35_0x1ba252(0x208),'description':a35_0x1ba252(0x228),'risk':a35_0x1ba252(0x216),'flags':[{'name':'type','type':a35_0x1ba252(0x21a),'description':a35_0x1ba252(0x229),'enum':[a35_0x1ba252(0x1f8),a35_0x1ba252(0x1f1),'HOOK']},{'name':a35_0x1ba252(0x1fa),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x17d3a9){const _0x111105=a35_0x1ba252,_0x42881b=loadBffProjectConfig(_0x17d3a9[_0x111105(0x205)]),_0x16509a=await readBffLockFile(_0x42881b[_0x111105(0x1fb)]),{appLock:_0x116988}=ensureLockScope(_0x16509a??createEmptyBffLock(),_0x17d3a9[_0x111105(0x205)],_0x42881b[_0x111105(0x204)],_0x111105(0x208)),_0x204fbb=normalizeBffType(_0x17d3a9[_0x111105(0x209)]('type'))??undefined,_0x29659c=buildDatasetCodeToAliasMap(_0x17d3a9[_0x111105(0x201)],_0x17d3a9['appCode']),[_0x33d6d4,_0x37f948]=await Promise[_0x111105(0x21d)]([listBffScripts(_0x17d3a9[_0x111105(0x205)],_0x204fbb),getBffScriptStatistics(_0x17d3a9[_0x111105(0x205)])]),_0x1a1e83=createHookLocationMap(_0x37f948),_0x445ef4=[];for(const _0x3e525e of _0x33d6d4){const _0x46a2f5=resolveRemoteScriptTarget(_0x42881b,_0x3e525e,_0x1a1e83,_0x116988[_0x111105(0x211)],_0x29659c);if(!_0x46a2f5){_0x445ef4[_0x111105(0x1ed)]({'scriptType':_0x3e525e[_0x111105(0x21f)],'functionName':_0x3e525e[_0x111105(0x230)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x14963e=_0x116988[_0x111105(0x211)][_0x46a2f5['lockKey']],_0x2a2b79=_0x3e525e[_0x111105(0x1ef)]!=null?computeContentHash(_0x3e525e[_0x111105(0x1ef)]):undefined,_0x54d62f=await hasUnsyncedLocalChanges(_0x46a2f5[_0x111105(0x20b)],_0x14963e,_0x2a2b79);_0x445ef4[_0x111105(0x1ed)]({'lockKey':_0x46a2f5['lockKey'],'filePath':_0x46a2f5[_0x111105(0x20b)],'remoteId':_0x3e525e['id']??null,'status':_0x54d62f?'conflict':_0x111105(0x1e9)});}return{'method':_0x111105(0x226),'url':_0x111105(0x20a)+_0x17d3a9[_0x111105(0x205)]+(_0x204fbb?_0x111105(0x1ec)+_0x204fbb:''),'body':{'appCode':_0x17d3a9[_0x111105(0x205)],'filterType':_0x204fbb??null,'files':_0x445ef4},'description':_0x111105(0x206)+_0x445ef4[_0x111105(0x1f3)]+_0x111105(0x227)};},async 'execute'(_0x5afdf9){const _0x16dac7=a35_0x1ba252,_0x4bacd2=loadBffProjectConfig(_0x5afdf9[_0x16dac7(0x205)]),_0x1698cc=await readBffLockFile(_0x4bacd2[_0x16dac7(0x1fb)]),{lockData:_0x284295,appLock:_0x49205e}=ensureLockScope(_0x1698cc??createEmptyBffLock(),_0x5afdf9[_0x16dac7(0x205)],_0x4bacd2[_0x16dac7(0x204)],_0x16dac7(0x208)),_0x40c257=normalizeBffType(_0x5afdf9['str']('type'))??undefined;if(_0x5afdf9[_0x16dac7(0x209)](_0x16dac7(0x1fe))&&!_0x40c257)throw CliErrors[_0x16dac7(0x1f7)](_0x16dac7(0x221));const [_0x2f570f,_0x4b04f7]=await Promise[_0x16dac7(0x21d)]([listBffScripts(_0x5afdf9['appCode'],_0x40c257),getBffScriptStatistics(_0x5afdf9[_0x16dac7(0x205)])]);if(_0x2f570f['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x16dac7(0x20f)};const _0x3f2cd2=_0x5afdf9[_0x16dac7(0x22e)](_0x16dac7(0x1fa));if(_0x3f2cd2&&!_0x5afdf9[_0x16dac7(0x1ea)]){const _0x43752e=await confirmForce();if(!_0x43752e)throw CliErrors[_0x16dac7(0x217)](_0x16dac7(0x215));}if(_0x3f2cd2&&_0x5afdf9[_0x16dac7(0x1ea)]){}const _0x34985d=buildDatasetCodeToAliasMap(_0x5afdf9[_0x16dac7(0x201)],_0x5afdf9[_0x16dac7(0x205)]),_0x2d9ad3=createHookLocationMap(_0x4b04f7),_0x28154c=JSON[_0x16dac7(0x22d)](JSON[_0x16dac7(0x22c)](_0x284295)),_0x4e62bd=_0x5afdf9['appCode'],_0x4f2b43=_0x28154c[_0x16dac7(0x21c)][_0x4e62bd];if(!_0x4f2b43)throw new Error(_0x16dac7(0x20c)+_0x4e62bd+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x256ca1=[],_0x11525f=[],_0x29c8be=[];for(const _0x4de535 of _0x2f570f){const _0x4b4af1=resolveRemoteScriptTarget(_0x4bacd2,_0x4de535,_0x2d9ad3,_0x49205e[_0x16dac7(0x211)],_0x34985d);if(!_0x4b4af1){_0x11525f[_0x16dac7(0x1ed)]({'lockKey':_0x4de535[_0x16dac7(0x21f)]+'/'+_0x4de535[_0x16dac7(0x230)],'reason':_0x16dac7(0x22b)});continue;}const _0x577347=_0x49205e[_0x16dac7(0x211)][_0x4b4af1[_0x16dac7(0x1f6)]];try{if(!_0x4de535['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x4de535[_0x16dac7(0x1ef)]==null)throw new Error(_0x16dac7(0x231));const _0x248501=_0x4de535[_0x16dac7(0x1ef)],_0x530251=computeContentHash(_0x248501);if(!_0x3f2cd2){const _0x566dae=await hasUnsyncedLocalChanges(_0x4b4af1[_0x16dac7(0x20b)],_0x577347,_0x530251);if(_0x566dae){_0x11525f[_0x16dac7(0x1ed)]({'lockKey':_0x4b4af1[_0x16dac7(0x1f6)],'reason':_0x16dac7(0x222)});continue;}}await ensureParentDirectory(_0x4b4af1[_0x16dac7(0x20b)]),await writeFile(_0x4b4af1[_0x16dac7(0x20b)],_0x248501,_0x16dac7(0x20d));const _0x85f0bd={'hash':_0x530251,'remoteId':_0x4de535['id'],'version':_0x4de535[_0x16dac7(0x1f2)]};_0x4b4af1[_0x16dac7(0x1fe)]===_0x16dac7(0x21e)&&_0x4b4af1['hookLocation']&&(_0x85f0bd[_0x16dac7(0x1fd)]=_0x4b4af1[_0x16dac7(0x203)][_0x16dac7(0x1fd)],_0x85f0bd[_0x16dac7(0x223)]=_0x4b4af1['hookLocation'][_0x16dac7(0x223)],_0x85f0bd['operationType']=_0x4b4af1[_0x16dac7(0x203)][_0x16dac7(0x218)],_0x85f0bd[_0x16dac7(0x210)]=_0x4b4af1[_0x16dac7(0x203)][_0x16dac7(0x210)]),_0x4f2b43['functions'][_0x4b4af1[_0x16dac7(0x1f6)]]=_0x85f0bd,_0x256ca1[_0x16dac7(0x1ed)]({'lockKey':_0x4b4af1[_0x16dac7(0x1f6)],'remoteId':_0x4de535['id']});}catch(_0x2f9ba0){_0x29c8be[_0x16dac7(0x1ed)]({'lockKey':_0x4b4af1[_0x16dac7(0x1f6)],'error':_0x2f9ba0 instanceof Error?_0x2f9ba0['message']:String(_0x2f9ba0)});}}return _0x4f2b43['lastSync']=new Date()[_0x16dac7(0x220)](),await writeBffLockFile(_0x4bacd2[_0x16dac7(0x1fb)],_0x28154c),{'ok':_0x29c8be[_0x16dac7(0x1f3)]===0x0,'data':{'pulled':_0x256ca1,'skipped':_0x11525f,'failed':_0x29c8be},'message':'Pull\x20complete:\x20'+_0x256ca1[_0x16dac7(0x1f3)]+'\x20pulled,\x20'+_0x11525f[_0x16dac7(0x1f3)]+_0x16dac7(0x213)+_0x29c8be[_0x16dac7(0x1f3)]+_0x16dac7(0x207)};}};async function hasUnsyncedLocalChanges(_0x41eadd,_0x5eb8ff,_0x50120a){const _0x306b64=a35_0x1ba252;if(!await fileExists(_0x41eadd))return![];const _0x3ca092=await computeFileHash(_0x41eadd);if(!_0x5eb8ff)return _0x50120a?_0x3ca092!==_0x50120a:!![];return _0x3ca092!==_0x5eb8ff[_0x306b64(0x1f9)];}function a35_0x906a(_0x28a747,_0x28a327){_0x28a747=_0x28a747-0x1e9;const _0x8ce6f5=a35_0x8ce6();let _0x906ada=_0x8ce6f5[_0x28a747];return _0x906ada;}function a35_0x8ce6(){const _0x669db7=['77jlfXcQ','lockKey','validation','COMMON','hash','force','lockFilePath','35rGRkEy','alias','type','3426935ofUtGN','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','apiDir','4038230aiBcoR','hookLocation','scriptsRoot','appCode','Would\x20inspect\x20','\x20failed','pull','str','/api/management/library/scripts/list?appCode=','filePath','Lock\x20scope\x20for\x20app\x20\x22','utf8','stdin','No\x20remote\x20BFF\x20scripts\x20found.','functionNode','functions','1402216bsNUAM','\x20skipped,\x20','map','Force\x20pull\x20cancelled.','read','cancelled','operationType','781896ovDQRd','string','toLowerCase','apps','all','HOOK','scriptType','toISOString','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','local\x20unsynced\x20changes','datasetCode','226557nEmzVd','stderr','GET','\x20remote\x20BFF\x20script(s)\x20for\x20pull','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','Pull\x20only\x20this\x20script\x20type','14ESPWlt','unresolvable\x20target\x20path','stringify','parse','bool','yes','functionName','Remote\x20script\x20missing\x20content.','26580rcknnL','would_pull','nonInteractive','225oMBxXm','&type=','push','14265837hCdqii','scriptContent','includes','ENDPOINT','version','length','bff'];a35_0x8ce6=function(){return _0x669db7;};return a35_0x8ce6();}function buildDatasetCodeToAliasMap(_0x28acd6,_0x28f8ae){const _0x4dddc3=a35_0x1ba252,_0x5b2626=loadAliasMap(_0x28acd6,undefined,resolveApiFilePath(_0x28acd6,_0x28f8ae));return new Map(_0x5b2626[_0x4dddc3(0x214)](_0x5277c6=>[_0x5277c6[_0x4dddc3(0x223)],_0x5277c6['alias']]));}async function confirmForce(){const _0x3a3a27=a35_0x1ba252,_0x51c283=createInterface({'input':process[_0x3a3a27(0x20e)],'output':process[_0x3a3a27(0x225)]}),_0x4a8483=await new Promise(_0x3723cf=>{const _0x3de9d6=_0x3a3a27;_0x51c283['question'](_0x3de9d6(0x200),_0x3723cf);});return _0x51c283['close'](),['y',_0x3a3a27(0x22f)][_0x3a3a27(0x1f0)](_0x4a8483['trim']()[_0x3a3a27(0x21b)]());}
|