@lovrabet/rabetbase-cli 2.3.9-beta.2 → 2.3.9-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -0
- package/lib/commands/menu/group-create.js +1 -0
- package/lib/commands/menu/group-update.js +1 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -0
- package/lib/commands/menu/shared/facts.js +1 -0
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -0
- package/lib/commands/task/status.js +1 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -0
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -0
- package/lib/framework/explicit-yes.js +1 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54bdd4,_0x220dae){const _0x7bab68=a147_0x5acc,_0x5d9cdc=_0x54bdd4();while(!![]){try{const _0xa260ea=-parseInt(_0x7bab68(0x13b))/0x1*(parseInt(_0x7bab68(0x125))/0x2)+parseInt(_0x7bab68(0x12f))/0x3*(-parseInt(_0x7bab68(0x12e))/0x4)+-parseInt(_0x7bab68(0x128))/0x5*(-parseInt(_0x7bab68(0x12c))/0x6)+-parseInt(_0x7bab68(0x12a))/0x7+-parseInt(_0x7bab68(0x138))/0x8*(parseInt(_0x7bab68(0x13a))/0x9)+-parseInt(_0x7bab68(0x12d))/0xa+parseInt(_0x7bab68(0x129))/0xb;if(_0xa260ea===_0x220dae)break;else _0x5d9cdc['push'](_0x5d9cdc['shift']());}catch(_0x439665){_0x5d9cdc['push'](_0x5d9cdc['shift']());}}}(a147_0x1b55,0x46ad0));function a147_0x1b55(){const _0x5f168e=['error','info','56464HIxiGC','resolve','549ImiJRc','163SirLYe','5678tyfaCU','install','cwd','19090ZpeiaT','17338805EJbZox','2463650JvlODd','依赖安装失败','600JASnNj','3220350FTeQlL','4DwTfFd','303861QNEqLQ','https://registry.npmmirror.com','message','now','开始安装依赖','依赖安装完成','npm'];a147_0x1b55=function(){return _0x5f168e;};return a147_0x1b55();}function a147_0x5acc(_0x23ffaa,_0x57d323){_0x23ffaa=_0x23ffaa-0x125;const _0x1b5552=a147_0x1b55();let _0x5acc27=_0x1b5552[_0x23ffaa];return _0x5acc27;}import a147_0x1d7903 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x53fcaf){const _0x167660=a147_0x5acc,_0x105f77=Date['now'](),_0x4dc7a7=a147_0x1d7903[_0x167660(0x139)](process[_0x167660(0x127)](),_0x53fcaf);try{logger[_0x167660(0x137)](_0x167660(0x126),_0x167660(0x133),{'projectCode':_0x53fcaf,'registry':_0x167660(0x130)}),await execa(resolveNpmBin(_0x167660(0x135)),[_0x167660(0x126),'--registry','https://registry.npmmirror.com'],{'cwd':_0x4dc7a7});const _0x4aa596=Date[_0x167660(0x132)]()-_0x105f77;logger['success']('install',_0x167660(0x134),_0x4aa596,{'projectCode':_0x53fcaf});}catch(_0x2e0d8e){const _0x407e16=Date['now']()-_0x105f77;logger[_0x167660(0x136)](_0x167660(0x126),_0x167660(0x12b),{'projectCode':_0x53fcaf,'error':_0x2e0d8e instanceof Error?_0x2e0d8e[_0x167660(0x131)]:String(_0x2e0d8e),'duration':_0x407e16});throw _0x2e0d8e;}return formatElapsed(_0x105f77);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0x36adc8=a148_0x237a;(function(_0x2ef3b5,_0x2be0a4){const _0x56dd9f=a148_0x237a,_0x1dedee=_0x2ef3b5();while(!![]){try{const _0x5ae409=-parseInt(_0x56dd9f(0x166))/0x1+-parseInt(_0x56dd9f(0x156))/0x2+-parseInt(_0x56dd9f(0x155))/0x3+parseInt(_0x56dd9f(0x169))/0x4+parseInt(_0x56dd9f(0x151))/0x5+-parseInt(_0x56dd9f(0x165))/0x6*(parseInt(_0x56dd9f(0x16c))/0x7)+parseInt(_0x56dd9f(0x157))/0x8;if(_0x5ae409===_0x2be0a4)break;else _0x1dedee['push'](_0x1dedee['shift']());}catch(_0x59da6f){_0x1dedee['push'](_0x1dedee['shift']());}}}(a148_0x1fd0,0xc4be7));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';function a148_0x237a(_0x4ec02f,_0x45971f){_0x4ec02f=_0x4ec02f-0x151;const _0x1fd0ae=a148_0x1fd0();let _0x237a5e=_0x1fd0ae[_0x4ec02f];return _0x237a5e;}import{upgradeApp}from'../../commands/project/upgrade.js';function a148_0x1fd0(){const _0x3b86ba=['create','4297419IjIoZO','1874766RgxniN','19989320kWBDnT','bool','write','Project\x20name','boolean','yes','Auto-confirm\x20prompts','string','2026-07','App\x20code\x20to\x20initialize','cookie','Create\x20a\x20new\x20project','str','project','132MxSdEX','847079qzMDky','args','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','5319316oEDzir','../../commands/project/create/main.js','nonInteractive','213619lseNCm','name','appcode','env','\x20workspace\x20init','init','Target\x20environment','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Skip\x20confirmation\x20prompt','project-name','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','4328390SFSMDy','../../commands/project/create/non-interactive.js','trim'];a148_0x1fd0=function(){return _0x3b86ba;};return a148_0x1fd0();}const initFlags=[{'name':'appcode','type':'string','description':a148_0x36adc8(0x160)},{'name':'env','type':a148_0x36adc8(0x15e),'description':a148_0x36adc8(0x172)},{'name':a148_0x36adc8(0x15c),'type':a148_0x36adc8(0x15b),'description':a148_0x36adc8(0x15d),'default':![]}],createFlags=[{'name':a148_0x36adc8(0x16d),'type':'string','description':a148_0x36adc8(0x15a)},{'name':a148_0x36adc8(0x16f),'type':a148_0x36adc8(0x15e),'description':a148_0x36adc8(0x172)},{'name':'appcode','type':'string','description':a148_0x36adc8(0x168)}],upgradeFlags=[{'name':a148_0x36adc8(0x15c),'type':a148_0x36adc8(0x15b),'description':a148_0x36adc8(0x174),'default':![]}];export const projectDefinitions=[{'service':a148_0x36adc8(0x164),'command':a148_0x36adc8(0x171),'description':a148_0x36adc8(0x176),'risk':a148_0x36adc8(0x159),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a148_0x36adc8(0x170),'since':a148_0x36adc8(0x15f)},'flags':initFlags,async 'execute'(_0xdf8794){const _0x55a21f=a148_0x36adc8;return await initConfig({'appcode':_0xdf8794[_0x55a21f(0x163)](_0x55a21f(0x16e))||undefined,'env':_0xdf8794[_0x55a21f(0x163)]('env')||undefined,'autoYes':_0xdf8794[_0x55a21f(0x158)](_0x55a21f(0x15c))}),{'ok':!![]};}},{'service':a148_0x36adc8(0x164),'command':a148_0x36adc8(0x154),'description':a148_0x36adc8(0x162),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a148_0x36adc8(0x175),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x4bdf1c){const _0x42f2f0=a148_0x36adc8,{createApp:_0x4898f4}=await import(_0x42f2f0(0x16a)),{createProjectNonInteractive:_0x446454}=await import(_0x42f2f0(0x152)),_0x23a14a=_0x4bdf1c[_0x42f2f0(0x163)]('name')[_0x42f2f0(0x153)]()||_0x4bdf1c[_0x42f2f0(0x167)][0x0]?.[_0x42f2f0(0x153)](),_0x5b1f48=_0x4bdf1c[_0x42f2f0(0x163)](_0x42f2f0(0x16f))||undefined,_0x2f01e9=_0x4bdf1c['str'](_0x42f2f0(0x16e))||undefined;if(_0x4bdf1c[_0x42f2f0(0x16b)]){if(!_0x23a14a)throw CliErrors['validation'](_0x42f2f0(0x173),'Usage:\x20'+CLI_BIN_NAME+_0x42f2f0(0x177));await _0x446454(_0x23a14a,_0x5b1f48,_0x2f01e9,_0x4bdf1c[_0x42f2f0(0x161)]);}else await _0x4898f4({'projectCode':_0x23a14a,'appCode':_0x2f01e9,'env':_0x5b1f48,'cookie':_0x4bdf1c[_0x42f2f0(0x161)]});return{'ok':!![]};}},{'service':'project','command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a148_0x36adc8(0x159),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x1a903c){const _0x37e31c=a148_0x36adc8;return await upgradeApp(_0x1a903c['nonInteractive'],{'yes':_0x1a903c[_0x37e31c(0x158)](_0x37e31c(0x15c))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23da3d,_0x53e0cf){const _0x4495d6=a149_0x213d,_0x4d3976=_0x23da3d();while(!![]){try{const _0x2c0cd3=-parseInt(_0x4495d6(0x19c))/0x1+parseInt(_0x4495d6(0x1b2))/0x2*(parseInt(_0x4495d6(0x1ad))/0x3)+parseInt(_0x4495d6(0x1a4))/0x4*(-parseInt(_0x4495d6(0x18c))/0x5)+-parseInt(_0x4495d6(0x1bc))/0x6*(-parseInt(_0x4495d6(0x19f))/0x7)+-parseInt(_0x4495d6(0x190))/0x8+-parseInt(_0x4495d6(0x1a9))/0x9+parseInt(_0x4495d6(0x194))/0xa;if(_0x2c0cd3===_0x53e0cf)break;else _0x4d3976['push'](_0x4d3976['shift']());}catch(_0x4af304){_0x4d3976['push'](_0x4d3976['shift']());}}}(a149_0x5655,0xee769));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a149_0x238344 from'chalk';function a149_0x5655(){const _0x5bc28d=['10090512EyjYzJ','\x20\x20Apps:\x20','appcode','production','57bCSGSJ','join','version','log','.bak','171806neDUJy','defaultApp','cyan','toLocaleString','init','gray','1.0.0','\x20workspace\x20init`\x20to\x20start\x20fresh.','Invalid\x20App\x20Code','从旧配置文件升级成功','299298PFpPPj','✓\x20Upgraded\x20','64030wQdZYm','app','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','.rabetbase.json','8235528TkECgU','setLogPath','parse','初始化项目配置文件成功','27414780ZMSwbV','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','\x20\x20appcode:\x20','utf8','info','yellow','keys','package.json','1151275VkpmWK','string','cwd','28FbaHug','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','apps','App\x20Code\x20cannot\x20be\x20empty','Please\x20enter\x20App\x20Code:','92xvayZj','env','bold','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','../..'];a149_0x5655=function(){return _0x5bc28d;};return a149_0x5655();}import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';function a149_0x213d(_0x339830,_0x2847d8){_0x339830=_0x339830-0x18b;const _0x5655f6=a149_0x5655();let _0x213d67=_0x5655f6[_0x339830];return _0x213d67;}import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x293657){const _0x35d696=a149_0x213d,{appcode:_0x39becd,env:_0x412346,autoYes:_0x7d259c}=_0x293657,_0x12c4a9=process[_0x35d696(0x19e)]();if(getProjectConfigPath())throw new Error(_0x35d696(0x18e));let _0x443522;for(const _0x1de049 of LEGACY_CONFIG_NAMES){const _0x5d356b=resolve(_0x12c4a9,_0x1de049);if(existsSync(_0x5d356b)){_0x443522=_0x5d356b;break;}}if(_0x443522){let _0x3bfee1={};try{_0x3bfee1=JSON[_0x35d696(0x192)](readFileSync(_0x443522,_0x35d696(0x197)));}catch{}const _0x4ddfb9=basename(_0x443522),_0x1d1a09=_0x3bfee1?.[_0x35d696(0x1ab)]||_0x3bfee1?.[_0x35d696(0x18d)];let _0x4b2af2=_0x7d259c;!_0x7d259c&&(console[_0x35d696(0x1b0)](a149_0x238344[_0x35d696(0x199)]('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a149_0x238344[_0x35d696(0x1a6)](_0x4ddfb9))),_0x1d1a09&&console[_0x35d696(0x1b0)](a149_0x238344[_0x35d696(0x1b4)](_0x35d696(0x196)+_0x1d1a09)),_0x4b2af2=await confirm({'message':'Upgrade\x20it\x20to\x20'+a149_0x238344[_0x35d696(0x1a6)](_0x35d696(0x18f))+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x4b2af2){console['log']('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x35d696(0x1b9));return;}const _0x1dbdc4=resolve(_0x12c4a9,NEW_CONFIG_NAME),_0x5e8f48=getCliVersionFromPkg(),_0x2a42c1=readRawConfig(),_0x5eafe3=_0x39becd||(typeof _0x3bfee1?.[_0x35d696(0x1ab)]===_0x35d696(0x19d)?_0x3bfee1['appcode']:undefined)||(typeof _0x3bfee1?.[_0x35d696(0x18d)]===_0x35d696(0x19d)?_0x3bfee1[_0x35d696(0x18d)]:undefined)||await askAppcode(),_0x3ca6e3=typeof _0x3bfee1?.[_0x35d696(0x1a5)]===_0x35d696(0x19d)?_0x3bfee1[_0x35d696(0x1a5)]:typeof _0x2a42c1[_0x35d696(0x1a5)]===_0x35d696(0x19d)?_0x2a42c1['env']:_0x35d696(0x1ac),_0x3cf425=buildCanonicalProjectConfig({..._0x2a42c1,..._0x3bfee1},{'appCodes':[_0x5eafe3],'env':_0x3ca6e3,'metadata':{'version':_0x5e8f48,'migratedAt':new Date()[_0x35d696(0x1b5)](),'migratedFrom':_0x443522}});writeConfigFile(_0x1dbdc4,_0x3cf425);const _0x31c2f8=_0x443522+_0x35d696(0x1b1);renameSync(_0x443522,_0x31c2f8),logger[_0x35d696(0x191)](_0x12c4a9),logger['info'](_0x35d696(0x1b6),_0x35d696(0x1bb),{'from':_0x443522,'to':_0x1dbdc4,'appcode':_0x5eafe3,'env':_0x3cf425[_0x35d696(0x1a5)]}),console[_0x35d696(0x1b0)](a149_0x238344['green'](_0x35d696(0x18b)+_0x4ddfb9+'\x20→\x20.rabetbase.json')),console[_0x35d696(0x1b0)](a149_0x238344[_0x35d696(0x1b4)](_0x35d696(0x1aa)+Object[_0x35d696(0x19a)](_0x3cf425[_0x35d696(0x1a1)]||{})['join'](',\x20'))),console['log'](a149_0x238344[_0x35d696(0x1b4)]('\x20\x20Default:\x20'+_0x3cf425[_0x35d696(0x1b3)])),console[_0x35d696(0x1b0)](a149_0x238344[_0x35d696(0x1b7)](_0x35d696(0x1a0)+_0x4ddfb9+'.bak'));return;}const _0x3f9eea=_0x39becd||await askAppcode(),_0x2aa459=resolve(_0x12c4a9,NEW_CONFIG_NAME),_0x474713=getCliVersionFromPkg(),_0xdb887=readRawConfig(),_0x525dd4=typeof _0xdb887[_0x35d696(0x1a5)]==='string'?_0xdb887[_0x35d696(0x1a5)]:undefined,_0xdb48d1=buildCanonicalProjectConfig({},{'appCodes':[_0x3f9eea],'env':_0x412346||_0x525dd4||_0x35d696(0x1ac),'metadata':{'version':_0x474713,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x2aa459,_0xdb48d1),logger['setLogPath'](_0x12c4a9),logger[_0x35d696(0x198)](_0x35d696(0x1b6),_0x35d696(0x193),{'appcode':_0x3f9eea,'env':_0xdb48d1[_0x35d696(0x1a5)],'version':_0xdb48d1[_0x35d696(0x1af)],'configPath':_0x2aa459}),console[_0x35d696(0x1b0)](a149_0x238344['green'](_0x35d696(0x195))),console[_0x35d696(0x1b0)](a149_0x238344[_0x35d696(0x1b4)](_0x35d696(0x1aa)+Object[_0x35d696(0x19a)](_0xdb48d1['apps']||{})[_0x35d696(0x1ae)](',\x20'))),console['log'](a149_0x238344['cyan']('\x20\x20Default:\x20'+_0xdb48d1['defaultApp'])),console[_0x35d696(0x1b0)](_0x35d696(0x1a7)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+'\x20api\x20pull\x27');}function askAppcode(){const _0x1ba1b0=a149_0x213d;return input({'message':_0x1ba1b0(0x1a3),'validate':_0x3488f5=>{const _0x22c890=_0x1ba1b0;if(!_0x3488f5['trim']())return _0x22c890(0x1a2);const {valid:_0x293f1a,message:_0x151799}=validateAppcode(_0x3488f5['trim']());return _0x293f1a||_0x151799||_0x22c890(0x1ba);}});}function getCliVersionFromPkg(){const _0x493845=a149_0x213d;try{const _0x5559cc=fileURLToPath(import.meta.url),_0x36f13a=resolve(dirname(_0x5559cc),_0x493845(0x1a8)),_0x3c5080=JSON[_0x493845(0x192)](readFileSync(resolve(_0x36f13a,_0x493845(0x19b)),_0x493845(0x197)));return _0x3c5080[_0x493845(0x1af)]||_0x493845(0x1b8);}catch{return _0x493845(0x1b8);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x4fc4df=a142_0x16d0;(function(_0x166bd1,_0x35406f){const _0x149a88=a142_0x16d0,_0xa02700=_0x166bd1();while(!![]){try{const _0x6fc48f=parseInt(_0x149a88(0x196))/0x1+parseInt(_0x149a88(0x150))/0x2+-parseInt(_0x149a88(0x185))/0x3*(parseInt(_0x149a88(0x14a))/0x4)+parseInt(_0x149a88(0x14c))/0x5+-parseInt(_0x149a88(0x165))/0x6+parseInt(_0x149a88(0x1a3))/0x7+parseInt(_0x149a88(0x1b7))/0x8*(-parseInt(_0x149a88(0x16a))/0x9);if(_0x6fc48f===_0x35406f)break;else _0xa02700['push'](_0xa02700['shift']());}catch(_0x5023bb){_0xa02700['push'](_0xa02700['shift']());}}}(a142_0xca17,0xb4d0d));import a142_0x480ee5 from'chalk';function a142_0xca17(){const _0x40dcb8=['\x20\x20Action:\x20delete','2740270rAamrU','utf8','skipped','\x20\x20#\x20or','failed','Step\x201/7:\x20Migrating\x20config...','parse','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','===\x20Upgrade\x20Analysis\x20===','.lovrabet','FAIL','sdkUpgrade','fail','path','exit\x20','\x20\x20Fields\x20to\x20migrate:\x20','message','Remove\x20legacy\x20artifacts','mcpServers','oldMcpConfig','Upgrade\x20cancelled.','4257270mZpNrW','[\x22@lovrabet/sdk\x22]:\x20','white','red','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','9qxfeiy','Upgrade\x20completed\x20successfully!','needsSkillSwap','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','none\x20found','package.json','devDependencies','no\x20legacy\x20config\x20found','Skill\x20swap:','args','Step\x204/7:\x20MCP\x20config\x20—\x20','not\x20found\x20(will\x20create)','.cursor/rules/lovrabet_rules.mdc','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','lovrabet/rabetbase\x20installed\x20globally','cyan','done','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','gray','\x20\x20Step\x20','FOUND','skipped\x20(no\x20legacy\x20config)','Config\x20migration','.bak','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','3vQppic','cwd','\x20\x20\x20\x20\x20\x20\x20','Proceed\x20with\x20upgrade?','green','needed','MCP\x20config:','lovrabet/rabetbase','lovrabet/lovrabet-skill\x20removed','start','join','bold','not\x20needed','yellow','log','succeed','some','40194LAgsRZ','oldArtifacts','removed\x20','step','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','configMigration','===\x20Upgrade\x20Summary\x20===','oldPath','includes','@lovrabet/sdk:','keys','.cursor/mcp.json','Legacy\x20artifacts:','9908647XjaWzw','stringify','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','CANCEL','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','entries','detail','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','@lovrabet/sdk','no\x20matching\x20entry\x20found','\x20removed','\x20→\x20','Clean\x20MCP\x20config','isDirectory','yes','\x20→\x20keys:\x20','isArray','\x20\x20bun\x20install','Config\x20file:','error','9176040KlQzfO','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','status','no\x20legacy\x20entry','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','inherit','object','\x20(backup:\x20','hasNewConfig','latest','Remove\x20.lovrabet/','push','Step\x201/7:\x20Config\x20migration\x20—\x20','length','string','Step\x205/7:\x20Removing\x20old\x20skill...','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','Install\x20new\x20skill','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','2364168fmFziK','Step\x206/7:\x20Installing\x20new\x20skill...','1811815kFmbhm','Upgrade\x20@lovrabet/sdk','filter'];a142_0xca17=function(){return _0x40dcb8;};return a142_0xca17();}import a142_0x2e3580 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x4fc4df(0x14e)](_0x210c15=>_0x210c15!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x959579){const _0x538965=a142_0x4fc4df,_0x31f3f8=[];for(const _0x1f08a8 of Object['values'](CORE_IDE_CONFIGS)){if(_0x1f08a8['files'])for(const _0x23fb94 of _0x1f08a8['files']){_0x31f3f8[_0x538965(0x142)](resolve(_0x959579,_0x23fb94['path']));}}return _0x31f3f8;}function analyse(_0x1bd839){const _0x220fa3=a142_0x4fc4df;let _0x4e5bcd=null;const _0x52e17e=resolve(_0x1bd839,NEW_CONFIG_NAME),_0x28c25c=existsSync(_0x52e17e);for(const _0x2309f6 of LEGACY_CONFIG_NAMES){const _0x5e4bed=resolve(_0x1bd839,_0x2309f6);if(existsSync(_0x5e4bed)){const _0x2e7584=readConfigFile(_0x5e4bed),_0x37d428=Object[_0x220fa3(0x1a0)](_0x2e7584)[_0x220fa3(0x14e)](_0x36b934=>typeof _0x2e7584[_0x36b934]!=='undefined');_0x4e5bcd={'oldPath':_0x5e4bed,'hasNewConfig':_0x28c25c,'fields':_0x37d428};break;}}const _0x301772=[],_0x52a374=resolve(_0x1bd839,_0x220fa3(0x159));if(existsSync(_0x52a374))_0x301772[_0x220fa3(0x142)](_0x52a374);const _0x3607bc=resolve(_0x1bd839,_0x220fa3(0x176));if(existsSync(_0x3607bc))_0x301772[_0x220fa3(0x142)](_0x3607bc);const _0x30913e=resolve(_0x1bd839,'.claude/skills/lovrabet');if(existsSync(_0x30913e))_0x301772[_0x220fa3(0x142)](_0x30913e);for(const _0x203b14 of collectIdeSkillFiles(_0x1bd839)){if(existsSync(_0x203b14))_0x301772[_0x220fa3(0x142)](_0x203b14);}let _0x4610d1=null;const _0x456ef4=resolve(_0x1bd839,_0x220fa3(0x1a1));if(existsSync(_0x456ef4))try{const _0x1fdc2f=JSON[_0x220fa3(0x156)](readFileSync(_0x456ef4,_0x220fa3(0x151)));if(_0x1fdc2f?.[_0x220fa3(0x162)]&&typeof _0x1fdc2f[_0x220fa3(0x162)]===_0x220fa3(0x1bd)){const _0x311aaa=[];for(const [_0x1f7c49,_0x37f8a2]of Object['entries'](_0x1fdc2f[_0x220fa3(0x162)])){const _0x4e54bd=_0x37f8a2;_0x4e54bd?.['args']&&Array['isArray'](_0x4e54bd['args'])&&_0x4e54bd['args']['some'](_0x385015=>typeof _0x385015===_0x220fa3(0x145)&&_0x385015[_0x220fa3(0x19e)]('@lovrabet/dataset-mcp-server'))&&_0x311aaa[_0x220fa3(0x142)](_0x1f7c49);}_0x311aaa[_0x220fa3(0x144)]>0x0&&(_0x4610d1={'path':_0x456ef4,'keys':_0x311aaa});}}catch{}const _0x50bb0f=_0x301772[_0x220fa3(0x144)]>0x0||_0x4e5bcd!==null;let _0x276939=null;const _0x423e86=resolve(_0x1bd839,_0x220fa3(0x16f));if(existsSync(_0x423e86))try{const _0x4c7dbd=JSON[_0x220fa3(0x156)](readFileSync(_0x423e86,_0x220fa3(0x151)));for(const _0x16268a of['dependencies',_0x220fa3(0x170)]){const _0x3cf28e=_0x4c7dbd?.[_0x16268a]?.[_0x220fa3(0x1ab)];if(typeof _0x3cf28e===_0x220fa3(0x145)){_0x3cf28e!==_0x220fa3(0x140)&&(_0x276939={'pkgPath':_0x423e86,'currentVersion':_0x3cf28e,'field':_0x16268a});break;}}}catch{}return{'configMigration':_0x4e5bcd,'oldArtifacts':_0x301772,'oldMcpConfig':_0x4610d1,'needsSkillSwap':_0x50bb0f,'sdkUpgrade':_0x276939};}function printReport(_0x60b861){const _0x451923=a142_0x4fc4df,{configMigration:_0x524256,oldArtifacts:_0x5844de,oldMcpConfig:_0x20e044,needsSkillSwap:_0xe07a55}=_0x60b861;console['log'](''),console[_0x451923(0x193)](a142_0x480ee5['bold'](_0x451923(0x158))),console[_0x451923(0x193)]('');_0x524256?(console[_0x451923(0x193)](a142_0x480ee5[_0x451923(0x17a)](_0x451923(0x1b5))+('\x20\x20'+a142_0x480ee5[_0x451923(0x192)](_0x524256[_0x451923(0x19d)]))),console[_0x451923(0x193)](_0x451923(0x177)+(_0x524256[_0x451923(0x13f)]?a142_0x480ee5['green']('already\x20exists\x20(will\x20merge)'):a142_0x480ee5['gray'](_0x451923(0x175)))),console[_0x451923(0x193)](_0x451923(0x15f)+_0x524256['fields'][_0x451923(0x18f)](',\x20')),console[_0x451923(0x193)](_0x451923(0x1a7))):console['log'](a142_0x480ee5[_0x451923(0x17a)]('Config\x20file:')+'\x20\x20'+a142_0x480ee5[_0x451923(0x17e)](_0x451923(0x171)));console['log']('');if(_0x5844de[_0x451923(0x144)]>0x0){console[_0x451923(0x193)](a142_0x480ee5[_0x451923(0x17a)](_0x451923(0x1a2)));for(const _0x34e3c8 of _0x5844de){console[_0x451923(0x193)]('\x20\x20'+a142_0x480ee5['red'](_0x451923(0x180))+'\x20\x20'+_0x34e3c8);}console[_0x451923(0x193)](_0x451923(0x14f));}else console[_0x451923(0x193)](a142_0x480ee5['cyan'](_0x451923(0x1a2))+'\x20\x20'+a142_0x480ee5[_0x451923(0x17e)](_0x451923(0x16e)));console[_0x451923(0x193)]('');_0x20e044?(console[_0x451923(0x193)](a142_0x480ee5[_0x451923(0x17a)](_0x451923(0x18b))+('\x20\x20'+a142_0x480ee5['yellow'](_0x20e044[_0x451923(0x15d)])+_0x451923(0x1b2)+_0x20e044[_0x451923(0x1a0)][_0x451923(0x18f)](',\x20'))),console[_0x451923(0x193)](_0x451923(0x1a5))):console['log'](a142_0x480ee5[_0x451923(0x17a)]('MCP\x20config:')+'\x20\x20'+a142_0x480ee5[_0x451923(0x17e)](_0x451923(0x1ba)));console[_0x451923(0x193)](''),console[_0x451923(0x193)](a142_0x480ee5[_0x451923(0x17a)](_0x451923(0x172))+('\x20\x20'+(_0xe07a55?a142_0x480ee5[_0x451923(0x192)](_0x451923(0x18a)):a142_0x480ee5[_0x451923(0x189)](_0x451923(0x191)))));_0xe07a55&&console[_0x451923(0x193)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x60b861[_0x451923(0x15b)]){const {currentVersion:_0x38ea06,field:_0x154def,pkgPath:_0x105783}=_0x60b861[_0x451923(0x15b)];console['log'](a142_0x480ee5[_0x451923(0x17a)](_0x451923(0x19f))+('\x20\x20'+a142_0x480ee5[_0x451923(0x192)](_0x105783))),console['log']('\x20\x20Current\x20version\x20in\x20'+_0x154def+':\x20'+a142_0x480ee5[_0x451923(0x192)](_0x38ea06)+_0x451923(0x1ae)+a142_0x480ee5[_0x451923(0x189)](_0x451923(0x140))),console['log'](_0x451923(0x17c));}else console[_0x451923(0x193)](a142_0x480ee5['cyan'](_0x451923(0x19f))+'\x20\x20'+a142_0x480ee5[_0x451923(0x17e)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x451923(0x193)]('');}function a142_0x16d0(_0xd57493,_0x5a06a7){_0xd57493=_0xd57493-0x13e;const _0xca1720=a142_0xca17();let _0x16d0b1=_0xca1720[_0xd57493];return _0x16d0b1;}function execConfigMigration(_0x1007c2,_0x1357a8){const _0x19aeb7=a142_0x4fc4df,{configMigration:_0x138901}=_0x1007c2;if(!_0x138901?.[_0x19aeb7(0x19d)])return{'step':0x1,'label':_0x19aeb7(0x182),'ok':!![],'detail':_0x19aeb7(0x181)};const _0x7560e3=readConfigFile(_0x138901[_0x19aeb7(0x19d)]),_0x4d1a8d=resolve(_0x1357a8,NEW_CONFIG_NAME),_0x1dfde1=_0x138901[_0x19aeb7(0x13f)]?readConfigFile(_0x4d1a8d):{};for(const [_0x48f521,_0x45fbc6]of Object['entries'](_0x7560e3)){!(_0x48f521 in _0x1dfde1)&&(_0x1dfde1[_0x48f521]=_0x45fbc6);}writeConfigFile(_0x4d1a8d,_0x1dfde1);const _0x26d330=_0x138901[_0x19aeb7(0x19d)]+_0x19aeb7(0x183);return renameSync(_0x138901[_0x19aeb7(0x19d)],_0x26d330),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x138901[_0x19aeb7(0x19d)]+'\x20→\x20'+_0x4d1a8d+_0x19aeb7(0x13e)+_0x26d330+')'};}function execRemoveOldArtifacts(_0x4688cf){const _0x2c35d5=a142_0x4fc4df,_0x1fe641=[];for(const _0x1848cd of _0x4688cf){try{if(!existsSync(_0x1848cd))continue;const _0x47d4bf=tryStat(_0x1848cd);_0x47d4bf?.[_0x2c35d5(0x1b0)]()?rmSync(_0x1848cd,{'recursive':!![],'force':!![]}):unlinkSync(_0x1848cd);}catch(_0x1022ba){_0x1fe641[_0x2c35d5(0x142)](_0x1848cd+':\x20'+_0x1022ba[_0x2c35d5(0x160)]);}}return{'step':0x3,'label':_0x2c35d5(0x161),'ok':_0x1fe641[_0x2c35d5(0x144)]===0x0,'detail':_0x1fe641['length']>0x0?_0x4688cf[_0x2c35d5(0x144)]-_0x1fe641[_0x2c35d5(0x144)]+'/'+_0x4688cf[_0x2c35d5(0x144)]+'\x20removed\x20('+_0x1fe641[_0x2c35d5(0x18f)](';\x20')+')':_0x4688cf['length']+_0x2c35d5(0x1ad)};}function execCleanMcp(_0x27a91f){const _0x5a1e84=a142_0x4fc4df;if(!_0x27a91f[_0x5a1e84(0x163)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5a1e84(0x152)};try{const _0x1bd3e1=readFileSync(_0x27a91f['oldMcpConfig'][_0x5a1e84(0x15d)],'utf8'),_0x4dadbc=JSON[_0x5a1e84(0x156)](_0x1bd3e1);if(_0x4dadbc?.[_0x5a1e84(0x162)]&&typeof _0x4dadbc[_0x5a1e84(0x162)]===_0x5a1e84(0x1bd)){const _0x3a408b=[];for(const [_0x38513f,_0x3da526]of Object[_0x5a1e84(0x1a8)](_0x4dadbc[_0x5a1e84(0x162)])){_0x3da526?.['args']&&Array[_0x5a1e84(0x1b3)](_0x3da526[_0x5a1e84(0x173)])&&_0x3da526[_0x5a1e84(0x173)][_0x5a1e84(0x195)](_0x3a80a6=>typeof _0x3a80a6===_0x5a1e84(0x145)&&_0x3a80a6[_0x5a1e84(0x19e)]('@lovrabet/dataset-mcp-server'))&&_0x3a408b[_0x5a1e84(0x142)](_0x38513f);}for(const _0x586e02 of _0x3a408b){delete _0x4dadbc[_0x5a1e84(0x162)][_0x586e02];}return _0x3a408b[_0x5a1e84(0x144)]>0x0&&writeFileSync(_0x27a91f[_0x5a1e84(0x163)][_0x5a1e84(0x15d)],JSON[_0x5a1e84(0x1a4)](_0x4dadbc,null,0x2)+'\x0a',_0x5a1e84(0x151)),{'step':0x4,'label':_0x5a1e84(0x1af),'ok':!![],'detail':_0x5a1e84(0x198)+_0x3a408b[_0x5a1e84(0x18f)](',\x20')+'\x20from\x20'+_0x27a91f[_0x5a1e84(0x163)][_0x5a1e84(0x15d)]};}return{'step':0x4,'label':_0x5a1e84(0x1af),'ok':!![],'detail':_0x5a1e84(0x1ac)};}catch(_0x15558c){return{'step':0x4,'label':_0x5a1e84(0x1af),'ok':![],'detail':_0x15558c['message']};}}function execSkillsRemove(_0xa3bf6c,_0x5a3543){const _0x4de619=a142_0x4fc4df,_0x5b9acc=runNpxSkillsRemove(_0xa3bf6c,{'stdio':_0x4de619(0x1bc),'yes':_0x5a3543});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x5b9acc['ok'],'detail':_0x5b9acc['ok']?_0x4de619(0x18d):_0x5b9acc[_0x4de619(0x1b6)]??_0x4de619(0x15e)+_0x5b9acc['status']};}function execSkillsAdd(_0x483f83,_0x132033){const _0x1e13c1=a142_0x4fc4df,_0x126096=runNpxSkillsAddGlobal(_0x483f83,_0x1e13c1(0x18c),{'stdio':'inherit','yes':_0x132033});return{'step':0x6,'label':_0x1e13c1(0x148),'ok':_0x126096['ok'],'detail':_0x126096['ok']?_0x1e13c1(0x179):_0x126096[_0x1e13c1(0x1b6)]??'exit\x20'+_0x126096[_0x1e13c1(0x1b9)]};}function execUpgradeSdk(_0x4a21d4){const _0x451dac=a142_0x4fc4df;if(!_0x4a21d4[_0x451dac(0x15b)])return{'step':0x7,'label':_0x451dac(0x14d),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x57928d,currentVersion:_0x197340,field:_0x553580}=_0x4a21d4[_0x451dac(0x15b)];try{const _0x87c014=readFileSync(_0x57928d,'utf8'),_0x315a09=JSON[_0x451dac(0x156)](_0x87c014);return _0x315a09[_0x553580]['@lovrabet/sdk']=_0x451dac(0x140),writeFileSync(_0x57928d,JSON['stringify'](_0x315a09,null,0x2)+'\x0a',_0x451dac(0x151)),{'step':0x7,'label':_0x451dac(0x14d),'ok':!![],'detail':_0x553580+_0x451dac(0x166)+_0x197340+'\x20→\x20latest'};}catch(_0x314125){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x314125[_0x451dac(0x160)]};}}function tryStat(_0xae07c7){try{return statSync(_0xae07c7);}catch{return undefined;}}function printSummary(_0x316897){const _0x5b120d=a142_0x4fc4df;console[_0x5b120d(0x193)](''),console[_0x5b120d(0x193)](a142_0x480ee5[_0x5b120d(0x190)](_0x5b120d(0x19c))),console[_0x5b120d(0x193)]('');for(const _0x5a93a1 of _0x316897){const _0x4efc57=_0x5a93a1['ok']?a142_0x480ee5[_0x5b120d(0x189)]('OK'):a142_0x480ee5[_0x5b120d(0x168)](_0x5b120d(0x15a));console['log']('\x20\x20'+_0x4efc57+_0x5b120d(0x17f)+_0x5a93a1[_0x5b120d(0x199)]+':\x20'+_0x5a93a1['label']);if(_0x5a93a1[_0x5b120d(0x1a9)])console[_0x5b120d(0x193)](_0x5b120d(0x187)+a142_0x480ee5[_0x5b120d(0x17e)](_0x5a93a1[_0x5b120d(0x1a9)]));}console[_0x5b120d(0x193)]('');}export async function upgradeApp(_0x1aa6b0,_0x50cdad){const _0x1cccfa=a142_0x4fc4df,_0x18c55e=process[_0x1cccfa(0x186)](),_0x3aa8b2=analyse(_0x18c55e),_0x9178d0=!_0x3aa8b2[_0x1cccfa(0x19b)]&&_0x3aa8b2[_0x1cccfa(0x197)]['length']===0x0&&!_0x3aa8b2['oldMcpConfig']&&!_0x3aa8b2[_0x1cccfa(0x16c)]&&!_0x3aa8b2[_0x1cccfa(0x15b)];if(_0x9178d0){console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x189)](_0x1cccfa(0x147)));return;}printReport(_0x3aa8b2);const _0x49df3b=!!(_0x50cdad[_0x1cccfa(0x1b1)]||_0x50cdad['Y']||_0x1aa6b0);if(!_0x49df3b)try{const _0x43d7cb=await askConfirm(_0x1cccfa(0x188));if(!_0x43d7cb){console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x17e)](_0x1cccfa(0x164)));return;}}catch(_0xb37bc8){if(_0xb37bc8?.[_0x1cccfa(0x160)]===_0x1cccfa(0x1a6)){console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x17e)](_0x1cccfa(0x164)));return;}throw _0xb37bc8;}const _0x54e8a6=[],_0x332939=a142_0x2e3580({'text':_0x1cccfa(0x155),'color':_0x1cccfa(0x17a)})[_0x1cccfa(0x18e)](),_0xa46299=execConfigMigration(_0x3aa8b2,_0x18c55e);_0x54e8a6['push'](_0xa46299),_0x332939[_0xa46299['ok']?_0x1cccfa(0x194):_0x1cccfa(0x15c)](_0x1cccfa(0x143)+(_0xa46299[_0x1cccfa(0x1a9)]??(_0xa46299['ok']?_0x1cccfa(0x17b):_0x1cccfa(0x154))));const _0x305aa1=resolve(_0x18c55e,_0x1cccfa(0x159)),_0x535845=a142_0x2e3580({'text':_0x1cccfa(0x1b8),'color':_0x1cccfa(0x17a)})[_0x1cccfa(0x18e)]();if(existsSync(_0x305aa1))try{rmSync(_0x305aa1,{'recursive':!![],'force':!![]}),_0x535845[_0x1cccfa(0x194)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x54e8a6[_0x1cccfa(0x142)]({'step':0x2,'label':_0x1cccfa(0x141),'ok':!![]});}catch(_0xe9db60){_0x535845[_0x1cccfa(0x15c)](_0x1cccfa(0x169)+_0xe9db60[_0x1cccfa(0x160)]),_0x54e8a6[_0x1cccfa(0x142)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0xe9db60[_0x1cccfa(0x160)]});}else _0x535845['info'](_0x1cccfa(0x157)),_0x54e8a6[_0x1cccfa(0x142)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x1cccfa(0x152)});const _0x584717=a142_0x2e3580({'text':_0x1cccfa(0x1aa),'color':_0x1cccfa(0x17a)})[_0x1cccfa(0x18e)](),_0x46fdee=execRemoveOldArtifacts(_0x3aa8b2[_0x1cccfa(0x197)]);_0x54e8a6['push'](_0x46fdee),_0x584717[_0x46fdee['ok']?_0x1cccfa(0x194):_0x1cccfa(0x15c)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x46fdee[_0x1cccfa(0x1a9)]??(_0x46fdee['ok']?_0x1cccfa(0x17b):'failed')));const _0x24ed94=a142_0x2e3580({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x1cccfa(0x17a)})['start'](),_0x5ee804=execCleanMcp(_0x3aa8b2);_0x54e8a6[_0x1cccfa(0x142)](_0x5ee804),_0x24ed94[_0x5ee804['ok']?_0x1cccfa(0x194):_0x1cccfa(0x15c)](_0x1cccfa(0x174)+(_0x5ee804[_0x1cccfa(0x1a9)]??(_0x5ee804['ok']?'done':_0x1cccfa(0x154))));const _0x375f2b=a142_0x2e3580({'text':_0x1cccfa(0x146),'color':_0x1cccfa(0x17a)})[_0x1cccfa(0x18e)](),_0x197efa=execSkillsRemove(_0x18c55e,_0x49df3b);_0x54e8a6[_0x1cccfa(0x142)](_0x197efa),_0x375f2b[_0x197efa['ok']?_0x1cccfa(0x194):_0x1cccfa(0x15c)](_0x1cccfa(0x184)+(_0x197efa[_0x1cccfa(0x1a9)]??(_0x197efa['ok']?_0x1cccfa(0x17b):_0x1cccfa(0x154))));const _0x4b792a=a142_0x2e3580({'text':_0x1cccfa(0x14b),'color':_0x1cccfa(0x17a)})[_0x1cccfa(0x18e)](),_0x439d8d=execSkillsAdd(_0x18c55e,_0x49df3b);_0x54e8a6[_0x1cccfa(0x142)](_0x439d8d),_0x4b792a[_0x439d8d['ok']?'succeed':_0x1cccfa(0x15c)](_0x1cccfa(0x19a)+(_0x439d8d['detail']??(_0x439d8d['ok']?_0x1cccfa(0x17b):_0x1cccfa(0x154))));const _0x14900b=a142_0x2e3580({'text':_0x1cccfa(0x17d),'color':_0x1cccfa(0x17a)})[_0x1cccfa(0x18e)](),_0x3023b6=execUpgradeSdk(_0x3aa8b2);_0x54e8a6[_0x1cccfa(0x142)](_0x3023b6),_0x14900b[_0x3023b6['ok']?'succeed':_0x1cccfa(0x15c)](_0x1cccfa(0x16d)+(_0x3023b6['detail']??(_0x3023b6['ok']?'done':_0x1cccfa(0x154)))),printSummary(_0x54e8a6);const _0x135966=_0x54e8a6[_0x1cccfa(0x195)](_0x1c9e68=>!_0x1c9e68['ok']);_0x135966?console[_0x1cccfa(0x193)](a142_0x480ee5['yellow'](_0x1cccfa(0x1bb))):console[_0x1cccfa(0x193)](a142_0x480ee5['green'](_0x1cccfa(0x16b))),_0x3023b6['ok']&&_0x3aa8b2[_0x1cccfa(0x15b)]&&(console[_0x1cccfa(0x193)](''),console[_0x1cccfa(0x193)](a142_0x480ee5['bold'][_0x1cccfa(0x17a)](_0x1cccfa(0x149))),console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x17a)](_0x1cccfa(0x178))),console['log'](''),console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x167)]('\x20\x20npm\x20install')),console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x167)](_0x1cccfa(0x153))),console[_0x1cccfa(0x193)](a142_0x480ee5[_0x1cccfa(0x167)](_0x1cccfa(0x1b4))),console['log'](''));}
|
|
1
|
+
const a150_0xd3b0c=a150_0x5435;(function(_0xb27669,_0x315b3e){const _0x4d80ae=a150_0x5435,_0x2d2c72=_0xb27669();while(!![]){try{const _0x18bace=-parseInt(_0x4d80ae(0x100))/0x1+parseInt(_0x4d80ae(0xef))/0x2*(-parseInt(_0x4d80ae(0xe4))/0x3)+parseInt(_0x4d80ae(0xc4))/0x4+-parseInt(_0x4d80ae(0xaa))/0x5*(-parseInt(_0x4d80ae(0x119))/0x6)+-parseInt(_0x4d80ae(0x115))/0x7+parseInt(_0x4d80ae(0xc0))/0x8*(-parseInt(_0x4d80ae(0xae))/0x9)+parseInt(_0x4d80ae(0xad))/0xa;if(_0x18bace===_0x315b3e)break;else _0x2d2c72['push'](_0x2d2c72['shift']());}catch(_0x183567){_0x2d2c72['push'](_0x2d2c72['shift']());}}}(a150_0xde17,0x212ae));import a150_0x16aaf1 from'chalk';import a150_0x591b83 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a150_0xde17(){const _0xf30595=['yellow','status','undefined','\x20\x20#\x20or','\x20\x20Current\x20version\x20in\x20','no\x20legacy\x20entry','860uvYvbP','stringify','MCP\x20config:','4382770gNFbCt','1971MEPRtY','@lovrabet/sdk','log','Remove\x20.lovrabet/','\x20→\x20','some','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','\x20\x20Action:\x20delete','done','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','isDirectory','error','filter','not\x20found\x20or\x20already\x20at\x20latest','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20bun\x20install','no\x20legacy\x20config\x20found','6824VzkvpE','Upgrade\x20cancelled.','hasNewConfig','path','227520odOxbY','step','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','dependencies','utf8','Step\x206/7:\x20Installing\x20new\x20skill...','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','sdkUpgrade','cyan','lovrabet/rabetbase\x20installed\x20globally','@lovrabet/dataset-mcp-server','entries','\x20\x20\x20\x20\x20\x20\x20','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','string','object','Step\x201/7:\x20Migrating\x20config...','removed\x20','Legacy\x20artifacts:','no\x20matching\x20entry\x20found','\x20removed\x20(','parse','oldMcpConfig','\x20(backup:\x20','fail','info','Upgrade\x20@lovrabet/sdk','message','red','exit\x20','join','141mUHnuC','oldArtifacts','\x20→\x20latest','push','package.json','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20\x20Fields\x20to\x20migrate:\x20','yes','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','skipped','Step\x204/7:\x20Cleaning\x20MCP\x20config...','1826lHlcZO','Config\x20file:','FOUND','@lovrabet/sdk:','skipped\x20(no\x20legacy\x20config)','keys','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','length','gray','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Config\x20migration','Proceed\x20with\x20upgrade?','Install\x20new\x20skill','Remove\x20legacy\x20artifacts','isArray','mcpServers','\x20\x20Step\x20','153808MjSvel','===\x20Upgrade\x20Analysis\x20===','detail','bold','files','[\x22@lovrabet/sdk\x22]:\x20','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','.bak','inherit','Clean\x20MCP\x20config','\x20removed','start','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','\x20from\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','needsSkillSwap','.cursor/rules/lovrabet_rules.mdc','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','FAIL','Remove\x20old\x20skill','not\x20needed','1282463TkWpbF','white','includes','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','7236lzVdoj','oldPath','label','green','succeed','.lovrabet','\x20→\x20keys:\x20','already\x20exists\x20(will\x20merge)','latest','args','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','lovrabet/rabetbase','none\x20found','failed','cwd'];a150_0xde17=function(){return _0xf30595;};return a150_0xde17();}import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';function a150_0x5435(_0x1babb0,_0x177925){_0x1babb0=_0x1babb0-0xa2;const _0xde170c=a150_0xde17();let _0x5435d5=_0xde170c[_0x1babb0];return _0x5435d5;}import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a150_0xd3b0c(0xbb)](_0x385224=>_0x385224!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x295319){const _0x230c40=a150_0xd3b0c,_0x4ad1ed=[];for(const _0x52dc7d of Object['values'](CORE_IDE_CONFIGS)){if(_0x52dc7d[_0x230c40(0x104)])for(const _0x3223db of _0x52dc7d[_0x230c40(0x104)]){_0x4ad1ed[_0x230c40(0xe7)](resolve(_0x295319,_0x3223db[_0x230c40(0xc3)]));}}return _0x4ad1ed;}function analyse(_0x3cd150){const _0x2624f7=a150_0xd3b0c;let _0xf3a362=null;const _0x28cef9=resolve(_0x3cd150,NEW_CONFIG_NAME),_0x51ffd9=existsSync(_0x28cef9);for(const _0x23894f of LEGACY_CONFIG_NAMES){const _0x1cf91b=resolve(_0x3cd150,_0x23894f);if(existsSync(_0x1cf91b)){const _0x5d4bd9=readConfigFile(_0x1cf91b),_0x5266d4=Object[_0x2624f7(0xf4)](_0x5d4bd9)['filter'](_0x5673fc=>typeof _0x5d4bd9[_0x5673fc]!==_0x2624f7(0xa6));_0xf3a362={'oldPath':_0x1cf91b,'hasNewConfig':_0x51ffd9,'fields':_0x5266d4};break;}}const _0x4909bf=[],_0x147fe3=resolve(_0x3cd150,'.lovrabet');if(existsSync(_0x147fe3))_0x4909bf[_0x2624f7(0xe7)](_0x147fe3);const _0x124242=resolve(_0x3cd150,_0x2624f7(0x110));if(existsSync(_0x124242))_0x4909bf[_0x2624f7(0xe7)](_0x124242);const _0x26e5cd=resolve(_0x3cd150,'.claude/skills/lovrabet');if(existsSync(_0x26e5cd))_0x4909bf[_0x2624f7(0xe7)](_0x26e5cd);for(const _0x39c5f7 of collectIdeSkillFiles(_0x3cd150)){if(existsSync(_0x39c5f7))_0x4909bf[_0x2624f7(0xe7)](_0x39c5f7);}let _0x32bd0c=null;const _0x33e788=resolve(_0x3cd150,'.cursor/mcp.json');if(existsSync(_0x33e788))try{const _0x46b501=JSON[_0x2624f7(0xda)](readFileSync(_0x33e788,'utf8'));if(_0x46b501?.[_0x2624f7(0xfe)]&&typeof _0x46b501[_0x2624f7(0xfe)]===_0x2624f7(0xd4)){const _0x5990a7=[];for(const [_0x19856a,_0x1107ee]of Object[_0x2624f7(0xcf)](_0x46b501['mcpServers'])){const _0x2d8646=_0x1107ee;_0x2d8646?.['args']&&Array[_0x2624f7(0xfd)](_0x2d8646[_0x2624f7(0x122)])&&_0x2d8646[_0x2624f7(0x122)][_0x2624f7(0xb3)](_0x1d04d7=>typeof _0x1d04d7===_0x2624f7(0xd3)&&_0x1d04d7[_0x2624f7(0x117)](_0x2624f7(0xce)))&&_0x5990a7[_0x2624f7(0xe7)](_0x19856a);}_0x5990a7[_0x2624f7(0xf6)]>0x0&&(_0x32bd0c={'path':_0x33e788,'keys':_0x5990a7});}}catch{}const _0x5cd4e5=_0x4909bf[_0x2624f7(0xf6)]>0x0||_0xf3a362!==null;let _0x35bcdf=null;const _0x3d8081=resolve(_0x3cd150,_0x2624f7(0xe8));if(existsSync(_0x3d8081))try{const _0x1ad6d8=JSON[_0x2624f7(0xda)](readFileSync(_0x3d8081,'utf8'));for(const _0x54aa83 of[_0x2624f7(0xc7),'devDependencies']){const _0x31b364=_0x1ad6d8?.[_0x54aa83]?.[_0x2624f7(0xaf)];if(typeof _0x31b364==='string'){_0x31b364!==_0x2624f7(0x121)&&(_0x35bcdf={'pkgPath':_0x3d8081,'currentVersion':_0x31b364,'field':_0x54aa83});break;}}}catch{}return{'configMigration':_0xf3a362,'oldArtifacts':_0x4909bf,'oldMcpConfig':_0x32bd0c,'needsSkillSwap':_0x5cd4e5,'sdkUpgrade':_0x35bcdf};}function printReport(_0x1fb2b3){const _0x30f9ef=a150_0xd3b0c,{configMigration:_0x134a11,oldArtifacts:_0x397ed4,oldMcpConfig:_0x10a299,needsSkillSwap:_0xbff043}=_0x1fb2b3;console['log'](''),console['log'](a150_0x16aaf1[_0x30f9ef(0x103)](_0x30f9ef(0x101))),console[_0x30f9ef(0xb0)]('');_0x134a11?(console[_0x30f9ef(0xb0)](a150_0x16aaf1['cyan'](_0x30f9ef(0xf0))+('\x20\x20'+a150_0x16aaf1[_0x30f9ef(0xa4)](_0x134a11[_0x30f9ef(0x11a)]))),console[_0x30f9ef(0xb0)](_0x30f9ef(0x10e)+(_0x134a11[_0x30f9ef(0xc2)]?a150_0x16aaf1['green'](_0x30f9ef(0x120)):a150_0x16aaf1[_0x30f9ef(0xf7)]('not\x20found\x20(will\x20create)'))),console[_0x30f9ef(0xb0)](_0x30f9ef(0xea)+_0x134a11['fields'][_0x30f9ef(0xe3)](',\x20')),console[_0x30f9ef(0xb0)](_0x30f9ef(0x118))):console[_0x30f9ef(0xb0)](a150_0x16aaf1[_0x30f9ef(0xcc)]('Config\x20file:')+'\x20\x20'+a150_0x16aaf1[_0x30f9ef(0xf7)](_0x30f9ef(0xbf)));console[_0x30f9ef(0xb0)]('');if(_0x397ed4['length']>0x0){console[_0x30f9ef(0xb0)](a150_0x16aaf1[_0x30f9ef(0xcc)](_0x30f9ef(0xd7)));for(const _0x1386b7 of _0x397ed4){console[_0x30f9ef(0xb0)]('\x20\x20'+a150_0x16aaf1[_0x30f9ef(0xe1)](_0x30f9ef(0xf1))+'\x20\x20'+_0x1386b7);}console[_0x30f9ef(0xb0)](_0x30f9ef(0xb6));}else console[_0x30f9ef(0xb0)](a150_0x16aaf1[_0x30f9ef(0xcc)](_0x30f9ef(0xd7))+'\x20\x20'+a150_0x16aaf1['gray'](_0x30f9ef(0x125)));console[_0x30f9ef(0xb0)]('');_0x10a299?(console['log'](a150_0x16aaf1[_0x30f9ef(0xcc)]('MCP\x20config:')+('\x20\x20'+a150_0x16aaf1[_0x30f9ef(0xa4)](_0x10a299[_0x30f9ef(0xc3)])+_0x30f9ef(0x11f)+_0x10a299[_0x30f9ef(0xf4)][_0x30f9ef(0xe3)](',\x20'))),console[_0x30f9ef(0xb0)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x30f9ef(0xb0)](a150_0x16aaf1[_0x30f9ef(0xcc)](_0x30f9ef(0xac))+'\x20\x20'+a150_0x16aaf1['gray'](_0x30f9ef(0xa9)));console[_0x30f9ef(0xb0)](''),console[_0x30f9ef(0xb0)](a150_0x16aaf1['cyan']('Skill\x20swap:')+('\x20\x20'+(_0xbff043?a150_0x16aaf1['yellow']('needed'):a150_0x16aaf1[_0x30f9ef(0x11c)](_0x30f9ef(0x114)))));_0xbff043&&console[_0x30f9ef(0xb0)](_0x30f9ef(0x10c)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x1fb2b3['sdkUpgrade']){const {currentVersion:_0xe96e47,field:_0x1cee91,pkgPath:_0x4a9708}=_0x1fb2b3[_0x30f9ef(0xcb)];console[_0x30f9ef(0xb0)](a150_0x16aaf1[_0x30f9ef(0xcc)](_0x30f9ef(0xf2))+('\x20\x20'+a150_0x16aaf1[_0x30f9ef(0xa4)](_0x4a9708))),console['log'](_0x30f9ef(0xa8)+_0x1cee91+':\x20'+a150_0x16aaf1['yellow'](_0xe96e47)+_0x30f9ef(0xb2)+a150_0x16aaf1[_0x30f9ef(0x11c)](_0x30f9ef(0x121))),console[_0x30f9ef(0xb0)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a150_0x16aaf1['cyan'](_0x30f9ef(0xf2))+'\x20\x20'+a150_0x16aaf1['gray'](_0x30f9ef(0xbc)));console['log']('');}function execConfigMigration(_0x73c6a0,_0x30fc0d){const _0x55f0c1=a150_0xd3b0c,{configMigration:_0x128af0}=_0x73c6a0;if(!_0x128af0?.[_0x55f0c1(0x11a)])return{'step':0x1,'label':_0x55f0c1(0xf9),'ok':!![],'detail':_0x55f0c1(0xf3)};const _0x5e89fa=readConfigFile(_0x128af0[_0x55f0c1(0x11a)]),_0x2cfd46=resolve(_0x30fc0d,NEW_CONFIG_NAME),_0xe5a4cc=_0x128af0['hasNewConfig']?readConfigFile(_0x2cfd46):{};for(const [_0x3865bc,_0x30d8bb]of Object[_0x55f0c1(0xcf)](_0x5e89fa)){!(_0x3865bc in _0xe5a4cc)&&(_0xe5a4cc[_0x3865bc]=_0x30d8bb);}writeConfigFile(_0x2cfd46,_0xe5a4cc);const _0x632902=_0x128af0['oldPath']+_0x55f0c1(0x107);return renameSync(_0x128af0[_0x55f0c1(0x11a)],_0x632902),{'step':0x1,'label':_0x55f0c1(0xf9),'ok':!![],'detail':_0x128af0[_0x55f0c1(0x11a)]+_0x55f0c1(0xb2)+_0x2cfd46+_0x55f0c1(0xdc)+_0x632902+')'};}function execRemoveOldArtifacts(_0x37a112){const _0x4a68bf=a150_0xd3b0c,_0x509088=[];for(const _0x555e9f of _0x37a112){try{if(!existsSync(_0x555e9f))continue;const _0x427d32=tryStat(_0x555e9f);_0x427d32?.[_0x4a68bf(0xb9)]()?rmSync(_0x555e9f,{'recursive':!![],'force':!![]}):unlinkSync(_0x555e9f);}catch(_0x3b0f0c){_0x509088[_0x4a68bf(0xe7)](_0x555e9f+':\x20'+_0x3b0f0c[_0x4a68bf(0xe0)]);}}return{'step':0x3,'label':_0x4a68bf(0xfc),'ok':_0x509088[_0x4a68bf(0xf6)]===0x0,'detail':_0x509088['length']>0x0?_0x37a112[_0x4a68bf(0xf6)]-_0x509088[_0x4a68bf(0xf6)]+'/'+_0x37a112[_0x4a68bf(0xf6)]+_0x4a68bf(0xd9)+_0x509088[_0x4a68bf(0xe3)](';\x20')+')':_0x37a112[_0x4a68bf(0xf6)]+_0x4a68bf(0x10a)};}function execCleanMcp(_0x5d0cfe){const _0x98588a=a150_0xd3b0c;if(!_0x5d0cfe[_0x98588a(0xdb)])return{'step':0x4,'label':_0x98588a(0x109),'ok':!![],'detail':_0x98588a(0xed)};try{const _0x3fae10=readFileSync(_0x5d0cfe[_0x98588a(0xdb)][_0x98588a(0xc3)],_0x98588a(0xc8)),_0x4e4a12=JSON[_0x98588a(0xda)](_0x3fae10);if(_0x4e4a12?.['mcpServers']&&typeof _0x4e4a12[_0x98588a(0xfe)]===_0x98588a(0xd4)){const _0x5ccd0a=[];for(const [_0x291b99,_0x14aa4c]of Object['entries'](_0x4e4a12[_0x98588a(0xfe)])){_0x14aa4c?.[_0x98588a(0x122)]&&Array[_0x98588a(0xfd)](_0x14aa4c['args'])&&_0x14aa4c[_0x98588a(0x122)][_0x98588a(0xb3)](_0x5e9644=>typeof _0x5e9644===_0x98588a(0xd3)&&_0x5e9644[_0x98588a(0x117)](_0x98588a(0xce)))&&_0x5ccd0a['push'](_0x291b99);}for(const _0x2e97a6 of _0x5ccd0a){delete _0x4e4a12['mcpServers'][_0x2e97a6];}return _0x5ccd0a[_0x98588a(0xf6)]>0x0&&writeFileSync(_0x5d0cfe[_0x98588a(0xdb)][_0x98588a(0xc3)],JSON[_0x98588a(0xab)](_0x4e4a12,null,0x2)+'\x0a',_0x98588a(0xc8)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x98588a(0xd6)+_0x5ccd0a['join'](',\x20')+_0x98588a(0x10d)+_0x5d0cfe[_0x98588a(0xdb)][_0x98588a(0xc3)]};}return{'step':0x4,'label':_0x98588a(0x109),'ok':!![],'detail':_0x98588a(0xd8)};}catch(_0x4bb6a5){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x4bb6a5['message']};}}function execSkillsRemove(_0x55ec0f,_0x5b0179){const _0x292889=a150_0xd3b0c,_0x4f5de6=runNpxSkillsRemove(_0x55ec0f,{'stdio':_0x292889(0x108),'yes':_0x5b0179});return{'step':0x5,'label':_0x292889(0x113),'ok':_0x4f5de6['ok'],'detail':_0x4f5de6['ok']?'lovrabet/lovrabet-skill\x20removed':_0x4f5de6[_0x292889(0xba)]??_0x292889(0xe2)+_0x4f5de6['status']};}function execSkillsAdd(_0x59c9aa,_0x5103f2){const _0x1339ed=a150_0xd3b0c,_0x2c329a=runNpxSkillsAddGlobal(_0x59c9aa,_0x1339ed(0x124),{'stdio':_0x1339ed(0x108),'yes':_0x5103f2});return{'step':0x6,'label':_0x1339ed(0xfb),'ok':_0x2c329a['ok'],'detail':_0x2c329a['ok']?_0x1339ed(0xcd):_0x2c329a[_0x1339ed(0xba)]??_0x1339ed(0xe2)+_0x2c329a[_0x1339ed(0xa5)]};}function execUpgradeSdk(_0x12edb7){const _0xb935b=a150_0xd3b0c;if(!_0x12edb7['sdkUpgrade'])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x360f91,currentVersion:_0x4962b0,field:_0x24da13}=_0x12edb7[_0xb935b(0xcb)];try{const _0x2a3044=readFileSync(_0x360f91,_0xb935b(0xc8)),_0x43ec94=JSON['parse'](_0x2a3044);return _0x43ec94[_0x24da13]['@lovrabet/sdk']='latest',writeFileSync(_0x360f91,JSON[_0xb935b(0xab)](_0x43ec94,null,0x2)+'\x0a',_0xb935b(0xc8)),{'step':0x7,'label':_0xb935b(0xdf),'ok':!![],'detail':_0x24da13+_0xb935b(0x105)+_0x4962b0+_0xb935b(0xe6)};}catch(_0x481f2e){return{'step':0x7,'label':_0xb935b(0xdf),'ok':![],'detail':_0x481f2e[_0xb935b(0xe0)]};}}function tryStat(_0x4a1aef){try{return statSync(_0x4a1aef);}catch{return undefined;}}function printSummary(_0x53724d){const _0x32135e=a150_0xd3b0c;console[_0x32135e(0xb0)](''),console[_0x32135e(0xb0)](a150_0x16aaf1[_0x32135e(0x103)]('===\x20Upgrade\x20Summary\x20===')),console['log']('');for(const _0x40f4f6 of _0x53724d){const _0x47ac31=_0x40f4f6['ok']?a150_0x16aaf1[_0x32135e(0x11c)]('OK'):a150_0x16aaf1[_0x32135e(0xe1)](_0x32135e(0x112));console[_0x32135e(0xb0)]('\x20\x20'+_0x47ac31+_0x32135e(0xff)+_0x40f4f6[_0x32135e(0xc5)]+':\x20'+_0x40f4f6[_0x32135e(0x11b)]);if(_0x40f4f6[_0x32135e(0x102)])console[_0x32135e(0xb0)](_0x32135e(0xd0)+a150_0x16aaf1['gray'](_0x40f4f6['detail']));}console['log']('');}export async function upgradeApp(_0x4e7b67,_0x86249b){const _0xd4dfdd=a150_0xd3b0c,_0x5e697c=process[_0xd4dfdd(0xa3)](),_0x222fc0=analyse(_0x5e697c),_0x3e0ca1=!_0x222fc0['configMigration']&&_0x222fc0[_0xd4dfdd(0xe5)][_0xd4dfdd(0xf6)]===0x0&&!_0x222fc0[_0xd4dfdd(0xdb)]&&!_0x222fc0[_0xd4dfdd(0x10f)]&&!_0x222fc0['sdkUpgrade'];if(_0x3e0ca1){console[_0xd4dfdd(0xb0)](a150_0x16aaf1['green'](_0xd4dfdd(0xca)));return;}printReport(_0x222fc0);const _0x4ec699=!!(_0x86249b[_0xd4dfdd(0xeb)]||_0x86249b['Y']||_0x4e7b67);if(!_0x4ec699)try{const _0x1225b0=await askConfirm(_0xd4dfdd(0xfa));if(!_0x1225b0){console[_0xd4dfdd(0xb0)](a150_0x16aaf1[_0xd4dfdd(0xf7)]('Upgrade\x20cancelled.'));return;}}catch(_0x268ae0){if(_0x268ae0?.[_0xd4dfdd(0xe0)]==='CANCEL'){console[_0xd4dfdd(0xb0)](a150_0x16aaf1['gray'](_0xd4dfdd(0xc1)));return;}throw _0x268ae0;}const _0x520e35=[],_0x1e0bba=a150_0x591b83({'text':_0xd4dfdd(0xd5),'color':_0xd4dfdd(0xcc)})[_0xd4dfdd(0x10b)](),_0x29a63e=execConfigMigration(_0x222fc0,_0x5e697c);_0x520e35[_0xd4dfdd(0xe7)](_0x29a63e),_0x1e0bba[_0x29a63e['ok']?'succeed':'fail'](_0xd4dfdd(0xbd)+(_0x29a63e[_0xd4dfdd(0x102)]??(_0x29a63e['ok']?_0xd4dfdd(0xb7):_0xd4dfdd(0xa2))));const _0x28291=resolve(_0x5e697c,_0xd4dfdd(0x11e)),_0x53b948=a150_0x591b83({'text':_0xd4dfdd(0xd2),'color':_0xd4dfdd(0xcc)})[_0xd4dfdd(0x10b)]();if(existsSync(_0x28291))try{rmSync(_0x28291,{'recursive':!![],'force':!![]}),_0x53b948[_0xd4dfdd(0x11d)](_0xd4dfdd(0xec)),_0x520e35[_0xd4dfdd(0xe7)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x58a732){_0x53b948[_0xd4dfdd(0xdd)](_0xd4dfdd(0x123)+_0x58a732[_0xd4dfdd(0xe0)]),_0x520e35[_0xd4dfdd(0xe7)]({'step':0x2,'label':_0xd4dfdd(0xb1),'ok':![],'detail':_0x58a732[_0xd4dfdd(0xe0)]});}else _0x53b948[_0xd4dfdd(0xde)](_0xd4dfdd(0xc6)),_0x520e35[_0xd4dfdd(0xe7)]({'step':0x2,'label':_0xd4dfdd(0xb1),'ok':!![],'detail':_0xd4dfdd(0xed)});const _0x2eb6e2=a150_0x591b83({'text':_0xd4dfdd(0xb8),'color':_0xd4dfdd(0xcc)})[_0xd4dfdd(0x10b)](),_0x55574f=execRemoveOldArtifacts(_0x222fc0[_0xd4dfdd(0xe5)]);_0x520e35[_0xd4dfdd(0xe7)](_0x55574f),_0x2eb6e2[_0x55574f['ok']?_0xd4dfdd(0x11d):_0xd4dfdd(0xdd)](_0xd4dfdd(0xf5)+(_0x55574f[_0xd4dfdd(0x102)]??(_0x55574f['ok']?_0xd4dfdd(0xb7):_0xd4dfdd(0xa2))));const _0x5dc76c=a150_0x591b83({'text':_0xd4dfdd(0xee),'color':_0xd4dfdd(0xcc)})['start'](),_0x2339b2=execCleanMcp(_0x222fc0);_0x520e35['push'](_0x2339b2),_0x5dc76c[_0x2339b2['ok']?'succeed':_0xd4dfdd(0xdd)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x2339b2[_0xd4dfdd(0x102)]??(_0x2339b2['ok']?'done':'failed')));const _0x2ea40e=a150_0x591b83({'text':_0xd4dfdd(0xd1),'color':_0xd4dfdd(0xcc)})['start'](),_0x4af475=execSkillsRemove(_0x5e697c,_0x4ec699);_0x520e35['push'](_0x4af475),_0x2ea40e[_0x4af475['ok']?_0xd4dfdd(0x11d):'fail'](_0xd4dfdd(0xe9)+(_0x4af475[_0xd4dfdd(0x102)]??(_0x4af475['ok']?_0xd4dfdd(0xb7):'failed')));const _0x472192=a150_0x591b83({'text':_0xd4dfdd(0xc9),'color':_0xd4dfdd(0xcc)})[_0xd4dfdd(0x10b)](),_0xdd219b=execSkillsAdd(_0x5e697c,_0x4ec699);_0x520e35[_0xd4dfdd(0xe7)](_0xdd219b),_0x472192[_0xdd219b['ok']?_0xd4dfdd(0x11d):_0xd4dfdd(0xdd)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0xdd219b['detail']??(_0xdd219b['ok']?_0xd4dfdd(0xb7):_0xd4dfdd(0xa2))));const _0x5a5a66=a150_0x591b83({'text':_0xd4dfdd(0xb4),'color':_0xd4dfdd(0xcc)})['start'](),_0x201eb0=execUpgradeSdk(_0x222fc0);_0x520e35[_0xd4dfdd(0xe7)](_0x201eb0),_0x5a5a66[_0x201eb0['ok']?_0xd4dfdd(0x11d):_0xd4dfdd(0xdd)](_0xd4dfdd(0x106)+(_0x201eb0['detail']??(_0x201eb0['ok']?_0xd4dfdd(0xb7):_0xd4dfdd(0xa2)))),printSummary(_0x520e35);const _0xe6174d=_0x520e35[_0xd4dfdd(0xb3)](_0x4eebc9=>!_0x4eebc9['ok']);_0xe6174d?console['log'](a150_0x16aaf1[_0xd4dfdd(0xa4)](_0xd4dfdd(0xb5))):console[_0xd4dfdd(0xb0)](a150_0x16aaf1['green']('Upgrade\x20completed\x20successfully!')),_0x201eb0['ok']&&_0x222fc0[_0xd4dfdd(0xcb)]&&(console[_0xd4dfdd(0xb0)](''),console['log'](a150_0x16aaf1[_0xd4dfdd(0x103)][_0xd4dfdd(0xcc)](_0xd4dfdd(0xf8))),console[_0xd4dfdd(0xb0)](a150_0x16aaf1[_0xd4dfdd(0xcc)](_0xd4dfdd(0x111))),console[_0xd4dfdd(0xb0)](''),console[_0xd4dfdd(0xb0)](a150_0x16aaf1[_0xd4dfdd(0x116)]('\x20\x20npm\x20install')),console[_0xd4dfdd(0xb0)](a150_0x16aaf1[_0xd4dfdd(0x116)](_0xd4dfdd(0xa7))),console[_0xd4dfdd(0xb0)](a150_0x16aaf1[_0xd4dfdd(0x116)](_0xd4dfdd(0xbe))),console[_0xd4dfdd(0xb0)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x2ce3ba=a151_0x5e64;(function(_0x851201,_0x32c69c){const _0x454492=a151_0x5e64,_0x21c8b4=_0x851201();while(!![]){try{const _0x527419=-parseInt(_0x454492(0x1e7))/0x1*(parseInt(_0x454492(0x223))/0x2)+-parseInt(_0x454492(0x1fe))/0x3*(parseInt(_0x454492(0x225))/0x4)+parseInt(_0x454492(0x1eb))/0x5*(-parseInt(_0x454492(0x1e8))/0x6)+-parseInt(_0x454492(0x200))/0x7*(parseInt(_0x454492(0x202))/0x8)+-parseInt(_0x454492(0x209))/0x9+parseInt(_0x454492(0x21f))/0xa*(-parseInt(_0x454492(0x21d))/0xb)+-parseInt(_0x454492(0x1ea))/0xc*(-parseInt(_0x454492(0x220))/0xd);if(_0x527419===_0x32c69c)break;else _0x21c8b4['push'](_0x21c8b4['shift']());}catch(_0x55c688){_0x21c8b4['push'](_0x21c8b4['shift']());}}}(a151_0x2f47,0x527f5));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';function a151_0x5e64(_0x10cadf,_0x15f3e6){_0x10cadf=_0x10cadf-0x1e0;const _0x2f47dd=a151_0x2f47();let _0x5e6409=_0x2f47dd[_0x10cadf];return _0x5e6409;}import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{taskDefinitions}from'../commands/task/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';function a151_0x2f47(){const _0x2516ee=['Schema','skill','skills','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','Permissions','Project','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','Workspace','\x20\x20[write]','risk','Configuration','run','Notification\x20Configuration','push','`\x20has\x20been\x20removed.','2004673ltsHFN','isSingleCommand','30IGhaBG','2977091DmUgDG','BFF\x20Scripts','defaultCommand','57940mlAUnx','CLI\x20Built-in\x20Skill','4gukPfb','Instant\x20API','command','length','Run\x20any\x20package.json\x20script','Async\x20Tasks','API\x20Development','SQL\x20Queries','has','read','service','20TKJYOx','49386oopDJy','login','156arQfWe','235qYskOC','\x20\x20[high-risk-write]','App\x20Management','app\x20remote','Dataset\x20&\x20Operations','write','set','get','create','map','File','commands','wildcardDef','Code\x20Generation','Logs','Runtime\x20App\x20Config\x20Management','install','filter','<script>','2020191PHaImc','show','3206PpLAOk','skill\x20','7408eBvYRy','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','use','build','app','Self\x20Update','258219zkAMgu','project','Platform\x20Issue','Smart\x20List\x20Pages','description'];a151_0x2f47=function(){return _0x2516ee;};return a151_0x2f47();}import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3248d8){const _0x41c6cb=a151_0x5e64;for(const _0x1212b3 of _0x3248d8){definitions['set'](_0x1212b3['service']+':'+_0x1212b3[_0x41c6cb(0x227)],_0x1212b3);let _0x5eb6c1=serviceGroups['get'](_0x1212b3[_0x41c6cb(0x1e6)]);!_0x5eb6c1&&(_0x5eb6c1=[],serviceGroups[_0x41c6cb(0x1f1)](_0x1212b3[_0x41c6cb(0x1e6)],_0x5eb6c1)),_0x5eb6c1[_0x41c6cb(0x21b)](_0x1212b3);}}function registerDeclarativeService(_0x20a712,_0x726c4b,_0x386567){const _0x4de8b0=a151_0x5e64;registerDefinitions(_0x726c4b);_0x386567?.[_0x4de8b0(0x1f7)]&®isterDefinitions([_0x386567[_0x4de8b0(0x1f7)]]);const _0x470bce=_0x1ac6a1=>_0x1ac6a1===_0x4de8b0(0x1e5)?'':_0x1ac6a1===_0x4de8b0(0x1f0)?_0x4de8b0(0x216):_0x4de8b0(0x1ec),_0x42c3cb={'service':_0x726c4b[0x0][_0x4de8b0(0x1e6)],'label':_0x20a712,'commands':_0x726c4b[_0x4de8b0(0x1fc)](_0x281a6b=>!_0x281a6b['hidden'])[_0x4de8b0(0x1f4)](_0x199f62=>({'command':_0x199f62[_0x4de8b0(0x227)],'description':_0x199f62[_0x4de8b0(0x20d)],'tag':_0x470bce(_0x199f62[_0x4de8b0(0x217)])})),'declarative':!![],'defaultCommand':_0x386567?.[_0x4de8b0(0x222)]??(_0x386567?.[_0x4de8b0(0x21e)]?_0x726c4b[0x0]['command']:undefined),'wildcardDef':_0x386567?.[_0x4de8b0(0x1f7)],'isSingleCommand':_0x386567?.[_0x4de8b0(0x21e)]};serviceRegistry[_0x4de8b0(0x21b)](_0x42c3cb),serviceByName['set'](_0x42c3cb[_0x4de8b0(0x1e6)],_0x42c3cb);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a151_0x2ce3ba(0x219),'isSingleCommand':!![]}),registerDeclarativeService(a151_0x2ce3ba(0x213),projectDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x215),workspaceDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1ed),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a151_0x2ce3ba(0x1e9)}),registerDeclarativeService(a151_0x2ce3ba(0x1ef),datasetDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x20c),pageDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1e2),apiDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x226),dataDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x221),bffDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x21a),notificationDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1e3),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1e1),taskDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x212),permitDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1fa),appConfigDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x20b),issueDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1f5),fileDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x1f8),codegenDefinitions),registerDeclarativeService(a151_0x2ce3ba(0x218),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a151_0x2ce3ba(0x20e),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a151_0x2ce3ba(0x208),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a151_0x2ce3ba(0x224),cliSkillDefinitions,{'defaultCommand':a151_0x2ce3ba(0x1fb)}),registerDeclarativeService(a151_0x2ce3ba(0x1f9),logsDefinitions,{'defaultCommand':a151_0x2ce3ba(0x1ff)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a151_0x2ce3ba(0x228)]-0x1];last[a151_0x2ce3ba(0x1f6)]=[{'command':a151_0x2ce3ba(0x1fd),'description':a151_0x2ce3ba(0x1e0),'tag':''}];}export const deprecatedAliases={'create':{'service':a151_0x2ce3ba(0x20a),'command':a151_0x2ce3ba(0x1f3)},'start':{'service':a151_0x2ce3ba(0x219),'command':'start'},'build':{'service':a151_0x2ce3ba(0x219),'command':a151_0x2ce3ba(0x206)},'preview':{'service':a151_0x2ce3ba(0x219),'command':'preview'},'logout':{'service':'auth','command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a151_0x2ce3ba(0x203),APP_REMOTE_REMOVED_HINT=a151_0x2ce3ba(0x204),APP_USE_REMOVED_HINT=a151_0x2ce3ba(0x211);export function resolveRemovedCommand(_0x5bfd37,_0x603a96){const _0x2f49c0=a151_0x2ce3ba;if(_0x5bfd37==='skill'){const _0x29e955=_0x603a96?_0x2f49c0(0x201)+_0x603a96:_0x2f49c0(0x20f);return{'command':_0x29e955,'message':'`rabetbase\x20'+_0x29e955+_0x2f49c0(0x21c),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x5bfd37===_0x2f49c0(0x210))return{'command':'skills','message':'`rabetbase\x20skills`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x5bfd37===_0x2f49c0(0x207)&&_0x603a96==='remote')return{'command':_0x2f49c0(0x1ee),'message':_0x2f49c0(0x214),'hint':APP_REMOTE_REMOVED_HINT};if(_0x5bfd37===_0x2f49c0(0x207)&&_0x603a96===_0x2f49c0(0x205))return{'command':'app\x20use','message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a151_0x2ce3ba(0x1f3)},'sql':{'new':a151_0x2ce3ba(0x1f3)}};export function resolveDeprecatedSubcommand(_0x5afa23,_0x95c494){return deprecatedSubcommands[_0x5afa23]?.[_0x95c494];}export function findDefinition(_0x39ac45,_0x2a5258){const _0x250c12=a151_0x2ce3ba;return definitions[_0x250c12(0x1f2)](_0x39ac45+':'+_0x2a5258);}export function isKnownService(_0x26ffcf){const _0x396a92=a151_0x2ce3ba;return serviceByName[_0x396a92(0x1e4)](_0x26ffcf);}export function isDeclarativeService(_0xdff823){const _0x54be55=a151_0x2ce3ba;return serviceGroups[_0x54be55(0x1e4)](_0xdff823)||serviceByName['get'](_0xdff823)?.[_0x54be55(0x1f7)]!==undefined;}export function getServiceEntry(_0x550b2b){const _0x32dc26=a151_0x2ce3ba;return serviceByName[_0x32dc26(0x1f2)](_0x550b2b);}export function getLegacyHandler(_0x394387,_0x18c0d0){return undefined;}export function getAllDefinitions(){return Array['from'](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a152_0xc23fe=a152_0x2d3f;function a152_0x182f(){const _0x102039=['trim','Created\x20role\x20','str','1030059ybePhs','22786ZewWql','role','remark','6ZQNZLg','appCode','create','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','CUSTOM','9055850MjiWRT','name','\x20(id=','/smartapi/permit/role/create','roleName','2239925ddjwsw','flagMissing','validation','7474124lQZCVw','POST','219ERwLwZ','Pass\x20--name\x20<roleName>.','72kyFiKq','842781NYYfJm','write','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','1194688vEvyDE'];a152_0x182f=function(){return _0x102039;};return a152_0x182f();}(function(_0x3305f5,_0x408302){const _0x27a34d=a152_0x2d3f,_0x19f7e4=_0x3305f5();while(!![]){try{const _0x41941c=-parseInt(_0x27a34d(0xeb))/0x1+parseInt(_0x27a34d(0xd6))/0x2*(-parseInt(_0x27a34d(0xe8))/0x3)+-parseInt(_0x27a34d(0xee))/0x4+parseInt(_0x27a34d(0xe3))/0x5*(-parseInt(_0x27a34d(0xd9))/0x6)+parseInt(_0x27a34d(0xe6))/0x7+-parseInt(_0x27a34d(0xea))/0x8*(-parseInt(_0x27a34d(0xd5))/0x9)+parseInt(_0x27a34d(0xde))/0xa;if(_0x41941c===_0x408302)break;else _0x19f7e4['push'](_0x19f7e4['shift']());}catch(_0x433ac7){_0x19f7e4['push'](_0x19f7e4['shift']());}}}(a152_0x182f,0x8e269));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a152_0x2d3f(_0x4948e3,_0x6e05f6){_0x4948e3=_0x4948e3-0xd2;const _0x182f06=a152_0x182f();let _0x2d3ff4=_0x182f06[_0x4948e3];return _0x2d3ff4;}import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a152_0xc23fe(0xe1);function readName(_0x3f32be){const _0x365ed7=a152_0xc23fe,_0x7d4782=_0x3f32be[_0x365ed7(0xd4)](_0x365ed7(0xdf))[_0x365ed7(0xd2)]();if(!_0x7d4782)throw CliErrors[_0x365ed7(0xe4)](_0x365ed7(0xdf),_0x365ed7(0xe9));if(_0x7d4782['length']>0x40)throw CliErrors[_0x365ed7(0xe5)](_0x365ed7(0xdc));return _0x7d4782;}export const roleCreate={'service':a152_0xc23fe(0xd7),'command':a152_0xc23fe(0xdb),'description':a152_0xc23fe(0xed),'risk':a152_0xc23fe(0xec),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2cb53a){readName(_0x2cb53a);},async 'dryRun'(_0x5e7e28){const _0x517ea6=a152_0xc23fe,_0x260095=readName(_0x5e7e28),_0x3ad8d8=_0x5e7e28[_0x517ea6(0xd4)](_0x517ea6(0xd8))[_0x517ea6(0xd2)]()||undefined;return asDryRunResult({'operation':_0x517ea6(0xdb),'selector':{'appCode':_0x5e7e28[_0x517ea6(0xda)],'roleName':_0x260095},'before':null,'after':{'roleName':_0x260095,'roleType':_0x517ea6(0xdd),'remark':_0x3ad8d8},'dryRun':!![],'backend':{'method':_0x517ea6(0xe7),'path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x913f67){const _0x29b41b=a152_0xc23fe,_0x268750=readName(_0x913f67),_0x35652e=_0x913f67['str']('remark')['trim']()||undefined,_0x365f9c=await createAppRole({'appCode':_0x913f67[_0x29b41b(0xda)],'roleName':_0x268750,..._0x35652e?{'remark':_0x35652e}:{}});return{'ok':!![],'data':{'operation':_0x29b41b(0xdb),'selector':{'appCode':_0x913f67[_0x29b41b(0xda)],'roleId':_0x365f9c['id'],'roleName':_0x268750},'before':null,'after':projectRole(_0x365f9c),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},'message':_0x29b41b(0xd3)+_0x365f9c[_0x29b41b(0xe2)]+_0x29b41b(0xe0)+_0x365f9c['id']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a153_0x16da2b=a153_0x4741;(function(_0x33d244,_0x4e1287){const _0x1aaffa=a153_0x4741,_0x177e02=_0x33d244();while(!![]){try{const _0x15cb89=-parseInt(_0x1aaffa(0x88))/0x1+parseInt(_0x1aaffa(0x8e))/0x2+parseInt(_0x1aaffa(0x87))/0x3*(-parseInt(_0x1aaffa(0x97))/0x4)+-parseInt(_0x1aaffa(0x94))/0x5*(parseInt(_0x1aaffa(0x8a))/0x6)+-parseInt(_0x1aaffa(0x83))/0x7+-parseInt(_0x1aaffa(0x8b))/0x8*(-parseInt(_0x1aaffa(0x86))/0x9)+parseInt(_0x1aaffa(0x91))/0xa*(parseInt(_0x1aaffa(0x8c))/0xb);if(_0x15cb89===_0x4e1287)break;else _0x177e02['push'](_0x177e02['shift']());}catch(_0x1b4020){_0x177e02['push'](_0x177e02['shift']());}}}(a153_0x6883,0x33235));import{deleteAppRole}from'../../core/api-client.js';function a153_0x4741(_0x1dafe8,_0x6b91b1){_0x1dafe8=_0x1dafe8-0x80;const _0x68832e=a153_0x6883();let _0x4741e1=_0x68832e[_0x1dafe8];return _0x4741e1;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a153_0x16da2b(0x90);export const roleDelete={'service':a153_0x16da2b(0x96),'command':a153_0x16da2b(0x8d),'description':a153_0x16da2b(0x89),'risk':a153_0x16da2b(0x95),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2d6a17){const _0xa650b2=a153_0x16da2b,_0x3b7b16=_0x2d6a17[_0xa650b2(0x85)]('id'),_0xd6d07d=await getRoleById(_0x2d6a17['appCode'],_0x3b7b16);return assertCustomRole(_0xd6d07d,_0xa650b2(0x8d)),asDryRunResult({'operation':_0xa650b2(0x8d),'selector':{'appCode':_0x2d6a17[_0xa650b2(0x82)],'roleId':_0x3b7b16,'roleName':_0xd6d07d['roleName']},'before':projectRole(_0xd6d07d),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0xd6d07d[_0xa650b2(0x84)]>0x0?[_0xa650b2(0x92)+_0xd6d07d[_0xa650b2(0x84)]+_0xa650b2(0x81)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0xdff810){const _0x4e1674=a153_0x16da2b,_0x2642ad=_0xdff810['num']('id'),_0x45700f=await getRoleById(_0xdff810['appCode'],_0x2642ad);return assertCustomRole(_0x45700f,_0x4e1674(0x8d)),await deleteAppRole(_0x2642ad),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0xdff810[_0x4e1674(0x82)],'roleId':_0x2642ad,'roleName':_0x45700f[_0x4e1674(0x80)]},'before':projectRole(_0x45700f),'after':null,'dryRun':![],'backend':{'method':_0x4e1674(0x98),'path':DELETE_PATH},'warnings':[]},'message':_0x4e1674(0x8f)+_0x45700f['roleName']+_0x4e1674(0x93)+_0x2642ad+')'};}};function a153_0x6883(){const _0x2e0a24=['145242iaxKud','248AGYucH','253cbcVQa','delete','680186KdJhNS','Deleted\x20role\x20','/smartapi/permit/role/delete','152110viBJnr','Role\x20still\x20has\x20','\x20(id=','40OQpDtm','high-risk-write','role','40cQpXYa','POST','roleName','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','appCode','514731stpdJR','userCount','num','8316mGJfLy','46830qVyBZa','85840okVtxa','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes'];a153_0x6883=function(){return _0x2e0a24;};return a153_0x6883();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a154_0x38d39e=a154_0x4a80;(function(_0x3db55c,_0x108e52){const _0x2ad58d=a154_0x4a80,_0x1f3cd6=_0x3db55c();while(!![]){try{const _0x40e6b0=-parseInt(_0x2ad58d(0x88))/0x1+-parseInt(_0x2ad58d(0x8b))/0x2*(parseInt(_0x2ad58d(0x8a))/0x3)+-parseInt(_0x2ad58d(0x87))/0x4+-parseInt(_0x2ad58d(0x89))/0x5*(parseInt(_0x2ad58d(0x85))/0x6)+parseInt(_0x2ad58d(0x90))/0x7+parseInt(_0x2ad58d(0x91))/0x8*(parseInt(_0x2ad58d(0x86))/0x9)+parseInt(_0x2ad58d(0x8e))/0xa;if(_0x40e6b0===_0x108e52)break;else _0x1f3cd6['push'](_0x1f3cd6['shift']());}catch(_0x45cac8){_0x1f3cd6['push'](_0x1f3cd6['shift']());}}}(a154_0x2c22,0x4e6a1));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a154_0x4a80(_0x421438,_0x26aee2){_0x421438=_0x421438-0x83;const _0x2c223c=a154_0x2c22();let _0x4a8055=_0x2c223c[_0x421438];return _0x4a8055;}function a154_0x2c22(){const _0x496123=['role','821334TCXZYE','16596zgqiIH','1168804HybiKV','185446JSDTMS','20nyYYyR','256833HdwJPZ','6wKLyuB','Show\x20a\x20single\x20role\x27s\x20detail','detail','8239260BUThFb','roleType','1569757JQzpsZ','2408RPQwXU','read','roleName'];a154_0x2c22=function(){return _0x496123;};return a154_0x2c22();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a154_0x38d39e(0x84),'command':a154_0x38d39e(0x8d),'description':a154_0x38d39e(0x8c),'risk':a154_0x38d39e(0x92),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3bf319){const _0x15d194=a154_0x38d39e,_0x237acc=_0x3bf319['num']('id'),_0x51b70e=await getRoleById(_0x3bf319['appCode'],_0x237acc);return{'ok':!![],'data':{'role':projectRole(_0x51b70e)},'message':'Role\x20'+_0x51b70e[_0x15d194(0x83)]+'\x20('+_0x51b70e[_0x15d194(0x8f)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5cae77,_0x2f2113){const _0x1c6578=a155_0x88d8,_0x539608=_0x5cae77();while(!![]){try{const _0x57bcea=parseInt(_0x1c6578(0x1c2))/0x1+parseInt(_0x1c6578(0x1c6))/0x2*(parseInt(_0x1c6578(0x1c3))/0x3)+-parseInt(_0x1c6578(0x1c8))/0x4+-parseInt(_0x1c6578(0x1ca))/0x5*(parseInt(_0x1c6578(0x1c7))/0x6)+parseInt(_0x1c6578(0x1c5))/0x7*(parseInt(_0x1c6578(0x1c4))/0x8)+-parseInt(_0x1c6578(0x1cb))/0x9+parseInt(_0x1c6578(0x1c9))/0xa;if(_0x57bcea===_0x2f2113)break;else _0x539608['push'](_0x539608['shift']());}catch(_0xa6ae36){_0x539608['push'](_0x539608['shift']());}}}(a155_0x1765,0x9a7b4));import{roleList}from'../../commands/role/list.js';function a155_0x88d8(_0x215fca,_0x2284a3){_0x215fca=_0x215fca-0x1c2;const _0x176544=a155_0x1765();let _0x88d8e4=_0x176544[_0x215fca];return _0x88d8e4;}import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a155_0x1765(){const _0x2dd5c3=['3905448hSZNHb','14hyZtKL','2kqaUOS','24LhSBqh','4605252MtpEsY','7138920aXiTBX','1088440jfSGrQ','2880063IgtnFE','822035xBNILs','1387617byHMWn'];a155_0x1765=function(){return _0x2dd5c3;};return a155_0x1765();}import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a156_0x491182=a156_0xff1a;(function(_0x5e6102,_0x42f89f){const _0x10c9c3=a156_0xff1a,_0x3e7620=_0x5e6102();while(!![]){try{const _0x27648d=-parseInt(_0x10c9c3(0x184))/0x1+parseInt(_0x10c9c3(0x180))/0x2*(parseInt(_0x10c9c3(0x183))/0x3)+parseInt(_0x10c9c3(0x18d))/0x4+parseInt(_0x10c9c3(0x18c))/0x5*(parseInt(_0x10c9c3(0x173))/0x6)+-parseInt(_0x10c9c3(0x179))/0x7*(parseInt(_0x10c9c3(0x170))/0x8)+-parseInt(_0x10c9c3(0x17b))/0x9+parseInt(_0x10c9c3(0x185))/0xa*(-parseInt(_0x10c9c3(0x182))/0xb);if(_0x27648d===_0x42f89f)break;else _0x3e7620['push'](_0x3e7620['shift']());}catch(_0x549d90){_0x3e7620['push'](_0x3e7620['shift']());}}}(a156_0x29af,0x31f4c));function a156_0xff1a(_0x283f5a,_0x1f22b5){_0x283f5a=_0x283f5a-0x170;const _0x29af6a=a156_0x29af();let _0xff1a65=_0x29af6a[_0x283f5a];return _0xff1a65;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a156_0x491182(0x174),a156_0x491182(0x177),a156_0x491182(0x18b),a156_0x491182(0x18a)];export const roleList={'service':a156_0x491182(0x18e),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a156_0x491182(0x17e),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a156_0x491182(0x181),'type':a156_0x491182(0x186),'required':![],'description':a156_0x491182(0x187),'enum':ROLE_TYPES},{'name':a156_0x491182(0x188),'type':a156_0x491182(0x17a),'description':a156_0x491182(0x189),'default':0x1},{'name':a156_0x491182(0x178),'type':a156_0x491182(0x17a),'description':a156_0x491182(0x191),'default':0x64}],async 'validate'(_0x9aa01b){const _0x12dbe2=a156_0x491182,_0xd23da9=_0x9aa01b['str'](_0x12dbe2(0x181))[_0x12dbe2(0x175)]();if(_0xd23da9&&!ROLE_TYPES['includes'](_0xd23da9[_0x12dbe2(0x172)]()))throw CliErrors['validation']('Invalid\x20--type\x20\x22'+_0xd23da9+'\x22.',_0x12dbe2(0x195)+ROLE_TYPES['join'](',\x20')+'.');const _0x6a2110=_0x9aa01b[_0x12dbe2(0x18f)]('page',0x1),_0x4fb863=_0x9aa01b[_0x12dbe2(0x18f)](_0x12dbe2(0x178),0x64);if(_0x6a2110<0x1)throw CliErrors[_0x12dbe2(0x193)](_0x12dbe2(0x17d));if(_0x4fb863<0x1||_0x4fb863>0x64)throw CliErrors[_0x12dbe2(0x193)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x29e345){const _0x21e2de=a156_0x491182,_0x271440=_0x29e345[_0x21e2de(0x18f)](_0x21e2de(0x188),0x1)||0x1,_0xda5d52=_0x29e345[_0x21e2de(0x18f)](_0x21e2de(0x178),0x64)||0x64,_0xe1b9b0=_0x29e345['str']('type')[_0x21e2de(0x175)]()['toUpperCase'](),{items:_0x3bec4d,paging:_0x1b47c8}=await listAppRoles(_0x29e345[_0x21e2de(0x194)],{'currentPage':_0x271440,'pageSize':_0xda5d52}),_0x89a639=_0xe1b9b0?_0x3bec4d[_0x21e2de(0x190)](_0x4f4047=>_0x4f4047[_0x21e2de(0x192)]===_0xe1b9b0):_0x3bec4d,_0x3d806e=_0x89a639[_0x21e2de(0x176)](projectRole);return{'ok':!![],'data':{'roles':_0x3d806e,'paging':_0x1b47c8},'message':_0x21e2de(0x17c)+_0x3d806e[_0x21e2de(0x17f)]+_0x21e2de(0x171)};}};function a156_0x29af(){const _0x985816=['242856kvjSSt','20zmVafb','string','Filter\x20by\x20role\x20type','page','Page\x20index\x20(1-based)','CUSTOM','USER','9915phxBJK','1570208KihsqY','role','num','filter','Page\x20size\x20(1-100)','roleType','validation','appCode','Use\x20one\x20of:\x20','97840wKfqws','\x20role(s)','toUpperCase','1020eNBFrV','ADMIN','trim','map','DEV','pagesize','7HzDfMk','number','1705689qyTRyH','Found\x20','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','read','length','286dPDXlS','type','2651671bDdymM','8427lokrrm'];a156_0x29af=function(){return _0x985816;};return a156_0x29af();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a149_0x56823e=a149_0x5cb9;(function(_0x32ac1f,_0xdfd960){const _0x3ebbf6=a149_0x5cb9,_0x9b8e12=_0x32ac1f();while(!![]){try{const _0x1d31a3=parseInt(_0x3ebbf6(0xbb))/0x1+parseInt(_0x3ebbf6(0x87))/0x2+-parseInt(_0x3ebbf6(0xc2))/0x3*(-parseInt(_0x3ebbf6(0xbe))/0x4)+-parseInt(_0x3ebbf6(0x83))/0x5+parseInt(_0x3ebbf6(0x8c))/0x6*(parseInt(_0x3ebbf6(0x9a))/0x7)+parseInt(_0x3ebbf6(0xb0))/0x8+-parseInt(_0x3ebbf6(0xa4))/0x9*(parseInt(_0x3ebbf6(0xa3))/0xa);if(_0x1d31a3===_0xdfd960)break;else _0x9b8e12['push'](_0x9b8e12['shift']());}catch(_0x5ead9e){_0x9b8e12['push'](_0x9b8e12['shift']());}}}(a149_0x43b7,0x32f6f));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a149_0x43b7(){const _0x3db659=['role','ADMIN','No\x20tenant\x20member\x20matches\x20\x22','flagMissing','nickname','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userList','Optional\x20role\x20remark/description','2038168DkJaXy','filter','Multiple\x20tenant\x20members\x20match\x20\x22','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','tenant','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20',';\x20no\x20change.','Cannot\x20','tenant_code','roleName','Role\x20name\x20\x22','405680ohasVj','\x20member(s)\x20but\x20role\x20has\x20','length','292156GStKhi','trim','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Missing\x20user\x20reference.','3Scoaab','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','totalCount','\x22\x20not\x20found\x20in\x20app\x20','Pass\x20--role\x20<id|name>.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','map','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','dryRun','str','validation','User\x20','userId','appCode','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','toLowerCase','Disambiguate\x20with\x20--role\x20<id>.','857310mHLvxg','find','username','number','233692NHSCaX','string','Missing\x20role\x20reference.','Role\x20name','remark','18744RAoYHI','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','DEV','CUSTOM','\x20is\x20not\x20a\x20member\x20of\x20role\x20','splice','Disambiguate\x20with\x20--user\x20<id>.','permitCount','user','includes','push','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','expect-user-count','91BtOUjD','test','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','join','name','user-add','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20not\x20found\x20in\x20app\x20','findIndex','12930sTUIta','3555yMEDdn','Role\x20id\x20','flag','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.'];a149_0x43b7=function(){return _0x3db659;};return a149_0x43b7();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a149_0x56823e(0x86),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a149_0x56823e(0xa8),'type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0xc4)};export const USER_REF_FLAG={'name':a149_0x56823e(0x95),'type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0xc8)};export const NAME_FLAG={'name':a149_0x56823e(0x9e),'type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0x8a)};export const USER_NAME_FLAG={'name':'name','type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0xa0)};function a149_0x5cb9(_0x5899be,_0x3682bb){_0x5899be=_0x5899be-0x76;const _0x43b77d=a149_0x43b7();let _0x5cb92e=_0x43b77d[_0x5899be];return _0x5cb92e;}export const REMARK_FLAG={'name':a149_0x56823e(0x8b),'type':'string','required':![],'description':a149_0x56823e(0xaf)};export const EXPECT_USER_COUNT_FLAG={'name':a149_0x56823e(0x99),'type':a149_0x56823e(0x86),'required':![],'description':a149_0x56823e(0x9c)};export const BUILTIN_ROLE_TYPES=[a149_0x56823e(0xa9),a149_0x56823e(0x8f),'USER'];export function isBuiltinRole(_0x914228){const _0x106040=a149_0x56823e;return BUILTIN_ROLE_TYPES[_0x106040(0x96)](_0x914228);}export function assertCustomRole(_0x5d1f48,_0x2aba0e){const _0x4681c3=a149_0x56823e;if(_0x5d1f48[_0x4681c3(0x8d)]!==_0x4681c3(0x90))throw CliErrors[_0x4681c3(0x7c)](_0x4681c3(0xb7)+_0x2aba0e+'\x20built-in\x20role\x20'+_0x5d1f48[_0x4681c3(0xb9)]+'\x20('+_0x5d1f48[_0x4681c3(0x8d)]+').',_0x4681c3(0xb3));}export function assertPermConfigurable(_0x454337){const _0x50f89a=a149_0x56823e;if(_0x454337[_0x50f89a(0x8d)]==='DEV'||_0x454337['roleType']===_0x50f89a(0xa9))throw CliErrors[_0x50f89a(0x7c)](_0x50f89a(0xb5)+_0x454337[_0x50f89a(0xb9)]+'\x20('+_0x454337['roleType']+').',_0x50f89a(0x80));}export function projectRole(_0x58c4f5){const _0x8d67aa=a149_0x56823e;return{'id':_0x58c4f5['id'],'roleName':_0x58c4f5[_0x8d67aa(0xb9)],'roleType':_0x58c4f5[_0x8d67aa(0x8d)],'remark':_0x58c4f5[_0x8d67aa(0x8b)],'userCount':_0x58c4f5['userCount'],'permitCount':_0x58c4f5[_0x8d67aa(0x94)],'builtin':isBuiltinRole(_0x58c4f5['roleType'])};}export async function resolveRoleRef(_0x50c435,_0x29b4ab){const _0x1b2be5=a149_0x56823e,_0x5d75b0=_0x29b4ab['trim']();if(!_0x5d75b0)throw CliErrors['validation'](_0x1b2be5(0x89),_0x1b2be5(0xc7));if(/^\d+$/[_0x1b2be5(0x9b)](_0x5d75b0))return getRoleById(_0x50c435,Number(_0x5d75b0));const _0x7fc139=await listAllAppRoles(_0x50c435),_0x204c9d=_0x7fc139[_0x1b2be5(0xb1)](_0x3c9c12=>_0x3c9c12['roleName']===_0x5d75b0);if(_0x204c9d['length']===0x0)throw CliErrors[_0x1b2be5(0x7c)](_0x1b2be5(0xba)+_0x5d75b0+_0x1b2be5(0xc6)+_0x50c435+'.',_0x1b2be5(0xc0));if(_0x204c9d[_0x1b2be5(0xbd)]>0x1){const _0x3dd51d=_0x204c9d[_0x1b2be5(0x77)](_0x52f090=>_0x52f090['id'])[_0x1b2be5(0x9d)](',\x20');throw CliErrors[_0x1b2be5(0x7c)]('Role\x20name\x20\x22'+_0x5d75b0+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x3dd51d+').',_0x1b2be5(0x82));}return _0x204c9d[0x0];}export async function getRoleById(_0x2ce308,_0xa2fc15){const _0x377ace=a149_0x56823e,_0x4f4be2=await getAppRole(_0xa2fc15);if(!_0x4f4be2)throw CliErrors[_0x377ace(0x7c)]('Role\x20id\x20'+_0xa2fc15+_0x377ace(0xa1)+_0x2ce308+'.',_0x377ace(0xc3));return _0x4f4be2;}async function listAllAppRoles(_0x371ba4){const _0x446953=a149_0x56823e,_0xb2fcb2=0x64,_0x5a9bd9=[];for(let _0x15dee6=0x1;;_0x15dee6+=0x1){const {items:_0x1c57da,paging:_0x38708c}=await listAppRoles(_0x371ba4,{'currentPage':_0x15dee6,'pageSize':_0xb2fcb2});_0x5a9bd9[_0x446953(0x97)](..._0x1c57da);if(_0x1c57da['length']<_0xb2fcb2||_0x38708c&&_0x5a9bd9[_0x446953(0xbd)]>=_0x38708c[_0x446953(0xc5)])return _0x5a9bd9;}}export async function resolveTenantCode(){const _0x1ff7e6=a149_0x56823e,_0x2bc483=await getSessionUserInfo(),_0x2f3d64=_0x2bc483?.[_0x1ff7e6(0x95)]?.[_0x1ff7e6(0xb4)]?.[_0x1ff7e6(0xb8)];if(!_0x2f3d64)throw CliErrors['authRequired'](_0x1ff7e6(0xad));return _0x2f3d64;}function matchMember(_0x522478,_0x25ee4e){const _0x5d90fd=a149_0x56823e,_0x51d4aa=_0x25ee4e[_0x5d90fd(0xbf)]()[_0x5d90fd(0x81)]();return(_0x522478[_0x5d90fd(0xac)]??'')[_0x5d90fd(0x81)]()===_0x51d4aa||(_0x522478['username']??'')['toLowerCase']()===_0x51d4aa;}export async function resolveUserRef(_0x72acea){const _0x567835=a149_0x56823e,_0x370d88=_0x72acea['trim']();if(!_0x370d88)throw CliErrors['validation'](_0x567835(0xc1),_0x567835(0x79));const _0x3a6a47=await resolveTenantCode(),_0x158cf7=await getTenantMembers(_0x3a6a47);if(/^\d+$/[_0x567835(0x9b)](_0x370d88)){const _0xa24d91=Number(_0x370d88),_0x3e6551=_0x158cf7[_0x567835(0x84)](_0x58a000=>_0x58a000[_0x567835(0x7e)]===_0xa24d91);return{'userId':_0xa24d91,'username':_0x3e6551?.[_0x567835(0x85)]??String(_0xa24d91),'nickname':_0x3e6551?.[_0x567835(0xac)],'matchedBy':'id'};}const _0x46c178=_0x158cf7[_0x567835(0xb1)](_0x233b05=>matchMember(_0x233b05,_0x370d88));if(_0x46c178[_0x567835(0xbd)]===0x0)throw CliErrors[_0x567835(0x7c)](_0x567835(0xaa)+_0x370d88+'\x22.',_0x567835(0x98));if(_0x46c178[_0x567835(0xbd)]>0x1){const _0x3e63f3=_0x46c178['map'](_0xeca1f5=>(_0xeca1f5[_0x567835(0xac)]??_0xeca1f5[_0x567835(0x85)]??'?')+'('+_0xeca1f5['userId']+')')[_0x567835(0x9d)](',\x20');throw CliErrors[_0x567835(0x7c)](_0x567835(0xb2)+_0x370d88+'\x22:\x20'+_0x3e63f3+'.',_0x567835(0x93));}const _0x525553=_0x46c178[0x0];return{'userId':_0x525553[_0x567835(0x7e)],'username':_0x525553[_0x567835(0x85)]??String(_0x525553[_0x567835(0x7e)]),'nickname':_0x525553['nickname'],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x1b2ad6){const _0x29f3d3=a149_0x56823e;return(_0x1b2ad6?.[_0x29f3d3(0xae)]??[])[_0x29f3d3(0x77)](_0x3930f1=>_0x3930f1[_0x29f3d3(0x7e)]);}export function computeRoleUserMutation(_0x3c5c0c){const _0x4586c5=a149_0x56823e,{operation:_0x15fa89,appCode:_0x1bbf0a,roleUsers:_0x2b9f7c,targetRoleId:_0x21a8ed,user:_0x480f00}=_0x3c5c0c,_0x2b1f59=_0x2b9f7c['find'](_0x48970a=>_0x48970a['id']===_0x21a8ed);if(!_0x2b1f59)throw CliErrors[_0x4586c5(0x7c)](_0x4586c5(0xa5)+_0x21a8ed+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x4586c5(0xc3));const _0x1a993d=userIdsOf(_0x2b1f59),_0x43d09e=[];if(_0x3c5c0c[_0x4586c5(0x76)]!==undefined&&_0x3c5c0c['expectUserCount']!==_0x1a993d[_0x4586c5(0xbd)])throw CliErrors[_0x4586c5(0x7c)](_0x4586c5(0x8e)+_0x3c5c0c['expectUserCount']+_0x4586c5(0xbc)+_0x1a993d['length']+'.',_0x4586c5(0xa7));const _0x5a02ce=_0x1a993d[_0x4586c5(0x96)](_0x480f00[_0x4586c5(0x7e)]);let _0x7912ed=![];const _0x36214d=[..._0x2b1f59[_0x4586c5(0xae)]];if(_0x15fa89===_0x4586c5(0x9f))_0x5a02ce?_0x43d09e[_0x4586c5(0x97)](_0x4586c5(0x7d)+_0x480f00[_0x4586c5(0x7e)]+_0x4586c5(0x78)+_0x2b1f59[_0x4586c5(0xb9)]+';\x20no\x20change.'):(_0x36214d[_0x4586c5(0x97)]({'userId':_0x480f00[_0x4586c5(0x7e)],'username':_0x480f00[_0x4586c5(0x85)],..._0x480f00[_0x4586c5(0xac)]?{'nickname':_0x480f00[_0x4586c5(0xac)]}:{}}),_0x7912ed=!![]);else{if(!_0x5a02ce)_0x43d09e[_0x4586c5(0x97)](_0x4586c5(0x7d)+_0x480f00[_0x4586c5(0x7e)]+_0x4586c5(0x91)+_0x2b1f59[_0x4586c5(0xb9)]+_0x4586c5(0xb6));else{const _0x4fe55b=_0x36214d[_0x4586c5(0xa2)](_0x27cb05=>_0x27cb05['userId']===_0x480f00[_0x4586c5(0x7e)]);if(_0x4fe55b>=0x0)_0x36214d[_0x4586c5(0x92)](_0x4fe55b,0x1);_0x7912ed=!![];}}const _0x2793bd=_0x2b9f7c[_0x4586c5(0x77)](_0x19fac0=>_0x19fac0['id']===_0x21a8ed?{..._0x19fac0,'userList':_0x36214d}:_0x19fac0),_0x633a8c=_0x36214d[_0x4586c5(0x77)](_0x1c72e8=>_0x1c72e8[_0x4586c5(0x7e)]),_0x492648={'operation':_0x15fa89,'selector':{'appCode':_0x1bbf0a,'roleId':_0x21a8ed,'roleName':_0x2b1f59['roleName'],'userId':_0x480f00[_0x4586c5(0x7e)]},'before':{'userIds':_0x1a993d},'after':{'userIds':_0x633a8c},'dryRun':_0x3c5c0c[_0x4586c5(0x7a)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x43d09e};return{'roleList':_0x2793bd,'mutation':_0x492648,'changed':_0x7912ed};}export async function loadRoleUsers(_0x1916ff){return listRoleUsers(_0x1916ff);}export function readRoleRef(_0x553a3c){const _0x54dbdc=a149_0x56823e,_0x5a3b35=_0x553a3c[_0x54dbdc(0x7b)](_0x54dbdc(0xa8))[_0x54dbdc(0xbf)]();if(!_0x5a3b35)throw CliErrors[_0x54dbdc(0xab)](_0x54dbdc(0xa8),_0x54dbdc(0xc7));return _0x5a3b35;}export async function prepareUserMutation(_0x290216,_0x33241c,_0x4f6624){const _0x5f2677=a149_0x56823e,_0x59b876=readRoleRef(_0x290216),_0x52d6d3=_0x290216[_0x5f2677(0x7b)](_0x5f2677(0x95))[_0x5f2677(0xbf)]();if(!_0x52d6d3)throw CliErrors[_0x5f2677(0xab)](_0x5f2677(0x95),_0x5f2677(0x79));const _0x567118=_0x290216[_0x5f2677(0xa6)]('expect-user-count'),_0x27216b=_0x567118===undefined||_0x567118===null?undefined:Number(_0x567118),_0x1233af=await resolveRoleRef(_0x290216[_0x5f2677(0x7f)],_0x59b876),_0x4f60db=await resolveUserRef(_0x52d6d3),_0x1f36c7=await loadRoleUsers(_0x290216[_0x5f2677(0x7f)]);return computeRoleUserMutation({'operation':_0x33241c,'appCode':_0x290216[_0x5f2677(0x7f)],'roleUsers':_0x1f36c7,'targetRoleId':_0x1233af['id'],'user':{'userId':_0x4f60db[_0x5f2677(0x7e)],'username':_0x4f60db[_0x5f2677(0x85)],'nickname':_0x4f60db[_0x5f2677(0xac)]},'dryRun':_0x4f6624,..._0x27216b!==undefined?{'expectUserCount':_0x27216b}:{}});}
|
|
1
|
+
const a157_0x47db1b=a157_0x35ed;(function(_0xa585f5,_0x9ae274){const _0x568d4c=a157_0x35ed,_0x490a9a=_0xa585f5();while(!![]){try{const _0x1b86c2=-parseInt(_0x568d4c(0x150))/0x1+-parseInt(_0x568d4c(0x148))/0x2*(parseInt(_0x568d4c(0x173))/0x3)+-parseInt(_0x568d4c(0x136))/0x4*(-parseInt(_0x568d4c(0x15a))/0x5)+-parseInt(_0x568d4c(0x169))/0x6*(parseInt(_0x568d4c(0x129))/0x7)+parseInt(_0x568d4c(0x159))/0x8+parseInt(_0x568d4c(0x167))/0x9*(-parseInt(_0x568d4c(0x176))/0xa)+parseInt(_0x568d4c(0x161))/0xb;if(_0x1b86c2===_0x9ae274)break;else _0x490a9a['push'](_0x490a9a['shift']());}catch(_0xedce1f){_0x490a9a['push'](_0x490a9a['shift']());}}}(a157_0x3da6,0x48992));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a157_0x47db1b(0x160),'required':!![],'description':a157_0x47db1b(0x13d)};export const ROLE_REF_FLAG={'name':a157_0x47db1b(0x126),'type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x139)};export const USER_REF_FLAG={'name':a157_0x47db1b(0x152),'type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x134)};export const NAME_FLAG={'name':'name','type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x15c)};export const USER_NAME_FLAG={'name':'name','type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x172)};export const REMARK_FLAG={'name':a157_0x47db1b(0x162),'type':a157_0x47db1b(0x13f),'required':![],'description':a157_0x47db1b(0x12d)};export const EXPECT_USER_COUNT_FLAG={'name':a157_0x47db1b(0x16f),'type':'number','required':![],'description':a157_0x47db1b(0x15d)};function a157_0x35ed(_0x395130,_0x42b388){_0x395130=_0x395130-0x125;const _0x3da65a=a157_0x3da6();let _0x35ed4c=_0x3da65a[_0x395130];return _0x35ed4c;}export const BUILTIN_ROLE_TYPES=['ADMIN',a157_0x47db1b(0x12e),a157_0x47db1b(0x16a)];export function isBuiltinRole(_0x4ea701){const _0x5c566a=a157_0x47db1b;return BUILTIN_ROLE_TYPES[_0x5c566a(0x145)](_0x4ea701);}export function assertCustomRole(_0xa33889,_0x4369c0){const _0x5c7601=a157_0x47db1b;if(_0xa33889[_0x5c7601(0x156)]!==_0x5c7601(0x151))throw CliErrors[_0x5c7601(0x14c)](_0x5c7601(0x16d)+_0x4369c0+_0x5c7601(0x146)+_0xa33889[_0x5c7601(0x13a)]+'\x20('+_0xa33889[_0x5c7601(0x156)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x1dfe08){const _0x17a8d8=a157_0x47db1b;if(_0x1dfe08[_0x17a8d8(0x156)]===_0x17a8d8(0x12e)||_0x1dfe08['roleType']===_0x17a8d8(0x15b))throw CliErrors[_0x17a8d8(0x14c)](_0x17a8d8(0x155)+_0x1dfe08[_0x17a8d8(0x13a)]+'\x20('+_0x1dfe08[_0x17a8d8(0x156)]+').',_0x17a8d8(0x147));}export function projectRole(_0x1f4517){const _0xc4b04c=a157_0x47db1b;return{'id':_0x1f4517['id'],'roleName':_0x1f4517[_0xc4b04c(0x13a)],'roleType':_0x1f4517[_0xc4b04c(0x156)],'remark':_0x1f4517[_0xc4b04c(0x162)],'userCount':_0x1f4517['userCount'],'permitCount':_0x1f4517[_0xc4b04c(0x14d)],'builtin':isBuiltinRole(_0x1f4517['roleType'])};}export async function resolveRoleRef(_0x30505b,_0x4d0bd7){const _0xe0511a=a157_0x47db1b,_0x1a7648=_0x4d0bd7['trim']();if(!_0x1a7648)throw CliErrors[_0xe0511a(0x14c)](_0xe0511a(0x166),_0xe0511a(0x13e));if(/^\d+$/[_0xe0511a(0x142)](_0x1a7648))return getRoleById(_0x30505b,Number(_0x1a7648));const _0x589ee4=await listAllAppRoles(_0x30505b),_0xdccd7e=_0x589ee4[_0xe0511a(0x131)](_0x43ce67=>_0x43ce67[_0xe0511a(0x13a)]===_0x1a7648);if(_0xdccd7e[_0xe0511a(0x170)]===0x0)throw CliErrors['validation'](_0xe0511a(0x177)+_0x1a7648+_0xe0511a(0x12a)+_0x30505b+'.',_0xe0511a(0x12b));if(_0xdccd7e[_0xe0511a(0x170)]>0x1){const _0x58e47c=_0xdccd7e['map'](_0x3af98d=>_0x3af98d['id'])[_0xe0511a(0x157)](',\x20');throw CliErrors[_0xe0511a(0x14c)](_0xe0511a(0x177)+_0x1a7648+_0xe0511a(0x14e)+_0x58e47c+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0xdccd7e[0x0];}export async function getRoleById(_0x5e6e99,_0x480693){const _0x4bdc15=a157_0x47db1b,_0xdaf2c8=await getAppRole(_0x480693);if(!_0xdaf2c8)throw CliErrors[_0x4bdc15(0x14c)](_0x4bdc15(0x130)+_0x480693+_0x4bdc15(0x174)+_0x5e6e99+'.',_0x4bdc15(0x14b));return _0xdaf2c8;}async function listAllAppRoles(_0x54e081){const _0x32aa8f=a157_0x47db1b,_0x108608=0x64,_0x54f9a8=[];for(let _0x334ada=0x1;;_0x334ada+=0x1){const {items:_0x2b6bc4,paging:_0x445f0f}=await listAppRoles(_0x54e081,{'currentPage':_0x334ada,'pageSize':_0x108608});_0x54f9a8[_0x32aa8f(0x14a)](..._0x2b6bc4);if(_0x2b6bc4[_0x32aa8f(0x170)]<_0x108608||_0x445f0f&&_0x54f9a8[_0x32aa8f(0x170)]>=_0x445f0f[_0x32aa8f(0x175)])return _0x54f9a8;}}export async function resolveTenantCode(){const _0x35dbf6=a157_0x47db1b,_0x2779b8=await getSessionUserInfo(),_0x23641a=_0x2779b8?.['user']?.[_0x35dbf6(0x171)]?.[_0x35dbf6(0x143)];if(!_0x23641a)throw CliErrors['authRequired'](_0x35dbf6(0x163));return _0x23641a;}function matchMember(_0x2d04f6,_0x237dc3){const _0x40bb7c=a157_0x47db1b,_0x2c357f=_0x237dc3[_0x40bb7c(0x133)]()['toLowerCase']();return(_0x2d04f6['nickname']??'')['toLowerCase']()===_0x2c357f||(_0x2d04f6[_0x40bb7c(0x153)]??'')[_0x40bb7c(0x141)]()===_0x2c357f;}export async function resolveUserRef(_0x428331){const _0x518ce6=a157_0x47db1b,_0x5d5c1a=_0x428331[_0x518ce6(0x133)]();if(!_0x5d5c1a)throw CliErrors[_0x518ce6(0x14c)](_0x518ce6(0x125),_0x518ce6(0x135));const _0x491de4=await resolveTenantCode(),_0x557287=await getTenantMembers(_0x491de4);if(/^\d+$/[_0x518ce6(0x142)](_0x5d5c1a)){const _0x1e8e26=Number(_0x5d5c1a),_0x213c26=_0x557287[_0x518ce6(0x12c)](_0x5634e3=>_0x5634e3[_0x518ce6(0x168)]===_0x1e8e26);return{'userId':_0x1e8e26,'username':_0x213c26?.[_0x518ce6(0x153)]??String(_0x1e8e26),'nickname':_0x213c26?.[_0x518ce6(0x149)],'matchedBy':'id'};}const _0x424066=_0x557287[_0x518ce6(0x131)](_0x342b61=>matchMember(_0x342b61,_0x5d5c1a));if(_0x424066[_0x518ce6(0x170)]===0x0)throw CliErrors[_0x518ce6(0x14c)](_0x518ce6(0x154)+_0x5d5c1a+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x424066[_0x518ce6(0x170)]>0x1){const _0x4911ca=_0x424066['map'](_0x272685=>(_0x272685['nickname']??_0x272685[_0x518ce6(0x153)]??'?')+'('+_0x272685['userId']+')')[_0x518ce6(0x157)](',\x20');throw CliErrors[_0x518ce6(0x14c)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x5d5c1a+_0x518ce6(0x16e)+_0x4911ca+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x4d9a61=_0x424066[0x0];return{'userId':_0x4d9a61[_0x518ce6(0x168)],'username':_0x4d9a61[_0x518ce6(0x153)]??String(_0x4d9a61[_0x518ce6(0x168)]),'nickname':_0x4d9a61[_0x518ce6(0x149)],'matchedBy':_0x518ce6(0x13c)};}export const UPDATE_USER_LIST_PATH=a157_0x47db1b(0x165);function userIdsOf(_0x43d612){const _0x131bd2=a157_0x47db1b;return(_0x43d612?.[_0x131bd2(0x16c)]??[])[_0x131bd2(0x12f)](_0x4936c9=>_0x4936c9['userId']);}function a157_0x3da6(){const _0x501bf7=['3641984jDTtzn','1551605Bsohtp','ADMIN','Role\x20name','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','User\x20','\x20member(s)\x20but\x20role\x20has\x20','number','9595960EhBDmv','remark','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','str','/smartapi/permit/user-role/update-user-list','Missing\x20role\x20reference.','54lIMzNd','userId','26766LwVrqg','USER','expectUserCount','userList','Cannot\x20','\x22:\x20','expect-user-count','length','tenant','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','6oGupEJ','\x20not\x20found\x20in\x20app\x20','totalCount','336320vKdmfm','Role\x20name\x20\x22','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20user\x20reference.','role','appCode','flagMissing','91RFnYtl','\x22\x20not\x20found\x20in\x20app\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','find','Optional\x20role\x20remark/description','DEV','map','Role\x20id\x20','filter','\x20is\x20already\x20a\x20member\x20of\x20role\x20','trim','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Pass\x20--user\x20<id|name>.','4tyvKji',';\x20no\x20change.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','roleName','dryRun','name','Role\x20id\x20(from\x20`role\x20list`)','Pass\x20--role\x20<id|name>.','string','user-add','toLowerCase','test','tenant_code','findIndex','includes','\x20built-in\x20role\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','534922JHHinP','nickname','push','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','validation','permitCount','\x22\x20is\x20ambiguous\x20(ids:\x20','POST','545860DqpKJX','CUSTOM','user','username','No\x20tenant\x20member\x20matches\x20\x22','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','roleType','join','\x20not\x20found\x20in\x20the\x20user-role\x20list.'];a157_0x3da6=function(){return _0x501bf7;};return a157_0x3da6();}export function computeRoleUserMutation(_0x58d045){const _0x3d8a67=a157_0x47db1b,{operation:_0x2025fe,appCode:_0xa49190,roleUsers:_0x144466,targetRoleId:_0x417b61,user:_0x6adc83}=_0x58d045,_0x75f037=_0x144466['find'](_0x3f1277=>_0x3f1277['id']===_0x417b61);if(!_0x75f037)throw CliErrors['validation']('Role\x20id\x20'+_0x417b61+_0x3d8a67(0x158),_0x3d8a67(0x14b));const _0x390e60=userIdsOf(_0x75f037),_0x679d35=[];if(_0x58d045[_0x3d8a67(0x16b)]!==undefined&&_0x58d045[_0x3d8a67(0x16b)]!==_0x390e60[_0x3d8a67(0x170)])throw CliErrors[_0x3d8a67(0x14c)](_0x3d8a67(0x178)+_0x58d045[_0x3d8a67(0x16b)]+_0x3d8a67(0x15f)+_0x390e60['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x243086=_0x390e60['includes'](_0x6adc83[_0x3d8a67(0x168)]);let _0x1e0eb7=![];const _0x514d9c=[..._0x75f037[_0x3d8a67(0x16c)]];if(_0x2025fe===_0x3d8a67(0x140))_0x243086?_0x679d35[_0x3d8a67(0x14a)](_0x3d8a67(0x15e)+_0x6adc83[_0x3d8a67(0x168)]+_0x3d8a67(0x132)+_0x75f037[_0x3d8a67(0x13a)]+_0x3d8a67(0x137)):(_0x514d9c[_0x3d8a67(0x14a)]({'userId':_0x6adc83[_0x3d8a67(0x168)],'username':_0x6adc83[_0x3d8a67(0x153)],..._0x6adc83[_0x3d8a67(0x149)]?{'nickname':_0x6adc83[_0x3d8a67(0x149)]}:{}}),_0x1e0eb7=!![]);else{if(!_0x243086)_0x679d35[_0x3d8a67(0x14a)](_0x3d8a67(0x15e)+_0x6adc83[_0x3d8a67(0x168)]+_0x3d8a67(0x138)+_0x75f037[_0x3d8a67(0x13a)]+_0x3d8a67(0x137));else{const _0x563ba1=_0x514d9c[_0x3d8a67(0x144)](_0x19d584=>_0x19d584[_0x3d8a67(0x168)]===_0x6adc83[_0x3d8a67(0x168)]);if(_0x563ba1>=0x0)_0x514d9c['splice'](_0x563ba1,0x1);_0x1e0eb7=!![];}}const _0x1281c8=_0x144466['map'](_0x13ec87=>_0x13ec87['id']===_0x417b61?{..._0x13ec87,'userList':_0x514d9c}:_0x13ec87),_0x493e59=_0x514d9c[_0x3d8a67(0x12f)](_0xf71b07=>_0xf71b07[_0x3d8a67(0x168)]),_0x4da149={'operation':_0x2025fe,'selector':{'appCode':_0xa49190,'roleId':_0x417b61,'roleName':_0x75f037[_0x3d8a67(0x13a)],'userId':_0x6adc83[_0x3d8a67(0x168)]},'before':{'userIds':_0x390e60},'after':{'userIds':_0x493e59},'dryRun':_0x58d045[_0x3d8a67(0x13b)],'backend':{'method':_0x3d8a67(0x14f),'path':UPDATE_USER_LIST_PATH},'warnings':_0x679d35};return{'roleList':_0x1281c8,'mutation':_0x4da149,'changed':_0x1e0eb7};}export async function loadRoleUsers(_0x1c2ab6){return listRoleUsers(_0x1c2ab6);}export function readRoleRef(_0x43babe){const _0x1b36e8=a157_0x47db1b,_0x1da103=_0x43babe['str']('role')[_0x1b36e8(0x133)]();if(!_0x1da103)throw CliErrors[_0x1b36e8(0x128)]('role','Pass\x20--role\x20<id|name>.');return _0x1da103;}export async function prepareUserMutation(_0x20a5ce,_0x539c70,_0x59a48d){const _0x3a4154=a157_0x47db1b,_0x3cbf02=readRoleRef(_0x20a5ce),_0x3458e6=_0x20a5ce[_0x3a4154(0x164)](_0x3a4154(0x152))[_0x3a4154(0x133)]();if(!_0x3458e6)throw CliErrors[_0x3a4154(0x128)](_0x3a4154(0x152),_0x3a4154(0x135));const _0x4781a0=_0x20a5ce['flag']('expect-user-count'),_0xdafdad=_0x4781a0===undefined||_0x4781a0===null?undefined:Number(_0x4781a0),_0x4e3dac=await resolveRoleRef(_0x20a5ce['appCode'],_0x3cbf02),_0x26d2a1=await resolveUserRef(_0x3458e6),_0x195981=await loadRoleUsers(_0x20a5ce[_0x3a4154(0x127)]);return computeRoleUserMutation({'operation':_0x539c70,'appCode':_0x20a5ce[_0x3a4154(0x127)],'roleUsers':_0x195981,'targetRoleId':_0x4e3dac['id'],'user':{'userId':_0x26d2a1[_0x3a4154(0x168)],'username':_0x26d2a1[_0x3a4154(0x153)],'nickname':_0x26d2a1[_0x3a4154(0x149)]},'dryRun':_0x59a48d,..._0xdafdad!==undefined?{'expectUserCount':_0xdafdad}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a158_0x59e65c=a158_0x4ee3;(function(_0x435493,_0x3ba21a){const _0x209253=a158_0x4ee3,_0x11ad08=_0x435493();while(!![]){try{const _0x18f1a1=parseInt(_0x209253(0x11c))/0x1+-parseInt(_0x209253(0x115))/0x2+parseInt(_0x209253(0x129))/0x3*(-parseInt(_0x209253(0x11b))/0x4)+parseInt(_0x209253(0x125))/0x5*(-parseInt(_0x209253(0x12b))/0x6)+parseInt(_0x209253(0x120))/0x7+-parseInt(_0x209253(0x128))/0x8*(-parseInt(_0x209253(0x112))/0x9)+-parseInt(_0x209253(0x118))/0xa*(-parseInt(_0x209253(0x110))/0xb);if(_0x18f1a1===_0x3ba21a)break;else _0x11ad08['push'](_0x11ad08['shift']());}catch(_0x329b70){_0x11ad08['push'](_0x11ad08['shift']());}}}(a158_0x6263,0xa733e));function a158_0x6263(){const _0x5223f2=['num','1745pOTLXM','New\x20role\x20name','Nothing\x20to\x20update.','3448qdkJfs','1611BmklVT','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','14430dpFDoM','validation','appCode','remark','1494966BLVprK','name','22284jJDfkO','\x20(id=','--name\x20cannot\x20be\x20empty.','2060148ddITyb','length','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','70yirIGW','string','flag','8228xxxZTD','1362315xPLARD','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','update','roleName','1946539uUSmzE','POST','role','trim'];a158_0x6263=function(){return _0x5223f2;};return a158_0x6263();}import{updateAppRole}from'../../core/api-client.js';function a158_0x4ee3(_0x33d2dc,_0x232cfc){_0x33d2dc=_0x33d2dc-0x10e;const _0x62635a=a158_0x6263();let _0x4ee364=_0x62635a[_0x33d2dc];return _0x4ee364;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x23602e){const _0x8f436b=a158_0x4ee3,_0x3a6b83=_0x23602e['flag']('name'),_0x147659=_0x23602e[_0x8f436b(0x11a)](_0x8f436b(0x10f)),_0x595a11={};if(_0x3a6b83!==undefined&&_0x3a6b83!==null){const _0x51400a=String(_0x3a6b83)[_0x8f436b(0x123)]();if(!_0x51400a)throw CliErrors['validation'](_0x8f436b(0x114));if(_0x51400a[_0x8f436b(0x116)]>0x40)throw CliErrors[_0x8f436b(0x12c)](_0x8f436b(0x12a));_0x595a11['roleName']=_0x51400a;}_0x147659!==undefined&&_0x147659!==null&&(_0x595a11['remark']=String(_0x147659));if(_0x595a11[_0x8f436b(0x11f)]===undefined&&_0x595a11[_0x8f436b(0x10f)]===undefined)throw CliErrors['validation'](_0x8f436b(0x127),_0x8f436b(0x117));return _0x595a11;}export const roleUpdate={'service':a158_0x59e65c(0x122),'command':'update','description':a158_0x59e65c(0x11d),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a158_0x59e65c(0x111),'type':a158_0x59e65c(0x119),'required':![],'description':a158_0x59e65c(0x126)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x51ac96){readPatch(_0x51ac96);},async 'dryRun'(_0x22c08b){const _0x293e4b=a158_0x59e65c,_0xd210aa=_0x22c08b[_0x293e4b(0x124)]('id'),_0x4f8756=readPatch(_0x22c08b),_0x4195e6=await getRoleById(_0x22c08b['appCode'],_0xd210aa);return assertCustomRole(_0x4195e6,_0x293e4b(0x11e)),asDryRunResult({'operation':_0x293e4b(0x11e),'selector':{'appCode':_0x22c08b['appCode'],'roleId':_0xd210aa,'roleName':_0x4195e6[_0x293e4b(0x11f)]},'before':projectRole(_0x4195e6),'after':projectRole({..._0x4195e6,..._0x4f8756['roleName']!==undefined?{'roleName':_0x4f8756[_0x293e4b(0x11f)]}:{},..._0x4f8756[_0x293e4b(0x10f)]!==undefined?{'remark':_0x4f8756['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x293e4b(0x121),'path':UPDATE_PATH},'warnings':[]},{'method':_0x293e4b(0x121),'url':UPDATE_PATH});},async 'execute'(_0x328439){const _0x2e6bd0=a158_0x59e65c,_0x2a15e3=_0x328439[_0x2e6bd0(0x124)]('id'),_0x57c5c5=readPatch(_0x328439),_0x3a7011=await getRoleById(_0x328439[_0x2e6bd0(0x10e)],_0x2a15e3);assertCustomRole(_0x3a7011,'update'),await updateAppRole({'id':_0x2a15e3,'appCode':_0x328439[_0x2e6bd0(0x10e)],..._0x57c5c5[_0x2e6bd0(0x11f)]!==undefined?{'roleName':_0x57c5c5[_0x2e6bd0(0x11f)]}:{},..._0x57c5c5[_0x2e6bd0(0x10f)]!==undefined?{'remark':_0x57c5c5[_0x2e6bd0(0x10f)]}:{}});const _0x5dd79a=await getRoleById(_0x328439[_0x2e6bd0(0x10e)],_0x2a15e3);return{'ok':!![],'data':{'operation':_0x2e6bd0(0x11e),'selector':{'appCode':_0x328439['appCode'],'roleId':_0x2a15e3,'roleName':_0x5dd79a[_0x2e6bd0(0x11f)]},'before':projectRole(_0x3a7011),'after':projectRole(_0x5dd79a),'dryRun':![],'backend':{'method':_0x2e6bd0(0x121),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x5dd79a['roleName']+_0x2e6bd0(0x113)+_0x2a15e3+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x248b28=a159_0x1bc6;(function(_0x1bee0a,_0x5ea78f){const _0x28acbb=a159_0x1bc6,_0x45adaf=_0x1bee0a();while(!![]){try{const _0x44ae3a=parseInt(_0x28acbb(0x67))/0x1*(parseInt(_0x28acbb(0x76))/0x2)+parseInt(_0x28acbb(0x6b))/0x3+parseInt(_0x28acbb(0x79))/0x4+parseInt(_0x28acbb(0x6e))/0x5*(-parseInt(_0x28acbb(0x66))/0x6)+parseInt(_0x28acbb(0x78))/0x7+parseInt(_0x28acbb(0x6d))/0x8*(-parseInt(_0x28acbb(0x77))/0x9)+-parseInt(_0x28acbb(0x69))/0xa*(parseInt(_0x28acbb(0x6c))/0xb);if(_0x44ae3a===_0x5ea78f)break;else _0x45adaf['push'](_0x45adaf['shift']());}catch(_0x6823d5){_0x45adaf['push'](_0x45adaf['shift']());}}}(a159_0xd5e7,0x8200a));import{updateRoleUsers}from'../../core/api-client.js';function a159_0x1bc6(_0x1a1a30,_0x21e65d){_0x1a1a30=_0x1a1a30-0x65;const _0xd5e789=a159_0xd5e7();let _0x1bc664=_0xd5e789[_0x1a1a30];return _0x1bc664;}function a159_0xd5e7(){const _0x3ffdba=['\x20already\x20in\x20role\x20','selector','618NUvOTL','1yOSOKw','POST','1807730VinbUx','userId','293607fCUVEB','11GhFMLX','8KaoKQC','51525lltBMo','Added\x20user\x20','\x20to\x20role\x20','roleName','No\x20change:\x20user\x20','appCode','user-add','high-risk-write','1254158qmRFxc','5811885JAXdVM','4521461rLWHZv','4198288vSfHsu','role'];a159_0xd5e7=function(){return _0x3ffdba;};return a159_0xd5e7();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a159_0x248b28(0x7a),'command':a159_0x248b28(0x74),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a159_0x248b28(0x75),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x36b0ba){const _0x56cbbc=a159_0x248b28,{mutation:_0x1df2b6}=await prepareUserMutation(_0x36b0ba,_0x56cbbc(0x74),!![]);return asDryRunResult(_0x1df2b6,{'method':_0x56cbbc(0x68),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xe8020e){const _0x38dce0=a159_0x248b28,{roleList:_0x75f5cc,mutation:_0xc0cd62,changed:_0x546f9a}=await prepareUserMutation(_0xe8020e,'user-add',![]);return _0x546f9a&&await updateRoleUsers(_0xe8020e[_0x38dce0(0x73)],_0x75f5cc),{'ok':!![],'data':_0xc0cd62,'message':_0x546f9a?_0x38dce0(0x6f)+_0xc0cd62[_0x38dce0(0x65)][_0x38dce0(0x6a)]+_0x38dce0(0x70)+_0xc0cd62[_0x38dce0(0x65)][_0x38dce0(0x71)]:_0x38dce0(0x72)+_0xc0cd62['selector'][_0x38dce0(0x6a)]+_0x38dce0(0x7b)+_0xc0cd62[_0x38dce0(0x65)][_0x38dce0(0x71)]};}};
|