@lovrabet/rabetbase-cli 2.3.14 → 2.3.15-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x44f73c=a36_0x5213;(function(_0x4eb81b,_0x5f48d6){const _0x3b90f6=a36_0x5213,_0x1948d1=_0x4eb81b();while(!![]){try{const _0x16859b=parseInt(_0x3b90f6(0xeb))/0x1*(-parseInt(_0x3b90f6(0xd1))/0x2)+parseInt(_0x3b90f6(0xdb))/0x3+-parseInt(_0x3b90f6(0x113))/0x4*(-parseInt(_0x3b90f6(0xf9))/0x5)+-parseInt(_0x3b90f6(0xdf))/0x6+parseInt(_0x3b90f6(0xd4))/0x7*(-parseInt(_0x3b90f6(0x105))/0x8)+-parseInt(_0x3b90f6(0xd7))/0x9+parseInt(_0x3b90f6(0xfb))/0xa*(parseInt(_0x3b90f6(0xdc))/0xb);if(_0x16859b===_0x5f48d6)break;else _0x1948d1['push'](_0x1948d1['shift']());}catch(_0x5e2c7d){_0x1948d1['push'](_0x1948d1['shift']());}}}(a36_0x482d,0xcca7a));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';function a36_0x482d(){const _0x4a3f0a=['scriptContent','COMMON','force','bool','Pull\x20complete:\x20','includes','lockKey','map','utf8','Force\x20overwrite\x20local\x20unsynced\x20changes','\x22\x20not\x20found\x20after\x20ensureLockScope.','25481jDQnUd','apiDir','HOOK','would_pull','Remote\x20script\x20missing\x20content.','alias','\x20skipped,\x20','ENDPOINT','all','apps','toLowerCase','type','message','functions','24435QZELYP','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','4123520IEtZrp','Remote\x20script\x20missing\x20id.','yes','&type=','local\x20unsynced\x20changes','conflict','trim','Would\x20inspect\x20','length','filePath','16RxyQVm','Pull\x20only\x20this\x20script\x20type','scriptType','hash','skipped','close','operationType','appCode','question','pull','functionNode','\x20failed','stdin','push','4ASNJkR','Force\x20pull\x20cancelled.','stringify','str','hookLocation','datasetCode','No\x20remote\x20BFF\x20scripts\x20found.','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','lastSync','22tztldg','cancelled','unresolvable\x20target\x20path','1830577XwbXBN','write','lockFilePath','12278493mPdUQD','nonInteractive','/api/management/library/scripts/list?appCode=','scriptsRoot','2107860HikkUc','77LZFNWq','functionName','\x20remote\x20BFF\x20script(s)\x20for\x20pull','3528690VrueEW'];a36_0x482d=function(){return _0x4a3f0a;};return a36_0x482d();}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a36_0x44f73c(0x10e),'description':a36_0x44f73c(0xfa),'risk':a36_0x44f73c(0xd5),'flags':[{'name':a36_0x44f73c(0xf6),'type':'string','description':a36_0x44f73c(0x106),'enum':[a36_0x44f73c(0xe1),a36_0x44f73c(0xf2),a36_0x44f73c(0xed)]},{'name':a36_0x44f73c(0xe2),'type':'boolean','description':a36_0x44f73c(0xe9)}],async 'dryRun'(_0x1d82ed){const _0x546025=a36_0x44f73c,_0x3e66fc=loadBffProjectConfig(_0x1d82ed['appCode']),_0x5cbade=await readBffLockFile(_0x3e66fc[_0x546025(0xd6)]),{appLock:_0x37c065}=ensureLockScope(_0x5cbade??createEmptyBffLock(),_0x1d82ed[_0x546025(0x10c)],_0x3e66fc[_0x546025(0xda)],_0x546025(0x10e)),_0x392b3c=normalizeBffType(_0x1d82ed[_0x546025(0xcb)](_0x546025(0xf6)))??undefined,_0x140682=buildDatasetCodeToAliasMap(_0x1d82ed[_0x546025(0xec)],_0x1d82ed['appCode']),[_0x5c2fe9,_0x304a70]=await Promise[_0x546025(0xf3)]([listBffScripts(_0x1d82ed[_0x546025(0x10c)],_0x392b3c),getBffScriptStatistics(_0x1d82ed['appCode'])]),_0x15b761=createHookLocationMap(_0x304a70),_0x5b1343=[];for(const _0xf84d82 of _0x5c2fe9){const _0x40eff9=resolveRemoteScriptTarget(_0x3e66fc,_0xf84d82,_0x15b761,_0x37c065[_0x546025(0xf8)],_0x140682);if(!_0x40eff9){_0x5b1343[_0x546025(0x112)]({'scriptType':_0xf84d82['scriptType'],'functionName':_0xf84d82[_0x546025(0xdd)]??'','status':_0x546025(0x109),'reason':_0x546025(0xd3)});continue;}const _0x171617=_0x37c065[_0x546025(0xf8)][_0x40eff9['lockKey']],_0x320cbd=_0xf84d82[_0x546025(0xe0)]!=null?computeContentHash(_0xf84d82[_0x546025(0xe0)]):undefined,_0x282502=await hasUnsyncedLocalChanges(_0x40eff9['filePath'],_0x171617,_0x320cbd);_0x5b1343['push']({'lockKey':_0x40eff9['lockKey'],'filePath':_0x40eff9[_0x546025(0x104)],'remoteId':_0xf84d82['id']??null,'status':_0x282502?_0x546025(0x100):_0x546025(0xee)});}return{'method':'GET','url':_0x546025(0xd9)+_0x1d82ed['appCode']+(_0x392b3c?_0x546025(0xfe)+_0x392b3c:''),'body':{'appCode':_0x1d82ed[_0x546025(0x10c)],'filterType':_0x392b3c??null,'files':_0x5b1343},'description':_0x546025(0x102)+_0x5b1343[_0x546025(0x103)]+_0x546025(0xde)};},async 'execute'(_0x169fdb){const _0x32fdd3=a36_0x44f73c,_0x512cd3=loadBffProjectConfig(_0x169fdb[_0x32fdd3(0x10c)]),_0x2fd807=await readBffLockFile(_0x512cd3[_0x32fdd3(0xd6)]),{lockData:_0x45d59b,appLock:_0x3f97f3}=ensureLockScope(_0x2fd807??createEmptyBffLock(),_0x169fdb['appCode'],_0x512cd3[_0x32fdd3(0xda)],_0x32fdd3(0x10e)),_0x6fc702=normalizeBffType(_0x169fdb['str'](_0x32fdd3(0xf6)))??undefined;if(_0x169fdb['str'](_0x32fdd3(0xf6))&&!_0x6fc702)throw CliErrors['validation'](_0x32fdd3(0xcf));const [_0x1b6754,_0x2f1d99]=await Promise[_0x32fdd3(0xf3)]([listBffScripts(_0x169fdb[_0x32fdd3(0x10c)],_0x6fc702),getBffScriptStatistics(_0x169fdb[_0x32fdd3(0x10c)])]);if(_0x1b6754[_0x32fdd3(0x103)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x32fdd3(0xce)};const _0x107d20=_0x169fdb[_0x32fdd3(0xe3)](_0x32fdd3(0xe2));if(_0x107d20&&!_0x169fdb[_0x32fdd3(0xd8)]){const _0x555d6b=await confirmForce();if(!_0x555d6b)throw CliErrors[_0x32fdd3(0xd2)](_0x32fdd3(0x114));}if(_0x107d20&&_0x169fdb['nonInteractive']){}const _0x1a8509=buildDatasetCodeToAliasMap(_0x169fdb[_0x32fdd3(0xec)],_0x169fdb[_0x32fdd3(0x10c)]),_0x39810f=createHookLocationMap(_0x2f1d99),_0x29ac6d=JSON['parse'](JSON[_0x32fdd3(0xca)](_0x45d59b)),_0x480a79=_0x169fdb['appCode'],_0x16b631=_0x29ac6d[_0x32fdd3(0xf4)][_0x480a79];if(!_0x16b631)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x480a79+_0x32fdd3(0xea));const _0x14b7f3=[],_0x5e8e29=[],_0x59a6ea=[];for(const _0x27ff9b of _0x1b6754){const _0x1b497f=resolveRemoteScriptTarget(_0x512cd3,_0x27ff9b,_0x39810f,_0x3f97f3[_0x32fdd3(0xf8)],_0x1a8509);if(!_0x1b497f){_0x5e8e29[_0x32fdd3(0x112)]({'lockKey':_0x27ff9b[_0x32fdd3(0x107)]+'/'+_0x27ff9b[_0x32fdd3(0xdd)],'reason':_0x32fdd3(0xd3)});continue;}const _0x9ac62=_0x3f97f3[_0x32fdd3(0xf8)][_0x1b497f['lockKey']];try{if(!_0x27ff9b['id'])throw new Error(_0x32fdd3(0xfc));if(_0x27ff9b['scriptContent']==null)throw new Error(_0x32fdd3(0xef));const _0x266b36=_0x27ff9b[_0x32fdd3(0xe0)],_0xed31e0=computeContentHash(_0x266b36);if(!_0x107d20){const _0x47a165=await hasUnsyncedLocalChanges(_0x1b497f[_0x32fdd3(0x104)],_0x9ac62,_0xed31e0);if(_0x47a165){_0x5e8e29[_0x32fdd3(0x112)]({'lockKey':_0x1b497f[_0x32fdd3(0xe6)],'reason':_0x32fdd3(0xff)});continue;}}await ensureParentDirectory(_0x1b497f['filePath']),await writeFile(_0x1b497f[_0x32fdd3(0x104)],_0x266b36,_0x32fdd3(0xe8));const _0x53c14c={'hash':_0xed31e0,'remoteId':_0x27ff9b['id'],'version':_0x27ff9b['version']};_0x1b497f[_0x32fdd3(0xf6)]===_0x32fdd3(0xed)&&_0x1b497f['hookLocation']&&(_0x53c14c['alias']=_0x1b497f[_0x32fdd3(0xcc)][_0x32fdd3(0xf0)],_0x53c14c[_0x32fdd3(0xcd)]=_0x1b497f[_0x32fdd3(0xcc)]['datasetCode'],_0x53c14c['operationType']=_0x1b497f[_0x32fdd3(0xcc)][_0x32fdd3(0x10b)],_0x53c14c[_0x32fdd3(0x10f)]=_0x1b497f['hookLocation']['functionNode']),_0x16b631[_0x32fdd3(0xf8)][_0x1b497f[_0x32fdd3(0xe6)]]=_0x53c14c,_0x14b7f3[_0x32fdd3(0x112)]({'lockKey':_0x1b497f['lockKey'],'remoteId':_0x27ff9b['id']});}catch(_0x3152ec){_0x59a6ea[_0x32fdd3(0x112)]({'lockKey':_0x1b497f[_0x32fdd3(0xe6)],'error':_0x3152ec instanceof Error?_0x3152ec[_0x32fdd3(0xf7)]:String(_0x3152ec)});}}return _0x16b631[_0x32fdd3(0xd0)]=new Date()['toISOString'](),await writeBffLockFile(_0x512cd3[_0x32fdd3(0xd6)],_0x29ac6d),{'ok':_0x59a6ea[_0x32fdd3(0x103)]===0x0,'data':{'pulled':_0x14b7f3,'skipped':_0x5e8e29,'failed':_0x59a6ea},'message':_0x32fdd3(0xe4)+_0x14b7f3[_0x32fdd3(0x103)]+'\x20pulled,\x20'+_0x5e8e29['length']+_0x32fdd3(0xf1)+_0x59a6ea[_0x32fdd3(0x103)]+_0x32fdd3(0x110)};}};async function hasUnsyncedLocalChanges(_0x5483fc,_0x2eb72e,_0x474acf){const _0x27425f=a36_0x44f73c;if(!await fileExists(_0x5483fc))return![];const _0x31adfc=await computeFileHash(_0x5483fc);if(!_0x2eb72e)return _0x474acf?_0x31adfc!==_0x474acf:!![];return _0x31adfc!==_0x2eb72e[_0x27425f(0x108)];}function a36_0x5213(_0x9d049e,_0x453c47){_0x9d049e=_0x9d049e-0xca;const _0x482d50=a36_0x482d();let _0x52139d=_0x482d50[_0x9d049e];return _0x52139d;}function buildDatasetCodeToAliasMap(_0x5d3269,_0x5f3ea5){const _0x4cff3f=a36_0x44f73c,_0x414174=loadAliasMap(_0x5d3269,undefined,resolveApiFilePath(_0x5d3269,_0x5f3ea5));return new Map(_0x414174[_0x4cff3f(0xe7)](_0x512591=>[_0x512591[_0x4cff3f(0xcd)],_0x512591['alias']]));}async function confirmForce(){const _0x41fd7e=a36_0x44f73c,_0x22c720=createInterface({'input':process[_0x41fd7e(0x111)],'output':process['stderr']}),_0x13fbda=await new Promise(_0x2ef2ea=>{const _0x268420=_0x41fd7e;_0x22c720[_0x268420(0x10d)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x2ef2ea);});return _0x22c720[_0x41fd7e(0x10a)](),['y',_0x41fd7e(0xfd)][_0x41fd7e(0xe5)](_0x13fbda[_0x41fd7e(0x101)]()[_0x41fd7e(0xf5)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x17d35d=a37_0x5c82;(function(_0x36513b,_0x4cf594){const _0x53525b=a37_0x5c82,_0x24e446=_0x36513b();while(!![]){try{const _0x22d75e=-parseInt(_0x53525b(0x130))/0x1+parseInt(_0x53525b(0x168))/0x2+-parseInt(_0x53525b(0x144))/0x3*(parseInt(_0x53525b(0x145))/0x4)+parseInt(_0x53525b(0x12c))/0x5+parseInt(_0x53525b(0x120))/0x6+-parseInt(_0x53525b(0x155))/0x7*(-parseInt(_0x53525b(0x13e))/0x8)+-parseInt(_0x53525b(0x128))/0x9;if(_0x22d75e===_0x4cf594)break;else _0x24e446['push'](_0x24e446['shift']());}catch(_0x1fa545){_0x24e446['push'](_0x24e446['shift']());}}}(a37_0xbbd0,0x486c6));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';function a37_0xbbd0(){const _0x511084=['boolean','Push\x20local\x20BFF\x20scripts\x20to\x20remote','16bllavX','\x22\x20not\x20found\x20after\x20ensureLockScope.','No\x20local\x20BFF\x20functions\x20found.','lockFilePath',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','utf8','264ViGrmM','13332baySgU','POST','lastSync','filter','cleared','toISOString','type','join','apiDir','remoteId','\x20failed,\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','Incomplete\x20HOOK\x20path:\x20','datasetCode','version','scriptsRoot','1425725AxRKyW','functionNode','force','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','appCode','validation','map','set','operationType','HOOK','alias','unchanged','datasetId','functions','\x20uploaded,\x20','would_push','runtime\x20cache\x20clear\x20failed','Runtime\x20script\x20cache\x20cleared.','create','246214NYAdxF','runtime\x20cache\x20cleared','Lock\x20scope\x20for\x20app\x20\x22','Would\x20inspect\x20','stringify','2529018IwagVn','filePath','name','length','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','lockKey','bool','Force\x20push\x20ignoring\x20hash\x20protection','1980423WxeXKr','get','aliasToDatasetCode','string','1381580tsAgCe','str','message','some','418279LgFGsK','status','high-risk-write','hash','Push\x20complete:\x20','push','Cannot\x20resolve\x20dataset\x20for\x20\x22','description','Push\x20only\x20this\x20script\x20type','values','runtime\x20cache\x20not\x20needed','has'];a37_0xbbd0=function(){return _0x511084;};return a37_0xbbd0();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a37_0x17d35d(0x13d),'risk':a37_0x17d35d(0x132),'flags':[{'name':a37_0x17d35d(0x14b),'type':a37_0x17d35d(0x12b),'description':a37_0x17d35d(0x138),'enum':['COMMON','ENDPOINT',a37_0x17d35d(0x15e)]},{'name':a37_0x17d35d(0x122),'type':a37_0x17d35d(0x12b),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x17d35d(0x157),'type':a37_0x17d35d(0x13c),'description':a37_0x17d35d(0x127)}],async 'dryRun'(_0x244863){const _0x38528c=a37_0x17d35d,_0x12012f=loadBffProjectConfig(_0x244863[_0x38528c(0x159)]),_0x5ae03c=await readBffLockFile(_0x12012f[_0x38528c(0x141)]),{appLock:_0x11ea91}=ensureLockScope(_0x5ae03c??createEmptyBffLock(),_0x244863[_0x38528c(0x159)],_0x12012f['scriptsRoot'],_0x38528c(0x135)),_0x5f1af4=await getTargetFunctions(_0x12012f,_0x244863),_0x357b93=_0x244863[_0x38528c(0x126)]('force'),_0x366f77=[];for(const _0x8ab38 of _0x5f1af4){const _0x509771=await computeFileHash(_0x8ab38[_0x38528c(0x121)]),_0x335f52=_0x11ea91[_0x38528c(0x162)][_0x8ab38[_0x38528c(0x125)]],_0x118bf3=!!_0x335f52&&_0x335f52[_0x38528c(0x133)]===_0x509771;_0x366f77[_0x38528c(0x135)]({'lockKey':_0x8ab38['lockKey'],'filePath':_0x8ab38[_0x38528c(0x121)],'remoteId':_0x335f52?.[_0x38528c(0x14e)]??null,'mode':_0x335f52?.[_0x38528c(0x14e)]?'update':_0x38528c(0x167),'status':!_0x357b93&&_0x118bf3?_0x38528c(0x160):'would_push'});}return{'method':_0x38528c(0x146),'url':'/api/management/library/scripts/save','body':{'appCode':_0x244863[_0x38528c(0x159)],'force':_0x357b93,'files':_0x366f77,'cacheClearAtRuntime':_0x366f77[_0x38528c(0x12f)](_0x33b6ac=>_0x33b6ac[_0x38528c(0x131)]==='would_push'),'cacheClearAtRuntimeTimes':_0x366f77[_0x38528c(0x12f)](_0x4290d5=>_0x4290d5[_0x38528c(0x131)]===_0x38528c(0x164))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x38528c(0x16b)+_0x366f77['length']+_0x38528c(0x158)};},async 'execute'(_0x187d69){const _0x3698db=a37_0x17d35d,_0x158191=loadBffProjectConfig(_0x187d69['appCode']),_0x3f3491=await readBffLockFile(_0x158191[_0x3698db(0x141)]),{lockData:_0x1d6ce4,appLock:_0xb94041}=ensureLockScope(_0x3f3491??createEmptyBffLock(),_0x187d69[_0x3698db(0x159)],_0x158191[_0x3698db(0x154)],_0x3698db(0x135)),_0x13d673=await getTargetFunctions(_0x158191,_0x187d69);if(_0x13d673[_0x3698db(0x123)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x3698db(0x140)};const _0x3f88f9=_0x187d69[_0x3698db(0x126)](_0x3698db(0x157)),_0x18408c=JSON['parse'](JSON[_0x3698db(0x11f)](_0x1d6ce4)),_0x2df86e=_0x18408c['apps'][_0x187d69[_0x3698db(0x159)]];if(!_0x2df86e)throw new Error(_0x3698db(0x16a)+_0x187d69[_0x3698db(0x159)]+_0x3698db(0x13f));const _0x40ec84=await buildHookMaps(_0x187d69['appCode'],_0x187d69[_0x3698db(0x14d)],_0x13d673,_0x2df86e),_0x2ed958=[],_0x301fc3=[],_0x4830e3=[];for(const _0x523ad6 of _0x13d673){const _0x1fecab=await computeFileHash(_0x523ad6[_0x3698db(0x121)]),_0x342392=_0x2df86e['functions'][_0x523ad6[_0x3698db(0x125)]];if(!_0x3f88f9&&_0x342392&&_0x342392[_0x3698db(0x133)]===_0x1fecab){_0x301fc3[_0x3698db(0x135)]({'lockKey':_0x523ad6[_0x3698db(0x125)],'reason':_0x3698db(0x160)});continue;}try{await uploadSingleFunction(_0x187d69[_0x3698db(0x159)],_0x523ad6,_0x2df86e,_0x40ec84);const _0x1557d1=_0x2df86e[_0x3698db(0x162)][_0x523ad6[_0x3698db(0x125)]];_0x2ed958['push']({'lockKey':_0x523ad6[_0x3698db(0x125)],'remoteId':_0x1557d1?.[_0x3698db(0x14e)]??0x0});}catch(_0x5dbece){_0x4830e3[_0x3698db(0x135)]({'lockKey':_0x523ad6['lockKey'],'error':_0x5dbece instanceof Error?_0x5dbece[_0x3698db(0x12e)]:String(_0x5dbece)});}}_0x2df86e[_0x3698db(0x147)]=new Date()[_0x3698db(0x14a)](),await writeBffLockFile(_0x158191[_0x3698db(0x141)],_0x18408c),await waitForUploadedLockEntries(_0x158191[_0x3698db(0x141)],_0x187d69[_0x3698db(0x159)],_0x2ed958[_0x3698db(0x15b)](_0x3c7272=>_0x3c7272[_0x3698db(0x125)]));let _0x1e393f={'attempted':![],'cleared':![]};if(_0x2ed958[_0x3698db(0x123)]>0x0)try{let _0xfe835c='';for(let _0x41738b=0x0;_0x41738b<CACHE_CLEAR_ATTEMPTS;_0x41738b+=0x1){_0xfe835c=await clearBffScriptCache(),_0x41738b<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x1e393f={'attempted':!![],'cleared':!![],'message':_0xfe835c||_0x3698db(0x166)};}catch(_0x20a81b){_0x1e393f={'attempted':!![],'cleared':![],'error':_0x20a81b instanceof Error?_0x20a81b['message']:String(_0x20a81b)};}const _0x429dd8=_0x4830e3[_0x3698db(0x123)]===0x0&&(_0x1e393f['attempted']?_0x1e393f[_0x3698db(0x149)]:!![]),_0xb70c28=_0x1e393f['attempted']?_0x1e393f['cleared']?_0x3698db(0x169):_0x3698db(0x165):_0x3698db(0x13a);return{'ok':_0x429dd8,'data':{'uploaded':_0x2ed958,'skipped':_0x301fc3,'failed':_0x4830e3,'cacheClear':_0x1e393f},'message':_0x3698db(0x134)+_0x2ed958['length']+_0x3698db(0x163)+_0x301fc3[_0x3698db(0x123)]+'\x20skipped,\x20'+_0x4830e3[_0x3698db(0x123)]+_0x3698db(0x14f)+_0xb70c28};}};async function getTargetFunctions(_0x2e3777,_0x435e27){const _0x89cf21=a37_0x17d35d,_0xbb18dc=_0x435e27[_0x89cf21(0x12d)](_0x89cf21(0x14b)),_0x43195e=_0x435e27['str'](_0x89cf21(0x122)),_0x4db867=normalizeBffType(_0xbb18dc)??undefined;if(_0x43195e&&!_0x4db867)throw CliErrors[_0x89cf21(0x15a)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4fb8bf=await scanLocalBffFunctions(_0x2e3777,_0x4db867);if(_0x43195e){const _0xb57219=_0x4fb8bf[_0x89cf21(0x148)](_0x588a71=>_0x588a71[_0x89cf21(0x122)]===_0x43195e);if(_0xb57219[_0x89cf21(0x123)]===0x0)throw CliErrors['validation']('Local\x20function\x20not\x20found:\x20'+_0x4db867+'/'+_0x43195e);return _0xb57219;}return _0x4fb8bf;}async function buildHookMaps(_0x54f62e,_0x4a69d9,_0x7f759a,_0x5cbb9d){const _0xbce6da=a37_0x17d35d,_0x3c1424=_0x7f759a[_0xbce6da(0x12f)](_0x4ca358=>_0x4ca358[_0xbce6da(0x14b)]===_0xbce6da(0x15e));if(!_0x3c1424)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xfc631f=loadAliasMap(_0x4a69d9,undefined,resolveApiFilePath(_0x4a69d9,_0x54f62e)),_0x56c953=new Map(_0xfc631f[_0xbce6da(0x15b)](_0x15a8ee=>[_0x15a8ee[_0xbce6da(0x15f)],_0x15a8ee['datasetCode']]));for(const _0x4fb243 of Object[_0xbce6da(0x139)](_0x5cbb9d[_0xbce6da(0x162)])){_0x4fb243['alias']&&_0x4fb243['datasetCode']&&!_0x56c953[_0xbce6da(0x13b)](_0x4fb243[_0xbce6da(0x15f)])&&_0x56c953[_0xbce6da(0x15c)](_0x4fb243[_0xbce6da(0x15f)],_0x4fb243[_0xbce6da(0x152)]);}const _0x1dbc0d=await listDatasets(_0x54f62e),_0x51057b=new Map(_0x1dbc0d[_0xbce6da(0x15b)](_0x1717f2=>[_0x1717f2['code'],_0x1717f2]));return{'aliasToDatasetCode':_0x56c953,'datasetCodeToDataset':_0x51057b};}function a37_0x5c82(_0x56903e,_0x3332cc){_0x56903e=_0x56903e-0x11f;const _0xbbd09f=a37_0xbbd0();let _0x5c8216=_0xbbd09f[_0x56903e];return _0x5c8216;}async function uploadSingleFunction(_0x472904,_0x406e10,_0x1a6c5d,_0x495aa2){const _0x11175f=a37_0x17d35d,_0x53fa77=await readFile(_0x406e10[_0x11175f(0x121)],_0x11175f(0x143)),_0x2c155e=await computeFileHash(_0x406e10[_0x11175f(0x121)]),_0x41911f=_0x1a6c5d[_0x11175f(0x162)][_0x406e10[_0x11175f(0x125)]];if(_0x41911f?.[_0x11175f(0x14e)]&&_0x41911f['version']==null)throw CliErrors[_0x11175f(0x15a)](_0x406e10[_0x11175f(0x125)]+_0x11175f(0x142));let _0x146655=extractScriptDescription(_0x53fa77);if(!_0x146655&&_0x41911f?.[_0x11175f(0x14e)]){const _0x42867e=await getBffScriptInfo(_0x41911f[_0x11175f(0x14e)]);_0x146655=_0x42867e[_0x11175f(0x137)]||undefined;}const _0x315beb={'appCode':_0x472904,'functionName':_0x406e10[_0x11175f(0x122)],'scriptType':_0x406e10[_0x11175f(0x14b)],'scriptContent':_0x53fa77};if(_0x41911f?.[_0x11175f(0x14e)])_0x315beb['id']=_0x41911f['remoteId'];if(_0x41911f?.[_0x11175f(0x153)]!=null)_0x315beb['version']=_0x41911f['version'];if(_0x146655)_0x315beb['description']=_0x146655;if(_0x406e10[_0x11175f(0x14b)]===_0x11175f(0x15e)){const _0x899677=_0x406e10[_0x11175f(0x15f)];if(!_0x899677||!_0x406e10['operationType']||!_0x406e10[_0x11175f(0x156)])throw CliErrors[_0x11175f(0x15a)](_0x11175f(0x151)+_0x406e10[_0x11175f(0x125)]);const _0x4e3246=_0x495aa2[_0x11175f(0x12a)][_0x11175f(0x129)](_0x899677)??_0x41911f?.['datasetCode']??_0x899677,_0x3de57a=_0x495aa2['datasetCodeToDataset'][_0x11175f(0x129)](_0x4e3246);if(!_0x3de57a)throw CliErrors['validation'](_0x11175f(0x136)+_0x899677+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x11175f(0x124)));_0x315beb[_0x11175f(0x161)]=_0x3de57a['id'],_0x315beb[_0x11175f(0x15d)]=_0x406e10[_0x11175f(0x15d)],_0x315beb[_0x11175f(0x156)]=_0x406e10[_0x11175f(0x156)];}const _0x273753=await saveBffScript(_0x315beb),_0x50c055=_0x273753['id'],_0x79e803=_0x273753['script']??await getBffScriptInfo(_0x50c055),_0x43a8ec={'hash':_0x2c155e,'remoteId':_0x50c055,'version':_0x79e803[_0x11175f(0x153)]};if(_0x406e10[_0x11175f(0x14b)]===_0x11175f(0x15e)){const _0x4fed8a=_0x406e10['alias'],_0xe3db89=_0x495aa2['aliasToDatasetCode'][_0x11175f(0x129)](_0x4fed8a)??_0x41911f?.[_0x11175f(0x152)]??_0x4fed8a;_0x495aa2[_0x11175f(0x12a)][_0x11175f(0x13b)](_0x4fed8a)?_0x43a8ec[_0x11175f(0x15f)]=_0x4fed8a:_0x43a8ec[_0x11175f(0x15f)]=_0x41911f?.[_0x11175f(0x15f)],_0x43a8ec[_0x11175f(0x152)]=_0xe3db89,_0x43a8ec['operationType']=_0x406e10['operationType'],_0x43a8ec[_0x11175f(0x156)]=_0x406e10[_0x11175f(0x156)];}_0x1a6c5d[_0x11175f(0x162)][_0x406e10[_0x11175f(0x125)]]=_0x43a8ec;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x286b38,_0x294aca,_0x4cdb71){const _0x22d696=a37_0x17d35d;if(_0x4cdb71[_0x22d696(0x123)]===0x0)return;for(let _0x494914=0x0;_0x494914<LOCK_SETTLE_RETRY_COUNT;_0x494914+=0x1){const _0x1df949=await readBffLockFile(_0x286b38),_0x2ad06a=_0x1df949?.['apps']?.[_0x294aca]?.[_0x22d696(0x162)]??{},_0x33bd0b=_0x4cdb71['every'](_0x1a5075=>!!_0x2ad06a[_0x1a5075]?.[_0x22d696(0x14e)]);if(_0x33bd0b)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x22d696(0x150)+_0x4cdb71[_0x22d696(0x14c)](',\x20')+'.');}
|
|
1
|
+
const a37_0xd26f8c=a37_0x196b;(function(_0x19422a,_0x1921b5){const _0x269a82=a37_0x196b,_0x484d09=_0x19422a();while(!![]){try{const _0x41e06d=-parseInt(_0x269a82(0x18d))/0x1*(-parseInt(_0x269a82(0x1ac))/0x2)+parseInt(_0x269a82(0x1cb))/0x3+-parseInt(_0x269a82(0x19f))/0x4+-parseInt(_0x269a82(0x1b3))/0x5+-parseInt(_0x269a82(0x1b2))/0x6*(parseInt(_0x269a82(0x1a3))/0x7)+-parseInt(_0x269a82(0x1a8))/0x8+parseInt(_0x269a82(0x1cf))/0x9*(parseInt(_0x269a82(0x190))/0xa);if(_0x41e06d===_0x1921b5)break;else _0x484d09['push'](_0x484d09['shift']());}catch(_0x43902c){_0x484d09['push'](_0x484d09['shift']());}}}(a37_0xf10f,0xc990b));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a37_0xf10f(){const _0xb57916=['--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','4250869kCgnHb','join','functions','\x20failed,\x20','\x20skipped,\x20','8463808bvFaso','Local\x20function\x20not\x20found:\x20','apps','get','13724KCZvwf','str','some','ENDPOINT','COMMON','scriptsRoot','12rVXLgd','4788555YrGPWm','appCode','hash','description','lockFilePath','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','HOOK','boolean','version','would_push','update','force','length','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','bff','Push\x20local\x20BFF\x20scripts\x20to\x20remote','status','parse','name','functionNode','values','push','apiDir','message','4368453RWRemq','map','Force\x20push\x20ignoring\x20hash\x20protection','lastSync','805941mqeEsX','alias','datasetCodeToDataset',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','stringify','has','type','No\x20local\x20BFF\x20functions\x20found.','attempted','aliasToDatasetCode','validation','Incomplete\x20HOOK\x20path:\x20','operationType','137TLrYTn','Cannot\x20resolve\x20dataset\x20for\x20\x22','create','250geidHV','\x22.\x20','runtime\x20cache\x20cleared','string','datasetCode','cleared','POST','/api/management/library/scripts/save','unchanged','Run\x20`','Push\x20complete:\x20','filter','toISOString','lockKey','filePath','2316552anRGGi','remoteId','every'];a37_0xf10f=function(){return _0xb57916;};return a37_0xf10f();}const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0xd26f8c(0x1c1),'command':a37_0xd26f8c(0x1c8),'description':a37_0xd26f8c(0x1c2),'risk':'high-risk-write','flags':[{'name':a37_0xd26f8c(0x186),'type':a37_0xd26f8c(0x193),'description':'Push\x20only\x20this\x20script\x20type','enum':[a37_0xd26f8c(0x1b0),a37_0xd26f8c(0x1af),'HOOK']},{'name':a37_0xd26f8c(0x1c5),'type':a37_0xd26f8c(0x193),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0xd26f8c(0x1be),'type':a37_0xd26f8c(0x1ba),'description':a37_0xd26f8c(0x1cd)}],async 'dryRun'(_0x581f1b){const _0x1952fe=a37_0xd26f8c,_0x57be17=loadBffProjectConfig(_0x581f1b[_0x1952fe(0x1b4)]),_0x9fe7b9=await readBffLockFile(_0x57be17[_0x1952fe(0x1b7)]),{appLock:_0x50e41d}=ensureLockScope(_0x9fe7b9??createEmptyBffLock(),_0x581f1b[_0x1952fe(0x1b4)],_0x57be17[_0x1952fe(0x1b1)],'push'),_0x23bc8a=await getTargetFunctions(_0x57be17,_0x581f1b),_0x269aab=_0x581f1b['bool'](_0x1952fe(0x1be)),_0x39bdb6=[];for(const _0x544c07 of _0x23bc8a){const _0x31ce98=await computeFileHash(_0x544c07[_0x1952fe(0x19e)]),_0x1c8c7b=_0x50e41d[_0x1952fe(0x1a5)][_0x544c07[_0x1952fe(0x19d)]],_0x5e19c0=!!_0x1c8c7b&&_0x1c8c7b[_0x1952fe(0x1b5)]===_0x31ce98;_0x39bdb6[_0x1952fe(0x1c8)]({'lockKey':_0x544c07[_0x1952fe(0x19d)],'filePath':_0x544c07['filePath'],'remoteId':_0x1c8c7b?.[_0x1952fe(0x1a0)]??null,'mode':_0x1c8c7b?.['remoteId']?_0x1952fe(0x1bd):_0x1952fe(0x18f),'status':!_0x269aab&&_0x5e19c0?_0x1952fe(0x198):_0x1952fe(0x1bc)});}return{'method':_0x1952fe(0x196),'url':_0x1952fe(0x197),'body':{'appCode':_0x581f1b['appCode'],'force':_0x269aab,'files':_0x39bdb6,'cacheClearAtRuntime':_0x39bdb6[_0x1952fe(0x1ae)](_0x249d9a=>_0x249d9a[_0x1952fe(0x1c3)]===_0x1952fe(0x1bc)),'cacheClearAtRuntimeTimes':_0x39bdb6[_0x1952fe(0x1ae)](_0x2c842e=>_0x2c842e[_0x1952fe(0x1c3)]===_0x1952fe(0x1bc))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x39bdb6[_0x1952fe(0x1bf)]+_0x1952fe(0x1b8)};},async 'execute'(_0x1683a5){const _0x2cb05e=a37_0xd26f8c,_0x5814ef=loadBffProjectConfig(_0x1683a5[_0x2cb05e(0x1b4)]),_0x405d0c=await readBffLockFile(_0x5814ef[_0x2cb05e(0x1b7)]),{lockData:_0x4dcd41,appLock:_0xe7d48b}=ensureLockScope(_0x405d0c??createEmptyBffLock(),_0x1683a5['appCode'],_0x5814ef[_0x2cb05e(0x1b1)],'push'),_0x5c57c8=await getTargetFunctions(_0x5814ef,_0x1683a5);if(_0x5c57c8[_0x2cb05e(0x1bf)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2cb05e(0x187)};const _0x2a92c2=_0x1683a5['bool'](_0x2cb05e(0x1be)),_0x3c5d84=JSON[_0x2cb05e(0x1c4)](JSON[_0x2cb05e(0x184)](_0x4dcd41)),_0x464f28=_0x3c5d84['apps'][_0x1683a5[_0x2cb05e(0x1b4)]];if(!_0x464f28)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1683a5[_0x2cb05e(0x1b4)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x3e1955=await buildHookMaps(_0x1683a5[_0x2cb05e(0x1b4)],_0x1683a5[_0x2cb05e(0x1c9)],_0x5c57c8,_0x464f28),_0x2ffe21=[],_0x42eb83=[],_0x46c22f=[];for(const _0x1f56bc of _0x5c57c8){const _0x296637=await computeFileHash(_0x1f56bc[_0x2cb05e(0x19e)]),_0x1832d1=_0x464f28[_0x2cb05e(0x1a5)][_0x1f56bc['lockKey']];if(!_0x2a92c2&&_0x1832d1&&_0x1832d1[_0x2cb05e(0x1b5)]===_0x296637){_0x42eb83[_0x2cb05e(0x1c8)]({'lockKey':_0x1f56bc['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x1683a5['appCode'],_0x1f56bc,_0x464f28,_0x3e1955);const _0x3adef8=_0x464f28[_0x2cb05e(0x1a5)][_0x1f56bc[_0x2cb05e(0x19d)]];_0x2ffe21[_0x2cb05e(0x1c8)]({'lockKey':_0x1f56bc['lockKey'],'remoteId':_0x3adef8?.[_0x2cb05e(0x1a0)]??0x0});}catch(_0x9505f6){_0x46c22f['push']({'lockKey':_0x1f56bc[_0x2cb05e(0x19d)],'error':_0x9505f6 instanceof Error?_0x9505f6[_0x2cb05e(0x1ca)]:String(_0x9505f6)});}}_0x464f28[_0x2cb05e(0x1ce)]=new Date()[_0x2cb05e(0x19c)](),await writeBffLockFile(_0x5814ef[_0x2cb05e(0x1b7)],_0x3c5d84),await waitForUploadedLockEntries(_0x5814ef[_0x2cb05e(0x1b7)],_0x1683a5['appCode'],_0x2ffe21[_0x2cb05e(0x1cc)](_0x59a340=>_0x59a340[_0x2cb05e(0x19d)]));let _0x14c4ba={'attempted':![],'cleared':![]};if(_0x2ffe21[_0x2cb05e(0x1bf)]>0x0)try{let _0x2db482='';for(let _0x586622=0x0;_0x586622<CACHE_CLEAR_ATTEMPTS;_0x586622+=0x1){_0x2db482=await clearBffScriptCache(),_0x586622<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x14c4ba={'attempted':!![],'cleared':!![],'message':_0x2db482||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0xdceaee){_0x14c4ba={'attempted':!![],'cleared':![],'error':_0xdceaee instanceof Error?_0xdceaee['message']:String(_0xdceaee)};}const _0x28d53c=_0x46c22f[_0x2cb05e(0x1bf)]===0x0&&(_0x14c4ba[_0x2cb05e(0x188)]?_0x14c4ba[_0x2cb05e(0x195)]:!![]),_0x29465e=_0x14c4ba[_0x2cb05e(0x188)]?_0x14c4ba[_0x2cb05e(0x195)]?_0x2cb05e(0x192):'runtime\x20cache\x20clear\x20failed':'runtime\x20cache\x20not\x20needed';return{'ok':_0x28d53c,'data':{'uploaded':_0x2ffe21,'skipped':_0x42eb83,'failed':_0x46c22f,'cacheClear':_0x14c4ba},'message':_0x2cb05e(0x19a)+_0x2ffe21[_0x2cb05e(0x1bf)]+'\x20uploaded,\x20'+_0x42eb83[_0x2cb05e(0x1bf)]+_0x2cb05e(0x1a7)+_0x46c22f[_0x2cb05e(0x1bf)]+_0x2cb05e(0x1a6)+_0x29465e};}};async function getTargetFunctions(_0x2090bb,_0x3029bb){const _0x1e96ae=a37_0xd26f8c,_0x43a90f=_0x3029bb[_0x1e96ae(0x1ad)]('type'),_0x367efe=_0x3029bb[_0x1e96ae(0x1ad)](_0x1e96ae(0x1c5)),_0x2487d0=normalizeBffType(_0x43a90f)??undefined;if(_0x367efe&&!_0x2487d0)throw CliErrors['validation'](_0x1e96ae(0x1a2));const _0x57cac0=await scanLocalBffFunctions(_0x2090bb,_0x2487d0);if(_0x367efe){const _0x41dbb2=_0x57cac0[_0x1e96ae(0x19b)](_0x51633b=>_0x51633b[_0x1e96ae(0x1c5)]===_0x367efe);if(_0x41dbb2['length']===0x0)throw CliErrors[_0x1e96ae(0x18a)](_0x1e96ae(0x1a9)+_0x2487d0+'/'+_0x367efe);return _0x41dbb2;}return _0x57cac0;}async function buildHookMaps(_0x7144af,_0x3bf2e3,_0x2b1dee,_0x51c8d8){const _0x3359e7=a37_0xd26f8c,_0x4f9f27=_0x2b1dee[_0x3359e7(0x1ae)](_0x3d3e96=>_0x3d3e96[_0x3359e7(0x186)]===_0x3359e7(0x1b9));if(!_0x4f9f27)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xbef487=loadAliasMap(_0x3bf2e3,undefined,resolveApiFilePath(_0x3bf2e3,_0x7144af)),_0x33c0e4=new Map(_0xbef487[_0x3359e7(0x1cc)](_0x2a2535=>[_0x2a2535[_0x3359e7(0x181)],_0x2a2535[_0x3359e7(0x194)]]));for(const _0xf18e6a of Object[_0x3359e7(0x1c7)](_0x51c8d8[_0x3359e7(0x1a5)])){_0xf18e6a[_0x3359e7(0x181)]&&_0xf18e6a[_0x3359e7(0x194)]&&!_0x33c0e4[_0x3359e7(0x185)](_0xf18e6a[_0x3359e7(0x181)])&&_0x33c0e4['set'](_0xf18e6a[_0x3359e7(0x181)],_0xf18e6a[_0x3359e7(0x194)]);}const _0x5da346=await listDatasets(_0x7144af),_0x206c29=new Map(_0x5da346['map'](_0xa7b17c=>[_0xa7b17c['code'],_0xa7b17c]));return{'aliasToDatasetCode':_0x33c0e4,'datasetCodeToDataset':_0x206c29};}function a37_0x196b(_0x1b1cb9,_0x29a14f){_0x1b1cb9=_0x1b1cb9-0x181;const _0xf10f85=a37_0xf10f();let _0x196b14=_0xf10f85[_0x1b1cb9];return _0x196b14;}async function uploadSingleFunction(_0x138729,_0x20cdae,_0x25ad8a,_0xa5f7f7){const _0x1ac030=a37_0xd26f8c,_0x170e56=await readFile(_0x20cdae[_0x1ac030(0x19e)],'utf8'),_0x28ce2c=await computeFileHash(_0x20cdae['filePath']),_0x222c3f=_0x25ad8a[_0x1ac030(0x1a5)][_0x20cdae[_0x1ac030(0x19d)]];if(_0x222c3f?.[_0x1ac030(0x1a0)]&&_0x222c3f[_0x1ac030(0x1bb)]==null)throw CliErrors[_0x1ac030(0x18a)](_0x20cdae['lockKey']+_0x1ac030(0x183));let _0x5be730=extractScriptDescription(_0x170e56);if(!_0x5be730&&_0x222c3f?.[_0x1ac030(0x1a0)]){const _0x378dde=await getBffScriptInfo(_0x222c3f[_0x1ac030(0x1a0)]);_0x5be730=_0x378dde[_0x1ac030(0x1b6)]||undefined;}const _0x1dfa04={'appCode':_0x138729,'functionName':_0x20cdae[_0x1ac030(0x1c5)],'scriptType':_0x20cdae[_0x1ac030(0x186)],'scriptContent':_0x170e56};if(_0x222c3f?.[_0x1ac030(0x1a0)])_0x1dfa04['id']=_0x222c3f[_0x1ac030(0x1a0)];if(_0x222c3f?.[_0x1ac030(0x1bb)]!=null)_0x1dfa04[_0x1ac030(0x1bb)]=_0x222c3f['version'];if(_0x5be730)_0x1dfa04[_0x1ac030(0x1b6)]=_0x5be730;if(_0x20cdae[_0x1ac030(0x186)]==='HOOK'){const _0x6d3e3b=_0x20cdae['alias'];if(!_0x6d3e3b||!_0x20cdae[_0x1ac030(0x18c)]||!_0x20cdae[_0x1ac030(0x1c6)])throw CliErrors[_0x1ac030(0x18a)](_0x1ac030(0x18b)+_0x20cdae[_0x1ac030(0x19d)]);const _0x23248d=_0xa5f7f7[_0x1ac030(0x189)][_0x1ac030(0x1ab)](_0x6d3e3b)??_0x222c3f?.[_0x1ac030(0x194)]??_0x6d3e3b,_0x4be3fa=_0xa5f7f7[_0x1ac030(0x182)][_0x1ac030(0x1ab)](_0x23248d);if(!_0x4be3fa)throw CliErrors[_0x1ac030(0x18a)](_0x1ac030(0x18e)+_0x6d3e3b+_0x1ac030(0x191)+(_0x1ac030(0x199)+CLI_BIN_NAME+_0x1ac030(0x1c0)));_0x1dfa04['datasetId']=_0x4be3fa['id'],_0x1dfa04[_0x1ac030(0x18c)]=_0x20cdae[_0x1ac030(0x18c)],_0x1dfa04[_0x1ac030(0x1c6)]=_0x20cdae[_0x1ac030(0x1c6)];}const _0x5173ec=await saveBffScript(_0x1dfa04),_0x50b28b=_0x5173ec['id'],_0x22ff03=_0x5173ec['script']??await getBffScriptInfo(_0x50b28b),_0x3b3811={'hash':_0x28ce2c,'remoteId':_0x50b28b,'version':_0x22ff03['version']};if(_0x20cdae['type']===_0x1ac030(0x1b9)){const _0x40660e=_0x20cdae[_0x1ac030(0x181)],_0x10a421=_0xa5f7f7['aliasToDatasetCode'][_0x1ac030(0x1ab)](_0x40660e)??_0x222c3f?.[_0x1ac030(0x194)]??_0x40660e;_0xa5f7f7[_0x1ac030(0x189)][_0x1ac030(0x185)](_0x40660e)?_0x3b3811[_0x1ac030(0x181)]=_0x40660e:_0x3b3811[_0x1ac030(0x181)]=_0x222c3f?.['alias'],_0x3b3811['datasetCode']=_0x10a421,_0x3b3811[_0x1ac030(0x18c)]=_0x20cdae['operationType'],_0x3b3811[_0x1ac030(0x1c6)]=_0x20cdae[_0x1ac030(0x1c6)];}_0x25ad8a[_0x1ac030(0x1a5)][_0x20cdae[_0x1ac030(0x19d)]]=_0x3b3811;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x23e21f,_0x524070,_0x561591){const _0x89cb4e=a37_0xd26f8c;if(_0x561591[_0x89cb4e(0x1bf)]===0x0)return;for(let _0x5e7ab4=0x0;_0x5e7ab4<LOCK_SETTLE_RETRY_COUNT;_0x5e7ab4+=0x1){const _0x343c95=await readBffLockFile(_0x23e21f),_0x438c5f=_0x343c95?.[_0x89cb4e(0x1aa)]?.[_0x524070]?.[_0x89cb4e(0x1a5)]??{},_0x58d301=_0x561591[_0x89cb4e(0x1a1)](_0xecb7e8=>!!_0x438c5f[_0xecb7e8]?.['remoteId']);if(_0x58d301)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x561591[_0x89cb4e(0x1a4)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a38_0x353a(_0x43b3d6,_0x24928d){_0x43b3d6=_0x43b3d6-0xab;const _0x118c70=a38_0x118c();let _0x353a5d=_0x118c70[_0x43b3d6];return _0x353a5d;}const a38_0x1c7167=a38_0x353a;(function(_0x295e00,_0x8e3c1a){const _0x4211a3=a38_0x353a,_0x2e3d3d=_0x295e00();while(!![]){try{const _0x368e98=parseInt(_0x4211a3(0xb6))/0x1+-parseInt(_0x4211a3(0xb4))/0x2*(-parseInt(_0x4211a3(0xb8))/0x3)+-parseInt(_0x4211a3(0xc4))/0x4+-parseInt(_0x4211a3(0xca))/0x5+-parseInt(_0x4211a3(0xb0))/0x6+parseInt(_0x4211a3(0xab))/0x7*(parseInt(_0x4211a3(0xba))/0x8)+parseInt(_0x4211a3(0xc7))/0x9;if(_0x368e98===_0x8e3c1a)break;else _0x2e3d3d['push'](_0x2e3d3d['shift']());}catch(_0x337418){_0x2e3d3d['push'](_0x2e3d3d['shift']());}}}(a38_0x118c,0x60b46));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';function a38_0x118c(){const _0x3a6328=['remote','all','3048600uLhkvR','appCode','length','bool','206yRJcmt','\x20remote-only','458171tEQaWH','\x20added,\x20','16539xTzlmz','All\x20BFF\x20scripts\x20are\x20in\x20sync.','186648dywKjr','status','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','read','functions','lockKey','filePath','push','map','\x20unchanged','309016dFFPOl','bff','lockFilePath','1458369PNCyZF','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','alias','1382940oLtgUh','apiDir','\x20modified,\x20','21HFvSVJ','scriptsRoot','has'];a38_0x118c=function(){return _0x3a6328;};return a38_0x118c();}export const bffStatus={'service':a38_0x1c7167(0xc5),'command':a38_0x1c7167(0xbb),'description':a38_0x1c7167(0xc8),'risk':a38_0x1c7167(0xbd),'flags':[{'name':a38_0x1c7167(0xae),'type':'boolean','description':a38_0x1c7167(0xbc)}],async 'execute'(_0x4ea356){const _0x5df3dc=a38_0x1c7167,_0xc8db3d=loadBffProjectConfig(_0x4ea356[_0x5df3dc(0xb1)]),_0x31ee37=await readBffLockFile(_0xc8db3d[_0x5df3dc(0xc6)]),{appLock:_0x3860c2}=ensureLockScope(_0x31ee37??createEmptyBffLock(),_0x4ea356[_0x5df3dc(0xb1)],_0xc8db3d[_0x5df3dc(0xac)],_0x5df3dc(0xbb)),_0x456285=await scanLocalBffFunctions(_0xc8db3d),_0x33b75b=[],_0x338254=[],_0x41ca16=[];for(const _0xc5ec9d of _0x456285){const _0x1ed36c=await computeFileHash(_0xc5ec9d[_0x5df3dc(0xc0)]),_0x20676a=_0x3860c2[_0x5df3dc(0xbe)][_0xc5ec9d['lockKey']];if(!_0x20676a)_0x33b75b[_0x5df3dc(0xc1)](_0xc5ec9d[_0x5df3dc(0xbf)]);else _0x20676a['hash']!==_0x1ed36c?_0x338254[_0x5df3dc(0xc1)](_0xc5ec9d['lockKey']):_0x41ca16[_0x5df3dc(0xc1)](_0xc5ec9d[_0x5df3dc(0xbf)]);}const _0x16c613=[];if(_0x4ea356[_0x5df3dc(0xb3)](_0x5df3dc(0xae))){const _0x547ac3=loadAliasMap(_0x4ea356[_0x5df3dc(0xcb)],undefined,resolveApiFilePath(_0x4ea356[_0x5df3dc(0xcb)],_0x4ea356[_0x5df3dc(0xb1)])),_0x27399a=new Map(_0x547ac3[_0x5df3dc(0xc2)](_0x30489=>[_0x30489['datasetCode'],_0x30489[_0x5df3dc(0xc9)]])),[_0x728e0a,_0x368b81]=await Promise[_0x5df3dc(0xaf)]([listBffScripts(_0x4ea356['appCode']),getBffScriptStatistics(_0x4ea356[_0x5df3dc(0xb1)])]),_0xbf0ce9=createHookLocationMap(_0x368b81),_0x543039=new Set(_0x456285['map'](_0xee42a6=>_0xee42a6[_0x5df3dc(0xbf)]));for(const _0x3d283d of _0x728e0a){const _0x591a8c=resolveRemoteScriptTarget(_0xc8db3d,_0x3d283d,_0xbf0ce9,_0x3860c2['functions'],_0x27399a);_0x591a8c&&!_0x543039[_0x5df3dc(0xad)](_0x591a8c[_0x5df3dc(0xbf)])&&_0x16c613[_0x5df3dc(0xc1)](_0x591a8c[_0x5df3dc(0xbf)]);}}const _0x47ce85=_0x33b75b[_0x5df3dc(0xb2)]===0x0&&_0x338254['length']===0x0&&_0x16c613[_0x5df3dc(0xb2)]===0x0;return{'ok':!![],'data':{'added':_0x33b75b,'modified':_0x338254,'unchanged':_0x41ca16,'remoteOnly':_0x16c613},'message':_0x47ce85?_0x5df3dc(0xb9):_0x33b75b['length']+_0x5df3dc(0xb7)+_0x338254[_0x5df3dc(0xb2)]+_0x5df3dc(0xcc)+_0x41ca16[_0x5df3dc(0xb2)]+_0x5df3dc(0xc3)+(_0x16c613[_0x5df3dc(0xb2)]>0x0?',\x20'+_0x16c613[_0x5df3dc(0xb2)]+_0x5df3dc(0xb5):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0xce503d=a39_0x3175;(function(_0x3bd6b5,_0x37c38c){const _0x437cfb=a39_0x3175,_0x10cab1=_0x3bd6b5();while(!![]){try{const _0x49b65f=-parseInt(_0x437cfb(0x1f3))/0x1*(parseInt(_0x437cfb(0x1eb))/0x2)+-parseInt(_0x437cfb(0x1ff))/0x3+-parseInt(_0x437cfb(0x205))/0x4*(parseInt(_0x437cfb(0x204))/0x5)+parseInt(_0x437cfb(0x1ed))/0x6*(-parseInt(_0x437cfb(0x1f2))/0x7)+-parseInt(_0x437cfb(0x202))/0x8*(parseInt(_0x437cfb(0x1f4))/0x9)+-parseInt(_0x437cfb(0x1f6))/0xa+-parseInt(_0x437cfb(0x1f8))/0xb*(-parseInt(_0x437cfb(0x1ef))/0xc);if(_0x49b65f===_0x37c38c)break;else _0x10cab1['push'](_0x10cab1['shift']());}catch(_0x1c4a0f){_0x10cab1['push'](_0x10cab1['shift']());}}}(a39_0x3573,0x7f2b4));import{CliErrors}from'../../errors.js';function a39_0x3175(_0x4b1ee7,_0x8d411){_0x4b1ee7=_0x4b1ee7-0x1e9;const _0x3573cc=a39_0x3573();let _0x31752d=_0x3573cc[_0x4b1ee7];return _0x31752d;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0xce503d(0x1fc),'command':a39_0xce503d(0x1f1),'description':a39_0xce503d(0x203),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x85b04d){const _0x54e37e=a39_0xce503d;logger[_0x54e37e(0x1f5)](process[_0x54e37e(0x1e9)]()),logger['info'](_0x54e37e(0x1fd),_0x54e37e(0x200));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x13820c,RABETBASE_SKILL_SOURCE:_0x21be4d,runNpxSkillsAddGlobal:_0x29dcff}=await import(_0x54e37e(0x1fa)),_0x28fb78=_0x85b04d[_0x54e37e(0x1f7)]?_0x54e37e(0x1ea):_0x54e37e(0x1f9);console[_0x54e37e(0x207)](_0x54e37e(0x1ec)+_0x13820c+_0x54e37e(0x206));const _0x25c190=_0x29dcff(process[_0x54e37e(0x1e9)](),_0x21be4d,{'stdio':_0x28fb78});if(_0x25c190['skipped'])console[_0x54e37e(0x207)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.');else{if(_0x25c190['ok'])console[_0x54e37e(0x207)]('CLI\x20Built-in\x20Skill\x20installed');else throw CliErrors[_0x54e37e(0x1fb)](_0x54e37e(0x201)+(_0x25c190[_0x54e37e(0x1ee)]||_0x54e37e(0x1fe)),_0x54e37e(0x1f0)+_0x13820c);}return{'ok':!![]};}}];function a39_0x3573(){const _0x31c69b=['apiError','cli-skill','cli-skill-install','unknown','2412237bAiVIp','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','npx\x20skills\x20add\x20failed:\x20','27944owFaPR','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','221675OpCGdu','20mKdnuv',')...','log','cwd','pipe','8152SaPsRM','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(','12hkmcUC','error','55128QNvdQV','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','install','3085985CJNjXF','16nmqKfJ','630zLTwwS','setLogPath','4409740NxvcID','nonInteractive','7612QmyrhU','inherit','../../skills/npx-skills-add.js'];a39_0x3573=function(){return _0x31c69b;};return a39_0x3573();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x57e0c3=a40_0xa25d;(function(_0x231bfa,_0x28eaa2){const _0x373d24=a40_0xa25d,_0x1085d9=_0x231bfa();while(!![]){try{const _0x318a94=-parseInt(_0x373d24(0x122))/0x1+parseInt(_0x373d24(0x12a))/0x2*(-parseInt(_0x373d24(0xfb))/0x3)+-parseInt(_0x373d24(0xfe))/0x4*(parseInt(_0x373d24(0x110))/0x5)+-parseInt(_0x373d24(0x105))/0x6+-parseInt(_0x373d24(0x11d))/0x7+-parseInt(_0x373d24(0x103))/0x8+parseInt(_0x373d24(0xf0))/0x9*(parseInt(_0x373d24(0x121))/0xa);if(_0x318a94===_0x28eaa2)break;else _0x1085d9['push'](_0x1085d9['shift']());}catch(_0x4b9a06){_0x1085d9['push'](_0x1085d9['shift']());}}}(a40_0x46ce,0xa0d29));import a40_0x6a23cc from'chalk';import a40_0x2c775b from'ora';import a40_0x4ff535 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function a40_0x46ce(){const _0x3e28c8=['\x20\x20Run\x20manually:\x20','fromEntries','3793190pWTqnw','960301FLOsod','green','json','skipped','Already\x20up\x20to\x20date\x20(v','flag','Updating\x20via\x20','timeout','122046YjEOAn','Update\x20failed','\x20\x20Try\x20manually:\x20','Checking\x20CLI\x20Built-in\x20Skill...','nonInteractive','update','write','...','Already\x20on\x20requested\x20version\x20(v','\x20→\x20','slice','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','entries','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','source','Current\x20version:\x20','\x20install\x20-g\x20','bool','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','info','validation','Checking\x20for\x20updates...','succeed','81LSwrig','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','boolean','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','bun','string','skills','trim','message','run','60yMehJD','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','object','1852mtjryX','red','Version\x20comparison\x20failed','latest','str','2393920Uitwub','pipe','350778TzSXON','map','fail','version','Beta\x20version:\x20','warn','npm','Install\x20a\x20specific\x20CLI\x20version','error','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','1585xmsBoz','log','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','length','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','Updated\x20to\x20v','yellow','install','gray','valid','beta','unknown','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','489349vATGud','start'];a40_0x46ce=function(){return _0x3e28c8;};return a40_0x46ce();}function getCurrentVersion(){const _0x173a59=a40_0xa25d;return GIT_COMMIT!==_0x173a59(0x11b)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x173a59(0xe3)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1ba148=a40_0xa25d,_0x456a6e=process['execPath']['toLowerCase']();if(_0x456a6e['includes'](_0x1ba148(0xf5)))return _0x1ba148(0xf5);return _0x1ba148(0x10b);}function a40_0xa25d(_0x2c8722,_0x4750b0){_0x2c8722=_0x2c8722-0xe0;const _0x46ce5f=a40_0x46ce();let _0xa25df2=_0x46ce5f[_0x2c8722];return _0xa25df2;}const updateFlags=[{'name':a40_0x57e0c3(0x11a),'type':a40_0x57e0c3(0xf3),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a40_0x57e0c3(0x108),'type':'string','description':a40_0x57e0c3(0x10c)},{'name':'no-skills','type':a40_0x57e0c3(0xf3),'description':a40_0x57e0c3(0x114),'default':![]},{'name':a40_0x57e0c3(0xf7),'type':a40_0x57e0c3(0xf3),'description':a40_0x57e0c3(0xeb),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x4ed009){const _0x4194ca=a40_0x57e0c3;return _0x4ed009[_0x4194ca(0x102)](_0x4194ca(0x108))[_0x4194ca(0xf8)]();}function shouldSkipCliSkill(_0x12fb09){const _0x44683d=a40_0x57e0c3;return _0x12fb09['bool']('no-skills')||_0x12fb09[_0x44683d(0x127)](_0x44683d(0xf7))===![];}async function validateUpdateFlags(_0x364cb7){const _0x56a066=a40_0x57e0c3,_0x4e6fb7=_0x364cb7[_0x56a066(0xea)]('beta'),_0x4edd5e=getRequestedVersion(_0x364cb7);if(_0x4e6fb7&&_0x4edd5e)throw CliErrors[_0x56a066(0xed)](_0x56a066(0x10e),_0x56a066(0x11c));if(_0x4edd5e&&!a40_0x4ff535['valid'](_0x4edd5e))throw CliErrors[_0x56a066(0xed)]('Invalid\x20version:\x20'+_0x4edd5e,_0x56a066(0xfc));}async function fetchNpmDistTags(){const _0x4a9803=a40_0x57e0c3;try{const _0x32e2a5=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x4a9803(0x129)](0x2710)});if(!_0x32e2a5['ok'])return null;const _0x21710d=await _0x32e2a5[_0x4a9803(0x124)]();if(!_0x21710d||typeof _0x21710d!==_0x4a9803(0xfd))return null;return Object[_0x4a9803(0x120)](Object[_0x4a9803(0xe5)](_0x21710d)['filter'](([,_0x34e219])=>typeof _0x34e219===_0x4a9803(0xf6)&&_0x34e219[_0x4a9803(0xf8)]()[_0x4a9803(0x113)]>0x0)[_0x4a9803(0x106)](([_0x4eb5b0,_0x2388b3])=>[_0x4eb5b0,String(_0x2388b3)[_0x4a9803(0xf8)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x4123c2){const _0x2b56ae=await fetchNpmDistTags();return _0x2b56ae?.[_0x4123c2]??null;}async function fetchLatestVersion(){const _0x30f516=a40_0x57e0c3;return fetchNpmDistTagVersion(_0x30f516(0x101));}async function resolveTargetVersion(_0x469955){const _0x501e57=a40_0x57e0c3,_0x3f36ae=getRequestedVersion(_0x469955);if(_0x3f36ae)return{'version':_0x3f36ae,'source':'version'};if(_0x469955[_0x501e57(0xea)]('beta')){const _0x4a57c4=await fetchNpmDistTagVersion('beta');if(!_0x4a57c4)return null;return{'version':_0x4a57c4,'source':_0x501e57(0x11a)};}const _0x2eabb2=await fetchLatestVersion();if(!_0x2eabb2)return null;return{'version':_0x2eabb2,'source':_0x501e57(0x101)};}function shouldInstallTarget(_0x5e5d21,_0x40a9c9){const _0x4dae22=a40_0x57e0c3;if(_0x40a9c9['source']===_0x4dae22(0x108)||_0x40a9c9[_0x4dae22(0xe7)]===_0x4dae22(0x11a))return!a40_0x4ff535['eq'](_0x5e5d21,_0x40a9c9['version']);return a40_0x4ff535['lt'](_0x5e5d21,_0x40a9c9['version']);}function getInstallPlanLabel(_0x5d7062,_0x3ff2aa){const _0x2942d7=a40_0x57e0c3;switch(_0x3ff2aa[_0x2942d7(0xe7)]){case _0x2942d7(0x11a):return _0x2942d7(0x109)+a40_0x6a23cc[_0x2942d7(0x116)](_0x5d7062)+_0x2942d7(0xe2)+a40_0x6a23cc['green'](_0x3ff2aa[_0x2942d7(0x108)]);case _0x2942d7(0x108):return'Requested\x20version:\x20'+a40_0x6a23cc[_0x2942d7(0x116)](_0x5d7062)+_0x2942d7(0xe2)+a40_0x6a23cc[_0x2942d7(0x123)](_0x3ff2aa['version']);case'latest':default:return'Update\x20available:\x20'+a40_0x6a23cc['yellow'](_0x5d7062)+'\x20→\x20'+a40_0x6a23cc[_0x2942d7(0x123)](_0x3ff2aa['version']);}}async function installCliSkill(_0x5bfc89){const _0x112124=a40_0x57e0c3;console[_0x112124(0x111)](a40_0x6a23cc[_0x112124(0x118)](_0x112124(0x12d)));const _0x3a5e9c=runNpxSkillsAddGlobal(process['cwd'](),RABETBASE_SKILL_SOURCE,{'stdio':_0x5bfc89?_0x112124(0x104):'inherit'});if(_0x3a5e9c[_0x112124(0x125)]){console['log'](a40_0x6a23cc['gray'](_0x112124(0x10f)));return;}if(_0x3a5e9c['ok']){console[_0x112124(0x111)](a40_0x6a23cc['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.'));return;}console[_0x112124(0x10a)](a40_0x6a23cc[_0x112124(0x116)]('\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20'+(_0x3a5e9c[_0x112124(0x10d)]||_0x112124(0x11b)))),console['log'](a40_0x6a23cc[_0x112124(0x118)](_0x112124(0x11f)+CLI_BIN_NAME+'\x20cli-skill\x20install'));}async function execute(_0xb81a68){const _0x54635c=a40_0x57e0c3;await validateUpdateFlags(_0xb81a68);const _0x49f4d6=getCurrentVersion();console[_0x54635c(0x111)](_0x54635c(0xe8)+_0x49f4d6);const _0x37b645=a40_0x2c775b(_0x54635c(0xee))[_0x54635c(0x11e)](),_0x2ca3e8=await resolveTargetVersion(_0xb81a68);if(!_0x2ca3e8){const _0x3dac17=_0xb81a68[_0x54635c(0xea)](_0x54635c(0x11a))?_0x54635c(0xf4):_0x54635c(0xf1);return _0x37b645[_0x54635c(0x107)](_0x3dac17),console[_0x54635c(0x111)](a40_0x6a23cc['gray'](_0x54635c(0x112)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x3dac17};}const _0x45eac8=a40_0x4ff535['valid'](VERSION),_0x214a2a=a40_0x4ff535[_0x54635c(0x119)](_0x2ca3e8['version']);if(!_0x45eac8||!_0x214a2a)return _0x37b645[_0x54635c(0x107)](_0x54635c(0x100)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x45eac8,_0x2ca3e8)){const _0x322457=_0x2ca3e8[_0x54635c(0xe7)]===_0x54635c(0x108)?_0x54635c(0xe1)+_0x2ca3e8[_0x54635c(0x108)]+')':_0x54635c(0x126)+_0x2ca3e8[_0x54635c(0x108)]+')';return _0x37b645[_0x54635c(0xef)](_0x322457),shouldSkipCliSkill(_0xb81a68)?console[_0x54635c(0x111)](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0xe6))):await installCliSkill(_0xb81a68['nonInteractive']),{'ok':!![]};}_0x37b645[_0x54635c(0xec)](getInstallPlanLabel(_0x49f4d6,_0x2ca3e8));const _0x474295=detectPackageManager(),_0x3a7fde=_0x474295===_0x54635c(0x10b)?resolveNpmBin(_0x54635c(0x10b)):_0x474295,_0x283b2f=a40_0x2c775b(_0x54635c(0x128)+_0x474295+_0x54635c(0xe0))[_0x54635c(0x11e)]();try{return await execa(_0x3a7fde,[_0x54635c(0x117),'-g',NPM_PACKAGE_NAME+'@'+_0x2ca3e8[_0x54635c(0x108)]],{'stdio':_0x54635c(0x104)}),_0x283b2f[_0x54635c(0xef)](_0x54635c(0x115)+_0x2ca3e8['version']),console['log'](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0xf2))),shouldSkipCliSkill(_0xb81a68)?console['log'](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0xe6))):await installCliSkill(_0xb81a68[_0x54635c(0x12e)]),{'ok':!![]};}catch(_0x45b3fb){return _0x283b2f[_0x54635c(0x107)](_0x54635c(0x12b)),console['error'](a40_0x6a23cc[_0x54635c(0xff)]('\x20\x20'+_0x45b3fb[_0x54635c(0xf9)])),console[_0x54635c(0x111)](a40_0x6a23cc[_0x54635c(0x118)](_0x54635c(0x12c)+_0x474295+_0x54635c(0xe9)+NPM_PACKAGE_NAME+'@'+_0x2ca3e8[_0x54635c(0x108)])),{'ok':![],'message':_0x45b3fb[_0x54635c(0xf9)]};}}export const updateDefinition={'service':a40_0x57e0c3(0x12f),'command':a40_0x57e0c3(0xfa),'description':a40_0x57e0c3(0xe4),'risk':a40_0x57e0c3(0x130),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x14057d=a40_0x328e;(function(_0xa6f14,_0x2dc7cf){const _0x45dfb3=a40_0x328e,_0x3c47ca=_0xa6f14();while(!![]){try{const _0x3c1d76=parseInt(_0x45dfb3(0xc8))/0x1*(parseInt(_0x45dfb3(0xc6))/0x2)+-parseInt(_0x45dfb3(0x90))/0x3+-parseInt(_0x45dfb3(0x79))/0x4+-parseInt(_0x45dfb3(0x7b))/0x5+-parseInt(_0x45dfb3(0xbf))/0x6*(-parseInt(_0x45dfb3(0xc2))/0x7)+parseInt(_0x45dfb3(0x7f))/0x8*(parseInt(_0x45dfb3(0xb6))/0x9)+-parseInt(_0x45dfb3(0xc5))/0xa*(parseInt(_0x45dfb3(0x85))/0xb);if(_0x3c1d76===_0x2dc7cf)break;else _0x3c47ca['push'](_0x3c47ca['shift']());}catch(_0x12f7e5){_0x3c47ca['push'](_0x3c47ca['shift']());}}}(a40_0x2acc,0x99ead));function a40_0x2acc(){const _0x509ddc=['flag','5224XnCwMZ','Install\x20a\x20specific\x20CLI\x20version','validation','valid','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','bool','44CLewHq','update','Version\x20comparison\x20failed','toLowerCase','@latest','gray','start','Current\x20version:\x20','\x20\x20Run\x20manually:\x20','Checking\x20for\x20updates...','includes','1601844QxVEKn','Update\x20failed','trim','slice','skills','pipe','bun','succeed','green','info','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','\x20install\x20-g\x20','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','\x20→\x20','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','yellow','log','Update\x20available:\x20','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','https://registry.npmjs.org/-/package/','timeout','Already\x20up\x20to\x20date\x20(v','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','fail','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','message','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20cli-skill\x20install','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','Updating\x20via\x20','error','boolean','/dist-tags','npm','beta','source','nonInteractive','version','738egUBjn','run','red','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','fromEntries','length','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','unknown','no-skills','2010sqvcDM','warn','inherit','15197wrsKoM','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','latest','747290QhQLFe','3714SInJuT','Invalid\x20version:\x20','549JggEDa','string','\x20\x20Try\x20manually:\x20','Updated\x20to\x20v','str','map','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','1168376wLPAjX','object','224605UgFFzR','skipped','write'];a40_0x2acc=function(){return _0x509ddc;};return a40_0x2acc();}import a40_0x2068a7 from'chalk';import a40_0x1dc441 from'ora';import a40_0x314ff9 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function a40_0x328e(_0xe4f121,_0x52d244){_0xe4f121=_0xe4f121-0x78;const _0x2accc0=a40_0x2acc();let _0x328e00=_0x2accc0[_0xe4f121];return _0x328e00;}function getCurrentVersion(){const _0x263db7=a40_0x328e;return GIT_COMMIT!==_0x263db7(0xbd)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x263db7(0x93)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3b4e83=a40_0x328e,_0x79cad7=process['execPath'][_0x3b4e83(0x88)]();if(_0x79cad7[_0x3b4e83(0x8f)](_0x3b4e83(0x96)))return _0x3b4e83(0x96);return _0x3b4e83(0xb1);}const updateFlags=[{'name':'beta','type':a40_0x14057d(0xaf),'description':a40_0x14057d(0x83),'default':![]},{'name':a40_0x14057d(0xb5),'type':'string','description':a40_0x14057d(0x80)},{'name':a40_0x14057d(0xbe),'type':'boolean','description':a40_0x14057d(0x9c),'default':![]},{'name':a40_0x14057d(0x94),'type':a40_0x14057d(0xaf),'description':a40_0x14057d(0x78),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x5ba4b2){const _0x87fc13=a40_0x14057d;return _0x5ba4b2[_0x87fc13(0xcc)](_0x87fc13(0xb5))[_0x87fc13(0x92)]();}function shouldSkipCliSkill(_0x5a6546){const _0x4c9cc0=a40_0x14057d;return _0x5a6546[_0x4c9cc0(0x84)](_0x4c9cc0(0xbe))||_0x5a6546[_0x4c9cc0(0x7e)](_0x4c9cc0(0x94))===![];}async function validateUpdateFlags(_0x212fe){const _0x4ee06f=a40_0x14057d,_0x1e0547=_0x212fe[_0x4ee06f(0x84)]('beta'),_0x38eba7=getRequestedVersion(_0x212fe);if(_0x1e0547&&_0x38eba7)throw CliErrors[_0x4ee06f(0x81)](_0x4ee06f(0xaa),_0x4ee06f(0xbc));if(_0x38eba7&&!a40_0x314ff9[_0x4ee06f(0x82)](_0x38eba7))throw CliErrors[_0x4ee06f(0x81)](_0x4ee06f(0xc7)+_0x38eba7,_0x4ee06f(0xa6));}async function fetchNpmDistTags(){const _0x2c916f=a40_0x14057d;try{const _0x48742d=await fetch(_0x2c916f(0xa3)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2c916f(0xb0),{'signal':AbortSignal[_0x2c916f(0xa4)](0x2710)});if(!_0x48742d['ok'])return null;const _0x5c1b3f=await _0x48742d['json']();if(!_0x5c1b3f||typeof _0x5c1b3f!==_0x2c916f(0x7a))return null;return Object[_0x2c916f(0xba)](Object['entries'](_0x5c1b3f)['filter'](([,_0x1a947f])=>typeof _0x1a947f===_0x2c916f(0xc9)&&_0x1a947f['trim']()[_0x2c916f(0xbb)]>0x0)[_0x2c916f(0xcd)](([_0x2502cf,_0x1c9f61])=>[_0x2502cf,String(_0x1c9f61)[_0x2c916f(0x92)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x429e28){const _0x56f720=await fetchNpmDistTags();return _0x56f720?.[_0x429e28]??null;}async function fetchLatestVersion(){const _0x5f0df1=a40_0x14057d;return fetchNpmDistTagVersion(_0x5f0df1(0xc4));}async function resolveTargetVersion(_0x4f7207){const _0x3ba325=a40_0x14057d,_0x3dc69a=getRequestedVersion(_0x4f7207);if(_0x3dc69a)return{'version':_0x3dc69a,'source':_0x3ba325(0xb5)};if(_0x4f7207[_0x3ba325(0x84)](_0x3ba325(0xb2))){const _0x58b110=await fetchNpmDistTagVersion(_0x3ba325(0xb2));if(!_0x58b110)return null;return{'version':_0x58b110,'source':_0x3ba325(0xb2)};}const _0x45dd06=await fetchLatestVersion();if(!_0x45dd06)return null;return{'version':_0x45dd06,'source':_0x3ba325(0xc4)};}function shouldInstallTarget(_0x1b8249,_0x227f41){const _0x547654=a40_0x14057d;if(_0x227f41['source']===_0x547654(0xb5)||_0x227f41[_0x547654(0xb3)]===_0x547654(0xb2))return!a40_0x314ff9['eq'](_0x1b8249,_0x227f41[_0x547654(0xb5)]);return a40_0x314ff9['lt'](_0x1b8249,_0x227f41['version']);}function getInstallPlanLabel(_0x20662e,_0x38dcf3){const _0x450f5d=a40_0x14057d;switch(_0x38dcf3[_0x450f5d(0xb3)]){case _0x450f5d(0xb2):return'Beta\x20version:\x20'+a40_0x2068a7[_0x450f5d(0x9f)](_0x20662e)+_0x450f5d(0x9d)+a40_0x2068a7['green'](_0x38dcf3[_0x450f5d(0xb5)]);case _0x450f5d(0xb5):return'Requested\x20version:\x20'+a40_0x2068a7['yellow'](_0x20662e)+_0x450f5d(0x9d)+a40_0x2068a7[_0x450f5d(0x98)](_0x38dcf3[_0x450f5d(0xb5)]);case _0x450f5d(0xc4):default:return _0x450f5d(0xa1)+a40_0x2068a7['yellow'](_0x20662e)+_0x450f5d(0x9d)+a40_0x2068a7[_0x450f5d(0x98)](_0x38dcf3[_0x450f5d(0xb5)]);}}async function installCliSkill(_0x2c0005){const _0x48d6b0=a40_0x14057d;console['log'](a40_0x2068a7[_0x48d6b0(0x8a)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x14824e=runNpxSkillsAddGlobal(process['cwd'](),RABETBASE_SKILL_SOURCE,{'stdio':_0x2c0005?_0x48d6b0(0x95):_0x48d6b0(0xc1)});if(_0x14824e[_0x48d6b0(0x7c)]){console['log'](a40_0x2068a7[_0x48d6b0(0x8a)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'));return;}if(_0x14824e['ok']){console[_0x48d6b0(0xa0)](a40_0x2068a7['gray'](_0x48d6b0(0x9e)));return;}console[_0x48d6b0(0xc0)](a40_0x2068a7[_0x48d6b0(0x9f)](_0x48d6b0(0xac)+(_0x14824e['error']||'unknown'))),console['log'](a40_0x2068a7[_0x48d6b0(0x8a)](_0x48d6b0(0x8d)+CLI_BIN_NAME+_0x48d6b0(0xab)));}async function execute(_0x50d2ef){const _0x1500c9=a40_0x14057d;await validateUpdateFlags(_0x50d2ef);const _0x5aab8f=getCurrentVersion();console['log'](_0x1500c9(0x8c)+_0x5aab8f);const _0x2d9e8d=a40_0x1dc441(_0x1500c9(0x8e))[_0x1500c9(0x8b)](),_0x4d0d49=await resolveTargetVersion(_0x50d2ef);if(!_0x4d0d49){const _0x283819=_0x50d2ef[_0x1500c9(0x84)](_0x1500c9(0xb2))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x1500c9(0xb9);return _0x2d9e8d[_0x1500c9(0xa7)](_0x283819),console[_0x1500c9(0xa0)](a40_0x2068a7[_0x1500c9(0x8a)](_0x1500c9(0xc3)+NPM_PACKAGE_NAME+_0x1500c9(0x89))),{'ok':![],'message':_0x283819};}const _0x9367c4=a40_0x314ff9[_0x1500c9(0x82)](VERSION),_0x1c7fe9=a40_0x314ff9[_0x1500c9(0x82)](_0x4d0d49[_0x1500c9(0xb5)]);if(!_0x9367c4||!_0x1c7fe9)return _0x2d9e8d['fail']('Version\x20comparison\x20failed'),{'ok':![],'message':_0x1500c9(0x87)};if(!shouldInstallTarget(_0x9367c4,_0x4d0d49)){const _0x5ccf3c=_0x4d0d49[_0x1500c9(0xb3)]===_0x1500c9(0xb5)?'Already\x20on\x20requested\x20version\x20(v'+_0x4d0d49['version']+')':_0x1500c9(0xa5)+_0x4d0d49[_0x1500c9(0xb5)]+')';return _0x2d9e8d[_0x1500c9(0x97)](_0x5ccf3c),shouldSkipCliSkill(_0x50d2ef)?console[_0x1500c9(0xa0)](a40_0x2068a7[_0x1500c9(0x8a)](_0x1500c9(0xa2))):await installCliSkill(_0x50d2ef[_0x1500c9(0xb4)]),{'ok':!![]};}_0x2d9e8d[_0x1500c9(0x99)](getInstallPlanLabel(_0x5aab8f,_0x4d0d49));const _0x2784e4=detectPackageManager(),_0x376aa1=_0x2784e4===_0x1500c9(0xb1)?resolveNpmBin(_0x1500c9(0xb1)):_0x2784e4,_0x555087=a40_0x1dc441(_0x1500c9(0xad)+_0x2784e4+'...')[_0x1500c9(0x8b)]();try{return await execa(_0x376aa1,['install','-g',NPM_PACKAGE_NAME+'@'+_0x4d0d49[_0x1500c9(0xb5)]],{'stdio':_0x1500c9(0x95)}),_0x555087[_0x1500c9(0x97)](_0x1500c9(0xcb)+_0x4d0d49[_0x1500c9(0xb5)]),console[_0x1500c9(0xa0)](a40_0x2068a7[_0x1500c9(0x8a)](_0x1500c9(0x9a))),shouldSkipCliSkill(_0x50d2ef)?console[_0x1500c9(0xa0)](a40_0x2068a7[_0x1500c9(0x8a)](_0x1500c9(0xa2))):await installCliSkill(_0x50d2ef[_0x1500c9(0xb4)]),{'ok':!![]};}catch(_0x367a09){return _0x555087['fail'](_0x1500c9(0x91)),console[_0x1500c9(0xae)](a40_0x2068a7[_0x1500c9(0xb8)]('\x20\x20'+_0x367a09[_0x1500c9(0xa9)])),console[_0x1500c9(0xa0)](a40_0x2068a7[_0x1500c9(0x8a)](_0x1500c9(0xca)+_0x2784e4+_0x1500c9(0x9b)+NPM_PACKAGE_NAME+'@'+_0x4d0d49[_0x1500c9(0xb5)])),{'ok':![],'message':_0x367a09[_0x1500c9(0xa9)]};}}export const updateDefinition={'service':a40_0x14057d(0x86),'command':a40_0x14057d(0xb7),'description':a40_0x14057d(0xa8),'risk':a40_0x14057d(0x7d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a41_0x31be(_0x4c943d,_0x1a0f57){_0x4c943d=_0x4c943d-0xcd;const _0x23fc5a=a41_0x23fc();let _0x31be24=_0x23fc5a[_0x4c943d];return _0x31be24;}function a41_0x23fc(){const _0x51e239=['289BOYhDG','9YYcGRD','7LnWCfe','55tGjbDN','2351055pDeaZL','44450758iYQyaJ','4479378eVHlzL','7546560nnlIRm','264904jqvxwD','5042712eesmsB','2008NWinxa'];a41_0x23fc=function(){return _0x51e239;};return a41_0x23fc();}(function(_0x404c1a,_0x3a7f83){const _0xb46280=a41_0x31be,_0x4fd466=_0x404c1a();while(!![]){try{const _0x59ae31=parseInt(_0xb46280(0xd7))/0x1*(parseInt(_0xb46280(0xd6))/0x2)+-parseInt(_0xb46280(0xd0))/0x3+-parseInt(_0xb46280(0xd4))/0x4*(parseInt(_0xb46280(0xcf))/0x5)+-parseInt(_0xb46280(0xd2))/0x6*(parseInt(_0xb46280(0xce))/0x7)+parseInt(_0xb46280(0xd5))/0x8*(-parseInt(_0xb46280(0xcd))/0x9)+-parseInt(_0xb46280(0xd3))/0xa+parseInt(_0xb46280(0xd1))/0xb;if(_0x59ae31===_0x3a7f83)break;else _0x4fd466['push'](_0x4fd466['shift']());}catch(_0x5d1a3a){_0x4fd466['push'](_0x4fd466['shift']());}}}(a41_0x23fc,0xa7d2d));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x351b96=a42_0x322a;(function(_0x1da17d,_0x235b3d){const _0x121eb7=a42_0x322a,_0x82cbc3=_0x1da17d();while(!![]){try{const _0x12b495=parseInt(_0x121eb7(0xab))/0x1+-parseInt(_0x121eb7(0xac))/0x2*(parseInt(_0x121eb7(0xb6))/0x3)+-parseInt(_0x121eb7(0xaf))/0x4+parseInt(_0x121eb7(0xae))/0x5+-parseInt(_0x121eb7(0xa1))/0x6+parseInt(_0x121eb7(0xb2))/0x7*(parseInt(_0x121eb7(0xb4))/0x8)+-parseInt(_0x121eb7(0xad))/0x9*(-parseInt(_0x121eb7(0xa8))/0xa);if(_0x12b495===_0x235b3d)break;else _0x82cbc3['push'](_0x82cbc3['shift']());}catch(_0x2d01d4){_0x82cbc3['push'](_0x82cbc3['shift']());}}}(a42_0x5e11,0xab13c));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x322a(_0x1c1d7c,_0x57a09a){_0x1c1d7c=_0x1c1d7c-0xa1;const _0x5e11f0=a42_0x5e11();let _0x322ac3=_0x5e11f0[_0x1c1d7c];return _0x322ac3;}export const codegenSdk={'service':a42_0x351b96(0xa7),'command':a42_0x351b96(0xb1),'description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a42_0x351b96(0xaa),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x351b96(0xa2),'type':a42_0x351b96(0xa9),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':a42_0x351b96(0xa9),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x351b96(0xb0),'type':a42_0x351b96(0xb3),'description':a42_0x351b96(0xa4)}],async 'execute'(_0x3383fc){const _0x281593=a42_0x351b96,{dataset:_0xc0c971,operation:_0x3fc60d}=await getOperationDetail(_0x3383fc['appCode'],_0x3383fc[_0x281593(0xb7)](_0x281593(0xa6)),_0x3383fc['str'](_0x281593(0xa3))),_0x4c97e2=generateSdkCode(_0xc0c971,_0x3fc60d,{'includeImports':!_0x3383fc['bool'](_0x281593(0xb0))});return{'ok':!![],'data':{'dataset':{'name':_0xc0c971[_0x281593(0xa5)],'code':_0xc0c971[_0x281593(0xa6)],'tableName':_0xc0c971[_0x281593(0xb5)]},'operation':_0x3383fc['str'](_0x281593(0xa3)),'code':_0x4c97e2}};}};function a42_0x5e11(){const _0x5cd020=['4223300UiXJbN','4886588OXcVvW','skip-imports','sdk','1638IUykQa','boolean','3832kWOBEe','tableName','48xPqcPA','str','279996uCIkQd','alias','operation','Omit\x20import\x20statements\x20from\x20generated\x20code','name','code','codegen','163940WBCPLI','string','read','549421Mtjdfk','63046kNMtHk','531vjghft'];a42_0x5e11=function(){return _0x5cd020;};return a42_0x5e11();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a43_0x2a8f(_0x5402cd,_0x555cca){_0x5402cd=_0x5402cd-0x1ea;const _0xfc617=a43_0xfc61();let _0x2a8feb=_0xfc617[_0x5402cd];return _0x2a8feb;}const a43_0x4ef11f=a43_0x2a8f;(function(_0x2b72bc,_0x4e92d8){const _0x16ed95=a43_0x2a8f,_0x1a67ff=_0x2b72bc();while(!![]){try{const _0x456d87=parseInt(_0x16ed95(0x1ea))/0x1+-parseInt(_0x16ed95(0x1eb))/0x2*(parseInt(_0x16ed95(0x1f4))/0x3)+parseInt(_0x16ed95(0x1f1))/0x4*(parseInt(_0x16ed95(0x203))/0x5)+-parseInt(_0x16ed95(0x1f0))/0x6*(-parseInt(_0x16ed95(0x1f5))/0x7)+-parseInt(_0x16ed95(0x204))/0x8+parseInt(_0x16ed95(0x1fd))/0x9+-parseInt(_0x16ed95(0x1fe))/0xa;if(_0x456d87===_0x4e92d8)break;else _0x1a67ff['push'](_0x1a67ff['shift']());}catch(_0x2a32c6){_0x1a67ff['push'](_0x1a67ff['shift']());}}}(a43_0xfc61,0x82cb5));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0xfc61(){const _0x313282=['bff','sqlName','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sdk','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','9069057DOrDqx','3536700lKCNDv','str','Omit\x20import\x20statements\x20from\x20generated\x20code','boolean','bool','140hzrwgW','6876040qzhfGR','936242RbijDj','28XKOYjA','appCode','target','codegen','string','18GxlgGa','13372zQvNmn','sqlCode','read','180813hNSrHy','1295427rDOgxB','no-imports','sql'];a43_0xfc61=function(){return _0x313282;};return a43_0xfc61();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x4ef11f(0x1ee),'command':a43_0x4ef11f(0x1f7),'description':a43_0x4ef11f(0x1fa),'risk':a43_0x4ef11f(0x1f3),'flags':[SQLCODE_FLAG,{'name':a43_0x4ef11f(0x1ed),'type':a43_0x4ef11f(0x1ef),'description':a43_0x4ef11f(0x1fc),'default':a43_0x4ef11f(0x1fb),'enum':[a43_0x4ef11f(0x1fb),a43_0x4ef11f(0x1f8)]},{'name':a43_0x4ef11f(0x1f6),'type':a43_0x4ef11f(0x201),'description':a43_0x4ef11f(0x200)}],async 'execute'(_0x44e50d){const _0x2be08f=a43_0x4ef11f,_0x554f8a=await getSqlQueryInfo(_0x44e50d[_0x2be08f(0x1ec)],_0x44e50d['str']('sqlcode')),_0x3d73b4=_0x44e50d[_0x2be08f(0x1ff)](_0x2be08f(0x1ed))||_0x2be08f(0x1fb),_0x448017=generateSqlCodeTemplate(_0x554f8a,{'target':_0x3d73b4,'includeImports':!_0x44e50d[_0x2be08f(0x202)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x554f8a[_0x2be08f(0x1f2)],'sqlName':_0x554f8a[_0x2be08f(0x1f9)],'target':_0x3d73b4,'code':_0x448017}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50b680,_0x27c731){const _0x477a8e=a44_0x515e,_0x817b01=_0x50b680();while(!![]){try{const _0x13c13d=-parseInt(_0x477a8e(0x10a))/0x1*(-parseInt(_0x477a8e(0xf6))/0x2)+-parseInt(_0x477a8e(0xfb))/0x3*(parseInt(_0x477a8e(0x105))/0x4)+parseInt(_0x477a8e(0x10d))/0x5*(parseInt(_0x477a8e(0x11f))/0x6)+parseInt(_0x477a8e(0x122))/0x7+-parseInt(_0x477a8e(0x100))/0x8*(-parseInt(_0x477a8e(0x108))/0x9)+parseInt(_0x477a8e(0x10f))/0xa*(-parseInt(_0x477a8e(0x117))/0xb)+-parseInt(_0x477a8e(0x123))/0xc*(parseInt(_0x477a8e(0xf8))/0xd);if(_0x13c13d===_0x27c731)break;else _0x817b01['push'](_0x817b01['shift']());}catch(_0x3d54ac){_0x817b01['push'](_0x817b01['shift']());}}}(a44_0x1792,0x4ded8));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a44_0x515e(_0x1cefc7,_0xba9bca){_0x1cefc7=_0x1cefc7-0xf6;const _0x179218=a44_0x1792();let _0x515eb2=_0x179218[_0x1cefc7];return _0x515eb2;}function a44_0x1792(){const _0x3763ae=['object','\x20Set\x20as\x20default\x20app.','globalConfig','appcode','21637mFpthH','projectConfig','\x20<name>','defaultApp','apps','trim','global','flagMissing','13830EgRBJo','Updated','\x22\x20still\x20defined\x20in\x20','1225308hQTzUc','636ILcAkX','2pllQkF','App\x20\x22','23439WwWgHA','project','args','23388qVjuus','\x22\x20not\x20found.','\x20Note:\x20app\x20\x22','boolean','\x20<name>\x20--appcode\x20<code>','338704NIOKEF','both','\x20<name>\x20[--global]','App\x20code','\x20app\x20\x22','16UUjNOC','Use\x20global\x20config\x20scope','\x22\x20(appcode:\x20','36PthEaa','validation','126505iYYcLo','keys','Missing\x20app\x20name.','620zJgZom','length','1580nujdam','Usage:\x20','bool','string'];a44_0x1792=function(){return _0x3763ae;};return a44_0x1792();}import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x47cecf=a44_0x515e;return[{'name':_0x47cecf(0x116),'type':_0x47cecf(0x112),'description':_0x47cecf(0x103),'required':!![]},{'name':'global','type':_0x47cecf(0xfe),'description':'Use\x20global\x20config\x20scope','default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x4f786b=a44_0x515e;return[{'name':'global','type':_0x4f786b(0xfe),'description':_0x4f786b(0x106),'default':![]}];}export async function validateAppName(_0x347e79,_0x2c789e){const _0x2da7d4=a44_0x515e,_0xef5d57=_0x347e79['args'][0x0]?.['trim']();if(!_0xef5d57)throw CliErrors[_0x2da7d4(0x109)](_0x2da7d4(0x10c),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x2c789e+_0x2da7d4(0x119));}export async function runAppAdd(_0x2ac82d,_0x1c0fc8){const _0x7ffe4c=a44_0x515e,_0x251ed0=_0x2ac82d[_0x7ffe4c(0xfa)][0x0]?.[_0x7ffe4c(0x11c)]();if(!_0x251ed0)throw CliErrors['validation'](_0x7ffe4c(0x10c),_0x7ffe4c(0x110)+CLI_BIN_NAME+'\x20'+_0x1c0fc8+'\x20<name>\x20--appcode\x20<code>');const _0x32bd2a=_0x2ac82d['str'](_0x7ffe4c(0x116));if(!_0x32bd2a)throw CliErrors[_0x7ffe4c(0x11e)](_0x7ffe4c(0x116),_0x7ffe4c(0x110)+CLI_BIN_NAME+'\x20'+_0x1c0fc8+_0x7ffe4c(0xff));const _0x28c2e7={'global':_0x2ac82d[_0x7ffe4c(0x111)](_0x7ffe4c(0x11d))},_0x575146=readConfig(_0x28c2e7);if(!_0x575146['apps'])_0x575146[_0x7ffe4c(0x11b)]={};const _0x2eca5f={'appcode':_0x32bd2a,...collectAppProfileOverrides(_0x231b1a=>_0x2ac82d['str'](_0x231b1a))},_0x3e692e=_0x575146[_0x7ffe4c(0x11b)],_0x289754=!!_0x3e692e[_0x251ed0];_0x3e692e[_0x251ed0]=_0x2eca5f;if(!_0x575146['defaultApp'])_0x575146[_0x7ffe4c(0x11a)]=_0x251ed0;writeConfig(_0x575146,_0x28c2e7);const _0x229d6c=!_0x289754&&_0x575146[_0x7ffe4c(0x11a)]===_0x251ed0?_0x7ffe4c(0x114):'',_0x309a7c=(_0x289754?_0x7ffe4c(0x120):'Added')+_0x7ffe4c(0x104)+_0x251ed0+_0x7ffe4c(0x107)+_0x32bd2a+')'+scopeLabel(_0x28c2e7)+'.'+_0x229d6c;return{'ok':!![],'message':_0x309a7c};}export async function runAppRemove(_0x29a5f0,_0x125818){const _0x4b3673=a44_0x515e,_0x327473=_0x29a5f0[_0x4b3673(0xfa)][0x0]?.['trim']();if(!_0x327473)throw CliErrors['validation']('Missing\x20app\x20name.',_0x4b3673(0x110)+CLI_BIN_NAME+'\x20'+_0x125818+_0x4b3673(0x102));const _0x4d6733=_0x29a5f0[_0x4b3673(0x111)]('global'),{config:_0x12277e,layers:_0x51aae7}=readRawConfigWithLayers(),_0x31e557=_0x12277e[_0x4b3673(0x11b)]??{};if(!_0x31e557[_0x327473])throw CliErrors[_0x4b3673(0x109)](_0x4b3673(0xf7)+_0x327473+'\x22\x20not\x20found.');const _0x35a218=_0x51aae7[_0x4b3673(0x115)][_0x4b3673(0x11b)]&&typeof _0x51aae7['globalConfig'][_0x4b3673(0x11b)]===_0x4b3673(0x113)?_0x51aae7[_0x4b3673(0x115)][_0x4b3673(0x11b)]:{},_0x1eb4e3=_0x51aae7[_0x4b3673(0x118)][_0x4b3673(0x11b)]&&typeof _0x51aae7['projectConfig'][_0x4b3673(0x11b)]===_0x4b3673(0x113)?_0x51aae7[_0x4b3673(0x118)][_0x4b3673(0x11b)]:{},_0xfebc69=appDefinedIn(_0x327473,_0x35a218,_0x1eb4e3,_0x51aae7['projectConfig']['inherit']===![]),_0x4bc038=resolveAppScopeForWrite(_0x327473,_0x4d6733,_0x51aae7),_0x541cab={'global':_0x4bc038===_0x4b3673(0x11d)},_0x3360ad=readConfig(_0x541cab),_0x365071=_0x3360ad[_0x4b3673(0x11b)];if(!_0x365071||!_0x365071[_0x327473])throw CliErrors[_0x4b3673(0x109)](_0x4b3673(0xf7)+_0x327473+_0x4b3673(0xfc));delete _0x365071[_0x327473];let _0x529e92='';if(_0x3360ad[_0x4b3673(0x11a)]===_0x327473){const _0x3fb652=Object[_0x4b3673(0x10b)](_0x365071);_0x3360ad['defaultApp']=_0x3fb652[_0x4b3673(0x10e)]>0x0?_0x3fb652[0x0]:undefined,_0x3360ad[_0x4b3673(0x11a)]?_0x529e92='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x3360ad[_0x4b3673(0x11a)]+'\x22.':delete _0x3360ad['defaultApp'];}Object[_0x4b3673(0x10b)](_0x365071)[_0x4b3673(0x10e)]===0x0&&(delete _0x3360ad[_0x4b3673(0x11b)],delete _0x3360ad[_0x4b3673(0x11a)]);writeConfig(_0x3360ad,_0x541cab);const _0x2867a9=_0xfebc69===_0x4b3673(0x101)?_0x4b3673(0xfd)+_0x327473+_0x4b3673(0x121)+(_0x4bc038==='project'?'global':_0x4b3673(0xf9))+'\x20config.':'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x327473+'\x22'+scopeLabel(_0x541cab)+'.'+_0x529e92+_0x2867a9};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x418a5d,_0x41bee5){const _0x4fa867=a45_0x2abc,_0x20bafe=_0x418a5d();while(!![]){try{const _0x5bef27=-parseInt(_0x4fa867(0x1b4))/0x1*(-parseInt(_0x4fa867(0x1a7))/0x2)+parseInt(_0x4fa867(0x195))/0x3+parseInt(_0x4fa867(0x1af))/0x4*(-parseInt(_0x4fa867(0x1ae))/0x5)+-parseInt(_0x4fa867(0x1a4))/0x6+parseInt(_0x4fa867(0x19f))/0x7+-parseInt(_0x4fa867(0x1a6))/0x8+parseInt(_0x4fa867(0x1a0))/0x9;if(_0x5bef27===_0x41bee5)break;else _0x20bafe['push'](_0x20bafe['shift']());}catch(_0x1a69d3){_0x20bafe['push'](_0x20bafe['shift']());}}}(a45_0x1480,0x25904));import{input,checkbox,select}from'@inquirer/prompts';function a45_0x2abc(_0x391e86,_0xec8c0d){_0x391e86=_0x391e86-0x193;const _0x148091=a45_0x1480();let _0x2abcbd=_0x148091[_0x391e86];return _0x2abcbd;}import a45_0x49309c 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';function a45_0x1480(){const _0x136de5=['skip','无法获取远程应用列表,请手动输入。','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','App\x20Code:','60BgHPtL','92528Yedhba','\x0a无法获取远程应用列表,请手动输入。','获取到\x20','message','custom','41687oxJGiQ','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','includes','338682vGgWOh','appName','yellow','gray','length','cyan','trim','Invalid\x20App\x20Code','appCode','find','1016561lXWivb','376713lKpZJb','manual','请输入\x20App\x20Code:','✎\x20手动输入','569514yvIlOu','✎\x20自定义输入\x20appcode','523360xSDnQp','14uiQXxU','map','正在获取可用应用列表...'];a45_0x1480=function(){return _0x136de5;};return a45_0x1480();}export async function promptCustomAppcode(){const _0x59e723=a45_0x2abc,_0x482744=await input({'message':_0x59e723(0x1a2),'validate':_0x1fa5c3=>{const _0x7f4c20=_0x59e723,_0x50e284=validateAppcode(_0x1fa5c3[_0x7f4c20(0x19b)]());return _0x50e284['valid']||_0x50e284[_0x7f4c20(0x1b2)]||_0x7f4c20(0x19c);}});return _0x482744[_0x59e723(0x19b)]();}export async function promptAppSelection(_0x23af55){const _0x18be17=a45_0x2abc,_0x36d90a=[{'name':a45_0x49309c['yellow']('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x23af55[_0x18be17(0x1a8)]((_0x14d911,_0x4598a7)=>({'name':_0x14d911[_0x18be17(0x196)]+'\x20\x20'+a45_0x49309c['gray']('('+_0x14d911[_0x18be17(0x19d)]+')'),'value':_0x4598a7}))],_0x459127=await checkbox({'message':_0x18be17(0x1b1)+a45_0x49309c[_0x18be17(0x19a)](_0x23af55[_0x18be17(0x199)])+'\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','choices':_0x36d90a,'loop':![]});if(_0x459127[_0x18be17(0x194)](-0x1))return _0x18be17(0x1b3);if(_0x459127[_0x18be17(0x199)]===0x0)return _0x18be17(0x1b3);return _0x459127[_0x18be17(0x1a8)](_0x20a0e8=>_0x23af55[_0x20a0e8]);}export async function promptSingleAppSelection(_0x215151){const _0x221f01=a45_0x2abc,_0x50075f=[{'name':a45_0x49309c[_0x221f01(0x198)](_0x221f01(0x193)),'value':'skip'},{'name':a45_0x49309c[_0x221f01(0x197)](_0x221f01(0x1a5)),'value':_0x221f01(0x1b3)},..._0x215151[_0x221f01(0x1a8)](_0x3705a9=>({'name':_0x3705a9[_0x221f01(0x196)]+'\x20\x20'+a45_0x49309c[_0x221f01(0x198)]('('+_0x3705a9[_0x221f01(0x19d)]+')'),'value':_0x3705a9[_0x221f01(0x19d)]}))],_0xb145a2=await select({'message':'请选择要绑定的应用:','choices':_0x50075f});if(_0xb145a2===_0x221f01(0x1aa))return _0x221f01(0x1aa);if(_0xb145a2===_0x221f01(0x1b3))return'custom';return _0x215151[_0x221f01(0x19e)](_0x3ec423=>_0x3ec423[_0x221f01(0x19d)]===_0xb145a2);}export async function selectSingleAppcode(_0x3e0378){const _0x2c479f=a45_0x2abc;if(!_0x3e0378)return writeCliSideChannelLine(a45_0x49309c[_0x2c479f(0x198)](_0x2c479f(0x1ac))),_fallbackOrSkip();writeCliSideChannelLine(_0x2c479f(0x1a9));let _0x155650;try{_0x155650=await withActiveCookie(_0x3e0378,()=>listRemoteApps());}catch(_0x3547c1){writeCliSideChannelLine(a45_0x49309c[_0x2c479f(0x197)](_0x2c479f(0x1ab)));if(_0x3547c1 instanceof Error)writeCliSideChannelLine(a45_0x49309c['gray']('\x20\x20('+_0x3547c1['message']+')'));return _fallbackOrSkip();}if(_0x155650[_0x2c479f(0x199)]===0x0)return writeCliSideChannelLine(a45_0x49309c[_0x2c479f(0x197)]('未找到可用应用。')),_fallbackOrSkip();const _0x43f3df=await promptSingleAppSelection(_0x155650);if(_0x43f3df===_0x2c479f(0x1aa))return'';if(_0x43f3df===_0x2c479f(0x1b3))return promptCustomAppcode();return _0x43f3df['appCode'];}export async function selectMultipleApps(_0x24a7f8){const _0x433a37=a45_0x2abc;writeCliSideChannelLine(_0x433a37(0x1a9));let _0x26e52e;try{_0x26e52e=await withActiveCookie(_0x24a7f8,()=>listRemoteApps());}catch(_0x257f57){writeCliSideChannelLine(_0x433a37(0x1b0));if(_0x257f57 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x257f57[_0x433a37(0x1b2)]+')');return _0x433a37(0x1b3);}if(_0x26e52e[_0x433a37(0x199)]===0x0)return writeCliSideChannelLine('\x0a未找到可用应用。'),_0x433a37(0x1b3);return promptAppSelection(_0x26e52e);}async function _fallbackOrSkip(){const _0x36fd72=a45_0x2abc,_0x11eb1e=await select({'message':_0x36fd72(0x1ad),'choices':[{'name':a45_0x49309c['gray']('(跳过,稍后配置)'),'value':_0x36fd72(0x1aa)},{'name':a45_0x49309c[_0x36fd72(0x197)](_0x36fd72(0x1a3)),'value':_0x36fd72(0x1a1)}]});if(_0x11eb1e===_0x36fd72(0x1aa))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x461330=a46_0x1b3b;function a46_0x1b3b(_0x1146c6,_0x44a25b){_0x1146c6=_0x1146c6-0x154;const _0x4e7143=a46_0x4e71();let _0x1b3b59=_0x4e7143[_0x1146c6];return _0x1b3b59;}function a46_0x4e71(){const _0x334dcd=['SUCCESS','3056409WfRMZI','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','121CtFcgW','taskId','\x20--appcode\x20','22254CHiGYI','\x20completed\x20successfully.','20576TdBCxo','4705992EyVgin','\x20task\x20status\x20--task-id\x20','1145BonIWY','has','\x20response\x20did\x20not\x20contain\x20a\x20status.','\x20--format\x20compress','\x20is\x20processing.','\x20returned\x20unknown\x20status\x20','status','\x27\x5c\x27\x27','PROCESSING','4pTMThy','707459MeNPSY','trim','PENDING','Task\x20','5598iZYNkE','304598sxQczg','4110970VROvAJ','string','\x20failed.','FAILED','\x20is\x20pending.','errorMessage'];a46_0x4e71=function(){return _0x334dcd;};return a46_0x4e71();}(function(_0x3e8e31,_0x4cd398){const _0x312706=a46_0x1b3b,_0x3166fa=_0x3e8e31();while(!![]){try{const _0x5c7c37=-parseInt(_0x312706(0x154))/0x1*(parseInt(_0x312706(0x174))/0x2)+-parseInt(_0x312706(0x161))/0x3+parseInt(_0x312706(0x169))/0x4+-parseInt(_0x312706(0x16b))/0x5*(parseInt(_0x312706(0x166))/0x6)+parseInt(_0x312706(0x159))/0x7+parseInt(_0x312706(0x168))/0x8*(-parseInt(_0x312706(0x158))/0x9)+-parseInt(_0x312706(0x15a))/0xa*(-parseInt(_0x312706(0x163))/0xb);if(_0x5c7c37===_0x4cd398)break;else _0x3166fa['push'](_0x3166fa['shift']());}catch(_0x1cd99b){_0x3166fa['push'](_0x3166fa['shift']());}}}(a46_0x4e71,0xd1c4d));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x461330(0x160),'FAILED']),NON_TERMINAL_STATUSES=new Set([a46_0x461330(0x156),a46_0x461330(0x173)]);export function normalizeAsyncTask(_0x201c35){const _0x3d055c=a46_0x461330,_0x385c23=typeof _0x201c35?.[_0x3d055c(0x164)]===_0x3d055c(0x15b)?_0x201c35[_0x3d055c(0x164)][_0x3d055c(0x155)]():'';if(!_0x385c23)throw CliErrors['apiError'](_0x3d055c(0x162));const _0x3bf28e=typeof _0x201c35[_0x3d055c(0x171)]===_0x3d055c(0x15b)?_0x201c35['status'][_0x3d055c(0x155)]()['toUpperCase']():'';if(!_0x3bf28e)throw CliErrors['apiError']('Async\x20task\x20'+_0x385c23+_0x3d055c(0x16d));return{'taskId':_0x385c23,'status':_0x3bf28e,'errorMessage':typeof _0x201c35[_0x3d055c(0x15f)]===_0x3d055c(0x15b)&&_0x201c35[_0x3d055c(0x15f)][_0x3d055c(0x155)]()?_0x201c35[_0x3d055c(0x15f)][_0x3d055c(0x155)]():null,'isTerminal':TERMINAL_STATUSES['has'](_0x3bf28e),'knownStatus':TERMINAL_STATUSES[_0x3d055c(0x16c)](_0x3bf28e)||NON_TERMINAL_STATUSES[_0x3d055c(0x16c)](_0x3bf28e)};}export function buildAsyncTaskStatusCommand(_0x397576,_0x59eb32){const _0xab94f7=a46_0x461330;return CLI_BIN_NAME+_0xab94f7(0x16a)+quoteShellArg(_0x397576)+_0xab94f7(0x165)+quoteShellArg(_0x59eb32)+_0xab94f7(0x16e);}export function asyncTaskMessage(_0x25f228){const _0x4679e8=a46_0x461330;switch(_0x25f228[_0x4679e8(0x171)]){case'PENDING':return'Task\x20'+_0x25f228[_0x4679e8(0x164)]+_0x4679e8(0x15e);case'PROCESSING':return _0x4679e8(0x157)+_0x25f228[_0x4679e8(0x164)]+_0x4679e8(0x16f);case _0x4679e8(0x160):return'Task\x20'+_0x25f228[_0x4679e8(0x164)]+_0x4679e8(0x167);case _0x4679e8(0x15d):return _0x25f228['errorMessage']?_0x4679e8(0x157)+_0x25f228[_0x4679e8(0x164)]+'\x20failed:\x20'+_0x25f228[_0x4679e8(0x15f)]:_0x4679e8(0x157)+_0x25f228['taskId']+_0x4679e8(0x15c);default:return _0x4679e8(0x157)+_0x25f228[_0x4679e8(0x164)]+_0x4679e8(0x170)+_0x25f228[_0x4679e8(0x171)]+'.';}}function quoteShellArg(_0xfbd81e){const _0x4981fe=a46_0x461330;return'\x27'+_0xfbd81e['replace'](/'/g,_0x4981fe(0x172))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0xf4f8(_0x426451,_0x4d3a39){_0x426451=_0x426451-0x156;var _0x237dc2=a47_0x237d();var _0xf4f864=_0x237dc2[_0x426451];return _0xf4f864;}function a47_0x237d(){var _0x554813=['1569576vlcLxU','11622664wTqvpP','2224220XbTFMm','method','1856PBKYpF','1187984xUSJVH','952195bRfGpO','1690032yrimWP','defineProperties','description','593oYmDoE'];a47_0x237d=function(){return _0x554813;};return a47_0x237d();}(function(_0x2ffc76,_0x4b1771){var _0x271805=a47_0xf4f8,_0x492a8f=_0x2ffc76();while(!![]){try{var _0x1a8fe1=parseInt(_0x271805(0x15d))/0x1*(-parseInt(_0x271805(0x157))/0x2)+-parseInt(_0x271805(0x15e))/0x3+parseInt(_0x271805(0x160))/0x4+-parseInt(_0x271805(0x159))/0x5+-parseInt(_0x271805(0x15a))/0x6+-parseInt(_0x271805(0x158))/0x7+parseInt(_0x271805(0x15f))/0x8;if(_0x1a8fe1===_0x4b1771)break;else _0x492a8f['push'](_0x492a8f['shift']());}catch(_0x185929){_0x492a8f['push'](_0x492a8f['shift']());}}}(a47_0x237d,0x47ac1));export function asDryRunResult(_0x34be26,_0x1c7de4){var _0x7c7308=a47_0xf4f8;return Object[_0x7c7308(0x15b)](_0x34be26,{'method':{'value':_0x1c7de4[_0x7c7308(0x156)],'enumerable':![]},'url':{'value':_0x1c7de4['url'],'enumerable':![]},..._0x1c7de4[_0x7c7308(0x15c)]?{'description':{'value':_0x1c7de4['description'],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a48_0x495a(){const _0x1825cf=['Database\x20product\x20type','120868DztmVK','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','46386wdPaFA','sqlcode','App\x20code\x20(e.g.\x20app-xxxxx)','229184oSzhnO','dbtype','263782VHNCnr','POSTGRESQL','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','4383981swyGQA','string','119hMgkih','185874HtCJQs','35ESHyMF','Dataset\x20code\x20(32-char\x20hex\x20UUID)','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','13576TGqzyZ','code','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','number'];a48_0x495a=function(){return _0x1825cf;};return a48_0x495a();}const a48_0x314528=a48_0x4222;(function(_0x2a08ac,_0x34dfe0){const _0x516ac0=a48_0x4222,_0x4f410f=_0x2a08ac();while(!![]){try{const _0x1f3c42=-parseInt(_0x516ac0(0x9e))/0x1+-parseInt(_0x516ac0(0xa0))/0x2+-parseInt(_0x516ac0(0xa6))/0x3+-parseInt(_0x516ac0(0xaf))/0x4+parseInt(_0x516ac0(0xa7))/0x5*(parseInt(_0x516ac0(0x9b))/0x6)+parseInt(_0x516ac0(0xa5))/0x7*(parseInt(_0x516ac0(0xaa))/0x8)+parseInt(_0x516ac0(0xa3))/0x9;if(_0x1f3c42===_0x34dfe0)break;else _0x4f410f['push'](_0x4f410f['shift']());}catch(_0x1177ce){_0x4f410f['push'](_0x4f410f['shift']());}}}(a48_0x495a,0x1c859));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a48_0x314528(0xa9)};export const CODE_FLAG={'name':a48_0x314528(0xab),'type':'string','required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a48_0x314528(0xa8)};export const SQLCODE_FLAG={'name':a48_0x314528(0x9c),'type':a48_0x314528(0xa4),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x314528(0xa2)}};export const APPCODE_FLAG_OPTIONAL={'name':'appcode','type':a48_0x314528(0xa4),'required':![],'description':a48_0x314528(0xac)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x314528(0x9d)};function a48_0x4222(_0x5472ca,_0x20f4f5){_0x5472ca=_0x5472ca-0x9a;const _0x495ab8=a48_0x495a();let _0x4222c1=_0x495ab8[_0x5472ca];return _0x4222c1;}export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x314528(0xad),'required':!![],'description':a48_0x314528(0x9a)};export const DB_TYPE_FLAG={'name':a48_0x314528(0x9f),'type':a48_0x314528(0xa4),'required':!![],'description':a48_0x314528(0xae),'enum':['MYSQL',a48_0x314528(0xa1)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5bdbdf,_0xd08a30){const _0x27ec6b=a49_0x23a8,_0x17c76c=_0x5bdbdf();while(!![]){try{const _0x15436a=-parseInt(_0x27ec6b(0x1bd))/0x1*(-parseInt(_0x27ec6b(0x1be))/0x2)+parseInt(_0x27ec6b(0x1cb))/0x3+-parseInt(_0x27ec6b(0x1ba))/0x4+-parseInt(_0x27ec6b(0x1c2))/0x5+parseInt(_0x27ec6b(0x1cd))/0x6+parseInt(_0x27ec6b(0x1cc))/0x7*(-parseInt(_0x27ec6b(0x1c4))/0x8)+-parseInt(_0x27ec6b(0x1ca))/0x9*(-parseInt(_0x27ec6b(0x1c6))/0xa);if(_0x15436a===_0xd08a30)break;else _0x17c76c['push'](_0x17c76c['shift']());}catch(_0x5268aa){_0x17c76c['push'](_0x17c76c['shift']());}}}(a49_0x3edc,0x3da50));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';function a49_0x23a8(_0x325263,_0x533647){_0x325263=_0x325263-0x1ba;const _0x3edc09=a49_0x3edc();let _0x23a83=_0x3edc09[_0x325263];return _0x23a83;}const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x539191){const _0x340095=a49_0x23a8;if(_0x539191>=BYTES_PER_MB){const _0x351e61=Math[_0x340095(0x1c1)](_0x539191/BYTES_PER_MB*0x64)/0x64;return _0x351e61[_0x340095(0x1bb)](0x2)+_0x340095(0x1c3);}return _0x539191+'\x20B';}function a49_0x3edc(){const _0x4999f7=['7rWFLnf','699258qvgJax','768548hXsifm','toFixed','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','1jfugjg','847142EBIMup','File\x20not\x20found:\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','ceil','1265655qvmhEE','\x20MB','1236952wqGstL','\x20path\x20is\x20required.','10Gpeqdk','validation','size','isFile','2511846qjYUki','99525hDzCSN'];a49_0x3edc=function(){return _0x4999f7;};return a49_0x3edc();}export function requireDevelopmentUploadFile(_0x1aa767,_0x120e35){const _0x21b033=a49_0x23a8,_0x3276b1=_0x1aa767['trim']();if(!_0x3276b1)throw CliErrors[_0x21b033(0x1c7)](_0x120e35+_0x21b033(0x1c5));if(!existsSync(_0x3276b1))throw CliErrors[_0x21b033(0x1c7)](_0x21b033(0x1bf)+_0x3276b1);const _0x9cd456=statSync(_0x3276b1);if(!_0x9cd456[_0x21b033(0x1c9)]())throw CliErrors['validation'](_0x21b033(0x1c0)+_0x3276b1);if(_0x9cd456[_0x21b033(0x1c8)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x21b033(0x1c7)](_0x21b033(0x1bc)+_0x3276b1+'\x20('+formatBytes(_0x9cd456[_0x21b033(0x1c8)])+')');return{'path':_0x3276b1,'size':_0x9cd456[_0x21b033(0x1c8)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a50_0x226e(_0x8c1141,_0x30b486){_0x8c1141=_0x8c1141-0x92;const _0x518825=a50_0x5188();let _0x226ee5=_0x518825[_0x8c1141];return _0x226ee5;}function a50_0x5188(){const _0x4f319c=['Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','2157576WFlwSz','App\x20Code\x20cannot\x20exceed\x20100\x20characters','length','23lBntQr','test','37953245yUgTar','5226486lmXFou','8934247EwEFLB','2071340kXHwcA','App\x20Code\x20cannot\x20be\x20empty','trim','27jsbIWd','5862780qQoEqf','51950JTHuzd','10LytKuA','8wZTVcv'];a50_0x5188=function(){return _0x4f319c;};return a50_0x5188();}(function(_0x998212,_0x9b6b7a){const _0xbc91ad=a50_0x226e,_0x170d6e=_0x998212();while(!![]){try{const _0x138681=-parseInt(_0xbc91ad(0x97))/0x1*(-parseInt(_0xbc91ad(0xa1))/0x2)+-parseInt(_0xbc91ad(0x9a))/0x3+parseInt(_0xbc91ad(0x94))/0x4*(-parseInt(_0xbc91ad(0xa2))/0x5)+-parseInt(_0xbc91ad(0xa0))/0x6+-parseInt(_0xbc91ad(0x9b))/0x7*(-parseInt(_0xbc91ad(0x92))/0x8)+-parseInt(_0xbc91ad(0x9f))/0x9*(parseInt(_0xbc91ad(0x9c))/0xa)+parseInt(_0xbc91ad(0x99))/0xb;if(_0x138681===_0x9b6b7a)break;else _0x170d6e['push'](_0x170d6e['shift']());}catch(_0x16eee7){_0x170d6e['push'](_0x170d6e['shift']());}}}(a50_0x5188,0xdcd6f));export function validateAppcode(_0x39d388){const _0x38c437=a50_0x226e,_0x470cca=_0x39d388[_0x38c437(0x9e)]();if(!_0x470cca)return{'valid':![],'message':_0x38c437(0x9d)};if(_0x470cca[_0x38c437(0x96)]>0x64)return{'valid':![],'message':_0x38c437(0x95)};if(!/^[A-Za-z0-9_-]+$/[_0x38c437(0x98)](_0x470cca))return{'valid':![],'message':_0x38c437(0x93)};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x605cab=a51_0x49d2;(function(_0x1d9ded,_0x54cbb7){const _0x5ddf24=a51_0x49d2,_0x34adaf=_0x1d9ded();while(!![]){try{const _0x3bb949=parseInt(_0x5ddf24(0x1a8))/0x1+parseInt(_0x5ddf24(0x196))/0x2*(parseInt(_0x5ddf24(0x1a2))/0x3)+parseInt(_0x5ddf24(0x19a))/0x4+-parseInt(_0x5ddf24(0x197))/0x5*(-parseInt(_0x5ddf24(0x198))/0x6)+parseInt(_0x5ddf24(0x1a1))/0x7+-parseInt(_0x5ddf24(0x1a3))/0x8+-parseInt(_0x5ddf24(0x1aa))/0x9*(-parseInt(_0x5ddf24(0x1a7))/0xa);if(_0x3bb949===_0x54cbb7)break;else _0x34adaf['push'](_0x34adaf['shift']());}catch(_0x384a4f){_0x34adaf['push'](_0x34adaf['shift']());}}}(a51_0x2e27,0xd7713));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';function a51_0x49d2(_0x2bd779,_0x403310){_0x2bd779=_0x2bd779-0x195;const _0x2e27fb=a51_0x2e27();let _0x49d272=_0x2e27fb[_0x2bd779];return _0x49d272;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';function a51_0x2e27(){const _0x226b34=['95538caWFRe','key','627596RWGakq','Get\x20a\x20config\x20value\x20by\x20key','Missing\x20key.','app','Key\x20not\x20found:\x20','object','\x20config\x20get\x20--key\x20<key>','5198375QtZCpu','10593KaiuiY','12765160ouyZGB','read','config','Usage:\x20','1643520DPAksV','191464fkjtZq','str','63oIfNwy','validation','116rZZizl','10IPfVix'];a51_0x2e27=function(){return _0x226b34;};return a51_0x2e27();}async function execute(_0x37343e){const _0x37a1ac=a51_0x49d2,_0x37af1f=_0x37343e[_0x37a1ac(0x1a9)]('key');if(!_0x37af1f)throw CliErrors[_0x37a1ac(0x195)](_0x37a1ac(0x19c),_0x37a1ac(0x1a6)+CLI_BIN_NAME+_0x37a1ac(0x1a0));const _0x443ba3=readConfig(),_0x3d0b2a=_0x37af1f===_0x37a1ac(0x19d)?'appcode':_0x37af1f,_0x25b9e3=_0x443ba3[_0x3d0b2a];if(_0x25b9e3===undefined)throw CliErrors['validation'](_0x37a1ac(0x19e)+_0x37af1f);return{'ok':!![],'data':typeof _0x25b9e3===_0x37a1ac(0x19f)?_0x25b9e3:{[_0x3d0b2a]:_0x25b9e3},'message':typeof _0x25b9e3==='object'?undefined:String(_0x25b9e3)};}export const configGetDefinition={'service':a51_0x605cab(0x1a5),'command':'get','description':a51_0x605cab(0x19b),'risk':a51_0x605cab(0x1a4),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a51_0x605cab(0x199),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|