@lovrabet/rabetbase-cli 2.5.2-beta.2 → 2.5.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -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.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.d.ts +1 -0
- 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.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/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-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/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.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.d.ts +3 -7
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1 -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/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +1 -3
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x84d1(_0x33bb57,_0x3548aa){_0x33bb57=_0x33bb57-0xe2;const _0x1b14ec=a32_0x1b14();let _0x84d144=_0x1b14ec[_0x33bb57];return _0x84d144;}const a32_0x129c7f=a32_0x84d1;function a32_0x1b14(){const _0x20dd76=['1199900rEGyHP','replace','5665aVvKhe','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','keys','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','toISOString','str','681165WmYQwZ','appCode','Lock\x20scope\x20for\x20app\x20\x22','Backend\x20Function\x20lock\x20file\x20not\x20found.','length','lockFilePath','/api/management/library/scripts/delete','\x20\x20-\x20','trashedTo','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','target','54dGRCrV','remoteId','validation','Would\x20delete\x20','lastSync','20YJRFri','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','\x20(local\x20file\x20moved\x20to\x20trash)','stringify','Function\x20not\x20found:\x20','find','scriptsRoot','Multiple\x20functions\x20match\x20\x22','<timestamp>','high-risk-write','No\x20lock\x20entry\x20found\x20for\x20\x22','691008wMXiuF','trashDir','7545GyDFtJ','startsWith','180RfBwVL','delete','parse','projectRoot','359718moqpkb','functions','apps','filter','Local\x20delete\x20not\x20settled\x20for\x20','2343054qDQAIy','includes'];a32_0x1b14=function(){return _0x20dd76;};return a32_0x1b14();}(function(_0x3baf6a,_0x31fbd5){const _0xde1eee=a32_0x84d1,_0x513e0e=_0x3baf6a();while(!![]){try{const _0x4188ea=parseInt(_0xde1eee(0xe8))/0x1*(parseInt(_0xde1eee(0xfa))/0x2)+parseInt(_0xde1eee(0x10c))/0x3*(-parseInt(_0xde1eee(0x10e))/0x4)+parseInt(_0xde1eee(0xff))/0x5*(-parseInt(_0xde1eee(0x112))/0x6)+parseInt(_0xde1eee(0xe4))/0x7+parseInt(_0xde1eee(0x10a))/0x8+parseInt(_0xde1eee(0xef))/0x9+-parseInt(_0xde1eee(0xe6))/0xa;if(_0x4188ea===_0x31fbd5)break;else _0x513e0e['push'](_0x513e0e['shift']());}catch(_0xba74a0){_0x513e0e['push'](_0x513e0e['shift']());}}}(a32_0x1b14,0x2b279));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':a32_0x129c7f(0x10f),'description':a32_0x129c7f(0xeb),'risk':a32_0x129c7f(0x108),'flags':[{'name':a32_0x129c7f(0xf9),'type':'string','required':!![],'description':a32_0x129c7f(0xf8)}],async 'validate'(_0x3968a1){const _0x5c3bab=a32_0x129c7f,_0x1f561d=loadBffProjectConfig(_0x3968a1['appCode']),_0x39f523=await readBffLockFile(_0x1f561d[_0x5c3bab(0xf4)]);if(!_0x39f523)throw CliErrors[_0x5c3bab(0xfc)](_0x5c3bab(0xec));},async 'dryRun'(_0xf77dec){const _0x1e2c80=a32_0x129c7f,_0x55c131=loadBffProjectConfig(_0xf77dec[_0x1e2c80(0xf0)]),_0x5b0936=await readBffLockFile(_0x55c131[_0x1e2c80(0xf4)]);if(!_0x5b0936)throw CliErrors['validation'](_0x1e2c80(0xf2));const {appLock:_0x298f14}=ensureLockScope(_0x5b0936,_0xf77dec[_0x1e2c80(0xf0)],_0x55c131[_0x1e2c80(0x105)],_0x1e2c80(0x10f)),_0x159adf=_0xf77dec[_0x1e2c80(0xee)]('target'),_0x31bc3f=Object[_0x1e2c80(0xea)](_0x298f14[_0x1e2c80(0x113)]),_0x5c8c88=resolveDeleteTarget(_0x159adf,_0x31bc3f),_0x444a09=_0x298f14['functions'][_0x5c8c88];if(!_0x444a09)throw CliErrors[_0x1e2c80(0xfc)](_0x1e2c80(0x109)+_0x5c8c88+'\x22.');const _0x50b613=resolveLocalFilePathFromLockKey(_0x55c131,_0x5c8c88),_0x5ae7f6=relative(_0x55c131[_0x1e2c80(0x111)],_0x50b613),_0xa7c325=join(_0x55c131[_0x1e2c80(0x10b)],_0x1e2c80(0x107),_0x5ae7f6);return{'method':'POST','url':_0x1e2c80(0xf5),'body':{'appCode':_0xf77dec[_0x1e2c80(0xf0)],'target':_0x5c8c88,'remoteId':_0x444a09[_0x1e2c80(0xfb)],'localFilePath':_0x50b613,'trashedPath':_0xa7c325},'description':_0x1e2c80(0xfd)+_0x5c8c88+_0x1e2c80(0x100)};},async 'execute'(_0x32ce95){const _0x2e6ede=a32_0x129c7f,_0x10e17d=loadBffProjectConfig(_0x32ce95[_0x2e6ede(0xf0)]),_0x5a31c8=await readBffLockFile(_0x10e17d[_0x2e6ede(0xf4)]);if(!_0x5a31c8)throw CliErrors[_0x2e6ede(0xfc)](_0x2e6ede(0xf2));const {lockData:_0x1ac74b,appLock:_0x3e53ba}=ensureLockScope(_0x5a31c8,_0x32ce95[_0x2e6ede(0xf0)],_0x10e17d[_0x2e6ede(0x105)],_0x2e6ede(0x10f)),_0x5cc652=JSON[_0x2e6ede(0x110)](JSON[_0x2e6ede(0x102)](_0x1ac74b)),_0x49424a=_0x5cc652[_0x2e6ede(0x114)][_0x32ce95['appCode']];if(!_0x49424a)throw new Error(_0x2e6ede(0xf1)+_0x32ce95[_0x2e6ede(0xf0)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x4e105c=_0x32ce95[_0x2e6ede(0xee)](_0x2e6ede(0xf9)),_0x31e029=Object[_0x2e6ede(0xea)](_0x49424a[_0x2e6ede(0x113)]),_0x3d0be2=resolveDeleteTarget(_0x4e105c,_0x31e029),_0x2edd95=_0x49424a[_0x2e6ede(0x113)][_0x3d0be2];if(!_0x2edd95)throw CliErrors[_0x2e6ede(0xfc)](_0x2e6ede(0x109)+_0x3d0be2+'\x22.');await deleteBffScript(_0x2edd95[_0x2e6ede(0xfb)]),delete _0x49424a['functions'][_0x3d0be2],_0x49424a[_0x2e6ede(0xfe)]=new Date()[_0x2e6ede(0xed)](),await writeBffLockFile(_0x10e17d[_0x2e6ede(0xf4)],_0x5cc652);const _0x8b8872=resolveLocalFilePathFromLockKey(_0x10e17d,_0x3d0be2);let _0x357adf;await fileExists(_0x8b8872)&&(_0x357adf=await moveToTrash(_0x10e17d[_0x2e6ede(0x111)],_0x10e17d['trashDir'],_0x8b8872),await cleanupEmptyDirectories(dirname(_0x8b8872),_0x10e17d['scriptsRootDir']));await waitForDeleteSettlement(_0x10e17d['lockFilePath'],_0x32ce95[_0x2e6ede(0xf0)],_0x3d0be2,_0x8b8872),await sleep(0x96);const _0x2ac076={'deleted':_0x3d0be2,'remoteId':_0x2edd95[_0x2e6ede(0xfb)]};if(_0x357adf)_0x2ac076[_0x2e6ede(0xf7)]=_0x357adf;return{'ok':!![],'data':_0x2ac076,'message':'Deleted\x20'+_0x3d0be2+(_0x357adf?_0x2e6ede(0x101):'')};}};function resolveDeleteTarget(_0x332fd6,_0x42f90a){const _0x30b879=a32_0x129c7f;if(_0x332fd6[_0x30b879(0xe5)]('/')){const _0x126ec3=_0x42f90a[_0x30b879(0x104)](_0x4f14f7=>_0x4f14f7===_0x332fd6);if(!_0x126ec3)throw CliErrors[_0x30b879(0xfc)]('Function\x20not\x20found:\x20'+_0x332fd6);return _0x126ec3;}const _0x3990a9=_0x42f90a[_0x30b879(0xe2)](_0x3b49f5=>_0x3b49f5['split']('/')['at'](-0x1)===_0x332fd6);if(_0x3990a9[_0x30b879(0xf3)]===0x0)throw CliErrors['validation'](_0x30b879(0x103)+_0x332fd6);if(_0x3990a9[_0x30b879(0xf3)]>0x1)throw CliErrors[_0x30b879(0xfc)](_0x30b879(0x106)+_0x332fd6+_0x30b879(0xe9)+_0x3990a9['map'](_0x5323a0=>_0x30b879(0xf6)+_0x5323a0)['join']('\x0a'));return _0x3990a9[0x0];}async function moveToTrash(_0x3f8f79,_0x3eec68,_0x74e8f2){const _0x4908cc=a32_0x129c7f,_0x333d32=new Date()['toISOString']()[_0x4908cc(0xe7)](/[:.]/g,'-'),_0x36603b=relative(_0x3f8f79,_0x74e8f2),_0x106c29=join(_0x3eec68,_0x333d32,_0x36603b);return await mkdir(dirname(_0x106c29),{'recursive':!![]}),await rename(_0x74e8f2,_0x106c29),_0x106c29;}async function cleanupEmptyDirectories(_0x441d36,_0x1fd877){const _0x5a6777=a32_0x129c7f;let _0x5abbb9=resolve(_0x441d36);const _0x53cf8e=resolve(_0x1fd877);while(_0x5abbb9[_0x5a6777(0x10d)](''+_0x53cf8e+sep)||_0x5abbb9===_0x53cf8e){if(_0x5abbb9===_0x53cf8e)return;try{const _0x5c0f15=await readdir(_0x5abbb9);if(_0x5c0f15['length']>0x0)return;await rmdir(_0x5abbb9);}catch{return;}_0x5abbb9=dirname(_0x5abbb9);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x148910,_0x31b95b,_0x2a4e78,_0x2901d8){const _0x591182=a32_0x129c7f;for(let _0x29e0f2=0x0;_0x29e0f2<DELETE_SETTLE_RETRY_COUNT;_0x29e0f2+=0x1){const _0x309d7c=await readBffLockFile(_0x148910),_0x515861=!!_0x309d7c?.[_0x591182(0x114)]?.[_0x31b95b]?.[_0x591182(0x113)]?.[_0x2a4e78],_0x4bfbf7=await fileExists(_0x2901d8);if(!_0x515861&&!_0x4bfbf7)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x591182(0xe3)+_0x2a4e78+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x227cf9=a33_0x73ec;function a33_0x73ec(_0x5acfee,_0x498ebe){_0x5acfee=_0x5acfee-0x17b;const _0x3292da=a33_0x3292();let _0x73ecfb=_0x3292da[_0x5acfee];return _0x73ecfb;}(function(_0x3812df,_0x2373d1){const _0x1e99ff=a33_0x73ec,_0x415c80=_0x3812df();while(!![]){try{const _0x40a2ac=parseInt(_0x1e99ff(0x185))/0x1+-parseInt(_0x1e99ff(0x17e))/0x2*(parseInt(_0x1e99ff(0x18b))/0x3)+parseInt(_0x1e99ff(0x184))/0x4*(-parseInt(_0x1e99ff(0x18a))/0x5)+parseInt(_0x1e99ff(0x193))/0x6*(-parseInt(_0x1e99ff(0x186))/0x7)+parseInt(_0x1e99ff(0x18d))/0x8+parseInt(_0x1e99ff(0x17b))/0x9*(parseInt(_0x1e99ff(0x194))/0xa)+parseInt(_0x1e99ff(0x188))/0xb*(parseInt(_0x1e99ff(0x183))/0xc);if(_0x40a2ac===_0x2373d1)break;else _0x415c80['push'](_0x415c80['shift']());}catch(_0x3ffafb){_0x415c80['push'](_0x415c80['shift']());}}}(a33_0x3292,0xbe612));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x227cf9(0x18f),'command':'detail','description':a33_0x227cf9(0x17f),'risk':'read','flags':[{'name':'id','type':a33_0x227cf9(0x191),'required':!![],'description':a33_0x227cf9(0x17d)},{'name':a33_0x227cf9(0x190),'type':'boolean','description':a33_0x227cf9(0x17c)}],async 'execute'(_0x29ced2){const _0x45ee06=a33_0x227cf9,_0x331c85=await getBffScriptInfo(_0x29ced2[_0x45ee06(0x18c)]('id')),_0x390da9=_0x29ced2[_0x45ee06(0x187)](_0x45ee06(0x190));if(_0x390da9)return{'ok':!![],'data':_0x331c85};return{'ok':!![],'data':{'id':_0x331c85['id'],'functionName':_0x331c85[_0x45ee06(0x196)]??'','version':_0x331c85[_0x45ee06(0x182)]??'','updateUserName':_0x331c85['updateUserName']??'','appCode':_0x331c85[_0x45ee06(0x181)],'scriptType':_0x331c85[_0x45ee06(0x195)],'description':_0x331c85[_0x45ee06(0x180)]||_0x45ee06(0x18e),'createdTime':_0x331c85[_0x45ee06(0x189)]??'','updatedTime':_0x331c85['updatedTime']??'','scriptContent':_0x331c85[_0x45ee06(0x192)]??''}};}};function a33_0x3292(){const _0x2732b6=['Script\x20ID','2877986okFSZK','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','description','appCode','version','972vCFjPG','4vyFmIl','1166826tTwiOP','770xOZUvn','bool','72402MIbCOD','createdTime','5632435gaZcRY','3nUhhGp','num','5594064DkEHpw','(none)','bff','verbose','number','scriptContent','894CELswh','10zNpfnQ','scriptType','functionName','8661942EPprDu','Return\x20full\x20raw\x20script\x20object'];a33_0x3292=function(){return _0x2732b6;};return a33_0x3292();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5470e5,_0x1c3c1f){const _0xd76321=a34_0x20d6,_0x145cf8=_0x5470e5();while(!![]){try{const _0x4d9c3a=parseInt(_0xd76321(0x150))/0x1*(-parseInt(_0xd76321(0x152))/0x2)+-parseInt(_0xd76321(0x14b))/0x3+-parseInt(_0xd76321(0x14a))/0x4*(-parseInt(_0xd76321(0x14f))/0x5)+-parseInt(_0xd76321(0x14d))/0x6+-parseInt(_0xd76321(0x151))/0x7+-parseInt(_0xd76321(0x14e))/0x8+parseInt(_0xd76321(0x14c))/0x9;if(_0x4d9c3a===_0x1c3c1f)break;else _0x145cf8['push'](_0x145cf8['shift']());}catch(_0x1b7e6c){_0x145cf8['push'](_0x145cf8['shift']());}}}(a34_0x1331,0x7bc9c));import{bffList}from'../../commands/bff/list.js';function a34_0x1331(){const _0x2f392f=['1883262JlMhrL','21914712ZDXTtc','391002KRCNFH','5957488AkHBzZ','393905hzeoun','465787ndAzbP','1826167mMCjyN','2VxaLmZ','12itTEqU'];a34_0x1331=function(){return _0x2f392f;};return a34_0x1331();}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_0x20d6(_0x2213e8,_0x2315d3){_0x2213e8=_0x2213e8-0x14a;const _0x13312f=a34_0x1331();let _0x20d6dd=_0x13312f[_0x2213e8];return _0x20d6dd;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a35_0x404f(){const _0x5d52ec=['verbose','COMMON','map','168vrEJkL','Script\x20type\x20filter','str','1887540JbhnBY','15840189oHdHan','bool','Filter\x20by\x20script\x20name','2366463WbhdrG','appCode','string','2rXhHQt','read','10wiogry','bff','105804BkaqEs','List\x20Backend\x20Function\x20scripts','54mCzHgN','length','2806998ifDHbp','586638piWkyB','Return\x20full\x20script\x20objects','ENDPOINT','(unnamed)','name','590704EyQJiP','functionName'];a35_0x404f=function(){return _0x5d52ec;};return a35_0x404f();}const a35_0x493ff1=a35_0x25d6;(function(_0x274245,_0x37015c){const _0x1d3648=a35_0x25d6,_0x3321e6=_0x274245();while(!![]){try{const _0x5f38cb=parseInt(_0x1d3648(0xc2))/0x1*(parseInt(_0x1d3648(0xd6))/0x2)+-parseInt(_0x1d3648(0xdc))/0x3*(-parseInt(_0x1d3648(0xda))/0x4)+-parseInt(_0x1d3648(0xcf))/0x5+parseInt(_0x1d3648(0xc1))/0x6+parseInt(_0x1d3648(0xcc))/0x7*(-parseInt(_0x1d3648(0xc7))/0x8)+-parseInt(_0x1d3648(0xd0))/0x9*(-parseInt(_0x1d3648(0xd8))/0xa)+-parseInt(_0x1d3648(0xd3))/0xb;if(_0x5f38cb===_0x37015c)break;else _0x3321e6['push'](_0x3321e6['shift']());}catch(_0x57502f){_0x3321e6['push'](_0x3321e6['shift']());}}}(a35_0x404f,0xe20a1));function a35_0x25d6(_0x1b9a63,_0x10a067){_0x1b9a63=_0x1b9a63-0xc1;const _0x404f30=a35_0x404f();let _0x25d642=_0x404f30[_0x1b9a63];return _0x25d642;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x493ff1(0xd9),'command':'list','description':a35_0x493ff1(0xdb),'risk':a35_0x493ff1(0xd7),'flags':[{'name':'type','type':a35_0x493ff1(0xd5),'description':a35_0x493ff1(0xcd),'default':a35_0x493ff1(0xc4),'enum':['ENDPOINT',a35_0x493ff1(0xca)]},{'name':'name','type':a35_0x493ff1(0xd5),'description':a35_0x493ff1(0xd2)},{'name':a35_0x493ff1(0xc9),'type':'boolean','description':a35_0x493ff1(0xc3)}],async 'execute'(_0xedc6db){const _0x36e0ba=a35_0x493ff1,_0x2402a1=await listBffScripts(_0xedc6db[_0x36e0ba(0xd4)],_0xedc6db[_0x36e0ba(0xce)]('type'),{'scriptName':_0xedc6db[_0x36e0ba(0xce)](_0x36e0ba(0xc6))||undefined}),_0x17ec25=_0xedc6db[_0x36e0ba(0xd1)](_0x36e0ba(0xc9));return{'ok':!![],'data':_0x17ec25?_0x2402a1:_0x2402a1[_0x36e0ba(0xcb)](_0x3dea58=>({'id':_0x3dea58['id'],'functionName':_0x3dea58[_0x36e0ba(0xc8)]??'','description':_0x3dea58['description']||_0x36e0ba(0xc5),'scriptType':_0x3dea58['scriptType']})),'message':_0x2402a1[_0x36e0ba(0xdd)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a36_0x75a385=a36_0x3ffe;(function(_0x2743ee,_0x4d721c){const _0x500d5b=a36_0x3ffe,_0x2c86be=_0x2743ee();while(!![]){try{const _0x4333d1=parseInt(_0x500d5b(0x8e))/0x1+parseInt(_0x500d5b(0x7c))/0x2+-parseInt(_0x500d5b(0x97))/0x3*(parseInt(_0x500d5b(0xa5))/0x4)+parseInt(_0x500d5b(0x9f))/0x5+-parseInt(_0x500d5b(0x88))/0x6*(parseInt(_0x500d5b(0xa2))/0x7)+-parseInt(_0x500d5b(0x69))/0x8+parseInt(_0x500d5b(0x9e))/0x9;if(_0x4333d1===_0x4d721c)break;else _0x2c86be['push'](_0x2c86be['shift']());}catch(_0x511d7a){_0x2c86be['push'](_0x2c86be['shift']());}}}(a36_0x1e01,0x9efe4));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';function a36_0x3ffe(_0x4ee632,_0x259ed2){_0x4ee632=_0x4ee632-0x67;const _0x1e01d4=a36_0x1e01();let _0x3ffe99=_0x1e01d4[_0x4ee632];return _0x3ffe99;}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a36_0x1e01(){const _0xe385c6=['message','Force\x20pull\x20cancelled.','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','version','scriptType','stringify','length','COMMON','hookLocation','force','push','6vmKSaG','/api/management/library/scripts/list?appCode=','cancelled','question','datasetCode','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','202203jLFZiR','functionNode','skipped','string','bool','operationType','appCode','toISOString','all','990129GIFyEZ','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','lockFilePath','toLowerCase','stdin','apiDir','lockKey','17142597bXtYBp','3097010FcKiNJ','includes','Remote\x20script\x20missing\x20content.','8873298ZqoNLv','ENDPOINT','lastSync','8PmfiuS','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','HOOK','functions','scriptContent','stderr','map','type','close','validation','GET','conflict','Pull\x20complete:\x20','nonInteractive','5038056OYiKPt','yes','filePath','Remote\x20script\x20missing\x20id.','parse','\x20pulled,\x20','apps','alias','&type=','would_pull','Lock\x20scope\x20for\x20app\x20\x22','Would\x20inspect\x20','pull','str','\x20skipped,\x20','boolean','trim','Pull\x20only\x20this\x20script\x20type','bff','964710reoBOx'];a36_0x1e01=function(){return _0xe385c6;};return a36_0x1e01();}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_0x75a385(0x7b),'command':a36_0x75a385(0x75),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':'read','flags':[{'name':a36_0x75a385(0xac),'type':a36_0x75a385(0x91),'description':a36_0x75a385(0x7a),'enum':[a36_0x75a385(0x84),a36_0x75a385(0xa3),a36_0x75a385(0xa7)]},{'name':a36_0x75a385(0x86),'type':a36_0x75a385(0x78),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x5e8dc4){const _0x58c3b4=a36_0x75a385,_0x19a9ef=loadBffProjectConfig(_0x5e8dc4[_0x58c3b4(0x94)]),_0x3e3572=await readBffLockFile(_0x19a9ef[_0x58c3b4(0x99)]),{appLock:_0x46acea}=ensureLockScope(_0x3e3572??createEmptyBffLock(),_0x5e8dc4[_0x58c3b4(0x94)],_0x19a9ef['scriptsRoot'],_0x58c3b4(0x75)),_0x9d8277=normalizeBffType(_0x5e8dc4[_0x58c3b4(0x76)]('type'))??undefined,_0x4a1f21=buildDatasetCodeToAliasMap(_0x5e8dc4[_0x58c3b4(0x9c)],_0x5e8dc4[_0x58c3b4(0x94)]),[_0x17817f,_0x164072]=await Promise['all']([listBffScripts(_0x5e8dc4[_0x58c3b4(0x94)],_0x9d8277),getBffScriptStatistics(_0x5e8dc4[_0x58c3b4(0x94)])]),_0x22ea07=createHookLocationMap(_0x164072),_0x20e4b4=[];for(const _0x11f216 of _0x17817f){const _0x2b65c4=resolveRemoteScriptTarget(_0x19a9ef,_0x11f216,_0x22ea07,_0x46acea[_0x58c3b4(0xa8)],_0x4a1f21);if(!_0x2b65c4){_0x20e4b4[_0x58c3b4(0x87)]({'scriptType':_0x11f216[_0x58c3b4(0x81)],'functionName':_0x11f216['functionName']??'','status':_0x58c3b4(0x90),'reason':'unresolvable\x20target\x20path'});continue;}const _0x31e19a=_0x46acea['functions'][_0x2b65c4[_0x58c3b4(0x9d)]],_0x5ac77b=_0x11f216[_0x58c3b4(0xa9)]!=null?computeContentHash(_0x11f216['scriptContent']):undefined,_0x4477e2=await hasUnsyncedLocalChanges(_0x2b65c4[_0x58c3b4(0x6b)],_0x31e19a,_0x5ac77b);_0x20e4b4['push']({'lockKey':_0x2b65c4['lockKey'],'filePath':_0x2b65c4[_0x58c3b4(0x6b)],'remoteId':_0x11f216['id']??null,'status':_0x4477e2?_0x58c3b4(0xb0):_0x58c3b4(0x72)});}return{'method':_0x58c3b4(0xaf),'url':_0x58c3b4(0x89)+_0x5e8dc4['appCode']+(_0x9d8277?_0x58c3b4(0x71)+_0x9d8277:''),'body':{'appCode':_0x5e8dc4[_0x58c3b4(0x94)],'filterType':_0x9d8277??null,'files':_0x20e4b4},'description':_0x58c3b4(0x74)+_0x20e4b4[_0x58c3b4(0x83)]+_0x58c3b4(0xa6)};},async 'execute'(_0xe01a5f){const _0x17f056=a36_0x75a385,_0x41fd83=loadBffProjectConfig(_0xe01a5f[_0x17f056(0x94)]),_0x5439fb=await readBffLockFile(_0x41fd83[_0x17f056(0x99)]),{lockData:_0x1e78fa,appLock:_0x16ea4f}=ensureLockScope(_0x5439fb??createEmptyBffLock(),_0xe01a5f['appCode'],_0x41fd83['scriptsRoot'],_0x17f056(0x75)),_0x4e1452=normalizeBffType(_0xe01a5f[_0x17f056(0x76)](_0x17f056(0xac)))??undefined;if(_0xe01a5f[_0x17f056(0x76)](_0x17f056(0xac))&&!_0x4e1452)throw CliErrors[_0x17f056(0xae)](_0x17f056(0x7f));const [_0x403efb,_0x433877]=await Promise[_0x17f056(0x96)]([listBffScripts(_0xe01a5f[_0x17f056(0x94)],_0x4e1452),getBffScriptStatistics(_0xe01a5f['appCode'])]);if(_0x403efb['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x17f056(0x8d)};const _0x5eacd4=_0xe01a5f[_0x17f056(0x92)]('force');if(_0x5eacd4&&!_0xe01a5f[_0x17f056(0x68)]){const _0xa9d04e=await confirmForce();if(!_0xa9d04e)throw CliErrors[_0x17f056(0x8a)](_0x17f056(0x7e));}if(_0x5eacd4&&_0xe01a5f[_0x17f056(0x68)]){}const _0x516110=buildDatasetCodeToAliasMap(_0xe01a5f[_0x17f056(0x9c)],_0xe01a5f['appCode']),_0x50eeac=createHookLocationMap(_0x433877),_0x1cdf54=JSON[_0x17f056(0x6d)](JSON[_0x17f056(0x82)](_0x1e78fa)),_0x37fd1d=_0xe01a5f[_0x17f056(0x94)],_0x475646=_0x1cdf54[_0x17f056(0x6f)][_0x37fd1d];if(!_0x475646)throw new Error(_0x17f056(0x73)+_0x37fd1d+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x51f5fc=[],_0x4b1121=[],_0x4a47ff=[];for(const _0x4100f2 of _0x403efb){const _0x285bde=resolveRemoteScriptTarget(_0x41fd83,_0x4100f2,_0x50eeac,_0x16ea4f['functions'],_0x516110);if(!_0x285bde){_0x4b1121[_0x17f056(0x87)]({'lockKey':_0x4100f2[_0x17f056(0x81)]+'/'+_0x4100f2['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x41310b=_0x16ea4f['functions'][_0x285bde[_0x17f056(0x9d)]];try{if(!_0x4100f2['id'])throw new Error(_0x17f056(0x6c));if(_0x4100f2[_0x17f056(0xa9)]==null)throw new Error(_0x17f056(0xa1));const _0x5e296f=_0x4100f2[_0x17f056(0xa9)],_0x4c2cf1=computeContentHash(_0x5e296f);if(!_0x5eacd4){const _0x505ac6=await hasUnsyncedLocalChanges(_0x285bde['filePath'],_0x41310b,_0x4c2cf1);if(_0x505ac6){_0x4b1121[_0x17f056(0x87)]({'lockKey':_0x285bde['lockKey'],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x285bde[_0x17f056(0x6b)]),await writeFile(_0x285bde['filePath'],_0x5e296f,'utf8');const _0x27ed51={'hash':_0x4c2cf1,'remoteId':_0x4100f2['id'],'version':_0x4100f2[_0x17f056(0x80)]};_0x285bde['type']==='HOOK'&&_0x285bde[_0x17f056(0x85)]&&(_0x27ed51[_0x17f056(0x70)]=_0x285bde[_0x17f056(0x85)][_0x17f056(0x70)],_0x27ed51[_0x17f056(0x8c)]=_0x285bde[_0x17f056(0x85)][_0x17f056(0x8c)],_0x27ed51[_0x17f056(0x93)]=_0x285bde['hookLocation'][_0x17f056(0x93)],_0x27ed51[_0x17f056(0x8f)]=_0x285bde[_0x17f056(0x85)][_0x17f056(0x8f)]),_0x475646[_0x17f056(0xa8)][_0x285bde[_0x17f056(0x9d)]]=_0x27ed51,_0x51f5fc[_0x17f056(0x87)]({'lockKey':_0x285bde[_0x17f056(0x9d)],'remoteId':_0x4100f2['id']});}catch(_0x2314c2){_0x4a47ff[_0x17f056(0x87)]({'lockKey':_0x285bde[_0x17f056(0x9d)],'error':_0x2314c2 instanceof Error?_0x2314c2[_0x17f056(0x7d)]:String(_0x2314c2)});}}return _0x475646[_0x17f056(0xa4)]=new Date()[_0x17f056(0x95)](),await writeBffLockFile(_0x41fd83[_0x17f056(0x99)],_0x1cdf54),{'ok':_0x4a47ff[_0x17f056(0x83)]===0x0,'data':{'pulled':_0x51f5fc,'skipped':_0x4b1121,'failed':_0x4a47ff},'message':_0x17f056(0x67)+_0x51f5fc[_0x17f056(0x83)]+_0x17f056(0x6e)+_0x4b1121[_0x17f056(0x83)]+_0x17f056(0x77)+_0x4a47ff['length']+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0x4858bd,_0x3c0de4,_0x2480f0){if(!await fileExists(_0x4858bd))return![];const _0x15db8f=await computeFileHash(_0x4858bd);if(!_0x3c0de4)return _0x2480f0?_0x15db8f!==_0x2480f0:!![];return _0x15db8f!==_0x3c0de4['hash'];}function buildDatasetCodeToAliasMap(_0x2de488,_0x381433){const _0x3f94e7=a36_0x75a385,_0x5034da=loadAliasMap(_0x2de488,undefined,resolveApiFilePath(_0x2de488,_0x381433));return new Map(_0x5034da[_0x3f94e7(0xab)](_0x31dd23=>[_0x31dd23[_0x3f94e7(0x8c)],_0x31dd23[_0x3f94e7(0x70)]]));}async function confirmForce(){const _0x4c6635=a36_0x75a385,_0xd7f46=createInterface({'input':process[_0x4c6635(0x9b)],'output':process[_0x4c6635(0xaa)]}),_0x5a4d26=await new Promise(_0x4032bb=>{const _0x4ff24e=_0x4c6635;_0xd7f46[_0x4ff24e(0x8b)](_0x4ff24e(0x98),_0x4032bb);});return _0xd7f46[_0x4c6635(0xad)](),['y',_0x4c6635(0x6a)][_0x4c6635(0xa0)](_0x5a4d26[_0x4c6635(0x79)]()[_0x4c6635(0x9a)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x479c63=a37_0x3e40;(function(_0x3a8870,_0x1afc65){const _0x3cd1b0=a37_0x3e40,_0x43eee4=_0x3a8870();while(!![]){try{const _0x130f28=parseInt(_0x3cd1b0(0x8d))/0x1+-parseInt(_0x3cd1b0(0xa7))/0x2*(-parseInt(_0x3cd1b0(0xce))/0x3)+-parseInt(_0x3cd1b0(0xd5))/0x4+-parseInt(_0x3cd1b0(0xac))/0x5+-parseInt(_0x3cd1b0(0xa1))/0x6+-parseInt(_0x3cd1b0(0x91))/0x7*(-parseInt(_0x3cd1b0(0xd2))/0x8)+parseInt(_0x3cd1b0(0x88))/0x9*(parseInt(_0x3cd1b0(0xb7))/0xa);if(_0x130f28===_0x1afc65)break;else _0x43eee4['push'](_0x43eee4['shift']());}catch(_0x3303ad){_0x43eee4['push'](_0x43eee4['shift']());}}}(a37_0x5b91,0x90a6a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a37_0x3e40(_0x3ea2d4,_0x57c618){_0x3ea2d4=_0x3ea2d4-0x88;const _0x5b91af=a37_0x5b91();let _0x3e4080=_0x5b91af[_0x3ea2d4];return _0x3e4080;}function a37_0x5b91(){const _0x39fdd5=['filePath','/api/management/library/scripts/save','alias','operationType','1763367sCjAQu','appCode','map','attempted','2473720ZKtFbG','Cannot\x20resolve\x20dataset\x20for\x20\x22',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','3966156OjCKkF','stringify','parse','version','No\x20local\x20Backend\x20Function\x20scripts\x20found.','write','125973ghWjzr','length','runtime\x20cache\x20cleared','code','update','1133575WAYCUr','Run\x20`','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','bool','7rxkbLb','apiDir','bff','description','COMMON','name','Incomplete\x20HOOK\x20path:\x20','every','lockKey','message','lockFilePath','Lock\x20scope\x20for\x20app\x20\x22','some','Would\x20inspect\x20','hash','apps','5065368sHuokD','create','unchanged','aliasToDatasetCode','filter','\x22\x20not\x20found\x20after\x20ensureLockScope.','4tCdTJI','\x20skipped,\x20','validation','ENDPOINT','runtime\x20cache\x20not\x20needed','5569565OYhzTd','values','has','boolean','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','datasetId','functionNode','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','POST','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x20failed,\x20','660hWUIRh','remoteId','HOOK','get','scriptsRoot','push','functions','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','lastSync','set','force','str','datasetCode','would_push','cleared','toISOString','Push\x20only\x20this\x20script\x20type','type','status'];a37_0x5b91=function(){return _0x39fdd5;};return a37_0x5b91();}import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x479c63(0x93),'command':a37_0x479c63(0xbc),'description':a37_0x479c63(0xb0),'risk':a37_0x479c63(0xda),'flags':[{'name':'type','type':'string','description':a37_0x479c63(0xc7),'enum':[a37_0x479c63(0x95),a37_0x479c63(0xaa),a37_0x479c63(0xb9)]},{'name':a37_0x479c63(0x96),'type':'string','description':a37_0x479c63(0x8f)},{'name':a37_0x479c63(0xc1),'type':a37_0x479c63(0xaf),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x415aa1){const _0x36ddfd=a37_0x479c63,_0x2651ac=loadBffProjectConfig(_0x415aa1[_0x36ddfd(0xcf)]),_0x199723=await readBffLockFile(_0x2651ac[_0x36ddfd(0x9b)]),{appLock:_0x294742}=ensureLockScope(_0x199723??createEmptyBffLock(),_0x415aa1['appCode'],_0x2651ac[_0x36ddfd(0xbb)],'push'),_0x5168d1=await getTargetFunctions(_0x2651ac,_0x415aa1),_0x3a388c=_0x415aa1[_0x36ddfd(0x90)]('force'),_0x355ac3=[],_0x5ef51c=[];for(const _0x486bdb of _0x5168d1){const _0x249c87=await computeFileHash(_0x486bdb[_0x36ddfd(0xca)]),_0x2b25c7=_0x294742['functions'][_0x486bdb['lockKey']],_0x532dfd=!!_0x2b25c7&&_0x2b25c7[_0x36ddfd(0x9f)]===_0x249c87,_0x5446e2=!_0x3a388c&&_0x532dfd?_0x36ddfd(0xa3):_0x36ddfd(0xc4);_0x355ac3[_0x36ddfd(0xbc)]({'lockKey':_0x486bdb[_0x36ddfd(0x99)],'filePath':_0x486bdb[_0x36ddfd(0xca)],'remoteId':_0x2b25c7?.['remoteId']??null,'mode':_0x2b25c7?.[_0x36ddfd(0xb8)]?_0x36ddfd(0x8c):_0x36ddfd(0xa2),'status':_0x5446e2});if(_0x5446e2===_0x36ddfd(0xc4))_0x5ef51c[_0x36ddfd(0xbc)](_0x486bdb[_0x36ddfd(0x96)]);}return{'method':_0x36ddfd(0xb4),'url':_0x36ddfd(0xcb),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x36ddfd(0x93),_0x5ef51c),'body':{'appCode':_0x415aa1[_0x36ddfd(0xcf)],'force':_0x3a388c,'files':_0x355ac3,'cacheClearAtRuntime':_0x355ac3[_0x36ddfd(0x9d)](_0x5d8ec8=>_0x5d8ec8[_0x36ddfd(0xc9)]==='would_push'),'cacheClearAtRuntimeTimes':_0x355ac3[_0x36ddfd(0x9d)](_0x496ad8=>_0x496ad8[_0x36ddfd(0xc9)]===_0x36ddfd(0xc4))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x36ddfd(0x9e)+_0x355ac3[_0x36ddfd(0x89)]+'\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x543f10){const _0x554e53=a37_0x479c63,_0x8fa122=loadBffProjectConfig(_0x543f10[_0x554e53(0xcf)]),_0x6453c1=await readBffLockFile(_0x8fa122[_0x554e53(0x9b)]),{lockData:_0x59cb50,appLock:_0x59085a}=ensureLockScope(_0x6453c1??createEmptyBffLock(),_0x543f10[_0x554e53(0xcf)],_0x8fa122[_0x554e53(0xbb)],'push'),_0x27bb90=await getTargetFunctions(_0x8fa122,_0x543f10);if(_0x27bb90[_0x554e53(0x89)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x554e53(0xd9)};const _0x4d4afc=_0x543f10['bool'](_0x554e53(0xc1)),_0x4746fd=JSON[_0x554e53(0xd7)](JSON[_0x554e53(0xd6)](_0x59cb50)),_0x942483=_0x4746fd[_0x554e53(0xa0)][_0x543f10[_0x554e53(0xcf)]];if(!_0x942483)throw new Error(_0x554e53(0x9c)+_0x543f10[_0x554e53(0xcf)]+_0x554e53(0xa6));const _0x565f02=await buildHookMaps(_0x543f10[_0x554e53(0xcf)],_0x543f10[_0x554e53(0x92)],_0x27bb90,_0x942483),_0x38dbdb=[],_0x4e590b=[],_0xd9d1eb=[],_0x38276f=[];for(const _0x1abb63 of _0x27bb90){const _0x179e14=await computeFileHash(_0x1abb63['filePath']),_0x4eccdd=_0x942483[_0x554e53(0xbd)][_0x1abb63[_0x554e53(0x99)]];if(!_0x4d4afc&&_0x4eccdd&&_0x4eccdd[_0x554e53(0x9f)]===_0x179e14){_0xd9d1eb[_0x554e53(0xbc)]({'lockKey':_0x1abb63[_0x554e53(0x99)],'reason':_0x554e53(0xa3)});continue;}try{await uploadSingleFunction(_0x543f10['appCode'],_0x1abb63,_0x942483,_0x565f02);const _0x220a67=_0x942483['functions'][_0x1abb63[_0x554e53(0x99)]];_0x38dbdb[_0x554e53(0xbc)]({'lockKey':_0x1abb63[_0x554e53(0x99)],'remoteId':_0x220a67?.[_0x554e53(0xb8)]??0x0}),_0x4e590b[_0x554e53(0xbc)](_0x1abb63[_0x554e53(0x96)]);}catch(_0x1a39ea){_0x38276f[_0x554e53(0xbc)]({'lockKey':_0x1abb63['lockKey'],'error':_0x1a39ea instanceof Error?_0x1a39ea[_0x554e53(0x9a)]:String(_0x1a39ea)});}}_0x942483[_0x554e53(0xbf)]=new Date()[_0x554e53(0xc6)](),await writeBffLockFile(_0x8fa122[_0x554e53(0x9b)],_0x4746fd),await waitForUploadedLockEntries(_0x8fa122[_0x554e53(0x9b)],_0x543f10['appCode'],_0x38dbdb[_0x554e53(0xd0)](_0x367afd=>_0x367afd[_0x554e53(0x99)]));let _0x48908c={'attempted':![],'cleared':![]};if(_0x38dbdb[_0x554e53(0x89)]>0x0)try{let _0x39301e='';for(let _0xbd0084=0x0;_0xbd0084<CACHE_CLEAR_ATTEMPTS;_0xbd0084+=0x1){_0x39301e=await clearBffScriptCache(),_0xbd0084<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x48908c={'attempted':!![],'cleared':!![],'message':_0x39301e||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x551ef2){_0x48908c={'attempted':!![],'cleared':![],'error':_0x551ef2 instanceof Error?_0x551ef2['message']:String(_0x551ef2)};}const _0x3d7f89=_0x38276f['length']===0x0&&(_0x48908c[_0x554e53(0xd1)]?_0x48908c['cleared']:!![]),_0x1060ab=await runAutomaticDeploymentSync(_0x543f10,_0x554e53(0x93),_0x4e590b,_0x3d7f89),_0x4b211f=_0x3d7f89&&automaticDeploymentSyncSucceeded(_0x1060ab),_0x1dd007=_0x48908c[_0x554e53(0xd1)]?_0x48908c[_0x554e53(0xc5)]?_0x554e53(0x8a):'runtime\x20cache\x20clear\x20failed':_0x554e53(0xab),_0x307dc5=',\x20deployment\x20sync\x20'+_0x1060ab[_0x554e53(0xc9)];return{'ok':_0x4b211f,'data':{'uploaded':_0x38dbdb,'skipped':_0xd9d1eb,'failed':_0x38276f,'cacheClear':_0x48908c,'deploymentSync':_0x1060ab},'message':'Push\x20complete:\x20'+_0x38dbdb['length']+'\x20uploaded,\x20'+_0xd9d1eb['length']+_0x554e53(0xa8)+_0x38276f['length']+_0x554e53(0xb6)+_0x1dd007+_0x307dc5};}};async function getTargetFunctions(_0x348554,_0x1535c9){const _0x5ea6ea=a37_0x479c63,_0x34d60b=_0x1535c9['str'](_0x5ea6ea(0xc8)),_0x3a1e7e=_0x1535c9[_0x5ea6ea(0xc2)](_0x5ea6ea(0x96)),_0x3bfe4b=normalizeBffType(_0x34d60b)??undefined;if(_0x3a1e7e&&!_0x3bfe4b)throw CliErrors[_0x5ea6ea(0xa9)](_0x5ea6ea(0xbe));const _0x4eadaf=await scanLocalBffFunctions(_0x348554,_0x3bfe4b);if(_0x3a1e7e){const _0x1caaf5=_0x4eadaf[_0x5ea6ea(0xa5)](_0xc7ed0f=>_0xc7ed0f[_0x5ea6ea(0x96)]===_0x3a1e7e);if(_0x1caaf5['length']===0x0)throw CliErrors[_0x5ea6ea(0xa9)]('Local\x20function\x20not\x20found:\x20'+_0x3bfe4b+'/'+_0x3a1e7e);return _0x1caaf5;}return _0x4eadaf;}async function buildHookMaps(_0x11c0a0,_0x1e6111,_0x2ad770,_0x106652){const _0xcf1aac=a37_0x479c63,_0x38acad=_0x2ad770[_0xcf1aac(0x9d)](_0x51e1d6=>_0x51e1d6[_0xcf1aac(0xc8)]==='HOOK');if(!_0x38acad)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5de4d3=loadAliasMap(_0x1e6111,undefined,resolveApiFilePath(_0x1e6111,_0x11c0a0)),_0x43d367=new Map(_0x5de4d3[_0xcf1aac(0xd0)](_0x44479e=>[_0x44479e['alias'],_0x44479e['datasetCode']]));for(const _0x4fc664 of Object[_0xcf1aac(0xad)](_0x106652['functions'])){_0x4fc664['alias']&&_0x4fc664['datasetCode']&&!_0x43d367[_0xcf1aac(0xae)](_0x4fc664[_0xcf1aac(0xcc)])&&_0x43d367[_0xcf1aac(0xc0)](_0x4fc664[_0xcf1aac(0xcc)],_0x4fc664[_0xcf1aac(0xc3)]);}const _0x5720bb=await listDatasets(_0x11c0a0),_0x3ca05a=new Map(_0x5720bb[_0xcf1aac(0xd0)](_0x3ec158=>[_0x3ec158[_0xcf1aac(0x8b)],_0x3ec158]));return{'aliasToDatasetCode':_0x43d367,'datasetCodeToDataset':_0x3ca05a};}async function uploadSingleFunction(_0x6c37c1,_0x2ecd19,_0x104d68,_0x5bcaf6){const _0x450ac6=a37_0x479c63,_0x438f83=await readFile(_0x2ecd19[_0x450ac6(0xca)],'utf8'),_0x49c118=await computeFileHash(_0x2ecd19[_0x450ac6(0xca)]),_0x3c6cf9=_0x104d68['functions'][_0x2ecd19[_0x450ac6(0x99)]];if(_0x3c6cf9?.['remoteId']&&_0x3c6cf9[_0x450ac6(0xd8)]==null)throw CliErrors['validation'](_0x2ecd19[_0x450ac6(0x99)]+_0x450ac6(0xd4));let _0x50f306=extractScriptDescription(_0x438f83);if(!_0x50f306&&_0x3c6cf9?.[_0x450ac6(0xb8)]){const _0x57f258=await getBffScriptInfo(_0x3c6cf9[_0x450ac6(0xb8)]);_0x50f306=_0x57f258[_0x450ac6(0x94)]||undefined;}const _0x3a657e={'appCode':_0x6c37c1,'functionName':_0x2ecd19['name'],'scriptType':_0x2ecd19[_0x450ac6(0xc8)],'scriptContent':_0x438f83};if(_0x3c6cf9?.[_0x450ac6(0xb8)])_0x3a657e['id']=_0x3c6cf9[_0x450ac6(0xb8)];if(_0x3c6cf9?.[_0x450ac6(0xd8)]!=null)_0x3a657e[_0x450ac6(0xd8)]=_0x3c6cf9[_0x450ac6(0xd8)];if(_0x50f306)_0x3a657e[_0x450ac6(0x94)]=_0x50f306;if(_0x2ecd19[_0x450ac6(0xc8)]===_0x450ac6(0xb9)){const _0x55b4c3=_0x2ecd19['alias'];if(!_0x55b4c3||!_0x2ecd19[_0x450ac6(0xcd)]||!_0x2ecd19[_0x450ac6(0xb2)])throw CliErrors[_0x450ac6(0xa9)](_0x450ac6(0x97)+_0x2ecd19[_0x450ac6(0x99)]);const _0x5acad4=_0x5bcaf6[_0x450ac6(0xa4)][_0x450ac6(0xba)](_0x55b4c3)??_0x3c6cf9?.['datasetCode']??_0x55b4c3,_0x309eed=_0x5bcaf6['datasetCodeToDataset'][_0x450ac6(0xba)](_0x5acad4);if(!_0x309eed)throw CliErrors['validation'](_0x450ac6(0xd3)+_0x55b4c3+'\x22.\x20'+(_0x450ac6(0x8e)+CLI_BIN_NAME+_0x450ac6(0xb3)));_0x3a657e[_0x450ac6(0xb1)]=_0x309eed['id'],_0x3a657e[_0x450ac6(0xcd)]=_0x2ecd19['operationType'],_0x3a657e[_0x450ac6(0xb2)]=_0x2ecd19[_0x450ac6(0xb2)];}const _0x4e9f4b=await saveBffScript(_0x3a657e),_0x4f246c=_0x4e9f4b['id'],_0x257d4b=_0x4e9f4b['script']??await getBffScriptInfo(_0x4f246c),_0xea4a67={'hash':_0x49c118,'remoteId':_0x4f246c,'version':_0x257d4b[_0x450ac6(0xd8)]};if(_0x2ecd19['type']===_0x450ac6(0xb9)){const _0x34220a=_0x2ecd19[_0x450ac6(0xcc)],_0x10506c=_0x5bcaf6['aliasToDatasetCode'][_0x450ac6(0xba)](_0x34220a)??_0x3c6cf9?.[_0x450ac6(0xc3)]??_0x34220a;_0x5bcaf6[_0x450ac6(0xa4)][_0x450ac6(0xae)](_0x34220a)?_0xea4a67[_0x450ac6(0xcc)]=_0x34220a:_0xea4a67[_0x450ac6(0xcc)]=_0x3c6cf9?.[_0x450ac6(0xcc)],_0xea4a67[_0x450ac6(0xc3)]=_0x10506c,_0xea4a67[_0x450ac6(0xcd)]=_0x2ecd19[_0x450ac6(0xcd)],_0xea4a67['functionNode']=_0x2ecd19['functionNode'];}_0x104d68[_0x450ac6(0xbd)][_0x2ecd19[_0x450ac6(0x99)]]=_0xea4a67;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x428dd7,_0x580812,_0x5064ff){const _0x203004=a37_0x479c63;if(_0x5064ff[_0x203004(0x89)]===0x0)return;for(let _0x502b9c=0x0;_0x502b9c<LOCK_SETTLE_RETRY_COUNT;_0x502b9c+=0x1){const _0x5f33d4=await readBffLockFile(_0x428dd7),_0x54bee2=_0x5f33d4?.[_0x203004(0xa0)]?.[_0x580812]?.[_0x203004(0xbd)]??{},_0x403718=_0x5064ff[_0x203004(0x98)](_0x558514=>!!_0x54bee2[_0x558514]?.[_0x203004(0xb8)]);if(_0x403718)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x203004(0xb5)+_0x5064ff['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x5080b8=a37_0x9607;(function(_0x22eaf8,_0xe1ef73){const _0xac72e4=a37_0x9607,_0x42b767=_0x22eaf8();while(!![]){try{const _0x4ffd24=-parseInt(_0xac72e4(0x1dc))/0x1+-parseInt(_0xac72e4(0x1bf))/0x2*(parseInt(_0xac72e4(0x1dd))/0x3)+parseInt(_0xac72e4(0x1ab))/0x4+-parseInt(_0xac72e4(0x19d))/0x5+-parseInt(_0xac72e4(0x1ca))/0x6*(parseInt(_0xac72e4(0x1b4))/0x7)+parseInt(_0xac72e4(0x1c0))/0x8+parseInt(_0xac72e4(0x198))/0x9*(parseInt(_0xac72e4(0x1b6))/0xa);if(_0x4ffd24===_0xe1ef73)break;else _0x42b767['push'](_0x42b767['shift']());}catch(_0x1500f5){_0x42b767['push'](_0x42b767['shift']());}}}(a37_0x3d62,0x25956));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a37_0x3d62(){const _0x2db308=['status','script','operationType','force','bff','values','7210CRDFSp','5178hUqrJd','map','update','appCode','utf8','some','push','\x20skipped,\x20','aliasToDatasetCode','description','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','datasetCodeToDataset','scriptsRoot','lockFilePath','Force\x20push\x20ignoring\x20hash\x20protection','Run\x20`','every','333nfPeSi','join','code','datasetId','Incomplete\x20HOOK\x20path:\x20','1398730fDwhVj','write','type','create','POST','Cannot\x20resolve\x20dataset\x20for\x20\x22','get','runtime\x20cache\x20clear\x20failed','cleared','runtime\x20cache\x20cleared','runtime\x20cache\x20not\x20needed','filePath','\x20uploaded,\x20','Would\x20inspect\x20','42744lnpQgZ','datasetCode','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','Runtime\x20script\x20cache\x20cleared.','remoteId','parse','Push\x20complete:\x20','string','version','502411DCMdfm',',\x20deployment\x20sync\x20','176830VASSXf','set','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','message','functionNode','alias','lastSync','\x22.\x20','boolean','300tHDcfh','1427096xvJySM','lockKey','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','Lock\x20scope\x20for\x20app\x20\x22','name','bool','COMMON','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','toISOString','12eCLiSm','apiDir','apps','attempted','functions','has','would_push','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','str','\x22\x20not\x20found\x20after\x20ensureLockScope.','validation','HOOK'];a37_0x3d62=function(){return _0x2db308;};return a37_0x3d62();}import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x5080b8(0x18d),'description':a37_0x5080b8(0x1d1),'risk':a37_0x5080b8(0x19e),'flags':[{'name':a37_0x5080b8(0x19f),'type':a37_0x5080b8(0x1b2),'description':'Push\x20only\x20this\x20script\x20type','enum':[a37_0x5080b8(0x1c7),'ENDPOINT','HOOK']},{'name':a37_0x5080b8(0x1c5),'type':a37_0x5080b8(0x1b2),'description':a37_0x5080b8(0x191)},{'name':a37_0x5080b8(0x1d9),'type':a37_0x5080b8(0x1be),'description':a37_0x5080b8(0x195)}],async 'dryRun'(_0x214844){const _0x36a43e=a37_0x5080b8,_0x584a05=loadBffProjectConfig(_0x214844[_0x36a43e(0x1e0)]),_0x5d3b58=await readBffLockFile(_0x584a05['lockFilePath']),{appLock:_0x4f67a9}=ensureLockScope(_0x5d3b58??createEmptyBffLock(),_0x214844['appCode'],_0x584a05[_0x36a43e(0x193)],'push'),_0x2f0978=await getTargetFunctions(_0x584a05,_0x214844),_0x41e901=_0x214844[_0x36a43e(0x1c6)](_0x36a43e(0x1d9)),_0xd7c300=[],_0x18c45e=[];for(const _0x19763b of _0x2f0978){const _0x4bbb48=await computeFileHash(_0x19763b[_0x36a43e(0x1a8)]),_0x3ef21e=_0x4f67a9[_0x36a43e(0x1ce)][_0x19763b[_0x36a43e(0x1c1)]],_0x7856=!!_0x3ef21e&&_0x3ef21e['hash']===_0x4bbb48,_0x469930=!_0x41e901&&_0x7856?'unchanged':_0x36a43e(0x1d0);_0xd7c300[_0x36a43e(0x18d)]({'lockKey':_0x19763b[_0x36a43e(0x1c1)],'filePath':_0x19763b[_0x36a43e(0x1a8)],'remoteId':_0x3ef21e?.[_0x36a43e(0x1af)]??null,'mode':_0x3ef21e?.[_0x36a43e(0x1af)]?_0x36a43e(0x1df):_0x36a43e(0x1a0),'status':_0x469930});if(_0x469930===_0x36a43e(0x1d0))_0x18c45e[_0x36a43e(0x18d)](_0x19763b[_0x36a43e(0x1c5)]);}return{'method':_0x36a43e(0x1a1),'url':'/api/management/library/scripts/save','deploymentSync':buildAutomaticDeploymentSyncPreview(_0x36a43e(0x1da),_0x18c45e),'body':{'appCode':_0x214844[_0x36a43e(0x1e0)],'force':_0x41e901,'files':_0xd7c300,'cacheClearAtRuntime':_0xd7c300[_0x36a43e(0x1e2)](_0x1357fe=>_0x1357fe[_0x36a43e(0x1d6)]===_0x36a43e(0x1d0)),'cacheClearAtRuntimeTimes':_0xd7c300[_0x36a43e(0x1e2)](_0x155583=>_0x155583[_0x36a43e(0x1d6)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x36a43e(0x1aa)+_0xd7c300[_0x36a43e(0x1c2)]+_0x36a43e(0x1ad)};},async 'execute'(_0x3727a0){const _0x45af42=a37_0x5080b8,_0x1e6e79=loadBffProjectConfig(_0x3727a0[_0x45af42(0x1e0)]),_0xf00cda=await readBffLockFile(_0x1e6e79['lockFilePath']),{lockData:_0x161ef9,appLock:_0x15646d}=ensureLockScope(_0xf00cda??createEmptyBffLock(),_0x3727a0[_0x45af42(0x1e0)],_0x1e6e79[_0x45af42(0x193)],_0x45af42(0x18d)),_0x5d0a63=await getTargetFunctions(_0x1e6e79,_0x3727a0);if(_0x5d0a63['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x45af42(0x1c3)};const _0x5e62f3=_0x3727a0[_0x45af42(0x1c6)](_0x45af42(0x1d9)),_0x595a95=JSON[_0x45af42(0x1b0)](JSON['stringify'](_0x161ef9)),_0x48f64e=_0x595a95[_0x45af42(0x1cc)][_0x3727a0['appCode']];if(!_0x48f64e)throw new Error(_0x45af42(0x1c4)+_0x3727a0[_0x45af42(0x1e0)]+_0x45af42(0x1d3));const _0x333bb4=await buildHookMaps(_0x3727a0['appCode'],_0x3727a0[_0x45af42(0x1cb)],_0x5d0a63,_0x48f64e),_0x9b7d81=[],_0x3e64fd=[],_0x1abc64=[],_0x1f9105=[];for(const _0x5050ab of _0x5d0a63){const _0xaba31=await computeFileHash(_0x5050ab[_0x45af42(0x1a8)]),_0x3a6735=_0x48f64e['functions'][_0x5050ab['lockKey']];if(!_0x5e62f3&&_0x3a6735&&_0x3a6735['hash']===_0xaba31){_0x1abc64['push']({'lockKey':_0x5050ab[_0x45af42(0x1c1)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x3727a0[_0x45af42(0x1e0)],_0x5050ab,_0x48f64e,_0x333bb4);const _0x44ae83=_0x48f64e[_0x45af42(0x1ce)][_0x5050ab[_0x45af42(0x1c1)]];_0x9b7d81[_0x45af42(0x18d)]({'lockKey':_0x5050ab['lockKey'],'remoteId':_0x44ae83?.['remoteId']??0x0}),_0x3e64fd[_0x45af42(0x18d)](_0x5050ab[_0x45af42(0x1c5)]);}catch(_0x2fc739){_0x1f9105[_0x45af42(0x18d)]({'lockKey':_0x5050ab[_0x45af42(0x1c1)],'error':_0x2fc739 instanceof Error?_0x2fc739[_0x45af42(0x1b9)]:String(_0x2fc739)});}}_0x48f64e[_0x45af42(0x1bc)]=new Date()[_0x45af42(0x1c9)](),await writeBffLockFile(_0x1e6e79[_0x45af42(0x194)],_0x595a95),await waitForUploadedLockEntries(_0x1e6e79[_0x45af42(0x194)],_0x3727a0['appCode'],_0x9b7d81[_0x45af42(0x1de)](_0x11e51b=>_0x11e51b[_0x45af42(0x1c1)]));let _0x20afde={'attempted':![],'cleared':![]};if(_0x9b7d81['length']>0x0)try{let _0x33b092='';for(let _0x518763=0x0;_0x518763<CACHE_CLEAR_ATTEMPTS;_0x518763+=0x1){_0x33b092=await clearBffScriptCache(),_0x518763<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x20afde={'attempted':!![],'cleared':!![],'message':_0x33b092||_0x45af42(0x1ae)};}catch(_0x299fd1){_0x20afde={'attempted':!![],'cleared':![],'error':_0x299fd1 instanceof Error?_0x299fd1[_0x45af42(0x1b9)]:String(_0x299fd1)};}const _0x14f4a8=_0x1f9105[_0x45af42(0x1c2)]===0x0&&(_0x20afde[_0x45af42(0x1cd)]?_0x20afde[_0x45af42(0x1a5)]:!![]),_0x5e4e67=await runAutomaticDeploymentSync(_0x3727a0,'bff',_0x3e64fd,_0x14f4a8),_0x1752e4=_0x14f4a8&&automaticDeploymentSyncSucceeded(_0x5e4e67),_0x1f1267=_0x20afde[_0x45af42(0x1cd)]?_0x20afde['cleared']?_0x45af42(0x1a6):_0x45af42(0x1a4):_0x45af42(0x1a7),_0x81e6e7=_0x45af42(0x1b5)+_0x5e4e67[_0x45af42(0x1d6)];return{'ok':_0x1752e4,'data':{'uploaded':_0x9b7d81,'skipped':_0x1abc64,'failed':_0x1f9105,'cacheClear':_0x20afde,'deploymentSync':_0x5e4e67},'message':_0x45af42(0x1b1)+_0x9b7d81[_0x45af42(0x1c2)]+_0x45af42(0x1a9)+_0x1abc64[_0x45af42(0x1c2)]+_0x45af42(0x18e)+_0x1f9105['length']+'\x20failed,\x20'+_0x1f1267+_0x81e6e7};}};async function getTargetFunctions(_0x2e15f0,_0x54854f){const _0x13f2bd=a37_0x5080b8,_0x4307df=_0x54854f[_0x13f2bd(0x1d2)](_0x13f2bd(0x19f)),_0x394dbf=_0x54854f[_0x13f2bd(0x1d2)](_0x13f2bd(0x1c5)),_0x3c283d=normalizeBffType(_0x4307df)??undefined;if(_0x394dbf&&!_0x3c283d)throw CliErrors[_0x13f2bd(0x1d4)](_0x13f2bd(0x1c8));const _0x3e2d0f=await scanLocalBffFunctions(_0x2e15f0,_0x3c283d);if(_0x394dbf){const _0x2ac994=_0x3e2d0f['filter'](_0xe7fe29=>_0xe7fe29[_0x13f2bd(0x1c5)]===_0x394dbf);if(_0x2ac994[_0x13f2bd(0x1c2)]===0x0)throw CliErrors['validation']('Local\x20function\x20not\x20found:\x20'+_0x3c283d+'/'+_0x394dbf);return _0x2ac994;}return _0x3e2d0f;}async function buildHookMaps(_0x2e0be0,_0x1b0e14,_0x2bee8e,_0x5549ed){const _0x478d6c=a37_0x5080b8,_0x264554=_0x2bee8e[_0x478d6c(0x1e2)](_0x5d8343=>_0x5d8343[_0x478d6c(0x19f)]==='HOOK');if(!_0x264554)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x371230=loadAliasMap(_0x1b0e14,undefined,resolveApiFilePath(_0x1b0e14,_0x2e0be0)),_0x56f09a=new Map(_0x371230['map'](_0x45f8ba=>[_0x45f8ba[_0x478d6c(0x1bb)],_0x45f8ba[_0x478d6c(0x1ac)]]));for(const _0x31db04 of Object[_0x478d6c(0x1db)](_0x5549ed[_0x478d6c(0x1ce)])){_0x31db04[_0x478d6c(0x1bb)]&&_0x31db04['datasetCode']&&!_0x56f09a[_0x478d6c(0x1cf)](_0x31db04['alias'])&&_0x56f09a[_0x478d6c(0x1b7)](_0x31db04[_0x478d6c(0x1bb)],_0x31db04['datasetCode']);}const _0x3c7a17=await listDatasets(_0x2e0be0),_0x5c9acc=new Map(_0x3c7a17[_0x478d6c(0x1de)](_0x15d7bc=>[_0x15d7bc[_0x478d6c(0x19a)],_0x15d7bc]));return{'aliasToDatasetCode':_0x56f09a,'datasetCodeToDataset':_0x5c9acc};}async function uploadSingleFunction(_0x5598d0,_0x1a8542,_0x591547,_0x2d6352){const _0x36d819=a37_0x5080b8,_0x187437=await readFile(_0x1a8542[_0x36d819(0x1a8)],_0x36d819(0x1e1)),_0x56bb1a=await computeFileHash(_0x1a8542['filePath']),_0x440b07=_0x591547[_0x36d819(0x1ce)][_0x1a8542['lockKey']];if(_0x440b07?.[_0x36d819(0x1af)]&&_0x440b07[_0x36d819(0x1b3)]==null)throw CliErrors[_0x36d819(0x1d4)](_0x1a8542[_0x36d819(0x1c1)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x26ddbd=extractScriptDescription(_0x187437);if(!_0x26ddbd&&_0x440b07?.[_0x36d819(0x1af)]){const _0x53bc03=await getBffScriptInfo(_0x440b07['remoteId']);_0x26ddbd=_0x53bc03['description']||undefined;}const _0x5532bd={'appCode':_0x5598d0,'functionName':_0x1a8542[_0x36d819(0x1c5)],'scriptType':_0x1a8542['type'],'scriptContent':_0x187437};if(_0x440b07?.[_0x36d819(0x1af)])_0x5532bd['id']=_0x440b07[_0x36d819(0x1af)];if(_0x440b07?.['version']!=null)_0x5532bd['version']=_0x440b07['version'];if(_0x26ddbd)_0x5532bd[_0x36d819(0x190)]=_0x26ddbd;if(_0x1a8542[_0x36d819(0x19f)]===_0x36d819(0x1d5)){const _0x265df4=_0x1a8542[_0x36d819(0x1bb)];if(!_0x265df4||!_0x1a8542[_0x36d819(0x1d8)]||!_0x1a8542[_0x36d819(0x1ba)])throw CliErrors[_0x36d819(0x1d4)](_0x36d819(0x19c)+_0x1a8542['lockKey']);const _0x5623de=_0x2d6352[_0x36d819(0x18f)][_0x36d819(0x1a3)](_0x265df4)??_0x440b07?.[_0x36d819(0x1ac)]??_0x265df4,_0x37023b=_0x2d6352[_0x36d819(0x192)]['get'](_0x5623de);if(!_0x37023b)throw CliErrors[_0x36d819(0x1d4)](_0x36d819(0x1a2)+_0x265df4+_0x36d819(0x1bd)+(_0x36d819(0x196)+CLI_BIN_NAME+_0x36d819(0x1b8)));_0x5532bd[_0x36d819(0x19b)]=_0x37023b['id'],_0x5532bd['operationType']=_0x1a8542[_0x36d819(0x1d8)],_0x5532bd[_0x36d819(0x1ba)]=_0x1a8542['functionNode'];}const _0x43a66f=await saveBffScript(_0x5532bd),_0x37f31a=_0x43a66f['id'],_0x5dfa50=_0x43a66f[_0x36d819(0x1d7)]??await getBffScriptInfo(_0x37f31a),_0x7a5e9d={'hash':_0x56bb1a,'remoteId':_0x37f31a,'version':_0x5dfa50[_0x36d819(0x1b3)]};if(_0x1a8542['type']===_0x36d819(0x1d5)){const _0x314b13=_0x1a8542['alias'],_0x4734a9=_0x2d6352['aliasToDatasetCode'][_0x36d819(0x1a3)](_0x314b13)??_0x440b07?.[_0x36d819(0x1ac)]??_0x314b13;_0x2d6352[_0x36d819(0x18f)][_0x36d819(0x1cf)](_0x314b13)?_0x7a5e9d[_0x36d819(0x1bb)]=_0x314b13:_0x7a5e9d[_0x36d819(0x1bb)]=_0x440b07?.[_0x36d819(0x1bb)],_0x7a5e9d[_0x36d819(0x1ac)]=_0x4734a9,_0x7a5e9d[_0x36d819(0x1d8)]=_0x1a8542[_0x36d819(0x1d8)],_0x7a5e9d[_0x36d819(0x1ba)]=_0x1a8542[_0x36d819(0x1ba)];}_0x591547[_0x36d819(0x1ce)][_0x1a8542['lockKey']]=_0x7a5e9d;}function a37_0x9607(_0x36835c,_0x41bb77){_0x36835c=_0x36835c-0x18d;const _0x3d6219=a37_0x3d62();let _0x960775=_0x3d6219[_0x36835c];return _0x960775;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x34ab2a,_0xfb1aa1,_0x2e707a){const _0x38a989=a37_0x5080b8;if(_0x2e707a['length']===0x0)return;for(let _0x3d6aa5=0x0;_0x3d6aa5<LOCK_SETTLE_RETRY_COUNT;_0x3d6aa5+=0x1){const _0x12b451=await readBffLockFile(_0x34ab2a),_0x4ae598=_0x12b451?.[_0x38a989(0x1cc)]?.[_0xfb1aa1]?.[_0x38a989(0x1ce)]??{},_0x1f5209=_0x2e707a[_0x38a989(0x197)](_0x2f0ab0=>!!_0x4ae598[_0x2f0ab0]?.[_0x38a989(0x1af)]);if(_0x1f5209)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x2e707a[_0x38a989(0x199)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a38_0x10d9a2=a38_0x2555;(function(_0x48aad2,_0x1fef3e){const _0x34fd0a=a38_0x2555,_0xe46b53=_0x48aad2();while(!![]){try{const _0x2c17d9=-parseInt(_0x34fd0a(0x127))/0x1*(-parseInt(_0x34fd0a(0x142))/0x2)+-parseInt(_0x34fd0a(0x12e))/0x3+-parseInt(_0x34fd0a(0x12b))/0x4+parseInt(_0x34fd0a(0x136))/0x5+-parseInt(_0x34fd0a(0x13f))/0x6+-parseInt(_0x34fd0a(0x13b))/0x7+parseInt(_0x34fd0a(0x12a))/0x8;if(_0x2c17d9===_0x1fef3e)break;else _0xe46b53['push'](_0xe46b53['shift']());}catch(_0x1c98df){_0xe46b53['push'](_0xe46b53['shift']());}}}(a38_0x4ebd,0x87717));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a38_0x2555(_0x537845,_0xb022cb){_0x537845=_0x537845-0x125;const _0x4ebdfa=a38_0x4ebd();let _0x2555f4=_0x4ebdfa[_0x537845];return _0x2555f4;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a38_0x4ebd(){const _0x3ccb1a=['All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','filePath','hash','5082190lreJDz','\x20modified,\x20','all','appCode','lockFilePath','833539zkQPFY','length','functions','read','2479692SdPRZU','map','push','2bbDwxQ','\x20remote-only','boolean','scriptsRoot','748633ktWkEA','status','has','7444200DvDnQb','3338092ZwXbuU','lockKey','remote','2321817mCGGBw','\x20added,\x20','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','apiDir'];a38_0x4ebd=function(){return _0x3ccb1a;};return a38_0x4ebd();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':'status','description':a38_0x10d9a2(0x130),'risk':a38_0x10d9a2(0x13e),'flags':[{'name':'remote','type':a38_0x10d9a2(0x125),'description':a38_0x10d9a2(0x133)}],async 'execute'(_0x328077){const _0x15d9b6=a38_0x10d9a2,_0x365fe7=loadBffProjectConfig(_0x328077['appCode']),_0x354160=await readBffLockFile(_0x365fe7[_0x15d9b6(0x13a)]),{appLock:_0x2de967}=ensureLockScope(_0x354160??createEmptyBffLock(),_0x328077[_0x15d9b6(0x139)],_0x365fe7[_0x15d9b6(0x126)],_0x15d9b6(0x128)),_0x435b42=await scanLocalBffFunctions(_0x365fe7),_0x4360b7=[],_0x3453ce=[],_0x24e394=[];for(const _0x50e136 of _0x435b42){const _0x58caa8=await computeFileHash(_0x50e136[_0x15d9b6(0x134)]),_0x53b838=_0x2de967[_0x15d9b6(0x13d)][_0x50e136['lockKey']];if(!_0x53b838)_0x4360b7[_0x15d9b6(0x141)](_0x50e136[_0x15d9b6(0x12c)]);else _0x53b838[_0x15d9b6(0x135)]!==_0x58caa8?_0x3453ce[_0x15d9b6(0x141)](_0x50e136[_0x15d9b6(0x12c)]):_0x24e394['push'](_0x50e136[_0x15d9b6(0x12c)]);}const _0x89e215=[];if(_0x328077['bool'](_0x15d9b6(0x12d))){const _0x10c41a=loadAliasMap(_0x328077['apiDir'],undefined,resolveApiFilePath(_0x328077[_0x15d9b6(0x131)],_0x328077[_0x15d9b6(0x139)])),_0x52c1c4=new Map(_0x10c41a[_0x15d9b6(0x140)](_0x2b9b44=>[_0x2b9b44['datasetCode'],_0x2b9b44['alias']])),[_0x138451,_0x315610]=await Promise[_0x15d9b6(0x138)]([listBffScripts(_0x328077[_0x15d9b6(0x139)]),getBffScriptStatistics(_0x328077[_0x15d9b6(0x139)])]),_0x5ce4b1=createHookLocationMap(_0x315610),_0x232f51=new Set(_0x435b42[_0x15d9b6(0x140)](_0x1a71a0=>_0x1a71a0[_0x15d9b6(0x12c)]));for(const _0x4c7355 of _0x138451){const _0x30be31=resolveRemoteScriptTarget(_0x365fe7,_0x4c7355,_0x5ce4b1,_0x2de967[_0x15d9b6(0x13d)],_0x52c1c4);_0x30be31&&!_0x232f51[_0x15d9b6(0x129)](_0x30be31[_0x15d9b6(0x12c)])&&_0x89e215[_0x15d9b6(0x141)](_0x30be31[_0x15d9b6(0x12c)]);}}const _0x142276=_0x4360b7[_0x15d9b6(0x13c)]===0x0&&_0x3453ce[_0x15d9b6(0x13c)]===0x0&&_0x89e215[_0x15d9b6(0x13c)]===0x0;return{'ok':!![],'data':{'added':_0x4360b7,'modified':_0x3453ce,'unchanged':_0x24e394,'remoteOnly':_0x89e215},'message':_0x142276?_0x15d9b6(0x132):_0x4360b7[_0x15d9b6(0x13c)]+_0x15d9b6(0x12f)+_0x3453ce[_0x15d9b6(0x13c)]+_0x15d9b6(0x137)+_0x24e394[_0x15d9b6(0x13c)]+'\x20unchanged'+(_0x89e215[_0x15d9b6(0x13c)]>0x0?',\x20'+_0x89e215['length']+_0x15d9b6(0x143):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a39_0xc1cb(_0x220b23,_0x77233d){_0x220b23=_0x220b23-0x1c5;const _0x3b5baf=a39_0x3b5b();let _0xc1cbec=_0x3b5baf[_0x220b23];return _0xc1cbec;}const a39_0x5b7ee1=a39_0xc1cb;(function(_0x45e254,_0x542a87){const _0x496713=a39_0xc1cb,_0xc44883=_0x45e254();while(!![]){try{const _0xee2504=parseInt(_0x496713(0x1ca))/0x1*(parseInt(_0x496713(0x1dc))/0x2)+-parseInt(_0x496713(0x1d2))/0x3+parseInt(_0x496713(0x1ce))/0x4*(parseInt(_0x496713(0x1d7))/0x5)+-parseInt(_0x496713(0x1d5))/0x6+-parseInt(_0x496713(0x1db))/0x7*(-parseInt(_0x496713(0x1cc))/0x8)+parseInt(_0x496713(0x1c8))/0x9*(-parseInt(_0x496713(0x1e1))/0xa)+parseInt(_0x496713(0x1d9))/0xb;if(_0xee2504===_0x542a87)break;else _0xc44883['push'](_0xc44883['shift']());}catch(_0x45e301){_0xc44883['push'](_0xc44883['shift']());}}}(a39_0x3b5b,0x70cca));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';function a39_0x3b5b(){const _0x21b2bc=['37970zNgUOP','cli-skill-install','log','info','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','873MovARI','unknown','16941bZsmTb','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','56XwsxCj','changed','211252xzjOjE','CLI\x20Built-in\x20Skill\x20','code','cli-skill','2546610ZokNFi','repairCommand','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','5247348cTEhKg','installedPath','75weUGiW',']:\x20','12420936NPulOL','\x20installed','547687GNwrur','10CFitMq','error','install','\x20at\x20','skillVersion'];a39_0x3b5b=function(){return _0x21b2bc;};return a39_0x3b5b();}export const cliSkillDefinitions=[{'service':a39_0x5b7ee1(0x1d1),'command':a39_0x5b7ee1(0x1de),'description':a39_0x5b7ee1(0x1c7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4a23c6){const _0x54b27e=a39_0x5b7ee1;logger['setLogPath'](process['cwd']()),logger[_0x54b27e(0x1c6)](_0x54b27e(0x1e2),_0x54b27e(0x1d4));const _0x43b19d=installBuiltinSkill({'stdio':_0x4a23c6['nonInteractive']?'pipe':'inherit'});if(!_0x43b19d['ok'])throw CliErrors['apiError']('Built-in\x20Skill\x20install\x20failed\x20['+_0x43b19d[_0x54b27e(0x1d0)]+_0x54b27e(0x1d8)+(_0x43b19d[_0x54b27e(0x1dd)]||_0x54b27e(0x1c9)),_0x54b27e(0x1cb)+_0x43b19d[_0x54b27e(0x1d3)]);return console[_0x54b27e(0x1c5)](_0x43b19d[_0x54b27e(0x1cd)]?_0x54b27e(0x1cf)+_0x43b19d['skillVersion']+_0x54b27e(0x1da)+(_0x43b19d['installedPath']?'\x20at\x20'+_0x43b19d[_0x54b27e(0x1d6)]:'\x20via\x20skills@latest'):_0x54b27e(0x1cf)+_0x43b19d[_0x54b27e(0x1e0)]+'\x20is\x20already\x20current'+(_0x43b19d[_0x54b27e(0x1d6)]?_0x54b27e(0x1df)+_0x43b19d[_0x54b27e(0x1d6)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x2b47ad=a40_0x34ed;(function(_0x3448fd,_0x44fec4){const _0x1e7431=a40_0x34ed,_0x2a90e=_0x3448fd();while(!![]){try{const _0x40ad2f=-parseInt(_0x1e7431(0x159))/0x1*(-parseInt(_0x1e7431(0x161))/0x2)+parseInt(_0x1e7431(0x152))/0x3*(-parseInt(_0x1e7431(0x170))/0x4)+parseInt(_0x1e7431(0x168))/0x5*(-parseInt(_0x1e7431(0x140))/0x6)+-parseInt(_0x1e7431(0x150))/0x7*(-parseInt(_0x1e7431(0x160))/0x8)+-parseInt(_0x1e7431(0x163))/0x9+-parseInt(_0x1e7431(0x156))/0xa+parseInt(_0x1e7431(0x12c))/0xb;if(_0x40ad2f===_0x44fec4)break;else _0x2a90e['push'](_0x2a90e['shift']());}catch(_0x4d464a){_0x2a90e['push'](_0x2a90e['shift']());}}}(a40_0x11ce,0xd07dd));import a40_0x30da73 from'chalk';function a40_0x34ed(_0x144df2,_0x42f139){_0x144df2=_0x144df2-0x120;const _0x11ceaa=a40_0x11ce();let _0x34edea=_0x11ceaa[_0x144df2];return _0x34edea;}import a40_0x276e3c from'ora';import a40_0x57785a from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';function a40_0x11ce(){const _0xab3c9a=['error','Current\x20version:\x20','code','entries','log','\x20cli-skill\x20install','149874siHhnE','repairCommand','...','\x20is\x20newer\x20than\x20npm\x20latest\x20v','https://registry.npmjs.org/-/package/','\x20\x20Try\x20manually:\x20','\x20→\x20',']:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','filter','run',',\x20found\x20','Update\x20failed','yellow','Install\x20a\x20specific\x20CLI\x20version','2131493AIylgi','timeout','16509kVvUOF','bun','bool','update','15949230skqrIL','str','toLowerCase','36999LoAkfu','install','boolean','gray','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Invalid\x20version:\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','40iSYqpQ','68GCmNQm','Updating\x20via\x20','10837332YmsaCe','validation','slice','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','\x20is\x20up\x20to\x20date.','290JltdKH','/dist-tags','json','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','beta','message','length','Requested\x20version:\x20','332foAAtU','unknown','Version\x20comparison\x20failed','green','Updated\x20to\x20v','source','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','red','execPath','valid','state','object','fail','version','expected\x20','Already\x20on\x20requested\x20version\x20(v','fromEntries','latest','\x20\x20Run\x20manually:\x20','skillVersion','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20\x20CLI\x20Built-in\x20Skill\x20','30559342JQYTbI','string','warn','Checking\x20for\x20updates...','@latest','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','current','succeed','Current\x20version\x20v','npm','trim','start','info','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'];a40_0x11ce=function(){return _0xab3c9a;};return a40_0x11ce();}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 _0x1e5557=a40_0x34ed;return GIT_COMMIT!==_0x1e5557(0x171)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x1e5557(0x165)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1e360f=a40_0x34ed,_0x47d71a=process[_0x1e360f(0x178)][_0x1e360f(0x158)]();if(_0x47d71a['includes'](_0x1e360f(0x153)))return _0x1e360f(0x153);return _0x1e360f(0x135);}const updateFlags=[{'name':a40_0x2b47ad(0x16c),'type':a40_0x2b47ad(0x15b),'description':a40_0x2b47ad(0x15d),'default':![]},{'name':a40_0x2b47ad(0x123),'type':a40_0x2b47ad(0x12d),'description':a40_0x2b47ad(0x14f)}];function getRequestedVersion(_0x2fac61){const _0x1d518f=a40_0x2b47ad;return _0x2fac61[_0x1d518f(0x157)](_0x1d518f(0x123))[_0x1d518f(0x136)]();}async function validateUpdateFlags(_0x1a5106){const _0xc1cf9e=a40_0x2b47ad,_0x2b3087=_0x1a5106[_0xc1cf9e(0x154)](_0xc1cf9e(0x16c)),_0x507552=getRequestedVersion(_0x1a5106);if(_0x2b3087&&_0x507552)throw CliErrors[_0xc1cf9e(0x164)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0xc1cf9e(0x166));if(_0x507552&&!a40_0x57785a[_0xc1cf9e(0x179)](_0x507552))throw CliErrors[_0xc1cf9e(0x164)](_0xc1cf9e(0x15e)+_0x507552,_0xc1cf9e(0x15f));}async function fetchNpmDistTags(){const _0x1a1081=a40_0x2b47ad;try{const _0x2037e5=await fetch(_0x1a1081(0x144)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x1a1081(0x169),{'signal':AbortSignal[_0x1a1081(0x151)](0x2710)});if(!_0x2037e5['ok'])return null;const _0xed851d=await _0x2037e5[_0x1a1081(0x16a)]();if(!_0xed851d||typeof _0xed851d!==_0x1a1081(0x121))return null;return Object[_0x1a1081(0x126)](Object[_0x1a1081(0x13d)](_0xed851d)[_0x1a1081(0x14a)](([,_0x527b55])=>typeof _0x527b55==='string'&&_0x527b55[_0x1a1081(0x136)]()[_0x1a1081(0x16e)]>0x0)['map'](([_0x30282f,_0x1b3f42])=>[_0x30282f,String(_0x1b3f42)[_0x1a1081(0x136)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x129586){const _0x5e32af=await fetchNpmDistTags();return _0x5e32af?.[_0x129586]??null;}async function fetchLatestVersion(){const _0x8521d6=a40_0x2b47ad;return fetchNpmDistTagVersion(_0x8521d6(0x127));}async function resolveTargetVersion(_0x3c4cb4){const _0x520cc2=a40_0x2b47ad,_0x11f03d=getRequestedVersion(_0x3c4cb4);if(_0x11f03d)return{'version':_0x11f03d,'source':'version'};if(_0x3c4cb4[_0x520cc2(0x154)](_0x520cc2(0x16c))){const _0x3c436f=await fetchNpmDistTagVersion(_0x520cc2(0x16c));if(!_0x3c436f)return null;return{'version':_0x3c436f,'source':_0x520cc2(0x16c)};}const _0x1af2d8=await fetchLatestVersion();if(!_0x1af2d8)return null;return{'version':_0x1af2d8,'source':'latest'};}function shouldInstallTarget(_0x38cd98,_0x5e0ee2){const _0x47ea31=a40_0x2b47ad;if(_0x5e0ee2[_0x47ea31(0x175)]==='version'||_0x5e0ee2[_0x47ea31(0x175)]==='beta')return!a40_0x57785a['eq'](_0x38cd98,_0x5e0ee2['version']);return a40_0x57785a['lt'](_0x38cd98,_0x5e0ee2['version']);}function getInstallPlanLabel(_0x15bf18,_0x36e240){const _0x3414c0=a40_0x2b47ad;switch(_0x36e240[_0x3414c0(0x175)]){case'beta':return'Beta\x20version:\x20'+a40_0x30da73[_0x3414c0(0x14e)](_0x15bf18)+_0x3414c0(0x146)+a40_0x30da73[_0x3414c0(0x173)](_0x36e240[_0x3414c0(0x123)]);case'version':return _0x3414c0(0x16f)+a40_0x30da73[_0x3414c0(0x14e)](_0x15bf18)+_0x3414c0(0x146)+a40_0x30da73['green'](_0x36e240[_0x3414c0(0x123)]);case _0x3414c0(0x127):default:return'Update\x20available:\x20'+a40_0x30da73[_0x3414c0(0x14e)](_0x15bf18)+'\x20→\x20'+a40_0x30da73['green'](_0x36e240['version']);}}function repairCurrentBuiltinSkill(){const _0x41031c=a40_0x2b47ad;console['log'](a40_0x30da73[_0x41031c(0x15c)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x4a2b22=installBuiltinSkill();if(_0x4a2b22['ok'])return console[_0x41031c(0x13e)](a40_0x30da73[_0x41031c(0x15c)](_0x41031c(0x12b)+_0x4a2b22[_0x41031c(0x129)]+_0x41031c(0x167))),!![];return console['warn'](a40_0x30da73[_0x41031c(0x14e)](_0x41031c(0x148)+_0x4a2b22[_0x41031c(0x13c)]+_0x41031c(0x147)+(_0x4a2b22[_0x41031c(0x13a)]||_0x41031c(0x171)))),console[_0x41031c(0x13e)](a40_0x30da73[_0x41031c(0x15c)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x41031c(0x13f))),![];}function verifyUpdatedBuiltinSkill(_0x2a7979){const _0x4fd660=a40_0x2b47ad,_0x11f9e0=inspectInstalledBuiltinSkillVersion(_0x2a7979);if(_0x11f9e0[_0x4fd660(0x120)]===_0x4fd660(0x132))return console[_0x4fd660(0x13e)](a40_0x30da73[_0x4fd660(0x15c)](_0x4fd660(0x12b)+_0x2a7979+_0x4fd660(0x167))),!![];const _0x54b294=_0x11f9e0['skillVersion']?_0x4fd660(0x124)+_0x2a7979+_0x4fd660(0x14c)+_0x11f9e0[_0x4fd660(0x129)]:'expected\x20'+_0x2a7979+',\x20state\x20'+_0x11f9e0[_0x4fd660(0x120)];return console[_0x4fd660(0x12e)](a40_0x30da73[_0x4fd660(0x14e)](_0x4fd660(0x131)+_0x54b294)),console[_0x4fd660(0x13e)](a40_0x30da73[_0x4fd660(0x15c)](_0x4fd660(0x128)+_0x11f9e0[_0x4fd660(0x141)])),![];}async function execute(_0x308119){const _0x1061d8=a40_0x2b47ad;await validateUpdateFlags(_0x308119);const _0x1b79ab=getCurrentVersion();console[_0x1061d8(0x13e)](_0x1061d8(0x13b)+_0x1b79ab);const _0x451b12=a40_0x276e3c(_0x1061d8(0x12f))['start'](),_0x12f03f=await resolveTargetVersion(_0x308119);if(!_0x12f03f){const _0x36f605=_0x308119[_0x1061d8(0x154)]('beta')?_0x1061d8(0x16b):_0x1061d8(0x176);return _0x451b12[_0x1061d8(0x122)](_0x36f605),console[_0x1061d8(0x13e)](a40_0x30da73[_0x1061d8(0x15c)](_0x1061d8(0x139)+NPM_PACKAGE_NAME+_0x1061d8(0x130))),{'ok':![],'message':_0x36f605};}const _0xd6ee6c=a40_0x57785a[_0x1061d8(0x179)](VERSION),_0x5d2eb9=a40_0x57785a[_0x1061d8(0x179)](_0x12f03f[_0x1061d8(0x123)]);if(!_0xd6ee6c||!_0x5d2eb9)return _0x451b12['fail'](_0x1061d8(0x172)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0xd6ee6c,_0x12f03f)){const _0x346dad=_0x12f03f[_0x1061d8(0x175)]===_0x1061d8(0x123)?_0x1061d8(0x125)+_0x12f03f[_0x1061d8(0x123)]+')':a40_0x57785a['gt'](_0xd6ee6c,_0x5d2eb9)?_0x1061d8(0x134)+_0x1b79ab+_0x1061d8(0x143)+_0x12f03f['version']:'Already\x20up\x20to\x20date\x20(v'+_0x12f03f[_0x1061d8(0x123)]+')';return _0x451b12[_0x1061d8(0x133)](_0x346dad),{'ok':repairCurrentBuiltinSkill()};}_0x451b12[_0x1061d8(0x138)](getInstallPlanLabel(_0x1b79ab,_0x12f03f));const _0x1fbb75=detectPackageManager(),_0xd65d3f=_0x1fbb75===_0x1061d8(0x135)?resolveNpmBin(_0x1061d8(0x135)):_0x1fbb75,_0x1c0e7b=a40_0x276e3c(_0x1061d8(0x162)+_0x1fbb75+_0x1061d8(0x142))[_0x1061d8(0x137)]();try{return await execa(_0xd65d3f,[_0x1061d8(0x15a),'-g',NPM_PACKAGE_NAME+'@'+_0x12f03f['version']],{'stdio':'pipe'}),_0x1c0e7b[_0x1061d8(0x133)](_0x1061d8(0x174)+_0x12f03f[_0x1061d8(0x123)]),console[_0x1061d8(0x13e)](a40_0x30da73[_0x1061d8(0x15c)](_0x1061d8(0x149))),{'ok':verifyUpdatedBuiltinSkill(_0x12f03f[_0x1061d8(0x123)])};}catch(_0xdf8c9c){return _0x1c0e7b[_0x1061d8(0x122)](_0x1061d8(0x14d)),console[_0x1061d8(0x13a)](a40_0x30da73[_0x1061d8(0x177)]('\x20\x20'+_0xdf8c9c[_0x1061d8(0x16d)])),console[_0x1061d8(0x13e)](a40_0x30da73[_0x1061d8(0x15c)](_0x1061d8(0x145)+_0x1fbb75+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x12f03f['version'])),{'ok':![],'message':_0xdf8c9c[_0x1061d8(0x16d)]};}}export const updateDefinition={'service':a40_0x2b47ad(0x155),'command':a40_0x2b47ad(0x14b),'description':a40_0x2b47ad(0x12a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x2ba156=a40_0x5437;(function(_0x2ddb09,_0x32d5bd){const _0x32c378=a40_0x5437,_0x20d8a4=_0x2ddb09();while(!![]){try{const _0x268874=-parseInt(_0x32c378(0x147))/0x1+-parseInt(_0x32c378(0xfe))/0x2*(-parseInt(_0x32c378(0xff))/0x3)+-parseInt(_0x32c378(0x10b))/0x4+-parseInt(_0x32c378(0x134))/0x5+-parseInt(_0x32c378(0x14e))/0x6+-parseInt(_0x32c378(0x110))/0x7+parseInt(_0x32c378(0x140))/0x8*(parseInt(_0x32c378(0x118))/0x9);if(_0x268874===_0x32d5bd)break;else _0x20d8a4['push'](_0x20d8a4['shift']());}catch(_0x47e982){_0x20d8a4['push'](_0x20d8a4['shift']());}}}(a40_0x3d56,0x99d62));import a40_0x4cbf60 from'chalk';import a40_0x3f0641 from'ora';import a40_0x37f509 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 _0x55ab9d=a40_0x5437;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x55ab9d(0x13a)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x4aa7af=a40_0x5437,_0x18d45c=process[_0x4aa7af(0x153)]['toLowerCase']();if(_0x18d45c[_0x4aa7af(0x114)](_0x4aa7af(0x100)))return _0x4aa7af(0x100);return'npm';}const updateFlags=[{'name':a40_0x2ba156(0x119),'type':'boolean','description':a40_0x2ba156(0x11d),'default':![]},{'name':a40_0x2ba156(0x135),'type':a40_0x2ba156(0x107),'description':a40_0x2ba156(0x143)}];function getRequestedVersion(_0x586744){const _0x3ea31e=a40_0x2ba156;return _0x586744[_0x3ea31e(0x11f)](_0x3ea31e(0x135))[_0x3ea31e(0x104)]();}async function validateUpdateFlags(_0xc40b9c){const _0x334016=a40_0x2ba156,_0x22177b=_0xc40b9c[_0x334016(0x102)](_0x334016(0x119)),_0x5ee54d=getRequestedVersion(_0xc40b9c);if(_0x22177b&&_0x5ee54d)throw CliErrors[_0x334016(0x12d)](_0x334016(0x145),_0x334016(0x13b));if(_0x5ee54d&&!a40_0x37f509['valid'](_0x5ee54d))throw CliErrors['validation'](_0x334016(0x10c)+_0x5ee54d,_0x334016(0x106));}async function fetchNpmDistTags(){const _0xe46fbc=a40_0x2ba156;try{const _0x5560ea=await fetch(_0xe46fbc(0x101)+encodeURIComponent(NPM_PACKAGE_NAME)+_0xe46fbc(0x10f),{'signal':AbortSignal[_0xe46fbc(0x12b)](0x2710)});if(!_0x5560ea['ok'])return null;const _0x3b1400=await _0x5560ea['json']();if(!_0x3b1400||typeof _0x3b1400!==_0xe46fbc(0x137))return null;return Object[_0xe46fbc(0x115)](Object['entries'](_0x3b1400)[_0xe46fbc(0x125)](([,_0x3b70ee])=>typeof _0x3b70ee===_0xe46fbc(0x107)&&_0x3b70ee[_0xe46fbc(0x104)]()[_0xe46fbc(0x122)]>0x0)['map'](([_0x58094b,_0x5d18a2])=>[_0x58094b,String(_0x5d18a2)[_0xe46fbc(0x104)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x25de2d){const _0x115b88=await fetchNpmDistTags();return _0x115b88?.[_0x25de2d]??null;}async function fetchLatestVersion(){const _0x51cabe=a40_0x2ba156;return fetchNpmDistTagVersion(_0x51cabe(0x123));}async function resolveTargetVersion(_0x54e002){const _0x13a046=a40_0x2ba156,_0x1f7fcd=getRequestedVersion(_0x54e002);if(_0x1f7fcd)return{'version':_0x1f7fcd,'source':_0x13a046(0x135)};if(_0x54e002[_0x13a046(0x102)](_0x13a046(0x119))){const _0x4418fc=await fetchNpmDistTagVersion(_0x13a046(0x119));if(!_0x4418fc)return null;return{'version':_0x4418fc,'source':'beta'};}const _0x58a712=await fetchLatestVersion();if(!_0x58a712)return null;return{'version':_0x58a712,'source':_0x13a046(0x123)};}function shouldInstallTarget(_0x539e4a,_0x574973){const _0x4f02aa=a40_0x2ba156;if(_0x574973[_0x4f02aa(0x116)]==='version'||_0x574973[_0x4f02aa(0x116)]===_0x4f02aa(0x119))return!a40_0x37f509['eq'](_0x539e4a,_0x574973[_0x4f02aa(0x135)]);return a40_0x37f509['lt'](_0x539e4a,_0x574973[_0x4f02aa(0x135)]);}function getInstallPlanLabel(_0x3f1e8b,_0x4ae839){const _0x1b390a=a40_0x2ba156;switch(_0x4ae839['source']){case _0x1b390a(0x119):return _0x1b390a(0x142)+a40_0x4cbf60[_0x1b390a(0x12a)](_0x3f1e8b)+'\x20→\x20'+a40_0x4cbf60['green'](_0x4ae839['version']);case _0x1b390a(0x135):return _0x1b390a(0x11c)+a40_0x4cbf60['yellow'](_0x3f1e8b)+_0x1b390a(0x150)+a40_0x4cbf60['green'](_0x4ae839[_0x1b390a(0x135)]);case _0x1b390a(0x123):default:return _0x1b390a(0x109)+a40_0x4cbf60[_0x1b390a(0x12a)](_0x3f1e8b)+'\x20→\x20'+a40_0x4cbf60[_0x1b390a(0x10a)](_0x4ae839[_0x1b390a(0x135)]);}}function a40_0x5437(_0x6ba389,_0x19c01f){_0x6ba389=_0x6ba389-0xfe;const _0x3d5632=a40_0x3d56();let _0x543770=_0x3d5632[_0x6ba389];return _0x543770;}function repairCurrentBuiltinSkill(){const _0x3d8919=a40_0x2ba156;console[_0x3d8919(0x131)](a40_0x4cbf60['gray'](_0x3d8919(0x10e)));const _0x178f30=installBuiltinSkill();if(_0x178f30['ok'])return console[_0x3d8919(0x131)](a40_0x4cbf60[_0x3d8919(0x144)](_0x3d8919(0x14b)+_0x178f30[_0x3d8919(0x112)]+_0x3d8919(0x13d))),!![];return console[_0x3d8919(0x14c)](a40_0x4cbf60[_0x3d8919(0x12a)](_0x3d8919(0x151)+_0x178f30[_0x3d8919(0x133)]+_0x3d8919(0x12f)+(_0x178f30[_0x3d8919(0x11b)]||_0x3d8919(0x149)))),console[_0x3d8919(0x131)](a40_0x4cbf60[_0x3d8919(0x144)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x3d8919(0x105))),![];}function verifyUpdatedBuiltinSkill(_0xf46875){const _0x12eb5e=a40_0x2ba156,_0x47b702=inspectInstalledBuiltinSkillVersion(_0xf46875);if(_0x47b702['state']==='current')return console[_0x12eb5e(0x131)](a40_0x4cbf60[_0x12eb5e(0x144)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0xf46875+_0x12eb5e(0x13d))),!![];const _0x5c30a0=_0x47b702[_0x12eb5e(0x112)]?_0x12eb5e(0x120)+_0xf46875+_0x12eb5e(0x129)+_0x47b702[_0x12eb5e(0x112)]:_0x12eb5e(0x120)+_0xf46875+_0x12eb5e(0x138)+_0x47b702[_0x12eb5e(0x130)];return console[_0x12eb5e(0x14c)](a40_0x4cbf60['yellow']('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0x5c30a0)),console[_0x12eb5e(0x131)](a40_0x4cbf60[_0x12eb5e(0x144)](_0x12eb5e(0x14a)+_0x47b702[_0x12eb5e(0x141)])),![];}async function execute(_0x20fb42){const _0x2a538d=a40_0x2ba156;await validateUpdateFlags(_0x20fb42);const _0x5676bd=getCurrentVersion();console[_0x2a538d(0x131)](_0x2a538d(0x14d)+_0x5676bd);const _0x1103f4=a40_0x3f0641(_0x2a538d(0x146))[_0x2a538d(0x124)](),_0x11587e=await resolveTargetVersion(_0x20fb42);if(!_0x11587e){const _0x5c8f99=_0x20fb42[_0x2a538d(0x102)](_0x2a538d(0x119))?_0x2a538d(0x136):_0x2a538d(0x10d);return _0x1103f4[_0x2a538d(0x12e)](_0x5c8f99),console[_0x2a538d(0x131)](a40_0x4cbf60[_0x2a538d(0x144)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x2a538d(0x11a))),{'ok':![],'message':_0x5c8f99};}const _0x3b12e5=a40_0x37f509[_0x2a538d(0x11e)](VERSION),_0x9660cf=a40_0x37f509[_0x2a538d(0x11e)](_0x11587e[_0x2a538d(0x135)]);if(!_0x3b12e5||!_0x9660cf)return _0x1103f4[_0x2a538d(0x12e)](_0x2a538d(0x111)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3b12e5,_0x11587e)){const _0x20389b=_0x11587e[_0x2a538d(0x116)]===_0x2a538d(0x135)?_0x2a538d(0x139)+_0x11587e[_0x2a538d(0x135)]+')':a40_0x37f509['gt'](_0x3b12e5,_0x9660cf)?'Current\x20version\x20v'+_0x5676bd+_0x2a538d(0x13f)+_0x11587e['version']:'Already\x20up\x20to\x20date\x20(v'+_0x11587e[_0x2a538d(0x135)]+')';return _0x1103f4[_0x2a538d(0x14f)](_0x20389b),{'ok':repairCurrentBuiltinSkill()};}_0x1103f4[_0x2a538d(0x127)](getInstallPlanLabel(_0x5676bd,_0x11587e));const _0x33bf5e=detectPackageManager(),_0x577e79=_0x33bf5e===_0x2a538d(0x13c)?resolveNpmBin(_0x2a538d(0x13c)):_0x33bf5e,_0x204d8d=a40_0x3f0641('Updating\x20via\x20'+_0x33bf5e+_0x2a538d(0x117))[_0x2a538d(0x124)]();try{return await execa(_0x577e79,[_0x2a538d(0x12c),'-g',NPM_PACKAGE_NAME+'@'+_0x11587e[_0x2a538d(0x135)]],{'stdio':_0x2a538d(0x126)}),_0x204d8d[_0x2a538d(0x14f)](_0x2a538d(0x148)+_0x11587e['version']),console[_0x2a538d(0x131)](a40_0x4cbf60['gray'](_0x2a538d(0x113))),{'ok':verifyUpdatedBuiltinSkill(_0x11587e['version'])};}catch(_0x1e96fb){return _0x204d8d[_0x2a538d(0x12e)](_0x2a538d(0x132)),console[_0x2a538d(0x11b)](a40_0x4cbf60['red']('\x20\x20'+_0x1e96fb[_0x2a538d(0x128)])),console[_0x2a538d(0x131)](a40_0x4cbf60[_0x2a538d(0x144)]('\x20\x20Try\x20manually:\x20'+_0x33bf5e+_0x2a538d(0x103)+NPM_PACKAGE_NAME+'@'+_0x11587e['version'])),{'ok':![],'message':_0x1e96fb['message']};}}function a40_0x3d56(){const _0x4add8d=['...','36nutmVY','beta','@latest','error','Requested\x20version:\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','valid','str','expected\x20','update','length','latest','start','filter','pipe','info','message',',\x20found\x20','yellow','timeout','install','validation','fail',']:\x20','state','log','Update\x20failed','code','2138005xhtoIh','version','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','object',',\x20state\x20','Already\x20on\x20requested\x20version\x20(v','slice','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','npm','\x20is\x20up\x20to\x20date.','read','\x20is\x20newer\x20than\x20npm\x20latest\x20v','8363736ReAMhK','repairCommand','Beta\x20version:\x20','Install\x20a\x20specific\x20CLI\x20version','gray','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Checking\x20for\x20updates...','726640dNRABf','Updated\x20to\x20v','unknown','\x20\x20Run\x20manually:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20','warn','Current\x20version:\x20','2706066jncnHs','succeed','\x20→\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','run','execPath','202owfGku','13341jyBdJF','bun','https://registry.npmjs.org/-/package/','bool','\x20install\x20-g\x20','trim','\x20cli-skill\x20install','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','string','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Update\x20available:\x20','green','4588732JKcfbv','Invalid\x20version:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Checking\x20CLI\x20Built-in\x20Skill...','/dist-tags','8739262TwQXaS','Version\x20comparison\x20failed','skillVersion','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','includes','fromEntries','source'];a40_0x3d56=function(){return _0x4add8d;};return a40_0x3d56();}export const updateDefinition={'service':a40_0x2ba156(0x121),'command':a40_0x2ba156(0x152),'description':a40_0x2ba156(0x108),'risk':a40_0x2ba156(0x13e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51cd18,_0x8597c2){const _0x1b270c=a41_0x319e,_0x1b1174=_0x51cd18();while(!![]){try{const _0x535825=-parseInt(_0x1b270c(0x1f1))/0x1*(parseInt(_0x1b270c(0x1f3))/0x2)+parseInt(_0x1b270c(0x1ee))/0x3*(-parseInt(_0x1b270c(0x1f8))/0x4)+-parseInt(_0x1b270c(0x1f6))/0x5+parseInt(_0x1b270c(0x1ef))/0x6*(-parseInt(_0x1b270c(0x1f0))/0x7)+parseInt(_0x1b270c(0x1f7))/0x8*(-parseInt(_0x1b270c(0x1ed))/0x9)+-parseInt(_0x1b270c(0x1f4))/0xa*(-parseInt(_0x1b270c(0x1f2))/0xb)+parseInt(_0x1b270c(0x1f5))/0xc;if(_0x535825===_0x8597c2)break;else _0x1b1174['push'](_0x1b1174['shift']());}catch(_0x45ee28){_0x1b1174['push'](_0x1b1174['shift']());}}}(a41_0x354b,0xcb852));function a41_0x319e(_0x1018e0,_0x121e22){_0x1018e0=_0x1018e0-0x1ed;const _0x354bf6=a41_0x354b();let _0x319e14=_0x354bf6[_0x1018e0];return _0x319e14;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x354b(){const _0x1568f0=['2868BAPElv','6HkGbRS','3307199cZjICG','46979jyRrbO','1251173UPacHR','34Dttzkq','30shcpQN','44337780lFMmkD','735730AwhvvI','14176beAPBD','696wLDbil','8217BSklFY'];a41_0x354b=function(){return _0x1568f0;};return a41_0x354b();}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x2b7d7c=a42_0x3b79;function a42_0x46e4(){const _0xc4c54f=['str','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','bool','Omit\x20import\x20statements\x20from\x20generated\x20code','tableName','598877LErWEg','code','operation','40wUvdgA','1660128nbxwVI','appCode','alias','16846vMbnTF','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','boolean','sdk','135mNMsBK','14yjfYXH','3115590evwePI','640737hRpmZw','name','string','skip-imports','2191244kONPJv','2755352GCJeay','read'];a42_0x46e4=function(){return _0xc4c54f;};return a42_0x46e4();}function a42_0x3b79(_0x49ba4b,_0x3efb23){_0x49ba4b=_0x49ba4b-0x183;const _0x46e478=a42_0x46e4();let _0x3b7958=_0x46e478[_0x49ba4b];return _0x3b7958;}(function(_0x4e2708,_0x4e9169){const _0xdf78ec=a42_0x3b79,_0x24a268=_0x4e2708();while(!![]){try{const _0x5ac6ba=-parseInt(_0xdf78ec(0x198))/0x1+parseInt(_0xdf78ec(0x185))/0x2*(parseInt(_0xdf78ec(0x189))/0x3)+parseInt(_0xdf78ec(0x190))/0x4+-parseInt(_0xdf78ec(0x18b))/0x5+-parseInt(_0xdf78ec(0x19c))/0x6*(-parseInt(_0xdf78ec(0x18a))/0x7)+parseInt(_0xdf78ec(0x191))/0x8+-parseInt(_0xdf78ec(0x18c))/0x9*(parseInt(_0xdf78ec(0x19b))/0xa);if(_0x5ac6ba===_0x4e9169)break;else _0x24a268['push'](_0x24a268['shift']());}catch(_0x5688eb){_0x24a268['push'](_0x24a268['shift']());}}}(a42_0x46e4,0x4d9b2));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':a42_0x2b7d7c(0x188),'description':a42_0x2b7d7c(0x186),'risk':a42_0x2b7d7c(0x192),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x2b7d7c(0x184),'type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a42_0x2b7d7c(0x19a),'type':a42_0x2b7d7c(0x18e),'required':!![],'description':a42_0x2b7d7c(0x194)},{'name':a42_0x2b7d7c(0x18f),'type':a42_0x2b7d7c(0x187),'description':a42_0x2b7d7c(0x196)}],async 'execute'(_0x4ec787){const _0x1bee0c=a42_0x2b7d7c,{dataset:_0x541892,operation:_0x3db79f}=await getOperationDetail(_0x4ec787[_0x1bee0c(0x183)],_0x4ec787[_0x1bee0c(0x193)](_0x1bee0c(0x199)),_0x4ec787[_0x1bee0c(0x193)](_0x1bee0c(0x19a))),_0x9d59d3=generateSdkCode(_0x541892,_0x3db79f,{'includeImports':!_0x4ec787[_0x1bee0c(0x195)](_0x1bee0c(0x18f))});return{'ok':!![],'data':{'dataset':{'name':_0x541892[_0x1bee0c(0x18d)],'code':_0x541892[_0x1bee0c(0x199)],'tableName':_0x541892[_0x1bee0c(0x197)]},'operation':_0x4ec787['str'](_0x1bee0c(0x19a)),'code':_0x9d59d3}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x8c7d94=a43_0x2c76;(function(_0x29d376,_0x37ce1a){const _0x3bf144=a43_0x2c76,_0x3dc4af=_0x29d376();while(!![]){try{const _0x2838e2=-parseInt(_0x3bf144(0x94))/0x1+-parseInt(_0x3bf144(0x9a))/0x2*(parseInt(_0x3bf144(0x9b))/0x3)+parseInt(_0x3bf144(0x8a))/0x4+-parseInt(_0x3bf144(0x89))/0x5*(parseInt(_0x3bf144(0x93))/0x6)+-parseInt(_0x3bf144(0x99))/0x7+-parseInt(_0x3bf144(0x84))/0x8*(-parseInt(_0x3bf144(0x91))/0x9)+-parseInt(_0x3bf144(0x95))/0xa*(-parseInt(_0x3bf144(0x98))/0xb);if(_0x2838e2===_0x37ce1a)break;else _0x3dc4af['push'](_0x3dc4af['shift']());}catch(_0x5f1fc9){_0x3dc4af['push'](_0x3dc4af['shift']());}}}(a43_0x2b22,0x30a0b));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x2c76(_0x25a423,_0xbdc7c3){_0x25a423=_0x25a423-0x83;const _0x2b2222=a43_0x2b22();let _0x2c7640=_0x2b2222[_0x25a423];return _0x2c7640;}function a43_0x2b22(){const _0x2afca2=['197302uvjdug','14WcoPEM','72477JoXjQd','str','8gvMrEf','bool','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sqlName','codegen','25615fzKghh','1085980HHVvjR','sdk','boolean','sqlCode','no-imports','appCode','Omit\x20import\x20statements\x20from\x20generated\x20code','361089HLkIVY','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','318VnDmzh','292659IhdxHb','53200cLSFsV','sql','target','1342IHwJiF'];a43_0x2b22=function(){return _0x2afca2;};return a43_0x2b22();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x8c7d94(0x88),'command':a43_0x8c7d94(0x96),'description':a43_0x8c7d94(0x92),'risk':'read','flags':[SQLCODE_FLAG,{'name':a43_0x8c7d94(0x97),'type':'string','description':a43_0x8c7d94(0x86),'default':a43_0x8c7d94(0x8b),'enum':[a43_0x8c7d94(0x8b),'bff']},{'name':a43_0x8c7d94(0x8e),'type':a43_0x8c7d94(0x8c),'description':a43_0x8c7d94(0x90)}],async 'execute'(_0x3822ba){const _0x2405f3=a43_0x8c7d94,_0xc86fdc=await getSqlQueryInfo(_0x3822ba[_0x2405f3(0x8f)],_0x3822ba[_0x2405f3(0x83)]('sqlcode')),_0xd6b0ea=_0x3822ba['str'](_0x2405f3(0x97))||'sdk',_0x19efb5=generateSqlCodeTemplate(_0xc86fdc,{'target':_0xd6b0ea,'includeImports':!_0x3822ba[_0x2405f3(0x85)](_0x2405f3(0x8e))});return{'ok':!![],'data':{'sqlCode':_0xc86fdc[_0x2405f3(0x8d)],'sqlName':_0xc86fdc[_0x2405f3(0x87)],'target':_0xd6b0ea,'code':_0x19efb5}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a44_0x42de(){const _0x3b51e3=['772677JmrxSo','App\x20code','object','Added','\x20Default\x20app\x20changed\x20to\x20\x22','\x22\x20still\x20defined\x20in\x20','109596GxqCfC','\x20Remaining\x20app\x20\x22','string','boolean','\x20config.','projectConfig','7324GIEJdc','global','App\x20\x22','5762880fosDUM','\x20<name>','2MajQuA','\x20Default\x20app\x20is\x20\x22','4350JXTjQz','flagMissing','Use\x20global\x20config\x20scope','\x20Note:\x20app\x20\x22','\x22\x20(appcode:\x20','263216PQAMox','841146lqrlti','12419MWxuiu','\x20<name>\x20[--global]','args','keys','Usage:\x20','apps','\x20<name>\x20--appcode\x20<code>','project','287HNTgEx','appcode','both','\x22\x20not\x20found.','defaultApp','\x22\x20is\x20selected\x20automatically.','trim','length','Updated','globalConfig','bool','validation','Missing\x20app\x20name.','\x20app\x20\x22','445LZsmPG','str'];a44_0x42de=function(){return _0x3b51e3;};return a44_0x42de();}(function(_0x18bcea,_0x2025a6){const _0x516585=a44_0x47c2,_0x411723=_0x18bcea();while(!![]){try{const _0x460bfd=parseInt(_0x516585(0x1fe))/0x1*(parseInt(_0x516585(0x20f))/0x2)+parseInt(_0x516585(0x217))/0x3+-parseInt(_0x516585(0x20a))/0x4*(-parseInt(_0x516585(0x1fc))/0x5)+parseInt(_0x516585(0x204))/0x6*(-parseInt(_0x516585(0x220))/0x7)+parseInt(_0x516585(0x216))/0x8+parseInt(_0x516585(0x20d))/0x9+parseInt(_0x516585(0x211))/0xa*(-parseInt(_0x516585(0x218))/0xb);if(_0x460bfd===_0x2025a6)break;else _0x411723['push'](_0x411723['shift']());}catch(_0x1de232){_0x411723['push'](_0x411723['shift']());}}}(a44_0x42de,0x9e803));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 _0x94bfa5=a44_0x47c2;return[{'name':_0x94bfa5(0x1ef),'type':_0x94bfa5(0x206),'description':_0x94bfa5(0x1ff),'required':!![]},{'name':_0x94bfa5(0x20b),'type':_0x94bfa5(0x207),'description':_0x94bfa5(0x213),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x2fa0cf=a44_0x47c2;return[{'name':_0x2fa0cf(0x20b),'type':_0x2fa0cf(0x207),'description':_0x2fa0cf(0x213),'default':![]}];}export async function validateAppName(_0x5bd55b,_0x29b939){const _0x1fb280=a44_0x47c2,_0x341d31=_0x5bd55b['args'][0x0]?.[_0x1fb280(0x1f4)]();if(!_0x341d31)throw CliErrors[_0x1fb280(0x1f9)]('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x29b939+_0x1fb280(0x20e));}function a44_0x47c2(_0x703329,_0x35e6a1){_0x703329=_0x703329-0x1ef;const _0x42ded=a44_0x42de();let _0x47c27d=_0x42ded[_0x703329];return _0x47c27d;}export async function runAppAdd(_0x90212a,_0x20303e){const _0x2c921a=a44_0x47c2,_0x5e0594=_0x90212a['args'][0x0]?.[_0x2c921a(0x1f4)]();if(!_0x5e0594)throw CliErrors['validation'](_0x2c921a(0x1fa),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x20303e+_0x2c921a(0x21e));const _0x5aa249=_0x90212a['str'](_0x2c921a(0x1ef));if(!_0x5aa249)throw CliErrors[_0x2c921a(0x212)](_0x2c921a(0x1ef),_0x2c921a(0x21c)+CLI_BIN_NAME+'\x20'+_0x20303e+'\x20<name>\x20--appcode\x20<code>');const _0x1ee77d={'global':_0x90212a[_0x2c921a(0x1f8)](_0x2c921a(0x20b))},_0x5f3232=readConfig(_0x1ee77d);if(!_0x5f3232[_0x2c921a(0x21d)])_0x5f3232[_0x2c921a(0x21d)]={};const _0x2880bf={'appcode':_0x5aa249,...collectAppProfileOverrides(_0xdb431b=>_0x90212a[_0x2c921a(0x1fd)](_0xdb431b))},_0x7e511b=_0x5f3232[_0x2c921a(0x21d)],_0x39a723=Object[_0x2c921a(0x21b)](_0x7e511b),_0x2e1d4c=typeof _0x5f3232[_0x2c921a(0x1f2)]===_0x2c921a(0x206)&&_0x7e511b[_0x5f3232[_0x2c921a(0x1f2)]]?_0x5f3232['defaultApp']:_0x39a723[_0x2c921a(0x1f5)]===0x1?_0x39a723[0x0]:undefined,_0x34def4=!!_0x7e511b[_0x5e0594];_0x7e511b[_0x5e0594]=_0x2880bf;const _0x552f92=normalizeStoredDefaultApp(_0x5f3232,_0x2e1d4c);writeConfig(_0x5f3232,_0x1ee77d);const _0x3d4f2e=!_0x34def4&&_0x552f92?_0x2c921a(0x210)+_0x552f92+'\x22.':'',_0x4173a9=(_0x34def4?_0x2c921a(0x1f6):_0x2c921a(0x201))+_0x2c921a(0x1fb)+_0x5e0594+_0x2c921a(0x215)+_0x5aa249+')'+scopeLabel(_0x1ee77d)+'.'+_0x3d4f2e;return{'ok':!![],'message':_0x4173a9};}export async function runAppRemove(_0x2df422,_0x44cc4a){const _0x21c31f=a44_0x47c2,_0x5f44c7=_0x2df422[_0x21c31f(0x21a)][0x0]?.[_0x21c31f(0x1f4)]();if(!_0x5f44c7)throw CliErrors[_0x21c31f(0x1f9)](_0x21c31f(0x1fa),_0x21c31f(0x21c)+CLI_BIN_NAME+'\x20'+_0x44cc4a+_0x21c31f(0x219));const _0x2c7e14=_0x2df422[_0x21c31f(0x1f8)](_0x21c31f(0x20b)),{config:_0x27a948,layers:_0x25dc3a}=readRawConfigWithLayers(),_0x7ae927=_0x27a948[_0x21c31f(0x21d)]??{};if(!_0x7ae927[_0x5f44c7])throw CliErrors[_0x21c31f(0x1f9)](_0x21c31f(0x20c)+_0x5f44c7+_0x21c31f(0x1f1));const _0x47d9ee=_0x25dc3a[_0x21c31f(0x1f7)][_0x21c31f(0x21d)]&&typeof _0x25dc3a[_0x21c31f(0x1f7)][_0x21c31f(0x21d)]===_0x21c31f(0x200)?_0x25dc3a['globalConfig'][_0x21c31f(0x21d)]:{},_0x59a086=_0x25dc3a[_0x21c31f(0x209)]['apps']&&typeof _0x25dc3a[_0x21c31f(0x209)][_0x21c31f(0x21d)]===_0x21c31f(0x200)?_0x25dc3a['projectConfig'][_0x21c31f(0x21d)]:{},_0x356530=appDefinedIn(_0x5f44c7,_0x47d9ee,_0x59a086),_0x1c1752=resolveAppScopeForWrite(_0x5f44c7,_0x2c7e14,_0x25dc3a),_0x138bea={'global':_0x1c1752===_0x21c31f(0x20b)},_0x1f4d94=readConfig(_0x138bea),_0x3ad1f5=_0x1f4d94['apps'];if(!_0x3ad1f5||!_0x3ad1f5[_0x5f44c7])throw CliErrors[_0x21c31f(0x1f9)](_0x21c31f(0x20c)+_0x5f44c7+_0x21c31f(0x1f1));delete _0x3ad1f5[_0x5f44c7];let _0x400d4a='';const _0x1134df=typeof _0x1f4d94['defaultApp']===_0x21c31f(0x206)?_0x1f4d94[_0x21c31f(0x1f2)]:undefined,_0x1a5c30=Object[_0x21c31f(0x21b)](_0x3ad1f5),_0x361432=_0x1134df===_0x5f44c7?_0x1a5c30[0x0]:_0x1134df,_0x2375c3=normalizeStoredDefaultApp(_0x1f4d94,_0x361432);if(_0x1134df===_0x5f44c7&&_0x1a5c30[_0x21c31f(0x1f5)]===0x1)_0x400d4a=_0x21c31f(0x205)+_0x1a5c30[0x0]+_0x21c31f(0x1f3);else _0x1134df===_0x5f44c7&&_0x2375c3&&(_0x400d4a=_0x21c31f(0x202)+_0x2375c3+'\x22.');Object[_0x21c31f(0x21b)](_0x3ad1f5)['length']===0x0&&(delete _0x1f4d94[_0x21c31f(0x21d)],delete _0x1f4d94[_0x21c31f(0x1f2)]);writeConfig(_0x1f4d94,_0x138bea);const _0x23a90d=_0x356530===_0x21c31f(0x1f0)?_0x21c31f(0x214)+_0x5f44c7+_0x21c31f(0x203)+(_0x1c1752===_0x21c31f(0x21f)?_0x21c31f(0x20b):'project')+_0x21c31f(0x208):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x5f44c7+'\x22'+scopeLabel(_0x138bea)+'.'+_0x400d4a+_0x23a90d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b897c,_0x54e5b4){const _0x1441fe=a45_0x495c,_0x3274a1=_0x3b897c();while(!![]){try{const _0x5750a0=-parseInt(_0x1441fe(0x13e))/0x1*(-parseInt(_0x1441fe(0x149))/0x2)+-parseInt(_0x1441fe(0x13a))/0x3+parseInt(_0x1441fe(0x143))/0x4+parseInt(_0x1441fe(0x132))/0x5+parseInt(_0x1441fe(0x13c))/0x6+-parseInt(_0x1441fe(0x145))/0x7*(parseInt(_0x1441fe(0x135))/0x8)+-parseInt(_0x1441fe(0x138))/0x9*(parseInt(_0x1441fe(0x151))/0xa);if(_0x5750a0===_0x54e5b4)break;else _0x3274a1['push'](_0x3274a1['shift']());}catch(_0x261838){_0x3274a1['push'](_0x3274a1['shift']());}}}(a45_0x79de,0xb3a51));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x2dab91 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a45_0x495c(_0xf2660,_0x10699f){_0xf2660=_0xf2660-0x130;const _0x79de91=a45_0x79de();let _0x495cc4=_0x79de91[_0xf2660];return _0x495cc4;}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x57329d=a45_0x495c,_0x1a12e1=await input({'message':_0x57329d(0x139),'validate':_0x38e535=>{const _0x31c228=_0x57329d,_0x41493b=validateAppcode(_0x38e535['trim']());return _0x41493b[_0x31c228(0x152)]||_0x41493b[_0x31c228(0x147)]||_0x31c228(0x141);}});return _0x1a12e1['trim']();}export async function promptAppSelection(_0x265244){const _0x162acb=a45_0x495c,_0x685ab9=[{'name':a45_0x2dab91[_0x162acb(0x142)](_0x162acb(0x144)),'value':-0x1},..._0x265244['map']((_0x4e9fee,_0x392b12)=>({'name':_0x4e9fee[_0x162acb(0x14f)]+'\x20\x20'+a45_0x2dab91[_0x162acb(0x14e)]('('+_0x4e9fee[_0x162acb(0x13f)]+')'),'value':_0x392b12}))],_0x3ab31b=await checkbox({'message':_0x162acb(0x14c)+a45_0x2dab91[_0x162acb(0x140)](_0x265244['length'])+_0x162acb(0x148),'choices':_0x685ab9,'loop':![]});if(_0x3ab31b[_0x162acb(0x134)](-0x1))return _0x162acb(0x150);if(_0x3ab31b[_0x162acb(0x14b)]===0x0)return _0x162acb(0x150);return _0x3ab31b['map'](_0x173a11=>_0x265244[_0x173a11]);}export async function promptSingleAppSelection(_0x26d9eb){const _0x5cb3a6=a45_0x495c,_0x6c6c6c=[{'name':a45_0x2dab91['gray'](_0x5cb3a6(0x131)),'value':_0x5cb3a6(0x153)},{'name':a45_0x2dab91[_0x5cb3a6(0x142)]('✎\x20Enter\x20appcode\x20manually'),'value':'custom'},..._0x26d9eb[_0x5cb3a6(0x137)](_0x22791c=>({'name':_0x22791c[_0x5cb3a6(0x14f)]+'\x20\x20'+a45_0x2dab91[_0x5cb3a6(0x14e)]('('+_0x22791c['appCode']+')'),'value':_0x22791c['appCode']}))],_0x4b1644=await select({'message':_0x5cb3a6(0x154),'choices':_0x6c6c6c});if(_0x4b1644===_0x5cb3a6(0x153))return _0x5cb3a6(0x153);if(_0x4b1644===_0x5cb3a6(0x150))return'custom';return _0x26d9eb[_0x5cb3a6(0x13d)](_0x361ee5=>_0x361ee5[_0x5cb3a6(0x13f)]===_0x4b1644);}export async function selectSingleAppcode(_0x4c0e15){const _0x54a944=a45_0x495c;if(!_0x4c0e15)return writeCliSideChannelLine(a45_0x2dab91['gray'](_0x54a944(0x14d))),_fallbackOrSkip();writeCliSideChannelLine(_0x54a944(0x146));let _0x14961b;try{_0x14961b=await withActiveCookie(_0x4c0e15,()=>listRemoteApps());}catch(_0x2a264b){writeCliSideChannelLine(a45_0x2dab91[_0x54a944(0x142)]('Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'));if(_0x2a264b instanceof Error)writeCliSideChannelLine(a45_0x2dab91[_0x54a944(0x14e)]('\x20\x20('+_0x2a264b[_0x54a944(0x147)]+')'));return _fallbackOrSkip();}if(_0x14961b[_0x54a944(0x14b)]===0x0)return writeCliSideChannelLine(a45_0x2dab91[_0x54a944(0x142)](_0x54a944(0x13b))),_fallbackOrSkip();const _0x5e2980=await promptSingleAppSelection(_0x14961b);if(_0x5e2980===_0x54a944(0x153))return'';if(_0x5e2980===_0x54a944(0x150))return promptCustomAppcode();return _0x5e2980[_0x54a944(0x13f)];}export async function selectMultipleApps(_0x33e053){const _0x44ca4e=a45_0x495c;writeCliSideChannelLine(_0x44ca4e(0x146));let _0x4e804f;try{_0x4e804f=await withActiveCookie(_0x33e053,()=>listRemoteApps());}catch(_0xe617ba){writeCliSideChannelLine(_0x44ca4e(0x130));if(_0xe617ba instanceof Error)writeCliSideChannelLine('\x20\x20('+_0xe617ba[_0x44ca4e(0x147)]+')');return'custom';}if(_0x4e804f[_0x44ca4e(0x14b)]===0x0)return writeCliSideChannelLine(_0x44ca4e(0x14a)),_0x44ca4e(0x150);return promptAppSelection(_0x4e804f);}async function _fallbackOrSkip(){const _0x39bba2=a45_0x495c,_0x11bb09=await select({'message':_0x39bba2(0x139),'choices':[{'name':a45_0x2dab91['gray']('(Skip;\x20configure\x20later)'),'value':_0x39bba2(0x153)},{'name':a45_0x2dab91[_0x39bba2(0x142)](_0x39bba2(0x136)),'value':_0x39bba2(0x133)}]});if(_0x11bb09===_0x39bba2(0x153))return'';return promptCustomAppcode();}function a45_0x79de(){const _0x3063e7=['(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','gray','appName','custom','1047390VqKzsE','valid','skip','Select\x20the\x20app\x20to\x20bind:','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','6033170AlkTBD','manual','includes','4234184ZsgLGU','✎\x20Enter\x20manually','map','207BDclnE','App\x20Code:','2601534hCIHDJ','No\x20available\x20apps\x20found.','8435622YCzCRD','find','3lJyMZX','appCode','cyan','Invalid\x20App\x20Code','yellow','4542992nAKxFg','✎\x20Enter\x20appcode\x20manually','7cfNrDH','Fetching\x20available\x20apps...','message','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','528636IoVEXW','\x0aNo\x20available\x20apps\x20found.','length','Found\x20'];a45_0x79de=function(){return _0x3063e7;};return a45_0x79de();}
|