@lovrabet/rabetbase-cli 2.3.15-beta.2 → 2.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x35367b=a36_0x3bb3;function a36_0x3bb3(_0x426982,_0x2d85fa){_0x426982=_0x426982-0x144;const _0x294f05=a36_0x294f();let _0x3bb315=_0x294f05[_0x426982];return _0x3bb315;}function a36_0x294f(){const _0x4f93b9=['94746wiNejG','/api/management/library/scripts/list?appCode=','scriptContent','Force\x20overwrite\x20local\x20unsynced\x20changes','574354TkMHOG','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','HOOK','Remote\x20script\x20missing\x20content.','Remote\x20script\x20missing\x20id.','functionNode','88624EiwDIg','string','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','50GkqDFF','validation','2799aIGJAR','datasetCode','651716FMqFkr','filePath','toLowerCase','hash','stdin','yes','would_pull','boolean','unresolvable\x20target\x20path','type','functionName','stderr','functions','5190vXbRrK','\x22\x20not\x20found\x20after\x20ensureLockScope.','length','message','local\x20unsynced\x20changes','lockKey','4386907cRxqTX','Lock\x20scope\x20for\x20app\x20\x22','cancelled','ENDPOINT','lastSync','bff','version','includes','lockFilePath','\x20failed','No\x20remote\x20BFF\x20scripts\x20found.','apiDir','\x20remote\x20BFF\x20script(s)\x20for\x20pull','conflict','map','write','pull','8XXRvBI','&type=','all','Force\x20pull\x20cancelled.','\x20pulled,\x20','\x20skipped,\x20','hookLocation','utf8','trim','Pull\x20complete:\x20','str','apps','push','scriptsRoot','question','scriptType','Would\x20inspect\x20','stringify','nonInteractive','appCode','976284HxMmDd','toISOString','alias'];a36_0x294f=function(){return _0x4f93b9;};return a36_0x294f();}(function(_0x179f23,_0x8c784b){const _0x5bc112=a36_0x3bb3,_0x4e2b2e=_0x179f23();while(!![]){try{const _0x223b6d=-parseInt(_0x5bc112(0x18b))/0x1+parseInt(_0x5bc112(0x17e))/0x2+parseInt(_0x5bc112(0x177))/0x3+parseInt(_0x5bc112(0x184))/0x4+-parseInt(_0x5bc112(0x187))/0x5*(parseInt(_0x5bc112(0x17a))/0x6)+-parseInt(_0x5bc112(0x152))/0x7*(-parseInt(_0x5bc112(0x163))/0x8)+parseInt(_0x5bc112(0x189))/0x9*(parseInt(_0x5bc112(0x14c))/0xa);if(_0x223b6d===_0x8c784b)break;else _0x4e2b2e['push'](_0x4e2b2e['shift']());}catch(_0x5d412f){_0x4e2b2e['push'](_0x4e2b2e['shift']());}}}(a36_0x294f,0x95b7d));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_0x35367b(0x157),'command':a36_0x35367b(0x162),'description':a36_0x35367b(0x186),'risk':a36_0x35367b(0x161),'flags':[{'name':a36_0x35367b(0x148),'type':a36_0x35367b(0x185),'description':'Pull\x20only\x20this\x20script\x20type','enum':['COMMON',a36_0x35367b(0x155),a36_0x35367b(0x180)]},{'name':'force','type':a36_0x35367b(0x146),'description':a36_0x35367b(0x17d)}],async 'dryRun'(_0xa62aea){const _0x19d59a=a36_0x35367b,_0x1964c3=loadBffProjectConfig(_0xa62aea[_0x19d59a(0x176)]),_0x468769=await readBffLockFile(_0x1964c3[_0x19d59a(0x15a)]),{appLock:_0x12a4c6}=ensureLockScope(_0x468769??createEmptyBffLock(),_0xa62aea[_0x19d59a(0x176)],_0x1964c3[_0x19d59a(0x170)],_0x19d59a(0x162)),_0x34d89b=normalizeBffType(_0xa62aea[_0x19d59a(0x16d)](_0x19d59a(0x148)))??undefined,_0x56da37=buildDatasetCodeToAliasMap(_0xa62aea[_0x19d59a(0x15d)],_0xa62aea[_0x19d59a(0x176)]),[_0x5427b2,_0x142702]=await Promise[_0x19d59a(0x165)]([listBffScripts(_0xa62aea[_0x19d59a(0x176)],_0x34d89b),getBffScriptStatistics(_0xa62aea[_0x19d59a(0x176)])]),_0x1e33a9=createHookLocationMap(_0x142702),_0x274218=[];for(const _0x3abe66 of _0x5427b2){const _0x29adf1=resolveRemoteScriptTarget(_0x1964c3,_0x3abe66,_0x1e33a9,_0x12a4c6[_0x19d59a(0x14b)],_0x56da37);if(!_0x29adf1){_0x274218[_0x19d59a(0x16f)]({'scriptType':_0x3abe66['scriptType'],'functionName':_0x3abe66[_0x19d59a(0x149)]??'','status':'skipped','reason':_0x19d59a(0x147)});continue;}const _0x48c845=_0x12a4c6[_0x19d59a(0x14b)][_0x29adf1['lockKey']],_0x780864=_0x3abe66[_0x19d59a(0x17c)]!=null?computeContentHash(_0x3abe66[_0x19d59a(0x17c)]):undefined,_0x360828=await hasUnsyncedLocalChanges(_0x29adf1[_0x19d59a(0x18c)],_0x48c845,_0x780864);_0x274218[_0x19d59a(0x16f)]({'lockKey':_0x29adf1[_0x19d59a(0x151)],'filePath':_0x29adf1[_0x19d59a(0x18c)],'remoteId':_0x3abe66['id']??null,'status':_0x360828?_0x19d59a(0x15f):_0x19d59a(0x145)});}return{'method':'GET','url':_0x19d59a(0x17b)+_0xa62aea['appCode']+(_0x34d89b?_0x19d59a(0x164)+_0x34d89b:''),'body':{'appCode':_0xa62aea[_0x19d59a(0x176)],'filterType':_0x34d89b??null,'files':_0x274218},'description':_0x19d59a(0x173)+_0x274218['length']+_0x19d59a(0x15e)};},async 'execute'(_0x5b8886){const _0x103d04=a36_0x35367b,_0x4de4ff=loadBffProjectConfig(_0x5b8886[_0x103d04(0x176)]),_0x1ac24d=await readBffLockFile(_0x4de4ff['lockFilePath']),{lockData:_0x22d0b9,appLock:_0x390568}=ensureLockScope(_0x1ac24d??createEmptyBffLock(),_0x5b8886[_0x103d04(0x176)],_0x4de4ff[_0x103d04(0x170)],_0x103d04(0x162)),_0x13618e=normalizeBffType(_0x5b8886[_0x103d04(0x16d)]('type'))??undefined;if(_0x5b8886[_0x103d04(0x16d)]('type')&&!_0x13618e)throw CliErrors[_0x103d04(0x188)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x227a0d,_0x5dc9d7]=await Promise['all']([listBffScripts(_0x5b8886[_0x103d04(0x176)],_0x13618e),getBffScriptStatistics(_0x5b8886['appCode'])]);if(_0x227a0d[_0x103d04(0x14e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x103d04(0x15c)};const _0x45f34f=_0x5b8886['bool']('force');if(_0x45f34f&&!_0x5b8886['nonInteractive']){const _0x34a990=await confirmForce();if(!_0x34a990)throw CliErrors[_0x103d04(0x154)](_0x103d04(0x166));}if(_0x45f34f&&_0x5b8886[_0x103d04(0x175)]){}const _0x30e5d3=buildDatasetCodeToAliasMap(_0x5b8886[_0x103d04(0x15d)],_0x5b8886['appCode']),_0x5850be=createHookLocationMap(_0x5dc9d7),_0x2fd241=JSON['parse'](JSON[_0x103d04(0x174)](_0x22d0b9)),_0x247ae4=_0x5b8886[_0x103d04(0x176)],_0x551233=_0x2fd241[_0x103d04(0x16e)][_0x247ae4];if(!_0x551233)throw new Error(_0x103d04(0x153)+_0x247ae4+_0x103d04(0x14d));const _0x285df8=[],_0x1b73b9=[],_0x1a2a0a=[];for(const _0x5be375 of _0x227a0d){const _0x3e60c0=resolveRemoteScriptTarget(_0x4de4ff,_0x5be375,_0x5850be,_0x390568[_0x103d04(0x14b)],_0x30e5d3);if(!_0x3e60c0){_0x1b73b9['push']({'lockKey':_0x5be375[_0x103d04(0x172)]+'/'+_0x5be375['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x428fdc=_0x390568[_0x103d04(0x14b)][_0x3e60c0[_0x103d04(0x151)]];try{if(!_0x5be375['id'])throw new Error(_0x103d04(0x182));if(_0x5be375[_0x103d04(0x17c)]==null)throw new Error(_0x103d04(0x181));const _0x47bb13=_0x5be375['scriptContent'],_0x2d9eb=computeContentHash(_0x47bb13);if(!_0x45f34f){const _0x13937e=await hasUnsyncedLocalChanges(_0x3e60c0[_0x103d04(0x18c)],_0x428fdc,_0x2d9eb);if(_0x13937e){_0x1b73b9[_0x103d04(0x16f)]({'lockKey':_0x3e60c0['lockKey'],'reason':_0x103d04(0x150)});continue;}}await ensureParentDirectory(_0x3e60c0[_0x103d04(0x18c)]),await writeFile(_0x3e60c0['filePath'],_0x47bb13,_0x103d04(0x16a));const _0x3a73e4={'hash':_0x2d9eb,'remoteId':_0x5be375['id'],'version':_0x5be375[_0x103d04(0x158)]};_0x3e60c0[_0x103d04(0x148)]===_0x103d04(0x180)&&_0x3e60c0['hookLocation']&&(_0x3a73e4[_0x103d04(0x179)]=_0x3e60c0['hookLocation'][_0x103d04(0x179)],_0x3a73e4[_0x103d04(0x18a)]=_0x3e60c0[_0x103d04(0x169)][_0x103d04(0x18a)],_0x3a73e4['operationType']=_0x3e60c0[_0x103d04(0x169)]['operationType'],_0x3a73e4['functionNode']=_0x3e60c0['hookLocation'][_0x103d04(0x183)]),_0x551233[_0x103d04(0x14b)][_0x3e60c0[_0x103d04(0x151)]]=_0x3a73e4,_0x285df8[_0x103d04(0x16f)]({'lockKey':_0x3e60c0[_0x103d04(0x151)],'remoteId':_0x5be375['id']});}catch(_0x171971){_0x1a2a0a[_0x103d04(0x16f)]({'lockKey':_0x3e60c0[_0x103d04(0x151)],'error':_0x171971 instanceof Error?_0x171971[_0x103d04(0x14f)]:String(_0x171971)});}}return _0x551233[_0x103d04(0x156)]=new Date()[_0x103d04(0x178)](),await writeBffLockFile(_0x4de4ff[_0x103d04(0x15a)],_0x2fd241),{'ok':_0x1a2a0a['length']===0x0,'data':{'pulled':_0x285df8,'skipped':_0x1b73b9,'failed':_0x1a2a0a},'message':_0x103d04(0x16c)+_0x285df8['length']+_0x103d04(0x167)+_0x1b73b9['length']+_0x103d04(0x168)+_0x1a2a0a[_0x103d04(0x14e)]+_0x103d04(0x15b)};}};async function hasUnsyncedLocalChanges(_0x5d81b5,_0x42b744,_0x5020b7){const _0x3f41b7=a36_0x35367b;if(!await fileExists(_0x5d81b5))return![];const _0xb564e6=await computeFileHash(_0x5d81b5);if(!_0x42b744)return _0x5020b7?_0xb564e6!==_0x5020b7:!![];return _0xb564e6!==_0x42b744[_0x3f41b7(0x18e)];}function buildDatasetCodeToAliasMap(_0x211c4b,_0x5126a4){const _0x3e324e=a36_0x35367b,_0x42c455=loadAliasMap(_0x211c4b,undefined,resolveApiFilePath(_0x211c4b,_0x5126a4));return new Map(_0x42c455[_0x3e324e(0x160)](_0x5b09fb=>[_0x5b09fb[_0x3e324e(0x18a)],_0x5b09fb[_0x3e324e(0x179)]]));}async function confirmForce(){const _0x40cc97=a36_0x35367b,_0x1330b2=createInterface({'input':process[_0x40cc97(0x18f)],'output':process[_0x40cc97(0x14a)]}),_0x3b2ebe=await new Promise(_0x56812a=>{const _0x144951=_0x40cc97;_0x1330b2[_0x144951(0x171)](_0x144951(0x17f),_0x56812a);});return _0x1330b2['close'](),['y',_0x40cc97(0x144)][_0x40cc97(0x159)](_0x3b2ebe[_0x40cc97(0x16b)]()[_0x40cc97(0x18d)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0xd2ff64=a37_0xcf02;(function(_0x531542,_0x4086d6){const _0x234a8d=a37_0xcf02,_0x5aa2b3=_0x531542();while(!![]){try{const _0x4dcde2=-parseInt(_0x234a8d(0x14a))/0x1*(-parseInt(_0x234a8d(0x14b))/0x2)+-parseInt(_0x234a8d(0x14e))/0x3+-parseInt(_0x234a8d(0x175))/0x4+-parseInt(_0x234a8d(0x142))/0x5*(parseInt(_0x234a8d(0x13e))/0x6)+parseInt(_0x234a8d(0x162))/0x7+parseInt(_0x234a8d(0x13f))/0x8*(-parseInt(_0x234a8d(0x179))/0x9)+parseInt(_0x234a8d(0x16d))/0xa;if(_0x4dcde2===_0x4086d6)break;else _0x5aa2b3['push'](_0x5aa2b3['shift']());}catch(_0x2f100e){_0x5aa2b3['push'](_0x5aa2b3['shift']());}}}(a37_0x4099,0xdf56a));function a37_0xcf02(_0x459e67,_0x107549){_0x459e67=_0x459e67-0x132;const _0x409999=a37_0x4099();let _0xcf0206=_0x409999[_0x459e67];return _0xcf0206;}import{readFile}from'node:fs/promises';function a37_0x4099(){const _0x377ddf=['Force\x20push\x20ignoring\x20hash\x20protection','6471tPSopS','runtime\x20cache\x20clear\x20failed','name','lockKey','every','lockFilePath','push','description','message','aliasToDatasetCode','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','functionNode','HOOK','would_push','functions','join','Lock\x20scope\x20for\x20app\x20\x22','79938kWzhHr','19744qNknXu','Run\x20`','datasetCode','110wHxcAp',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Push\x20complete:\x20','datasetCodeToDataset','POST','appCode','force','hash','7FzOlYS','164594MkxSbT','status','type','395955TCCSGl','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','high-risk-write','lastSync','filePath','scriptsRoot','\x20uploaded,\x20','operationType','validation','str','\x20skipped,\x20','values','bool','Cannot\x20resolve\x20dataset\x20for\x20\x22','string','toISOString','Push\x20local\x20BFF\x20scripts\x20to\x20remote','has','code','cleared','7199710IqITzU','remoteId','get','datasetId','filter','some','unchanged','map','apiDir','runtime\x20cache\x20not\x20needed','version','24357680IBgjNo','Push\x20only\x20this\x20script\x20type','\x22\x20not\x20found\x20after\x20ensureLockScope.','Local\x20function\x20not\x20found:\x20','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','\x20failed,\x20','alias','set','3704000cIYRSo','apps','length'];a37_0x4099=function(){return _0x377ddf;};return a37_0x4099();}import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0xd2ff64(0x133),'description':a37_0xd2ff64(0x15e),'risk':a37_0xd2ff64(0x150),'flags':[{'name':a37_0xd2ff64(0x14d),'type':a37_0xd2ff64(0x15c),'description':a37_0xd2ff64(0x16e),'enum':['COMMON','ENDPOINT',a37_0xd2ff64(0x139)]},{'name':a37_0xd2ff64(0x17b),'type':'string','description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0xd2ff64(0x148),'type':'boolean','description':a37_0xd2ff64(0x178)}],async 'dryRun'(_0x5a476d){const _0x351a8a=a37_0xd2ff64,_0x79b018=loadBffProjectConfig(_0x5a476d['appCode']),_0xb46fd3=await readBffLockFile(_0x79b018[_0x351a8a(0x132)]),{appLock:_0x2dcb1a}=ensureLockScope(_0xb46fd3??createEmptyBffLock(),_0x5a476d[_0x351a8a(0x147)],_0x79b018[_0x351a8a(0x153)],_0x351a8a(0x133)),_0x3404bc=await getTargetFunctions(_0x79b018,_0x5a476d),_0x3ca6f2=_0x5a476d[_0x351a8a(0x15a)]('force'),_0x37426d=[];for(const _0x3f71b1 of _0x3404bc){const _0x3d126c=await computeFileHash(_0x3f71b1[_0x351a8a(0x152)]),_0xa87cd1=_0x2dcb1a[_0x351a8a(0x13b)][_0x3f71b1['lockKey']],_0x1b6b9a=!!_0xa87cd1&&_0xa87cd1[_0x351a8a(0x149)]===_0x3d126c;_0x37426d[_0x351a8a(0x133)]({'lockKey':_0x3f71b1['lockKey'],'filePath':_0x3f71b1[_0x351a8a(0x152)],'remoteId':_0xa87cd1?.[_0x351a8a(0x163)]??null,'mode':_0xa87cd1?.['remoteId']?'update':'create','status':!_0x3ca6f2&&_0x1b6b9a?_0x351a8a(0x168):'would_push'});}return{'method':_0x351a8a(0x146),'url':'/api/management/library/scripts/save','body':{'appCode':_0x5a476d[_0x351a8a(0x147)],'force':_0x3ca6f2,'files':_0x37426d,'cacheClearAtRuntime':_0x37426d[_0x351a8a(0x167)](_0x4fb951=>_0x4fb951[_0x351a8a(0x14c)]===_0x351a8a(0x13a)),'cacheClearAtRuntimeTimes':_0x37426d[_0x351a8a(0x167)](_0x6db9a3=>_0x6db9a3['status']===_0x351a8a(0x13a))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x37426d[_0x351a8a(0x177)]+_0x351a8a(0x171)};},async 'execute'(_0x541d63){const _0x31e6bc=a37_0xd2ff64,_0x303ce4=loadBffProjectConfig(_0x541d63[_0x31e6bc(0x147)]),_0x5ab605=await readBffLockFile(_0x303ce4[_0x31e6bc(0x132)]),{lockData:_0x492a86,appLock:_0x529381}=ensureLockScope(_0x5ab605??createEmptyBffLock(),_0x541d63[_0x31e6bc(0x147)],_0x303ce4['scriptsRoot'],'push'),_0x3e37fd=await getTargetFunctions(_0x303ce4,_0x541d63);if(_0x3e37fd[_0x31e6bc(0x177)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x15abf3=_0x541d63[_0x31e6bc(0x15a)](_0x31e6bc(0x148)),_0x37af74=JSON['parse'](JSON['stringify'](_0x492a86)),_0x1f3f78=_0x37af74['apps'][_0x541d63[_0x31e6bc(0x147)]];if(!_0x1f3f78)throw new Error(_0x31e6bc(0x13d)+_0x541d63[_0x31e6bc(0x147)]+_0x31e6bc(0x16f));const _0x9bc529=await buildHookMaps(_0x541d63[_0x31e6bc(0x147)],_0x541d63[_0x31e6bc(0x16a)],_0x3e37fd,_0x1f3f78),_0x4ff540=[],_0x13dc2a=[],_0x1d60ba=[];for(const _0x44a857 of _0x3e37fd){const _0x8e1a2c=await computeFileHash(_0x44a857[_0x31e6bc(0x152)]),_0x2eacf2=_0x1f3f78[_0x31e6bc(0x13b)][_0x44a857['lockKey']];if(!_0x15abf3&&_0x2eacf2&&_0x2eacf2[_0x31e6bc(0x149)]===_0x8e1a2c){_0x13dc2a[_0x31e6bc(0x133)]({'lockKey':_0x44a857['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x541d63[_0x31e6bc(0x147)],_0x44a857,_0x1f3f78,_0x9bc529);const _0x23788d=_0x1f3f78['functions'][_0x44a857[_0x31e6bc(0x17c)]];_0x4ff540[_0x31e6bc(0x133)]({'lockKey':_0x44a857[_0x31e6bc(0x17c)],'remoteId':_0x23788d?.[_0x31e6bc(0x163)]??0x0});}catch(_0x37aecc){_0x1d60ba['push']({'lockKey':_0x44a857['lockKey'],'error':_0x37aecc instanceof Error?_0x37aecc['message']:String(_0x37aecc)});}}_0x1f3f78[_0x31e6bc(0x151)]=new Date()[_0x31e6bc(0x15d)](),await writeBffLockFile(_0x303ce4['lockFilePath'],_0x37af74),await waitForUploadedLockEntries(_0x303ce4[_0x31e6bc(0x132)],_0x541d63['appCode'],_0x4ff540[_0x31e6bc(0x169)](_0x378001=>_0x378001[_0x31e6bc(0x17c)]));let _0x4f7614={'attempted':![],'cleared':![]};if(_0x4ff540[_0x31e6bc(0x177)]>0x0)try{let _0x2e36c8='';for(let _0x2568bb=0x0;_0x2568bb<CACHE_CLEAR_ATTEMPTS;_0x2568bb+=0x1){_0x2e36c8=await clearBffScriptCache(),_0x2568bb<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x4f7614={'attempted':!![],'cleared':!![],'message':_0x2e36c8||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x3c1b0f){_0x4f7614={'attempted':!![],'cleared':![],'error':_0x3c1b0f instanceof Error?_0x3c1b0f[_0x31e6bc(0x135)]:String(_0x3c1b0f)};}const _0x3288a7=_0x1d60ba[_0x31e6bc(0x177)]===0x0&&(_0x4f7614['attempted']?_0x4f7614[_0x31e6bc(0x161)]:!![]),_0x3e92a9=_0x4f7614['attempted']?_0x4f7614[_0x31e6bc(0x161)]?'runtime\x20cache\x20cleared':_0x31e6bc(0x17a):_0x31e6bc(0x16b);return{'ok':_0x3288a7,'data':{'uploaded':_0x4ff540,'skipped':_0x13dc2a,'failed':_0x1d60ba,'cacheClear':_0x4f7614},'message':_0x31e6bc(0x144)+_0x4ff540['length']+_0x31e6bc(0x154)+_0x13dc2a[_0x31e6bc(0x177)]+_0x31e6bc(0x158)+_0x1d60ba['length']+_0x31e6bc(0x172)+_0x3e92a9};}};async function getTargetFunctions(_0x531fa9,_0x421e8e){const _0x3f9f1c=a37_0xd2ff64,_0x4669fb=_0x421e8e[_0x3f9f1c(0x157)]('type'),_0x45eda1=_0x421e8e['str']('name'),_0x1613e1=normalizeBffType(_0x4669fb)??undefined;if(_0x45eda1&&!_0x1613e1)throw CliErrors[_0x3f9f1c(0x156)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x245795=await scanLocalBffFunctions(_0x531fa9,_0x1613e1);if(_0x45eda1){const _0x570051=_0x245795[_0x3f9f1c(0x166)](_0x50660b=>_0x50660b[_0x3f9f1c(0x17b)]===_0x45eda1);if(_0x570051['length']===0x0)throw CliErrors['validation'](_0x3f9f1c(0x170)+_0x1613e1+'/'+_0x45eda1);return _0x570051;}return _0x245795;}async function buildHookMaps(_0x565168,_0x2adae3,_0x2e75ee,_0x887fdc){const _0x405509=a37_0xd2ff64,_0x2efcba=_0x2e75ee[_0x405509(0x167)](_0x1f6d1d=>_0x1f6d1d[_0x405509(0x14d)]==='HOOK');if(!_0x2efcba)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2dc6f3=loadAliasMap(_0x2adae3,undefined,resolveApiFilePath(_0x2adae3,_0x565168)),_0x42e3ce=new Map(_0x2dc6f3[_0x405509(0x169)](_0x409f35=>[_0x409f35[_0x405509(0x173)],_0x409f35[_0x405509(0x141)]]));for(const _0x20ed77 of Object[_0x405509(0x159)](_0x887fdc[_0x405509(0x13b)])){_0x20ed77[_0x405509(0x173)]&&_0x20ed77[_0x405509(0x141)]&&!_0x42e3ce[_0x405509(0x15f)](_0x20ed77['alias'])&&_0x42e3ce[_0x405509(0x174)](_0x20ed77[_0x405509(0x173)],_0x20ed77['datasetCode']);}const _0x5047d6=await listDatasets(_0x565168),_0x289154=new Map(_0x5047d6[_0x405509(0x169)](_0x247c41=>[_0x247c41[_0x405509(0x160)],_0x247c41]));return{'aliasToDatasetCode':_0x42e3ce,'datasetCodeToDataset':_0x289154};}async function uploadSingleFunction(_0x2ad5aa,_0x5553c1,_0x431c6a,_0x122bbf){const _0x17d61f=a37_0xd2ff64,_0xb401fa=await readFile(_0x5553c1[_0x17d61f(0x152)],'utf8'),_0x4e8f17=await computeFileHash(_0x5553c1[_0x17d61f(0x152)]),_0x34aeb6=_0x431c6a[_0x17d61f(0x13b)][_0x5553c1[_0x17d61f(0x17c)]];if(_0x34aeb6?.[_0x17d61f(0x163)]&&_0x34aeb6['version']==null)throw CliErrors[_0x17d61f(0x156)](_0x5553c1[_0x17d61f(0x17c)]+_0x17d61f(0x143));let _0x226aad=extractScriptDescription(_0xb401fa);if(!_0x226aad&&_0x34aeb6?.[_0x17d61f(0x163)]){const _0x979b70=await getBffScriptInfo(_0x34aeb6['remoteId']);_0x226aad=_0x979b70[_0x17d61f(0x134)]||undefined;}const _0x4d1e15={'appCode':_0x2ad5aa,'functionName':_0x5553c1[_0x17d61f(0x17b)],'scriptType':_0x5553c1[_0x17d61f(0x14d)],'scriptContent':_0xb401fa};if(_0x34aeb6?.[_0x17d61f(0x163)])_0x4d1e15['id']=_0x34aeb6[_0x17d61f(0x163)];if(_0x34aeb6?.[_0x17d61f(0x16c)]!=null)_0x4d1e15['version']=_0x34aeb6[_0x17d61f(0x16c)];if(_0x226aad)_0x4d1e15[_0x17d61f(0x134)]=_0x226aad;if(_0x5553c1['type']==='HOOK'){const _0x394409=_0x5553c1['alias'];if(!_0x394409||!_0x5553c1[_0x17d61f(0x155)]||!_0x5553c1['functionNode'])throw CliErrors[_0x17d61f(0x156)]('Incomplete\x20HOOK\x20path:\x20'+_0x5553c1[_0x17d61f(0x17c)]);const _0x11f153=_0x122bbf[_0x17d61f(0x136)][_0x17d61f(0x164)](_0x394409)??_0x34aeb6?.[_0x17d61f(0x141)]??_0x394409,_0x3d4042=_0x122bbf[_0x17d61f(0x145)][_0x17d61f(0x164)](_0x11f153);if(!_0x3d4042)throw CliErrors[_0x17d61f(0x156)](_0x17d61f(0x15b)+_0x394409+'\x22.\x20'+(_0x17d61f(0x140)+CLI_BIN_NAME+_0x17d61f(0x14f)));_0x4d1e15[_0x17d61f(0x165)]=_0x3d4042['id'],_0x4d1e15[_0x17d61f(0x155)]=_0x5553c1[_0x17d61f(0x155)],_0x4d1e15[_0x17d61f(0x138)]=_0x5553c1[_0x17d61f(0x138)];}const _0x1236d1=await saveBffScript(_0x4d1e15),_0x4f480e=_0x1236d1['id'],_0x119030=_0x1236d1['script']??await getBffScriptInfo(_0x4f480e),_0x317fc5={'hash':_0x4e8f17,'remoteId':_0x4f480e,'version':_0x119030[_0x17d61f(0x16c)]};if(_0x5553c1[_0x17d61f(0x14d)]===_0x17d61f(0x139)){const _0x969c99=_0x5553c1[_0x17d61f(0x173)],_0x16feca=_0x122bbf[_0x17d61f(0x136)]['get'](_0x969c99)??_0x34aeb6?.[_0x17d61f(0x141)]??_0x969c99;_0x122bbf[_0x17d61f(0x136)][_0x17d61f(0x15f)](_0x969c99)?_0x317fc5[_0x17d61f(0x173)]=_0x969c99:_0x317fc5[_0x17d61f(0x173)]=_0x34aeb6?.[_0x17d61f(0x173)],_0x317fc5['datasetCode']=_0x16feca,_0x317fc5[_0x17d61f(0x155)]=_0x5553c1[_0x17d61f(0x155)],_0x317fc5[_0x17d61f(0x138)]=_0x5553c1[_0x17d61f(0x138)];}_0x431c6a[_0x17d61f(0x13b)][_0x5553c1[_0x17d61f(0x17c)]]=_0x317fc5;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x296ac7,_0x1f2857,_0x385263){const _0xe848ae=a37_0xd2ff64;if(_0x385263['length']===0x0)return;for(let _0x51022a=0x0;_0x51022a<LOCK_SETTLE_RETRY_COUNT;_0x51022a+=0x1){const _0x23b093=await readBffLockFile(_0x296ac7),_0x5afb2d=_0x23b093?.[_0xe848ae(0x176)]?.[_0x1f2857]?.['functions']??{},_0x4d6140=_0x385263[_0xe848ae(0x17d)](_0x1b26f3=>!!_0x5afb2d[_0x1b26f3]?.['remoteId']);if(_0x4d6140)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0xe848ae(0x137)+_0x385263[_0xe848ae(0x13c)](',\x20')+'.');}
|
|
1
|
+
const a37_0x30a808=a37_0x1910;(function(_0x4d7373,_0x3ae97d){const _0x88ac83=a37_0x1910,_0x5cd0a2=_0x4d7373();while(!![]){try{const _0x4faa08=-parseInt(_0x88ac83(0x1e0))/0x1+parseInt(_0x88ac83(0x218))/0x2+parseInt(_0x88ac83(0x1f3))/0x3*(-parseInt(_0x88ac83(0x1fe))/0x4)+parseInt(_0x88ac83(0x21e))/0x5*(-parseInt(_0x88ac83(0x1fa))/0x6)+parseInt(_0x88ac83(0x21a))/0x7+-parseInt(_0x88ac83(0x1f9))/0x8+parseInt(_0x88ac83(0x1e3))/0x9;if(_0x4faa08===_0x3ae97d)break;else _0x5cd0a2['push'](_0x5cd0a2['shift']());}catch(_0x667363){_0x5cd0a2['push'](_0x5cd0a2['shift']());}}}(a37_0x4da4,0x5bd6a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x1910(_0x394e6e,_0x31d8bc){_0x394e6e=_0x394e6e-0x1d9;const _0x4da490=a37_0x4da4();let _0x191061=_0x4da490[_0x394e6e];return _0x191061;}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_0x4da4(){const _0x41e01c=['str','4079488UemKcm','operationType','Lock\x20scope\x20for\x20app\x20\x22','boolean','1379515Zkryjx','/api/management/library/scripts/save','\x20uploaded,\x20','message','name','Local\x20function\x20not\x20found:\x20','\x20failed,\x20','appCode','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','would_push','validation','bool','unchanged','remoteId','211270BYHeHE','ENDPOINT','map','3993642SguFKM','Incomplete\x20HOOK\x20path:\x20','values','alias','lastSync','script','apps','No\x20local\x20BFF\x20functions\x20found.','scriptsRoot','status','code','update','toISOString','datasetCode','get','HOOK','47694aFtlbB','Cannot\x20resolve\x20dataset\x20for\x20\x22','has','push','lockFilePath','string','3021528DrYfny','6lMWTkQ','version','\x22.\x20','cleared','64tJsDSK','aliasToDatasetCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','functionNode','Push\x20only\x20this\x20script\x20type','apiDir','filePath','functions','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','set','attempted','lockKey','description','runtime\x20cache\x20not\x20needed','\x20skipped,\x20','Force\x20push\x20ignoring\x20hash\x20protection','Would\x20inspect\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','force','Push\x20local\x20BFF\x20scripts\x20to\x20remote','length','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','type','POST','some','937760gAxJJc'];a37_0x4da4=function(){return _0x41e01c;};return a37_0x4da4();}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':'bff','command':a37_0x30a808(0x1f6),'description':a37_0x30a808(0x212),'risk':'high-risk-write','flags':[{'name':a37_0x30a808(0x215),'type':a37_0x30a808(0x1f8),'description':a37_0x30a808(0x202),'enum':['COMMON',a37_0x30a808(0x1e1),a37_0x30a808(0x1f2)]},{'name':a37_0x30a808(0x222),'type':a37_0x30a808(0x1f8),'description':a37_0x30a808(0x1da)},{'name':a37_0x30a808(0x211),'type':a37_0x30a808(0x21d),'description':a37_0x30a808(0x20d)}],async 'dryRun'(_0x366fee){const _0xd834c2=a37_0x30a808,_0x20f556=loadBffProjectConfig(_0x366fee[_0xd834c2(0x1d9)]),_0x4cd1a0=await readBffLockFile(_0x20f556[_0xd834c2(0x1f7)]),{appLock:_0x43c430}=ensureLockScope(_0x4cd1a0??createEmptyBffLock(),_0x366fee[_0xd834c2(0x1d9)],_0x20f556[_0xd834c2(0x1eb)],'push'),_0x3950c2=await getTargetFunctions(_0x20f556,_0x366fee),_0x4b61d1=_0x366fee[_0xd834c2(0x1dd)](_0xd834c2(0x211)),_0x447895=[];for(const _0x2b31eb of _0x3950c2){const _0x5305e6=await computeFileHash(_0x2b31eb[_0xd834c2(0x204)]),_0x57c841=_0x43c430['functions'][_0x2b31eb[_0xd834c2(0x209)]],_0x489cd7=!!_0x57c841&&_0x57c841['hash']===_0x5305e6;_0x447895['push']({'lockKey':_0x2b31eb['lockKey'],'filePath':_0x2b31eb['filePath'],'remoteId':_0x57c841?.[_0xd834c2(0x1df)]??null,'mode':_0x57c841?.[_0xd834c2(0x1df)]?_0xd834c2(0x1ee):'create','status':!_0x4b61d1&&_0x489cd7?'unchanged':_0xd834c2(0x1db)});}return{'method':_0xd834c2(0x216),'url':_0xd834c2(0x21f),'body':{'appCode':_0x366fee['appCode'],'force':_0x4b61d1,'files':_0x447895,'cacheClearAtRuntime':_0x447895['some'](_0xf3ff0f=>_0xf3ff0f[_0xd834c2(0x1ec)]==='would_push'),'cacheClearAtRuntimeTimes':_0x447895[_0xd834c2(0x217)](_0x2dbe2f=>_0x2dbe2f['status']===_0xd834c2(0x1db))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0xd834c2(0x20e)+_0x447895[_0xd834c2(0x213)]+_0xd834c2(0x214)};},async 'execute'(_0x183aa4){const _0xe94b7b=a37_0x30a808,_0x357228=loadBffProjectConfig(_0x183aa4[_0xe94b7b(0x1d9)]),_0x2f9094=await readBffLockFile(_0x357228['lockFilePath']),{lockData:_0x326a5e,appLock:_0x5cfd07}=ensureLockScope(_0x2f9094??createEmptyBffLock(),_0x183aa4[_0xe94b7b(0x1d9)],_0x357228[_0xe94b7b(0x1eb)],_0xe94b7b(0x1f6)),_0x5c90e1=await getTargetFunctions(_0x357228,_0x183aa4);if(_0x5c90e1[_0xe94b7b(0x213)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xe94b7b(0x1ea)};const _0x482257=_0x183aa4[_0xe94b7b(0x1dd)](_0xe94b7b(0x211)),_0x540a87=JSON['parse'](JSON['stringify'](_0x326a5e)),_0x54fe06=_0x540a87[_0xe94b7b(0x1e9)][_0x183aa4[_0xe94b7b(0x1d9)]];if(!_0x54fe06)throw new Error(_0xe94b7b(0x21c)+_0x183aa4['appCode']+_0xe94b7b(0x200));const _0x4e74fe=await buildHookMaps(_0x183aa4[_0xe94b7b(0x1d9)],_0x183aa4[_0xe94b7b(0x203)],_0x5c90e1,_0x54fe06),_0x3344fc=[],_0x2437e5=[],_0x46b355=[];for(const _0x593676 of _0x5c90e1){const _0x9742e6=await computeFileHash(_0x593676['filePath']),_0x1c942c=_0x54fe06[_0xe94b7b(0x205)][_0x593676[_0xe94b7b(0x209)]];if(!_0x482257&&_0x1c942c&&_0x1c942c['hash']===_0x9742e6){_0x2437e5[_0xe94b7b(0x1f6)]({'lockKey':_0x593676[_0xe94b7b(0x209)],'reason':_0xe94b7b(0x1de)});continue;}try{await uploadSingleFunction(_0x183aa4[_0xe94b7b(0x1d9)],_0x593676,_0x54fe06,_0x4e74fe);const _0x1ad068=_0x54fe06['functions'][_0x593676[_0xe94b7b(0x209)]];_0x3344fc[_0xe94b7b(0x1f6)]({'lockKey':_0x593676[_0xe94b7b(0x209)],'remoteId':_0x1ad068?.[_0xe94b7b(0x1df)]??0x0});}catch(_0x13b0e2){_0x46b355['push']({'lockKey':_0x593676[_0xe94b7b(0x209)],'error':_0x13b0e2 instanceof Error?_0x13b0e2[_0xe94b7b(0x221)]:String(_0x13b0e2)});}}_0x54fe06[_0xe94b7b(0x1e7)]=new Date()[_0xe94b7b(0x1ef)](),await writeBffLockFile(_0x357228[_0xe94b7b(0x1f7)],_0x540a87),await waitForUploadedLockEntries(_0x357228[_0xe94b7b(0x1f7)],_0x183aa4['appCode'],_0x3344fc[_0xe94b7b(0x1e2)](_0x57053d=>_0x57053d['lockKey']));let _0x242bef={'attempted':![],'cleared':![]};if(_0x3344fc['length']>0x0)try{let _0x2a10f5='';for(let _0x51fe93=0x0;_0x51fe93<CACHE_CLEAR_ATTEMPTS;_0x51fe93+=0x1){_0x2a10f5=await clearBffScriptCache(),_0x51fe93<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x242bef={'attempted':!![],'cleared':!![],'message':_0x2a10f5||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x3eb874){_0x242bef={'attempted':!![],'cleared':![],'error':_0x3eb874 instanceof Error?_0x3eb874[_0xe94b7b(0x221)]:String(_0x3eb874)};}const _0x262506=_0x46b355[_0xe94b7b(0x213)]===0x0&&(_0x242bef[_0xe94b7b(0x208)]?_0x242bef[_0xe94b7b(0x1fd)]:!![]),_0x3a2830=_0x242bef[_0xe94b7b(0x208)]?_0x242bef[_0xe94b7b(0x1fd)]?'runtime\x20cache\x20cleared':'runtime\x20cache\x20clear\x20failed':_0xe94b7b(0x20b);return{'ok':_0x262506,'data':{'uploaded':_0x3344fc,'skipped':_0x2437e5,'failed':_0x46b355,'cacheClear':_0x242bef},'message':'Push\x20complete:\x20'+_0x3344fc[_0xe94b7b(0x213)]+_0xe94b7b(0x220)+_0x2437e5[_0xe94b7b(0x213)]+_0xe94b7b(0x20c)+_0x46b355[_0xe94b7b(0x213)]+_0xe94b7b(0x224)+_0x3a2830};}};async function getTargetFunctions(_0x53ff3b,_0x37db0c){const _0x3f7d9a=a37_0x30a808,_0x3ab795=_0x37db0c[_0x3f7d9a(0x219)](_0x3f7d9a(0x215)),_0x37953f=_0x37db0c['str']('name'),_0x3e1d69=normalizeBffType(_0x3ab795)??undefined;if(_0x37953f&&!_0x3e1d69)throw CliErrors[_0x3f7d9a(0x1dc)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x5cd795=await scanLocalBffFunctions(_0x53ff3b,_0x3e1d69);if(_0x37953f){const _0x5d6d5e=_0x5cd795['filter'](_0x512e00=>_0x512e00[_0x3f7d9a(0x222)]===_0x37953f);if(_0x5d6d5e[_0x3f7d9a(0x213)]===0x0)throw CliErrors['validation'](_0x3f7d9a(0x223)+_0x3e1d69+'/'+_0x37953f);return _0x5d6d5e;}return _0x5cd795;}async function buildHookMaps(_0x5a4773,_0x20d46b,_0x134e50,_0x32b845){const _0x4c26c7=a37_0x30a808,_0x215b81=_0x134e50[_0x4c26c7(0x217)](_0x34b20b=>_0x34b20b['type']===_0x4c26c7(0x1f2));if(!_0x215b81)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x3aaee6=loadAliasMap(_0x20d46b,undefined,resolveApiFilePath(_0x20d46b,_0x5a4773)),_0x372cc1=new Map(_0x3aaee6['map'](_0x230ff6=>[_0x230ff6['alias'],_0x230ff6['datasetCode']]));for(const _0x283f17 of Object[_0x4c26c7(0x1e5)](_0x32b845[_0x4c26c7(0x205)])){_0x283f17['alias']&&_0x283f17[_0x4c26c7(0x1f0)]&&!_0x372cc1[_0x4c26c7(0x1f5)](_0x283f17[_0x4c26c7(0x1e6)])&&_0x372cc1[_0x4c26c7(0x207)](_0x283f17['alias'],_0x283f17[_0x4c26c7(0x1f0)]);}const _0x451cc6=await listDatasets(_0x5a4773),_0x2bda12=new Map(_0x451cc6[_0x4c26c7(0x1e2)](_0x793e6=>[_0x793e6[_0x4c26c7(0x1ed)],_0x793e6]));return{'aliasToDatasetCode':_0x372cc1,'datasetCodeToDataset':_0x2bda12};}async function uploadSingleFunction(_0x38f297,_0x4dbf33,_0x54e29d,_0x2e38b9){const _0x11d9bc=a37_0x30a808,_0x47053c=await readFile(_0x4dbf33[_0x11d9bc(0x204)],'utf8'),_0xceace8=await computeFileHash(_0x4dbf33[_0x11d9bc(0x204)]),_0x3cb534=_0x54e29d[_0x11d9bc(0x205)][_0x4dbf33[_0x11d9bc(0x209)]];if(_0x3cb534?.['remoteId']&&_0x3cb534[_0x11d9bc(0x1fb)]==null)throw CliErrors['validation'](_0x4dbf33[_0x11d9bc(0x209)]+_0x11d9bc(0x20f));let _0x3130e6=extractScriptDescription(_0x47053c);if(!_0x3130e6&&_0x3cb534?.['remoteId']){const _0x498a47=await getBffScriptInfo(_0x3cb534['remoteId']);_0x3130e6=_0x498a47[_0x11d9bc(0x20a)]||undefined;}const _0x154838={'appCode':_0x38f297,'functionName':_0x4dbf33[_0x11d9bc(0x222)],'scriptType':_0x4dbf33[_0x11d9bc(0x215)],'scriptContent':_0x47053c};if(_0x3cb534?.[_0x11d9bc(0x1df)])_0x154838['id']=_0x3cb534[_0x11d9bc(0x1df)];if(_0x3cb534?.['version']!=null)_0x154838[_0x11d9bc(0x1fb)]=_0x3cb534[_0x11d9bc(0x1fb)];if(_0x3130e6)_0x154838[_0x11d9bc(0x20a)]=_0x3130e6;if(_0x4dbf33['type']===_0x11d9bc(0x1f2)){const _0x299dbd=_0x4dbf33[_0x11d9bc(0x1e6)];if(!_0x299dbd||!_0x4dbf33['operationType']||!_0x4dbf33[_0x11d9bc(0x201)])throw CliErrors[_0x11d9bc(0x1dc)](_0x11d9bc(0x1e4)+_0x4dbf33['lockKey']);const _0x514fb0=_0x2e38b9[_0x11d9bc(0x1ff)][_0x11d9bc(0x1f1)](_0x299dbd)??_0x3cb534?.[_0x11d9bc(0x1f0)]??_0x299dbd,_0x7604d4=_0x2e38b9['datasetCodeToDataset'][_0x11d9bc(0x1f1)](_0x514fb0);if(!_0x7604d4)throw CliErrors[_0x11d9bc(0x1dc)](_0x11d9bc(0x1f4)+_0x299dbd+_0x11d9bc(0x1fc)+('Run\x20`'+CLI_BIN_NAME+_0x11d9bc(0x206)));_0x154838['datasetId']=_0x7604d4['id'],_0x154838[_0x11d9bc(0x21b)]=_0x4dbf33['operationType'],_0x154838[_0x11d9bc(0x201)]=_0x4dbf33[_0x11d9bc(0x201)];}const _0x243052=await saveBffScript(_0x154838),_0x349918=_0x243052['id'],_0x381131=_0x243052[_0x11d9bc(0x1e8)]??await getBffScriptInfo(_0x349918),_0x369ba3={'hash':_0xceace8,'remoteId':_0x349918,'version':_0x381131[_0x11d9bc(0x1fb)]};if(_0x4dbf33[_0x11d9bc(0x215)]===_0x11d9bc(0x1f2)){const _0x446209=_0x4dbf33[_0x11d9bc(0x1e6)],_0x5cbd54=_0x2e38b9[_0x11d9bc(0x1ff)][_0x11d9bc(0x1f1)](_0x446209)??_0x3cb534?.[_0x11d9bc(0x1f0)]??_0x446209;_0x2e38b9['aliasToDatasetCode']['has'](_0x446209)?_0x369ba3['alias']=_0x446209:_0x369ba3[_0x11d9bc(0x1e6)]=_0x3cb534?.[_0x11d9bc(0x1e6)],_0x369ba3[_0x11d9bc(0x1f0)]=_0x5cbd54,_0x369ba3[_0x11d9bc(0x21b)]=_0x4dbf33[_0x11d9bc(0x21b)],_0x369ba3[_0x11d9bc(0x201)]=_0x4dbf33[_0x11d9bc(0x201)];}_0x54e29d[_0x11d9bc(0x205)][_0x4dbf33[_0x11d9bc(0x209)]]=_0x369ba3;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1299ed,_0x30d30b,_0xae867d){const _0x1c1038=a37_0x30a808;if(_0xae867d[_0x1c1038(0x213)]===0x0)return;for(let _0x4865d1=0x0;_0x4865d1<LOCK_SETTLE_RETRY_COUNT;_0x4865d1+=0x1){const _0x2bb155=await readBffLockFile(_0x1299ed),_0x40873c=_0x2bb155?.[_0x1c1038(0x1e9)]?.[_0x30d30b]?.[_0x1c1038(0x205)]??{},_0x14d6e0=_0xae867d['every'](_0xa59a24=>!!_0x40873c[_0xa59a24]?.[_0x1c1038(0x1df)]);if(_0x14d6e0)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x1c1038(0x210)+_0xae867d['join'](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a38_0x526c5b=a38_0x5e9a;function a38_0xa336(){const _0x15d8bc=['boolean','lockKey','appCode','push','\x20added,\x20','remote','apiDir','119gAgIHn','hash','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','\x20modified,\x20','All\x20BFF\x20scripts\x20are\x20in\x20sync.','map','bff','4kPTnKK','all','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','11505zuIEpe','80hulZYZ','has','lockFilePath','datasetCode','bool','\x20unchanged','764285CYFSmY','554481YhXbyb','read','1437880mDvjdm','scriptsRoot','status','length','143057ckVrqz','65944WBOomk','functions','757218VvgiBg'];a38_0xa336=function(){return _0x15d8bc;};return a38_0xa336();}(function(_0x342176,_0x1b52a4){const _0x6225f=a38_0x5e9a,_0x3fe876=_0x342176();while(!![]){try{const _0x5642b1=parseInt(_0x6225f(0x189))/0x1+-parseInt(_0x6225f(0x17c))/0x2*(-parseInt(_0x6225f(0x17b))/0x3)+-parseInt(_0x6225f(0x178))/0x4*(-parseInt(_0x6225f(0x182))/0x5)+-parseInt(_0x6225f(0x18c))/0x6+parseInt(_0x6225f(0x171))/0x7*(-parseInt(_0x6225f(0x18a))/0x8)+parseInt(_0x6225f(0x183))/0x9+-parseInt(_0x6225f(0x185))/0xa;if(_0x5642b1===_0x1b52a4)break;else _0x3fe876['push'](_0x3fe876['shift']());}catch(_0x163ef7){_0x3fe876['push'](_0x3fe876['shift']());}}}(a38_0xa336,0x189c1));function a38_0x5e9a(_0x12d3da,_0x1a451e){_0x12d3da=_0x12d3da-0x16d;const _0xa33652=a38_0xa336();let _0x5e9ab0=_0xa33652[_0x12d3da];return _0x5e9ab0;}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_0x526c5b(0x177),'command':a38_0x526c5b(0x187),'description':a38_0x526c5b(0x173),'risk':a38_0x526c5b(0x184),'flags':[{'name':a38_0x526c5b(0x16f),'type':a38_0x526c5b(0x18d),'description':a38_0x526c5b(0x17a)}],async 'execute'(_0x166d89){const _0x42d7ff=a38_0x526c5b,_0x3337a6=loadBffProjectConfig(_0x166d89[_0x42d7ff(0x18f)]),_0x65f1e4=await readBffLockFile(_0x3337a6[_0x42d7ff(0x17e)]),{appLock:_0x14c75a}=ensureLockScope(_0x65f1e4??createEmptyBffLock(),_0x166d89[_0x42d7ff(0x18f)],_0x3337a6[_0x42d7ff(0x186)],_0x42d7ff(0x187)),_0x31e7cc=await scanLocalBffFunctions(_0x3337a6),_0x2a42df=[],_0x402ee7=[],_0x37b2e2=[];for(const _0x470269 of _0x31e7cc){const _0x17a104=await computeFileHash(_0x470269['filePath']),_0x2b56c1=_0x14c75a[_0x42d7ff(0x18b)][_0x470269['lockKey']];if(!_0x2b56c1)_0x2a42df[_0x42d7ff(0x16d)](_0x470269[_0x42d7ff(0x18e)]);else _0x2b56c1[_0x42d7ff(0x172)]!==_0x17a104?_0x402ee7[_0x42d7ff(0x16d)](_0x470269['lockKey']):_0x37b2e2[_0x42d7ff(0x16d)](_0x470269['lockKey']);}const _0x5b7c68=[];if(_0x166d89[_0x42d7ff(0x180)](_0x42d7ff(0x16f))){const _0x21e7d7=loadAliasMap(_0x166d89[_0x42d7ff(0x170)],undefined,resolveApiFilePath(_0x166d89[_0x42d7ff(0x170)],_0x166d89['appCode'])),_0x7a0e73=new Map(_0x21e7d7['map'](_0x22fedb=>[_0x22fedb[_0x42d7ff(0x17f)],_0x22fedb['alias']])),[_0x3ee9ac,_0x31099d]=await Promise[_0x42d7ff(0x179)]([listBffScripts(_0x166d89[_0x42d7ff(0x18f)]),getBffScriptStatistics(_0x166d89['appCode'])]),_0x86761=createHookLocationMap(_0x31099d),_0x224fd9=new Set(_0x31e7cc[_0x42d7ff(0x176)](_0x24ba3e=>_0x24ba3e[_0x42d7ff(0x18e)]));for(const _0x325951 of _0x3ee9ac){const _0x4ced90=resolveRemoteScriptTarget(_0x3337a6,_0x325951,_0x86761,_0x14c75a['functions'],_0x7a0e73);_0x4ced90&&!_0x224fd9[_0x42d7ff(0x17d)](_0x4ced90[_0x42d7ff(0x18e)])&&_0x5b7c68[_0x42d7ff(0x16d)](_0x4ced90['lockKey']);}}const _0x335495=_0x2a42df['length']===0x0&&_0x402ee7[_0x42d7ff(0x188)]===0x0&&_0x5b7c68[_0x42d7ff(0x188)]===0x0;return{'ok':!![],'data':{'added':_0x2a42df,'modified':_0x402ee7,'unchanged':_0x37b2e2,'remoteOnly':_0x5b7c68},'message':_0x335495?_0x42d7ff(0x175):_0x2a42df['length']+_0x42d7ff(0x16e)+_0x402ee7[_0x42d7ff(0x188)]+_0x42d7ff(0x174)+_0x37b2e2['length']+_0x42d7ff(0x181)+(_0x5b7c68['length']>0x0?',\x20'+_0x5b7c68[_0x42d7ff(0x188)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x2eb530=a39_0x3086;(function(_0x30640f,_0x1dfb7c){const _0x2bf7fd=a39_0x3086,_0x558750=_0x30640f();while(!![]){try{const _0x10f2d0=parseInt(_0x2bf7fd(0x137))/0x1+-parseInt(_0x2bf7fd(0x122))/0x2*(-parseInt(_0x2bf7fd(0x12d))/0x3)+-parseInt(_0x2bf7fd(0x11e))/0x4*(-parseInt(_0x2bf7fd(0x123))/0x5)+parseInt(_0x2bf7fd(0x139))/0x6+parseInt(_0x2bf7fd(0x134))/0x7*(parseInt(_0x2bf7fd(0x127))/0x8)+parseInt(_0x2bf7fd(0x129))/0x9*(parseInt(_0x2bf7fd(0x12c))/0xa)+parseInt(_0x2bf7fd(0x12e))/0xb*(-parseInt(_0x2bf7fd(0x125))/0xc);if(_0x10f2d0===_0x1dfb7c)break;else _0x558750['push'](_0x558750['shift']());}catch(_0x3aa3f2){_0x558750['push'](_0x558750['shift']());}}}(a39_0xcbfd,0x5a908));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';function a39_0x3086(_0x2818ec,_0x38d5c5){_0x2818ec=_0x2818ec-0x11e;const _0xcbfdc3=a39_0xcbfd();let _0x3086b0=_0xcbfdc3[_0x2818ec];return _0x3086b0;}function a39_0xcbfd(){const _0x2d08db=['Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(','4141949ISskNK','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','apiError','320232MQIcJk','../../skills/npx-skills-add.js','1457502WSSTAg','cwd','CLI\x20Built-in\x20Skill\x20installed','install','info','2228XdaDHV','error','setLogPath','cli-skill-install','18dauyim','1030RHItvk','cli-skill','12DePdnq','pipe','8JLTARq','unknown','235584uTBhKz','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','inherit','80wlpmAZ','21186UsaKfS','12887732vrlEsj','log','npx\x20skills\x20add\x20failed:\x20','write','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.'];a39_0xcbfd=function(){return _0x2d08db;};return a39_0xcbfd();}export const cliSkillDefinitions=[{'service':a39_0x2eb530(0x124),'command':a39_0x2eb530(0x13c),'description':a39_0x2eb530(0x135),'risk':a39_0x2eb530(0x131),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4ac6b4){const _0x2411d5=a39_0x2eb530;logger[_0x2411d5(0x120)](process[_0x2411d5(0x13a)]()),logger[_0x2411d5(0x13d)](_0x2411d5(0x121),_0x2411d5(0x132));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x4fb620,RABETBASE_SKILL_SOURCE:_0x35f4c7,runNpxSkillsAddGlobal:_0x3ab17b}=await import(_0x2411d5(0x138)),_0x490ac3=_0x4ac6b4['nonInteractive']?_0x2411d5(0x126):_0x2411d5(0x12b);console[_0x2411d5(0x12f)](_0x2411d5(0x133)+_0x4fb620+')...');const _0x3ceba0=_0x3ab17b(process[_0x2411d5(0x13a)](),_0x35f4c7,{'stdio':_0x490ac3});if(_0x3ceba0['skipped'])console[_0x2411d5(0x12f)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.');else{if(_0x3ceba0['ok'])console[_0x2411d5(0x12f)](_0x2411d5(0x13b));else throw CliErrors[_0x2411d5(0x136)](_0x2411d5(0x130)+(_0x3ceba0[_0x2411d5(0x11f)]||_0x2411d5(0x128)),_0x2411d5(0x12a)+_0x4fb620);}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x260e5c=a40_0x238e;(function(_0x46cafe,_0x4df652){const _0x488bc6=a40_0x238e,_0x2310d2=_0x46cafe();while(!![]){try{const _0x406b57=-parseInt(_0x488bc6(0x162))/0x1*(-parseInt(_0x488bc6(0x147))/0x2)+-parseInt(_0x488bc6(0x173))/0x3+parseInt(_0x488bc6(0x164))/0x4+parseInt(_0x488bc6(0x143))/0x5+parseInt(_0x488bc6(0x165))/0x6+parseInt(_0x488bc6(0x16a))/0x7*(-parseInt(_0x488bc6(0x16c))/0x8)+parseInt(_0x488bc6(0x14a))/0x9;if(_0x406b57===_0x4df652)break;else _0x2310d2['push'](_0x2310d2['shift']());}catch(_0x28bc2e){_0x2310d2['push'](_0x2310d2['shift']());}}}(a40_0x5d38,0x5a5a9));import a40_0x3bce2f from'chalk';import a40_0x549b44 from'ora';function a40_0x5d38(){const _0x155db6=['red','671785KZqLWE','start','run','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','1298CmuRRL','Checking\x20for\x20updates...','boolean','5113476izPNFw','skipped','nonInteractive','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','Checking\x20CLI\x20Built-in\x20Skill...','\x20\x20Try\x20manually:\x20','pipe','map','Already\x20up\x20to\x20date\x20(v','\x20install\x20-g\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','@latest','str','skills','Beta\x20version:\x20','install','includes','gray','timeout','fail','trim','valid','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','version','166aREUnE','filter','6124XxCESM','1503690lWBgvZ','slice','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','inherit','1878989TVVhCk','beta','16MNdYea','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','latest','warn','...','/dist-tags','source','466374QMmARg','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','validation','cwd','green','yellow','Requested\x20version:\x20','bool','succeed','object','json','entries','Already\x20on\x20requested\x20version\x20(v','bun','Update\x20failed','error','https://registry.npmjs.org/-/package/','\x20\x20Run\x20manually:\x20','Updating\x20via\x20','message','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','flag','Update\x20available:\x20','Install\x20a\x20specific\x20CLI\x20version','npm','no-skills','log','fromEntries','Version\x20comparison\x20failed','Invalid\x20version:\x20','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','Current\x20version:\x20','unknown','string','\x20→\x20'];a40_0x5d38=function(){return _0x155db6;};return a40_0x5d38();}import a40_0x16ebb2 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 _0x3c07d5=a40_0x238e;return GIT_COMMIT!==_0x3c07d5(0x13f)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x3c07d5(0x166)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1ded4c=a40_0x238e,_0x242b72=process['execPath']['toLowerCase']();if(_0x242b72[_0x1ded4c(0x15a)](_0x1ded4c(0x180)))return _0x1ded4c(0x180);return _0x1ded4c(0x137);}function a40_0x238e(_0x3fcc25,_0x52c31b){_0x3fcc25=_0x3fcc25-0x133;const _0x5d387d=a40_0x5d38();let _0x238e83=_0x5d387d[_0x3fcc25];return _0x238e83;}const updateFlags=[{'name':a40_0x260e5c(0x16b),'type':a40_0x260e5c(0x149),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a40_0x260e5c(0x161),'type':'string','description':a40_0x260e5c(0x136)},{'name':'no-skills','type':a40_0x260e5c(0x149),'description':a40_0x260e5c(0x13d),'default':![]},{'name':a40_0x260e5c(0x157),'type':a40_0x260e5c(0x149),'description':a40_0x260e5c(0x167),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x127946){const _0x231a55=a40_0x260e5c;return _0x127946[_0x231a55(0x156)](_0x231a55(0x161))[_0x231a55(0x15e)]();}function shouldSkipCliSkill(_0x3b7c22){const _0x2ad880=a40_0x260e5c;return _0x3b7c22[_0x2ad880(0x17a)](_0x2ad880(0x138))||_0x3b7c22[_0x2ad880(0x134)](_0x2ad880(0x157))===![];}async function validateUpdateFlags(_0x3f254f){const _0x1175d0=a40_0x260e5c,_0x57c94f=_0x3f254f[_0x1175d0(0x17a)]('beta'),_0x91471a=getRequestedVersion(_0x3f254f);if(_0x57c94f&&_0x91471a)throw CliErrors['validation'](_0x1175d0(0x133),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x91471a&&!a40_0x16ebb2['valid'](_0x91471a))throw CliErrors[_0x1175d0(0x175)](_0x1175d0(0x13c)+_0x91471a,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x125492=a40_0x260e5c;try{const _0x35231b=await fetch(_0x125492(0x183)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x125492(0x171),{'signal':AbortSignal[_0x125492(0x15c)](0x2710)});if(!_0x35231b['ok'])return null;const _0x5f2c55=await _0x35231b[_0x125492(0x17d)]();if(!_0x5f2c55||typeof _0x5f2c55!==_0x125492(0x17c))return null;return Object[_0x125492(0x13a)](Object[_0x125492(0x17e)](_0x5f2c55)[_0x125492(0x163)](([,_0x49498a])=>typeof _0x49498a===_0x125492(0x140)&&_0x49498a[_0x125492(0x15e)]()['length']>0x0)[_0x125492(0x151)](([_0x3b61d1,_0x4a7bac])=>[_0x3b61d1,String(_0x4a7bac)[_0x125492(0x15e)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x2d3735){const _0x28a0ba=await fetchNpmDistTags();return _0x28a0ba?.[_0x2d3735]??null;}async function fetchLatestVersion(){const _0x1bcbc4=a40_0x260e5c;return fetchNpmDistTagVersion(_0x1bcbc4(0x16e));}async function resolveTargetVersion(_0xedf73f){const _0x537f13=a40_0x260e5c,_0x8f046b=getRequestedVersion(_0xedf73f);if(_0x8f046b)return{'version':_0x8f046b,'source':_0x537f13(0x161)};if(_0xedf73f['bool'](_0x537f13(0x16b))){const _0x2fc9ca=await fetchNpmDistTagVersion(_0x537f13(0x16b));if(!_0x2fc9ca)return null;return{'version':_0x2fc9ca,'source':_0x537f13(0x16b)};}const _0x22625d=await fetchLatestVersion();if(!_0x22625d)return null;return{'version':_0x22625d,'source':'latest'};}function shouldInstallTarget(_0x2bacb0,_0x1b6ab7){const _0x2d10d1=a40_0x260e5c;if(_0x1b6ab7['source']===_0x2d10d1(0x161)||_0x1b6ab7[_0x2d10d1(0x172)]===_0x2d10d1(0x16b))return!a40_0x16ebb2['eq'](_0x2bacb0,_0x1b6ab7[_0x2d10d1(0x161)]);return a40_0x16ebb2['lt'](_0x2bacb0,_0x1b6ab7['version']);}function getInstallPlanLabel(_0x75161e,_0x19fe86){const _0x58ac93=a40_0x260e5c;switch(_0x19fe86['source']){case'beta':return _0x58ac93(0x158)+a40_0x3bce2f[_0x58ac93(0x178)](_0x75161e)+_0x58ac93(0x141)+a40_0x3bce2f[_0x58ac93(0x177)](_0x19fe86[_0x58ac93(0x161)]);case _0x58ac93(0x161):return _0x58ac93(0x179)+a40_0x3bce2f['yellow'](_0x75161e)+_0x58ac93(0x141)+a40_0x3bce2f['green'](_0x19fe86[_0x58ac93(0x161)]);case'latest':default:return _0x58ac93(0x135)+a40_0x3bce2f['yellow'](_0x75161e)+_0x58ac93(0x141)+a40_0x3bce2f[_0x58ac93(0x177)](_0x19fe86[_0x58ac93(0x161)]);}}async function installCliSkill(_0xc7909a){const _0xab2dd3=a40_0x260e5c;console[_0xab2dd3(0x139)](a40_0x3bce2f[_0xab2dd3(0x15b)](_0xab2dd3(0x14e)));const _0x3537ae=runNpxSkillsAddGlobal(process[_0xab2dd3(0x176)](),RABETBASE_SKILL_SOURCE,{'stdio':_0xc7909a?_0xab2dd3(0x150):_0xab2dd3(0x169)});if(_0x3537ae[_0xab2dd3(0x14b)]){console['log'](a40_0x3bce2f[_0xab2dd3(0x15b)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'));return;}if(_0x3537ae['ok']){console['log'](a40_0x3bce2f[_0xab2dd3(0x15b)](_0xab2dd3(0x146)));return;}console[_0xab2dd3(0x16f)](a40_0x3bce2f[_0xab2dd3(0x178)](_0xab2dd3(0x168)+(_0x3537ae[_0xab2dd3(0x182)]||_0xab2dd3(0x13f)))),console[_0xab2dd3(0x139)](a40_0x3bce2f[_0xab2dd3(0x15b)](_0xab2dd3(0x184)+CLI_BIN_NAME+'\x20cli-skill\x20install'));}async function execute(_0x1a7513){const _0x533111=a40_0x260e5c;await validateUpdateFlags(_0x1a7513);const _0x52e88d=getCurrentVersion();console[_0x533111(0x139)](_0x533111(0x13e)+_0x52e88d);const _0x3da502=a40_0x549b44(_0x533111(0x148))[_0x533111(0x144)](),_0x24732f=await resolveTargetVersion(_0x1a7513);if(!_0x24732f){const _0x2ffe87=_0x1a7513[_0x533111(0x17a)](_0x533111(0x16b))?_0x533111(0x16d):_0x533111(0x174);return _0x3da502['fail'](_0x2ffe87),console['log'](a40_0x3bce2f['gray'](_0x533111(0x154)+NPM_PACKAGE_NAME+_0x533111(0x155))),{'ok':![],'message':_0x2ffe87};}const _0x3848e4=a40_0x16ebb2[_0x533111(0x15f)](VERSION),_0x49058d=a40_0x16ebb2[_0x533111(0x15f)](_0x24732f[_0x533111(0x161)]);if(!_0x3848e4||!_0x49058d)return _0x3da502['fail'](_0x533111(0x13b)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3848e4,_0x24732f)){const _0x48fd1c=_0x24732f[_0x533111(0x172)]===_0x533111(0x161)?_0x533111(0x17f)+_0x24732f[_0x533111(0x161)]+')':_0x533111(0x152)+_0x24732f[_0x533111(0x161)]+')';return _0x3da502['succeed'](_0x48fd1c),shouldSkipCliSkill(_0x1a7513)?console['log'](a40_0x3bce2f[_0x533111(0x15b)](_0x533111(0x14d))):await installCliSkill(_0x1a7513[_0x533111(0x14c)]),{'ok':!![]};}_0x3da502['info'](getInstallPlanLabel(_0x52e88d,_0x24732f));const _0x5ea5b6=detectPackageManager(),_0x438e1d=_0x5ea5b6==='npm'?resolveNpmBin(_0x533111(0x137)):_0x5ea5b6,_0x310ffe=a40_0x549b44(_0x533111(0x185)+_0x5ea5b6+_0x533111(0x170))['start']();try{return await execa(_0x438e1d,[_0x533111(0x159),'-g',NPM_PACKAGE_NAME+'@'+_0x24732f['version']],{'stdio':'pipe'}),_0x310ffe[_0x533111(0x17b)]('Updated\x20to\x20v'+_0x24732f[_0x533111(0x161)]),console[_0x533111(0x139)](a40_0x3bce2f[_0x533111(0x15b)](_0x533111(0x160))),shouldSkipCliSkill(_0x1a7513)?console[_0x533111(0x139)](a40_0x3bce2f[_0x533111(0x15b)](_0x533111(0x14d))):await installCliSkill(_0x1a7513[_0x533111(0x14c)]),{'ok':!![]};}catch(_0x575927){return _0x310ffe[_0x533111(0x15d)](_0x533111(0x181)),console[_0x533111(0x182)](a40_0x3bce2f[_0x533111(0x142)]('\x20\x20'+_0x575927[_0x533111(0x186)])),console[_0x533111(0x139)](a40_0x3bce2f['gray'](_0x533111(0x14f)+_0x5ea5b6+_0x533111(0x153)+NPM_PACKAGE_NAME+'@'+_0x24732f['version'])),{'ok':![],'message':_0x575927['message']};}}export const updateDefinition={'service':'update','command':a40_0x260e5c(0x145),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0xa9880=a40_0x3d28;(function(_0x3a7cf5,_0x185539){const _0x2a30b7=a40_0x3d28,_0x461396=_0x3a7cf5();while(!![]){try{const _0x597bfe=parseInt(_0x2a30b7(0x150))/0x1+parseInt(_0x2a30b7(0x143))/0x2+parseInt(_0x2a30b7(0x11e))/0x3+-parseInt(_0x2a30b7(0x12c))/0x4*(-parseInt(_0x2a30b7(0x145))/0x5)+-parseInt(_0x2a30b7(0x153))/0x6*(parseInt(_0x2a30b7(0x136))/0x7)+parseInt(_0x2a30b7(0x108))/0x8+parseInt(_0x2a30b7(0x133))/0x9*(-parseInt(_0x2a30b7(0x118))/0xa);if(_0x597bfe===_0x185539)break;else _0x461396['push'](_0x461396['shift']());}catch(_0x386ac4){_0x461396['push'](_0x461396['shift']());}}}(a40_0x6f92,0xe53f7));function a40_0x6f92(){const _0x3d8706=['skipped','green','version','Invalid\x20version:\x20','fail','988704rcxANI','nonInteractive','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','update','Checking\x20for\x20updates...','write','filter','start','no-skills','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','boolean','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','info','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','/dist-tags','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','160XEqzfJ','@latest','install','source','error','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','4072059GYEXqO','validation','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','length','pipe','https://registry.npmjs.org/-/package/','Updating\x20via\x20','\x20cli-skill\x20install','unknown','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20Run\x20manually:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','message','4GtIQsE','warn','gray','cwd','bool','skills','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','2165391HrrIEm','Already\x20on\x20requested\x20version\x20(v','fromEntries','259lPbxUS','red','npm','bun','succeed','Updated\x20to\x20v','yellow','run','Install\x20a\x20specific\x20CLI\x20version','Requested\x20version:\x20','\x20install\x20-g\x20','beta','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','3677098DJxYuW','trim','6595075wwXTbG','str','latest','Version\x20comparison\x20failed','\x20\x20Try\x20manually:\x20','Update\x20failed','\x20→\x20','Checking\x20CLI\x20Built-in\x20Skill...','slice','log','Current\x20version:\x20','1231884BmQMCU','string','toLowerCase','175428BJhZiU','valid'];a40_0x6f92=function(){return _0x3d8706;};return a40_0x6f92();}import a40_0x373fb8 from'chalk';import a40_0x22ca1e from'ora';import a40_0x29fa1c 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 _0x33f374=a40_0x3d28;return GIT_COMMIT!==_0x33f374(0x127)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x33f374(0x14d)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x43625c=a40_0x3d28,_0x5de0fd=process['execPath'][_0x43625c(0x152)]();if(_0x5de0fd['includes']('bun'))return _0x43625c(0x139);return _0x43625c(0x138);}const updateFlags=[{'name':a40_0xa9880(0x141),'type':a40_0xa9880(0x112),'description':a40_0xa9880(0x142),'default':![]},{'name':a40_0xa9880(0x105),'type':'string','description':a40_0xa9880(0x13e)},{'name':a40_0xa9880(0x110),'type':a40_0xa9880(0x112),'description':a40_0xa9880(0x113),'default':![]},{'name':a40_0xa9880(0x131),'type':a40_0xa9880(0x112),'description':a40_0xa9880(0x11d),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x50ecd6){const _0x4156be=a40_0xa9880;return _0x50ecd6[_0x4156be(0x146)](_0x4156be(0x105))[_0x4156be(0x144)]();}function shouldSkipCliSkill(_0x38d22e){const _0x3cc7ef=a40_0xa9880;return _0x38d22e[_0x3cc7ef(0x130)]('no-skills')||_0x38d22e['flag']('skills')===![];}async function validateUpdateFlags(_0x462e0d){const _0x4bfebb=a40_0xa9880,_0x1b60d1=_0x462e0d[_0x4bfebb(0x130)](_0x4bfebb(0x141)),_0x4a7668=getRequestedVersion(_0x462e0d);if(_0x1b60d1&&_0x4a7668)throw CliErrors['validation'](_0x4bfebb(0x128),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x4a7668&&!a40_0x29fa1c['valid'](_0x4a7668))throw CliErrors[_0x4bfebb(0x11f)](_0x4bfebb(0x106)+_0x4a7668,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x2bb079=a40_0xa9880;try{const _0x44ca39=await fetch(_0x2bb079(0x124)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2bb079(0x116),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x44ca39['ok'])return null;const _0x32321e=await _0x44ca39['json']();if(!_0x32321e||typeof _0x32321e!=='object')return null;return Object[_0x2bb079(0x135)](Object['entries'](_0x32321e)[_0x2bb079(0x10e)](([,_0x134d1b])=>typeof _0x134d1b===_0x2bb079(0x151)&&_0x134d1b[_0x2bb079(0x144)]()[_0x2bb079(0x122)]>0x0)['map'](([_0x3c9596,_0x154ad1])=>[_0x3c9596,String(_0x154ad1)[_0x2bb079(0x144)]()]));}catch{return null;}}function a40_0x3d28(_0x383057,_0x10cd87){_0x383057=_0x383057-0x104;const _0x6f9277=a40_0x6f92();let _0x3d282b=_0x6f9277[_0x383057];return _0x3d282b;}async function fetchNpmDistTagVersion(_0x2a87c6){const _0x727136=await fetchNpmDistTags();return _0x727136?.[_0x2a87c6]??null;}async function fetchLatestVersion(){const _0x5899da=a40_0xa9880;return fetchNpmDistTagVersion(_0x5899da(0x147));}async function resolveTargetVersion(_0x57e877){const _0x39f386=a40_0xa9880,_0x3c1ca9=getRequestedVersion(_0x57e877);if(_0x3c1ca9)return{'version':_0x3c1ca9,'source':_0x39f386(0x105)};if(_0x57e877['bool']('beta')){const _0x3b2746=await fetchNpmDistTagVersion(_0x39f386(0x141));if(!_0x3b2746)return null;return{'version':_0x3b2746,'source':'beta'};}const _0x4e5b0f=await fetchLatestVersion();if(!_0x4e5b0f)return null;return{'version':_0x4e5b0f,'source':_0x39f386(0x147)};}function shouldInstallTarget(_0x38fa66,_0x4ac87e){const _0x342901=a40_0xa9880;if(_0x4ac87e[_0x342901(0x11b)]===_0x342901(0x105)||_0x4ac87e[_0x342901(0x11b)]===_0x342901(0x141))return!a40_0x29fa1c['eq'](_0x38fa66,_0x4ac87e[_0x342901(0x105)]);return a40_0x29fa1c['lt'](_0x38fa66,_0x4ac87e[_0x342901(0x105)]);}function getInstallPlanLabel(_0x140000,_0x2716e3){const _0x5f5c58=a40_0xa9880;switch(_0x2716e3['source']){case'beta':return'Beta\x20version:\x20'+a40_0x373fb8['yellow'](_0x140000)+_0x5f5c58(0x14b)+a40_0x373fb8['green'](_0x2716e3[_0x5f5c58(0x105)]);case _0x5f5c58(0x105):return _0x5f5c58(0x13f)+a40_0x373fb8[_0x5f5c58(0x13c)](_0x140000)+_0x5f5c58(0x14b)+a40_0x373fb8['green'](_0x2716e3[_0x5f5c58(0x105)]);case _0x5f5c58(0x147):default:return'Update\x20available:\x20'+a40_0x373fb8[_0x5f5c58(0x13c)](_0x140000)+_0x5f5c58(0x14b)+a40_0x373fb8[_0x5f5c58(0x104)](_0x2716e3[_0x5f5c58(0x105)]);}}async function installCliSkill(_0x3704bb){const _0x1920f4=a40_0xa9880;console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x14c)));const _0x1f35b3=runNpxSkillsAddGlobal(process[_0x1920f4(0x12f)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x3704bb?_0x1920f4(0x123):'inherit'});if(_0x1f35b3[_0x1920f4(0x155)]){console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x132)));return;}if(_0x1f35b3['ok']){console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x111)));return;}console[_0x1920f4(0x12d)](a40_0x373fb8[_0x1920f4(0x13c)](_0x1920f4(0x12a)+(_0x1f35b3[_0x1920f4(0x11c)]||'unknown'))),console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x129)+CLI_BIN_NAME+_0x1920f4(0x126)));}async function execute(_0x55ca74){const _0x2b3e44=a40_0xa9880;await validateUpdateFlags(_0x55ca74);const _0x55402b=getCurrentVersion();console[_0x2b3e44(0x14e)](_0x2b3e44(0x14f)+_0x55402b);const _0x20dc77=a40_0x22ca1e(_0x2b3e44(0x10c))[_0x2b3e44(0x10f)](),_0x257348=await resolveTargetVersion(_0x55ca74);if(!_0x257348){const _0x470f18=_0x55ca74['bool'](_0x2b3e44(0x141))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x2b3e44(0x10a);return _0x20dc77[_0x2b3e44(0x107)](_0x470f18),console[_0x2b3e44(0x14e)](a40_0x373fb8['gray'](_0x2b3e44(0x120)+NPM_PACKAGE_NAME+_0x2b3e44(0x119))),{'ok':![],'message':_0x470f18};}const _0xabc6f2=a40_0x29fa1c[_0x2b3e44(0x154)](VERSION),_0xb988d4=a40_0x29fa1c[_0x2b3e44(0x154)](_0x257348[_0x2b3e44(0x105)]);if(!_0xabc6f2||!_0xb988d4)return _0x20dc77[_0x2b3e44(0x107)](_0x2b3e44(0x148)),{'ok':![],'message':_0x2b3e44(0x148)};if(!shouldInstallTarget(_0xabc6f2,_0x257348)){const _0x2da88a=_0x257348[_0x2b3e44(0x11b)]===_0x2b3e44(0x105)?_0x2b3e44(0x134)+_0x257348['version']+')':'Already\x20up\x20to\x20date\x20(v'+_0x257348[_0x2b3e44(0x105)]+')';return _0x20dc77[_0x2b3e44(0x13a)](_0x2da88a),shouldSkipCliSkill(_0x55ca74)?console[_0x2b3e44(0x14e)](a40_0x373fb8[_0x2b3e44(0x12e)](_0x2b3e44(0x117))):await installCliSkill(_0x55ca74[_0x2b3e44(0x109)]),{'ok':!![]};}_0x20dc77[_0x2b3e44(0x114)](getInstallPlanLabel(_0x55402b,_0x257348));const _0x25ce1b=detectPackageManager(),_0x59b77b=_0x25ce1b===_0x2b3e44(0x138)?resolveNpmBin('npm'):_0x25ce1b,_0x40cfb1=a40_0x22ca1e(_0x2b3e44(0x125)+_0x25ce1b+'...')['start']();try{return await execa(_0x59b77b,[_0x2b3e44(0x11a),'-g',NPM_PACKAGE_NAME+'@'+_0x257348[_0x2b3e44(0x105)]],{'stdio':_0x2b3e44(0x123)}),_0x40cfb1['succeed'](_0x2b3e44(0x13b)+_0x257348[_0x2b3e44(0x105)]),console[_0x2b3e44(0x14e)](a40_0x373fb8[_0x2b3e44(0x12e)](_0x2b3e44(0x121))),shouldSkipCliSkill(_0x55ca74)?console[_0x2b3e44(0x14e)](a40_0x373fb8[_0x2b3e44(0x12e)](_0x2b3e44(0x117))):await installCliSkill(_0x55ca74[_0x2b3e44(0x109)]),{'ok':!![]};}catch(_0x2b2633){return _0x40cfb1[_0x2b3e44(0x107)](_0x2b3e44(0x14a)),console[_0x2b3e44(0x11c)](a40_0x373fb8[_0x2b3e44(0x137)]('\x20\x20'+_0x2b2633['message'])),console[_0x2b3e44(0x14e)](a40_0x373fb8['gray'](_0x2b3e44(0x149)+_0x25ce1b+_0x2b3e44(0x140)+NPM_PACKAGE_NAME+'@'+_0x257348[_0x2b3e44(0x105)])),{'ok':![],'message':_0x2b2633[_0x2b3e44(0x12b)]};}}export const updateDefinition={'service':a40_0xa9880(0x10b),'command':a40_0xa9880(0x13d),'description':a40_0xa9880(0x115),'risk':a40_0xa9880(0x10d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2de5d3,_0x5e64f4){const _0x2a1729=a41_0x4f2f,_0x4c8dd8=_0x2de5d3();while(!![]){try{const _0x1bde04=parseInt(_0x2a1729(0xff))/0x1+parseInt(_0x2a1729(0x102))/0x2*(parseInt(_0x2a1729(0x101))/0x3)+-parseInt(_0x2a1729(0xfb))/0x4+parseInt(_0x2a1729(0xfd))/0x5+parseInt(_0x2a1729(0xfc))/0x6+-parseInt(_0x2a1729(0xfe))/0x7+parseInt(_0x2a1729(0x100))/0x8*(-parseInt(_0x2a1729(0x103))/0x9);if(_0x1bde04===_0x5e64f4)break;else _0x4c8dd8['push'](_0x4c8dd8['shift']());}catch(_0x468e2a){_0x4c8dd8['push'](_0x4c8dd8['shift']());}}}(a41_0x466d,0xe2cf7));function a41_0x4f2f(_0x5ae8d0,_0x21afd4){_0x5ae8d0=_0x5ae8d0-0xfb;const _0x466dab=a41_0x466d();let _0x4f2f94=_0x466dab[_0x5ae8d0];return _0x4f2f94;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x466d(){const _0x2c73a9=['120lhUEEu','3fiAZUf','1842424CUWlzi','30627ZCMsXM','2367996bXVHcN','403020iWHvLK','7354335enMmaB','6282689CStlmG','10337wmCNSS'];a41_0x466d=function(){return _0x2c73a9;};return a41_0x466d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a42_0x556c(){const _0x40658c=['3469TEzoHQ','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','alias','operation','50iUQmfI','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','read','string','4ZmzKzl','267619lrlSQk','14MvigXW','bool','725230SjNKhJ','563361hpRCEU','code','369558enQBTP','sdk','730560dOkiMV','skip-imports','120YaoNuL','71856bMWxdZ','336IPIsBW','codegen','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','str'];a42_0x556c=function(){return _0x40658c;};return a42_0x556c();}const a42_0x41917f=a42_0x3c2f;function a42_0x3c2f(_0x5e1a5c,_0xbcbcdd){_0x5e1a5c=_0x5e1a5c-0xf7;const _0x556c0b=a42_0x556c();let _0x3c2f98=_0x556c0b[_0x5e1a5c];return _0x3c2f98;}(function(_0x4335c3,_0x4ef312){const _0x72de08=a42_0x3c2f,_0x79cb95=_0x4335c3();while(!![]){try{const _0x262cd7=parseInt(_0x72de08(0x105))/0x1*(parseInt(_0x72de08(0x109))/0x2)+parseInt(_0x72de08(0xf9))/0x3*(-parseInt(_0x72de08(0x10d))/0x4)+-parseInt(_0x72de08(0xf8))/0x5+parseInt(_0x72de08(0xfb))/0x6*(-parseInt(_0x72de08(0x10f))/0x7)+-parseInt(_0x72de08(0xfd))/0x8+-parseInt(_0x72de08(0x100))/0x9*(parseInt(_0x72de08(0xff))/0xa)+parseInt(_0x72de08(0x10e))/0xb*(parseInt(_0x72de08(0x101))/0xc);if(_0x262cd7===_0x4ef312)break;else _0x79cb95['push'](_0x79cb95['shift']());}catch(_0x189e83){_0x79cb95['push'](_0x79cb95['shift']());}}}(a42_0x556c,0x1e776));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x41917f(0x102),'command':a42_0x41917f(0xfc),'description':a42_0x41917f(0x10a),'risk':a42_0x41917f(0x10b),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x41917f(0x107),'type':a42_0x41917f(0x10c),'description':a42_0x41917f(0x103)},{'name':a42_0x41917f(0x108),'type':a42_0x41917f(0x10c),'required':!![],'description':a42_0x41917f(0x106)},{'name':a42_0x41917f(0xfe),'type':'boolean','description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x1f954d){const _0x130ecd=a42_0x41917f,{dataset:_0x4c0a46,operation:_0x23208b}=await getOperationDetail(_0x1f954d['appCode'],_0x1f954d[_0x130ecd(0x104)](_0x130ecd(0xfa)),_0x1f954d['str'](_0x130ecd(0x108))),_0x56b05d=generateSdkCode(_0x4c0a46,_0x23208b,{'includeImports':!_0x1f954d[_0x130ecd(0xf7)](_0x130ecd(0xfe))});return{'ok':!![],'data':{'dataset':{'name':_0x4c0a46['name'],'code':_0x4c0a46[_0x130ecd(0xfa)],'tableName':_0x4c0a46['tableName']},'operation':_0x1f954d[_0x130ecd(0x104)]('operation'),'code':_0x56b05d}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x324e7f=a43_0x4404;(function(_0x3aaf87,_0x354f06){const _0x2e39b7=a43_0x4404,_0x39d9d4=_0x3aaf87();while(!![]){try{const _0x2b1f5a=-parseInt(_0x2e39b7(0xba))/0x1+-parseInt(_0x2e39b7(0xc7))/0x2+parseInt(_0x2e39b7(0xbd))/0x3*(parseInt(_0x2e39b7(0xb9))/0x4)+parseInt(_0x2e39b7(0xbc))/0x5*(parseInt(_0x2e39b7(0xc2))/0x6)+parseInt(_0x2e39b7(0xc0))/0x7+parseInt(_0x2e39b7(0xb3))/0x8+-parseInt(_0x2e39b7(0xbe))/0x9;if(_0x2b1f5a===_0x354f06)break;else _0x39d9d4['push'](_0x39d9d4['shift']());}catch(_0x4526a8){_0x39d9d4['push'](_0x39d9d4['shift']());}}}(a43_0x24bb,0x5bc1a));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x4404(_0x513001,_0x49d2c5){_0x513001=_0x513001-0xb2;const _0x24bbb5=a43_0x24bb();let _0x44042e=_0x24bbb5[_0x513001];return _0x44042e;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x24bb(){const _0xf968ad=['appCode','487490JROGrc','2649TVnWPY','2309715HtuWKh','sdk','2977254esLomU','str','30gJDGqu','Omit\x20import\x20statements\x20from\x20generated\x20code','read','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sqlcode','389568UnrsAa','sql','no-imports','4309432JxlkNk','target','bool','sqlCode','boolean','sqlName','556qnvDpg','746975gwtUvF'];a43_0x24bb=function(){return _0xf968ad;};return a43_0x24bb();}export const codegenSql={'service':'codegen','command':a43_0x324e7f(0xc8),'description':a43_0x324e7f(0xc5),'risk':a43_0x324e7f(0xc4),'flags':[SQLCODE_FLAG,{'name':a43_0x324e7f(0xb4),'type':'string','description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x324e7f(0xbf),'enum':['sdk','bff']},{'name':a43_0x324e7f(0xb2),'type':a43_0x324e7f(0xb7),'description':a43_0x324e7f(0xc3)}],async 'execute'(_0x645e6b){const _0x525dbe=a43_0x324e7f,_0x18e375=await getSqlQueryInfo(_0x645e6b[_0x525dbe(0xbb)],_0x645e6b[_0x525dbe(0xc1)](_0x525dbe(0xc6))),_0x1e73ea=_0x645e6b[_0x525dbe(0xc1)](_0x525dbe(0xb4))||_0x525dbe(0xbf),_0x20a9a3=generateSqlCodeTemplate(_0x18e375,{'target':_0x1e73ea,'includeImports':!_0x645e6b[_0x525dbe(0xb5)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x18e375[_0x525dbe(0xb6)],'sqlName':_0x18e375[_0x525dbe(0xb8)],'target':_0x1e73ea,'code':_0x20a9a3}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xc4f2e0,_0x345867){const _0x28df93=a44_0x4ff0,_0x23637c=_0xc4f2e0();while(!![]){try{const _0xab8dd3=-parseInt(_0x28df93(0xb2))/0x1*(parseInt(_0x28df93(0xa9))/0x2)+-parseInt(_0x28df93(0xaa))/0x3*(parseInt(_0x28df93(0xcb))/0x4)+-parseInt(_0x28df93(0xca))/0x5+parseInt(_0x28df93(0xd3))/0x6+parseInt(_0x28df93(0xae))/0x7*(-parseInt(_0x28df93(0xd4))/0x8)+parseInt(_0x28df93(0xb0))/0x9+parseInt(_0x28df93(0xcf))/0xa;if(_0xab8dd3===_0x345867)break;else _0x23637c['push'](_0x23637c['shift']());}catch(_0x1cbdd2){_0x23637c['push'](_0x23637c['shift']());}}}(a44_0xcc8e,0xa0f54));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';function a44_0xcc8e(){const _0x44d752=['\x20<name>\x20--appcode\x20<code>','\x20config.','str','\x20Note:\x20app\x20\x22','Missing\x20app\x20name.','flagMissing','boolean','3264360FzkqxS','172oJqvqw','object','string','\x20<name>\x20[--global]','18417740CghqVW','\x22\x20(appcode:\x20','\x22\x20still\x20defined\x20in\x20','validation','1983606oFLgTn','145264ZcPAeV','project','Removed\x20app\x20\x22','global','50766bmoDCe','252ZnMsnG','trim','projectConfig','Added','385AmsVbl','\x22\x20not\x20found.','6304581rmdxTQ','Updated','22kbMwZh','apps','\x20<name>','inherit','\x20Set\x20as\x20default\x20app.','keys','args','\x20Default\x20app\x20changed\x20to\x20\x22','\x20app\x20\x22','appcode','App\x20\x22','bool','defaultApp','Use\x20global\x20config\x20scope','globalConfig','Usage:\x20','App\x20code'];a44_0xcc8e=function(){return _0x44d752;};return a44_0xcc8e();}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x5e2674=a44_0x4ff0;return[{'name':_0x5e2674(0xbb),'type':_0x5e2674(0xcd),'description':_0x5e2674(0xc2),'required':!![]},{'name':_0x5e2674(0xa8),'type':_0x5e2674(0xc9),'description':_0x5e2674(0xbf),'default':![]},...getAppProfileFlagDefs()];}function a44_0x4ff0(_0x45d1cc,_0x8e973c){_0x45d1cc=_0x45d1cc-0xa8;const _0xcc8e14=a44_0xcc8e();let _0x4ff036=_0xcc8e14[_0x45d1cc];return _0x4ff036;}export function buildAppRemoveFlags(){const _0x11f44d=a44_0x4ff0;return[{'name':'global','type':_0x11f44d(0xc9),'description':_0x11f44d(0xbf),'default':![]}];}export async function validateAppName(_0x277062,_0x368b7c){const _0x6195be=a44_0x4ff0,_0x326c6b=_0x277062['args'][0x0]?.[_0x6195be(0xab)]();if(!_0x326c6b)throw CliErrors['validation'](_0x6195be(0xc7),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x368b7c+_0x6195be(0xb4));}export async function runAppAdd(_0x1ce533,_0x29c15d){const _0x213950=a44_0x4ff0,_0x4c7185=_0x1ce533[_0x213950(0xb8)][0x0]?.[_0x213950(0xab)]();if(!_0x4c7185)throw CliErrors[_0x213950(0xd2)]('Missing\x20app\x20name.',_0x213950(0xc1)+CLI_BIN_NAME+'\x20'+_0x29c15d+_0x213950(0xc3));const _0x1fd0bc=_0x1ce533[_0x213950(0xc5)](_0x213950(0xbb));if(!_0x1fd0bc)throw CliErrors[_0x213950(0xc8)](_0x213950(0xbb),_0x213950(0xc1)+CLI_BIN_NAME+'\x20'+_0x29c15d+_0x213950(0xc3));const _0x43f5f3={'global':_0x1ce533[_0x213950(0xbd)](_0x213950(0xa8))},_0x3383d8=readConfig(_0x43f5f3);if(!_0x3383d8[_0x213950(0xb3)])_0x3383d8['apps']={};const _0xcceea7={'appcode':_0x1fd0bc,...collectAppProfileOverrides(_0x3b6c04=>_0x1ce533[_0x213950(0xc5)](_0x3b6c04))},_0x5a4fd0=_0x3383d8[_0x213950(0xb3)],_0x4d2a95=!!_0x5a4fd0[_0x4c7185];_0x5a4fd0[_0x4c7185]=_0xcceea7;if(!_0x3383d8[_0x213950(0xbe)])_0x3383d8[_0x213950(0xbe)]=_0x4c7185;writeConfig(_0x3383d8,_0x43f5f3);const _0x21855d=!_0x4d2a95&&_0x3383d8[_0x213950(0xbe)]===_0x4c7185?_0x213950(0xb6):'',_0x36b3a6=(_0x4d2a95?_0x213950(0xb1):_0x213950(0xad))+_0x213950(0xba)+_0x4c7185+_0x213950(0xd0)+_0x1fd0bc+')'+scopeLabel(_0x43f5f3)+'.'+_0x21855d;return{'ok':!![],'message':_0x36b3a6};}export async function runAppRemove(_0x378810,_0x486294){const _0x348dbb=a44_0x4ff0,_0x1ca6d1=_0x378810['args'][0x0]?.[_0x348dbb(0xab)]();if(!_0x1ca6d1)throw CliErrors['validation'](_0x348dbb(0xc7),_0x348dbb(0xc1)+CLI_BIN_NAME+'\x20'+_0x486294+_0x348dbb(0xce));const _0x286e80=_0x378810[_0x348dbb(0xbd)](_0x348dbb(0xa8)),{config:_0x4381a1,layers:_0x27212b}=readRawConfigWithLayers(),_0xd4ded5=_0x4381a1[_0x348dbb(0xb3)]??{};if(!_0xd4ded5[_0x1ca6d1])throw CliErrors['validation'](_0x348dbb(0xbc)+_0x1ca6d1+_0x348dbb(0xaf));const _0x191e5f=_0x27212b[_0x348dbb(0xc0)][_0x348dbb(0xb3)]&&typeof _0x27212b['globalConfig'][_0x348dbb(0xb3)]===_0x348dbb(0xcc)?_0x27212b[_0x348dbb(0xc0)][_0x348dbb(0xb3)]:{},_0x1e2abe=_0x27212b[_0x348dbb(0xac)]['apps']&&typeof _0x27212b[_0x348dbb(0xac)][_0x348dbb(0xb3)]==='object'?_0x27212b[_0x348dbb(0xac)][_0x348dbb(0xb3)]:{},_0x1f3eae=appDefinedIn(_0x1ca6d1,_0x191e5f,_0x1e2abe,_0x27212b[_0x348dbb(0xac)][_0x348dbb(0xb5)]===![]),_0x4291c1=resolveAppScopeForWrite(_0x1ca6d1,_0x286e80,_0x27212b),_0x378d22={'global':_0x4291c1==='global'},_0x15ec0e=readConfig(_0x378d22),_0x129c00=_0x15ec0e['apps'];if(!_0x129c00||!_0x129c00[_0x1ca6d1])throw CliErrors[_0x348dbb(0xd2)](_0x348dbb(0xbc)+_0x1ca6d1+'\x22\x20not\x20found.');delete _0x129c00[_0x1ca6d1];let _0x1b76eb='';if(_0x15ec0e[_0x348dbb(0xbe)]===_0x1ca6d1){const _0x246fb1=Object[_0x348dbb(0xb7)](_0x129c00);_0x15ec0e['defaultApp']=_0x246fb1['length']>0x0?_0x246fb1[0x0]:undefined,_0x15ec0e[_0x348dbb(0xbe)]?_0x1b76eb=_0x348dbb(0xb9)+_0x15ec0e[_0x348dbb(0xbe)]+'\x22.':delete _0x15ec0e[_0x348dbb(0xbe)];}Object[_0x348dbb(0xb7)](_0x129c00)['length']===0x0&&(delete _0x15ec0e['apps'],delete _0x15ec0e['defaultApp']);writeConfig(_0x15ec0e,_0x378d22);const _0x46f1fc=_0x1f3eae==='both'?_0x348dbb(0xc6)+_0x1ca6d1+_0x348dbb(0xd1)+(_0x4291c1==='project'?'global':_0x348dbb(0xd5))+_0x348dbb(0xc4):'';return{'ok':!![],'message':_0x348dbb(0xd6)+_0x1ca6d1+'\x22'+scopeLabel(_0x378d22)+'.'+_0x1b76eb+_0x46f1fc};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4efaed,_0x55f56a){const _0x97e8a5=a45_0x2f90,_0x36fd02=_0x4efaed();while(!![]){try{const _0x410a8e=-parseInt(_0x97e8a5(0xc0))/0x1+parseInt(_0x97e8a5(0xc9))/0x2+-parseInt(_0x97e8a5(0xc5))/0x3+-parseInt(_0x97e8a5(0xcd))/0x4+-parseInt(_0x97e8a5(0xdf))/0x5+-parseInt(_0x97e8a5(0xd2))/0x6+-parseInt(_0x97e8a5(0xdb))/0x7*(-parseInt(_0x97e8a5(0xc1))/0x8);if(_0x410a8e===_0x55f56a)break;else _0x36fd02['push'](_0x36fd02['shift']());}catch(_0x58c456){_0x36fd02['push'](_0x36fd02['shift']());}}}(a45_0xfd5a,0x65bfa));import{input,checkbox,select}from'@inquirer/prompts';function a45_0xfd5a(){const _0x233120=['2585996hUTnnu','map','未找到可用应用。','✎\x20自定义输入\x20appcode','valid','1804542ekLoKa','yellow','无法获取远程应用列表,请手动输入。','trim','skip','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','✎\x20手动输入','获取到\x20','请选择要绑定的应用:','21OTLkBP','message','cyan','length','2510725OKxBMd','App\x20Code:','custom','605744GSTQJp','5785864hMjDKB','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','\x0a无法获取远程应用列表,请手动输入。','appCode','1181973psBbgm','find','Invalid\x20App\x20Code','正在获取可用应用列表...','1392398enzOrl','(跳过,稍后配置)','gray','\x0a未找到可用应用。'];a45_0xfd5a=function(){return _0x233120;};return a45_0xfd5a();}function a45_0x2f90(_0x53a32a,_0x5f447d){_0x53a32a=_0x53a32a-0xbf;const _0xfd5af9=a45_0xfd5a();let _0x2f907b=_0xfd5af9[_0x53a32a];return _0x2f907b;}import a45_0x3140a2 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 _0x4e4bc9=a45_0x2f90,_0x33cf32=await input({'message':'请输入\x20App\x20Code:','validate':_0x39db83=>{const _0x38be7f=a45_0x2f90,_0x23c4ac=validateAppcode(_0x39db83[_0x38be7f(0xd5)]());return _0x23c4ac[_0x38be7f(0xd1)]||_0x23c4ac[_0x38be7f(0xdc)]||_0x38be7f(0xc7);}});return _0x33cf32[_0x4e4bc9(0xd5)]();}export async function promptAppSelection(_0x3ab374){const _0x6e168a=a45_0x2f90,_0x3286dd=[{'name':a45_0x3140a2['yellow']('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x3ab374[_0x6e168a(0xce)]((_0x29c095,_0x272ab1)=>({'name':_0x29c095['appName']+'\x20\x20'+a45_0x3140a2[_0x6e168a(0xcb)]('('+_0x29c095[_0x6e168a(0xc4)]+')'),'value':_0x272ab1}))],_0x406ce7=await checkbox({'message':_0x6e168a(0xd9)+a45_0x3140a2[_0x6e168a(0xdd)](_0x3ab374[_0x6e168a(0xde)])+_0x6e168a(0xd7),'choices':_0x3286dd,'loop':![]});if(_0x406ce7['includes'](-0x1))return _0x6e168a(0xbf);if(_0x406ce7[_0x6e168a(0xde)]===0x0)return _0x6e168a(0xbf);return _0x406ce7[_0x6e168a(0xce)](_0x2c80a0=>_0x3ab374[_0x2c80a0]);}export async function promptSingleAppSelection(_0x3ba293){const _0x48668f=a45_0x2f90,_0x3d48d0=[{'name':a45_0x3140a2[_0x48668f(0xcb)](_0x48668f(0xc2)),'value':_0x48668f(0xd6)},{'name':a45_0x3140a2[_0x48668f(0xd3)](_0x48668f(0xd0)),'value':_0x48668f(0xbf)},..._0x3ba293['map'](_0x316916=>({'name':_0x316916['appName']+'\x20\x20'+a45_0x3140a2[_0x48668f(0xcb)]('('+_0x316916['appCode']+')'),'value':_0x316916[_0x48668f(0xc4)]}))],_0x11ca83=await select({'message':_0x48668f(0xda),'choices':_0x3d48d0});if(_0x11ca83===_0x48668f(0xd6))return _0x48668f(0xd6);if(_0x11ca83===_0x48668f(0xbf))return _0x48668f(0xbf);return _0x3ba293[_0x48668f(0xc6)](_0x4b9bbb=>_0x4b9bbb['appCode']===_0x11ca83);}export async function selectSingleAppcode(_0xa21a49){const _0x8a459c=a45_0x2f90;if(!_0xa21a49)return writeCliSideChannelLine(a45_0x3140a2[_0x8a459c(0xcb)]('(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)')),_fallbackOrSkip();writeCliSideChannelLine('正在获取可用应用列表...');let _0x241ed8;try{_0x241ed8=await withActiveCookie(_0xa21a49,()=>listRemoteApps());}catch(_0x4e7415){writeCliSideChannelLine(a45_0x3140a2[_0x8a459c(0xd3)](_0x8a459c(0xd4)));if(_0x4e7415 instanceof Error)writeCliSideChannelLine(a45_0x3140a2[_0x8a459c(0xcb)]('\x20\x20('+_0x4e7415['message']+')'));return _fallbackOrSkip();}if(_0x241ed8['length']===0x0)return writeCliSideChannelLine(a45_0x3140a2[_0x8a459c(0xd3)](_0x8a459c(0xcf))),_fallbackOrSkip();const _0x8fb5ff=await promptSingleAppSelection(_0x241ed8);if(_0x8fb5ff==='skip')return'';if(_0x8fb5ff===_0x8a459c(0xbf))return promptCustomAppcode();return _0x8fb5ff[_0x8a459c(0xc4)];}export async function selectMultipleApps(_0x1b0d7d){const _0x2373d4=a45_0x2f90;writeCliSideChannelLine(_0x2373d4(0xc8));let _0x47632d;try{_0x47632d=await withActiveCookie(_0x1b0d7d,()=>listRemoteApps());}catch(_0x26efc0){writeCliSideChannelLine(_0x2373d4(0xc3));if(_0x26efc0 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x26efc0[_0x2373d4(0xdc)]+')');return'custom';}if(_0x47632d[_0x2373d4(0xde)]===0x0)return writeCliSideChannelLine(_0x2373d4(0xcc)),_0x2373d4(0xbf);return promptAppSelection(_0x47632d);}async function _fallbackOrSkip(){const _0x1dd469=a45_0x2f90,_0x4df6b3=await select({'message':_0x1dd469(0xe0),'choices':[{'name':a45_0x3140a2[_0x1dd469(0xcb)](_0x1dd469(0xca)),'value':_0x1dd469(0xd6)},{'name':a45_0x3140a2[_0x1dd469(0xd3)](_0x1dd469(0xd8)),'value':'manual'}]});if(_0x4df6b3==='skip')return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x15a1c7=a46_0x3fb6;(function(_0x49abfd,_0x57e304){const _0x17d72d=a46_0x3fb6,_0x32d164=_0x49abfd();while(!![]){try{const _0x3387c4=-parseInt(_0x17d72d(0xbd))/0x1*(-parseInt(_0x17d72d(0xc0))/0x2)+parseInt(_0x17d72d(0xda))/0x3+parseInt(_0x17d72d(0xcf))/0x4+parseInt(_0x17d72d(0xd2))/0x5+-parseInt(_0x17d72d(0xd3))/0x6+-parseInt(_0x17d72d(0xc3))/0x7*(-parseInt(_0x17d72d(0xc1))/0x8)+-parseInt(_0x17d72d(0xbe))/0x9*(parseInt(_0x17d72d(0xd4))/0xa);if(_0x3387c4===_0x57e304)break;else _0x32d164['push'](_0x32d164['shift']());}catch(_0x32ff8d){_0x32d164['push'](_0x32d164['shift']());}}}(a46_0x1916,0x58758));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set(['SUCCESS',a46_0x15a1c7(0xd6)]),NON_TERMINAL_STATUSES=new Set([a46_0x15a1c7(0xd5),a46_0x15a1c7(0xd8)]);export function normalizeAsyncTask(_0x2857ad){const _0x28f5f2=a46_0x15a1c7,_0x24b835=typeof _0x2857ad?.['taskId']==='string'?_0x2857ad[_0x28f5f2(0xca)]['trim']():'';if(!_0x24b835)throw CliErrors[_0x28f5f2(0xcd)](_0x28f5f2(0xc8));const _0xe8013a=typeof _0x2857ad[_0x28f5f2(0xd0)]==='string'?_0x2857ad[_0x28f5f2(0xd0)][_0x28f5f2(0xcb)]()[_0x28f5f2(0xc2)]():'';if(!_0xe8013a)throw CliErrors[_0x28f5f2(0xcd)](_0x28f5f2(0xc9)+_0x24b835+_0x28f5f2(0xcc));return{'taskId':_0x24b835,'status':_0xe8013a,'errorMessage':typeof _0x2857ad[_0x28f5f2(0xbf)]===_0x28f5f2(0xc7)&&_0x2857ad['errorMessage'][_0x28f5f2(0xcb)]()?_0x2857ad[_0x28f5f2(0xbf)][_0x28f5f2(0xcb)]():null,'isTerminal':TERMINAL_STATUSES[_0x28f5f2(0xdb)](_0xe8013a),'knownStatus':TERMINAL_STATUSES['has'](_0xe8013a)||NON_TERMINAL_STATUSES[_0x28f5f2(0xdb)](_0xe8013a)};}export function buildAsyncTaskStatusCommand(_0xfad33b,_0x28ef6a){const _0x4730fc=a46_0x15a1c7;return CLI_BIN_NAME+'\x20task\x20status\x20--task-id\x20'+quoteShellArg(_0xfad33b)+'\x20--appcode\x20'+quoteShellArg(_0x28ef6a)+_0x4730fc(0xc4);}export function asyncTaskMessage(_0x5600f8){const _0x426f52=a46_0x15a1c7;switch(_0x5600f8[_0x426f52(0xd0)]){case _0x426f52(0xd5):return _0x426f52(0xd7)+_0x5600f8[_0x426f52(0xca)]+'\x20is\x20pending.';case'PROCESSING':return'Task\x20'+_0x5600f8[_0x426f52(0xca)]+_0x426f52(0xd9);case'SUCCESS':return _0x426f52(0xd7)+_0x5600f8[_0x426f52(0xca)]+'\x20completed\x20successfully.';case _0x426f52(0xd6):return _0x5600f8[_0x426f52(0xbf)]?'Task\x20'+_0x5600f8[_0x426f52(0xca)]+'\x20failed:\x20'+_0x5600f8[_0x426f52(0xbf)]:_0x426f52(0xd7)+_0x5600f8[_0x426f52(0xca)]+_0x426f52(0xc6);default:return'Task\x20'+_0x5600f8[_0x426f52(0xca)]+_0x426f52(0xd1)+_0x5600f8[_0x426f52(0xd0)]+'.';}}function quoteShellArg(_0x10ea38){const _0x589302=a46_0x15a1c7;return'\x27'+_0x10ea38[_0x589302(0xce)](/'/g,_0x589302(0xc5))+'\x27';}function a46_0x3fb6(_0x4aa1e5,_0x174589){_0x4aa1e5=_0x4aa1e5-0xbd;const _0x191654=a46_0x1916();let _0x3fb619=_0x191654[_0x4aa1e5];return _0x3fb619;}function a46_0x1916(){const _0x3696d8=['replace','2030088fFkGTJ','status','\x20returned\x20unknown\x20status\x20','3280710SLAUlT','533190ayJmnp','10KGtjWf','PENDING','FAILED','Task\x20','PROCESSING','\x20is\x20processing.','807930gEsvDT','has','1jmsomi','11370852dCoAJB','errorMessage','54886nUpqQn','32aNxdom','toUpperCase','444857VJtfUh','\x20--format\x20compress','\x27\x5c\x27\x27','\x20failed.','string','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','Async\x20task\x20','taskId','trim','\x20response\x20did\x20not\x20contain\x20a\x20status.','apiError'];a46_0x1916=function(){return _0x3696d8;};return a46_0x1916();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x146f(_0x42ba7b,_0x32a606){_0x42ba7b=_0x42ba7b-0xb0;var _0x3ff346=a47_0x3ff3();var _0x146fd9=_0x3ff346[_0x42ba7b];return _0x146fd9;}(function(_0x3e855b,_0x1b2aea){var _0x52ffbf=a47_0x146f,_0x210dec=_0x3e855b();while(!![]){try{var _0x30319f=parseInt(_0x52ffbf(0xb4))/0x1*(-parseInt(_0x52ffbf(0xb0))/0x2)+-parseInt(_0x52ffbf(0xbb))/0x3*(parseInt(_0x52ffbf(0xb2))/0x4)+-parseInt(_0x52ffbf(0xbe))/0x5*(-parseInt(_0x52ffbf(0xb1))/0x6)+parseInt(_0x52ffbf(0xb3))/0x7+-parseInt(_0x52ffbf(0xbd))/0x8*(parseInt(_0x52ffbf(0xb5))/0x9)+-parseInt(_0x52ffbf(0xb7))/0xa*(parseInt(_0x52ffbf(0xbf))/0xb)+parseInt(_0x52ffbf(0xbc))/0xc;if(_0x30319f===_0x1b2aea)break;else _0x210dec['push'](_0x210dec['shift']());}catch(_0x5555c6){_0x210dec['push'](_0x210dec['shift']());}}}(a47_0x3ff3,0x507f6));export function asDryRunResult(_0x57b3b0,_0x45ed98){var _0x5df886=a47_0x146f;return Object[_0x5df886(0xb8)](_0x57b3b0,{'method':{'value':_0x45ed98[_0x5df886(0xba)],'enumerable':![]},'url':{'value':_0x45ed98[_0x5df886(0xb6)],'enumerable':![]},..._0x45ed98[_0x5df886(0xb9)]?{'description':{'value':_0x45ed98[_0x5df886(0xb9)],'enumerable':![]}}:{}});}function a47_0x3ff3(){var _0x38553b=['description','method','209091gOPrOS','9399804JOMHXt','40bxYlOb','676745uzehmi','143ysFlqJ','1010cwvsBS','12Eaftjy','4aJuxDM','192612ZVGclW','518NfQxqw','168507WfQvfk','url','251470nbmtun','defineProperties'];a47_0x3ff3=function(){return _0x38553b;};return a47_0x3ff3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x57f27f=a48_0x3b6d;(function(_0x239070,_0x2df7df){const _0x4f4d47=a48_0x3b6d,_0x1ccdc1=_0x239070();while(!![]){try{const _0x3a234b=-parseInt(_0x4f4d47(0xd0))/0x1+parseInt(_0x4f4d47(0xd2))/0x2+parseInt(_0x4f4d47(0xcd))/0x3+parseInt(_0x4f4d47(0xd9))/0x4+parseInt(_0x4f4d47(0xd6))/0x5*(parseInt(_0x4f4d47(0xcf))/0x6)+-parseInt(_0x4f4d47(0xce))/0x7+parseInt(_0x4f4d47(0xc8))/0x8*(-parseInt(_0x4f4d47(0xca))/0x9);if(_0x3a234b===_0x2df7df)break;else _0x1ccdc1['push'](_0x1ccdc1['shift']());}catch(_0x199865){_0x1ccdc1['push'](_0x1ccdc1['shift']());}}}(a48_0x58b1,0x2c2bb));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a48_0x57f27f(0xd1)};function a48_0x3b6d(_0xab3875,_0x321001){_0xab3875=_0xab3875-0xc3;const _0x58b1aa=a48_0x58b1();let _0x3b6d9c=_0x58b1aa[_0xab3875];return _0x3b6d9c;}export const CODE_FLAG={'name':a48_0x57f27f(0xc6),'type':a48_0x57f27f(0xd8),'required':!![],'description':a48_0x57f27f(0xc4),'pattern':DATASET_CODE_PATTERN};function a48_0x58b1(){const _0x2fea28=['SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Dataset\x20code\x20(32-char\x20hex\x20UUID)','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','code','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','3600136UiYLxY','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','9pUXcqK','App\x20code\x20(e.g.\x20app-xxxxx)','number','848169gusfyJ','2282714SmiVBj','1663878ejbYMr','157021cSHdbI','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','470460sWklpT','dbtype','Database\x20product\x20type','POSTGRESQL','5GgYopr','MYSQL','string','1275188NsHSPx'];a48_0x58b1=function(){return _0x2fea28;};return a48_0x58b1();}export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a48_0x57f27f(0xc4)};export const SQLCODE_FLAG={'name':'sqlcode','type':a48_0x57f27f(0xd8),'required':!![],'description':a48_0x57f27f(0xc3),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x57f27f(0xc9)}};export const APPCODE_FLAG_OPTIONAL={'name':'appcode','type':a48_0x57f27f(0xd8),'required':![],'description':a48_0x57f27f(0xc5)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x57f27f(0xcb)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x57f27f(0xcc),'required':!![],'description':a48_0x57f27f(0xc7)};export const DB_TYPE_FLAG={'name':a48_0x57f27f(0xd3),'type':a48_0x57f27f(0xd8),'required':!![],'description':a48_0x57f27f(0xd4),'enum':[a48_0x57f27f(0xd7),a48_0x57f27f(0xd5)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a49_0x5912(_0x1231b3,_0x1fda25){_0x1231b3=_0x1231b3-0x16f;const _0x5e2e9a=a49_0x5e2e();let _0x591203=_0x5e2e9a[_0x1231b3];return _0x591203;}function a49_0x5e2e(){const _0x443274=['validation','File\x20is\x20not\x20a\x20regular\x20file:\x20','trim','ceil','11ewTEid','54MNtFmx','isFile','1DpTrze','312910gfHEdf','200412equacr','size','File\x20not\x20found:\x20','467112QbDKNW','885386PqyvjA','\x20MB','19698eVqbeT','96xgpRhi','452820PeqKXR','667608fnUbxa'];a49_0x5e2e=function(){return _0x443274;};return a49_0x5e2e();}(function(_0x2479d0,_0x3a90ab){const _0x52c47d=a49_0x5912,_0x6419ad=_0x2479d0();while(!![]){try{const _0x48200f=parseInt(_0x52c47d(0x176))/0x1*(parseInt(_0x52c47d(0x17c))/0x2)+parseInt(_0x52c47d(0x181))/0x3+parseInt(_0x52c47d(0x178))/0x4+-parseInt(_0x52c47d(0x180))/0x5+parseInt(_0x52c47d(0x17f))/0x6*(parseInt(_0x52c47d(0x17e))/0x7)+parseInt(_0x52c47d(0x17b))/0x8*(-parseInt(_0x52c47d(0x174))/0x9)+parseInt(_0x52c47d(0x177))/0xa*(-parseInt(_0x52c47d(0x173))/0xb);if(_0x48200f===_0x3a90ab)break;else _0x6419ad['push'](_0x6419ad['shift']());}catch(_0x1b558){_0x6419ad['push'](_0x6419ad['shift']());}}}(a49_0x5e2e,0x465a7));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x1d9c75){const _0x3813a3=a49_0x5912;if(_0x1d9c75>=BYTES_PER_MB){const _0x487c65=Math[_0x3813a3(0x172)](_0x1d9c75/BYTES_PER_MB*0x64)/0x64;return _0x487c65['toFixed'](0x2)+_0x3813a3(0x17d);}return _0x1d9c75+'\x20B';}export function requireDevelopmentUploadFile(_0x44f6d4,_0x35a666){const _0x514650=a49_0x5912,_0x313629=_0x44f6d4[_0x514650(0x171)]();if(!_0x313629)throw CliErrors['validation'](_0x35a666+'\x20path\x20is\x20required.');if(!existsSync(_0x313629))throw CliErrors['validation'](_0x514650(0x17a)+_0x313629);const _0x5bd1eb=statSync(_0x313629);if(!_0x5bd1eb[_0x514650(0x175)]())throw CliErrors[_0x514650(0x16f)](_0x514650(0x170)+_0x313629);if(_0x5bd1eb[_0x514650(0x179)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors['validation']('File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20'+_0x313629+'\x20('+formatBytes(_0x5bd1eb['size'])+')');return{'path':_0x313629,'size':_0x5bd1eb[_0x514650(0x179)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a50_0x5222(_0xcdb95a,_0x8197d1){_0xcdb95a=_0xcdb95a-0x1ca;const _0x2760e1=a50_0x2760();let _0x522268=_0x2760e1[_0xcdb95a];return _0x522268;}(function(_0x1fd7c2,_0x55da5){const _0x134f04=a50_0x5222,_0x2dca44=_0x1fd7c2();while(!![]){try{const _0x2563ac=-parseInt(_0x134f04(0x1d5))/0x1*(-parseInt(_0x134f04(0x1ce))/0x2)+-parseInt(_0x134f04(0x1d8))/0x3*(parseInt(_0x134f04(0x1cc))/0x4)+-parseInt(_0x134f04(0x1d6))/0x5+parseInt(_0x134f04(0x1d9))/0x6+-parseInt(_0x134f04(0x1d3))/0x7+parseInt(_0x134f04(0x1d7))/0x8+-parseInt(_0x134f04(0x1d0))/0x9*(-parseInt(_0x134f04(0x1d2))/0xa);if(_0x2563ac===_0x55da5)break;else _0x2dca44['push'](_0x2dca44['shift']());}catch(_0x4fd3b5){_0x2dca44['push'](_0x2dca44['shift']());}}}(a50_0x2760,0xa9f64));function a50_0x2760(){const _0x4bcc7d=['12ejJlVN','App\x20Code\x20cannot\x20exceed\x20100\x20characters','138076vjsBaJ','trim','1818KCPxri','App\x20Code\x20cannot\x20be\x20empty','29910gSkIKi','5217597ZYJXsD','test','1OagGhx','3436960hRMvPW','6494368IATaxh','300993ClBNkT','5669424MyCgQI','length','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'];a50_0x2760=function(){return _0x4bcc7d;};return a50_0x2760();}export function validateAppcode(_0x5d7752){const _0x447c5a=a50_0x5222,_0x1405d9=_0x5d7752[_0x447c5a(0x1cf)]();if(!_0x1405d9)return{'valid':![],'message':_0x447c5a(0x1d1)};if(_0x1405d9[_0x447c5a(0x1ca)]>0x64)return{'valid':![],'message':_0x447c5a(0x1cd)};if(!/^[A-Za-z0-9_-]+$/[_0x447c5a(0x1d4)](_0x1405d9))return{'valid':![],'message':_0x447c5a(0x1cb)};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x2dfc0b=a51_0x1ca5;(function(_0x57328e,_0x2dd503){const _0x43719b=a51_0x1ca5,_0x434712=_0x57328e();while(!![]){try{const _0x24f641=-parseInt(_0x43719b(0x108))/0x1+-parseInt(_0x43719b(0x117))/0x2*(parseInt(_0x43719b(0x103))/0x3)+parseInt(_0x43719b(0x10b))/0x4*(parseInt(_0x43719b(0x110))/0x5)+-parseInt(_0x43719b(0x112))/0x6*(parseInt(_0x43719b(0x10c))/0x7)+-parseInt(_0x43719b(0x10a))/0x8*(parseInt(_0x43719b(0x114))/0x9)+-parseInt(_0x43719b(0x115))/0xa+-parseInt(_0x43719b(0x10d))/0xb*(-parseInt(_0x43719b(0x111))/0xc);if(_0x24f641===_0x2dd503)break;else _0x434712['push'](_0x434712['shift']());}catch(_0x2f767d){_0x434712['push'](_0x434712['shift']());}}}(a51_0x37b4,0xf0ff7));function a51_0x1ca5(_0x5793c4,_0x53f302){_0x5793c4=_0x5793c4-0x100;const _0x37b430=a51_0x37b4();let _0x1ca54e=_0x37b430[_0x5793c4];return _0x1ca54e;}import{CliErrors}from'../../errors.js';function a51_0x37b4(){const _0x521d90=['get','Key\x20not\x20found:\x20','685wrwHUX','44929716RbWhTe','348qVBdQg','validation','81Bsthly','297790NNqJGj','string','158bIdPuh','app','read','key','30930qUjKCS','object','Get\x20a\x20config\x20value\x20by\x20key','appcode','Missing\x20key.','406891ckYAPv','str','1265848zbHrRu','36524zabdeu','160846jTHMem','11uAcjAJ'];a51_0x37b4=function(){return _0x521d90;};return a51_0x37b4();}import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x2da5e9){const _0x2f0972=a51_0x1ca5,_0x349610=_0x2da5e9[_0x2f0972(0x109)](_0x2f0972(0x102));if(!_0x349610)throw CliErrors['validation'](_0x2f0972(0x107),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20--key\x20<key>');const _0x935a02=readConfig(),_0x329ff2=_0x349610===_0x2f0972(0x100)?_0x2f0972(0x106):_0x349610,_0x547b20=_0x935a02[_0x329ff2];if(_0x547b20===undefined)throw CliErrors[_0x2f0972(0x113)](_0x2f0972(0x10f)+_0x349610);return{'ok':!![],'data':typeof _0x547b20===_0x2f0972(0x104)?_0x547b20:{[_0x329ff2]:_0x547b20},'message':typeof _0x547b20===_0x2f0972(0x104)?undefined:String(_0x547b20)};}export const configGetDefinition={'service':'config','command':a51_0x2dfc0b(0x10e),'description':a51_0x2dfc0b(0x105),'risk':a51_0x2dfc0b(0x101),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a51_0x2dfc0b(0x116),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|