@lovrabet/rabetbase-cli 2.3.3 → 2.3.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.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-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/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/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/index.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 +2 -2
- package/lib/commands/app/use.js +0 -1
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a35_0xeb58(_0x16cebc,_0x35b078){_0x16cebc=_0x16cebc-0x1d2;const _0x2532c5=a35_0x2532();let _0xeb58a1=_0x2532c5[_0x16cebc];return _0xeb58a1;}function a35_0x2532(){const _0x4df9bd=['Return\x20full\x20script\x20objects','Script\x20type\x20filter','appCode','map','bool','7802724LPvixZ','type','8AwezBG','boolean','scriptType','name','No\x20BFF\x20scripts\x20found.','(unnamed)','str','521199GWcfjn','Filter\x20by\x20script\x20name','7TsJSqa','16gIVYJg','List\x20BFF\x20scripts','bff','240FBcdHX','100024XhDROg','3141490ZQulZO','1UyldAu','5405628qEfgGD','functionName','1001979QVfcUi','verbose','874460nlJwvA','ENDPOINT'];a35_0x2532=function(){return _0x4df9bd;};return a35_0x2532();}const a35_0x5a771e=a35_0xeb58;(function(_0x60d959,_0x4d093b){const _0x5727ac=a35_0xeb58,_0x104c31=_0x60d959();while(!![]){try{const _0x2548c3=-parseInt(_0x5727ac(0x1d8))/0x1*(parseInt(_0x5727ac(0x1d6))/0x2)+parseInt(_0x5727ac(0x1d9))/0x3+-parseInt(_0x5727ac(0x1d2))/0x4*(parseInt(_0x5727ac(0x1dd))/0x5)+-parseInt(_0x5727ac(0x1e4))/0x6*(-parseInt(_0x5727ac(0x1ef))/0x7)+-parseInt(_0x5727ac(0x1e6))/0x8*(-parseInt(_0x5727ac(0x1ed))/0x9)+parseInt(_0x5727ac(0x1d7))/0xa+parseInt(_0x5727ac(0x1db))/0xb*(-parseInt(_0x5727ac(0x1d5))/0xc);if(_0x2548c3===_0x4d093b)break;else _0x104c31['push'](_0x104c31['shift']());}catch(_0x4b5fe4){_0x104c31['push'](_0x104c31['shift']());}}}(a35_0x2532,0xdc776));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x5a771e(0x1d4),'command':'list','description':a35_0x5a771e(0x1d3),'risk':'read','flags':[{'name':a35_0x5a771e(0x1e5),'type':'string','description':a35_0x5a771e(0x1e0),'default':'ENDPOINT','enum':[a35_0x5a771e(0x1de),'COMMON']},{'name':a35_0x5a771e(0x1e9),'type':'string','description':a35_0x5a771e(0x1ee)},{'name':a35_0x5a771e(0x1dc),'type':a35_0x5a771e(0x1e7),'description':a35_0x5a771e(0x1df)}],async 'execute'(_0x12e457){const _0x78db21=a35_0x5a771e,_0x5154fb=await listBffScripts(_0x12e457[_0x78db21(0x1e1)],_0x12e457['str'](_0x78db21(0x1e5)),{'scriptName':_0x12e457[_0x78db21(0x1ec)](_0x78db21(0x1e9))||undefined}),_0x57d85c=_0x12e457[_0x78db21(0x1e3)](_0x78db21(0x1dc));return{'ok':!![],'data':_0x57d85c?_0x5154fb:_0x5154fb[_0x78db21(0x1e2)](_0x2d644e=>({'id':_0x2d644e['id'],'functionName':_0x2d644e[_0x78db21(0x1da)]??'','description':_0x2d644e['description']||_0x78db21(0x1eb),'scriptType':_0x2d644e[_0x78db21(0x1e8)]})),'message':_0x5154fb['length']===0x0?_0x78db21(0x1ea):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2270e0=a36_0x5192;(function(_0xa17723,_0x396be2){const _0x36eedb=a36_0x5192,_0x274186=_0xa17723();while(!![]){try{const _0x33d95a=-parseInt(_0x36eedb(0x208))/0x1*(parseInt(_0x36eedb(0x1e3))/0x2)+-parseInt(_0x36eedb(0x217))/0x3+-parseInt(_0x36eedb(0x207))/0x4*(-parseInt(_0x36eedb(0x1e8))/0x5)+parseInt(_0x36eedb(0x1d8))/0x6*(parseInt(_0x36eedb(0x20e))/0x7)+-parseInt(_0x36eedb(0x213))/0x8+-parseInt(_0x36eedb(0x204))/0x9*(-parseInt(_0x36eedb(0x1f1))/0xa)+-parseInt(_0x36eedb(0x1f5))/0xb*(-parseInt(_0x36eedb(0x21e))/0xc);if(_0x33d95a===_0x396be2)break;else _0x274186['push'](_0x274186['shift']());}catch(_0x3d6b6f){_0x274186['push'](_0x274186['shift']());}}}(a36_0x2b45,0xe214e));import{createInterface}from'node:readline';function a36_0x2b45(){const _0x316cfa=['message','version','4417tvWpXi','validation','hash','scriptType','lastSync','1048312PIeSyy','toISOString','lockFilePath','functions','187758BVYsgR','type','apiDir','Remote\x20script\x20missing\x20content.','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','Remote\x20script\x20missing\x20id.','lockKey','903972iCLEFA','\x20failed','toLowerCase','push','apps','all','3642FhDNlT','force','includes','trim','unresolvable\x20target\x20path','utf8','bff','skipped','\x20skipped,\x20','string','stderr','2FYXpbq','Force\x20pull\x20cancelled.','filePath','boolean','str','24765mLjRcp','length','functionName','&type=','scriptContent','functionNode','GET','datasetCode','appCode','1949150ghbUJh','conflict','bool','would_pull','154JLBvAh','No\x20remote\x20BFF\x20scripts\x20found.','operationType','Pull\x20complete:\x20','map','/api/management/library/scripts/list?appCode=','stringify','Force\x20overwrite\x20local\x20unsynced\x20changes','Would\x20inspect\x20','COMMON','scriptsRoot','yes','HOOK','alias','stdin','9QDjvzW','nonInteractive','pull','604ldAITf','1260814DYRkCD','local\x20unsynced\x20changes','hookLocation','write'];a36_0x2b45=function(){return _0x316cfa;};return a36_0x2b45();}import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';function a36_0x5192(_0x37c442,_0x15375b){_0x37c442=_0x37c442-0x1d8;const _0x2b4554=a36_0x2b45();let _0x5192d1=_0x2b4554[_0x37c442];return _0x5192d1;}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_0x2270e0(0x1de),'command':a36_0x2270e0(0x206),'description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a36_0x2270e0(0x20b),'flags':[{'name':'type','type':a36_0x2270e0(0x1e1),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a36_0x2270e0(0x1fe),'ENDPOINT','HOOK']},{'name':a36_0x2270e0(0x1d9),'type':a36_0x2270e0(0x1e6),'description':a36_0x2270e0(0x1fc)}],async 'dryRun'(_0x188e2a){const _0x3a6c17=a36_0x2270e0,_0x1e7ca2=loadBffProjectConfig(_0x188e2a[_0x3a6c17(0x1f0)]),_0x56fe06=await readBffLockFile(_0x1e7ca2[_0x3a6c17(0x215)]),{appLock:_0x5a4574}=ensureLockScope(_0x56fe06??createEmptyBffLock(),_0x188e2a[_0x3a6c17(0x1f0)],_0x1e7ca2[_0x3a6c17(0x1ff)],_0x3a6c17(0x206)),_0x6ca505=normalizeBffType(_0x188e2a[_0x3a6c17(0x1e7)]('type'))??undefined,_0x3c7f9a=buildDatasetCodeToAliasMap(_0x188e2a[_0x3a6c17(0x219)],_0x188e2a[_0x3a6c17(0x1f0)]),[_0x5cd49b,_0x1d034c]=await Promise[_0x3a6c17(0x223)]([listBffScripts(_0x188e2a['appCode'],_0x6ca505),getBffScriptStatistics(_0x188e2a[_0x3a6c17(0x1f0)])]),_0x40a808=createHookLocationMap(_0x1d034c),_0x212e3e=[];for(const _0x59e031 of _0x5cd49b){const _0x192d39=resolveRemoteScriptTarget(_0x1e7ca2,_0x59e031,_0x40a808,_0x5a4574[_0x3a6c17(0x216)],_0x3c7f9a);if(!_0x192d39){_0x212e3e[_0x3a6c17(0x221)]({'scriptType':_0x59e031['scriptType'],'functionName':_0x59e031[_0x3a6c17(0x1ea)]??'','status':_0x3a6c17(0x1df),'reason':_0x3a6c17(0x1dc)});continue;}const _0x3dd86=_0x5a4574['functions'][_0x192d39[_0x3a6c17(0x21d)]],_0xaeb486=_0x59e031[_0x3a6c17(0x1ec)]!=null?computeContentHash(_0x59e031['scriptContent']):undefined,_0x32c5e4=await hasUnsyncedLocalChanges(_0x192d39[_0x3a6c17(0x1e5)],_0x3dd86,_0xaeb486);_0x212e3e[_0x3a6c17(0x221)]({'lockKey':_0x192d39[_0x3a6c17(0x21d)],'filePath':_0x192d39['filePath'],'remoteId':_0x59e031['id']??null,'status':_0x32c5e4?_0x3a6c17(0x1f2):_0x3a6c17(0x1f4)});}return{'method':_0x3a6c17(0x1ee),'url':_0x3a6c17(0x1fa)+_0x188e2a['appCode']+(_0x6ca505?_0x3a6c17(0x1eb)+_0x6ca505:''),'body':{'appCode':_0x188e2a[_0x3a6c17(0x1f0)],'filterType':_0x6ca505??null,'files':_0x212e3e},'description':_0x3a6c17(0x1fd)+_0x212e3e[_0x3a6c17(0x1e9)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x90e618){const _0x560e8f=a36_0x2270e0,_0x57018d=loadBffProjectConfig(_0x90e618[_0x560e8f(0x1f0)]),_0x50ec50=await readBffLockFile(_0x57018d['lockFilePath']),{lockData:_0x63b16f,appLock:_0x5b5d88}=ensureLockScope(_0x50ec50??createEmptyBffLock(),_0x90e618[_0x560e8f(0x1f0)],_0x57018d[_0x560e8f(0x1ff)],_0x560e8f(0x206)),_0x1ea25b=normalizeBffType(_0x90e618['str'](_0x560e8f(0x218)))??undefined;if(_0x90e618[_0x560e8f(0x1e7)](_0x560e8f(0x218))&&!_0x1ea25b)throw CliErrors[_0x560e8f(0x20f)](_0x560e8f(0x21b));const [_0x599270,_0x2201df]=await Promise[_0x560e8f(0x223)]([listBffScripts(_0x90e618[_0x560e8f(0x1f0)],_0x1ea25b),getBffScriptStatistics(_0x90e618[_0x560e8f(0x1f0)])]);if(_0x599270[_0x560e8f(0x1e9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x560e8f(0x1f6)};const _0x524e57=_0x90e618[_0x560e8f(0x1f3)](_0x560e8f(0x1d9));if(_0x524e57&&!_0x90e618[_0x560e8f(0x205)]){const _0x77f6db=await confirmForce();if(!_0x77f6db)throw CliErrors['cancelled'](_0x560e8f(0x1e4));}if(_0x524e57&&_0x90e618[_0x560e8f(0x205)]){}const _0x4b6c2c=buildDatasetCodeToAliasMap(_0x90e618[_0x560e8f(0x219)],_0x90e618[_0x560e8f(0x1f0)]),_0x306454=createHookLocationMap(_0x2201df),_0x1841ec=JSON['parse'](JSON[_0x560e8f(0x1fb)](_0x63b16f)),_0x75b0b8=_0x90e618['appCode'],_0x49ef20=_0x1841ec[_0x560e8f(0x222)][_0x75b0b8];if(!_0x49ef20)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x75b0b8+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x1c7be2=[],_0x51ec03=[],_0x77f188=[];for(const _0x56ecc0 of _0x599270){const _0x51cde0=resolveRemoteScriptTarget(_0x57018d,_0x56ecc0,_0x306454,_0x5b5d88[_0x560e8f(0x216)],_0x4b6c2c);if(!_0x51cde0){_0x51ec03[_0x560e8f(0x221)]({'lockKey':_0x56ecc0[_0x560e8f(0x211)]+'/'+_0x56ecc0[_0x560e8f(0x1ea)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x31a461=_0x5b5d88[_0x560e8f(0x216)][_0x51cde0[_0x560e8f(0x21d)]];try{if(!_0x56ecc0['id'])throw new Error(_0x560e8f(0x21c));if(_0x56ecc0[_0x560e8f(0x1ec)]==null)throw new Error(_0x560e8f(0x21a));const _0x2fb9b8=_0x56ecc0['scriptContent'],_0x2730fc=computeContentHash(_0x2fb9b8);if(!_0x524e57){const _0x30dcfa=await hasUnsyncedLocalChanges(_0x51cde0[_0x560e8f(0x1e5)],_0x31a461,_0x2730fc);if(_0x30dcfa){_0x51ec03['push']({'lockKey':_0x51cde0[_0x560e8f(0x21d)],'reason':_0x560e8f(0x209)});continue;}}await ensureParentDirectory(_0x51cde0[_0x560e8f(0x1e5)]),await writeFile(_0x51cde0[_0x560e8f(0x1e5)],_0x2fb9b8,_0x560e8f(0x1dd));const _0x3e814c={'hash':_0x2730fc,'remoteId':_0x56ecc0['id'],'version':_0x56ecc0[_0x560e8f(0x20d)]};_0x51cde0[_0x560e8f(0x218)]===_0x560e8f(0x201)&&_0x51cde0[_0x560e8f(0x20a)]&&(_0x3e814c[_0x560e8f(0x202)]=_0x51cde0['hookLocation']['alias'],_0x3e814c['datasetCode']=_0x51cde0[_0x560e8f(0x20a)]['datasetCode'],_0x3e814c[_0x560e8f(0x1f7)]=_0x51cde0['hookLocation'][_0x560e8f(0x1f7)],_0x3e814c[_0x560e8f(0x1ed)]=_0x51cde0[_0x560e8f(0x20a)]['functionNode']),_0x49ef20['functions'][_0x51cde0[_0x560e8f(0x21d)]]=_0x3e814c,_0x1c7be2['push']({'lockKey':_0x51cde0['lockKey'],'remoteId':_0x56ecc0['id']});}catch(_0x28d691){_0x77f188[_0x560e8f(0x221)]({'lockKey':_0x51cde0['lockKey'],'error':_0x28d691 instanceof Error?_0x28d691[_0x560e8f(0x20c)]:String(_0x28d691)});}}return _0x49ef20[_0x560e8f(0x212)]=new Date()[_0x560e8f(0x214)](),await writeBffLockFile(_0x57018d[_0x560e8f(0x215)],_0x1841ec),{'ok':_0x77f188[_0x560e8f(0x1e9)]===0x0,'data':{'pulled':_0x1c7be2,'skipped':_0x51ec03,'failed':_0x77f188},'message':_0x560e8f(0x1f8)+_0x1c7be2[_0x560e8f(0x1e9)]+'\x20pulled,\x20'+_0x51ec03[_0x560e8f(0x1e9)]+_0x560e8f(0x1e0)+_0x77f188['length']+_0x560e8f(0x21f)};}};async function hasUnsyncedLocalChanges(_0x9eb3f,_0x2649d9,_0x222023){const _0x130707=a36_0x2270e0;if(!await fileExists(_0x9eb3f))return![];const _0x21fb1d=await computeFileHash(_0x9eb3f);if(!_0x2649d9)return _0x222023?_0x21fb1d!==_0x222023:!![];return _0x21fb1d!==_0x2649d9[_0x130707(0x210)];}function buildDatasetCodeToAliasMap(_0x212bb5,_0x23cf7b){const _0x4b32db=a36_0x2270e0,_0x1136ea=loadAliasMap(_0x212bb5,undefined,resolveApiFilePath(_0x212bb5,_0x23cf7b));return new Map(_0x1136ea[_0x4b32db(0x1f9)](_0x110288=>[_0x110288[_0x4b32db(0x1ef)],_0x110288['alias']]));}async function confirmForce(){const _0x208e72=a36_0x2270e0,_0x154b0e=createInterface({'input':process[_0x208e72(0x203)],'output':process[_0x208e72(0x1e2)]}),_0x365841=await new Promise(_0x4dcb6b=>{_0x154b0e['question']('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x4dcb6b);});return _0x154b0e['close'](),['y',_0x208e72(0x200)][_0x208e72(0x1da)](_0x365841[_0x208e72(0x1db)]()[_0x208e72(0x220)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x4f18ce=a38_0x38e9;function a38_0x3a19(){const _0x1f181f=['description','/api/management/library/scripts/save','script','operationType','str','status','validation','parse','4fjKUdD','54ONWfBU','HOOK','code','push','utf8','some','would_push','bool','get','datasetCodeToDataset','196703rSNHcR','COMMON','468688Ibwcyq','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','lockKey','aliasToDatasetCode','update','6679400lNXeUA','string','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x20uploaded,\x20','runtime\x20cache\x20not\x20needed','Push\x20only\x20this\x20script\x20type','has','name','every','743756ocVZnT','\x20skipped,\x20','Push\x20complete:\x20','type','functionNode','Lock\x20scope\x20for\x20app\x20\x22','functions','hash','Would\x20inspect\x20','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','datasetId','join','runtime\x20cache\x20cleared','\x22\x20not\x20found\x20after\x20ensureLockScope.','datasetCode','70938MJMZGm','1943160rughTv','lockFilePath','Local\x20function\x20not\x20found:\x20','high-risk-write','remoteId','unchanged','force','attempted','\x22.\x20','message','version','stringify','\x20failed,\x20','940kYVuob','cleared','Force\x20push\x20ignoring\x20hash\x20protection','map','boolean','Push\x20local\x20BFF\x20scripts\x20to\x20remote','lastSync','282VSyKlQ','runtime\x20cache\x20clear\x20failed','appCode','apiDir','POST','Runtime\x20script\x20cache\x20cleared.','filePath','bff','length','Cannot\x20resolve\x20dataset\x20for\x20\x22','alias','scriptsRoot','apps','638985eaIEZC'];a38_0x3a19=function(){return _0x1f181f;};return a38_0x3a19();}(function(_0x11051d,_0x298370){const _0x1a81a7=a38_0x38e9,_0x2e0531=_0x11051d();while(!![]){try{const _0x232d18=-parseInt(_0x1a81a7(0x1bb))/0x1+-parseInt(_0x1a81a7(0x176))/0x2+-parseInt(_0x1a81a7(0x1a7))/0x3+parseInt(_0x1a81a7(0x1b0))/0x4*(-parseInt(_0x1a81a7(0x1c2))/0x5)+parseInt(_0x1a81a7(0x19a))/0x6*(parseInt(_0x1a81a7(0x185))/0x7)+parseInt(_0x1a81a7(0x186))/0x8*(-parseInt(_0x1a81a7(0x1b1))/0x9)+-parseInt(_0x1a81a7(0x193))/0xa*(-parseInt(_0x1a81a7(0x1bd))/0xb);if(_0x232d18===_0x298370)break;else _0x2e0531['push'](_0x2e0531['shift']());}catch(_0x52770a){_0x2e0531['push'](_0x2e0531['shift']());}}}(a38_0x3a19,0xdd580));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 a38_0x38e9(_0x2a3473,_0xf36aa9){_0x2a3473=_0x2a3473-0x175;const _0x3a19a9=a38_0x3a19();let _0x38e95d=_0x3a19a9[_0x2a3473];return _0x38e95d;}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':a38_0x4f18ce(0x1a1),'command':'push','description':a38_0x4f18ce(0x198),'risk':a38_0x4f18ce(0x189),'flags':[{'name':'type','type':'string','description':a38_0x4f18ce(0x1c7),'enum':[a38_0x4f18ce(0x1bc),'ENDPOINT','HOOK']},{'name':a38_0x4f18ce(0x1c9),'type':a38_0x4f18ce(0x1c3),'description':a38_0x4f18ce(0x1be)},{'name':a38_0x4f18ce(0x18c),'type':a38_0x4f18ce(0x197),'description':a38_0x4f18ce(0x195)}],async 'dryRun'(_0xab342e){const _0x1a034c=a38_0x4f18ce,_0x4a2f48=loadBffProjectConfig(_0xab342e[_0x1a034c(0x19c)]),_0x4ab9a7=await readBffLockFile(_0x4a2f48[_0x1a034c(0x187)]),{appLock:_0x276144}=ensureLockScope(_0x4ab9a7??createEmptyBffLock(),_0xab342e[_0x1a034c(0x19c)],_0x4a2f48['scriptsRoot'],_0x1a034c(0x1b4)),_0x44f842=await getTargetFunctions(_0x4a2f48,_0xab342e),_0x3de597=_0xab342e[_0x1a034c(0x1b8)](_0x1a034c(0x18c)),_0x2d748b=[];for(const _0x3d74aa of _0x44f842){const _0x45e066=await computeFileHash(_0x3d74aa[_0x1a034c(0x1a0)]),_0x476659=_0x276144['functions'][_0x3d74aa[_0x1a034c(0x1bf)]],_0x5d49c5=!!_0x476659&&_0x476659[_0x1a034c(0x17d)]===_0x45e066;_0x2d748b['push']({'lockKey':_0x3d74aa[_0x1a034c(0x1bf)],'filePath':_0x3d74aa[_0x1a034c(0x1a0)],'remoteId':_0x476659?.['remoteId']??null,'mode':_0x476659?.[_0x1a034c(0x18a)]?_0x1a034c(0x1c1):'create','status':!_0x3de597&&_0x5d49c5?_0x1a034c(0x18b):_0x1a034c(0x1b7)});}return{'method':_0x1a034c(0x19e),'url':_0x1a034c(0x1a9),'body':{'appCode':_0xab342e[_0x1a034c(0x19c)],'force':_0x3de597,'files':_0x2d748b,'cacheClearAtRuntime':_0x2d748b[_0x1a034c(0x1b6)](_0x502f1f=>_0x502f1f[_0x1a034c(0x1ad)]==='would_push'),'cacheClearAtRuntimeTimes':_0x2d748b[_0x1a034c(0x1b6)](_0x291a76=>_0x291a76['status']===_0x1a034c(0x1b7))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x1a034c(0x17e)+_0x2d748b[_0x1a034c(0x1a2)]+_0x1a034c(0x17f)};},async 'execute'(_0x55b18e){const _0x30fe7e=a38_0x4f18ce,_0x436093=loadBffProjectConfig(_0x55b18e[_0x30fe7e(0x19c)]),_0x23b2f0=await readBffLockFile(_0x436093[_0x30fe7e(0x187)]),{lockData:_0x9469f8,appLock:_0x588c2a}=ensureLockScope(_0x23b2f0??createEmptyBffLock(),_0x55b18e[_0x30fe7e(0x19c)],_0x436093[_0x30fe7e(0x1a5)],_0x30fe7e(0x1b4)),_0x2c7aef=await getTargetFunctions(_0x436093,_0x55b18e);if(_0x2c7aef['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0xd50a99=_0x55b18e[_0x30fe7e(0x1b8)](_0x30fe7e(0x18c)),_0x335113=JSON[_0x30fe7e(0x1af)](JSON[_0x30fe7e(0x191)](_0x9469f8)),_0x44c42b=_0x335113['apps'][_0x55b18e[_0x30fe7e(0x19c)]];if(!_0x44c42b)throw new Error(_0x30fe7e(0x17b)+_0x55b18e['appCode']+_0x30fe7e(0x183));const _0x2cbb35=await buildHookMaps(_0x55b18e[_0x30fe7e(0x19c)],_0x55b18e[_0x30fe7e(0x19d)],_0x2c7aef,_0x44c42b),_0x49ccc8=[],_0x5cbb28=[],_0x21761c=[];for(const _0x59d356 of _0x2c7aef){const _0x38e318=await computeFileHash(_0x59d356[_0x30fe7e(0x1a0)]),_0x232b68=_0x44c42b[_0x30fe7e(0x17c)][_0x59d356[_0x30fe7e(0x1bf)]];if(!_0xd50a99&&_0x232b68&&_0x232b68[_0x30fe7e(0x17d)]===_0x38e318){_0x5cbb28[_0x30fe7e(0x1b4)]({'lockKey':_0x59d356[_0x30fe7e(0x1bf)],'reason':_0x30fe7e(0x18b)});continue;}try{await uploadSingleFunction(_0x55b18e['appCode'],_0x59d356,_0x44c42b,_0x2cbb35);const _0x5905f0=_0x44c42b[_0x30fe7e(0x17c)][_0x59d356['lockKey']];_0x49ccc8['push']({'lockKey':_0x59d356['lockKey'],'remoteId':_0x5905f0?.[_0x30fe7e(0x18a)]??0x0});}catch(_0x3e827a){_0x21761c['push']({'lockKey':_0x59d356[_0x30fe7e(0x1bf)],'error':_0x3e827a instanceof Error?_0x3e827a[_0x30fe7e(0x18f)]:String(_0x3e827a)});}}_0x44c42b[_0x30fe7e(0x199)]=new Date()['toISOString'](),await writeBffLockFile(_0x436093[_0x30fe7e(0x187)],_0x335113),await waitForUploadedLockEntries(_0x436093['lockFilePath'],_0x55b18e[_0x30fe7e(0x19c)],_0x49ccc8[_0x30fe7e(0x196)](_0x58b211=>_0x58b211[_0x30fe7e(0x1bf)]));let _0x3b7813={'attempted':![],'cleared':![]};if(_0x49ccc8[_0x30fe7e(0x1a2)]>0x0)try{let _0x1296a2='';for(let _0x4c541a=0x0;_0x4c541a<CACHE_CLEAR_ATTEMPTS;_0x4c541a+=0x1){_0x1296a2=await clearBffScriptCache(),_0x4c541a<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x3b7813={'attempted':!![],'cleared':!![],'message':_0x1296a2||_0x30fe7e(0x19f)};}catch(_0x34ccb4){_0x3b7813={'attempted':!![],'cleared':![],'error':_0x34ccb4 instanceof Error?_0x34ccb4['message']:String(_0x34ccb4)};}const _0x4edd76=_0x21761c[_0x30fe7e(0x1a2)]===0x0&&(_0x3b7813[_0x30fe7e(0x18d)]?_0x3b7813[_0x30fe7e(0x194)]:!![]),_0x2a7665=_0x3b7813[_0x30fe7e(0x18d)]?_0x3b7813['cleared']?_0x30fe7e(0x182):_0x30fe7e(0x19b):_0x30fe7e(0x1c6);return{'ok':_0x4edd76,'data':{'uploaded':_0x49ccc8,'skipped':_0x5cbb28,'failed':_0x21761c,'cacheClear':_0x3b7813},'message':_0x30fe7e(0x178)+_0x49ccc8['length']+_0x30fe7e(0x1c5)+_0x5cbb28[_0x30fe7e(0x1a2)]+_0x30fe7e(0x177)+_0x21761c['length']+_0x30fe7e(0x192)+_0x2a7665};}};async function getTargetFunctions(_0x3d4d68,_0x198b94){const _0x3201b0=a38_0x4f18ce,_0x48c417=_0x198b94[_0x3201b0(0x1ac)]('type'),_0x216565=_0x198b94['str'](_0x3201b0(0x1c9)),_0x446784=normalizeBffType(_0x48c417)??undefined;if(_0x216565&&!_0x446784)throw CliErrors[_0x3201b0(0x1ae)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x183941=await scanLocalBffFunctions(_0x3d4d68,_0x446784);if(_0x216565){const _0x58cfc6=_0x183941['filter'](_0x3b0143=>_0x3b0143['name']===_0x216565);if(_0x58cfc6[_0x3201b0(0x1a2)]===0x0)throw CliErrors[_0x3201b0(0x1ae)](_0x3201b0(0x188)+_0x446784+'/'+_0x216565);return _0x58cfc6;}return _0x183941;}async function buildHookMaps(_0x305f50,_0x5164b3,_0x5da9bb,_0x5cf489){const _0x372be7=a38_0x4f18ce,_0x2db241=_0x5da9bb[_0x372be7(0x1b6)](_0x47b139=>_0x47b139[_0x372be7(0x179)]===_0x372be7(0x1b2));if(!_0x2db241)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2518e7=loadAliasMap(_0x5164b3,undefined,resolveApiFilePath(_0x5164b3,_0x305f50)),_0x49d1d0=new Map(_0x2518e7[_0x372be7(0x196)](_0x56793f=>[_0x56793f['alias'],_0x56793f[_0x372be7(0x184)]]));for(const _0x548874 of Object['values'](_0x5cf489[_0x372be7(0x17c)])){_0x548874[_0x372be7(0x1a4)]&&_0x548874[_0x372be7(0x184)]&&!_0x49d1d0['has'](_0x548874[_0x372be7(0x1a4)])&&_0x49d1d0['set'](_0x548874['alias'],_0x548874[_0x372be7(0x184)]);}const _0x41cd9c=await listDatasets(_0x305f50),_0x4f566c=new Map(_0x41cd9c['map'](_0x2d1eea=>[_0x2d1eea[_0x372be7(0x1b3)],_0x2d1eea]));return{'aliasToDatasetCode':_0x49d1d0,'datasetCodeToDataset':_0x4f566c};}async function uploadSingleFunction(_0x5c28b5,_0x51b27d,_0x505497,_0x4702cf){const _0x1db876=a38_0x4f18ce,_0x2472b1=await readFile(_0x51b27d[_0x1db876(0x1a0)],_0x1db876(0x1b5)),_0x1638e4=await computeFileHash(_0x51b27d[_0x1db876(0x1a0)]),_0x2fcb89=_0x505497[_0x1db876(0x17c)][_0x51b27d[_0x1db876(0x1bf)]];if(_0x2fcb89?.[_0x1db876(0x18a)]&&_0x2fcb89[_0x1db876(0x190)]==null)throw CliErrors['validation'](_0x51b27d[_0x1db876(0x1bf)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x44ceb7=extractScriptDescription(_0x2472b1);if(!_0x44ceb7&&_0x2fcb89?.[_0x1db876(0x18a)]){const _0x129bb0=await getBffScriptInfo(_0x2fcb89[_0x1db876(0x18a)]);_0x44ceb7=_0x129bb0['description']||undefined;}const _0x4aaebc={'appCode':_0x5c28b5,'functionName':_0x51b27d[_0x1db876(0x1c9)],'scriptType':_0x51b27d['type'],'scriptContent':_0x2472b1};if(_0x2fcb89?.[_0x1db876(0x18a)])_0x4aaebc['id']=_0x2fcb89[_0x1db876(0x18a)];if(_0x2fcb89?.[_0x1db876(0x190)]!=null)_0x4aaebc[_0x1db876(0x190)]=_0x2fcb89[_0x1db876(0x190)];if(_0x44ceb7)_0x4aaebc[_0x1db876(0x1a8)]=_0x44ceb7;if(_0x51b27d[_0x1db876(0x179)]===_0x1db876(0x1b2)){const _0x44182d=_0x51b27d[_0x1db876(0x1a4)];if(!_0x44182d||!_0x51b27d['operationType']||!_0x51b27d[_0x1db876(0x17a)])throw CliErrors[_0x1db876(0x1ae)]('Incomplete\x20HOOK\x20path:\x20'+_0x51b27d[_0x1db876(0x1bf)]);const _0x2559ea=_0x4702cf[_0x1db876(0x1c0)]['get'](_0x44182d)??_0x2fcb89?.['datasetCode']??_0x44182d,_0x38f0bd=_0x4702cf[_0x1db876(0x1ba)][_0x1db876(0x1b9)](_0x2559ea);if(!_0x38f0bd)throw CliErrors['validation'](_0x1db876(0x1a3)+_0x44182d+_0x1db876(0x18e)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x4aaebc[_0x1db876(0x180)]=_0x38f0bd['id'],_0x4aaebc[_0x1db876(0x1ab)]=_0x51b27d[_0x1db876(0x1ab)],_0x4aaebc[_0x1db876(0x17a)]=_0x51b27d['functionNode'];}const _0x23a804=await saveBffScript(_0x4aaebc),_0x5f0357=_0x23a804['id'],_0x3ca68c=_0x23a804[_0x1db876(0x1aa)]??await getBffScriptInfo(_0x5f0357),_0x3008ab={'hash':_0x1638e4,'remoteId':_0x5f0357,'version':_0x3ca68c[_0x1db876(0x190)]};if(_0x51b27d[_0x1db876(0x179)]==='HOOK'){const _0x163d42=_0x51b27d[_0x1db876(0x1a4)],_0x30a633=_0x4702cf[_0x1db876(0x1c0)][_0x1db876(0x1b9)](_0x163d42)??_0x2fcb89?.[_0x1db876(0x184)]??_0x163d42;_0x4702cf['aliasToDatasetCode'][_0x1db876(0x1c8)](_0x163d42)?_0x3008ab[_0x1db876(0x1a4)]=_0x163d42:_0x3008ab[_0x1db876(0x1a4)]=_0x2fcb89?.[_0x1db876(0x1a4)],_0x3008ab['datasetCode']=_0x30a633,_0x3008ab[_0x1db876(0x1ab)]=_0x51b27d[_0x1db876(0x1ab)],_0x3008ab[_0x1db876(0x17a)]=_0x51b27d[_0x1db876(0x17a)];}_0x505497[_0x1db876(0x17c)][_0x51b27d['lockKey']]=_0x3008ab;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x12b758,_0x5207e5,_0x2efa47){const _0x163f27=a38_0x4f18ce;if(_0x2efa47['length']===0x0)return;for(let _0x27c3c9=0x0;_0x27c3c9<LOCK_SETTLE_RETRY_COUNT;_0x27c3c9+=0x1){const _0x3ee043=await readBffLockFile(_0x12b758),_0x3a0e29=_0x3ee043?.[_0x163f27(0x1a6)]?.[_0x5207e5]?.[_0x163f27(0x17c)]??{},_0x196780=_0x2efa47[_0x163f27(0x175)](_0xe4ca5a=>!!_0x3a0e29[_0xe4ca5a]?.[_0x163f27(0x18a)]);if(_0x196780)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x163f27(0x1c4)+_0x2efa47[_0x163f27(0x181)](',\x20')+'.');}
|
|
1
|
+
const a37_0x446567=a37_0x279e;(function(_0x3aaa05,_0x56e7b2){const _0x33d427=a37_0x279e,_0x284951=_0x3aaa05();while(!![]){try{const _0x12d533=-parseInt(_0x33d427(0x17e))/0x1*(parseInt(_0x33d427(0x18d))/0x2)+parseInt(_0x33d427(0x16e))/0x3*(parseInt(_0x33d427(0x16a))/0x4)+-parseInt(_0x33d427(0x19e))/0x5+parseInt(_0x33d427(0x19d))/0x6+-parseInt(_0x33d427(0x172))/0x7+-parseInt(_0x33d427(0x179))/0x8+parseInt(_0x33d427(0x17b))/0x9*(parseInt(_0x33d427(0x167))/0xa);if(_0x12d533===_0x56e7b2)break;else _0x284951['push'](_0x284951['shift']());}catch(_0x5466da){_0x284951['push'](_0x284951['shift']());}}}(a37_0xb401,0x27b3a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a37_0xb401(){const _0x29114f=['type','lockFilePath','datasetCode','utf8','push','get','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','Force\x20push\x20ignoring\x20hash\x20protection','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','20rbXpJS','hash','high-risk-write','8TcEiPi','/api/management/library/scripts/save','Run\x20`','values','122352OlRVkB','set','scriptsRoot','HOOK','2113272jQoRLX','Lock\x20scope\x20for\x20app\x20\x22','remoteId','parse','Cannot\x20resolve\x20dataset\x20for\x20\x22','datasetId','\x20failed,\x20','649776dMunNx','attempted','2573694vSWpho','version','Push\x20only\x20this\x20script\x20type','166134CpPVbz','Runtime\x20script\x20cache\x20cleared.','message','string','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','every','has','apps','validation','lockKey','str','Push\x20complete:\x20','runtime\x20cache\x20cleared','apiDir','lastSync','2MmADXa','cleared','join','map','filePath','No\x20local\x20BFF\x20functions\x20found.','force',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','some','toISOString','functionNode','filter','create','status','description','appCode','1653666lsjYKB','1086205fWsStt','Push\x20local\x20BFF\x20scripts\x20to\x20remote','operationType','alias','length','would_push','stringify','update','aliasToDatasetCode','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','functions','code','name','\x22\x20not\x20found\x20after\x20ensureLockScope.','runtime\x20cache\x20not\x20needed'];a37_0xb401=function(){return _0x29114f;};return a37_0xb401();}import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';function a37_0x279e(_0xd7f9b7,_0x26f325){_0xd7f9b7=_0xd7f9b7-0x154;const _0xb4016f=a37_0xb401();let _0x279e47=_0xb4016f[_0xd7f9b7];return _0x279e47;}import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a37_0x446567(0x19f),'risk':a37_0x446567(0x169),'flags':[{'name':'type','type':a37_0x446567(0x181),'description':a37_0x446567(0x17d),'enum':['COMMON','ENDPOINT',a37_0x446567(0x171)]},{'name':'name','type':a37_0x446567(0x181),'description':a37_0x446567(0x182)},{'name':'force','type':'boolean','description':a37_0x446567(0x165)}],async 'dryRun'(_0x2db769){const _0x15c854=a37_0x446567,_0xc3378c=loadBffProjectConfig(_0x2db769[_0x15c854(0x19c)]),_0x458e82=await readBffLockFile(_0xc3378c[_0x15c854(0x15f)]),{appLock:_0x2171ad}=ensureLockScope(_0x458e82??createEmptyBffLock(),_0x2db769['appCode'],_0xc3378c[_0x15c854(0x170)],_0x15c854(0x162)),_0x79dc06=await getTargetFunctions(_0xc3378c,_0x2db769),_0x292b63=_0x2db769['bool'](_0x15c854(0x193)),_0x568aeb=[];for(const _0x14cf14 of _0x79dc06){const _0xa07de5=await computeFileHash(_0x14cf14[_0x15c854(0x191)]),_0x350448=_0x2171ad[_0x15c854(0x159)][_0x14cf14['lockKey']],_0x3622a6=!!_0x350448&&_0x350448[_0x15c854(0x168)]===_0xa07de5;_0x568aeb['push']({'lockKey':_0x14cf14['lockKey'],'filePath':_0x14cf14[_0x15c854(0x191)],'remoteId':_0x350448?.[_0x15c854(0x174)]??null,'mode':_0x350448?.[_0x15c854(0x174)]?_0x15c854(0x156):_0x15c854(0x199),'status':!_0x292b63&&_0x3622a6?'unchanged':'would_push'});}return{'method':'POST','url':_0x15c854(0x16b),'body':{'appCode':_0x2db769[_0x15c854(0x19c)],'force':_0x292b63,'files':_0x568aeb,'cacheClearAtRuntime':_0x568aeb[_0x15c854(0x195)](_0x138b75=>_0x138b75[_0x15c854(0x19a)]==='would_push'),'cacheClearAtRuntimeTimes':_0x568aeb[_0x15c854(0x195)](_0x4d55b4=>_0x4d55b4[_0x15c854(0x19a)]===_0x15c854(0x154))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x568aeb['length']+_0x15c854(0x166)};},async 'execute'(_0xce5186){const _0x20aaea=a37_0x446567,_0xa55561=loadBffProjectConfig(_0xce5186[_0x20aaea(0x19c)]),_0x1dcbbd=await readBffLockFile(_0xa55561[_0x20aaea(0x15f)]),{lockData:_0x59a4d3,appLock:_0x1e9943}=ensureLockScope(_0x1dcbbd??createEmptyBffLock(),_0xce5186['appCode'],_0xa55561[_0x20aaea(0x170)],_0x20aaea(0x162)),_0x4191d4=await getTargetFunctions(_0xa55561,_0xce5186);if(_0x4191d4[_0x20aaea(0x1a2)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x20aaea(0x192)};const _0x12df39=_0xce5186['bool'](_0x20aaea(0x193)),_0x5a93d0=JSON[_0x20aaea(0x175)](JSON[_0x20aaea(0x155)](_0x59a4d3)),_0x2d1c67=_0x5a93d0[_0x20aaea(0x185)][_0xce5186[_0x20aaea(0x19c)]];if(!_0x2d1c67)throw new Error(_0x20aaea(0x173)+_0xce5186['appCode']+_0x20aaea(0x15c));const _0x20af3f=await buildHookMaps(_0xce5186[_0x20aaea(0x19c)],_0xce5186[_0x20aaea(0x18b)],_0x4191d4,_0x2d1c67),_0x182378=[],_0x59e461=[],_0x5758bb=[];for(const _0x1bfb91 of _0x4191d4){const _0x489467=await computeFileHash(_0x1bfb91[_0x20aaea(0x191)]),_0x240c60=_0x2d1c67['functions'][_0x1bfb91['lockKey']];if(!_0x12df39&&_0x240c60&&_0x240c60[_0x20aaea(0x168)]===_0x489467){_0x59e461[_0x20aaea(0x162)]({'lockKey':_0x1bfb91[_0x20aaea(0x187)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0xce5186['appCode'],_0x1bfb91,_0x2d1c67,_0x20af3f);const _0x50fa11=_0x2d1c67[_0x20aaea(0x159)][_0x1bfb91['lockKey']];_0x182378['push']({'lockKey':_0x1bfb91[_0x20aaea(0x187)],'remoteId':_0x50fa11?.[_0x20aaea(0x174)]??0x0});}catch(_0x2e2064){_0x5758bb[_0x20aaea(0x162)]({'lockKey':_0x1bfb91[_0x20aaea(0x187)],'error':_0x2e2064 instanceof Error?_0x2e2064[_0x20aaea(0x180)]:String(_0x2e2064)});}}_0x2d1c67[_0x20aaea(0x18c)]=new Date()[_0x20aaea(0x196)](),await writeBffLockFile(_0xa55561[_0x20aaea(0x15f)],_0x5a93d0),await waitForUploadedLockEntries(_0xa55561[_0x20aaea(0x15f)],_0xce5186['appCode'],_0x182378[_0x20aaea(0x190)](_0x56465c=>_0x56465c[_0x20aaea(0x187)]));let _0x3383a5={'attempted':![],'cleared':![]};if(_0x182378[_0x20aaea(0x1a2)]>0x0)try{let _0x31b088='';for(let _0x186da8=0x0;_0x186da8<CACHE_CLEAR_ATTEMPTS;_0x186da8+=0x1){_0x31b088=await clearBffScriptCache(),_0x186da8<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x3383a5={'attempted':!![],'cleared':!![],'message':_0x31b088||_0x20aaea(0x17f)};}catch(_0x5dfeaf){_0x3383a5={'attempted':!![],'cleared':![],'error':_0x5dfeaf instanceof Error?_0x5dfeaf[_0x20aaea(0x180)]:String(_0x5dfeaf)};}const _0x3bfa45=_0x5758bb[_0x20aaea(0x1a2)]===0x0&&(_0x3383a5[_0x20aaea(0x17a)]?_0x3383a5[_0x20aaea(0x18e)]:!![]),_0x581e4a=_0x3383a5[_0x20aaea(0x17a)]?_0x3383a5[_0x20aaea(0x18e)]?_0x20aaea(0x18a):'runtime\x20cache\x20clear\x20failed':_0x20aaea(0x15d);return{'ok':_0x3bfa45,'data':{'uploaded':_0x182378,'skipped':_0x59e461,'failed':_0x5758bb,'cacheClear':_0x3383a5},'message':_0x20aaea(0x189)+_0x182378[_0x20aaea(0x1a2)]+'\x20uploaded,\x20'+_0x59e461[_0x20aaea(0x1a2)]+'\x20skipped,\x20'+_0x5758bb[_0x20aaea(0x1a2)]+_0x20aaea(0x178)+_0x581e4a};}};async function getTargetFunctions(_0x7adbf6,_0x4a04f0){const _0x1d0382=a37_0x446567,_0x5badb3=_0x4a04f0[_0x1d0382(0x188)](_0x1d0382(0x15e)),_0x3bf65e=_0x4a04f0[_0x1d0382(0x188)]('name'),_0x213d19=normalizeBffType(_0x5badb3)??undefined;if(_0x3bf65e&&!_0x213d19)throw CliErrors[_0x1d0382(0x186)](_0x1d0382(0x164));const _0x354cd1=await scanLocalBffFunctions(_0x7adbf6,_0x213d19);if(_0x3bf65e){const _0x3d61e8=_0x354cd1[_0x1d0382(0x198)](_0x1ff5d8=>_0x1ff5d8[_0x1d0382(0x15b)]===_0x3bf65e);if(_0x3d61e8[_0x1d0382(0x1a2)]===0x0)throw CliErrors['validation']('Local\x20function\x20not\x20found:\x20'+_0x213d19+'/'+_0x3bf65e);return _0x3d61e8;}return _0x354cd1;}async function buildHookMaps(_0x3e0456,_0x51f10e,_0x121e57,_0x1f197f){const _0x782a5a=a37_0x446567,_0x533488=_0x121e57['some'](_0xd9033a=>_0xd9033a[_0x782a5a(0x15e)]==='HOOK');if(!_0x533488)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5f29fa=loadAliasMap(_0x51f10e,undefined,resolveApiFilePath(_0x51f10e,_0x3e0456)),_0x178c89=new Map(_0x5f29fa[_0x782a5a(0x190)](_0xe892d7=>[_0xe892d7[_0x782a5a(0x1a1)],_0xe892d7[_0x782a5a(0x160)]]));for(const _0x381f81 of Object[_0x782a5a(0x16d)](_0x1f197f[_0x782a5a(0x159)])){_0x381f81[_0x782a5a(0x1a1)]&&_0x381f81[_0x782a5a(0x160)]&&!_0x178c89['has'](_0x381f81[_0x782a5a(0x1a1)])&&_0x178c89[_0x782a5a(0x16f)](_0x381f81['alias'],_0x381f81[_0x782a5a(0x160)]);}const _0xc0c0b2=await listDatasets(_0x3e0456),_0x4e8193=new Map(_0xc0c0b2[_0x782a5a(0x190)](_0x53ba38=>[_0x53ba38[_0x782a5a(0x15a)],_0x53ba38]));return{'aliasToDatasetCode':_0x178c89,'datasetCodeToDataset':_0x4e8193};}async function uploadSingleFunction(_0x3f495b,_0x3c14a5,_0x488eb1,_0x5868fd){const _0x41fb6a=a37_0x446567,_0x2f569a=await readFile(_0x3c14a5[_0x41fb6a(0x191)],_0x41fb6a(0x161)),_0x9f50c7=await computeFileHash(_0x3c14a5[_0x41fb6a(0x191)]),_0x13a7d5=_0x488eb1[_0x41fb6a(0x159)][_0x3c14a5[_0x41fb6a(0x187)]];if(_0x13a7d5?.[_0x41fb6a(0x174)]&&_0x13a7d5[_0x41fb6a(0x17c)]==null)throw CliErrors[_0x41fb6a(0x186)](_0x3c14a5[_0x41fb6a(0x187)]+_0x41fb6a(0x194));let _0x464a53=extractScriptDescription(_0x2f569a);if(!_0x464a53&&_0x13a7d5?.['remoteId']){const _0x414c6d=await getBffScriptInfo(_0x13a7d5[_0x41fb6a(0x174)]);_0x464a53=_0x414c6d['description']||undefined;}const _0x3075b8={'appCode':_0x3f495b,'functionName':_0x3c14a5[_0x41fb6a(0x15b)],'scriptType':_0x3c14a5[_0x41fb6a(0x15e)],'scriptContent':_0x2f569a};if(_0x13a7d5?.[_0x41fb6a(0x174)])_0x3075b8['id']=_0x13a7d5[_0x41fb6a(0x174)];if(_0x13a7d5?.[_0x41fb6a(0x17c)]!=null)_0x3075b8['version']=_0x13a7d5[_0x41fb6a(0x17c)];if(_0x464a53)_0x3075b8[_0x41fb6a(0x19b)]=_0x464a53;if(_0x3c14a5[_0x41fb6a(0x15e)]===_0x41fb6a(0x171)){const _0x10e478=_0x3c14a5[_0x41fb6a(0x1a1)];if(!_0x10e478||!_0x3c14a5['operationType']||!_0x3c14a5[_0x41fb6a(0x197)])throw CliErrors[_0x41fb6a(0x186)]('Incomplete\x20HOOK\x20path:\x20'+_0x3c14a5['lockKey']);const _0x37d4e4=_0x5868fd[_0x41fb6a(0x157)][_0x41fb6a(0x163)](_0x10e478)??_0x13a7d5?.['datasetCode']??_0x10e478,_0x431bb3=_0x5868fd['datasetCodeToDataset']['get'](_0x37d4e4);if(!_0x431bb3)throw CliErrors['validation'](_0x41fb6a(0x176)+_0x10e478+'\x22.\x20'+(_0x41fb6a(0x16c)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x3075b8[_0x41fb6a(0x177)]=_0x431bb3['id'],_0x3075b8[_0x41fb6a(0x1a0)]=_0x3c14a5['operationType'],_0x3075b8[_0x41fb6a(0x197)]=_0x3c14a5[_0x41fb6a(0x197)];}const _0xd5b576=await saveBffScript(_0x3075b8),_0x326731=_0xd5b576['id'],_0x309b36=_0xd5b576['script']??await getBffScriptInfo(_0x326731),_0x687e35={'hash':_0x9f50c7,'remoteId':_0x326731,'version':_0x309b36[_0x41fb6a(0x17c)]};if(_0x3c14a5[_0x41fb6a(0x15e)]==='HOOK'){const _0x34a7a2=_0x3c14a5['alias'],_0x1f4085=_0x5868fd['aliasToDatasetCode'][_0x41fb6a(0x163)](_0x34a7a2)??_0x13a7d5?.[_0x41fb6a(0x160)]??_0x34a7a2;_0x5868fd['aliasToDatasetCode'][_0x41fb6a(0x184)](_0x34a7a2)?_0x687e35[_0x41fb6a(0x1a1)]=_0x34a7a2:_0x687e35[_0x41fb6a(0x1a1)]=_0x13a7d5?.[_0x41fb6a(0x1a1)],_0x687e35[_0x41fb6a(0x160)]=_0x1f4085,_0x687e35[_0x41fb6a(0x1a0)]=_0x3c14a5[_0x41fb6a(0x1a0)],_0x687e35['functionNode']=_0x3c14a5['functionNode'];}_0x488eb1[_0x41fb6a(0x159)][_0x3c14a5[_0x41fb6a(0x187)]]=_0x687e35;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x5758ef,_0x416f6a,_0x13dd95){const _0x337a11=a37_0x446567;if(_0x13dd95['length']===0x0)return;for(let _0x41119e=0x0;_0x41119e<LOCK_SETTLE_RETRY_COUNT;_0x41119e+=0x1){const _0x128791=await readBffLockFile(_0x5758ef),_0xfe077d=_0x128791?.[_0x337a11(0x185)]?.[_0x416f6a]?.['functions']??{},_0x37510f=_0x13dd95[_0x337a11(0x183)](_0x1b2ff7=>!!_0xfe077d[_0x1b2ff7]?.['remoteId']);if(_0x37510f)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x337a11(0x158)+_0x13dd95[_0x337a11(0x18f)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x55fc3e=a38_0x5e21;(function(_0x6c8759,_0x26a481){const _0x2b7d77=a38_0x5e21,_0x3b593b=_0x6c8759();while(!![]){try{const _0x2c37d8=parseInt(_0x2b7d77(0x103))/0x1*(-parseInt(_0x2b7d77(0x10a))/0x2)+-parseInt(_0x2b7d77(0xfb))/0x3*(-parseInt(_0x2b7d77(0xf4))/0x4)+-parseInt(_0x2b7d77(0xf6))/0x5+parseInt(_0x2b7d77(0xfc))/0x6+parseInt(_0x2b7d77(0x10c))/0x7+parseInt(_0x2b7d77(0xf2))/0x8*(parseInt(_0x2b7d77(0x108))/0x9)+-parseInt(_0x2b7d77(0xf7))/0xa;if(_0x2c37d8===_0x26a481)break;else _0x3b593b['push'](_0x3b593b['shift']());}catch(_0x116fa2){_0x3b593b['push'](_0x3b593b['shift']());}}}(a38_0x1542,0xa7ddb));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a38_0x5e21(_0x1cdd72,_0x3f43d1){_0x1cdd72=_0x1cdd72-0xec;const _0x154293=a38_0x1542();let _0x5e21a6=_0x154293[_0x1cdd72];return _0x5e21a6;}import{loadBffProjectConfig}from'../../core/bff/config.js';function a38_0x1542(){const _0x43f6b4=['380828TSmqKD','map','boolean','lockKey','apiDir','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','push','functions','984bdxuDp','\x20modified,\x20','20yCSQDp','lockFilePath','654980WPZgKd','3318010yuwVoF','all','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','filePath','245190yARMqw','4720470GiOOiF','scriptsRoot','bool','length','appCode','has','datasetCode','2084YDyRqR','status','\x20remote-only','\x20added,\x20','alias','88335Ovvadk','hash','1254HCObHx','remote'];a38_0x1542=function(){return _0x43f6b4;};return a38_0x1542();}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':a38_0x55fc3e(0x104),'description':a38_0x55fc3e(0xf9),'risk':'read','flags':[{'name':a38_0x55fc3e(0x10b),'type':a38_0x55fc3e(0xec),'description':a38_0x55fc3e(0xef)}],async 'execute'(_0x40eaf8){const _0x3c0b8b=a38_0x55fc3e,_0x1ff55f=loadBffProjectConfig(_0x40eaf8['appCode']),_0x218537=await readBffLockFile(_0x1ff55f[_0x3c0b8b(0xf5)]),{appLock:_0x39b0a0}=ensureLockScope(_0x218537??createEmptyBffLock(),_0x40eaf8[_0x3c0b8b(0x100)],_0x1ff55f[_0x3c0b8b(0xfd)],_0x3c0b8b(0x104)),_0x3c6d3b=await scanLocalBffFunctions(_0x1ff55f),_0x24c97e=[],_0x2c7c05=[],_0x527d20=[];for(const _0x45b2e8 of _0x3c6d3b){const _0x781dbd=await computeFileHash(_0x45b2e8[_0x3c0b8b(0xfa)]),_0x254f00=_0x39b0a0[_0x3c0b8b(0xf1)][_0x45b2e8[_0x3c0b8b(0xed)]];if(!_0x254f00)_0x24c97e[_0x3c0b8b(0xf0)](_0x45b2e8[_0x3c0b8b(0xed)]);else _0x254f00[_0x3c0b8b(0x109)]!==_0x781dbd?_0x2c7c05['push'](_0x45b2e8[_0x3c0b8b(0xed)]):_0x527d20[_0x3c0b8b(0xf0)](_0x45b2e8[_0x3c0b8b(0xed)]);}const _0x226bdc=[];if(_0x40eaf8[_0x3c0b8b(0xfe)](_0x3c0b8b(0x10b))){const _0x4d79aa=loadAliasMap(_0x40eaf8[_0x3c0b8b(0xee)],undefined,resolveApiFilePath(_0x40eaf8[_0x3c0b8b(0xee)],_0x40eaf8['appCode'])),_0x3907d1=new Map(_0x4d79aa[_0x3c0b8b(0x10d)](_0x30249a=>[_0x30249a[_0x3c0b8b(0x102)],_0x30249a[_0x3c0b8b(0x107)]])),[_0x294471,_0x21b105]=await Promise[_0x3c0b8b(0xf8)]([listBffScripts(_0x40eaf8[_0x3c0b8b(0x100)]),getBffScriptStatistics(_0x40eaf8[_0x3c0b8b(0x100)])]),_0x270777=createHookLocationMap(_0x21b105),_0x4385c1=new Set(_0x3c6d3b[_0x3c0b8b(0x10d)](_0x7eb5a=>_0x7eb5a['lockKey']));for(const _0x5ed059 of _0x294471){const _0x4b280c=resolveRemoteScriptTarget(_0x1ff55f,_0x5ed059,_0x270777,_0x39b0a0['functions'],_0x3907d1);_0x4b280c&&!_0x4385c1[_0x3c0b8b(0x101)](_0x4b280c[_0x3c0b8b(0xed)])&&_0x226bdc['push'](_0x4b280c[_0x3c0b8b(0xed)]);}}const _0x93b272=_0x24c97e[_0x3c0b8b(0xff)]===0x0&&_0x2c7c05[_0x3c0b8b(0xff)]===0x0&&_0x226bdc[_0x3c0b8b(0xff)]===0x0;return{'ok':!![],'data':{'added':_0x24c97e,'modified':_0x2c7c05,'unchanged':_0x527d20,'remoteOnly':_0x226bdc},'message':_0x93b272?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x24c97e[_0x3c0b8b(0xff)]+_0x3c0b8b(0x106)+_0x2c7c05['length']+_0x3c0b8b(0xf3)+_0x527d20['length']+'\x20unchanged'+(_0x226bdc[_0x3c0b8b(0xff)]>0x0?',\x20'+_0x226bdc[_0x3c0b8b(0xff)]+_0x3c0b8b(0x105):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x2211ce=a39_0x4ed0;(function(_0x50f8ce,_0x58e21c){const _0x1537a8=a39_0x4ed0,_0xf2924c=_0x50f8ce();while(!![]){try{const _0x21fb25=-parseInt(_0x1537a8(0x185))/0x1+-parseInt(_0x1537a8(0x17d))/0x2*(-parseInt(_0x1537a8(0x16f))/0x3)+parseInt(_0x1537a8(0x179))/0x4+parseInt(_0x1537a8(0x183))/0x5+-parseInt(_0x1537a8(0x172))/0x6+-parseInt(_0x1537a8(0x170))/0x7*(-parseInt(_0x1537a8(0x180))/0x8)+parseInt(_0x1537a8(0x182))/0x9*(parseInt(_0x1537a8(0x178))/0xa);if(_0x21fb25===_0x58e21c)break;else _0xf2924c['push'](_0xf2924c['shift']());}catch(_0x159e7a){_0xf2924c['push'](_0xf2924c['shift']());}}}(a39_0x17c2,0x2e513));import{CliErrors}from'../../errors.js';function a39_0x4ed0(_0x3ba0e2,_0x34fab7){_0x3ba0e2=_0x3ba0e2-0x16a;const _0x17c2a6=a39_0x17c2();let _0x4ed029=_0x17c2a6[_0x3ba0e2];return _0x4ed029;}function a39_0x17c2(){const _0x5e9073=['npx\x20skills\x20add\x20failed:\x20','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','skipped','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','write','../../skills/npx-skills-add.js','log','3SaDeki','112lwLiJX','apiError','1379694cqcDVc','error',')...','unknown','cwd','info','1730xEfHmU','1291044xCAGue','install','nonInteractive','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','242552RuQxGh','cli-skill','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','13480zLhjYk','CLI\x20Built-in\x20Skill\x20installed','333aTywQM','343695OenKwv','inherit','126473KExxDp','setLogPath'];a39_0x17c2=function(){return _0x5e9073;};return a39_0x17c2();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x2211ce(0x17e),'command':a39_0x2211ce(0x17a),'description':a39_0x2211ce(0x17c),'risk':a39_0x2211ce(0x16c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1d08d7){const _0x5c1ec4=a39_0x2211ce;logger[_0x5c1ec4(0x186)](process[_0x5c1ec4(0x176)]()),logger[_0x5c1ec4(0x177)]('cli-skill-install',_0x5c1ec4(0x17f));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x15bd03,RABETBASE_SKILL_SOURCE:_0x165c99,runNpxSkillsAddGlobal:_0x19a3bf}=await import(_0x5c1ec4(0x16d)),_0x23567e=_0x1d08d7[_0x5c1ec4(0x17b)]?'pipe':_0x5c1ec4(0x184);console[_0x5c1ec4(0x16e)]('Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20('+_0x15bd03+_0x5c1ec4(0x174));const _0x142408=_0x19a3bf(process[_0x5c1ec4(0x176)](),_0x165c99,{'stdio':_0x23567e});if(_0x142408[_0x5c1ec4(0x16a)])console[_0x5c1ec4(0x16e)](_0x5c1ec4(0x188));else{if(_0x142408['ok'])console[_0x5c1ec4(0x16e)](_0x5c1ec4(0x181));else throw CliErrors[_0x5c1ec4(0x171)](_0x5c1ec4(0x187)+(_0x142408[_0x5c1ec4(0x173)]||_0x5c1ec4(0x175)),_0x5c1ec4(0x16b)+_0x15bd03);}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x8cd2c8=a41_0x3d88;function a41_0x3d88(_0xfb3f12,_0x3ad815){_0xfb3f12=_0xfb3f12-0x1dc;const _0x4c1b22=a41_0x4c1b();let _0x3d88b7=_0x4c1b22[_0xfb3f12];return _0x3d88b7;}(function(_0x415829,_0x53ae1d){const _0x348697=a41_0x3d88,_0x270e54=_0x415829();while(!![]){try{const _0x2f6eff=-parseInt(_0x348697(0x1ed))/0x1+parseInt(_0x348697(0x21e))/0x2*(-parseInt(_0x348697(0x1f9))/0x3)+-parseInt(_0x348697(0x1fe))/0x4*(parseInt(_0x348697(0x203))/0x5)+parseInt(_0x348697(0x209))/0x6+-parseInt(_0x348697(0x215))/0x7*(parseInt(_0x348697(0x206))/0x8)+-parseInt(_0x348697(0x217))/0x9+-parseInt(_0x348697(0x1f0))/0xa*(-parseInt(_0x348697(0x21c))/0xb);if(_0x2f6eff===_0x53ae1d)break;else _0x270e54['push'](_0x270e54['shift']());}catch(_0x327dfb){_0x270e54['push'](_0x270e54['shift']());}}}(a41_0x4c1b,0x5d6ed));import a41_0x386294 from'chalk';import a41_0x34f208 from'ora';import a41_0x199e1b 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 _0x447b44=a41_0x3d88;return GIT_COMMIT!==_0x447b44(0x21d)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x447b44(0x221)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x200b99=a41_0x3d88,_0x376490=process[_0x200b99(0x20c)][_0x200b99(0x228)]();if(_0x376490[_0x200b99(0x1e2)](_0x200b99(0x1eb)))return _0x200b99(0x1eb);return _0x200b99(0x1fc);}function a41_0x4c1b(){const _0xeb6254=['1231890sfAlyE','...','Invalid\x20version:\x20','437064IGTcFA','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','3937824RFNhHm','pipe','Updated\x20to\x20v','execPath','flag','Requested\x20version:\x20','map','run','green','skills','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','91rsKzua','source','4583772szjZnB','bool','log','error','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','5528875AmWqHW','unknown','32GTaypN','timeout','version','slice','yellow','valid','trim','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','beta','Current\x20version:\x20','toLowerCase','gray','\x20\x20Run\x20manually:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Checking\x20for\x20updates...','fromEntries','filter','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','latest','includes','start','Update\x20failed','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','\x20install\x20-g\x20','info','nonInteractive','Update\x20available:\x20','fail','bun','https://registry.npmjs.org/-/package/','128379ljyQIv','Install\x20a\x20specific\x20CLI\x20version','Already\x20up\x20to\x20date\x20(v','30rQRMeL','message','validation','Version\x20comparison\x20failed','no-skills','object','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','warn','write','35097hzvgoO','inherit','boolean','npm','succeed','4WkglFb','\x20→\x20','Beta\x20version:\x20','red','length'];a41_0x4c1b=function(){return _0xeb6254;};return a41_0x4c1b();}const updateFlags=[{'name':'beta','type':'boolean','description':a41_0x8cd2c8(0x207),'default':![]},{'name':a41_0x8cd2c8(0x220),'type':'string','description':a41_0x8cd2c8(0x1ee)},{'name':'no-skills','type':a41_0x8cd2c8(0x1fb),'description':a41_0x8cd2c8(0x208),'default':![]},{'name':a41_0x8cd2c8(0x212),'type':a41_0x8cd2c8(0x1fb),'description':a41_0x8cd2c8(0x21b),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x86ccf0){const _0x11dfba=a41_0x8cd2c8;return _0x86ccf0['str'](_0x11dfba(0x220))['trim']();}function shouldSkipCliSkill(_0x238935){const _0xbb723c=a41_0x8cd2c8;return _0x238935[_0xbb723c(0x218)](_0xbb723c(0x1f4))||_0x238935[_0xbb723c(0x20d)](_0xbb723c(0x212))===![];}async function validateUpdateFlags(_0x5ac7a9){const _0x30c8c0=a41_0x8cd2c8,_0x51d6db=_0x5ac7a9[_0x30c8c0(0x218)](_0x30c8c0(0x226)),_0x357e18=getRequestedVersion(_0x5ac7a9);if(_0x51d6db&&_0x357e18)throw CliErrors[_0x30c8c0(0x1f2)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x30c8c0(0x1e5));if(_0x357e18&&!a41_0x199e1b[_0x30c8c0(0x223)](_0x357e18))throw CliErrors['validation'](_0x30c8c0(0x205)+_0x357e18,_0x30c8c0(0x1e0));}async function fetchNpmDistTags(){const _0x276319=a41_0x8cd2c8;try{const _0x44d617=await fetch(_0x276319(0x1ec)+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x276319(0x21f)](0x2710)});if(!_0x44d617['ok'])return null;const _0xe6d134=await _0x44d617['json']();if(!_0xe6d134||typeof _0xe6d134!==_0x276319(0x1f5))return null;return Object[_0x276319(0x1de)](Object['entries'](_0xe6d134)[_0x276319(0x1df)](([,_0x3dc7a0])=>typeof _0x3dc7a0==='string'&&_0x3dc7a0[_0x276319(0x224)]()[_0x276319(0x202)]>0x0)[_0x276319(0x20f)](([_0x50c66a,_0x2a86e9])=>[_0x50c66a,String(_0x2a86e9)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x18b28a){const _0x3376f6=await fetchNpmDistTags();return _0x3376f6?.[_0x18b28a]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x8749b9){const _0x117f2f=a41_0x8cd2c8,_0x6e09dd=getRequestedVersion(_0x8749b9);if(_0x6e09dd)return{'version':_0x6e09dd,'source':_0x117f2f(0x220)};if(_0x8749b9[_0x117f2f(0x218)](_0x117f2f(0x226))){const _0x174bed=await fetchNpmDistTagVersion(_0x117f2f(0x226));if(!_0x174bed)return null;return{'version':_0x174bed,'source':_0x117f2f(0x226)};}const _0x2899b4=await fetchLatestVersion();if(!_0x2899b4)return null;return{'version':_0x2899b4,'source':_0x117f2f(0x1e1)};}function shouldInstallTarget(_0x4a33e6,_0x338bec){const _0x2dcea4=a41_0x8cd2c8;if(_0x338bec['source']===_0x2dcea4(0x220)||_0x338bec[_0x2dcea4(0x216)]===_0x2dcea4(0x226))return!a41_0x199e1b['eq'](_0x4a33e6,_0x338bec[_0x2dcea4(0x220)]);return a41_0x199e1b['lt'](_0x4a33e6,_0x338bec[_0x2dcea4(0x220)]);}function getInstallPlanLabel(_0x3f7f11,_0x112d08){const _0x3dd057=a41_0x8cd2c8;switch(_0x112d08[_0x3dd057(0x216)]){case _0x3dd057(0x226):return _0x3dd057(0x200)+a41_0x386294[_0x3dd057(0x222)](_0x3f7f11)+_0x3dd057(0x1ff)+a41_0x386294[_0x3dd057(0x211)](_0x112d08[_0x3dd057(0x220)]);case'version':return _0x3dd057(0x20e)+a41_0x386294[_0x3dd057(0x222)](_0x3f7f11)+_0x3dd057(0x1ff)+a41_0x386294[_0x3dd057(0x211)](_0x112d08['version']);case _0x3dd057(0x1e1):default:return _0x3dd057(0x1e9)+a41_0x386294[_0x3dd057(0x222)](_0x3f7f11)+_0x3dd057(0x1ff)+a41_0x386294[_0x3dd057(0x211)](_0x112d08[_0x3dd057(0x220)]);}}async function installCliSkill(_0x9068ec){const _0x34d4c0=a41_0x8cd2c8;console[_0x34d4c0(0x219)](a41_0x386294[_0x34d4c0(0x229)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x4f4838=runNpxSkillsAddGlobal(process['cwd'](),RABETBASE_SKILL_SOURCE,{'stdio':_0x9068ec?_0x34d4c0(0x20a):_0x34d4c0(0x1fa)});if(_0x4f4838['skipped']){console[_0x34d4c0(0x219)](a41_0x386294[_0x34d4c0(0x229)](_0x34d4c0(0x225)));return;}if(_0x4f4838['ok']){console[_0x34d4c0(0x219)](a41_0x386294[_0x34d4c0(0x229)](_0x34d4c0(0x1f6)));return;}console[_0x34d4c0(0x1f7)](a41_0x386294[_0x34d4c0(0x222)](_0x34d4c0(0x213)+(_0x4f4838[_0x34d4c0(0x21a)]||'unknown'))),console['log'](a41_0x386294[_0x34d4c0(0x229)](_0x34d4c0(0x22a)+CLI_BIN_NAME+'\x20cli-skill\x20install'));}async function execute(_0x3ff1b6){const _0x55ae0d=a41_0x8cd2c8;await validateUpdateFlags(_0x3ff1b6);const _0x23c1d9=getCurrentVersion();console['log'](_0x55ae0d(0x227)+_0x23c1d9);const _0x162080=a41_0x34f208(_0x55ae0d(0x1dd))[_0x55ae0d(0x1e3)](),_0x408328=await resolveTargetVersion(_0x3ff1b6);if(!_0x408328){const _0x1f922e=_0x3ff1b6[_0x55ae0d(0x218)](_0x55ae0d(0x226))?_0x55ae0d(0x214):_0x55ae0d(0x1dc);return _0x162080['fail'](_0x1f922e),console[_0x55ae0d(0x219)](a41_0x386294[_0x55ae0d(0x229)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x1f922e};}const _0x26fb44=a41_0x199e1b[_0x55ae0d(0x223)](VERSION),_0x125cee=a41_0x199e1b[_0x55ae0d(0x223)](_0x408328[_0x55ae0d(0x220)]);if(!_0x26fb44||!_0x125cee)return _0x162080[_0x55ae0d(0x1ea)](_0x55ae0d(0x1f3)),{'ok':![],'message':_0x55ae0d(0x1f3)};if(!shouldInstallTarget(_0x26fb44,_0x408328)){const _0x26ab32=_0x408328[_0x55ae0d(0x216)]==='version'?'Already\x20on\x20requested\x20version\x20(v'+_0x408328['version']+')':_0x55ae0d(0x1ef)+_0x408328[_0x55ae0d(0x220)]+')';return _0x162080[_0x55ae0d(0x1fd)](_0x26ab32),shouldSkipCliSkill(_0x3ff1b6)?console[_0x55ae0d(0x219)](a41_0x386294['gray']('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).')):await installCliSkill(_0x3ff1b6[_0x55ae0d(0x1e8)]),{'ok':!![]};}_0x162080[_0x55ae0d(0x1e7)](getInstallPlanLabel(_0x23c1d9,_0x408328));const _0xb5a0d1=detectPackageManager(),_0xd902f=_0xb5a0d1==='npm'?resolveNpmBin(_0x55ae0d(0x1fc)):_0xb5a0d1,_0x37d1c9=a41_0x34f208('Updating\x20via\x20'+_0xb5a0d1+_0x55ae0d(0x204))['start']();try{return await execa(_0xd902f,['install','-g',NPM_PACKAGE_NAME+'@'+_0x408328[_0x55ae0d(0x220)]],{'stdio':_0x55ae0d(0x20a)}),_0x37d1c9['succeed'](_0x55ae0d(0x20b)+_0x408328[_0x55ae0d(0x220)]),console['log'](a41_0x386294[_0x55ae0d(0x229)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),shouldSkipCliSkill(_0x3ff1b6)?console[_0x55ae0d(0x219)](a41_0x386294[_0x55ae0d(0x229)]('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).')):await installCliSkill(_0x3ff1b6['nonInteractive']),{'ok':!![]};}catch(_0x3c1352){return _0x37d1c9[_0x55ae0d(0x1ea)](_0x55ae0d(0x1e4)),console[_0x55ae0d(0x21a)](a41_0x386294[_0x55ae0d(0x201)]('\x20\x20'+_0x3c1352[_0x55ae0d(0x1f1)])),console[_0x55ae0d(0x219)](a41_0x386294[_0x55ae0d(0x229)]('\x20\x20Try\x20manually:\x20'+_0xb5a0d1+_0x55ae0d(0x1e6)+NPM_PACKAGE_NAME+'@'+_0x408328['version'])),{'ok':![],'message':_0x3c1352[_0x55ae0d(0x1f1)]};}}export const updateDefinition={'service':'update','command':a41_0x8cd2c8(0x210),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a41_0x8cd2c8(0x1f8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x29df21=a40_0x3a78;(function(_0x24edd8,_0x2ff90b){const _0x463ef2=a40_0x3a78,_0x2b719e=_0x24edd8();while(!![]){try{const _0x72995=parseInt(_0x463ef2(0x19c))/0x1*(parseInt(_0x463ef2(0x1b6))/0x2)+-parseInt(_0x463ef2(0x1d1))/0x3*(-parseInt(_0x463ef2(0x1bf))/0x4)+-parseInt(_0x463ef2(0x194))/0x5*(parseInt(_0x463ef2(0x1c6))/0x6)+-parseInt(_0x463ef2(0x183))/0x7+parseInt(_0x463ef2(0x1a7))/0x8*(parseInt(_0x463ef2(0x1d2))/0x9)+-parseInt(_0x463ef2(0x1a5))/0xa+parseInt(_0x463ef2(0x1c2))/0xb;if(_0x72995===_0x2ff90b)break;else _0x2b719e['push'](_0x2b719e['shift']());}catch(_0x3ea32f){_0x2b719e['push'](_0x2b719e['shift']());}}}(a40_0x413e,0x7ac29));import a40_0xab6d91 from'chalk';import a40_0x437945 from'ora';import a40_0x418bf9 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 _0x2cea8d=a40_0x3a78;return GIT_COMMIT!==_0x2cea8d(0x18f)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x2cea8d(0x1ba)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x21328a=a40_0x3a78,_0x576433=process[_0x21328a(0x1c9)][_0x21328a(0x1be)]();if(_0x576433['includes'](_0x21328a(0x1b0)))return _0x21328a(0x1b0);return _0x21328a(0x1ce);}const updateFlags=[{'name':a40_0x29df21(0x1cf),'type':a40_0x29df21(0x1b5),'description':a40_0x29df21(0x1a2),'default':![]},{'name':'version','type':'string','description':a40_0x29df21(0x1af)},{'name':'no-skills','type':a40_0x29df21(0x1b5),'description':a40_0x29df21(0x1bd),'default':![]},{'name':a40_0x29df21(0x1ad),'type':a40_0x29df21(0x1b5),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function getRequestedVersion(_0x4ac51c){const _0x37dcd1=a40_0x29df21;return _0x4ac51c[_0x37dcd1(0x1a8)](_0x37dcd1(0x1bc))['trim']();}function shouldSkipCliSkill(_0x538cb6){const _0x5b1fac=a40_0x29df21;return _0x538cb6[_0x5b1fac(0x197)](_0x5b1fac(0x1a1))||_0x538cb6[_0x5b1fac(0x1cc)](_0x5b1fac(0x1ad))===![];}async function validateUpdateFlags(_0x59d4e1){const _0x28dd07=a40_0x29df21,_0x12db15=_0x59d4e1['bool'](_0x28dd07(0x1cf)),_0x3ff776=getRequestedVersion(_0x59d4e1);if(_0x12db15&&_0x3ff776)throw CliErrors[_0x28dd07(0x1b2)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x3ff776&&!a40_0x418bf9[_0x28dd07(0x1cb)](_0x3ff776))throw CliErrors[_0x28dd07(0x1b2)](_0x28dd07(0x1b7)+_0x3ff776,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x31db4a=a40_0x29df21;try{const _0x45823c=await fetch(_0x31db4a(0x1d3)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x31db4a(0x1bb),{'signal':AbortSignal[_0x31db4a(0x1c4)](0x2710)});if(!_0x45823c['ok'])return null;const _0x195839=await _0x45823c[_0x31db4a(0x1ac)]();if(!_0x195839||typeof _0x195839!=='object')return null;return Object['fromEntries'](Object[_0x31db4a(0x1a6)](_0x195839)['filter'](([,_0x12c39a])=>typeof _0x12c39a===_0x31db4a(0x199)&&_0x12c39a[_0x31db4a(0x19f)]()[_0x31db4a(0x1c5)]>0x0)[_0x31db4a(0x190)](([_0xe49954,_0x2fcc69])=>[_0xe49954,String(_0x2fcc69)[_0x31db4a(0x19f)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x56230c){const _0x2d1c4e=await fetchNpmDistTags();return _0x2d1c4e?.[_0x56230c]??null;}async function fetchLatestVersion(){const _0x293118=a40_0x29df21;return fetchNpmDistTagVersion(_0x293118(0x188));}async function resolveTargetVersion(_0x4bf76f){const _0x20fbd4=a40_0x29df21,_0xdc9c68=getRequestedVersion(_0x4bf76f);if(_0xdc9c68)return{'version':_0xdc9c68,'source':_0x20fbd4(0x1bc)};if(_0x4bf76f[_0x20fbd4(0x197)](_0x20fbd4(0x1cf))){const _0xa205dd=await fetchNpmDistTagVersion('beta');if(!_0xa205dd)return null;return{'version':_0xa205dd,'source':_0x20fbd4(0x1cf)};}const _0x284d76=await fetchLatestVersion();if(!_0x284d76)return null;return{'version':_0x284d76,'source':_0x20fbd4(0x188)};}function shouldInstallTarget(_0x1e6697,_0x3801d8){const _0x43a7e3=a40_0x29df21;if(_0x3801d8[_0x43a7e3(0x1a9)]===_0x43a7e3(0x1bc)||_0x3801d8[_0x43a7e3(0x1a9)]==='beta')return!a40_0x418bf9['eq'](_0x1e6697,_0x3801d8[_0x43a7e3(0x1bc)]);return a40_0x418bf9['lt'](_0x1e6697,_0x3801d8['version']);}function getInstallPlanLabel(_0x2673ba,_0x4bf231){const _0x4a37f5=a40_0x29df21;switch(_0x4bf231[_0x4a37f5(0x1a9)]){case _0x4a37f5(0x1cf):return _0x4a37f5(0x19a)+a40_0xab6d91['yellow'](_0x2673ba)+_0x4a37f5(0x18e)+a40_0xab6d91['green'](_0x4bf231[_0x4a37f5(0x1bc)]);case _0x4a37f5(0x1bc):return _0x4a37f5(0x1ae)+a40_0xab6d91[_0x4a37f5(0x185)](_0x2673ba)+'\x20→\x20'+a40_0xab6d91[_0x4a37f5(0x1c7)](_0x4bf231[_0x4a37f5(0x1bc)]);case'latest':default:return'Update\x20available:\x20'+a40_0xab6d91[_0x4a37f5(0x185)](_0x2673ba)+_0x4a37f5(0x18e)+a40_0xab6d91[_0x4a37f5(0x1c7)](_0x4bf231[_0x4a37f5(0x1bc)]);}}async function installCliSkill(_0x28b4b0){const _0x24b057=a40_0x29df21;console['log'](a40_0xab6d91[_0x24b057(0x19d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x2d9d70=runNpxSkillsAddGlobal(process[_0x24b057(0x181)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x28b4b0?_0x24b057(0x1b9):_0x24b057(0x187)});if(_0x2d9d70[_0x24b057(0x1c1)]){console[_0x24b057(0x195)](a40_0xab6d91[_0x24b057(0x19d)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'));return;}if(_0x2d9d70['ok']){console[_0x24b057(0x195)](a40_0xab6d91[_0x24b057(0x19d)](_0x24b057(0x19e)));return;}console[_0x24b057(0x196)](a40_0xab6d91[_0x24b057(0x185)](_0x24b057(0x18b)+(_0x2d9d70[_0x24b057(0x1c0)]||'unknown'))),console[_0x24b057(0x195)](a40_0xab6d91[_0x24b057(0x19d)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+'\x20cli-skill\x20install'));}function a40_0x3a78(_0x101359,_0x85c93){_0x101359=_0x101359-0x181;const _0x413e2b=a40_0x413e();let _0x3a7859=_0x413e2b[_0x101359];return _0x3a7859;}async function execute(_0x47e31f){const _0x39b560=a40_0x29df21;await validateUpdateFlags(_0x47e31f);const _0x3568dd=getCurrentVersion();console['log'](_0x39b560(0x1b4)+_0x3568dd);const _0x2d7301=a40_0x437945(_0x39b560(0x1cd))['start'](),_0x22f4ab=await resolveTargetVersion(_0x47e31f);if(!_0x22f4ab){const _0x7f844a=_0x47e31f['bool'](_0x39b560(0x1cf))?_0x39b560(0x1b1):_0x39b560(0x1b3);return _0x2d7301[_0x39b560(0x184)](_0x7f844a),console[_0x39b560(0x195)](a40_0xab6d91['gray'](_0x39b560(0x198)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x7f844a};}const _0x4bc046=a40_0x418bf9['valid'](VERSION),_0x3fc4c7=a40_0x418bf9['valid'](_0x22f4ab[_0x39b560(0x1bc)]);if(!_0x4bc046||!_0x3fc4c7)return _0x2d7301[_0x39b560(0x184)]('Version\x20comparison\x20failed'),{'ok':![],'message':_0x39b560(0x1d0)};if(!shouldInstallTarget(_0x4bc046,_0x22f4ab)){const _0x4d7c2d=_0x22f4ab['source']===_0x39b560(0x1bc)?'Already\x20on\x20requested\x20version\x20(v'+_0x22f4ab[_0x39b560(0x1bc)]+')':_0x39b560(0x19b)+_0x22f4ab[_0x39b560(0x1bc)]+')';return _0x2d7301[_0x39b560(0x192)](_0x4d7c2d),shouldSkipCliSkill(_0x47e31f)?console[_0x39b560(0x195)](a40_0xab6d91['gray'](_0x39b560(0x182))):await installCliSkill(_0x47e31f['nonInteractive']),{'ok':!![]};}_0x2d7301[_0x39b560(0x186)](getInstallPlanLabel(_0x3568dd,_0x22f4ab));const _0x38c8d9=detectPackageManager(),_0x22fbea=_0x38c8d9===_0x39b560(0x1ce)?resolveNpmBin(_0x39b560(0x1ce)):_0x38c8d9,_0x1d545a=a40_0x437945('Updating\x20via\x20'+_0x38c8d9+_0x39b560(0x1c3))[_0x39b560(0x1aa)]();try{return await execa(_0x22fbea,[_0x39b560(0x1a0),'-g',NPM_PACKAGE_NAME+'@'+_0x22f4ab['version']],{'stdio':_0x39b560(0x1b9)}),_0x1d545a[_0x39b560(0x192)](_0x39b560(0x1b8)+_0x22f4ab['version']),console[_0x39b560(0x195)](a40_0xab6d91[_0x39b560(0x19d)](_0x39b560(0x1ab))),shouldSkipCliSkill(_0x47e31f)?console[_0x39b560(0x195)](a40_0xab6d91[_0x39b560(0x19d)](_0x39b560(0x182))):await installCliSkill(_0x47e31f[_0x39b560(0x18a)]),{'ok':!![]};}catch(_0x3b98e4){return _0x1d545a[_0x39b560(0x184)](_0x39b560(0x1ca)),console[_0x39b560(0x1c0)](a40_0xab6d91[_0x39b560(0x189)]('\x20\x20'+_0x3b98e4[_0x39b560(0x18d)])),console[_0x39b560(0x195)](a40_0xab6d91[_0x39b560(0x19d)](_0x39b560(0x191)+_0x38c8d9+_0x39b560(0x1a3)+NPM_PACKAGE_NAME+'@'+_0x22f4ab['version'])),{'ok':![],'message':_0x3b98e4[_0x39b560(0x18d)]};}}export const updateDefinition={'service':a40_0x29df21(0x1a4),'command':a40_0x29df21(0x18c),'description':a40_0x29df21(0x193),'risk':a40_0x29df21(0x1c8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};function a40_0x413e(){const _0x1d2055=['npm','beta','Version\x20comparison\x20failed','3FbibJo','9hXIJpf','https://registry.npmjs.org/-/package/','cwd','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','3392522THIgvP','fail','yellow','info','inherit','latest','red','nonInteractive','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','run','message','\x20→\x20','unknown','map','\x20\x20Try\x20manually:\x20','succeed','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','5PpjPBK','log','warn','bool','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','string','Beta\x20version:\x20','Already\x20up\x20to\x20date\x20(v','1fvsgaj','gray','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','trim','install','no-skills','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20install\x20-g\x20','update','2382420dokRiN','entries','663456zhOVEZ','str','source','start','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','json','skills','Requested\x20version:\x20','Install\x20a\x20specific\x20CLI\x20version','bun','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','validation','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Current\x20version:\x20','boolean','1398876SxPDik','Invalid\x20version:\x20','Updated\x20to\x20v','pipe','slice','/dist-tags','version','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','toLowerCase','380356vpospb','error','skipped','9771421EZpyJN','...','timeout','length','3240342RLOTxQ','green','write','execPath','Update\x20failed','valid','flag','Checking\x20for\x20updates...'];a40_0x413e=function(){return _0x1d2055;};return a40_0x413e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a41_0x379c(_0x5b1f21,_0x3b0665){_0x5b1f21=_0x5b1f21-0x1b8;const _0x185f9a=a41_0x185f();let _0x379c3c=_0x185f9a[_0x5b1f21];return _0x379c3c;}(function(_0x18e643,_0x5f0918){const _0x47d21d=a41_0x379c,_0x4d51e6=_0x18e643();while(!![]){try{const _0x51d1c7=parseInt(_0x47d21d(0x1ba))/0x1*(-parseInt(_0x47d21d(0x1c0))/0x2)+parseInt(_0x47d21d(0x1b8))/0x3+-parseInt(_0x47d21d(0x1bb))/0x4*(parseInt(_0x47d21d(0x1c1))/0x5)+parseInt(_0x47d21d(0x1bc))/0x6+-parseInt(_0x47d21d(0x1be))/0x7*(-parseInt(_0x47d21d(0x1bf))/0x8)+parseInt(_0x47d21d(0x1bd))/0x9+parseInt(_0x47d21d(0x1b9))/0xa;if(_0x51d1c7===_0x5f0918)break;else _0x4d51e6['push'](_0x4d51e6['shift']());}catch(_0x15f96c){_0x4d51e6['push'](_0x4d51e6['shift']());}}}(a41_0x185f,0x3689a));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x185f(){const _0xf999e7=['4053050zIznIw','84508KwnSxq','4CxhDBH','707874LTazDG','881145NjlroY','20531LXEfWu','32fYioVc','6AzrkhV','1933220nxMrlv','691899QtWevK'];a41_0x185f=function(){return _0xf999e7;};return a41_0x185f();}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a42_0x3d47(){const _0x2a8e03=['10861ZCxxmI','appCode','53028xZIdIt','sdk','3836264YyFXyK','Omit\x20import\x20statements\x20from\x20generated\x20code','codegen','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','code','13190814ZNNbyi','bool','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','boolean','3791223Dvjthv','427jXVYoh','skip-imports','82mQaLhb','str','operation','6912224IutOmD','read','string','6003005ZnPXZR'];a42_0x3d47=function(){return _0x2a8e03;};return a42_0x3d47();}const a42_0x3c346f=a42_0x3682;(function(_0x2b52d0,_0x10e262){const _0x21cba3=a42_0x3682,_0x225c7d=_0x2b52d0();while(!![]){try{const _0x3684b6=-parseInt(_0x21cba3(0x1d2))/0x1*(parseInt(_0x21cba3(0x1e2))/0x2)+parseInt(_0x21cba3(0x1df))/0x3+parseInt(_0x21cba3(0x1d6))/0x4+-parseInt(_0x21cba3(0x1d1))/0x5+parseInt(_0x21cba3(0x1d4))/0x6*(-parseInt(_0x21cba3(0x1e0))/0x7)+-parseInt(_0x21cba3(0x1ce))/0x8+parseInt(_0x21cba3(0x1db))/0x9;if(_0x3684b6===_0x10e262)break;else _0x225c7d['push'](_0x225c7d['shift']());}catch(_0x20964a){_0x225c7d['push'](_0x225c7d['shift']());}}}(a42_0x3d47,0x9c1ad));function a42_0x3682(_0x42f98c,_0xf9d9ed){_0x42f98c=_0x42f98c-0x1cd;const _0x3d471e=a42_0x3d47();let _0x3682e7=_0x3d471e[_0x42f98c];return _0x3682e7;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x3c346f(0x1d8),'command':a42_0x3c346f(0x1d5),'description':a42_0x3c346f(0x1d9),'risk':a42_0x3c346f(0x1cf),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a42_0x3c346f(0x1d0),'description':a42_0x3c346f(0x1dd)},{'name':a42_0x3c346f(0x1cd),'type':a42_0x3c346f(0x1d0),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x3c346f(0x1e1),'type':a42_0x3c346f(0x1de),'description':a42_0x3c346f(0x1d7)}],async 'execute'(_0x5602d9){const _0x16b815=a42_0x3c346f,{dataset:_0x513d47,operation:_0x377bfe}=await getOperationDetail(_0x5602d9[_0x16b815(0x1d3)],_0x5602d9['str'](_0x16b815(0x1da)),_0x5602d9['str'](_0x16b815(0x1cd))),_0x1d927a=generateSdkCode(_0x513d47,_0x377bfe,{'includeImports':!_0x5602d9[_0x16b815(0x1dc)](_0x16b815(0x1e1))});return{'ok':!![],'data':{'dataset':{'name':_0x513d47['name'],'code':_0x513d47['code'],'tableName':_0x513d47['tableName']},'operation':_0x5602d9[_0x16b815(0x1e3)](_0x16b815(0x1cd)),'code':_0x1d927a}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x70186c=a43_0x917e;(function(_0x54dfc1,_0x4b9f0b){const _0x5d0a4e=a43_0x917e,_0x401faa=_0x54dfc1();while(!![]){try{const _0x532d01=parseInt(_0x5d0a4e(0xee))/0x1*(-parseInt(_0x5d0a4e(0x103))/0x2)+parseInt(_0x5d0a4e(0xf4))/0x3*(-parseInt(_0x5d0a4e(0xef))/0x4)+parseInt(_0x5d0a4e(0xf6))/0x5*(-parseInt(_0x5d0a4e(0x100))/0x6)+parseInt(_0x5d0a4e(0xf9))/0x7+-parseInt(_0x5d0a4e(0xfc))/0x8*(parseInt(_0x5d0a4e(0xff))/0x9)+parseInt(_0x5d0a4e(0x104))/0xa+parseInt(_0x5d0a4e(0xfe))/0xb;if(_0x532d01===_0x4b9f0b)break;else _0x401faa['push'](_0x401faa['shift']());}catch(_0x1052c6){_0x401faa['push'](_0x401faa['shift']());}}}(a43_0x4f3f,0x576f1));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x4f3f(){const _0x130f0d=['Code\x20target:\x20sdk\x20(default)\x20or\x20bff','3SGURlp','appCode','885eFKhLm','target','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','1859347PgtzVw','sqlCode','string','5464ygBWBi','boolean','9832119ozFKew','1881jsSUuI','4374SjgwmT','sql','str','302HAQNXg','699180oScRBT','sqlName','bool','bff','sqlcode','3787czmQua','110488yprwHq','Omit\x20import\x20statements\x20from\x20generated\x20code','read','sdk'];a43_0x4f3f=function(){return _0x130f0d;};return a43_0x4f3f();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x917e(_0x1019b9,_0x2f09dd){_0x1019b9=_0x1019b9-0xee;const _0x4f3ff9=a43_0x4f3f();let _0x917e5f=_0x4f3ff9[_0x1019b9];return _0x917e5f;}export const codegenSql={'service':'codegen','command':a43_0x70186c(0x101),'description':a43_0x70186c(0xf8),'risk':a43_0x70186c(0xf1),'flags':[SQLCODE_FLAG,{'name':a43_0x70186c(0xf7),'type':a43_0x70186c(0xfb),'description':a43_0x70186c(0xf3),'default':'sdk','enum':[a43_0x70186c(0xf2),a43_0x70186c(0x107)]},{'name':'no-imports','type':a43_0x70186c(0xfd),'description':a43_0x70186c(0xf0)}],async 'execute'(_0x30b29c){const _0x49f2d2=a43_0x70186c,_0x1b17a0=await getSqlQueryInfo(_0x30b29c[_0x49f2d2(0xf5)],_0x30b29c[_0x49f2d2(0x102)](_0x49f2d2(0x108))),_0x49868f=_0x30b29c['str'](_0x49f2d2(0xf7))||_0x49f2d2(0xf2),_0x54158e=generateSqlCodeTemplate(_0x1b17a0,{'target':_0x49868f,'includeImports':!_0x30b29c[_0x49f2d2(0x106)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x1b17a0[_0x49f2d2(0xfa)],'sqlName':_0x1b17a0[_0x49f2d2(0x105)],'target':_0x49868f,'code':_0x54158e}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8a6ce4,_0x26e0b4){const _0x37505a=a44_0x3367,_0x44fa35=_0x8a6ce4();while(!![]){try{const _0x3d518e=-parseInt(_0x37505a(0x137))/0x1*(-parseInt(_0x37505a(0x130))/0x2)+parseInt(_0x37505a(0x120))/0x3*(-parseInt(_0x37505a(0x11e))/0x4)+-parseInt(_0x37505a(0x132))/0x5+-parseInt(_0x37505a(0x135))/0x6+parseInt(_0x37505a(0x123))/0x7*(-parseInt(_0x37505a(0x13e))/0x8)+-parseInt(_0x37505a(0x129))/0x9*(-parseInt(_0x37505a(0x11d))/0xa)+parseInt(_0x37505a(0x127))/0xb;if(_0x3d518e===_0x26e0b4)break;else _0x44fa35['push'](_0x44fa35['shift']());}catch(_0x3666a3){_0x44fa35['push'](_0x44fa35['shift']());}}}(a44_0x4e8d,0xafbc4));function a44_0x4e8d(){const _0x112baf=['请输入\x20App\x20Code:','13976303erJBot','App\x20Code:','1942209dpGkTp','Invalid\x20App\x20Code','无法获取远程应用列表,请手动输入。','\x20\x20(','find','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','trim','4QoJLAA','(跳过,稍后配置)','534645pohlrK','map','message','2314374CqlYoE','appCode','417884ROWldg','请选择要绑定的应用:','✎\x20手动输入','length','\x0a未找到可用应用。','includes','✎\x20自定义输入\x20appcode','664hrNGFC','custom','yellow','获取到\x20','valid','10TWYHqV','211568SjhuTJ','skip','42BOcByh','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','gray','31136IOxsaU','正在获取可用应用列表...','appName'];a44_0x4e8d=function(){return _0x112baf;};return a44_0x4e8d();}import{input,checkbox,select}from'@inquirer/prompts';import a44_0x1ff25f from'chalk';import{validateAppcode}from'../../commands/common/validate.js';function a44_0x3367(_0x3fac62,_0x3e8846){_0x3fac62=_0x3fac62-0x11a;const _0x4e8d0d=a44_0x4e8d();let _0x336730=_0x4e8d0d[_0x3fac62];return _0x336730;}import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x43522a=a44_0x3367,_0x55a8f9=await input({'message':_0x43522a(0x126),'validate':_0x5e38e=>{const _0x224a2a=_0x43522a,_0xbf1fb4=validateAppcode(_0x5e38e['trim']());return _0xbf1fb4[_0x224a2a(0x11c)]||_0xbf1fb4[_0x224a2a(0x134)]||_0x224a2a(0x12a);}});return _0x55a8f9[_0x43522a(0x12f)]();}export async function promptAppSelection(_0x21fee7){const _0x1ccc72=a44_0x3367,_0x45803c=[{'name':a44_0x1ff25f[_0x1ccc72(0x11a)](_0x1ccc72(0x13d)),'value':-0x1},..._0x21fee7[_0x1ccc72(0x133)]((_0x49951d,_0x362869)=>({'name':_0x49951d['appName']+'\x20\x20'+a44_0x1ff25f[_0x1ccc72(0x122)]('('+_0x49951d[_0x1ccc72(0x136)]+')'),'value':_0x362869}))],_0x44c45f=await checkbox({'message':_0x1ccc72(0x11b)+a44_0x1ff25f['cyan'](_0x21fee7[_0x1ccc72(0x13a)])+_0x1ccc72(0x121),'choices':_0x45803c,'loop':![]});if(_0x44c45f[_0x1ccc72(0x13c)](-0x1))return _0x1ccc72(0x13f);if(_0x44c45f[_0x1ccc72(0x13a)]===0x0)return _0x1ccc72(0x13f);return _0x44c45f[_0x1ccc72(0x133)](_0x14f441=>_0x21fee7[_0x14f441]);}export async function promptSingleAppSelection(_0x57be45){const _0x880d8e=a44_0x3367,_0x52e433=[{'name':a44_0x1ff25f['gray']('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x880d8e(0x11f)},{'name':a44_0x1ff25f[_0x880d8e(0x11a)](_0x880d8e(0x13d)),'value':_0x880d8e(0x13f)},..._0x57be45['map'](_0x2fdeb0=>({'name':_0x2fdeb0[_0x880d8e(0x125)]+'\x20\x20'+a44_0x1ff25f[_0x880d8e(0x122)]('('+_0x2fdeb0[_0x880d8e(0x136)]+')'),'value':_0x2fdeb0[_0x880d8e(0x136)]}))],_0x468138=await select({'message':_0x880d8e(0x138),'choices':_0x52e433});if(_0x468138===_0x880d8e(0x11f))return _0x880d8e(0x11f);if(_0x468138===_0x880d8e(0x13f))return _0x880d8e(0x13f);return _0x57be45[_0x880d8e(0x12d)](_0x124704=>_0x124704[_0x880d8e(0x136)]===_0x468138);}export async function selectSingleAppcode(_0x50cb00){const _0x4f5f25=a44_0x3367;if(!_0x50cb00)return writeCliSideChannelLine(a44_0x1ff25f[_0x4f5f25(0x122)](_0x4f5f25(0x12e))),_fallbackOrSkip();writeCliSideChannelLine(_0x4f5f25(0x124));let _0x316b0a;try{_0x316b0a=await withActiveCookie(_0x50cb00,()=>listRemoteApps());}catch(_0x4fbe93){writeCliSideChannelLine(a44_0x1ff25f['yellow'](_0x4f5f25(0x12b)));if(_0x4fbe93 instanceof Error)writeCliSideChannelLine(a44_0x1ff25f[_0x4f5f25(0x122)](_0x4f5f25(0x12c)+_0x4fbe93[_0x4f5f25(0x134)]+')'));return _fallbackOrSkip();}if(_0x316b0a[_0x4f5f25(0x13a)]===0x0)return writeCliSideChannelLine(a44_0x1ff25f[_0x4f5f25(0x11a)]('未找到可用应用。')),_fallbackOrSkip();const _0xd779bc=await promptSingleAppSelection(_0x316b0a);if(_0xd779bc===_0x4f5f25(0x11f))return'';if(_0xd779bc===_0x4f5f25(0x13f))return promptCustomAppcode();return _0xd779bc[_0x4f5f25(0x136)];}export async function selectMultipleApps(_0x3e1cbe){const _0x525e34=a44_0x3367;writeCliSideChannelLine(_0x525e34(0x124));let _0x3bc37b;try{_0x3bc37b=await withActiveCookie(_0x3e1cbe,()=>listRemoteApps());}catch(_0x104aa9){writeCliSideChannelLine('\x0a无法获取远程应用列表,请手动输入。');if(_0x104aa9 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x104aa9[_0x525e34(0x134)]+')');return'custom';}if(_0x3bc37b[_0x525e34(0x13a)]===0x0)return writeCliSideChannelLine(_0x525e34(0x13b)),_0x525e34(0x13f);return promptAppSelection(_0x3bc37b);}async function _fallbackOrSkip(){const _0x56873f=a44_0x3367,_0x1e2960=await select({'message':_0x56873f(0x128),'choices':[{'name':a44_0x1ff25f[_0x56873f(0x122)](_0x56873f(0x131)),'value':_0x56873f(0x11f)},{'name':a44_0x1ff25f[_0x56873f(0x11a)](_0x56873f(0x139)),'value':'manual'}]});if(_0x1e2960===_0x56873f(0x11f))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a45_0x2389(_0xd04108,_0xcf7bb5){_0xd04108=_0xd04108-0x16c;const _0x213c55=a45_0x213c();let _0x23890d=_0x213c55[_0xd04108];return _0x23890d;}const a45_0x233a95=a45_0x2389;(function(_0x1188ce,_0x1e7359){const _0x2c1201=a45_0x2389,_0x184295=_0x1188ce();while(!![]){try{const _0xc88d69=-parseInt(_0x2c1201(0x170))/0x1*(parseInt(_0x2c1201(0x180))/0x2)+-parseInt(_0x2c1201(0x17d))/0x3*(parseInt(_0x2c1201(0x171))/0x4)+-parseInt(_0x2c1201(0x16f))/0x5+parseInt(_0x2c1201(0x17f))/0x6*(parseInt(_0x2c1201(0x17a))/0x7)+parseInt(_0x2c1201(0x176))/0x8+parseInt(_0x2c1201(0x16c))/0x9+-parseInt(_0x2c1201(0x173))/0xa;if(_0xc88d69===_0x1e7359)break;else _0x184295['push'](_0x184295['shift']());}catch(_0x43c988){_0x184295['push'](_0x184295['shift']());}}}(a45_0x213c,0xc71a6));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a45_0x233a95(0x17b)};export const CODE_FLAG={'name':a45_0x233a95(0x179),'type':a45_0x233a95(0x178),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)'};export const SQLCODE_FLAG={'name':a45_0x233a95(0x16e),'type':a45_0x233a95(0x178),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a45_0x233a95(0x182)}};export const APPCODE_FLAG_OPTIONAL={'name':a45_0x233a95(0x17c),'type':'string','required':![],'description':a45_0x233a95(0x17e)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a45_0x233a95(0x175),'required':!![],'description':a45_0x233a95(0x16d)};function a45_0x213c(){const _0x2e3de4=['1375870BNblhI','dbtype','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','14542110dzVXPg','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','sqlcode','5007985AVEHsz','1FEGXuT','121596hsijxS','Database\x20product\x20type','749760OJokzz','POSTGRESQL','number','10227128tBAEeY','MYSQL','string','code','35YZrrMN','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','appcode','69yexNKR','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','462036BOYzQX'];a45_0x213c=function(){return _0x2e3de4;};return a45_0x213c();}export const DB_TYPE_FLAG={'name':a45_0x233a95(0x181),'type':a45_0x233a95(0x178),'required':!![],'description':a45_0x233a95(0x172),'enum':[a45_0x233a95(0x177),a45_0x233a95(0x174)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a46_0x55f0(_0x59ac15,_0x568425){_0x59ac15=_0x59ac15-0x97;const _0x222af0=a46_0x222a();let _0x55f045=_0x222af0[_0x59ac15];return _0x55f045;}(function(_0x44b6aa,_0x22b701){const _0x26dc39=a46_0x55f0,_0x6d581=_0x44b6aa();while(!![]){try{const _0x2c1c7d=parseInt(_0x26dc39(0xa1))/0x1+parseInt(_0x26dc39(0x9f))/0x2*(parseInt(_0x26dc39(0xa2))/0x3)+-parseInt(_0x26dc39(0x9d))/0x4+-parseInt(_0x26dc39(0x9e))/0x5*(parseInt(_0x26dc39(0x99))/0x6)+-parseInt(_0x26dc39(0xa4))/0x7*(parseInt(_0x26dc39(0x97))/0x8)+-parseInt(_0x26dc39(0xa0))/0x9*(-parseInt(_0x26dc39(0x9c))/0xa)+parseInt(_0x26dc39(0xa3))/0xb;if(_0x2c1c7d===_0x22b701)break;else _0x6d581['push'](_0x6d581['shift']());}catch(_0x4b33dd){_0x6d581['push'](_0x6d581['shift']());}}}(a46_0x222a,0x821c8));function a46_0x222a(){const _0x56d1b9=['1058508xhaIWt','2349705VKEYgD','2867964PQpMld','763qbtkgb','44144GsZQmj','trim','54qbWtib','test','App\x20Code\x20cannot\x20exceed\x20100\x20characters','970210jMLLrR','3053280njRgbw','167650asoYMp','2tOmHcD','9jYeMfk'];a46_0x222a=function(){return _0x56d1b9;};return a46_0x222a();}export function validateAppcode(_0x1f898d){const _0xc66f2=a46_0x55f0,_0x9f50c0=_0x1f898d[_0xc66f2(0x98)]();if(!_0x9f50c0)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0x9f50c0['length']>0x64)return{'valid':![],'message':_0xc66f2(0x9b)};if(!/^[A-Za-z0-9_-]+$/[_0xc66f2(0x9a)](_0x9f50c0))return{'valid':![],'message':'Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x1f5a86=a47_0x4901;function a47_0x2316(){const _0x56f55b=['Usage:\x20','2821645TKBqem','Get\x20a\x20config\x20value\x20by\x20key','get','13095ViBKfM','object','4dEQWlJ','config','app','key','149334isdRJp','4490crFbPa','3567116oRxLQm','validation','7qnjQTV','1722064LqaHOX','string','4485234LYfeHt','Missing\x20key.','appcode','522169OuMZCU'];a47_0x2316=function(){return _0x56f55b;};return a47_0x2316();}function a47_0x4901(_0x587ea1,_0x10ddf6){_0x587ea1=_0x587ea1-0x1c6;const _0x23160b=a47_0x2316();let _0x4901c0=_0x23160b[_0x587ea1];return _0x4901c0;}(function(_0x300d81,_0x53417a){const _0x4fb053=a47_0x4901,_0x26a3a8=_0x300d81();while(!![]){try{const _0x469864=parseInt(_0x4fb053(0x1d7))/0x1+parseInt(_0x4fb053(0x1c9))/0x2*(parseInt(_0x4fb053(0x1cd))/0x3)+parseInt(_0x4fb053(0x1cf))/0x4+parseInt(_0x4fb053(0x1d9))/0x5+-parseInt(_0x4fb053(0x1d4))/0x6*(parseInt(_0x4fb053(0x1d1))/0x7)+-parseInt(_0x4fb053(0x1d2))/0x8+parseInt(_0x4fb053(0x1c7))/0x9*(-parseInt(_0x4fb053(0x1ce))/0xa);if(_0x469864===_0x53417a)break;else _0x26a3a8['push'](_0x26a3a8['shift']());}catch(_0x18596e){_0x26a3a8['push'](_0x26a3a8['shift']());}}}(a47_0x2316,0x70bad));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';async function execute(_0xa7b4ab){const _0x54f126=a47_0x4901,_0x494f64=_0xa7b4ab['str'](_0x54f126(0x1cc));if(!_0x494f64)throw CliErrors[_0x54f126(0x1d0)](_0x54f126(0x1d5),_0x54f126(0x1d8)+CLI_BIN_NAME+'\x20config\x20get\x20--key\x20<key>');const _0x428849=readConfig(),_0x37b83d=_0x494f64===_0x54f126(0x1cb)?_0x54f126(0x1d6):_0x494f64,_0x5019e9=_0x428849[_0x37b83d];if(_0x5019e9===undefined)throw CliErrors[_0x54f126(0x1d0)]('Key\x20not\x20found:\x20'+_0x494f64);return{'ok':!![],'data':typeof _0x5019e9===_0x54f126(0x1c8)?_0x5019e9:{[_0x37b83d]:_0x5019e9},'message':typeof _0x5019e9===_0x54f126(0x1c8)?undefined:String(_0x5019e9)};}export const configGetDefinition={'service':a47_0x1f5a86(0x1ca),'command':a47_0x1f5a86(0x1c6),'description':a47_0x1f5a86(0x1da),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a47_0x1f5a86(0x1cc),'type':a47_0x1f5a86(0x1d3),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4258f9,_0x30d6b7){const _0xef6459=a48_0x4dde,_0x4a8f4d=_0x4258f9();while(!![]){try{const _0x5c5a0a=-parseInt(_0xef6459(0x188))/0x1*(-parseInt(_0xef6459(0x190))/0x2)+-parseInt(_0xef6459(0x18a))/0x3*(-parseInt(_0xef6459(0x18b))/0x4)+parseInt(_0xef6459(0x186))/0x5+-parseInt(_0xef6459(0x187))/0x6*(-parseInt(_0xef6459(0x18c))/0x7)+-parseInt(_0xef6459(0x18f))/0x8*(parseInt(_0xef6459(0x191))/0x9)+parseInt(_0xef6459(0x189))/0xa*(parseInt(_0xef6459(0x18e))/0xb)+-parseInt(_0xef6459(0x18d))/0xc;if(_0x5c5a0a===_0x30d6b7)break;else _0x4a8f4d['push'](_0x4a8f4d['shift']());}catch(_0x48dce6){_0x4a8f4d['push'](_0x4a8f4d['shift']());}}}(a48_0x5494,0x890a9));function a48_0x5494(){const _0x1d29f9=['24639756exASPf','583pHgEdl','1350280qVBAce','508Sawbcz','9brTdWB','4133070SCQykv','196314UVvHNE','2413Duakqa','106690AEJmeb','12507wSjBEV','276wkflSA','105HGIgUt'];a48_0x5494=function(){return _0x1d29f9;};return a48_0x5494();}function a48_0x4dde(_0x71ed8a,_0x39fdf1){_0x71ed8a=_0x71ed8a-0x186;const _0x549418=a48_0x5494();let _0x4ddedc=_0x549418[_0x71ed8a];return _0x4ddedc;}import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a49_0x547cc6=a49_0x298e;(function(_0x4f8df6,_0x5b3a80){const _0x165fb0=a49_0x298e,_0x2a687c=_0x4f8df6();while(!![]){try{const _0x1406d9=parseInt(_0x165fb0(0x11a))/0x1*(-parseInt(_0x165fb0(0x11e))/0x2)+-parseInt(_0x165fb0(0x110))/0x3+parseInt(_0x165fb0(0x11d))/0x4*(parseInt(_0x165fb0(0x114))/0x5)+-parseInt(_0x165fb0(0x111))/0x6+parseInt(_0x165fb0(0x115))/0x7+parseInt(_0x165fb0(0x117))/0x8+-parseInt(_0x165fb0(0x11c))/0x9*(-parseInt(_0x165fb0(0x11b))/0xa);if(_0x1406d9===_0x5b3a80)break;else _0x2a687c['push'](_0x2a687c['shift']());}catch(_0x51e675){_0x2a687c['push'](_0x2a687c['shift']());}}}(a49_0x78aa,0xd9d6f));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';function a49_0x298e(_0x37a5b8,_0x2ae019){_0x37a5b8=_0x37a5b8-0x10f;const _0x78aada=a49_0x78aa();let _0x298eae=_0x78aada[_0x37a5b8];return _0x298eae;}async function execute(_0x1eb443){const _0x5a905a=a49_0x298e,_0x73e244=_0x1eb443[_0x5a905a(0x119)](_0x5a905a(0x113))?readScopedConfig(_0x5a905a(0x113)):readConfig();return{'ok':!![],'data':_0x73e244};}function a49_0x78aa(){const _0x44d663=['548288rQfTgC','22TCeFxg','read','4038411xOTwYf','8995842DCiYyh','list','global','20mZRjjv','3992618rtLepy','List\x20all\x20config\x20values','5157672etYapd','boolean','bool','128199AHZwzl','23390avdIGz','13023rcaRBA'];a49_0x78aa=function(){return _0x44d663;};return a49_0x78aa();}export const configListDefinition={'service':'config','command':a49_0x547cc6(0x112),'description':a49_0x547cc6(0x116),'risk':a49_0x547cc6(0x10f),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'global','type':a49_0x547cc6(0x118),'description':'Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x2b9437=a50_0x5a41;(function(_0x6d86fa,_0x16a371){const _0x1d7f7b=a50_0x5a41,_0x196cf5=_0x6d86fa();while(!![]){try{const _0x2692ce=parseInt(_0x1d7f7b(0x10b))/0x1+-parseInt(_0x1d7f7b(0x108))/0x2*(-parseInt(_0x1d7f7b(0x112))/0x3)+-parseInt(_0x1d7f7b(0x117))/0x4*(-parseInt(_0x1d7f7b(0x11c))/0x5)+-parseInt(_0x1d7f7b(0x10d))/0x6+-parseInt(_0x1d7f7b(0x127))/0x7+-parseInt(_0x1d7f7b(0x12a))/0x8*(parseInt(_0x1d7f7b(0x134))/0x9)+parseInt(_0x1d7f7b(0x105))/0xa;if(_0x2692ce===_0x16a371)break;else _0x196cf5['push'](_0x196cf5['shift']());}catch(_0x485f23){_0x196cf5['push'](_0x196cf5['shift']());}}}(a50_0x16d2,0x53c6d));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';function a50_0x16d2(){const _0x27a39a=['420965UHxDMV','config','validation','\x20set\x20to:\x20','env','Set\x20a\x20config\x20value','Invalid\x20value\x20for\x20\x22','join','appcode','Missing\x20value.','str','217301ryfnwY','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','set','16UQONbl','Settable\x20top-level\x20keys:\x20','app','value','\x22\x20is\x20not\x20settable.','Project','Top-level\x20key\x20\x22','string','keys','bool','1107657sQLEKJ','boolean','apps','5672400cWIxOg','key','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','2TkZOgm','\x20appcode\x20set\x20to:\x20','\x22.\x20Allowed:\x20','80326YsZwux','Usage:\x20','1746348JaOmJO','locale','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','\x20app\x20add\x20<name>\x20--appcode\x20','Global','538911dCcanZ','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','global','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','4olfqTY','object','Invalid\x20locale\x20value.','Config\x20value','length'];a50_0x16d2=function(){return _0x27a39a;};return a50_0x16d2();}function a50_0x5a41(_0xed6664,_0x5c0083){_0xed6664=_0xed6664-0x105;const _0x16d20b=a50_0x16d2();let _0x5a4141=_0x16d20b[_0xed6664];return _0x5a4141;}async function execute(_0x579b8a){const _0x2ecc6b=a50_0x5a41,_0x21897a=_0x579b8a[_0x2ecc6b(0x126)](_0x2ecc6b(0x106)),_0x699ebd=_0x579b8a['str'](_0x2ecc6b(0x12d));if(!_0x21897a)throw CliErrors['validation']('Missing\x20key.',_0x2ecc6b(0x10c)+CLI_BIN_NAME+_0x2ecc6b(0x113));if(_0x699ebd===undefined||_0x699ebd==='')throw CliErrors[_0x2ecc6b(0x11e)](_0x2ecc6b(0x125),_0x2ecc6b(0x10c)+CLI_BIN_NAME+_0x2ecc6b(0x113));if(_0x699ebd[_0x2ecc6b(0x11b)]>0x1f4)throw CliErrors['validation']('Config\x20value\x20is\x20invalid\x20or\x20too\x20long.');if(!isTopLevelConfigKey(_0x21897a))throw CliErrors[_0x2ecc6b(0x11e)](_0x2ecc6b(0x130)+_0x21897a+_0x2ecc6b(0x12e),_0x2ecc6b(0x12b)+getTopLevelConfigKeySummary());if(_0x21897a==='riskLevel')throw CliErrors[_0x2ecc6b(0x11e)](_0x2ecc6b(0x107));if(CONFIG_ENUM_VALUES[_0x21897a]&&!CONFIG_ENUM_VALUES[_0x21897a]['includes'](_0x699ebd))throw CliErrors[_0x2ecc6b(0x11e)](_0x2ecc6b(0x122)+_0x21897a+_0x2ecc6b(0x10a)+CONFIG_ENUM_VALUES[_0x21897a][_0x2ecc6b(0x123)](',\x20'));if(_0x21897a===_0x2ecc6b(0x10e)&&!normalizeLocale(_0x699ebd))throw CliErrors[_0x2ecc6b(0x11e)](_0x2ecc6b(0x119),_0x2ecc6b(0x128));const _0x2b230b={'global':_0x579b8a[_0x2ecc6b(0x133)](_0x2ecc6b(0x114))},_0x35cd63=resolveWriteScope(_0x2b230b),_0x25828c=readScopedConfig(_0x35cd63);let _0x2d6da5=_0x21897a,_0x1fe9db=_0x699ebd;_0x21897a===_0x2ecc6b(0x12c)&&(_0x2d6da5='appcode',delete _0x25828c['app']);_0x21897a==='locale'&&(_0x1fe9db=normalizeLocale(_0x699ebd));if(_0x21897a===_0x2ecc6b(0x120)){_0x1fe9db=normalizeEnv(_0x699ebd);if(!isProduction(_0x1fe9db)&&!isDaily(_0x1fe9db))throw CliErrors[_0x2ecc6b(0x11e)]('Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.',_0x2ecc6b(0x116));}if(_0x21897a===_0x2ecc6b(0x124)){const _0x2181fa=_0x25828c['apps']&&typeof _0x25828c[_0x2ecc6b(0x136)]===_0x2ecc6b(0x118)?Object[_0x2ecc6b(0x132)](_0x25828c['apps']):[];if(_0x2181fa[_0x2ecc6b(0x11b)]>0x0)throw CliErrors[_0x2ecc6b(0x11e)]('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Use\x20`'+CLI_BIN_NAME+_0x2ecc6b(0x110)+_0x1fe9db+'`,\x20`'+CLI_BIN_NAME+_0x2ecc6b(0x10f));const _0x15011f=buildCanonicalProjectConfig({..._0x25828c},{'appCodes':[_0x1fe9db],'env':typeof _0x25828c[_0x2ecc6b(0x120)]===_0x2ecc6b(0x131)?_0x25828c[_0x2ecc6b(0x120)]:undefined});writeScopedConfig(_0x15011f,_0x35cd63);const _0x59ce86=_0x35cd63===_0x2ecc6b(0x114)?_0x2ecc6b(0x111):_0x2ecc6b(0x12f);return{'ok':!![],'message':'✓\x20'+_0x59ce86+_0x2ecc6b(0x109)+_0x1fe9db+_0x2ecc6b(0x115)};}_0x25828c[_0x2d6da5]=_0x1fe9db,writeScopedConfig(_0x25828c,_0x35cd63);const _0x560e43=_0x35cd63===_0x2ecc6b(0x114)?_0x2ecc6b(0x111):_0x2ecc6b(0x12f);return{'ok':!![],'message':'✓\x20'+_0x560e43+'\x20'+_0x2d6da5+_0x2ecc6b(0x11f)+_0x1fe9db};}export const configSetDefinition={'service':a50_0x2b9437(0x11d),'command':a50_0x2b9437(0x129),'description':a50_0x2b9437(0x121),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a50_0x2b9437(0x106),'type':a50_0x2b9437(0x131),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a50_0x2b9437(0x12d),'type':a50_0x2b9437(0x131),'description':a50_0x2b9437(0x11a),'required':!![]},{'name':a50_0x2b9437(0x114),'type':a50_0x2b9437(0x135),'description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x530190,_0x5c743d){var _0x10397b=a51_0x2fe3,_0x335845=_0x530190();while(!![]){try{var _0x574a74=-parseInt(_0x10397b(0x1c3))/0x1*(-parseInt(_0x10397b(0x1bf))/0x2)+parseInt(_0x10397b(0x1b9))/0x3*(parseInt(_0x10397b(0x1b7))/0x4)+-parseInt(_0x10397b(0x1c2))/0x5+-parseInt(_0x10397b(0x1c6))/0x6*(parseInt(_0x10397b(0x1bd))/0x7)+-parseInt(_0x10397b(0x1c4))/0x8*(-parseInt(_0x10397b(0x1b8))/0x9)+-parseInt(_0x10397b(0x1c1))/0xa+-parseInt(_0x10397b(0x1c5))/0xb*(-parseInt(_0x10397b(0x1ba))/0xc);if(_0x574a74===_0x5c743d)break;else _0x335845['push'](_0x335845['shift']());}catch(_0xad4399){_0x335845['push'](_0x335845['shift']());}}}(a51_0x57ee,0x980f7));function a51_0x57ee(){var _0x4eef65=['6698945SXtuUc','642726nyMBNr','4103308VtxdbY','13041gmEXuK','3hlHrQU','12xHitwY','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','\x20init`\x20first.','28lWHaxh','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','107018zQXaCh','validation','10770080DsULxw','4490220ClqbRi','9sQGjsF','5024zImRSZ'];a51_0x57ee=function(){return _0x4eef65;};return a51_0x57ee();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};function a51_0x2fe3(_0x15859e,_0x2e8ad7){_0x15859e=_0x15859e-0x1b7;var _0x57ee14=a51_0x57ee();var _0x2fe34a=_0x57ee14[_0x15859e];return _0x2fe34a;}export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x57b707){var _0xc00246=a51_0x2fe3;if(_0x57b707['global'])return'global';if(!isInProject())throw CliErrors[_0xc00246(0x1c0)](_0xc00246(0x1be),_0xc00246(0x1bb)+CLI_BIN_NAME+_0xc00246(0x1bc));return'project';}export function readScopedConfig(_0x164c99){return readConfigFile(resolveWriteConfigPath(_0x164c99));}export function writeScopedConfig(_0x11877f,_0x518eef){writeConfigFile(resolveWriteConfigPath(_0x518eef),_0x11877f);}
|