@lovrabet/rabetbase-cli 2.3.7 → 2.3.8
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/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/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/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/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/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-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x478cc0=a36_0x375c;(function(_0x5ad967,_0x5a7d1c){const _0x436cc1=a36_0x375c,_0xaa15f7=_0x5ad967();while(!![]){try{const _0x45997e=parseInt(_0x436cc1(0x1fe))/0x1+parseInt(_0x436cc1(0x1cc))/0x2+parseInt(_0x436cc1(0x1d2))/0x3*(parseInt(_0x436cc1(0x1ff))/0x4)+-parseInt(_0x436cc1(0x1f9))/0x5*(parseInt(_0x436cc1(0x1f8))/0x6)+parseInt(_0x436cc1(0x1c4))/0x7*(-parseInt(_0x436cc1(0x1e2))/0x8)+parseInt(_0x436cc1(0x1d8))/0x9*(-parseInt(_0x436cc1(0x204))/0xa)+parseInt(_0x436cc1(0x202))/0xb*(parseInt(_0x436cc1(0x1d0))/0xc);if(_0x45997e===_0x5a7d1c)break;else _0xaa15f7['push'](_0xaa15f7['shift']());}catch(_0x2ff9d8){_0xaa15f7['push'](_0xaa15f7['shift']());}}}(a36_0x2e59,0xa7f52));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';function a36_0x375c(_0x47483d,_0x200b1b){_0x47483d=_0x47483d-0x1c3;const _0x2e5943=a36_0x2e59();let _0x375cd0=_0x2e5943[_0x47483d];return _0x375cd0;}import{loadBffProjectConfig}from'../../core/bff/config.js';function a36_0x2e59(){const _0x4ea1f1=['lockFilePath','force','286734RCwxXQ','1504708GxOqgS','bff','lastSync','5947931XIJGhk','Remote\x20script\x20missing\x20id.','4332990TMRgjh','toISOString','Pull\x20only\x20this\x20script\x20type','Force\x20overwrite\x20local\x20unsynced\x20changes','259133vPJccT','push','skipped','\x22\x20not\x20found\x20after\x20ensureLockScope.','trim','type','/api/management/library/scripts/list?appCode=','utf8','1733300PJEGhq','would_pull','cancelled','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','24ZgKeoW','functionNode','3nlpOQV','functions','local\x20unsynced\x20changes','alias','pull','\x20skipped,\x20','9INdkPk','length','unresolvable\x20target\x20path','Force\x20pull\x20cancelled.','Pull\x20complete:\x20','all','includes','yes','parse','hash','56mLmgiQ','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','stderr','HOOK','functionName','toLowerCase','appCode','scriptContent','datasetCode','boolean','\x20failed','operationType','filePath','apiDir','message','lockKey','str','Remote\x20script\x20missing\x20content.','scriptType','scriptsRoot','GET','ENDPOINT','7383702zBaQcb','5TzigWf','hookLocation','apps'];a36_0x2e59=function(){return _0x4ea1f1;};return a36_0x2e59();}import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x478cc0(0x200),'command':a36_0x478cc0(0x1d6),'description':a36_0x478cc0(0x1cf),'risk':'write','flags':[{'name':a36_0x478cc0(0x1c9),'type':'string','description':a36_0x478cc0(0x206),'enum':['COMMON',a36_0x478cc0(0x1f7),a36_0x478cc0(0x1e5)]},{'name':a36_0x478cc0(0x1fd),'type':a36_0x478cc0(0x1eb),'description':a36_0x478cc0(0x1c3)}],async 'dryRun'(_0x375f5f){const _0x4ee112=a36_0x478cc0,_0x4b0912=loadBffProjectConfig(_0x375f5f[_0x4ee112(0x1e8)]),_0x2949a2=await readBffLockFile(_0x4b0912[_0x4ee112(0x1fc)]),{appLock:_0x3a5f31}=ensureLockScope(_0x2949a2??createEmptyBffLock(),_0x375f5f[_0x4ee112(0x1e8)],_0x4b0912[_0x4ee112(0x1f5)],_0x4ee112(0x1d6)),_0x1d4b76=normalizeBffType(_0x375f5f[_0x4ee112(0x1f2)](_0x4ee112(0x1c9)))??undefined,_0x518930=buildDatasetCodeToAliasMap(_0x375f5f[_0x4ee112(0x1ef)],_0x375f5f[_0x4ee112(0x1e8)]),[_0x25cbd6,_0x5cc1dd]=await Promise[_0x4ee112(0x1dd)]([listBffScripts(_0x375f5f[_0x4ee112(0x1e8)],_0x1d4b76),getBffScriptStatistics(_0x375f5f[_0x4ee112(0x1e8)])]),_0x39648d=createHookLocationMap(_0x5cc1dd),_0x174391=[];for(const _0x2270bc of _0x25cbd6){const _0x3eefda=resolveRemoteScriptTarget(_0x4b0912,_0x2270bc,_0x39648d,_0x3a5f31['functions'],_0x518930);if(!_0x3eefda){_0x174391[_0x4ee112(0x1c5)]({'scriptType':_0x2270bc[_0x4ee112(0x1f4)],'functionName':_0x2270bc['functionName']??'','status':_0x4ee112(0x1c6),'reason':_0x4ee112(0x1da)});continue;}const _0x43fcbc=_0x3a5f31[_0x4ee112(0x1d3)][_0x3eefda[_0x4ee112(0x1f1)]],_0x1dba1e=_0x2270bc[_0x4ee112(0x1e9)]!=null?computeContentHash(_0x2270bc['scriptContent']):undefined,_0x25513d=await hasUnsyncedLocalChanges(_0x3eefda[_0x4ee112(0x1ee)],_0x43fcbc,_0x1dba1e);_0x174391[_0x4ee112(0x1c5)]({'lockKey':_0x3eefda[_0x4ee112(0x1f1)],'filePath':_0x3eefda[_0x4ee112(0x1ee)],'remoteId':_0x2270bc['id']??null,'status':_0x25513d?'conflict':_0x4ee112(0x1cd)});}return{'method':_0x4ee112(0x1f6),'url':_0x4ee112(0x1ca)+_0x375f5f[_0x4ee112(0x1e8)]+(_0x1d4b76?'&type='+_0x1d4b76:''),'body':{'appCode':_0x375f5f[_0x4ee112(0x1e8)],'filterType':_0x1d4b76??null,'files':_0x174391},'description':'Would\x20inspect\x20'+_0x174391[_0x4ee112(0x1d9)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0xec66e0){const _0x9a42a3=a36_0x478cc0,_0x59007e=loadBffProjectConfig(_0xec66e0[_0x9a42a3(0x1e8)]),_0x2ed966=await readBffLockFile(_0x59007e[_0x9a42a3(0x1fc)]),{lockData:_0x206da2,appLock:_0x5dd735}=ensureLockScope(_0x2ed966??createEmptyBffLock(),_0xec66e0['appCode'],_0x59007e['scriptsRoot'],_0x9a42a3(0x1d6)),_0x3bb268=normalizeBffType(_0xec66e0[_0x9a42a3(0x1f2)](_0x9a42a3(0x1c9)))??undefined;if(_0xec66e0[_0x9a42a3(0x1f2)](_0x9a42a3(0x1c9))&&!_0x3bb268)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x1c0b7c,_0x5a0160]=await Promise[_0x9a42a3(0x1dd)]([listBffScripts(_0xec66e0[_0x9a42a3(0x1e8)],_0x3bb268),getBffScriptStatistics(_0xec66e0[_0x9a42a3(0x1e8)])]);if(_0x1c0b7c[_0x9a42a3(0x1d9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x406014=_0xec66e0['bool'](_0x9a42a3(0x1fd));if(_0x406014&&!_0xec66e0['nonInteractive']){const _0xfca6f5=await confirmForce();if(!_0xfca6f5)throw CliErrors[_0x9a42a3(0x1ce)](_0x9a42a3(0x1db));}if(_0x406014&&_0xec66e0['nonInteractive']){}const _0x4b03af=buildDatasetCodeToAliasMap(_0xec66e0[_0x9a42a3(0x1ef)],_0xec66e0[_0x9a42a3(0x1e8)]),_0x495fe8=createHookLocationMap(_0x5a0160),_0x307e07=JSON[_0x9a42a3(0x1e0)](JSON['stringify'](_0x206da2)),_0x578a80=_0xec66e0[_0x9a42a3(0x1e8)],_0x14d0cd=_0x307e07[_0x9a42a3(0x1fb)][_0x578a80];if(!_0x14d0cd)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x578a80+_0x9a42a3(0x1c7));const _0x4bb2df=[],_0x1ed0c9=[],_0x1c3137=[];for(const _0x59ff70 of _0x1c0b7c){const _0x4b971b=resolveRemoteScriptTarget(_0x59007e,_0x59ff70,_0x495fe8,_0x5dd735['functions'],_0x4b03af);if(!_0x4b971b){_0x1ed0c9['push']({'lockKey':_0x59ff70['scriptType']+'/'+_0x59ff70[_0x9a42a3(0x1e6)],'reason':_0x9a42a3(0x1da)});continue;}const _0x20a2ae=_0x5dd735[_0x9a42a3(0x1d3)][_0x4b971b[_0x9a42a3(0x1f1)]];try{if(!_0x59ff70['id'])throw new Error(_0x9a42a3(0x203));if(_0x59ff70[_0x9a42a3(0x1e9)]==null)throw new Error(_0x9a42a3(0x1f3));const _0x2de2bf=_0x59ff70[_0x9a42a3(0x1e9)],_0x412afe=computeContentHash(_0x2de2bf);if(!_0x406014){const _0x37d8da=await hasUnsyncedLocalChanges(_0x4b971b[_0x9a42a3(0x1ee)],_0x20a2ae,_0x412afe);if(_0x37d8da){_0x1ed0c9['push']({'lockKey':_0x4b971b[_0x9a42a3(0x1f1)],'reason':_0x9a42a3(0x1d4)});continue;}}await ensureParentDirectory(_0x4b971b[_0x9a42a3(0x1ee)]),await writeFile(_0x4b971b['filePath'],_0x2de2bf,_0x9a42a3(0x1cb));const _0x2bafdd={'hash':_0x412afe,'remoteId':_0x59ff70['id'],'version':_0x59ff70['version']};_0x4b971b['type']===_0x9a42a3(0x1e5)&&_0x4b971b['hookLocation']&&(_0x2bafdd[_0x9a42a3(0x1d5)]=_0x4b971b[_0x9a42a3(0x1fa)][_0x9a42a3(0x1d5)],_0x2bafdd[_0x9a42a3(0x1ea)]=_0x4b971b[_0x9a42a3(0x1fa)][_0x9a42a3(0x1ea)],_0x2bafdd[_0x9a42a3(0x1ed)]=_0x4b971b['hookLocation']['operationType'],_0x2bafdd[_0x9a42a3(0x1d1)]=_0x4b971b['hookLocation'][_0x9a42a3(0x1d1)]),_0x14d0cd[_0x9a42a3(0x1d3)][_0x4b971b[_0x9a42a3(0x1f1)]]=_0x2bafdd,_0x4bb2df['push']({'lockKey':_0x4b971b['lockKey'],'remoteId':_0x59ff70['id']});}catch(_0x6b1259){_0x1c3137[_0x9a42a3(0x1c5)]({'lockKey':_0x4b971b[_0x9a42a3(0x1f1)],'error':_0x6b1259 instanceof Error?_0x6b1259[_0x9a42a3(0x1f0)]:String(_0x6b1259)});}}return _0x14d0cd[_0x9a42a3(0x201)]=new Date()[_0x9a42a3(0x205)](),await writeBffLockFile(_0x59007e[_0x9a42a3(0x1fc)],_0x307e07),{'ok':_0x1c3137[_0x9a42a3(0x1d9)]===0x0,'data':{'pulled':_0x4bb2df,'skipped':_0x1ed0c9,'failed':_0x1c3137},'message':_0x9a42a3(0x1dc)+_0x4bb2df[_0x9a42a3(0x1d9)]+'\x20pulled,\x20'+_0x1ed0c9[_0x9a42a3(0x1d9)]+_0x9a42a3(0x1d7)+_0x1c3137[_0x9a42a3(0x1d9)]+_0x9a42a3(0x1ec)};}};async function hasUnsyncedLocalChanges(_0x389e56,_0x2b3b4c,_0x20be0b){const _0x2a65cf=a36_0x478cc0;if(!await fileExists(_0x389e56))return![];const _0x337fed=await computeFileHash(_0x389e56);if(!_0x2b3b4c)return _0x20be0b?_0x337fed!==_0x20be0b:!![];return _0x337fed!==_0x2b3b4c[_0x2a65cf(0x1e1)];}function buildDatasetCodeToAliasMap(_0x325465,_0x43b661){const _0x319ee0=a36_0x478cc0,_0x359677=loadAliasMap(_0x325465,undefined,resolveApiFilePath(_0x325465,_0x43b661));return new Map(_0x359677['map'](_0x5513b6=>[_0x5513b6[_0x319ee0(0x1ea)],_0x5513b6[_0x319ee0(0x1d5)]]));}async function confirmForce(){const _0x2c6d06=a36_0x478cc0,_0x36bbf4=createInterface({'input':process['stdin'],'output':process[_0x2c6d06(0x1e4)]}),_0x28b9ca=await new Promise(_0x24f6e7=>{const _0x1408df=_0x2c6d06;_0x36bbf4['question'](_0x1408df(0x1e3),_0x24f6e7);});return _0x36bbf4['close'](),['y',_0x2c6d06(0x1df)][_0x2c6d06(0x1de)](_0x28b9ca[_0x2c6d06(0x1c8)]()[_0x2c6d06(0x1e7)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x2a8a5c=a37_0x2526;(function(_0x3597e5,_0x3fd1a6){const _0x143a23=a37_0x2526,_0x222930=_0x3597e5();while(!![]){try{const _0x1eef2b=parseInt(_0x143a23(0x12c))/0x1*(-parseInt(_0x143a23(0x148))/0x2)+parseInt(_0x143a23(0x113))/0x3*(parseInt(_0x143a23(0x137))/0x4)+parseInt(_0x143a23(0x13e))/0x5*(-parseInt(_0x143a23(0x114))/0x6)+-parseInt(_0x143a23(0x151))/0x7*(parseInt(_0x143a23(0x11c))/0x8)+-parseInt(_0x143a23(0x115))/0x9*(-parseInt(_0x143a23(0x13f))/0xa)+-parseInt(_0x143a23(0x11d))/0xb*(parseInt(_0x143a23(0x14e))/0xc)+parseInt(_0x143a23(0x135))/0xd;if(_0x1eef2b===_0x3fd1a6)break;else _0x222930['push'](_0x222930['shift']());}catch(_0x3229ec){_0x222930['push'](_0x222930['shift']());}}}(a37_0x555b,0xae622));import{readFile}from'node:fs/promises';function a37_0x2526(_0x488074,_0x46fcb1){_0x488074=_0x488074-0xff;const _0x555be5=a37_0x555b();let _0x2526ea=_0x555be5[_0x488074];return _0x2526ea;}import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x2a8a5c(0x136),'command':a37_0x2a8a5c(0x111),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a37_0x2a8a5c(0x10b),'flags':[{'name':'type','type':a37_0x2a8a5c(0x14f),'description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON',a37_0x2a8a5c(0x130),a37_0x2a8a5c(0x10a)]},{'name':a37_0x2a8a5c(0x110),'type':'string','description':a37_0x2a8a5c(0x12b)},{'name':a37_0x2a8a5c(0x13c),'type':a37_0x2a8a5c(0x147),'description':a37_0x2a8a5c(0x145)}],async 'dryRun'(_0x9787d){const _0x4b1637=a37_0x2a8a5c,_0x10251c=loadBffProjectConfig(_0x9787d[_0x4b1637(0x14d)]),_0x2c5fd1=await readBffLockFile(_0x10251c[_0x4b1637(0x102)]),{appLock:_0xddd215}=ensureLockScope(_0x2c5fd1??createEmptyBffLock(),_0x9787d[_0x4b1637(0x14d)],_0x10251c[_0x4b1637(0x122)],_0x4b1637(0x111)),_0x5f302f=await getTargetFunctions(_0x10251c,_0x9787d),_0x248d1d=_0x9787d[_0x4b1637(0x106)](_0x4b1637(0x13c)),_0x142083=[];for(const _0x546866 of _0x5f302f){const _0x54c1d1=await computeFileHash(_0x546866[_0x4b1637(0x119)]),_0x12f49e=_0xddd215[_0x4b1637(0x129)][_0x546866['lockKey']],_0x4a8f71=!!_0x12f49e&&_0x12f49e[_0x4b1637(0x107)]===_0x54c1d1;_0x142083[_0x4b1637(0x111)]({'lockKey':_0x546866[_0x4b1637(0x131)],'filePath':_0x546866[_0x4b1637(0x119)],'remoteId':_0x12f49e?.['remoteId']??null,'mode':_0x12f49e?.[_0x4b1637(0x152)]?'update':'create','status':!_0x248d1d&&_0x4a8f71?_0x4b1637(0x101):'would_push'});}return{'method':'POST','url':_0x4b1637(0x12e),'body':{'appCode':_0x9787d[_0x4b1637(0x14d)],'force':_0x248d1d,'files':_0x142083,'cacheClearAtRuntime':_0x142083[_0x4b1637(0x133)](_0x4da4da=>_0x4da4da['status']===_0x4b1637(0x153)),'cacheClearAtRuntimeTimes':_0x142083[_0x4b1637(0x133)](_0x1ccfa9=>_0x1ccfa9[_0x4b1637(0x10c)]===_0x4b1637(0x153))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x142083[_0x4b1637(0x108)]+_0x4b1637(0x11e)};},async 'execute'(_0x5a51d5){const _0x45f8c9=a37_0x2a8a5c,_0x23369a=loadBffProjectConfig(_0x5a51d5[_0x45f8c9(0x14d)]),_0x2a71fb=await readBffLockFile(_0x23369a['lockFilePath']),{lockData:_0x611218,appLock:_0x3c7b01}=ensureLockScope(_0x2a71fb??createEmptyBffLock(),_0x5a51d5[_0x45f8c9(0x14d)],_0x23369a['scriptsRoot'],'push'),_0x428a1f=await getTargetFunctions(_0x23369a,_0x5a51d5);if(_0x428a1f[_0x45f8c9(0x108)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x45f8c9(0x13d)};const _0x2d0886=_0x5a51d5['bool']('force'),_0x1cc68c=JSON['parse'](JSON[_0x45f8c9(0x10d)](_0x611218)),_0x503a3f=_0x1cc68c[_0x45f8c9(0x150)][_0x5a51d5[_0x45f8c9(0x14d)]];if(!_0x503a3f)throw new Error(_0x45f8c9(0x134)+_0x5a51d5[_0x45f8c9(0x14d)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x2e35cb=await buildHookMaps(_0x5a51d5['appCode'],_0x5a51d5[_0x45f8c9(0x127)],_0x428a1f,_0x503a3f),_0x422cce=[],_0x4e00bd=[],_0x21c9bf=[];for(const _0x4b3cf0 of _0x428a1f){const _0x344024=await computeFileHash(_0x4b3cf0[_0x45f8c9(0x119)]),_0x255590=_0x503a3f['functions'][_0x4b3cf0[_0x45f8c9(0x131)]];if(!_0x2d0886&&_0x255590&&_0x255590[_0x45f8c9(0x107)]===_0x344024){_0x4e00bd[_0x45f8c9(0x111)]({'lockKey':_0x4b3cf0[_0x45f8c9(0x131)],'reason':_0x45f8c9(0x101)});continue;}try{await uploadSingleFunction(_0x5a51d5[_0x45f8c9(0x14d)],_0x4b3cf0,_0x503a3f,_0x2e35cb);const _0x53e1be=_0x503a3f[_0x45f8c9(0x129)][_0x4b3cf0[_0x45f8c9(0x131)]];_0x422cce[_0x45f8c9(0x111)]({'lockKey':_0x4b3cf0['lockKey'],'remoteId':_0x53e1be?.[_0x45f8c9(0x152)]??0x0});}catch(_0x5c46d7){_0x21c9bf[_0x45f8c9(0x111)]({'lockKey':_0x4b3cf0[_0x45f8c9(0x131)],'error':_0x5c46d7 instanceof Error?_0x5c46d7['message']:String(_0x5c46d7)});}}_0x503a3f[_0x45f8c9(0x100)]=new Date()['toISOString'](),await writeBffLockFile(_0x23369a[_0x45f8c9(0x102)],_0x1cc68c),await waitForUploadedLockEntries(_0x23369a['lockFilePath'],_0x5a51d5[_0x45f8c9(0x14d)],_0x422cce[_0x45f8c9(0x10e)](_0x8d108e=>_0x8d108e[_0x45f8c9(0x131)]));let _0x599fdd={'attempted':![],'cleared':![]};if(_0x422cce[_0x45f8c9(0x108)]>0x0)try{let _0x366296='';for(let _0x9b8620=0x0;_0x9b8620<CACHE_CLEAR_ATTEMPTS;_0x9b8620+=0x1){_0x366296=await clearBffScriptCache(),_0x9b8620<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x599fdd={'attempted':!![],'cleared':!![],'message':_0x366296||_0x45f8c9(0x14c)};}catch(_0x1febd6){_0x599fdd={'attempted':!![],'cleared':![],'error':_0x1febd6 instanceof Error?_0x1febd6[_0x45f8c9(0x103)]:String(_0x1febd6)};}const _0x576e14=_0x21c9bf['length']===0x0&&(_0x599fdd[_0x45f8c9(0x143)]?_0x599fdd['cleared']:!![]),_0x25d9af=_0x599fdd['attempted']?_0x599fdd[_0x45f8c9(0x104)]?_0x45f8c9(0x132):_0x45f8c9(0x124):_0x45f8c9(0x13a);return{'ok':_0x576e14,'data':{'uploaded':_0x422cce,'skipped':_0x4e00bd,'failed':_0x21c9bf,'cacheClear':_0x599fdd},'message':_0x45f8c9(0x11b)+_0x422cce['length']+_0x45f8c9(0x117)+_0x4e00bd[_0x45f8c9(0x108)]+_0x45f8c9(0x140)+_0x21c9bf[_0x45f8c9(0x108)]+_0x45f8c9(0x116)+_0x25d9af};}};async function getTargetFunctions(_0x58d607,_0x3b5265){const _0x2d1dca=a37_0x2a8a5c,_0x416b31=_0x3b5265['str'](_0x2d1dca(0x14b)),_0x514952=_0x3b5265[_0x2d1dca(0x125)]('name'),_0x49761a=normalizeBffType(_0x416b31)??undefined;if(_0x514952&&!_0x49761a)throw CliErrors[_0x2d1dca(0x121)](_0x2d1dca(0x142));const _0x18bf14=await scanLocalBffFunctions(_0x58d607,_0x49761a);if(_0x514952){const _0x27d05d=_0x18bf14[_0x2d1dca(0x139)](_0x14d1ff=>_0x14d1ff[_0x2d1dca(0x110)]===_0x514952);if(_0x27d05d[_0x2d1dca(0x108)]===0x0)throw CliErrors['validation'](_0x2d1dca(0x120)+_0x49761a+'/'+_0x514952);return _0x27d05d;}return _0x18bf14;}function a37_0x555b(){const _0x411ba5=['1hVJBHL','version','/api/management/library/scripts/save','set','ENDPOINT','lockKey','runtime\x20cache\x20cleared','some','Lock\x20scope\x20for\x20app\x20\x22','34504977nBmvdw','bff','8gjUDFE','alias','filter','runtime\x20cache\x20not\x20needed','datasetCode','force','No\x20local\x20BFF\x20functions\x20found.','85nIjvDS','330nHnIih','\x20skipped,\x20','operationType','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','attempted','get','Force\x20push\x20ignoring\x20hash\x20protection','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','boolean','2532340epSSUS','code','description','type','Runtime\x20script\x20cache\x20cleared.','appCode','9732GeYgCU','string','apps','42vtiNZh','remoteId','would_push',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','lastSync','unchanged','lockFilePath','message','cleared','functionNode','bool','hash','length','utf8','HOOK','high-risk-write','status','stringify','map','script','name','push','datasetCodeToDataset','836400gUcVxK','38658iYAgmW','217926YKsBhY','\x20failed,\x20','\x20uploaded,\x20','every','filePath','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Push\x20complete:\x20','1706968DLGFZn','8690fmaIgC','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','Cannot\x20resolve\x20dataset\x20for\x20\x22','Local\x20function\x20not\x20found:\x20','validation','scriptsRoot','Run\x20`','runtime\x20cache\x20clear\x20failed','str','\x22.\x20','apiDir','aliasToDatasetCode','functions','datasetId','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'];a37_0x555b=function(){return _0x411ba5;};return a37_0x555b();}async function buildHookMaps(_0x85d01c,_0x1eb657,_0x3fd501,_0x3aefbe){const _0x43dfd8=a37_0x2a8a5c,_0x311be8=_0x3fd501[_0x43dfd8(0x133)](_0x3f6e3c=>_0x3f6e3c[_0x43dfd8(0x14b)]==='HOOK');if(!_0x311be8)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x342979=loadAliasMap(_0x1eb657,undefined,resolveApiFilePath(_0x1eb657,_0x85d01c)),_0x5e463d=new Map(_0x342979[_0x43dfd8(0x10e)](_0x509626=>[_0x509626[_0x43dfd8(0x138)],_0x509626[_0x43dfd8(0x13b)]]));for(const _0x11eb50 of Object['values'](_0x3aefbe['functions'])){_0x11eb50[_0x43dfd8(0x138)]&&_0x11eb50['datasetCode']&&!_0x5e463d['has'](_0x11eb50[_0x43dfd8(0x138)])&&_0x5e463d[_0x43dfd8(0x12f)](_0x11eb50[_0x43dfd8(0x138)],_0x11eb50[_0x43dfd8(0x13b)]);}const _0xbbc44c=await listDatasets(_0x85d01c),_0x52ebaa=new Map(_0xbbc44c[_0x43dfd8(0x10e)](_0x4b139f=>[_0x4b139f[_0x43dfd8(0x149)],_0x4b139f]));return{'aliasToDatasetCode':_0x5e463d,'datasetCodeToDataset':_0x52ebaa};}async function uploadSingleFunction(_0x44a216,_0x9a91ec,_0x292ddf,_0x2bb328){const _0x328862=a37_0x2a8a5c,_0x131dac=await readFile(_0x9a91ec[_0x328862(0x119)],_0x328862(0x109)),_0x4e280d=await computeFileHash(_0x9a91ec[_0x328862(0x119)]),_0x5af8a7=_0x292ddf[_0x328862(0x129)][_0x9a91ec[_0x328862(0x131)]];if(_0x5af8a7?.[_0x328862(0x152)]&&_0x5af8a7[_0x328862(0x12d)]==null)throw CliErrors[_0x328862(0x121)](_0x9a91ec['lockKey']+_0x328862(0xff));let _0x4f2b1e=extractScriptDescription(_0x131dac);if(!_0x4f2b1e&&_0x5af8a7?.[_0x328862(0x152)]){const _0x11d4d2=await getBffScriptInfo(_0x5af8a7[_0x328862(0x152)]);_0x4f2b1e=_0x11d4d2[_0x328862(0x14a)]||undefined;}const _0x531b33={'appCode':_0x44a216,'functionName':_0x9a91ec['name'],'scriptType':_0x9a91ec[_0x328862(0x14b)],'scriptContent':_0x131dac};if(_0x5af8a7?.[_0x328862(0x152)])_0x531b33['id']=_0x5af8a7[_0x328862(0x152)];if(_0x5af8a7?.['version']!=null)_0x531b33[_0x328862(0x12d)]=_0x5af8a7[_0x328862(0x12d)];if(_0x4f2b1e)_0x531b33[_0x328862(0x14a)]=_0x4f2b1e;if(_0x9a91ec['type']===_0x328862(0x10a)){const _0x2aaf65=_0x9a91ec[_0x328862(0x138)];if(!_0x2aaf65||!_0x9a91ec[_0x328862(0x141)]||!_0x9a91ec[_0x328862(0x105)])throw CliErrors[_0x328862(0x121)]('Incomplete\x20HOOK\x20path:\x20'+_0x9a91ec[_0x328862(0x131)]);const _0x3cadcf=_0x2bb328[_0x328862(0x128)]['get'](_0x2aaf65)??_0x5af8a7?.['datasetCode']??_0x2aaf65,_0x5a4a86=_0x2bb328[_0x328862(0x112)][_0x328862(0x144)](_0x3cadcf);if(!_0x5a4a86)throw CliErrors['validation'](_0x328862(0x11f)+_0x2aaf65+_0x328862(0x126)+(_0x328862(0x123)+CLI_BIN_NAME+_0x328862(0x11a)));_0x531b33[_0x328862(0x12a)]=_0x5a4a86['id'],_0x531b33[_0x328862(0x141)]=_0x9a91ec[_0x328862(0x141)],_0x531b33[_0x328862(0x105)]=_0x9a91ec[_0x328862(0x105)];}const _0x4f6477=await saveBffScript(_0x531b33),_0x30f82c=_0x4f6477['id'],_0x26f89f=_0x4f6477[_0x328862(0x10f)]??await getBffScriptInfo(_0x30f82c),_0x15f879={'hash':_0x4e280d,'remoteId':_0x30f82c,'version':_0x26f89f[_0x328862(0x12d)]};if(_0x9a91ec['type']===_0x328862(0x10a)){const _0x426421=_0x9a91ec['alias'],_0x40b524=_0x2bb328[_0x328862(0x128)]['get'](_0x426421)??_0x5af8a7?.['datasetCode']??_0x426421;_0x2bb328[_0x328862(0x128)]['has'](_0x426421)?_0x15f879['alias']=_0x426421:_0x15f879[_0x328862(0x138)]=_0x5af8a7?.[_0x328862(0x138)],_0x15f879[_0x328862(0x13b)]=_0x40b524,_0x15f879[_0x328862(0x141)]=_0x9a91ec['operationType'],_0x15f879[_0x328862(0x105)]=_0x9a91ec['functionNode'];}_0x292ddf[_0x328862(0x129)][_0x9a91ec[_0x328862(0x131)]]=_0x15f879;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x34ea29,_0x44152a,_0x277860){const _0x396773=a37_0x2a8a5c;if(_0x277860[_0x396773(0x108)]===0x0)return;for(let _0xb7a459=0x0;_0xb7a459<LOCK_SETTLE_RETRY_COUNT;_0xb7a459+=0x1){const _0x5ea041=await readBffLockFile(_0x34ea29),_0x4a1635=_0x5ea041?.[_0x396773(0x150)]?.[_0x44152a]?.[_0x396773(0x129)]??{},_0x428679=_0x277860[_0x396773(0x118)](_0x592b69=>!!_0x4a1635[_0x592b69]?.[_0x396773(0x152)]);if(_0x428679)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x396773(0x146)+_0x277860['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x229b1c=a37_0x3067;(function(_0xe4565e,_0x3c0317){const _0x3b967f=a37_0x3067,_0x51f084=_0xe4565e();while(!![]){try{const _0x2737fc=parseInt(_0x3b967f(0x1fd))/0x1*(parseInt(_0x3b967f(0x1c2))/0x2)+-parseInt(_0x3b967f(0x1f8))/0x3+-parseInt(_0x3b967f(0x1e0))/0x4+-parseInt(_0x3b967f(0x208))/0x5*(parseInt(_0x3b967f(0x1d5))/0x6)+-parseInt(_0x3b967f(0x1f0))/0x7*(-parseInt(_0x3b967f(0x1d8))/0x8)+parseInt(_0x3b967f(0x1e7))/0x9*(parseInt(_0x3b967f(0x1c3))/0xa)+parseInt(_0x3b967f(0x1eb))/0xb*(parseInt(_0x3b967f(0x1ee))/0xc);if(_0x2737fc===_0x3c0317)break;else _0x51f084['push'](_0x51f084['shift']());}catch(_0x4d2fad){_0x51f084['push'](_0x51f084['shift']());}}}(a37_0x5eaa,0x80382));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';function a37_0x3067(_0x33e870,_0x14c444){_0x33e870=_0x33e870-0x1c1;const _0x5eaa5b=a37_0x5eaa();let _0x30678a=_0x5eaa5b[_0x33e870];return _0x30678a;}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';function a37_0x5eaa(){const _0xa5d448=['Run\x20`','filePath','has','HOOK','get','runtime\x20cache\x20clear\x20failed','bool','validation','124482vQPbkh','lockFilePath','functionNode','2096BEvRoF','some','Push\x20local\x20BFF\x20scripts\x20to\x20remote','attempted','remoteId','ENDPOINT','Runtime\x20script\x20cache\x20cleared.','utf8','2489656gGEYWe','Push\x20only\x20this\x20script\x20type','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','name','scriptsRoot','stringify','COMMON','9DFWklB','Force\x20push\x20ignoring\x20hash\x20protection','\x20skipped,\x20','description','22hlVKhI','POST','/api/management/library/scripts/save','1695084uPivoN','datasetCodeToDataset','14336QWiHjz','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','high-risk-write','map','parse','lockKey','boolean','\x22\x20not\x20found\x20after\x20ensureLockScope.','511758SZWnbN','message','str','push','join','45818THUlAw','force','runtime\x20cache\x20not\x20needed','script','\x20uploaded,\x20','datasetCode','update','No\x20local\x20BFF\x20functions\x20found.','Local\x20function\x20not\x20found:\x20','lastSync','\x22.\x20','155NdGvCz','Push\x20complete:\x20','code','version','cleared','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','would_push','appCode','toISOString','alias','aliasToDatasetCode','38pRZNQF','2717110jBTJAn','length','status','type','set','functions','filter','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','runtime\x20cache\x20cleared','operationType'];a37_0x5eaa=function(){return _0xa5d448;};return a37_0x5eaa();}import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x229b1c(0x1fb),'description':a37_0x229b1c(0x1da),'risk':a37_0x229b1c(0x1f2),'flags':[{'name':a37_0x229b1c(0x1c6),'type':'string','description':a37_0x229b1c(0x1e1),'enum':[a37_0x229b1c(0x1e6),a37_0x229b1c(0x1dd),a37_0x229b1c(0x1d0)]},{'name':a37_0x229b1c(0x1e3),'type':'string','description':a37_0x229b1c(0x1f1)},{'name':a37_0x229b1c(0x1fe),'type':a37_0x229b1c(0x1f6),'description':a37_0x229b1c(0x1e8)}],async 'dryRun'(_0x7bfb3){const _0x1c0a6e=a37_0x229b1c,_0x482361=loadBffProjectConfig(_0x7bfb3[_0x1c0a6e(0x20f)]),_0x387446=await readBffLockFile(_0x482361[_0x1c0a6e(0x1d6)]),{appLock:_0x7de598}=ensureLockScope(_0x387446??createEmptyBffLock(),_0x7bfb3['appCode'],_0x482361[_0x1c0a6e(0x1e4)],_0x1c0a6e(0x1fb)),_0x5624ed=await getTargetFunctions(_0x482361,_0x7bfb3),_0xbf3a98=_0x7bfb3[_0x1c0a6e(0x1d3)](_0x1c0a6e(0x1fe)),_0x4c0789=[];for(const _0x489dca of _0x5624ed){const _0x4b6606=await computeFileHash(_0x489dca[_0x1c0a6e(0x1ce)]),_0x434bb4=_0x7de598[_0x1c0a6e(0x1c8)][_0x489dca['lockKey']],_0x1fef99=!!_0x434bb4&&_0x434bb4['hash']===_0x4b6606;_0x4c0789[_0x1c0a6e(0x1fb)]({'lockKey':_0x489dca[_0x1c0a6e(0x1f5)],'filePath':_0x489dca[_0x1c0a6e(0x1ce)],'remoteId':_0x434bb4?.[_0x1c0a6e(0x1dc)]??null,'mode':_0x434bb4?.[_0x1c0a6e(0x1dc)]?_0x1c0a6e(0x203):'create','status':!_0xbf3a98&&_0x1fef99?'unchanged':_0x1c0a6e(0x20e)});}return{'method':_0x1c0a6e(0x1ec),'url':_0x1c0a6e(0x1ed),'body':{'appCode':_0x7bfb3[_0x1c0a6e(0x20f)],'force':_0xbf3a98,'files':_0x4c0789,'cacheClearAtRuntime':_0x4c0789[_0x1c0a6e(0x1d9)](_0x39bcac=>_0x39bcac[_0x1c0a6e(0x1c5)]===_0x1c0a6e(0x20e)),'cacheClearAtRuntimeTimes':_0x4c0789[_0x1c0a6e(0x1d9)](_0x400c1f=>_0x400c1f[_0x1c0a6e(0x1c5)]===_0x1c0a6e(0x20e))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x4c0789[_0x1c0a6e(0x1c4)]+_0x1c0a6e(0x1ca)};},async 'execute'(_0x43ffc9){const _0x20c254=a37_0x229b1c,_0x1c01ca=loadBffProjectConfig(_0x43ffc9['appCode']),_0x125c53=await readBffLockFile(_0x1c01ca[_0x20c254(0x1d6)]),{lockData:_0x1b6bd8,appLock:_0x1442ea}=ensureLockScope(_0x125c53??createEmptyBffLock(),_0x43ffc9[_0x20c254(0x20f)],_0x1c01ca[_0x20c254(0x1e4)],'push'),_0x3e2d5b=await getTargetFunctions(_0x1c01ca,_0x43ffc9);if(_0x3e2d5b[_0x20c254(0x1c4)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x20c254(0x204)};const _0x50c66f=_0x43ffc9[_0x20c254(0x1d3)](_0x20c254(0x1fe)),_0x1efeb3=JSON[_0x20c254(0x1f4)](JSON[_0x20c254(0x1e5)](_0x1b6bd8)),_0x56828d=_0x1efeb3['apps'][_0x43ffc9[_0x20c254(0x20f)]];if(!_0x56828d)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x43ffc9['appCode']+_0x20c254(0x1f7));const _0x5d84c7=await buildHookMaps(_0x43ffc9[_0x20c254(0x20f)],_0x43ffc9['apiDir'],_0x3e2d5b,_0x56828d),_0x3583eb=[],_0x4d2bc5=[],_0x1e04c6=[];for(const _0x49d49c of _0x3e2d5b){const _0xc15e0d=await computeFileHash(_0x49d49c['filePath']),_0x5669f=_0x56828d[_0x20c254(0x1c8)][_0x49d49c[_0x20c254(0x1f5)]];if(!_0x50c66f&&_0x5669f&&_0x5669f['hash']===_0xc15e0d){_0x4d2bc5[_0x20c254(0x1fb)]({'lockKey':_0x49d49c[_0x20c254(0x1f5)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x43ffc9[_0x20c254(0x20f)],_0x49d49c,_0x56828d,_0x5d84c7);const _0xc170d6=_0x56828d[_0x20c254(0x1c8)][_0x49d49c[_0x20c254(0x1f5)]];_0x3583eb[_0x20c254(0x1fb)]({'lockKey':_0x49d49c[_0x20c254(0x1f5)],'remoteId':_0xc170d6?.[_0x20c254(0x1dc)]??0x0});}catch(_0x10bdcf){_0x1e04c6[_0x20c254(0x1fb)]({'lockKey':_0x49d49c[_0x20c254(0x1f5)],'error':_0x10bdcf instanceof Error?_0x10bdcf[_0x20c254(0x1f9)]:String(_0x10bdcf)});}}_0x56828d[_0x20c254(0x206)]=new Date()[_0x20c254(0x210)](),await writeBffLockFile(_0x1c01ca['lockFilePath'],_0x1efeb3),await waitForUploadedLockEntries(_0x1c01ca[_0x20c254(0x1d6)],_0x43ffc9[_0x20c254(0x20f)],_0x3583eb['map'](_0xa28649=>_0xa28649[_0x20c254(0x1f5)]));let _0x2c9fee={'attempted':![],'cleared':![]};if(_0x3583eb['length']>0x0)try{let _0x40ea93='';for(let _0x5c4ea0=0x0;_0x5c4ea0<CACHE_CLEAR_ATTEMPTS;_0x5c4ea0+=0x1){_0x40ea93=await clearBffScriptCache(),_0x5c4ea0<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x2c9fee={'attempted':!![],'cleared':!![],'message':_0x40ea93||_0x20c254(0x1de)};}catch(_0x34c149){_0x2c9fee={'attempted':!![],'cleared':![],'error':_0x34c149 instanceof Error?_0x34c149[_0x20c254(0x1f9)]:String(_0x34c149)};}const _0x24b94e=_0x1e04c6['length']===0x0&&(_0x2c9fee[_0x20c254(0x1db)]?_0x2c9fee[_0x20c254(0x20c)]:!![]),_0x200367=_0x2c9fee[_0x20c254(0x1db)]?_0x2c9fee[_0x20c254(0x20c)]?_0x20c254(0x1cb):_0x20c254(0x1d2):_0x20c254(0x1ff);return{'ok':_0x24b94e,'data':{'uploaded':_0x3583eb,'skipped':_0x4d2bc5,'failed':_0x1e04c6,'cacheClear':_0x2c9fee},'message':_0x20c254(0x209)+_0x3583eb['length']+_0x20c254(0x201)+_0x4d2bc5[_0x20c254(0x1c4)]+_0x20c254(0x1e9)+_0x1e04c6[_0x20c254(0x1c4)]+'\x20failed,\x20'+_0x200367};}};async function getTargetFunctions(_0x258b5a,_0x51250a){const _0xe38748=a37_0x229b1c,_0x501cef=_0x51250a[_0xe38748(0x1fa)](_0xe38748(0x1c6)),_0x41975e=_0x51250a[_0xe38748(0x1fa)]('name'),_0xd6748=normalizeBffType(_0x501cef)??undefined;if(_0x41975e&&!_0xd6748)throw CliErrors[_0xe38748(0x1d4)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x5f389d=await scanLocalBffFunctions(_0x258b5a,_0xd6748);if(_0x41975e){const _0x2af8a2=_0x5f389d[_0xe38748(0x1c9)](_0x19a4b5=>_0x19a4b5[_0xe38748(0x1e3)]===_0x41975e);if(_0x2af8a2['length']===0x0)throw CliErrors['validation'](_0xe38748(0x205)+_0xd6748+'/'+_0x41975e);return _0x2af8a2;}return _0x5f389d;}async function buildHookMaps(_0x22ca89,_0x2657fb,_0x342e6f,_0x30bdf8){const _0x458806=a37_0x229b1c,_0x31c009=_0x342e6f['some'](_0x37436d=>_0x37436d['type']===_0x458806(0x1d0));if(!_0x31c009)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x50c23a=loadAliasMap(_0x2657fb,undefined,resolveApiFilePath(_0x2657fb,_0x22ca89)),_0x562b01=new Map(_0x50c23a['map'](_0x35b625=>[_0x35b625[_0x458806(0x211)],_0x35b625['datasetCode']]));for(const _0x5e0d7e of Object['values'](_0x30bdf8[_0x458806(0x1c8)])){_0x5e0d7e['alias']&&_0x5e0d7e[_0x458806(0x202)]&&!_0x562b01[_0x458806(0x1cf)](_0x5e0d7e['alias'])&&_0x562b01[_0x458806(0x1c7)](_0x5e0d7e[_0x458806(0x211)],_0x5e0d7e['datasetCode']);}const _0x1eb16e=await listDatasets(_0x22ca89),_0x5c892b=new Map(_0x1eb16e[_0x458806(0x1f3)](_0x193460=>[_0x193460[_0x458806(0x20a)],_0x193460]));return{'aliasToDatasetCode':_0x562b01,'datasetCodeToDataset':_0x5c892b};}async function uploadSingleFunction(_0x69af22,_0x3946ab,_0x40c937,_0x1fc127){const _0x2e1411=a37_0x229b1c,_0x224419=await readFile(_0x3946ab['filePath'],_0x2e1411(0x1df)),_0x3ac7ce=await computeFileHash(_0x3946ab['filePath']),_0x49e7da=_0x40c937['functions'][_0x3946ab[_0x2e1411(0x1f5)]];if(_0x49e7da?.[_0x2e1411(0x1dc)]&&_0x49e7da['version']==null)throw CliErrors['validation'](_0x3946ab['lockKey']+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x1fc060=extractScriptDescription(_0x224419);if(!_0x1fc060&&_0x49e7da?.['remoteId']){const _0x264709=await getBffScriptInfo(_0x49e7da[_0x2e1411(0x1dc)]);_0x1fc060=_0x264709[_0x2e1411(0x1ea)]||undefined;}const _0x146198={'appCode':_0x69af22,'functionName':_0x3946ab[_0x2e1411(0x1e3)],'scriptType':_0x3946ab[_0x2e1411(0x1c6)],'scriptContent':_0x224419};if(_0x49e7da?.[_0x2e1411(0x1dc)])_0x146198['id']=_0x49e7da[_0x2e1411(0x1dc)];if(_0x49e7da?.[_0x2e1411(0x20b)]!=null)_0x146198[_0x2e1411(0x20b)]=_0x49e7da[_0x2e1411(0x20b)];if(_0x1fc060)_0x146198[_0x2e1411(0x1ea)]=_0x1fc060;if(_0x3946ab['type']==='HOOK'){const _0x33be2f=_0x3946ab[_0x2e1411(0x211)];if(!_0x33be2f||!_0x3946ab['operationType']||!_0x3946ab['functionNode'])throw CliErrors[_0x2e1411(0x1d4)]('Incomplete\x20HOOK\x20path:\x20'+_0x3946ab[_0x2e1411(0x1f5)]);const _0x37fe3e=_0x1fc127[_0x2e1411(0x1c1)][_0x2e1411(0x1d1)](_0x33be2f)??_0x49e7da?.[_0x2e1411(0x202)]??_0x33be2f,_0x1dad76=_0x1fc127[_0x2e1411(0x1ef)][_0x2e1411(0x1d1)](_0x37fe3e);if(!_0x1dad76)throw CliErrors[_0x2e1411(0x1d4)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x33be2f+_0x2e1411(0x207)+(_0x2e1411(0x1cd)+CLI_BIN_NAME+_0x2e1411(0x1e2)));_0x146198['datasetId']=_0x1dad76['id'],_0x146198[_0x2e1411(0x1cc)]=_0x3946ab[_0x2e1411(0x1cc)],_0x146198[_0x2e1411(0x1d7)]=_0x3946ab[_0x2e1411(0x1d7)];}const _0x47f2ea=await saveBffScript(_0x146198),_0x106c6e=_0x47f2ea['id'],_0x221f80=_0x47f2ea[_0x2e1411(0x200)]??await getBffScriptInfo(_0x106c6e),_0x3dbbae={'hash':_0x3ac7ce,'remoteId':_0x106c6e,'version':_0x221f80['version']};if(_0x3946ab[_0x2e1411(0x1c6)]==='HOOK'){const _0x47d547=_0x3946ab[_0x2e1411(0x211)],_0x30c4e7=_0x1fc127[_0x2e1411(0x1c1)]['get'](_0x47d547)??_0x49e7da?.[_0x2e1411(0x202)]??_0x47d547;_0x1fc127['aliasToDatasetCode'][_0x2e1411(0x1cf)](_0x47d547)?_0x3dbbae[_0x2e1411(0x211)]=_0x47d547:_0x3dbbae[_0x2e1411(0x211)]=_0x49e7da?.[_0x2e1411(0x211)],_0x3dbbae[_0x2e1411(0x202)]=_0x30c4e7,_0x3dbbae[_0x2e1411(0x1cc)]=_0x3946ab['operationType'],_0x3dbbae[_0x2e1411(0x1d7)]=_0x3946ab[_0x2e1411(0x1d7)];}_0x40c937['functions'][_0x3946ab['lockKey']]=_0x3dbbae;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x599656,_0x42f098,_0x5d86e5){const _0x31ba0e=a37_0x229b1c;if(_0x5d86e5[_0x31ba0e(0x1c4)]===0x0)return;for(let _0x29103c=0x0;_0x29103c<LOCK_SETTLE_RETRY_COUNT;_0x29103c+=0x1){const _0x1b7aaa=await readBffLockFile(_0x599656),_0x380e54=_0x1b7aaa?.['apps']?.[_0x42f098]?.[_0x31ba0e(0x1c8)]??{},_0x5c8b97=_0x5d86e5['every'](_0x1065c1=>!!_0x380e54[_0x1065c1]?.['remoteId']);if(_0x5c8b97)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x31ba0e(0x20d)+_0x5d86e5[_0x31ba0e(0x1fc)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a38_0x4863(){const _0x4cfbf9=['scriptsRoot','bool','2463FaWyTY','remote','length','lockFilePath','\x20remote-only','236817ZwJUGi','192RwlMWW','\x20unchanged','4IResOO','21234730sDUvrG','1124872bAlqMT','functions','has','434AWtWwc','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','6632032yFbblq','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','filePath','lockKey','all','\x20modified,\x20','apiDir','hash','appCode','boolean','10ocXsYe','map','push','10696ALLRgn','4643185dMJAiH'];a38_0x4863=function(){return _0x4cfbf9;};return a38_0x4863();}const a38_0x3e1f08=a38_0x2fde;function a38_0x2fde(_0x192c27,_0x595a69){_0x192c27=_0x192c27-0x104;const _0x486389=a38_0x4863();let _0x2fde00=_0x486389[_0x192c27];return _0x2fde00;}(function(_0x3d427c,_0x3359a6){const _0x20762a=a38_0x2fde,_0x330de3=_0x3d427c();while(!![]){try{const _0x89ef0c=-parseInt(_0x20762a(0x10f))/0x1+parseInt(_0x20762a(0x112))/0x2*(-parseInt(_0x20762a(0x105))/0x3)+-parseInt(_0x20762a(0x10d))/0x4*(-parseInt(_0x20762a(0x122))/0x5)+parseInt(_0x20762a(0x10b))/0x6*(-parseInt(_0x20762a(0x121))/0x7)+-parseInt(_0x20762a(0x114))/0x8+parseInt(_0x20762a(0x10a))/0x9+-parseInt(_0x20762a(0x11e))/0xa*(-parseInt(_0x20762a(0x10e))/0xb);if(_0x89ef0c===_0x3359a6)break;else _0x330de3['push'](_0x330de3['shift']());}catch(_0x339af7){_0x330de3['push'](_0x330de3['shift']());}}}(a38_0x4863,0xabfc3));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':'status','description':a38_0x3e1f08(0x113),'risk':'read','flags':[{'name':a38_0x3e1f08(0x106),'type':a38_0x3e1f08(0x11d),'description':a38_0x3e1f08(0x115)}],async 'execute'(_0x3b45e6){const _0x512688=a38_0x3e1f08,_0x4f5680=loadBffProjectConfig(_0x3b45e6[_0x512688(0x11c)]),_0x3e1e3f=await readBffLockFile(_0x4f5680[_0x512688(0x108)]),{appLock:_0x281133}=ensureLockScope(_0x3e1e3f??createEmptyBffLock(),_0x3b45e6['appCode'],_0x4f5680[_0x512688(0x123)],'status'),_0x396639=await scanLocalBffFunctions(_0x4f5680),_0x3d0ee7=[],_0x25c954=[],_0x6668f9=[];for(const _0x1020aa of _0x396639){const _0x35d569=await computeFileHash(_0x1020aa[_0x512688(0x116)]),_0x2516e1=_0x281133[_0x512688(0x110)][_0x1020aa[_0x512688(0x117)]];if(!_0x2516e1)_0x3d0ee7['push'](_0x1020aa['lockKey']);else _0x2516e1[_0x512688(0x11b)]!==_0x35d569?_0x25c954['push'](_0x1020aa[_0x512688(0x117)]):_0x6668f9[_0x512688(0x120)](_0x1020aa[_0x512688(0x117)]);}const _0x4542e2=[];if(_0x3b45e6[_0x512688(0x104)](_0x512688(0x106))){const _0x2ff34c=loadAliasMap(_0x3b45e6[_0x512688(0x11a)],undefined,resolveApiFilePath(_0x3b45e6[_0x512688(0x11a)],_0x3b45e6[_0x512688(0x11c)])),_0x25b59a=new Map(_0x2ff34c[_0x512688(0x11f)](_0x19d4ba=>[_0x19d4ba['datasetCode'],_0x19d4ba['alias']])),[_0x3572ba,_0x3acc0b]=await Promise[_0x512688(0x118)]([listBffScripts(_0x3b45e6[_0x512688(0x11c)]),getBffScriptStatistics(_0x3b45e6[_0x512688(0x11c)])]),_0x2bd070=createHookLocationMap(_0x3acc0b),_0x361a7f=new Set(_0x396639[_0x512688(0x11f)](_0x476909=>_0x476909[_0x512688(0x117)]));for(const _0x5c880e of _0x3572ba){const _0x1e83bc=resolveRemoteScriptTarget(_0x4f5680,_0x5c880e,_0x2bd070,_0x281133[_0x512688(0x110)],_0x25b59a);_0x1e83bc&&!_0x361a7f[_0x512688(0x111)](_0x1e83bc[_0x512688(0x117)])&&_0x4542e2['push'](_0x1e83bc[_0x512688(0x117)]);}}const _0x6fd161=_0x3d0ee7[_0x512688(0x107)]===0x0&&_0x25c954[_0x512688(0x107)]===0x0&&_0x4542e2[_0x512688(0x107)]===0x0;return{'ok':!![],'data':{'added':_0x3d0ee7,'modified':_0x25c954,'unchanged':_0x6668f9,'remoteOnly':_0x4542e2},'message':_0x6fd161?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x3d0ee7[_0x512688(0x107)]+'\x20added,\x20'+_0x25c954[_0x512688(0x107)]+_0x512688(0x119)+_0x6668f9['length']+_0x512688(0x10c)+(_0x4542e2[_0x512688(0x107)]>0x0?',\x20'+_0x4542e2[_0x512688(0x107)]+_0x512688(0x109):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a39_0x32a1a7=a39_0x4cc2;(function(_0x392c96,_0x4e0f84){const _0x565432=a39_0x4cc2,_0x5343d9=_0x392c96();while(!![]){try{const _0x73b293=-parseInt(_0x565432(0x1d9))/0x1+-parseInt(_0x565432(0x1ee))/0x2+parseInt(_0x565432(0x1eb))/0x3*(parseInt(_0x565432(0x1e1))/0x4)+parseInt(_0x565432(0x1db))/0x5*(-parseInt(_0x565432(0x1dc))/0x6)+parseInt(_0x565432(0x1dd))/0x7*(-parseInt(_0x565432(0x1ef))/0x8)+-parseInt(_0x565432(0x1ec))/0x9+-parseInt(_0x565432(0x1e8))/0xa*(-parseInt(_0x565432(0x1e5))/0xb);if(_0x73b293===_0x4e0f84)break;else _0x5343d9['push'](_0x5343d9['shift']());}catch(_0x3b6397){_0x5343d9['push'](_0x5343d9['shift']());}}}(a39_0x3277,0x197e0));function a39_0x4cc2(_0x2d93da,_0x4cc7ef){_0x2d93da=_0x2d93da-0x1d8;const _0x3277bb=a39_0x3277();let _0x4cc299=_0x3277bb[_0x2d93da];return _0x4cc299;}import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';function a39_0x3277(){const _0x5ae8fa=['Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','CLI\x20Built-in\x20Skill\x20installed','275532HoMkDb','error','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','../../skills/npx-skills-add.js','5723014LyyQNf','skipped','npx\x20skills\x20add\x20failed:\x20','10aQHnMm','setLogPath','cwd','3iVOOid','1598499cqiMtI','nonInteractive','57628pvxfph','1218664NpfSoS','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','log','inherit','cli-skill-install',')...','write','unknown','info','7145fACQUD','apiError','5cOBQkQ','713028VljPHH','7kGMkKf'];a39_0x3277=function(){return _0x5ae8fa;};return a39_0x3277();}export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':a39_0x32a1a7(0x1de),'risk':a39_0x32a1a7(0x1f5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3c41dd){const _0x228f3a=a39_0x32a1a7;logger[_0x228f3a(0x1e9)](process['cwd']()),logger[_0x228f3a(0x1d8)](_0x228f3a(0x1f3),_0x228f3a(0x1f0));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x16d7d4,RABETBASE_SKILL_SOURCE:_0x68263e,runNpxSkillsAddGlobal:_0x34b960}=await import(_0x228f3a(0x1e4)),_0x59c5c4=_0x3c41dd[_0x228f3a(0x1ed)]?'pipe':_0x228f3a(0x1f2);console[_0x228f3a(0x1f1)]('Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20('+_0x16d7d4+_0x228f3a(0x1f4));const _0x318a69=_0x34b960(process[_0x228f3a(0x1ea)](),_0x68263e,{'stdio':_0x59c5c4});if(_0x318a69[_0x228f3a(0x1e6)])console[_0x228f3a(0x1f1)](_0x228f3a(0x1e3));else{if(_0x318a69['ok'])console[_0x228f3a(0x1f1)](_0x228f3a(0x1e0));else throw CliErrors[_0x228f3a(0x1da)](_0x228f3a(0x1e7)+(_0x318a69[_0x228f3a(0x1e2)]||_0x228f3a(0x1f6)),_0x228f3a(0x1df)+_0x16d7d4);}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a40_0x9ea3(_0x2a6a90,_0x52672d){_0x2a6a90=_0x2a6a90-0x15b;const _0x437009=a40_0x4370();let _0x9ea35e=_0x437009[_0x2a6a90];return _0x9ea35e;}const a40_0x4e6c1d=a40_0x9ea3;(function(_0x2b2390,_0x456aeb){const _0x1441c6=a40_0x9ea3,_0x498ff9=_0x2b2390();while(!![]){try{const _0x1ea96c=parseInt(_0x1441c6(0x16f))/0x1+-parseInt(_0x1441c6(0x176))/0x2*(parseInt(_0x1441c6(0x1a3))/0x3)+parseInt(_0x1441c6(0x162))/0x4*(-parseInt(_0x1441c6(0x15d))/0x5)+parseInt(_0x1441c6(0x1a8))/0x6*(parseInt(_0x1441c6(0x163))/0x7)+parseInt(_0x1441c6(0x160))/0x8+parseInt(_0x1441c6(0x1a9))/0x9+-parseInt(_0x1441c6(0x17d))/0xa;if(_0x1ea96c===_0x456aeb)break;else _0x498ff9['push'](_0x498ff9['shift']());}catch(_0x165dba){_0x498ff9['push'](_0x498ff9['shift']());}}}(a40_0x4370,0x57b55));import a40_0x4604e6 from'chalk';import a40_0x83667a from'ora';import a40_0x37e212 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x564e86=a40_0x9ea3;return GIT_COMMIT!==_0x564e86(0x166)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x564e86(0x19c)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3f73aa=a40_0x9ea3,_0x26a2bd=process[_0x3f73aa(0x179)]['toLowerCase']();if(_0x26a2bd[_0x3f73aa(0x17f)](_0x3f73aa(0x194)))return _0x3f73aa(0x194);return _0x3f73aa(0x184);}const updateFlags=[{'name':a40_0x4e6c1d(0x18d),'type':a40_0x4e6c1d(0x1a7),'description':a40_0x4e6c1d(0x197),'default':![]},{'name':a40_0x4e6c1d(0x190),'type':a40_0x4e6c1d(0x18a),'description':a40_0x4e6c1d(0x16c)},{'name':a40_0x4e6c1d(0x15c),'type':a40_0x4e6c1d(0x1a7),'description':a40_0x4e6c1d(0x178),'default':![]},{'name':a40_0x4e6c1d(0x182),'type':a40_0x4e6c1d(0x1a7),'description':a40_0x4e6c1d(0x15b),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x4e5c03){const _0x46442a=a40_0x4e6c1d;return _0x4e5c03[_0x46442a(0x171)](_0x46442a(0x190))[_0x46442a(0x19f)]();}function shouldSkipCliSkill(_0x41f0b8){const _0x3083a4=a40_0x4e6c1d;return _0x41f0b8[_0x3083a4(0x17a)](_0x3083a4(0x15c))||_0x41f0b8['flag'](_0x3083a4(0x182))===![];}async function validateUpdateFlags(_0x3e9824){const _0x2fbb0e=a40_0x4e6c1d,_0x55aea1=_0x3e9824[_0x2fbb0e(0x17a)]('beta'),_0x3cc0f0=getRequestedVersion(_0x3e9824);if(_0x55aea1&&_0x3cc0f0)throw CliErrors[_0x2fbb0e(0x19b)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x2fbb0e(0x173));if(_0x3cc0f0&&!a40_0x37e212[_0x2fbb0e(0x164)](_0x3cc0f0))throw CliErrors[_0x2fbb0e(0x19b)](_0x2fbb0e(0x177)+_0x3cc0f0,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x366494=a40_0x4e6c1d;try{const _0x480584=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x366494(0x181)](0x2710)});if(!_0x480584['ok'])return null;const _0x3814da=await _0x480584[_0x366494(0x17e)]();if(!_0x3814da||typeof _0x3814da!==_0x366494(0x15f))return null;return Object[_0x366494(0x18e)](Object[_0x366494(0x1a0)](_0x3814da)['filter'](([,_0x2d739b])=>typeof _0x2d739b==='string'&&_0x2d739b['trim']()[_0x366494(0x189)]>0x0)[_0x366494(0x19a)](([_0xf0f60e,_0x18649f])=>[_0xf0f60e,String(_0x18649f)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0xe38dac){const _0x13ca0=await fetchNpmDistTags();return _0x13ca0?.[_0xe38dac]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x288ca5){const _0x22f7f5=a40_0x4e6c1d,_0xb4b7d5=getRequestedVersion(_0x288ca5);if(_0xb4b7d5)return{'version':_0xb4b7d5,'source':_0x22f7f5(0x190)};if(_0x288ca5['bool'](_0x22f7f5(0x18d))){const _0x285a7b=await fetchNpmDistTagVersion('beta');if(!_0x285a7b)return null;return{'version':_0x285a7b,'source':_0x22f7f5(0x18d)};}const _0x8a7071=await fetchLatestVersion();if(!_0x8a7071)return null;return{'version':_0x8a7071,'source':_0x22f7f5(0x1ab)};}function shouldInstallTarget(_0x5b290f,_0x1a20fd){const _0x1a0499=a40_0x4e6c1d;if(_0x1a20fd[_0x1a0499(0x186)]==='version'||_0x1a20fd[_0x1a0499(0x186)]==='beta')return!a40_0x37e212['eq'](_0x5b290f,_0x1a20fd[_0x1a0499(0x190)]);return a40_0x37e212['lt'](_0x5b290f,_0x1a20fd[_0x1a0499(0x190)]);}function getInstallPlanLabel(_0x32c4a2,_0x879980){const _0x21c456=a40_0x4e6c1d;switch(_0x879980[_0x21c456(0x186)]){case _0x21c456(0x18d):return _0x21c456(0x185)+a40_0x4604e6[_0x21c456(0x1a5)](_0x32c4a2)+_0x21c456(0x17c)+a40_0x4604e6['green'](_0x879980['version']);case'version':return _0x21c456(0x170)+a40_0x4604e6[_0x21c456(0x1a5)](_0x32c4a2)+_0x21c456(0x17c)+a40_0x4604e6[_0x21c456(0x16d)](_0x879980[_0x21c456(0x190)]);case _0x21c456(0x1ab):default:return _0x21c456(0x1ac)+a40_0x4604e6[_0x21c456(0x1a5)](_0x32c4a2)+_0x21c456(0x17c)+a40_0x4604e6[_0x21c456(0x16d)](_0x879980[_0x21c456(0x190)]);}}async function installCliSkill(_0x4b1ea6){const _0x4cbe50=a40_0x4e6c1d;console[_0x4cbe50(0x180)](a40_0x4604e6[_0x4cbe50(0x183)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x12f050=runNpxSkillsAddGlobal(process[_0x4cbe50(0x174)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x4b1ea6?'pipe':_0x4cbe50(0x1a4)});if(_0x12f050[_0x4cbe50(0x195)]){console[_0x4cbe50(0x180)](a40_0x4604e6[_0x4cbe50(0x183)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'));return;}if(_0x12f050['ok']){console[_0x4cbe50(0x180)](a40_0x4604e6['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.'));return;}console['warn'](a40_0x4604e6[_0x4cbe50(0x1a5)](_0x4cbe50(0x18b)+(_0x12f050[_0x4cbe50(0x16e)]||'unknown'))),console[_0x4cbe50(0x180)](a40_0x4604e6[_0x4cbe50(0x183)](_0x4cbe50(0x16b)+CLI_BIN_NAME+_0x4cbe50(0x19e)));}function a40_0x4370(){const _0x3b8383=['Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','run','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','map','validation','slice','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','\x20cli-skill\x20install','trim','entries','red','fail','1937529ojSyEY','inherit','yellow','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','boolean','492naHevJ','4536432goCZwA','start','latest','Update\x20available:\x20','Current\x20version:\x20','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','no-skills','5ERcwLq','install','object','1092272XkCrUD','\x20install\x20-g\x20','1093256skuLfo','41825Wiyrbn','valid','Already\x20on\x20requested\x20version\x20(v','unknown','pipe','Checking\x20for\x20updates...','...','info','\x20\x20Run\x20manually:\x20','Install\x20a\x20specific\x20CLI\x20version','green','error','151183dmjEVD','Requested\x20version:\x20','str','succeed','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','cwd','Already\x20up\x20to\x20date\x20(v','2mOytYr','Invalid\x20version:\x20','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','execPath','bool','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','\x20→\x20','33050gKoKgn','json','includes','log','timeout','skills','gray','npm','Beta\x20version:\x20','source','\x20\x20Try\x20manually:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','length','string','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','message','beta','fromEntries','nonInteractive','version','write','Updated\x20to\x20v','Version\x20comparison\x20failed','bun','skipped','@latest'];a40_0x4370=function(){return _0x3b8383;};return a40_0x4370();}async function execute(_0x26963d){const _0x35e1db=a40_0x4e6c1d;await validateUpdateFlags(_0x26963d);const _0x56a4c2=getCurrentVersion();console[_0x35e1db(0x180)](_0x35e1db(0x1ad)+_0x56a4c2);const _0x1152fc=a40_0x83667a(_0x35e1db(0x168))[_0x35e1db(0x1aa)](),_0x2d5a66=await resolveTargetVersion(_0x26963d);if(!_0x2d5a66){const _0x34116d=_0x26963d[_0x35e1db(0x17a)](_0x35e1db(0x18d))?_0x35e1db(0x19d):'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x1152fc[_0x35e1db(0x1a2)](_0x34116d),console[_0x35e1db(0x180)](a40_0x4604e6[_0x35e1db(0x183)](_0x35e1db(0x199)+NPM_PACKAGE_NAME+_0x35e1db(0x196))),{'ok':![],'message':_0x34116d};}const _0x4c6bde=a40_0x37e212[_0x35e1db(0x164)](VERSION),_0x34667b=a40_0x37e212[_0x35e1db(0x164)](_0x2d5a66[_0x35e1db(0x190)]);if(!_0x4c6bde||!_0x34667b)return _0x1152fc[_0x35e1db(0x1a2)](_0x35e1db(0x193)),{'ok':![],'message':_0x35e1db(0x193)};if(!shouldInstallTarget(_0x4c6bde,_0x2d5a66)){const _0x4f68eb=_0x2d5a66['source']===_0x35e1db(0x190)?_0x35e1db(0x165)+_0x2d5a66[_0x35e1db(0x190)]+')':_0x35e1db(0x175)+_0x2d5a66[_0x35e1db(0x190)]+')';return _0x1152fc[_0x35e1db(0x172)](_0x4f68eb),shouldSkipCliSkill(_0x26963d)?console[_0x35e1db(0x180)](a40_0x4604e6[_0x35e1db(0x183)](_0x35e1db(0x1a6))):await installCliSkill(_0x26963d[_0x35e1db(0x18f)]),{'ok':!![]};}_0x1152fc[_0x35e1db(0x16a)](getInstallPlanLabel(_0x56a4c2,_0x2d5a66));const _0x25ffe9=detectPackageManager(),_0xbd5358=_0x25ffe9===_0x35e1db(0x184)?resolveNpmBin(_0x35e1db(0x184)):_0x25ffe9,_0x306ac6=a40_0x83667a('Updating\x20via\x20'+_0x25ffe9+_0x35e1db(0x169))[_0x35e1db(0x1aa)]();try{return await execa(_0xbd5358,[_0x35e1db(0x15e),'-g',NPM_PACKAGE_NAME+'@'+_0x2d5a66[_0x35e1db(0x190)]],{'stdio':_0x35e1db(0x167)}),_0x306ac6[_0x35e1db(0x172)](_0x35e1db(0x192)+_0x2d5a66[_0x35e1db(0x190)]),console['log'](a40_0x4604e6[_0x35e1db(0x183)](_0x35e1db(0x17b))),shouldSkipCliSkill(_0x26963d)?console[_0x35e1db(0x180)](a40_0x4604e6[_0x35e1db(0x183)]('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).')):await installCliSkill(_0x26963d[_0x35e1db(0x18f)]),{'ok':!![]};}catch(_0x3b6325){return _0x306ac6[_0x35e1db(0x1a2)]('Update\x20failed'),console['error'](a40_0x4604e6[_0x35e1db(0x1a1)]('\x20\x20'+_0x3b6325[_0x35e1db(0x18c)])),console[_0x35e1db(0x180)](a40_0x4604e6[_0x35e1db(0x183)](_0x35e1db(0x187)+_0x25ffe9+_0x35e1db(0x161)+NPM_PACKAGE_NAME+'@'+_0x2d5a66[_0x35e1db(0x190)])),{'ok':![],'message':_0x3b6325[_0x35e1db(0x18c)]};}}export const updateDefinition={'service':'update','command':a40_0x4e6c1d(0x198),'description':a40_0x4e6c1d(0x188),'risk':a40_0x4e6c1d(0x191),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x29c952=a40_0x47e7;function a40_0x30df(){const _0x5aa79c=['...','Update\x20available:\x20','Install\x20a\x20specific\x20CLI\x20version','27644CAaJzl','error','4383762WbBosV','json','green','Already\x20on\x20requested\x20version\x20(v','Requested\x20version:\x20','Current\x20version:\x20','npm','write','bun','beta','70326gaaSQy','\x20\x20Try\x20manually:\x20','latest','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','run','\x20install\x20-g\x20','succeed','map','Version\x20comparison\x20failed','validation','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','filter','\x20cli-skill\x20install','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','message','426696WRDGYC','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','cwd','entries','Checking\x20CLI\x20Built-in\x20Skill...','https://registry.npmjs.org/-/package/','Updated\x20to\x20v','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','start','/dist-tags','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','includes','info','Updating\x20via\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','130844wrBbTa','toLowerCase','flag','source','122368bybnLJ','61uzYaru','version','str','Invalid\x20version:\x20','unknown','\x20→\x20','valid','trim','10CQqSME','red','70AfaNpB','bool','yellow','Checking\x20for\x20updates...','nonInteractive','45rgMOBg','execPath','Already\x20up\x20to\x20date\x20(v','@latest','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','no-skills','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','inherit','252ItuRhs','slice','timeout','fail','Beta\x20version:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','gray','log','boolean','14209789cYnQoo','skills'];a40_0x30df=function(){return _0x5aa79c;};return a40_0x30df();}(function(_0x5a8cbb,_0x27053b){const _0x5b3dca=a40_0x47e7,_0x50a551=_0x5a8cbb();while(!![]){try{const _0x5ec43c=-parseInt(_0x5b3dca(0x118))/0x1*(-parseInt(_0x5b3dca(0xe8))/0x2)+parseInt(_0x5b3dca(0xea))/0x3+parseInt(_0x5b3dca(0x113))/0x4*(-parseInt(_0x5b3dca(0x122))/0x5)+-parseInt(_0x5b3dca(0xf4))/0x6*(-parseInt(_0x5b3dca(0xda))/0x7)+-parseInt(_0x5b3dca(0x117))/0x8*(parseInt(_0x5b3dca(0x127))/0x9)+-parseInt(_0x5b3dca(0x120))/0xa*(parseInt(_0x5b3dca(0xe3))/0xb)+-parseInt(_0x5b3dca(0x104))/0xc;if(_0x5ec43c===_0x27053b)break;else _0x50a551['push'](_0x50a551['shift']());}catch(_0x5ae3f2){_0x50a551['push'](_0x50a551['shift']());}}}(a40_0x30df,0xd3131));import a40_0x46ddaa from'chalk';import a40_0x343c0a from'ora';import a40_0x58077f 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';function a40_0x47e7(_0x4bcc79,_0x5e97a3){_0x4bcc79=_0x4bcc79-0xd8;const _0x30df44=a40_0x30df();let _0x47e77e=_0x30df44[_0x4bcc79];return _0x47e77e;}import{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x457ef3=a40_0x47e7;return GIT_COMMIT!==_0x457ef3(0x11c)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x457ef3(0xdb)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x382764=a40_0x47e7,_0x46f529=process[_0x382764(0x128)][_0x382764(0x114)]();if(_0x46f529[_0x382764(0x10f)](_0x382764(0xf2)))return _0x382764(0xf2);return _0x382764(0xf0);}const updateFlags=[{'name':a40_0x29c952(0xf3),'type':a40_0x29c952(0xe2),'description':a40_0x29c952(0x10e),'default':![]},{'name':'version','type':'string','description':a40_0x29c952(0xe7)},{'name':a40_0x29c952(0x12d),'type':a40_0x29c952(0xe2),'description':'Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','default':![]},{'name':a40_0x29c952(0xe4),'type':a40_0x29c952(0xe2),'description':a40_0x29c952(0x105),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x543166){const _0x129bd0=a40_0x29c952;return _0x543166[_0x129bd0(0x11a)](_0x129bd0(0x119))[_0x129bd0(0x11f)]();}function shouldSkipCliSkill(_0x76a7af){const _0x2c2dc7=a40_0x29c952;return _0x76a7af[_0x2c2dc7(0x123)](_0x2c2dc7(0x12d))||_0x76a7af[_0x2c2dc7(0x115)](_0x2c2dc7(0xe4))===![];}async function validateUpdateFlags(_0x1afe5c){const _0x462893=a40_0x29c952,_0x29d5a8=_0x1afe5c[_0x462893(0x123)](_0x462893(0xf3)),_0x5a2002=getRequestedVersion(_0x1afe5c);if(_0x29d5a8&&_0x5a2002)throw CliErrors[_0x462893(0xfe)](_0x462893(0xff),_0x462893(0x10b));if(_0x5a2002&&!a40_0x58077f[_0x462893(0x11e)](_0x5a2002))throw CliErrors[_0x462893(0xfe)](_0x462893(0x11b)+_0x5a2002,_0x462893(0xf8));}async function fetchNpmDistTags(){const _0x1d5cb5=a40_0x29c952;try{const _0x131b97=await fetch(_0x1d5cb5(0x109)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x1d5cb5(0x10d),{'signal':AbortSignal[_0x1d5cb5(0xdc)](0x2710)});if(!_0x131b97['ok'])return null;const _0x2d19c8=await _0x131b97[_0x1d5cb5(0xeb)]();if(!_0x2d19c8||typeof _0x2d19c8!=='object')return null;return Object['fromEntries'](Object[_0x1d5cb5(0x107)](_0x2d19c8)[_0x1d5cb5(0x100)](([,_0x344ff1])=>typeof _0x344ff1==='string'&&_0x344ff1[_0x1d5cb5(0x11f)]()['length']>0x0)[_0x1d5cb5(0xfc)](([_0x5bd659,_0x5b942e])=>[_0x5bd659,String(_0x5b942e)[_0x1d5cb5(0x11f)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x568842){const _0x164036=await fetchNpmDistTags();return _0x164036?.[_0x568842]??null;}async function fetchLatestVersion(){const _0x5e91c0=a40_0x29c952;return fetchNpmDistTagVersion(_0x5e91c0(0xf6));}async function resolveTargetVersion(_0x43b71d){const _0x10a4c3=a40_0x29c952,_0x137c4d=getRequestedVersion(_0x43b71d);if(_0x137c4d)return{'version':_0x137c4d,'source':'version'};if(_0x43b71d['bool'](_0x10a4c3(0xf3))){const _0x59778c=await fetchNpmDistTagVersion(_0x10a4c3(0xf3));if(!_0x59778c)return null;return{'version':_0x59778c,'source':_0x10a4c3(0xf3)};}const _0x27c1b9=await fetchLatestVersion();if(!_0x27c1b9)return null;return{'version':_0x27c1b9,'source':_0x10a4c3(0xf6)};}function shouldInstallTarget(_0x40230a,_0x23ec08){const _0x28a619=a40_0x29c952;if(_0x23ec08[_0x28a619(0x116)]==='version'||_0x23ec08['source']===_0x28a619(0xf3))return!a40_0x58077f['eq'](_0x40230a,_0x23ec08[_0x28a619(0x119)]);return a40_0x58077f['lt'](_0x40230a,_0x23ec08[_0x28a619(0x119)]);}function getInstallPlanLabel(_0x3c6ad7,_0x4ee728){const _0x160a51=a40_0x29c952;switch(_0x4ee728[_0x160a51(0x116)]){case _0x160a51(0xf3):return _0x160a51(0xde)+a40_0x46ddaa['yellow'](_0x3c6ad7)+_0x160a51(0x11d)+a40_0x46ddaa[_0x160a51(0xec)](_0x4ee728[_0x160a51(0x119)]);case'version':return _0x160a51(0xee)+a40_0x46ddaa[_0x160a51(0x124)](_0x3c6ad7)+_0x160a51(0x11d)+a40_0x46ddaa[_0x160a51(0xec)](_0x4ee728[_0x160a51(0x119)]);case _0x160a51(0xf6):default:return _0x160a51(0xe6)+a40_0x46ddaa['yellow'](_0x3c6ad7)+_0x160a51(0x11d)+a40_0x46ddaa[_0x160a51(0xec)](_0x4ee728['version']);}}async function installCliSkill(_0x2b2049){const _0x529e7b=a40_0x29c952;console['log'](a40_0x46ddaa['gray'](_0x529e7b(0x108)));const _0x580d66=runNpxSkillsAddGlobal(process[_0x529e7b(0x106)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x2b2049?'pipe':_0x529e7b(0xd9)});if(_0x580d66['skipped']){console[_0x529e7b(0xe1)](a40_0x46ddaa['gray'](_0x529e7b(0x102)));return;}if(_0x580d66['ok']){console[_0x529e7b(0xe1)](a40_0x46ddaa[_0x529e7b(0xe0)](_0x529e7b(0xdf)));return;}console['warn'](a40_0x46ddaa[_0x529e7b(0x124)](_0x529e7b(0x12c)+(_0x580d66[_0x529e7b(0xe9)]||_0x529e7b(0x11c)))),console['log'](a40_0x46ddaa[_0x529e7b(0xe0)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x529e7b(0x101)));}async function execute(_0x564750){const _0x407885=a40_0x29c952;await validateUpdateFlags(_0x564750);const _0x22d0f4=getCurrentVersion();console[_0x407885(0xe1)](_0x407885(0xef)+_0x22d0f4);const _0x1ff2c2=a40_0x343c0a(_0x407885(0x125))[_0x407885(0x10c)](),_0x1970a9=await resolveTargetVersion(_0x564750);if(!_0x1970a9){const _0x324098=_0x564750[_0x407885(0x123)](_0x407885(0xf3))?_0x407885(0xd8):'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x1ff2c2[_0x407885(0xdd)](_0x324098),console[_0x407885(0xe1)](a40_0x46ddaa[_0x407885(0xe0)](_0x407885(0x112)+NPM_PACKAGE_NAME+_0x407885(0x12a))),{'ok':![],'message':_0x324098};}const _0x2f8262=a40_0x58077f[_0x407885(0x11e)](VERSION),_0x3fd4c7=a40_0x58077f[_0x407885(0x11e)](_0x1970a9[_0x407885(0x119)]);if(!_0x2f8262||!_0x3fd4c7)return _0x1ff2c2[_0x407885(0xdd)]('Version\x20comparison\x20failed'),{'ok':![],'message':_0x407885(0xfd)};if(!shouldInstallTarget(_0x2f8262,_0x1970a9)){const _0x2e2fa1=_0x1970a9[_0x407885(0x116)]===_0x407885(0x119)?_0x407885(0xed)+_0x1970a9[_0x407885(0x119)]+')':_0x407885(0x129)+_0x1970a9[_0x407885(0x119)]+')';return _0x1ff2c2['succeed'](_0x2e2fa1),shouldSkipCliSkill(_0x564750)?console['log'](a40_0x46ddaa[_0x407885(0xe0)](_0x407885(0xf7))):await installCliSkill(_0x564750[_0x407885(0x126)]),{'ok':!![]};}_0x1ff2c2[_0x407885(0x110)](getInstallPlanLabel(_0x22d0f4,_0x1970a9));const _0x205361=detectPackageManager(),_0x5a985b=_0x205361===_0x407885(0xf0)?resolveNpmBin(_0x407885(0xf0)):_0x205361,_0x104a6c=a40_0x343c0a(_0x407885(0x111)+_0x205361+_0x407885(0xe5))[_0x407885(0x10c)]();try{return await execa(_0x5a985b,['install','-g',NPM_PACKAGE_NAME+'@'+_0x1970a9[_0x407885(0x119)]],{'stdio':'pipe'}),_0x104a6c[_0x407885(0xfb)](_0x407885(0x10a)+_0x1970a9[_0x407885(0x119)]),console[_0x407885(0xe1)](a40_0x46ddaa[_0x407885(0xe0)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),shouldSkipCliSkill(_0x564750)?console['log'](a40_0x46ddaa[_0x407885(0xe0)](_0x407885(0xf7))):await installCliSkill(_0x564750[_0x407885(0x126)]),{'ok':!![]};}catch(_0x17420e){return _0x104a6c[_0x407885(0xdd)]('Update\x20failed'),console[_0x407885(0xe9)](a40_0x46ddaa[_0x407885(0x121)]('\x20\x20'+_0x17420e[_0x407885(0x103)])),console[_0x407885(0xe1)](a40_0x46ddaa[_0x407885(0xe0)](_0x407885(0xf5)+_0x205361+_0x407885(0xfa)+NPM_PACKAGE_NAME+'@'+_0x1970a9[_0x407885(0x119)])),{'ok':![],'message':_0x17420e['message']};}}export const updateDefinition={'service':'update','command':a40_0x29c952(0xf9),'description':a40_0x29c952(0x12b),'risk':a40_0x29c952(0xf1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d3d97,_0x4a8c16){const _0x426360=a41_0x36ba,_0x152c64=_0x4d3d97();while(!![]){try{const _0x3ff54f=parseInt(_0x426360(0xa3))/0x1*(parseInt(_0x426360(0xa2))/0x2)+parseInt(_0x426360(0x9d))/0x3*(parseInt(_0x426360(0x9e))/0x4)+parseInt(_0x426360(0xa4))/0x5+parseInt(_0x426360(0x9c))/0x6*(parseInt(_0x426360(0x9b))/0x7)+-parseInt(_0x426360(0xa1))/0x8+-parseInt(_0x426360(0xa0))/0x9+-parseInt(_0x426360(0x9f))/0xa;if(_0x3ff54f===_0x4a8c16)break;else _0x152c64['push'](_0x152c64['shift']());}catch(_0x197789){_0x152c64['push'](_0x152c64['shift']());}}}(a41_0x4684,0x6d8c6));function a41_0x36ba(_0x1da6e3,_0x49bef3){_0x1da6e3=_0x1da6e3-0x9b;const _0x4684a4=a41_0x4684();let _0x36bab5=_0x4684a4[_0x1da6e3];return _0x36bab5;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x4684(){const _0x562411=['4XlwnDR','3642420sCKzwX','3292056OGjmaM','4047944zVppYO','257962NokEuj','1RAfWTd','860665ftGrZb','833nKEHOM','44004IUtfDf','1532607YabbXh'];a41_0x4684=function(){return _0x562411;};return a41_0x4684();}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x5af651=a42_0x2a8a;function a42_0x2a8a(_0x3998f6,_0x285fec){_0x3998f6=_0x3998f6-0x126;const _0xc99f5=a42_0xc99f();let _0x2a8a83=_0xc99f5[_0x3998f6];return _0x2a8a83;}(function(_0x5da55a,_0x34503d){const _0x2b9591=a42_0x2a8a,_0x2256d3=_0x5da55a();while(!![]){try{const _0x5b3cfe=-parseInt(_0x2b9591(0x12e))/0x1+-parseInt(_0x2b9591(0x13b))/0x2+parseInt(_0x2b9591(0x13d))/0x3*(-parseInt(_0x2b9591(0x131))/0x4)+-parseInt(_0x2b9591(0x129))/0x5+parseInt(_0x2b9591(0x138))/0x6*(parseInt(_0x2b9591(0x135))/0x7)+-parseInt(_0x2b9591(0x127))/0x8+parseInt(_0x2b9591(0x133))/0x9;if(_0x5b3cfe===_0x34503d)break;else _0x2256d3['push'](_0x2256d3['shift']());}catch(_0x7e5af8){_0x2256d3['push'](_0x2256d3['shift']());}}}(a42_0xc99f,0xae3b0));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a42_0xc99f(){const _0x234683=['str','appCode','Omit\x20import\x20statements\x20from\x20generated\x20code','code','1189931JuVeBh','bool','sdk','144GKnTod','alias','43246926YFjEoh','operation','38087JssFas','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','name','42fRMtVN','boolean','tableName','1885388qtDLBc','string','60783iLlEqn','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','codegen','3106168bqtwFp','skip-imports','4396805aexbLI'];a42_0xc99f=function(){return _0x234683;};return a42_0xc99f();}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x5af651(0x126),'command':a42_0x5af651(0x130),'description':a42_0x5af651(0x136),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x5af651(0x132),'type':a42_0x5af651(0x13c),'description':a42_0x5af651(0x13e)},{'name':a42_0x5af651(0x134),'type':a42_0x5af651(0x13c),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x5af651(0x128),'type':a42_0x5af651(0x139),'description':a42_0x5af651(0x12c)}],async 'execute'(_0x4e9293){const _0x484083=a42_0x5af651,{dataset:_0x490239,operation:_0x1bc73d}=await getOperationDetail(_0x4e9293[_0x484083(0x12b)],_0x4e9293[_0x484083(0x12a)](_0x484083(0x12d)),_0x4e9293['str'](_0x484083(0x134))),_0x5d2e12=generateSdkCode(_0x490239,_0x1bc73d,{'includeImports':!_0x4e9293[_0x484083(0x12f)](_0x484083(0x128))});return{'ok':!![],'data':{'dataset':{'name':_0x490239[_0x484083(0x137)],'code':_0x490239[_0x484083(0x12d)],'tableName':_0x490239[_0x484083(0x13a)]},'operation':_0x4e9293['str'](_0x484083(0x134)),'code':_0x5d2e12}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x56794c=a43_0x2882;function a43_0x5726(){const _0xf8a33f=['sdk','3044349lAODny','sqlcode','codegen','bff','appCode','10LSMRYA','1202TbWMtS','string','4697ZgVDIW','766ewSMEy','23233668Rujmen','sql','target','7542qkMftP','1598619qLbWrd','13QlEAXo','267645pEoovS','Omit\x20import\x20statements\x20from\x20generated\x20code','2717560uDiCEv','4HuVlHU','no-imports','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','8dIdODp','sqlName'];a43_0x5726=function(){return _0xf8a33f;};return a43_0x5726();}(function(_0x5eef70,_0x1b002d){const _0x1510d5=a43_0x2882,_0x349914=_0x5eef70();while(!![]){try{const _0x52cee3=parseInt(_0x1510d5(0x1ab))/0x1*(parseInt(_0x1510d5(0x1a8))/0x2)+parseInt(_0x1510d5(0x1b2))/0x3*(-parseInt(_0x1510d5(0x1b5))/0x4)+-parseInt(_0x1510d5(0x1b4))/0x5+parseInt(_0x1510d5(0x1af))/0x6*(-parseInt(_0x1510d5(0x1aa))/0x7)+-parseInt(_0x1510d5(0x1b8))/0x8*(parseInt(_0x1510d5(0x1a2))/0x9)+parseInt(_0x1510d5(0x1a7))/0xa*(-parseInt(_0x1510d5(0x1b0))/0xb)+-parseInt(_0x1510d5(0x1ac))/0xc*(-parseInt(_0x1510d5(0x1b1))/0xd);if(_0x52cee3===_0x1b002d)break;else _0x349914['push'](_0x349914['shift']());}catch(_0x4006ac){_0x349914['push'](_0x349914['shift']());}}}(a43_0x5726,0x6aa05));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x2882(_0x16c614,_0x126bbc){_0x16c614=_0x16c614-0x1a2;const _0x572607=a43_0x5726();let _0x288216=_0x572607[_0x16c614];return _0x288216;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x56794c(0x1a4),'command':a43_0x56794c(0x1ad),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':'read','flags':[SQLCODE_FLAG,{'name':'target','type':a43_0x56794c(0x1a9),'description':a43_0x56794c(0x1b7),'default':a43_0x56794c(0x1ba),'enum':[a43_0x56794c(0x1ba),a43_0x56794c(0x1a5)]},{'name':a43_0x56794c(0x1b6),'type':'boolean','description':a43_0x56794c(0x1b3)}],async 'execute'(_0x43c672){const _0xef8ffb=a43_0x56794c,_0x1569d2=await getSqlQueryInfo(_0x43c672[_0xef8ffb(0x1a6)],_0x43c672['str'](_0xef8ffb(0x1a3))),_0x45333f=_0x43c672['str'](_0xef8ffb(0x1ae))||'sdk',_0x57f942=generateSqlCodeTemplate(_0x1569d2,{'target':_0x45333f,'includeImports':!_0x43c672['bool']('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x1569d2['sqlCode'],'sqlName':_0x1569d2[_0xef8ffb(0x1b9)],'target':_0x45333f,'code':_0x57f942}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x181607,_0x442473){const _0x1d8603=a44_0x4a60,_0x53b1f5=_0x181607();while(!![]){try{const _0x1dc755=-parseInt(_0x1d8603(0xda))/0x1*(parseInt(_0x1d8603(0xf7))/0x2)+parseInt(_0x1d8603(0xe5))/0x3*(-parseInt(_0x1d8603(0xd2))/0x4)+parseInt(_0x1d8603(0xe9))/0x5+parseInt(_0x1d8603(0xf3))/0x6+-parseInt(_0x1d8603(0xd6))/0x7+-parseInt(_0x1d8603(0xee))/0x8*(parseInt(_0x1d8603(0xde))/0x9)+-parseInt(_0x1d8603(0xd4))/0xa*(-parseInt(_0x1d8603(0xe3))/0xb);if(_0x1dc755===_0x442473)break;else _0x53b1f5['push'](_0x53b1f5['shift']());}catch(_0x30a128){_0x53b1f5['push'](_0x53b1f5['shift']());}}}(a44_0x4bbf,0xf0074));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a44_0x4bbf(){const _0x370770=['defaultApp','\x22\x20still\x20defined\x20in\x20','\x22\x20not\x20found.','1836108RiojqP','validation','projectConfig','bool','2hYNpzd','object','\x20app\x20\x22','\x20<name>\x20[--global]','\x20<name>\x20--appcode\x20<code>','string','args','40048YqictL','length','2093010pcONae','Use\x20global\x20config\x20scope','13187384YJYIiN','Added','Usage:\x20','App\x20code','980610Lengwf','global','both','\x20<name>','9bHiTdS','globalConfig','str','apps','trim','264PvLgPN','Updated','177aDvylN','boolean','inherit','flagMissing','1709205SwQUjX','Missing\x20app\x20name.','App\x20\x22','appcode','\x20Set\x20as\x20default\x20app.','9861576pthxic','project'];a44_0x4bbf=function(){return _0x370770;};return a44_0x4bbf();}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 _0x2e40fc=a44_0x4a60;return[{'name':_0x2e40fc(0xec),'type':_0x2e40fc(0xd0),'description':_0x2e40fc(0xd9),'required':!![]},{'name':_0x2e40fc(0xdb),'type':'boolean','description':_0x2e40fc(0xd5),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x369d6f=a44_0x4a60;return[{'name':_0x369d6f(0xdb),'type':_0x369d6f(0xe6),'description':_0x369d6f(0xd5),'default':![]}];}function a44_0x4a60(_0x4dae5b,_0x2639d6){_0x4dae5b=_0x4dae5b-0xcf;const _0x4bbf36=a44_0x4bbf();let _0x4a6081=_0x4bbf36[_0x4dae5b];return _0x4a6081;}export async function validateAppName(_0x2b21da,_0x9c8488){const _0x33fa77=a44_0x4a60,_0x40eba9=_0x2b21da[_0x33fa77(0xd1)][0x0]?.[_0x33fa77(0xe2)]();if(!_0x40eba9)throw CliErrors[_0x33fa77(0xf4)](_0x33fa77(0xea),_0x33fa77(0xd8)+CLI_BIN_NAME+'\x20'+_0x9c8488+_0x33fa77(0xdd));}export async function runAppAdd(_0x163028,_0x35f84b){const _0x2fae15=a44_0x4a60,_0x4db0fa=_0x163028[_0x2fae15(0xd1)][0x0]?.[_0x2fae15(0xe2)]();if(!_0x4db0fa)throw CliErrors[_0x2fae15(0xf4)](_0x2fae15(0xea),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x35f84b+_0x2fae15(0xcf));const _0xbd6095=_0x163028[_0x2fae15(0xe0)](_0x2fae15(0xec));if(!_0xbd6095)throw CliErrors[_0x2fae15(0xe8)](_0x2fae15(0xec),_0x2fae15(0xd8)+CLI_BIN_NAME+'\x20'+_0x35f84b+_0x2fae15(0xcf));const _0x5d6387={'global':_0x163028['bool']('global')},_0x445d86=readConfig(_0x5d6387);if(!_0x445d86[_0x2fae15(0xe1)])_0x445d86[_0x2fae15(0xe1)]={};const _0x113be9={'appcode':_0xbd6095,...collectAppProfileOverrides(_0x25943a=>_0x163028[_0x2fae15(0xe0)](_0x25943a))},_0x5204ea=_0x445d86[_0x2fae15(0xe1)],_0x5be007=!!_0x5204ea[_0x4db0fa];_0x5204ea[_0x4db0fa]=_0x113be9;if(!_0x445d86[_0x2fae15(0xf0)])_0x445d86[_0x2fae15(0xf0)]=_0x4db0fa;writeConfig(_0x445d86,_0x5d6387);const _0x172dbf=!_0x5be007&&_0x445d86[_0x2fae15(0xf0)]===_0x4db0fa?_0x2fae15(0xed):'',_0x13eaa5=(_0x5be007?_0x2fae15(0xe4):_0x2fae15(0xd7))+_0x2fae15(0xf9)+_0x4db0fa+'\x22\x20(appcode:\x20'+_0xbd6095+')'+scopeLabel(_0x5d6387)+'.'+_0x172dbf;return{'ok':!![],'message':_0x13eaa5};}export async function runAppRemove(_0xf02b0d,_0x53b1ef){const _0x164a0d=a44_0x4a60,_0x2da91f=_0xf02b0d[_0x164a0d(0xd1)][0x0]?.['trim']();if(!_0x2da91f)throw CliErrors[_0x164a0d(0xf4)]('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x53b1ef+_0x164a0d(0xfa));const _0x3f41a7=_0xf02b0d[_0x164a0d(0xf6)](_0x164a0d(0xdb)),{config:_0x5aa8af,layers:_0x951c7e}=readRawConfigWithLayers(),_0x58e73a=_0x5aa8af[_0x164a0d(0xe1)]??{};if(!_0x58e73a[_0x2da91f])throw CliErrors[_0x164a0d(0xf4)](_0x164a0d(0xeb)+_0x2da91f+_0x164a0d(0xf2));const _0x4a8acf=_0x951c7e[_0x164a0d(0xdf)][_0x164a0d(0xe1)]&&typeof _0x951c7e[_0x164a0d(0xdf)]['apps']===_0x164a0d(0xf8)?_0x951c7e['globalConfig']['apps']:{},_0x4f41eb=_0x951c7e['projectConfig'][_0x164a0d(0xe1)]&&typeof _0x951c7e['projectConfig']['apps']==='object'?_0x951c7e[_0x164a0d(0xf5)][_0x164a0d(0xe1)]:{},_0x559301=appDefinedIn(_0x2da91f,_0x4a8acf,_0x4f41eb,_0x951c7e['projectConfig'][_0x164a0d(0xe7)]===![]),_0x34632a=resolveAppScopeForWrite(_0x2da91f,_0x3f41a7,_0x951c7e),_0x5b1d33={'global':_0x34632a===_0x164a0d(0xdb)},_0x1a7ecf=readConfig(_0x5b1d33),_0x2ed2c5=_0x1a7ecf[_0x164a0d(0xe1)];if(!_0x2ed2c5||!_0x2ed2c5[_0x2da91f])throw CliErrors[_0x164a0d(0xf4)](_0x164a0d(0xeb)+_0x2da91f+_0x164a0d(0xf2));delete _0x2ed2c5[_0x2da91f];let _0x322ad5='';if(_0x1a7ecf[_0x164a0d(0xf0)]===_0x2da91f){const _0x2569bf=Object['keys'](_0x2ed2c5);_0x1a7ecf['defaultApp']=_0x2569bf[_0x164a0d(0xd3)]>0x0?_0x2569bf[0x0]:undefined,_0x1a7ecf[_0x164a0d(0xf0)]?_0x322ad5='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x1a7ecf[_0x164a0d(0xf0)]+'\x22.':delete _0x1a7ecf[_0x164a0d(0xf0)];}Object['keys'](_0x2ed2c5)[_0x164a0d(0xd3)]===0x0&&(delete _0x1a7ecf[_0x164a0d(0xe1)],delete _0x1a7ecf[_0x164a0d(0xf0)]);writeConfig(_0x1a7ecf,_0x5b1d33);const _0x47ec69=_0x559301===_0x164a0d(0xdc)?'\x20Note:\x20app\x20\x22'+_0x2da91f+_0x164a0d(0xf1)+(_0x34632a==='project'?_0x164a0d(0xdb):_0x164a0d(0xef))+'\x20config.':'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x2da91f+'\x22'+scopeLabel(_0x5b1d33)+'.'+_0x322ad5+_0x47ec69};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f7190,_0x31d4f6){const _0x1ec1be=a45_0x141c,_0xb8debb=_0x4f7190();while(!![]){try{const _0x1d1202=parseInt(_0x1ec1be(0x1da))/0x1+parseInt(_0x1ec1be(0x1d0))/0x2+-parseInt(_0x1ec1be(0x1dc))/0x3+-parseInt(_0x1ec1be(0x1ec))/0x4+-parseInt(_0x1ec1be(0x1e3))/0x5*(-parseInt(_0x1ec1be(0x1e2))/0x6)+-parseInt(_0x1ec1be(0x1db))/0x7+-parseInt(_0x1ec1be(0x1d5))/0x8*(-parseInt(_0x1ec1be(0x1d7))/0x9);if(_0x1d1202===_0x31d4f6)break;else _0xb8debb['push'](_0xb8debb['shift']());}catch(_0x57f851){_0xb8debb['push'](_0xb8debb['shift']());}}}(a45_0x3867,0xed0e3));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x42325b 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_0x3867(){const _0x9d8e05=['4910874YHuLUv','✎\x20自定义输入\x20appcode','正在获取可用应用列表...','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','gray','无法获取远程应用列表,请手动输入。','758904xTbTte','5UKKXPr','yellow','map','Invalid\x20App\x20Code','message','appName','App\x20Code:','请选择要绑定的应用:','length','3824636qtVhxu','trim','\x0a无法获取远程应用列表,请手动输入。','(跳过,稍后配置)','find','1093598FdfOnB','获取到\x20','appCode','\x0a未找到可用应用。','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','248ISZaYH','skip','957879cGouwm','\x20\x20(','custom','727098mMcodD','7949522iqPklg'];a45_0x3867=function(){return _0x9d8e05;};return a45_0x3867();}export async function promptCustomAppcode(){const _0x37f3a8=a45_0x141c,_0x196cdc=await input({'message':'请输入\x20App\x20Code:','validate':_0x128a95=>{const _0x119881=a45_0x141c,_0x215c8a=validateAppcode(_0x128a95[_0x119881(0x1ed)]());return _0x215c8a['valid']||_0x215c8a['message']||_0x119881(0x1e6);}});return _0x196cdc[_0x37f3a8(0x1ed)]();}export async function promptAppSelection(_0x3f6e08){const _0x41ca12=a45_0x141c,_0x36f570=[{'name':a45_0x42325b['yellow'](_0x41ca12(0x1dd)),'value':-0x1},..._0x3f6e08[_0x41ca12(0x1e5)]((_0x5afd1a,_0x4e343c)=>({'name':_0x5afd1a[_0x41ca12(0x1e8)]+'\x20\x20'+a45_0x42325b['gray']('('+_0x5afd1a[_0x41ca12(0x1d2)]+')'),'value':_0x4e343c}))],_0x4e3d31=await checkbox({'message':_0x41ca12(0x1d1)+a45_0x42325b['cyan'](_0x3f6e08[_0x41ca12(0x1eb)])+'\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','choices':_0x36f570,'loop':![]});if(_0x4e3d31['includes'](-0x1))return _0x41ca12(0x1d9);if(_0x4e3d31['length']===0x0)return _0x41ca12(0x1d9);return _0x4e3d31[_0x41ca12(0x1e5)](_0x514159=>_0x3f6e08[_0x514159]);}export async function promptSingleAppSelection(_0x6938cc){const _0x29484e=a45_0x141c,_0x133c65=[{'name':a45_0x42325b[_0x29484e(0x1e0)](_0x29484e(0x1df)),'value':_0x29484e(0x1d6)},{'name':a45_0x42325b[_0x29484e(0x1e4)](_0x29484e(0x1dd)),'value':_0x29484e(0x1d9)},..._0x6938cc[_0x29484e(0x1e5)](_0x328f75=>({'name':_0x328f75[_0x29484e(0x1e8)]+'\x20\x20'+a45_0x42325b[_0x29484e(0x1e0)]('('+_0x328f75[_0x29484e(0x1d2)]+')'),'value':_0x328f75['appCode']}))],_0x390c48=await select({'message':_0x29484e(0x1ea),'choices':_0x133c65});if(_0x390c48===_0x29484e(0x1d6))return _0x29484e(0x1d6);if(_0x390c48===_0x29484e(0x1d9))return'custom';return _0x6938cc[_0x29484e(0x1f0)](_0x395fc6=>_0x395fc6[_0x29484e(0x1d2)]===_0x390c48);}export async function selectSingleAppcode(_0x284796){const _0x1ff4c9=a45_0x141c;if(!_0x284796)return writeCliSideChannelLine(a45_0x42325b[_0x1ff4c9(0x1e0)](_0x1ff4c9(0x1d4))),_fallbackOrSkip();writeCliSideChannelLine(_0x1ff4c9(0x1de));let _0xf29287;try{_0xf29287=await withActiveCookie(_0x284796,()=>listRemoteApps());}catch(_0x227917){writeCliSideChannelLine(a45_0x42325b[_0x1ff4c9(0x1e4)](_0x1ff4c9(0x1e1)));if(_0x227917 instanceof Error)writeCliSideChannelLine(a45_0x42325b[_0x1ff4c9(0x1e0)](_0x1ff4c9(0x1d8)+_0x227917[_0x1ff4c9(0x1e7)]+')'));return _fallbackOrSkip();}if(_0xf29287['length']===0x0)return writeCliSideChannelLine(a45_0x42325b['yellow']('未找到可用应用。')),_fallbackOrSkip();const _0x1e2b84=await promptSingleAppSelection(_0xf29287);if(_0x1e2b84===_0x1ff4c9(0x1d6))return'';if(_0x1e2b84===_0x1ff4c9(0x1d9))return promptCustomAppcode();return _0x1e2b84['appCode'];}function a45_0x141c(_0x13c8e5,_0x4a9386){_0x13c8e5=_0x13c8e5-0x1d0;const _0x38677e=a45_0x3867();let _0x141c5d=_0x38677e[_0x13c8e5];return _0x141c5d;}export async function selectMultipleApps(_0x20db4c){const _0x493e36=a45_0x141c;writeCliSideChannelLine(_0x493e36(0x1de));let _0x4e7540;try{_0x4e7540=await withActiveCookie(_0x20db4c,()=>listRemoteApps());}catch(_0x1cd631){writeCliSideChannelLine(_0x493e36(0x1ee));if(_0x1cd631 instanceof Error)writeCliSideChannelLine(_0x493e36(0x1d8)+_0x1cd631[_0x493e36(0x1e7)]+')');return _0x493e36(0x1d9);}if(_0x4e7540['length']===0x0)return writeCliSideChannelLine(_0x493e36(0x1d3)),_0x493e36(0x1d9);return promptAppSelection(_0x4e7540);}async function _fallbackOrSkip(){const _0x46d431=a45_0x141c,_0x3e68fd=await select({'message':_0x46d431(0x1e9),'choices':[{'name':a45_0x42325b[_0x46d431(0x1e0)](_0x46d431(0x1ef)),'value':_0x46d431(0x1d6)},{'name':a45_0x42325b[_0x46d431(0x1e4)]('✎\x20手动输入'),'value':'manual'}]});if(_0x3e68fd===_0x46d431(0x1d6))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a46_0xe190(_0x2bc2d6,_0x25fa31){_0x2bc2d6=_0x2bc2d6-0x196;var _0x314380=a46_0x3143();var _0xe19021=_0x314380[_0x2bc2d6];return _0xe19021;}function a46_0x3143(){var _0x23659b=['345736SgcPFU','defineProperties','66ShAvcS','446126hEbcMz','description','70qWQStJ','1073574QftHyr','3343101XAlVcB','2433609xtrwxX','20wjmEkx','method','18283738UMcmWV','133345fBdjUW','4eskgvP'];a46_0x3143=function(){return _0x23659b;};return a46_0x3143();}(function(_0x5e42d8,_0x55da8a){var _0x2efa7f=a46_0xe190,_0x13aff0=_0x5e42d8();while(!![]){try{var _0x2deba8=parseInt(_0x2efa7f(0x198))/0x1+parseInt(_0x2efa7f(0x1a3))/0x2+parseInt(_0x2efa7f(0x199))/0x3*(parseInt(_0x2efa7f(0x19f))/0x4)+-parseInt(_0x2efa7f(0x19e))/0x5*(parseInt(_0x2efa7f(0x1a2))/0x6)+-parseInt(_0x2efa7f(0x197))/0x7*(parseInt(_0x2efa7f(0x1a0))/0x8)+-parseInt(_0x2efa7f(0x19a))/0x9*(-parseInt(_0x2efa7f(0x19b))/0xa)+-parseInt(_0x2efa7f(0x19d))/0xb;if(_0x2deba8===_0x55da8a)break;else _0x13aff0['push'](_0x13aff0['shift']());}catch(_0x3bb26f){_0x13aff0['push'](_0x13aff0['shift']());}}}(a46_0x3143,0x89b97));export function asDryRunResult(_0x5cde60,_0x33c199){var _0x2e6bde=a46_0xe190;return Object[_0x2e6bde(0x1a1)](_0x5cde60,{'method':{'value':_0x33c199[_0x2e6bde(0x19c)],'enumerable':![]},'url':{'value':_0x33c199['url'],'enumerable':![]},..._0x33c199[_0x2e6bde(0x196)]?{'description':{'value':_0x33c199[_0x2e6bde(0x196)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a47_0x5f58(){const _0x4db7e6=['SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','code','Database\x20product\x20type','1135179QBxlgI','1639017DJiFzO','14205670qMBVwo','449592NmDoLM','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','2233170cSUwJg','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','8097584eVnnEY','App\x20code\x20(e.g.\x20app-xxxxx)','49IILAGs','MYSQL','Dataset\x20code\x20(32-char\x20hex\x20UUID)','string','number','appcode','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','dbtype','1262MGcUtd','1765ILcMUC','datasetcode','8sOJvlK'];a47_0x5f58=function(){return _0x4db7e6;};return a47_0x5f58();}const a47_0x268c5f=a47_0x28ba;(function(_0x24c572,_0x142c2e){const _0x3906bc=a47_0x28ba,_0x212e3=_0x24c572();while(!![]){try{const _0x209ea1=-parseInt(_0x3906bc(0x190))/0x1*(-parseInt(_0x3906bc(0x18f))/0x2)+parseInt(_0x3906bc(0x196))/0x3*(-parseInt(_0x3906bc(0x192))/0x4)+parseInt(_0x3906bc(0x19b))/0x5+-parseInt(_0x3906bc(0x199))/0x6*(-parseInt(_0x3906bc(0x19f))/0x7)+parseInt(_0x3906bc(0x19d))/0x8+-parseInt(_0x3906bc(0x197))/0x9+-parseInt(_0x3906bc(0x198))/0xa;if(_0x209ea1===_0x142c2e)break;else _0x212e3['push'](_0x212e3['shift']());}catch(_0x836270){_0x212e3['push'](_0x212e3['shift']());}}}(a47_0x5f58,0xb4145));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'};export const CODE_FLAG={'name':a47_0x268c5f(0x194),'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':a47_0x268c5f(0x191),'description':a47_0x268c5f(0x1a1)};function a47_0x28ba(_0x2b2cc0,_0x55c327){_0x2b2cc0=_0x2b2cc0-0x18d;const _0x5f5860=a47_0x5f58();let _0x28ba29=_0x5f5860[_0x2b2cc0];return _0x28ba29;}export const SQLCODE_FLAG={'name':'sqlcode','type':a47_0x268c5f(0x1a2),'required':!![],'description':a47_0x268c5f(0x18d),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a47_0x268c5f(0x193)}};export const APPCODE_FLAG_OPTIONAL={'name':a47_0x268c5f(0x1a4),'type':a47_0x268c5f(0x1a2),'required':![],'description':a47_0x268c5f(0x19a)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a47_0x268c5f(0x19e)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a47_0x268c5f(0x1a3),'required':!![],'description':a47_0x268c5f(0x19c)};export const DB_TYPE_FLAG={'name':a47_0x268c5f(0x18e),'type':a47_0x268c5f(0x1a2),'required':!![],'description':a47_0x268c5f(0x195),'enum':[a47_0x268c5f(0x1a0),'POSTGRESQL']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d3637,_0x2896ef){const _0x175cd7=a48_0x51bf,_0x341184=_0x1d3637();while(!![]){try{const _0x1a8cf1=parseInt(_0x175cd7(0x7a))/0x1*(parseInt(_0x175cd7(0x74))/0x2)+-parseInt(_0x175cd7(0x71))/0x3+-parseInt(_0x175cd7(0x81))/0x4*(parseInt(_0x175cd7(0x7d))/0x5)+parseInt(_0x175cd7(0x6f))/0x6+parseInt(_0x175cd7(0x78))/0x7*(parseInt(_0x175cd7(0x7b))/0x8)+parseInt(_0x175cd7(0x70))/0x9*(parseInt(_0x175cd7(0x76))/0xa)+-parseInt(_0x175cd7(0x82))/0xb*(parseInt(_0x175cd7(0x7e))/0xc);if(_0x1a8cf1===_0x2896ef)break;else _0x341184['push'](_0x341184['shift']());}catch(_0x43d2bd){_0x341184['push'](_0x341184['shift']());}}}(a48_0x1e1f,0x655ff));function a48_0x51bf(_0x1405fb,_0x3dfdae){_0x1405fb=_0x1405fb-0x6e;const _0x1e1f26=a48_0x1e1f();let _0x51bfe9=_0x1e1f26[_0x1405fb];return _0x51bfe9;}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;function a48_0x1e1f(){const _0x2e5426=['325ULVixg','6061224deGUpg','File\x20is\x20not\x20a\x20regular\x20file:\x20','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','42892cZTAsx','11VSKPYS','File\x20not\x20found:\x20','3066072gWKlXz','7458624tFhNht','838563oyRDMa','\x20path\x20is\x20required.','validation','11014tpKdne','ceil','10ThlICA','toFixed','7FhSAyr','size','94RZnOtu','315544kIpyaR','\x20MB'];a48_0x1e1f=function(){return _0x2e5426;};return a48_0x1e1f();}export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x3a5e8b){const _0x177ccb=a48_0x51bf;if(_0x3a5e8b>=BYTES_PER_MB){const _0x47f7e8=Math[_0x177ccb(0x75)](_0x3a5e8b/BYTES_PER_MB*0x64)/0x64;return _0x47f7e8[_0x177ccb(0x77)](0x2)+_0x177ccb(0x7c);}return _0x3a5e8b+'\x20B';}export function requireDevelopmentUploadFile(_0x1d95cd,_0x5a32b9){const _0x2137c6=a48_0x51bf,_0x1f18bd=_0x1d95cd['trim']();if(!_0x1f18bd)throw CliErrors[_0x2137c6(0x73)](_0x5a32b9+_0x2137c6(0x72));if(!existsSync(_0x1f18bd))throw CliErrors['validation'](_0x2137c6(0x6e)+_0x1f18bd);const _0x44bfc7=statSync(_0x1f18bd);if(!_0x44bfc7['isFile']())throw CliErrors[_0x2137c6(0x73)](_0x2137c6(0x7f)+_0x1f18bd);if(_0x44bfc7[_0x2137c6(0x79)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x2137c6(0x73)](_0x2137c6(0x80)+_0x1f18bd+'\x20('+formatBytes(_0x44bfc7[_0x2137c6(0x79)])+')');return{'path':_0x1f18bd,'size':_0x44bfc7[_0x2137c6(0x79)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f2490,_0x4aa1f8){const _0x2aa59b=a49_0x55fd,_0x495eee=_0x2f2490();while(!![]){try{const _0x3cba73=parseInt(_0x2aa59b(0x6b))/0x1+-parseInt(_0x2aa59b(0x75))/0x2+parseInt(_0x2aa59b(0x6c))/0x3*(parseInt(_0x2aa59b(0x79))/0x4)+parseInt(_0x2aa59b(0x70))/0x5+-parseInt(_0x2aa59b(0x76))/0x6+parseInt(_0x2aa59b(0x6d))/0x7*(-parseInt(_0x2aa59b(0x77))/0x8)+-parseInt(_0x2aa59b(0x74))/0x9*(parseInt(_0x2aa59b(0x72))/0xa);if(_0x3cba73===_0x4aa1f8)break;else _0x495eee['push'](_0x495eee['shift']());}catch(_0xba160e){_0x495eee['push'](_0x495eee['shift']());}}}(a49_0x3c7b,0x52912));function a49_0x55fd(_0x403ceb,_0x4d66a4){_0x403ceb=_0x403ceb-0x6b;const _0x3c7b9d=a49_0x3c7b();let _0x55fdc5=_0x3c7b9d[_0x403ceb];return _0x55fdc5;}function a49_0x3c7b(){const _0xc3d70d=['Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','trim','3342155zkpcvf','test','286690NoqFsH','App\x20Code\x20cannot\x20exceed\x20100\x20characters','81rfoXfh','282858gRnizH','2496924PPTDQW','1696lgXYKC','length','24032NsHaCd','560299YNBHJN','102CMTpEG','9219Mlxygv'];a49_0x3c7b=function(){return _0xc3d70d;};return a49_0x3c7b();}export function validateAppcode(_0x2b3b81){const _0x10d5aa=a49_0x55fd,_0x3977ba=_0x2b3b81[_0x10d5aa(0x6f)]();if(!_0x3977ba)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0x3977ba[_0x10d5aa(0x78)]>0x64)return{'valid':![],'message':_0x10d5aa(0x73)};if(!/^[A-Za-z0-9_-]+$/[_0x10d5aa(0x71)](_0x3977ba))return{'valid':![],'message':_0x10d5aa(0x6e)};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a50_0x32b975=a50_0x4e03;function a50_0x4e03(_0x406805,_0x33a253){_0x406805=_0x406805-0x118;const _0x507e06=a50_0x507e();let _0x4e0307=_0x507e06[_0x406805];return _0x4e0307;}(function(_0x5d5169,_0x15c02e){const _0x1d7ba2=a50_0x4e03,_0x562973=_0x5d5169();while(!![]){try{const _0x415d31=parseInt(_0x1d7ba2(0x11a))/0x1+parseInt(_0x1d7ba2(0x11e))/0x2*(-parseInt(_0x1d7ba2(0x123))/0x3)+parseInt(_0x1d7ba2(0x12c))/0x4*(-parseInt(_0x1d7ba2(0x120))/0x5)+-parseInt(_0x1d7ba2(0x11f))/0x6+parseInt(_0x1d7ba2(0x12d))/0x7+-parseInt(_0x1d7ba2(0x124))/0x8+-parseInt(_0x1d7ba2(0x127))/0x9*(-parseInt(_0x1d7ba2(0x118))/0xa);if(_0x415d31===_0x15c02e)break;else _0x562973['push'](_0x562973['shift']());}catch(_0x2f65dd){_0x562973['push'](_0x562973['shift']());}}}(a50_0x507e,0xde583));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';function a50_0x507e(){const _0x4476bd=['38450GPVGXd','key','1737061tVjlTE','app','appcode','validation','647898Alcoki','6515106Lcivwf','5026870gBLRLS','Missing\x20key.','object','3xfHXfM','10101880fiivLC','str','Key\x20not\x20found:\x20','2439zGLEmy','Usage:\x20','Get\x20a\x20config\x20value\x20by\x20key','config','read','4ozWkka','12667032LkTICk'];a50_0x507e=function(){return _0x4476bd;};return a50_0x507e();}async function execute(_0x1660b7){const _0x47948d=a50_0x4e03,_0x295837=_0x1660b7[_0x47948d(0x125)](_0x47948d(0x119));if(!_0x295837)throw CliErrors[_0x47948d(0x11d)](_0x47948d(0x121),_0x47948d(0x128)+CLI_BIN_NAME+'\x20config\x20get\x20--key\x20<key>');const _0x2ac40e=readConfig(),_0x1f7317=_0x295837===_0x47948d(0x11b)?_0x47948d(0x11c):_0x295837,_0x6da21d=_0x2ac40e[_0x1f7317];if(_0x6da21d===undefined)throw CliErrors[_0x47948d(0x11d)](_0x47948d(0x126)+_0x295837);return{'ok':!![],'data':typeof _0x6da21d===_0x47948d(0x122)?_0x6da21d:{[_0x1f7317]:_0x6da21d},'message':typeof _0x6da21d===_0x47948d(0x122)?undefined:String(_0x6da21d)};}export const configGetDefinition={'service':a50_0x32b975(0x12a),'command':'get','description':a50_0x32b975(0x129),'risk':a50_0x32b975(0x12b),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a50_0x32b975(0x119),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a51_0x9672(){const _0xdbca57=['823017MCBThe','3984796EdwqtP','258NJCbmG','223019FzRcxa','11617680wsxJYT','34529031rmoazj','14IvyNoG','9374456myUZMK','10025CdGVWk'];a51_0x9672=function(){return _0xdbca57;};return a51_0x9672();}(function(_0x29fb20,_0x481df3){const _0xc3c53c=a51_0x598f,_0x14c9d1=_0x29fb20();while(!![]){try{const _0x521e42=parseInt(_0xc3c53c(0xac))/0x1*(-parseInt(_0xc3c53c(0xa6))/0x2)+parseInt(_0xc3c53c(0xa9))/0x3+parseInt(_0xc3c53c(0xaa))/0x4+parseInt(_0xc3c53c(0xa8))/0x5*(parseInt(_0xc3c53c(0xab))/0x6)+-parseInt(_0xc3c53c(0xa7))/0x7+-parseInt(_0xc3c53c(0xad))/0x8+parseInt(_0xc3c53c(0xa5))/0x9;if(_0x521e42===_0x481df3)break;else _0x14c9d1['push'](_0x14c9d1['shift']());}catch(_0x461fe2){_0x14c9d1['push'](_0x14c9d1['shift']());}}}(a51_0x9672,0xcd439));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';function a51_0x598f(_0x5879d4,_0x4debcb){_0x5879d4=_0x5879d4-0xa5;const _0x96728=a51_0x9672();let _0x598f66=_0x96728[_0x5879d4];return _0x598f66;}import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a52_0x390c2b=a52_0x430c;(function(_0xa375f6,_0x3e2af5){const _0x208510=a52_0x430c,_0x1263aa=_0xa375f6();while(!![]){try{const _0x3b6149=parseInt(_0x208510(0x189))/0x1+parseInt(_0x208510(0x182))/0x2*(parseInt(_0x208510(0x190))/0x3)+-parseInt(_0x208510(0x188))/0x4+parseInt(_0x208510(0x18f))/0x5+-parseInt(_0x208510(0x184))/0x6*(parseInt(_0x208510(0x18d))/0x7)+parseInt(_0x208510(0x18c))/0x8*(-parseInt(_0x208510(0x18a))/0x9)+parseInt(_0x208510(0x18e))/0xa;if(_0x3b6149===_0x3e2af5)break;else _0x1263aa['push'](_0x1263aa['shift']());}catch(_0x3d9f52){_0x1263aa['push'](_0x1263aa['shift']());}}}(a52_0x57b0,0x95942));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';function a52_0x57b0(){const _0x52bbec=['995426dkroQG','global','30582XzvHUH','list','List\x20all\x20config\x20values','read','4360688FHDtwu','530304aFeuNT','36GctPvW','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','769416jrEjTm','1659QYKtCm','19576240CAQCkW','1549510rYNrzz','3Mfdsjq','bool'];a52_0x57b0=function(){return _0x52bbec;};return a52_0x57b0();}function a52_0x430c(_0x20a287,_0x2c58f6){_0x20a287=_0x20a287-0x182;const _0x57b0f2=a52_0x57b0();let _0x430c4c=_0x57b0f2[_0x20a287];return _0x430c4c;}async function execute(_0x4ed8a7){const _0x20dad0=a52_0x430c,_0x611561=_0x4ed8a7[_0x20dad0(0x191)](_0x20dad0(0x183))?readScopedConfig(_0x20dad0(0x183)):readConfig();return{'ok':!![],'data':_0x611561};}export const configListDefinition={'service':'config','command':a52_0x390c2b(0x185),'description':a52_0x390c2b(0x186),'risk':a52_0x390c2b(0x187),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a52_0x390c2b(0x183),'type':'boolean','description':a52_0x390c2b(0x18b),'default':![]}],'execute':execute};
|