@lovrabet/rabetbase-cli 2.3.14-beta.1 → 2.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-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/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.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-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/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.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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/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/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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.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/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.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/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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/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/save.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/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.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/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.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/copy-directory.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/rules-cdn.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/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x20c84b=a36_0x31ba;function a36_0x31ba(_0x556df4,_0x4e06f1){_0x556df4=_0x556df4-0x9b;const _0x568872=a36_0x5688();let _0x31ba80=_0x568872[_0x556df4];return _0x31ba80;}(function(_0x14f2f4,_0x22750a){const _0x2e3b9d=a36_0x31ba,_0x53fbe6=_0x14f2f4();while(!![]){try{const _0xdb0e76=parseInt(_0x2e3b9d(0xe0))/0x1+parseInt(_0x2e3b9d(0xd8))/0x2+parseInt(_0x2e3b9d(0xb4))/0x3*(parseInt(_0x2e3b9d(0xcd))/0x4)+-parseInt(_0x2e3b9d(0xb7))/0x5+-parseInt(_0x2e3b9d(0xba))/0x6+parseInt(_0x2e3b9d(0xd4))/0x7*(parseInt(_0x2e3b9d(0xd1))/0x8)+-parseInt(_0x2e3b9d(0xdc))/0x9*(parseInt(_0x2e3b9d(0xbf))/0xa);if(_0xdb0e76===_0x22750a)break;else _0x53fbe6['push'](_0x53fbe6['shift']());}catch(_0x2c92ab){_0x53fbe6['push'](_0x53fbe6['shift']());}}}(a36_0x5688,0x9e433));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a36_0x5688(){const _0x5b716e=['376192frvFye','unresolvable\x20target\x20path','functions','Remote\x20script\x20missing\x20content.','387EqJbNB','parse','push','write','445583LzvyVu','utf8','all','includes','filePath','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','trim','apps','operationType','No\x20remote\x20BFF\x20scripts\x20found.','lastSync','question','lockKey','nonInteractive','boolean','message','str','COMMON','\x20failed','pull','stringify','force','Pull\x20only\x20this\x20script\x20type','scriptsRoot','Force\x20overwrite\x20local\x20unsynced\x20changes','functionNode','bff','would_pull','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','appCode','Remote\x20script\x20missing\x20id.','3383052fumewz','yes','datasetCode','4395505zLtnkl','type','lockFilePath','1949994wpqnvB','\x20pulled,\x20','bool','length','conflict','100590EhhXAo','&type=','Would\x20inspect\x20','Force\x20pull\x20cancelled.','alias','string','validation','hookLocation','functionName','/api/management/library/scripts/list?appCode=','stderr','Pull\x20complete:\x20','local\x20unsynced\x20changes','toLowerCase','4GsvGQq','Lock\x20scope\x20for\x20app\x20\x22','ENDPOINT','scriptType','27736SNFmsW','scriptContent','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','1057xACxcG','skipped','HOOK','apiDir'];a36_0x5688=function(){return _0x5b716e;};return a36_0x5688();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x20c84b(0xaf),'command':a36_0x20c84b(0xa8),'description':a36_0x20c84b(0xd3),'risk':a36_0x20c84b(0xdf),'flags':[{'name':a36_0x20c84b(0xb8),'type':a36_0x20c84b(0xc4),'description':a36_0x20c84b(0xab),'enum':[a36_0x20c84b(0xa6),a36_0x20c84b(0xcf),'HOOK']},{'name':a36_0x20c84b(0xaa),'type':a36_0x20c84b(0xa3),'description':a36_0x20c84b(0xad)}],async 'dryRun'(_0x69a20d){const _0xb4edd1=a36_0x20c84b,_0xfe0641=loadBffProjectConfig(_0x69a20d[_0xb4edd1(0xb2)]),_0x3f9343=await readBffLockFile(_0xfe0641[_0xb4edd1(0xb9)]),{appLock:_0x5d9127}=ensureLockScope(_0x3f9343??createEmptyBffLock(),_0x69a20d[_0xb4edd1(0xb2)],_0xfe0641[_0xb4edd1(0xac)],_0xb4edd1(0xa8)),_0x15687d=normalizeBffType(_0x69a20d[_0xb4edd1(0xa5)](_0xb4edd1(0xb8)))??undefined,_0x1501eb=buildDatasetCodeToAliasMap(_0x69a20d[_0xb4edd1(0xd7)],_0x69a20d['appCode']),[_0x5ee6b2,_0x3d9add]=await Promise[_0xb4edd1(0xe2)]([listBffScripts(_0x69a20d[_0xb4edd1(0xb2)],_0x15687d),getBffScriptStatistics(_0x69a20d['appCode'])]),_0x558a59=createHookLocationMap(_0x3d9add),_0x14d7ca=[];for(const _0x1ea156 of _0x5ee6b2){const _0x302a29=resolveRemoteScriptTarget(_0xfe0641,_0x1ea156,_0x558a59,_0x5d9127[_0xb4edd1(0xda)],_0x1501eb);if(!_0x302a29){_0x14d7ca[_0xb4edd1(0xde)]({'scriptType':_0x1ea156[_0xb4edd1(0xd0)],'functionName':_0x1ea156[_0xb4edd1(0xc7)]??'','status':_0xb4edd1(0xd5),'reason':_0xb4edd1(0xd9)});continue;}const _0x3a4b65=_0x5d9127[_0xb4edd1(0xda)][_0x302a29['lockKey']],_0x4f7f6f=_0x1ea156[_0xb4edd1(0xd2)]!=null?computeContentHash(_0x1ea156[_0xb4edd1(0xd2)]):undefined,_0x21830b=await hasUnsyncedLocalChanges(_0x302a29['filePath'],_0x3a4b65,_0x4f7f6f);_0x14d7ca[_0xb4edd1(0xde)]({'lockKey':_0x302a29['lockKey'],'filePath':_0x302a29[_0xb4edd1(0xe4)],'remoteId':_0x1ea156['id']??null,'status':_0x21830b?_0xb4edd1(0xbe):_0xb4edd1(0xb0)});}return{'method':'GET','url':_0xb4edd1(0xc8)+_0x69a20d[_0xb4edd1(0xb2)]+(_0x15687d?_0xb4edd1(0xc0)+_0x15687d:''),'body':{'appCode':_0x69a20d[_0xb4edd1(0xb2)],'filterType':_0x15687d??null,'files':_0x14d7ca},'description':_0xb4edd1(0xc1)+_0x14d7ca[_0xb4edd1(0xbd)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x41dec6){const _0x337d92=a36_0x20c84b,_0x5bfcca=loadBffProjectConfig(_0x41dec6[_0x337d92(0xb2)]),_0x48b282=await readBffLockFile(_0x5bfcca[_0x337d92(0xb9)]),{lockData:_0x5630c4,appLock:_0x39fd0a}=ensureLockScope(_0x48b282??createEmptyBffLock(),_0x41dec6[_0x337d92(0xb2)],_0x5bfcca[_0x337d92(0xac)],_0x337d92(0xa8)),_0x5304b5=normalizeBffType(_0x41dec6['str']('type'))??undefined;if(_0x41dec6['str'](_0x337d92(0xb8))&&!_0x5304b5)throw CliErrors[_0x337d92(0xc5)](_0x337d92(0xe5));const [_0x41fe85,_0x328d12]=await Promise['all']([listBffScripts(_0x41dec6[_0x337d92(0xb2)],_0x5304b5),getBffScriptStatistics(_0x41dec6[_0x337d92(0xb2)])]);if(_0x41fe85['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x337d92(0x9e)};const _0x3c535e=_0x41dec6[_0x337d92(0xbc)](_0x337d92(0xaa));if(_0x3c535e&&!_0x41dec6[_0x337d92(0xa2)]){const _0x4d32ea=await confirmForce();if(!_0x4d32ea)throw CliErrors['cancelled'](_0x337d92(0xc2));}if(_0x3c535e&&_0x41dec6[_0x337d92(0xa2)]){}const _0x204b25=buildDatasetCodeToAliasMap(_0x41dec6[_0x337d92(0xd7)],_0x41dec6[_0x337d92(0xb2)]),_0x5eee9b=createHookLocationMap(_0x328d12),_0x47009f=JSON[_0x337d92(0xdd)](JSON[_0x337d92(0xa9)](_0x5630c4)),_0x390fd1=_0x41dec6[_0x337d92(0xb2)],_0x588af6=_0x47009f[_0x337d92(0x9c)][_0x390fd1];if(!_0x588af6)throw new Error(_0x337d92(0xce)+_0x390fd1+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x3ead81=[],_0x4433bd=[],_0x1781b6=[];for(const _0x4d1b98 of _0x41fe85){const _0x28d1d0=resolveRemoteScriptTarget(_0x5bfcca,_0x4d1b98,_0x5eee9b,_0x39fd0a[_0x337d92(0xda)],_0x204b25);if(!_0x28d1d0){_0x4433bd['push']({'lockKey':_0x4d1b98['scriptType']+'/'+_0x4d1b98[_0x337d92(0xc7)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x4b662a=_0x39fd0a[_0x337d92(0xda)][_0x28d1d0['lockKey']];try{if(!_0x4d1b98['id'])throw new Error(_0x337d92(0xb3));if(_0x4d1b98['scriptContent']==null)throw new Error(_0x337d92(0xdb));const _0xbdddc8=_0x4d1b98['scriptContent'],_0x1584f1=computeContentHash(_0xbdddc8);if(!_0x3c535e){const _0x4a9725=await hasUnsyncedLocalChanges(_0x28d1d0[_0x337d92(0xe4)],_0x4b662a,_0x1584f1);if(_0x4a9725){_0x4433bd[_0x337d92(0xde)]({'lockKey':_0x28d1d0[_0x337d92(0xa1)],'reason':_0x337d92(0xcb)});continue;}}await ensureParentDirectory(_0x28d1d0['filePath']),await writeFile(_0x28d1d0[_0x337d92(0xe4)],_0xbdddc8,_0x337d92(0xe1));const _0x1bf38f={'hash':_0x1584f1,'remoteId':_0x4d1b98['id'],'version':_0x4d1b98['version']};_0x28d1d0['type']===_0x337d92(0xd6)&&_0x28d1d0[_0x337d92(0xc6)]&&(_0x1bf38f[_0x337d92(0xc3)]=_0x28d1d0[_0x337d92(0xc6)][_0x337d92(0xc3)],_0x1bf38f[_0x337d92(0xb6)]=_0x28d1d0[_0x337d92(0xc6)][_0x337d92(0xb6)],_0x1bf38f[_0x337d92(0x9d)]=_0x28d1d0[_0x337d92(0xc6)][_0x337d92(0x9d)],_0x1bf38f[_0x337d92(0xae)]=_0x28d1d0[_0x337d92(0xc6)][_0x337d92(0xae)]),_0x588af6[_0x337d92(0xda)][_0x28d1d0[_0x337d92(0xa1)]]=_0x1bf38f,_0x3ead81[_0x337d92(0xde)]({'lockKey':_0x28d1d0[_0x337d92(0xa1)],'remoteId':_0x4d1b98['id']});}catch(_0x5cabd4){_0x1781b6[_0x337d92(0xde)]({'lockKey':_0x28d1d0['lockKey'],'error':_0x5cabd4 instanceof Error?_0x5cabd4[_0x337d92(0xa4)]:String(_0x5cabd4)});}}return _0x588af6[_0x337d92(0x9f)]=new Date()['toISOString'](),await writeBffLockFile(_0x5bfcca[_0x337d92(0xb9)],_0x47009f),{'ok':_0x1781b6[_0x337d92(0xbd)]===0x0,'data':{'pulled':_0x3ead81,'skipped':_0x4433bd,'failed':_0x1781b6},'message':_0x337d92(0xca)+_0x3ead81[_0x337d92(0xbd)]+_0x337d92(0xbb)+_0x4433bd[_0x337d92(0xbd)]+'\x20skipped,\x20'+_0x1781b6['length']+_0x337d92(0xa7)};}};async function hasUnsyncedLocalChanges(_0xe46a00,_0x2028d9,_0x21dac9){if(!await fileExists(_0xe46a00))return![];const _0x4db7e7=await computeFileHash(_0xe46a00);if(!_0x2028d9)return _0x21dac9?_0x4db7e7!==_0x21dac9:!![];return _0x4db7e7!==_0x2028d9['hash'];}function buildDatasetCodeToAliasMap(_0x5a99cf,_0x5c0c1e){const _0x1c819e=a36_0x20c84b,_0xd4919f=loadAliasMap(_0x5a99cf,undefined,resolveApiFilePath(_0x5a99cf,_0x5c0c1e));return new Map(_0xd4919f['map'](_0x1c4307=>[_0x1c4307['datasetCode'],_0x1c4307[_0x1c819e(0xc3)]]));}async function confirmForce(){const _0x33b8ef=a36_0x20c84b,_0x513c30=createInterface({'input':process['stdin'],'output':process[_0x33b8ef(0xc9)]}),_0xf912c=await new Promise(_0x3babfd=>{const _0xe15fdf=_0x33b8ef;_0x513c30[_0xe15fdf(0xa0)](_0xe15fdf(0xb1),_0x3babfd);});return _0x513c30['close'](),['y',_0x33b8ef(0xb5)][_0x33b8ef(0xe3)](_0xf912c[_0x33b8ef(0x9b)]()[_0x33b8ef(0xcc)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x4c04d2=a37_0x2ed7;(function(_0x2017ba,_0x5aeed3){const _0x390cf3=a37_0x2ed7,_0x5c9291=_0x2017ba();while(!![]){try{const _0x161fde=-parseInt(_0x390cf3(0x1c3))/0x1+parseInt(_0x390cf3(0x1fc))/0x2+-parseInt(_0x390cf3(0x1de))/0x3*(-parseInt(_0x390cf3(0x1c6))/0x4)+-parseInt(_0x390cf3(0x1af))/0x5+-parseInt(_0x390cf3(0x1c7))/0x6+-parseInt(_0x390cf3(0x1f6))/0x7*(parseInt(_0x390cf3(0x1c0))/0x8)+parseInt(_0x390cf3(0x1df))/0x9;if(_0x161fde===_0x5aeed3)break;else _0x5c9291['push'](_0x5c9291['shift']());}catch(_0xc50ffd){_0x5c9291['push'](_0x5c9291['shift']());}}}(a37_0x595a,0xece6f));import{readFile}from'node:fs/promises';function a37_0x2ed7(_0x42ce59,_0x126128){_0x42ce59=_0x42ce59-0x1af;const _0x595a3b=a37_0x595a();let _0x2ed712=_0x595a3b[_0x42ce59];return _0x2ed712;}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';function a37_0x595a(){const _0x28a679=['remoteId','has','update','5784kCcnMr','push','datasetId','730213eIMBcQ','Local\x20function\x20not\x20found:\x20','unchanged','56fHWXox','8219172FijwUi','operationType','Push\x20only\x20this\x20script\x20type','code','apps','some','Push\x20complete:\x20','bff','length','\x20failed,\x20','filter','set','utf8','version','/api/management/library/scripts/save','\x20uploaded,\x20','status','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','aliasToDatasetCode','functions','Incomplete\x20HOOK\x20path:\x20','\x20skipped,\x20','filePath','330174RaXWXp','33167358iuPNQl','map','HOOK','lastSync','apiDir','cleared','datasetCodeToDataset','Would\x20inspect\x20','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','force','Push\x20local\x20BFF\x20scripts\x20to\x20remote','stringify','functionNode','high-risk-write','attempted','\x22\x20not\x20found\x20after\x20ensureLockScope.','every','datasetCode','message','values','lockKey','Run\x20`','parse','14497VHwltt','Force\x20push\x20ignoring\x20hash\x20protection','Runtime\x20script\x20cache\x20cleared.','runtime\x20cache\x20not\x20needed','str','alias','2003998hWCnYy','get','COMMON','Cannot\x20resolve\x20dataset\x20for\x20\x22','ENDPOINT','runtime\x20cache\x20clear\x20failed','string','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','8301570whnACK','create','toISOString','type','bool',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','boolean','runtime\x20cache\x20cleared','validation','scriptsRoot','would_push','appCode','\x22.\x20','hash'];a37_0x595a=function(){return _0x28a679;};return a37_0x595a();}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x4c04d2(0x1ce),'command':a37_0x4c04d2(0x1c1),'description':a37_0x4c04d2(0x1e9),'risk':a37_0x4c04d2(0x1ec),'flags':[{'name':a37_0x4c04d2(0x1b2),'type':a37_0x4c04d2(0x202),'description':a37_0x4c04d2(0x1c9),'enum':[a37_0x4c04d2(0x1fe),a37_0x4c04d2(0x200),'HOOK']},{'name':'name','type':a37_0x4c04d2(0x202),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x4c04d2(0x1e8),'type':a37_0x4c04d2(0x1b5),'description':a37_0x4c04d2(0x1f7)}],async 'dryRun'(_0x5e70f1){const _0x30376c=a37_0x4c04d2,_0x1d14af=loadBffProjectConfig(_0x5e70f1[_0x30376c(0x1ba)]),_0x4db744=await readBffLockFile(_0x1d14af['lockFilePath']),{appLock:_0x2b5f23}=ensureLockScope(_0x4db744??createEmptyBffLock(),_0x5e70f1[_0x30376c(0x1ba)],_0x1d14af[_0x30376c(0x1b8)],_0x30376c(0x1c1)),_0x5b6a1f=await getTargetFunctions(_0x1d14af,_0x5e70f1),_0x38ca94=_0x5e70f1[_0x30376c(0x1b3)](_0x30376c(0x1e8)),_0x42e03b=[];for(const _0x3c3292 of _0x5b6a1f){const _0x3e9d5a=await computeFileHash(_0x3c3292[_0x30376c(0x1dd)]),_0x32ca90=_0x2b5f23[_0x30376c(0x1da)][_0x3c3292['lockKey']],_0x5a30b4=!!_0x32ca90&&_0x32ca90[_0x30376c(0x1bc)]===_0x3e9d5a;_0x42e03b[_0x30376c(0x1c1)]({'lockKey':_0x3c3292[_0x30376c(0x1f3)],'filePath':_0x3c3292[_0x30376c(0x1dd)],'remoteId':_0x32ca90?.['remoteId']??null,'mode':_0x32ca90?.[_0x30376c(0x1bd)]?_0x30376c(0x1bf):_0x30376c(0x1b0),'status':!_0x38ca94&&_0x5a30b4?_0x30376c(0x1c5):_0x30376c(0x1b9)});}return{'method':'POST','url':_0x30376c(0x1d5),'body':{'appCode':_0x5e70f1[_0x30376c(0x1ba)],'force':_0x38ca94,'files':_0x42e03b,'cacheClearAtRuntime':_0x42e03b[_0x30376c(0x1cc)](_0x51806a=>_0x51806a[_0x30376c(0x1d7)]===_0x30376c(0x1b9)),'cacheClearAtRuntimeTimes':_0x42e03b[_0x30376c(0x1cc)](_0xb1833b=>_0xb1833b[_0x30376c(0x1d7)]===_0x30376c(0x1b9))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x30376c(0x1e6)+_0x42e03b[_0x30376c(0x1cf)]+_0x30376c(0x1e7)};},async 'execute'(_0x14dc14){const _0x508038=a37_0x4c04d2,_0x2ccecc=loadBffProjectConfig(_0x14dc14[_0x508038(0x1ba)]),_0x1def0b=await readBffLockFile(_0x2ccecc['lockFilePath']),{lockData:_0x741e7,appLock:_0x46f055}=ensureLockScope(_0x1def0b??createEmptyBffLock(),_0x14dc14[_0x508038(0x1ba)],_0x2ccecc['scriptsRoot'],'push'),_0x548247=await getTargetFunctions(_0x2ccecc,_0x14dc14);if(_0x548247[_0x508038(0x1cf)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x4ed957=_0x14dc14[_0x508038(0x1b3)](_0x508038(0x1e8)),_0x5d9850=JSON[_0x508038(0x1f5)](JSON[_0x508038(0x1ea)](_0x741e7)),_0x4dd873=_0x5d9850[_0x508038(0x1cb)][_0x14dc14[_0x508038(0x1ba)]];if(!_0x4dd873)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x14dc14[_0x508038(0x1ba)]+_0x508038(0x1ee));const _0x2c7c69=await buildHookMaps(_0x14dc14['appCode'],_0x14dc14[_0x508038(0x1e3)],_0x548247,_0x4dd873),_0x426f0b=[],_0x3734a1=[],_0x4f1113=[];for(const _0x38bab7 of _0x548247){const _0x4aea25=await computeFileHash(_0x38bab7[_0x508038(0x1dd)]),_0x28854c=_0x4dd873[_0x508038(0x1da)][_0x38bab7[_0x508038(0x1f3)]];if(!_0x4ed957&&_0x28854c&&_0x28854c[_0x508038(0x1bc)]===_0x4aea25){_0x3734a1[_0x508038(0x1c1)]({'lockKey':_0x38bab7[_0x508038(0x1f3)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x14dc14[_0x508038(0x1ba)],_0x38bab7,_0x4dd873,_0x2c7c69);const _0x406162=_0x4dd873[_0x508038(0x1da)][_0x38bab7[_0x508038(0x1f3)]];_0x426f0b[_0x508038(0x1c1)]({'lockKey':_0x38bab7[_0x508038(0x1f3)],'remoteId':_0x406162?.[_0x508038(0x1bd)]??0x0});}catch(_0x3f9799){_0x4f1113[_0x508038(0x1c1)]({'lockKey':_0x38bab7[_0x508038(0x1f3)],'error':_0x3f9799 instanceof Error?_0x3f9799[_0x508038(0x1f1)]:String(_0x3f9799)});}}_0x4dd873[_0x508038(0x1e2)]=new Date()[_0x508038(0x1b1)](),await writeBffLockFile(_0x2ccecc['lockFilePath'],_0x5d9850),await waitForUploadedLockEntries(_0x2ccecc['lockFilePath'],_0x14dc14[_0x508038(0x1ba)],_0x426f0b[_0x508038(0x1e0)](_0x41375a=>_0x41375a[_0x508038(0x1f3)]));let _0xa016af={'attempted':![],'cleared':![]};if(_0x426f0b[_0x508038(0x1cf)]>0x0)try{let _0x5adbb1='';for(let _0x4d78e8=0x0;_0x4d78e8<CACHE_CLEAR_ATTEMPTS;_0x4d78e8+=0x1){_0x5adbb1=await clearBffScriptCache(),_0x4d78e8<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0xa016af={'attempted':!![],'cleared':!![],'message':_0x5adbb1||_0x508038(0x1f8)};}catch(_0x3fa715){_0xa016af={'attempted':!![],'cleared':![],'error':_0x3fa715 instanceof Error?_0x3fa715[_0x508038(0x1f1)]:String(_0x3fa715)};}const _0x2666c5=_0x4f1113[_0x508038(0x1cf)]===0x0&&(_0xa016af[_0x508038(0x1ed)]?_0xa016af[_0x508038(0x1e4)]:!![]),_0x46c6bb=_0xa016af['attempted']?_0xa016af[_0x508038(0x1e4)]?_0x508038(0x1b6):_0x508038(0x201):_0x508038(0x1f9);return{'ok':_0x2666c5,'data':{'uploaded':_0x426f0b,'skipped':_0x3734a1,'failed':_0x4f1113,'cacheClear':_0xa016af},'message':_0x508038(0x1cd)+_0x426f0b[_0x508038(0x1cf)]+_0x508038(0x1d6)+_0x3734a1[_0x508038(0x1cf)]+_0x508038(0x1dc)+_0x4f1113['length']+_0x508038(0x1d0)+_0x46c6bb};}};async function getTargetFunctions(_0x31275d,_0x259fd1){const _0x14c8df=a37_0x4c04d2,_0x25039f=_0x259fd1[_0x14c8df(0x1fa)](_0x14c8df(0x1b2)),_0x497c4e=_0x259fd1[_0x14c8df(0x1fa)]('name'),_0x1409cc=normalizeBffType(_0x25039f)??undefined;if(_0x497c4e&&!_0x1409cc)throw CliErrors[_0x14c8df(0x1b7)](_0x14c8df(0x1d8));const _0x1af804=await scanLocalBffFunctions(_0x31275d,_0x1409cc);if(_0x497c4e){const _0x1f1888=_0x1af804[_0x14c8df(0x1d1)](_0x126fdd=>_0x126fdd['name']===_0x497c4e);if(_0x1f1888[_0x14c8df(0x1cf)]===0x0)throw CliErrors[_0x14c8df(0x1b7)](_0x14c8df(0x1c4)+_0x1409cc+'/'+_0x497c4e);return _0x1f1888;}return _0x1af804;}async function buildHookMaps(_0x591ca6,_0x32dfd0,_0x1a0119,_0x5a0e9f){const _0x149c4c=a37_0x4c04d2,_0x39b7c9=_0x1a0119['some'](_0x310ce1=>_0x310ce1['type']===_0x149c4c(0x1e1));if(!_0x39b7c9)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x49e2ed=loadAliasMap(_0x32dfd0,undefined,resolveApiFilePath(_0x32dfd0,_0x591ca6)),_0x3c3206=new Map(_0x49e2ed['map'](_0x3a8cee=>[_0x3a8cee[_0x149c4c(0x1fb)],_0x3a8cee[_0x149c4c(0x1f0)]]));for(const _0x31c634 of Object[_0x149c4c(0x1f2)](_0x5a0e9f[_0x149c4c(0x1da)])){_0x31c634[_0x149c4c(0x1fb)]&&_0x31c634['datasetCode']&&!_0x3c3206[_0x149c4c(0x1be)](_0x31c634['alias'])&&_0x3c3206[_0x149c4c(0x1d2)](_0x31c634[_0x149c4c(0x1fb)],_0x31c634[_0x149c4c(0x1f0)]);}const _0x43b834=await listDatasets(_0x591ca6),_0x42fc54=new Map(_0x43b834['map'](_0x5f3ed6=>[_0x5f3ed6[_0x149c4c(0x1ca)],_0x5f3ed6]));return{'aliasToDatasetCode':_0x3c3206,'datasetCodeToDataset':_0x42fc54};}async function uploadSingleFunction(_0x29b61b,_0x2b4f18,_0x2fb07b,_0x32b8de){const _0x219e3a=a37_0x4c04d2,_0x5d4ef3=await readFile(_0x2b4f18[_0x219e3a(0x1dd)],_0x219e3a(0x1d3)),_0xe8f9b9=await computeFileHash(_0x2b4f18['filePath']),_0x4a5fc1=_0x2fb07b[_0x219e3a(0x1da)][_0x2b4f18[_0x219e3a(0x1f3)]];if(_0x4a5fc1?.[_0x219e3a(0x1bd)]&&_0x4a5fc1[_0x219e3a(0x1d4)]==null)throw CliErrors[_0x219e3a(0x1b7)](_0x2b4f18[_0x219e3a(0x1f3)]+_0x219e3a(0x1b4));let _0x4aced0=extractScriptDescription(_0x5d4ef3);if(!_0x4aced0&&_0x4a5fc1?.[_0x219e3a(0x1bd)]){const _0xd3921b=await getBffScriptInfo(_0x4a5fc1[_0x219e3a(0x1bd)]);_0x4aced0=_0xd3921b['description']||undefined;}const _0x53a05b={'appCode':_0x29b61b,'functionName':_0x2b4f18['name'],'scriptType':_0x2b4f18[_0x219e3a(0x1b2)],'scriptContent':_0x5d4ef3};if(_0x4a5fc1?.[_0x219e3a(0x1bd)])_0x53a05b['id']=_0x4a5fc1[_0x219e3a(0x1bd)];if(_0x4a5fc1?.['version']!=null)_0x53a05b[_0x219e3a(0x1d4)]=_0x4a5fc1[_0x219e3a(0x1d4)];if(_0x4aced0)_0x53a05b['description']=_0x4aced0;if(_0x2b4f18['type']===_0x219e3a(0x1e1)){const _0x563d21=_0x2b4f18['alias'];if(!_0x563d21||!_0x2b4f18[_0x219e3a(0x1c8)]||!_0x2b4f18[_0x219e3a(0x1eb)])throw CliErrors[_0x219e3a(0x1b7)](_0x219e3a(0x1db)+_0x2b4f18[_0x219e3a(0x1f3)]);const _0x2bc978=_0x32b8de[_0x219e3a(0x1d9)]['get'](_0x563d21)??_0x4a5fc1?.['datasetCode']??_0x563d21,_0x450be7=_0x32b8de[_0x219e3a(0x1e5)]['get'](_0x2bc978);if(!_0x450be7)throw CliErrors[_0x219e3a(0x1b7)](_0x219e3a(0x1ff)+_0x563d21+_0x219e3a(0x1bb)+(_0x219e3a(0x1f4)+CLI_BIN_NAME+_0x219e3a(0x203)));_0x53a05b[_0x219e3a(0x1c2)]=_0x450be7['id'],_0x53a05b[_0x219e3a(0x1c8)]=_0x2b4f18[_0x219e3a(0x1c8)],_0x53a05b[_0x219e3a(0x1eb)]=_0x2b4f18['functionNode'];}const _0x848331=await saveBffScript(_0x53a05b),_0x570d05=_0x848331['id'],_0x5615e2=_0x848331['script']??await getBffScriptInfo(_0x570d05),_0x456333={'hash':_0xe8f9b9,'remoteId':_0x570d05,'version':_0x5615e2[_0x219e3a(0x1d4)]};if(_0x2b4f18[_0x219e3a(0x1b2)]==='HOOK'){const _0x2fb95a=_0x2b4f18[_0x219e3a(0x1fb)],_0x10f4b2=_0x32b8de[_0x219e3a(0x1d9)][_0x219e3a(0x1fd)](_0x2fb95a)??_0x4a5fc1?.[_0x219e3a(0x1f0)]??_0x2fb95a;_0x32b8de[_0x219e3a(0x1d9)][_0x219e3a(0x1be)](_0x2fb95a)?_0x456333['alias']=_0x2fb95a:_0x456333[_0x219e3a(0x1fb)]=_0x4a5fc1?.[_0x219e3a(0x1fb)],_0x456333['datasetCode']=_0x10f4b2,_0x456333[_0x219e3a(0x1c8)]=_0x2b4f18['operationType'],_0x456333[_0x219e3a(0x1eb)]=_0x2b4f18[_0x219e3a(0x1eb)];}_0x2fb07b[_0x219e3a(0x1da)][_0x2b4f18[_0x219e3a(0x1f3)]]=_0x456333;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x2c41d4,_0x293d6a,_0x57421a){const _0x2ffa38=a37_0x4c04d2;if(_0x57421a[_0x2ffa38(0x1cf)]===0x0)return;for(let _0x4dd9dd=0x0;_0x4dd9dd<LOCK_SETTLE_RETRY_COUNT;_0x4dd9dd+=0x1){const _0x365dce=await readBffLockFile(_0x2c41d4),_0x19bd72=_0x365dce?.[_0x2ffa38(0x1cb)]?.[_0x293d6a]?.[_0x2ffa38(0x1da)]??{},_0x3b45f9=_0x57421a[_0x2ffa38(0x1ef)](_0x38ce57=>!!_0x19bd72[_0x38ce57]?.['remoteId']);if(_0x3b45f9)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x57421a['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x17d35d=a37_0x5c82;(function(_0x36513b,_0x4cf594){const _0x53525b=a37_0x5c82,_0x24e446=_0x36513b();while(!![]){try{const _0x22d75e=-parseInt(_0x53525b(0x130))/0x1+parseInt(_0x53525b(0x168))/0x2+-parseInt(_0x53525b(0x144))/0x3*(parseInt(_0x53525b(0x145))/0x4)+parseInt(_0x53525b(0x12c))/0x5+parseInt(_0x53525b(0x120))/0x6+-parseInt(_0x53525b(0x155))/0x7*(-parseInt(_0x53525b(0x13e))/0x8)+-parseInt(_0x53525b(0x128))/0x9;if(_0x22d75e===_0x4cf594)break;else _0x24e446['push'](_0x24e446['shift']());}catch(_0x1fa545){_0x24e446['push'](_0x24e446['shift']());}}}(a37_0xbbd0,0x486c6));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';function a37_0xbbd0(){const _0x511084=['boolean','Push\x20local\x20BFF\x20scripts\x20to\x20remote','16bllavX','\x22\x20not\x20found\x20after\x20ensureLockScope.','No\x20local\x20BFF\x20functions\x20found.','lockFilePath',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','utf8','264ViGrmM','13332baySgU','POST','lastSync','filter','cleared','toISOString','type','join','apiDir','remoteId','\x20failed,\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','Incomplete\x20HOOK\x20path:\x20','datasetCode','version','scriptsRoot','1425725AxRKyW','functionNode','force','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','appCode','validation','map','set','operationType','HOOK','alias','unchanged','datasetId','functions','\x20uploaded,\x20','would_push','runtime\x20cache\x20clear\x20failed','Runtime\x20script\x20cache\x20cleared.','create','246214NYAdxF','runtime\x20cache\x20cleared','Lock\x20scope\x20for\x20app\x20\x22','Would\x20inspect\x20','stringify','2529018IwagVn','filePath','name','length','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','lockKey','bool','Force\x20push\x20ignoring\x20hash\x20protection','1980423WxeXKr','get','aliasToDatasetCode','string','1381580tsAgCe','str','message','some','418279LgFGsK','status','high-risk-write','hash','Push\x20complete:\x20','push','Cannot\x20resolve\x20dataset\x20for\x20\x22','description','Push\x20only\x20this\x20script\x20type','values','runtime\x20cache\x20not\x20needed','has'];a37_0xbbd0=function(){return _0x511084;};return a37_0xbbd0();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a37_0x17d35d(0x13d),'risk':a37_0x17d35d(0x132),'flags':[{'name':a37_0x17d35d(0x14b),'type':a37_0x17d35d(0x12b),'description':a37_0x17d35d(0x138),'enum':['COMMON','ENDPOINT',a37_0x17d35d(0x15e)]},{'name':a37_0x17d35d(0x122),'type':a37_0x17d35d(0x12b),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x17d35d(0x157),'type':a37_0x17d35d(0x13c),'description':a37_0x17d35d(0x127)}],async 'dryRun'(_0x244863){const _0x38528c=a37_0x17d35d,_0x12012f=loadBffProjectConfig(_0x244863[_0x38528c(0x159)]),_0x5ae03c=await readBffLockFile(_0x12012f[_0x38528c(0x141)]),{appLock:_0x11ea91}=ensureLockScope(_0x5ae03c??createEmptyBffLock(),_0x244863[_0x38528c(0x159)],_0x12012f['scriptsRoot'],_0x38528c(0x135)),_0x5f1af4=await getTargetFunctions(_0x12012f,_0x244863),_0x357b93=_0x244863[_0x38528c(0x126)]('force'),_0x366f77=[];for(const _0x8ab38 of _0x5f1af4){const _0x509771=await computeFileHash(_0x8ab38[_0x38528c(0x121)]),_0x335f52=_0x11ea91[_0x38528c(0x162)][_0x8ab38[_0x38528c(0x125)]],_0x118bf3=!!_0x335f52&&_0x335f52[_0x38528c(0x133)]===_0x509771;_0x366f77[_0x38528c(0x135)]({'lockKey':_0x8ab38['lockKey'],'filePath':_0x8ab38[_0x38528c(0x121)],'remoteId':_0x335f52?.[_0x38528c(0x14e)]??null,'mode':_0x335f52?.[_0x38528c(0x14e)]?'update':_0x38528c(0x167),'status':!_0x357b93&&_0x118bf3?_0x38528c(0x160):'would_push'});}return{'method':_0x38528c(0x146),'url':'/api/management/library/scripts/save','body':{'appCode':_0x244863[_0x38528c(0x159)],'force':_0x357b93,'files':_0x366f77,'cacheClearAtRuntime':_0x366f77[_0x38528c(0x12f)](_0x33b6ac=>_0x33b6ac[_0x38528c(0x131)]==='would_push'),'cacheClearAtRuntimeTimes':_0x366f77[_0x38528c(0x12f)](_0x4290d5=>_0x4290d5[_0x38528c(0x131)]===_0x38528c(0x164))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x38528c(0x16b)+_0x366f77['length']+_0x38528c(0x158)};},async 'execute'(_0x187d69){const _0x3698db=a37_0x17d35d,_0x158191=loadBffProjectConfig(_0x187d69['appCode']),_0x3f3491=await readBffLockFile(_0x158191[_0x3698db(0x141)]),{lockData:_0x1d6ce4,appLock:_0xb94041}=ensureLockScope(_0x3f3491??createEmptyBffLock(),_0x187d69[_0x3698db(0x159)],_0x158191[_0x3698db(0x154)],_0x3698db(0x135)),_0x13d673=await getTargetFunctions(_0x158191,_0x187d69);if(_0x13d673[_0x3698db(0x123)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x3698db(0x140)};const _0x3f88f9=_0x187d69[_0x3698db(0x126)](_0x3698db(0x157)),_0x18408c=JSON['parse'](JSON[_0x3698db(0x11f)](_0x1d6ce4)),_0x2df86e=_0x18408c['apps'][_0x187d69[_0x3698db(0x159)]];if(!_0x2df86e)throw new Error(_0x3698db(0x16a)+_0x187d69[_0x3698db(0x159)]+_0x3698db(0x13f));const _0x40ec84=await buildHookMaps(_0x187d69['appCode'],_0x187d69[_0x3698db(0x14d)],_0x13d673,_0x2df86e),_0x2ed958=[],_0x301fc3=[],_0x4830e3=[];for(const _0x523ad6 of _0x13d673){const _0x1fecab=await computeFileHash(_0x523ad6[_0x3698db(0x121)]),_0x342392=_0x2df86e['functions'][_0x523ad6[_0x3698db(0x125)]];if(!_0x3f88f9&&_0x342392&&_0x342392[_0x3698db(0x133)]===_0x1fecab){_0x301fc3[_0x3698db(0x135)]({'lockKey':_0x523ad6[_0x3698db(0x125)],'reason':_0x3698db(0x160)});continue;}try{await uploadSingleFunction(_0x187d69[_0x3698db(0x159)],_0x523ad6,_0x2df86e,_0x40ec84);const _0x1557d1=_0x2df86e[_0x3698db(0x162)][_0x523ad6[_0x3698db(0x125)]];_0x2ed958['push']({'lockKey':_0x523ad6[_0x3698db(0x125)],'remoteId':_0x1557d1?.[_0x3698db(0x14e)]??0x0});}catch(_0x5dbece){_0x4830e3[_0x3698db(0x135)]({'lockKey':_0x523ad6['lockKey'],'error':_0x5dbece instanceof Error?_0x5dbece[_0x3698db(0x12e)]:String(_0x5dbece)});}}_0x2df86e[_0x3698db(0x147)]=new Date()[_0x3698db(0x14a)](),await writeBffLockFile(_0x158191[_0x3698db(0x141)],_0x18408c),await waitForUploadedLockEntries(_0x158191[_0x3698db(0x141)],_0x187d69[_0x3698db(0x159)],_0x2ed958[_0x3698db(0x15b)](_0x3c7272=>_0x3c7272[_0x3698db(0x125)]));let _0x1e393f={'attempted':![],'cleared':![]};if(_0x2ed958[_0x3698db(0x123)]>0x0)try{let _0xfe835c='';for(let _0x41738b=0x0;_0x41738b<CACHE_CLEAR_ATTEMPTS;_0x41738b+=0x1){_0xfe835c=await clearBffScriptCache(),_0x41738b<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x1e393f={'attempted':!![],'cleared':!![],'message':_0xfe835c||_0x3698db(0x166)};}catch(_0x20a81b){_0x1e393f={'attempted':!![],'cleared':![],'error':_0x20a81b instanceof Error?_0x20a81b['message']:String(_0x20a81b)};}const _0x429dd8=_0x4830e3[_0x3698db(0x123)]===0x0&&(_0x1e393f['attempted']?_0x1e393f[_0x3698db(0x149)]:!![]),_0xb70c28=_0x1e393f['attempted']?_0x1e393f['cleared']?_0x3698db(0x169):_0x3698db(0x165):_0x3698db(0x13a);return{'ok':_0x429dd8,'data':{'uploaded':_0x2ed958,'skipped':_0x301fc3,'failed':_0x4830e3,'cacheClear':_0x1e393f},'message':_0x3698db(0x134)+_0x2ed958['length']+_0x3698db(0x163)+_0x301fc3[_0x3698db(0x123)]+'\x20skipped,\x20'+_0x4830e3[_0x3698db(0x123)]+_0x3698db(0x14f)+_0xb70c28};}};async function getTargetFunctions(_0x2e3777,_0x435e27){const _0x89cf21=a37_0x17d35d,_0xbb18dc=_0x435e27[_0x89cf21(0x12d)](_0x89cf21(0x14b)),_0x43195e=_0x435e27['str'](_0x89cf21(0x122)),_0x4db867=normalizeBffType(_0xbb18dc)??undefined;if(_0x43195e&&!_0x4db867)throw CliErrors[_0x89cf21(0x15a)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4fb8bf=await scanLocalBffFunctions(_0x2e3777,_0x4db867);if(_0x43195e){const _0xb57219=_0x4fb8bf[_0x89cf21(0x148)](_0x588a71=>_0x588a71[_0x89cf21(0x122)]===_0x43195e);if(_0xb57219[_0x89cf21(0x123)]===0x0)throw CliErrors['validation']('Local\x20function\x20not\x20found:\x20'+_0x4db867+'/'+_0x43195e);return _0xb57219;}return _0x4fb8bf;}async function buildHookMaps(_0x54f62e,_0x4a69d9,_0x7f759a,_0x5cbb9d){const _0xbce6da=a37_0x17d35d,_0x3c1424=_0x7f759a[_0xbce6da(0x12f)](_0x4ca358=>_0x4ca358[_0xbce6da(0x14b)]===_0xbce6da(0x15e));if(!_0x3c1424)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xfc631f=loadAliasMap(_0x4a69d9,undefined,resolveApiFilePath(_0x4a69d9,_0x54f62e)),_0x56c953=new Map(_0xfc631f[_0xbce6da(0x15b)](_0x15a8ee=>[_0x15a8ee[_0xbce6da(0x15f)],_0x15a8ee['datasetCode']]));for(const _0x4fb243 of Object[_0xbce6da(0x139)](_0x5cbb9d[_0xbce6da(0x162)])){_0x4fb243['alias']&&_0x4fb243['datasetCode']&&!_0x56c953[_0xbce6da(0x13b)](_0x4fb243[_0xbce6da(0x15f)])&&_0x56c953[_0xbce6da(0x15c)](_0x4fb243[_0xbce6da(0x15f)],_0x4fb243[_0xbce6da(0x152)]);}const _0x1dbc0d=await listDatasets(_0x54f62e),_0x51057b=new Map(_0x1dbc0d[_0xbce6da(0x15b)](_0x1717f2=>[_0x1717f2['code'],_0x1717f2]));return{'aliasToDatasetCode':_0x56c953,'datasetCodeToDataset':_0x51057b};}function a37_0x5c82(_0x56903e,_0x3332cc){_0x56903e=_0x56903e-0x11f;const _0xbbd09f=a37_0xbbd0();let _0x5c8216=_0xbbd09f[_0x56903e];return _0x5c8216;}async function uploadSingleFunction(_0x472904,_0x406e10,_0x1a6c5d,_0x495aa2){const _0x11175f=a37_0x17d35d,_0x53fa77=await readFile(_0x406e10[_0x11175f(0x121)],_0x11175f(0x143)),_0x2c155e=await computeFileHash(_0x406e10[_0x11175f(0x121)]),_0x41911f=_0x1a6c5d[_0x11175f(0x162)][_0x406e10[_0x11175f(0x125)]];if(_0x41911f?.[_0x11175f(0x14e)]&&_0x41911f['version']==null)throw CliErrors[_0x11175f(0x15a)](_0x406e10[_0x11175f(0x125)]+_0x11175f(0x142));let _0x146655=extractScriptDescription(_0x53fa77);if(!_0x146655&&_0x41911f?.[_0x11175f(0x14e)]){const _0x42867e=await getBffScriptInfo(_0x41911f[_0x11175f(0x14e)]);_0x146655=_0x42867e[_0x11175f(0x137)]||undefined;}const _0x315beb={'appCode':_0x472904,'functionName':_0x406e10[_0x11175f(0x122)],'scriptType':_0x406e10[_0x11175f(0x14b)],'scriptContent':_0x53fa77};if(_0x41911f?.[_0x11175f(0x14e)])_0x315beb['id']=_0x41911f['remoteId'];if(_0x41911f?.[_0x11175f(0x153)]!=null)_0x315beb['version']=_0x41911f['version'];if(_0x146655)_0x315beb['description']=_0x146655;if(_0x406e10[_0x11175f(0x14b)]===_0x11175f(0x15e)){const _0x899677=_0x406e10[_0x11175f(0x15f)];if(!_0x899677||!_0x406e10['operationType']||!_0x406e10[_0x11175f(0x156)])throw CliErrors[_0x11175f(0x15a)](_0x11175f(0x151)+_0x406e10[_0x11175f(0x125)]);const _0x4e3246=_0x495aa2[_0x11175f(0x12a)][_0x11175f(0x129)](_0x899677)??_0x41911f?.['datasetCode']??_0x899677,_0x3de57a=_0x495aa2['datasetCodeToDataset'][_0x11175f(0x129)](_0x4e3246);if(!_0x3de57a)throw CliErrors['validation'](_0x11175f(0x136)+_0x899677+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x11175f(0x124)));_0x315beb[_0x11175f(0x161)]=_0x3de57a['id'],_0x315beb[_0x11175f(0x15d)]=_0x406e10[_0x11175f(0x15d)],_0x315beb[_0x11175f(0x156)]=_0x406e10[_0x11175f(0x156)];}const _0x273753=await saveBffScript(_0x315beb),_0x50c055=_0x273753['id'],_0x79e803=_0x273753['script']??await getBffScriptInfo(_0x50c055),_0x43a8ec={'hash':_0x2c155e,'remoteId':_0x50c055,'version':_0x79e803[_0x11175f(0x153)]};if(_0x406e10[_0x11175f(0x14b)]===_0x11175f(0x15e)){const _0x4fed8a=_0x406e10['alias'],_0xe3db89=_0x495aa2['aliasToDatasetCode'][_0x11175f(0x129)](_0x4fed8a)??_0x41911f?.[_0x11175f(0x152)]??_0x4fed8a;_0x495aa2[_0x11175f(0x12a)][_0x11175f(0x13b)](_0x4fed8a)?_0x43a8ec[_0x11175f(0x15f)]=_0x4fed8a:_0x43a8ec[_0x11175f(0x15f)]=_0x41911f?.[_0x11175f(0x15f)],_0x43a8ec[_0x11175f(0x152)]=_0xe3db89,_0x43a8ec['operationType']=_0x406e10['operationType'],_0x43a8ec[_0x11175f(0x156)]=_0x406e10[_0x11175f(0x156)];}_0x1a6c5d[_0x11175f(0x162)][_0x406e10[_0x11175f(0x125)]]=_0x43a8ec;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x286b38,_0x294aca,_0x4cdb71){const _0x22d696=a37_0x17d35d;if(_0x4cdb71[_0x22d696(0x123)]===0x0)return;for(let _0x494914=0x0;_0x494914<LOCK_SETTLE_RETRY_COUNT;_0x494914+=0x1){const _0x1df949=await readBffLockFile(_0x286b38),_0x2ad06a=_0x1df949?.['apps']?.[_0x294aca]?.[_0x22d696(0x162)]??{},_0x33bd0b=_0x4cdb71['every'](_0x1a5075=>!!_0x2ad06a[_0x1a5075]?.[_0x22d696(0x14e)]);if(_0x33bd0b)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x22d696(0x150)+_0x4cdb71[_0x22d696(0x14c)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x262582=a38_0x4605;function a38_0x4692(){const _0x49304f=['map','\x20unchanged','alias','4tNmshw','hash','\x20remote-only','6aZcick','\x20modified,\x20','12882978dpvfPK','64RhJgDb','scriptsRoot','apiDir','status','3075860eBlPoY','\x20added,\x20','has','appCode','functions','284837HmUZrX','read','push','bff','1673799tAGnBk','333168YwRvcd','160579DirOJP','filePath','length','remote','lockKey','6AoeDLG','12NNLnWa','boolean','6441110YsSgbm','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file'];a38_0x4692=function(){return _0x49304f;};return a38_0x4692();}(function(_0x5cfc63,_0x9cb05f){const _0x152ef7=a38_0x4605,_0x60469f=_0x5cfc63();while(!![]){try{const _0x1e6981=parseInt(_0x152ef7(0x147))/0x1*(parseInt(_0x152ef7(0x14c))/0x2)+-parseInt(_0x152ef7(0x145))/0x3*(-parseInt(_0x152ef7(0x132))/0x4)+parseInt(_0x152ef7(0x14f))/0x5*(parseInt(_0x152ef7(0x135))/0x6)+parseInt(_0x152ef7(0x141))/0x7*(parseInt(_0x152ef7(0x138))/0x8)+-parseInt(_0x152ef7(0x137))/0x9+-parseInt(_0x152ef7(0x13c))/0xa+-parseInt(_0x152ef7(0x146))/0xb*(parseInt(_0x152ef7(0x14d))/0xc);if(_0x1e6981===_0x9cb05f)break;else _0x60469f['push'](_0x60469f['shift']());}catch(_0x3188ad){_0x60469f['push'](_0x60469f['shift']());}}}(a38_0x4692,0xd7d88));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a38_0x4605(_0x54af9d,_0xe45ab2){_0x54af9d=_0x54af9d-0x130;const _0x469250=a38_0x4692();let _0x4605ba=_0x469250[_0x54af9d];return _0x4605ba;}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x262582(0x144),'command':'status','description':a38_0x262582(0x150),'risk':a38_0x262582(0x142),'flags':[{'name':a38_0x262582(0x14a),'type':a38_0x262582(0x14e),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x45f86b){const _0x5b30b8=a38_0x262582,_0xc13449=loadBffProjectConfig(_0x45f86b[_0x5b30b8(0x13f)]),_0x3a47fa=await readBffLockFile(_0xc13449['lockFilePath']),{appLock:_0x14b3ee}=ensureLockScope(_0x3a47fa??createEmptyBffLock(),_0x45f86b['appCode'],_0xc13449[_0x5b30b8(0x139)],_0x5b30b8(0x13b)),_0x508615=await scanLocalBffFunctions(_0xc13449),_0x1698ac=[],_0x5c7614=[],_0x379d14=[];for(const _0x7b8011 of _0x508615){const _0x1d32da=await computeFileHash(_0x7b8011[_0x5b30b8(0x148)]),_0x16db77=_0x14b3ee[_0x5b30b8(0x140)][_0x7b8011[_0x5b30b8(0x14b)]];if(!_0x16db77)_0x1698ac[_0x5b30b8(0x143)](_0x7b8011[_0x5b30b8(0x14b)]);else _0x16db77[_0x5b30b8(0x133)]!==_0x1d32da?_0x5c7614[_0x5b30b8(0x143)](_0x7b8011[_0x5b30b8(0x14b)]):_0x379d14['push'](_0x7b8011['lockKey']);}const _0x3ef647=[];if(_0x45f86b['bool']('remote')){const _0x5c7e7a=loadAliasMap(_0x45f86b['apiDir'],undefined,resolveApiFilePath(_0x45f86b[_0x5b30b8(0x13a)],_0x45f86b[_0x5b30b8(0x13f)])),_0x104468=new Map(_0x5c7e7a[_0x5b30b8(0x151)](_0x54e1fa=>[_0x54e1fa['datasetCode'],_0x54e1fa[_0x5b30b8(0x131)]])),[_0x333c32,_0x1561a]=await Promise['all']([listBffScripts(_0x45f86b[_0x5b30b8(0x13f)]),getBffScriptStatistics(_0x45f86b[_0x5b30b8(0x13f)])]),_0x5b984f=createHookLocationMap(_0x1561a),_0x231e5f=new Set(_0x508615[_0x5b30b8(0x151)](_0x347c05=>_0x347c05[_0x5b30b8(0x14b)]));for(const _0x1ac396 of _0x333c32){const _0x3ee9f4=resolveRemoteScriptTarget(_0xc13449,_0x1ac396,_0x5b984f,_0x14b3ee['functions'],_0x104468);_0x3ee9f4&&!_0x231e5f[_0x5b30b8(0x13e)](_0x3ee9f4[_0x5b30b8(0x14b)])&&_0x3ef647['push'](_0x3ee9f4['lockKey']);}}const _0x25e110=_0x1698ac[_0x5b30b8(0x149)]===0x0&&_0x5c7614[_0x5b30b8(0x149)]===0x0&&_0x3ef647['length']===0x0;return{'ok':!![],'data':{'added':_0x1698ac,'modified':_0x5c7614,'unchanged':_0x379d14,'remoteOnly':_0x3ef647},'message':_0x25e110?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x1698ac['length']+_0x5b30b8(0x13d)+_0x5c7614[_0x5b30b8(0x149)]+_0x5b30b8(0x136)+_0x379d14[_0x5b30b8(0x149)]+_0x5b30b8(0x130)+(_0x3ef647[_0x5b30b8(0x149)]>0x0?',\x20'+_0x3ef647[_0x5b30b8(0x149)]+_0x5b30b8(0x134):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x2896c3=a39_0x4988;(function(_0x319474,_0x1af5eb){const _0x4abe1b=a39_0x4988,_0x133270=_0x319474();while(!![]){try{const _0x1b3d3d=-parseInt(_0x4abe1b(0x111))/0x1*(parseInt(_0x4abe1b(0x128))/0x2)+-parseInt(_0x4abe1b(0x117))/0x3+-parseInt(_0x4abe1b(0x115))/0x4+parseInt(_0x4abe1b(0x126))/0x5+parseInt(_0x4abe1b(0x10e))/0x6+parseInt(_0x4abe1b(0x11d))/0x7+-parseInt(_0x4abe1b(0x127))/0x8*(-parseInt(_0x4abe1b(0x116))/0x9);if(_0x1b3d3d===_0x1af5eb)break;else _0x133270['push'](_0x133270['shift']());}catch(_0x2f1784){_0x133270['push'](_0x133270['shift']());}}}(a39_0x41df,0xd31c0));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':a39_0x2896c3(0x114),'description':a39_0x2896c3(0x118),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2ccb15){const _0x58714a=a39_0x2896c3;logger[_0x58714a(0x120)](process['cwd']()),logger[_0x58714a(0x11e)](_0x58714a(0x11f),_0x58714a(0x11b));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x143f4d,RABETBASE_SKILL_SOURCE:_0x58682f,runNpxSkillsAddGlobal:_0x329abe}=await import(_0x58714a(0x129)),_0x2a03a5=_0x2ccb15[_0x58714a(0x121)]?_0x58714a(0x11c):_0x58714a(0x125);console['log']('Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20('+_0x143f4d+_0x58714a(0x123));const _0x2558af=_0x329abe(process[_0x58714a(0x122)](),_0x58682f,{'stdio':_0x2a03a5});if(_0x2558af[_0x58714a(0x124)])console[_0x58714a(0x113)](_0x58714a(0x110));else{if(_0x2558af['ok'])console['log'](_0x58714a(0x11a));else throw CliErrors['apiError']('npx\x20skills\x20add\x20failed:\x20'+(_0x2558af[_0x58714a(0x10f)]||_0x58714a(0x112)),_0x58714a(0x119)+_0x143f4d);}return{'ok':!![]};}}];function a39_0x4988(_0x39f032,_0x4d7eb7){_0x39f032=_0x39f032-0x10e;const _0x41df47=a39_0x41df();let _0x498850=_0x41df47[_0x39f032];return _0x498850;}function a39_0x41df(){const _0x2eb3c8=['6683548vTUraG','63ylAfQK','2723697uPhiIV','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','CLI\x20Built-in\x20Skill\x20installed','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','pipe','7266007kcKoFA','info','cli-skill-install','setLogPath','nonInteractive','cwd',')...','skipped','inherit','1880035cavZqe','3059992DPfdqK','1034RUcMhp','../../skills/npx-skills-add.js','3376818ndGZvS','error','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','2342iKscAl','unknown','log','install'];a39_0x41df=function(){return _0x2eb3c8;};return a39_0x41df();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0xed60aa=a40_0x3e82;(function(_0x55e60a,_0x311cbc){const _0x14ad9c=a40_0x3e82,_0x178c12=_0x55e60a();while(!![]){try{const _0x137739=parseInt(_0x14ad9c(0x150))/0x1+-parseInt(_0x14ad9c(0x136))/0x2*(-parseInt(_0x14ad9c(0x163))/0x3)+-parseInt(_0x14ad9c(0x15d))/0x4*(-parseInt(_0x14ad9c(0x12a))/0x5)+parseInt(_0x14ad9c(0x168))/0x6+parseInt(_0x14ad9c(0x159))/0x7+parseInt(_0x14ad9c(0x156))/0x8*(-parseInt(_0x14ad9c(0x164))/0x9)+parseInt(_0x14ad9c(0x12c))/0xa*(-parseInt(_0x14ad9c(0x169))/0xb);if(_0x137739===_0x311cbc)break;else _0x178c12['push'](_0x178c12['shift']());}catch(_0x4ea055){_0x178c12['push'](_0x178c12['shift']());}}}(a40_0x2528,0x4e748));import a40_0x3e06ef from'chalk';import a40_0x30beb0 from'ora';import a40_0x1acd14 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{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0xf44557=a40_0x3e82;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0xf44557(0x151)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3acbe6=a40_0x3e82,_0x29f78c=process['execPath'][_0x3acbe6(0x13d)]();if(_0x29f78c[_0x3acbe6(0x138)](_0x3acbe6(0x152)))return'bun';return _0x3acbe6(0x165);}const updateFlags=[{'name':a40_0xed60aa(0x162),'type':a40_0xed60aa(0x155),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a40_0xed60aa(0x125),'type':'string','description':a40_0xed60aa(0x16b)},{'name':a40_0xed60aa(0x137),'type':a40_0xed60aa(0x155),'description':a40_0xed60aa(0x130),'default':![]},{'name':a40_0xed60aa(0x11b),'type':a40_0xed60aa(0x155),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function getRequestedVersion(_0x58c52c){const _0x40695b=a40_0xed60aa;return _0x58c52c[_0x40695b(0x14f)]('version')[_0x40695b(0x14a)]();}function a40_0x3e82(_0x4ae242,_0x25e4fb){_0x4ae242=_0x4ae242-0x11b;const _0x252856=a40_0x2528();let _0x3e820c=_0x252856[_0x4ae242];return _0x3e820c;}function shouldSkipCliSkill(_0x51a034){const _0x3096fe=a40_0xed60aa;return _0x51a034[_0x3096fe(0x139)](_0x3096fe(0x137))||_0x51a034['flag'](_0x3096fe(0x11b))===![];}async function validateUpdateFlags(_0x2b93d9){const _0x4f4f6a=a40_0xed60aa,_0x574398=_0x2b93d9['bool'](_0x4f4f6a(0x162)),_0x6b41aa=getRequestedVersion(_0x2b93d9);if(_0x574398&&_0x6b41aa)throw CliErrors[_0x4f4f6a(0x13a)](_0x4f4f6a(0x13c),_0x4f4f6a(0x13b));if(_0x6b41aa&&!a40_0x1acd14['valid'](_0x6b41aa))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x6b41aa,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x967a5b=a40_0xed60aa;try{const _0x213dd8=await fetch(_0x967a5b(0x128)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x967a5b(0x11c),{'signal':AbortSignal[_0x967a5b(0x14e)](0x2710)});if(!_0x213dd8['ok'])return null;const _0x4e8b5a=await _0x213dd8[_0x967a5b(0x153)]();if(!_0x4e8b5a||typeof _0x4e8b5a!==_0x967a5b(0x14d))return null;return Object[_0x967a5b(0x166)](Object['entries'](_0x4e8b5a)['filter'](([,_0x25a7c3])=>typeof _0x25a7c3===_0x967a5b(0x123)&&_0x25a7c3[_0x967a5b(0x14a)]()['length']>0x0)[_0x967a5b(0x160)](([_0x15b411,_0x41ba68])=>[_0x15b411,String(_0x41ba68)[_0x967a5b(0x14a)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x573cbf){const _0x277934=await fetchNpmDistTags();return _0x277934?.[_0x573cbf]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x531db1){const _0x22915e=a40_0xed60aa,_0x1d09d6=getRequestedVersion(_0x531db1);if(_0x1d09d6)return{'version':_0x1d09d6,'source':_0x22915e(0x125)};if(_0x531db1[_0x22915e(0x139)](_0x22915e(0x162))){const _0x5d8e38=await fetchNpmDistTagVersion(_0x22915e(0x162));if(!_0x5d8e38)return null;return{'version':_0x5d8e38,'source':_0x22915e(0x162)};}const _0x52e928=await fetchLatestVersion();if(!_0x52e928)return null;return{'version':_0x52e928,'source':_0x22915e(0x158)};}function shouldInstallTarget(_0x4e79a6,_0x5cc032){const _0x3c47a3=a40_0xed60aa;if(_0x5cc032['source']==='version'||_0x5cc032['source']==='beta')return!a40_0x1acd14['eq'](_0x4e79a6,_0x5cc032['version']);return a40_0x1acd14['lt'](_0x4e79a6,_0x5cc032[_0x3c47a3(0x125)]);}function getInstallPlanLabel(_0x42c03e,_0x3727b1){const _0x4df206=a40_0xed60aa;switch(_0x3727b1['source']){case _0x4df206(0x162):return _0x4df206(0x15e)+a40_0x3e06ef['yellow'](_0x42c03e)+_0x4df206(0x143)+a40_0x3e06ef[_0x4df206(0x14b)](_0x3727b1[_0x4df206(0x125)]);case _0x4df206(0x125):return'Requested\x20version:\x20'+a40_0x3e06ef[_0x4df206(0x12f)](_0x42c03e)+_0x4df206(0x143)+a40_0x3e06ef['green'](_0x3727b1['version']);case _0x4df206(0x158):default:return'Update\x20available:\x20'+a40_0x3e06ef[_0x4df206(0x12f)](_0x42c03e)+_0x4df206(0x143)+a40_0x3e06ef['green'](_0x3727b1[_0x4df206(0x125)]);}}async function installCliSkill(_0x18519e){const _0x20f8de=a40_0xed60aa;console[_0x20f8de(0x144)](a40_0x3e06ef[_0x20f8de(0x141)](_0x20f8de(0x11d)));const _0x1948fa=runNpxSkillsAddGlobal(process[_0x20f8de(0x147)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x18519e?_0x20f8de(0x126):_0x20f8de(0x16a)});if(_0x1948fa[_0x20f8de(0x135)]){console[_0x20f8de(0x144)](a40_0x3e06ef[_0x20f8de(0x141)](_0x20f8de(0x120)));return;}if(_0x1948fa['ok']){console[_0x20f8de(0x144)](a40_0x3e06ef['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.'));return;}console[_0x20f8de(0x12e)](a40_0x3e06ef['yellow'](_0x20f8de(0x14c)+(_0x1948fa[_0x20f8de(0x167)]||_0x20f8de(0x15b)))),console[_0x20f8de(0x144)](a40_0x3e06ef[_0x20f8de(0x141)](_0x20f8de(0x154)+CLI_BIN_NAME+'\x20cli-skill\x20install'));}async function execute(_0x3a0064){const _0x381f53=a40_0xed60aa;await validateUpdateFlags(_0x3a0064);const _0x683a23=getCurrentVersion();console['log'](_0x381f53(0x140)+_0x683a23);const _0x2c5fcb=a40_0x30beb0(_0x381f53(0x146))[_0x381f53(0x127)](),_0xb19707=await resolveTargetVersion(_0x3a0064);if(!_0xb19707){const _0x1a55c=_0x3a0064[_0x381f53(0x139)](_0x381f53(0x162))?_0x381f53(0x129):_0x381f53(0x134);return _0x2c5fcb[_0x381f53(0x11f)](_0x1a55c),console[_0x381f53(0x144)](a40_0x3e06ef[_0x381f53(0x141)](_0x381f53(0x132)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x1a55c};}const _0x329b7a=a40_0x1acd14[_0x381f53(0x157)](VERSION),_0x58443a=a40_0x1acd14['valid'](_0xb19707['version']);if(!_0x329b7a||!_0x58443a)return _0x2c5fcb[_0x381f53(0x11f)](_0x381f53(0x15c)),{'ok':![],'message':_0x381f53(0x15c)};if(!shouldInstallTarget(_0x329b7a,_0xb19707)){const _0x2c971f=_0xb19707[_0x381f53(0x145)]===_0x381f53(0x125)?_0x381f53(0x13f)+_0xb19707[_0x381f53(0x125)]+')':_0x381f53(0x122)+_0xb19707['version']+')';return _0x2c5fcb['succeed'](_0x2c971f),shouldSkipCliSkill(_0x3a0064)?console['log'](a40_0x3e06ef[_0x381f53(0x141)](_0x381f53(0x131))):await installCliSkill(_0x3a0064['nonInteractive']),{'ok':!![]};}_0x2c5fcb[_0x381f53(0x149)](getInstallPlanLabel(_0x683a23,_0xb19707));const _0x502a9d=detectPackageManager(),_0xefeab8=_0x502a9d===_0x381f53(0x165)?resolveNpmBin(_0x381f53(0x165)):_0x502a9d,_0x1005e1=a40_0x30beb0('Updating\x20via\x20'+_0x502a9d+_0x381f53(0x121))[_0x381f53(0x127)]();try{return await execa(_0xefeab8,[_0x381f53(0x12d),'-g',NPM_PACKAGE_NAME+'@'+_0xb19707[_0x381f53(0x125)]],{'stdio':_0x381f53(0x126)}),_0x1005e1[_0x381f53(0x13e)](_0x381f53(0x15a)+_0xb19707[_0x381f53(0x125)]),console[_0x381f53(0x144)](a40_0x3e06ef[_0x381f53(0x141)](_0x381f53(0x124))),shouldSkipCliSkill(_0x3a0064)?console[_0x381f53(0x144)](a40_0x3e06ef[_0x381f53(0x141)]('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).')):await installCliSkill(_0x3a0064[_0x381f53(0x161)]),{'ok':!![]};}catch(_0x533b3e){return _0x1005e1[_0x381f53(0x11f)](_0x381f53(0x142)),console[_0x381f53(0x167)](a40_0x3e06ef[_0x381f53(0x15f)]('\x20\x20'+_0x533b3e['message'])),console['log'](a40_0x3e06ef[_0x381f53(0x141)]('\x20\x20Try\x20manually:\x20'+_0x502a9d+_0x381f53(0x11e)+NPM_PACKAGE_NAME+'@'+_0xb19707[_0x381f53(0x125)])),{'ok':![],'message':_0x533b3e[_0x381f53(0x148)]};}}function a40_0x2528(){const _0x56c5d4=['skills','/dist-tags','Checking\x20CLI\x20Built-in\x20Skill...','\x20install\x20-g\x20','fail','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','...','Already\x20up\x20to\x20date\x20(v','string','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','version','pipe','start','https://registry.npmjs.org/-/package/','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','5rlHTlc','update','561320fsBRNl','install','warn','yellow','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','run','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','skipped','2FpKBMb','no-skills','includes','bool','validation','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','toLowerCase','succeed','Already\x20on\x20requested\x20version\x20(v','Current\x20version:\x20','gray','Update\x20failed','\x20→\x20','log','source','Checking\x20for\x20updates...','cwd','message','info','trim','green','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','object','timeout','str','62871SMErPq','slice','bun','json','\x20\x20Run\x20manually:\x20','boolean','90744JXnnax','valid','latest','117971NiqfYT','Updated\x20to\x20v','unknown','Version\x20comparison\x20failed','1422020iUQDme','Beta\x20version:\x20','red','map','nonInteractive','beta','45921yRxeEx','396TNhElr','npm','fromEntries','error','3566616ZIrqHf','44MtUmNf','inherit','Install\x20a\x20specific\x20CLI\x20version'];a40_0x2528=function(){return _0x56c5d4;};return a40_0x2528();}export const updateDefinition={'service':a40_0xed60aa(0x12b),'command':a40_0xed60aa(0x133),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x57e0c3=a40_0xa25d;(function(_0x231bfa,_0x28eaa2){const _0x373d24=a40_0xa25d,_0x1085d9=_0x231bfa();while(!![]){try{const _0x318a94=-parseInt(_0x373d24(0x122))/0x1+parseInt(_0x373d24(0x12a))/0x2*(-parseInt(_0x373d24(0xfb))/0x3)+-parseInt(_0x373d24(0xfe))/0x4*(parseInt(_0x373d24(0x110))/0x5)+-parseInt(_0x373d24(0x105))/0x6+-parseInt(_0x373d24(0x11d))/0x7+-parseInt(_0x373d24(0x103))/0x8+parseInt(_0x373d24(0xf0))/0x9*(parseInt(_0x373d24(0x121))/0xa);if(_0x318a94===_0x28eaa2)break;else _0x1085d9['push'](_0x1085d9['shift']());}catch(_0x4b9a06){_0x1085d9['push'](_0x1085d9['shift']());}}}(a40_0x46ce,0xa0d29));import a40_0x6a23cc from'chalk';import a40_0x2c775b from'ora';import a40_0x4ff535 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{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function a40_0x46ce(){const _0x3e28c8=['\x20\x20Run\x20manually:\x20','fromEntries','3793190pWTqnw','960301FLOsod','green','json','skipped','Already\x20up\x20to\x20date\x20(v','flag','Updating\x20via\x20','timeout','122046YjEOAn','Update\x20failed','\x20\x20Try\x20manually:\x20','Checking\x20CLI\x20Built-in\x20Skill...','nonInteractive','update','write','...','Already\x20on\x20requested\x20version\x20(v','\x20→\x20','slice','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','entries','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','source','Current\x20version:\x20','\x20install\x20-g\x20','bool','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','info','validation','Checking\x20for\x20updates...','succeed','81LSwrig','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','boolean','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','bun','string','skills','trim','message','run','60yMehJD','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','object','1852mtjryX','red','Version\x20comparison\x20failed','latest','str','2393920Uitwub','pipe','350778TzSXON','map','fail','version','Beta\x20version:\x20','warn','npm','Install\x20a\x20specific\x20CLI\x20version','error','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','1585xmsBoz','log','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','length','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','Updated\x20to\x20v','yellow','install','gray','valid','beta','unknown','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','489349vATGud','start'];a40_0x46ce=function(){return _0x3e28c8;};return a40_0x46ce();}function getCurrentVersion(){const _0x173a59=a40_0xa25d;return GIT_COMMIT!==_0x173a59(0x11b)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x173a59(0xe3)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1ba148=a40_0xa25d,_0x456a6e=process['execPath']['toLowerCase']();if(_0x456a6e['includes'](_0x1ba148(0xf5)))return _0x1ba148(0xf5);return _0x1ba148(0x10b);}function a40_0xa25d(_0x2c8722,_0x4750b0){_0x2c8722=_0x2c8722-0xe0;const _0x46ce5f=a40_0x46ce();let _0xa25df2=_0x46ce5f[_0x2c8722];return _0xa25df2;}const updateFlags=[{'name':a40_0x57e0c3(0x11a),'type':a40_0x57e0c3(0xf3),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a40_0x57e0c3(0x108),'type':'string','description':a40_0x57e0c3(0x10c)},{'name':'no-skills','type':a40_0x57e0c3(0xf3),'description':a40_0x57e0c3(0x114),'default':![]},{'name':a40_0x57e0c3(0xf7),'type':a40_0x57e0c3(0xf3),'description':a40_0x57e0c3(0xeb),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x4ed009){const _0x4194ca=a40_0x57e0c3;return _0x4ed009[_0x4194ca(0x102)](_0x4194ca(0x108))[_0x4194ca(0xf8)]();}function shouldSkipCliSkill(_0x12fb09){const _0x44683d=a40_0x57e0c3;return _0x12fb09['bool']('no-skills')||_0x12fb09[_0x44683d(0x127)](_0x44683d(0xf7))===![];}async function validateUpdateFlags(_0x364cb7){const _0x56a066=a40_0x57e0c3,_0x4e6fb7=_0x364cb7[_0x56a066(0xea)]('beta'),_0x4edd5e=getRequestedVersion(_0x364cb7);if(_0x4e6fb7&&_0x4edd5e)throw CliErrors[_0x56a066(0xed)](_0x56a066(0x10e),_0x56a066(0x11c));if(_0x4edd5e&&!a40_0x4ff535['valid'](_0x4edd5e))throw CliErrors[_0x56a066(0xed)]('Invalid\x20version:\x20'+_0x4edd5e,_0x56a066(0xfc));}async function fetchNpmDistTags(){const _0x4a9803=a40_0x57e0c3;try{const _0x32e2a5=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x4a9803(0x129)](0x2710)});if(!_0x32e2a5['ok'])return null;const _0x21710d=await _0x32e2a5[_0x4a9803(0x124)]();if(!_0x21710d||typeof _0x21710d!==_0x4a9803(0xfd))return null;return Object[_0x4a9803(0x120)](Object[_0x4a9803(0xe5)](_0x21710d)['filter'](([,_0x34e219])=>typeof _0x34e219===_0x4a9803(0xf6)&&_0x34e219[_0x4a9803(0xf8)]()[_0x4a9803(0x113)]>0x0)[_0x4a9803(0x106)](([_0x4eb5b0,_0x2388b3])=>[_0x4eb5b0,String(_0x2388b3)[_0x4a9803(0xf8)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x4123c2){const _0x2b56ae=await fetchNpmDistTags();return _0x2b56ae?.[_0x4123c2]??null;}async function fetchLatestVersion(){const _0x30f516=a40_0x57e0c3;return fetchNpmDistTagVersion(_0x30f516(0x101));}async function resolveTargetVersion(_0x469955){const _0x501e57=a40_0x57e0c3,_0x3f36ae=getRequestedVersion(_0x469955);if(_0x3f36ae)return{'version':_0x3f36ae,'source':'version'};if(_0x469955[_0x501e57(0xea)]('beta')){const _0x4a57c4=await fetchNpmDistTagVersion('beta');if(!_0x4a57c4)return null;return{'version':_0x4a57c4,'source':_0x501e57(0x11a)};}const _0x2eabb2=await fetchLatestVersion();if(!_0x2eabb2)return null;return{'version':_0x2eabb2,'source':_0x501e57(0x101)};}function shouldInstallTarget(_0x5e5d21,_0x40a9c9){const _0x4dae22=a40_0x57e0c3;if(_0x40a9c9['source']===_0x4dae22(0x108)||_0x40a9c9[_0x4dae22(0xe7)]===_0x4dae22(0x11a))return!a40_0x4ff535['eq'](_0x5e5d21,_0x40a9c9['version']);return a40_0x4ff535['lt'](_0x5e5d21,_0x40a9c9['version']);}function getInstallPlanLabel(_0x5d7062,_0x3ff2aa){const _0x2942d7=a40_0x57e0c3;switch(_0x3ff2aa[_0x2942d7(0xe7)]){case _0x2942d7(0x11a):return _0x2942d7(0x109)+a40_0x6a23cc[_0x2942d7(0x116)](_0x5d7062)+_0x2942d7(0xe2)+a40_0x6a23cc['green'](_0x3ff2aa[_0x2942d7(0x108)]);case _0x2942d7(0x108):return'Requested\x20version:\x20'+a40_0x6a23cc[_0x2942d7(0x116)](_0x5d7062)+_0x2942d7(0xe2)+a40_0x6a23cc[_0x2942d7(0x123)](_0x3ff2aa['version']);case'latest':default:return'Update\x20available:\x20'+a40_0x6a23cc['yellow'](_0x5d7062)+'\x20→\x20'+a40_0x6a23cc[_0x2942d7(0x123)](_0x3ff2aa['version']);}}async function installCliSkill(_0x5bfc89){const _0x112124=a40_0x57e0c3;console[_0x112124(0x111)](a40_0x6a23cc[_0x112124(0x118)](_0x112124(0x12d)));const _0x3a5e9c=runNpxSkillsAddGlobal(process['cwd'](),RABETBASE_SKILL_SOURCE,{'stdio':_0x5bfc89?_0x112124(0x104):'inherit'});if(_0x3a5e9c[_0x112124(0x125)]){console['log'](a40_0x6a23cc['gray'](_0x112124(0x10f)));return;}if(_0x3a5e9c['ok']){console[_0x112124(0x111)](a40_0x6a23cc['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.'));return;}console[_0x112124(0x10a)](a40_0x6a23cc[_0x112124(0x116)]('\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20'+(_0x3a5e9c[_0x112124(0x10d)]||_0x112124(0x11b)))),console['log'](a40_0x6a23cc[_0x112124(0x118)](_0x112124(0x11f)+CLI_BIN_NAME+'\x20cli-skill\x20install'));}async function execute(_0xb81a68){const _0x54635c=a40_0x57e0c3;await validateUpdateFlags(_0xb81a68);const _0x49f4d6=getCurrentVersion();console[_0x54635c(0x111)](_0x54635c(0xe8)+_0x49f4d6);const _0x37b645=a40_0x2c775b(_0x54635c(0xee))[_0x54635c(0x11e)](),_0x2ca3e8=await resolveTargetVersion(_0xb81a68);if(!_0x2ca3e8){const _0x3dac17=_0xb81a68[_0x54635c(0xea)](_0x54635c(0x11a))?_0x54635c(0xf4):_0x54635c(0xf1);return _0x37b645[_0x54635c(0x107)](_0x3dac17),console[_0x54635c(0x111)](a40_0x6a23cc['gray'](_0x54635c(0x112)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x3dac17};}const _0x45eac8=a40_0x4ff535['valid'](VERSION),_0x214a2a=a40_0x4ff535[_0x54635c(0x119)](_0x2ca3e8['version']);if(!_0x45eac8||!_0x214a2a)return _0x37b645[_0x54635c(0x107)](_0x54635c(0x100)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x45eac8,_0x2ca3e8)){const _0x322457=_0x2ca3e8[_0x54635c(0xe7)]===_0x54635c(0x108)?_0x54635c(0xe1)+_0x2ca3e8[_0x54635c(0x108)]+')':_0x54635c(0x126)+_0x2ca3e8[_0x54635c(0x108)]+')';return _0x37b645[_0x54635c(0xef)](_0x322457),shouldSkipCliSkill(_0xb81a68)?console[_0x54635c(0x111)](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0xe6))):await installCliSkill(_0xb81a68['nonInteractive']),{'ok':!![]};}_0x37b645[_0x54635c(0xec)](getInstallPlanLabel(_0x49f4d6,_0x2ca3e8));const _0x474295=detectPackageManager(),_0x3a7fde=_0x474295===_0x54635c(0x10b)?resolveNpmBin(_0x54635c(0x10b)):_0x474295,_0x283b2f=a40_0x2c775b(_0x54635c(0x128)+_0x474295+_0x54635c(0xe0))[_0x54635c(0x11e)]();try{return await execa(_0x3a7fde,[_0x54635c(0x117),'-g',NPM_PACKAGE_NAME+'@'+_0x2ca3e8[_0x54635c(0x108)]],{'stdio':_0x54635c(0x104)}),_0x283b2f[_0x54635c(0xef)](_0x54635c(0x115)+_0x2ca3e8['version']),console['log'](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0xf2))),shouldSkipCliSkill(_0xb81a68)?console['log'](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0xe6))):await installCliSkill(_0xb81a68[_0x54635c(0x12e)]),{'ok':!![]};}catch(_0x45b3fb){return _0x283b2f[_0x54635c(0x107)](_0x54635c(0x12b)),console['error'](a40_0x6a23cc[_0x54635c(0xff)]('\x20\x20'+_0x45b3fb[_0x54635c(0xf9)])),console[_0x54635c(0x111)](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0x12c)+_0x474295+_0x54635c(0xe9)+NPM_PACKAGE_NAME+'@'+_0x2ca3e8[_0x54635c(0x108)])),{'ok':![],'message':_0x45b3fb[_0x54635c(0xf9)]};}}export const updateDefinition={'service':a40_0x57e0c3(0x12f),'command':a40_0x57e0c3(0xfa),'description':a40_0x57e0c3(0xe4),'risk':a40_0x57e0c3(0x130),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2cecc2,_0x4a387f){const _0x3df994=a41_0x2dd5,_0xf05863=_0x2cecc2();while(!![]){try{const _0x527212=-parseInt(_0x3df994(0x165))/0x1*(-parseInt(_0x3df994(0x164))/0x2)+-parseInt(_0x3df994(0x16a))/0x3*(parseInt(_0x3df994(0x16f))/0x4)+parseInt(_0x3df994(0x16b))/0x5*(-parseInt(_0x3df994(0x16e))/0x6)+-parseInt(_0x3df994(0x167))/0x7*(-parseInt(_0x3df994(0x16d))/0x8)+parseInt(_0x3df994(0x169))/0x9*(-parseInt(_0x3df994(0x16c))/0xa)+parseInt(_0x3df994(0x166))/0xb+parseInt(_0x3df994(0x168))/0xc;if(_0x527212===_0x4a387f)break;else _0xf05863['push'](_0xf05863['shift']());}catch(_0x9b29a7){_0xf05863['push'](_0xf05863['shift']());}}}(a41_0x43a3,0x44e75));function a41_0x2dd5(_0x4f2929,_0x4d0bf7){_0x4f2929=_0x4f2929-0x164;const _0x43a362=a41_0x43a3();let _0x2dd581=_0x43a362[_0x4f2929];return _0x2dd581;}import{codegenSdk}from'../../commands/codegen/sdk.js';function a41_0x43a3(){const _0x4e84c8=['6wxOMoM','673160qCyAGc','528172QbSqzt','2bqUCQi','2036925BEXTkf','37807lMGeUb','2264700mdIldw','168102jxvJGg','3acJNoa','2454720mOJtQM','190sZGwiP','584XozjTd'];a41_0x43a3=function(){return _0x4e84c8;};return a41_0x43a3();}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x450d1c=a42_0x2926;(function(_0x4b8704,_0x2c5885){const _0x45fd43=a42_0x2926,_0x3bb8e5=_0x4b8704();while(!![]){try{const _0x11862c=parseInt(_0x45fd43(0x151))/0x1*(parseInt(_0x45fd43(0x156))/0x2)+parseInt(_0x45fd43(0x145))/0x3+-parseInt(_0x45fd43(0x149))/0x4+-parseInt(_0x45fd43(0x152))/0x5+parseInt(_0x45fd43(0x148))/0x6+parseInt(_0x45fd43(0x15a))/0x7*(-parseInt(_0x45fd43(0x142))/0x8)+parseInt(_0x45fd43(0x14e))/0x9*(-parseInt(_0x45fd43(0x153))/0xa);if(_0x11862c===_0x2c5885)break;else _0x3bb8e5['push'](_0x3bb8e5['shift']());}catch(_0x1994b4){_0x3bb8e5['push'](_0x3bb8e5['shift']());}}}(a42_0x1654,0x69582));function a42_0x2926(_0x1e4677,_0x278716){_0x1e4677=_0x1e4677-0x142;const _0x16540c=a42_0x1654();let _0x292620=_0x16540c[_0x1e4677];return _0x292620;}function a42_0x1654(){const _0x357f25=['3760472xLvqdz','codegen','string','2169393fEJIiv','bool','skip-imports','3896442WcvPMA','74188iDpvat','str','Omit\x20import\x20statements\x20from\x20generated\x20code','sdk','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','27bFkAZb','operation','tableName','24509ciWSBP','872565iWUNqv','3622420NoxNGk','appCode','boolean','66POhNmH','code','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','7EgRPQY'];a42_0x1654=function(){return _0x357f25;};return a42_0x1654();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x450d1c(0x143),'command':a42_0x450d1c(0x14c),'description':a42_0x450d1c(0x158),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a42_0x450d1c(0x144),'description':a42_0x450d1c(0x159)},{'name':a42_0x450d1c(0x14f),'type':a42_0x450d1c(0x144),'required':!![],'description':a42_0x450d1c(0x14d)},{'name':a42_0x450d1c(0x147),'type':a42_0x450d1c(0x155),'description':a42_0x450d1c(0x14b)}],async 'execute'(_0x5c6f54){const _0x3d26ac=a42_0x450d1c,{dataset:_0x3b9ab9,operation:_0xeb60c7}=await getOperationDetail(_0x5c6f54[_0x3d26ac(0x154)],_0x5c6f54[_0x3d26ac(0x14a)](_0x3d26ac(0x157)),_0x5c6f54[_0x3d26ac(0x14a)](_0x3d26ac(0x14f))),_0x5e3093=generateSdkCode(_0x3b9ab9,_0xeb60c7,{'includeImports':!_0x5c6f54[_0x3d26ac(0x146)](_0x3d26ac(0x147))});return{'ok':!![],'data':{'dataset':{'name':_0x3b9ab9['name'],'code':_0x3b9ab9[_0x3d26ac(0x157)],'tableName':_0x3b9ab9[_0x3d26ac(0x150)]},'operation':_0x5c6f54[_0x3d26ac(0x14a)](_0x3d26ac(0x14f)),'code':_0x5e3093}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x1c7f10=a43_0x5367;function a43_0x5367(_0x28373d,_0x53b6d3){_0x28373d=_0x28373d-0x83;const _0x520cf0=a43_0x520c();let _0x53677d=_0x520cf0[_0x28373d];return _0x53677d;}(function(_0x53c4c0,_0x52f565){const _0x5b1b33=a43_0x5367,_0x4bf7a1=_0x53c4c0();while(!![]){try{const _0x3c5eb2=parseInt(_0x5b1b33(0x94))/0x1*(-parseInt(_0x5b1b33(0x89))/0x2)+-parseInt(_0x5b1b33(0x8e))/0x3+-parseInt(_0x5b1b33(0x8c))/0x4*(parseInt(_0x5b1b33(0x9c))/0x5)+parseInt(_0x5b1b33(0x83))/0x6*(parseInt(_0x5b1b33(0x8b))/0x7)+-parseInt(_0x5b1b33(0x8a))/0x8+-parseInt(_0x5b1b33(0x9b))/0x9+parseInt(_0x5b1b33(0x88))/0xa*(parseInt(_0x5b1b33(0x90))/0xb);if(_0x3c5eb2===_0x52f565)break;else _0x4bf7a1['push'](_0x4bf7a1['shift']());}catch(_0x4a1552){_0x4bf7a1['push'](_0x4bf7a1['shift']());}}}(a43_0x520c,0x416c1));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x520c(){const _0xc2bd55=['str','7366240BPjtUF','166ikTuGN','1536128vRhiSe','7XLXcxB','70528DdeoBX','appCode','482568qRKqJb','sqlcode','22UFFUaS','sqlName','no-imports','sqlCode','4803QgwDfg','string','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sdk','bff','sql','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','3043206rPkSfc','45JqoKWb','codegen','boolean','258384NaCXmg','bool','read','Omit\x20import\x20statements\x20from\x20generated\x20code'];a43_0x520c=function(){return _0xc2bd55;};return a43_0x520c();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x1c7f10(0x9d),'command':a43_0x1c7f10(0x99),'description':a43_0x1c7f10(0x9a),'risk':a43_0x1c7f10(0x85),'flags':[SQLCODE_FLAG,{'name':'target','type':a43_0x1c7f10(0x95),'description':a43_0x1c7f10(0x96),'default':a43_0x1c7f10(0x97),'enum':[a43_0x1c7f10(0x97),a43_0x1c7f10(0x98)]},{'name':a43_0x1c7f10(0x92),'type':a43_0x1c7f10(0x9e),'description':a43_0x1c7f10(0x86)}],async 'execute'(_0x131cb2){const _0xf0858b=a43_0x1c7f10,_0x877418=await getSqlQueryInfo(_0x131cb2[_0xf0858b(0x8d)],_0x131cb2[_0xf0858b(0x87)](_0xf0858b(0x8f))),_0x49403a=_0x131cb2['str']('target')||_0xf0858b(0x97),_0x2bed89=generateSqlCodeTemplate(_0x877418,{'target':_0x49403a,'includeImports':!_0x131cb2[_0xf0858b(0x84)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x877418[_0xf0858b(0x93)],'sqlName':_0x877418[_0xf0858b(0x91)],'target':_0x49403a,'code':_0x2bed89}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a6186,_0x530eb3){const _0x13478d=a44_0x1701,_0x452fee=_0x1a6186();while(!![]){try{const _0x1d2deb=-parseInt(_0x13478d(0x192))/0x1*(-parseInt(_0x13478d(0x193))/0x2)+-parseInt(_0x13478d(0x1ae))/0x3+-parseInt(_0x13478d(0x199))/0x4*(parseInt(_0x13478d(0x187))/0x5)+parseInt(_0x13478d(0x19a))/0x6+-parseInt(_0x13478d(0x1a6))/0x7+parseInt(_0x13478d(0x19d))/0x8*(parseInt(_0x13478d(0x18b))/0x9)+-parseInt(_0x13478d(0x18d))/0xa;if(_0x1d2deb===_0x530eb3)break;else _0x452fee['push'](_0x452fee['shift']());}catch(_0xa45f6f){_0x452fee['push'](_0x452fee['shift']());}}}(a44_0x3f63,0x54ce3));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x319f65=a44_0x1701;return[{'name':_0x319f65(0x197),'type':_0x319f65(0x19b),'description':'App\x20code','required':!![]},{'name':_0x319f65(0x1a8),'type':_0x319f65(0x18e),'description':_0x319f65(0x19c),'default':![]},...getAppProfileFlagDefs()];}function a44_0x1701(_0x3e0906,_0x4a2bf5){_0x3e0906=_0x3e0906-0x187;const _0x3f6318=a44_0x3f63();let _0x17012b=_0x3f6318[_0x3e0906];return _0x17012b;}export function buildAppRemoveFlags(){const _0x5c1b6a=a44_0x1701;return[{'name':_0x5c1b6a(0x1a8),'type':_0x5c1b6a(0x18e),'description':_0x5c1b6a(0x19c),'default':![]}];}export async function validateAppName(_0x1019b0,_0x4716d6){const _0x3a5aa5=a44_0x1701,_0x2bf1c7=_0x1019b0[_0x3a5aa5(0x196)][0x0]?.['trim']();if(!_0x2bf1c7)throw CliErrors[_0x3a5aa5(0x19f)](_0x3a5aa5(0x1af),_0x3a5aa5(0x1b1)+CLI_BIN_NAME+'\x20'+_0x4716d6+_0x3a5aa5(0x190));}export async function runAppAdd(_0x47a121,_0x242b5f){const _0x37373c=a44_0x1701,_0x75a1c9=_0x47a121[_0x37373c(0x196)][0x0]?.[_0x37373c(0x1ad)]();if(!_0x75a1c9)throw CliErrors[_0x37373c(0x19f)]('Missing\x20app\x20name.',_0x37373c(0x1b1)+CLI_BIN_NAME+'\x20'+_0x242b5f+_0x37373c(0x195));const _0x529dd1=_0x47a121['str']('appcode');if(!_0x529dd1)throw CliErrors['flagMissing'](_0x37373c(0x197),_0x37373c(0x1b1)+CLI_BIN_NAME+'\x20'+_0x242b5f+'\x20<name>\x20--appcode\x20<code>');const _0x48d81f={'global':_0x47a121[_0x37373c(0x1a0)](_0x37373c(0x1a8))},_0x5b2fac=readConfig(_0x48d81f);if(!_0x5b2fac['apps'])_0x5b2fac[_0x37373c(0x18f)]={};const _0x525965={'appcode':_0x529dd1,...collectAppProfileOverrides(_0x574409=>_0x47a121[_0x37373c(0x189)](_0x574409))},_0x4af99b=_0x5b2fac[_0x37373c(0x18f)],_0x2cad50=!!_0x4af99b[_0x75a1c9];_0x4af99b[_0x75a1c9]=_0x525965;if(!_0x5b2fac[_0x37373c(0x1a9)])_0x5b2fac['defaultApp']=_0x75a1c9;writeConfig(_0x5b2fac,_0x48d81f);const _0x1e639a=!_0x2cad50&&_0x5b2fac[_0x37373c(0x1a9)]===_0x75a1c9?_0x37373c(0x1ac):'',_0x34c778=(_0x2cad50?_0x37373c(0x1a3):_0x37373c(0x191))+_0x37373c(0x1b0)+_0x75a1c9+_0x37373c(0x1a7)+_0x529dd1+')'+scopeLabel(_0x48d81f)+'.'+_0x1e639a;return{'ok':!![],'message':_0x34c778};}export async function runAppRemove(_0x455b6a,_0x4acfa4){const _0x5a502c=a44_0x1701,_0xeaeb71=_0x455b6a[_0x5a502c(0x196)][0x0]?.['trim']();if(!_0xeaeb71)throw CliErrors[_0x5a502c(0x19f)](_0x5a502c(0x1af),_0x5a502c(0x1b1)+CLI_BIN_NAME+'\x20'+_0x4acfa4+'\x20<name>\x20[--global]');const _0x38f205=_0x455b6a['bool'](_0x5a502c(0x1a8)),{config:_0x5dce50,layers:_0x14f3f1}=readRawConfigWithLayers(),_0x7b108d=_0x5dce50[_0x5a502c(0x18f)]??{};if(!_0x7b108d[_0xeaeb71])throw CliErrors[_0x5a502c(0x19f)](_0x5a502c(0x1a4)+_0xeaeb71+_0x5a502c(0x1aa));const _0xbcd41d=_0x14f3f1[_0x5a502c(0x18a)][_0x5a502c(0x18f)]&&typeof _0x14f3f1[_0x5a502c(0x18a)][_0x5a502c(0x18f)]===_0x5a502c(0x1a5)?_0x14f3f1[_0x5a502c(0x18a)]['apps']:{},_0x6d3691=_0x14f3f1[_0x5a502c(0x1a2)][_0x5a502c(0x18f)]&&typeof _0x14f3f1[_0x5a502c(0x1a2)][_0x5a502c(0x18f)]===_0x5a502c(0x1a5)?_0x14f3f1[_0x5a502c(0x1a2)][_0x5a502c(0x18f)]:{},_0x5ba27d=appDefinedIn(_0xeaeb71,_0xbcd41d,_0x6d3691,_0x14f3f1[_0x5a502c(0x1a2)]['inherit']===![]),_0x2a2633=resolveAppScopeForWrite(_0xeaeb71,_0x38f205,_0x14f3f1),_0x394553={'global':_0x2a2633==='global'},_0x1ef108=readConfig(_0x394553),_0x1a16f3=_0x1ef108[_0x5a502c(0x18f)];if(!_0x1a16f3||!_0x1a16f3[_0xeaeb71])throw CliErrors['validation'](_0x5a502c(0x1a4)+_0xeaeb71+_0x5a502c(0x1aa));delete _0x1a16f3[_0xeaeb71];let _0x2bdfb3='';if(_0x1ef108[_0x5a502c(0x1a9)]===_0xeaeb71){const _0xe132b4=Object[_0x5a502c(0x1a1)](_0x1a16f3);_0x1ef108['defaultApp']=_0xe132b4[_0x5a502c(0x198)]>0x0?_0xe132b4[0x0]:undefined,_0x1ef108['defaultApp']?_0x2bdfb3='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x1ef108[_0x5a502c(0x1a9)]+'\x22.':delete _0x1ef108[_0x5a502c(0x1a9)];}Object[_0x5a502c(0x1a1)](_0x1a16f3)[_0x5a502c(0x198)]===0x0&&(delete _0x1ef108[_0x5a502c(0x18f)],delete _0x1ef108['defaultApp']);writeConfig(_0x1ef108,_0x394553);const _0x19b2ba=_0x5ba27d===_0x5a502c(0x19e)?'\x20Note:\x20app\x20\x22'+_0xeaeb71+_0x5a502c(0x18c)+(_0x2a2633===_0x5a502c(0x188)?_0x5a502c(0x1a8):'project')+_0x5a502c(0x1ab):'';return{'ok':!![],'message':_0x5a502c(0x194)+_0xeaeb71+'\x22'+scopeLabel(_0x394553)+'.'+_0x2bdfb3+_0x19b2ba};}function a44_0x3f63(){const _0x5e1bb9=['string','Use\x20global\x20config\x20scope','4864Omnljx','both','validation','bool','keys','projectConfig','Updated','App\x20\x22','object','793653JuwcqI','\x22\x20(appcode:\x20','global','defaultApp','\x22\x20not\x20found.','\x20config.','\x20Set\x20as\x20default\x20app.','trim','609081HwCKpX','Missing\x20app\x20name.','\x20app\x20\x22','Usage:\x20','360170GrcbnF','project','str','globalConfig','8919guJGaR','\x22\x20still\x20defined\x20in\x20','8804660NozOln','boolean','apps','\x20<name>','Added','53003AmADZK','26RtVOqv','Removed\x20app\x20\x22','\x20<name>\x20--appcode\x20<code>','args','appcode','length','20jYyVMj','3677028cNOEeN'];a44_0x3f63=function(){return _0x5e1bb9;};return a44_0x3f63();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a0c24,_0x5d5f7a){const _0x16fbaf=a45_0x4ad6,_0x108ff8=_0x2a0c24();while(!![]){try{const _0x534663=parseInt(_0x16fbaf(0xb5))/0x1*(-parseInt(_0x16fbaf(0xc0))/0x2)+-parseInt(_0x16fbaf(0x9e))/0x3*(parseInt(_0x16fbaf(0xa4))/0x4)+-parseInt(_0x16fbaf(0xb8))/0x5*(parseInt(_0x16fbaf(0xaf))/0x6)+parseInt(_0x16fbaf(0xb2))/0x7*(parseInt(_0x16fbaf(0xa0))/0x8)+-parseInt(_0x16fbaf(0xac))/0x9*(-parseInt(_0x16fbaf(0xbf))/0xa)+parseInt(_0x16fbaf(0xbd))/0xb*(parseInt(_0x16fbaf(0xa3))/0xc)+-parseInt(_0x16fbaf(0xa6))/0xd*(parseInt(_0x16fbaf(0xbb))/0xe);if(_0x534663===_0x5d5f7a)break;else _0x108ff8['push'](_0x108ff8['shift']());}catch(_0x48bee0){_0x108ff8['push'](_0x108ff8['shift']());}}}(a45_0xb18d,0x9de9f));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x444ff2 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';function a45_0xb18d(){const _0x3c52ea=['无法获取远程应用列表,请手动输入。','401492rxgORz','获取到\x20','请选择要绑定的应用:','skip','map','includes','999flGxus','length','\x20\x20(','52566oSpYBe','appName','message','7MMDJOm','✎\x20自定义输入\x20appcode','custom','636193ZESxQe','gray','\x0a未找到可用应用。','85KDaIoz','trim','cyan','28VgrJKw','yellow','11308231CPQkZh','Invalid\x20App\x20Code','81070CuKIfW','4SlCpaH','请输入\x20App\x20Code:','find','正在获取可用应用列表...','appCode','12zxVXnE','未找到可用应用。','8968736JpCiAv','(跳过,稍后配置)','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','12cpvjwb','919084lddrlO'];a45_0xb18d=function(){return _0x3c52ea;};return a45_0xb18d();}import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x782c92=a45_0x4ad6,_0x1b1be5=await input({'message':_0x782c92(0xc1),'validate':_0x108273=>{const _0x28be1d=_0x782c92,_0x5391a5=validateAppcode(_0x108273['trim']());return _0x5391a5['valid']||_0x5391a5[_0x28be1d(0xb1)]||_0x28be1d(0xbe);}});return _0x1b1be5[_0x782c92(0xb9)]();}export async function promptAppSelection(_0x2cc8e1){const _0x4521ff=a45_0x4ad6,_0x49db99=[{'name':a45_0x444ff2[_0x4521ff(0xbc)](_0x4521ff(0xb3)),'value':-0x1},..._0x2cc8e1['map']((_0x25d6d5,_0x51dbcc)=>({'name':_0x25d6d5[_0x4521ff(0xb0)]+'\x20\x20'+a45_0x444ff2[_0x4521ff(0xb6)]('('+_0x25d6d5['appCode']+')'),'value':_0x51dbcc}))],_0x395748=await checkbox({'message':_0x4521ff(0xa7)+a45_0x444ff2[_0x4521ff(0xba)](_0x2cc8e1[_0x4521ff(0xad)])+_0x4521ff(0xa2),'choices':_0x49db99,'loop':![]});if(_0x395748[_0x4521ff(0xab)](-0x1))return _0x4521ff(0xb4);if(_0x395748[_0x4521ff(0xad)]===0x0)return _0x4521ff(0xb4);return _0x395748[_0x4521ff(0xaa)](_0x1b0dd1=>_0x2cc8e1[_0x1b0dd1]);}function a45_0x4ad6(_0x3c6a4e,_0xbc9a65){_0x3c6a4e=_0x3c6a4e-0x9d;const _0xb18d2e=a45_0xb18d();let _0x4ad65a=_0xb18d2e[_0x3c6a4e];return _0x4ad65a;}export async function promptSingleAppSelection(_0x12f0f9){const _0x329f90=a45_0x4ad6,_0x543f29=[{'name':a45_0x444ff2[_0x329f90(0xb6)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x329f90(0xa9)},{'name':a45_0x444ff2[_0x329f90(0xbc)]('✎\x20自定义输入\x20appcode'),'value':_0x329f90(0xb4)},..._0x12f0f9[_0x329f90(0xaa)](_0x1459be=>({'name':_0x1459be[_0x329f90(0xb0)]+'\x20\x20'+a45_0x444ff2[_0x329f90(0xb6)]('('+_0x1459be[_0x329f90(0x9d)]+')'),'value':_0x1459be['appCode']}))],_0xe73ce5=await select({'message':_0x329f90(0xa8),'choices':_0x543f29});if(_0xe73ce5===_0x329f90(0xa9))return'skip';if(_0xe73ce5===_0x329f90(0xb4))return _0x329f90(0xb4);return _0x12f0f9[_0x329f90(0xc2)](_0x1e797d=>_0x1e797d[_0x329f90(0x9d)]===_0xe73ce5);}export async function selectSingleAppcode(_0x494aac){const _0x42e077=a45_0x4ad6;if(!_0x494aac)return writeCliSideChannelLine(a45_0x444ff2[_0x42e077(0xb6)]('(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)')),_fallbackOrSkip();writeCliSideChannelLine('正在获取可用应用列表...');let _0x14868b;try{_0x14868b=await withActiveCookie(_0x494aac,()=>listRemoteApps());}catch(_0x2a5f6e){writeCliSideChannelLine(a45_0x444ff2[_0x42e077(0xbc)](_0x42e077(0xa5)));if(_0x2a5f6e instanceof Error)writeCliSideChannelLine(a45_0x444ff2[_0x42e077(0xb6)](_0x42e077(0xae)+_0x2a5f6e[_0x42e077(0xb1)]+')'));return _fallbackOrSkip();}if(_0x14868b[_0x42e077(0xad)]===0x0)return writeCliSideChannelLine(a45_0x444ff2[_0x42e077(0xbc)](_0x42e077(0x9f))),_fallbackOrSkip();const _0x4ce3ce=await promptSingleAppSelection(_0x14868b);if(_0x4ce3ce==='skip')return'';if(_0x4ce3ce===_0x42e077(0xb4))return promptCustomAppcode();return _0x4ce3ce[_0x42e077(0x9d)];}export async function selectMultipleApps(_0x51caf9){const _0x2cb4f4=a45_0x4ad6;writeCliSideChannelLine(_0x2cb4f4(0xc3));let _0x5b569b;try{_0x5b569b=await withActiveCookie(_0x51caf9,()=>listRemoteApps());}catch(_0x5156bd){writeCliSideChannelLine('\x0a无法获取远程应用列表,请手动输入。');if(_0x5156bd instanceof Error)writeCliSideChannelLine(_0x2cb4f4(0xae)+_0x5156bd[_0x2cb4f4(0xb1)]+')');return _0x2cb4f4(0xb4);}if(_0x5b569b[_0x2cb4f4(0xad)]===0x0)return writeCliSideChannelLine(_0x2cb4f4(0xb7)),'custom';return promptAppSelection(_0x5b569b);}async function _fallbackOrSkip(){const _0x3487b4=a45_0x4ad6,_0x3eb9ff=await select({'message':'App\x20Code:','choices':[{'name':a45_0x444ff2[_0x3487b4(0xb6)](_0x3487b4(0xa1)),'value':_0x3487b4(0xa9)},{'name':a45_0x444ff2['yellow']('✎\x20手动输入'),'value':'manual'}]});if(_0x3eb9ff===_0x3487b4(0xa9))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x14bab6=a46_0xa43e;function a46_0x4bd0(){const _0xee02f5=['\x27\x5c\x27\x27','PENDING','errorMessage','3866128OpKPpZ','trim','998260dyYAEk','\x20completed\x20successfully.','toUpperCase','2218440aRVzYS','308900bEzOgf','PROCESSING','\x20failed:\x20','apiError','118317pVdvcW','has','\x20--format\x20compress','string','\x20--appcode\x20','\x20is\x20processing.','taskId','SUCCESS','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','145668pHiiHm','\x20response\x20did\x20not\x20contain\x20a\x20status.','Task\x20','16ZSGbBs','status','replace','7oEYsab','FAILED','5360535hOooCV'];a46_0x4bd0=function(){return _0xee02f5;};return a46_0x4bd0();}(function(_0x54349e,_0x45108d){const _0x9562e=a46_0xa43e,_0x42091e=_0x54349e();while(!![]){try{const _0x19ec45=-parseInt(_0x9562e(0xeb))/0x1+parseInt(_0x9562e(0xfb))/0x2*(-parseInt(_0x9562e(0xef))/0x3)+-parseInt(_0x9562e(0xf8))/0x4+parseInt(_0x9562e(0xe7))/0x5+-parseInt(_0x9562e(0xea))/0x6+-parseInt(_0x9562e(0xdf))/0x7*(-parseInt(_0x9562e(0xe5))/0x8)+parseInt(_0x9562e(0xe1))/0x9;if(_0x19ec45===_0x45108d)break;else _0x42091e['push'](_0x42091e['shift']());}catch(_0x343955){_0x42091e['push'](_0x42091e['shift']());}}}(a46_0x4bd0,0x3c89c));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set(['SUCCESS',a46_0x14bab6(0xe0)]),NON_TERMINAL_STATUSES=new Set([a46_0x14bab6(0xe3),'PROCESSING']);function a46_0xa43e(_0x583862,_0x891553){_0x583862=_0x583862-0xdf;const _0x4bd0af=a46_0x4bd0();let _0xa43e5b=_0x4bd0af[_0x583862];return _0xa43e5b;}export function normalizeAsyncTask(_0x10f9dc){const _0x5e164a=a46_0x14bab6,_0x47c3ed=typeof _0x10f9dc?.[_0x5e164a(0xf5)]==='string'?_0x10f9dc['taskId'][_0x5e164a(0xe6)]():'';if(!_0x47c3ed)throw CliErrors[_0x5e164a(0xee)](_0x5e164a(0xf7));const _0x3c434d=typeof _0x10f9dc[_0x5e164a(0xfc)]===_0x5e164a(0xf2)?_0x10f9dc[_0x5e164a(0xfc)][_0x5e164a(0xe6)]()[_0x5e164a(0xe9)]():'';if(!_0x3c434d)throw CliErrors[_0x5e164a(0xee)]('Async\x20task\x20'+_0x47c3ed+_0x5e164a(0xf9));return{'taskId':_0x47c3ed,'status':_0x3c434d,'errorMessage':typeof _0x10f9dc[_0x5e164a(0xe4)]===_0x5e164a(0xf2)&&_0x10f9dc[_0x5e164a(0xe4)]['trim']()?_0x10f9dc['errorMessage'][_0x5e164a(0xe6)]():null,'isTerminal':TERMINAL_STATUSES[_0x5e164a(0xf0)](_0x3c434d),'knownStatus':TERMINAL_STATUSES[_0x5e164a(0xf0)](_0x3c434d)||NON_TERMINAL_STATUSES[_0x5e164a(0xf0)](_0x3c434d)};}export function buildAsyncTaskStatusCommand(_0x1c699a,_0x105e4d){const _0x2b06d8=a46_0x14bab6;return CLI_BIN_NAME+'\x20task\x20status\x20--task-id\x20'+quoteShellArg(_0x1c699a)+_0x2b06d8(0xf3)+quoteShellArg(_0x105e4d)+_0x2b06d8(0xf1);}export function asyncTaskMessage(_0x361c73){const _0x2a0a93=a46_0x14bab6;switch(_0x361c73[_0x2a0a93(0xfc)]){case _0x2a0a93(0xe3):return _0x2a0a93(0xfa)+_0x361c73[_0x2a0a93(0xf5)]+'\x20is\x20pending.';case _0x2a0a93(0xec):return'Task\x20'+_0x361c73[_0x2a0a93(0xf5)]+_0x2a0a93(0xf4);case _0x2a0a93(0xf6):return _0x2a0a93(0xfa)+_0x361c73['taskId']+_0x2a0a93(0xe8);case _0x2a0a93(0xe0):return _0x361c73['errorMessage']?_0x2a0a93(0xfa)+_0x361c73[_0x2a0a93(0xf5)]+_0x2a0a93(0xed)+_0x361c73[_0x2a0a93(0xe4)]:_0x2a0a93(0xfa)+_0x361c73[_0x2a0a93(0xf5)]+'\x20failed.';default:return _0x2a0a93(0xfa)+_0x361c73['taskId']+'\x20returned\x20unknown\x20status\x20'+_0x361c73[_0x2a0a93(0xfc)]+'.';}}function quoteShellArg(_0x295b97){const _0x4e4df8=a46_0x14bab6;return'\x27'+_0x295b97[_0x4e4df8(0xfd)](/'/g,_0x4e4df8(0xe2))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30aa01,_0x1e1903){var _0x423d1d=a47_0x4152,_0x431e35=_0x30aa01();while(!![]){try{var _0x19733b=-parseInt(_0x423d1d(0x9a))/0x1+-parseInt(_0x423d1d(0x9b))/0x2*(parseInt(_0x423d1d(0xa1))/0x3)+-parseInt(_0x423d1d(0xa0))/0x4*(parseInt(_0x423d1d(0x95))/0x5)+parseInt(_0x423d1d(0x9c))/0x6+-parseInt(_0x423d1d(0x98))/0x7+-parseInt(_0x423d1d(0x99))/0x8*(parseInt(_0x423d1d(0x97))/0x9)+parseInt(_0x423d1d(0x96))/0xa;if(_0x19733b===_0x1e1903)break;else _0x431e35['push'](_0x431e35['shift']());}catch(_0x341518){_0x431e35['push'](_0x431e35['shift']());}}}(a47_0x451f,0x20468));function a47_0x4152(_0x27f30a,_0x3e1037){_0x27f30a=_0x27f30a-0x94;var _0x451faa=a47_0x451f();var _0x4152f5=_0x451faa[_0x27f30a];return _0x4152f5;}export function asDryRunResult(_0x37138a,_0x4f53f6){var _0x57c332=a47_0x4152;return Object[_0x57c332(0x9f)](_0x37138a,{'method':{'value':_0x4f53f6[_0x57c332(0x9e)],'enumerable':![]},'url':{'value':_0x4f53f6[_0x57c332(0x9d)],'enumerable':![]},..._0x4f53f6[_0x57c332(0x94)]?{'description':{'value':_0x4f53f6[_0x57c332(0x94)],'enumerable':![]}}:{}});}function a47_0x451f(){var _0x43e300=['method','defineProperties','10616OrnCXH','682647KNRukB','description','315yaNnqr','7365710shIwqE','27WjEfZb','1578948EIXSSd','495632cpYEmc','29279ubXLyb','2BmCeax','1386510MeKhJL','url'];a47_0x451f=function(){return _0x43e300;};return a47_0x451f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a48_0x48b4(){const _0x90f514=['MYSQL','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','App\x20code\x20(e.g.\x20app-xxxxx)','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','6DplTJy','15194502zPKHTI','Dataset\x20code\x20(32-char\x20hex\x20UUID)','7CieUfQ','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','11598pacGlg','datasetcode','8721894pNDNyM','6624980bMEpFO','dbtype','number','31HwgvHC','108948jYCqkF','3940240ZJKMUy','string','5080952WfpOBH','sqlcode','POSTGRESQL'];a48_0x48b4=function(){return _0x90f514;};return a48_0x48b4();}const a48_0x240a8c=a48_0xff64;function a48_0xff64(_0x54c712,_0x486913){_0x54c712=_0x54c712-0x1d9;const _0x48b401=a48_0x48b4();let _0xff64bf=_0x48b401[_0x54c712];return _0xff64bf;}(function(_0x53ee14,_0x5df02e){const _0x43674e=a48_0xff64,_0x1358e5=_0x53ee14();while(!![]){try{const _0x960f9f=parseInt(_0x43674e(0x1da))/0x1*(-parseInt(_0x43674e(0x1eb))/0x2)+parseInt(_0x43674e(0x1e5))/0x3*(parseInt(_0x43674e(0x1db))/0x4)+-parseInt(_0x43674e(0x1dc))/0x5+parseInt(_0x43674e(0x1ed))/0x6*(parseInt(_0x43674e(0x1e8))/0x7)+-parseInt(_0x43674e(0x1de))/0x8+parseInt(_0x43674e(0x1e6))/0x9+-parseInt(_0x43674e(0x1ee))/0xa;if(_0x960f9f===_0x5df02e)break;else _0x1358e5['push'](_0x1358e5['shift']());}catch(_0x23a583){_0x1358e5['push'](_0x1358e5['shift']());}}}(a48_0x48b4,0xe3497));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a48_0x240a8c(0x1e4)};export const CODE_FLAG={'name':'code','type':a48_0x240a8c(0x1dd),'required':!![],'description':a48_0x240a8c(0x1e7),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a48_0x240a8c(0x1ec),'description':a48_0x240a8c(0x1e7)};export const SQLCODE_FLAG={'name':a48_0x240a8c(0x1df),'type':a48_0x240a8c(0x1dd),'required':!![],'description':a48_0x240a8c(0x1ea),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const APPCODE_FLAG_OPTIONAL={'name':'appcode','type':a48_0x240a8c(0x1dd),'required':![],'description':a48_0x240a8c(0x1e2)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x240a8c(0x1e3)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x240a8c(0x1d9),'required':!![],'description':a48_0x240a8c(0x1e9)};export const DB_TYPE_FLAG={'name':a48_0x240a8c(0x1ef),'type':a48_0x240a8c(0x1dd),'required':!![],'description':'Database\x20product\x20type','enum':[a48_0x240a8c(0x1e1),a48_0x240a8c(0x1e0)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2be08c,_0x4efbbf){const _0x23947a=a49_0x1988,_0x324339=_0x2be08c();while(!![]){try{const _0x56470e=parseInt(_0x23947a(0x1b5))/0x1*(-parseInt(_0x23947a(0x1c4))/0x2)+-parseInt(_0x23947a(0x1b6))/0x3+parseInt(_0x23947a(0x1c2))/0x4*(-parseInt(_0x23947a(0x1c0))/0x5)+-parseInt(_0x23947a(0x1c1))/0x6*(parseInt(_0x23947a(0x1c5))/0x7)+parseInt(_0x23947a(0x1b8))/0x8*(-parseInt(_0x23947a(0x1b3))/0x9)+parseInt(_0x23947a(0x1c3))/0xa+parseInt(_0x23947a(0x1bb))/0xb;if(_0x56470e===_0x4efbbf)break;else _0x324339['push'](_0x324339['shift']());}catch(_0x26da83){_0x324339['push'](_0x324339['shift']());}}}(a49_0x2d2f,0xc99b5));import{existsSync,statSync}from'node:fs';function a49_0x1988(_0x1435ff,_0x8b8c20){_0x1435ff=_0x1435ff-0x1b3;const _0x2d2fb6=a49_0x2d2f();let _0x1988a2=_0x2d2fb6[_0x1435ff];return _0x1988a2;}function a49_0x2d2f(){const _0x404052=['File\x20not\x20found:\x20','toFixed','20180lPmomU','1535652usFeQy','1128oEkJCW','13713310VjKcvO','5396cXYgmy','14UcPuYp','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','trim','2267523KyVqYN','File\x20is\x20not\x20a\x20regular\x20file:\x20','55vTiHVs','2839380ysRluo','\x20MB','16jTprYQ','\x20path\x20is\x20required.','validation','29735530rwCiUe','isFile','size'];a49_0x2d2f=function(){return _0x404052;};return a49_0x2d2f();}import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x5e6701){const _0x2defee=a49_0x1988;if(_0x5e6701>=BYTES_PER_MB){const _0x1b9951=Math['ceil'](_0x5e6701/BYTES_PER_MB*0x64)/0x64;return _0x1b9951[_0x2defee(0x1bf)](0x2)+_0x2defee(0x1b7);}return _0x5e6701+'\x20B';}export function requireDevelopmentUploadFile(_0x55d50c,_0x5ad342){const _0x108df6=a49_0x1988,_0x37cea7=_0x55d50c[_0x108df6(0x1c7)]();if(!_0x37cea7)throw CliErrors[_0x108df6(0x1ba)](_0x5ad342+_0x108df6(0x1b9));if(!existsSync(_0x37cea7))throw CliErrors['validation'](_0x108df6(0x1be)+_0x37cea7);const _0x5073e3=statSync(_0x37cea7);if(!_0x5073e3[_0x108df6(0x1bc)]())throw CliErrors['validation'](_0x108df6(0x1b4)+_0x37cea7);if(_0x5073e3['size']>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x108df6(0x1ba)](_0x108df6(0x1c6)+_0x37cea7+'\x20('+formatBytes(_0x5073e3[_0x108df6(0x1bd)])+')');return{'path':_0x37cea7,'size':_0x5073e3[_0x108df6(0x1bd)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a50_0x32ec(_0x454193,_0xec4038){_0x454193=_0x454193-0xcd;const _0x44f2f0=a50_0x44f2();let _0x32ecc6=_0x44f2f0[_0x454193];return _0x32ecc6;}(function(_0x293b1a,_0x2a1cf3){const _0x3b37ca=a50_0x32ec,_0x11ba21=_0x293b1a();while(!![]){try{const _0x1c5a03=parseInt(_0x3b37ca(0xd3))/0x1+parseInt(_0x3b37ca(0xd4))/0x2+-parseInt(_0x3b37ca(0xd7))/0x3*(parseInt(_0x3b37ca(0xd2))/0x4)+parseInt(_0x3b37ca(0xdc))/0x5*(-parseInt(_0x3b37ca(0xd6))/0x6)+-parseInt(_0x3b37ca(0xd0))/0x7+parseInt(_0x3b37ca(0xd8))/0x8*(-parseInt(_0x3b37ca(0xdb))/0x9)+parseInt(_0x3b37ca(0xd9))/0xa*(parseInt(_0x3b37ca(0xd1))/0xb);if(_0x1c5a03===_0x2a1cf3)break;else _0x11ba21['push'](_0x11ba21['shift']());}catch(_0x264382){_0x11ba21['push'](_0x11ba21['shift']());}}}(a50_0x44f2,0xb402b));function a50_0x44f2(){const _0x316d93=['1637660cXKpyw','length','90nPWvJA','420PrQudz','trim','test','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','1220324PpqWxR','99GxSuSw','12mDDaEG','1408253msLFcp','1962086lbVaDF','App\x20Code\x20cannot\x20exceed\x20100\x20characters','89844uHecyb','377529awCRXv','1052952FGZAeP'];a50_0x44f2=function(){return _0x316d93;};return a50_0x44f2();}export function validateAppcode(_0x48155d){const _0x40d4d0=a50_0x32ec,_0x51526f=_0x48155d[_0x40d4d0(0xcd)]();if(!_0x51526f)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0x51526f[_0x40d4d0(0xda)]>0x64)return{'valid':![],'message':_0x40d4d0(0xd5)};if(!/^[A-Za-z0-9_-]+$/[_0x40d4d0(0xce)](_0x51526f))return{'valid':![],'message':_0x40d4d0(0xcf)};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a51_0x290c93=a51_0x10f1;function a51_0x39a8(){const _0xe6e3cd=['5ezCVLJ','Get\x20a\x20config\x20value\x20by\x20key','134948jTlQdj','2331432QwUDIN','\x20config\x20get\x20--key\x20<key>','Key\x20not\x20found:\x20','get','35fneBdL','10kObqsE','appcode','string','4170228YQGpec','57UxQQhO','3726027kDaiMh','Missing\x20key.','9151753DZFcLk','11uYinXI','4gBlfJy','str','305411gnvPhr','862536DaLOKX','object','app','28Idxqvh','config'];a51_0x39a8=function(){return _0xe6e3cd;};return a51_0x39a8();}(function(_0x1bd9ab,_0x3ecbc7){const _0x20f897=a51_0x10f1,_0x3ea2e7=_0x1bd9ab();while(!![]){try{const _0x2a1847=parseInt(_0x20f897(0xa4))/0x1*(parseInt(_0x20f897(0xa2))/0x2)+-parseInt(_0x20f897(0xb6))/0x3*(parseInt(_0x20f897(0xac))/0x4)+-parseInt(_0x20f897(0xaa))/0x5*(parseInt(_0x20f897(0xad))/0x6)+-parseInt(_0x20f897(0xb1))/0x7*(parseInt(_0x20f897(0xa5))/0x8)+parseInt(_0x20f897(0xb7))/0x9*(-parseInt(_0x20f897(0xb2))/0xa)+parseInt(_0x20f897(0xa1))/0xb*(parseInt(_0x20f897(0xb5))/0xc)+-parseInt(_0x20f897(0xb9))/0xd*(-parseInt(_0x20f897(0xa8))/0xe);if(_0x2a1847===_0x3ecbc7)break;else _0x3ea2e7['push'](_0x3ea2e7['shift']());}catch(_0x35c8c1){_0x3ea2e7['push'](_0x3ea2e7['shift']());}}}(a51_0x39a8,0x5da98));import{CliErrors}from'../../errors.js';function a51_0x10f1(_0x58f3a5,_0x12439b){_0x58f3a5=_0x58f3a5-0xa1;const _0x39a83d=a51_0x39a8();let _0x10f127=_0x39a83d[_0x58f3a5];return _0x10f127;}import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x46adcd){const _0x546fa7=a51_0x10f1,_0x475943=_0x46adcd[_0x546fa7(0xa3)]('key');if(!_0x475943)throw CliErrors['validation'](_0x546fa7(0xb8),'Usage:\x20'+CLI_BIN_NAME+_0x546fa7(0xae));const _0x581802=readConfig(),_0x18d82f=_0x475943===_0x546fa7(0xa7)?_0x546fa7(0xb3):_0x475943,_0x25cbbc=_0x581802[_0x18d82f];if(_0x25cbbc===undefined)throw CliErrors['validation'](_0x546fa7(0xaf)+_0x475943);return{'ok':!![],'data':typeof _0x25cbbc===_0x546fa7(0xa6)?_0x25cbbc:{[_0x18d82f]:_0x25cbbc},'message':typeof _0x25cbbc==='object'?undefined:String(_0x25cbbc)};}export const configGetDefinition={'service':a51_0x290c93(0xa9),'command':a51_0x290c93(0xb0),'description':a51_0x290c93(0xab),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a51_0x290c93(0xb4),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|