@lovrabet/rabetbase-cli 2.5.1-beta.4 → 2.5.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -1
- package/lib/api/api-doc.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.d.ts +0 -1
- package/lib/api/generate-sdk-config-file.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/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.d.ts +2 -0
- 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.d.ts +2 -0
- 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/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/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/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.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/template.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/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- 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.d.ts +2 -0
- package/lib/commands/project/domain-routing-sync.js +1 -0
- 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.d.ts +2 -0
- package/lib/commands/rule/get.js +1 -0
- package/lib/commands/rule/index.d.ts +2 -0
- package/lib/commands/rule/index.js +1 -0
- package/lib/commands/rule/list.d.ts +2 -0
- package/lib/commands/rule/list.js +1 -0
- package/lib/commands/rule/set.d.ts +2 -0
- package/lib/commands/rule/set.js +1 -0
- package/lib/commands/rule/shared.d.ts +43 -0
- package/lib/commands/rule/shared.js +1 -0
- 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/deployment-sync.js +1 -1
- package/lib/config/domain-config.d.ts +37 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +27 -0
- package/lib/config/project-domain-routing.js +1 -0
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +10 -4
- 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.d.ts +4 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +43 -49
- 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.d.ts +2 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +21 -0
- 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/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.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/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/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +83 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- 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/types/index.d.ts +0 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/rabetbase/SKILL.md +15 -12
- package/skills/rabetbase/guides/sdk-client-generation.md +10 -8
- package/skills/rabetbase/references/rabetbase-api-pull.md +16 -11
- package/skills/rabetbase/references/rabetbase-config.md +3 -3
- package/skills/rabetbase/references/rabetbase-database-template.md +36 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -0
- package/skills/rabetbase/references/rabetbase-init.md +32 -8
- package/skills/rabetbase/references/rabetbase-project-create.md +33 -8
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +28 -0
- package/skills/rabetbase/references/rabetbase-rule.md +64 -0
- package/skills/rabetbase.manifest.json +6 -3
- package/lib/config/project-routing.d.ts +0 -30
- package/lib/config/project-routing.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x4703a4=a32_0x5b91;(function(_0xd564db,_0x4b194d){const _0x56397c=a32_0x5b91,_0x34f5a3=_0xd564db();while(!![]){try{const _0x765973=parseInt(_0x56397c(0xd1))/0x1+-parseInt(_0x56397c(0xe3))/0x2+-parseInt(_0x56397c(0xdf))/0x3+-parseInt(_0x56397c(0xe0))/0x4*(-parseInt(_0x56397c(0xcd))/0x5)+parseInt(_0x56397c(0xda))/0x6+-parseInt(_0x56397c(0xc4))/0x7*(-parseInt(_0x56397c(0xd9))/0x8)+-parseInt(_0x56397c(0xd3))/0x9;if(_0x765973===_0x4b194d)break;else _0x34f5a3['push'](_0x34f5a3['shift']());}catch(_0x107262){_0x34f5a3['push'](_0x34f5a3['shift']());}}}(a32_0x156b,0x40127));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a32_0x156b(){const _0x5ae6bc=['Function\x20not\x20found:\x20','apps','56CAkUUT','2517528zxiXrI','No\x20lock\x20entry\x20found\x20for\x20\x22','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','/api/management/library/scripts/delete','target','440076cHLUcQ','123868trAaRM','trashedTo','filter','663914HkPEsl','toISOString','<timestamp>','validation','\x22\x20not\x20found\x20after\x20ensureLockScope.','str','includes','map','appCode','high-risk-write','bff','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','lockFilePath','length','Deleted\x20','split','Lock\x20scope\x20for\x20app\x20\x22','472024FYiIiR','POST','trashDir','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','\x20\x20-\x20','stringify','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Backend\x20Function\x20lock\x20file\x20not\x20found.','remoteId','45phfpFQ','delete','string','scriptsRoot','459075YMIMDL','replace','7994718OAvsAY','functions','projectRoot','keys'];a32_0x156b=function(){return _0x5ae6bc;};return a32_0x156b();}import{dirname,join,relative,resolve,sep}from'node:path';function a32_0x5b91(_0x26853b,_0x5450f8){_0x26853b=_0x26853b-0xb6;const _0x156bfc=a32_0x156b();let _0x5b9179=_0x156bfc[_0x26853b];return _0x5b9179;}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a32_0x4703a4(0xbd),'command':a32_0x4703a4(0xce),'description':a32_0x4703a4(0xbe),'risk':a32_0x4703a4(0xbc),'flags':[{'name':a32_0x4703a4(0xde),'type':a32_0x4703a4(0xcf),'required':!![],'description':a32_0x4703a4(0xdc)}],async 'validate'(_0x22f2eb){const _0x43fde1=a32_0x4703a4,_0x40508b=loadBffProjectConfig(_0x22f2eb['appCode']),_0x16def2=await readBffLockFile(_0x40508b[_0x43fde1(0xbf)]);if(!_0x16def2)throw CliErrors[_0x43fde1(0xb6)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x5505e2){const _0x51134b=a32_0x4703a4,_0x2f70e7=loadBffProjectConfig(_0x5505e2[_0x51134b(0xbb)]),_0x2c63b7=await readBffLockFile(_0x2f70e7[_0x51134b(0xbf)]);if(!_0x2c63b7)throw CliErrors[_0x51134b(0xb6)](_0x51134b(0xcb));const {appLock:_0x147e9b}=ensureLockScope(_0x2c63b7,_0x5505e2['appCode'],_0x2f70e7[_0x51134b(0xd0)],_0x51134b(0xce)),_0x4d2a25=_0x5505e2[_0x51134b(0xb8)](_0x51134b(0xde)),_0x1c8c39=Object[_0x51134b(0xd6)](_0x147e9b['functions']),_0x1ad855=resolveDeleteTarget(_0x4d2a25,_0x1c8c39),_0x367dcf=_0x147e9b[_0x51134b(0xd4)][_0x1ad855];if(!_0x367dcf)throw CliErrors['validation'](_0x51134b(0xdb)+_0x1ad855+'\x22.');const _0x103c50=resolveLocalFilePathFromLockKey(_0x2f70e7,_0x1ad855),_0x2f6d7b=relative(_0x2f70e7[_0x51134b(0xd5)],_0x103c50),_0x21fbfd=join(_0x2f70e7['trashDir'],_0x51134b(0xe5),_0x2f6d7b);return{'method':_0x51134b(0xc5),'url':_0x51134b(0xdd),'body':{'appCode':_0x5505e2[_0x51134b(0xbb)],'target':_0x1ad855,'remoteId':_0x367dcf[_0x51134b(0xcc)],'localFilePath':_0x103c50,'trashedPath':_0x21fbfd},'description':'Would\x20delete\x20'+_0x1ad855+_0x51134b(0xc7)};},async 'execute'(_0x34d79f){const _0x5561e6=a32_0x4703a4,_0x3bd11c=loadBffProjectConfig(_0x34d79f[_0x5561e6(0xbb)]),_0x561030=await readBffLockFile(_0x3bd11c[_0x5561e6(0xbf)]);if(!_0x561030)throw CliErrors[_0x5561e6(0xb6)](_0x5561e6(0xcb));const {lockData:_0x1be941,appLock:_0x53e4f8}=ensureLockScope(_0x561030,_0x34d79f[_0x5561e6(0xbb)],_0x3bd11c[_0x5561e6(0xd0)],'delete'),_0x499f86=JSON['parse'](JSON[_0x5561e6(0xc9)](_0x1be941)),_0x2f0769=_0x499f86[_0x5561e6(0xd8)][_0x34d79f[_0x5561e6(0xbb)]];if(!_0x2f0769)throw new Error(_0x5561e6(0xc3)+_0x34d79f['appCode']+_0x5561e6(0xb7));const _0x12fc45=_0x34d79f['str'](_0x5561e6(0xde)),_0x3270bd=Object[_0x5561e6(0xd6)](_0x2f0769[_0x5561e6(0xd4)]),_0x3dc170=resolveDeleteTarget(_0x12fc45,_0x3270bd),_0x462684=_0x2f0769[_0x5561e6(0xd4)][_0x3dc170];if(!_0x462684)throw CliErrors[_0x5561e6(0xb6)](_0x5561e6(0xdb)+_0x3dc170+'\x22.');await deleteBffScript(_0x462684['remoteId']),delete _0x2f0769[_0x5561e6(0xd4)][_0x3dc170],_0x2f0769['lastSync']=new Date()[_0x5561e6(0xe4)](),await writeBffLockFile(_0x3bd11c[_0x5561e6(0xbf)],_0x499f86);const _0x4cc6fb=resolveLocalFilePathFromLockKey(_0x3bd11c,_0x3dc170);let _0x119f1b;await fileExists(_0x4cc6fb)&&(_0x119f1b=await moveToTrash(_0x3bd11c[_0x5561e6(0xd5)],_0x3bd11c[_0x5561e6(0xc6)],_0x4cc6fb),await cleanupEmptyDirectories(dirname(_0x4cc6fb),_0x3bd11c['scriptsRootDir']));await waitForDeleteSettlement(_0x3bd11c[_0x5561e6(0xbf)],_0x34d79f[_0x5561e6(0xbb)],_0x3dc170,_0x4cc6fb),await sleep(0x96);const _0x3baa6b={'deleted':_0x3dc170,'remoteId':_0x462684['remoteId']};if(_0x119f1b)_0x3baa6b[_0x5561e6(0xe1)]=_0x119f1b;return{'ok':!![],'data':_0x3baa6b,'message':_0x5561e6(0xc1)+_0x3dc170+(_0x119f1b?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x7cb706,_0xab2c93){const _0x2154c4=a32_0x4703a4;if(_0x7cb706[_0x2154c4(0xb9)]('/')){const _0x1167f7=_0xab2c93['find'](_0x5a2ee8=>_0x5a2ee8===_0x7cb706);if(!_0x1167f7)throw CliErrors[_0x2154c4(0xb6)](_0x2154c4(0xd7)+_0x7cb706);return _0x1167f7;}const _0x51ac13=_0xab2c93[_0x2154c4(0xe2)](_0x1e5f32=>_0x1e5f32[_0x2154c4(0xc2)]('/')['at'](-0x1)===_0x7cb706);if(_0x51ac13[_0x2154c4(0xc0)]===0x0)throw CliErrors[_0x2154c4(0xb6)](_0x2154c4(0xd7)+_0x7cb706);if(_0x51ac13['length']>0x1)throw CliErrors[_0x2154c4(0xb6)]('Multiple\x20functions\x20match\x20\x22'+_0x7cb706+_0x2154c4(0xca)+_0x51ac13[_0x2154c4(0xba)](_0x16e0ce=>_0x2154c4(0xc8)+_0x16e0ce)['join']('\x0a'));return _0x51ac13[0x0];}async function moveToTrash(_0x5c4a7c,_0x5cbf50,_0x497077){const _0x13ac19=a32_0x4703a4,_0x42b16f=new Date()[_0x13ac19(0xe4)]()[_0x13ac19(0xd2)](/[:.]/g,'-'),_0x5c26aa=relative(_0x5c4a7c,_0x497077),_0x3c0b45=join(_0x5cbf50,_0x42b16f,_0x5c26aa);return await mkdir(dirname(_0x3c0b45),{'recursive':!![]}),await rename(_0x497077,_0x3c0b45),_0x3c0b45;}async function cleanupEmptyDirectories(_0x27bc8d,_0x15946d){const _0x39e42a=a32_0x4703a4;let _0x3ebafc=resolve(_0x27bc8d);const _0x1cd20e=resolve(_0x15946d);while(_0x3ebafc['startsWith'](''+_0x1cd20e+sep)||_0x3ebafc===_0x1cd20e){if(_0x3ebafc===_0x1cd20e)return;try{const _0x409064=await readdir(_0x3ebafc);if(_0x409064[_0x39e42a(0xc0)]>0x0)return;await rmdir(_0x3ebafc);}catch{return;}_0x3ebafc=dirname(_0x3ebafc);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x134ff0,_0x262212,_0xdae17a,_0x40fe64){const _0x369312=a32_0x4703a4;for(let _0x291aaa=0x0;_0x291aaa<DELETE_SETTLE_RETRY_COUNT;_0x291aaa+=0x1){const _0x5e3b37=await readBffLockFile(_0x134ff0),_0x5b1e12=!!_0x5e3b37?.[_0x369312(0xd8)]?.[_0x262212]?.[_0x369312(0xd4)]?.[_0xdae17a],_0x4ef0b3=await fileExists(_0x40fe64);if(!_0x5b1e12&&!_0x4ef0b3)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0xdae17a+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0x2c323e=a33_0x908f;function a33_0x908f(_0x502d3a,_0x22c8a5){_0x502d3a=_0x502d3a-0x8d;const _0x4e2024=a33_0x4e20();let _0x908f2c=_0x4e2024[_0x502d3a];return _0x908f2c;}(function(_0x4f26a9,_0x1fbd56){const _0x42f53b=a33_0x908f,_0x3590d7=_0x4f26a9();while(!![]){try{const _0x48817b=-parseInt(_0x42f53b(0xa2))/0x1+-parseInt(_0x42f53b(0x98))/0x2+parseInt(_0x42f53b(0xa1))/0x3+-parseInt(_0x42f53b(0x9c))/0x4+-parseInt(_0x42f53b(0x8d))/0x5+parseInt(_0x42f53b(0xa0))/0x6*(-parseInt(_0x42f53b(0x8f))/0x7)+-parseInt(_0x42f53b(0x9d))/0x8*(-parseInt(_0x42f53b(0x9a))/0x9);if(_0x48817b===_0x1fbd56)break;else _0x3590d7['push'](_0x3590d7['shift']());}catch(_0x3255be){_0x3590d7['push'](_0x3590d7['shift']());}}}(a33_0x4e20,0x4a6ea));import{getBffScriptInfo}from'../../core/api-client.js';function a33_0x4e20(){const _0x18c54a=['248008HkMFYN','version','number','36695guipSw','verbose','1812797fwHwxn','description','num','read','bff','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','updateUserName','Script\x20ID','createdTime','118152KnJPaa','bool','8514tTJsVv','(none)','458176JyYxfb','5752tYsBWJ','scriptType','appCode','6kTHcyL','937914tzMHxR'];a33_0x4e20=function(){return _0x18c54a;};return a33_0x4e20();}export const bffDetail={'service':a33_0x2c323e(0x93),'command':'detail','description':a33_0x2c323e(0x94),'risk':a33_0x2c323e(0x92),'flags':[{'name':'id','type':a33_0x2c323e(0xa4),'required':!![],'description':a33_0x2c323e(0x96)},{'name':a33_0x2c323e(0x8e),'type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x2d4e65){const _0x4d74ac=a33_0x2c323e,_0x34faeb=await getBffScriptInfo(_0x2d4e65[_0x4d74ac(0x91)]('id')),_0x1b829a=_0x2d4e65[_0x4d74ac(0x99)](_0x4d74ac(0x8e));if(_0x1b829a)return{'ok':!![],'data':_0x34faeb};return{'ok':!![],'data':{'id':_0x34faeb['id'],'functionName':_0x34faeb['functionName']??'','version':_0x34faeb[_0x4d74ac(0xa3)]??'','updateUserName':_0x34faeb[_0x4d74ac(0x95)]??'','appCode':_0x34faeb[_0x4d74ac(0x9f)],'scriptType':_0x34faeb[_0x4d74ac(0x9e)],'description':_0x34faeb[_0x4d74ac(0x90)]||_0x4d74ac(0x9b),'createdTime':_0x34faeb[_0x4d74ac(0x97)]??'','updatedTime':_0x34faeb['updatedTime']??'','scriptContent':_0x34faeb['scriptContent']??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4679f6,_0x5cf226){const _0x5303f4=a34_0x2712,_0x10f5f5=_0x4679f6();while(!![]){try{const _0x590bc2=-parseInt(_0x5303f4(0x7e))/0x1+-parseInt(_0x5303f4(0x78))/0x2*(-parseInt(_0x5303f4(0x82))/0x3)+-parseInt(_0x5303f4(0x79))/0x4*(parseInt(_0x5303f4(0x7a))/0x5)+parseInt(_0x5303f4(0x7b))/0x6*(parseInt(_0x5303f4(0x7c))/0x7)+parseInt(_0x5303f4(0x7f))/0x8+parseInt(_0x5303f4(0x80))/0x9*(-parseInt(_0x5303f4(0x7d))/0xa)+-parseInt(_0x5303f4(0x77))/0xb*(-parseInt(_0x5303f4(0x81))/0xc);if(_0x590bc2===_0x5cf226)break;else _0x10f5f5['push'](_0x10f5f5['shift']());}catch(_0x22708f){_0x10f5f5['push'](_0x10f5f5['shift']());}}}(a34_0x54d5,0xb5f23));import{bffList}from'../../commands/bff/list.js';function a34_0x54d5(){const _0x1f1cbc=['6SknprF','8279264cvHTpY','10ahRNIe','1346949aMywWw','6189064uXQGFs','1643193zeUBjY','12abnsjz','518754poPzUT','3738911lBtXGc','12pIeCmF','4236068IrVrHv','5NlymLi'];a34_0x54d5=function(){return _0x1f1cbc;};return a34_0x54d5();}import{bffDetail}from'../../commands/bff/detail.js';function a34_0x2712(_0x17c089,_0x552b92){_0x17c089=_0x17c089-0x77;const _0x54d5b6=a34_0x54d5();let _0x2712fa=_0x54d5b6[_0x17c089];return _0x2712fa;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x3344(_0x1101c6,_0x3cc246){_0x1101c6=_0x1101c6-0x114;const _0x138351=a35_0x1383();let _0x3344ae=_0x138351[_0x1101c6];return _0x3344ae;}const a35_0x15b4f1=a35_0x3344;(function(_0x44e217,_0xe71188){const _0x4f912e=a35_0x3344,_0xf41192=_0x44e217();while(!![]){try{const _0x194c40=parseInt(_0x4f912e(0x129))/0x1+-parseInt(_0x4f912e(0x124))/0x2*(-parseInt(_0x4f912e(0x117))/0x3)+-parseInt(_0x4f912e(0x115))/0x4+parseInt(_0x4f912e(0x12c))/0x5+parseInt(_0x4f912e(0x11b))/0x6+parseInt(_0x4f912e(0x119))/0x7*(parseInt(_0x4f912e(0x11a))/0x8)+-parseInt(_0x4f912e(0x11e))/0x9*(parseInt(_0x4f912e(0x118))/0xa);if(_0x194c40===_0xe71188)break;else _0xf41192['push'](_0xf41192['shift']());}catch(_0x59f078){_0xf41192['push'](_0xf41192['shift']());}}}(a35_0x1383,0x41c11));import{listBffScripts}from'../../core/api-client.js';function a35_0x1383(){const _0x22c3c0=['description','1040634lbrman','11660130tJbzMM','1778189gVEwgA','8qFgMqw','1659120KFSkEc','name','map','9xuCTqm','string','List\x20Backend\x20Function\x20scripts','ENDPOINT','Return\x20full\x20script\x20objects','scriptType','2JXFJff','type','No\x20Backend\x20Function\x20scripts\x20found.','COMMON','length','510835EAmdxu','Script\x20type\x20filter','(unnamed)','2310470aCTAhF','verbose','bool','str','read','1660048KOcIDH'];a35_0x1383=function(){return _0x22c3c0;};return a35_0x1383();}export const bffList={'service':'bff','command':'list','description':a35_0x15b4f1(0x120),'risk':a35_0x15b4f1(0x114),'flags':[{'name':a35_0x15b4f1(0x125),'type':'string','description':a35_0x15b4f1(0x12a),'default':a35_0x15b4f1(0x121),'enum':[a35_0x15b4f1(0x121),a35_0x15b4f1(0x127)]},{'name':a35_0x15b4f1(0x11c),'type':a35_0x15b4f1(0x11f),'description':'Filter\x20by\x20script\x20name'},{'name':a35_0x15b4f1(0x12d),'type':'boolean','description':a35_0x15b4f1(0x122)}],async 'execute'(_0xa8e27b){const _0x3042e9=a35_0x15b4f1,_0x4671e6=await listBffScripts(_0xa8e27b['appCode'],_0xa8e27b[_0x3042e9(0x12f)](_0x3042e9(0x125)),{'scriptName':_0xa8e27b[_0x3042e9(0x12f)](_0x3042e9(0x11c))||undefined}),_0x2b1821=_0xa8e27b[_0x3042e9(0x12e)]('verbose');return{'ok':!![],'data':_0x2b1821?_0x4671e6:_0x4671e6[_0x3042e9(0x11d)](_0x383706=>({'id':_0x383706['id'],'functionName':_0x383706['functionName']??'','description':_0x383706[_0x3042e9(0x116)]||_0x3042e9(0x12b),'scriptType':_0x383706[_0x3042e9(0x123)]})),'message':_0x4671e6[_0x3042e9(0x128)]===0x0?_0x3042e9(0x126):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a36_0x561587=a36_0x5ea9;function a36_0x4424(){const _0x3956a6=['390OkxJXK','Force\x20pull\x20cancelled.','stderr','1727oPjKTj','includes','stringify','Remote\x20script\x20missing\x20content.','\x22\x20not\x20found\x20after\x20ensureLockScope.','Pull\x20complete:\x20','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','skipped','apps','parse','read','hookLocation','1469237RpthZy','\x20failed','filePath','validation','operationType','4ILloba','Force\x20overwrite\x20local\x20unsynced\x20changes','444216fttIIt','datasetCode','push','functions','conflict','/api/management/library/scripts/list?appCode=','string','lockFilePath','force','5vKxnJt','2BGhfBw','Pull\x20only\x20this\x20script\x20type','scriptType','scriptsRoot','appCode','scriptContent','pull','nonInteractive','\x20skipped,\x20','alias','lastSync','unresolvable\x20target\x20path','35032luXjIE','type','bff','ENDPOINT','47673avxVxD','&type=','length','885704cWOuDd','139944Fxhdlz','functionName','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','all','close','GET','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','Remote\x20script\x20missing\x20id.','Would\x20inspect\x20','functionNode','str','message','question','hash','toLowerCase','version','bool','cancelled','HOOK','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','local\x20unsynced\x20changes','COMMON','2953023oMroyZ','toISOString','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','utf8','lockKey'];a36_0x4424=function(){return _0x3956a6;};return a36_0x4424();}(function(_0x3f3d6a,_0x4ca8fc){const _0x1abf02=a36_0x5ea9,_0x40e46a=_0x3f3d6a();while(!![]){try{const _0x200dca=-parseInt(_0x1abf02(0x199))/0x1*(-parseInt(_0x1abf02(0x1a5))/0x2)+parseInt(_0x1abf02(0x1c3))/0x3*(-parseInt(_0x1abf02(0x18d))/0x4)+parseInt(_0x1abf02(0x198))/0x5*(parseInt(_0x1abf02(0x18f))/0x6)+-parseInt(_0x1abf02(0x188))/0x7+parseInt(_0x1abf02(0x1ac))/0x8+parseInt(_0x1abf02(0x1a9))/0x9*(-parseInt(_0x1abf02(0x1c8))/0xa)+parseInt(_0x1abf02(0x1cb))/0xb*(parseInt(_0x1abf02(0x1ad))/0xc);if(_0x200dca===_0x4ca8fc)break;else _0x40e46a['push'](_0x40e46a['shift']());}catch(_0x4d1466){_0x40e46a['push'](_0x40e46a['shift']());}}}(a36_0x4424,0x9eaac));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';function a36_0x5ea9(_0xabae84,_0x474245){_0xabae84=_0xabae84-0x17d;const _0x4424fa=a36_0x4424();let _0x5ea979=_0x4424fa[_0xabae84];return _0x5ea979;}import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x561587(0x1a7),'command':a36_0x561587(0x19f),'description':a36_0x561587(0x182),'risk':a36_0x561587(0x186),'flags':[{'name':a36_0x561587(0x1a6),'type':a36_0x561587(0x195),'description':a36_0x561587(0x19a),'enum':[a36_0x561587(0x1c2),a36_0x561587(0x1a8),a36_0x561587(0x1bf)]},{'name':a36_0x561587(0x197),'type':'boolean','description':a36_0x561587(0x18e)}],async 'dryRun'(_0x77c977){const _0x121241=a36_0x561587,_0x7a4b23=loadBffProjectConfig(_0x77c977[_0x121241(0x19d)]),_0x451d15=await readBffLockFile(_0x7a4b23[_0x121241(0x196)]),{appLock:_0x51cc36}=ensureLockScope(_0x451d15??createEmptyBffLock(),_0x77c977[_0x121241(0x19d)],_0x7a4b23[_0x121241(0x19c)],'pull'),_0xbbc85e=normalizeBffType(_0x77c977[_0x121241(0x1b7)]('type'))??undefined,_0x4006d4=buildDatasetCodeToAliasMap(_0x77c977['apiDir'],_0x77c977[_0x121241(0x19d)]),[_0x5e1eda,_0x283105]=await Promise[_0x121241(0x1b0)]([listBffScripts(_0x77c977[_0x121241(0x19d)],_0xbbc85e),getBffScriptStatistics(_0x77c977[_0x121241(0x19d)])]),_0x36f4cf=createHookLocationMap(_0x283105),_0x3ac764=[];for(const _0x4d479a of _0x5e1eda){const _0x8734d=resolveRemoteScriptTarget(_0x7a4b23,_0x4d479a,_0x36f4cf,_0x51cc36[_0x121241(0x192)],_0x4006d4);if(!_0x8734d){_0x3ac764[_0x121241(0x191)]({'scriptType':_0x4d479a['scriptType'],'functionName':_0x4d479a[_0x121241(0x1ae)]??'','status':_0x121241(0x183),'reason':_0x121241(0x1a4)});continue;}const _0x361213=_0x51cc36[_0x121241(0x192)][_0x8734d[_0x121241(0x1c7)]],_0x4fdd1e=_0x4d479a[_0x121241(0x19e)]!=null?computeContentHash(_0x4d479a[_0x121241(0x19e)]):undefined,_0x5c9b20=await hasUnsyncedLocalChanges(_0x8734d[_0x121241(0x18a)],_0x361213,_0x4fdd1e);_0x3ac764['push']({'lockKey':_0x8734d[_0x121241(0x1c7)],'filePath':_0x8734d['filePath'],'remoteId':_0x4d479a['id']??null,'status':_0x5c9b20?_0x121241(0x193):'would_pull'});}return{'method':_0x121241(0x1b2),'url':_0x121241(0x194)+_0x77c977[_0x121241(0x19d)]+(_0xbbc85e?_0x121241(0x1aa)+_0xbbc85e:''),'body':{'appCode':_0x77c977[_0x121241(0x19d)],'filterType':_0xbbc85e??null,'files':_0x3ac764},'description':_0x121241(0x1b5)+_0x3ac764['length']+_0x121241(0x1af)};},async 'execute'(_0x5cc948){const _0x8613b8=a36_0x561587,_0x4582ab=loadBffProjectConfig(_0x5cc948[_0x8613b8(0x19d)]),_0x4cc9c8=await readBffLockFile(_0x4582ab[_0x8613b8(0x196)]),{lockData:_0x52f449,appLock:_0x55238b}=ensureLockScope(_0x4cc9c8??createEmptyBffLock(),_0x5cc948[_0x8613b8(0x19d)],_0x4582ab[_0x8613b8(0x19c)],'pull'),_0x5f551b=normalizeBffType(_0x5cc948[_0x8613b8(0x1b7)]('type'))??undefined;if(_0x5cc948[_0x8613b8(0x1b7)]('type')&&!_0x5f551b)throw CliErrors[_0x8613b8(0x18b)](_0x8613b8(0x1b3));const [_0x13140c,_0x57a393]=await Promise[_0x8613b8(0x1b0)]([listBffScripts(_0x5cc948['appCode'],_0x5f551b),getBffScriptStatistics(_0x5cc948[_0x8613b8(0x19d)])]);if(_0x13140c[_0x8613b8(0x1ab)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x8613b8(0x1c0)};const _0x412eb2=_0x5cc948[_0x8613b8(0x1bd)](_0x8613b8(0x197));if(_0x412eb2&&!_0x5cc948[_0x8613b8(0x1a0)]){const _0x34cd01=await confirmForce();if(!_0x34cd01)throw CliErrors[_0x8613b8(0x1be)](_0x8613b8(0x1c9));}if(_0x412eb2&&_0x5cc948[_0x8613b8(0x1a0)]){}const _0x233297=buildDatasetCodeToAliasMap(_0x5cc948['apiDir'],_0x5cc948['appCode']),_0x4d8079=createHookLocationMap(_0x57a393),_0x3c44a1=JSON[_0x8613b8(0x185)](JSON[_0x8613b8(0x17e)](_0x52f449)),_0x23b341=_0x5cc948[_0x8613b8(0x19d)],_0x4a7627=_0x3c44a1[_0x8613b8(0x184)][_0x23b341];if(!_0x4a7627)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x23b341+_0x8613b8(0x180));const _0x1e4d5b=[],_0x45fd84=[],_0x7c3097=[];for(const _0x16bf95 of _0x13140c){const _0x13a386=resolveRemoteScriptTarget(_0x4582ab,_0x16bf95,_0x4d8079,_0x55238b[_0x8613b8(0x192)],_0x233297);if(!_0x13a386){_0x45fd84[_0x8613b8(0x191)]({'lockKey':_0x16bf95[_0x8613b8(0x19b)]+'/'+_0x16bf95[_0x8613b8(0x1ae)],'reason':_0x8613b8(0x1a4)});continue;}const _0x4576c5=_0x55238b[_0x8613b8(0x192)][_0x13a386[_0x8613b8(0x1c7)]];try{if(!_0x16bf95['id'])throw new Error(_0x8613b8(0x1b4));if(_0x16bf95[_0x8613b8(0x19e)]==null)throw new Error(_0x8613b8(0x17f));const _0x52872f=_0x16bf95[_0x8613b8(0x19e)],_0x161bc7=computeContentHash(_0x52872f);if(!_0x412eb2){const _0x1db718=await hasUnsyncedLocalChanges(_0x13a386[_0x8613b8(0x18a)],_0x4576c5,_0x161bc7);if(_0x1db718){_0x45fd84['push']({'lockKey':_0x13a386['lockKey'],'reason':_0x8613b8(0x1c1)});continue;}}await ensureParentDirectory(_0x13a386[_0x8613b8(0x18a)]),await writeFile(_0x13a386[_0x8613b8(0x18a)],_0x52872f,_0x8613b8(0x1c6));const _0x1d7e32={'hash':_0x161bc7,'remoteId':_0x16bf95['id'],'version':_0x16bf95[_0x8613b8(0x1bc)]};_0x13a386[_0x8613b8(0x1a6)]===_0x8613b8(0x1bf)&&_0x13a386['hookLocation']&&(_0x1d7e32[_0x8613b8(0x1a2)]=_0x13a386[_0x8613b8(0x187)][_0x8613b8(0x1a2)],_0x1d7e32[_0x8613b8(0x190)]=_0x13a386[_0x8613b8(0x187)][_0x8613b8(0x190)],_0x1d7e32[_0x8613b8(0x18c)]=_0x13a386[_0x8613b8(0x187)][_0x8613b8(0x18c)],_0x1d7e32[_0x8613b8(0x1b6)]=_0x13a386['hookLocation'][_0x8613b8(0x1b6)]),_0x4a7627['functions'][_0x13a386['lockKey']]=_0x1d7e32,_0x1e4d5b[_0x8613b8(0x191)]({'lockKey':_0x13a386['lockKey'],'remoteId':_0x16bf95['id']});}catch(_0x4e171a){_0x7c3097[_0x8613b8(0x191)]({'lockKey':_0x13a386[_0x8613b8(0x1c7)],'error':_0x4e171a instanceof Error?_0x4e171a[_0x8613b8(0x1b8)]:String(_0x4e171a)});}}return _0x4a7627[_0x8613b8(0x1a3)]=new Date()[_0x8613b8(0x1c4)](),await writeBffLockFile(_0x4582ab[_0x8613b8(0x196)],_0x3c44a1),{'ok':_0x7c3097['length']===0x0,'data':{'pulled':_0x1e4d5b,'skipped':_0x45fd84,'failed':_0x7c3097},'message':_0x8613b8(0x181)+_0x1e4d5b[_0x8613b8(0x1ab)]+'\x20pulled,\x20'+_0x45fd84['length']+_0x8613b8(0x1a1)+_0x7c3097[_0x8613b8(0x1ab)]+_0x8613b8(0x189)};}};async function hasUnsyncedLocalChanges(_0x3195da,_0x8cf0ed,_0x2fbfbf){const _0x251f0e=a36_0x561587;if(!await fileExists(_0x3195da))return![];const _0x1dbc8a=await computeFileHash(_0x3195da);if(!_0x8cf0ed)return _0x2fbfbf?_0x1dbc8a!==_0x2fbfbf:!![];return _0x1dbc8a!==_0x8cf0ed[_0x251f0e(0x1ba)];}function buildDatasetCodeToAliasMap(_0x5879f8,_0x3b1616){const _0x114c90=a36_0x561587,_0x10f1d9=loadAliasMap(_0x5879f8,undefined,resolveApiFilePath(_0x5879f8,_0x3b1616));return new Map(_0x10f1d9['map'](_0x5f36aa=>[_0x5f36aa[_0x114c90(0x190)],_0x5f36aa[_0x114c90(0x1a2)]]));}async function confirmForce(){const _0x3c5123=a36_0x561587,_0x56a399=createInterface({'input':process['stdin'],'output':process[_0x3c5123(0x1ca)]}),_0x4c6723=await new Promise(_0x49d6e4=>{const _0x52705d=_0x3c5123;_0x56a399[_0x52705d(0x1b9)](_0x52705d(0x1c5),_0x49d6e4);});return _0x56a399[_0x3c5123(0x1b1)](),['y','yes'][_0x3c5123(0x17d)](_0x4c6723['trim']()[_0x3c5123(0x1bb)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x33896e=a37_0x2aad;(function(_0x28b26e,_0x2b8f83){const _0x5102f4=a37_0x2aad,_0x87efb2=_0x28b26e();while(!![]){try{const _0x5e8047=parseInt(_0x5102f4(0x11e))/0x1*(parseInt(_0x5102f4(0x127))/0x2)+-parseInt(_0x5102f4(0xed))/0x3*(-parseInt(_0x5102f4(0x131))/0x4)+-parseInt(_0x5102f4(0x119))/0x5*(-parseInt(_0x5102f4(0x129))/0x6)+parseInt(_0x5102f4(0x10a))/0x7+-parseInt(_0x5102f4(0xf6))/0x8+-parseInt(_0x5102f4(0x126))/0x9+-parseInt(_0x5102f4(0xf0))/0xa*(parseInt(_0x5102f4(0x125))/0xb);if(_0x5e8047===_0x2b8f83)break;else _0x87efb2['push'](_0x87efb2['shift']());}catch(_0x50d2ab){_0x87efb2['push'](_0x87efb2['shift']());}}}(a37_0x4569,0xc9b84));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a37_0x4569(){const _0x5b493f=['remoteId','6URzKMD','type','runtime\x20cache\x20not\x20needed','datasetCode','filePath','every','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','unchanged','3098696rBymIy','\x22\x20not\x20found\x20after\x20ensureLockScope.','get','cleared','lockKey','Would\x20inspect\x20','validation','utf8','string','stringify','version','lockFilePath','functions','datasetId','alias','No\x20local\x20Backend\x20Function\x20scripts\x20found.','COMMON','6fswPsW','appCode','values','21260JCQbom','runtime\x20cache\x20clear\x20failed','would_push','boolean','apiDir','set','931304pOGONE','configured','runtime\x20cache\x20cleared','bool','some','Push\x20only\x20this\x20script\x20type','aliasToDatasetCode','force','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','ENDPOINT','operationType','bff','Lock\x20scope\x20for\x20app\x20\x22','create','str','functionNode','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','push','HOOK','Local\x20function\x20not\x20found:\x20','1107316echVHi','/api/management/library/scripts/save','filter','Cannot\x20resolve\x20dataset\x20for\x20\x22','name',',\x20deployment\x20sync\x20','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','script','\x20failed,\x20','message','apps','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','code','length','parse','7896605CgYDWe','description','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','status','scriptsRoot','1RtBrsX','POST','toISOString','attempted','lastSync','hash','map','12397koJCba','13130811UtPdYV','3021562NvYKko'];a37_0x4569=function(){return _0x5b493f;};return a37_0x4569();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x33896e(0x107),'description':a37_0x33896e(0x110),'risk':'write','flags':[{'name':a37_0x33896e(0x12a),'type':a37_0x33896e(0x139),'description':a37_0x33896e(0xfb),'enum':[a37_0x33896e(0xec),a37_0x33896e(0xff),'HOOK']},{'name':a37_0x33896e(0x10e),'type':a37_0x33896e(0x139),'description':a37_0x33896e(0xfe)},{'name':a37_0x33896e(0xfd),'type':a37_0x33896e(0xf3),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'validate'(_0xc263be){validateAutomaticDeploymentSync(_0xc263be);},async 'dryRun'(_0x5b2725){const _0x21d85c=a37_0x33896e,_0x47495c=loadBffProjectConfig(_0x5b2725['appCode']),_0x2c2c73=await readBffLockFile(_0x47495c['lockFilePath']),{appLock:_0x54ed32}=ensureLockScope(_0x2c2c73??createEmptyBffLock(),_0x5b2725[_0x21d85c(0xee)],_0x47495c[_0x21d85c(0x11d)],_0x21d85c(0x107)),_0x153c84=await getTargetFunctions(_0x47495c,_0x5b2725),_0x4b0f00=_0x5b2725[_0x21d85c(0xf9)](_0x21d85c(0xfd)),_0x216f81=[],_0x308086=[];for(const _0x1eda21 of _0x153c84){const _0x402816=await computeFileHash(_0x1eda21[_0x21d85c(0x12d)]),_0x2c500d=_0x54ed32[_0x21d85c(0xe8)][_0x1eda21['lockKey']],_0x36296e=!!_0x2c500d&&_0x2c500d[_0x21d85c(0x123)]===_0x402816,_0x44845c=!_0x4b0f00&&_0x36296e?_0x21d85c(0x130):'would_push';_0x216f81['push']({'lockKey':_0x1eda21[_0x21d85c(0x135)],'filePath':_0x1eda21[_0x21d85c(0x12d)],'remoteId':_0x2c500d?.[_0x21d85c(0x128)]??null,'mode':_0x2c500d?.[_0x21d85c(0x128)]?'update':_0x21d85c(0x103),'status':_0x44845c});if(_0x44845c==='would_push')_0x308086[_0x21d85c(0x107)](_0x1eda21[_0x21d85c(0x10e)]);}return{'method':_0x21d85c(0x11f),'url':_0x21d85c(0x10b),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x5b2725,_0x21d85c(0x101),_0x308086),'body':{'appCode':_0x5b2725['appCode'],'force':_0x4b0f00,'files':_0x216f81,'cacheClearAtRuntime':_0x216f81[_0x21d85c(0xfa)](_0x1ec91e=>_0x1ec91e['status']==='would_push'),'cacheClearAtRuntimeTimes':_0x216f81[_0x21d85c(0xfa)](_0x30ac1d=>_0x30ac1d[_0x21d85c(0x11c)]===_0x21d85c(0xf2))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x21d85c(0x136)+_0x216f81['length']+_0x21d85c(0x11b)};},async 'execute'(_0x230791){const _0x1a33b7=a37_0x33896e,_0x2de4c4=loadBffProjectConfig(_0x230791[_0x1a33b7(0xee)]),_0x193427=await readBffLockFile(_0x2de4c4[_0x1a33b7(0xe7)]),{lockData:_0x5b34f7,appLock:_0x32cfe5}=ensureLockScope(_0x193427??createEmptyBffLock(),_0x230791[_0x1a33b7(0xee)],_0x2de4c4[_0x1a33b7(0x11d)],_0x1a33b7(0x107)),_0x498ab7=await getTargetFunctions(_0x2de4c4,_0x230791);if(_0x498ab7[_0x1a33b7(0x117)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x1a33b7(0xeb)};const _0x4702d7=_0x230791[_0x1a33b7(0xf9)](_0x1a33b7(0xfd)),_0x1f40f4=JSON[_0x1a33b7(0x118)](JSON[_0x1a33b7(0x13a)](_0x5b34f7)),_0x4e772e=_0x1f40f4[_0x1a33b7(0x114)][_0x230791[_0x1a33b7(0xee)]];if(!_0x4e772e)throw new Error(_0x1a33b7(0x102)+_0x230791[_0x1a33b7(0xee)]+_0x1a33b7(0x132));const _0x3fab85=await buildHookMaps(_0x230791[_0x1a33b7(0xee)],_0x230791[_0x1a33b7(0xf4)],_0x498ab7,_0x4e772e),_0x4a961e=[],_0x4728dc=[],_0xbb2292=[],_0x279133=[];for(const _0x5a72d0 of _0x498ab7){const _0x12f8f7=await computeFileHash(_0x5a72d0['filePath']),_0x264065=_0x4e772e[_0x1a33b7(0xe8)][_0x5a72d0[_0x1a33b7(0x135)]];if(!_0x4702d7&&_0x264065&&_0x264065[_0x1a33b7(0x123)]===_0x12f8f7){_0xbb2292[_0x1a33b7(0x107)]({'lockKey':_0x5a72d0[_0x1a33b7(0x135)],'reason':_0x1a33b7(0x130)});continue;}try{await uploadSingleFunction(_0x230791[_0x1a33b7(0xee)],_0x5a72d0,_0x4e772e,_0x3fab85);const _0x3dc594=_0x4e772e[_0x1a33b7(0xe8)][_0x5a72d0['lockKey']];_0x4a961e['push']({'lockKey':_0x5a72d0[_0x1a33b7(0x135)],'remoteId':_0x3dc594?.['remoteId']??0x0}),_0x4728dc[_0x1a33b7(0x107)](_0x5a72d0['name']);}catch(_0x3f096c){_0x279133['push']({'lockKey':_0x5a72d0['lockKey'],'error':_0x3f096c instanceof Error?_0x3f096c[_0x1a33b7(0x113)]:String(_0x3f096c)});}}_0x4e772e[_0x1a33b7(0x122)]=new Date()[_0x1a33b7(0x120)](),await writeBffLockFile(_0x2de4c4[_0x1a33b7(0xe7)],_0x1f40f4),await waitForUploadedLockEntries(_0x2de4c4[_0x1a33b7(0xe7)],_0x230791['appCode'],_0x4a961e[_0x1a33b7(0x124)](_0x220404=>_0x220404[_0x1a33b7(0x135)]));let _0x13271f={'attempted':![],'cleared':![]};if(_0x4a961e[_0x1a33b7(0x117)]>0x0)try{let _0x49c3b9='';for(let _0x249684=0x0;_0x249684<CACHE_CLEAR_ATTEMPTS;_0x249684+=0x1){_0x49c3b9=await clearBffScriptCache(),_0x249684<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x13271f={'attempted':!![],'cleared':!![],'message':_0x49c3b9||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x2fbd6a){_0x13271f={'attempted':!![],'cleared':![],'error':_0x2fbd6a instanceof Error?_0x2fbd6a['message']:String(_0x2fbd6a)};}const _0x5a14ed=_0x279133['length']===0x0&&(_0x13271f[_0x1a33b7(0x121)]?_0x13271f[_0x1a33b7(0x134)]:!![]),_0x489996=await runAutomaticDeploymentSync(_0x230791,'bff',_0x4728dc,_0x5a14ed),_0x361737=_0x5a14ed&&automaticDeploymentSyncSucceeded(_0x489996),_0x540d2c=_0x13271f[_0x1a33b7(0x121)]?_0x13271f[_0x1a33b7(0x134)]?_0x1a33b7(0xf8):_0x1a33b7(0xf1):_0x1a33b7(0x12b),_0x5f3dfc=_0x489996[_0x1a33b7(0xf7)]?_0x1a33b7(0x10f)+_0x489996[_0x1a33b7(0x11c)]:'';return{'ok':_0x361737,'data':{'uploaded':_0x4a961e,'skipped':_0xbb2292,'failed':_0x279133,'cacheClear':_0x13271f,'deploymentSync':_0x489996},'message':'Push\x20complete:\x20'+_0x4a961e[_0x1a33b7(0x117)]+'\x20uploaded,\x20'+_0xbb2292[_0x1a33b7(0x117)]+'\x20skipped,\x20'+_0x279133['length']+_0x1a33b7(0x112)+_0x540d2c+_0x5f3dfc};}};async function getTargetFunctions(_0x3fdb6c,_0x18f478){const _0x35e844=a37_0x33896e,_0x470353=_0x18f478[_0x35e844(0x104)]('type'),_0x462425=_0x18f478[_0x35e844(0x104)](_0x35e844(0x10e)),_0x3f0cf6=normalizeBffType(_0x470353)??undefined;if(_0x462425&&!_0x3f0cf6)throw CliErrors['validation'](_0x35e844(0x12f));const _0x408868=await scanLocalBffFunctions(_0x3fdb6c,_0x3f0cf6);if(_0x462425){const _0x5aa90a=_0x408868[_0x35e844(0x10c)](_0x102941=>_0x102941[_0x35e844(0x10e)]===_0x462425);if(_0x5aa90a[_0x35e844(0x117)]===0x0)throw CliErrors['validation'](_0x35e844(0x109)+_0x3f0cf6+'/'+_0x462425);return _0x5aa90a;}return _0x408868;}function a37_0x2aad(_0x304bcf,_0x3971d2){_0x304bcf=_0x304bcf-0xe7;const _0x45693f=a37_0x4569();let _0x2aad7a=_0x45693f[_0x304bcf];return _0x2aad7a;}async function buildHookMaps(_0x5f0537,_0x413502,_0x313879,_0x3a8ced){const _0xe63610=a37_0x33896e,_0x80f0b7=_0x313879[_0xe63610(0xfa)](_0x58b17b=>_0x58b17b['type']===_0xe63610(0x108));if(!_0x80f0b7)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x1b72b3=loadAliasMap(_0x413502,undefined,resolveApiFilePath(_0x413502,_0x5f0537)),_0x3682ae=new Map(_0x1b72b3[_0xe63610(0x124)](_0x566028=>[_0x566028[_0xe63610(0xea)],_0x566028['datasetCode']]));for(const _0x2389d3 of Object[_0xe63610(0xef)](_0x3a8ced[_0xe63610(0xe8)])){_0x2389d3[_0xe63610(0xea)]&&_0x2389d3[_0xe63610(0x12c)]&&!_0x3682ae['has'](_0x2389d3['alias'])&&_0x3682ae[_0xe63610(0xf5)](_0x2389d3[_0xe63610(0xea)],_0x2389d3['datasetCode']);}const _0x112475=await listDatasets(_0x5f0537),_0x1dacc0=new Map(_0x112475['map'](_0x4dbd47=>[_0x4dbd47[_0xe63610(0x116)],_0x4dbd47]));return{'aliasToDatasetCode':_0x3682ae,'datasetCodeToDataset':_0x1dacc0};}async function uploadSingleFunction(_0x1e2c13,_0x336707,_0x22d653,_0x233100){const _0x52dc9e=a37_0x33896e,_0x5a1ed4=await readFile(_0x336707['filePath'],_0x52dc9e(0x138)),_0x4b5c7a=await computeFileHash(_0x336707[_0x52dc9e(0x12d)]),_0x4a36b0=_0x22d653['functions'][_0x336707[_0x52dc9e(0x135)]];if(_0x4a36b0?.[_0x52dc9e(0x128)]&&_0x4a36b0[_0x52dc9e(0x13b)]==null)throw CliErrors[_0x52dc9e(0x137)](_0x336707[_0x52dc9e(0x135)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x2472ac=extractScriptDescription(_0x5a1ed4);if(!_0x2472ac&&_0x4a36b0?.[_0x52dc9e(0x128)]){const _0x5c4f2c=await getBffScriptInfo(_0x4a36b0['remoteId']);_0x2472ac=_0x5c4f2c[_0x52dc9e(0x11a)]||undefined;}const _0x317152={'appCode':_0x1e2c13,'functionName':_0x336707[_0x52dc9e(0x10e)],'scriptType':_0x336707[_0x52dc9e(0x12a)],'scriptContent':_0x5a1ed4};if(_0x4a36b0?.['remoteId'])_0x317152['id']=_0x4a36b0[_0x52dc9e(0x128)];if(_0x4a36b0?.[_0x52dc9e(0x13b)]!=null)_0x317152[_0x52dc9e(0x13b)]=_0x4a36b0[_0x52dc9e(0x13b)];if(_0x2472ac)_0x317152['description']=_0x2472ac;if(_0x336707[_0x52dc9e(0x12a)]===_0x52dc9e(0x108)){const _0xb4d8a2=_0x336707[_0x52dc9e(0xea)];if(!_0xb4d8a2||!_0x336707[_0x52dc9e(0x100)]||!_0x336707[_0x52dc9e(0x105)])throw CliErrors[_0x52dc9e(0x137)]('Incomplete\x20HOOK\x20path:\x20'+_0x336707[_0x52dc9e(0x135)]);const _0x2fc6a1=_0x233100['aliasToDatasetCode'][_0x52dc9e(0x133)](_0xb4d8a2)??_0x4a36b0?.['datasetCode']??_0xb4d8a2,_0x4c9c18=_0x233100['datasetCodeToDataset']['get'](_0x2fc6a1);if(!_0x4c9c18)throw CliErrors[_0x52dc9e(0x137)](_0x52dc9e(0x10d)+_0xb4d8a2+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x52dc9e(0x115)));_0x317152[_0x52dc9e(0xe9)]=_0x4c9c18['id'],_0x317152[_0x52dc9e(0x100)]=_0x336707['operationType'],_0x317152[_0x52dc9e(0x105)]=_0x336707[_0x52dc9e(0x105)];}const _0x3124b6=await saveBffScript(_0x317152),_0x5180cb=_0x3124b6['id'],_0x1d723a=_0x3124b6[_0x52dc9e(0x111)]??await getBffScriptInfo(_0x5180cb),_0x28ca97={'hash':_0x4b5c7a,'remoteId':_0x5180cb,'version':_0x1d723a['version']};if(_0x336707['type']===_0x52dc9e(0x108)){const _0x313b9c=_0x336707[_0x52dc9e(0xea)],_0x42b8c0=_0x233100[_0x52dc9e(0xfc)][_0x52dc9e(0x133)](_0x313b9c)??_0x4a36b0?.[_0x52dc9e(0x12c)]??_0x313b9c;_0x233100[_0x52dc9e(0xfc)]['has'](_0x313b9c)?_0x28ca97[_0x52dc9e(0xea)]=_0x313b9c:_0x28ca97[_0x52dc9e(0xea)]=_0x4a36b0?.['alias'],_0x28ca97['datasetCode']=_0x42b8c0,_0x28ca97['operationType']=_0x336707[_0x52dc9e(0x100)],_0x28ca97['functionNode']=_0x336707['functionNode'];}_0x22d653[_0x52dc9e(0xe8)][_0x336707['lockKey']]=_0x28ca97;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x490ae9,_0x1b44b3,_0x1fbbe9){const _0x5b30ac=a37_0x33896e;if(_0x1fbbe9[_0x5b30ac(0x117)]===0x0)return;for(let _0x41f6ec=0x0;_0x41f6ec<LOCK_SETTLE_RETRY_COUNT;_0x41f6ec+=0x1){const _0x4a57fa=await readBffLockFile(_0x490ae9),_0x503216=_0x4a57fa?.[_0x5b30ac(0x114)]?.[_0x1b44b3]?.[_0x5b30ac(0xe8)]??{},_0x2a9fd6=_0x1fbbe9[_0x5b30ac(0x12e)](_0x4b2314=>!!_0x503216[_0x4b2314]?.[_0x5b30ac(0x128)]);if(_0x2a9fd6)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x5b30ac(0x106)+_0x1fbbe9['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x211c6c=a37_0x3ccf;(function(_0x594713,_0x15b4c4){const _0x494611=a37_0x3ccf,_0x2313a2=_0x594713();while(!![]){try{const _0x466f55=parseInt(_0x494611(0x134))/0x1+parseInt(_0x494611(0x147))/0x2+parseInt(_0x494611(0x126))/0x3+-parseInt(_0x494611(0x160))/0x4*(-parseInt(_0x494611(0x156))/0x5)+-parseInt(_0x494611(0x12e))/0x6+-parseInt(_0x494611(0x157))/0x7*(parseInt(_0x494611(0x15a))/0x8)+-parseInt(_0x494611(0x15c))/0x9*(-parseInt(_0x494611(0x14e))/0xa);if(_0x466f55===_0x15b4c4)break;else _0x2313a2['push'](_0x2313a2['shift']());}catch(_0x10a4fe){_0x2313a2['push'](_0x2313a2['shift']());}}}(a37_0x3cf1,0x6696b));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x211c6c(0x14b),'description':a37_0x211c6c(0x163),'risk':a37_0x211c6c(0x124),'flags':[{'name':a37_0x211c6c(0x169),'type':a37_0x211c6c(0x15e),'description':a37_0x211c6c(0x13a),'enum':['COMMON','ENDPOINT',a37_0x211c6c(0x138)]},{'name':a37_0x211c6c(0x12c),'type':'string','description':a37_0x211c6c(0x148)},{'name':a37_0x211c6c(0x11d),'type':a37_0x211c6c(0x12d),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'validate'(_0x503554){validateAutomaticDeploymentSync(_0x503554);},async 'dryRun'(_0x45e89c){const _0xff9bb5=a37_0x211c6c,_0xb146a6=loadBffProjectConfig(_0x45e89c[_0xff9bb5(0x11b)]),_0x11cafa=await readBffLockFile(_0xb146a6['lockFilePath']),{appLock:_0x13c8fc}=ensureLockScope(_0x11cafa??createEmptyBffLock(),_0x45e89c[_0xff9bb5(0x11b)],_0xb146a6[_0xff9bb5(0x14a)],_0xff9bb5(0x14b)),_0x3a9f3c=await getTargetFunctions(_0xb146a6,_0x45e89c),_0x5b8b95=_0x45e89c['bool'](_0xff9bb5(0x11d)),_0x5aeb31=[],_0x1e3dfc=[];for(const _0x4a0dcc of _0x3a9f3c){const _0xc3181e=await computeFileHash(_0x4a0dcc[_0xff9bb5(0x13f)]),_0x128b23=_0x13c8fc[_0xff9bb5(0x145)][_0x4a0dcc[_0xff9bb5(0x14d)]],_0x23e149=!!_0x128b23&&_0x128b23[_0xff9bb5(0x162)]===_0xc3181e,_0x149ec7=!_0x5b8b95&&_0x23e149?'unchanged':_0xff9bb5(0x168);_0x5aeb31[_0xff9bb5(0x14b)]({'lockKey':_0x4a0dcc[_0xff9bb5(0x14d)],'filePath':_0x4a0dcc[_0xff9bb5(0x13f)],'remoteId':_0x128b23?.['remoteId']??null,'mode':_0x128b23?.[_0xff9bb5(0x118)]?_0xff9bb5(0x135):'create','status':_0x149ec7});if(_0x149ec7===_0xff9bb5(0x168))_0x1e3dfc[_0xff9bb5(0x14b)](_0x4a0dcc[_0xff9bb5(0x12c)]);}return{'method':_0xff9bb5(0x141),'url':_0xff9bb5(0x14f),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x45e89c,_0xff9bb5(0x158),_0x1e3dfc),'body':{'appCode':_0x45e89c[_0xff9bb5(0x11b)],'force':_0x5b8b95,'files':_0x5aeb31,'cacheClearAtRuntime':_0x5aeb31[_0xff9bb5(0x136)](_0x5414ff=>_0x5414ff[_0xff9bb5(0x166)]===_0xff9bb5(0x168)),'cacheClearAtRuntimeTimes':_0x5aeb31[_0xff9bb5(0x136)](_0x3faeed=>_0x3faeed['status']==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x5aeb31[_0xff9bb5(0x15b)]+_0xff9bb5(0x14c)};},async 'execute'(_0x56dce4){const _0x54717a=a37_0x211c6c,_0x384646=loadBffProjectConfig(_0x56dce4[_0x54717a(0x11b)]),_0x3df12a=await readBffLockFile(_0x384646[_0x54717a(0x167)]),{lockData:_0x17f524,appLock:_0x49fc83}=ensureLockScope(_0x3df12a??createEmptyBffLock(),_0x56dce4[_0x54717a(0x11b)],_0x384646['scriptsRoot'],_0x54717a(0x14b)),_0x15d5c5=await getTargetFunctions(_0x384646,_0x56dce4);if(_0x15d5c5['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x54717a(0x13c)};const _0xfa631a=_0x56dce4[_0x54717a(0x128)]('force'),_0x422499=JSON[_0x54717a(0x164)](JSON['stringify'](_0x17f524)),_0x363b66=_0x422499[_0x54717a(0x137)][_0x56dce4[_0x54717a(0x11b)]];if(!_0x363b66)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x56dce4[_0x54717a(0x11b)]+_0x54717a(0x120));const _0xf92b3a=await buildHookMaps(_0x56dce4[_0x54717a(0x11b)],_0x56dce4[_0x54717a(0x13e)],_0x15d5c5,_0x363b66),_0x17696c=[],_0x12cccd=[],_0x4190c5=[],_0x4cd4eb=[];for(const _0x41b1bc of _0x15d5c5){const _0x5a36c2=await computeFileHash(_0x41b1bc[_0x54717a(0x13f)]),_0x505341=_0x363b66[_0x54717a(0x145)][_0x41b1bc[_0x54717a(0x14d)]];if(!_0xfa631a&&_0x505341&&_0x505341[_0x54717a(0x162)]===_0x5a36c2){_0x4190c5[_0x54717a(0x14b)]({'lockKey':_0x41b1bc[_0x54717a(0x14d)],'reason':_0x54717a(0x12b)});continue;}try{await uploadSingleFunction(_0x56dce4[_0x54717a(0x11b)],_0x41b1bc,_0x363b66,_0xf92b3a);const _0x548fe7=_0x363b66[_0x54717a(0x145)][_0x41b1bc[_0x54717a(0x14d)]];_0x17696c[_0x54717a(0x14b)]({'lockKey':_0x41b1bc[_0x54717a(0x14d)],'remoteId':_0x548fe7?.[_0x54717a(0x118)]??0x0}),_0x12cccd[_0x54717a(0x14b)](_0x41b1bc[_0x54717a(0x12c)]);}catch(_0x149444){_0x4cd4eb[_0x54717a(0x14b)]({'lockKey':_0x41b1bc['lockKey'],'error':_0x149444 instanceof Error?_0x149444['message']:String(_0x149444)});}}_0x363b66[_0x54717a(0x151)]=new Date()[_0x54717a(0x129)](),await writeBffLockFile(_0x384646[_0x54717a(0x167)],_0x422499),await waitForUploadedLockEntries(_0x384646['lockFilePath'],_0x56dce4[_0x54717a(0x11b)],_0x17696c['map'](_0xecf987=>_0xecf987['lockKey']));let _0x4cdcc8={'attempted':![],'cleared':![]};if(_0x17696c['length']>0x0)try{let _0x3097ef='';for(let _0x2a4ef8=0x0;_0x2a4ef8<CACHE_CLEAR_ATTEMPTS;_0x2a4ef8+=0x1){_0x3097ef=await clearBffScriptCache(),_0x2a4ef8<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x4cdcc8={'attempted':!![],'cleared':!![],'message':_0x3097ef||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x2a1555){_0x4cdcc8={'attempted':!![],'cleared':![],'error':_0x2a1555 instanceof Error?_0x2a1555[_0x54717a(0x122)]:String(_0x2a1555)};}const _0x585ce6=_0x4cd4eb[_0x54717a(0x15b)]===0x0&&(_0x4cdcc8[_0x54717a(0x165)]?_0x4cdcc8[_0x54717a(0x127)]:!![]),_0x346b1b=await runAutomaticDeploymentSync(_0x56dce4,'bff',_0x12cccd,_0x585ce6),_0x15cbcf=_0x585ce6&&automaticDeploymentSyncSucceeded(_0x346b1b),_0x1ce226=_0x4cdcc8[_0x54717a(0x165)]?_0x4cdcc8[_0x54717a(0x127)]?_0x54717a(0x146):_0x54717a(0x144):_0x54717a(0x12f),_0x18c687=_0x346b1b[_0x54717a(0x123)]?_0x54717a(0x132)+_0x346b1b[_0x54717a(0x166)]:'';return{'ok':_0x15cbcf,'data':{'uploaded':_0x17696c,'skipped':_0x4190c5,'failed':_0x4cd4eb,'cacheClear':_0x4cdcc8,'deploymentSync':_0x346b1b},'message':'Push\x20complete:\x20'+_0x17696c[_0x54717a(0x15b)]+'\x20uploaded,\x20'+_0x4190c5[_0x54717a(0x15b)]+_0x54717a(0x130)+_0x4cd4eb[_0x54717a(0x15b)]+_0x54717a(0x143)+_0x1ce226+_0x18c687};}};async function getTargetFunctions(_0x500de3,_0x1ede02){const _0x456758=a37_0x211c6c,_0x18aa25=_0x1ede02['str']('type'),_0x39f6b6=_0x1ede02['str'](_0x456758(0x12c)),_0x49bd75=normalizeBffType(_0x18aa25)??undefined;if(_0x39f6b6&&!_0x49bd75)throw CliErrors[_0x456758(0x119)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x33df19=await scanLocalBffFunctions(_0x500de3,_0x49bd75);if(_0x39f6b6){const _0x263003=_0x33df19['filter'](_0x56502b=>_0x56502b[_0x456758(0x12c)]===_0x39f6b6);if(_0x263003[_0x456758(0x15b)]===0x0)throw CliErrors[_0x456758(0x119)](_0x456758(0x11a)+_0x49bd75+'/'+_0x39f6b6);return _0x263003;}return _0x33df19;}async function buildHookMaps(_0x1cc435,_0x5d6793,_0x90cdb7,_0x2728ea){const _0x345ad6=a37_0x211c6c,_0x1618de=_0x90cdb7['some'](_0x31fdf1=>_0x31fdf1[_0x345ad6(0x169)]==='HOOK');if(!_0x1618de)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x290e89=loadAliasMap(_0x5d6793,undefined,resolveApiFilePath(_0x5d6793,_0x1cc435)),_0x26a1b6=new Map(_0x290e89['map'](_0x463340=>[_0x463340[_0x345ad6(0x11f)],_0x463340['datasetCode']]));for(const _0x3a474a of Object[_0x345ad6(0x11e)](_0x2728ea[_0x345ad6(0x145)])){_0x3a474a[_0x345ad6(0x11f)]&&_0x3a474a[_0x345ad6(0x15d)]&&!_0x26a1b6[_0x345ad6(0x152)](_0x3a474a[_0x345ad6(0x11f)])&&_0x26a1b6[_0x345ad6(0x149)](_0x3a474a['alias'],_0x3a474a[_0x345ad6(0x15d)]);}const _0xa984f0=await listDatasets(_0x1cc435),_0x24b1ee=new Map(_0xa984f0[_0x345ad6(0x153)](_0x10630c=>[_0x10630c[_0x345ad6(0x15f)],_0x10630c]));return{'aliasToDatasetCode':_0x26a1b6,'datasetCodeToDataset':_0x24b1ee};}function a37_0x3cf1(){const _0x1733e2=['HOOK','script','Push\x20only\x20this\x20script\x20type','functionNode','No\x20local\x20Backend\x20Function\x20scripts\x20found.','every','apiDir','filePath','get','POST','Incomplete\x20HOOK\x20path:\x20','\x20failed,\x20','runtime\x20cache\x20clear\x20failed','functions','runtime\x20cache\x20cleared','1368670kAoNje','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','set','scriptsRoot','push','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','lockKey','150oujmds','/api/management/library/scripts/save','utf8','lastSync','has','map','\x22.\x20','Run\x20`','10LMEBzO','687827HubjwZ','bff','datasetId','40oLWOdS','length','65979BAumuk','datasetCode','string','code','184344rZnvXm','version','hash','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','parse','attempted','status','lockFilePath','would_push','type','remoteId','validation','Local\x20function\x20not\x20found:\x20','appCode',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','force','values','alias','\x22\x20not\x20found\x20after\x20ensureLockScope.','datasetCodeToDataset','message','configured','write','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','951171XLtcNk','cleared','bool','toISOString','aliasToDatasetCode','unchanged','name','boolean','4591422FbTTXt','runtime\x20cache\x20not\x20needed','\x20skipped,\x20','operationType',',\x20deployment\x20sync\x20','description','473216yIsNpJ','update','some','apps'];a37_0x3cf1=function(){return _0x1733e2;};return a37_0x3cf1();}async function uploadSingleFunction(_0x534258,_0xe3467b,_0x100270,_0x55663){const _0x36b3bc=a37_0x211c6c,_0x3235f4=await readFile(_0xe3467b[_0x36b3bc(0x13f)],_0x36b3bc(0x150)),_0x20ded9=await computeFileHash(_0xe3467b[_0x36b3bc(0x13f)]),_0x579b38=_0x100270[_0x36b3bc(0x145)][_0xe3467b[_0x36b3bc(0x14d)]];if(_0x579b38?.[_0x36b3bc(0x118)]&&_0x579b38['version']==null)throw CliErrors[_0x36b3bc(0x119)](_0xe3467b[_0x36b3bc(0x14d)]+_0x36b3bc(0x11c));let _0x18f3c7=extractScriptDescription(_0x3235f4);if(!_0x18f3c7&&_0x579b38?.['remoteId']){const _0x1ca4df=await getBffScriptInfo(_0x579b38[_0x36b3bc(0x118)]);_0x18f3c7=_0x1ca4df[_0x36b3bc(0x133)]||undefined;}const _0x39a57d={'appCode':_0x534258,'functionName':_0xe3467b[_0x36b3bc(0x12c)],'scriptType':_0xe3467b['type'],'scriptContent':_0x3235f4};if(_0x579b38?.[_0x36b3bc(0x118)])_0x39a57d['id']=_0x579b38[_0x36b3bc(0x118)];if(_0x579b38?.[_0x36b3bc(0x161)]!=null)_0x39a57d[_0x36b3bc(0x161)]=_0x579b38[_0x36b3bc(0x161)];if(_0x18f3c7)_0x39a57d[_0x36b3bc(0x133)]=_0x18f3c7;if(_0xe3467b['type']===_0x36b3bc(0x138)){const _0xa233de=_0xe3467b[_0x36b3bc(0x11f)];if(!_0xa233de||!_0xe3467b[_0x36b3bc(0x131)]||!_0xe3467b[_0x36b3bc(0x13b)])throw CliErrors[_0x36b3bc(0x119)](_0x36b3bc(0x142)+_0xe3467b[_0x36b3bc(0x14d)]);const _0x2a3593=_0x55663['aliasToDatasetCode'][_0x36b3bc(0x140)](_0xa233de)??_0x579b38?.['datasetCode']??_0xa233de,_0x4e2d44=_0x55663[_0x36b3bc(0x121)][_0x36b3bc(0x140)](_0x2a3593);if(!_0x4e2d44)throw CliErrors[_0x36b3bc(0x119)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0xa233de+_0x36b3bc(0x154)+(_0x36b3bc(0x155)+CLI_BIN_NAME+_0x36b3bc(0x125)));_0x39a57d[_0x36b3bc(0x159)]=_0x4e2d44['id'],_0x39a57d[_0x36b3bc(0x131)]=_0xe3467b[_0x36b3bc(0x131)],_0x39a57d[_0x36b3bc(0x13b)]=_0xe3467b[_0x36b3bc(0x13b)];}const _0x1ef00a=await saveBffScript(_0x39a57d),_0x48f84b=_0x1ef00a['id'],_0x5af933=_0x1ef00a[_0x36b3bc(0x139)]??await getBffScriptInfo(_0x48f84b),_0x425a27={'hash':_0x20ded9,'remoteId':_0x48f84b,'version':_0x5af933[_0x36b3bc(0x161)]};if(_0xe3467b[_0x36b3bc(0x169)]===_0x36b3bc(0x138)){const _0x3aba24=_0xe3467b[_0x36b3bc(0x11f)],_0x36c02e=_0x55663[_0x36b3bc(0x12a)][_0x36b3bc(0x140)](_0x3aba24)??_0x579b38?.[_0x36b3bc(0x15d)]??_0x3aba24;_0x55663[_0x36b3bc(0x12a)][_0x36b3bc(0x152)](_0x3aba24)?_0x425a27[_0x36b3bc(0x11f)]=_0x3aba24:_0x425a27[_0x36b3bc(0x11f)]=_0x579b38?.[_0x36b3bc(0x11f)],_0x425a27[_0x36b3bc(0x15d)]=_0x36c02e,_0x425a27[_0x36b3bc(0x131)]=_0xe3467b[_0x36b3bc(0x131)],_0x425a27['functionNode']=_0xe3467b[_0x36b3bc(0x13b)];}_0x100270[_0x36b3bc(0x145)][_0xe3467b[_0x36b3bc(0x14d)]]=_0x425a27;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;function a37_0x3ccf(_0x36228e,_0x354521){_0x36228e=_0x36228e-0x118;const _0x3cf1ac=a37_0x3cf1();let _0x3ccfb5=_0x3cf1ac[_0x36228e];return _0x3ccfb5;}async function waitForUploadedLockEntries(_0x1187b8,_0x2fe674,_0x26d424){const _0x2431cd=a37_0x211c6c;if(_0x26d424[_0x2431cd(0x15b)]===0x0)return;for(let _0x292809=0x0;_0x292809<LOCK_SETTLE_RETRY_COUNT;_0x292809+=0x1){const _0x5a2389=await readBffLockFile(_0x1187b8),_0xdb956e=_0x5a2389?.['apps']?.[_0x2fe674]?.[_0x2431cd(0x145)]??{},_0x4af3c8=_0x26d424[_0x2431cd(0x13d)](_0x32f972=>!!_0xdb956e[_0x32f972]?.['remoteId']);if(_0x4af3c8)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x26d424['join'](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x3a4a0c=a38_0x5747;(function(_0x268112,_0x273d21){const _0x377405=a38_0x5747,_0x54a602=_0x268112();while(!![]){try{const _0x31443d=parseInt(_0x377405(0xfc))/0x1*(-parseInt(_0x377405(0xe7))/0x2)+parseInt(_0x377405(0xfa))/0x3+-parseInt(_0x377405(0xf6))/0x4+parseInt(_0x377405(0x101))/0x5+parseInt(_0x377405(0xec))/0x6+-parseInt(_0x377405(0x102))/0x7+parseInt(_0x377405(0xe9))/0x8;if(_0x31443d===_0x273d21)break;else _0x54a602['push'](_0x54a602['shift']());}catch(_0x99b93d){_0x54a602['push'](_0x54a602['shift']());}}}(a38_0x547c,0xaff58));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a38_0x5747(_0x2fb6a8,_0x306cbd){_0x2fb6a8=_0x2fb6a8-0xe6;const _0x547cea=a38_0x547c();let _0x57478d=_0x547cea[_0x2fb6a8];return _0x57478d;}function a38_0x547c(){const _0x471311=['length','47738IHSdFG','functions','6117024Knjtxk','remote','boolean','3134556afYELT','bff','read','hash','push','appCode','\x20unchanged','lockFilePath','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','alias','3665516ZWipqf','status','map','apiDir','2493747OrdkmS','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','11bePxSf','has','bool','datasetCode','all','323850Iyskzt','1983849SBprlI','lockKey'];a38_0x547c=function(){return _0x471311;};return a38_0x547c();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x3a4a0c(0xed),'command':'status','description':a38_0x3a4a0c(0xf4),'risk':a38_0x3a4a0c(0xee),'flags':[{'name':'remote','type':a38_0x3a4a0c(0xeb),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x4aff32){const _0x276c00=a38_0x3a4a0c,_0xed13f3=loadBffProjectConfig(_0x4aff32[_0x276c00(0xf1)]),_0x86e07=await readBffLockFile(_0xed13f3[_0x276c00(0xf3)]),{appLock:_0x4f136f}=ensureLockScope(_0x86e07??createEmptyBffLock(),_0x4aff32[_0x276c00(0xf1)],_0xed13f3['scriptsRoot'],_0x276c00(0xf7)),_0x38e5f7=await scanLocalBffFunctions(_0xed13f3),_0x268204=[],_0x1c0ce4=[],_0x456dd8=[];for(const _0xec1c47 of _0x38e5f7){const _0x2175a5=await computeFileHash(_0xec1c47['filePath']),_0x20618d=_0x4f136f[_0x276c00(0xe8)][_0xec1c47[_0x276c00(0x103)]];if(!_0x20618d)_0x268204[_0x276c00(0xf0)](_0xec1c47['lockKey']);else _0x20618d[_0x276c00(0xef)]!==_0x2175a5?_0x1c0ce4['push'](_0xec1c47[_0x276c00(0x103)]):_0x456dd8[_0x276c00(0xf0)](_0xec1c47[_0x276c00(0x103)]);}const _0x3f0ab0=[];if(_0x4aff32[_0x276c00(0xfe)](_0x276c00(0xea))){const _0x509bf6=loadAliasMap(_0x4aff32[_0x276c00(0xf9)],undefined,resolveApiFilePath(_0x4aff32[_0x276c00(0xf9)],_0x4aff32[_0x276c00(0xf1)])),_0x3f6765=new Map(_0x509bf6['map'](_0x44d7c7=>[_0x44d7c7[_0x276c00(0xff)],_0x44d7c7[_0x276c00(0xf5)]])),[_0x30f49a,_0x418e31]=await Promise[_0x276c00(0x100)]([listBffScripts(_0x4aff32[_0x276c00(0xf1)]),getBffScriptStatistics(_0x4aff32[_0x276c00(0xf1)])]),_0x25d6f6=createHookLocationMap(_0x418e31),_0x1d204e=new Set(_0x38e5f7[_0x276c00(0xf8)](_0x37dac1=>_0x37dac1[_0x276c00(0x103)]));for(const _0x4464a9 of _0x30f49a){const _0x430442=resolveRemoteScriptTarget(_0xed13f3,_0x4464a9,_0x25d6f6,_0x4f136f[_0x276c00(0xe8)],_0x3f6765);_0x430442&&!_0x1d204e[_0x276c00(0xfd)](_0x430442[_0x276c00(0x103)])&&_0x3f0ab0['push'](_0x430442[_0x276c00(0x103)]);}}const _0x28884a=_0x268204[_0x276c00(0xe6)]===0x0&&_0x1c0ce4['length']===0x0&&_0x3f0ab0[_0x276c00(0xe6)]===0x0;return{'ok':!![],'data':{'added':_0x268204,'modified':_0x1c0ce4,'unchanged':_0x456dd8,'remoteOnly':_0x3f0ab0},'message':_0x28884a?_0x276c00(0xfb):_0x268204[_0x276c00(0xe6)]+'\x20added,\x20'+_0x1c0ce4['length']+'\x20modified,\x20'+_0x456dd8['length']+_0x276c00(0xf2)+(_0x3f0ab0['length']>0x0?',\x20'+_0x3f0ab0['length']+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x400f4c=a39_0x1743;(function(_0x4c966a,_0x4a6423){const _0x65fc62=a39_0x1743,_0x288a9f=_0x4c966a();while(!![]){try{const _0x25a32b=parseInt(_0x65fc62(0x18f))/0x1*(parseInt(_0x65fc62(0x190))/0x2)+parseInt(_0x65fc62(0x17a))/0x3+-parseInt(_0x65fc62(0x182))/0x4*(-parseInt(_0x65fc62(0x18c))/0x5)+parseInt(_0x65fc62(0x187))/0x6+parseInt(_0x65fc62(0x194))/0x7+parseInt(_0x65fc62(0x188))/0x8*(parseInt(_0x65fc62(0x17f))/0x9)+parseInt(_0x65fc62(0x177))/0xa*(-parseInt(_0x65fc62(0x186))/0xb);if(_0x25a32b===_0x4a6423)break;else _0x288a9f['push'](_0x288a9f['shift']());}catch(_0xdbfbe8){_0x288a9f['push'](_0x288a9f['shift']());}}}(a39_0x422d,0x54ef3));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0x422d(){const _0x4949d8=['inherit','cli-skill-install','48080qeTPyR','\x20via\x20skills@latest','\x20at\x20','3eQCpvb','189854BFTlVV','installedPath','install','Built-in\x20Skill\x20install\x20failed\x20[','272503HuqJDZ','apiError','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','\x20installed','CLI\x20Built-in\x20Skill\x20','484170WreSpB','unknown','setLogPath','1496721rICnVh','repairCommand','nonInteractive',']:\x20','read','6012mveBrt','error','log','136kPFczK','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','\x20is\x20already\x20current','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','451JuMckr','3056490hkEdPj','8072cmkslM','cwd'];a39_0x422d=function(){return _0x4949d8;};return a39_0x422d();}function a39_0x1743(_0x1f5f86,_0x32b564){_0x1f5f86=_0x1f5f86-0x176;const _0x422d98=a39_0x422d();let _0x174364=_0x422d98[_0x1f5f86];return _0x174364;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':a39_0x400f4c(0x192),'description':a39_0x400f4c(0x185),'risk':a39_0x400f4c(0x17e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x59cac6){const _0x3d3b6a=a39_0x400f4c;logger[_0x3d3b6a(0x179)](process[_0x3d3b6a(0x189)]()),logger['info'](_0x3d3b6a(0x18b),_0x3d3b6a(0x196));const _0x486326=installBuiltinSkill({'stdio':_0x59cac6[_0x3d3b6a(0x17c)]?'pipe':_0x3d3b6a(0x18a)});if(!_0x486326['ok'])throw CliErrors[_0x3d3b6a(0x195)](_0x3d3b6a(0x193)+_0x486326['code']+_0x3d3b6a(0x17d)+(_0x486326[_0x3d3b6a(0x180)]||_0x3d3b6a(0x178)),_0x3d3b6a(0x183)+_0x486326[_0x3d3b6a(0x17b)]);return console[_0x3d3b6a(0x181)](_0x486326['changed']?'CLI\x20Built-in\x20Skill\x20'+_0x486326['skillVersion']+_0x3d3b6a(0x197)+(_0x486326[_0x3d3b6a(0x191)]?_0x3d3b6a(0x18e)+_0x486326[_0x3d3b6a(0x191)]:_0x3d3b6a(0x18d)):_0x3d3b6a(0x176)+_0x486326['skillVersion']+_0x3d3b6a(0x184)+(_0x486326[_0x3d3b6a(0x191)]?_0x3d3b6a(0x18e)+_0x486326['installedPath']:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x57bdef=a40_0x16c2;(function(_0x148414,_0x788bb2){const _0x2b835f=a40_0x16c2,_0x444f43=_0x148414();while(!![]){try{const _0x59624a=parseInt(_0x2b835f(0xd9))/0x1*(parseInt(_0x2b835f(0xf0))/0x2)+-parseInt(_0x2b835f(0x104))/0x3*(-parseInt(_0x2b835f(0xf3))/0x4)+-parseInt(_0x2b835f(0xdc))/0x5+-parseInt(_0x2b835f(0x10d))/0x6+parseInt(_0x2b835f(0xed))/0x7+parseInt(_0x2b835f(0x101))/0x8*(parseInt(_0x2b835f(0xf2))/0x9)+parseInt(_0x2b835f(0xf7))/0xa*(-parseInt(_0x2b835f(0xc4))/0xb);if(_0x59624a===_0x788bb2)break;else _0x444f43['push'](_0x444f43['shift']());}catch(_0x3ea20e){_0x444f43['push'](_0x444f43['shift']());}}}(a40_0x16b9,0x933c5));import a40_0x33c3c0 from'chalk';import a40_0x590ce7 from'ora';import a40_0x3cf44b from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';function a40_0x16c2(_0x4ec93a,_0x9f9c6a){_0x4ec93a=_0x4ec93a-0xc4;const _0x16b99b=a40_0x16b9();let _0x16c21c=_0x16b99b[_0x4ec93a];return _0x16c21c;}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 _0x4b9694=a40_0x16c2;return GIT_COMMIT!==_0x4b9694(0xc7)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4b9694(0x10c)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x38a98e=a40_0x16c2,_0x3ddbaf=process[_0x38a98e(0xdb)][_0x38a98e(0xd4)]();if(_0x3ddbaf['includes'](_0x38a98e(0xc9)))return'bun';return'npm';}const updateFlags=[{'name':a40_0x57bdef(0xe6),'type':a40_0x57bdef(0x111),'description':a40_0x57bdef(0x106),'default':![]},{'name':a40_0x57bdef(0xfd),'type':a40_0x57bdef(0xe3),'description':a40_0x57bdef(0xca)}];function getRequestedVersion(_0x579d7a){const _0x278d40=a40_0x57bdef;return _0x579d7a[_0x278d40(0x116)](_0x278d40(0xfd))[_0x278d40(0xcc)]();}async function validateUpdateFlags(_0x2de400){const _0xc8fa0b=a40_0x57bdef,_0x2ee26c=_0x2de400[_0xc8fa0b(0xef)]('beta'),_0x2cf11b=getRequestedVersion(_0x2de400);if(_0x2ee26c&&_0x2cf11b)throw CliErrors[_0xc8fa0b(0x10f)](_0xc8fa0b(0x10b),_0xc8fa0b(0x110));if(_0x2cf11b&&!a40_0x3cf44b[_0xc8fa0b(0xcf)](_0x2cf11b))throw CliErrors[_0xc8fa0b(0x10f)](_0xc8fa0b(0xe1)+_0x2cf11b,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x5469e7=a40_0x57bdef;try{const _0x1b74af=await fetch(_0x5469e7(0xf8)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x5469e7(0xd7),{'signal':AbortSignal[_0x5469e7(0xdd)](0x2710)});if(!_0x1b74af['ok'])return null;const _0x5d034f=await _0x1b74af[_0x5469e7(0xe4)]();if(!_0x5d034f||typeof _0x5d034f!==_0x5469e7(0xea))return null;return Object['fromEntries'](Object[_0x5469e7(0xd5)](_0x5d034f)[_0x5469e7(0xda)](([,_0x237cae])=>typeof _0x237cae===_0x5469e7(0xe3)&&_0x237cae[_0x5469e7(0xcc)]()[_0x5469e7(0xd6)]>0x0)[_0x5469e7(0x10a)](([_0x5c3e3e,_0x3d80fa])=>[_0x5c3e3e,String(_0x3d80fa)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x26eae0){const _0x226bb1=await fetchNpmDistTags();return _0x226bb1?.[_0x26eae0]??null;}async function fetchLatestVersion(){const _0x5f44e4=a40_0x57bdef;return fetchNpmDistTagVersion(_0x5f44e4(0x105));}async function resolveTargetVersion(_0x234247){const _0x4683ad=a40_0x57bdef,_0x5077aa=getRequestedVersion(_0x234247);if(_0x5077aa)return{'version':_0x5077aa,'source':_0x4683ad(0xfd)};if(_0x234247[_0x4683ad(0xef)](_0x4683ad(0xe6))){const _0x2ad5ef=await fetchNpmDistTagVersion(_0x4683ad(0xe6));if(!_0x2ad5ef)return null;return{'version':_0x2ad5ef,'source':_0x4683ad(0xe6)};}const _0x248066=await fetchLatestVersion();if(!_0x248066)return null;return{'version':_0x248066,'source':_0x4683ad(0x105)};}function shouldInstallTarget(_0x20f37f,_0x59f7ef){const _0x18edc9=a40_0x57bdef;if(_0x59f7ef[_0x18edc9(0xfa)]===_0x18edc9(0xfd)||_0x59f7ef[_0x18edc9(0xfa)]==='beta')return!a40_0x3cf44b['eq'](_0x20f37f,_0x59f7ef[_0x18edc9(0xfd)]);return a40_0x3cf44b['lt'](_0x20f37f,_0x59f7ef[_0x18edc9(0xfd)]);}function getInstallPlanLabel(_0x32cc00,_0x54abc5){const _0x1edfab=a40_0x57bdef;switch(_0x54abc5[_0x1edfab(0xfa)]){case'beta':return'Beta\x20version:\x20'+a40_0x33c3c0[_0x1edfab(0xfc)](_0x32cc00)+_0x1edfab(0xdf)+a40_0x33c3c0['green'](_0x54abc5[_0x1edfab(0xfd)]);case _0x1edfab(0xfd):return _0x1edfab(0xce)+a40_0x33c3c0['yellow'](_0x32cc00)+'\x20→\x20'+a40_0x33c3c0[_0x1edfab(0xff)](_0x54abc5[_0x1edfab(0xfd)]);case _0x1edfab(0x105):default:return _0x1edfab(0xe5)+a40_0x33c3c0['yellow'](_0x32cc00)+_0x1edfab(0xdf)+a40_0x33c3c0[_0x1edfab(0xff)](_0x54abc5[_0x1edfab(0xfd)]);}}function repairCurrentBuiltinSkill(){const _0x68716b=a40_0x57bdef;console[_0x68716b(0x114)](a40_0x33c3c0[_0x68716b(0xe0)](_0x68716b(0xf5)));const _0x4a9dcf=installBuiltinSkill();if(_0x4a9dcf['ok'])return console[_0x68716b(0x114)](a40_0x33c3c0[_0x68716b(0xe0)](_0x68716b(0xe7)+_0x4a9dcf['skillVersion']+_0x68716b(0xee))),!![];return console[_0x68716b(0xd1)](a40_0x33c3c0[_0x68716b(0xfc)](_0x68716b(0xf1)+_0x4a9dcf['code']+']:\x20'+(_0x4a9dcf[_0x68716b(0xec)]||_0x68716b(0xc7)))),console[_0x68716b(0x114)](a40_0x33c3c0[_0x68716b(0xe0)](_0x68716b(0x108)+CLI_BIN_NAME+_0x68716b(0x10e))),![];}function verifyUpdatedBuiltinSkill(_0x306d82){const _0x196a7a=a40_0x57bdef,_0x2f4327=inspectInstalledBuiltinSkillVersion(_0x306d82);if(_0x2f4327[_0x196a7a(0x103)]===_0x196a7a(0xde))return console[_0x196a7a(0x114)](a40_0x33c3c0['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x306d82+_0x196a7a(0xee))),!![];const _0x43395b=_0x2f4327[_0x196a7a(0x100)]?_0x196a7a(0xcd)+_0x306d82+',\x20found\x20'+_0x2f4327['skillVersion']:_0x196a7a(0xcd)+_0x306d82+',\x20state\x20'+_0x2f4327[_0x196a7a(0x103)];return console[_0x196a7a(0xd1)](a40_0x33c3c0[_0x196a7a(0xfc)](_0x196a7a(0x113)+_0x43395b)),console[_0x196a7a(0x114)](a40_0x33c3c0[_0x196a7a(0xe0)]('\x20\x20Run\x20manually:\x20'+_0x2f4327[_0x196a7a(0xe9)])),![];}async function execute(_0x54e529){const _0x52ca44=a40_0x57bdef;await validateUpdateFlags(_0x54e529);const _0x1d6b66=getCurrentVersion();console[_0x52ca44(0x114)](_0x52ca44(0xf6)+_0x1d6b66);const _0x5bfd7b=a40_0x590ce7('Checking\x20for\x20updates...')[_0x52ca44(0xfe)](),_0x87d660=await resolveTargetVersion(_0x54e529);if(!_0x87d660){const _0x3ff5b2=_0x54e529[_0x52ca44(0xef)](_0x52ca44(0xe6))?_0x52ca44(0xc6):_0x52ca44(0xf4);return _0x5bfd7b[_0x52ca44(0xeb)](_0x3ff5b2),console[_0x52ca44(0x114)](a40_0x33c3c0[_0x52ca44(0xe0)](_0x52ca44(0xd3)+NPM_PACKAGE_NAME+_0x52ca44(0xe8))),{'ok':![],'message':_0x3ff5b2};}const _0x26299f=a40_0x3cf44b[_0x52ca44(0xcf)](VERSION),_0x50ca44=a40_0x3cf44b[_0x52ca44(0xcf)](_0x87d660[_0x52ca44(0xfd)]);if(!_0x26299f||!_0x50ca44)return _0x5bfd7b[_0x52ca44(0xeb)](_0x52ca44(0x102)),{'ok':![],'message':_0x52ca44(0x102)};if(!shouldInstallTarget(_0x26299f,_0x87d660)){const _0x367af4=_0x87d660['source']==='version'?'Already\x20on\x20requested\x20version\x20(v'+_0x87d660[_0x52ca44(0xfd)]+')':a40_0x3cf44b['gt'](_0x26299f,_0x50ca44)?'Current\x20version\x20v'+_0x1d6b66+_0x52ca44(0xd2)+_0x87d660[_0x52ca44(0xfd)]:'Already\x20up\x20to\x20date\x20(v'+_0x87d660[_0x52ca44(0xfd)]+')';return _0x5bfd7b['succeed'](_0x367af4),{'ok':repairCurrentBuiltinSkill()};}_0x5bfd7b[_0x52ca44(0x115)](getInstallPlanLabel(_0x1d6b66,_0x87d660));const _0x1fd0a6=detectPackageManager(),_0x529336=_0x1fd0a6===_0x52ca44(0xfb)?resolveNpmBin(_0x52ca44(0xfb)):_0x1fd0a6,_0x4cb973=a40_0x590ce7('Updating\x20via\x20'+_0x1fd0a6+_0x52ca44(0x107))['start']();try{return await execa(_0x529336,['install','-g',NPM_PACKAGE_NAME+'@'+_0x87d660['version']],{'stdio':_0x52ca44(0x112)}),_0x4cb973['succeed'](_0x52ca44(0xd8)+_0x87d660[_0x52ca44(0xfd)]),console[_0x52ca44(0x114)](a40_0x33c3c0[_0x52ca44(0xe0)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0x87d660[_0x52ca44(0xfd)])};}catch(_0x4f6fab){return _0x4cb973[_0x52ca44(0xeb)]('Update\x20failed'),console[_0x52ca44(0xec)](a40_0x33c3c0[_0x52ca44(0xc5)]('\x20\x20'+_0x4f6fab[_0x52ca44(0xcb)])),console[_0x52ca44(0x114)](a40_0x33c3c0[_0x52ca44(0xe0)](_0x52ca44(0x109)+_0x1fd0a6+_0x52ca44(0xc8)+NPM_PACKAGE_NAME+'@'+_0x87d660[_0x52ca44(0xfd)])),{'ok':![],'message':_0x4f6fab[_0x52ca44(0xcb)]};}}function a40_0x16b9(){const _0x506329=['Current\x20version:\x20','10310vAuorf','https://registry.npmjs.org/-/package/','read','source','npm','yellow','version','start','green','skillVersion','4366536qnayMg','Version\x20comparison\x20failed','state','12ICjBzr','latest','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','...','\x20\x20Run\x20manually:\x20','\x20\x20Try\x20manually:\x20','map','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','slice','1023402xOqyor','\x20cli-skill\x20install','validation','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','boolean','pipe','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','log','info','str','21263TgUipb','red','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','unknown','\x20install\x20-g\x20','bun','Install\x20a\x20specific\x20CLI\x20version','message','trim','expected\x20','Requested\x20version:\x20','valid','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','warn','\x20is\x20newer\x20than\x20npm\x20latest\x20v','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','toLowerCase','entries','length','/dist-tags','Updated\x20to\x20v','19064edcZLK','filter','execPath','376890gHrVtA','timeout','current','\x20→\x20','gray','Invalid\x20version:\x20','run','string','json','Update\x20available:\x20','beta','\x20\x20CLI\x20Built-in\x20Skill\x20','@latest','repairCommand','object','fail','error','2747892fvCuXc','\x20is\x20up\x20to\x20date.','bool','82GppZmj','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','9GxpImf','1121948NTTpAf','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Checking\x20CLI\x20Built-in\x20Skill...'];a40_0x16b9=function(){return _0x506329;};return a40_0x16b9();}export const updateDefinition={'service':'update','command':a40_0x57bdef(0xe2),'description':a40_0x57bdef(0xd0),'risk':a40_0x57bdef(0xf9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x5ae98a=a40_0x2f83;(function(_0x19c12f,_0x516399){const _0x2a9df8=a40_0x2f83,_0x23487b=_0x19c12f();while(!![]){try{const _0x2aeacf=parseInt(_0x2a9df8(0x213))/0x1*(-parseInt(_0x2a9df8(0x22f))/0x2)+-parseInt(_0x2a9df8(0x235))/0x3*(parseInt(_0x2a9df8(0x1ee))/0x4)+-parseInt(_0x2a9df8(0x1e7))/0x5+parseInt(_0x2a9df8(0x1f6))/0x6*(-parseInt(_0x2a9df8(0x21a))/0x7)+parseInt(_0x2a9df8(0x212))/0x8+parseInt(_0x2a9df8(0x233))/0x9+-parseInt(_0x2a9df8(0x210))/0xa*(-parseInt(_0x2a9df8(0x208))/0xb);if(_0x2aeacf===_0x516399)break;else _0x23487b['push'](_0x23487b['shift']());}catch(_0xb885a1){_0x23487b['push'](_0x23487b['shift']());}}}(a40_0x5e76,0x1870c));function a40_0x5e76(){const _0x54fe2f=['filter','Requested\x20version:\x20','bool','pipe','start','fail','2334oSQypN','Update\x20failed','repairCommand','https://registry.npmjs.org/-/package/','695520toBHQA','green','28002cyOktK','Already\x20up\x20to\x20date\x20(v','bun','install','@latest','trim','\x20\x20Try\x20manually:\x20','Update\x20available:\x20',']:\x20','unknown','info','\x20→\x20','838885ikfZcp','skillVersion','timeout','latest','map','slice','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','24iMRPKh','fromEntries','valid','update','execPath',',\x20found\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','message','511026hxKaXX','npm','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','\x20\x20Run\x20manually:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','warn','read','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','red','toLowerCase',',\x20state\x20','Already\x20on\x20requested\x20version\x20(v','/dist-tags','Updating\x20via\x20','yellow','24805UtVjFd','beta','boolean','log','Current\x20version:\x20','Version\x20comparison\x20failed','json','\x20is\x20up\x20to\x20date.','1580kXHGqU','error','1185488sVsBll','75IBtSEW','\x20cli-skill\x20install','Install\x20a\x20specific\x20CLI\x20version','str','validation','version','Current\x20version\x20v','14RKXvJC','string','length','\x20install\x20-g\x20','object','source','expected\x20','code','\x20is\x20newer\x20than\x20npm\x20latest\x20v','Beta\x20version:\x20','entries','Checking\x20CLI\x20Built-in\x20Skill...','gray','current','succeed'];a40_0x5e76=function(){return _0x54fe2f;};return a40_0x5e76();}import a40_0x1fb072 from'chalk';import a40_0x2d16a6 from'ora';function a40_0x2f83(_0x1fb2d9,_0x206acb){_0x1fb2d9=_0x1fb2d9-0x1de;const _0x5e769d=a40_0x5e76();let _0x2f83de=_0x5e769d[_0x1fb2d9];return _0x2f83de;}import a40_0x20e9ee 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 _0x135bc9=a40_0x2f83;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x135bc9(0x1ec)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x5d29dd=a40_0x2f83,_0xcc4755=process[_0x5d29dd(0x1f2)][_0x5d29dd(0x202)]();if(_0xcc4755['includes'](_0x5d29dd(0x237)))return _0x5d29dd(0x237);return _0x5d29dd(0x1f7);}const updateFlags=[{'name':a40_0x5ae98a(0x209),'type':a40_0x5ae98a(0x20a),'description':a40_0x5ae98a(0x1fd),'default':![]},{'name':'version','type':'string','description':a40_0x5ae98a(0x215)}];function getRequestedVersion(_0x35df4b){const _0x5b7ad3=a40_0x5ae98a;return _0x35df4b[_0x5b7ad3(0x216)](_0x5b7ad3(0x218))['trim']();}async function validateUpdateFlags(_0x2886f1){const _0x348118=a40_0x5ae98a,_0x2992dd=_0x2886f1[_0x348118(0x22b)]('beta'),_0x4325fd=getRequestedVersion(_0x2886f1);if(_0x2992dd&&_0x4325fd)throw CliErrors[_0x348118(0x217)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x4325fd&&!a40_0x20e9ee[_0x348118(0x1f0)](_0x4325fd))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x4325fd,_0x348118(0x1f9));}async function fetchNpmDistTags(){const _0x522c23=a40_0x5ae98a;try{const _0x609b61=await fetch(_0x522c23(0x232)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x522c23(0x205),{'signal':AbortSignal[_0x522c23(0x1e9)](0x2710)});if(!_0x609b61['ok'])return null;const _0x5c4ce2=await _0x609b61[_0x522c23(0x20e)]();if(!_0x5c4ce2||typeof _0x5c4ce2!==_0x522c23(0x21e))return null;return Object[_0x522c23(0x1ef)](Object[_0x522c23(0x224)](_0x5c4ce2)[_0x522c23(0x229)](([,_0x2123d1])=>typeof _0x2123d1===_0x522c23(0x21b)&&_0x2123d1[_0x522c23(0x1e0)]()[_0x522c23(0x21c)]>0x0)[_0x522c23(0x1eb)](([_0x1215ce,_0x482c9a])=>[_0x1215ce,String(_0x482c9a)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x2d1ecc){const _0x4848f5=await fetchNpmDistTags();return _0x4848f5?.[_0x2d1ecc]??null;}async function fetchLatestVersion(){const _0x3707cf=a40_0x5ae98a;return fetchNpmDistTagVersion(_0x3707cf(0x1ea));}async function resolveTargetVersion(_0x3fbd0e){const _0x5647f3=a40_0x5ae98a,_0xceb84c=getRequestedVersion(_0x3fbd0e);if(_0xceb84c)return{'version':_0xceb84c,'source':'version'};if(_0x3fbd0e[_0x5647f3(0x22b)]('beta')){const _0x555e69=await fetchNpmDistTagVersion(_0x5647f3(0x209));if(!_0x555e69)return null;return{'version':_0x555e69,'source':_0x5647f3(0x209)};}const _0x66e8b9=await fetchLatestVersion();if(!_0x66e8b9)return null;return{'version':_0x66e8b9,'source':_0x5647f3(0x1ea)};}function shouldInstallTarget(_0x3058dd,_0x50f5b9){const _0x2cbbba=a40_0x5ae98a;if(_0x50f5b9[_0x2cbbba(0x21f)]===_0x2cbbba(0x218)||_0x50f5b9['source']===_0x2cbbba(0x209))return!a40_0x20e9ee['eq'](_0x3058dd,_0x50f5b9[_0x2cbbba(0x218)]);return a40_0x20e9ee['lt'](_0x3058dd,_0x50f5b9['version']);}function getInstallPlanLabel(_0x2f29f4,_0x21f4b3){const _0x4b0300=a40_0x5ae98a;switch(_0x21f4b3[_0x4b0300(0x21f)]){case'beta':return _0x4b0300(0x223)+a40_0x1fb072[_0x4b0300(0x207)](_0x2f29f4)+_0x4b0300(0x1e6)+a40_0x1fb072[_0x4b0300(0x234)](_0x21f4b3[_0x4b0300(0x218)]);case _0x4b0300(0x218):return _0x4b0300(0x22a)+a40_0x1fb072[_0x4b0300(0x207)](_0x2f29f4)+_0x4b0300(0x1e6)+a40_0x1fb072['green'](_0x21f4b3['version']);case _0x4b0300(0x1ea):default:return _0x4b0300(0x1e2)+a40_0x1fb072[_0x4b0300(0x207)](_0x2f29f4)+_0x4b0300(0x1e6)+a40_0x1fb072[_0x4b0300(0x234)](_0x21f4b3[_0x4b0300(0x218)]);}}function repairCurrentBuiltinSkill(){const _0x3fe269=a40_0x5ae98a;console[_0x3fe269(0x20b)](a40_0x1fb072[_0x3fe269(0x226)](_0x3fe269(0x225)));const _0x546ba0=installBuiltinSkill();if(_0x546ba0['ok'])return console[_0x3fe269(0x20b)](a40_0x1fb072[_0x3fe269(0x226)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x546ba0[_0x3fe269(0x1e8)]+_0x3fe269(0x20f))),!![];return console[_0x3fe269(0x1fe)](a40_0x1fb072['yellow'](_0x3fe269(0x1fc)+_0x546ba0[_0x3fe269(0x221)]+_0x3fe269(0x1e3)+(_0x546ba0[_0x3fe269(0x211)]||_0x3fe269(0x1e4)))),console[_0x3fe269(0x20b)](a40_0x1fb072[_0x3fe269(0x226)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x3fe269(0x214))),![];}function verifyUpdatedBuiltinSkill(_0x5ee961){const _0x548c06=a40_0x5ae98a,_0x3c140b=inspectInstalledBuiltinSkillVersion(_0x5ee961);if(_0x3c140b['state']===_0x548c06(0x227))return console[_0x548c06(0x20b)](a40_0x1fb072['gray'](_0x548c06(0x1fb)+_0x5ee961+'\x20is\x20up\x20to\x20date.')),!![];const _0x14c800=_0x3c140b[_0x548c06(0x1e8)]?_0x548c06(0x220)+_0x5ee961+_0x548c06(0x1f3)+_0x3c140b['skillVersion']:_0x548c06(0x220)+_0x5ee961+_0x548c06(0x203)+_0x3c140b['state'];return console[_0x548c06(0x1fe)](a40_0x1fb072['yellow']('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0x14c800)),console['log'](a40_0x1fb072[_0x548c06(0x226)](_0x548c06(0x1fa)+_0x3c140b[_0x548c06(0x231)])),![];}async function execute(_0x588078){const _0x9c2a23=a40_0x5ae98a;await validateUpdateFlags(_0x588078);const _0x3ddab5=getCurrentVersion();console[_0x9c2a23(0x20b)](_0x9c2a23(0x20c)+_0x3ddab5);const _0x3fa34d=a40_0x2d16a6('Checking\x20for\x20updates...')[_0x9c2a23(0x22d)](),_0x2b713e=await resolveTargetVersion(_0x588078);if(!_0x2b713e){const _0x5b4c11=_0x588078[_0x9c2a23(0x22b)](_0x9c2a23(0x209))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x9c2a23(0x200);return _0x3fa34d[_0x9c2a23(0x22e)](_0x5b4c11),console['log'](a40_0x1fb072[_0x9c2a23(0x226)](_0x9c2a23(0x1f8)+NPM_PACKAGE_NAME+_0x9c2a23(0x1df))),{'ok':![],'message':_0x5b4c11};}const _0x590b0f=a40_0x20e9ee[_0x9c2a23(0x1f0)](VERSION),_0x5dfc5e=a40_0x20e9ee[_0x9c2a23(0x1f0)](_0x2b713e['version']);if(!_0x590b0f||!_0x5dfc5e)return _0x3fa34d[_0x9c2a23(0x22e)](_0x9c2a23(0x20d)),{'ok':![],'message':_0x9c2a23(0x20d)};if(!shouldInstallTarget(_0x590b0f,_0x2b713e)){const _0x2c68f3=_0x2b713e[_0x9c2a23(0x21f)]===_0x9c2a23(0x218)?_0x9c2a23(0x204)+_0x2b713e['version']+')':a40_0x20e9ee['gt'](_0x590b0f,_0x5dfc5e)?_0x9c2a23(0x219)+_0x3ddab5+_0x9c2a23(0x222)+_0x2b713e[_0x9c2a23(0x218)]:_0x9c2a23(0x236)+_0x2b713e[_0x9c2a23(0x218)]+')';return _0x3fa34d[_0x9c2a23(0x228)](_0x2c68f3),{'ok':repairCurrentBuiltinSkill()};}_0x3fa34d[_0x9c2a23(0x1e5)](getInstallPlanLabel(_0x3ddab5,_0x2b713e));const _0x4c173c=detectPackageManager(),_0x39e751=_0x4c173c===_0x9c2a23(0x1f7)?resolveNpmBin('npm'):_0x4c173c,_0x575edd=a40_0x2d16a6(_0x9c2a23(0x206)+_0x4c173c+'...')['start']();try{return await execa(_0x39e751,[_0x9c2a23(0x1de),'-g',NPM_PACKAGE_NAME+'@'+_0x2b713e[_0x9c2a23(0x218)]],{'stdio':_0x9c2a23(0x22c)}),_0x575edd[_0x9c2a23(0x228)]('Updated\x20to\x20v'+_0x2b713e[_0x9c2a23(0x218)]),console[_0x9c2a23(0x20b)](a40_0x1fb072[_0x9c2a23(0x226)](_0x9c2a23(0x1ed))),{'ok':verifyUpdatedBuiltinSkill(_0x2b713e[_0x9c2a23(0x218)])};}catch(_0x54a9dd){return _0x575edd[_0x9c2a23(0x22e)](_0x9c2a23(0x230)),console[_0x9c2a23(0x211)](a40_0x1fb072[_0x9c2a23(0x201)]('\x20\x20'+_0x54a9dd[_0x9c2a23(0x1f5)])),console[_0x9c2a23(0x20b)](a40_0x1fb072['gray'](_0x9c2a23(0x1e1)+_0x4c173c+_0x9c2a23(0x21d)+NPM_PACKAGE_NAME+'@'+_0x2b713e[_0x9c2a23(0x218)])),{'ok':![],'message':_0x54a9dd[_0x9c2a23(0x1f5)]};}}export const updateDefinition={'service':a40_0x5ae98a(0x1f1),'command':'run','description':a40_0x5ae98a(0x1f4),'risk':a40_0x5ae98a(0x1ff),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29c0ba,_0x3e78a8){const _0x36601a=a41_0x1aa8,_0x142488=_0x29c0ba();while(!![]){try{const _0x176b5a=-parseInt(_0x36601a(0x108))/0x1*(-parseInt(_0x36601a(0x104))/0x2)+-parseInt(_0x36601a(0x105))/0x3*(-parseInt(_0x36601a(0x10b))/0x4)+-parseInt(_0x36601a(0x10d))/0x5*(parseInt(_0x36601a(0x10c))/0x6)+-parseInt(_0x36601a(0x10a))/0x7*(-parseInt(_0x36601a(0x107))/0x8)+parseInt(_0x36601a(0x106))/0x9+-parseInt(_0x36601a(0x10e))/0xa+parseInt(_0x36601a(0x109))/0xb;if(_0x176b5a===_0x3e78a8)break;else _0x142488['push'](_0x142488['shift']());}catch(_0xfed242){_0x142488['push'](_0x142488['shift']());}}}(a41_0x4658,0xd2c8f));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x1aa8(_0x5e199a,_0x1c5a3a){_0x5e199a=_0x5e199a-0x104;const _0x465839=a41_0x4658();let _0x1aa803=_0x465839[_0x5e199a];return _0x1aa803;}function a41_0x4658(){const _0x43ad55=['342024sjATkt','106KnLgDf','9980982fenboQ','91TQNgZc','1556APZyAc','50262AQPrFb','945pCwKpj','11565990PMuWbA','10684SlXgsu','3594SRuYMY','9970218JnmPZG'];a41_0x4658=function(){return _0x43ad55;};return a41_0x4658();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a42_0x181c(_0xa7fac0,_0x4b3e1f){_0xa7fac0=_0xa7fac0-0x105;const _0x2a746=a42_0x2a74();let _0x181cc4=_0x2a746[_0xa7fac0];return _0x181cc4;}const a42_0x2addd7=a42_0x181c;function a42_0x2a74(){const _0x37d617=['sdk','code','tableName','string','read','994257ATpAzo','bool','72kudqxg','str','429840ftXGDH','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','appCode','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','1643132UKBOjE','4089372EdCOVn','Omit\x20import\x20statements\x20from\x20generated\x20code','30306fDeyOR','2795136AQKqAO','skip-imports','712280KQkmvh','operation'];a42_0x2a74=function(){return _0x37d617;};return a42_0x2a74();}(function(_0x2a53b8,_0x265bb2){const _0x842b36=a42_0x181c,_0x50a278=_0x2a53b8();while(!![]){try{const _0x205c9d=-parseInt(_0x842b36(0x10e))/0x1*(-parseInt(_0x842b36(0x117))/0x2)+parseInt(_0x842b36(0x10c))/0x3+parseInt(_0x842b36(0x114))/0x4+-parseInt(_0x842b36(0x105))/0x5+-parseInt(_0x842b36(0x118))/0x6+-parseInt(_0x842b36(0x115))/0x7+-parseInt(_0x842b36(0x110))/0x8;if(_0x205c9d===_0x265bb2)break;else _0x50a278['push'](_0x50a278['shift']());}catch(_0x4f932d){_0x50a278['push'](_0x50a278['shift']());}}}(a42_0x2a74,0x8f4e4));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':a42_0x2addd7(0x107),'description':a42_0x2addd7(0x113),'risk':a42_0x2addd7(0x10b),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':a42_0x2addd7(0x10a),'required':!![],'description':a42_0x2addd7(0x111)},{'name':'skip-imports','type':'boolean','description':a42_0x2addd7(0x116)}],async 'execute'(_0x192fd4){const _0x12ff35=a42_0x2addd7,{dataset:_0x25de9f,operation:_0x107f91}=await getOperationDetail(_0x192fd4[_0x12ff35(0x112)],_0x192fd4['str'](_0x12ff35(0x108)),_0x192fd4['str'](_0x12ff35(0x106))),_0x33a204=generateSdkCode(_0x25de9f,_0x107f91,{'includeImports':!_0x192fd4[_0x12ff35(0x10d)](_0x12ff35(0x119))});return{'ok':!![],'data':{'dataset':{'name':_0x25de9f['name'],'code':_0x25de9f[_0x12ff35(0x108)],'tableName':_0x25de9f[_0x12ff35(0x109)]},'operation':_0x192fd4[_0x12ff35(0x10f)](_0x12ff35(0x106)),'code':_0x33a204}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x592288=a43_0x2ccc;(function(_0x37189a,_0x131e14){const _0x4d1e93=a43_0x2ccc,_0x40fd97=_0x37189a();while(!![]){try{const _0x2061b2=-parseInt(_0x4d1e93(0x19c))/0x1*(-parseInt(_0x4d1e93(0x18c))/0x2)+-parseInt(_0x4d1e93(0x19f))/0x3*(parseInt(_0x4d1e93(0x192))/0x4)+parseInt(_0x4d1e93(0x199))/0x5*(parseInt(_0x4d1e93(0x19e))/0x6)+parseInt(_0x4d1e93(0x194))/0x7*(parseInt(_0x4d1e93(0x19a))/0x8)+parseInt(_0x4d1e93(0x191))/0x9+-parseInt(_0x4d1e93(0x18d))/0xa+-parseInt(_0x4d1e93(0x18e))/0xb;if(_0x2061b2===_0x131e14)break;else _0x40fd97['push'](_0x40fd97['shift']());}catch(_0x16e9e4){_0x40fd97['push'](_0x40fd97['shift']());}}}(a43_0x78c5,0x52b82));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x2ccc(_0x14c2c0,_0x5cd1d3){_0x14c2c0=_0x14c2c0-0x189;const _0x78c51a=a43_0x78c5();let _0x2cccd5=_0x78c51a[_0x14c2c0];return _0x2cccd5;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':'codegen','command':'sql','description':a43_0x592288(0x19b),'risk':a43_0x592288(0x195),'flags':[SQLCODE_FLAG,{'name':a43_0x592288(0x193),'type':'string','description':a43_0x592288(0x190),'default':'sdk','enum':[a43_0x592288(0x19d),a43_0x592288(0x197)]},{'name':a43_0x592288(0x196),'type':a43_0x592288(0x189),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x5566a9){const _0x158477=a43_0x592288,_0x1138ae=await getSqlQueryInfo(_0x5566a9[_0x158477(0x18a)],_0x5566a9[_0x158477(0x18f)]('sqlcode')),_0x3c4a53=_0x5566a9[_0x158477(0x18f)]('target')||'sdk',_0x231347=generateSqlCodeTemplate(_0x1138ae,{'target':_0x3c4a53,'includeImports':!_0x5566a9['bool'](_0x158477(0x196))});return{'ok':!![],'data':{'sqlCode':_0x1138ae[_0x158477(0x18b)],'sqlName':_0x1138ae[_0x158477(0x198)],'target':_0x3c4a53,'code':_0x231347}};}};function a43_0x78c5(){const _0x331ddf=['Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','22495qJYgfp','sdk','6LbPsna','81NhdAXM','boolean','appCode','sqlCode','52GSfsUL','1812480geFNIw','5184861WDApvy','str','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','4441932PbgOmc','78724cwqglM','target','21YeNZgt','read','no-imports','bff','sqlName','1900645tsEDjJ','171352BoEvRO'];a43_0x78c5=function(){return _0x331ddf;};return a43_0x78c5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d9229,_0x1e74c6){const _0xe8cc22=a44_0x55e6,_0x1d3a14=_0x3d9229();while(!![]){try{const _0x1ebd48=-parseInt(_0xe8cc22(0x1e7))/0x1+parseInt(_0xe8cc22(0x1ed))/0x2+parseInt(_0xe8cc22(0x1da))/0x3*(parseInt(_0xe8cc22(0x1e3))/0x4)+parseInt(_0xe8cc22(0x1f9))/0x5*(parseInt(_0xe8cc22(0x1e9))/0x6)+parseInt(_0xe8cc22(0x1f8))/0x7*(parseInt(_0xe8cc22(0x1f3))/0x8)+-parseInt(_0xe8cc22(0x1cf))/0x9*(-parseInt(_0xe8cc22(0x1f0))/0xa)+-parseInt(_0xe8cc22(0x1f2))/0xb;if(_0x1ebd48===_0x1e74c6)break;else _0x1d3a14['push'](_0x1d3a14['shift']());}catch(_0x43c598){_0x1d3a14['push'](_0x1d3a14['shift']());}}}(a44_0x2be0,0x93636));import{CliErrors}from'../../errors.js';function a44_0x2be0(){const _0x299ab5=['4hKtbhC','bool','\x22\x20(appcode:\x20','\x20Note:\x20app\x20\x22','595482Xufann','both','6635418vNTRJo','trim','\x20<name>','Removed\x20app\x20\x22','636340fURZaf','\x22\x20not\x20found.','global','10bACUkL','App\x20\x22','21945649pwWgqH','8LdXuZN','length','project','validation','Updated','3112207tiPYeU','5XmohvV','string','\x20<name>\x20[--global]','Usage:\x20','apps','7571952PodZHH','\x22\x20is\x20selected\x20automatically.','boolean','Missing\x20app\x20name.','appcode','Use\x20global\x20config\x20scope','\x20<name>\x20--appcode\x20<code>','args','globalConfig','projectConfig','defaultApp','1452723tZZsTc','flagMissing','\x20Default\x20app\x20is\x20\x22','object','\x20Default\x20app\x20changed\x20to\x20\x22','keys','\x20app\x20\x22','\x22\x20still\x20defined\x20in\x20','str'];a44_0x2be0=function(){return _0x299ab5;};return a44_0x2be0();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a44_0x55e6(_0x42d0ca,_0x5d9690){_0x42d0ca=_0x42d0ca-0x1cd;const _0x2be07c=a44_0x2be0();let _0x55e67e=_0x2be07c[_0x42d0ca];return _0x55e67e;}export function buildAppAddFlags(){const _0x4d0f54=a44_0x55e6;return[{'name':_0x4d0f54(0x1d3),'type':_0x4d0f54(0x1fa),'description':'App\x20code','required':!![]},{'name':_0x4d0f54(0x1ef),'type':_0x4d0f54(0x1d1),'description':_0x4d0f54(0x1d4),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x5da9ce=a44_0x55e6;return[{'name':'global','type':_0x5da9ce(0x1d1),'description':'Use\x20global\x20config\x20scope','default':![]}];}export async function validateAppName(_0x14fb85,_0x458a38){const _0x26c245=a44_0x55e6,_0x2d172a=_0x14fb85['args'][0x0]?.['trim']();if(!_0x2d172a)throw CliErrors[_0x26c245(0x1f6)](_0x26c245(0x1d2),_0x26c245(0x1cd)+CLI_BIN_NAME+'\x20'+_0x458a38+_0x26c245(0x1eb));}export async function runAppAdd(_0x37458e,_0x47e78d){const _0x27e10c=a44_0x55e6,_0x209ff5=_0x37458e[_0x27e10c(0x1d6)][0x0]?.[_0x27e10c(0x1ea)]();if(!_0x209ff5)throw CliErrors[_0x27e10c(0x1f6)](_0x27e10c(0x1d2),_0x27e10c(0x1cd)+CLI_BIN_NAME+'\x20'+_0x47e78d+'\x20<name>\x20--appcode\x20<code>');const _0x2067fb=_0x37458e[_0x27e10c(0x1e2)](_0x27e10c(0x1d3));if(!_0x2067fb)throw CliErrors[_0x27e10c(0x1db)](_0x27e10c(0x1d3),_0x27e10c(0x1cd)+CLI_BIN_NAME+'\x20'+_0x47e78d+_0x27e10c(0x1d5));const _0x2a2e5f={'global':_0x37458e[_0x27e10c(0x1e4)](_0x27e10c(0x1ef))},_0x45d68c=readConfig(_0x2a2e5f);if(!_0x45d68c['apps'])_0x45d68c[_0x27e10c(0x1ce)]={};const _0x1ffad4={'appcode':_0x2067fb,...collectAppProfileOverrides(_0x593f65=>_0x37458e[_0x27e10c(0x1e2)](_0x593f65))},_0x490f32=_0x45d68c['apps'],_0x571774=Object['keys'](_0x490f32),_0x2833ac=typeof _0x45d68c[_0x27e10c(0x1d9)]===_0x27e10c(0x1fa)&&_0x490f32[_0x45d68c['defaultApp']]?_0x45d68c[_0x27e10c(0x1d9)]:_0x571774[_0x27e10c(0x1f4)]===0x1?_0x571774[0x0]:undefined,_0x8edb4d=!!_0x490f32[_0x209ff5];_0x490f32[_0x209ff5]=_0x1ffad4;const _0x223c0a=normalizeStoredDefaultApp(_0x45d68c,_0x2833ac);writeConfig(_0x45d68c,_0x2a2e5f);const _0x5fde22=!_0x8edb4d&&_0x223c0a?_0x27e10c(0x1dc)+_0x223c0a+'\x22.':'',_0x280431=(_0x8edb4d?_0x27e10c(0x1f7):'Added')+_0x27e10c(0x1e0)+_0x209ff5+_0x27e10c(0x1e5)+_0x2067fb+')'+scopeLabel(_0x2a2e5f)+'.'+_0x5fde22;return{'ok':!![],'message':_0x280431};}export async function runAppRemove(_0x18269f,_0x2ba160){const _0x4a92c8=a44_0x55e6,_0x49740b=_0x18269f['args'][0x0]?.[_0x4a92c8(0x1ea)]();if(!_0x49740b)throw CliErrors[_0x4a92c8(0x1f6)]('Missing\x20app\x20name.',_0x4a92c8(0x1cd)+CLI_BIN_NAME+'\x20'+_0x2ba160+_0x4a92c8(0x1fb));const _0x26ccab=_0x18269f['bool'](_0x4a92c8(0x1ef)),{config:_0x5a962d,layers:_0x11ead3}=readRawConfigWithLayers(),_0x57021b=_0x5a962d[_0x4a92c8(0x1ce)]??{};if(!_0x57021b[_0x49740b])throw CliErrors[_0x4a92c8(0x1f6)](_0x4a92c8(0x1f1)+_0x49740b+_0x4a92c8(0x1ee));const _0x47bfd3=_0x11ead3[_0x4a92c8(0x1d7)][_0x4a92c8(0x1ce)]&&typeof _0x11ead3[_0x4a92c8(0x1d7)][_0x4a92c8(0x1ce)]===_0x4a92c8(0x1dd)?_0x11ead3[_0x4a92c8(0x1d7)][_0x4a92c8(0x1ce)]:{},_0x210fa9=_0x11ead3[_0x4a92c8(0x1d8)][_0x4a92c8(0x1ce)]&&typeof _0x11ead3[_0x4a92c8(0x1d8)][_0x4a92c8(0x1ce)]===_0x4a92c8(0x1dd)?_0x11ead3[_0x4a92c8(0x1d8)]['apps']:{},_0x11dc68=appDefinedIn(_0x49740b,_0x47bfd3,_0x210fa9),_0x238090=resolveAppScopeForWrite(_0x49740b,_0x26ccab,_0x11ead3),_0x2f0232={'global':_0x238090===_0x4a92c8(0x1ef)},_0x26897=readConfig(_0x2f0232),_0xa17762=_0x26897[_0x4a92c8(0x1ce)];if(!_0xa17762||!_0xa17762[_0x49740b])throw CliErrors[_0x4a92c8(0x1f6)](_0x4a92c8(0x1f1)+_0x49740b+_0x4a92c8(0x1ee));delete _0xa17762[_0x49740b];let _0x2c35ef='';const _0x26d9d5=typeof _0x26897[_0x4a92c8(0x1d9)]===_0x4a92c8(0x1fa)?_0x26897['defaultApp']:undefined,_0x1f3dfb=Object[_0x4a92c8(0x1df)](_0xa17762),_0x1fe350=_0x26d9d5===_0x49740b?_0x1f3dfb[0x0]:_0x26d9d5,_0x155dc0=normalizeStoredDefaultApp(_0x26897,_0x1fe350);if(_0x26d9d5===_0x49740b&&_0x1f3dfb[_0x4a92c8(0x1f4)]===0x1)_0x2c35ef='\x20Remaining\x20app\x20\x22'+_0x1f3dfb[0x0]+_0x4a92c8(0x1d0);else _0x26d9d5===_0x49740b&&_0x155dc0&&(_0x2c35ef=_0x4a92c8(0x1de)+_0x155dc0+'\x22.');Object['keys'](_0xa17762)['length']===0x0&&(delete _0x26897[_0x4a92c8(0x1ce)],delete _0x26897[_0x4a92c8(0x1d9)]);writeConfig(_0x26897,_0x2f0232);const _0xa833a=_0x11dc68===_0x4a92c8(0x1e8)?_0x4a92c8(0x1e6)+_0x49740b+_0x4a92c8(0x1e1)+(_0x238090===_0x4a92c8(0x1f5)?_0x4a92c8(0x1ef):_0x4a92c8(0x1f5))+'\x20config.':'';return{'ok':!![],'message':_0x4a92c8(0x1ec)+_0x49740b+'\x22'+scopeLabel(_0x2f0232)+'.'+_0x2c35ef+_0xa833a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d7e19,_0x3b336c){const _0x582b6c=a45_0x35d1,_0xba3a8=_0x1d7e19();while(!![]){try{const _0xd86131=parseInt(_0x582b6c(0x157))/0x1*(parseInt(_0x582b6c(0x149))/0x2)+-parseInt(_0x582b6c(0x152))/0x3+parseInt(_0x582b6c(0x146))/0x4*(-parseInt(_0x582b6c(0x15e))/0x5)+parseInt(_0x582b6c(0x147))/0x6+parseInt(_0x582b6c(0x154))/0x7+parseInt(_0x582b6c(0x145))/0x8+parseInt(_0x582b6c(0x13c))/0x9*(-parseInt(_0x582b6c(0x148))/0xa);if(_0xd86131===_0x3b336c)break;else _0xba3a8['push'](_0xba3a8['shift']());}catch(_0xd13a48){_0xba3a8['push'](_0xba3a8['shift']());}}}(a45_0x4a92,0x30fe1));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x46063e from'chalk';import{validateAppcode}from'../../commands/common/validate.js';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 _0x4c1212=a45_0x35d1,_0x4b413f=await input({'message':_0x4c1212(0x15c),'validate':_0x3380fd=>{const _0x296437=_0x4c1212,_0x25b0c9=validateAppcode(_0x3380fd[_0x296437(0x14d)]());return _0x25b0c9[_0x296437(0x15b)]||_0x25b0c9['message']||_0x296437(0x143);}});return _0x4b413f['trim']();}export async function promptAppSelection(_0x5b5825){const _0x2d26d4=a45_0x35d1,_0x69127a=[{'name':a45_0x46063e[_0x2d26d4(0x158)](_0x2d26d4(0x153)),'value':-0x1},..._0x5b5825['map']((_0x38fbaf,_0xa09a49)=>({'name':_0x38fbaf[_0x2d26d4(0x14e)]+'\x20\x20'+a45_0x46063e[_0x2d26d4(0x155)]('('+_0x38fbaf[_0x2d26d4(0x14a)]+')'),'value':_0xa09a49}))],_0x2a4f34=await checkbox({'message':_0x2d26d4(0x15f)+a45_0x46063e[_0x2d26d4(0x15d)](_0x5b5825[_0x2d26d4(0x141)])+_0x2d26d4(0x15a),'choices':_0x69127a,'loop':![]});if(_0x2a4f34['includes'](-0x1))return _0x2d26d4(0x14c);if(_0x2a4f34['length']===0x0)return _0x2d26d4(0x14c);return _0x2a4f34[_0x2d26d4(0x150)](_0x2f4f96=>_0x5b5825[_0x2f4f96]);}function a45_0x35d1(_0x41408b,_0x4083aa){_0x41408b=_0x41408b-0x13c;const _0x4a9294=a45_0x4a92();let _0x35d153=_0x4a9294[_0x41408b];return _0x35d153;}export async function promptSingleAppSelection(_0x164ec3){const _0x45a4c8=a45_0x35d1,_0x177fce=[{'name':a45_0x46063e['gray'](_0x45a4c8(0x140)),'value':_0x45a4c8(0x159)},{'name':a45_0x46063e[_0x45a4c8(0x158)]('✎\x20Enter\x20appcode\x20manually'),'value':_0x45a4c8(0x14c)},..._0x164ec3['map'](_0x172df0=>({'name':_0x172df0[_0x45a4c8(0x14e)]+'\x20\x20'+a45_0x46063e[_0x45a4c8(0x155)]('('+_0x172df0[_0x45a4c8(0x14a)]+')'),'value':_0x172df0[_0x45a4c8(0x14a)]}))],_0x4c77cc=await select({'message':_0x45a4c8(0x151),'choices':_0x177fce});if(_0x4c77cc===_0x45a4c8(0x159))return'skip';if(_0x4c77cc===_0x45a4c8(0x14c))return _0x45a4c8(0x14c);return _0x164ec3[_0x45a4c8(0x156)](_0xcfd8b0=>_0xcfd8b0['appCode']===_0x4c77cc);}export async function selectSingleAppcode(_0x22132f){const _0x4db605=a45_0x35d1;if(!_0x22132f)return writeCliSideChannelLine(a45_0x46063e[_0x4db605(0x155)](_0x4db605(0x13e))),_fallbackOrSkip();writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x3cf956;try{_0x3cf956=await withActiveCookie(_0x22132f,()=>listRemoteApps());}catch(_0x4a5944){writeCliSideChannelLine(a45_0x46063e['yellow']('Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'));if(_0x4a5944 instanceof Error)writeCliSideChannelLine(a45_0x46063e[_0x4db605(0x155)](_0x4db605(0x13f)+_0x4a5944[_0x4db605(0x14b)]+')'));return _fallbackOrSkip();}if(_0x3cf956[_0x4db605(0x141)]===0x0)return writeCliSideChannelLine(a45_0x46063e[_0x4db605(0x158)](_0x4db605(0x144))),_fallbackOrSkip();const _0x3a2fde=await promptSingleAppSelection(_0x3cf956);if(_0x3a2fde===_0x4db605(0x159))return'';if(_0x3a2fde===_0x4db605(0x14c))return promptCustomAppcode();return _0x3a2fde[_0x4db605(0x14a)];}export async function selectMultipleApps(_0x36ad92){const _0x11f4a7=a45_0x35d1;writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x2542c3;try{_0x2542c3=await withActiveCookie(_0x36ad92,()=>listRemoteApps());}catch(_0x732a3a){writeCliSideChannelLine('\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.');if(_0x732a3a instanceof Error)writeCliSideChannelLine(_0x11f4a7(0x13f)+_0x732a3a[_0x11f4a7(0x14b)]+')');return'custom';}if(_0x2542c3[_0x11f4a7(0x141)]===0x0)return writeCliSideChannelLine('\x0aNo\x20available\x20apps\x20found.'),_0x11f4a7(0x14c);return promptAppSelection(_0x2542c3);}function a45_0x4a92(){const _0x1c1489=['appName','✎\x20Enter\x20manually','map','Select\x20the\x20app\x20to\x20bind:','599934XApisu','✎\x20Enter\x20appcode\x20manually','2608172FZzVKj','gray','find','1OvpGEn','yellow','skip','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','valid','App\x20Code:','cyan','5RwQKNm','Found\x20','1152SaACpM','(Skip;\x20configure\x20later)','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','\x20\x20(','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','length','manual','Invalid\x20App\x20Code','No\x20available\x20apps\x20found.','42344LLGAdr','1184636UOUzZo','2135610fhYRoR','20140cUXvmO','441556fSQyHg','appCode','message','custom','trim'];a45_0x4a92=function(){return _0x1c1489;};return a45_0x4a92();}async function _fallbackOrSkip(){const _0x3f7964=a45_0x35d1,_0x2d6567=await select({'message':_0x3f7964(0x15c),'choices':[{'name':a45_0x46063e[_0x3f7964(0x155)](_0x3f7964(0x13d)),'value':_0x3f7964(0x159)},{'name':a45_0x46063e['yellow'](_0x3f7964(0x14f)),'value':_0x3f7964(0x142)}]});if(_0x2d6567===_0x3f7964(0x159))return'';return promptCustomAppcode();}
|