@lovrabet/rabetbase-cli 2.5.3-beta.3 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +5 -3
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +7 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -1
- package/skills/rabetbase/SKILL.md +7 -5
- package/skills/rabetbase/guides/backend-function.md +5 -1
- package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
- package/skills/rabetbase/guides/cross-database-bff.md +70 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
- package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +5 -1
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +41 -13
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a43_0x3b97bc=a43_0x71b6;function a43_0x33aa(){const _0x34c047=['filePath','update',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','\x20bff\x20detail\x20--id\x20','review_remote_and_merge','string','apps','message','size','HOOK','currentApp','operationType','Would\x20inspect\x20','mergedCli','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','POST','appCode','runtime\x20cache\x20cleared','set','EXISTING_HOOK_BINDING_PRESERVED','cleared','1000629EyYqzE','156uzHINy','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','3918DWvIzP','531771vBuheK','script','runtime\x20cache\x20clear\x20failed','push','33620LjCGBA','attempted','hash','delete','apiDir','\x20resolution','conflict','164240zjNbFE','Lock\x20scope\x20for\x20app\x20\x22','remoteId','scriptsRoot','dataset','stringify','8ZeGdOP','before','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','Remote\x20script\x20version\x20changed\x20since\x20the\x20last\x20pull.','status','some','map','\x20uploaded','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','\x20--format\x20compress','get','ENDPOINT','alias','Force\x20push\x20ignoring\x20hash\x20protection','HOOK_DATASET_NOT_FOUND:','resolutions','warnings','functions','9177JwJoWE','existingHooks','1255310KjivOM','Local\x20function\x20not\x20found:\x20','str','BFF_REMOTE_VERSION_CHANGED','force','lockKey','type','validation','failures','flatMap','every','Push\x20only\x20this\x20script\x20type','profileName','lockFilePath','failed','functionName','lastSync','\x20conflict','scriptType','The\x20local\x20sync\x20lock\x20has\x20no\x20remote\x20version\x20for\x20this\x20script.','unchanged','Existing\x20HOOK\x20identity,\x20version\x20or\x20binding\x20does\x20not\x20match\x20the\x20local\x20lock.\x20Pull\x20and\x20review\x20before\x20pushing.','Review\x20the\x20current\x20remote\x20source,\x20merge\x20it\x20into\x20the\x20local\x20script,\x20then\x20retry\x20push.\x20Do\x20not\x20use\x20--force\x20unless\x20you\x20intentionally\x20discard\x20local\x20changes.','1158IEPgjc','has','join','boolean','create','filter','description','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','version','name','startsWith','functionNode','Dataset\x20metadata\x20is\x20unavailable;\x20the\x20existing\x20script\x20and\x20binding\x20were\x20verified.\x20Update\x20by\x20script\x20ID\x20without\x20rebinding.','require','selectedAppName','BFF_REMOTE_VERSION_MISSING','COMMON','datasetCode','Push\x20complete:\x20','Incomplete\x20HOOK\x20path:\x20','datasetId','afterScriptId','bool','defaultApp','would_push','Cannot\x20verify\x20existing\x20HOOK\x20binding:\x20'];a43_0x33aa=function(){return _0x34c047;};return a43_0x33aa();}(function(_0x45d8dc,_0x3d2d2b){const _0x306357=a43_0x71b6,_0x2bc9df=_0x45d8dc();while(!![]){try{const _0x12f096=parseInt(_0x306357(0xe4))/0x1*(parseInt(_0x306357(0xe6))/0x2)+-parseInt(_0x306357(0xe7))/0x3*(-parseInt(_0x306357(0xf8))/0x4)+-parseInt(_0x306357(0xeb))/0x5+parseInt(_0x306357(0xb4))/0x6*(-parseInt(_0x306357(0x10b))/0x7)+parseInt(_0x306357(0xf2))/0x8+-parseInt(_0x306357(0xe3))/0x9+-parseInt(_0x306357(0x10d))/0xa;if(_0x12f096===_0x3d2d2b)break;else _0x2bc9df['push'](_0x2bc9df['shift']());}catch(_0x163ccb){_0x2bc9df['push'](_0x2bc9df['shift']());}}}(a43_0x33aa,0x2cf7d));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,getBffScriptStatistics,getPlatformErrorCode,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{buildHookDirectoryIndexes,assertUnambiguousHookAliases,assertUnambiguousHookDirectoryMappings,preflightPushHookDirectories,trackedHookDirectoryMappings}from'../../core/bff/hook-directory.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription,snakeToCamel}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a43_0x71b6(_0x3886ac,_0x1a4ddd){_0x3886ac=_0x3886ac-0xb3;const _0x33aa13=a43_0x33aa();let _0x71b6d6=_0x33aa13[_0x3886ac];return _0x71b6d6;}import{CliErrors}from'../../errors.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a43_0x3b97bc(0xea),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':'write','structuredErrors':!![],'flags':[{'name':a43_0x3b97bc(0x113),'type':'string','description':a43_0x3b97bc(0x118),'enum':[a43_0x3b97bc(0xc4),a43_0x3b97bc(0x104),a43_0x3b97bc(0xd7)]},{'name':'name','type':a43_0x3b97bc(0xd3),'description':a43_0x3b97bc(0xe5)},{'name':'force','type':a43_0x3b97bc(0xb7),'description':a43_0x3b97bc(0x106)}],async 'dryRun'(_0x4d58a6){const _0x50ce96=a43_0x3b97bc,_0x3d7b43=loadBffProjectConfig(_0x4d58a6['appCode']),_0x2e213c=await readBffLockFile(_0x3d7b43['lockFilePath']),{appLock:_0x444cd5}=ensureLockScope(_0x2e213c??createEmptyBffLock(),_0x4d58a6[_0x50ce96(0xde)],_0x3d7b43['scriptsRoot'],_0x50ce96(0xea)),_0x226dcf=await getTargetFunctions(_0x3d7b43,_0x4d58a6),_0x49d98e=_0x226dcf[_0x50ce96(0xfd)](_0x1eacda=>_0x1eacda['type']===_0x50ce96(0xd7))?await scanLocalBffFunctions(_0x3d7b43,_0x50ce96(0xd7)):_0x226dcf,_0x2dd27f=await buildHookMaps(_0x4d58a6[_0x50ce96(0xde)],_0x4d58a6[_0x50ce96(0xef)],_0x49d98e,_0x444cd5,_0x4d58a6['selectedAppName']||_0x4d58a6[_0x50ce96(0xdb)]?.[_0x50ce96(0xd8)]||_0x4d58a6[_0x50ce96(0xdb)]?.['defaultApp']),_0x3cf14b=_0x4d58a6[_0x50ce96(0xca)]('force'),_0x20a7c7=[];for(const _0x62787e of _0x226dcf){const _0x58b226=await computeFileHash(_0x62787e[_0x50ce96(0xce)]),_0x526afb=_0x444cd5[_0x50ce96(0x10a)][_0x62787e['lockKey']],_0x534323=!!_0x526afb&&_0x526afb[_0x50ce96(0xed)]===_0x58b226,_0x1c7397=_0x2dd27f[_0x50ce96(0x108)][_0x50ce96(0x103)](_0x62787e[_0x50ce96(0x112)]),_0x1b7159=!!_0x526afb?.[_0x50ce96(0xf4)]&&_0x526afb[_0x50ce96(0xbc)]==null&&(_0x3cf14b||!_0x534323),_0x2abb96=_0x1b7159?missingRemoteVersionConflict(_0x62787e,_0x526afb):undefined,_0x1412e6=_0x2dd27f[_0x50ce96(0x115)][_0x50ce96(0xb5)](_0x62787e[_0x50ce96(0x112)])?_0x50ce96(0x11b):!_0x3cf14b&&_0x534323?_0x50ce96(0x121):_0x2abb96?_0x50ce96(0xf1):_0x50ce96(0xcc);_0x20a7c7[_0x50ce96(0xea)]({'lockKey':_0x62787e[_0x50ce96(0x112)],'filePath':_0x62787e['filePath'],'remoteId':_0x526afb?.['remoteId']??null,'mode':_0x526afb?.['remoteId']?_0x50ce96(0xcf):_0x50ce96(0xb8),'status':_0x1412e6,..._0x2dd27f[_0x50ce96(0x115)][_0x50ce96(0xb5)](_0x62787e[_0x50ce96(0x112)])?{'error':_0x2dd27f[_0x50ce96(0x115)]['get'](_0x62787e[_0x50ce96(0x112)])}:{},..._0x2abb96?{'conflict':_0x2abb96}:{},..._0x2dd27f[_0x50ce96(0x10c)][_0x50ce96(0xb5)](_0x62787e[_0x50ce96(0x112)])?{'datasetCode':_0x526afb?.[_0x50ce96(0xc5)],'bindingPreserved':!![],'warnings':[existingHookWarning(_0x62787e['lockKey'])]}:{},..._0x1c7397?{'alias':_0x1c7397[_0x50ce96(0x105)]??null,'datasetCode':_0x1c7397[_0x50ce96(0xc5)],'operationType':_0x62787e[_0x50ce96(0xd9)],'functionNode':_0x62787e[_0x50ce96(0xbf)],'warnings':_0x1c7397[_0x50ce96(0x109)]}:{}});}return{'method':_0x50ce96(0xdd),'url':'/api/management/library/scripts/save','body':{'appCode':_0x4d58a6['appCode'],'force':_0x3cf14b,'files':_0x20a7c7,'cacheClearAtRuntime':_0x20a7c7['some'](_0x423093=>_0x423093[_0x50ce96(0xfc)]===_0x50ce96(0xcc)),'cacheClearAtRuntimeTimes':_0x20a7c7[_0x50ce96(0xfd)](_0x2a66df=>_0x2a66df[_0x50ce96(0xfc)]===_0x50ce96(0xcc))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x50ce96(0xda)+_0x20a7c7[_0x50ce96(0x100)]+_0x50ce96(0xdc)};},async 'execute'(_0xe95505){const _0x306b4e=a43_0x3b97bc,_0x26bd40=loadBffProjectConfig(_0xe95505['appCode']),_0x3ca318=await readBffLockFile(_0x26bd40['lockFilePath']),{lockData:_0x2c3f9b,appLock:_0x575f6d}=ensureLockScope(_0x3ca318??createEmptyBffLock(),_0xe95505['appCode'],_0x26bd40[_0x306b4e(0xf5)],_0x306b4e(0xea)),_0x40faf9=await getTargetFunctions(_0x26bd40,_0xe95505);if(_0x40faf9[_0x306b4e(0x100)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x306b4e(0x101)};const _0x14a059=_0xe95505[_0x306b4e(0xca)](_0x306b4e(0x111)),_0x4e8a94=JSON['parse'](JSON[_0x306b4e(0xf7)](_0x2c3f9b)),_0x494c4d=_0x4e8a94[_0x306b4e(0xd4)][_0xe95505[_0x306b4e(0xde)]];if(!_0x494c4d)throw new Error(_0x306b4e(0xf3)+_0xe95505[_0x306b4e(0xde)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x1a3341=_0x40faf9[_0x306b4e(0xfd)](_0x1281b4=>_0x1281b4[_0x306b4e(0x113)]===_0x306b4e(0xd7))?await scanLocalBffFunctions(_0x26bd40,'HOOK'):_0x40faf9,_0xd94f64=await buildHookMaps(_0xe95505[_0x306b4e(0xde)],_0xe95505[_0x306b4e(0xef)],_0x1a3341,_0x494c4d,_0xe95505[_0x306b4e(0xc2)]||_0xe95505[_0x306b4e(0xdb)]?.[_0x306b4e(0xd8)]||_0xe95505[_0x306b4e(0xdb)]?.[_0x306b4e(0xcb)]),_0x581e9f=[],_0x1034ce=[],_0x116842=[],_0x2b0fb1=[];for(const _0x3acaf5 of _0x40faf9){const _0xf9b8ff=_0xd94f64[_0x306b4e(0x115)]['get'](_0x3acaf5[_0x306b4e(0x112)]);if(_0xf9b8ff){_0x2b0fb1[_0x306b4e(0xea)]({'lockKey':_0x3acaf5[_0x306b4e(0x112)],'error':_0xf9b8ff});continue;}const _0x11b2d1=await computeFileHash(_0x3acaf5['filePath']),_0x293147=_0x494c4d[_0x306b4e(0x10a)][_0x3acaf5[_0x306b4e(0x112)]];if(!_0x14a059&&_0x293147&&_0x293147['hash']===_0x11b2d1){_0x1034ce['push']({'lockKey':_0x3acaf5[_0x306b4e(0x112)],'reason':_0x306b4e(0x121)});continue;}if(_0x293147?.[_0x306b4e(0xf4)]&&_0x293147[_0x306b4e(0xbc)]==null){_0x116842[_0x306b4e(0xea)](missingRemoteVersionConflict(_0x3acaf5,_0x293147));continue;}try{await uploadSingleFunction(_0xe95505[_0x306b4e(0xde)],_0x3acaf5,_0x494c4d,_0xd94f64);const _0x2f480d=_0x494c4d[_0x306b4e(0x10a)][_0x3acaf5[_0x306b4e(0x112)]];_0x581e9f[_0x306b4e(0xea)]({'lockKey':_0x3acaf5['lockKey'],'remoteId':_0x2f480d?.['remoteId']??0x0});}catch(_0x3f1bbd){const _0x110407=remoteVersionChangedConflict(_0x3acaf5,_0x293147,_0x3f1bbd);if(_0x110407){_0x116842['push'](_0x110407);continue;}_0x2b0fb1[_0x306b4e(0xea)]({'lockKey':_0x3acaf5[_0x306b4e(0x112)],'error':_0x3f1bbd instanceof Error?_0x3f1bbd[_0x306b4e(0xd5)]:String(_0x3f1bbd)});}}_0x494c4d[_0x306b4e(0x11d)]=new Date()['toISOString'](),await writeBffLockFile(_0x26bd40[_0x306b4e(0x11a)],_0x4e8a94),await waitForUploadedLockEntries(_0x26bd40[_0x306b4e(0x11a)],_0xe95505[_0x306b4e(0xde)],_0x581e9f[_0x306b4e(0xfe)](_0x18bcfa=>_0x18bcfa[_0x306b4e(0x112)]));let _0x5ca175={'attempted':![],'cleared':![]};if(_0x581e9f[_0x306b4e(0x100)]>0x0)try{let _0x5f2909='';for(let _0x1db719=0x0;_0x1db719<CACHE_CLEAR_ATTEMPTS;_0x1db719+=0x1){_0x5f2909=await clearBffScriptCache(),_0x1db719<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5ca175={'attempted':!![],'cleared':!![],'message':_0x5f2909||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x1e760f){_0x5ca175={'attempted':!![],'cleared':![],'error':_0x1e760f instanceof Error?_0x1e760f[_0x306b4e(0xd5)]:String(_0x1e760f)};}const _0x4be922=_0x2b0fb1[_0x306b4e(0x100)]===0x0&&(_0x5ca175[_0x306b4e(0xec)]?_0x5ca175[_0x306b4e(0xe2)]:!![]),_0x9964ac=_0x4be922,_0x73e5ba=_0x5ca175[_0x306b4e(0xec)]?_0x5ca175[_0x306b4e(0xe2)]?_0x306b4e(0xdf):_0x306b4e(0xe9):'runtime\x20cache\x20not\x20needed';return{'ok':_0x9964ac,'data':{'uploaded':_0x581e9f,'skipped':_0x1034ce,'conflicts':_0x116842,'failed':_0x2b0fb1,'cacheClear':_0x5ca175,'warnings':[...[..._0xd94f64['resolutions']['values']()][_0x306b4e(0x116)](_0x5db908=>_0x5db908['warnings']),...[..._0xd94f64[_0x306b4e(0x10c)]][_0x306b4e(0xfe)](existingHookWarning)]},'message':formatPushMessage(_0x581e9f[_0x306b4e(0x100)],_0x1034ce[_0x306b4e(0x100)],_0x116842[_0x306b4e(0x100)],_0x2b0fb1[_0x306b4e(0x100)],_0x73e5ba)};}};function missingRemoteVersionConflict(_0x2d0446,_0x1b0093){const _0x49f3bf=a43_0x3b97bc;return remoteVersionConflict(_0x2d0446,_0x1b0093,_0x49f3bf(0xc3),_0x49f3bf(0x120));}function remoteVersionChangedConflict(_0x594a55,_0x26b0e4,_0x393875){const _0x551139=a43_0x3b97bc;if(!_0x26b0e4?.[_0x551139(0xf4)]||_0x26b0e4[_0x551139(0xbc)]==null||!isRemoteVersionConflict(_0x393875))return undefined;return remoteVersionConflict(_0x594a55,_0x26b0e4,_0x551139(0x110),_0x551139(0xfb));}function remoteVersionConflict(_0x1cf124,_0x356bbb,_0x3cbda9,_0x2cf481){const _0x26312b=a43_0x3b97bc;return{'code':_0x3cbda9,'lockKey':_0x1cf124[_0x26312b(0x112)],'filePath':_0x1cf124[_0x26312b(0xce)],'remoteId':_0x356bbb[_0x26312b(0xf4)],..._0x356bbb[_0x26312b(0xbc)]!=null?{'expectedVersion':_0x356bbb[_0x26312b(0xbc)]}:{},'message':_0x2cf481,'nextAction':{'action':_0x26312b(0xd2),'command':CLI_BIN_NAME+_0x26312b(0xd1)+_0x356bbb[_0x26312b(0xf4)]+_0x26312b(0x102),'requiresReview':!![],'message':_0x26312b(0xb3)}};}function isRemoteVersionConflict(_0x317098){const _0x3a7622=a43_0x3b97bc,_0x759662=_0x317098 instanceof Error?_0x317098[_0x3a7622(0xd5)]:String(_0x317098),_0x53e81a=getPlatformErrorCode(_0x317098)??'';return[_0x759662,_0x53e81a][_0x3a7622(0xfd)](_0x156fc0=>/(?:version|optimistic)[\s_-]*(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)|(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)[\s_-]*(?:version|optimistic)/i['test'](_0x156fc0));}function formatPushMessage(_0x17f77d,_0x16eb1b,_0x412246,_0x44caf1,_0x54d168){const _0x582cd4=a43_0x3b97bc,_0x20cd98=[_0x582cd4(0xc6)+_0x17f77d+_0x582cd4(0xff),_0x16eb1b+'\x20skipped'];_0x412246>0x0&&_0x20cd98[_0x582cd4(0xea)](_0x412246+_0x582cd4(0x11e)+(_0x412246===0x1?'':'s')+'\x20'+(_0x412246===0x1?'requires':_0x582cd4(0xc1))+_0x582cd4(0xf0));if(_0x44caf1>0x0)_0x20cd98[_0x582cd4(0xea)](_0x44caf1+'\x20failed');return _0x20cd98[_0x582cd4(0xea)](_0x54d168),_0x20cd98[_0x582cd4(0xb6)](',\x20');}async function getTargetFunctions(_0x404ec0,_0x59ac89){const _0x4dad38=a43_0x3b97bc,_0x4690b6=_0x59ac89['str'](_0x4dad38(0x113)),_0x247ab2=_0x59ac89[_0x4dad38(0x10f)]('name'),_0x50823b=normalizeBffType(_0x4690b6)??undefined;if(_0x247ab2&&!_0x50823b)throw CliErrors[_0x4dad38(0x114)](_0x4dad38(0xbb));const _0x7da617=await scanLocalBffFunctions(_0x404ec0,_0x50823b);if(_0x247ab2){const _0x2bffbe=_0x7da617[_0x4dad38(0xb9)](_0x38f265=>_0x38f265[_0x4dad38(0xbd)]===_0x247ab2);if(_0x2bffbe[_0x4dad38(0x100)]===0x0)throw CliErrors['validation'](_0x4dad38(0x10e)+_0x50823b+'/'+_0x247ab2);return _0x2bffbe;}return _0x7da617;}function existingHookWarning(_0x223440){const _0x2d279b=a43_0x3b97bc;return{'code':_0x2d279b(0xe1),'lockKey':_0x223440,'message':_0x2d279b(0xc0)};}async function buildHookMaps(_0x497d1f,_0x466651,_0x5c0814,_0x380052,_0x4a68c0){const _0x24342c=a43_0x3b97bc,_0x3564fe=_0x5c0814[_0x24342c(0xfd)](_0x23f612=>_0x23f612[_0x24342c(0x113)]===_0x24342c(0xd7));if(!_0x3564fe)return{'resolutions':new Map(),'failures':new Map(),'existingHooks':new Set()};const _0x276c4d=resolveApiModelSource(_0x466651,_0x497d1f,_0x4a68c0),_0x4c0ea2=loadAliasMap(_0x466651,undefined,_0x276c4d[_0x24342c(0xce)],_0x276c4d[_0x24342c(0x119)]);assertUnambiguousHookAliases(_0x4c0ea2);const _0x44ec6e=[..._0x4c0ea2['map'](_0x51cf02=>[_0x51cf02[_0x24342c(0x105)],_0x51cf02['datasetCode']]),...trackedHookDirectoryMappings(_0x380052)[_0x24342c(0xfe)](_0x3c1bd5=>[_0x3c1bd5[_0x24342c(0x105)],_0x3c1bd5[_0x24342c(0xc5)]])],_0xca0ee9=await listDatasets(_0x497d1f);assertUnambiguousHookDirectoryMappings(_0x44ec6e['map'](([_0x229650,_0x37b18c])=>({'alias':_0x229650,'datasetCode':_0x37b18c})));const _0xea724d=buildHookDirectoryIndexes(_0xca0ee9,_0x44ec6e),_0x4e145b=new Map(),_0x228117=preflightPushHookDirectories(_0x5c0814,_0x380052,_0xea724d,_0x4e145b),_0xd65c70=new Set(),_0x585076=_0x5c0814['filter'](_0x262f1c=>_0x4e145b[_0x24342c(0x103)](_0x262f1c[_0x24342c(0x112)])?.[_0x24342c(0xbe)](_0x24342c(0x107))&&_0x380052['functions'][_0x262f1c[_0x24342c(0x112)]]?.[_0x24342c(0xf4)]&&_0x380052['functions'][_0x262f1c[_0x24342c(0x112)]]?.[_0x24342c(0xc5)]);if(_0x585076[_0x24342c(0x100)]>0x0){let _0x20c9bf;try{_0x20c9bf=await getBffScriptStatistics(_0x497d1f);}catch(_0x35e880){for(const _0x4f4dfd of _0x585076)_0x4e145b[_0x24342c(0xe0)](_0x4f4dfd['lockKey'],_0x24342c(0xcd)+(_0x35e880 instanceof Error?_0x35e880['message']:String(_0x35e880)));return{'resolutions':_0x228117,'failures':_0x4e145b,'existingHooks':_0xd65c70};}for(const _0x4cb223 of _0x585076){const _0x5b9c51=_0x380052[_0x24342c(0x10a)][_0x4cb223[_0x24342c(0x112)]];try{const _0xfbf923=new Set(_0x5c0814[_0x24342c(0xb9)](_0x5aaf1b=>_0x5aaf1b[_0x24342c(0x113)]==='HOOK'&&_0x380052[_0x24342c(0x10a)][_0x5aaf1b[_0x24342c(0x112)]]?.[_0x24342c(0xc5)]===_0x5b9c51['datasetCode'])['map'](_0x31f82b=>_0x31f82b['alias']));if(_0xfbf923[_0x24342c(0xd6)]>0x1)throw CliErrors[_0x24342c(0x114)]('Multiple\x20HOOK\x20directories\x20reference\x20the\x20same\x20missing\x20Dataset.\x20Resolve\x20duplicate\x20directories\x20before\x20pushing.');const _0x4190ba=_0x20c9bf[_0x24342c(0x116)](_0x5c6345=>[{'datasetCode':_0x5c6345['datasetCode'],'operationType':snakeToCamel(_0x5c6345['operationType']),'functionNode':_0x24342c(0xf9),'id':_0x5c6345['beforeScriptId']},{'datasetCode':_0x5c6345['datasetCode'],'operationType':snakeToCamel(_0x5c6345['operationType']),'functionNode':'after','id':_0x5c6345[_0x24342c(0xc9)]}])['filter'](_0x5d4bf3=>_0x5d4bf3['id']===_0x5b9c51['remoteId']),_0x465c77=await getBffScriptInfo(_0x5b9c51['remoteId']);if(_0x465c77['id']!==_0x5b9c51[_0x24342c(0xf4)]||_0x465c77[_0x24342c(0xde)]!==_0x497d1f||_0x465c77[_0x24342c(0x11f)]!==_0x24342c(0xd7)||_0x465c77[_0x24342c(0x11c)]!==_0x4cb223[_0x24342c(0xbd)]||_0x5b9c51['version']==null||_0x465c77[_0x24342c(0xbc)]!==_0x5b9c51[_0x24342c(0xbc)]||_0x4190ba[_0x24342c(0x100)]!==0x1||_0x4190ba[0x0][_0x24342c(0xc5)]!==_0x5b9c51['datasetCode']||_0x4190ba[0x0][_0x24342c(0xd9)]!==_0x4cb223[_0x24342c(0xd9)]||_0x4190ba[0x0][_0x24342c(0xbf)]!==_0x4cb223[_0x24342c(0xbf)]||_0x5b9c51['operationType']!==_0x4cb223[_0x24342c(0xd9)]||_0x5b9c51[_0x24342c(0xbf)]!==_0x4cb223[_0x24342c(0xbf)])throw CliErrors['validation'](_0x24342c(0x122));_0xd65c70['add'](_0x4cb223[_0x24342c(0x112)]),_0x4e145b[_0x24342c(0xee)](_0x4cb223[_0x24342c(0x112)]);}catch(_0x1de0ac){_0x4e145b[_0x24342c(0xe0)](_0x4cb223['lockKey'],_0x1de0ac instanceof Error?_0x1de0ac['message']:String(_0x1de0ac));}}}return{'resolutions':_0x228117,'failures':_0x4e145b,'existingHooks':_0xd65c70};}async function uploadSingleFunction(_0x6be797,_0x9f5290,_0x40fd0f,_0x1fc7df){const _0x1ee8fc=a43_0x3b97bc,_0x42d6e9=await readFile(_0x9f5290['filePath'],'utf8'),_0x4f2c7a=await computeFileHash(_0x9f5290[_0x1ee8fc(0xce)]),_0x30aad2=_0x40fd0f[_0x1ee8fc(0x10a)][_0x9f5290['lockKey']];if(_0x30aad2?.[_0x1ee8fc(0xf4)]&&_0x30aad2[_0x1ee8fc(0xbc)]==null)throw CliErrors[_0x1ee8fc(0x114)](_0x9f5290[_0x1ee8fc(0x112)]+_0x1ee8fc(0xd0));let _0x4e74bf=extractScriptDescription(_0x42d6e9);if(!_0x4e74bf&&_0x30aad2?.[_0x1ee8fc(0xf4)]){const _0x99ae4=await getBffScriptInfo(_0x30aad2[_0x1ee8fc(0xf4)]);_0x4e74bf=_0x99ae4['description']||undefined;}const _0x470d93={'appCode':_0x6be797,'functionName':_0x9f5290['name'],'scriptType':_0x9f5290[_0x1ee8fc(0x113)],'scriptContent':_0x42d6e9};if(_0x30aad2?.[_0x1ee8fc(0xf4)])_0x470d93['id']=_0x30aad2[_0x1ee8fc(0xf4)];if(_0x30aad2?.['version']!=null)_0x470d93[_0x1ee8fc(0xbc)]=_0x30aad2[_0x1ee8fc(0xbc)];if(_0x4e74bf)_0x470d93[_0x1ee8fc(0xba)]=_0x4e74bf;if(_0x9f5290['type']===_0x1ee8fc(0xd7)){const _0x490190=_0x1fc7df['resolutions'][_0x1ee8fc(0x103)](_0x9f5290[_0x1ee8fc(0x112)]);if(!_0x490190&&!_0x1fc7df[_0x1ee8fc(0x10c)][_0x1ee8fc(0xb5)](_0x9f5290[_0x1ee8fc(0x112)])||!_0x9f5290[_0x1ee8fc(0xd9)]||!_0x9f5290[_0x1ee8fc(0xbf)])throw CliErrors[_0x1ee8fc(0x114)](_0x1ee8fc(0xc7)+_0x9f5290[_0x1ee8fc(0x112)]);_0x490190&&(_0x470d93[_0x1ee8fc(0xc8)]=_0x490190[_0x1ee8fc(0xf6)]['id'],_0x470d93[_0x1ee8fc(0xd9)]=_0x9f5290[_0x1ee8fc(0xd9)]),_0x470d93[_0x1ee8fc(0xbf)]=_0x9f5290[_0x1ee8fc(0xbf)];}const _0x56b08d=await saveBffScript(_0x470d93),_0x491e1e=_0x56b08d['id'],_0x7a073b=_0x56b08d[_0x1ee8fc(0xe8)]??await getBffScriptInfo(_0x491e1e),_0x27730f={'hash':_0x4f2c7a,'remoteId':_0x491e1e,'version':_0x7a073b['version']};if(_0x9f5290[_0x1ee8fc(0x113)]===_0x1ee8fc(0xd7)){const _0x49e8bf=_0x1fc7df['resolutions'][_0x1ee8fc(0x103)](_0x9f5290['lockKey']);if(!_0x49e8bf){_0x40fd0f[_0x1ee8fc(0x10a)][_0x9f5290['lockKey']]={..._0x30aad2,..._0x27730f};return;}_0x27730f['alias']=_0x49e8bf[_0x1ee8fc(0x105)]??_0x30aad2?.['alias'],_0x27730f[_0x1ee8fc(0xc5)]=_0x49e8bf[_0x1ee8fc(0xc5)],_0x27730f['operationType']=_0x9f5290['operationType'],_0x27730f[_0x1ee8fc(0xbf)]=_0x9f5290[_0x1ee8fc(0xbf)];}_0x40fd0f[_0x1ee8fc(0x10a)][_0x9f5290[_0x1ee8fc(0x112)]]=_0x27730f;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x4858b2,_0x34d0bc,_0x8ea953){const _0xc17c8f=a43_0x3b97bc;if(_0x8ea953[_0xc17c8f(0x100)]===0x0)return;for(let _0x54ff15=0x0;_0x54ff15<LOCK_SETTLE_RETRY_COUNT;_0x54ff15+=0x1){const _0x36355f=await readBffLockFile(_0x4858b2),_0x27549b=_0x36355f?.[_0xc17c8f(0xd4)]?.[_0x34d0bc]?.[_0xc17c8f(0x10a)]??{},_0x489468=_0x8ea953[_0xc17c8f(0x117)](_0x1a5f8f=>!!_0x27549b[_0x1a5f8f]?.[_0xc17c8f(0xf4)]);if(_0x489468)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0xc17c8f(0xfa)+_0x8ea953[_0xc17c8f(0xb6)](',\x20')+'.');}
|
|
1
|
+
const a43_0x19170a=a43_0x3e32;(function(_0x52a9b9,_0x580794){const _0x5df076=a43_0x3e32,_0x5222a5=_0x52a9b9();while(!![]){try{const _0x4b749e=-parseInt(_0x5df076(0x137))/0x1*(-parseInt(_0x5df076(0xdf))/0x2)+-parseInt(_0x5df076(0xd7))/0x3*(parseInt(_0x5df076(0x11b))/0x4)+parseInt(_0x5df076(0x12d))/0x5*(-parseInt(_0x5df076(0x136))/0x6)+parseInt(_0x5df076(0xe3))/0x7*(parseInt(_0x5df076(0xd3))/0x8)+-parseInt(_0x5df076(0x115))/0x9+parseInt(_0x5df076(0xcf))/0xa+-parseInt(_0x5df076(0xf3))/0xb*(-parseInt(_0x5df076(0x116))/0xc);if(_0x4b749e===_0x580794)break;else _0x5222a5['push'](_0x5222a5['shift']());}catch(_0x22752c){_0x5222a5['push'](_0x5222a5['shift']());}}}(a43_0x5d43,0x47cd0));import{readFile}from'node:fs/promises';function a43_0x3e32(_0x493e38,_0x4a5ae7){_0x493e38=_0x493e38-0xce;const _0x5d435c=a43_0x5d43();let _0x3e321d=_0x5d435c[_0x493e38];return _0x3e321d;}import{saveBffScript,getBffScriptInfo,getBffScriptStatistics,getPlatformErrorCode,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{buildHookDirectoryIndexes,assertUnambiguousHookAliases,assertUnambiguousHookDirectoryMappings,preflightPushHookDirectories,trackedHookDirectoryMappings}from'../../core/bff/hook-directory.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription,snakeToCamel}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a43_0x5d43(){const _0x3d80de=['selectedAppName','version','bool','alias','1088574xilnRG','1QLbzcY','flatMap','test','status','get','4980780ZwGsrP','runtime\x20cache\x20clear\x20failed','Would\x20inspect\x20','datasetId','1188392xxNabf','every','join','scriptType','3sVRfGv',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','\x20failed','appCode','lockKey','update','unchanged','\x20--format\x20compress','43138MiGays','Cannot\x20verify\x20existing\x20HOOK\x20binding:\x20','require','Multiple\x20HOOK\x20directories\x20reference\x20the\x20same\x20missing\x20Dataset.\x20Resolve\x20duplicate\x20directories\x20before\x20pushing.','21cyShlA','scriptsRoot','BFF_REMOTE_VERSION_CHANGED','str','name','size','description','\x20resolution','apps','Remote\x20script\x20version\x20changed\x20since\x20the\x20last\x20pull.','\x20bff\x20detail\x20--id\x20','defaultApp','before','bff','add','has','66JDiwOA','operationType','stringify','mergedCli','lastSync','remoteId','/api/management/library/scripts/save','Local\x20function\x20not\x20found:\x20','failures','requires','currentApp','filter','utf8','cleared','after','startsWith','attempted','functionName','Push\x20complete:\x20','Dataset\x20metadata\x20is\x20unavailable;\x20the\x20existing\x20script\x20and\x20binding\x20were\x20verified.\x20Update\x20by\x20script\x20ID\x20without\x20rebinding.','HOOK','length','failed','string','\x22\x20not\x20found\x20after\x20ensureLockScope.','datasetCode','validation','force','apiDir','push','resolutions','lockFilePath','message','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','3604509YpPstP','650196ESfbXw','would_push','\x20skipped','afterScriptId','Existing\x20HOOK\x20identity,\x20version\x20or\x20binding\x20does\x20not\x20match\x20the\x20local\x20lock.\x20Pull\x20and\x20review\x20before\x20pushing.','931748mUrjNo','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','map','warnings','set','POST','existingHooks','values','script','beforeScriptId','runtime\x20cache\x20cleared','functions','functionNode','type','dataset','The\x20local\x20sync\x20lock\x20has\x20no\x20remote\x20version\x20for\x20this\x20script.','Force\x20push\x20ignoring\x20hash\x20protection','hash','10tvTqYu','No\x20local\x20Backend\x20Function\x20scripts\x20found.','some','COMMON','filePath'];a43_0x5d43=function(){return _0x3d80de;};return a43_0x5d43();}import{CliErrors}from'../../errors.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a43_0x19170a(0xf0),'command':a43_0x19170a(0x110),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':'write','structuredErrors':!![],'flags':[{'name':a43_0x19170a(0x128),'type':a43_0x19170a(0x10a),'description':'Push\x20only\x20this\x20script\x20type','enum':[a43_0x19170a(0x130),'ENDPOINT',a43_0x19170a(0x107)]},{'name':a43_0x19170a(0xe7),'type':'string','description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':'force','type':'boolean','description':a43_0x19170a(0x12b)}],async 'dryRun'(_0x33a350){const _0x71bb51=a43_0x19170a,_0x482880=loadBffProjectConfig(_0x33a350['appCode']),_0x2817a3=await readBffLockFile(_0x482880[_0x71bb51(0x112)]),{appLock:_0x9530d2}=ensureLockScope(_0x2817a3??createEmptyBffLock(),_0x33a350[_0x71bb51(0xda)],_0x482880[_0x71bb51(0xe4)],_0x71bb51(0x110)),_0xb10108=await getTargetFunctions(_0x482880,_0x33a350),_0xd5e0ae=_0xb10108[_0x71bb51(0x12f)](_0x65b5d4=>_0x65b5d4[_0x71bb51(0x128)]===_0x71bb51(0x107))?await scanLocalBffFunctions(_0x482880,_0x71bb51(0x107)):_0xb10108,_0x6b02c7=await buildHookMaps(_0x33a350[_0x71bb51(0xda)],_0x33a350['apiDir'],_0xd5e0ae,_0x9530d2,_0x33a350[_0x71bb51(0x132)]||_0x33a350['mergedCli']?.[_0x71bb51(0xfd)]||_0x33a350[_0x71bb51(0xf6)]?.[_0x71bb51(0xee)]),_0x1bf8c3=_0x33a350[_0x71bb51(0x134)](_0x71bb51(0x10e)),_0x28bea9=[];for(const _0x20ae30 of _0xb10108){const _0x20814a=await computeFileHash(_0x20ae30[_0x71bb51(0x131)]),_0x42779e=_0x9530d2['functions'][_0x20ae30[_0x71bb51(0xdb)]],_0x3d3c5f=!!_0x42779e&&_0x42779e[_0x71bb51(0x12c)]===_0x20814a,_0x537595=_0x6b02c7[_0x71bb51(0x111)][_0x71bb51(0xce)](_0x20ae30[_0x71bb51(0xdb)]),_0x9dcb77=!!_0x42779e?.[_0x71bb51(0xf8)]&&_0x42779e[_0x71bb51(0x133)]==null&&(_0x1bf8c3||!_0x3d3c5f),_0x1bb6a9=_0x9dcb77?missingRemoteVersionConflict(_0x20ae30,_0x42779e):undefined,_0x3e2bf7=_0x6b02c7[_0x71bb51(0xfb)]['has'](_0x20ae30[_0x71bb51(0xdb)])?_0x71bb51(0x109):!_0x1bf8c3&&_0x3d3c5f?_0x71bb51(0xdd):_0x1bb6a9?'conflict':_0x71bb51(0x117);_0x28bea9['push']({'lockKey':_0x20ae30[_0x71bb51(0xdb)],'filePath':_0x20ae30[_0x71bb51(0x131)],'remoteId':_0x42779e?.[_0x71bb51(0xf8)]??null,'mode':_0x42779e?.['remoteId']?_0x71bb51(0xdc):'create','status':_0x3e2bf7,..._0x6b02c7[_0x71bb51(0xfb)][_0x71bb51(0xf2)](_0x20ae30[_0x71bb51(0xdb)])?{'error':_0x6b02c7[_0x71bb51(0xfb)][_0x71bb51(0xce)](_0x20ae30[_0x71bb51(0xdb)])}:{},..._0x1bb6a9?{'conflict':_0x1bb6a9}:{},..._0x6b02c7[_0x71bb51(0x121)][_0x71bb51(0xf2)](_0x20ae30[_0x71bb51(0xdb)])?{'datasetCode':_0x42779e?.[_0x71bb51(0x10c)],'bindingPreserved':!![],'warnings':[existingHookWarning(_0x20ae30[_0x71bb51(0xdb)])]}:{},..._0x537595?{'alias':_0x537595[_0x71bb51(0x135)]??null,'datasetCode':_0x537595['datasetCode'],'operationType':_0x20ae30[_0x71bb51(0xf4)],'functionNode':_0x20ae30[_0x71bb51(0x127)],'warnings':_0x537595[_0x71bb51(0x11e)]}:{}});}return{'method':_0x71bb51(0x120),'url':_0x71bb51(0xf9),'body':{'appCode':_0x33a350[_0x71bb51(0xda)],'force':_0x1bf8c3,'files':_0x28bea9,'cacheClearAtRuntime':_0x28bea9[_0x71bb51(0x12f)](_0x4cc6f7=>_0x4cc6f7[_0x71bb51(0x13a)]===_0x71bb51(0x117)),'cacheClearAtRuntimeTimes':_0x28bea9[_0x71bb51(0x12f)](_0x1340ef=>_0x1340ef['status']===_0x71bb51(0x117))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x71bb51(0xd1)+_0x28bea9[_0x71bb51(0x108)]+_0x71bb51(0x11c)};},async 'execute'(_0x2a067b){const _0x1c9e9a=a43_0x19170a,_0x5a5ae4=loadBffProjectConfig(_0x2a067b[_0x1c9e9a(0xda)]),_0x2541ab=await readBffLockFile(_0x5a5ae4['lockFilePath']),{lockData:_0x5ebb59,appLock:_0x135b32}=ensureLockScope(_0x2541ab??createEmptyBffLock(),_0x2a067b[_0x1c9e9a(0xda)],_0x5a5ae4[_0x1c9e9a(0xe4)],_0x1c9e9a(0x110)),_0x4cbd54=await getTargetFunctions(_0x5a5ae4,_0x2a067b);if(_0x4cbd54['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x1c9e9a(0x12e)};const _0x34063f=_0x2a067b['bool']('force'),_0x2a7c62=JSON['parse'](JSON[_0x1c9e9a(0xf5)](_0x5ebb59)),_0x13e24d=_0x2a7c62[_0x1c9e9a(0xeb)][_0x2a067b[_0x1c9e9a(0xda)]];if(!_0x13e24d)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x2a067b['appCode']+_0x1c9e9a(0x10b));const _0x59012e=_0x4cbd54['some'](_0x224b66=>_0x224b66[_0x1c9e9a(0x128)]==='HOOK')?await scanLocalBffFunctions(_0x5a5ae4,_0x1c9e9a(0x107)):_0x4cbd54,_0x16543f=await buildHookMaps(_0x2a067b[_0x1c9e9a(0xda)],_0x2a067b[_0x1c9e9a(0x10f)],_0x59012e,_0x13e24d,_0x2a067b[_0x1c9e9a(0x132)]||_0x2a067b[_0x1c9e9a(0xf6)]?.[_0x1c9e9a(0xfd)]||_0x2a067b[_0x1c9e9a(0xf6)]?.['defaultApp']),_0x431b07=[],_0xdf9b56=[],_0x5b87cb=[],_0x15ca5c=[];for(const _0x24b303 of _0x4cbd54){const _0x4c19c3=_0x16543f[_0x1c9e9a(0xfb)][_0x1c9e9a(0xce)](_0x24b303['lockKey']);if(_0x4c19c3){_0x15ca5c[_0x1c9e9a(0x110)]({'lockKey':_0x24b303[_0x1c9e9a(0xdb)],'error':_0x4c19c3});continue;}const _0x20de99=await computeFileHash(_0x24b303[_0x1c9e9a(0x131)]),_0x5e4356=_0x13e24d['functions'][_0x24b303[_0x1c9e9a(0xdb)]];if(!_0x34063f&&_0x5e4356&&_0x5e4356[_0x1c9e9a(0x12c)]===_0x20de99){_0xdf9b56[_0x1c9e9a(0x110)]({'lockKey':_0x24b303['lockKey'],'reason':'unchanged'});continue;}if(_0x5e4356?.[_0x1c9e9a(0xf8)]&&_0x5e4356[_0x1c9e9a(0x133)]==null){_0x5b87cb[_0x1c9e9a(0x110)](missingRemoteVersionConflict(_0x24b303,_0x5e4356));continue;}try{await uploadSingleFunction(_0x2a067b['appCode'],_0x24b303,_0x13e24d,_0x16543f);const _0x1e8503=_0x13e24d[_0x1c9e9a(0x126)][_0x24b303[_0x1c9e9a(0xdb)]];_0x431b07[_0x1c9e9a(0x110)]({'lockKey':_0x24b303[_0x1c9e9a(0xdb)],'remoteId':_0x1e8503?.[_0x1c9e9a(0xf8)]??0x0});}catch(_0x26ba48){const _0x3df8e1=remoteVersionChangedConflict(_0x24b303,_0x5e4356,_0x26ba48);if(_0x3df8e1){_0x5b87cb['push'](_0x3df8e1);continue;}_0x15ca5c[_0x1c9e9a(0x110)]({'lockKey':_0x24b303[_0x1c9e9a(0xdb)],'error':_0x26ba48 instanceof Error?_0x26ba48['message']:String(_0x26ba48)});}}_0x13e24d[_0x1c9e9a(0xf7)]=new Date()['toISOString'](),await writeBffLockFile(_0x5a5ae4['lockFilePath'],_0x2a7c62),await waitForUploadedLockEntries(_0x5a5ae4[_0x1c9e9a(0x112)],_0x2a067b[_0x1c9e9a(0xda)],_0x431b07[_0x1c9e9a(0x11d)](_0x2699cb=>_0x2699cb['lockKey']));let _0x548160={'attempted':![],'cleared':![]};if(_0x431b07[_0x1c9e9a(0x108)]>0x0)try{let _0x9f5390='';for(let _0x1b9980=0x0;_0x1b9980<CACHE_CLEAR_ATTEMPTS;_0x1b9980+=0x1){_0x9f5390=await clearBffScriptCache(),_0x1b9980<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x548160={'attempted':!![],'cleared':!![],'message':_0x9f5390||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x2676e0){_0x548160={'attempted':!![],'cleared':![],'error':_0x2676e0 instanceof Error?_0x2676e0[_0x1c9e9a(0x113)]:String(_0x2676e0)};}const _0xcc0ddf=_0x15ca5c[_0x1c9e9a(0x108)]===0x0&&(_0x548160[_0x1c9e9a(0x103)]?_0x548160[_0x1c9e9a(0x100)]:!![]),_0x5429a4=_0xcc0ddf,_0x37920d=_0x548160[_0x1c9e9a(0x103)]?_0x548160[_0x1c9e9a(0x100)]?_0x1c9e9a(0x125):_0x1c9e9a(0xd0):'runtime\x20cache\x20not\x20needed';return{'ok':_0x5429a4,'data':{'uploaded':_0x431b07,'skipped':_0xdf9b56,'conflicts':_0x5b87cb,'failed':_0x15ca5c,'cacheClear':_0x548160,'warnings':[...[..._0x16543f[_0x1c9e9a(0x111)][_0x1c9e9a(0x122)]()][_0x1c9e9a(0x138)](_0x4049c0=>_0x4049c0[_0x1c9e9a(0x11e)]),...[..._0x16543f[_0x1c9e9a(0x121)]][_0x1c9e9a(0x11d)](existingHookWarning)]},'message':formatPushMessage(_0x431b07['length'],_0xdf9b56['length'],_0x5b87cb['length'],_0x15ca5c[_0x1c9e9a(0x108)],_0x37920d)};}};function missingRemoteVersionConflict(_0x54ba2e,_0xa4c5fe){const _0x26ea2b=a43_0x19170a;return remoteVersionConflict(_0x54ba2e,_0xa4c5fe,'BFF_REMOTE_VERSION_MISSING',_0x26ea2b(0x12a));}function remoteVersionChangedConflict(_0x287fa0,_0xa18d72,_0x29b9ce){const _0x5c8731=a43_0x19170a;if(!_0xa18d72?.[_0x5c8731(0xf8)]||_0xa18d72[_0x5c8731(0x133)]==null||!isRemoteVersionConflict(_0x29b9ce))return undefined;return remoteVersionConflict(_0x287fa0,_0xa18d72,_0x5c8731(0xe5),_0x5c8731(0xec));}function remoteVersionConflict(_0x49d23f,_0x262085,_0x13a638,_0x37ca17){const _0x575eca=a43_0x19170a;return{'code':_0x13a638,'lockKey':_0x49d23f['lockKey'],'filePath':_0x49d23f['filePath'],'remoteId':_0x262085[_0x575eca(0xf8)],..._0x262085['version']!=null?{'expectedVersion':_0x262085[_0x575eca(0x133)]}:{},'message':_0x37ca17,'nextAction':{'action':'review_remote_and_merge','command':CLI_BIN_NAME+_0x575eca(0xed)+_0x262085[_0x575eca(0xf8)]+_0x575eca(0xde),'requiresReview':!![],'message':'Review\x20the\x20current\x20remote\x20source,\x20merge\x20it\x20into\x20the\x20local\x20script,\x20then\x20retry\x20push.\x20Do\x20not\x20use\x20--force\x20unless\x20you\x20intentionally\x20discard\x20local\x20changes.'}};}function isRemoteVersionConflict(_0x3b1263){const _0x5b98b2=a43_0x19170a,_0x2f4b8a=_0x3b1263 instanceof Error?_0x3b1263['message']:String(_0x3b1263),_0x130f09=getPlatformErrorCode(_0x3b1263)??'';return[_0x2f4b8a,_0x130f09]['some'](_0x1ba7e2=>/(?:version|optimistic)[\s_-]*(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)|(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)[\s_-]*(?:version|optimistic)/i[_0x5b98b2(0x139)](_0x1ba7e2));}function formatPushMessage(_0x3ec7da,_0x5cfe95,_0x355e08,_0x243278,_0x3b4e7c){const _0x2bf086=a43_0x19170a,_0x51cad6=[_0x2bf086(0x105)+_0x3ec7da+'\x20uploaded',_0x5cfe95+_0x2bf086(0x118)];_0x355e08>0x0&&_0x51cad6[_0x2bf086(0x110)](_0x355e08+'\x20conflict'+(_0x355e08===0x1?'':'s')+'\x20'+(_0x355e08===0x1?_0x2bf086(0xfc):_0x2bf086(0xe1))+_0x2bf086(0xea));if(_0x243278>0x0)_0x51cad6[_0x2bf086(0x110)](_0x243278+_0x2bf086(0xd9));return _0x51cad6[_0x2bf086(0x110)](_0x3b4e7c),_0x51cad6['join'](',\x20');}async function getTargetFunctions(_0x31c89c,_0x2bda5e){const _0x2d3e28=a43_0x19170a,_0x29072e=_0x2bda5e[_0x2d3e28(0xe6)]('type'),_0x1b67a3=_0x2bda5e[_0x2d3e28(0xe6)]('name'),_0x1a1fb3=normalizeBffType(_0x29072e)??undefined;if(_0x1b67a3&&!_0x1a1fb3)throw CliErrors['validation'](_0x2d3e28(0x114));const _0x91a68d=await scanLocalBffFunctions(_0x31c89c,_0x1a1fb3);if(_0x1b67a3){const _0x411a21=_0x91a68d[_0x2d3e28(0xfe)](_0x42be65=>_0x42be65[_0x2d3e28(0xe7)]===_0x1b67a3);if(_0x411a21[_0x2d3e28(0x108)]===0x0)throw CliErrors[_0x2d3e28(0x10d)](_0x2d3e28(0xfa)+_0x1a1fb3+'/'+_0x1b67a3);return _0x411a21;}return _0x91a68d;}function existingHookWarning(_0x34ae6c){const _0x48b867=a43_0x19170a;return{'code':'EXISTING_HOOK_BINDING_PRESERVED','lockKey':_0x34ae6c,'message':_0x48b867(0x106)};}async function buildHookMaps(_0x7ceb8d,_0x4d1180,_0x13069c,_0x57833d,_0xb2d053){const _0x3d5f6c=a43_0x19170a,_0x4b8c97=_0x13069c[_0x3d5f6c(0x12f)](_0x3be54d=>_0x3be54d['type']===_0x3d5f6c(0x107));if(!_0x4b8c97)return{'resolutions':new Map(),'failures':new Map(),'existingHooks':new Set()};const _0x1bcf8d=resolveApiModelSource(_0x4d1180,_0x7ceb8d,_0xb2d053),_0x261df9=loadAliasMap(_0x4d1180,undefined,_0x1bcf8d['filePath'],_0x1bcf8d['profileName']);assertUnambiguousHookAliases(_0x261df9);const _0x2bab9a=[..._0x261df9[_0x3d5f6c(0x11d)](_0x224d54=>[_0x224d54[_0x3d5f6c(0x135)],_0x224d54[_0x3d5f6c(0x10c)]]),...trackedHookDirectoryMappings(_0x57833d)[_0x3d5f6c(0x11d)](_0x770168=>[_0x770168[_0x3d5f6c(0x135)],_0x770168['datasetCode']])],_0x347fba=await listDatasets(_0x7ceb8d);assertUnambiguousHookDirectoryMappings(_0x2bab9a[_0x3d5f6c(0x11d)](([_0xd6763a,_0x53cb9c])=>({'alias':_0xd6763a,'datasetCode':_0x53cb9c})));const _0x10778a=buildHookDirectoryIndexes(_0x347fba,_0x2bab9a),_0x46e092=new Map(),_0x245511=preflightPushHookDirectories(_0x13069c,_0x57833d,_0x10778a,_0x46e092),_0x22b61e=new Set(),_0x102941=_0x13069c['filter'](_0x595149=>_0x46e092[_0x3d5f6c(0xce)](_0x595149[_0x3d5f6c(0xdb)])?.[_0x3d5f6c(0x102)]('HOOK_DATASET_NOT_FOUND:')&&_0x57833d[_0x3d5f6c(0x126)][_0x595149[_0x3d5f6c(0xdb)]]?.[_0x3d5f6c(0xf8)]&&_0x57833d['functions'][_0x595149[_0x3d5f6c(0xdb)]]?.['datasetCode']);if(_0x102941[_0x3d5f6c(0x108)]>0x0){let _0x4aa2d9;try{_0x4aa2d9=await getBffScriptStatistics(_0x7ceb8d);}catch(_0x4bdb95){for(const _0xeccc48 of _0x102941)_0x46e092[_0x3d5f6c(0x11f)](_0xeccc48[_0x3d5f6c(0xdb)],_0x3d5f6c(0xe0)+(_0x4bdb95 instanceof Error?_0x4bdb95[_0x3d5f6c(0x113)]:String(_0x4bdb95)));return{'resolutions':_0x245511,'failures':_0x46e092,'existingHooks':_0x22b61e};}for(const _0x5e11a5 of _0x102941){const _0x5b10e5=_0x57833d[_0x3d5f6c(0x126)][_0x5e11a5['lockKey']];try{const _0x850f33=new Set(_0x13069c[_0x3d5f6c(0xfe)](_0x4f180b=>_0x4f180b[_0x3d5f6c(0x128)]===_0x3d5f6c(0x107)&&_0x57833d[_0x3d5f6c(0x126)][_0x4f180b[_0x3d5f6c(0xdb)]]?.['datasetCode']===_0x5b10e5[_0x3d5f6c(0x10c)])[_0x3d5f6c(0x11d)](_0x18c504=>_0x18c504[_0x3d5f6c(0x135)]));if(_0x850f33[_0x3d5f6c(0xe8)]>0x1)throw CliErrors['validation'](_0x3d5f6c(0xe2));const _0x443303=_0x4aa2d9[_0x3d5f6c(0x138)](_0x1f84f9=>[{'datasetCode':_0x1f84f9['datasetCode'],'operationType':snakeToCamel(_0x1f84f9[_0x3d5f6c(0xf4)]),'functionNode':_0x3d5f6c(0xef),'id':_0x1f84f9[_0x3d5f6c(0x124)]},{'datasetCode':_0x1f84f9[_0x3d5f6c(0x10c)],'operationType':snakeToCamel(_0x1f84f9[_0x3d5f6c(0xf4)]),'functionNode':_0x3d5f6c(0x101),'id':_0x1f84f9[_0x3d5f6c(0x119)]}])['filter'](_0x3d4950=>_0x3d4950['id']===_0x5b10e5[_0x3d5f6c(0xf8)]),_0x51f7b8=await getBffScriptInfo(_0x5b10e5['remoteId']);if(_0x51f7b8['id']!==_0x5b10e5[_0x3d5f6c(0xf8)]||_0x51f7b8['appCode']!==_0x7ceb8d||_0x51f7b8[_0x3d5f6c(0xd6)]!=='HOOK'||_0x51f7b8[_0x3d5f6c(0x104)]!==_0x5e11a5[_0x3d5f6c(0xe7)]||_0x5b10e5[_0x3d5f6c(0x133)]==null||_0x51f7b8['version']!==_0x5b10e5[_0x3d5f6c(0x133)]||_0x443303[_0x3d5f6c(0x108)]!==0x1||_0x443303[0x0][_0x3d5f6c(0x10c)]!==_0x5b10e5[_0x3d5f6c(0x10c)]||_0x443303[0x0][_0x3d5f6c(0xf4)]!==_0x5e11a5[_0x3d5f6c(0xf4)]||_0x443303[0x0][_0x3d5f6c(0x127)]!==_0x5e11a5['functionNode']||_0x5b10e5[_0x3d5f6c(0xf4)]!==_0x5e11a5[_0x3d5f6c(0xf4)]||_0x5b10e5['functionNode']!==_0x5e11a5['functionNode'])throw CliErrors['validation'](_0x3d5f6c(0x11a));_0x22b61e[_0x3d5f6c(0xf1)](_0x5e11a5['lockKey']),_0x46e092['delete'](_0x5e11a5[_0x3d5f6c(0xdb)]);}catch(_0x59a574){_0x46e092[_0x3d5f6c(0x11f)](_0x5e11a5[_0x3d5f6c(0xdb)],_0x59a574 instanceof Error?_0x59a574[_0x3d5f6c(0x113)]:String(_0x59a574));}}}return{'resolutions':_0x245511,'failures':_0x46e092,'existingHooks':_0x22b61e};}async function uploadSingleFunction(_0x583d27,_0x3c5298,_0x5874b6,_0x460eec){const _0x516224=a43_0x19170a,_0x322f45=await readFile(_0x3c5298[_0x516224(0x131)],_0x516224(0xff)),_0x34f18a=await computeFileHash(_0x3c5298[_0x516224(0x131)]),_0x460089=_0x5874b6[_0x516224(0x126)][_0x3c5298[_0x516224(0xdb)]];if(_0x460089?.[_0x516224(0xf8)]&&_0x460089['version']==null)throw CliErrors[_0x516224(0x10d)](_0x3c5298[_0x516224(0xdb)]+_0x516224(0xd8));let _0x2d74bf=extractScriptDescription(_0x322f45);if(!_0x2d74bf&&_0x460089?.[_0x516224(0xf8)]){const _0x3d92c4=await getBffScriptInfo(_0x460089[_0x516224(0xf8)]);_0x2d74bf=_0x3d92c4[_0x516224(0xe9)]||undefined;}const _0x5af514={'appCode':_0x583d27,'functionName':_0x3c5298[_0x516224(0xe7)],'scriptType':_0x3c5298[_0x516224(0x128)],'scriptContent':_0x322f45};if(_0x460089?.[_0x516224(0xf8)])_0x5af514['id']=_0x460089[_0x516224(0xf8)];if(_0x460089?.[_0x516224(0x133)]!=null)_0x5af514[_0x516224(0x133)]=_0x460089[_0x516224(0x133)];if(_0x2d74bf)_0x5af514[_0x516224(0xe9)]=_0x2d74bf;if(_0x3c5298[_0x516224(0x128)]===_0x516224(0x107)){const _0x450f9f=_0x460eec['resolutions']['get'](_0x3c5298[_0x516224(0xdb)]);if(!_0x450f9f&&!_0x460eec[_0x516224(0x121)][_0x516224(0xf2)](_0x3c5298[_0x516224(0xdb)])||!_0x3c5298[_0x516224(0xf4)]||!_0x3c5298['functionNode'])throw CliErrors['validation']('Incomplete\x20HOOK\x20path:\x20'+_0x3c5298[_0x516224(0xdb)]);_0x450f9f&&(_0x5af514[_0x516224(0xd2)]=_0x450f9f[_0x516224(0x129)]['id'],_0x5af514[_0x516224(0xf4)]=_0x3c5298[_0x516224(0xf4)]),_0x5af514['functionNode']=_0x3c5298[_0x516224(0x127)];}const _0x44868a=await saveBffScript(_0x5af514),_0xc8f481=_0x44868a['id'],_0x391e19=_0x44868a[_0x516224(0x123)]??await getBffScriptInfo(_0xc8f481),_0x26eae7={'hash':_0x34f18a,'remoteId':_0xc8f481,'version':_0x391e19[_0x516224(0x133)]};if(_0x3c5298[_0x516224(0x128)]===_0x516224(0x107)){const _0xabc19c=_0x460eec['resolutions'][_0x516224(0xce)](_0x3c5298[_0x516224(0xdb)]);if(!_0xabc19c){_0x5874b6[_0x516224(0x126)][_0x3c5298['lockKey']]={..._0x460089,..._0x26eae7};return;}_0x26eae7['alias']=_0xabc19c[_0x516224(0x135)]??_0x460089?.[_0x516224(0x135)],_0x26eae7['datasetCode']=_0xabc19c[_0x516224(0x10c)],_0x26eae7[_0x516224(0xf4)]=_0x3c5298[_0x516224(0xf4)],_0x26eae7[_0x516224(0x127)]=_0x3c5298[_0x516224(0x127)];}_0x5874b6[_0x516224(0x126)][_0x3c5298[_0x516224(0xdb)]]=_0x26eae7;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x298dc4,_0x19123f,_0x3c0f1b){const _0x24b7f9=a43_0x19170a;if(_0x3c0f1b[_0x24b7f9(0x108)]===0x0)return;for(let _0x2c2767=0x0;_0x2c2767<LOCK_SETTLE_RETRY_COUNT;_0x2c2767+=0x1){const _0x582949=await readBffLockFile(_0x298dc4),_0x9e57fa=_0x582949?.[_0x24b7f9(0xeb)]?.[_0x19123f]?.[_0x24b7f9(0x126)]??{},_0x392fe1=_0x3c0f1b[_0x24b7f9(0xd4)](_0x3f3e61=>!!_0x9e57fa[_0x3f3e61]?.[_0x24b7f9(0xf8)]);if(_0x392fe1)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x3c0f1b[_0x24b7f9(0xd5)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x2e881c=a44_0x45f9;function a44_0x52ca(){const _0x39a8d9=['4595499gUSSTc','1075272cURUDB','functions','remote','mergedCli','1fVNDRm','hash','\x20added,\x20','\x20remote-only','lockFilePath','defaultApp','push','datasetCode','2371978zCzoNF','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','boolean','887710AMtmCn','selectedAppName','currentApp','has','appCode','filePath','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','\x20modified,\x20','4dcXGzJ','\x20unchanged','874070wNZveh','map','1076163GZXogp','profileName','length','bool','status','apiDir','lockKey','1448464hXuJui'];a44_0x52ca=function(){return _0x39a8d9;};return a44_0x52ca();}function a44_0x45f9(_0x459a59,_0x4222fc){_0x459a59=_0x459a59-0xb9;const _0x52caac=a44_0x52ca();let _0x45f915=_0x52caac[_0x459a59];return _0x45f915;}(function(_0xff3453,_0x4002db){const _0x43e61c=a44_0x45f9,_0x5b0a4b=_0xff3453();while(!![]){try{const _0x37e5f6=-parseInt(_0x43e61c(0xd3))/0x1*(parseInt(_0x43e61c(0xc4))/0x2)+-parseInt(_0x43e61c(0xc6))/0x3+parseInt(_0x43e61c(0xc2))/0x4*(-parseInt(_0x43e61c(0xba))/0x5)+parseInt(_0x43e61c(0xcf))/0x6+parseInt(_0x43e61c(0xdb))/0x7+parseInt(_0x43e61c(0xcd))/0x8+parseInt(_0x43e61c(0xce))/0x9;if(_0x37e5f6===_0x4002db)break;else _0x5b0a4b['push'](_0x5b0a4b['shift']());}catch(_0x457452){_0x5b0a4b['push'](_0x5b0a4b['shift']());}}}(a44_0x52ca,0x39b95));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a44_0x2e881c(0xca),'description':a44_0x2e881c(0xc0),'risk':'read','flags':[{'name':'remote','type':a44_0x2e881c(0xb9),'description':a44_0x2e881c(0xdc)}],async 'execute'(_0x5c5fdd){const _0x24524f=a44_0x2e881c,_0x29cad0=loadBffProjectConfig(_0x5c5fdd[_0x24524f(0xbe)]),_0x4df0a9=await readBffLockFile(_0x29cad0[_0x24524f(0xd7)]),{appLock:_0x509d0a}=ensureLockScope(_0x4df0a9??createEmptyBffLock(),_0x5c5fdd[_0x24524f(0xbe)],_0x29cad0['scriptsRoot'],_0x24524f(0xca)),_0x11de8e=await scanLocalBffFunctions(_0x29cad0),_0x2b6ded=[],_0x75b728=[],_0x7a3ef2=[];for(const _0x15b6cd of _0x11de8e){const _0x2219de=await computeFileHash(_0x15b6cd[_0x24524f(0xbf)]),_0x29a2a7=_0x509d0a[_0x24524f(0xd0)][_0x15b6cd[_0x24524f(0xcc)]];if(!_0x29a2a7)_0x2b6ded[_0x24524f(0xd9)](_0x15b6cd['lockKey']);else _0x29a2a7[_0x24524f(0xd4)]!==_0x2219de?_0x75b728['push'](_0x15b6cd[_0x24524f(0xcc)]):_0x7a3ef2['push'](_0x15b6cd[_0x24524f(0xcc)]);}const _0x53a23b=[];if(_0x5c5fdd[_0x24524f(0xc9)](_0x24524f(0xd1))){const _0x3b6c4b=resolveApiModelSource(_0x5c5fdd[_0x24524f(0xcb)],_0x5c5fdd[_0x24524f(0xbe)],_0x5c5fdd[_0x24524f(0xbb)]||_0x5c5fdd[_0x24524f(0xd2)]?.[_0x24524f(0xbc)]||_0x5c5fdd['mergedCli']?.[_0x24524f(0xd8)]),_0x5658f9=loadAliasMap(_0x5c5fdd['apiDir'],undefined,_0x3b6c4b[_0x24524f(0xbf)],_0x3b6c4b[_0x24524f(0xc7)]),_0x1e85e6=new Map(_0x5658f9[_0x24524f(0xc5)](_0x16a499=>[_0x16a499[_0x24524f(0xda)],_0x16a499['alias']])),[_0x4d3bd2,_0x3e7c3f]=await Promise['all']([listBffScripts(_0x5c5fdd[_0x24524f(0xbe)]),getBffScriptStatistics(_0x5c5fdd['appCode'])]),_0x523c2a=createHookLocationMap(_0x3e7c3f),_0x27790d=new Set(_0x11de8e[_0x24524f(0xc5)](_0x2e7a03=>_0x2e7a03[_0x24524f(0xcc)]));for(const _0x35c44d of _0x4d3bd2){const _0x5c51ab=resolveRemoteScriptTarget(_0x29cad0,_0x35c44d,_0x523c2a,_0x509d0a['functions'],_0x1e85e6);_0x5c51ab&&!_0x27790d[_0x24524f(0xbd)](_0x5c51ab[_0x24524f(0xcc)])&&_0x53a23b[_0x24524f(0xd9)](_0x5c51ab[_0x24524f(0xcc)]);}}const _0x3105d0=_0x2b6ded[_0x24524f(0xc8)]===0x0&&_0x75b728[_0x24524f(0xc8)]===0x0&&_0x53a23b['length']===0x0;return{'ok':!![],'data':{'added':_0x2b6ded,'modified':_0x75b728,'unchanged':_0x7a3ef2,'remoteOnly':_0x53a23b},'message':_0x3105d0?'All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.':_0x2b6ded[_0x24524f(0xc8)]+_0x24524f(0xd5)+_0x75b728[_0x24524f(0xc8)]+_0x24524f(0xc1)+_0x7a3ef2[_0x24524f(0xc8)]+_0x24524f(0xc3)+(_0x53a23b[_0x24524f(0xc8)]>0x0?',\x20'+_0x53a23b['length']+_0x24524f(0xd6):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a45_0x9a4a5a=a45_0x281c;(function(_0x1646c5,_0x12fcbb){const _0x1af530=a45_0x281c,_0x1ad119=_0x1646c5();while(!![]){try{const _0x1795e2=parseInt(_0x1af530(0xe0))/0x1+parseInt(_0x1af530(0xf6))/0x2+-parseInt(_0x1af530(0xd6))/0x3*(-parseInt(_0x1af530(0xdb))/0x4)+parseInt(_0x1af530(0xf1))/0x5+-parseInt(_0x1af530(0xdc))/0x6+-parseInt(_0x1af530(0xd9))/0x7+-parseInt(_0x1af530(0xf2))/0x8*(parseInt(_0x1af530(0xee))/0x9);if(_0x1795e2===_0x12fcbb)break;else _0x1ad119['push'](_0x1ad119['shift']());}catch(_0x567500){_0x1ad119['push'](_0x1ad119['shift']());}}}(a45_0x5b94,0xdf4c3));function a45_0x5b94(){const _0x2a0189=['cli-skill-install','498716YZZEJt','50328obkbrR','code','\x20installed',']:\x20','1122670sRZNHn','log','install','\x20is\x20already\x20current','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','cwd','unknown','repairCommand','nonInteractive','CLI\x20Built-in\x20Skill\x20','Built-in\x20Skill\x20install\x20failed\x20[','pipe','error','skillVersion','13374pmzOJp','cli-skill','changed','5451040ZfueAn','20176ZNmXGW','\x20via\x20skills@latest','apiError','setLogPath','2284048SvoJBZ','read','installedPath','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','39csJEZM','info','\x20at\x20','2135154rWxHIZ'];a45_0x5b94=function(){return _0x2a0189;};return a45_0x5b94();}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a45_0x281c(_0x404a6d,_0x1f1a3e){_0x404a6d=_0x404a6d-0xd5;const _0x5b942f=a45_0x5b94();let _0x281cb5=_0x5b942f[_0x404a6d];return _0x281cb5;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a45_0x9a4a5a(0xef),'command':a45_0x9a4a5a(0xe2),'description':a45_0x9a4a5a(0xd5),'risk':a45_0x9a4a5a(0xf7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4e84eb){const _0x1b18b7=a45_0x9a4a5a;logger[_0x1b18b7(0xf5)](process[_0x1b18b7(0xe5)]()),logger[_0x1b18b7(0xd7)](_0x1b18b7(0xda),'Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.');const _0x1ecb74=installBuiltinSkill({'stdio':_0x4e84eb[_0x1b18b7(0xe8)]?_0x1b18b7(0xeb):'inherit'});if(!_0x1ecb74['ok'])throw CliErrors[_0x1b18b7(0xf4)](_0x1b18b7(0xea)+_0x1ecb74[_0x1b18b7(0xdd)]+_0x1b18b7(0xdf)+(_0x1ecb74[_0x1b18b7(0xec)]||_0x1b18b7(0xe6)),_0x1b18b7(0xe4)+_0x1ecb74[_0x1b18b7(0xe7)]);return console[_0x1b18b7(0xe1)](_0x1ecb74[_0x1b18b7(0xf0)]?_0x1b18b7(0xe9)+_0x1ecb74[_0x1b18b7(0xed)]+_0x1b18b7(0xde)+(_0x1ecb74['installedPath']?_0x1b18b7(0xd8)+_0x1ecb74[_0x1b18b7(0xf8)]:_0x1b18b7(0xf3)):'CLI\x20Built-in\x20Skill\x20'+_0x1ecb74[_0x1b18b7(0xed)]+_0x1b18b7(0xe3)+(_0x1ecb74[_0x1b18b7(0xf8)]?_0x1b18b7(0xd8)+_0x1ecb74[_0x1b18b7(0xf8)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x4a3465=a46_0x4db3;(function(_0x22a88b,_0x20d447){const _0x502a5a=a46_0x4db3,_0x1db634=_0x22a88b();while(!![]){try{const _0x16a216=-parseInt(_0x502a5a(0x8d))/0x1+parseInt(_0x502a5a(0x8c))/0x2+parseInt(_0x502a5a(0x6e))/0x3*(parseInt(_0x502a5a(0x9d))/0x4)+-parseInt(_0x502a5a(0x79))/0x5+parseInt(_0x502a5a(0x6c))/0x6+-parseInt(_0x502a5a(0xae))/0x7+parseInt(_0x502a5a(0xb7))/0x8;if(_0x16a216===_0x20d447)break;else _0x1db634['push'](_0x1db634['shift']());}catch(_0xc9c8ce){_0x1db634['push'](_0x1db634['shift']());}}}(a46_0x2628,0x634b4));import a46_0x3182e3 from'chalk';import a46_0x4f9234 from'ora';function a46_0x4db3(_0x5bf36d,_0x59c451){_0x5bf36d=_0x5bf36d-0x6b;const _0x262851=a46_0x2628();let _0x4db3d6=_0x262851[_0x5bf36d];return _0x4db3d6;}import a46_0x2df4cb from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x2700a8=a46_0x4db3;return GIT_COMMIT!==_0x2700a8(0xa5)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x2700a8(0x80)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x56cc9a=a46_0x4db3,_0x46378a=process['execPath'][_0x56cc9a(0xc1)]();if(_0x46378a[_0x56cc9a(0xc0)](_0x56cc9a(0xab)))return _0x56cc9a(0xab);return'npm';}const updateFlags=[{'name':'beta','type':a46_0x4a3465(0x6d),'description':a46_0x4a3465(0xa0),'default':![]},{'name':a46_0x4a3465(0xa1),'type':a46_0x4a3465(0xb5),'description':a46_0x4a3465(0x9a)}];function getRequestedVersion(_0xb26d0e){const _0x4e4f9f=a46_0x4a3465;return _0xb26d0e[_0x4e4f9f(0x8a)](_0x4e4f9f(0xa1))[_0x4e4f9f(0x92)]();}async function validateUpdateFlags(_0x33ef00){const _0x3ac951=a46_0x4a3465,_0x4ff8d4=_0x33ef00[_0x3ac951(0xbc)](_0x3ac951(0x77)),_0x19c300=getRequestedVersion(_0x33ef00);if(_0x4ff8d4&&_0x19c300)throw CliErrors[_0x3ac951(0x8b)](_0x3ac951(0xb9),_0x3ac951(0xbf));if(_0x19c300&&!a46_0x2df4cb[_0x3ac951(0x73)](_0x19c300))throw CliErrors[_0x3ac951(0x8b)]('Invalid\x20version:\x20'+_0x19c300,_0x3ac951(0xba));}async function fetchNpmDistTags(){const _0x34580a=a46_0x4a3465;try{const _0x6c3e12=await fetch(_0x34580a(0x8f)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x34580a(0x7b),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x6c3e12['ok'])return null;const _0x2e6c57=await _0x6c3e12[_0x34580a(0xc2)]();if(!_0x2e6c57||typeof _0x2e6c57!==_0x34580a(0x7e))return null;return Object[_0x34580a(0x85)](Object['entries'](_0x2e6c57)[_0x34580a(0xac)](([,_0x47080a])=>typeof _0x47080a===_0x34580a(0xb5)&&_0x47080a['trim']()[_0x34580a(0x81)]>0x0)[_0x34580a(0xb6)](([_0xa55558,_0x1ca64d])=>[_0xa55558,String(_0x1ca64d)[_0x34580a(0x92)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x187aea){const _0x5a81b1=await fetchNpmDistTags();return _0x5a81b1?.[_0x187aea]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x22256c){const _0x59b896=a46_0x4a3465,_0x2413f1=getRequestedVersion(_0x22256c);if(_0x2413f1)return{'version':_0x2413f1,'source':'version'};if(_0x22256c[_0x59b896(0xbc)](_0x59b896(0x77))){const _0x31c4cb=await fetchNpmDistTagVersion(_0x59b896(0x77));if(!_0x31c4cb)return null;return{'version':_0x31c4cb,'source':'beta'};}const _0x394e45=await fetchLatestVersion();if(!_0x394e45)return null;return{'version':_0x394e45,'source':_0x59b896(0xbd)};}function shouldInstallTarget(_0x39fe5f,_0x278d1b){const _0xb56395=a46_0x4a3465;if(_0x278d1b[_0xb56395(0x87)]===_0xb56395(0xa1)||_0x278d1b[_0xb56395(0x87)]===_0xb56395(0x77))return!a46_0x2df4cb['eq'](_0x39fe5f,_0x278d1b['version']);return a46_0x2df4cb['lt'](_0x39fe5f,_0x278d1b[_0xb56395(0xa1)]);}function a46_0x2628(){const _0x179c20=['\x20\x20Try\x20manually:\x20','apiError','install','code','Install\x20a\x20specific\x20CLI\x20version','Already\x20up\x20to\x20date\x20(v','current','8GALkTm','expected\x20','Update\x20available:\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','version','npm',',\x20then\x20verify\x20with:\x20',',\x20state\x20','unknown','Version\x20comparison\x20failed','\x20doctor','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','yellow','update','bun','filter','pipe','2393678iwVusH','CLI\x20updated\x20to\x20v','red','Updating\x20via\x20','log','\x20\x20CLI\x20Built-in\x20Skill\x20',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','string','map','4719360MwKqVt','state','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','bool','latest','repairCommand','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','includes','toLowerCase','json','read','\x20is\x20newer\x20than\x20npm\x20latest\x20v','Checking\x20for\x20updates...','1256346MiLsJf','boolean','194658XVLogs','...','Current\x20version\x20v','run','Update\x20failed','valid','Run:\x20','Beta\x20version:\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','beta','\x20is\x20up\x20to\x20date.','2468865bqIgmn','\x20install\x20-g\x20','/dist-tags','green','info','object','Current\x20version:\x20','slice','length','message','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','gray','fromEntries','Requested\x20version:\x20','source','start','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','str','validation','828612vcgBta','100954wfCuHV','fail','https://registry.npmjs.org/-/package/','succeed','\x20→\x20','trim','skillVersion','error',']:\x20'];a46_0x2628=function(){return _0x179c20;};return a46_0x2628();}function getInstallPlanLabel(_0x538a7d,_0x18bb52){const _0x2de6c0=a46_0x4a3465;switch(_0x18bb52['source']){case'beta':return _0x2de6c0(0x75)+a46_0x3182e3['yellow'](_0x538a7d)+_0x2de6c0(0x91)+a46_0x3182e3[_0x2de6c0(0x7c)](_0x18bb52[_0x2de6c0(0xa1)]);case _0x2de6c0(0xa1):return _0x2de6c0(0x86)+a46_0x3182e3[_0x2de6c0(0xa9)](_0x538a7d)+_0x2de6c0(0x91)+a46_0x3182e3[_0x2de6c0(0x7c)](_0x18bb52[_0x2de6c0(0xa1)]);case'latest':default:return _0x2de6c0(0x9f)+a46_0x3182e3[_0x2de6c0(0xa9)](_0x538a7d)+_0x2de6c0(0x91)+a46_0x3182e3[_0x2de6c0(0x7c)](_0x18bb52[_0x2de6c0(0xa1)]);}}function repairCurrentBuiltinSkill(){const _0x3db9f1=a46_0x4a3465;console[_0x3db9f1(0xb2)](a46_0x3182e3['gray']('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x52c25b=installBuiltinSkill();if(_0x52c25b['ok']){console[_0x3db9f1(0xb2)](a46_0x3182e3[_0x3db9f1(0x84)](_0x3db9f1(0xb3)+_0x52c25b[_0x3db9f1(0x93)]+_0x3db9f1(0x78)));return;}throw CliErrors[_0x3db9f1(0x97)]('CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x52c25b[_0x3db9f1(0x99)]+_0x3db9f1(0x95)+(_0x52c25b['error']||_0x3db9f1(0xa5)),_0x3db9f1(0x74)+_0x52c25b[_0x3db9f1(0xbe)]+_0x3db9f1(0xa3)+CLI_BIN_NAME+_0x3db9f1(0xa7));}function verifyUpdatedBuiltinSkill(_0x266591){const _0x198c18=a46_0x4a3465,_0x43a92d=inspectInstalledBuiltinSkillVersion(_0x266591);if(_0x43a92d[_0x198c18(0xb8)]===_0x198c18(0x9c)){console[_0x198c18(0xb2)](a46_0x3182e3[_0x198c18(0x84)](_0x198c18(0xb3)+_0x266591+_0x198c18(0x78)));return;}const _0x8b6f59=_0x43a92d[_0x198c18(0x93)]?_0x198c18(0x9e)+_0x266591+',\x20found\x20'+_0x43a92d['skillVersion']:_0x198c18(0x9e)+_0x266591+_0x198c18(0xa4)+_0x43a92d['state'];throw CliErrors[_0x198c18(0x97)](_0x198c18(0xaf)+_0x266591+_0x198c18(0xb4)+_0x8b6f59,_0x198c18(0x74)+_0x43a92d['repairCommand']+_0x198c18(0xa3)+CLI_BIN_NAME+_0x198c18(0xa7));}async function execute(_0x733b35){const _0x210d64=a46_0x4a3465;await validateUpdateFlags(_0x733b35);const _0xfa1c19=getCurrentVersion();console['log'](_0x210d64(0x7f)+_0xfa1c19);const _0x37abc6=a46_0x4f9234(_0x210d64(0x6b))[_0x210d64(0x88)](),_0x38567e=await resolveTargetVersion(_0x733b35);if(!_0x38567e){const _0x5f328b=_0x733b35[_0x210d64(0xbc)](_0x210d64(0x77))?_0x210d64(0xa8):_0x210d64(0xbb);return _0x37abc6[_0x210d64(0x8e)](_0x5f328b),console[_0x210d64(0xb2)](a46_0x3182e3['gray'](_0x210d64(0x76)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x5f328b};}const _0x1ad58b=a46_0x2df4cb[_0x210d64(0x73)](VERSION),_0x321c84=a46_0x2df4cb[_0x210d64(0x73)](_0x38567e[_0x210d64(0xa1)]);if(!_0x1ad58b||!_0x321c84)return _0x37abc6[_0x210d64(0x8e)](_0x210d64(0xa6)),{'ok':![],'message':_0x210d64(0xa6)};if(!shouldInstallTarget(_0x1ad58b,_0x38567e)){const _0x41123c=_0x38567e[_0x210d64(0x87)]===_0x210d64(0xa1)?'Already\x20on\x20requested\x20version\x20(v'+_0x38567e['version']+')':a46_0x2df4cb['gt'](_0x1ad58b,_0x321c84)?_0x210d64(0x70)+_0xfa1c19+_0x210d64(0xc4)+_0x38567e['version']:_0x210d64(0x9b)+_0x38567e[_0x210d64(0xa1)]+')';return _0x37abc6[_0x210d64(0x90)](_0x41123c),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x37abc6[_0x210d64(0x7d)](getInstallPlanLabel(_0xfa1c19,_0x38567e));const _0x10f224=detectPackageManager(),_0x5d4ba8=_0x10f224==='npm'?resolveNpmBin(_0x210d64(0xa2)):_0x10f224,_0x90c65b=a46_0x4f9234(_0x210d64(0xb1)+_0x10f224+_0x210d64(0x6f))[_0x210d64(0x88)]();try{await execa(_0x5d4ba8,[_0x210d64(0x98),'-g',NPM_PACKAGE_NAME+'@'+_0x38567e['version']],{'stdio':_0x210d64(0xad)}),_0x90c65b[_0x210d64(0x90)]('Updated\x20to\x20v'+_0x38567e[_0x210d64(0xa1)]),console[_0x210d64(0xb2)](a46_0x3182e3[_0x210d64(0x84)](_0x210d64(0x89)));}catch(_0x55fdc7){return _0x90c65b[_0x210d64(0x8e)](_0x210d64(0x72)),console[_0x210d64(0x94)](a46_0x3182e3[_0x210d64(0xb0)]('\x20\x20'+_0x55fdc7[_0x210d64(0x82)])),console[_0x210d64(0xb2)](a46_0x3182e3[_0x210d64(0x84)](_0x210d64(0x96)+_0x10f224+_0x210d64(0x7a)+NPM_PACKAGE_NAME+'@'+_0x38567e[_0x210d64(0xa1)])),{'ok':![],'message':_0x55fdc7[_0x210d64(0x82)]};}return verifyUpdatedBuiltinSkill(_0x38567e[_0x210d64(0xa1)]),{'ok':!![]};}export const updateDefinition={'service':a46_0x4a3465(0xaa),'command':a46_0x4a3465(0x71),'description':a46_0x4a3465(0x83),'risk':a46_0x4a3465(0xc3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a46_0x57a691=a46_0x21ce;(function(_0x3c5372,_0x504f2a){const _0x4c81c9=a46_0x21ce,_0x2efb52=_0x3c5372();while(!![]){try{const _0xc448f4=-parseInt(_0x4c81c9(0x180))/0x1*(-parseInt(_0x4c81c9(0x164))/0x2)+-parseInt(_0x4c81c9(0x177))/0x3+parseInt(_0x4c81c9(0x168))/0x4*(-parseInt(_0x4c81c9(0x16f))/0x5)+parseInt(_0x4c81c9(0x172))/0x6+-parseInt(_0x4c81c9(0x16c))/0x7*(-parseInt(_0x4c81c9(0x165))/0x8)+parseInt(_0x4c81c9(0x173))/0x9*(parseInt(_0x4c81c9(0x1a7))/0xa)+-parseInt(_0x4c81c9(0x183))/0xb;if(_0xc448f4===_0x504f2a)break;else _0x2efb52['push'](_0x2efb52['shift']());}catch(_0x41427e){_0x2efb52['push'](_0x2efb52['shift']());}}}(a46_0x43c9,0x22a20));import a46_0x496c13 from'chalk';import a46_0x45158b from'ora';import a46_0x7906e5 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function a46_0x43c9(){const _0x325129=['slice','190hlGZEf','Beta\x20version:\x20','pipe','fromEntries','\x20\x20CLI\x20Built-in\x20Skill\x20','\x20install\x20-g\x20','source','start','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','green','trim','version','Already\x20on\x20requested\x20version\x20(v','Invalid\x20version:\x20','326LZKSlU','24BMTMbW','string','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','20HNKKch','repairCommand','json','Update\x20available:\x20','244153Kywdxg','valid','fail','104890rYXSEY','run','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','1144578PpPdwz','101628LeBCsq','\x20is\x20up\x20to\x20date.','timeout','succeed','462918mmNwnZ','Version\x20comparison\x20failed','state','\x20→\x20','execPath','gray','expected\x20','apiError','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','1493HOFWZy',',\x20found\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','3874805yavHFa','str','entries','bun','Install\x20a\x20specific\x20CLI\x20version','includes','log','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','CLI\x20updated\x20to\x20v','Update\x20failed',',\x20then\x20verify\x20with:\x20','beta','red','code','Checking\x20for\x20updates...','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','validation','message','map','Current\x20version\x20v','length','https://registry.npmjs.org/-/package/','Already\x20up\x20to\x20date\x20(v','bool','skillVersion',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','toLowerCase','boolean','npm','yellow','\x20doctor','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','unknown','info','latest'];a46_0x43c9=function(){return _0x325129;};return a46_0x43c9();}function getCurrentVersion(){const _0x4807e3=a46_0x21ce;return GIT_COMMIT!==_0x4807e3(0x1a3)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4807e3(0x1a6)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3f112a=a46_0x21ce,_0x50a262=process[_0x3f112a(0x17b)][_0x3f112a(0x19d)]();if(_0x50a262[_0x3f112a(0x188)](_0x3f112a(0x186)))return'bun';return _0x3f112a(0x19f);}const updateFlags=[{'name':a46_0x57a691(0x18e),'type':a46_0x57a691(0x19e),'description':a46_0x57a691(0x15e),'default':![]},{'name':a46_0x57a691(0x161),'type':a46_0x57a691(0x166),'description':a46_0x57a691(0x187)}];function a46_0x21ce(_0x2da3bb,_0x2bc1f6){_0x2da3bb=_0x2da3bb-0x158;const _0x43c954=a46_0x43c9();let _0x21ceb8=_0x43c954[_0x2da3bb];return _0x21ceb8;}function getRequestedVersion(_0x1e1fcd){const _0xd9d270=a46_0x57a691;return _0x1e1fcd[_0xd9d270(0x184)](_0xd9d270(0x161))['trim']();}async function validateUpdateFlags(_0x41a207){const _0x6a57a7=a46_0x57a691,_0x4b21fa=_0x41a207[_0x6a57a7(0x19a)](_0x6a57a7(0x18e)),_0x1b2d5c=getRequestedVersion(_0x41a207);if(_0x4b21fa&&_0x1b2d5c)throw CliErrors['validation'](_0x6a57a7(0x18a),_0x6a57a7(0x167));if(_0x1b2d5c&&!a46_0x7906e5[_0x6a57a7(0x16d)](_0x1b2d5c))throw CliErrors[_0x6a57a7(0x193)](_0x6a57a7(0x163)+_0x1b2d5c,_0x6a57a7(0x17f));}async function fetchNpmDistTags(){const _0x414dd3=a46_0x57a691;try{const _0x38f78d=await fetch(_0x414dd3(0x198)+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x414dd3(0x175)](0x2710)});if(!_0x38f78d['ok'])return null;const _0x594a1b=await _0x38f78d[_0x414dd3(0x16a)]();if(!_0x594a1b||typeof _0x594a1b!=='object')return null;return Object[_0x414dd3(0x159)](Object[_0x414dd3(0x185)](_0x594a1b)['filter'](([,_0x3424ff])=>typeof _0x3424ff===_0x414dd3(0x166)&&_0x3424ff[_0x414dd3(0x160)]()[_0x414dd3(0x197)]>0x0)[_0x414dd3(0x195)](([_0x3b70d8,_0x42e257])=>[_0x3b70d8,String(_0x42e257)[_0x414dd3(0x160)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x43f4d5){const _0x37809b=await fetchNpmDistTags();return _0x37809b?.[_0x43f4d5]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x2b8c77){const _0x274ca3=a46_0x57a691,_0x4fce9d=getRequestedVersion(_0x2b8c77);if(_0x4fce9d)return{'version':_0x4fce9d,'source':_0x274ca3(0x161)};if(_0x2b8c77[_0x274ca3(0x19a)](_0x274ca3(0x18e))){const _0x32f3f1=await fetchNpmDistTagVersion(_0x274ca3(0x18e));if(!_0x32f3f1)return null;return{'version':_0x32f3f1,'source':_0x274ca3(0x18e)};}const _0xd4953b=await fetchLatestVersion();if(!_0xd4953b)return null;return{'version':_0xd4953b,'source':'latest'};}function shouldInstallTarget(_0x149a4e,_0x75d4db){const _0x2f9540=a46_0x57a691;if(_0x75d4db[_0x2f9540(0x15c)]==='version'||_0x75d4db[_0x2f9540(0x15c)]===_0x2f9540(0x18e))return!a46_0x7906e5['eq'](_0x149a4e,_0x75d4db[_0x2f9540(0x161)]);return a46_0x7906e5['lt'](_0x149a4e,_0x75d4db['version']);}function getInstallPlanLabel(_0x322ad2,_0x2c5cf2){const _0x3d5a44=a46_0x57a691;switch(_0x2c5cf2['source']){case _0x3d5a44(0x18e):return _0x3d5a44(0x1a8)+a46_0x496c13[_0x3d5a44(0x1a0)](_0x322ad2)+_0x3d5a44(0x17a)+a46_0x496c13[_0x3d5a44(0x15f)](_0x2c5cf2[_0x3d5a44(0x161)]);case _0x3d5a44(0x161):return'Requested\x20version:\x20'+a46_0x496c13[_0x3d5a44(0x1a0)](_0x322ad2)+_0x3d5a44(0x17a)+a46_0x496c13['green'](_0x2c5cf2[_0x3d5a44(0x161)]);case _0x3d5a44(0x1a5):default:return _0x3d5a44(0x16b)+a46_0x496c13[_0x3d5a44(0x1a0)](_0x322ad2)+'\x20→\x20'+a46_0x496c13[_0x3d5a44(0x15f)](_0x2c5cf2[_0x3d5a44(0x161)]);}}function repairCurrentBuiltinSkill(){const _0x4ae661=a46_0x57a691;console['log'](a46_0x496c13[_0x4ae661(0x17c)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x23e2b7=installBuiltinSkill();if(_0x23e2b7['ok']){console[_0x4ae661(0x189)](a46_0x496c13[_0x4ae661(0x17c)](_0x4ae661(0x15a)+_0x23e2b7[_0x4ae661(0x19b)]+'\x20is\x20up\x20to\x20date.'));return;}throw CliErrors['apiError']('CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x23e2b7[_0x4ae661(0x190)]+']:\x20'+(_0x23e2b7['error']||_0x4ae661(0x1a3)),'Run:\x20'+_0x23e2b7['repairCommand']+',\x20then\x20verify\x20with:\x20'+CLI_BIN_NAME+'\x20doctor');}function verifyUpdatedBuiltinSkill(_0x351807){const _0x1e4a84=a46_0x57a691,_0x266540=inspectInstalledBuiltinSkillVersion(_0x351807);if(_0x266540['state']==='current'){console[_0x1e4a84(0x189)](a46_0x496c13[_0x1e4a84(0x17c)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x351807+_0x1e4a84(0x174)));return;}const _0x322677=_0x266540[_0x1e4a84(0x19b)]?_0x1e4a84(0x17d)+_0x351807+_0x1e4a84(0x181)+_0x266540[_0x1e4a84(0x19b)]:'expected\x20'+_0x351807+',\x20state\x20'+_0x266540[_0x1e4a84(0x179)];throw CliErrors[_0x1e4a84(0x17e)](_0x1e4a84(0x18b)+_0x351807+_0x1e4a84(0x19c)+_0x322677,'Run:\x20'+_0x266540[_0x1e4a84(0x169)]+_0x1e4a84(0x18d)+CLI_BIN_NAME+_0x1e4a84(0x1a1));}async function execute(_0x386b91){const _0x5c65a0=a46_0x57a691;await validateUpdateFlags(_0x386b91);const _0x524ee6=getCurrentVersion();console['log']('Current\x20version:\x20'+_0x524ee6);const _0x5b74dd=a46_0x45158b(_0x5c65a0(0x191))[_0x5c65a0(0x15d)](),_0x583975=await resolveTargetVersion(_0x386b91);if(!_0x583975){const _0x51f2b7=_0x386b91[_0x5c65a0(0x19a)](_0x5c65a0(0x18e))?_0x5c65a0(0x1a2):_0x5c65a0(0x182);return _0x5b74dd[_0x5c65a0(0x16e)](_0x51f2b7),console[_0x5c65a0(0x189)](a46_0x496c13['gray']('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x51f2b7};}const _0x217dda=a46_0x7906e5['valid'](VERSION),_0x94bcc6=a46_0x7906e5[_0x5c65a0(0x16d)](_0x583975[_0x5c65a0(0x161)]);if(!_0x217dda||!_0x94bcc6)return _0x5b74dd[_0x5c65a0(0x16e)](_0x5c65a0(0x178)),{'ok':![],'message':_0x5c65a0(0x178)};if(!shouldInstallTarget(_0x217dda,_0x583975)){const _0x4eba5d=_0x583975['source']===_0x5c65a0(0x161)?_0x5c65a0(0x162)+_0x583975[_0x5c65a0(0x161)]+')':a46_0x7906e5['gt'](_0x217dda,_0x94bcc6)?_0x5c65a0(0x196)+_0x524ee6+'\x20is\x20newer\x20than\x20npm\x20latest\x20v'+_0x583975[_0x5c65a0(0x161)]:_0x5c65a0(0x199)+_0x583975['version']+')';return _0x5b74dd[_0x5c65a0(0x176)](_0x4eba5d),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x5b74dd[_0x5c65a0(0x1a4)](getInstallPlanLabel(_0x524ee6,_0x583975));const _0x452b85=detectPackageManager(),_0x2d7665=_0x452b85===_0x5c65a0(0x19f)?resolveNpmBin(_0x5c65a0(0x19f)):_0x452b85,_0x467711=a46_0x45158b('Updating\x20via\x20'+_0x452b85+'...')[_0x5c65a0(0x15d)]();try{await execa(_0x2d7665,['install','-g',NPM_PACKAGE_NAME+'@'+_0x583975['version']],{'stdio':_0x5c65a0(0x158)}),_0x467711['succeed']('Updated\x20to\x20v'+_0x583975[_0x5c65a0(0x161)]),console['log'](a46_0x496c13[_0x5c65a0(0x17c)](_0x5c65a0(0x171)));}catch(_0x29fd42){return _0x467711['fail'](_0x5c65a0(0x18c)),console['error'](a46_0x496c13[_0x5c65a0(0x18f)]('\x20\x20'+_0x29fd42[_0x5c65a0(0x194)])),console['log'](a46_0x496c13[_0x5c65a0(0x17c)]('\x20\x20Try\x20manually:\x20'+_0x452b85+_0x5c65a0(0x15b)+NPM_PACKAGE_NAME+'@'+_0x583975['version'])),{'ok':![],'message':_0x29fd42[_0x5c65a0(0x194)]};}return verifyUpdatedBuiltinSkill(_0x583975[_0x5c65a0(0x161)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a46_0x57a691(0x170),'description':a46_0x57a691(0x192),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29ab1d,_0x3df550){const _0x37e0d0=a47_0x3ad4,_0x42ed59=_0x29ab1d();while(!![]){try{const _0x3d1850=parseInt(_0x37e0d0(0xad))/0x1+-parseInt(_0x37e0d0(0xb2))/0x2*(-parseInt(_0x37e0d0(0xae))/0x3)+-parseInt(_0x37e0d0(0xab))/0x4+parseInt(_0x37e0d0(0xac))/0x5+-parseInt(_0x37e0d0(0xaa))/0x6+-parseInt(_0x37e0d0(0xaf))/0x7*(-parseInt(_0x37e0d0(0xa9))/0x8)+-parseInt(_0x37e0d0(0xb0))/0x9*(parseInt(_0x37e0d0(0xb1))/0xa);if(_0x3d1850===_0x3df550)break;else _0x42ed59['push'](_0x42ed59['shift']());}catch(_0x17fe32){_0x42ed59['push'](_0x42ed59['shift']());}}}(a47_0x1156,0xefa6b));import{codegenSdk}from'../../commands/codegen/sdk.js';function a47_0x3ad4(_0x50e414,_0x30e932){_0x50e414=_0x50e414-0xa9;const _0x1156c9=a47_0x1156();let _0x3ad42e=_0x1156c9[_0x50e414];return _0x3ad42e;}function a47_0x1156(){const _0x3d1734=['3624916eIhQMN','5642175rbqcOb','779366jWypnc','14202CuUoaV','7GsWOIp','16029KCtzGi','6460JWWlvs','256YyzxyA','4684504wVKYKG','365700RHdshB'];a47_0x1156=function(){return _0x3d1734;};return a47_0x1156();}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x3d7073=a48_0x4caf;(function(_0x4e6a5c,_0xc79a62){const _0x5a1e0a=a48_0x4caf,_0x4081b2=_0x4e6a5c();while(!![]){try{const _0x1f0caa=-parseInt(_0x5a1e0a(0x153))/0x1+parseInt(_0x5a1e0a(0x14e))/0x2+parseInt(_0x5a1e0a(0x159))/0x3*(-parseInt(_0x5a1e0a(0x15d))/0x4)+parseInt(_0x5a1e0a(0x157))/0x5+-parseInt(_0x5a1e0a(0x150))/0x6*(-parseInt(_0x5a1e0a(0x155))/0x7)+-parseInt(_0x5a1e0a(0x15e))/0x8*(-parseInt(_0x5a1e0a(0x152))/0x9)+-parseInt(_0x5a1e0a(0x151))/0xa*(parseInt(_0x5a1e0a(0x15b))/0xb);if(_0x1f0caa===_0xc79a62)break;else _0x4081b2['push'](_0x4081b2['shift']());}catch(_0x37d087){_0x4081b2['push'](_0x4081b2['shift']());}}}(a48_0x3a46,0x80b99));function a48_0x3a46(){const _0x19996f=['boolean','55Fyxkpb','codegen','76ndpXsH','162152epQkVk','alias','Omit\x20import\x20statements\x20from\x20generated\x20code','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','code','bool','str','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','name','operation','appCode','706592SsXNmQ','sdk','930pAhEtX','913820UPAgiL','63FGzCBH','108750FqWHfR','tableName','13552DKymkQ','read','1675345vGitDE','string','5907GrBxRY'];a48_0x3a46=function(){return _0x19996f;};return a48_0x3a46();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a48_0x4caf(_0x5944ec,_0x17cb72){_0x5944ec=_0x5944ec-0x14a;const _0x3a46c0=a48_0x3a46();let _0x4cafb7=_0x3a46c0[_0x5944ec];return _0x4cafb7;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a48_0x3d7073(0x15c),'command':a48_0x3d7073(0x14f),'description':a48_0x3d7073(0x14a),'risk':a48_0x3d7073(0x156),'flags':[CODE_FLAG_OPTIONAL,{'name':a48_0x3d7073(0x15f),'type':a48_0x3d7073(0x158),'description':a48_0x3d7073(0x161)},{'name':a48_0x3d7073(0x14c),'type':a48_0x3d7073(0x158),'required':!![],'description':a48_0x3d7073(0x165)},{'name':'skip-imports','type':a48_0x3d7073(0x15a),'description':a48_0x3d7073(0x160)}],async 'execute'(_0x436af4){const _0x267d1c=a48_0x3d7073,{dataset:_0xc5c76,operation:_0x105857}=await getOperationDetail(_0x436af4[_0x267d1c(0x14d)],_0x436af4[_0x267d1c(0x164)](_0x267d1c(0x162)),_0x436af4[_0x267d1c(0x164)](_0x267d1c(0x14c))),_0x191981=generateSdkCode(_0xc5c76,_0x105857,{'includeImports':!_0x436af4[_0x267d1c(0x163)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0xc5c76[_0x267d1c(0x14b)],'code':_0xc5c76[_0x267d1c(0x162)],'tableName':_0xc5c76[_0x267d1c(0x154)]},'operation':_0x436af4[_0x267d1c(0x164)](_0x267d1c(0x14c)),'code':_0x191981}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x34cc00=a49_0x5acb;function a49_0x5acb(_0x46639f,_0x608c80){_0x46639f=_0x46639f-0x149;const _0x1b4476=a49_0x1b44();let _0x5acbf1=_0x1b4476[_0x46639f];return _0x5acbf1;}(function(_0x187acf,_0x44b619){const _0x139683=a49_0x5acb,_0x21a133=_0x187acf();while(!![]){try{const _0x55cfef=-parseInt(_0x139683(0x162))/0x1*(parseInt(_0x139683(0x14f))/0x2)+-parseInt(_0x139683(0x156))/0x3*(parseInt(_0x139683(0x14d))/0x4)+parseInt(_0x139683(0x159))/0x5+parseInt(_0x139683(0x150))/0x6*(parseInt(_0x139683(0x160))/0x7)+parseInt(_0x139683(0x14a))/0x8+parseInt(_0x139683(0x15f))/0x9*(-parseInt(_0x139683(0x15a))/0xa)+parseInt(_0x139683(0x14b))/0xb*(parseInt(_0x139683(0x149))/0xc);if(_0x55cfef===_0x44b619)break;else _0x21a133['push'](_0x21a133['shift']());}catch(_0x432a93){_0x21a133['push'](_0x21a133['shift']());}}}(a49_0x1b44,0x3d950));function a49_0x1b44(){const _0x341254=['bool','12lXAtrV','sql','16SoRBAn','132xnlnuI','boolean','appCode','sdk','target','string','43326SPBsoH','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','str','902195gPhPqt','94500oPUjsK','sqlCode','codegen','read','sqlcode','378dzlAhF','146818ZRaIeb','no-imports','59108Flomht','54984KiwaWM','1988344OgoMae','660iZzDGN'];a49_0x1b44=function(){return _0x341254;};return a49_0x1b44();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a49_0x34cc00(0x15c),'command':a49_0x34cc00(0x14e),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a49_0x34cc00(0x15d),'flags':[SQLCODE_FLAG,{'name':'target','type':a49_0x34cc00(0x155),'description':a49_0x34cc00(0x157),'default':a49_0x34cc00(0x153),'enum':[a49_0x34cc00(0x153),'bff']},{'name':'no-imports','type':a49_0x34cc00(0x151),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x526807){const _0x496561=a49_0x34cc00,_0x48e756=await getSqlQueryInfo(_0x526807[_0x496561(0x152)],_0x526807[_0x496561(0x158)](_0x496561(0x15e))),_0x1d446a=_0x526807[_0x496561(0x158)](_0x496561(0x154))||_0x496561(0x153),_0xde5875=generateSqlCodeTemplate(_0x48e756,{'target':_0x1d446a,'includeImports':!_0x526807[_0x496561(0x14c)](_0x496561(0x161))});return{'ok':!![],'data':{'sqlCode':_0x48e756[_0x496561(0x15b)],'sqlName':_0x48e756['sqlName'],'target':_0x1d446a,'code':_0xde5875}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x190067,_0x5bcc8d){const _0x3889f3=a50_0x4071,_0x8cbd4d=_0x190067();while(!![]){try{const _0x557402=parseInt(_0x3889f3(0x12c))/0x1*(-parseInt(_0x3889f3(0x131))/0x2)+parseInt(_0x3889f3(0x12f))/0x3+-parseInt(_0x3889f3(0x13a))/0x4+parseInt(_0x3889f3(0x111))/0x5+parseInt(_0x3889f3(0x12d))/0x6*(parseInt(_0x3889f3(0x136))/0x7)+parseInt(_0x3889f3(0x114))/0x8*(parseInt(_0x3889f3(0x123))/0x9)+parseInt(_0x3889f3(0x128))/0xa*(parseInt(_0x3889f3(0x133))/0xb);if(_0x557402===_0x5bcc8d)break;else _0x8cbd4d['push'](_0x8cbd4d['shift']());}catch(_0x7c6a93){_0x8cbd4d['push'](_0x8cbd4d['shift']());}}}(a50_0x21e5,0x93f20));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';function a50_0x21e5(){const _0x438b72=['string','3292145wqIrmn','validation','Removed\x20app\x20\x22','8eqezWe','appcode','global','keys','\x20<name>\x20--appcode\x20<code>','\x22\x20still\x20defined\x20in\x20','args','boolean','\x20Default\x20app\x20changed\x20to\x20\x22','\x22\x20is\x20selected\x20automatically.','Added','\x20app\x20\x22','length','projectConfig','Usage:\x20','460395XUMyKA','apps','Use\x20global\x20config\x20scope','bool','\x22\x20not\x20found.','320hndHUr','\x22\x20(appcode:\x20','\x20<name>','Missing\x20app\x20name.','35sIAbWi','150XIQhTR','project','2045622iPyJbg','App\x20code','62902FDkQFE','both','219593FuiNCy','object','str','199465jYhWbz','trim','\x20Remaining\x20app\x20\x22','defaultApp','4143520RCRBbq','globalConfig','\x20<name>\x20[--global]','App\x20\x22','\x20Note:\x20app\x20\x22','Updated','\x20config.'];a50_0x21e5=function(){return _0x438b72;};return a50_0x21e5();}import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x27b327=a50_0x4071;return[{'name':'appcode','type':_0x27b327(0x110),'description':_0x27b327(0x130),'required':!![]},{'name':_0x27b327(0x116),'type':_0x27b327(0x11b),'description':_0x27b327(0x125),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x156954=a50_0x4071;return[{'name':_0x156954(0x116),'type':_0x156954(0x11b),'description':_0x156954(0x125),'default':![]}];}export async function validateAppName(_0x41fdd0,_0x3bde37){const _0x5f3259=a50_0x4071,_0x4bced4=_0x41fdd0[_0x5f3259(0x11a)][0x0]?.[_0x5f3259(0x137)]();if(!_0x4bced4)throw CliErrors[_0x5f3259(0x112)]('Missing\x20app\x20name.',_0x5f3259(0x122)+CLI_BIN_NAME+'\x20'+_0x3bde37+_0x5f3259(0x12a));}function a50_0x4071(_0xa2a734,_0x34858f){_0xa2a734=_0xa2a734-0x10e;const _0x21e562=a50_0x21e5();let _0x407139=_0x21e562[_0xa2a734];return _0x407139;}export async function runAppAdd(_0x110cfe,_0x5a172c){const _0x198d64=a50_0x4071,_0x11091e=_0x110cfe[_0x198d64(0x11a)][0x0]?.[_0x198d64(0x137)]();if(!_0x11091e)throw CliErrors[_0x198d64(0x112)](_0x198d64(0x12b),_0x198d64(0x122)+CLI_BIN_NAME+'\x20'+_0x5a172c+_0x198d64(0x118));const _0xc2c883=_0x110cfe['str'](_0x198d64(0x115));if(!_0xc2c883)throw CliErrors['flagMissing'](_0x198d64(0x115),_0x198d64(0x122)+CLI_BIN_NAME+'\x20'+_0x5a172c+'\x20<name>\x20--appcode\x20<code>');const _0x393335={'global':_0x110cfe['bool'](_0x198d64(0x116))},_0x16c421=readConfig(_0x393335);if(!_0x16c421[_0x198d64(0x124)])_0x16c421['apps']={};const _0x5c5aef={'appcode':_0xc2c883,...collectAppProfileOverrides(_0x533819=>_0x110cfe[_0x198d64(0x135)](_0x533819))},_0x4f4d24=_0x16c421['apps'],_0x58c75d=Object[_0x198d64(0x117)](_0x4f4d24),_0x5e9e4c=typeof _0x16c421[_0x198d64(0x139)]===_0x198d64(0x110)&&_0x4f4d24[_0x16c421[_0x198d64(0x139)]]?_0x16c421[_0x198d64(0x139)]:_0x58c75d[_0x198d64(0x120)]===0x1?_0x58c75d[0x0]:undefined,_0x4a67bb=!!_0x4f4d24[_0x11091e];_0x4f4d24[_0x11091e]=_0x5c5aef;const _0x42a593=normalizeStoredDefaultApp(_0x16c421,_0x5e9e4c);writeConfig(_0x16c421,_0x393335);const _0x207219=!_0x4a67bb&&_0x42a593?'\x20Default\x20app\x20is\x20\x22'+_0x42a593+'\x22.':'',_0x33f24b=(_0x4a67bb?_0x198d64(0x10e):_0x198d64(0x11e))+_0x198d64(0x11f)+_0x11091e+_0x198d64(0x129)+_0xc2c883+')'+scopeLabel(_0x393335)+'.'+_0x207219;return{'ok':!![],'message':_0x33f24b};}export async function runAppRemove(_0x1e83ea,_0x18ba06){const _0x205ac9=a50_0x4071,_0x173317=_0x1e83ea[_0x205ac9(0x11a)][0x0]?.['trim']();if(!_0x173317)throw CliErrors[_0x205ac9(0x112)](_0x205ac9(0x12b),_0x205ac9(0x122)+CLI_BIN_NAME+'\x20'+_0x18ba06+_0x205ac9(0x13c));const _0x2c3c23=_0x1e83ea[_0x205ac9(0x126)](_0x205ac9(0x116)),{config:_0x5e6eb9,layers:_0xf518fc}=readRawConfigWithLayers(),_0x3d0594=_0x5e6eb9[_0x205ac9(0x124)]??{};if(!_0x3d0594[_0x173317])throw CliErrors['validation'](_0x205ac9(0x13d)+_0x173317+_0x205ac9(0x127));const _0x2b12d8=_0xf518fc['globalConfig'][_0x205ac9(0x124)]&&typeof _0xf518fc[_0x205ac9(0x13b)][_0x205ac9(0x124)]===_0x205ac9(0x134)?_0xf518fc[_0x205ac9(0x13b)][_0x205ac9(0x124)]:{},_0xc0fb3=_0xf518fc[_0x205ac9(0x121)][_0x205ac9(0x124)]&&typeof _0xf518fc[_0x205ac9(0x121)][_0x205ac9(0x124)]===_0x205ac9(0x134)?_0xf518fc[_0x205ac9(0x121)][_0x205ac9(0x124)]:{},_0x3af7d9=appDefinedIn(_0x173317,_0x2b12d8,_0xc0fb3),_0x5bedb7=resolveAppScopeForWrite(_0x173317,_0x2c3c23,_0xf518fc),_0x4c47cf={'global':_0x5bedb7==='global'},_0x20f41f=readConfig(_0x4c47cf),_0x3579fb=_0x20f41f['apps'];if(!_0x3579fb||!_0x3579fb[_0x173317])throw CliErrors[_0x205ac9(0x112)](_0x205ac9(0x13d)+_0x173317+_0x205ac9(0x127));delete _0x3579fb[_0x173317];let _0x36ea97='';const _0x531849=typeof _0x20f41f['defaultApp']===_0x205ac9(0x110)?_0x20f41f[_0x205ac9(0x139)]:undefined,_0x4382c3=Object[_0x205ac9(0x117)](_0x3579fb),_0x27ddb2=_0x531849===_0x173317?_0x4382c3[0x0]:_0x531849,_0xa3a989=normalizeStoredDefaultApp(_0x20f41f,_0x27ddb2);if(_0x531849===_0x173317&&_0x4382c3[_0x205ac9(0x120)]===0x1)_0x36ea97=_0x205ac9(0x138)+_0x4382c3[0x0]+_0x205ac9(0x11d);else _0x531849===_0x173317&&_0xa3a989&&(_0x36ea97=_0x205ac9(0x11c)+_0xa3a989+'\x22.');Object[_0x205ac9(0x117)](_0x3579fb)[_0x205ac9(0x120)]===0x0&&(delete _0x20f41f[_0x205ac9(0x124)],delete _0x20f41f['defaultApp']);writeConfig(_0x20f41f,_0x4c47cf);const _0x3a9828=_0x3af7d9===_0x205ac9(0x132)?_0x205ac9(0x13e)+_0x173317+_0x205ac9(0x119)+(_0x5bedb7===_0x205ac9(0x12e)?_0x205ac9(0x116):_0x205ac9(0x12e))+_0x205ac9(0x10f):'';return{'ok':!![],'message':_0x205ac9(0x113)+_0x173317+'\x22'+scopeLabel(_0x4c47cf)+'.'+_0x36ea97+_0x3a9828};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3fc29d,_0x10708f){const _0x50d75b=a51_0xe3b3,_0x49878a=_0x3fc29d();while(!![]){try{const _0x53862e=parseInt(_0x50d75b(0x210))/0x1*(-parseInt(_0x50d75b(0x201))/0x2)+parseInt(_0x50d75b(0x202))/0x3*(parseInt(_0x50d75b(0x1fb))/0x4)+-parseInt(_0x50d75b(0x204))/0x5+-parseInt(_0x50d75b(0x20f))/0x6+-parseInt(_0x50d75b(0x207))/0x7*(-parseInt(_0x50d75b(0x206))/0x8)+-parseInt(_0x50d75b(0x211))/0x9*(-parseInt(_0x50d75b(0x203))/0xa)+-parseInt(_0x50d75b(0x20d))/0xb*(-parseInt(_0x50d75b(0x1f8))/0xc);if(_0x53862e===_0x10708f)break;else _0x49878a['push'](_0x49878a['shift']());}catch(_0x1dc803){_0x49878a['push'](_0x49878a['shift']());}}}(a51_0x21ff,0xf2531));import{input,checkbox,select}from'@inquirer/prompts';import a51_0x2237b1 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';function a51_0x21ff(){const _0xe9c047=['find','✎\x20Enter\x20appcode\x20manually','trim','appName','skip','12ePwTgv','includes','Select\x20the\x20app\x20to\x20bind:','32OmNZjN','map','App\x20Code:','✎\x20Enter\x20manually','valid','appCode','1130226jCqABI','47427sAClCW','1281760EsSXmp','7904690wtJlSd','Fetching\x20available\x20apps...','1496fxzgXl','60151duBeIo','message','cyan','gray','custom','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','8692849KuoeAY','yellow','295488icBHgW','3EmZfnV','126kmwRHw','manual','(Skip;\x20configure\x20later)','\x20\x20(','\x0aNo\x20available\x20apps\x20found.','length','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','Invalid\x20App\x20Code'];a51_0x21ff=function(){return _0xe9c047;};return a51_0x21ff();}import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x4af6ef=a51_0xe3b3,_0x9dce7=await input({'message':_0x4af6ef(0x1fd),'validate':_0x448083=>{const _0x471c9b=_0x4af6ef,_0x3fb44b=validateAppcode(_0x448083[_0x471c9b(0x1f5)]());return _0x3fb44b[_0x471c9b(0x1ff)]||_0x3fb44b[_0x471c9b(0x208)]||_0x471c9b(0x1f2);}});return _0x9dce7[_0x4af6ef(0x1f5)]();}function a51_0xe3b3(_0x19240f,_0x1293f9){_0x19240f=_0x19240f-0x1f2;const _0x21ff56=a51_0x21ff();let _0xe3b34d=_0x21ff56[_0x19240f];return _0xe3b34d;}export async function promptAppSelection(_0x3509a9){const _0x439a44=a51_0xe3b3,_0x3060ff=[{'name':a51_0x2237b1['yellow'](_0x439a44(0x1f4)),'value':-0x1},..._0x3509a9[_0x439a44(0x1fc)]((_0x23a7b5,_0x2fb811)=>({'name':_0x23a7b5['appName']+'\x20\x20'+a51_0x2237b1[_0x439a44(0x20a)]('('+_0x23a7b5[_0x439a44(0x200)]+')'),'value':_0x2fb811}))],_0x1c2ed5=await checkbox({'message':'Found\x20'+a51_0x2237b1[_0x439a44(0x209)](_0x3509a9['length'])+'\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','choices':_0x3060ff,'loop':![]});if(_0x1c2ed5[_0x439a44(0x1f9)](-0x1))return'custom';if(_0x1c2ed5[_0x439a44(0x216)]===0x0)return _0x439a44(0x20b);return _0x1c2ed5[_0x439a44(0x1fc)](_0x254d84=>_0x3509a9[_0x254d84]);}export async function promptSingleAppSelection(_0x160776){const _0x22ea32=a51_0xe3b3,_0x18f759=[{'name':a51_0x2237b1[_0x22ea32(0x20a)]('(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)'),'value':'skip'},{'name':a51_0x2237b1['yellow'](_0x22ea32(0x1f4)),'value':_0x22ea32(0x20b)},..._0x160776['map'](_0x365184=>({'name':_0x365184[_0x22ea32(0x1f6)]+'\x20\x20'+a51_0x2237b1[_0x22ea32(0x20a)]('('+_0x365184[_0x22ea32(0x200)]+')'),'value':_0x365184[_0x22ea32(0x200)]}))],_0x534810=await select({'message':_0x22ea32(0x1fa),'choices':_0x18f759});if(_0x534810===_0x22ea32(0x1f7))return _0x22ea32(0x1f7);if(_0x534810===_0x22ea32(0x20b))return _0x22ea32(0x20b);return _0x160776[_0x22ea32(0x1f3)](_0x37d803=>_0x37d803[_0x22ea32(0x200)]===_0x534810);}export async function selectSingleAppcode(_0xb3cb3d){const _0xa8fe60=a51_0xe3b3;if(!_0xb3cb3d)return writeCliSideChannelLine(a51_0x2237b1[_0xa8fe60(0x20a)](_0xa8fe60(0x217))),_fallbackOrSkip();writeCliSideChannelLine(_0xa8fe60(0x205));let _0x13aeff;try{_0x13aeff=await withActiveCookie(_0xb3cb3d,()=>listRemoteApps());}catch(_0x462d3b){writeCliSideChannelLine(a51_0x2237b1[_0xa8fe60(0x20e)]('Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'));if(_0x462d3b instanceof Error)writeCliSideChannelLine(a51_0x2237b1[_0xa8fe60(0x20a)](_0xa8fe60(0x214)+_0x462d3b[_0xa8fe60(0x208)]+')'));return _fallbackOrSkip();}if(_0x13aeff[_0xa8fe60(0x216)]===0x0)return writeCliSideChannelLine(a51_0x2237b1[_0xa8fe60(0x20e)]('No\x20available\x20apps\x20found.')),_fallbackOrSkip();const _0x4f6b64=await promptSingleAppSelection(_0x13aeff);if(_0x4f6b64==='skip')return'';if(_0x4f6b64===_0xa8fe60(0x20b))return promptCustomAppcode();return _0x4f6b64[_0xa8fe60(0x200)];}export async function selectMultipleApps(_0x19c778){const _0x3531bb=a51_0xe3b3;writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x24b82e;try{_0x24b82e=await withActiveCookie(_0x19c778,()=>listRemoteApps());}catch(_0x3c2c82){writeCliSideChannelLine(_0x3531bb(0x20c));if(_0x3c2c82 instanceof Error)writeCliSideChannelLine(_0x3531bb(0x214)+_0x3c2c82[_0x3531bb(0x208)]+')');return _0x3531bb(0x20b);}if(_0x24b82e[_0x3531bb(0x216)]===0x0)return writeCliSideChannelLine(_0x3531bb(0x215)),_0x3531bb(0x20b);return promptAppSelection(_0x24b82e);}async function _fallbackOrSkip(){const _0x13586c=a51_0xe3b3,_0x4bd684=await select({'message':_0x13586c(0x1fd),'choices':[{'name':a51_0x2237b1[_0x13586c(0x20a)](_0x13586c(0x213)),'value':'skip'},{'name':a51_0x2237b1[_0x13586c(0x20e)](_0x13586c(0x1fe)),'value':_0x13586c(0x212)}]});if(_0x4bd684===_0x13586c(0x1f7))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x2c5e58=a52_0x1ac6;(function(_0x4bc3df,_0x2f0b47){const _0x207604=a52_0x1ac6,_0x5981ff=_0x4bc3df();while(!![]){try{const _0x581d53=parseInt(_0x207604(0xd3))/0x1+-parseInt(_0x207604(0xe4))/0x2+parseInt(_0x207604(0xd0))/0x3+parseInt(_0x207604(0xdf))/0x4+-parseInt(_0x207604(0xe9))/0x5+-parseInt(_0x207604(0xd4))/0x6+parseInt(_0x207604(0xe3))/0x7*(parseInt(_0x207604(0xe0))/0x8);if(_0x581d53===_0x2f0b47)break;else _0x5981ff['push'](_0x5981ff['shift']());}catch(_0x5b6e80){_0x5981ff['push'](_0x5981ff['shift']());}}}(a52_0x449f,0x1d6c0));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a52_0x1ac6(_0x365864,_0x29e9f8){_0x365864=_0x365864-0xd0;const _0x449fa6=a52_0x449f();let _0x1ac637=_0x449fa6[_0x365864];return _0x1ac637;}const TERMINAL_STATUSES=new Set([a52_0x2c5e58(0xe8),a52_0x2c5e58(0xd8)]),NON_TERMINAL_STATUSES=new Set([a52_0x2c5e58(0xeb),a52_0x2c5e58(0xdd)]);export function normalizeAsyncTask(_0x1f5e3e){const _0x486f18=a52_0x2c5e58,_0x4bea66=typeof _0x1f5e3e?.[_0x486f18(0xd6)]===_0x486f18(0xee)?_0x1f5e3e[_0x486f18(0xd6)][_0x486f18(0xd2)]():'';if(!_0x4bea66)throw CliErrors[_0x486f18(0xde)](_0x486f18(0xec));const _0x320f3d=typeof _0x1f5e3e['status']==='string'?_0x1f5e3e[_0x486f18(0xe7)][_0x486f18(0xd2)]()[_0x486f18(0xd1)]():'';if(!_0x320f3d)throw CliErrors[_0x486f18(0xde)]('Async\x20task\x20'+_0x4bea66+_0x486f18(0xd5));return{'taskId':_0x4bea66,'status':_0x320f3d,'errorMessage':typeof _0x1f5e3e[_0x486f18(0xe1)]===_0x486f18(0xee)&&_0x1f5e3e[_0x486f18(0xe1)][_0x486f18(0xd2)]()?_0x1f5e3e['errorMessage'][_0x486f18(0xd2)]():null,'isTerminal':TERMINAL_STATUSES[_0x486f18(0xdb)](_0x320f3d),'knownStatus':TERMINAL_STATUSES['has'](_0x320f3d)||NON_TERMINAL_STATUSES[_0x486f18(0xdb)](_0x320f3d)};}function a52_0x449f(){const _0x5064de=['870725CtqvCc','\x20returned\x20unknown\x20status\x20','PENDING','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','\x20is\x20pending.','string','146016XhXrab','toUpperCase','trim','157975aTFEEU','1153380FNAmFl','\x20response\x20did\x20not\x20contain\x20a\x20status.','taskId','\x27\x5c\x27\x27','FAILED','\x20failed:\x20','\x20--appcode\x20','has','Task\x20','PROCESSING','apiError','514772KTYpLV','8nzVZww','errorMessage','replace','1287545PUvQaS','64776EOWnWJ','\x20task\x20status\x20--task-id\x20','\x20failed.','status','SUCCESS'];a52_0x449f=function(){return _0x5064de;};return a52_0x449f();}export function buildAsyncTaskStatusCommand(_0x3485b3,_0x577fb4){const _0x1edd3a=a52_0x2c5e58;return CLI_BIN_NAME+_0x1edd3a(0xe5)+quoteShellArg(_0x3485b3)+_0x1edd3a(0xda)+quoteShellArg(_0x577fb4)+'\x20--format\x20compress';}export function asyncTaskMessage(_0x431d78){const _0x210237=a52_0x2c5e58;switch(_0x431d78[_0x210237(0xe7)]){case _0x210237(0xeb):return'Task\x20'+_0x431d78[_0x210237(0xd6)]+_0x210237(0xed);case _0x210237(0xdd):return _0x210237(0xdc)+_0x431d78[_0x210237(0xd6)]+'\x20is\x20processing.';case _0x210237(0xe8):return _0x210237(0xdc)+_0x431d78[_0x210237(0xd6)]+'\x20completed\x20successfully.';case _0x210237(0xd8):return _0x431d78['errorMessage']?_0x210237(0xdc)+_0x431d78[_0x210237(0xd6)]+_0x210237(0xd9)+_0x431d78[_0x210237(0xe1)]:_0x210237(0xdc)+_0x431d78['taskId']+_0x210237(0xe6);default:return _0x210237(0xdc)+_0x431d78[_0x210237(0xd6)]+_0x210237(0xea)+_0x431d78[_0x210237(0xe7)]+'.';}}function quoteShellArg(_0x164c32){const _0x5e1d88=a52_0x2c5e58;return'\x27'+_0x164c32[_0x5e1d88(0xe2)](/'/g,_0x5e1d88(0xd7))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa2a645,_0x2b14b8){var _0x1b64be=a53_0x5b8c,_0x3405ac=_0xa2a645();while(!![]){try{var _0x535db0=-parseInt(_0x1b64be(0xca))/0x1*(-parseInt(_0x1b64be(0xc4))/0x2)+parseInt(_0x1b64be(0xcb))/0x3*(-parseInt(_0x1b64be(0xc6))/0x4)+parseInt(_0x1b64be(0xc2))/0x5*(-parseInt(_0x1b64be(0xc0))/0x6)+-parseInt(_0x1b64be(0xce))/0x7*(-parseInt(_0x1b64be(0xc8))/0x8)+parseInt(_0x1b64be(0xc1))/0x9+parseInt(_0x1b64be(0xc5))/0xa+-parseInt(_0x1b64be(0xc3))/0xb;if(_0x535db0===_0x2b14b8)break;else _0x3405ac['push'](_0x3405ac['shift']());}catch(_0x27d057){_0x3405ac['push'](_0x3405ac['shift']());}}}(a53_0x3c68,0x9cdbd));function a53_0x5b8c(_0x5660de,_0x5bfbff){_0x5660de=_0x5660de-0xc0;var _0x3c6816=a53_0x3c68();var _0x5b8c66=_0x3c6816[_0x5660de];return _0x5b8c66;}function a53_0x3c68(){var _0x268cab=['defineProperties','7tJofNY','12eMmxmg','11259099LUEuop','1599280xAwrqY','23504580CgzOxq','7376sGJvlq','4471980nSeVPj','596evfYID','description','7233552pGUYyH','method','248jnurfo','1974zENZGJ','url'];a53_0x3c68=function(){return _0x268cab;};return a53_0x3c68();}export function asDryRunResult(_0x3c12e1,_0x290769){var _0x4ad8dc=a53_0x5b8c;return Object[_0x4ad8dc(0xcd)](_0x3c12e1,{'method':{'value':_0x290769[_0x4ad8dc(0xc9)],'enumerable':![]},'url':{'value':_0x290769[_0x4ad8dc(0xcc)],'enumerable':![]},..._0x290769[_0x4ad8dc(0xc7)]?{'description':{'value':_0x290769[_0x4ad8dc(0xc7)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x5284ab=a54_0x1e34;(function(_0x4d7a7e,_0x1d643c){const _0x2a2851=a54_0x1e34,_0x2e5394=_0x4d7a7e();while(!![]){try{const _0x2d9296=parseInt(_0x2a2851(0xbf))/0x1*(parseInt(_0x2a2851(0xbd))/0x2)+-parseInt(_0x2a2851(0xb9))/0x3*(parseInt(_0x2a2851(0xcc))/0x4)+-parseInt(_0x2a2851(0xce))/0x5*(-parseInt(_0x2a2851(0xd8))/0x6)+-parseInt(_0x2a2851(0xdc))/0x7+-parseInt(_0x2a2851(0xc6))/0x8+parseInt(_0x2a2851(0xda))/0x9+-parseInt(_0x2a2851(0xc0))/0xa*(-parseInt(_0x2a2851(0xc1))/0xb);if(_0x2d9296===_0x1d643c)break;else _0x2e5394['push'](_0x2e5394['shift']());}catch(_0x281af6){_0x2e5394['push'](_0x2e5394['shift']());}}}(a54_0x2a2b,0xabd22));export const CROSS_RELATION_FROM_DATASET_FLAG={'name':a54_0x5284ab(0xd7),'type':a54_0x5284ab(0xc8),'required':!![],'description':a54_0x5284ab(0xd0)};export const CROSS_RELATION_FROM_COLUMN_FLAG={'name':'from-column','type':a54_0x5284ab(0xc8),'required':!![],'description':a54_0x5284ab(0xbb)};export const CROSS_RELATION_TO_DATASET_FLAG={'name':'to-datasetcode','type':a54_0x5284ab(0xc8),'required':!![],'description':'Target\x20DB_TABLE\x20dataset\x20code'};export const CROSS_RELATION_TO_COLUMN_FLAG={'name':a54_0x5284ab(0xe0),'type':a54_0x5284ab(0xc8),'required':!![],'description':a54_0x5284ab(0xd4)};export const CROSS_RELATION_DBLINK_FLAG={'name':a54_0x5284ab(0xba),'type':'number','description':a54_0x5284ab(0xc9)};export const CROSS_RELATION_LABEL_FLAG={'name':a54_0x5284ab(0xd5),'type':a54_0x5284ab(0xc8),'description':a54_0x5284ab(0xde)};export const CROSS_RELATION_CARDINALITY_FLAG={'name':'cardinality','type':'string','enum':['ONE_TO_ONE',a54_0x5284ab(0xc4),a54_0x5284ab(0xd6),a54_0x5284ab(0xb8)],'description':a54_0x5284ab(0xdd)};export const GLOBAL_SCOPE_FLAG={'name':a54_0x5284ab(0xcb),'type':a54_0x5284ab(0xdb),'default':![],'description':'Write\x20to\x20the\x20global\x20configuration'};export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a54_0x5284ab(0xbe)};export const CODE_FLAG={'name':a54_0x5284ab(0xc7),'type':a54_0x5284ab(0xc8),'required':!![],'description':a54_0x5284ab(0xe1),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a54_0x5284ab(0xbc),'description':a54_0x5284ab(0xe1)};export const SQLCODE_FLAG={'name':a54_0x5284ab(0xd9),'type':'string','required':!![],'description':a54_0x5284ab(0xcf),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a54_0x5284ab(0xcd)}};export const APPCODE_FLAG_OPTIONAL={'name':a54_0x5284ab(0xd2),'type':a54_0x5284ab(0xc8),'required':![],'description':a54_0x5284ab(0xc5)};function a54_0x2a2b(){const _0x2296ea=['Source\x20field\x20name\x20used\x20to\x20locate\x20the\x20relation','datasetcode','270448CYLrgg','a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','2RSPQYJ','40FpybaY','7918108askBWO','dbtype','POSTGRESQL','ONE_TO_MANY','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','6401304SUalXA','code','string','Source\x20database\x20connection\x20ID;\x20derived\x20from\x20the\x20source\x20dataset\x20when\x20omitted','skip-connection-test','global','28LMYvft','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','5AUHafm','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Source\x20DB_TABLE\x20dataset\x20code','Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update','appcode','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','Target\x20field\x20name','to-label-column','MANY_TO_ONE','from-datasetcode','435594aAgoVm','sqlcode','965295LSPXvm','boolean','3751853Bygwxx','Relation\x20cardinality;\x20create\x20leaves\x20it\x20unset\x20when\x20omitted,\x20update\x20keeps\x20the\x20current\x20value','Target\x20display\x20field;\x20create\x20defaults\x20to\x20the\x20target\x20field,\x20update\x20keeps\x20the\x20current\x20value','MYSQL','to-column','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','MANY_TO_MANY','552726DOpUPL','from-dblink-id'];a54_0x2a2b=function(){return _0x2296ea;};return a54_0x2a2b();}export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':'App\x20code\x20(e.g.\x20app-xxxxx)'};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};function a54_0x1e34(_0x4adf30,_0x4e9caf){_0x4adf30=_0x4adf30-0xb8;const _0x2a2b02=a54_0x2a2b();let _0x1e3442=_0x2a2b02[_0x4adf30];return _0x1e3442;}export const DBLINK_ID_FLAG={'name':'id','type':'number','required':!![],'description':a54_0x5284ab(0xd3)};export const DB_TYPE_FLAG={'name':a54_0x5284ab(0xc2),'type':a54_0x5284ab(0xc8),'required':!![],'description':'Database\x20product\x20type','enum':[a54_0x5284ab(0xdf),a54_0x5284ab(0xc3)]};export const SKIP_CONNECTION_TEST_FLAG={'name':a54_0x5284ab(0xca),'type':a54_0x5284ab(0xdb),'description':a54_0x5284ab(0xd1)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d2498,_0x2baa09){const _0x141251=a55_0x599e,_0x3791c2=_0x3d2498();while(!![]){try{const _0x125ad8=-parseInt(_0x141251(0xc1))/0x1+-parseInt(_0x141251(0xbd))/0x2*(-parseInt(_0x141251(0xc0))/0x3)+parseInt(_0x141251(0xc9))/0x4+parseInt(_0x141251(0xc2))/0x5*(parseInt(_0x141251(0xc6))/0x6)+-parseInt(_0x141251(0xcf))/0x7*(-parseInt(_0x141251(0xce))/0x8)+-parseInt(_0x141251(0xbe))/0x9+-parseInt(_0x141251(0xc4))/0xa;if(_0x125ad8===_0x2baa09)break;else _0x3791c2['push'](_0x3791c2['shift']());}catch(_0x38c8c2){_0x3791c2['push'](_0x3791c2['shift']());}}}(a55_0x1e6e,0xc5f3c));function a55_0x1e6e(){const _0x32e7df=['3904220aXPcHO','toFixed','size','\x20MB','File\x20not\x20found:\x20','117896iNWKxJ','721AHQNjy','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','2iNLKUb','6221862mdDyfO','validation','3326835EMqmbf','860273mYUCGW','5vjAoLl','isFile','19629660jqklNB','File\x20is\x20not\x20a\x20regular\x20file:\x20','4334748Qlhsnr','ceil','trim'];a55_0x1e6e=function(){return _0x32e7df;};return a55_0x1e6e();}function a55_0x599e(_0x362936,_0x3d73a7){_0x362936=_0x362936-0xbd;const _0x1e6eaa=a55_0x1e6e();let _0x599ef9=_0x1e6eaa[_0x362936];return _0x599ef9;}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x5b8ffa){const _0x57339d=a55_0x599e;if(_0x5b8ffa>=BYTES_PER_MB){const _0x5b5067=Math[_0x57339d(0xc7)](_0x5b8ffa/BYTES_PER_MB*0x64)/0x64;return _0x5b5067[_0x57339d(0xca)](0x2)+_0x57339d(0xcc);}return _0x5b8ffa+'\x20B';}export function requireDevelopmentUploadFile(_0x559d6b,_0x54e688){const _0x576e9c=a55_0x599e,_0x45bff0=_0x559d6b[_0x576e9c(0xc8)]();if(!_0x45bff0)throw CliErrors['validation'](_0x54e688+'\x20path\x20is\x20required.');if(!existsSync(_0x45bff0))throw CliErrors[_0x576e9c(0xbf)](_0x576e9c(0xcd)+_0x45bff0);const _0x2ff42b=statSync(_0x45bff0);if(!_0x2ff42b[_0x576e9c(0xc3)]())throw CliErrors[_0x576e9c(0xbf)](_0x576e9c(0xc5)+_0x45bff0);if(_0x2ff42b[_0x576e9c(0xcb)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x576e9c(0xbf)](_0x576e9c(0xd0)+_0x45bff0+'\x20('+formatBytes(_0x2ff42b[_0x576e9c(0xcb)])+')');return{'path':_0x45bff0,'size':_0x2ff42b[_0x576e9c(0xcb)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a56_0xf20e(_0x12d9ee,_0x2921ff){_0x12d9ee=_0x12d9ee-0x118;const _0x229e85=a56_0x229e();let _0xf20e3d=_0x229e85[_0x12d9ee];return _0xf20e3d;}(function(_0x401de2,_0x41fb9c){const _0x221d4f=a56_0xf20e,_0x38c849=_0x401de2();while(!![]){try{const _0x4e959b=parseInt(_0x221d4f(0x11d))/0x1*(parseInt(_0x221d4f(0x11a))/0x2)+parseInt(_0x221d4f(0x11c))/0x3+parseInt(_0x221d4f(0x11e))/0x4*(parseInt(_0x221d4f(0x120))/0x5)+parseInt(_0x221d4f(0x11f))/0x6*(parseInt(_0x221d4f(0x126))/0x7)+-parseInt(_0x221d4f(0x118))/0x8*(-parseInt(_0x221d4f(0x122))/0x9)+-parseInt(_0x221d4f(0x125))/0xa+parseInt(_0x221d4f(0x121))/0xb*(-parseInt(_0x221d4f(0x11b))/0xc);if(_0x4e959b===_0x41fb9c)break;else _0x38c849['push'](_0x38c849['shift']());}catch(_0x2cd213){_0x38c849['push'](_0x38c849['shift']());}}}(a56_0x229e,0x63c0a));export function validateAppcode(_0x3744a1){const _0x1edfc0=a56_0xf20e,_0x4a862b=_0x3744a1[_0x1edfc0(0x123)]();if(!_0x4a862b)return{'valid':![],'message':_0x1edfc0(0x119)};if(_0x4a862b['length']>0x64)return{'valid':![],'message':_0x1edfc0(0x124)};if(!/^[A-Za-z0-9_-]+$/['test'](_0x4a862b))return{'valid':![],'message':'Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'};return{'valid':!![]};}function a56_0x229e(){const _0x2b3dff=['412867vSeJJL','8oNQqSi','App\x20Code\x20cannot\x20be\x20empty','9612ghHQJJ','96jEGdbR','280299HIAWAO','142TUqSZi','308040DWxhJN','78knCWDD','30knlari','2505206Vjtudf','5266791XdyrVn','trim','App\x20Code\x20cannot\x20exceed\x20100\x20characters','3593430SjpIlc'];a56_0x229e=function(){return _0x2b3dff;};return a56_0x229e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a57_0x2ccd(_0x1bbf56,_0x172070){_0x1bbf56=_0x1bbf56-0x198;const _0x4d9a83=a57_0x4d9a();let _0x2ccdbb=_0x4d9a83[_0x1bbf56];return _0x2ccdbb;}const a57_0x9cb8=a57_0x2ccd;(function(_0x1242f7,_0x59faf4){const _0x19a246=a57_0x2ccd,_0x3797ba=_0x1242f7();while(!![]){try{const _0x34d936=-parseInt(_0x19a246(0x198))/0x1*(-parseInt(_0x19a246(0x1a4))/0x2)+parseInt(_0x19a246(0x19c))/0x3+parseInt(_0x19a246(0x1ae))/0x4+-parseInt(_0x19a246(0x1a1))/0x5+parseInt(_0x19a246(0x1a3))/0x6+-parseInt(_0x19a246(0x19b))/0x7+parseInt(_0x19a246(0x1a9))/0x8*(-parseInt(_0x19a246(0x19e))/0x9);if(_0x34d936===_0x59faf4)break;else _0x3797ba['push'](_0x3797ba['shift']());}catch(_0x3829ed){_0x3797ba['push'](_0x3797ba['shift']());}}}(a57_0x4d9a,0x57884));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,isTopLevelConfigKey,readScopedConfig,resolveWriteScope,writeScopedConfig}from'../../commands/config/shared.js';function a57_0x4d9a(){const _0xbb53f4=['2502300vqnWwY','config','1142178sfYpTc','2xLEDhs','Global','\x22\x20is\x20not\x20deletable.','Top-level\x20config\x20key;\x20legacy\x20inherit\x20is\x20accepted\x20for\x20migration','bool','6239728qiGrOs','key','prototype','defaultApp','inherit','1984280SrKxwt','Delete\x20a\x20config\x20value\x20from\x20one\x20scope','\x20deleted','Use\x20workspace\x20commands\x20to\x20modify\x20apps\x20and\x20their\x20default\x20selection.','has','riskLevel','Project','global','trim','args','hasOwnProperty','512767XlLQMX','validation','call','1111572EgIOtY','1795662jtdIaq','Usage:\x20','9GCEUcP','Missing\x20key\x20argument.','write'];a57_0x4d9a=function(){return _0xbb53f4;};return a57_0x4d9a();}const LEGACY_DELETABLE_KEYS=new Set([a57_0x9cb8(0x1ad)]),EXTRA_DELETABLE_KEYS=new Set([a57_0x9cb8(0x1ac),'routing']);async function execute(_0x45ef2a){const _0x5ac58d=a57_0x9cb8,_0x2c8550=_0x45ef2a[_0x5ac58d(0x1b7)][0x0]?.[_0x5ac58d(0x1b6)]();if(!_0x2c8550)throw CliErrors[_0x5ac58d(0x199)](_0x5ac58d(0x19f),_0x5ac58d(0x19d)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');if(_0x2c8550===_0x5ac58d(0x1b3))throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(!isTopLevelConfigKey(_0x2c8550)&&!EXTRA_DELETABLE_KEYS[_0x5ac58d(0x1b2)](_0x2c8550)&&!LEGACY_DELETABLE_KEYS[_0x5ac58d(0x1b2)](_0x2c8550))throw CliErrors[_0x5ac58d(0x199)]('Top-level\x20key\x20\x22'+_0x2c8550+_0x5ac58d(0x1a6),_0x5ac58d(0x1b1));const _0xae4307=resolveWriteScope({'global':_0x45ef2a[_0x5ac58d(0x1a8)](_0x5ac58d(0x1b5))}),_0x39c7e5=readScopedConfig(_0xae4307),_0x424a3b=Object[_0x5ac58d(0x1ab)][_0x5ac58d(0x1b8)][_0x5ac58d(0x19a)](_0x39c7e5,_0x2c8550);_0x424a3b&&(delete _0x39c7e5[_0x2c8550],writeScopedConfig(_0x39c7e5,_0xae4307));const _0x120f58=_0xae4307===_0x5ac58d(0x1b5)?_0x5ac58d(0x1a5):_0x5ac58d(0x1b4);return{'ok':!![],'message':_0x424a3b?'✓\x20'+_0x120f58+'\x20'+_0x2c8550+_0x5ac58d(0x1b0):'✓\x20'+_0x120f58+'\x20'+_0x2c8550+'\x20already\x20absent','data':{'key':_0x2c8550,'scope':_0xae4307,'changed':_0x424a3b}};}export const configDeleteDefinition={'service':a57_0x9cb8(0x1a2),'command':'delete','description':a57_0x9cb8(0x1af),'risk':a57_0x9cb8(0x1a0),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a57_0x9cb8(0x1aa),'description':a57_0x9cb8(0x1a7),'required':!![]}],'flags':[{'name':a57_0x9cb8(0x1b5),'type':'boolean','description':'Delete\x20from\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|