@lovrabet/rabetbase-cli 2.5.1-beta.3 → 2.5.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +3 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/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 +38 -2
- 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 -6
- 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 +37 -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/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.d.ts +0 -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 +16 -13
- 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 -6
- package/skills/rabetbase/references/rabetbase-doctor.md +2 -1
- package/skills/rabetbase/references/rabetbase-init.md +32 -10
- package/skills/rabetbase/references/rabetbase-kb.md +7 -7
- 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 +49 -0
- package/skills/rabetbase.manifest.json +5 -3
- package/lib/config/project-routing.d.ts +0 -30
- package/lib/config/project-routing.js +0 -1
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x3baceb=a32_0x7dd1;(function(_0x3e6b40,_0x29c608){const _0x1ad06b=a32_0x7dd1,_0x41700b=_0x3e6b40();while(!![]){try{const _0x5bb828=-parseInt(_0x1ad06b(0x10d))/0x1*(parseInt(_0x1ad06b(0x108))/0x2)+parseInt(_0x1ad06b(0xea))/0x3+-parseInt(_0x1ad06b(0x109))/0x4*(parseInt(_0x1ad06b(0xe6))/0x5)+parseInt(_0x1ad06b(0xff))/0x6+-parseInt(_0x1ad06b(0xde))/0x7+-parseInt(_0x1ad06b(0xfa))/0x8+-parseInt(_0x1ad06b(0xe0))/0x9*(-parseInt(_0x1ad06b(0xe3))/0xa);if(_0x5bb828===_0x29c608)break;else _0x41700b['push'](_0x41700b['shift']());}catch(_0xdf504b){_0x41700b['push'](_0x41700b['shift']());}}}(a32_0x237a,0xdbfaa));function a32_0x7dd1(_0x5e8e2e,_0x3a7a42){_0x5e8e2e=_0x5e8e2e-0xdc;const _0x237a92=a32_0x237a();let _0x7dd1ac=_0x237a92[_0x5e8e2e];return _0x7dd1ac;}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';function a32_0x237a(){const _0x3e159f=['str','6147974liSwXA','map','6651KetbVr','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','35560LYitcp','delete','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','85QHDlMC','join','startsWith','target','3259125Azljbs','lockFilePath','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Lock\x20scope\x20for\x20app\x20\x22','/api/management/library/scripts/delete','string','parse','projectRoot','toISOString','Deleted\x20','includes','apps','Backend\x20Function\x20lock\x20file\x20not\x20found.','remoteId','filter','POST','6217568ixeVMZ','length','trashDir','\x20(local\x20file\x20moved\x20to\x20trash)','find','5399466ZyMnWh','bff','Multiple\x20functions\x20match\x20\x22','\x20\x20-\x20','functions','No\x20lock\x20entry\x20found\x20for\x20\x22','split','Local\x20delete\x20not\x20settled\x20for\x20','scriptsRootDir','61558mnPVrb','187228JdSTcG','appCode','<timestamp>','validation','41XAsDGx','scriptsRoot','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local'];a32_0x237a=function(){return _0x3e159f;};return a32_0x237a();}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_0x3baceb(0x100),'command':a32_0x3baceb(0xe4),'description':a32_0x3baceb(0xdc),'risk':'high-risk-write','flags':[{'name':a32_0x3baceb(0xe9),'type':a32_0x3baceb(0xef),'required':!![],'description':a32_0x3baceb(0xec)}],async 'validate'(_0x589188){const _0x1a23b4=a32_0x3baceb,_0x1f7043=loadBffProjectConfig(_0x589188[_0x1a23b4(0x10a)]),_0x26039a=await readBffLockFile(_0x1f7043[_0x1a23b4(0xeb)]);if(!_0x26039a)throw CliErrors[_0x1a23b4(0x10c)](_0x1a23b4(0xe1));},async 'dryRun'(_0x47d0dc){const _0x3c1d7f=a32_0x3baceb,_0x5b3295=loadBffProjectConfig(_0x47d0dc[_0x3c1d7f(0x10a)]),_0x957a8d=await readBffLockFile(_0x5b3295[_0x3c1d7f(0xeb)]);if(!_0x957a8d)throw CliErrors[_0x3c1d7f(0x10c)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x2d461e}=ensureLockScope(_0x957a8d,_0x47d0dc[_0x3c1d7f(0x10a)],_0x5b3295[_0x3c1d7f(0x10e)],'delete'),_0x558763=_0x47d0dc[_0x3c1d7f(0xdd)](_0x3c1d7f(0xe9)),_0x4a5931=Object['keys'](_0x2d461e['functions']),_0x2c2526=resolveDeleteTarget(_0x558763,_0x4a5931),_0x21586b=_0x2d461e['functions'][_0x2c2526];if(!_0x21586b)throw CliErrors[_0x3c1d7f(0x10c)](_0x3c1d7f(0x104)+_0x2c2526+'\x22.');const _0x47249d=resolveLocalFilePathFromLockKey(_0x5b3295,_0x2c2526),_0x3669f2=relative(_0x5b3295[_0x3c1d7f(0xf1)],_0x47249d),_0xe63531=join(_0x5b3295['trashDir'],_0x3c1d7f(0x10b),_0x3669f2);return{'method':_0x3c1d7f(0xf9),'url':_0x3c1d7f(0xee),'body':{'appCode':_0x47d0dc[_0x3c1d7f(0x10a)],'target':_0x2c2526,'remoteId':_0x21586b['remoteId'],'localFilePath':_0x47249d,'trashedPath':_0xe63531},'description':'Would\x20delete\x20'+_0x2c2526+_0x3c1d7f(0xe5)};},async 'execute'(_0x5db6be){const _0x28db59=a32_0x3baceb,_0xa528ef=loadBffProjectConfig(_0x5db6be[_0x28db59(0x10a)]),_0x39417b=await readBffLockFile(_0xa528ef[_0x28db59(0xeb)]);if(!_0x39417b)throw CliErrors[_0x28db59(0x10c)](_0x28db59(0xf6));const {lockData:_0x32aca4,appLock:_0x393bc8}=ensureLockScope(_0x39417b,_0x5db6be[_0x28db59(0x10a)],_0xa528ef[_0x28db59(0x10e)],_0x28db59(0xe4)),_0x1cb2ab=JSON[_0x28db59(0xf0)](JSON['stringify'](_0x32aca4)),_0x214007=_0x1cb2ab[_0x28db59(0xf5)][_0x5db6be['appCode']];if(!_0x214007)throw new Error(_0x28db59(0xed)+_0x5db6be[_0x28db59(0x10a)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x5b1acb=_0x5db6be['str'](_0x28db59(0xe9)),_0x11a455=Object['keys'](_0x214007[_0x28db59(0x103)]),_0x16a7df=resolveDeleteTarget(_0x5b1acb,_0x11a455),_0x44cded=_0x214007[_0x28db59(0x103)][_0x16a7df];if(!_0x44cded)throw CliErrors[_0x28db59(0x10c)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x16a7df+'\x22.');await deleteBffScript(_0x44cded[_0x28db59(0xf7)]),delete _0x214007[_0x28db59(0x103)][_0x16a7df],_0x214007['lastSync']=new Date()[_0x28db59(0xf2)](),await writeBffLockFile(_0xa528ef[_0x28db59(0xeb)],_0x1cb2ab);const _0x1b252e=resolveLocalFilePathFromLockKey(_0xa528ef,_0x16a7df);let _0x2e5d2f;await fileExists(_0x1b252e)&&(_0x2e5d2f=await moveToTrash(_0xa528ef[_0x28db59(0xf1)],_0xa528ef[_0x28db59(0xfc)],_0x1b252e),await cleanupEmptyDirectories(dirname(_0x1b252e),_0xa528ef[_0x28db59(0x107)]));await waitForDeleteSettlement(_0xa528ef[_0x28db59(0xeb)],_0x5db6be[_0x28db59(0x10a)],_0x16a7df,_0x1b252e),await sleep(0x96);const _0x5035c6={'deleted':_0x16a7df,'remoteId':_0x44cded[_0x28db59(0xf7)]};if(_0x2e5d2f)_0x5035c6['trashedTo']=_0x2e5d2f;return{'ok':!![],'data':_0x5035c6,'message':_0x28db59(0xf3)+_0x16a7df+(_0x2e5d2f?_0x28db59(0xfd):'')};}};function resolveDeleteTarget(_0x423e79,_0x112bf5){const _0x100a34=a32_0x3baceb;if(_0x423e79[_0x100a34(0xf4)]('/')){const _0x2d5d74=_0x112bf5[_0x100a34(0xfe)](_0x3d0095=>_0x3d0095===_0x423e79);if(!_0x2d5d74)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x423e79);return _0x2d5d74;}const _0x17548a=_0x112bf5[_0x100a34(0xf8)](_0x907dd7=>_0x907dd7[_0x100a34(0x105)]('/')['at'](-0x1)===_0x423e79);if(_0x17548a[_0x100a34(0xfb)]===0x0)throw CliErrors[_0x100a34(0x10c)]('Function\x20not\x20found:\x20'+_0x423e79);if(_0x17548a[_0x100a34(0xfb)]>0x1)throw CliErrors['validation'](_0x100a34(0x101)+_0x423e79+_0x100a34(0xe2)+_0x17548a[_0x100a34(0xdf)](_0x81c6a9=>_0x100a34(0x102)+_0x81c6a9)[_0x100a34(0xe7)]('\x0a'));return _0x17548a[0x0];}async function moveToTrash(_0x4f42ed,_0x578b1b,_0x174cdb){const _0x5c6e6a=a32_0x3baceb,_0xb7c380=new Date()[_0x5c6e6a(0xf2)]()['replace'](/[:.]/g,'-'),_0x279b03=relative(_0x4f42ed,_0x174cdb),_0x3a7c1a=join(_0x578b1b,_0xb7c380,_0x279b03);return await mkdir(dirname(_0x3a7c1a),{'recursive':!![]}),await rename(_0x174cdb,_0x3a7c1a),_0x3a7c1a;}async function cleanupEmptyDirectories(_0xf057e4,_0x2d71d0){const _0xd13a7b=a32_0x3baceb;let _0x70e808=resolve(_0xf057e4);const _0x4d9781=resolve(_0x2d71d0);while(_0x70e808[_0xd13a7b(0xe8)](''+_0x4d9781+sep)||_0x70e808===_0x4d9781){if(_0x70e808===_0x4d9781)return;try{const _0x3767b7=await readdir(_0x70e808);if(_0x3767b7[_0xd13a7b(0xfb)]>0x0)return;await rmdir(_0x70e808);}catch{return;}_0x70e808=dirname(_0x70e808);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x47ce5c,_0x18a82e,_0x26ddfb,_0x335554){const _0x2cde12=a32_0x3baceb;for(let _0x298728=0x0;_0x298728<DELETE_SETTLE_RETRY_COUNT;_0x298728+=0x1){const _0x18193a=await readBffLockFile(_0x47ce5c),_0x3cb9a8=!!_0x18193a?.['apps']?.[_0x18a82e]?.['functions']?.[_0x26ddfb],_0x10780e=await fileExists(_0x335554);if(!_0x3cb9a8&&!_0x10780e)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x2cde12(0x106)+_0x26ddfb+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a33_0x40d3(_0x4e37c2,_0x5481b3){_0x4e37c2=_0x4e37c2-0x1ea;const _0x1024b8=a33_0x1024();let _0x40d301=_0x1024b8[_0x4e37c2];return _0x40d301;}const a33_0x47832e=a33_0x40d3;(function(_0x1c2a33,_0x2af784){const _0x111e63=a33_0x40d3,_0x245d87=_0x1c2a33();while(!![]){try{const _0x5cbb98=parseInt(_0x111e63(0x1ea))/0x1*(parseInt(_0x111e63(0x201))/0x2)+parseInt(_0x111e63(0x1ec))/0x3*(-parseInt(_0x111e63(0x1f3))/0x4)+-parseInt(_0x111e63(0x1f1))/0x5+-parseInt(_0x111e63(0x1ee))/0x6*(-parseInt(_0x111e63(0x207))/0x7)+parseInt(_0x111e63(0x202))/0x8*(parseInt(_0x111e63(0x1f9))/0x9)+parseInt(_0x111e63(0x1f4))/0xa*(parseInt(_0x111e63(0x1fb))/0xb)+-parseInt(_0x111e63(0x205))/0xc;if(_0x5cbb98===_0x2af784)break;else _0x245d87['push'](_0x245d87['shift']());}catch(_0x328672){_0x245d87['push'](_0x245d87['shift']());}}}(a33_0x1024,0x9a9f6));function a33_0x1024(){const _0x19e9a9=['696648SfCDsl','updateUserName','version','12082452kBehxM','detail','148946CJxnGF','1trYalS','number','30pfRsED','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','342IZGVLl','bff','updatedTime','1348925hsskfZ','functionName','495052BfZySR','779740KEhHvl','appCode','bool','Return\x20full\x20raw\x20script\x20object','scriptType','63LBcTWk','(none)','143GwLZak','read','boolean','num','description','verbose','623090rrAUdg'];a33_0x1024=function(){return _0x19e9a9;};return a33_0x1024();}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x47832e(0x1ef),'command':a33_0x47832e(0x206),'description':a33_0x47832e(0x1ed),'risk':a33_0x47832e(0x1fc),'flags':[{'name':'id','type':a33_0x47832e(0x1eb),'required':!![],'description':'Script\x20ID'},{'name':a33_0x47832e(0x200),'type':a33_0x47832e(0x1fd),'description':a33_0x47832e(0x1f7)}],async 'execute'(_0x4ea4b3){const _0x5a3ec9=a33_0x47832e,_0x6aeaa0=await getBffScriptInfo(_0x4ea4b3[_0x5a3ec9(0x1fe)]('id')),_0x5d65e0=_0x4ea4b3[_0x5a3ec9(0x1f6)](_0x5a3ec9(0x200));if(_0x5d65e0)return{'ok':!![],'data':_0x6aeaa0};return{'ok':!![],'data':{'id':_0x6aeaa0['id'],'functionName':_0x6aeaa0[_0x5a3ec9(0x1f2)]??'','version':_0x6aeaa0[_0x5a3ec9(0x204)]??'','updateUserName':_0x6aeaa0[_0x5a3ec9(0x203)]??'','appCode':_0x6aeaa0[_0x5a3ec9(0x1f5)],'scriptType':_0x6aeaa0[_0x5a3ec9(0x1f8)],'description':_0x6aeaa0[_0x5a3ec9(0x1ff)]||_0x5a3ec9(0x1fa),'createdTime':_0x6aeaa0['createdTime']??'','updatedTime':_0x6aeaa0[_0x5a3ec9(0x1f0)]??'','scriptContent':_0x6aeaa0['scriptContent']??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x167b89,_0x252a69){const _0x135a62=a34_0x2399,_0x410c8f=_0x167b89();while(!![]){try{const _0xe3c864=-parseInt(_0x135a62(0x17d))/0x1+-parseInt(_0x135a62(0x17e))/0x2*(parseInt(_0x135a62(0x17c))/0x3)+parseInt(_0x135a62(0x17b))/0x4+-parseInt(_0x135a62(0x178))/0x5+-parseInt(_0x135a62(0x180))/0x6+parseInt(_0x135a62(0x17f))/0x7*(-parseInt(_0x135a62(0x179))/0x8)+parseInt(_0x135a62(0x17a))/0x9*(parseInt(_0x135a62(0x177))/0xa);if(_0xe3c864===_0x252a69)break;else _0x410c8f['push'](_0x410c8f['shift']());}catch(_0x3cfcbf){_0x410c8f['push'](_0x410c8f['shift']());}}}(a34_0x526a,0xd0ad4));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a34_0x2399(_0x28a930,_0x41906d){_0x28a930=_0x28a930-0x177;const _0x526a83=a34_0x526a();let _0x2399ba=_0x526a83[_0x28a930];return _0x2399ba;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';function a34_0x526a(){const _0x27e70c=['9TmqlBu','5432524Bnppjb','1810545SHHfef','853700oJCkgN','2rAjzNu','6079346wYrwKO','6324480XKuXIS','38776420wonuNK','5006300twOVFH','8KFssAc'];a34_0x526a=function(){return _0x27e70c;};return a34_0x526a();}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x3cfb(_0x109433,_0x5a2eb6){_0x109433=_0x109433-0xa2;const _0x21179f=a35_0x2117();let _0x3cfb8b=_0x21179f[_0x109433];return _0x3cfb8b;}function a35_0x2117(){const _0x5f4471=['27934320bbNQKW','functionName','List\x20Backend\x20Function\x20scripts','Script\x20type\x20filter','read','scriptType','ENDPOINT','map','list','str','77IDcqNc','length','3282009LGISIx','description','Filter\x20by\x20script\x20name','Return\x20full\x20script\x20objects','name','verbose','string','COMMON','bool','36VueACB','989964gbaHUl','7116568kNrsES','No\x20Backend\x20Function\x20scripts\x20found.','329104WuJugs','1VFtdCF','bff','1930710uyGDlE','931382CmqVrS'];a35_0x2117=function(){return _0x5f4471;};return a35_0x2117();}const a35_0x1128c2=a35_0x3cfb;(function(_0x2afaab,_0x5523bb){const _0x5bf957=a35_0x3cfb,_0x524346=_0x2afaab();while(!![]){try{const _0x5cc433=-parseInt(_0x5bf957(0xb1))/0x1*(parseInt(_0x5bf957(0xb4))/0x2)+-parseInt(_0x5bf957(0xa3))/0x3+parseInt(_0x5bf957(0xae))/0x4+-parseInt(_0x5bf957(0xb3))/0x5+parseInt(_0x5bf957(0xad))/0x6*(-parseInt(_0x5bf957(0xbf))/0x7)+parseInt(_0x5bf957(0xb0))/0x8*(parseInt(_0x5bf957(0xac))/0x9)+parseInt(_0x5bf957(0xb5))/0xa;if(_0x5cc433===_0x5523bb)break;else _0x524346['push'](_0x524346['shift']());}catch(_0x33c899){_0x524346['push'](_0x524346['shift']());}}}(a35_0x2117,0xee5e4));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x1128c2(0xb2),'command':a35_0x1128c2(0xbd),'description':a35_0x1128c2(0xb7),'risk':a35_0x1128c2(0xb9),'flags':[{'name':'type','type':a35_0x1128c2(0xa9),'description':a35_0x1128c2(0xb8),'default':'ENDPOINT','enum':[a35_0x1128c2(0xbb),a35_0x1128c2(0xaa)]},{'name':a35_0x1128c2(0xa7),'type':a35_0x1128c2(0xa9),'description':a35_0x1128c2(0xa5)},{'name':a35_0x1128c2(0xa8),'type':'boolean','description':a35_0x1128c2(0xa6)}],async 'execute'(_0x3feddb){const _0x12a2e8=a35_0x1128c2,_0x15bde9=await listBffScripts(_0x3feddb['appCode'],_0x3feddb[_0x12a2e8(0xbe)]('type'),{'scriptName':_0x3feddb[_0x12a2e8(0xbe)](_0x12a2e8(0xa7))||undefined}),_0x12b383=_0x3feddb[_0x12a2e8(0xab)]('verbose');return{'ok':!![],'data':_0x12b383?_0x15bde9:_0x15bde9[_0x12a2e8(0xbc)](_0x1f76ce=>({'id':_0x1f76ce['id'],'functionName':_0x1f76ce[_0x12a2e8(0xb6)]??'','description':_0x1f76ce[_0x12a2e8(0xa4)]||'(unnamed)','scriptType':_0x1f76ce[_0x12a2e8(0xba)]})),'message':_0x15bde9[_0x12a2e8(0xa2)]===0x0?_0x12a2e8(0xaf):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x66011c=a36_0x4b87;(function(_0x3cad51,_0x11f27f){const _0x29c901=a36_0x4b87,_0x39b637=_0x3cad51();while(!![]){try{const _0x517f0a=parseInt(_0x29c901(0x136))/0x1+parseInt(_0x29c901(0x143))/0x2+-parseInt(_0x29c901(0x122))/0x3*(-parseInt(_0x29c901(0x10b))/0x4)+-parseInt(_0x29c901(0x12b))/0x5+parseInt(_0x29c901(0x132))/0x6*(-parseInt(_0x29c901(0x115))/0x7)+-parseInt(_0x29c901(0x109))/0x8*(-parseInt(_0x29c901(0x10c))/0x9)+parseInt(_0x29c901(0x13d))/0xa*(-parseInt(_0x29c901(0x13c))/0xb);if(_0x517f0a===_0x11f27f)break;else _0x39b637['push'](_0x39b637['shift']());}catch(_0x2ceb91){_0x39b637['push'](_0x39b637['shift']());}}}(a36_0x11ec,0x79ece));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x66011c(0x12e),'command':a36_0x66011c(0x120),'description':a36_0x66011c(0x137),'risk':a36_0x66011c(0x12a),'flags':[{'name':a36_0x66011c(0x100),'type':a36_0x66011c(0x121),'description':a36_0x66011c(0x142),'enum':[a36_0x66011c(0x114),a36_0x66011c(0x140),a36_0x66011c(0x125)]},{'name':'force','type':a36_0x66011c(0x145),'description':a36_0x66011c(0x102)}],async 'dryRun'(_0x4f3c6e){const _0x43d814=a36_0x66011c,_0x5c7ab3=loadBffProjectConfig(_0x4f3c6e[_0x43d814(0x123)]),_0x5400e9=await readBffLockFile(_0x5c7ab3[_0x43d814(0x12d)]),{appLock:_0x228dbf}=ensureLockScope(_0x5400e9??createEmptyBffLock(),_0x4f3c6e[_0x43d814(0x123)],_0x5c7ab3[_0x43d814(0x101)],'pull'),_0x1d0454=normalizeBffType(_0x4f3c6e['str'](_0x43d814(0x100)))??undefined,_0x59b21a=buildDatasetCodeToAliasMap(_0x4f3c6e[_0x43d814(0x147)],_0x4f3c6e['appCode']),[_0x59e2dd,_0x10be7b]=await Promise[_0x43d814(0x139)]([listBffScripts(_0x4f3c6e['appCode'],_0x1d0454),getBffScriptStatistics(_0x4f3c6e['appCode'])]),_0x138c5c=createHookLocationMap(_0x10be7b),_0xc4f82=[];for(const _0x13d595 of _0x59e2dd){const _0x718131=resolveRemoteScriptTarget(_0x5c7ab3,_0x13d595,_0x138c5c,_0x228dbf[_0x43d814(0x116)],_0x59b21a);if(!_0x718131){_0xc4f82['push']({'scriptType':_0x13d595[_0x43d814(0x12c)],'functionName':_0x13d595['functionName']??'','status':_0x43d814(0x11d),'reason':_0x43d814(0x106)});continue;}const _0x3d3ebc=_0x228dbf[_0x43d814(0x116)][_0x718131[_0x43d814(0x11a)]],_0xdbfa9b=_0x13d595['scriptContent']!=null?computeContentHash(_0x13d595[_0x43d814(0x134)]):undefined,_0x517fc5=await hasUnsyncedLocalChanges(_0x718131['filePath'],_0x3d3ebc,_0xdbfa9b);_0xc4f82[_0x43d814(0x11b)]({'lockKey':_0x718131[_0x43d814(0x11a)],'filePath':_0x718131[_0x43d814(0x10f)],'remoteId':_0x13d595['id']??null,'status':_0x517fc5?_0x43d814(0x13b):_0x43d814(0x117)});}return{'method':'GET','url':_0x43d814(0x146)+_0x4f3c6e[_0x43d814(0x123)]+(_0x1d0454?_0x43d814(0x138)+_0x1d0454:''),'body':{'appCode':_0x4f3c6e[_0x43d814(0x123)],'filterType':_0x1d0454??null,'files':_0xc4f82},'description':'Would\x20inspect\x20'+_0xc4f82['length']+_0x43d814(0x12f)};},async 'execute'(_0x4e6d78){const _0xb0bd3=a36_0x66011c,_0x4aec90=loadBffProjectConfig(_0x4e6d78[_0xb0bd3(0x123)]),_0x1d0fbc=await readBffLockFile(_0x4aec90['lockFilePath']),{lockData:_0xe3a921,appLock:_0x57fbbb}=ensureLockScope(_0x1d0fbc??createEmptyBffLock(),_0x4e6d78[_0xb0bd3(0x123)],_0x4aec90[_0xb0bd3(0x101)],'pull'),_0xeb6a9f=normalizeBffType(_0x4e6d78[_0xb0bd3(0x13f)]('type'))??undefined;if(_0x4e6d78[_0xb0bd3(0x13f)](_0xb0bd3(0x100))&&!_0xeb6a9f)throw CliErrors[_0xb0bd3(0x129)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x2fa455,_0x16972f]=await Promise[_0xb0bd3(0x139)]([listBffScripts(_0x4e6d78['appCode'],_0xeb6a9f),getBffScriptStatistics(_0x4e6d78[_0xb0bd3(0x123)])]);if(_0x2fa455[_0xb0bd3(0x103)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xb0bd3(0x111)};const _0x358642=_0x4e6d78['bool'](_0xb0bd3(0x10a));if(_0x358642&&!_0x4e6d78[_0xb0bd3(0x119)]){const _0x4121e1=await confirmForce();if(!_0x4121e1)throw CliErrors[_0xb0bd3(0x131)]('Force\x20pull\x20cancelled.');}if(_0x358642&&_0x4e6d78[_0xb0bd3(0x119)]){}const _0x551011=buildDatasetCodeToAliasMap(_0x4e6d78[_0xb0bd3(0x147)],_0x4e6d78[_0xb0bd3(0x123)]),_0x3a9409=createHookLocationMap(_0x16972f),_0x327965=JSON[_0xb0bd3(0x144)](JSON['stringify'](_0xe3a921)),_0x6b8866=_0x4e6d78[_0xb0bd3(0x123)],_0x5217c6=_0x327965[_0xb0bd3(0x107)][_0x6b8866];if(!_0x5217c6)throw new Error(_0xb0bd3(0x118)+_0x6b8866+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x46b584=[],_0x3b5a90=[],_0x378903=[];for(const _0x2ca2cc of _0x2fa455){const _0x4c80ca=resolveRemoteScriptTarget(_0x4aec90,_0x2ca2cc,_0x3a9409,_0x57fbbb[_0xb0bd3(0x116)],_0x551011);if(!_0x4c80ca){_0x3b5a90[_0xb0bd3(0x11b)]({'lockKey':_0x2ca2cc[_0xb0bd3(0x12c)]+'/'+_0x2ca2cc[_0xb0bd3(0x11c)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x4a422b=_0x57fbbb['functions'][_0x4c80ca[_0xb0bd3(0x11a)]];try{if(!_0x2ca2cc['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x2ca2cc[_0xb0bd3(0x134)]==null)throw new Error(_0xb0bd3(0x133));const _0x385bde=_0x2ca2cc[_0xb0bd3(0x134)],_0x3c429d=computeContentHash(_0x385bde);if(!_0x358642){const _0xf8ec17=await hasUnsyncedLocalChanges(_0x4c80ca[_0xb0bd3(0x10f)],_0x4a422b,_0x3c429d);if(_0xf8ec17){_0x3b5a90[_0xb0bd3(0x11b)]({'lockKey':_0x4c80ca[_0xb0bd3(0x11a)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x4c80ca[_0xb0bd3(0x10f)]),await writeFile(_0x4c80ca[_0xb0bd3(0x10f)],_0x385bde,_0xb0bd3(0x112));const _0x3c6661={'hash':_0x3c429d,'remoteId':_0x2ca2cc['id'],'version':_0x2ca2cc[_0xb0bd3(0x108)]};_0x4c80ca[_0xb0bd3(0x100)]==='HOOK'&&_0x4c80ca[_0xb0bd3(0x124)]&&(_0x3c6661[_0xb0bd3(0x13a)]=_0x4c80ca[_0xb0bd3(0x124)][_0xb0bd3(0x13a)],_0x3c6661[_0xb0bd3(0x113)]=_0x4c80ca[_0xb0bd3(0x124)]['datasetCode'],_0x3c6661[_0xb0bd3(0x13e)]=_0x4c80ca[_0xb0bd3(0x124)][_0xb0bd3(0x13e)],_0x3c6661[_0xb0bd3(0x104)]=_0x4c80ca['hookLocation']['functionNode']),_0x5217c6[_0xb0bd3(0x116)][_0x4c80ca['lockKey']]=_0x3c6661,_0x46b584['push']({'lockKey':_0x4c80ca[_0xb0bd3(0x11a)],'remoteId':_0x2ca2cc['id']});}catch(_0x463dd5){_0x378903[_0xb0bd3(0x11b)]({'lockKey':_0x4c80ca['lockKey'],'error':_0x463dd5 instanceof Error?_0x463dd5['message']:String(_0x463dd5)});}}return _0x5217c6[_0xb0bd3(0x10d)]=new Date()['toISOString'](),await writeBffLockFile(_0x4aec90[_0xb0bd3(0x12d)],_0x327965),{'ok':_0x378903[_0xb0bd3(0x103)]===0x0,'data':{'pulled':_0x46b584,'skipped':_0x3b5a90,'failed':_0x378903},'message':_0xb0bd3(0x128)+_0x46b584[_0xb0bd3(0x103)]+'\x20pulled,\x20'+_0x3b5a90[_0xb0bd3(0x103)]+_0xb0bd3(0x11e)+_0x378903[_0xb0bd3(0x103)]+_0xb0bd3(0x105)};}};function a36_0x11ec(){const _0x4eeac5=['functionName','skipped','\x20skipped,\x20','yes','pull','string','332463bXiQKn','appCode','hookLocation','HOOK','includes','stdin','Pull\x20complete:\x20','validation','read','4201715uGKZVh','scriptType','lockFilePath','bff','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','trim','cancelled','12156kPBMHH','Remote\x20script\x20missing\x20content.','scriptContent','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','698226KweQkw','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','&type=','all','alias','conflict','132HAZCpU','63380jDoBRT','operationType','str','ENDPOINT','map','Pull\x20only\x20this\x20script\x20type','140114SNgdpV','parse','boolean','/api/management/library/scripts/list?appCode=','apiDir','type','scriptsRoot','Force\x20overwrite\x20local\x20unsynced\x20changes','length','functionNode','\x20failed','unresolvable\x20target\x20path','apps','version','56YuKpxY','force','36nizOZU','24255RvDnMQ','lastSync','toLowerCase','filePath','question','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','utf8','datasetCode','COMMON','1274OMtbLD','functions','would_pull','Lock\x20scope\x20for\x20app\x20\x22','nonInteractive','lockKey','push'];a36_0x11ec=function(){return _0x4eeac5;};return a36_0x11ec();}async function hasUnsyncedLocalChanges(_0xfd2ad0,_0x174b1b,_0x3d9e53){if(!await fileExists(_0xfd2ad0))return![];const _0x387192=await computeFileHash(_0xfd2ad0);if(!_0x174b1b)return _0x3d9e53?_0x387192!==_0x3d9e53:!![];return _0x387192!==_0x174b1b['hash'];}function a36_0x4b87(_0x2f328c,_0x44e3dd){_0x2f328c=_0x2f328c-0x100;const _0x11ec34=a36_0x11ec();let _0x4b87a1=_0x11ec34[_0x2f328c];return _0x4b87a1;}function buildDatasetCodeToAliasMap(_0x3f4f7e,_0x5b18f9){const _0x34d8fd=a36_0x66011c,_0x57e50b=loadAliasMap(_0x3f4f7e,undefined,resolveApiFilePath(_0x3f4f7e,_0x5b18f9));return new Map(_0x57e50b[_0x34d8fd(0x141)](_0x7b2e0c=>[_0x7b2e0c[_0x34d8fd(0x113)],_0x7b2e0c[_0x34d8fd(0x13a)]]));}async function confirmForce(){const _0x372d82=a36_0x66011c,_0x5978f6=createInterface({'input':process[_0x372d82(0x127)],'output':process['stderr']}),_0x10d3e7=await new Promise(_0x5f2627=>{const _0x4ba192=_0x372d82;_0x5978f6[_0x4ba192(0x110)](_0x4ba192(0x135),_0x5f2627);});return _0x5978f6['close'](),['y',_0x372d82(0x11f)][_0x372d82(0x126)](_0x10d3e7[_0x372d82(0x130)]()[_0x372d82(0x10e)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a37_0x16c3(){const _0x5e05f4=['operationType','cleared','version','bff','apps','3QERyIK','datasetCodeToDataset','3472hxsDiQ','functions','filePath','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','remoteId','scriptsRoot','push','utf8','validation','hash','Incomplete\x20HOOK\x20path:\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','623466pJZxrh','2255512ZWOxrq','bool','datasetCode','alias','/api/management/library/scripts/save','toISOString','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','810780FGYGlj','name','description','1648cJkxgK','type','force','would_push','lastSync','functionNode','configured','status','Run\x20`','\x22.\x20','apiDir','map','attempted','runtime\x20cache\x20clear\x20failed','aliasToDatasetCode','unchanged','string','appCode','3714222nSECPx','\x20failed,\x20','runtime\x20cache\x20not\x20needed','join','str','HOOK','lockFilePath','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','code',',\x20deployment\x20sync\x20','stringify','240395dnVJSb','has','Cannot\x20resolve\x20dataset\x20for\x20\x22','7876728xpMsQA','Local\x20function\x20not\x20found:\x20','COMMON','Runtime\x20script\x20cache\x20cleared.','filter','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','POST','create','get','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','some','\x20uploaded,\x20','message','Lock\x20scope\x20for\x20app\x20\x22','Push\x20only\x20this\x20script\x20type','lockKey','Force\x20push\x20ignoring\x20hash\x20protection'];a37_0x16c3=function(){return _0x5e05f4;};return a37_0x16c3();}const a37_0x42ede9=a37_0x40d1;(function(_0x30d441,_0x3a69c7){const _0x385196=a37_0x40d1,_0x457621=_0x30d441();while(!![]){try{const _0x44cd93=-parseInt(_0x385196(0xca))/0x1+-parseInt(_0x385196(0xcb))/0x2*(-parseInt(_0x385196(0xbc))/0x3)+parseInt(_0x385196(0xd2))/0x4+parseInt(_0x385196(0xf3))/0x5+parseInt(_0x385196(0xe7))/0x6+-parseInt(_0x385196(0xbe))/0x7*(-parseInt(_0x385196(0xd5))/0x8)+-parseInt(_0x385196(0xf6))/0x9;if(_0x44cd93===_0x3a69c7)break;else _0x457621['push'](_0x457621['shift']());}catch(_0x50ba4c){_0x457621['push'](_0x457621['shift']());}}}(a37_0x16c3,0x92bfd));import{readFile}from'node:fs/promises';function a37_0x40d1(_0x5cf75a,_0x4adb56){_0x5cf75a=_0x5cf75a-0xb6;const _0x16c388=a37_0x16c3();let _0x40d18c=_0x16c388[_0x5cf75a];return _0x40d18c;}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':a37_0x42ede9(0xba),'command':a37_0x42ede9(0xc4),'description':a37_0x42ede9(0xfb),'risk':'write','flags':[{'name':a37_0x42ede9(0xd6),'type':a37_0x42ede9(0xe5),'description':a37_0x42ede9(0x104),'enum':[a37_0x42ede9(0xf8),'ENDPOINT','HOOK']},{'name':a37_0x42ede9(0xd3),'type':a37_0x42ede9(0xe5),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x42ede9(0xd7),'type':'boolean','description':a37_0x42ede9(0xb6)}],async 'validate'(_0x1558a3){validateAutomaticDeploymentSync(_0x1558a3);},async 'dryRun'(_0x2ff5fc){const _0x373901=a37_0x42ede9,_0x45d215=loadBffProjectConfig(_0x2ff5fc['appCode']),_0x253e7a=await readBffLockFile(_0x45d215[_0x373901(0xed)]),{appLock:_0x5ef257}=ensureLockScope(_0x253e7a??createEmptyBffLock(),_0x2ff5fc[_0x373901(0xe6)],_0x45d215['scriptsRoot'],_0x373901(0xc4)),_0x13c7c9=await getTargetFunctions(_0x45d215,_0x2ff5fc),_0x59dd5e=_0x2ff5fc[_0x373901(0xcc)](_0x373901(0xd7)),_0x31c837=[],_0x13ac11=[];for(const _0x423703 of _0x13c7c9){const _0x481ae2=await computeFileHash(_0x423703[_0x373901(0xc0)]),_0x26bbff=_0x5ef257[_0x373901(0xbf)][_0x423703[_0x373901(0x105)]],_0x30a2df=!!_0x26bbff&&_0x26bbff[_0x373901(0xc7)]===_0x481ae2,_0x37fae1=!_0x59dd5e&&_0x30a2df?_0x373901(0xe4):_0x373901(0xd8);_0x31c837[_0x373901(0xc4)]({'lockKey':_0x423703[_0x373901(0x105)],'filePath':_0x423703[_0x373901(0xc0)],'remoteId':_0x26bbff?.[_0x373901(0xc2)]??null,'mode':_0x26bbff?.['remoteId']?'update':_0x373901(0xfd),'status':_0x37fae1});if(_0x37fae1===_0x373901(0xd8))_0x13ac11['push'](_0x423703[_0x373901(0xd3)]);}return{'method':_0x373901(0xfc),'url':_0x373901(0xcf),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x2ff5fc,_0x373901(0xba),_0x13ac11),'body':{'appCode':_0x2ff5fc[_0x373901(0xe6)],'force':_0x59dd5e,'files':_0x31c837,'cacheClearAtRuntime':_0x31c837[_0x373901(0x100)](_0x592fc7=>_0x592fc7[_0x373901(0xdc)]==='would_push'),'cacheClearAtRuntimeTimes':_0x31c837[_0x373901(0x100)](_0x5a2f9e=>_0x5a2f9e['status']===_0x373901(0xd8))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x31c837[_0x373901(0xee)]+_0x373901(0xd1)};},async 'execute'(_0x2e2ee6){const _0x470d4a=a37_0x42ede9,_0x4217ce=loadBffProjectConfig(_0x2e2ee6['appCode']),_0x2c47aa=await readBffLockFile(_0x4217ce['lockFilePath']),{lockData:_0x13612e,appLock:_0x50e8a5}=ensureLockScope(_0x2c47aa??createEmptyBffLock(),_0x2e2ee6[_0x470d4a(0xe6)],_0x4217ce[_0x470d4a(0xc3)],_0x470d4a(0xc4)),_0x491da4=await getTargetFunctions(_0x4217ce,_0x2e2ee6);if(_0x491da4[_0x470d4a(0xee)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x470d4a(0xef)};const _0x12d737=_0x2e2ee6[_0x470d4a(0xcc)]('force'),_0x39a3fd=JSON['parse'](JSON[_0x470d4a(0xf2)](_0x13612e)),_0x360516=_0x39a3fd[_0x470d4a(0xbb)][_0x2e2ee6['appCode']];if(!_0x360516)throw new Error(_0x470d4a(0x103)+_0x2e2ee6[_0x470d4a(0xe6)]+_0x470d4a(0xc9));const _0xdd4a05=await buildHookMaps(_0x2e2ee6[_0x470d4a(0xe6)],_0x2e2ee6[_0x470d4a(0xdf)],_0x491da4,_0x360516),_0x7a9cb6=[],_0x20852d=[],_0xf86bd2=[],_0xbbcdde=[];for(const _0x4bf6f6 of _0x491da4){const _0x594904=await computeFileHash(_0x4bf6f6['filePath']),_0x4e7386=_0x360516[_0x470d4a(0xbf)][_0x4bf6f6[_0x470d4a(0x105)]];if(!_0x12d737&&_0x4e7386&&_0x4e7386[_0x470d4a(0xc7)]===_0x594904){_0xf86bd2[_0x470d4a(0xc4)]({'lockKey':_0x4bf6f6[_0x470d4a(0x105)],'reason':_0x470d4a(0xe4)});continue;}try{await uploadSingleFunction(_0x2e2ee6[_0x470d4a(0xe6)],_0x4bf6f6,_0x360516,_0xdd4a05);const _0x494d69=_0x360516[_0x470d4a(0xbf)][_0x4bf6f6['lockKey']];_0x7a9cb6[_0x470d4a(0xc4)]({'lockKey':_0x4bf6f6[_0x470d4a(0x105)],'remoteId':_0x494d69?.[_0x470d4a(0xc2)]??0x0}),_0x20852d[_0x470d4a(0xc4)](_0x4bf6f6[_0x470d4a(0xd3)]);}catch(_0x4f1d5f){_0xbbcdde[_0x470d4a(0xc4)]({'lockKey':_0x4bf6f6[_0x470d4a(0x105)],'error':_0x4f1d5f instanceof Error?_0x4f1d5f[_0x470d4a(0x102)]:String(_0x4f1d5f)});}}_0x360516[_0x470d4a(0xd9)]=new Date()[_0x470d4a(0xd0)](),await writeBffLockFile(_0x4217ce[_0x470d4a(0xed)],_0x39a3fd),await waitForUploadedLockEntries(_0x4217ce[_0x470d4a(0xed)],_0x2e2ee6[_0x470d4a(0xe6)],_0x7a9cb6[_0x470d4a(0xe0)](_0x413b2b=>_0x413b2b[_0x470d4a(0x105)]));let _0x4b31f9={'attempted':![],'cleared':![]};if(_0x7a9cb6['length']>0x0)try{let _0x1edfc4='';for(let _0x84f2cd=0x0;_0x84f2cd<CACHE_CLEAR_ATTEMPTS;_0x84f2cd+=0x1){_0x1edfc4=await clearBffScriptCache(),_0x84f2cd<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x4b31f9={'attempted':!![],'cleared':!![],'message':_0x1edfc4||_0x470d4a(0xf9)};}catch(_0x4c6d2b){_0x4b31f9={'attempted':!![],'cleared':![],'error':_0x4c6d2b instanceof Error?_0x4c6d2b[_0x470d4a(0x102)]:String(_0x4c6d2b)};}const _0x18c6d0=_0xbbcdde[_0x470d4a(0xee)]===0x0&&(_0x4b31f9['attempted']?_0x4b31f9[_0x470d4a(0xb8)]:!![]),_0x28f278=await runAutomaticDeploymentSync(_0x2e2ee6,_0x470d4a(0xba),_0x20852d,_0x18c6d0),_0x50d3f4=_0x18c6d0&&automaticDeploymentSyncSucceeded(_0x28f278),_0x2fa646=_0x4b31f9[_0x470d4a(0xe1)]?_0x4b31f9[_0x470d4a(0xb8)]?'runtime\x20cache\x20cleared':_0x470d4a(0xe2):_0x470d4a(0xe9),_0x27e4d4=_0x28f278[_0x470d4a(0xdb)]?_0x470d4a(0xf1)+_0x28f278[_0x470d4a(0xdc)]:'';return{'ok':_0x50d3f4,'data':{'uploaded':_0x7a9cb6,'skipped':_0xf86bd2,'failed':_0xbbcdde,'cacheClear':_0x4b31f9,'deploymentSync':_0x28f278},'message':'Push\x20complete:\x20'+_0x7a9cb6[_0x470d4a(0xee)]+_0x470d4a(0x101)+_0xf86bd2[_0x470d4a(0xee)]+'\x20skipped,\x20'+_0xbbcdde[_0x470d4a(0xee)]+_0x470d4a(0xe8)+_0x2fa646+_0x27e4d4};}};async function getTargetFunctions(_0x52192f,_0xf06974){const _0x566a21=a37_0x42ede9,_0x171814=_0xf06974[_0x566a21(0xeb)](_0x566a21(0xd6)),_0x14d555=_0xf06974['str']('name'),_0x2c4a2b=normalizeBffType(_0x171814)??undefined;if(_0x14d555&&!_0x2c4a2b)throw CliErrors[_0x566a21(0xc6)](_0x566a21(0xff));const _0x3551aa=await scanLocalBffFunctions(_0x52192f,_0x2c4a2b);if(_0x14d555){const _0x53ce62=_0x3551aa[_0x566a21(0xfa)](_0x2ce883=>_0x2ce883[_0x566a21(0xd3)]===_0x14d555);if(_0x53ce62[_0x566a21(0xee)]===0x0)throw CliErrors[_0x566a21(0xc6)](_0x566a21(0xf7)+_0x2c4a2b+'/'+_0x14d555);return _0x53ce62;}return _0x3551aa;}async function buildHookMaps(_0x2de2c4,_0x3a7178,_0x3d3f25,_0x508245){const _0x1360b1=a37_0x42ede9,_0x145242=_0x3d3f25[_0x1360b1(0x100)](_0x14a85f=>_0x14a85f['type']===_0x1360b1(0xec));if(!_0x145242)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x48fd0c=loadAliasMap(_0x3a7178,undefined,resolveApiFilePath(_0x3a7178,_0x2de2c4)),_0x5d2e08=new Map(_0x48fd0c['map'](_0x4286d8=>[_0x4286d8[_0x1360b1(0xce)],_0x4286d8[_0x1360b1(0xcd)]]));for(const _0x394f62 of Object['values'](_0x508245[_0x1360b1(0xbf)])){_0x394f62[_0x1360b1(0xce)]&&_0x394f62[_0x1360b1(0xcd)]&&!_0x5d2e08[_0x1360b1(0xf4)](_0x394f62[_0x1360b1(0xce)])&&_0x5d2e08['set'](_0x394f62['alias'],_0x394f62[_0x1360b1(0xcd)]);}const _0x2fa51c=await listDatasets(_0x2de2c4),_0x578044=new Map(_0x2fa51c[_0x1360b1(0xe0)](_0x41fbeb=>[_0x41fbeb[_0x1360b1(0xf0)],_0x41fbeb]));return{'aliasToDatasetCode':_0x5d2e08,'datasetCodeToDataset':_0x578044};}async function uploadSingleFunction(_0x56200f,_0x4178d1,_0x17a91d,_0x22868a){const _0x12b647=a37_0x42ede9,_0x1bd2a1=await readFile(_0x4178d1[_0x12b647(0xc0)],_0x12b647(0xc5)),_0x27d991=await computeFileHash(_0x4178d1[_0x12b647(0xc0)]),_0x142915=_0x17a91d[_0x12b647(0xbf)][_0x4178d1[_0x12b647(0x105)]];if(_0x142915?.[_0x12b647(0xc2)]&&_0x142915[_0x12b647(0xb9)]==null)throw CliErrors[_0x12b647(0xc6)](_0x4178d1[_0x12b647(0x105)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0xf47a66=extractScriptDescription(_0x1bd2a1);if(!_0xf47a66&&_0x142915?.[_0x12b647(0xc2)]){const _0x4eb672=await getBffScriptInfo(_0x142915[_0x12b647(0xc2)]);_0xf47a66=_0x4eb672['description']||undefined;}const _0x1e057b={'appCode':_0x56200f,'functionName':_0x4178d1['name'],'scriptType':_0x4178d1['type'],'scriptContent':_0x1bd2a1};if(_0x142915?.['remoteId'])_0x1e057b['id']=_0x142915[_0x12b647(0xc2)];if(_0x142915?.[_0x12b647(0xb9)]!=null)_0x1e057b[_0x12b647(0xb9)]=_0x142915[_0x12b647(0xb9)];if(_0xf47a66)_0x1e057b[_0x12b647(0xd4)]=_0xf47a66;if(_0x4178d1[_0x12b647(0xd6)]===_0x12b647(0xec)){const _0x484ec=_0x4178d1[_0x12b647(0xce)];if(!_0x484ec||!_0x4178d1[_0x12b647(0xb7)]||!_0x4178d1[_0x12b647(0xda)])throw CliErrors[_0x12b647(0xc6)](_0x12b647(0xc8)+_0x4178d1[_0x12b647(0x105)]);const _0x4cdb2d=_0x22868a[_0x12b647(0xe3)][_0x12b647(0xfe)](_0x484ec)??_0x142915?.['datasetCode']??_0x484ec,_0x47ef76=_0x22868a[_0x12b647(0xbd)][_0x12b647(0xfe)](_0x4cdb2d);if(!_0x47ef76)throw CliErrors['validation'](_0x12b647(0xf5)+_0x484ec+_0x12b647(0xde)+(_0x12b647(0xdd)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x1e057b['datasetId']=_0x47ef76['id'],_0x1e057b[_0x12b647(0xb7)]=_0x4178d1[_0x12b647(0xb7)],_0x1e057b['functionNode']=_0x4178d1[_0x12b647(0xda)];}const _0x5f4593=await saveBffScript(_0x1e057b),_0xed9fec=_0x5f4593['id'],_0x54f966=_0x5f4593['script']??await getBffScriptInfo(_0xed9fec),_0x2c5e9d={'hash':_0x27d991,'remoteId':_0xed9fec,'version':_0x54f966[_0x12b647(0xb9)]};if(_0x4178d1[_0x12b647(0xd6)]===_0x12b647(0xec)){const _0x4acc9a=_0x4178d1[_0x12b647(0xce)],_0x437d50=_0x22868a[_0x12b647(0xe3)][_0x12b647(0xfe)](_0x4acc9a)??_0x142915?.['datasetCode']??_0x4acc9a;_0x22868a[_0x12b647(0xe3)]['has'](_0x4acc9a)?_0x2c5e9d[_0x12b647(0xce)]=_0x4acc9a:_0x2c5e9d[_0x12b647(0xce)]=_0x142915?.[_0x12b647(0xce)],_0x2c5e9d['datasetCode']=_0x437d50,_0x2c5e9d[_0x12b647(0xb7)]=_0x4178d1[_0x12b647(0xb7)],_0x2c5e9d['functionNode']=_0x4178d1['functionNode'];}_0x17a91d[_0x12b647(0xbf)][_0x4178d1['lockKey']]=_0x2c5e9d;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1daa9f,_0x19ac0c,_0x2136c0){const _0x17f8ad=a37_0x42ede9;if(_0x2136c0[_0x17f8ad(0xee)]===0x0)return;for(let _0x8b69ec=0x0;_0x8b69ec<LOCK_SETTLE_RETRY_COUNT;_0x8b69ec+=0x1){const _0x3a5e32=await readBffLockFile(_0x1daa9f),_0x203c38=_0x3a5e32?.[_0x17f8ad(0xbb)]?.[_0x19ac0c]?.['functions']??{},_0x1dd49c=_0x2136c0['every'](_0xded421=>!!_0x203c38[_0xded421]?.[_0x17f8ad(0xc2)]);if(_0x1dd49c)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x17f8ad(0xc1)+_0x2136c0[_0x17f8ad(0xea)](',\x20')+'.');}
|
|
1
|
+
const a37_0x1031ca=a37_0x521e;(function(_0x2e57e9,_0x24f606){const _0x56aee3=a37_0x521e,_0x2075bc=_0x2e57e9();while(!![]){try{const _0x1fbea8=parseInt(_0x56aee3(0x8f))/0x1+-parseInt(_0x56aee3(0x86))/0x2*(parseInt(_0x56aee3(0xab))/0x3)+parseInt(_0x56aee3(0xb6))/0x4*(-parseInt(_0x56aee3(0xcb))/0x5)+parseInt(_0x56aee3(0x93))/0x6+-parseInt(_0x56aee3(0x9c))/0x7*(parseInt(_0x56aee3(0x96))/0x8)+-parseInt(_0x56aee3(0xb9))/0x9*(parseInt(_0x56aee3(0xda))/0xa)+-parseInt(_0x56aee3(0xbd))/0xb*(-parseInt(_0x56aee3(0xc0))/0xc);if(_0x1fbea8===_0x24f606)break;else _0x2075bc['push'](_0x2075bc['shift']());}catch(_0x35449d){_0x2075bc['push'](_0x2075bc['shift']());}}}(a37_0x1100,0x69476));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x521e(_0x7c0901,_0x4b7c4d){_0x7c0901=_0x7c0901-0x86;const _0x110062=a37_0x1100();let _0x521ef0=_0x110062[_0x7c0901];return _0x521ef0;}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':a37_0x1031ca(0xc7),'command':a37_0x1031ca(0xaa),'description':a37_0x1031ca(0xba),'risk':a37_0x1031ca(0xaf),'flags':[{'name':a37_0x1031ca(0xa1),'type':a37_0x1031ca(0xd8),'description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON',a37_0x1031ca(0xb7),a37_0x1031ca(0x9d)]},{'name':a37_0x1031ca(0xcd),'type':'string','description':a37_0x1031ca(0xd4)},{'name':'force','type':'boolean','description':a37_0x1031ca(0xa5)}],async 'validate'(_0x3ba62a){validateAutomaticDeploymentSync(_0x3ba62a);},async 'dryRun'(_0x17c5ff){const _0x117b28=a37_0x1031ca,_0x40fbaf=loadBffProjectConfig(_0x17c5ff[_0x117b28(0xbc)]),_0x48e327=await readBffLockFile(_0x40fbaf['lockFilePath']),{appLock:_0x49aa43}=ensureLockScope(_0x48e327??createEmptyBffLock(),_0x17c5ff['appCode'],_0x40fbaf[_0x117b28(0x8c)],_0x117b28(0xaa)),_0x5e6bc9=await getTargetFunctions(_0x40fbaf,_0x17c5ff),_0x23ef5b=_0x17c5ff[_0x117b28(0xc6)]('force'),_0x72023d=[],_0x5d9b25=[];for(const _0x7baa0e of _0x5e6bc9){const _0x246108=await computeFileHash(_0x7baa0e[_0x117b28(0x89)]),_0xe7bf75=_0x49aa43[_0x117b28(0xc2)][_0x7baa0e[_0x117b28(0xad)]],_0x47e407=!!_0xe7bf75&&_0xe7bf75[_0x117b28(0xbf)]===_0x246108,_0x6f7b68=!_0x23ef5b&&_0x47e407?_0x117b28(0xa8):_0x117b28(0xd3);_0x72023d[_0x117b28(0xaa)]({'lockKey':_0x7baa0e[_0x117b28(0xad)],'filePath':_0x7baa0e['filePath'],'remoteId':_0xe7bf75?.[_0x117b28(0x9a)]??null,'mode':_0xe7bf75?.[_0x117b28(0x9a)]?'update':'create','status':_0x6f7b68});if(_0x6f7b68==='would_push')_0x5d9b25[_0x117b28(0xaa)](_0x7baa0e['name']);}return{'method':_0x117b28(0x8d),'url':_0x117b28(0xb4),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x17c5ff,'bff',_0x5d9b25),'body':{'appCode':_0x17c5ff[_0x117b28(0xbc)],'force':_0x23ef5b,'files':_0x72023d,'cacheClearAtRuntime':_0x72023d[_0x117b28(0x9f)](_0x4741c0=>_0x4741c0[_0x117b28(0xc4)]===_0x117b28(0xd3)),'cacheClearAtRuntimeTimes':_0x72023d[_0x117b28(0x9f)](_0x28991c=>_0x28991c['status']==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x117b28(0x94)+_0x72023d['length']+_0x117b28(0xc9)};},async 'execute'(_0x2c82e3){const _0x2dc385=a37_0x1031ca,_0xc455c=loadBffProjectConfig(_0x2c82e3[_0x2dc385(0xbc)]),_0x119ce5=await readBffLockFile(_0xc455c[_0x2dc385(0x98)]),{lockData:_0x38c6d1,appLock:_0x2d7834}=ensureLockScope(_0x119ce5??createEmptyBffLock(),_0x2c82e3[_0x2dc385(0xbc)],_0xc455c['scriptsRoot'],_0x2dc385(0xaa)),_0x1863fa=await getTargetFunctions(_0xc455c,_0x2c82e3);if(_0x1863fa[_0x2dc385(0xc8)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20Backend\x20Function\x20scripts\x20found.'};const _0x21f5c1=_0x2c82e3[_0x2dc385(0xc6)](_0x2dc385(0xa6)),_0x37bd4a=JSON[_0x2dc385(0xd1)](JSON[_0x2dc385(0xac)](_0x38c6d1)),_0x363e4d=_0x37bd4a[_0x2dc385(0xbe)][_0x2c82e3[_0x2dc385(0xbc)]];if(!_0x363e4d)throw new Error(_0x2dc385(0x9b)+_0x2c82e3[_0x2dc385(0xbc)]+_0x2dc385(0xb0));const _0x92926d=await buildHookMaps(_0x2c82e3[_0x2dc385(0xbc)],_0x2c82e3[_0x2dc385(0xb3)],_0x1863fa,_0x363e4d),_0x340613=[],_0x4063ac=[],_0x2cb369=[],_0xe7da50=[];for(const _0x1497cb of _0x1863fa){const _0x25ec98=await computeFileHash(_0x1497cb[_0x2dc385(0x89)]),_0x4a0b7a=_0x363e4d[_0x2dc385(0xc2)][_0x1497cb[_0x2dc385(0xad)]];if(!_0x21f5c1&&_0x4a0b7a&&_0x4a0b7a[_0x2dc385(0xbf)]===_0x25ec98){_0x2cb369[_0x2dc385(0xaa)]({'lockKey':_0x1497cb['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x2c82e3[_0x2dc385(0xbc)],_0x1497cb,_0x363e4d,_0x92926d);const _0x2b9e7e=_0x363e4d['functions'][_0x1497cb[_0x2dc385(0xad)]];_0x340613[_0x2dc385(0xaa)]({'lockKey':_0x1497cb['lockKey'],'remoteId':_0x2b9e7e?.['remoteId']??0x0}),_0x4063ac[_0x2dc385(0xaa)](_0x1497cb[_0x2dc385(0xcd)]);}catch(_0x50cf5e){_0xe7da50[_0x2dc385(0xaa)]({'lockKey':_0x1497cb[_0x2dc385(0xad)],'error':_0x50cf5e instanceof Error?_0x50cf5e[_0x2dc385(0xc5)]:String(_0x50cf5e)});}}_0x363e4d[_0x2dc385(0x8a)]=new Date()['toISOString'](),await writeBffLockFile(_0xc455c[_0x2dc385(0x98)],_0x37bd4a),await waitForUploadedLockEntries(_0xc455c[_0x2dc385(0x98)],_0x2c82e3['appCode'],_0x340613[_0x2dc385(0xae)](_0x481e16=>_0x481e16[_0x2dc385(0xad)]));let _0x34948a={'attempted':![],'cleared':![]};if(_0x340613[_0x2dc385(0xc8)]>0x0)try{let _0x283947='';for(let _0x15229f=0x0;_0x15229f<CACHE_CLEAR_ATTEMPTS;_0x15229f+=0x1){_0x283947=await clearBffScriptCache(),_0x15229f<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x34948a={'attempted':!![],'cleared':!![],'message':_0x283947||_0x2dc385(0xd6)};}catch(_0x3132b8){_0x34948a={'attempted':!![],'cleared':![],'error':_0x3132b8 instanceof Error?_0x3132b8[_0x2dc385(0xc5)]:String(_0x3132b8)};}const _0x1dd8b8=_0xe7da50[_0x2dc385(0xc8)]===0x0&&(_0x34948a[_0x2dc385(0x91)]?_0x34948a[_0x2dc385(0xa3)]:!![]),_0x26a7da=await runAutomaticDeploymentSync(_0x2c82e3,_0x2dc385(0xc7),_0x4063ac,_0x1dd8b8),_0x27392a=_0x1dd8b8&&automaticDeploymentSyncSucceeded(_0x26a7da),_0x469ba4=_0x34948a['attempted']?_0x34948a[_0x2dc385(0xa3)]?_0x2dc385(0xd7):_0x2dc385(0xb8):_0x2dc385(0xb5),_0x1073e7=_0x26a7da[_0x2dc385(0x8e)]?_0x2dc385(0xd0)+_0x26a7da[_0x2dc385(0xc4)]:'';return{'ok':_0x27392a,'data':{'uploaded':_0x340613,'skipped':_0x2cb369,'failed':_0xe7da50,'cacheClear':_0x34948a,'deploymentSync':_0x26a7da},'message':_0x2dc385(0xa0)+_0x340613[_0x2dc385(0xc8)]+_0x2dc385(0xa9)+_0x2cb369[_0x2dc385(0xc8)]+'\x20skipped,\x20'+_0xe7da50['length']+'\x20failed,\x20'+_0x469ba4+_0x1073e7};}};async function getTargetFunctions(_0x1aaa89,_0x5e9c8f){const _0x2a0ebf=a37_0x1031ca,_0x3ed266=_0x5e9c8f[_0x2a0ebf(0xa7)](_0x2a0ebf(0xa1)),_0x55766b=_0x5e9c8f[_0x2a0ebf(0xa7)](_0x2a0ebf(0xcd)),_0x4b171f=normalizeBffType(_0x3ed266)??undefined;if(_0x55766b&&!_0x4b171f)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x46da24=await scanLocalBffFunctions(_0x1aaa89,_0x4b171f);if(_0x55766b){const _0x4a324c=_0x46da24[_0x2a0ebf(0x8b)](_0x3684a3=>_0x3684a3[_0x2a0ebf(0xcd)]===_0x55766b);if(_0x4a324c[_0x2a0ebf(0xc8)]===0x0)throw CliErrors[_0x2a0ebf(0x95)](_0x2a0ebf(0xcc)+_0x4b171f+'/'+_0x55766b);return _0x4a324c;}return _0x46da24;}async function buildHookMaps(_0x4fa1b1,_0x539259,_0x277a9f,_0x18f68c){const _0x42a9ad=a37_0x1031ca,_0x493779=_0x277a9f[_0x42a9ad(0x9f)](_0x2535ca=>_0x2535ca[_0x42a9ad(0xa1)]==='HOOK');if(!_0x493779)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x354f88=loadAliasMap(_0x539259,undefined,resolveApiFilePath(_0x539259,_0x4fa1b1)),_0x5902f7=new Map(_0x354f88[_0x42a9ad(0xae)](_0x33df3f=>[_0x33df3f[_0x42a9ad(0xbb)],_0x33df3f[_0x42a9ad(0xdb)]]));for(const _0x274de5 of Object[_0x42a9ad(0xca)](_0x18f68c['functions'])){_0x274de5['alias']&&_0x274de5['datasetCode']&&!_0x5902f7['has'](_0x274de5[_0x42a9ad(0xbb)])&&_0x5902f7[_0x42a9ad(0xc3)](_0x274de5[_0x42a9ad(0xbb)],_0x274de5[_0x42a9ad(0xdb)]);}const _0x51ca02=await listDatasets(_0x4fa1b1),_0x141876=new Map(_0x51ca02[_0x42a9ad(0xae)](_0x4aad7d=>[_0x4aad7d[_0x42a9ad(0xd5)],_0x4aad7d]));return{'aliasToDatasetCode':_0x5902f7,'datasetCodeToDataset':_0x141876};}async function uploadSingleFunction(_0x43f064,_0x1e11d1,_0x565d06,_0x2b6449){const _0x3dd2f5=a37_0x1031ca,_0x53a1a4=await readFile(_0x1e11d1[_0x3dd2f5(0x89)],'utf8'),_0x1590d0=await computeFileHash(_0x1e11d1['filePath']),_0x5ea07b=_0x565d06[_0x3dd2f5(0xc2)][_0x1e11d1['lockKey']];if(_0x5ea07b?.[_0x3dd2f5(0x9a)]&&_0x5ea07b[_0x3dd2f5(0x9e)]==null)throw CliErrors[_0x3dd2f5(0x95)](_0x1e11d1[_0x3dd2f5(0xad)]+_0x3dd2f5(0xce));let _0x5afd9b=extractScriptDescription(_0x53a1a4);if(!_0x5afd9b&&_0x5ea07b?.['remoteId']){const _0x30ea15=await getBffScriptInfo(_0x5ea07b[_0x3dd2f5(0x9a)]);_0x5afd9b=_0x30ea15[_0x3dd2f5(0x87)]||undefined;}const _0x2d9bba={'appCode':_0x43f064,'functionName':_0x1e11d1[_0x3dd2f5(0xcd)],'scriptType':_0x1e11d1[_0x3dd2f5(0xa1)],'scriptContent':_0x53a1a4};if(_0x5ea07b?.['remoteId'])_0x2d9bba['id']=_0x5ea07b['remoteId'];if(_0x5ea07b?.['version']!=null)_0x2d9bba[_0x3dd2f5(0x9e)]=_0x5ea07b[_0x3dd2f5(0x9e)];if(_0x5afd9b)_0x2d9bba[_0x3dd2f5(0x87)]=_0x5afd9b;if(_0x1e11d1[_0x3dd2f5(0xa1)]===_0x3dd2f5(0x9d)){const _0x552b30=_0x1e11d1[_0x3dd2f5(0xbb)];if(!_0x552b30||!_0x1e11d1[_0x3dd2f5(0xcf)]||!_0x1e11d1[_0x3dd2f5(0xb1)])throw CliErrors[_0x3dd2f5(0x95)](_0x3dd2f5(0x92)+_0x1e11d1[_0x3dd2f5(0xad)]);const _0x2e5d8e=_0x2b6449[_0x3dd2f5(0xb2)][_0x3dd2f5(0x97)](_0x552b30)??_0x5ea07b?.['datasetCode']??_0x552b30,_0x5a30ae=_0x2b6449[_0x3dd2f5(0x90)]['get'](_0x2e5d8e);if(!_0x5a30ae)throw CliErrors['validation'](_0x3dd2f5(0xd2)+_0x552b30+_0x3dd2f5(0xa4)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x2d9bba[_0x3dd2f5(0x88)]=_0x5a30ae['id'],_0x2d9bba[_0x3dd2f5(0xcf)]=_0x1e11d1[_0x3dd2f5(0xcf)],_0x2d9bba[_0x3dd2f5(0xb1)]=_0x1e11d1[_0x3dd2f5(0xb1)];}const _0x56b639=await saveBffScript(_0x2d9bba),_0x5bd03d=_0x56b639['id'],_0x2276bb=_0x56b639[_0x3dd2f5(0xdc)]??await getBffScriptInfo(_0x5bd03d),_0x28a7d1={'hash':_0x1590d0,'remoteId':_0x5bd03d,'version':_0x2276bb[_0x3dd2f5(0x9e)]};if(_0x1e11d1[_0x3dd2f5(0xa1)]===_0x3dd2f5(0x9d)){const _0x40f0a5=_0x1e11d1[_0x3dd2f5(0xbb)],_0x2d1687=_0x2b6449['aliasToDatasetCode']['get'](_0x40f0a5)??_0x5ea07b?.[_0x3dd2f5(0xdb)]??_0x40f0a5;_0x2b6449[_0x3dd2f5(0xb2)][_0x3dd2f5(0xd9)](_0x40f0a5)?_0x28a7d1[_0x3dd2f5(0xbb)]=_0x40f0a5:_0x28a7d1['alias']=_0x5ea07b?.[_0x3dd2f5(0xbb)],_0x28a7d1[_0x3dd2f5(0xdb)]=_0x2d1687,_0x28a7d1[_0x3dd2f5(0xcf)]=_0x1e11d1[_0x3dd2f5(0xcf)],_0x28a7d1[_0x3dd2f5(0xb1)]=_0x1e11d1['functionNode'];}_0x565d06[_0x3dd2f5(0xc2)][_0x1e11d1[_0x3dd2f5(0xad)]]=_0x28a7d1;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;function a37_0x1100(){const _0x4c6bde=['runtime\x20cache\x20clear\x20failed','9mQeRWa','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','alias','appCode','11CkwYwW','apps','hash','17383332NSzAok','join','functions','set','status','message','bool','bff','length','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','values','35mHfyYQ','Local\x20function\x20not\x20found:\x20','name',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','operationType',',\x20deployment\x20sync\x20','parse','Cannot\x20resolve\x20dataset\x20for\x20\x22','would_push','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','code','Runtime\x20script\x20cache\x20cleared.','runtime\x20cache\x20cleared','string','has','5374520UShzRI','datasetCode','script','2OgOYCl','description','datasetId','filePath','lastSync','filter','scriptsRoot','POST','configured','818134JwqVnu','datasetCodeToDataset','attempted','Incomplete\x20HOOK\x20path:\x20','75582hZEdfJ','Would\x20inspect\x20','validation','24onzeqR','get','lockFilePath','every','remoteId','Lock\x20scope\x20for\x20app\x20\x22','1812916ItRdkZ','HOOK','version','some','Push\x20complete:\x20','type','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','cleared','\x22.\x20','Force\x20push\x20ignoring\x20hash\x20protection','force','str','unchanged','\x20uploaded,\x20','push','1416039PRnuwc','stringify','lockKey','map','write','\x22\x20not\x20found\x20after\x20ensureLockScope.','functionNode','aliasToDatasetCode','apiDir','/api/management/library/scripts/save','runtime\x20cache\x20not\x20needed','35252qepmlr','ENDPOINT'];a37_0x1100=function(){return _0x4c6bde;};return a37_0x1100();}async function waitForUploadedLockEntries(_0x471bec,_0x34c688,_0x531318){const _0x3ad5f3=a37_0x1031ca;if(_0x531318['length']===0x0)return;for(let _0x43d020=0x0;_0x43d020<LOCK_SETTLE_RETRY_COUNT;_0x43d020+=0x1){const _0x16c47b=await readBffLockFile(_0x471bec),_0x5a0c86=_0x16c47b?.[_0x3ad5f3(0xbe)]?.[_0x34c688]?.['functions']??{},_0x5dfde0=_0x531318[_0x3ad5f3(0x99)](_0x5b2157=>!!_0x5a0c86[_0x5b2157]?.[_0x3ad5f3(0x9a)]);if(_0x5dfde0)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x3ad5f3(0xa2)+_0x531318[_0x3ad5f3(0xc1)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x4ef3d8=a38_0x58cf;(function(_0x1e39c1,_0x1c22b0){const _0x1c4987=a38_0x58cf,_0x27ca6d=_0x1e39c1();while(!![]){try{const _0x26a6d0=-parseInt(_0x1c4987(0x102))/0x1+parseInt(_0x1c4987(0x114))/0x2*(parseInt(_0x1c4987(0x10c))/0x3)+parseInt(_0x1c4987(0x11a))/0x4*(parseInt(_0x1c4987(0x101))/0x5)+-parseInt(_0x1c4987(0x10b))/0x6+-parseInt(_0x1c4987(0x10e))/0x7*(-parseInt(_0x1c4987(0xff))/0x8)+-parseInt(_0x1c4987(0x10a))/0x9+-parseInt(_0x1c4987(0x111))/0xa;if(_0x26a6d0===_0x1c22b0)break;else _0x27ca6d['push'](_0x27ca6d['shift']());}catch(_0x202fb8){_0x27ca6d['push'](_0x27ca6d['shift']());}}}(a38_0x14df,0xa4c91));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';function a38_0x14df(){const _0x764426=['7848306wSyVPh','3545208PNTQaK','6TmaGMF','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','8351329vhPCmC','alias','length','1326290pECKhB','\x20added,\x20','scriptsRoot','601478iVkcFT','boolean','map','apiDir','\x20unchanged','push','3542380MxWiuC','appCode','lockKey','bool','8qDRWar','remote','5mYAkYo','409628spCyjZ','has','bff','filePath','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','functions','status','all'];a38_0x14df=function(){return _0x764426;};return a38_0x14df();}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';function a38_0x58cf(_0x44cd07,_0x1f003e){_0x44cd07=_0x44cd07-0xfc;const _0x14df06=a38_0x14df();let _0x58cf18=_0x14df06[_0x44cd07];return _0x58cf18;}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x4ef3d8(0x104),'command':a38_0x4ef3d8(0x108),'description':a38_0x4ef3d8(0x106),'risk':'read','flags':[{'name':a38_0x4ef3d8(0x100),'type':a38_0x4ef3d8(0x115),'description':a38_0x4ef3d8(0x10d)}],async 'execute'(_0x52dbe2){const _0x1a3f97=a38_0x4ef3d8,_0x4f7345=loadBffProjectConfig(_0x52dbe2[_0x1a3f97(0xfc)]),_0x2341fa=await readBffLockFile(_0x4f7345['lockFilePath']),{appLock:_0x4003fe}=ensureLockScope(_0x2341fa??createEmptyBffLock(),_0x52dbe2[_0x1a3f97(0xfc)],_0x4f7345[_0x1a3f97(0x113)],_0x1a3f97(0x108)),_0x4686e6=await scanLocalBffFunctions(_0x4f7345),_0x41ac97=[],_0x26e1f9=[],_0x258b85=[];for(const _0x20ca58 of _0x4686e6){const _0x1fc7e7=await computeFileHash(_0x20ca58[_0x1a3f97(0x105)]),_0x34ec8d=_0x4003fe[_0x1a3f97(0x107)][_0x20ca58[_0x1a3f97(0xfd)]];if(!_0x34ec8d)_0x41ac97[_0x1a3f97(0x119)](_0x20ca58[_0x1a3f97(0xfd)]);else _0x34ec8d['hash']!==_0x1fc7e7?_0x26e1f9[_0x1a3f97(0x119)](_0x20ca58[_0x1a3f97(0xfd)]):_0x258b85[_0x1a3f97(0x119)](_0x20ca58[_0x1a3f97(0xfd)]);}const _0x450df1=[];if(_0x52dbe2[_0x1a3f97(0xfe)]('remote')){const _0x272361=loadAliasMap(_0x52dbe2[_0x1a3f97(0x117)],undefined,resolveApiFilePath(_0x52dbe2[_0x1a3f97(0x117)],_0x52dbe2[_0x1a3f97(0xfc)])),_0x5106c4=new Map(_0x272361['map'](_0xa4a778=>[_0xa4a778['datasetCode'],_0xa4a778[_0x1a3f97(0x10f)]])),[_0x206d63,_0x3be26e]=await Promise[_0x1a3f97(0x109)]([listBffScripts(_0x52dbe2[_0x1a3f97(0xfc)]),getBffScriptStatistics(_0x52dbe2[_0x1a3f97(0xfc)])]),_0x4fdc2e=createHookLocationMap(_0x3be26e),_0x2e4483=new Set(_0x4686e6[_0x1a3f97(0x116)](_0x292db9=>_0x292db9[_0x1a3f97(0xfd)]));for(const _0x496007 of _0x206d63){const _0x23f912=resolveRemoteScriptTarget(_0x4f7345,_0x496007,_0x4fdc2e,_0x4003fe[_0x1a3f97(0x107)],_0x5106c4);_0x23f912&&!_0x2e4483[_0x1a3f97(0x103)](_0x23f912[_0x1a3f97(0xfd)])&&_0x450df1[_0x1a3f97(0x119)](_0x23f912[_0x1a3f97(0xfd)]);}}const _0x502277=_0x41ac97[_0x1a3f97(0x110)]===0x0&&_0x26e1f9['length']===0x0&&_0x450df1[_0x1a3f97(0x110)]===0x0;return{'ok':!![],'data':{'added':_0x41ac97,'modified':_0x26e1f9,'unchanged':_0x258b85,'remoteOnly':_0x450df1},'message':_0x502277?'All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.':_0x41ac97['length']+_0x1a3f97(0x112)+_0x26e1f9['length']+'\x20modified,\x20'+_0x258b85[_0x1a3f97(0x110)]+_0x1a3f97(0x118)+(_0x450df1[_0x1a3f97(0x110)]>0x0?',\x20'+_0x450df1[_0x1a3f97(0x110)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x3bce39=a39_0x33a1;(function(_0x8108d8,_0x2d8e31){const _0x4fd559=a39_0x33a1,_0x12a32f=_0x8108d8();while(!![]){try{const _0xbe2e4b=parseInt(_0x4fd559(0x1a2))/0x1*(-parseInt(_0x4fd559(0x1a4))/0x2)+parseInt(_0x4fd559(0x19e))/0x3+-parseInt(_0x4fd559(0x197))/0x4*(parseInt(_0x4fd559(0x198))/0x5)+-parseInt(_0x4fd559(0x196))/0x6+parseInt(_0x4fd559(0x1aa))/0x7*(parseInt(_0x4fd559(0x1a3))/0x8)+-parseInt(_0x4fd559(0x1ad))/0x9+parseInt(_0x4fd559(0x1a1))/0xa*(parseInt(_0x4fd559(0x1a6))/0xb);if(_0xbe2e4b===_0x2d8e31)break;else _0x12a32f['push'](_0x12a32f['shift']());}catch(_0x45f1b2){_0x12a32f['push'](_0x12a32f['shift']());}}}(a39_0x4d4d,0x52bb4));function a39_0x33a1(_0x5653a6,_0xafd05e){_0x5653a6=_0x5653a6-0x196;const _0x4d4dfe=a39_0x4d4d();let _0x33a1d4=_0x4d4dfe[_0x5653a6];return _0x33a1d4;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x3bce39(0x1a9),'command':'install','description':a39_0x3bce39(0x199),'risk':a39_0x3bce39(0x19c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x103b62){const _0x47cfb6=a39_0x3bce39;logger['setLogPath'](process[_0x47cfb6(0x1a7)]()),logger[_0x47cfb6(0x1ae)](_0x47cfb6(0x1ac),_0x47cfb6(0x1a5));const _0x479ff4=installBuiltinSkill({'stdio':_0x103b62[_0x47cfb6(0x1a0)]?_0x47cfb6(0x19f):_0x47cfb6(0x1b1)});if(!_0x479ff4['ok'])throw CliErrors['apiError'](_0x47cfb6(0x1a8)+_0x479ff4[_0x47cfb6(0x1ab)]+']:\x20'+(_0x479ff4[_0x47cfb6(0x1af)]||'unknown'),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x479ff4[_0x47cfb6(0x1b2)]);return console[_0x47cfb6(0x19b)](_0x479ff4['changed']?_0x47cfb6(0x1b3)+_0x479ff4[_0x47cfb6(0x1b4)]+'\x20installed'+(_0x479ff4[_0x47cfb6(0x19a)]?_0x47cfb6(0x19d)+_0x479ff4[_0x47cfb6(0x19a)]:_0x47cfb6(0x1b0)):'CLI\x20Built-in\x20Skill\x20'+_0x479ff4[_0x47cfb6(0x1b4)]+'\x20is\x20already\x20current'+(_0x479ff4['installedPath']?_0x47cfb6(0x19d)+_0x479ff4['installedPath']:'')),{'ok':!![]};}}];function a39_0x4d4d(){const _0x14dcd4=['5MsiTbN','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','installedPath','log','read','\x20at\x20','424110JQlLpN','pipe','nonInteractive','60ppSivg','13hxVxdx','24BJdDNi','58382DpcBIN','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','1862421IydmwR','cwd','Built-in\x20Skill\x20install\x20failed\x20[','cli-skill','1572837kLQhVU','code','cli-skill-install','1702629bAKmQo','info','error','\x20via\x20skills@latest','inherit','repairCommand','CLI\x20Built-in\x20Skill\x20','skillVersion','3206166YFAIlD','1557664dBwGmU'];a39_0x4d4d=function(){return _0x14dcd4;};return a39_0x4d4d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x305ca1=a40_0x2be2;(function(_0x4a23f4,_0x35696f){const _0x1104da=a40_0x2be2,_0x42ecb8=_0x4a23f4();while(!![]){try{const _0x29ced1=parseInt(_0x1104da(0x15a))/0x1*(parseInt(_0x1104da(0x125))/0x2)+-parseInt(_0x1104da(0x157))/0x3*(-parseInt(_0x1104da(0x164))/0x4)+parseInt(_0x1104da(0x13c))/0x5*(-parseInt(_0x1104da(0x156))/0x6)+-parseInt(_0x1104da(0x12d))/0x7+parseInt(_0x1104da(0x175))/0x8*(parseInt(_0x1104da(0x11f))/0x9)+parseInt(_0x1104da(0x14c))/0xa+-parseInt(_0x1104da(0x152))/0xb;if(_0x29ced1===_0x35696f)break;else _0x42ecb8['push'](_0x42ecb8['shift']());}catch(_0x4f93b3){_0x42ecb8['push'](_0x42ecb8['shift']());}}}(a40_0x12f1,0x821a8));import a40_0xd67b75 from'chalk';import a40_0x48919d from'ora';import a40_0x955f54 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 _0x382872=a40_0x2be2;return GIT_COMMIT!==_0x382872(0x135)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x382872(0x12a)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x6bcda8=a40_0x2be2,_0x30fb9b=process[_0x6bcda8(0x158)][_0x6bcda8(0x11e)]();if(_0x30fb9b[_0x6bcda8(0x165)](_0x6bcda8(0x168)))return'bun';return _0x6bcda8(0x124);}const updateFlags=[{'name':'beta','type':a40_0x305ca1(0x128),'description':a40_0x305ca1(0x161),'default':![]},{'name':'version','type':'string','description':a40_0x305ca1(0x16b)}];function getRequestedVersion(_0x2d0abb){const _0x125535=a40_0x305ca1;return _0x2d0abb[_0x125535(0x148)](_0x125535(0x149))[_0x125535(0x13f)]();}async function validateUpdateFlags(_0x74fa78){const _0x383af8=a40_0x305ca1,_0x1029b2=_0x74fa78[_0x383af8(0x12b)](_0x383af8(0x132)),_0x598246=getRequestedVersion(_0x74fa78);if(_0x1029b2&&_0x598246)throw CliErrors[_0x383af8(0x14b)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x383af8(0x162));if(_0x598246&&!a40_0x955f54[_0x383af8(0x146)](_0x598246))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x598246,_0x383af8(0x129));}async function fetchNpmDistTags(){const _0x39a94a=a40_0x305ca1;try{const _0x5b8e48=await fetch(_0x39a94a(0x121)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x39a94a(0x16c),{'signal':AbortSignal[_0x39a94a(0x170)](0x2710)});if(!_0x5b8e48['ok'])return null;const _0x319527=await _0x5b8e48[_0x39a94a(0x173)]();if(!_0x319527||typeof _0x319527!==_0x39a94a(0x13b))return null;return Object['fromEntries'](Object[_0x39a94a(0x15f)](_0x319527)[_0x39a94a(0x16f)](([,_0x12aa62])=>typeof _0x12aa62===_0x39a94a(0x127)&&_0x12aa62['trim']()[_0x39a94a(0x13e)]>0x0)[_0x39a94a(0x151)](([_0x4a603f,_0x5f5c5c])=>[_0x4a603f,String(_0x5f5c5c)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x319c08){const _0x38ad79=await fetchNpmDistTags();return _0x38ad79?.[_0x319c08]??null;}async function fetchLatestVersion(){const _0x2ba0ff=a40_0x305ca1;return fetchNpmDistTagVersion(_0x2ba0ff(0x172));}async function resolveTargetVersion(_0x24e57e){const _0x2503e9=a40_0x305ca1,_0x74bb1f=getRequestedVersion(_0x24e57e);if(_0x74bb1f)return{'version':_0x74bb1f,'source':_0x2503e9(0x149)};if(_0x24e57e[_0x2503e9(0x12b)](_0x2503e9(0x132))){const _0x239afb=await fetchNpmDistTagVersion('beta');if(!_0x239afb)return null;return{'version':_0x239afb,'source':_0x2503e9(0x132)};}const _0x356ee9=await fetchLatestVersion();if(!_0x356ee9)return null;return{'version':_0x356ee9,'source':_0x2503e9(0x172)};}function shouldInstallTarget(_0x686f54,_0x298724){const _0x347629=a40_0x305ca1;if(_0x298724['source']===_0x347629(0x149)||_0x298724[_0x347629(0x150)]==='beta')return!a40_0x955f54['eq'](_0x686f54,_0x298724[_0x347629(0x149)]);return a40_0x955f54['lt'](_0x686f54,_0x298724[_0x347629(0x149)]);}function getInstallPlanLabel(_0x1801a1,_0x21a695){const _0x1ff9c3=a40_0x305ca1;switch(_0x21a695[_0x1ff9c3(0x150)]){case _0x1ff9c3(0x132):return _0x1ff9c3(0x120)+a40_0xd67b75[_0x1ff9c3(0x12e)](_0x1801a1)+'\x20→\x20'+a40_0xd67b75['green'](_0x21a695[_0x1ff9c3(0x149)]);case _0x1ff9c3(0x149):return _0x1ff9c3(0x145)+a40_0xd67b75[_0x1ff9c3(0x12e)](_0x1801a1)+_0x1ff9c3(0x122)+a40_0xd67b75[_0x1ff9c3(0x163)](_0x21a695[_0x1ff9c3(0x149)]);case _0x1ff9c3(0x172):default:return _0x1ff9c3(0x12c)+a40_0xd67b75[_0x1ff9c3(0x12e)](_0x1801a1)+_0x1ff9c3(0x122)+a40_0xd67b75[_0x1ff9c3(0x163)](_0x21a695[_0x1ff9c3(0x149)]);}}function repairCurrentBuiltinSkill(){const _0x356d54=a40_0x305ca1;console[_0x356d54(0x14a)](a40_0xd67b75[_0x356d54(0x140)](_0x356d54(0x14d)));const _0x324408=installBuiltinSkill();if(_0x324408['ok'])return console[_0x356d54(0x14a)](a40_0xd67b75[_0x356d54(0x140)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x324408[_0x356d54(0x15d)]+_0x356d54(0x155))),!![];return console[_0x356d54(0x171)](a40_0xd67b75['yellow']('\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x324408[_0x356d54(0x159)]+']:\x20'+(_0x324408[_0x356d54(0x13a)]||'unknown'))),console['log'](a40_0xd67b75[_0x356d54(0x140)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x356d54(0x154))),![];}function verifyUpdatedBuiltinSkill(_0x2b443a){const _0xe44cd4=a40_0x305ca1,_0x1ecf20=inspectInstalledBuiltinSkillVersion(_0x2b443a);if(_0x1ecf20['state']==='current')return console[_0xe44cd4(0x14a)](a40_0xd67b75['gray'](_0xe44cd4(0x143)+_0x2b443a+_0xe44cd4(0x155))),!![];const _0xf4fcf9=_0x1ecf20[_0xe44cd4(0x15d)]?_0xe44cd4(0x153)+_0x2b443a+_0xe44cd4(0x15c)+_0x1ecf20[_0xe44cd4(0x15d)]:_0xe44cd4(0x153)+_0x2b443a+',\x20state\x20'+_0x1ecf20[_0xe44cd4(0x174)];return console[_0xe44cd4(0x171)](a40_0xd67b75[_0xe44cd4(0x12e)]('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0xf4fcf9)),console[_0xe44cd4(0x14a)](a40_0xd67b75[_0xe44cd4(0x140)](_0xe44cd4(0x131)+_0x1ecf20[_0xe44cd4(0x130)])),![];}function a40_0x12f1(){const _0x25cc50=['boolean','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','slice','bool','Update\x20available:\x20','1094821tPdXfU','yellow','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','repairCommand','\x20\x20Run\x20manually:\x20','beta','Already\x20up\x20to\x20date\x20(v','succeed','unknown','Already\x20on\x20requested\x20version\x20(v','start','fail','red','error','object','10UrHyWF','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','length','trim','gray','Checking\x20for\x20updates...','read','\x20\x20CLI\x20Built-in\x20Skill\x20','@latest','Requested\x20version:\x20','valid','run','str','version','log','validation','10599990ldPrnU','Checking\x20CLI\x20Built-in\x20Skill...','Updating\x20via\x20','\x20install\x20-g\x20','source','map','4429403OsGIZs','expected\x20','\x20cli-skill\x20install','\x20is\x20up\x20to\x20date.','1880922VACqGY','37062JtWlAy','execPath','code','109TzFmAT','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',',\x20found\x20','skillVersion','\x20is\x20newer\x20than\x20npm\x20latest\x20v','entries','Version\x20comparison\x20failed','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','green','28ywhdQh','includes','install','Updated\x20to\x20v','bun','Current\x20version:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Install\x20a\x20specific\x20CLI\x20version','/dist-tags','Update\x20failed','info','filter','timeout','warn','latest','json','state','444728TrNuns','update','toLowerCase','81OaivYb','Beta\x20version:\x20','https://registry.npmjs.org/-/package/','\x20→\x20','Current\x20version\x20v','npm','1324nHyfBI','message','string'];a40_0x12f1=function(){return _0x25cc50;};return a40_0x12f1();}async function execute(_0x384525){const _0x49c2d7=a40_0x305ca1;await validateUpdateFlags(_0x384525);const _0x350fb2=getCurrentVersion();console[_0x49c2d7(0x14a)](_0x49c2d7(0x169)+_0x350fb2);const _0x16606d=a40_0x48919d(_0x49c2d7(0x141))[_0x49c2d7(0x137)](),_0x2a5b94=await resolveTargetVersion(_0x384525);if(!_0x2a5b94){const _0x522c2d=_0x384525['bool']('beta')?_0x49c2d7(0x13d):_0x49c2d7(0x16a);return _0x16606d['fail'](_0x522c2d),console['log'](a40_0xd67b75[_0x49c2d7(0x140)](_0x49c2d7(0x12f)+NPM_PACKAGE_NAME+_0x49c2d7(0x144))),{'ok':![],'message':_0x522c2d};}const _0x34e626=a40_0x955f54[_0x49c2d7(0x146)](VERSION),_0xf327ea=a40_0x955f54[_0x49c2d7(0x146)](_0x2a5b94[_0x49c2d7(0x149)]);if(!_0x34e626||!_0xf327ea)return _0x16606d[_0x49c2d7(0x138)](_0x49c2d7(0x160)),{'ok':![],'message':_0x49c2d7(0x160)};if(!shouldInstallTarget(_0x34e626,_0x2a5b94)){const _0x2b9ff5=_0x2a5b94['source']===_0x49c2d7(0x149)?_0x49c2d7(0x136)+_0x2a5b94['version']+')':a40_0x955f54['gt'](_0x34e626,_0xf327ea)?_0x49c2d7(0x123)+_0x350fb2+_0x49c2d7(0x15e)+_0x2a5b94[_0x49c2d7(0x149)]:_0x49c2d7(0x133)+_0x2a5b94[_0x49c2d7(0x149)]+')';return _0x16606d[_0x49c2d7(0x134)](_0x2b9ff5),{'ok':repairCurrentBuiltinSkill()};}_0x16606d[_0x49c2d7(0x16e)](getInstallPlanLabel(_0x350fb2,_0x2a5b94));const _0x5deca3=detectPackageManager(),_0x334ccd=_0x5deca3===_0x49c2d7(0x124)?resolveNpmBin(_0x49c2d7(0x124)):_0x5deca3,_0x56d8bc=a40_0x48919d(_0x49c2d7(0x14e)+_0x5deca3+'...')['start']();try{return await execa(_0x334ccd,[_0x49c2d7(0x166),'-g',NPM_PACKAGE_NAME+'@'+_0x2a5b94[_0x49c2d7(0x149)]],{'stdio':'pipe'}),_0x56d8bc[_0x49c2d7(0x134)](_0x49c2d7(0x167)+_0x2a5b94[_0x49c2d7(0x149)]),console[_0x49c2d7(0x14a)](a40_0xd67b75[_0x49c2d7(0x140)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0x2a5b94[_0x49c2d7(0x149)])};}catch(_0x35539d){return _0x56d8bc[_0x49c2d7(0x138)](_0x49c2d7(0x16d)),console[_0x49c2d7(0x13a)](a40_0xd67b75[_0x49c2d7(0x139)]('\x20\x20'+_0x35539d[_0x49c2d7(0x126)])),console[_0x49c2d7(0x14a)](a40_0xd67b75['gray']('\x20\x20Try\x20manually:\x20'+_0x5deca3+_0x49c2d7(0x14f)+NPM_PACKAGE_NAME+'@'+_0x2a5b94[_0x49c2d7(0x149)])),{'ok':![],'message':_0x35539d[_0x49c2d7(0x126)]};}}function a40_0x2be2(_0x558132,_0x105c8e){_0x558132=_0x558132-0x11e;const _0x12f1ad=a40_0x12f1();let _0x2be239=_0x12f1ad[_0x558132];return _0x2be239;}export const updateDefinition={'service':a40_0x305ca1(0x176),'command':a40_0x305ca1(0x147),'description':a40_0x305ca1(0x15b),'risk':a40_0x305ca1(0x142),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x391f1f=a40_0x535e;(function(_0x5a198f,_0x400cf1){const _0x555b63=a40_0x535e,_0x1d7c78=_0x5a198f();while(!![]){try{const _0x469b79=parseInt(_0x555b63(0x1db))/0x1+parseInt(_0x555b63(0x1e7))/0x2*(parseInt(_0x555b63(0x1eb))/0x3)+parseInt(_0x555b63(0x209))/0x4+-parseInt(_0x555b63(0x1fd))/0x5*(-parseInt(_0x555b63(0x201))/0x6)+-parseInt(_0x555b63(0x1de))/0x7+-parseInt(_0x555b63(0x1cc))/0x8+-parseInt(_0x555b63(0x1cb))/0x9;if(_0x469b79===_0x400cf1)break;else _0x1d7c78['push'](_0x1d7c78['shift']());}catch(_0x4f87e6){_0x1d7c78['push'](_0x1d7c78['shift']());}}}(a40_0x287e,0x7d46d));import a40_0x559651 from'chalk';import a40_0x500cad from'ora';import a40_0x31962f 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';function a40_0x287e(){const _0x2de79c=['Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','...','validation','3410592udOZcJ','pipe',']:\x20','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','gray','state','\x20install\x20-g\x20','Beta\x20version:\x20','length','Current\x20version:\x20','fail','Already\x20on\x20requested\x20version\x20(v','entries','execPath','toLowerCase','beta','\x20is\x20up\x20to\x20date.','info','succeed','error','boolean','version','expected\x20','13223952AGasTm','1707064IBQPEQ','\x20\x20Try\x20manually:\x20','valid','string','read','update','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','slice','warn','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','npm','map','\x20is\x20newer\x20than\x20npm\x20latest\x20v','latest','green','649352SVrMEJ','run','trim','5524050BFLaKJ','Checking\x20for\x20updates...','red','object','Update\x20failed','message','\x20\x20Run\x20manually:\x20','timeout','Already\x20up\x20to\x20date\x20(v','174dRtPnM','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','yellow','Updating\x20via\x20','32841AQzVKc','log','filter','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',',\x20state\x20','Version\x20comparison\x20failed','json','str','\x20→\x20','Current\x20version\x20v','@latest','Invalid\x20version:\x20','install','Install\x20a\x20specific\x20CLI\x20version','fromEntries','skillVersion','bool','Update\x20available:\x20','2653025WwDtRZ','\x20cli-skill\x20install','start','bun','6bsTKeu','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','unknown','source','code'];a40_0x287e=function(){return _0x2de79c;};return a40_0x287e();}import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x313de0=a40_0x535e;return GIT_COMMIT!==_0x313de0(0x203)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x313de0(0x1d3)](0x0,0xa)+')':VERSION;}function a40_0x535e(_0x4e9f8a,_0x84fa18){_0x4e9f8a=_0x4e9f8a-0x1c7;const _0x287e9b=a40_0x287e();let _0x535e85=_0x287e9b[_0x4e9f8a];return _0x535e85;}function detectPackageManager(){const _0x2a1ce4=a40_0x535e,_0x530b47=process[_0x2a1ce4(0x216)][_0x2a1ce4(0x217)]();if(_0x530b47['includes']('bun'))return _0x2a1ce4(0x200);return'npm';}const updateFlags=[{'name':a40_0x391f1f(0x218),'type':a40_0x391f1f(0x1c8),'description':a40_0x391f1f(0x206),'default':![]},{'name':a40_0x391f1f(0x1c9),'type':a40_0x391f1f(0x1cf),'description':a40_0x391f1f(0x1f8)}];function getRequestedVersion(_0x183f49){const _0x53a0e2=a40_0x391f1f;return _0x183f49[_0x53a0e2(0x1f2)]('version')[_0x53a0e2(0x1dd)]();}async function validateUpdateFlags(_0x1747e6){const _0x475de6=a40_0x391f1f,_0x4c6fc3=_0x1747e6[_0x475de6(0x1fb)](_0x475de6(0x218)),_0x77503b=getRequestedVersion(_0x1747e6);if(_0x4c6fc3&&_0x77503b)throw CliErrors[_0x475de6(0x208)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x475de6(0x1d2));if(_0x77503b&&!a40_0x31962f[_0x475de6(0x1ce)](_0x77503b))throw CliErrors['validation'](_0x475de6(0x1f6)+_0x77503b,_0x475de6(0x202));}async function fetchNpmDistTags(){const _0x27526b=a40_0x391f1f;try{const _0x2c721a=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x27526b(0x1e5)](0x2710)});if(!_0x2c721a['ok'])return null;const _0x14df39=await _0x2c721a[_0x27526b(0x1f1)]();if(!_0x14df39||typeof _0x14df39!==_0x27526b(0x1e1))return null;return Object[_0x27526b(0x1f9)](Object[_0x27526b(0x215)](_0x14df39)[_0x27526b(0x1ed)](([,_0x1168df])=>typeof _0x1168df===_0x27526b(0x1cf)&&_0x1168df['trim']()[_0x27526b(0x211)]>0x0)[_0x27526b(0x1d7)](([_0x1d8108,_0x505b41])=>[_0x1d8108,String(_0x505b41)[_0x27526b(0x1dd)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x3e6ea8){const _0x2537ca=await fetchNpmDistTags();return _0x2537ca?.[_0x3e6ea8]??null;}async function fetchLatestVersion(){const _0x52aacc=a40_0x391f1f;return fetchNpmDistTagVersion(_0x52aacc(0x1d9));}async function resolveTargetVersion(_0x29d3ff){const _0x3c53f4=a40_0x391f1f,_0x556c09=getRequestedVersion(_0x29d3ff);if(_0x556c09)return{'version':_0x556c09,'source':'version'};if(_0x29d3ff[_0x3c53f4(0x1fb)]('beta')){const _0x5c84b8=await fetchNpmDistTagVersion('beta');if(!_0x5c84b8)return null;return{'version':_0x5c84b8,'source':_0x3c53f4(0x218)};}const _0x5bd754=await fetchLatestVersion();if(!_0x5bd754)return null;return{'version':_0x5bd754,'source':_0x3c53f4(0x1d9)};}function shouldInstallTarget(_0x417c6e,_0x3eb5dc){const _0x1caef9=a40_0x391f1f;if(_0x3eb5dc[_0x1caef9(0x204)]===_0x1caef9(0x1c9)||_0x3eb5dc[_0x1caef9(0x204)]===_0x1caef9(0x218))return!a40_0x31962f['eq'](_0x417c6e,_0x3eb5dc[_0x1caef9(0x1c9)]);return a40_0x31962f['lt'](_0x417c6e,_0x3eb5dc[_0x1caef9(0x1c9)]);}function getInstallPlanLabel(_0x75d724,_0x4fbb02){const _0x548133=a40_0x391f1f;switch(_0x4fbb02[_0x548133(0x204)]){case _0x548133(0x218):return _0x548133(0x210)+a40_0x559651[_0x548133(0x1e9)](_0x75d724)+'\x20→\x20'+a40_0x559651[_0x548133(0x1da)](_0x4fbb02['version']);case _0x548133(0x1c9):return'Requested\x20version:\x20'+a40_0x559651[_0x548133(0x1e9)](_0x75d724)+_0x548133(0x1f3)+a40_0x559651[_0x548133(0x1da)](_0x4fbb02['version']);case'latest':default:return _0x548133(0x1fc)+a40_0x559651[_0x548133(0x1e9)](_0x75d724)+_0x548133(0x1f3)+a40_0x559651[_0x548133(0x1da)](_0x4fbb02[_0x548133(0x1c9)]);}}function repairCurrentBuiltinSkill(){const _0x106176=a40_0x391f1f;console['log'](a40_0x559651[_0x106176(0x20d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x6f995b=installBuiltinSkill();if(_0x6f995b['ok'])return console[_0x106176(0x1ec)](a40_0x559651[_0x106176(0x20d)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x6f995b[_0x106176(0x1fa)]+_0x106176(0x219))),!![];return console[_0x106176(0x1d4)](a40_0x559651[_0x106176(0x1e9)](_0x106176(0x1e8)+_0x6f995b[_0x106176(0x205)]+_0x106176(0x20b)+(_0x6f995b[_0x106176(0x1c7)]||_0x106176(0x203)))),console['log'](a40_0x559651[_0x106176(0x20d)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x106176(0x1fe))),![];}function verifyUpdatedBuiltinSkill(_0x47d4b5){const _0x944498=a40_0x391f1f,_0x2adc11=inspectInstalledBuiltinSkillVersion(_0x47d4b5);if(_0x2adc11[_0x944498(0x20e)]==='current')return console['log'](a40_0x559651[_0x944498(0x20d)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x47d4b5+_0x944498(0x219))),!![];const _0x28e71a=_0x2adc11['skillVersion']?_0x944498(0x1ca)+_0x47d4b5+',\x20found\x20'+_0x2adc11[_0x944498(0x1fa)]:'expected\x20'+_0x47d4b5+_0x944498(0x1ef)+_0x2adc11[_0x944498(0x20e)];return console[_0x944498(0x1d4)](a40_0x559651['yellow'](_0x944498(0x20c)+_0x28e71a)),console[_0x944498(0x1ec)](a40_0x559651['gray'](_0x944498(0x1e4)+_0x2adc11['repairCommand'])),![];}async function execute(_0x4722e3){const _0xdf2c77=a40_0x391f1f;await validateUpdateFlags(_0x4722e3);const _0x150eb1=getCurrentVersion();console[_0xdf2c77(0x1ec)](_0xdf2c77(0x212)+_0x150eb1);const _0x282e34=a40_0x500cad(_0xdf2c77(0x1df))[_0xdf2c77(0x1ff)](),_0x2df09b=await resolveTargetVersion(_0x4722e3);if(!_0x2df09b){const _0x458f48=_0x4722e3[_0xdf2c77(0x1fb)](_0xdf2c77(0x218))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x282e34['fail'](_0x458f48),console['log'](a40_0x559651['gray']('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0xdf2c77(0x1f5))),{'ok':![],'message':_0x458f48};}const _0x39d32d=a40_0x31962f[_0xdf2c77(0x1ce)](VERSION),_0x58dfff=a40_0x31962f['valid'](_0x2df09b[_0xdf2c77(0x1c9)]);if(!_0x39d32d||!_0x58dfff)return _0x282e34[_0xdf2c77(0x213)](_0xdf2c77(0x1f0)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x39d32d,_0x2df09b)){const _0xb6da7c=_0x2df09b[_0xdf2c77(0x204)]===_0xdf2c77(0x1c9)?_0xdf2c77(0x214)+_0x2df09b[_0xdf2c77(0x1c9)]+')':a40_0x31962f['gt'](_0x39d32d,_0x58dfff)?_0xdf2c77(0x1f4)+_0x150eb1+_0xdf2c77(0x1d8)+_0x2df09b['version']:_0xdf2c77(0x1e6)+_0x2df09b[_0xdf2c77(0x1c9)]+')';return _0x282e34[_0xdf2c77(0x21b)](_0xb6da7c),{'ok':repairCurrentBuiltinSkill()};}_0x282e34[_0xdf2c77(0x21a)](getInstallPlanLabel(_0x150eb1,_0x2df09b));const _0x461e3f=detectPackageManager(),_0x17f6f1=_0x461e3f===_0xdf2c77(0x1d6)?resolveNpmBin(_0xdf2c77(0x1d6)):_0x461e3f,_0x27cb2c=a40_0x500cad(_0xdf2c77(0x1ea)+_0x461e3f+_0xdf2c77(0x207))[_0xdf2c77(0x1ff)]();try{return await execa(_0x17f6f1,[_0xdf2c77(0x1f7),'-g',NPM_PACKAGE_NAME+'@'+_0x2df09b[_0xdf2c77(0x1c9)]],{'stdio':_0xdf2c77(0x20a)}),_0x27cb2c[_0xdf2c77(0x21b)]('Updated\x20to\x20v'+_0x2df09b['version']),console[_0xdf2c77(0x1ec)](a40_0x559651[_0xdf2c77(0x20d)](_0xdf2c77(0x1d5))),{'ok':verifyUpdatedBuiltinSkill(_0x2df09b['version'])};}catch(_0x1d101e){return _0x27cb2c['fail'](_0xdf2c77(0x1e2)),console[_0xdf2c77(0x1c7)](a40_0x559651[_0xdf2c77(0x1e0)]('\x20\x20'+_0x1d101e[_0xdf2c77(0x1e3)])),console[_0xdf2c77(0x1ec)](a40_0x559651[_0xdf2c77(0x20d)](_0xdf2c77(0x1cd)+_0x461e3f+_0xdf2c77(0x20f)+NPM_PACKAGE_NAME+'@'+_0x2df09b[_0xdf2c77(0x1c9)])),{'ok':![],'message':_0x1d101e['message']};}}export const updateDefinition={'service':a40_0x391f1f(0x1d1),'command':a40_0x391f1f(0x1dc),'description':a40_0x391f1f(0x1ee),'risk':a40_0x391f1f(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4939fd,_0x212dd1){const _0x1e1ab4=a41_0x3b80,_0x15c73a=_0x4939fd();while(!![]){try{const _0x26e813=parseInt(_0x1e1ab4(0x148))/0x1*(-parseInt(_0x1e1ab4(0x144))/0x2)+parseInt(_0x1e1ab4(0x142))/0x3*(-parseInt(_0x1e1ab4(0x13e))/0x4)+parseInt(_0x1e1ab4(0x13d))/0x5*(-parseInt(_0x1e1ab4(0x147))/0x6)+parseInt(_0x1e1ab4(0x140))/0x7*(-parseInt(_0x1e1ab4(0x145))/0x8)+parseInt(_0x1e1ab4(0x143))/0x9*(-parseInt(_0x1e1ab4(0x13f))/0xa)+-parseInt(_0x1e1ab4(0x146))/0xb+parseInt(_0x1e1ab4(0x141))/0xc;if(_0x26e813===_0x212dd1)break;else _0x15c73a['push'](_0x15c73a['shift']());}catch(_0x43f367){_0x15c73a['push'](_0x15c73a['shift']());}}}(a41_0x480f,0x352af));function a41_0x3b80(_0x378522,_0x1e0d61){_0x378522=_0x378522-0x13d;const _0x480f7c=a41_0x480f();let _0x3b80c9=_0x480f7c[_0x378522];return _0x3b80c9;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x480f(){const _0x5b4f7f=['2618110WzsasL','69293LrCnfA','15100032OSknRo','261RoytCu','9MZKeYK','2WstxpB','152cPSmmi','3943302yDmDAT','39138MGLjJY','42739UrCoUo','95HpbEGd','3012oYDSbK'];a41_0x480f=function(){return _0x5b4f7f;};return a41_0x480f();}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a42_0x528b64=a42_0x57fd;(function(_0x57853b,_0x5e1871){const _0x276d1c=a42_0x57fd,_0xaf3c9c=_0x57853b();while(!![]){try{const _0x5ce620=-parseInt(_0x276d1c(0x1c9))/0x1*(-parseInt(_0x276d1c(0x1ba))/0x2)+parseInt(_0x276d1c(0x1be))/0x3+-parseInt(_0x276d1c(0x1ca))/0x4+-parseInt(_0x276d1c(0x1c3))/0x5+parseInt(_0x276d1c(0x1bd))/0x6+parseInt(_0x276d1c(0x1bb))/0x7+-parseInt(_0x276d1c(0x1bf))/0x8;if(_0x5ce620===_0x5e1871)break;else _0xaf3c9c['push'](_0xaf3c9c['shift']());}catch(_0x5b6685){_0xaf3c9c['push'](_0xaf3c9c['shift']());}}}(a42_0x557a,0xb8493));function a42_0x557a(){const _0x4d4a0e=['name','appCode','string','33909tExiSH','3191788wyUuub','alias','str','tableName','code','skip-imports','operation','34WPDErd','8709302PbJMKF','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','493608SdwUDs','3641457tOhMmB','11269464IYzwBM','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','boolean','sdk','776305htaAUK','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','read'];a42_0x557a=function(){return _0x4d4a0e;};return a42_0x557a();}function a42_0x57fd(_0x5621de,_0x166108){_0x5621de=_0x5621de-0x1b4;const _0x557aff=a42_0x557a();let _0x57fd7a=_0x557aff[_0x5621de];return _0x57fd7a;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':a42_0x528b64(0x1c2),'description':a42_0x528b64(0x1bc),'risk':a42_0x528b64(0x1c5),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x528b64(0x1b4),'type':a42_0x528b64(0x1c8),'description':a42_0x528b64(0x1c0)},{'name':'operation','type':a42_0x528b64(0x1c8),'required':!![],'description':a42_0x528b64(0x1c4)},{'name':a42_0x528b64(0x1b8),'type':a42_0x528b64(0x1c1),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x5f54fa){const _0x16a677=a42_0x528b64,{dataset:_0x242c51,operation:_0x2bcba6}=await getOperationDetail(_0x5f54fa[_0x16a677(0x1c7)],_0x5f54fa[_0x16a677(0x1b5)](_0x16a677(0x1b7)),_0x5f54fa['str']('operation')),_0x16dcec=generateSdkCode(_0x242c51,_0x2bcba6,{'includeImports':!_0x5f54fa['bool']('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x242c51[_0x16a677(0x1c6)],'code':_0x242c51[_0x16a677(0x1b7)],'tableName':_0x242c51[_0x16a677(0x1b6)]},'operation':_0x5f54fa[_0x16a677(0x1b5)](_0x16a677(0x1b9)),'code':_0x16dcec}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a43_0x377c(){const _0x3817f0=['no-imports','2715570fHRweV','7PNiSSF','codegen','217835pjsKon','sdk','2yfPjcK','str','1044432xQywJv','sqlName','bool','905CzFMMt','189027HyJDRA','read','169856iyAUpl','905000WqeaAX','bff','string','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','27IRocuI','sqlcode','sql','sqlCode','16IaYPtC'];a43_0x377c=function(){return _0x3817f0;};return a43_0x377c();}const a43_0x2f4633=a43_0x297f;(function(_0x3ecec2,_0x5d3733){const _0x553d83=a43_0x297f,_0x136d25=_0x3ecec2();while(!![]){try{const _0x9c0c9e=-parseInt(_0x553d83(0x1c6))/0x1*(-parseInt(_0x553d83(0x1c1))/0x2)+parseInt(_0x553d83(0x1c7))/0x3+parseInt(_0x553d83(0x1ba))/0x4*(parseInt(_0x553d83(0x1bf))/0x5)+-parseInt(_0x553d83(0x1c3))/0x6*(-parseInt(_0x553d83(0x1bd))/0x7)+-parseInt(_0x553d83(0x1b1))/0x8*(-parseInt(_0x553d83(0x1b6))/0x9)+-parseInt(_0x553d83(0x1b2))/0xa+-parseInt(_0x553d83(0x1bc))/0xb;if(_0x9c0c9e===_0x5d3733)break;else _0x136d25['push'](_0x136d25['shift']());}catch(_0x49b790){_0x136d25['push'](_0x136d25['shift']());}}}(a43_0x377c,0x21d54));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x297f(_0x304074,_0x2d73bb){_0x304074=_0x304074-0x1b1;const _0x377c55=a43_0x377c();let _0x297f21=_0x377c55[_0x304074];return _0x297f21;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x2f4633(0x1be),'command':a43_0x2f4633(0x1b8),'description':a43_0x2f4633(0x1b5),'risk':a43_0x2f4633(0x1c8),'flags':[SQLCODE_FLAG,{'name':'target','type':a43_0x2f4633(0x1b4),'description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x2f4633(0x1c0),'enum':[a43_0x2f4633(0x1c0),a43_0x2f4633(0x1b3)]},{'name':'no-imports','type':'boolean','description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x3a7f31){const _0x4b65e8=a43_0x2f4633,_0x1ba728=await getSqlQueryInfo(_0x3a7f31['appCode'],_0x3a7f31[_0x4b65e8(0x1c2)](_0x4b65e8(0x1b7))),_0x3cd003=_0x3a7f31['str']('target')||_0x4b65e8(0x1c0),_0x2389cf=generateSqlCodeTemplate(_0x1ba728,{'target':_0x3cd003,'includeImports':!_0x3a7f31[_0x4b65e8(0x1c5)](_0x4b65e8(0x1bb))});return{'ok':!![],'data':{'sqlCode':_0x1ba728[_0x4b65e8(0x1b9)],'sqlName':_0x1ba728[_0x4b65e8(0x1c4)],'target':_0x3cd003,'code':_0x2389cf}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xe7c425,_0x1d6012){const _0x3bbff1=a44_0x249f,_0x1c4b30=_0xe7c425();while(!![]){try{const _0x50740a=-parseInt(_0x3bbff1(0x84))/0x1+parseInt(_0x3bbff1(0x74))/0x2*(-parseInt(_0x3bbff1(0x6b))/0x3)+-parseInt(_0x3bbff1(0x76))/0x4+-parseInt(_0x3bbff1(0x68))/0x5+parseInt(_0x3bbff1(0x86))/0x6+-parseInt(_0x3bbff1(0x89))/0x7*(-parseInt(_0x3bbff1(0x85))/0x8)+parseInt(_0x3bbff1(0x6f))/0x9;if(_0x50740a===_0x1d6012)break;else _0x1c4b30['push'](_0x1c4b30['shift']());}catch(_0x4a7e34){_0x1c4b30['push'](_0x1c4b30['shift']());}}}(a44_0x4b2c,0x4d15a));import{CliErrors}from'../../errors.js';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';export function buildAppAddFlags(){const _0x41c56d=a44_0x249f;return[{'name':'appcode','type':_0x41c56d(0x81),'description':_0x41c56d(0x8d),'required':!![]},{'name':_0x41c56d(0x87),'type':'boolean','description':_0x41c56d(0x8e),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x30dc58=a44_0x249f;return[{'name':_0x30dc58(0x87),'type':_0x30dc58(0x8c),'description':_0x30dc58(0x8e),'default':![]}];}function a44_0x4b2c(){const _0x26ddd5=['\x20<name>','Added','string','Missing\x20app\x20name.','defaultApp','440796LXNHej','16SdSXnk','444720AgWDGE','global','\x22\x20(appcode:\x20','1430289uYspak','globalConfig','length','boolean','App\x20code','Use\x20global\x20config\x20scope','App\x20\x22','\x20Default\x20app\x20is\x20\x22','Usage:\x20','\x20app\x20\x22','str','\x20Remaining\x20app\x20\x22','653700aTZiLl','args','\x22\x20still\x20defined\x20in\x20','563469udLAIR','\x20<name>\x20--appcode\x20<code>','apps','projectConfig','8124750nGnjHi','both','\x20<name>\x20[--global]','\x20config.','\x20Default\x20app\x20changed\x20to\x20\x22','4KzBQEx','\x22\x20is\x20selected\x20automatically.','490416RLwhLX','trim','appcode','validation','keys','bool','\x22\x20not\x20found.','flagMissing','project'];a44_0x4b2c=function(){return _0x26ddd5;};return a44_0x4b2c();}export async function validateAppName(_0x97b408,_0x40cd52){const _0x2f4c66=a44_0x249f,_0x4e9f7f=_0x97b408['args'][0x0]?.[_0x2f4c66(0x77)]();if(!_0x4e9f7f)throw CliErrors['validation'](_0x2f4c66(0x82),_0x2f4c66(0x64)+CLI_BIN_NAME+'\x20'+_0x40cd52+_0x2f4c66(0x7f));}export async function runAppAdd(_0x1bb3bc,_0x4bfa97){const _0x48229a=a44_0x249f,_0x40d602=_0x1bb3bc[_0x48229a(0x69)][0x0]?.[_0x48229a(0x77)]();if(!_0x40d602)throw CliErrors['validation'](_0x48229a(0x82),_0x48229a(0x64)+CLI_BIN_NAME+'\x20'+_0x4bfa97+_0x48229a(0x6c));const _0x474440=_0x1bb3bc[_0x48229a(0x66)]('appcode');if(!_0x474440)throw CliErrors[_0x48229a(0x7d)](_0x48229a(0x78),_0x48229a(0x64)+CLI_BIN_NAME+'\x20'+_0x4bfa97+'\x20<name>\x20--appcode\x20<code>');const _0x19b4e9={'global':_0x1bb3bc['bool'](_0x48229a(0x87))},_0x738164=readConfig(_0x19b4e9);if(!_0x738164[_0x48229a(0x6d)])_0x738164[_0x48229a(0x6d)]={};const _0x5c1874={'appcode':_0x474440,...collectAppProfileOverrides(_0x26e00c=>_0x1bb3bc['str'](_0x26e00c))},_0x386807=_0x738164[_0x48229a(0x6d)],_0x5a9174=Object[_0x48229a(0x7a)](_0x386807),_0x2c3888=typeof _0x738164[_0x48229a(0x83)]===_0x48229a(0x81)&&_0x386807[_0x738164[_0x48229a(0x83)]]?_0x738164[_0x48229a(0x83)]:_0x5a9174[_0x48229a(0x8b)]===0x1?_0x5a9174[0x0]:undefined,_0x520f66=!!_0x386807[_0x40d602];_0x386807[_0x40d602]=_0x5c1874;const _0x4f76dd=normalizeStoredDefaultApp(_0x738164,_0x2c3888);writeConfig(_0x738164,_0x19b4e9);const _0x4ef2ea=!_0x520f66&&_0x4f76dd?_0x48229a(0x90)+_0x4f76dd+'\x22.':'',_0x3ad24f=(_0x520f66?'Updated':_0x48229a(0x80))+_0x48229a(0x65)+_0x40d602+_0x48229a(0x88)+_0x474440+')'+scopeLabel(_0x19b4e9)+'.'+_0x4ef2ea;return{'ok':!![],'message':_0x3ad24f};}function a44_0x249f(_0x5a7d74,_0x9ea573){_0x5a7d74=_0x5a7d74-0x64;const _0x4b2c08=a44_0x4b2c();let _0x249f03=_0x4b2c08[_0x5a7d74];return _0x249f03;}export async function runAppRemove(_0x2425f5,_0x4f460d){const _0x4b098c=a44_0x249f,_0x7fd22=_0x2425f5[_0x4b098c(0x69)][0x0]?.['trim']();if(!_0x7fd22)throw CliErrors['validation'](_0x4b098c(0x82),_0x4b098c(0x64)+CLI_BIN_NAME+'\x20'+_0x4f460d+_0x4b098c(0x71));const _0x199f36=_0x2425f5[_0x4b098c(0x7b)](_0x4b098c(0x87)),{config:_0x11ce33,layers:_0x463d10}=readRawConfigWithLayers(),_0x518501=_0x11ce33['apps']??{};if(!_0x518501[_0x7fd22])throw CliErrors[_0x4b098c(0x79)](_0x4b098c(0x8f)+_0x7fd22+_0x4b098c(0x7c));const _0x3529c6=_0x463d10[_0x4b098c(0x8a)]['apps']&&typeof _0x463d10[_0x4b098c(0x8a)]['apps']==='object'?_0x463d10['globalConfig'][_0x4b098c(0x6d)]:{},_0x26b2fc=_0x463d10[_0x4b098c(0x6e)][_0x4b098c(0x6d)]&&typeof _0x463d10[_0x4b098c(0x6e)][_0x4b098c(0x6d)]==='object'?_0x463d10[_0x4b098c(0x6e)][_0x4b098c(0x6d)]:{},_0x55bd08=appDefinedIn(_0x7fd22,_0x3529c6,_0x26b2fc),_0x1afbd7=resolveAppScopeForWrite(_0x7fd22,_0x199f36,_0x463d10),_0x4385bb={'global':_0x1afbd7===_0x4b098c(0x87)},_0xd5817a=readConfig(_0x4385bb),_0x19e936=_0xd5817a['apps'];if(!_0x19e936||!_0x19e936[_0x7fd22])throw CliErrors[_0x4b098c(0x79)](_0x4b098c(0x8f)+_0x7fd22+_0x4b098c(0x7c));delete _0x19e936[_0x7fd22];let _0x426c66='';const _0x22161f=typeof _0xd5817a['defaultApp']===_0x4b098c(0x81)?_0xd5817a[_0x4b098c(0x83)]:undefined,_0x413237=Object[_0x4b098c(0x7a)](_0x19e936),_0x3c67b9=_0x22161f===_0x7fd22?_0x413237[0x0]:_0x22161f,_0x5a6eec=normalizeStoredDefaultApp(_0xd5817a,_0x3c67b9);if(_0x22161f===_0x7fd22&&_0x413237[_0x4b098c(0x8b)]===0x1)_0x426c66=_0x4b098c(0x67)+_0x413237[0x0]+_0x4b098c(0x75);else _0x22161f===_0x7fd22&&_0x5a6eec&&(_0x426c66=_0x4b098c(0x73)+_0x5a6eec+'\x22.');Object[_0x4b098c(0x7a)](_0x19e936)[_0x4b098c(0x8b)]===0x0&&(delete _0xd5817a[_0x4b098c(0x6d)],delete _0xd5817a[_0x4b098c(0x83)]);writeConfig(_0xd5817a,_0x4385bb);const _0x46e1de=_0x55bd08===_0x4b098c(0x70)?'\x20Note:\x20app\x20\x22'+_0x7fd22+_0x4b098c(0x6a)+(_0x1afbd7===_0x4b098c(0x7e)?_0x4b098c(0x87):_0x4b098c(0x7e))+_0x4b098c(0x72):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x7fd22+'\x22'+scopeLabel(_0x4385bb)+'.'+_0x426c66+_0x46e1de};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x454872,_0x448f41){const _0x4bb7c0=a45_0x135e,_0x381a9e=_0x454872();while(!![]){try{const _0x5097e8=parseInt(_0x4bb7c0(0x167))/0x1*(-parseInt(_0x4bb7c0(0x176))/0x2)+parseInt(_0x4bb7c0(0x17c))/0x3*(-parseInt(_0x4bb7c0(0x17e))/0x4)+-parseInt(_0x4bb7c0(0x162))/0x5+-parseInt(_0x4bb7c0(0x175))/0x6+-parseInt(_0x4bb7c0(0x16e))/0x7*(parseInt(_0x4bb7c0(0x166))/0x8)+-parseInt(_0x4bb7c0(0x171))/0x9*(parseInt(_0x4bb7c0(0x163))/0xa)+parseInt(_0x4bb7c0(0x165))/0xb;if(_0x5097e8===_0x448f41)break;else _0x381a9e['push'](_0x381a9e['shift']());}catch(_0x4c38e6){_0x381a9e['push'](_0x381a9e['shift']());}}}(a45_0x4f38,0xa0a98));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x1f2474 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 _0x267d81=a45_0x135e,_0x4ea5d5=await input({'message':'App\x20Code:','validate':_0x349083=>{const _0x598827=a45_0x135e,_0x5d628c=validateAppcode(_0x349083[_0x598827(0x17f)]());return _0x5d628c[_0x598827(0x177)]||_0x5d628c[_0x598827(0x16c)]||'Invalid\x20App\x20Code';}});return _0x4ea5d5[_0x267d81(0x17f)]();}export async function promptAppSelection(_0x2d5e28){const _0x4ae623=a45_0x135e,_0x29e612=[{'name':a45_0x1f2474['yellow'](_0x4ae623(0x182)),'value':-0x1},..._0x2d5e28['map']((_0x49a781,_0x2d0ec2)=>({'name':_0x49a781[_0x4ae623(0x173)]+'\x20\x20'+a45_0x1f2474[_0x4ae623(0x179)]('('+_0x49a781[_0x4ae623(0x180)]+')'),'value':_0x2d0ec2}))],_0x5cca4a=await checkbox({'message':'Found\x20'+a45_0x1f2474[_0x4ae623(0x183)](_0x2d5e28['length'])+_0x4ae623(0x181),'choices':_0x29e612,'loop':![]});if(_0x5cca4a[_0x4ae623(0x161)](-0x1))return _0x4ae623(0x168);if(_0x5cca4a[_0x4ae623(0x16b)]===0x0)return _0x4ae623(0x168);return _0x5cca4a['map'](_0x3489fa=>_0x2d5e28[_0x3489fa]);}export async function promptSingleAppSelection(_0x2731e1){const _0x38e75b=a45_0x135e,_0x193219=[{'name':a45_0x1f2474[_0x38e75b(0x179)](_0x38e75b(0x17d)),'value':_0x38e75b(0x164)},{'name':a45_0x1f2474[_0x38e75b(0x169)](_0x38e75b(0x182)),'value':_0x38e75b(0x168)},..._0x2731e1['map'](_0x52382e=>({'name':_0x52382e[_0x38e75b(0x173)]+'\x20\x20'+a45_0x1f2474[_0x38e75b(0x179)]('('+_0x52382e[_0x38e75b(0x180)]+')'),'value':_0x52382e[_0x38e75b(0x180)]}))],_0x5deeab=await select({'message':'Select\x20the\x20app\x20to\x20bind:','choices':_0x193219});if(_0x5deeab===_0x38e75b(0x164))return _0x38e75b(0x164);if(_0x5deeab==='custom')return _0x38e75b(0x168);return _0x2731e1[_0x38e75b(0x17b)](_0x2d8472=>_0x2d8472['appCode']===_0x5deeab);}export async function selectSingleAppcode(_0x11611f){const _0x153aef=a45_0x135e;if(!_0x11611f)return writeCliSideChannelLine(a45_0x1f2474[_0x153aef(0x179)]('(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)')),_fallbackOrSkip();writeCliSideChannelLine(_0x153aef(0x16d));let _0x335db3;try{_0x335db3=await withActiveCookie(_0x11611f,()=>listRemoteApps());}catch(_0x2eb6ee){writeCliSideChannelLine(a45_0x1f2474[_0x153aef(0x169)](_0x153aef(0x178)));if(_0x2eb6ee instanceof Error)writeCliSideChannelLine(a45_0x1f2474['gray'](_0x153aef(0x172)+_0x2eb6ee[_0x153aef(0x16c)]+')'));return _fallbackOrSkip();}if(_0x335db3[_0x153aef(0x16b)]===0x0)return writeCliSideChannelLine(a45_0x1f2474[_0x153aef(0x169)](_0x153aef(0x170))),_fallbackOrSkip();const _0x535355=await promptSingleAppSelection(_0x335db3);if(_0x535355===_0x153aef(0x164))return'';if(_0x535355===_0x153aef(0x168))return promptCustomAppcode();return _0x535355[_0x153aef(0x180)];}export async function selectMultipleApps(_0x1adc5d){const _0xc87729=a45_0x135e;writeCliSideChannelLine(_0xc87729(0x16d));let _0x5eda82;try{_0x5eda82=await withActiveCookie(_0x1adc5d,()=>listRemoteApps());}catch(_0x377d96){writeCliSideChannelLine('\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.');if(_0x377d96 instanceof Error)writeCliSideChannelLine(_0xc87729(0x172)+_0x377d96[_0xc87729(0x16c)]+')');return _0xc87729(0x168);}if(_0x5eda82[_0xc87729(0x16b)]===0x0)return writeCliSideChannelLine('\x0aNo\x20available\x20apps\x20found.'),_0xc87729(0x168);return promptAppSelection(_0x5eda82);}function a45_0x135e(_0x1577ab,_0x394335){_0x1577ab=_0x1577ab-0x161;const _0x4f38cd=a45_0x4f38();let _0x135e49=_0x4f38cd[_0x1577ab];return _0x135e49;}async function _fallbackOrSkip(){const _0x559773=a45_0x135e,_0x58e3c6=await select({'message':_0x559773(0x16a),'choices':[{'name':a45_0x1f2474[_0x559773(0x179)](_0x559773(0x174)),'value':_0x559773(0x164)},{'name':a45_0x1f2474['yellow'](_0x559773(0x17a)),'value':_0x559773(0x16f)}]});if(_0x58e3c6===_0x559773(0x164))return'';return promptCustomAppcode();}function a45_0x4f38(){const _0x3b1155=['valid','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','gray','✎\x20Enter\x20manually','find','55983vYMDzg','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','188zrKKfw','trim','appCode','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','✎\x20Enter\x20appcode\x20manually','cyan','includes','1855465vGyLNL','20aAselc','skip','59478936boPPLq','6564296qmbCEu','1ZneIEI','custom','yellow','App\x20Code:','length','message','Fetching\x20available\x20apps...','7wswPTL','manual','No\x20available\x20apps\x20found.','5785452YHrefE','\x20\x20(','appName','(Skip;\x20configure\x20later)','5415936ceFSAr','984190KBjOSc'];a45_0x4f38=function(){return _0x3b1155;};return a45_0x4f38();}
|