@lovrabet/rabetbase-cli 2.3.4-beta.3 → 2.3.4-beta.4
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 -0
- 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 -0
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/dry-run.js +1 -0
- package/lib/commands/common/flags.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/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/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/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.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/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 -0
- package/lib/commands/permit/page-get.js +1 -0
- package/lib/commands/permit/page-set.js +1 -0
- package/lib/commands/permit/role-apis-set.js +1 -0
- package/lib/commands/permit/role-menus-set.js +1 -0
- package/lib/commands/permit/role-menus.js +1 -0
- package/lib/commands/permit/shared.js +1 -0
- 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 -0
- package/lib/commands/role/delete.js +1 -0
- package/lib/commands/role/detail.js +1 -0
- package/lib/commands/role/index.js +1 -0
- package/lib/commands/role/list.js +1 -0
- package/lib/commands/role/shared.js +1 -0
- package/lib/commands/role/update.js +1 -0
- package/lib/commands/role/user-add.js +1 -0
- package/lib/commands/role/user-remove.js +1 -0
- package/lib/commands/role/user-resolve.js +1 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/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/workspace/add.js +1 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -0
- 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-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/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 +2 -2
- package/lib/commands/app/discover.js +0 -1
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x5bf01=a36_0x565b;function a36_0x1df9(){const _0x49992d=['Force\x20overwrite\x20local\x20unsynced\x20changes','filePath','close','Remote\x20script\x20missing\x20id.','10rNWeGn','unresolvable\x20target\x20path','datasetCode','707zYnGHi','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','lockFilePath','apiDir','appCode','apps','hookLocation','Pull\x20only\x20this\x20script\x20type','question','6967647KVpYrA','version','34017vYzNqG','353488QNsQWU','trim','Would\x20inspect\x20','toLowerCase','toISOString','type','bool','\x20skipped,\x20','COMMON','83538aDtpwv','alias','HOOK','str','functionName','\x20pulled,\x20','Remote\x20script\x20missing\x20content.','hash','&type=','all','\x20remote\x20BFF\x20script(s)\x20for\x20pull','length','\x20failed','operationType','functionNode','467720fmcyhI','\x22\x20not\x20found\x20after\x20ensureLockScope.','pull','nonInteractive','463560bzFFTT','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','ENDPOINT','4194CHnJEl','bff','scriptsRoot','Pull\x20complete:\x20','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','conflict','push','stderr','lockKey','functions','force','validation','stdin','would_pull','utf8','scriptContent','yes'];a36_0x1df9=function(){return _0x49992d;};return a36_0x1df9();}(function(_0x3f6ad4,_0x5b4ca6){const _0x2edb0a=a36_0x565b,_0x50a1b4=_0x3f6ad4();while(!![]){try{const _0x1422e0=-parseInt(_0x2edb0a(0x105))/0x1+-parseInt(_0x2edb0a(0xd5))/0x2+-parseInt(_0x2edb0a(0xfb))/0x3+-parseInt(_0x2edb0a(0xfc))/0x4*(parseInt(_0x2edb0a(0xed))/0x5)+parseInt(_0x2edb0a(0xd8))/0x6*(-parseInt(_0x2edb0a(0xf0))/0x7)+-parseInt(_0x2edb0a(0xd1))/0x8+parseInt(_0x2edb0a(0xf9))/0x9;if(_0x1422e0===_0x5b4ca6)break;else _0x50a1b4['push'](_0x50a1b4['shift']());}catch(_0x436000){_0x50a1b4['push'](_0x50a1b4['shift']());}}}(a36_0x1df9,0x22996));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x5bf01(0xd9),'command':a36_0x5bf01(0xd3),'description':a36_0x5bf01(0xdc),'risk':'write','flags':[{'name':a36_0x5bf01(0x101),'type':'string','description':a36_0x5bf01(0xf7),'enum':[a36_0x5bf01(0x104),a36_0x5bf01(0xd7),'HOOK']},{'name':'force','type':'boolean','description':a36_0x5bf01(0xe9)}],async 'dryRun'(_0x25ebac){const _0x3b70df=a36_0x5bf01,_0x491951=loadBffProjectConfig(_0x25ebac[_0x3b70df(0xf4)]),_0x50275a=await readBffLockFile(_0x491951[_0x3b70df(0xf2)]),{appLock:_0x530eea}=ensureLockScope(_0x50275a??createEmptyBffLock(),_0x25ebac[_0x3b70df(0xf4)],_0x491951[_0x3b70df(0xda)],_0x3b70df(0xd3)),_0x53cf2a=normalizeBffType(_0x25ebac[_0x3b70df(0x108)](_0x3b70df(0x101)))??undefined,_0x4621fa=buildDatasetCodeToAliasMap(_0x25ebac[_0x3b70df(0xf3)],_0x25ebac[_0x3b70df(0xf4)]),[_0x35b11d,_0xc62198]=await Promise['all']([listBffScripts(_0x25ebac['appCode'],_0x53cf2a),getBffScriptStatistics(_0x25ebac[_0x3b70df(0xf4)])]),_0x171b17=createHookLocationMap(_0xc62198),_0x13de08=[];for(const _0x101e33 of _0x35b11d){const _0x3d085e=resolveRemoteScriptTarget(_0x491951,_0x101e33,_0x171b17,_0x530eea['functions'],_0x4621fa);if(!_0x3d085e){_0x13de08[_0x3b70df(0xde)]({'scriptType':_0x101e33['scriptType'],'functionName':_0x101e33[_0x3b70df(0x109)]??'','status':'skipped','reason':_0x3b70df(0xee)});continue;}const _0x26fb16=_0x530eea[_0x3b70df(0xe1)][_0x3d085e[_0x3b70df(0xe0)]],_0x50dcb9=_0x101e33[_0x3b70df(0xe7)]!=null?computeContentHash(_0x101e33[_0x3b70df(0xe7)]):undefined,_0x575af5=await hasUnsyncedLocalChanges(_0x3d085e['filePath'],_0x26fb16,_0x50dcb9);_0x13de08[_0x3b70df(0xde)]({'lockKey':_0x3d085e[_0x3b70df(0xe0)],'filePath':_0x3d085e[_0x3b70df(0xea)],'remoteId':_0x101e33['id']??null,'status':_0x575af5?_0x3b70df(0xdd):_0x3b70df(0xe5)});}return{'method':'GET','url':'/api/management/library/scripts/list?appCode='+_0x25ebac[_0x3b70df(0xf4)]+(_0x53cf2a?_0x3b70df(0x10d)+_0x53cf2a:''),'body':{'appCode':_0x25ebac['appCode'],'filterType':_0x53cf2a??null,'files':_0x13de08},'description':_0x3b70df(0xfe)+_0x13de08[_0x3b70df(0x110)]+_0x3b70df(0x10f)};},async 'execute'(_0x1c6df4){const _0x5992cc=a36_0x5bf01,_0x2dc901=loadBffProjectConfig(_0x1c6df4['appCode']),_0x563140=await readBffLockFile(_0x2dc901[_0x5992cc(0xf2)]),{lockData:_0x59f28d,appLock:_0x3fd10e}=ensureLockScope(_0x563140??createEmptyBffLock(),_0x1c6df4[_0x5992cc(0xf4)],_0x2dc901[_0x5992cc(0xda)],_0x5992cc(0xd3)),_0x282568=normalizeBffType(_0x1c6df4[_0x5992cc(0x108)](_0x5992cc(0x101)))??undefined;if(_0x1c6df4['str']('type')&&!_0x282568)throw CliErrors[_0x5992cc(0xe3)](_0x5992cc(0xd6));const [_0x114ccb,_0x14926e]=await Promise[_0x5992cc(0x10e)]([listBffScripts(_0x1c6df4[_0x5992cc(0xf4)],_0x282568),getBffScriptStatistics(_0x1c6df4[_0x5992cc(0xf4)])]);if(_0x114ccb[_0x5992cc(0x110)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x463ab4=_0x1c6df4[_0x5992cc(0x102)](_0x5992cc(0xe2));if(_0x463ab4&&!_0x1c6df4['nonInteractive']){const _0x282108=await confirmForce();if(!_0x282108)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}if(_0x463ab4&&_0x1c6df4[_0x5992cc(0xd4)]){}const _0xf0a9c7=buildDatasetCodeToAliasMap(_0x1c6df4[_0x5992cc(0xf3)],_0x1c6df4[_0x5992cc(0xf4)]),_0x504ad7=createHookLocationMap(_0x14926e),_0x14a451=JSON['parse'](JSON['stringify'](_0x59f28d)),_0x4cd9b5=_0x1c6df4[_0x5992cc(0xf4)],_0x45eda4=_0x14a451[_0x5992cc(0xf5)][_0x4cd9b5];if(!_0x45eda4)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x4cd9b5+_0x5992cc(0xd2));const _0x4d0119=[],_0x3331b1=[],_0x427b90=[];for(const _0x1245f6 of _0x114ccb){const _0x526bcd=resolveRemoteScriptTarget(_0x2dc901,_0x1245f6,_0x504ad7,_0x3fd10e[_0x5992cc(0xe1)],_0xf0a9c7);if(!_0x526bcd){_0x3331b1['push']({'lockKey':_0x1245f6['scriptType']+'/'+_0x1245f6[_0x5992cc(0x109)],'reason':_0x5992cc(0xee)});continue;}const _0xa7a2fb=_0x3fd10e[_0x5992cc(0xe1)][_0x526bcd['lockKey']];try{if(!_0x1245f6['id'])throw new Error(_0x5992cc(0xec));if(_0x1245f6[_0x5992cc(0xe7)]==null)throw new Error(_0x5992cc(0x10b));const _0x5dc9fb=_0x1245f6[_0x5992cc(0xe7)],_0x43a8d9=computeContentHash(_0x5dc9fb);if(!_0x463ab4){const _0x346cd7=await hasUnsyncedLocalChanges(_0x526bcd[_0x5992cc(0xea)],_0xa7a2fb,_0x43a8d9);if(_0x346cd7){_0x3331b1[_0x5992cc(0xde)]({'lockKey':_0x526bcd['lockKey'],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x526bcd[_0x5992cc(0xea)]),await writeFile(_0x526bcd['filePath'],_0x5dc9fb,_0x5992cc(0xe6));const _0x4432d4={'hash':_0x43a8d9,'remoteId':_0x1245f6['id'],'version':_0x1245f6[_0x5992cc(0xfa)]};_0x526bcd['type']===_0x5992cc(0x107)&&_0x526bcd[_0x5992cc(0xf6)]&&(_0x4432d4[_0x5992cc(0x106)]=_0x526bcd[_0x5992cc(0xf6)][_0x5992cc(0x106)],_0x4432d4[_0x5992cc(0xef)]=_0x526bcd[_0x5992cc(0xf6)][_0x5992cc(0xef)],_0x4432d4[_0x5992cc(0x112)]=_0x526bcd[_0x5992cc(0xf6)][_0x5992cc(0x112)],_0x4432d4[_0x5992cc(0xd0)]=_0x526bcd['hookLocation'][_0x5992cc(0xd0)]),_0x45eda4[_0x5992cc(0xe1)][_0x526bcd[_0x5992cc(0xe0)]]=_0x4432d4,_0x4d0119[_0x5992cc(0xde)]({'lockKey':_0x526bcd['lockKey'],'remoteId':_0x1245f6['id']});}catch(_0x5edab5){_0x427b90['push']({'lockKey':_0x526bcd[_0x5992cc(0xe0)],'error':_0x5edab5 instanceof Error?_0x5edab5['message']:String(_0x5edab5)});}}return _0x45eda4['lastSync']=new Date()[_0x5992cc(0x100)](),await writeBffLockFile(_0x2dc901[_0x5992cc(0xf2)],_0x14a451),{'ok':_0x427b90['length']===0x0,'data':{'pulled':_0x4d0119,'skipped':_0x3331b1,'failed':_0x427b90},'message':_0x5992cc(0xdb)+_0x4d0119[_0x5992cc(0x110)]+_0x5992cc(0x10a)+_0x3331b1[_0x5992cc(0x110)]+_0x5992cc(0x103)+_0x427b90[_0x5992cc(0x110)]+_0x5992cc(0x111)};}};async function hasUnsyncedLocalChanges(_0x468f50,_0x46743a,_0x380f69){const _0x16e642=a36_0x5bf01;if(!await fileExists(_0x468f50))return![];const _0x1d62e3=await computeFileHash(_0x468f50);if(!_0x46743a)return _0x380f69?_0x1d62e3!==_0x380f69:!![];return _0x1d62e3!==_0x46743a[_0x16e642(0x10c)];}function buildDatasetCodeToAliasMap(_0x15c18b,_0x2e1bd6){const _0x29a456=a36_0x5bf01,_0x3951d7=loadAliasMap(_0x15c18b,undefined,resolveApiFilePath(_0x15c18b,_0x2e1bd6));return new Map(_0x3951d7['map'](_0x5d33fb=>[_0x5d33fb['datasetCode'],_0x5d33fb[_0x29a456(0x106)]]));}function a36_0x565b(_0x11429f,_0x1d0e82){_0x11429f=_0x11429f-0xd0;const _0x1df9ff=a36_0x1df9();let _0x565b63=_0x1df9ff[_0x11429f];return _0x565b63;}async function confirmForce(){const _0x8f6c9c=a36_0x5bf01,_0x56be17=createInterface({'input':process[_0x8f6c9c(0xe4)],'output':process[_0x8f6c9c(0xdf)]}),_0x132347=await new Promise(_0x44ddd6=>{const _0x2ab9fc=_0x8f6c9c;_0x56be17[_0x2ab9fc(0xf8)](_0x2ab9fc(0xf1),_0x44ddd6);});return _0x56be17[_0x8f6c9c(0xeb)](),['y',_0x8f6c9c(0xe8)]['includes'](_0x132347[_0x8f6c9c(0xfd)]()[_0x8f6c9c(0xff)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x50d48d=a37_0x3e57;(function(_0x285337,_0x26f0d0){const _0x5bbad5=a37_0x3e57,_0x5f0edf=_0x285337();while(!![]){try{const _0x4c438e=-parseInt(_0x5bbad5(0x210))/0x1*(parseInt(_0x5bbad5(0x21f))/0x2)+-parseInt(_0x5bbad5(0x1d8))/0x3+parseInt(_0x5bbad5(0x216))/0x4*(parseInt(_0x5bbad5(0x1e6))/0x5)+parseInt(_0x5bbad5(0x1d9))/0x6+parseInt(_0x5bbad5(0x1eb))/0x7*(-parseInt(_0x5bbad5(0x1e7))/0x8)+parseInt(_0x5bbad5(0x1e9))/0x9+parseInt(_0x5bbad5(0x1e4))/0xa*(parseInt(_0x5bbad5(0x1ef))/0xb);if(_0x4c438e===_0x26f0d0)break;else _0x5f0edf['push'](_0x5f0edf['shift']());}catch(_0x47faf1){_0x5f0edf['push'](_0x5f0edf['shift']());}}}(a37_0x4256,0xbd8b8));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x3e57(_0x2b9f85,_0x257a6c){_0x2b9f85=_0x2b9f85-0x1d8;const _0x425623=a37_0x4256();let _0x3e57b6=_0x425623[_0x2b9f85];return _0x3e57b6;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;function a37_0x4256(){const _0x2d0d90=['message','type','utf8','name','toISOString','lockFilePath','has','cleared','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Incomplete\x20HOOK\x20path:\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','bool','lastSync','785404sOcROX','\x22\x20not\x20found\x20after\x20ensureLockScope.','runtime\x20cache\x20not\x20needed','Local\x20function\x20not\x20found:\x20','str','every','156JuPeQV','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','filePath','functions','Lock\x20scope\x20for\x20app\x20\x22','\x20failed,\x20','scriptsRoot','push','Force\x20push\x20ignoring\x20hash\x20protection','2RyLDLR','operationType','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','functionNode','apiDir','HOOK','code','1391142bkJhcB','6584514QuFkfJ',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Runtime\x20script\x20cache\x20cleared.','values','boolean','script','Cannot\x20resolve\x20dataset\x20for\x20\x22','get','appCode','bff','apps','10vQIkVk','parse','102445TrfaQz','28776RkmInw','hash','1008072LzIEQw','status','2709ZPnxPX','version','map','length','15499385zoSAsx','unchanged','Would\x20inspect\x20','would_push','lockKey','remoteId','datasetCode','\x20skipped,\x20','ENDPOINT','Push\x20local\x20BFF\x20scripts\x20to\x20remote','aliasToDatasetCode','force','validation','Push\x20only\x20this\x20script\x20type','some','description','runtime\x20cache\x20clear\x20failed','alias','string','datasetId'];a37_0x4256=function(){return _0x2d0d90;};return a37_0x4256();}export const bffPush={'service':a37_0x50d48d(0x1e2),'command':a37_0x50d48d(0x21d),'description':a37_0x50d48d(0x1f8),'risk':'high-risk-write','flags':[{'name':a37_0x50d48d(0x204),'type':'string','description':a37_0x50d48d(0x1fc),'enum':['COMMON',a37_0x50d48d(0x1f7),a37_0x50d48d(0x224)]},{'name':a37_0x50d48d(0x206),'type':a37_0x50d48d(0x201),'description':a37_0x50d48d(0x221)},{'name':a37_0x50d48d(0x1fa),'type':a37_0x50d48d(0x1dd),'description':a37_0x50d48d(0x21e)}],async 'dryRun'(_0x403950){const _0x1c19a8=a37_0x50d48d,_0x1a24ad=loadBffProjectConfig(_0x403950['appCode']),_0xbd554a=await readBffLockFile(_0x1a24ad[_0x1c19a8(0x208)]),{appLock:_0xd3fed0}=ensureLockScope(_0xbd554a??createEmptyBffLock(),_0x403950[_0x1c19a8(0x1e1)],_0x1a24ad[_0x1c19a8(0x21c)],_0x1c19a8(0x21d)),_0x1a3ce5=await getTargetFunctions(_0x1a24ad,_0x403950),_0x4337a6=_0x403950[_0x1c19a8(0x20e)]('force'),_0xc089a7=[];for(const _0x35f4d1 of _0x1a3ce5){const _0x4b3d8d=await computeFileHash(_0x35f4d1[_0x1c19a8(0x218)]),_0x4360bd=_0xd3fed0[_0x1c19a8(0x219)][_0x35f4d1[_0x1c19a8(0x1f3)]],_0x50e089=!!_0x4360bd&&_0x4360bd[_0x1c19a8(0x1e8)]===_0x4b3d8d;_0xc089a7[_0x1c19a8(0x21d)]({'lockKey':_0x35f4d1[_0x1c19a8(0x1f3)],'filePath':_0x35f4d1[_0x1c19a8(0x218)],'remoteId':_0x4360bd?.['remoteId']??null,'mode':_0x4360bd?.[_0x1c19a8(0x1f4)]?'update':'create','status':!_0x4337a6&&_0x50e089?'unchanged':_0x1c19a8(0x1f2)});}return{'method':'POST','url':'/api/management/library/scripts/save','body':{'appCode':_0x403950[_0x1c19a8(0x1e1)],'force':_0x4337a6,'files':_0xc089a7,'cacheClearAtRuntime':_0xc089a7[_0x1c19a8(0x1fd)](_0x3969b8=>_0x3969b8['status']===_0x1c19a8(0x1f2)),'cacheClearAtRuntimeTimes':_0xc089a7[_0x1c19a8(0x1fd)](_0x1bced0=>_0x1bced0[_0x1c19a8(0x1ea)]===_0x1c19a8(0x1f2))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x1c19a8(0x1f1)+_0xc089a7[_0x1c19a8(0x1ee)]+_0x1c19a8(0x217)};},async 'execute'(_0x26237){const _0x21525d=a37_0x50d48d,_0x497327=loadBffProjectConfig(_0x26237[_0x21525d(0x1e1)]),_0x5d8815=await readBffLockFile(_0x497327['lockFilePath']),{lockData:_0x2b742d,appLock:_0x184854}=ensureLockScope(_0x5d8815??createEmptyBffLock(),_0x26237[_0x21525d(0x1e1)],_0x497327[_0x21525d(0x21c)],'push'),_0x341c4f=await getTargetFunctions(_0x497327,_0x26237);if(_0x341c4f[_0x21525d(0x1ee)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x106c43=_0x26237[_0x21525d(0x20e)]('force'),_0x1ff6c8=JSON[_0x21525d(0x1e5)](JSON['stringify'](_0x2b742d)),_0x6b4084=_0x1ff6c8[_0x21525d(0x1e3)][_0x26237[_0x21525d(0x1e1)]];if(!_0x6b4084)throw new Error(_0x21525d(0x21a)+_0x26237[_0x21525d(0x1e1)]+_0x21525d(0x211));const _0x29ab83=await buildHookMaps(_0x26237[_0x21525d(0x1e1)],_0x26237[_0x21525d(0x223)],_0x341c4f,_0x6b4084),_0x2fcade=[],_0x2f3ec9=[],_0x2ff446=[];for(const _0x3e433d of _0x341c4f){const _0x489207=await computeFileHash(_0x3e433d['filePath']),_0x180a56=_0x6b4084[_0x21525d(0x219)][_0x3e433d[_0x21525d(0x1f3)]];if(!_0x106c43&&_0x180a56&&_0x180a56[_0x21525d(0x1e8)]===_0x489207){_0x2f3ec9[_0x21525d(0x21d)]({'lockKey':_0x3e433d[_0x21525d(0x1f3)],'reason':_0x21525d(0x1f0)});continue;}try{await uploadSingleFunction(_0x26237[_0x21525d(0x1e1)],_0x3e433d,_0x6b4084,_0x29ab83);const _0x156c05=_0x6b4084[_0x21525d(0x219)][_0x3e433d[_0x21525d(0x1f3)]];_0x2fcade[_0x21525d(0x21d)]({'lockKey':_0x3e433d[_0x21525d(0x1f3)],'remoteId':_0x156c05?.['remoteId']??0x0});}catch(_0x297e9e){_0x2ff446[_0x21525d(0x21d)]({'lockKey':_0x3e433d[_0x21525d(0x1f3)],'error':_0x297e9e instanceof Error?_0x297e9e['message']:String(_0x297e9e)});}}_0x6b4084[_0x21525d(0x20f)]=new Date()[_0x21525d(0x207)](),await writeBffLockFile(_0x497327[_0x21525d(0x208)],_0x1ff6c8),await waitForUploadedLockEntries(_0x497327[_0x21525d(0x208)],_0x26237[_0x21525d(0x1e1)],_0x2fcade[_0x21525d(0x1ed)](_0x4de412=>_0x4de412[_0x21525d(0x1f3)]));let _0x544fea={'attempted':![],'cleared':![]};if(_0x2fcade[_0x21525d(0x1ee)]>0x0)try{let _0xf9109c='';for(let _0x16704f=0x0;_0x16704f<CACHE_CLEAR_ATTEMPTS;_0x16704f+=0x1){_0xf9109c=await clearBffScriptCache(),_0x16704f<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x544fea={'attempted':!![],'cleared':!![],'message':_0xf9109c||_0x21525d(0x1db)};}catch(_0x5a732d){_0x544fea={'attempted':!![],'cleared':![],'error':_0x5a732d instanceof Error?_0x5a732d[_0x21525d(0x203)]:String(_0x5a732d)};}const _0x195c81=_0x2ff446[_0x21525d(0x1ee)]===0x0&&(_0x544fea['attempted']?_0x544fea['cleared']:!![]),_0x274ac0=_0x544fea['attempted']?_0x544fea[_0x21525d(0x20a)]?'runtime\x20cache\x20cleared':_0x21525d(0x1ff):_0x21525d(0x212);return{'ok':_0x195c81,'data':{'uploaded':_0x2fcade,'skipped':_0x2f3ec9,'failed':_0x2ff446,'cacheClear':_0x544fea},'message':'Push\x20complete:\x20'+_0x2fcade[_0x21525d(0x1ee)]+'\x20uploaded,\x20'+_0x2f3ec9[_0x21525d(0x1ee)]+_0x21525d(0x1f6)+_0x2ff446[_0x21525d(0x1ee)]+_0x21525d(0x21b)+_0x274ac0};}};async function getTargetFunctions(_0x2f2cf9,_0x585938){const _0x487235=a37_0x50d48d,_0x5be066=_0x585938[_0x487235(0x214)](_0x487235(0x204)),_0x6c5a16=_0x585938[_0x487235(0x214)](_0x487235(0x206)),_0x5beccc=normalizeBffType(_0x5be066)??undefined;if(_0x6c5a16&&!_0x5beccc)throw CliErrors[_0x487235(0x1fb)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x2fad9b=await scanLocalBffFunctions(_0x2f2cf9,_0x5beccc);if(_0x6c5a16){const _0xa71e7e=_0x2fad9b['filter'](_0xf88853=>_0xf88853[_0x487235(0x206)]===_0x6c5a16);if(_0xa71e7e[_0x487235(0x1ee)]===0x0)throw CliErrors[_0x487235(0x1fb)](_0x487235(0x213)+_0x5beccc+'/'+_0x6c5a16);return _0xa71e7e;}return _0x2fad9b;}async function buildHookMaps(_0x503031,_0x5635e0,_0x17e88a,_0x578d93){const _0x46d05=a37_0x50d48d,_0x5a343c=_0x17e88a[_0x46d05(0x1fd)](_0x439782=>_0x439782[_0x46d05(0x204)]==='HOOK');if(!_0x5a343c)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x337672=loadAliasMap(_0x5635e0,undefined,resolveApiFilePath(_0x5635e0,_0x503031)),_0x3320c6=new Map(_0x337672[_0x46d05(0x1ed)](_0x132eef=>[_0x132eef[_0x46d05(0x200)],_0x132eef[_0x46d05(0x1f5)]]));for(const _0x5083eb of Object[_0x46d05(0x1dc)](_0x578d93[_0x46d05(0x219)])){_0x5083eb[_0x46d05(0x200)]&&_0x5083eb[_0x46d05(0x1f5)]&&!_0x3320c6[_0x46d05(0x209)](_0x5083eb['alias'])&&_0x3320c6['set'](_0x5083eb[_0x46d05(0x200)],_0x5083eb[_0x46d05(0x1f5)]);}const _0x1f1501=await listDatasets(_0x503031),_0xe257b9=new Map(_0x1f1501[_0x46d05(0x1ed)](_0x330157=>[_0x330157[_0x46d05(0x225)],_0x330157]));return{'aliasToDatasetCode':_0x3320c6,'datasetCodeToDataset':_0xe257b9};}async function uploadSingleFunction(_0x5f1e9f,_0xfc6ec1,_0xda71c0,_0x5d51ed){const _0x6496c1=a37_0x50d48d,_0x18c661=await readFile(_0xfc6ec1[_0x6496c1(0x218)],_0x6496c1(0x205)),_0x219121=await computeFileHash(_0xfc6ec1['filePath']),_0x3d5274=_0xda71c0[_0x6496c1(0x219)][_0xfc6ec1[_0x6496c1(0x1f3)]];if(_0x3d5274?.[_0x6496c1(0x1f4)]&&_0x3d5274[_0x6496c1(0x1ec)]==null)throw CliErrors[_0x6496c1(0x1fb)](_0xfc6ec1[_0x6496c1(0x1f3)]+_0x6496c1(0x1da));let _0x20285d=extractScriptDescription(_0x18c661);if(!_0x20285d&&_0x3d5274?.[_0x6496c1(0x1f4)]){const _0x86399c=await getBffScriptInfo(_0x3d5274[_0x6496c1(0x1f4)]);_0x20285d=_0x86399c[_0x6496c1(0x1fe)]||undefined;}const _0x4eba27={'appCode':_0x5f1e9f,'functionName':_0xfc6ec1[_0x6496c1(0x206)],'scriptType':_0xfc6ec1['type'],'scriptContent':_0x18c661};if(_0x3d5274?.[_0x6496c1(0x1f4)])_0x4eba27['id']=_0x3d5274[_0x6496c1(0x1f4)];if(_0x3d5274?.[_0x6496c1(0x1ec)]!=null)_0x4eba27['version']=_0x3d5274['version'];if(_0x20285d)_0x4eba27[_0x6496c1(0x1fe)]=_0x20285d;if(_0xfc6ec1['type']===_0x6496c1(0x224)){const _0x2110ae=_0xfc6ec1[_0x6496c1(0x200)];if(!_0x2110ae||!_0xfc6ec1[_0x6496c1(0x220)]||!_0xfc6ec1['functionNode'])throw CliErrors[_0x6496c1(0x1fb)](_0x6496c1(0x20c)+_0xfc6ec1[_0x6496c1(0x1f3)]);const _0x2e7e76=_0x5d51ed['aliasToDatasetCode'][_0x6496c1(0x1e0)](_0x2110ae)??_0x3d5274?.[_0x6496c1(0x1f5)]??_0x2110ae,_0x187b13=_0x5d51ed['datasetCodeToDataset']['get'](_0x2e7e76);if(!_0x187b13)throw CliErrors[_0x6496c1(0x1fb)](_0x6496c1(0x1df)+_0x2110ae+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x6496c1(0x20b)));_0x4eba27[_0x6496c1(0x202)]=_0x187b13['id'],_0x4eba27[_0x6496c1(0x220)]=_0xfc6ec1['operationType'],_0x4eba27[_0x6496c1(0x222)]=_0xfc6ec1['functionNode'];}const _0x5432f9=await saveBffScript(_0x4eba27),_0x14c137=_0x5432f9['id'],_0x33087a=_0x5432f9[_0x6496c1(0x1de)]??await getBffScriptInfo(_0x14c137),_0xf073aa={'hash':_0x219121,'remoteId':_0x14c137,'version':_0x33087a['version']};if(_0xfc6ec1[_0x6496c1(0x204)]===_0x6496c1(0x224)){const _0x3bbde0=_0xfc6ec1['alias'],_0x381d0b=_0x5d51ed[_0x6496c1(0x1f9)][_0x6496c1(0x1e0)](_0x3bbde0)??_0x3d5274?.[_0x6496c1(0x1f5)]??_0x3bbde0;_0x5d51ed[_0x6496c1(0x1f9)]['has'](_0x3bbde0)?_0xf073aa[_0x6496c1(0x200)]=_0x3bbde0:_0xf073aa[_0x6496c1(0x200)]=_0x3d5274?.[_0x6496c1(0x200)],_0xf073aa['datasetCode']=_0x381d0b,_0xf073aa[_0x6496c1(0x220)]=_0xfc6ec1['operationType'],_0xf073aa[_0x6496c1(0x222)]=_0xfc6ec1[_0x6496c1(0x222)];}_0xda71c0['functions'][_0xfc6ec1[_0x6496c1(0x1f3)]]=_0xf073aa;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x405d27,_0x981c2a,_0x3f525){const _0x1fedc9=a37_0x50d48d;if(_0x3f525['length']===0x0)return;for(let _0x3f1588=0x0;_0x3f1588<LOCK_SETTLE_RETRY_COUNT;_0x3f1588+=0x1){const _0x4e8a3a=await readBffLockFile(_0x405d27),_0x5dc5d5=_0x4e8a3a?.[_0x1fedc9(0x1e3)]?.[_0x981c2a]?.[_0x1fedc9(0x219)]??{},_0x3d0678=_0x3f525[_0x1fedc9(0x215)](_0x29d96e=>!!_0x5dc5d5[_0x29d96e]?.[_0x1fedc9(0x1f4)]);if(_0x3d0678)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x1fedc9(0x20d)+_0x3f525['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x4f96ff=a37_0x365e;(function(_0x42139e,_0x2242eb){const _0x18a490=a37_0x365e,_0x3a9045=_0x42139e();while(!![]){try{const _0x105afa=-parseInt(_0x18a490(0x8f))/0x1+parseInt(_0x18a490(0xa4))/0x2*(parseInt(_0x18a490(0x98))/0x3)+-parseInt(_0x18a490(0xb8))/0x4*(-parseInt(_0x18a490(0xde))/0x5)+-parseInt(_0x18a490(0xd5))/0x6*(parseInt(_0x18a490(0xcc))/0x7)+-parseInt(_0x18a490(0xe3))/0x8*(parseInt(_0x18a490(0xb3))/0x9)+parseInt(_0x18a490(0xe5))/0xa*(-parseInt(_0x18a490(0xa8))/0xb)+-parseInt(_0x18a490(0xcb))/0xc*(-parseInt(_0x18a490(0x9a))/0xd);if(_0x105afa===_0x2242eb)break;else _0x3a9045['push'](_0x3a9045['shift']());}catch(_0x2ec8e3){_0x3a9045['push'](_0x3a9045['shift']());}}}(a37_0x1dd1,0xe373a));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';function a37_0x1dd1(){const _0x3f1bd3=['Force\x20push\x20ignoring\x20hash\x20protection','description','parse','17418XilhSF','Push\x20local\x20BFF\x20scripts\x20to\x20remote','alias','datasetCode','join','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','operationType','would_push','push','33120OKDxwu','functionNode','Would\x20inspect\x20','validation','datasetCodeToDataset','424bSGzRT','status','43910QmDlWt','string','499556FLWqKf','appCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','filePath','boolean',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','some','COMMON','name','27KEnGKW','bff','234SUABuq','code','update','Run\x20`','high-risk-write','filter','runtime\x20cache\x20not\x20needed','message','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','/api/management/library/scripts/save','310146kOaiyY','attempted','\x20skipped,\x20','hash','1155jzepMP','lockKey','HOOK','bool','str','apps','stringify','remoteId','Runtime\x20script\x20cache\x20cleared.','force','No\x20local\x20BFF\x20functions\x20found.','245304estESn','get','lastSync','create','version','200MiLPMS','aliasToDatasetCode','cleared','lockFilePath','values','Push\x20only\x20this\x20script\x20type','Lock\x20scope\x20for\x20app\x20\x22','utf8','script','length','runtime\x20cache\x20clear\x20failed','every','scriptsRoot','POST','set','map','Cannot\x20resolve\x20dataset\x20for\x20\x22','functions','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','2052588MuKrOk','3542XdtTvG','\x20uploaded,\x20','has','unchanged','type','datasetId'];a37_0x1dd1=function(){return _0x3f1bd3;};return a37_0x1dd1();}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_0x4f96ff(0x99),'command':'push','description':a37_0x4f96ff(0xd6),'risk':a37_0x4f96ff(0x9e),'flags':[{'name':'type','type':a37_0x4f96ff(0xe6),'description':a37_0x4f96ff(0xbd),'enum':[a37_0x4f96ff(0x96),'ENDPOINT',a37_0x4f96ff(0xaa)]},{'name':a37_0x4f96ff(0x97),'type':a37_0x4f96ff(0xe6),'description':a37_0x4f96ff(0xda)},{'name':a37_0x4f96ff(0xb1),'type':a37_0x4f96ff(0x93),'description':a37_0x4f96ff(0xd2)}],async 'dryRun'(_0x54c5b9){const _0x4b6c9f=a37_0x4f96ff,_0x443bd9=loadBffProjectConfig(_0x54c5b9[_0x4b6c9f(0x90)]),_0x50b76f=await readBffLockFile(_0x443bd9[_0x4b6c9f(0xbb)]),{appLock:_0x113b26}=ensureLockScope(_0x50b76f??createEmptyBffLock(),_0x54c5b9[_0x4b6c9f(0x90)],_0x443bd9[_0x4b6c9f(0xc4)],_0x4b6c9f(0xdd)),_0x4cadcf=await getTargetFunctions(_0x443bd9,_0x54c5b9),_0x3a14f7=_0x54c5b9[_0x4b6c9f(0xab)](_0x4b6c9f(0xb1)),_0x329700=[];for(const _0x2b1953 of _0x4cadcf){const _0x5dcb92=await computeFileHash(_0x2b1953[_0x4b6c9f(0x92)]),_0x2acd1b=_0x113b26[_0x4b6c9f(0xc9)][_0x2b1953['lockKey']],_0x571c91=!!_0x2acd1b&&_0x2acd1b[_0x4b6c9f(0xa7)]===_0x5dcb92;_0x329700[_0x4b6c9f(0xdd)]({'lockKey':_0x2b1953[_0x4b6c9f(0xa9)],'filePath':_0x2b1953[_0x4b6c9f(0x92)],'remoteId':_0x2acd1b?.[_0x4b6c9f(0xaf)]??null,'mode':_0x2acd1b?.[_0x4b6c9f(0xaf)]?_0x4b6c9f(0x9c):_0x4b6c9f(0xb6),'status':!_0x3a14f7&&_0x571c91?_0x4b6c9f(0xcf):_0x4b6c9f(0xdc)});}return{'method':_0x4b6c9f(0xc5),'url':_0x4b6c9f(0xa3),'body':{'appCode':_0x54c5b9['appCode'],'force':_0x3a14f7,'files':_0x329700,'cacheClearAtRuntime':_0x329700[_0x4b6c9f(0x95)](_0x590ec2=>_0x590ec2[_0x4b6c9f(0xe4)]===_0x4b6c9f(0xdc)),'cacheClearAtRuntimeTimes':_0x329700[_0x4b6c9f(0x95)](_0x567181=>_0x567181[_0x4b6c9f(0xe4)]===_0x4b6c9f(0xdc))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x4b6c9f(0xe0)+_0x329700[_0x4b6c9f(0xc1)]+_0x4b6c9f(0xa2)};},async 'execute'(_0x2c59c0){const _0x80563c=a37_0x4f96ff,_0x387d7f=loadBffProjectConfig(_0x2c59c0[_0x80563c(0x90)]),_0x454384=await readBffLockFile(_0x387d7f['lockFilePath']),{lockData:_0x291780,appLock:_0x4a2595}=ensureLockScope(_0x454384??createEmptyBffLock(),_0x2c59c0['appCode'],_0x387d7f[_0x80563c(0xc4)],'push'),_0x1f0a79=await getTargetFunctions(_0x387d7f,_0x2c59c0);if(_0x1f0a79[_0x80563c(0xc1)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x80563c(0xb2)};const _0x138e59=_0x2c59c0[_0x80563c(0xab)](_0x80563c(0xb1)),_0x134189=JSON[_0x80563c(0xd4)](JSON[_0x80563c(0xae)](_0x291780)),_0x46a896=_0x134189['apps'][_0x2c59c0[_0x80563c(0x90)]];if(!_0x46a896)throw new Error(_0x80563c(0xbe)+_0x2c59c0[_0x80563c(0x90)]+_0x80563c(0x91));const _0xba057d=await buildHookMaps(_0x2c59c0[_0x80563c(0x90)],_0x2c59c0['apiDir'],_0x1f0a79,_0x46a896),_0x57bb87=[],_0x28e0ef=[],_0x1e007f=[];for(const _0x30d0f1 of _0x1f0a79){const _0x91a12c=await computeFileHash(_0x30d0f1[_0x80563c(0x92)]),_0x3c1fcb=_0x46a896[_0x80563c(0xc9)][_0x30d0f1['lockKey']];if(!_0x138e59&&_0x3c1fcb&&_0x3c1fcb[_0x80563c(0xa7)]===_0x91a12c){_0x28e0ef['push']({'lockKey':_0x30d0f1[_0x80563c(0xa9)],'reason':_0x80563c(0xcf)});continue;}try{await uploadSingleFunction(_0x2c59c0[_0x80563c(0x90)],_0x30d0f1,_0x46a896,_0xba057d);const _0x128219=_0x46a896[_0x80563c(0xc9)][_0x30d0f1[_0x80563c(0xa9)]];_0x57bb87[_0x80563c(0xdd)]({'lockKey':_0x30d0f1[_0x80563c(0xa9)],'remoteId':_0x128219?.[_0x80563c(0xaf)]??0x0});}catch(_0x5ae046){_0x1e007f[_0x80563c(0xdd)]({'lockKey':_0x30d0f1['lockKey'],'error':_0x5ae046 instanceof Error?_0x5ae046['message']:String(_0x5ae046)});}}_0x46a896[_0x80563c(0xb5)]=new Date()['toISOString'](),await writeBffLockFile(_0x387d7f[_0x80563c(0xbb)],_0x134189),await waitForUploadedLockEntries(_0x387d7f[_0x80563c(0xbb)],_0x2c59c0['appCode'],_0x57bb87[_0x80563c(0xc7)](_0x58f71d=>_0x58f71d['lockKey']));let _0x9f82ff={'attempted':![],'cleared':![]};if(_0x57bb87[_0x80563c(0xc1)]>0x0)try{let _0x51ebf1='';for(let _0x1782a5=0x0;_0x1782a5<CACHE_CLEAR_ATTEMPTS;_0x1782a5+=0x1){_0x51ebf1=await clearBffScriptCache(),_0x1782a5<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x9f82ff={'attempted':!![],'cleared':!![],'message':_0x51ebf1||_0x80563c(0xb0)};}catch(_0x2827dd){_0x9f82ff={'attempted':!![],'cleared':![],'error':_0x2827dd instanceof Error?_0x2827dd[_0x80563c(0xa1)]:String(_0x2827dd)};}const _0x22fc91=_0x1e007f[_0x80563c(0xc1)]===0x0&&(_0x9f82ff[_0x80563c(0xa5)]?_0x9f82ff['cleared']:!![]),_0x21e9bf=_0x9f82ff[_0x80563c(0xa5)]?_0x9f82ff[_0x80563c(0xba)]?'runtime\x20cache\x20cleared':_0x80563c(0xc2):_0x80563c(0xa0);return{'ok':_0x22fc91,'data':{'uploaded':_0x57bb87,'skipped':_0x28e0ef,'failed':_0x1e007f,'cacheClear':_0x9f82ff},'message':'Push\x20complete:\x20'+_0x57bb87[_0x80563c(0xc1)]+_0x80563c(0xcd)+_0x28e0ef[_0x80563c(0xc1)]+_0x80563c(0xa6)+_0x1e007f[_0x80563c(0xc1)]+'\x20failed,\x20'+_0x21e9bf};}};function a37_0x365e(_0x4b2d46,_0x1ca5b6){_0x4b2d46=_0x4b2d46-0x8f;const _0x1dd114=a37_0x1dd1();let _0x365eb4=_0x1dd114[_0x4b2d46];return _0x365eb4;}async function getTargetFunctions(_0x521d62,_0x301095){const _0x11316c=a37_0x4f96ff,_0x3bfc5d=_0x301095[_0x11316c(0xac)](_0x11316c(0xd0)),_0x542ff7=_0x301095[_0x11316c(0xac)](_0x11316c(0x97)),_0x1d0158=normalizeBffType(_0x3bfc5d)??undefined;if(_0x542ff7&&!_0x1d0158)throw CliErrors[_0x11316c(0xe1)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x63882e=await scanLocalBffFunctions(_0x521d62,_0x1d0158);if(_0x542ff7){const _0x35fba7=_0x63882e[_0x11316c(0x9f)](_0x46015c=>_0x46015c[_0x11316c(0x97)]===_0x542ff7);if(_0x35fba7[_0x11316c(0xc1)]===0x0)throw CliErrors[_0x11316c(0xe1)]('Local\x20function\x20not\x20found:\x20'+_0x1d0158+'/'+_0x542ff7);return _0x35fba7;}return _0x63882e;}async function buildHookMaps(_0x51b707,_0x27fe71,_0x10f5c6,_0x44c3dc){const _0x459a11=a37_0x4f96ff,_0x403b1a=_0x10f5c6[_0x459a11(0x95)](_0x28a24a=>_0x28a24a[_0x459a11(0xd0)]==='HOOK');if(!_0x403b1a)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x56ae00=loadAliasMap(_0x27fe71,undefined,resolveApiFilePath(_0x27fe71,_0x51b707)),_0x3f6d25=new Map(_0x56ae00[_0x459a11(0xc7)](_0x5267ba=>[_0x5267ba[_0x459a11(0xd7)],_0x5267ba[_0x459a11(0xd8)]]));for(const _0x28382d of Object[_0x459a11(0xbc)](_0x44c3dc['functions'])){_0x28382d[_0x459a11(0xd7)]&&_0x28382d[_0x459a11(0xd8)]&&!_0x3f6d25[_0x459a11(0xce)](_0x28382d['alias'])&&_0x3f6d25[_0x459a11(0xc6)](_0x28382d[_0x459a11(0xd7)],_0x28382d[_0x459a11(0xd8)]);}const _0x8a544a=await listDatasets(_0x51b707),_0x32b46b=new Map(_0x8a544a[_0x459a11(0xc7)](_0x4b2040=>[_0x4b2040[_0x459a11(0x9b)],_0x4b2040]));return{'aliasToDatasetCode':_0x3f6d25,'datasetCodeToDataset':_0x32b46b};}async function uploadSingleFunction(_0x37bb9e,_0x9aad32,_0x264a6e,_0x6f4531){const _0x366d41=a37_0x4f96ff,_0x1327ed=await readFile(_0x9aad32[_0x366d41(0x92)],_0x366d41(0xbf)),_0x7badb5=await computeFileHash(_0x9aad32[_0x366d41(0x92)]),_0x26b035=_0x264a6e[_0x366d41(0xc9)][_0x9aad32[_0x366d41(0xa9)]];if(_0x26b035?.[_0x366d41(0xaf)]&&_0x26b035[_0x366d41(0xb7)]==null)throw CliErrors[_0x366d41(0xe1)](_0x9aad32[_0x366d41(0xa9)]+_0x366d41(0x94));let _0x254e16=extractScriptDescription(_0x1327ed);if(!_0x254e16&&_0x26b035?.[_0x366d41(0xaf)]){const _0x1c3d47=await getBffScriptInfo(_0x26b035['remoteId']);_0x254e16=_0x1c3d47[_0x366d41(0xd3)]||undefined;}const _0x3e41c7={'appCode':_0x37bb9e,'functionName':_0x9aad32[_0x366d41(0x97)],'scriptType':_0x9aad32['type'],'scriptContent':_0x1327ed};if(_0x26b035?.['remoteId'])_0x3e41c7['id']=_0x26b035[_0x366d41(0xaf)];if(_0x26b035?.[_0x366d41(0xb7)]!=null)_0x3e41c7[_0x366d41(0xb7)]=_0x26b035[_0x366d41(0xb7)];if(_0x254e16)_0x3e41c7[_0x366d41(0xd3)]=_0x254e16;if(_0x9aad32['type']===_0x366d41(0xaa)){const _0x3da592=_0x9aad32[_0x366d41(0xd7)];if(!_0x3da592||!_0x9aad32['operationType']||!_0x9aad32[_0x366d41(0xdf)])throw CliErrors['validation']('Incomplete\x20HOOK\x20path:\x20'+_0x9aad32[_0x366d41(0xa9)]);const _0x596b1f=_0x6f4531[_0x366d41(0xb9)][_0x366d41(0xb4)](_0x3da592)??_0x26b035?.[_0x366d41(0xd8)]??_0x3da592,_0x2eaf6e=_0x6f4531[_0x366d41(0xe2)][_0x366d41(0xb4)](_0x596b1f);if(!_0x2eaf6e)throw CliErrors['validation'](_0x366d41(0xc8)+_0x3da592+'\x22.\x20'+(_0x366d41(0x9d)+CLI_BIN_NAME+_0x366d41(0xca)));_0x3e41c7[_0x366d41(0xd1)]=_0x2eaf6e['id'],_0x3e41c7[_0x366d41(0xdb)]=_0x9aad32['operationType'],_0x3e41c7[_0x366d41(0xdf)]=_0x9aad32['functionNode'];}const _0x1fee95=await saveBffScript(_0x3e41c7),_0x23c940=_0x1fee95['id'],_0x23e1f7=_0x1fee95[_0x366d41(0xc0)]??await getBffScriptInfo(_0x23c940),_0x5a4ea6={'hash':_0x7badb5,'remoteId':_0x23c940,'version':_0x23e1f7['version']};if(_0x9aad32[_0x366d41(0xd0)]===_0x366d41(0xaa)){const _0x5bbb81=_0x9aad32['alias'],_0x3342a2=_0x6f4531['aliasToDatasetCode']['get'](_0x5bbb81)??_0x26b035?.[_0x366d41(0xd8)]??_0x5bbb81;_0x6f4531[_0x366d41(0xb9)][_0x366d41(0xce)](_0x5bbb81)?_0x5a4ea6[_0x366d41(0xd7)]=_0x5bbb81:_0x5a4ea6[_0x366d41(0xd7)]=_0x26b035?.[_0x366d41(0xd7)],_0x5a4ea6[_0x366d41(0xd8)]=_0x3342a2,_0x5a4ea6[_0x366d41(0xdb)]=_0x9aad32[_0x366d41(0xdb)],_0x5a4ea6[_0x366d41(0xdf)]=_0x9aad32[_0x366d41(0xdf)];}_0x264a6e[_0x366d41(0xc9)][_0x9aad32['lockKey']]=_0x5a4ea6;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1017f5,_0x4786fa,_0x18adec){const _0x4d388b=a37_0x4f96ff;if(_0x18adec[_0x4d388b(0xc1)]===0x0)return;for(let _0x1d66f6=0x0;_0x1d66f6<LOCK_SETTLE_RETRY_COUNT;_0x1d66f6+=0x1){const _0x18eefb=await readBffLockFile(_0x1017f5),_0x51dfa5=_0x18eefb?.[_0x4d388b(0xad)]?.[_0x4786fa]?.[_0x4d388b(0xc9)]??{},_0x19c223=_0x18adec[_0x4d388b(0xc3)](_0xdae8f5=>!!_0x51dfa5[_0xdae8f5]?.[_0x4d388b(0xaf)]);if(_0x19c223)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x18adec[_0x4d388b(0xd9)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x3c2b1f=a38_0x608b;(function(_0x324caf,_0x515c33){const _0x1d9eda=a38_0x608b,_0xdda27d=_0x324caf();while(!![]){try{const _0xe3291b=-parseInt(_0x1d9eda(0x1f4))/0x1+-parseInt(_0x1d9eda(0x1f1))/0x2+-parseInt(_0x1d9eda(0x1e5))/0x3*(parseInt(_0x1d9eda(0x1fa))/0x4)+-parseInt(_0x1d9eda(0x1f0))/0x5*(-parseInt(_0x1d9eda(0x1df))/0x6)+-parseInt(_0x1d9eda(0x1e1))/0x7*(-parseInt(_0x1d9eda(0x1f5))/0x8)+-parseInt(_0x1d9eda(0x1f2))/0x9+parseInt(_0x1d9eda(0x1fb))/0xa;if(_0xe3291b===_0x515c33)break;else _0xdda27d['push'](_0xdda27d['shift']());}catch(_0x318d3b){_0xdda27d['push'](_0xdda27d['shift']());}}}(a38_0x3016,0xdc749));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x3c2b1f(0x1fc),'command':'status','description':a38_0x3c2b1f(0x1ec),'risk':a38_0x3c2b1f(0x1f8),'flags':[{'name':'remote','type':a38_0x3c2b1f(0x1f6),'description':a38_0x3c2b1f(0x1fd)}],async 'execute'(_0x3bc6c9){const _0x4d6e17=a38_0x3c2b1f,_0x1656c9=loadBffProjectConfig(_0x3bc6c9[_0x4d6e17(0x1ed)]),_0x447e08=await readBffLockFile(_0x1656c9[_0x4d6e17(0x1e9)]),{appLock:_0x18b206}=ensureLockScope(_0x447e08??createEmptyBffLock(),_0x3bc6c9[_0x4d6e17(0x1ed)],_0x1656c9['scriptsRoot'],_0x4d6e17(0x1e6)),_0x45b48f=await scanLocalBffFunctions(_0x1656c9),_0x2e7e8a=[],_0x3470f6=[],_0x535e36=[];for(const _0x8c394f of _0x45b48f){const _0x54fc46=await computeFileHash(_0x8c394f['filePath']),_0x1e3160=_0x18b206[_0x4d6e17(0x1dd)][_0x8c394f[_0x4d6e17(0x1eb)]];if(!_0x1e3160)_0x2e7e8a[_0x4d6e17(0x1ea)](_0x8c394f[_0x4d6e17(0x1eb)]);else _0x1e3160[_0x4d6e17(0x1de)]!==_0x54fc46?_0x3470f6[_0x4d6e17(0x1ea)](_0x8c394f[_0x4d6e17(0x1eb)]):_0x535e36[_0x4d6e17(0x1ea)](_0x8c394f[_0x4d6e17(0x1eb)]);}const _0x3a4fdb=[];if(_0x3bc6c9[_0x4d6e17(0x1e2)](_0x4d6e17(0x1e0))){const _0x1cb6d5=loadAliasMap(_0x3bc6c9['apiDir'],undefined,resolveApiFilePath(_0x3bc6c9[_0x4d6e17(0x1e4)],_0x3bc6c9[_0x4d6e17(0x1ed)])),_0x3de030=new Map(_0x1cb6d5[_0x4d6e17(0x1e7)](_0x5c0f75=>[_0x5c0f75[_0x4d6e17(0x1e3)],_0x5c0f75[_0x4d6e17(0x1f3)]])),[_0x294afd,_0x158484]=await Promise[_0x4d6e17(0x1ee)]([listBffScripts(_0x3bc6c9[_0x4d6e17(0x1ed)]),getBffScriptStatistics(_0x3bc6c9[_0x4d6e17(0x1ed)])]),_0x3e8cb1=createHookLocationMap(_0x158484),_0x137b0a=new Set(_0x45b48f[_0x4d6e17(0x1e7)](_0x486662=>_0x486662[_0x4d6e17(0x1eb)]));for(const _0x4daee2 of _0x294afd){const _0x16f7a0=resolveRemoteScriptTarget(_0x1656c9,_0x4daee2,_0x3e8cb1,_0x18b206['functions'],_0x3de030);_0x16f7a0&&!_0x137b0a['has'](_0x16f7a0[_0x4d6e17(0x1eb)])&&_0x3a4fdb['push'](_0x16f7a0['lockKey']);}}const _0x58b2e5=_0x2e7e8a[_0x4d6e17(0x1e8)]===0x0&&_0x3470f6[_0x4d6e17(0x1e8)]===0x0&&_0x3a4fdb[_0x4d6e17(0x1e8)]===0x0;return{'ok':!![],'data':{'added':_0x2e7e8a,'modified':_0x3470f6,'unchanged':_0x535e36,'remoteOnly':_0x3a4fdb},'message':_0x58b2e5?_0x4d6e17(0x1f7):_0x2e7e8a[_0x4d6e17(0x1e8)]+_0x4d6e17(0x1f9)+_0x3470f6[_0x4d6e17(0x1e8)]+'\x20modified,\x20'+_0x535e36[_0x4d6e17(0x1e8)]+'\x20unchanged'+(_0x3a4fdb[_0x4d6e17(0x1e8)]>0x0?',\x20'+_0x3a4fdb[_0x4d6e17(0x1e8)]+_0x4d6e17(0x1ef):'')};}};function a38_0x608b(_0x3d7fd2,_0x1c465a){_0x3d7fd2=_0x3d7fd2-0x1dd;const _0x30168f=a38_0x3016();let _0x608be7=_0x30168f[_0x3d7fd2];return _0x608be7;}function a38_0x3016(){const _0x3d3c8e=['bool','datasetCode','apiDir','3jPlaCR','status','map','length','lockFilePath','push','lockKey','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','appCode','all','\x20remote-only','155fQYcSj','2182692GpZxLP','14305203CsCPHt','alias','1538382QEQrwi','570488cLyfjU','boolean','All\x20BFF\x20scripts\x20are\x20in\x20sync.','read','\x20added,\x20','2791788cIhtXE','54071830xykzDQ','bff','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','functions','hash','10914bsPlXa','remote','35Dfdclr'];a38_0x3016=function(){return _0x3d3c8e;};return a38_0x3016();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a39_0x77ad(_0x348315,_0x5d01a7){_0x348315=_0x348315-0x99;const _0x7511d6=a39_0x7511();let _0x77add4=_0x7511d6[_0x348315];return _0x77add4;}const a39_0x271ba7=a39_0x77ad;(function(_0x3de919,_0x567b85){const _0x2ab911=a39_0x77ad,_0x1d6699=_0x3de919();while(!![]){try{const _0x543a6e=parseInt(_0x2ab911(0xb2))/0x1+parseInt(_0x2ab911(0xa4))/0x2*(-parseInt(_0x2ab911(0x9d))/0x3)+-parseInt(_0x2ab911(0x9b))/0x4*(parseInt(_0x2ab911(0x9a))/0x5)+-parseInt(_0x2ab911(0xa0))/0x6*(-parseInt(_0x2ab911(0xa2))/0x7)+-parseInt(_0x2ab911(0xb5))/0x8*(-parseInt(_0x2ab911(0xa5))/0x9)+parseInt(_0x2ab911(0xb1))/0xa*(-parseInt(_0x2ab911(0xa8))/0xb)+parseInt(_0x2ab911(0xa3))/0xc*(parseInt(_0x2ab911(0xb6))/0xd);if(_0x543a6e===_0x567b85)break;else _0x1d6699['push'](_0x1d6699['shift']());}catch(_0x8bb924){_0x1d6699['push'](_0x1d6699['shift']());}}}(a39_0x7511,0x21d36));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x271ba7(0x99),'command':'install','description':a39_0x271ba7(0xa6),'risk':a39_0x271ba7(0x9e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5eaa66){const _0xbae5a1=a39_0x271ba7;logger['setLogPath'](process['cwd']()),logger[_0xbae5a1(0xad)](_0xbae5a1(0xac),_0xbae5a1(0xa7));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x38bd61,RABETBASE_SKILL_SOURCE:_0x562d29,runNpxSkillsAddGlobal:_0x501672}=await import('../../skills/npx-skills-add.js'),_0x177abd=_0x5eaa66[_0xbae5a1(0xaf)]?_0xbae5a1(0xb7):'inherit';console[_0xbae5a1(0xab)](_0xbae5a1(0x9c)+_0x38bd61+_0xbae5a1(0xb3));const _0x5ae447=_0x501672(process['cwd'](),_0x562d29,{'stdio':_0x177abd});if(_0x5ae447[_0xbae5a1(0x9f)])console[_0xbae5a1(0xab)](_0xbae5a1(0xaa));else{if(_0x5ae447['ok'])console[_0xbae5a1(0xab)](_0xbae5a1(0xb0));else throw CliErrors[_0xbae5a1(0xa1)](_0xbae5a1(0xae)+(_0x5ae447['error']||_0xbae5a1(0xb4)),_0xbae5a1(0xa9)+_0x38bd61);}return{'ok':!![]};}}];function a39_0x7511(){const _0x5bb530=['3172fDjcBf','144Ldiioa','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','55piHlRW','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','log','cli-skill-install','info','npx\x20skills\x20add\x20failed:\x20','nonInteractive','CLI\x20Built-in\x20Skill\x20installed','327270fvoloW','38298mrUxvH',')...','unknown','103784BfCtqd','178646UjtruM','pipe','cli-skill','45zQGANm','85784kcMOOd','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(','429TdOInv','write','skipped','6AWkoss','apiError','1890007DEaKmt','180JYiaNr'];a39_0x7511=function(){return _0x5bb530;};return a39_0x7511();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x952e27=a40_0x4753;(function(_0x2edf08,_0x14e180){const _0x230093=a40_0x4753,_0x4b0b56=_0x2edf08();while(!![]){try{const _0xc502cd=-parseInt(_0x230093(0x19c))/0x1*(-parseInt(_0x230093(0x198))/0x2)+-parseInt(_0x230093(0x186))/0x3*(-parseInt(_0x230093(0x1a6))/0x4)+parseInt(_0x230093(0x1c7))/0x5*(-parseInt(_0x230093(0x189))/0x6)+-parseInt(_0x230093(0x19f))/0x7*(parseInt(_0x230093(0x1bc))/0x8)+-parseInt(_0x230093(0x1d1))/0x9+parseInt(_0x230093(0x187))/0xa+parseInt(_0x230093(0x19b))/0xb;if(_0xc502cd===_0x14e180)break;else _0x4b0b56['push'](_0x4b0b56['shift']());}catch(_0x28d72a){_0x4b0b56['push'](_0x4b0b56['shift']());}}}(a40_0x2277,0xc38a0));import a40_0x5a6121 from'chalk';import a40_0x452e9b from'ora';import a40_0x524678 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 _0x12c969=a40_0x4753;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x12c969(0x1c9)](0x0,0xa)+')':VERSION;}function a40_0x4753(_0x243385,_0x3e4a56){_0x243385=_0x243385-0x186;const _0x2277f4=a40_0x2277();let _0x475390=_0x2277f4[_0x243385];return _0x475390;}function detectPackageManager(){const _0x8a2297=a40_0x4753,_0x43173f=process[_0x8a2297(0x1ac)][_0x8a2297(0x195)]();if(_0x43173f[_0x8a2297(0x1b9)](_0x8a2297(0x1ae)))return'bun';return _0x8a2297(0x1b5);}const updateFlags=[{'name':a40_0x952e27(0x1c1),'type':a40_0x952e27(0x18c),'description':a40_0x952e27(0x1a7),'default':![]},{'name':'version','type':'string','description':a40_0x952e27(0x19a)},{'name':a40_0x952e27(0x1d6),'type':a40_0x952e27(0x18c),'description':'Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','default':![]},{'name':a40_0x952e27(0x1a3),'type':a40_0x952e27(0x18c),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function getRequestedVersion(_0x49d1d1){const _0x35580c=a40_0x952e27;return _0x49d1d1[_0x35580c(0x1c2)](_0x35580c(0x1a5))[_0x35580c(0x191)]();}function shouldSkipCliSkill(_0x3ebf62){const _0x41f6e9=a40_0x952e27;return _0x3ebf62[_0x41f6e9(0x19d)]('no-skills')||_0x3ebf62[_0x41f6e9(0x1b0)](_0x41f6e9(0x1a3))===![];}async function validateUpdateFlags(_0x509baa){const _0xfcc34=a40_0x952e27,_0x1dbfa6=_0x509baa[_0xfcc34(0x19d)](_0xfcc34(0x1c1)),_0x31718b=getRequestedVersion(_0x509baa);if(_0x1dbfa6&&_0x31718b)throw CliErrors[_0xfcc34(0x194)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x31718b&&!a40_0x524678['valid'](_0x31718b))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x31718b,_0xfcc34(0x1d5));}async function fetchNpmDistTags(){const _0x10160a=a40_0x952e27;try{const _0x53f552=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x10160a(0x1ba)](0x2710)});if(!_0x53f552['ok'])return null;const _0xf620b4=await _0x53f552[_0x10160a(0x1c8)]();if(!_0xf620b4||typeof _0xf620b4!=='object')return null;return Object[_0x10160a(0x1d7)](Object[_0x10160a(0x196)](_0xf620b4)[_0x10160a(0x1b3)](([,_0xf587b4])=>typeof _0xf587b4===_0x10160a(0x18a)&&_0xf587b4['trim']()[_0x10160a(0x1cd)]>0x0)[_0x10160a(0x197)](([_0x3f25af,_0x249660])=>[_0x3f25af,String(_0x249660)[_0x10160a(0x191)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x29b97e){const _0x3bb253=await fetchNpmDistTags();return _0x3bb253?.[_0x29b97e]??null;}async function fetchLatestVersion(){const _0x51447b=a40_0x952e27;return fetchNpmDistTagVersion(_0x51447b(0x1bb));}async function resolveTargetVersion(_0x57a64a){const _0xb594a8=a40_0x952e27,_0x156aaa=getRequestedVersion(_0x57a64a);if(_0x156aaa)return{'version':_0x156aaa,'source':_0xb594a8(0x1a5)};if(_0x57a64a[_0xb594a8(0x19d)](_0xb594a8(0x1c1))){const _0x1d917f=await fetchNpmDistTagVersion(_0xb594a8(0x1c1));if(!_0x1d917f)return null;return{'version':_0x1d917f,'source':_0xb594a8(0x1c1)};}const _0x5668d7=await fetchLatestVersion();if(!_0x5668d7)return null;return{'version':_0x5668d7,'source':_0xb594a8(0x1bb)};}function shouldInstallTarget(_0x26ca58,_0x580d26){const _0xac731e=a40_0x952e27;if(_0x580d26[_0xac731e(0x1b7)]===_0xac731e(0x1a5)||_0x580d26[_0xac731e(0x1b7)]===_0xac731e(0x1c1))return!a40_0x524678['eq'](_0x26ca58,_0x580d26[_0xac731e(0x1a5)]);return a40_0x524678['lt'](_0x26ca58,_0x580d26[_0xac731e(0x1a5)]);}function getInstallPlanLabel(_0x4dd74d,_0x129090){const _0x3674bf=a40_0x952e27;switch(_0x129090['source']){case _0x3674bf(0x1c1):return'Beta\x20version:\x20'+a40_0x5a6121[_0x3674bf(0x1a4)](_0x4dd74d)+_0x3674bf(0x188)+a40_0x5a6121[_0x3674bf(0x1aa)](_0x129090['version']);case _0x3674bf(0x1a5):return _0x3674bf(0x1bd)+a40_0x5a6121[_0x3674bf(0x1a4)](_0x4dd74d)+'\x20→\x20'+a40_0x5a6121[_0x3674bf(0x1aa)](_0x129090[_0x3674bf(0x1a5)]);case _0x3674bf(0x1bb):default:return _0x3674bf(0x1c0)+a40_0x5a6121[_0x3674bf(0x1a4)](_0x4dd74d)+_0x3674bf(0x188)+a40_0x5a6121[_0x3674bf(0x1aa)](_0x129090[_0x3674bf(0x1a5)]);}}function a40_0x2277(){const _0x3ef3d4=['Checking\x20CLI\x20Built-in\x20Skill...','\x20\x20Try\x20manually:\x20','trim','gray','start','validation','toLowerCase','entries','map','430Ajdfvt','message','Install\x20a\x20specific\x20CLI\x20version','316811RSyWEl','3895lHsnXC','bool','log','14dsidkq','install','Version\x20comparison\x20failed','...','skills','yellow','version','108QohTqS','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','Already\x20on\x20requested\x20version\x20(v','green','nonInteractive','execPath','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','bun','Checking\x20for\x20updates...','flag','inherit','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','filter','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','npm','red','source','error','includes','timeout','latest','3023376CRaObl','Requested\x20version:\x20','\x20\x20Run\x20manually:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Update\x20available:\x20','beta','str','\x20install\x20-g\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','cwd','4045xCAFoR','json','slice','\x20cli-skill\x20install','fail','valid','length','unknown','Updated\x20to\x20v','run','6727608bUsQcr','Update\x20failed','@latest','write','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','no-skills','fromEntries','Updating\x20via\x20','141855sIYPkc','2495440UIQEMX','\x20→\x20','654cagaIh','string','info','boolean','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','update'];a40_0x2277=function(){return _0x3ef3d4;};return a40_0x2277();}async function installCliSkill(_0x4fac63){const _0x25e52b=a40_0x952e27;console[_0x25e52b(0x19e)](a40_0x5a6121[_0x25e52b(0x192)](_0x25e52b(0x18f)));const _0x46f1e3=runNpxSkillsAddGlobal(process[_0x25e52b(0x1c6)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x4fac63?'pipe':_0x25e52b(0x1b1)});if(_0x46f1e3['skipped']){console['log'](a40_0x5a6121[_0x25e52b(0x192)](_0x25e52b(0x1b4)));return;}if(_0x46f1e3['ok']){console[_0x25e52b(0x19e)](a40_0x5a6121[_0x25e52b(0x192)](_0x25e52b(0x1a8)));return;}console['warn'](a40_0x5a6121[_0x25e52b(0x1a4)](_0x25e52b(0x1c5)+(_0x46f1e3[_0x25e52b(0x1b8)]||_0x25e52b(0x1ce)))),console[_0x25e52b(0x19e)](a40_0x5a6121[_0x25e52b(0x192)](_0x25e52b(0x1be)+CLI_BIN_NAME+_0x25e52b(0x1ca)));}async function execute(_0x13771e){const _0xde54c4=a40_0x952e27;await validateUpdateFlags(_0x13771e);const _0x3de316=getCurrentVersion();console[_0xde54c4(0x19e)]('Current\x20version:\x20'+_0x3de316);const _0x255e7d=a40_0x452e9b(_0xde54c4(0x1af))[_0xde54c4(0x193)](),_0x20c16a=await resolveTargetVersion(_0x13771e);if(!_0x20c16a){const _0x32c2dd=_0x13771e['bool'](_0xde54c4(0x1c1))?_0xde54c4(0x1ad):_0xde54c4(0x1bf);return _0x255e7d['fail'](_0x32c2dd),console['log'](a40_0x5a6121[_0xde54c4(0x192)](_0xde54c4(0x1c4)+NPM_PACKAGE_NAME+_0xde54c4(0x1d3))),{'ok':![],'message':_0x32c2dd};}const _0x4324c6=a40_0x524678[_0xde54c4(0x1cc)](VERSION),_0x354a8a=a40_0x524678['valid'](_0x20c16a[_0xde54c4(0x1a5)]);if(!_0x4324c6||!_0x354a8a)return _0x255e7d[_0xde54c4(0x1cb)](_0xde54c4(0x1a1)),{'ok':![],'message':_0xde54c4(0x1a1)};if(!shouldInstallTarget(_0x4324c6,_0x20c16a)){const _0x318449=_0x20c16a[_0xde54c4(0x1b7)]==='version'?_0xde54c4(0x1a9)+_0x20c16a[_0xde54c4(0x1a5)]+')':'Already\x20up\x20to\x20date\x20(v'+_0x20c16a[_0xde54c4(0x1a5)]+')';return _0x255e7d['succeed'](_0x318449),shouldSkipCliSkill(_0x13771e)?console[_0xde54c4(0x19e)](a40_0x5a6121[_0xde54c4(0x192)](_0xde54c4(0x1b2))):await installCliSkill(_0x13771e[_0xde54c4(0x1ab)]),{'ok':!![]};}_0x255e7d[_0xde54c4(0x18b)](getInstallPlanLabel(_0x3de316,_0x20c16a));const _0x2cbe6e=detectPackageManager(),_0x6ff9f7=_0x2cbe6e===_0xde54c4(0x1b5)?resolveNpmBin(_0xde54c4(0x1b5)):_0x2cbe6e,_0x540dc0=a40_0x452e9b(_0xde54c4(0x1d8)+_0x2cbe6e+_0xde54c4(0x1a2))[_0xde54c4(0x193)]();try{return await execa(_0x6ff9f7,[_0xde54c4(0x1a0),'-g',NPM_PACKAGE_NAME+'@'+_0x20c16a['version']],{'stdio':'pipe'}),_0x540dc0['succeed'](_0xde54c4(0x1cf)+_0x20c16a[_0xde54c4(0x1a5)]),console['log'](a40_0x5a6121[_0xde54c4(0x192)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),shouldSkipCliSkill(_0x13771e)?console[_0xde54c4(0x19e)](a40_0x5a6121['gray'](_0xde54c4(0x1b2))):await installCliSkill(_0x13771e['nonInteractive']),{'ok':!![]};}catch(_0x5b42fd){return _0x540dc0['fail'](_0xde54c4(0x1d2)),console[_0xde54c4(0x1b8)](a40_0x5a6121[_0xde54c4(0x1b6)]('\x20\x20'+_0x5b42fd[_0xde54c4(0x199)])),console[_0xde54c4(0x19e)](a40_0x5a6121[_0xde54c4(0x192)](_0xde54c4(0x190)+_0x2cbe6e+_0xde54c4(0x1c3)+NPM_PACKAGE_NAME+'@'+_0x20c16a[_0xde54c4(0x1a5)])),{'ok':![],'message':_0x5b42fd[_0xde54c4(0x199)]};}}export const updateDefinition={'service':a40_0x952e27(0x18e),'command':a40_0x952e27(0x1d0),'description':a40_0x952e27(0x18d),'risk':a40_0x952e27(0x1d4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x157917=a40_0x2c5f;function a40_0x4fda(){const _0x369061=['cwd','12315540NopDrx','Install\x20a\x20specific\x20CLI\x20version','no-skills','str','fail','red','update','Updating\x20via\x20','slice','\x20cli-skill\x20install','inherit','63dcTGhB','Checking\x20for\x20updates...','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Updated\x20to\x20v','/dist-tags','4025145RVEdWY','green','pipe','Update\x20failed','bun','\x20install\x20-g\x20','skills','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','flag','Beta\x20version:\x20','string','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','\x20→\x20','Already\x20up\x20to\x20date\x20(v','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','source','Requested\x20version:\x20','npm','run','start','map','valid','9304799lyRSlI','1568CvKdSz','message','Current\x20version:\x20','entries','gray','install','unknown','beta','\x20\x20Try\x20manually:\x20','2610306yDmoxP','Update\x20available:\x20','Invalid\x20version:\x20','1bRWNyR','latest','Version\x20comparison\x20failed','bool','65884KDsJwk','succeed','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','...','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','length','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','error','536482pFmEdA','validation','Already\x20on\x20requested\x20version\x20(v','info','58761JrwmxG','yellow','version','write','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','https://registry.npmjs.org/-/package/','trim','log','boolean','nonInteractive'];a40_0x4fda=function(){return _0x369061;};return a40_0x4fda();}(function(_0x5443e7,_0x2d9efe){const _0xceb21=a40_0x2c5f,_0x4049b8=_0x5443e7();while(!![]){try{const _0x20579b=parseInt(_0xceb21(0x120))/0x1*(parseInt(_0xceb21(0x12d))/0x2)+-parseInt(_0xceb21(0x147))/0x3*(parseInt(_0xceb21(0x124))/0x4)+-parseInt(_0xceb21(0x14c))/0x5+parseInt(_0xceb21(0x11d))/0x6+-parseInt(_0xceb21(0x113))/0x7+parseInt(_0xceb21(0x114))/0x8*(parseInt(_0xceb21(0x131))/0x9)+parseInt(_0xceb21(0x13c))/0xa;if(_0x20579b===_0x2d9efe)break;else _0x4049b8['push'](_0x4049b8['shift']());}catch(_0x5351ec){_0x4049b8['push'](_0x4049b8['shift']());}}}(a40_0x4fda,0xb3491));import a40_0x1aede3 from'chalk';import a40_0x171b96 from'ora';import a40_0x1308f5 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 _0xb1cbe8=a40_0x2c5f;return GIT_COMMIT!==_0xb1cbe8(0x11a)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0xb1cbe8(0x144)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0xcc5ceb=a40_0x2c5f,_0x337730=process['execPath']['toLowerCase']();if(_0x337730['includes'](_0xcc5ceb(0x150)))return'bun';return _0xcc5ceb(0x15e);}function a40_0x2c5f(_0x1d3ed3,_0x5531f9){_0x1d3ed3=_0x1d3ed3-0x111;const _0x4fdac0=a40_0x4fda();let _0x2c5ff6=_0x4fdac0[_0x1d3ed3];return _0x2c5ff6;}const updateFlags=[{'name':a40_0x157917(0x11b),'type':a40_0x157917(0x139),'description':a40_0x157917(0x127),'default':![]},{'name':a40_0x157917(0x133),'type':a40_0x157917(0x156),'description':a40_0x157917(0x13d)},{'name':a40_0x157917(0x13e),'type':a40_0x157917(0x139),'description':a40_0x157917(0x126),'default':![]},{'name':'skills','type':'boolean','description':a40_0x157917(0x158),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x3be2a5){const _0x696d00=a40_0x157917;return _0x3be2a5[_0x696d00(0x13f)](_0x696d00(0x133))[_0x696d00(0x137)]();}function shouldSkipCliSkill(_0x3af86e){const _0x172a8c=a40_0x157917;return _0x3af86e['bool'](_0x172a8c(0x13e))||_0x3af86e[_0x172a8c(0x154)](_0x172a8c(0x152))===![];}async function validateUpdateFlags(_0x29a7a7){const _0x444c3e=a40_0x157917,_0x44716c=_0x29a7a7[_0x444c3e(0x123)](_0x444c3e(0x11b)),_0x4fcd93=getRequestedVersion(_0x29a7a7);if(_0x44716c&&_0x4fcd93)throw CliErrors[_0x444c3e(0x12e)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x444c3e(0x149));if(_0x4fcd93&&!a40_0x1308f5[_0x444c3e(0x112)](_0x4fcd93))throw CliErrors['validation'](_0x444c3e(0x11f)+_0x4fcd93,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x453716=a40_0x157917;try{const _0x4bfdd4=await fetch(_0x453716(0x136)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x453716(0x14b),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x4bfdd4['ok'])return null;const _0x250efc=await _0x4bfdd4['json']();if(!_0x250efc||typeof _0x250efc!=='object')return null;return Object['fromEntries'](Object[_0x453716(0x117)](_0x250efc)['filter'](([,_0x286b01])=>typeof _0x286b01===_0x453716(0x156)&&_0x286b01[_0x453716(0x137)]()[_0x453716(0x12a)]>0x0)[_0x453716(0x111)](([_0x13d6d8,_0x405054])=>[_0x13d6d8,String(_0x405054)[_0x453716(0x137)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x187eef){const _0x1b72ed=await fetchNpmDistTags();return _0x1b72ed?.[_0x187eef]??null;}async function fetchLatestVersion(){const _0x264451=a40_0x157917;return fetchNpmDistTagVersion(_0x264451(0x121));}async function resolveTargetVersion(_0x45018e){const _0x305c91=a40_0x157917,_0x5ec29e=getRequestedVersion(_0x45018e);if(_0x5ec29e)return{'version':_0x5ec29e,'source':_0x305c91(0x133)};if(_0x45018e[_0x305c91(0x123)](_0x305c91(0x11b))){const _0x235b2d=await fetchNpmDistTagVersion(_0x305c91(0x11b));if(!_0x235b2d)return null;return{'version':_0x235b2d,'source':_0x305c91(0x11b)};}const _0x1b34b6=await fetchLatestVersion();if(!_0x1b34b6)return null;return{'version':_0x1b34b6,'source':_0x305c91(0x121)};}function shouldInstallTarget(_0x9fed18,_0x601410){const _0x3b46e6=a40_0x157917;if(_0x601410[_0x3b46e6(0x15c)]===_0x3b46e6(0x133)||_0x601410[_0x3b46e6(0x15c)]===_0x3b46e6(0x11b))return!a40_0x1308f5['eq'](_0x9fed18,_0x601410[_0x3b46e6(0x133)]);return a40_0x1308f5['lt'](_0x9fed18,_0x601410[_0x3b46e6(0x133)]);}function getInstallPlanLabel(_0x41d35f,_0x8f687e){const _0x245101=a40_0x157917;switch(_0x8f687e['source']){case _0x245101(0x11b):return _0x245101(0x155)+a40_0x1aede3[_0x245101(0x132)](_0x41d35f)+_0x245101(0x159)+a40_0x1aede3[_0x245101(0x14d)](_0x8f687e[_0x245101(0x133)]);case _0x245101(0x133):return _0x245101(0x15d)+a40_0x1aede3[_0x245101(0x132)](_0x41d35f)+_0x245101(0x159)+a40_0x1aede3[_0x245101(0x14d)](_0x8f687e[_0x245101(0x133)]);case _0x245101(0x121):default:return _0x245101(0x11e)+a40_0x1aede3[_0x245101(0x132)](_0x41d35f)+'\x20→\x20'+a40_0x1aede3[_0x245101(0x14d)](_0x8f687e['version']);}}async function installCliSkill(_0x455e2f){const _0x3f3232=a40_0x157917;console['log'](a40_0x1aede3[_0x3f3232(0x118)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x27c9ae=runNpxSkillsAddGlobal(process[_0x3f3232(0x13b)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x455e2f?_0x3f3232(0x14e):_0x3f3232(0x146)});if(_0x27c9ae['skipped']){console[_0x3f3232(0x138)](a40_0x1aede3[_0x3f3232(0x118)](_0x3f3232(0x129)));return;}if(_0x27c9ae['ok']){console[_0x3f3232(0x138)](a40_0x1aede3['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.'));return;}console['warn'](a40_0x1aede3[_0x3f3232(0x132)]('\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20'+(_0x27c9ae[_0x3f3232(0x12c)]||_0x3f3232(0x11a)))),console[_0x3f3232(0x138)](a40_0x1aede3[_0x3f3232(0x118)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x3f3232(0x145)));}async function execute(_0x48d6d9){const _0x3e3d3b=a40_0x157917;await validateUpdateFlags(_0x48d6d9);const _0x1eb95a=getCurrentVersion();console[_0x3e3d3b(0x138)](_0x3e3d3b(0x116)+_0x1eb95a);const _0x499200=a40_0x171b96(_0x3e3d3b(0x148))['start'](),_0x431825=await resolveTargetVersion(_0x48d6d9);if(!_0x431825){const _0x4c37a5=_0x48d6d9[_0x3e3d3b(0x123)](_0x3e3d3b(0x11b))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x3e3d3b(0x157);return _0x499200['fail'](_0x4c37a5),console[_0x3e3d3b(0x138)](a40_0x1aede3[_0x3e3d3b(0x118)](_0x3e3d3b(0x153)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x4c37a5};}const _0x575310=a40_0x1308f5[_0x3e3d3b(0x112)](VERSION),_0x590c4e=a40_0x1308f5[_0x3e3d3b(0x112)](_0x431825[_0x3e3d3b(0x133)]);if(!_0x575310||!_0x590c4e)return _0x499200[_0x3e3d3b(0x140)](_0x3e3d3b(0x122)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x575310,_0x431825)){const _0x2280cf=_0x431825[_0x3e3d3b(0x15c)]==='version'?_0x3e3d3b(0x12f)+_0x431825['version']+')':_0x3e3d3b(0x15a)+_0x431825[_0x3e3d3b(0x133)]+')';return _0x499200[_0x3e3d3b(0x125)](_0x2280cf),shouldSkipCliSkill(_0x48d6d9)?console[_0x3e3d3b(0x138)](a40_0x1aede3[_0x3e3d3b(0x118)](_0x3e3d3b(0x135))):await installCliSkill(_0x48d6d9[_0x3e3d3b(0x13a)]),{'ok':!![]};}_0x499200[_0x3e3d3b(0x130)](getInstallPlanLabel(_0x1eb95a,_0x431825));const _0x89a8a2=detectPackageManager(),_0x3cbc34=_0x89a8a2===_0x3e3d3b(0x15e)?resolveNpmBin(_0x3e3d3b(0x15e)):_0x89a8a2,_0x2d371e=a40_0x171b96(_0x3e3d3b(0x143)+_0x89a8a2+_0x3e3d3b(0x128))[_0x3e3d3b(0x160)]();try{return await execa(_0x3cbc34,[_0x3e3d3b(0x119),'-g',NPM_PACKAGE_NAME+'@'+_0x431825[_0x3e3d3b(0x133)]],{'stdio':_0x3e3d3b(0x14e)}),_0x2d371e[_0x3e3d3b(0x125)](_0x3e3d3b(0x14a)+_0x431825[_0x3e3d3b(0x133)]),console['log'](a40_0x1aede3['gray'](_0x3e3d3b(0x15b))),shouldSkipCliSkill(_0x48d6d9)?console[_0x3e3d3b(0x138)](a40_0x1aede3[_0x3e3d3b(0x118)](_0x3e3d3b(0x135))):await installCliSkill(_0x48d6d9['nonInteractive']),{'ok':!![]};}catch(_0x9175b6){return _0x2d371e[_0x3e3d3b(0x140)](_0x3e3d3b(0x14f)),console['error'](a40_0x1aede3[_0x3e3d3b(0x141)]('\x20\x20'+_0x9175b6[_0x3e3d3b(0x115)])),console[_0x3e3d3b(0x138)](a40_0x1aede3['gray'](_0x3e3d3b(0x11c)+_0x89a8a2+_0x3e3d3b(0x151)+NPM_PACKAGE_NAME+'@'+_0x431825[_0x3e3d3b(0x133)])),{'ok':![],'message':_0x9175b6[_0x3e3d3b(0x115)]};}}export const updateDefinition={'service':a40_0x157917(0x142),'command':a40_0x157917(0x15f),'description':a40_0x157917(0x12b),'risk':a40_0x157917(0x134),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a41_0x13ca(){const _0x5c2bff=['1050608jCHZLJ','3118712HFjUzI','34894278LvNNRX','12186iKzPKa','3002742cBhFRY','1SaWKbD','5622315igdDxl','2086dFoVeF','2074244tmiofP'];a41_0x13ca=function(){return _0x5c2bff;};return a41_0x13ca();}(function(_0x9d76c9,_0x1f3cf9){const _0x3348b3=a41_0x9c1e,_0x37efbd=_0x9d76c9();while(!![]){try{const _0x35f9e6=-parseInt(_0x3348b3(0x6b))/0x1*(-parseInt(_0x3348b3(0x6e))/0x2)+parseInt(_0x3348b3(0x6a))/0x3+parseInt(_0x3348b3(0x67))/0x4+parseInt(_0x3348b3(0x6c))/0x5+parseInt(_0x3348b3(0x69))/0x6*(parseInt(_0x3348b3(0x6d))/0x7)+parseInt(_0x3348b3(0x66))/0x8+-parseInt(_0x3348b3(0x68))/0x9;if(_0x35f9e6===_0x1f3cf9)break;else _0x37efbd['push'](_0x37efbd['shift']());}catch(_0x5a16e6){_0x37efbd['push'](_0x37efbd['shift']());}}}(a41_0x13ca,0xc3b3f));function a41_0x9c1e(_0x42af57,_0xf3c1f3){_0x42af57=_0x42af57-0x66;const _0x13caba=a41_0x13ca();let _0x9c1e77=_0x13caba[_0x42af57];return _0x9c1e77;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x33ec1e=a42_0x2649;(function(_0x58fca9,_0x5138ed){const _0x3252fd=a42_0x2649,_0xc2d955=_0x58fca9();while(!![]){try{const _0x5cee42=-parseInt(_0x3252fd(0x1c7))/0x1+parseInt(_0x3252fd(0x1b7))/0x2*(-parseInt(_0x3252fd(0x1c1))/0x3)+-parseInt(_0x3252fd(0x1c6))/0x4+parseInt(_0x3252fd(0x1c2))/0x5*(parseInt(_0x3252fd(0x1bd))/0x6)+parseInt(_0x3252fd(0x1ba))/0x7+-parseInt(_0x3252fd(0x1cc))/0x8+parseInt(_0x3252fd(0x1b6))/0x9*(parseInt(_0x3252fd(0x1b9))/0xa);if(_0x5cee42===_0x5138ed)break;else _0xc2d955['push'](_0xc2d955['shift']());}catch(_0x42058b){_0xc2d955['push'](_0xc2d955['shift']());}}}(a42_0x13c6,0xae940));function a42_0x13c6(){const _0x157417=['sdk','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','name','37509dqMzTg','5zLDFsN','str','alias','code','1740104mLNNzB','128713QuuesB','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','boolean','bool','codegen','4596904ONtxfg','skip-imports','string','9JUlEJg','132OyTRSS','operation','24235030mhTjIk','1034628YQQMGF','appCode','read','643890seYYmY'];a42_0x13c6=function(){return _0x157417;};return a42_0x13c6();}function a42_0x2649(_0x1c119a,_0x22962b){_0x1c119a=_0x1c119a-0x1b6;const _0x13c6ff=a42_0x13c6();let _0x26493e=_0x13c6ff[_0x1c119a];return _0x26493e;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x33ec1e(0x1cb),'command':a42_0x33ec1e(0x1be),'description':a42_0x33ec1e(0x1c8),'risk':a42_0x33ec1e(0x1bc),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x33ec1e(0x1c4),'type':a42_0x33ec1e(0x1ce),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':'string','required':!![],'description':a42_0x33ec1e(0x1bf)},{'name':a42_0x33ec1e(0x1cd),'type':a42_0x33ec1e(0x1c9),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x2c8960){const _0x258177=a42_0x33ec1e,{dataset:_0x3f16ef,operation:_0x346282}=await getOperationDetail(_0x2c8960[_0x258177(0x1bb)],_0x2c8960[_0x258177(0x1c3)](_0x258177(0x1c5)),_0x2c8960['str']('operation')),_0x54a8f7=generateSdkCode(_0x3f16ef,_0x346282,{'includeImports':!_0x2c8960[_0x258177(0x1ca)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x3f16ef[_0x258177(0x1c0)],'code':_0x3f16ef[_0x258177(0x1c5)],'tableName':_0x3f16ef['tableName']},'operation':_0x2c8960['str'](_0x258177(0x1b8)),'code':_0x54a8f7}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x115de6=a43_0x4e06;(function(_0x44559b,_0x5173ed){const _0x5b4277=a43_0x4e06,_0x34cf84=_0x44559b();while(!![]){try{const _0x3d4c8d=parseInt(_0x5b4277(0x81))/0x1*(-parseInt(_0x5b4277(0x92))/0x2)+parseInt(_0x5b4277(0x8d))/0x3*(parseInt(_0x5b4277(0x80))/0x4)+parseInt(_0x5b4277(0x88))/0x5+-parseInt(_0x5b4277(0x8f))/0x6+-parseInt(_0x5b4277(0x89))/0x7*(parseInt(_0x5b4277(0x83))/0x8)+parseInt(_0x5b4277(0x8e))/0x9+parseInt(_0x5b4277(0x8a))/0xa*(-parseInt(_0x5b4277(0x8c))/0xb);if(_0x3d4c8d===_0x5173ed)break;else _0x34cf84['push'](_0x34cf84['shift']());}catch(_0x2ad774){_0x34cf84['push'](_0x34cf84['shift']());}}}(a43_0x133d,0xcd6d6));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x115de6(0x86),'command':'sql','description':a43_0x115de6(0x93),'risk':a43_0x115de6(0x8b),'flags':[SQLCODE_FLAG,{'name':a43_0x115de6(0x94),'type':a43_0x115de6(0x96),'description':a43_0x115de6(0x90),'default':a43_0x115de6(0x91),'enum':[a43_0x115de6(0x91),a43_0x115de6(0x87)]},{'name':a43_0x115de6(0x82),'type':a43_0x115de6(0x85),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x1ae4ba){const _0x1f3083=a43_0x115de6,_0xd01472=await getSqlQueryInfo(_0x1ae4ba[_0x1f3083(0x98)],_0x1ae4ba[_0x1f3083(0x84)](_0x1f3083(0x7f))),_0x5016be=_0x1ae4ba[_0x1f3083(0x84)](_0x1f3083(0x94))||'sdk',_0x559897=generateSqlCodeTemplate(_0xd01472,{'target':_0x5016be,'includeImports':!_0x1ae4ba['bool'](_0x1f3083(0x82))});return{'ok':!![],'data':{'sqlCode':_0xd01472[_0x1f3083(0x97)],'sqlName':_0xd01472[_0x1f3083(0x95)],'target':_0x5016be,'code':_0x559897}};}};function a43_0x4e06(_0x53df8c,_0x1f10b9){_0x53df8c=_0x53df8c-0x7f;const _0x133dd4=a43_0x133d();let _0x4e06c0=_0x133dd4[_0x53df8c];return _0x4e06c0;}function a43_0x133d(){const _0x5b8fe5=['1529tadztR','3DEtqua','12326958PpHQKi','869106BsWSjD','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sdk','33686MgoVIY','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','target','sqlName','string','sqlCode','appCode','sqlcode','3059156uhebvr','73ugFUFd','no-imports','16008zGzlDX','str','boolean','codegen','bff','7650430mbBBmo','3528YSsQfB','31670mqOOTT','read'];a43_0x133d=function(){return _0x5b8fe5;};return a43_0x133d();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x42b073,_0x410d80){const _0xd81389=a44_0x9797,_0xaaccc2=_0x42b073();while(!![]){try{const _0xef0fc9=-parseInt(_0xd81389(0xfb))/0x1*(-parseInt(_0xd81389(0xe2))/0x2)+parseInt(_0xd81389(0xd7))/0x3+-parseInt(_0xd81389(0xf8))/0x4+-parseInt(_0xd81389(0xda))/0x5*(-parseInt(_0xd81389(0xf6))/0x6)+parseInt(_0xd81389(0xed))/0x7+-parseInt(_0xd81389(0xea))/0x8*(-parseInt(_0xd81389(0xe0))/0x9)+-parseInt(_0xd81389(0xd0))/0xa*(parseInt(_0xd81389(0xe6))/0xb);if(_0xef0fc9===_0x410d80)break;else _0xaaccc2['push'](_0xaaccc2['shift']());}catch(_0x2d8633){_0xaaccc2['push'](_0xaaccc2['shift']());}}}(a44_0x16b4,0x57327));function a44_0x9797(_0xc505b8,_0x808fc0){_0xc505b8=_0xc505b8-0xd0;const _0x16b438=a44_0x16b4();let _0x9797c4=_0x16b438[_0xc505b8];return _0x9797c4;}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 _0x5a0080=a44_0x9797;return[{'name':_0x5a0080(0xf3),'type':_0x5a0080(0xe1),'description':_0x5a0080(0xd4),'required':!![]},{'name':_0x5a0080(0xd5),'type':_0x5a0080(0xf9),'description':_0x5a0080(0xdf),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x109375=a44_0x9797;return[{'name':_0x109375(0xd5),'type':_0x109375(0xf9),'description':_0x109375(0xdf),'default':![]}];}function a44_0x16b4(){const _0x1d42d0=['Use\x20global\x20config\x20scope','27MizpbA','string','406942XDWyPU','keys','apps','App\x20\x22','1507tYcMIO','project','\x20config.','defaultApp','316792hpshys','\x20Note:\x20app\x20\x22','bool','4848900RNMxmL','globalConfig','object','\x22\x20(appcode:\x20','flagMissing','\x20Set\x20as\x20default\x20app.','appcode','\x20<name>','Updated','7014YUOjNm','\x22\x20not\x20found.','1174172qxtxSE','boolean','\x20Default\x20app\x20changed\x20to\x20\x22','1nfkkly','Missing\x20app\x20name.','50590PFMtFo','Usage:\x20','\x20app\x20\x22','length','App\x20code','global','args','783045sjwXgK','str','validation','290fRaXdf','Removed\x20app\x20\x22','\x22\x20still\x20defined\x20in\x20','trim','projectConfig'];a44_0x16b4=function(){return _0x1d42d0;};return a44_0x16b4();}export async function validateAppName(_0x103ae0,_0xde3c53){const _0x480ed0=a44_0x9797,_0x3cd483=_0x103ae0[_0x480ed0(0xd6)][0x0]?.[_0x480ed0(0xdd)]();if(!_0x3cd483)throw CliErrors[_0x480ed0(0xd9)](_0x480ed0(0xfc),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0xde3c53+_0x480ed0(0xf4));}export async function runAppAdd(_0x3eddb5,_0x1bd367){const _0x245d01=a44_0x9797,_0x3f8416=_0x3eddb5[_0x245d01(0xd6)][0x0]?.['trim']();if(!_0x3f8416)throw CliErrors[_0x245d01(0xd9)](_0x245d01(0xfc),_0x245d01(0xd1)+CLI_BIN_NAME+'\x20'+_0x1bd367+'\x20<name>\x20--appcode\x20<code>');const _0x51a936=_0x3eddb5['str'](_0x245d01(0xf3));if(!_0x51a936)throw CliErrors[_0x245d01(0xf1)](_0x245d01(0xf3),_0x245d01(0xd1)+CLI_BIN_NAME+'\x20'+_0x1bd367+'\x20<name>\x20--appcode\x20<code>');const _0x504de={'global':_0x3eddb5[_0x245d01(0xec)](_0x245d01(0xd5))},_0x34cc27=readConfig(_0x504de);if(!_0x34cc27[_0x245d01(0xe4)])_0x34cc27[_0x245d01(0xe4)]={};const _0x13786b={'appcode':_0x51a936,...collectAppProfileOverrides(_0x201933=>_0x3eddb5[_0x245d01(0xd8)](_0x201933))},_0x3f540c=_0x34cc27['apps'],_0xdb3181=!!_0x3f540c[_0x3f8416];_0x3f540c[_0x3f8416]=_0x13786b;if(!_0x34cc27[_0x245d01(0xe9)])_0x34cc27[_0x245d01(0xe9)]=_0x3f8416;writeConfig(_0x34cc27,_0x504de);const _0x6f1924=!_0xdb3181&&_0x34cc27[_0x245d01(0xe9)]===_0x3f8416?_0x245d01(0xf2):'',_0xfa6808=(_0xdb3181?_0x245d01(0xf5):'Added')+_0x245d01(0xd2)+_0x3f8416+_0x245d01(0xf0)+_0x51a936+')'+scopeLabel(_0x504de)+'.'+_0x6f1924;return{'ok':!![],'message':_0xfa6808};}export async function runAppRemove(_0x47fbbe,_0xa084a7){const _0x295a4f=a44_0x9797,_0x11cc46=_0x47fbbe[_0x295a4f(0xd6)][0x0]?.[_0x295a4f(0xdd)]();if(!_0x11cc46)throw CliErrors[_0x295a4f(0xd9)]('Missing\x20app\x20name.',_0x295a4f(0xd1)+CLI_BIN_NAME+'\x20'+_0xa084a7+'\x20<name>\x20[--global]');const _0x2264c1=_0x47fbbe[_0x295a4f(0xec)](_0x295a4f(0xd5)),{config:_0x5a82df,layers:_0x4927d6}=readRawConfigWithLayers(),_0x590a66=_0x5a82df[_0x295a4f(0xe4)]??{};if(!_0x590a66[_0x11cc46])throw CliErrors[_0x295a4f(0xd9)](_0x295a4f(0xe5)+_0x11cc46+'\x22\x20not\x20found.');const _0x4fe52f=_0x4927d6[_0x295a4f(0xee)]['apps']&&typeof _0x4927d6[_0x295a4f(0xee)]['apps']===_0x295a4f(0xef)?_0x4927d6[_0x295a4f(0xee)][_0x295a4f(0xe4)]:{},_0x627f36=_0x4927d6[_0x295a4f(0xde)]['apps']&&typeof _0x4927d6[_0x295a4f(0xde)][_0x295a4f(0xe4)]===_0x295a4f(0xef)?_0x4927d6[_0x295a4f(0xde)]['apps']:{},_0x1e270a=appDefinedIn(_0x11cc46,_0x4fe52f,_0x627f36,_0x4927d6[_0x295a4f(0xde)]['inherit']===![]),_0x2d55e4=resolveAppScopeForWrite(_0x11cc46,_0x2264c1,_0x4927d6),_0x107637={'global':_0x2d55e4==='global'},_0x136b0a=readConfig(_0x107637),_0x19a7c1=_0x136b0a[_0x295a4f(0xe4)];if(!_0x19a7c1||!_0x19a7c1[_0x11cc46])throw CliErrors[_0x295a4f(0xd9)](_0x295a4f(0xe5)+_0x11cc46+_0x295a4f(0xf7));delete _0x19a7c1[_0x11cc46];let _0x5064b0='';if(_0x136b0a[_0x295a4f(0xe9)]===_0x11cc46){const _0x810d1a=Object[_0x295a4f(0xe3)](_0x19a7c1);_0x136b0a[_0x295a4f(0xe9)]=_0x810d1a[_0x295a4f(0xd3)]>0x0?_0x810d1a[0x0]:undefined,_0x136b0a['defaultApp']?_0x5064b0=_0x295a4f(0xfa)+_0x136b0a['defaultApp']+'\x22.':delete _0x136b0a[_0x295a4f(0xe9)];}Object[_0x295a4f(0xe3)](_0x19a7c1)['length']===0x0&&(delete _0x136b0a[_0x295a4f(0xe4)],delete _0x136b0a[_0x295a4f(0xe9)]);writeConfig(_0x136b0a,_0x107637);const _0x281f7d=_0x1e270a==='both'?_0x295a4f(0xeb)+_0x11cc46+_0x295a4f(0xdc)+(_0x2d55e4===_0x295a4f(0xe7)?_0x295a4f(0xd5):_0x295a4f(0xe7))+_0x295a4f(0xe8):'';return{'ok':!![],'message':_0x295a4f(0xdb)+_0x11cc46+'\x22'+scopeLabel(_0x107637)+'.'+_0x5064b0+_0x281f7d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbcf6dc,_0x3659c2){const _0x3b308e=a45_0x18ea,_0x1fc706=_0xbcf6dc();while(!![]){try{const _0x1fb83f=parseInt(_0x3b308e(0x80))/0x1*(parseInt(_0x3b308e(0x96))/0x2)+parseInt(_0x3b308e(0x92))/0x3*(-parseInt(_0x3b308e(0x7e))/0x4)+parseInt(_0x3b308e(0x7a))/0x5*(parseInt(_0x3b308e(0x8a))/0x6)+parseInt(_0x3b308e(0x85))/0x7+-parseInt(_0x3b308e(0x74))/0x8+parseInt(_0x3b308e(0x78))/0x9+-parseInt(_0x3b308e(0x91))/0xa;if(_0x1fb83f===_0x3659c2)break;else _0x1fc706['push'](_0x1fc706['shift']());}catch(_0x1be841){_0x1fc706['push'](_0x1fc706['shift']());}}}(a45_0x4773,0xa3dda));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x32dec1 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x55fa2e=a45_0x18ea,_0x509ff6=await input({'message':_0x55fa2e(0x7b),'validate':_0x251376=>{const _0x4f6d44=_0x55fa2e,_0x5c7df9=validateAppcode(_0x251376[_0x4f6d44(0x87)]());return _0x5c7df9[_0x4f6d44(0x7f)]||_0x5c7df9['message']||'Invalid\x20App\x20Code';}});return _0x509ff6[_0x55fa2e(0x87)]();}export async function promptAppSelection(_0x55a365){const _0x114cdd=a45_0x18ea,_0x2d2a17=[{'name':a45_0x32dec1['yellow'](_0x114cdd(0x7d)),'value':-0x1},..._0x55a365['map']((_0x161a56,_0x4e04b9)=>({'name':_0x161a56['appName']+'\x20\x20'+a45_0x32dec1[_0x114cdd(0x90)]('('+_0x161a56[_0x114cdd(0x7c)]+')'),'value':_0x4e04b9}))],_0x140147=await checkbox({'message':_0x114cdd(0x83)+a45_0x32dec1['cyan'](_0x55a365[_0x114cdd(0x8e)])+_0x114cdd(0x81),'choices':_0x2d2a17,'loop':![]});if(_0x140147[_0x114cdd(0x73)](-0x1))return _0x114cdd(0x75);if(_0x140147[_0x114cdd(0x8e)]===0x0)return'custom';return _0x140147['map'](_0x39156d=>_0x55a365[_0x39156d]);}export async function promptSingleAppSelection(_0xcc7b6){const _0x5adf18=a45_0x18ea,_0x14ca82=[{'name':a45_0x32dec1[_0x5adf18(0x90)](_0x5adf18(0x84)),'value':_0x5adf18(0x95)},{'name':a45_0x32dec1[_0x5adf18(0x8d)](_0x5adf18(0x7d)),'value':'custom'},..._0xcc7b6[_0x5adf18(0x86)](_0xc73df4=>({'name':_0xc73df4[_0x5adf18(0x77)]+'\x20\x20'+a45_0x32dec1[_0x5adf18(0x90)]('('+_0xc73df4['appCode']+')'),'value':_0xc73df4[_0x5adf18(0x7c)]}))],_0x1f1205=await select({'message':'请选择要绑定的应用:','choices':_0x14ca82});if(_0x1f1205===_0x5adf18(0x95))return'skip';if(_0x1f1205===_0x5adf18(0x75))return'custom';return _0xcc7b6[_0x5adf18(0x82)](_0x3b6430=>_0x3b6430[_0x5adf18(0x7c)]===_0x1f1205);}function a45_0x18ea(_0x3e84ac,_0x480c8a){_0x3e84ac=_0x3e84ac-0x72;const _0x47736d=a45_0x4773();let _0x18ea22=_0x47736d[_0x3e84ac];return _0x18ea22;}export async function selectSingleAppcode(_0x4eff2b){const _0x42d45f=a45_0x18ea;if(!_0x4eff2b)return writeCliSideChannelLine(a45_0x32dec1[_0x42d45f(0x90)](_0x42d45f(0x8c))),_fallbackOrSkip();writeCliSideChannelLine(_0x42d45f(0x8b));let _0x524277;try{_0x524277=await withActiveCookie(_0x4eff2b,()=>listRemoteApps());}catch(_0x14705b){writeCliSideChannelLine(a45_0x32dec1['yellow'](_0x42d45f(0x72)));if(_0x14705b instanceof Error)writeCliSideChannelLine(a45_0x32dec1[_0x42d45f(0x90)]('\x20\x20('+_0x14705b[_0x42d45f(0x88)]+')'));return _fallbackOrSkip();}if(_0x524277['length']===0x0)return writeCliSideChannelLine(a45_0x32dec1[_0x42d45f(0x8d)](_0x42d45f(0x79))),_fallbackOrSkip();const _0x255ab9=await promptSingleAppSelection(_0x524277);if(_0x255ab9===_0x42d45f(0x95))return'';if(_0x255ab9==='custom')return promptCustomAppcode();return _0x255ab9[_0x42d45f(0x7c)];}export async function selectMultipleApps(_0x33912a){const _0x2d4759=a45_0x18ea;writeCliSideChannelLine('正在获取可用应用列表...');let _0x2454de;try{_0x2454de=await withActiveCookie(_0x33912a,()=>listRemoteApps());}catch(_0x29e13a){writeCliSideChannelLine(_0x2d4759(0x93));if(_0x29e13a instanceof Error)writeCliSideChannelLine(_0x2d4759(0x89)+_0x29e13a['message']+')');return'custom';}if(_0x2454de[_0x2d4759(0x8e)]===0x0)return writeCliSideChannelLine(_0x2d4759(0x8f)),_0x2d4759(0x75);return promptAppSelection(_0x2454de);}async function _fallbackOrSkip(){const _0x99e021=a45_0x18ea,_0x3abcc1=await select({'message':'App\x20Code:','choices':[{'name':a45_0x32dec1[_0x99e021(0x90)](_0x99e021(0x97)),'value':_0x99e021(0x95)},{'name':a45_0x32dec1[_0x99e021(0x8d)](_0x99e021(0x76)),'value':_0x99e021(0x94)}]});if(_0x3abcc1===_0x99e021(0x95))return'';return promptCustomAppcode();}function a45_0x4773(){const _0x5ea4bb=['(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','yellow','length','\x0a未找到可用应用。','gray','26664320MRgrKG','259842aElTUO','\x0a无法获取远程应用列表,请手动输入。','manual','skip','25018TepryR','(跳过,稍后配置)','无法获取远程应用列表,请手动输入。','includes','3867200oxpcdM','custom','✎\x20手动输入','appName','11367612aZopgB','未找到可用应用。','2232515FUGkiB','请输入\x20App\x20Code:','appCode','✎\x20自定义输入\x20appcode','28xKknqf','valid','101cfphdO','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','find','获取到\x20','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','3929366aoUypX','map','trim','message','\x20\x20(','18dlekQQ','正在获取可用应用列表...'];a45_0x4773=function(){return _0x5ea4bb;};return a45_0x4773();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x347276,_0x3b01c7){var _0x31435b=a46_0x523c,_0x4982e4=_0x347276();while(!![]){try{var _0x30932b=parseInt(_0x31435b(0x1a5))/0x1*(parseInt(_0x31435b(0x1a9))/0x2)+parseInt(_0x31435b(0x1a2))/0x3*(parseInt(_0x31435b(0x1a3))/0x4)+parseInt(_0x31435b(0x1aa))/0x5+-parseInt(_0x31435b(0x1a8))/0x6+parseInt(_0x31435b(0x1ab))/0x7*(-parseInt(_0x31435b(0x1a0))/0x8)+parseInt(_0x31435b(0x1a4))/0x9*(-parseInt(_0x31435b(0x1a6))/0xa)+-parseInt(_0x31435b(0x19f))/0xb;if(_0x30932b===_0x3b01c7)break;else _0x4982e4['push'](_0x4982e4['shift']());}catch(_0x1fea3d){_0x4982e4['push'](_0x4982e4['shift']());}}}(a46_0x4675,0x4ea5d));function a46_0x523c(_0x43a059,_0x52805){_0x43a059=_0x43a059-0x19f;var _0x4675a6=a46_0x4675();var _0x523ca0=_0x4675a6[_0x43a059];return _0x523ca0;}function a46_0x4675(){var _0x1aae11=['413208PmdRTj','925278hsgurF','2875260QPjqZV','733992CQNKJb','1762739jLzYIO','40spYDny','description','129nTJGBx','18284QpdaTL','476118wTxAIO','1oUQkjq','30zSiqws','url'];a46_0x4675=function(){return _0x1aae11;};return a46_0x4675();}export function asDryRunResult(_0x36065c,_0x1ff3d2){var _0x474c14=a46_0x523c;return Object['defineProperties'](_0x36065c,{'method':{'value':_0x1ff3d2['method'],'enumerable':![]},'url':{'value':_0x1ff3d2[_0x474c14(0x1a7)],'enumerable':![]},..._0x1ff3d2[_0x474c14(0x1a1)]?{'description':{'value':_0x1ff3d2[_0x474c14(0x1a1)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x3f3202=a47_0x2b65;(function(_0x56b6af,_0x288cbc){const _0x54cd84=a47_0x2b65,_0x3c6d66=_0x56b6af();while(!![]){try{const _0x39e03d=parseInt(_0x54cd84(0x87))/0x1*(-parseInt(_0x54cd84(0x95))/0x2)+parseInt(_0x54cd84(0x98))/0x3*(-parseInt(_0x54cd84(0x8b))/0x4)+-parseInt(_0x54cd84(0x88))/0x5*(-parseInt(_0x54cd84(0x9b))/0x6)+parseInt(_0x54cd84(0x9c))/0x7*(-parseInt(_0x54cd84(0x8f))/0x8)+parseInt(_0x54cd84(0x97))/0x9+parseInt(_0x54cd84(0x93))/0xa+-parseInt(_0x54cd84(0x86))/0xb*(-parseInt(_0x54cd84(0x91))/0xc);if(_0x39e03d===_0x288cbc)break;else _0x3c6d66['push'](_0x3c6d66['shift']());}catch(_0x24ed7e){_0x3c6d66['push'](_0x3c6d66['shift']());}}}(a47_0x37f4,0x22bbd));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'};function a47_0x2b65(_0x42370a,_0x120db8){_0x42370a=_0x42370a-0x85;const _0x37f4f6=a47_0x37f4();let _0x2b65b1=_0x37f4f6[_0x42370a];return _0x2b65b1;}export const CODE_FLAG={'name':a47_0x3f3202(0x8c),'type':a47_0x3f3202(0x8d),'required':!![],'description':a47_0x3f3202(0x9a),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a47_0x3f3202(0x8a),'description':a47_0x3f3202(0x9a)};function a47_0x37f4(){const _0x18e779=['140929DtFBne','664780nbbmTY','number','datasetcode','68PqJwjw','code','string','POSTGRESQL','8ZMTitd','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','5001492ZwIhsC','sqlcode','808090LUANAa','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','4lwqJCd','appcode','953640MMoITJ','39699lCDKmn','Database\x20product\x20type','Dataset\x20code\x20(32-char\x20hex\x20UUID)','6ZOuokg','611996vwYzjJ','MYSQL','11FneRVG'];a47_0x37f4=function(){return _0x18e779;};return a47_0x37f4();}export const SQLCODE_FLAG={'name':a47_0x3f3202(0x92),'type':a47_0x3f3202(0x8d),'required':!![],'description':a47_0x3f3202(0x94),'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':a47_0x3f3202(0x96),'type':a47_0x3f3202(0x8d),'required':![],'description':'App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)'};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a47_0x3f3202(0x89),'required':!![],'description':a47_0x3f3202(0x90)};export const DB_TYPE_FLAG={'name':'dbtype','type':a47_0x3f3202(0x8d),'required':!![],'description':a47_0x3f3202(0x99),'enum':[a47_0x3f3202(0x85),a47_0x3f3202(0x8e)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d9589,_0x2b3a1c){const _0x8a25c2=a48_0x44a3,_0x338421=_0x4d9589();while(!![]){try{const _0x133a0a=-parseInt(_0x8a25c2(0x78))/0x1+-parseInt(_0x8a25c2(0x77))/0x2*(-parseInt(_0x8a25c2(0x7a))/0x3)+-parseInt(_0x8a25c2(0x7b))/0x4*(parseInt(_0x8a25c2(0x81))/0x5)+-parseInt(_0x8a25c2(0x80))/0x6*(-parseInt(_0x8a25c2(0x76))/0x7)+-parseInt(_0x8a25c2(0x7c))/0x8+parseInt(_0x8a25c2(0x7d))/0x9+parseInt(_0x8a25c2(0x79))/0xa;if(_0x133a0a===_0x2b3a1c)break;else _0x338421['push'](_0x338421['shift']());}catch(_0x414905){_0x338421['push'](_0x338421['shift']());}}}(a48_0x3e0f,0x58aee));function a48_0x44a3(_0xa91e5,_0x338cd7){_0xa91e5=_0xa91e5-0x75;const _0x3e0fd5=a48_0x3e0f();let _0x44a3a3=_0x3e0fd5[_0xa91e5];return _0x44a3a3;}function a48_0x3e0f(){const _0x5c318b=['1829082OvAHvK','10lprUOz','test','14bkgXaQ','2fwCeBq','25271ytfKaj','1184810qYJwGj','100590nPZNDk','610448AwdNke','4651664ANEgXO','4621446wPkALB','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','App\x20Code\x20cannot\x20be\x20empty'];a48_0x3e0f=function(){return _0x5c318b;};return a48_0x3e0f();}export function validateAppcode(_0x5505e8){const _0xc99fe3=a48_0x44a3,_0x5ffdc4=_0x5505e8['trim']();if(!_0x5ffdc4)return{'valid':![],'message':_0xc99fe3(0x7f)};if(_0x5ffdc4['length']>0x64)return{'valid':![],'message':'App\x20Code\x20cannot\x20exceed\x20100\x20characters'};if(!/^[A-Za-z0-9_-]+$/[_0xc99fe3(0x75)](_0x5ffdc4))return{'valid':![],'message':_0xc99fe3(0x7e)};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x2bbe08=a49_0x101c;(function(_0x16c10c,_0x5ac495){const _0x14a59e=a49_0x101c,_0x8ce812=_0x16c10c();while(!![]){try{const _0x56b911=parseInt(_0x14a59e(0x190))/0x1+parseInt(_0x14a59e(0x189))/0x2*(parseInt(_0x14a59e(0x187))/0x3)+parseInt(_0x14a59e(0x192))/0x4+-parseInt(_0x14a59e(0x18a))/0x5*(-parseInt(_0x14a59e(0x18e))/0x6)+-parseInt(_0x14a59e(0x194))/0x7*(parseInt(_0x14a59e(0x18c))/0x8)+-parseInt(_0x14a59e(0x197))/0x9+parseInt(_0x14a59e(0x185))/0xa;if(_0x56b911===_0x5ac495)break;else _0x8ce812['push'](_0x8ce812['shift']());}catch(_0xb426b1){_0x8ce812['push'](_0x8ce812['shift']());}}}(a49_0x5bc4,0xbb209));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';function a49_0x101c(_0x550ec8,_0x2d9b10){_0x550ec8=_0x550ec8-0x185;const _0x5bc425=a49_0x5bc4();let _0x101c2c=_0x5bc425[_0x550ec8];return _0x101c2c;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';function a49_0x5bc4(){const _0x5840b7=['appcode','525777MHSnFl','get','786048wRIbBW','read','91uPUWPL','str','Usage:\x20','6488442BHEnuj','\x20config\x20get\x20--key\x20<key>','Key\x20not\x20found:\x20','object','761310Pxeyhy','key','96027zGqvLn','app','76ZQGUqz','1080kXVpLz','Missing\x20key.','806104smkocy','validation','21738JBBMMi'];a49_0x5bc4=function(){return _0x5840b7;};return a49_0x5bc4();}async function execute(_0x57c54b){const _0x247b71=a49_0x101c,_0x5b3b21=_0x57c54b[_0x247b71(0x195)]('key');if(!_0x5b3b21)throw CliErrors['validation'](_0x247b71(0x18b),_0x247b71(0x196)+CLI_BIN_NAME+_0x247b71(0x198));const _0x13e403=readConfig(),_0x4d4b4a=_0x5b3b21===_0x247b71(0x188)?_0x247b71(0x18f):_0x5b3b21,_0x3c1213=_0x13e403[_0x4d4b4a];if(_0x3c1213===undefined)throw CliErrors[_0x247b71(0x18d)](_0x247b71(0x199)+_0x5b3b21);return{'ok':!![],'data':typeof _0x3c1213===_0x247b71(0x19a)?_0x3c1213:{[_0x4d4b4a]:_0x3c1213},'message':typeof _0x3c1213===_0x247b71(0x19a)?undefined:String(_0x3c1213)};}export const configGetDefinition={'service':'config','command':a49_0x2bbe08(0x191),'description':'Get\x20a\x20config\x20value\x20by\x20key','risk':a49_0x2bbe08(0x193),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a49_0x2bbe08(0x186),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a50_0x37c4(_0x257778,_0x168eff){_0x257778=_0x257778-0x139;const _0x5a0b5b=a50_0x5a0b();let _0x37c45a=_0x5a0b5b[_0x257778];return _0x37c45a;}(function(_0x49bbde,_0x387ec1){const _0x220642=a50_0x37c4,_0x5be693=_0x49bbde();while(!![]){try{const _0x8f46d5=-parseInt(_0x220642(0x140))/0x1+-parseInt(_0x220642(0x13c))/0x2*(parseInt(_0x220642(0x141))/0x3)+parseInt(_0x220642(0x13f))/0x4*(-parseInt(_0x220642(0x144))/0x5)+-parseInt(_0x220642(0x13b))/0x6+-parseInt(_0x220642(0x142))/0x7*(-parseInt(_0x220642(0x13d))/0x8)+-parseInt(_0x220642(0x13a))/0x9*(parseInt(_0x220642(0x13e))/0xa)+-parseInt(_0x220642(0x139))/0xb*(-parseInt(_0x220642(0x143))/0xc);if(_0x8f46d5===_0x387ec1)break;else _0x5be693['push'](_0x5be693['shift']());}catch(_0x3307b2){_0x5be693['push'](_0x5be693['shift']());}}}(a50_0x5a0b,0x74eb2));function a50_0x5a0b(){const _0x4b6e45=['304780MkvhvD','954825IJHZKO','3660SGjajk','6384861HXVYSV','2693784CCUacz','55axmPkE','121zwHbQX','240453ZlWITF','1487328aMZTCW','668nzzgRm','8NQblVS','170tEWaGe'];a50_0x5a0b=function(){return _0x4b6e45;};return a50_0x5a0b();}import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x41af81=a51_0x25be;(function(_0x174628,_0x50f682){const _0x11dbda=a51_0x25be,_0xebcee=_0x174628();while(!![]){try{const _0x516fe4=parseInt(_0x11dbda(0x6e))/0x1+parseInt(_0x11dbda(0x76))/0x2*(parseInt(_0x11dbda(0x7b))/0x3)+parseInt(_0x11dbda(0x72))/0x4+-parseInt(_0x11dbda(0x79))/0x5+-parseInt(_0x11dbda(0x7c))/0x6*(parseInt(_0x11dbda(0x7a))/0x7)+-parseInt(_0x11dbda(0x70))/0x8+parseInt(_0x11dbda(0x75))/0x9*(parseInt(_0x11dbda(0x6f))/0xa);if(_0x516fe4===_0x50f682)break;else _0xebcee['push'](_0xebcee['shift']());}catch(_0xcdc52b){_0xebcee['push'](_0xebcee['shift']());}}}(a51_0x4643,0x6506a));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0x3c6078){const _0x20d0c6=a51_0x25be,_0x2e7008=_0x3c6078['bool'](_0x20d0c6(0x78))?readScopedConfig(_0x20d0c6(0x78)):readConfig();return{'ok':!![],'data':_0x2e7008};}export const configListDefinition={'service':a51_0x41af81(0x7d),'command':a51_0x41af81(0x71),'description':'List\x20all\x20config\x20values','risk':a51_0x41af81(0x73),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'global','type':a51_0x41af81(0x74),'description':a51_0x41af81(0x77),'default':![]}],'execute':execute};function a51_0x25be(_0x18a581,_0x2c0050){_0x18a581=_0x18a581-0x6e;const _0x464398=a51_0x4643();let _0x25bec2=_0x464398[_0x18a581];return _0x25bec2;}function a51_0x4643(){const _0x34c66b=['12hnHbpL','14730DHdTJa','config','10613FAtXWT','10VMdMpm','4440232XBPWis','list','183796HUxNaC','read','boolean','9330813RCcmIO','153744vqBPhc','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','global','453655htuKmx','973JAbWAZ'];a51_0x4643=function(){return _0x34c66b;};return a51_0x4643();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x367e10=a52_0x3751;(function(_0x9297c8,_0x50f4b4){const _0x125dde=a52_0x3751,_0x528b5f=_0x9297c8();while(!![]){try{const _0x2f3a1e=-parseInt(_0x125dde(0xd1))/0x1+parseInt(_0x125dde(0xe6))/0x2*(parseInt(_0x125dde(0xc7))/0x3)+-parseInt(_0x125dde(0xc5))/0x4*(parseInt(_0x125dde(0xcf))/0x5)+parseInt(_0x125dde(0xdc))/0x6*(-parseInt(_0x125dde(0xbb))/0x7)+-parseInt(_0x125dde(0xcd))/0x8*(-parseInt(_0x125dde(0xd0))/0x9)+parseInt(_0x125dde(0xd9))/0xa*(-parseInt(_0x125dde(0xc1))/0xb)+-parseInt(_0x125dde(0xc2))/0xc*(-parseInt(_0x125dde(0xe4))/0xd);if(_0x2f3a1e===_0x50f4b4)break;else _0x528b5f['push'](_0x528b5f['shift']());}catch(_0x58048f){_0x528b5f['push'](_0x528b5f['shift']());}}}(a52_0x34fc,0x1aa79));function a52_0x34fc(){const _0x5e3768=['str','\x20set\x20to:\x20','Settable\x20top-level\x20keys:\x20','riskLevel','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','includes','10kyGsaL','Global','string','115494nSBZFq','validation','value','`,\x20`','\x22.\x20Allowed:\x20','global','set','env','481zzUAXy','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','297512RxgYYl','appcode','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','Project','boolean','\x20appcode\x20set\x20to:\x20','length','49PYlSZl','Set\x20a\x20config\x20value','key','Invalid\x20locale\x20value.','Missing\x20value.','app','1210561mNzoYZ','102108xBGyVl','Usage:\x20','apps','4lhhKAt','write','3iAyoEJ','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','locale','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','join','Top-level\x20key\x20\x22','8fGpgwA','\x20app\x20add\x20<name>\x20--appcode\x20','461990KxxZJm','1763199ptAVpK','213131jpKkmp','Missing\x20key.'];a52_0x34fc=function(){return _0x5e3768;};return a52_0x34fc();}import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x55fc9c){const _0x38bf27=a52_0x3751,_0x494278=_0x55fc9c[_0x38bf27(0xd3)](_0x38bf27(0xbd)),_0x4d025e=_0x55fc9c['str'](_0x38bf27(0xde));if(!_0x494278)throw CliErrors[_0x38bf27(0xdd)](_0x38bf27(0xd2),_0x38bf27(0xc3)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x4d025e===undefined||_0x4d025e==='')throw CliErrors[_0x38bf27(0xdd)](_0x38bf27(0xbf),_0x38bf27(0xc3)+CLI_BIN_NAME+_0x38bf27(0xd7));if(_0x4d025e[_0x38bf27(0xba)]>0x1f4)throw CliErrors['validation']('Config\x20value\x20is\x20invalid\x20or\x20too\x20long.');if(!isTopLevelConfigKey(_0x494278))throw CliErrors[_0x38bf27(0xdd)](_0x38bf27(0xcc)+_0x494278+'\x22\x20is\x20not\x20settable.',_0x38bf27(0xd5)+getTopLevelConfigKeySummary());if(_0x494278===_0x38bf27(0xd6))throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(CONFIG_ENUM_VALUES[_0x494278]&&!CONFIG_ENUM_VALUES[_0x494278][_0x38bf27(0xd8)](_0x4d025e))throw CliErrors[_0x38bf27(0xdd)]('Invalid\x20value\x20for\x20\x22'+_0x494278+_0x38bf27(0xe0)+CONFIG_ENUM_VALUES[_0x494278][_0x38bf27(0xcb)](',\x20'));if(_0x494278==='locale'&&!normalizeLocale(_0x4d025e))throw CliErrors[_0x38bf27(0xdd)](_0x38bf27(0xbe),_0x38bf27(0xe5));const _0x430e3c={'global':_0x55fc9c['bool']('global')},_0x1aa9bd=resolveWriteScope(_0x430e3c),_0x507bd4=readScopedConfig(_0x1aa9bd);let _0x3f0a54=_0x494278,_0x562468=_0x4d025e;_0x494278==='app'&&(_0x3f0a54=_0x38bf27(0xb5),delete _0x507bd4[_0x38bf27(0xc0)]);_0x494278===_0x38bf27(0xc9)&&(_0x562468=normalizeLocale(_0x4d025e));if(_0x494278===_0x38bf27(0xe3)){_0x562468=normalizeEnv(_0x4d025e);if(!isProduction(_0x562468)&&!isDaily(_0x562468))throw CliErrors[_0x38bf27(0xdd)]('Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.');}if(_0x494278===_0x38bf27(0xb5)){const _0x3fb65d=_0x507bd4[_0x38bf27(0xc4)]&&typeof _0x507bd4[_0x38bf27(0xc4)]==='object'?Object['keys'](_0x507bd4[_0x38bf27(0xc4)]):[];if(_0x3fb65d['length']>0x0)throw CliErrors[_0x38bf27(0xdd)](_0x38bf27(0xca),'Use\x20`'+CLI_BIN_NAME+_0x38bf27(0xce)+_0x562468+_0x38bf27(0xdf)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x757eb=buildCanonicalProjectConfig({..._0x507bd4},{'appCodes':[_0x562468],'env':typeof _0x507bd4['env']===_0x38bf27(0xdb)?_0x507bd4[_0x38bf27(0xe3)]:undefined});writeScopedConfig(_0x757eb,_0x1aa9bd);const _0x3be7ff=_0x1aa9bd===_0x38bf27(0xe1)?_0x38bf27(0xda):_0x38bf27(0xb7);return{'ok':!![],'message':'✓\x20'+_0x3be7ff+_0x38bf27(0xb9)+_0x562468+_0x38bf27(0xc8)};}_0x507bd4[_0x3f0a54]=_0x562468,writeScopedConfig(_0x507bd4,_0x1aa9bd);const _0x3fdf65=_0x1aa9bd===_0x38bf27(0xe1)?_0x38bf27(0xda):'Project';return{'ok':!![],'message':'✓\x20'+_0x3fdf65+'\x20'+_0x3f0a54+_0x38bf27(0xd4)+_0x562468};}function a52_0x3751(_0x3d275c,_0x4a3fbf){_0x3d275c=_0x3d275c-0xb5;const _0x34fc5d=a52_0x34fc();let _0x3751b4=_0x34fc5d[_0x3d275c];return _0x3751b4;}export const configSetDefinition={'service':'config','command':a52_0x367e10(0xe2),'description':a52_0x367e10(0xbc),'risk':a52_0x367e10(0xc6),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a52_0x367e10(0xbd),'type':a52_0x367e10(0xdb),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a52_0x367e10(0xde),'type':a52_0x367e10(0xdb),'description':'Config\x20value','required':!![]},{'name':a52_0x367e10(0xe1),'type':a52_0x367e10(0xb8),'description':a52_0x367e10(0xb6),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cbeaa,_0x5b80de){var _0x29b934=a53_0x3534,_0x2133cd=_0x1cbeaa();while(!![]){try{var _0x3d10ee=-parseInt(_0x29b934(0x1d6))/0x1*(parseInt(_0x29b934(0x1d2))/0x2)+-parseInt(_0x29b934(0x1d4))/0x3*(parseInt(_0x29b934(0x1df))/0x4)+-parseInt(_0x29b934(0x1da))/0x5+parseInt(_0x29b934(0x1db))/0x6+parseInt(_0x29b934(0x1d1))/0x7*(parseInt(_0x29b934(0x1d7))/0x8)+parseInt(_0x29b934(0x1d9))/0x9*(-parseInt(_0x29b934(0x1dd))/0xa)+parseInt(_0x29b934(0x1d8))/0xb*(parseInt(_0x29b934(0x1d0))/0xc);if(_0x3d10ee===_0x5b80de)break;else _0x2133cd['push'](_0x2133cd['shift']());}catch(_0x538a85){_0x2133cd['push'](_0x2133cd['shift']());}}}(a53_0x15ed,0xf100a));function a53_0x3534(_0x3ae305,_0x5e4fd0){_0x3ae305=_0x3ae305-0x1cf;var _0x15edd9=a53_0x15ed();var _0x353467=_0x15edd9[_0x3ae305];return _0x353467;}function a53_0x15ed(){var _0x48d9b4=['Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','80QTDOqt','project','24624756wXusjv','33677jNvvsY','4qYikzF','\x20init`\x20first.','70497UzJORD','global','83783QiKlHY','952FYDeKr','11HWrBtO','30132mtnZzb','4291955zJkFXq','6021162pLiQLV','validation','3420itqNvr'];a53_0x15ed=function(){return _0x48d9b4;};return a53_0x15ed();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x2222f7){var _0x5496f1=a53_0x3534;if(_0x2222f7[_0x5496f1(0x1d5)])return'global';if(!isInProject())throw CliErrors[_0x5496f1(0x1dc)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x5496f1(0x1de)+CLI_BIN_NAME+_0x5496f1(0x1d3));return _0x5496f1(0x1cf);}export function readScopedConfig(_0x4671b8){return readConfigFile(resolveWriteConfigPath(_0x4671b8));}export function writeScopedConfig(_0x455db2,_0x3bc7ec){writeConfigFile(resolveWriteConfigPath(_0x3bc7ec),_0x455db2);}
|