@lovrabet/rabetbase-cli 2.3.9-beta.2 → 2.3.9
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
|
-
|
|
1
|
+
function a148_0x49d1(_0x51d3db,_0x531be3){_0x51d3db=_0x51d3db-0x114;const _0x21b040=a148_0x21b0();let _0x49d1ed=_0x21b040[_0x51d3db];return _0x49d1ed;}const a148_0x2c693d=a148_0x49d1;(function(_0x49a415,_0x5872b5){const _0x1d9f03=a148_0x49d1,_0x39f5ea=_0x49a415();while(!![]){try{const _0x41ac1e=-parseInt(_0x1d9f03(0x116))/0x1*(parseInt(_0x1d9f03(0x13b))/0x2)+-parseInt(_0x1d9f03(0x129))/0x3+parseInt(_0x1d9f03(0x12a))/0x4*(parseInt(_0x1d9f03(0x11e))/0x5)+parseInt(_0x1d9f03(0x125))/0x6*(parseInt(_0x1d9f03(0x123))/0x7)+parseInt(_0x1d9f03(0x127))/0x8+-parseInt(_0x1d9f03(0x136))/0x9+parseInt(_0x1d9f03(0x138))/0xa*(parseInt(_0x1d9f03(0x135))/0xb);if(_0x41ac1e===_0x5872b5)break;else _0x39f5ea['push'](_0x39f5ea['shift']());}catch(_0x16433e){_0x39f5ea['push'](_0x39f5ea['shift']());}}}(a148_0x21b0,0xbba1e));import{CliErrors}from'../../errors.js';function a148_0x21b0(){const _0x3c6d7a=['string','Target\x20environment','Usage:\x20','bool','write','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','str','boolean','App\x20code\x20to\x20initialize','name','22sauSJd','4760883SviAbi','Skip\x20confirmation\x20prompt','2661690EVDqYk','\x20workspace\x20init','create','194Gtfnne','../../commands/project/create/main.js','Auto-confirm\x20prompts','nonInteractive','yes','11098nyUyVM','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','validation','../../commands/project/create/non-interactive.js','Create\x20a\x20new\x20project','cookie','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','2026-07','45rhcHIl','trim','env','init','appcode','10066wUSLwO','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','5046JCpVBf','project','468112GzpsMx','upgrade','2363112mMcHyi','605124DngBPU'];a148_0x21b0=function(){return _0x3c6d7a;};return a148_0x21b0();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':'appcode','type':a148_0x2c693d(0x12b),'description':a148_0x2c693d(0x133)},{'name':a148_0x2c693d(0x120),'type':a148_0x2c693d(0x12b),'description':'Target\x20environment'},{'name':a148_0x2c693d(0x115),'type':a148_0x2c693d(0x132),'description':a148_0x2c693d(0x13d),'default':![]}],createFlags=[{'name':a148_0x2c693d(0x134),'type':'string','description':'Project\x20name'},{'name':a148_0x2c693d(0x120),'type':a148_0x2c693d(0x12b),'description':a148_0x2c693d(0x12c)},{'name':a148_0x2c693d(0x122),'type':a148_0x2c693d(0x12b),'description':a148_0x2c693d(0x11c)}],upgradeFlags=[{'name':a148_0x2c693d(0x115),'type':a148_0x2c693d(0x132),'description':a148_0x2c693d(0x137),'default':![]}];export const projectDefinitions=[{'service':a148_0x2c693d(0x126),'command':a148_0x2c693d(0x121),'description':a148_0x2c693d(0x117),'risk':a148_0x2c693d(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a148_0x2c693d(0x139),'since':a148_0x2c693d(0x11d)},'flags':initFlags,async 'execute'(_0x1fe6fe){const _0x3efbdb=a148_0x2c693d;return await initConfig({'appcode':_0x1fe6fe['str'](_0x3efbdb(0x122))||undefined,'env':_0x1fe6fe[_0x3efbdb(0x131)](_0x3efbdb(0x120))||undefined,'autoYes':_0x1fe6fe['bool']('yes')}),{'ok':!![]};}},{'service':a148_0x2c693d(0x126),'command':a148_0x2c693d(0x13a),'description':a148_0x2c693d(0x11a),'risk':a148_0x2c693d(0x12f),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a148_0x2c693d(0x124),'required':![]}],'flags':createFlags,async 'execute'(_0x11b6b4){const _0x599533=a148_0x2c693d,{createApp:_0x8c7605}=await import(_0x599533(0x13c)),{createProjectNonInteractive:_0xac330b}=await import(_0x599533(0x119)),_0x562ef6=_0x11b6b4[_0x599533(0x131)](_0x599533(0x134))[_0x599533(0x11f)]()||_0x11b6b4['args'][0x0]?.['trim'](),_0x5480b2=_0x11b6b4[_0x599533(0x131)](_0x599533(0x120))||undefined,_0x519da7=_0x11b6b4[_0x599533(0x131)](_0x599533(0x122))||undefined;if(_0x11b6b4[_0x599533(0x114)]){if(!_0x562ef6)throw CliErrors[_0x599533(0x118)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x599533(0x12d)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0xac330b(_0x562ef6,_0x5480b2,_0x519da7,_0x11b6b4[_0x599533(0x11b)]);}else await _0x8c7605({'projectCode':_0x562ef6,'appCode':_0x519da7,'env':_0x5480b2,'cookie':_0x11b6b4[_0x599533(0x11b)]});return{'ok':!![]};}},{'service':a148_0x2c693d(0x126),'command':a148_0x2c693d(0x128),'description':a148_0x2c693d(0x130),'risk':a148_0x2c693d(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x2b005f){const _0x296788=a148_0x2c693d;return await upgradeApp(_0x2b005f[_0x296788(0x114)],{'yes':_0x2b005f[_0x296788(0x12e)](_0x296788(0x115))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x174edb,_0x37f19e){const _0x1caac3=a149_0x40ad,_0x5e4822=_0x174edb();while(!![]){try{const _0x4b0137=-parseInt(_0x1caac3(0x1e6))/0x1+parseInt(_0x1caac3(0x1fb))/0x2*(parseInt(_0x1caac3(0x1e5))/0x3)+-parseInt(_0x1caac3(0x1e4))/0x4+-parseInt(_0x1caac3(0x1d0))/0x5+-parseInt(_0x1caac3(0x1ff))/0x6+-parseInt(_0x1caac3(0x1f8))/0x7+parseInt(_0x1caac3(0x1eb))/0x8;if(_0x4b0137===_0x37f19e)break;else _0x5e4822['push'](_0x5e4822['shift']());}catch(_0x1c23fb){_0x5e4822['push'](_0x5e4822['shift']());}}}(a149_0x139e,0x669ce));import{readFileSync,existsSync,renameSync}from'node:fs';function a149_0x40ad(_0x45c412,_0x3e5fc2){_0x45c412=_0x45c412-0x1cc;const _0x139e5a=a149_0x139e();let _0x40ada5=_0x139e5a[_0x45c412];return _0x40ada5;}import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a149_0x3221ad from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';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(_0x29fa93){const _0x38fab0=a149_0x40ad,{appcode:_0x14e2fd,env:_0x3ca848,autoYes:_0x5902c7}=_0x29fa93,_0x374102=process[_0x38fab0(0x1ea)]();if(getProjectConfigPath())throw new Error(_0x38fab0(0x1e2));let _0x23330d;for(const _0x4686db of LEGACY_CONFIG_NAMES){const _0x33f44e=resolve(_0x374102,_0x4686db);if(existsSync(_0x33f44e)){_0x23330d=_0x33f44e;break;}}if(_0x23330d){let _0x56a6a0={};try{_0x56a6a0=JSON[_0x38fab0(0x1f0)](readFileSync(_0x23330d,_0x38fab0(0x1dc)));}catch{}const _0x332f35=basename(_0x23330d),_0x50124f=_0x56a6a0?.[_0x38fab0(0x1d2)]||_0x56a6a0?.['app'];let _0x5966f7=_0x5902c7;!_0x5902c7&&(console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1cc)](_0x38fab0(0x1f2)+a149_0x3221ad[_0x38fab0(0x1e3)](_0x332f35))),_0x50124f&&console[_0x38fab0(0x1d6)](a149_0x3221ad['cyan'](_0x38fab0(0x1da)+_0x50124f)),_0x5966f7=await confirm({'message':_0x38fab0(0x1e1)+a149_0x3221ad['bold'](_0x38fab0(0x1d9))+_0x38fab0(0x1e0),'default':!![]}));if(!_0x5966f7){console[_0x38fab0(0x1d6)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x38fab0(0x1ed));return;}const _0xbc3c41=resolve(_0x374102,NEW_CONFIG_NAME),_0x114ee5=getCliVersionFromPkg(),_0x48fcba=readRawConfig(),_0xe3a535=_0x14e2fd||(typeof _0x56a6a0?.[_0x38fab0(0x1d2)]==='string'?_0x56a6a0[_0x38fab0(0x1d2)]:undefined)||(typeof _0x56a6a0?.[_0x38fab0(0x1f3)]===_0x38fab0(0x1f5)?_0x56a6a0[_0x38fab0(0x1f3)]:undefined)||await askAppcode(),_0x515125=typeof _0x56a6a0?.[_0x38fab0(0x1d1)]===_0x38fab0(0x1f5)?_0x56a6a0[_0x38fab0(0x1d1)]:typeof _0x48fcba[_0x38fab0(0x1d1)]==='string'?_0x48fcba[_0x38fab0(0x1d1)]:_0x38fab0(0x1f7),_0x425eb9=buildCanonicalProjectConfig({..._0x48fcba,..._0x56a6a0},{'appCodes':[_0xe3a535],'env':_0x515125,'metadata':{'version':_0x114ee5,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x23330d}});writeConfigFile(_0xbc3c41,_0x425eb9);const _0x3a8c39=_0x23330d+_0x38fab0(0x1ef);renameSync(_0x23330d,_0x3a8c39),logger[_0x38fab0(0x1f6)](_0x374102),logger[_0x38fab0(0x1db)](_0x38fab0(0x1f4),_0x38fab0(0x1d3),{'from':_0x23330d,'to':_0xbc3c41,'appcode':_0xe3a535,'env':_0x425eb9[_0x38fab0(0x1d1)]}),console[_0x38fab0(0x1d6)](a149_0x3221ad['green'](_0x38fab0(0x1fe)+_0x332f35+_0x38fab0(0x1ee))),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1de)+Object[_0x38fab0(0x1fa)](_0x425eb9[_0x38fab0(0x1ce)]||{})[_0x38fab0(0x1df)](',\x20'))),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1e8)+_0x425eb9[_0x38fab0(0x1d4)])),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1e9)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x332f35+_0x38fab0(0x1ef)));return;}const _0x2feec6=_0x14e2fd||await askAppcode(),_0x282206=resolve(_0x374102,NEW_CONFIG_NAME),_0xaf5429=getCliVersionFromPkg(),_0x228156=readRawConfig(),_0x1ad646=typeof _0x228156[_0x38fab0(0x1d1)]===_0x38fab0(0x1f5)?_0x228156[_0x38fab0(0x1d1)]:undefined,_0x10c37e=buildCanonicalProjectConfig({},{'appCodes':[_0x2feec6],'env':_0x3ca848||_0x1ad646||'production','metadata':{'version':_0xaf5429,'createdAt':new Date()[_0x38fab0(0x1fc)]()}});writeConfigFile(_0x282206,_0x10c37e),logger[_0x38fab0(0x1f6)](_0x374102),logger[_0x38fab0(0x1db)](_0x38fab0(0x1f4),_0x38fab0(0x1d5),{'appcode':_0x2feec6,'env':_0x10c37e[_0x38fab0(0x1d1)],'version':_0x10c37e[_0x38fab0(0x201)],'configPath':_0x282206}),console[_0x38fab0(0x1d6)](a149_0x3221ad[_0x38fab0(0x1f1)](_0x38fab0(0x200))),console['log'](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1de)+Object[_0x38fab0(0x1fa)](_0x10c37e[_0x38fab0(0x1ce)]||{})[_0x38fab0(0x1df)](',\x20'))),console['log'](a149_0x3221ad[_0x38fab0(0x1e7)](_0x38fab0(0x1e8)+_0x10c37e[_0x38fab0(0x1d4)])),console[_0x38fab0(0x1d6)](_0x38fab0(0x1d7)+CLI_BIN_NAME+_0x38fab0(0x1d8)+CLI_BIN_NAME+_0x38fab0(0x1ec));}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0xc69355=>{const _0x3dff9d=a149_0x40ad;if(!_0xc69355['trim']())return _0x3dff9d(0x1cf);const {valid:_0x19e2e7,message:_0x439057}=validateAppcode(_0xc69355['trim']());return _0x19e2e7||_0x439057||_0x3dff9d(0x1f9);}});}function a149_0x139e(){const _0x2d0bc8=['⚠\x20Found\x20legacy\x20configuration\x20file:\x20','app','init','string','setLogPath','production','514199KcRUMX','Invalid\x20App\x20Code','keys','82eioDzr','toLocaleString','package.json','✓\x20Upgraded\x20','3423144UrOTuW','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','version','yellow','../..','apps','App\x20Code\x20cannot\x20be\x20empty','1238200cujRFP','env','appcode','从旧配置文件升级成功','defaultApp','初始化项目配置文件成功','log','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20api\x20generate\x27\x20and\x20\x27','.rabetbase.json','\x20\x20appcode:\x20','info','utf8','1.0.0','\x20\x20Apps:\x20','join','?\x20(Old\x20file\x20→\x20*.bak)','Upgrade\x20it\x20to\x20','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','bold','850936KLhCTF','47238ZYhcDK','433284pNhaTT','cyan','\x20\x20Default:\x20','gray','cwd','10498840SkaBFe','\x20api\x20pull\x27','\x20workspace\x20init`\x20to\x20start\x20fresh.','\x20→\x20.rabetbase.json','.bak','parse','green'];a149_0x139e=function(){return _0x2d0bc8;};return a149_0x139e();}function getCliVersionFromPkg(){const _0x3f6ef4=a149_0x40ad;try{const _0x17cf6d=fileURLToPath(import.meta.url),_0x55a567=resolve(dirname(_0x17cf6d),_0x3f6ef4(0x1cd)),_0x1a41b6=JSON[_0x3f6ef4(0x1f0)](readFileSync(resolve(_0x55a567,_0x3f6ef4(0x1fd)),_0x3f6ef4(0x1dc)));return _0x1a41b6[_0x3f6ef4(0x201)]||_0x3f6ef4(0x1dd);}catch{return _0x3f6ef4(0x1dd);}}
|
|
@@ -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
|
+
(function(_0x2d6a9a,_0xb4f40f){const _0x1c5ff6=a150_0xe42e,_0xd21b5d=_0x2d6a9a();while(!![]){try{const _0x51ef96=parseInt(_0x1c5ff6(0x1a9))/0x1*(-parseInt(_0x1c5ff6(0x1f4))/0x2)+-parseInt(_0x1c5ff6(0x1c4))/0x3*(-parseInt(_0x1c5ff6(0x210))/0x4)+-parseInt(_0x1c5ff6(0x1f9))/0x5+-parseInt(_0x1c5ff6(0x202))/0x6+-parseInt(_0x1c5ff6(0x1ed))/0x7*(parseInt(_0x1c5ff6(0x1b0))/0x8)+parseInt(_0x1c5ff6(0x1aa))/0x9*(-parseInt(_0x1c5ff6(0x20d))/0xa)+parseInt(_0x1c5ff6(0x1b5))/0xb;if(_0x51ef96===_0xb4f40f)break;else _0xd21b5d['push'](_0xd21b5d['shift']());}catch(_0x10bc3f){_0xd21b5d['push'](_0xd21b5d['shift']());}}}(a150_0x4a2e,0xbf6e5));import a150_0x13bc42 from'chalk';import a150_0x5a4b1f from'ora';function a150_0xe42e(_0x28136c,_0x1fab99){_0x28136c=_0x28136c-0x1a5;const _0x4a2e4e=a150_0x4a2e();let _0xe42e1e=_0x4a2e4e[_0x28136c];return _0xe42e1e;}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['filter'](_0x2ba79c=>_0x2ba79c!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x44dd19){const _0x266fc7=a150_0xe42e,_0x304c22=[];for(const _0x5227ef of Object[_0x266fc7(0x1a7)](CORE_IDE_CONFIGS)){if(_0x5227ef['files'])for(const _0x446ba8 of _0x5227ef[_0x266fc7(0x1b7)]){_0x304c22['push'](resolve(_0x44dd19,_0x446ba8[_0x266fc7(0x1fa)]));}}return _0x304c22;}function analyse(_0x3ea075){const _0x14444a=a150_0xe42e;let _0x275129=null;const _0xd870a9=resolve(_0x3ea075,NEW_CONFIG_NAME),_0x5c81d8=existsSync(_0xd870a9);for(const _0x28aa4b of LEGACY_CONFIG_NAMES){const _0x9a7ba4=resolve(_0x3ea075,_0x28aa4b);if(existsSync(_0x9a7ba4)){const _0x264813=readConfigFile(_0x9a7ba4),_0x2793f1=Object[_0x14444a(0x1ae)](_0x264813)[_0x14444a(0x1c1)](_0x24631d=>typeof _0x264813[_0x24631d]!==_0x14444a(0x1da));_0x275129={'oldPath':_0x9a7ba4,'hasNewConfig':_0x5c81d8,'fields':_0x2793f1};break;}}const _0x2beeec=[],_0x3a5744=resolve(_0x3ea075,_0x14444a(0x1d8));if(existsSync(_0x3a5744))_0x2beeec[_0x14444a(0x1be)](_0x3a5744);const _0x43d56f=resolve(_0x3ea075,_0x14444a(0x1ce));if(existsSync(_0x43d56f))_0x2beeec[_0x14444a(0x1be)](_0x43d56f);const _0x35a30a=resolve(_0x3ea075,'.claude/skills/lovrabet');if(existsSync(_0x35a30a))_0x2beeec[_0x14444a(0x1be)](_0x35a30a);for(const _0x573fac of collectIdeSkillFiles(_0x3ea075)){if(existsSync(_0x573fac))_0x2beeec[_0x14444a(0x1be)](_0x573fac);}let _0x4c0682=null;const _0x48b9d8=resolve(_0x3ea075,'.cursor/mcp.json');if(existsSync(_0x48b9d8))try{const _0x147eb3=JSON['parse'](readFileSync(_0x48b9d8,'utf8'));if(_0x147eb3?.[_0x14444a(0x206)]&&typeof _0x147eb3[_0x14444a(0x206)]===_0x14444a(0x1d1)){const _0x3ff8e0=[];for(const [_0x3ae1d2,_0x107f67]of Object[_0x14444a(0x205)](_0x147eb3[_0x14444a(0x206)])){const _0x9300eb=_0x107f67;_0x9300eb?.[_0x14444a(0x1e7)]&&Array[_0x14444a(0x1e8)](_0x9300eb[_0x14444a(0x1e7)])&&_0x9300eb['args'][_0x14444a(0x208)](_0x53b476=>typeof _0x53b476===_0x14444a(0x224)&&_0x53b476['includes'](_0x14444a(0x21e)))&&_0x3ff8e0['push'](_0x3ae1d2);}_0x3ff8e0[_0x14444a(0x225)]>0x0&&(_0x4c0682={'path':_0x48b9d8,'keys':_0x3ff8e0});}}catch{}const _0x33f6af=_0x2beeec[_0x14444a(0x225)]>0x0||_0x275129!==null;let _0x18c0d5=null;const _0x11174b=resolve(_0x3ea075,_0x14444a(0x1b1));if(existsSync(_0x11174b))try{const _0x3ccf51=JSON[_0x14444a(0x207)](readFileSync(_0x11174b,'utf8'));for(const _0x2f9509 of[_0x14444a(0x1c7),_0x14444a(0x1bd)]){const _0xedb925=_0x3ccf51?.[_0x2f9509]?.[_0x14444a(0x1ea)];if(typeof _0xedb925===_0x14444a(0x224)){_0xedb925!==_0x14444a(0x1b4)&&(_0x18c0d5={'pkgPath':_0x11174b,'currentVersion':_0xedb925,'field':_0x2f9509});break;}}}catch{}return{'configMigration':_0x275129,'oldArtifacts':_0x2beeec,'oldMcpConfig':_0x4c0682,'needsSkillSwap':_0x33f6af,'sdkUpgrade':_0x18c0d5};}function printReport(_0x478409){const _0x368464=a150_0xe42e,{configMigration:_0x31563c,oldArtifacts:_0x3357c9,oldMcpConfig:_0x235bf7,needsSkillSwap:_0x294f01}=_0x478409;console[_0x368464(0x1d2)](''),console['log'](a150_0x13bc42[_0x368464(0x1d4)](_0x368464(0x218))),console[_0x368464(0x1d2)]('');_0x31563c?(console[_0x368464(0x1d2)](a150_0x13bc42['cyan']('Config\x20file:')+('\x20\x20'+a150_0x13bc42['yellow'](_0x31563c['oldPath']))),console['log'](_0x368464(0x1e6)+(_0x31563c[_0x368464(0x1b9)]?a150_0x13bc42[_0x368464(0x1f7)](_0x368464(0x1d5)):a150_0x13bc42[_0x368464(0x20c)](_0x368464(0x1d9)))),console[_0x368464(0x1d2)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x31563c[_0x368464(0x1cb)][_0x368464(0x211)](',\x20')),console['log'](_0x368464(0x1eb))):console[_0x368464(0x1d2)](a150_0x13bc42[_0x368464(0x1c0)]('Config\x20file:')+'\x20\x20'+a150_0x13bc42['gray'](_0x368464(0x1db)));console[_0x368464(0x1d2)]('');if(_0x3357c9[_0x368464(0x225)]>0x0){console['log'](a150_0x13bc42[_0x368464(0x1c0)]('Legacy\x20artifacts:'));for(const _0x2bb30c of _0x3357c9){console[_0x368464(0x1d2)]('\x20\x20'+a150_0x13bc42[_0x368464(0x1b2)](_0x368464(0x1ad))+'\x20\x20'+_0x2bb30c);}console[_0x368464(0x1d2)](_0x368464(0x1e5));}else console[_0x368464(0x1d2)](a150_0x13bc42[_0x368464(0x1c0)](_0x368464(0x219))+'\x20\x20'+a150_0x13bc42[_0x368464(0x20c)](_0x368464(0x1ba)));console[_0x368464(0x1d2)]('');_0x235bf7?(console[_0x368464(0x1d2)](a150_0x13bc42[_0x368464(0x1c0)](_0x368464(0x222))+('\x20\x20'+a150_0x13bc42[_0x368464(0x1d3)](_0x235bf7[_0x368464(0x1fa)])+_0x368464(0x1cd)+_0x235bf7[_0x368464(0x1ae)][_0x368464(0x211)](',\x20'))),console[_0x368464(0x1d2)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x368464(0x1d2)](a150_0x13bc42['cyan']('MCP\x20config:')+'\x20\x20'+a150_0x13bc42[_0x368464(0x20c)](_0x368464(0x1a5)));console[_0x368464(0x1d2)](''),console[_0x368464(0x1d2)](a150_0x13bc42['cyan'](_0x368464(0x1bb))+('\x20\x20'+(_0x294f01?a150_0x13bc42[_0x368464(0x1d3)](_0x368464(0x220)):a150_0x13bc42['green']('not\x20needed'))));_0x294f01&&console[_0x368464(0x1d2)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x368464(0x1d2)]('');if(_0x478409[_0x368464(0x1ca)]){const {currentVersion:_0x1eb346,field:_0x337df4,pkgPath:_0x418c92}=_0x478409[_0x368464(0x1ca)];console[_0x368464(0x1d2)](a150_0x13bc42['cyan'](_0x368464(0x1d7))+('\x20\x20'+a150_0x13bc42['yellow'](_0x418c92))),console[_0x368464(0x1d2)](_0x368464(0x1ec)+_0x337df4+':\x20'+a150_0x13bc42[_0x368464(0x1d3)](_0x1eb346)+_0x368464(0x1c5)+a150_0x13bc42[_0x368464(0x1f7)](_0x368464(0x1b4))),console[_0x368464(0x1d2)](_0x368464(0x1f3));}else console[_0x368464(0x1d2)](a150_0x13bc42[_0x368464(0x1c0)]('@lovrabet/sdk:')+'\x20\x20'+a150_0x13bc42[_0x368464(0x20c)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x368464(0x1d2)]('');}function execConfigMigration(_0x796822,_0x18116b){const _0x5679b7=a150_0xe42e,{configMigration:_0xfc2a41}=_0x796822;if(!_0xfc2a41?.['oldPath'])return{'step':0x1,'label':_0x5679b7(0x1bf),'ok':!![],'detail':_0x5679b7(0x1cc)};const _0x522225=readConfigFile(_0xfc2a41[_0x5679b7(0x1df)]),_0x3fda87=resolve(_0x18116b,NEW_CONFIG_NAME),_0x3afa4e=_0xfc2a41[_0x5679b7(0x1b9)]?readConfigFile(_0x3fda87):{};for(const [_0x558d59,_0x203c1b]of Object[_0x5679b7(0x205)](_0x522225)){!(_0x558d59 in _0x3afa4e)&&(_0x3afa4e[_0x558d59]=_0x203c1b);}writeConfigFile(_0x3fda87,_0x3afa4e);const _0x4749cc=_0xfc2a41[_0x5679b7(0x1df)]+'.bak';return renameSync(_0xfc2a41[_0x5679b7(0x1df)],_0x4749cc),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0xfc2a41['oldPath']+_0x5679b7(0x1c5)+_0x3fda87+_0x5679b7(0x1d6)+_0x4749cc+')'};}function execRemoveOldArtifacts(_0x193e57){const _0x5d850c=a150_0xe42e,_0x2e87bb=[];for(const _0x2b61a7 of _0x193e57){try{if(!existsSync(_0x2b61a7))continue;const _0xfbfe5=tryStat(_0x2b61a7);_0xfbfe5?.[_0x5d850c(0x1f8)]()?rmSync(_0x2b61a7,{'recursive':!![],'force':!![]}):unlinkSync(_0x2b61a7);}catch(_0x4a36d1){_0x2e87bb[_0x5d850c(0x1be)](_0x2b61a7+':\x20'+_0x4a36d1['message']);}}return{'step':0x3,'label':_0x5d850c(0x1ee),'ok':_0x2e87bb[_0x5d850c(0x225)]===0x0,'detail':_0x2e87bb[_0x5d850c(0x225)]>0x0?_0x193e57[_0x5d850c(0x225)]-_0x2e87bb['length']+'/'+_0x193e57[_0x5d850c(0x225)]+_0x5d850c(0x1e2)+_0x2e87bb['join'](';\x20')+')':_0x193e57[_0x5d850c(0x225)]+'\x20removed'};}function execCleanMcp(_0x353c14){const _0x390e7b=a150_0xe42e;if(!_0x353c14[_0x390e7b(0x1e0)])return{'step':0x4,'label':_0x390e7b(0x1fc),'ok':!![],'detail':_0x390e7b(0x213)};try{const _0x133356=readFileSync(_0x353c14[_0x390e7b(0x1e0)]['path'],_0x390e7b(0x1cf)),_0x3a6259=JSON[_0x390e7b(0x207)](_0x133356);if(_0x3a6259?.[_0x390e7b(0x206)]&&typeof _0x3a6259[_0x390e7b(0x206)]===_0x390e7b(0x1d1)){const _0x2dcb82=[];for(const [_0x2ea5b0,_0x186886]of Object[_0x390e7b(0x205)](_0x3a6259[_0x390e7b(0x206)])){_0x186886?.[_0x390e7b(0x1e7)]&&Array['isArray'](_0x186886[_0x390e7b(0x1e7)])&&_0x186886[_0x390e7b(0x1e7)][_0x390e7b(0x208)](_0x118608=>typeof _0x118608===_0x390e7b(0x224)&&_0x118608[_0x390e7b(0x1bc)](_0x390e7b(0x21e)))&&_0x2dcb82['push'](_0x2ea5b0);}for(const _0x49baa0 of _0x2dcb82){delete _0x3a6259[_0x390e7b(0x206)][_0x49baa0];}return _0x2dcb82[_0x390e7b(0x225)]>0x0&&writeFileSync(_0x353c14[_0x390e7b(0x1e0)][_0x390e7b(0x1fa)],JSON['stringify'](_0x3a6259,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x390e7b(0x21b)+_0x2dcb82[_0x390e7b(0x211)](',\x20')+_0x390e7b(0x214)+_0x353c14[_0x390e7b(0x1e0)][_0x390e7b(0x1fa)]};}return{'step':0x4,'label':_0x390e7b(0x1fc),'ok':!![],'detail':_0x390e7b(0x21c)};}catch(_0x5e23a4){return{'step':0x4,'label':_0x390e7b(0x1fc),'ok':![],'detail':_0x5e23a4[_0x390e7b(0x21d)]};}}function execSkillsRemove(_0x11ed2d,_0x50614c){const _0x179348=a150_0xe42e,_0x273c48=runNpxSkillsRemove(_0x11ed2d,{'stdio':'inherit','yes':_0x50614c});return{'step':0x5,'label':_0x179348(0x201),'ok':_0x273c48['ok'],'detail':_0x273c48['ok']?_0x179348(0x21f):_0x273c48[_0x179348(0x1a8)]??_0x179348(0x217)+_0x273c48[_0x179348(0x20e)]};}function execSkillsAdd(_0x8e9d4a,_0x3f7e42){const _0x5b04cf=a150_0xe42e,_0x4e186c=runNpxSkillsAddGlobal(_0x8e9d4a,_0x5b04cf(0x21a),{'stdio':'inherit','yes':_0x3f7e42});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x4e186c['ok'],'detail':_0x4e186c['ok']?_0x5b04cf(0x221):_0x4e186c[_0x5b04cf(0x1a8)]??_0x5b04cf(0x217)+_0x4e186c[_0x5b04cf(0x20e)]};}function execUpgradeSdk(_0x4cd890){const _0xf5a4f6=a150_0xe42e;if(!_0x4cd890[_0xf5a4f6(0x1ca)])return{'step':0x7,'label':_0xf5a4f6(0x1ac),'ok':!![],'detail':_0xf5a4f6(0x223)};const {pkgPath:_0x548229,currentVersion:_0x593f1d,field:_0xdd13cb}=_0x4cd890[_0xf5a4f6(0x1ca)];try{const _0x323223=readFileSync(_0x548229,_0xf5a4f6(0x1cf)),_0x28b329=JSON[_0xf5a4f6(0x207)](_0x323223);return _0x28b329[_0xdd13cb]['@lovrabet/sdk']=_0xf5a4f6(0x1b4),writeFileSync(_0x548229,JSON[_0xf5a4f6(0x209)](_0x28b329,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0xf5a4f6(0x1ac),'ok':!![],'detail':_0xdd13cb+'[\x22@lovrabet/sdk\x22]:\x20'+_0x593f1d+_0xf5a4f6(0x1de)};}catch(_0x26d4a6){return{'step':0x7,'label':_0xf5a4f6(0x1ac),'ok':![],'detail':_0x26d4a6['message']};}}function a150_0x4a2e(){const _0x48e3c9=['gray','26910BTKAPc','status','Upgrade\x20completed\x20successfully!','537756KYazWo','join','Step\x205/7:\x20Removing\x20old\x20skill...','skipped','\x20from\x20','\x20\x20\x20\x20\x20\x20\x20','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','exit\x20','===\x20Upgrade\x20Analysis\x20===','Legacy\x20artifacts:','lovrabet/rabetbase','removed\x20','no\x20matching\x20entry\x20found','message','@lovrabet/dataset-mcp-server','lovrabet/lovrabet-skill\x20removed','needed','lovrabet/rabetbase\x20installed\x20globally','MCP\x20config:','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','string','length','info','no\x20legacy\x20entry','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','values','error','1018373uneHqx','1647oJBxxO','done','Upgrade\x20@lovrabet/sdk','FOUND','keys','Upgrade\x20cancelled.','55064KgNXCv','package.json','red','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','latest','33567017KOdbdn','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','files','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','hasNewConfig','none\x20found','Skill\x20swap:','includes','devDependencies','push','Config\x20migration','cyan','filter','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','\x20\x20npm\x20install','27NJLHqL','\x20→\x20','FAIL','dependencies','\x20\x20#\x20or','detail','sdkUpgrade','fields','skipped\x20(no\x20legacy\x20config)','\x20→\x20keys:\x20','.cursor/rules/lovrabet_rules.mdc','utf8','configMigration','object','log','yellow','bold','already\x20exists\x20(will\x20merge)','\x20(backup:\x20','@lovrabet/sdk:','.lovrabet','not\x20found\x20(will\x20create)','undefined','no\x20legacy\x20config\x20found','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Step\x201/7:\x20Migrating\x20config...','\x20→\x20latest','oldPath','oldMcpConfig','Remove\x20.lovrabet/','\x20removed\x20(','Step\x206/7:\x20Installing\x20new\x20skill...','yes','\x20\x20Action:\x20delete','\x20\x20New\x20config\x20(.rabetbase.json):\x20','args','isArray','CANCEL','@lovrabet/sdk','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','\x20\x20Current\x20version\x20in\x20','1281Eobkbj','Remove\x20legacy\x20artifacts','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','\x20\x20bun\x20install','fail','label','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','2VXhZPi','needsSkillSwap','start','green','isDirectory','3252745WetiAU','path','cwd','Clean\x20MCP\x20config','step','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','white','oldArtifacts','Remove\x20old\x20skill','338598jlPWxe','Proceed\x20with\x20upgrade?','failed','entries','mcpServers','parse','some','stringify','succeed','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...'];a150_0x4a2e=function(){return _0x48e3c9;};return a150_0x4a2e();}function tryStat(_0x4a6fee){try{return statSync(_0x4a6fee);}catch{return undefined;}}function printSummary(_0x26108c){const _0x231636=a150_0xe42e;console[_0x231636(0x1d2)](''),console[_0x231636(0x1d2)](a150_0x13bc42['bold']('===\x20Upgrade\x20Summary\x20===')),console[_0x231636(0x1d2)]('');for(const _0x1a9ce9 of _0x26108c){const _0x51afda=_0x1a9ce9['ok']?a150_0x13bc42['green']('OK'):a150_0x13bc42[_0x231636(0x1b2)](_0x231636(0x1c6));console['log']('\x20\x20'+_0x51afda+'\x20\x20Step\x20'+_0x1a9ce9[_0x231636(0x1fd)]+':\x20'+_0x1a9ce9[_0x231636(0x1f2)]);if(_0x1a9ce9[_0x231636(0x1c9)])console[_0x231636(0x1d2)](_0x231636(0x215)+a150_0x13bc42[_0x231636(0x20c)](_0x1a9ce9['detail']));}console[_0x231636(0x1d2)]('');}export async function upgradeApp(_0x85e51a,_0xc2a970){const _0xbb77be=a150_0xe42e,_0xc09fba=process[_0xbb77be(0x1fb)](),_0x209515=analyse(_0xc09fba),_0xec2a74=!_0x209515[_0xbb77be(0x1d0)]&&_0x209515[_0xbb77be(0x200)]['length']===0x0&&!_0x209515['oldMcpConfig']&&!_0x209515[_0xbb77be(0x1f5)]&&!_0x209515['sdkUpgrade'];if(_0xec2a74){console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x1f7)](_0xbb77be(0x1ef)));return;}printReport(_0x209515);const _0x4351fb=!!(_0xc2a970[_0xbb77be(0x1e4)]||_0xc2a970['Y']||_0x85e51a);if(!_0x4351fb)try{const _0x21e76a=await askConfirm(_0xbb77be(0x203));if(!_0x21e76a){console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x20c)]('Upgrade\x20cancelled.'));return;}}catch(_0x51fbc6){if(_0x51fbc6?.['message']===_0xbb77be(0x1e9)){console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x20c)](_0xbb77be(0x1af)));return;}throw _0x51fbc6;}const _0x1f9188=[],_0x4e4c69=a150_0x5a4b1f({'text':_0xbb77be(0x1dd),'color':'cyan'})[_0xbb77be(0x1f6)](),_0x3ced89=execConfigMigration(_0x209515,_0xc09fba);_0x1f9188[_0xbb77be(0x1be)](_0x3ced89),_0x4e4c69[_0x3ced89['ok']?_0xbb77be(0x20a):_0xbb77be(0x1f1)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x3ced89['detail']??(_0x3ced89['ok']?'done':_0xbb77be(0x204))));const _0x4d2a93=resolve(_0xc09fba,_0xbb77be(0x1d8)),_0x34b301=a150_0x5a4b1f({'text':_0xbb77be(0x1b6),'color':'cyan'})[_0xbb77be(0x1f6)]();if(existsSync(_0x4d2a93))try{rmSync(_0x4d2a93,{'recursive':!![],'force':!![]}),_0x34b301[_0xbb77be(0x20a)](_0xbb77be(0x1dc)),_0x1f9188[_0xbb77be(0x1be)]({'step':0x2,'label':_0xbb77be(0x1e1),'ok':!![]});}catch(_0xf06b13){_0x34b301[_0xbb77be(0x1f1)](_0xbb77be(0x1c2)+_0xf06b13[_0xbb77be(0x21d)]),_0x1f9188['push']({'step':0x2,'label':_0xbb77be(0x1e1),'ok':![],'detail':_0xf06b13['message']});}else _0x34b301[_0xbb77be(0x226)](_0xbb77be(0x216)),_0x1f9188['push']({'step':0x2,'label':_0xbb77be(0x1e1),'ok':!![],'detail':_0xbb77be(0x213)});const _0x4590ff=a150_0x5a4b1f({'text':_0xbb77be(0x1b3),'color':_0xbb77be(0x1c0)})['start'](),_0x2fe59b=execRemoveOldArtifacts(_0x209515[_0xbb77be(0x200)]);_0x1f9188['push'](_0x2fe59b),_0x4590ff[_0x2fe59b['ok']?_0xbb77be(0x20a):'fail']('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x2fe59b[_0xbb77be(0x1c9)]??(_0x2fe59b['ok']?_0xbb77be(0x1ab):'failed')));const _0x313b5d=a150_0x5a4b1f({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0xbb77be(0x1c0)})[_0xbb77be(0x1f6)](),_0x2141dd=execCleanMcp(_0x209515);_0x1f9188[_0xbb77be(0x1be)](_0x2141dd),_0x313b5d[_0x2141dd['ok']?_0xbb77be(0x20a):'fail']('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x2141dd[_0xbb77be(0x1c9)]??(_0x2141dd['ok']?_0xbb77be(0x1ab):'failed')));const _0x2a17ab=a150_0x5a4b1f({'text':_0xbb77be(0x212),'color':_0xbb77be(0x1c0)})['start'](),_0x42f209=execSkillsRemove(_0xc09fba,_0x4351fb);_0x1f9188[_0xbb77be(0x1be)](_0x42f209),_0x2a17ab[_0x42f209['ok']?_0xbb77be(0x20a):'fail']('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x42f209[_0xbb77be(0x1c9)]??(_0x42f209['ok']?_0xbb77be(0x1ab):'failed')));const _0x5110be=a150_0x5a4b1f({'text':_0xbb77be(0x1e3),'color':_0xbb77be(0x1c0)})['start'](),_0x4779ad=execSkillsAdd(_0xc09fba,_0x4351fb);_0x1f9188[_0xbb77be(0x1be)](_0x4779ad),_0x5110be[_0x4779ad['ok']?_0xbb77be(0x20a):'fail'](_0xbb77be(0x1fe)+(_0x4779ad['detail']??(_0x4779ad['ok']?_0xbb77be(0x1ab):'failed')));const _0x230f94=a150_0x5a4b1f({'text':_0xbb77be(0x20b),'color':_0xbb77be(0x1c0)})['start'](),_0x399538=execUpgradeSdk(_0x209515);_0x1f9188[_0xbb77be(0x1be)](_0x399538),_0x230f94[_0x399538['ok']?_0xbb77be(0x20a):_0xbb77be(0x1f1)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x399538[_0xbb77be(0x1c9)]??(_0x399538['ok']?_0xbb77be(0x1ab):_0xbb77be(0x204)))),printSummary(_0x1f9188);const _0x5bd14d=_0x1f9188[_0xbb77be(0x208)](_0x3841a7=>!_0x3841a7['ok']);_0x5bd14d?console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x1d3)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x1f7)](_0xbb77be(0x20f))),_0x399538['ok']&&_0x209515[_0xbb77be(0x1ca)]&&(console[_0xbb77be(0x1d2)](''),console[_0xbb77be(0x1d2)](a150_0x13bc42['bold'][_0xbb77be(0x1c0)](_0xbb77be(0x1b8))),console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x1c0)](_0xbb77be(0x1a6))),console[_0xbb77be(0x1d2)](''),console['log'](a150_0x13bc42[_0xbb77be(0x1ff)](_0xbb77be(0x1c3))),console[_0xbb77be(0x1d2)](a150_0x13bc42['white'](_0xbb77be(0x1c8))),console[_0xbb77be(0x1d2)](a150_0x13bc42[_0xbb77be(0x1ff)](_0xbb77be(0x1f0))),console[_0xbb77be(0x1d2)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x1849f3=a151_0x9313;(function(_0x1c647b,_0x194b6d){const _0xbb80c6=a151_0x9313,_0x5e6c72=_0x1c647b();while(!![]){try{const _0x3758b5=-parseInt(_0xbb80c6(0x112))/0x1*(parseInt(_0xbb80c6(0x108))/0x2)+-parseInt(_0xbb80c6(0x11f))/0x3*(-parseInt(_0xbb80c6(0xf8))/0x4)+-parseInt(_0xbb80c6(0x107))/0x5*(parseInt(_0xbb80c6(0x11e))/0x6)+parseInt(_0xbb80c6(0xed))/0x7*(parseInt(_0xbb80c6(0xea))/0x8)+parseInt(_0xbb80c6(0x10f))/0x9*(parseInt(_0xbb80c6(0xec))/0xa)+-parseInt(_0xbb80c6(0xe5))/0xb+parseInt(_0xbb80c6(0x10c))/0xc;if(_0x3758b5===_0x194b6d)break;else _0x5e6c72['push'](_0x5e6c72['shift']());}catch(_0x594179){_0x5e6c72['push'](_0x5e6c72['shift']());}}}(a151_0x475e,0xc3870));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';function a151_0x475e(){const _0x45d75a=['8165773LrVusc','Smart\x20List\x20Pages','auth','Workspace','`rabetbase\x20skills`\x20has\x20been\x20removed.','31936zzKBWb','push','110aOLYEu','1358kAVTEn','\x20\x20[write]','Database\x20Connections','Configuration','Diagnostics','CLI\x20Built-in\x20Skill','app\x20use','from','map','File','skills','4CEWcJY','service','Self\x20Update','show','`\x20has\x20been\x20removed.','Runtime\x20App\x20Config\x20Management','remote','Platform\x20Issue','commands','API\x20Development','set','defaultCommand','skill','run','Async\x20Tasks','5dqMtII','6GMGSfe','create','write','login','1527456HmQCce','isSingleCommand','start','195066vXRLzt','Logs','wildcardDef','175zihxxy','`rabetbase\x20','command','has','App\x20Management','values','skill\x20','Roles','Authentication','project','filter','description','1289478YrtVHk','1855533HmVYSz','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','get','install','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','Instant\x20API','Dataset\x20&\x20Operations','Quick\x20Start','app','logout','Menu','length','use','risk'];a151_0x475e=function(){return _0x45d75a;};return a151_0x475e();}import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';function a151_0x9313(_0xad10fd,_0x350cdc){_0xad10fd=_0xad10fd-0xde;const _0x475e00=a151_0x475e();let _0x9313f7=_0x475e00[_0xad10fd];return _0x9313f7;}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';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(_0x42e3e2){const _0x41b08f=a151_0x9313;for(const _0x168d47 of _0x42e3e2){definitions[_0x41b08f(0x102)](_0x168d47['service']+':'+_0x168d47['command'],_0x168d47);let _0x7fd399=serviceGroups['get'](_0x168d47[_0x41b08f(0xf9)]);!_0x7fd399&&(_0x7fd399=[],serviceGroups['set'](_0x168d47['service'],_0x7fd399)),_0x7fd399[_0x41b08f(0xeb)](_0x168d47);}}function registerDeclarativeService(_0x3d20f0,_0x12ebca,_0x36bfb4){const _0x3f9957=a151_0x9313;registerDefinitions(_0x12ebca);_0x36bfb4?.[_0x3f9957(0x111)]&®isterDefinitions([_0x36bfb4['wildcardDef']]);const _0x584f0c=_0xf35902=>_0xf35902==='read'?'':_0xf35902===_0x3f9957(0x10a)?_0x3f9957(0xee):'\x20\x20[high-risk-write]',_0x1ab09d={'service':_0x12ebca[0x0][_0x3f9957(0xf9)],'label':_0x3d20f0,'commands':_0x12ebca[_0x3f9957(0x11c)](_0x4ea5ab=>!_0x4ea5ab['hidden'])[_0x3f9957(0xf5)](_0x20f943=>({'command':_0x20f943[_0x3f9957(0x114)],'description':_0x20f943[_0x3f9957(0x11d)],'tag':_0x584f0c(_0x20f943[_0x3f9957(0xe4)])})),'declarative':!![],'defaultCommand':_0x36bfb4?.[_0x3f9957(0x103)]??(_0x36bfb4?.[_0x3f9957(0x10d)]?_0x12ebca[0x0][_0x3f9957(0x114)]:undefined),'wildcardDef':_0x36bfb4?.['wildcardDef'],'isSingleCommand':_0x36bfb4?.[_0x3f9957(0x10d)]};serviceRegistry[_0x3f9957(0xeb)](_0x1ab09d),serviceByName[_0x3f9957(0x102)](_0x1ab09d[_0x3f9957(0xf9)],_0x1ab09d);}registerDeclarativeService(a151_0x1849f3(0xde),initDefinitions,{'defaultCommand':a151_0x1849f3(0x105),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a151_0x1849f3(0xe8),workspaceDefinitions),registerDeclarativeService(a151_0x1849f3(0x116),appDefinitions),registerDeclarativeService(a151_0x1849f3(0x11a),authDefinitions,{'defaultCommand':a151_0x1849f3(0x10b)}),registerDeclarativeService(a151_0x1849f3(0x125),datasetDefinitions),registerDeclarativeService(a151_0x1849f3(0xe6),pageDefinitions),registerDeclarativeService(a151_0x1849f3(0x101),apiDefinitions),registerDeclarativeService(a151_0x1849f3(0x124),dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService('Notification\x20Configuration',notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a151_0x1849f3(0xef),dbDefinitions),registerDeclarativeService(a151_0x1849f3(0xe1),menuDefinitions),registerDeclarativeService(a151_0x1849f3(0x106),taskDefinitions),registerDeclarativeService(a151_0x1849f3(0x119),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a151_0x1849f3(0xfd),appConfigDefinitions),registerDeclarativeService(a151_0x1849f3(0xff),issueDefinitions),registerDeclarativeService(a151_0x1849f3(0xf6),fileDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a151_0x1849f3(0xf0),configDefinitions),registerDeclarativeService(a151_0x1849f3(0xf1),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a151_0x1849f3(0xfa),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a151_0x1849f3(0xf2),cliSkillDefinitions,{'defaultCommand':a151_0x1849f3(0x122)}),registerDeclarativeService(a151_0x1849f3(0x110),logsDefinitions,{'defaultCommand':a151_0x1849f3(0xfb)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a151_0x1849f3(0xe2)]-0x1];last[a151_0x1849f3(0x100)]=[{'command':'<script>','description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':a151_0x1849f3(0x11b),'command':a151_0x1849f3(0x109)},'start':{'service':'run','command':a151_0x1849f3(0x10e)},'build':{'service':a151_0x1849f3(0x105),'command':'build'},'preview':{'service':a151_0x1849f3(0x105),'command':'preview'},'logout':{'service':a151_0x1849f3(0xe7),'command':a151_0x1849f3(0xe0)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a151_0x1849f3(0x123),APP_REMOTE_REMOVED_HINT=a151_0x1849f3(0x120),APP_USE_REMOVED_HINT='Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.';export function resolveRemovedCommand(_0x3b3334,_0x9c7fa){const _0x4e46bb=a151_0x1849f3;if(_0x3b3334===_0x4e46bb(0x104)){const _0x1980f6=_0x9c7fa?_0x4e46bb(0x118)+_0x9c7fa:_0x4e46bb(0x104);return{'command':_0x1980f6,'message':_0x4e46bb(0x113)+_0x1980f6+_0x4e46bb(0xfc),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x3b3334==='skills')return{'command':_0x4e46bb(0xf7),'message':_0x4e46bb(0xe9),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x3b3334===_0x4e46bb(0xdf)&&_0x9c7fa===_0x4e46bb(0xfe))return{'command':'app\x20remote','message':'`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','hint':APP_REMOTE_REMOVED_HINT};if(_0x3b3334===_0x4e46bb(0xdf)&&_0x9c7fa===_0x4e46bb(0xe3))return{'command':_0x4e46bb(0xf3),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a151_0x1849f3(0x109)},'sql':{'new':a151_0x1849f3(0x109)}};export function resolveDeprecatedSubcommand(_0x3890aa,_0x4fc870){return deprecatedSubcommands[_0x3890aa]?.[_0x4fc870];}export function findDefinition(_0x4a698d,_0x533a8c){const _0x4b2c56=a151_0x1849f3;return definitions[_0x4b2c56(0x121)](_0x4a698d+':'+_0x533a8c);}export function isKnownService(_0x3b35ad){const _0x90d782=a151_0x1849f3;return serviceByName[_0x90d782(0x115)](_0x3b35ad);}export function isDeclarativeService(_0x4d52e8){const _0x324871=a151_0x1849f3;return serviceGroups[_0x324871(0x115)](_0x4d52e8)||serviceByName['get'](_0x4d52e8)?.[_0x324871(0x111)]!==undefined;}export function getServiceEntry(_0xc691d6){return serviceByName['get'](_0xc691d6);}export function getLegacyHandler(_0x4d02cb,_0x3aa33b){return undefined;}export function getAllDefinitions(){const _0x1a030c=a151_0x1849f3;return Array[_0x1a030c(0xf4)](definitions[_0x1a030c(0x117)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a152_0x5c5cc8=a152_0x39ac;function a152_0x39ac(_0x47389b,_0x348818){_0x47389b=_0x47389b-0xf5;const _0x5a27b3=a152_0x5a27();let _0x39aca5=_0x5a27b3[_0x47389b];return _0x39aca5;}(function(_0x5ca856,_0x5e2bc0){const _0x50f1f4=a152_0x39ac,_0xfc1c2c=_0x5ca856();while(!![]){try{const _0x1e3454=parseInt(_0x50f1f4(0xfa))/0x1*(-parseInt(_0x50f1f4(0xf5))/0x2)+-parseInt(_0x50f1f4(0xfe))/0x3+-parseInt(_0x50f1f4(0x10d))/0x4+-parseInt(_0x50f1f4(0xf6))/0x5+parseInt(_0x50f1f4(0xf7))/0x6*(-parseInt(_0x50f1f4(0x107))/0x7)+parseInt(_0x50f1f4(0x109))/0x8+-parseInt(_0x50f1f4(0x100))/0x9*(-parseInt(_0x50f1f4(0xff))/0xa);if(_0x1e3454===_0x5e2bc0)break;else _0xfc1c2c['push'](_0xfc1c2c['shift']());}catch(_0x1f389b){_0xfc1c2c['push'](_0xfc1c2c['shift']());}}}(a152_0x5a27,0xb15e1));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';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x166b58){const _0x6a19c8=a152_0x39ac,_0x54319f=_0x166b58[_0x6a19c8(0x10c)]('name')[_0x6a19c8(0xf9)]();if(!_0x54319f)throw CliErrors[_0x6a19c8(0x104)](_0x6a19c8(0xf8),_0x6a19c8(0x105));if(_0x54319f['length']>0x40)throw CliErrors['validation'](_0x6a19c8(0x103));return _0x54319f;}function a152_0x5a27(){const _0x45951c=['role','1372128aVhpLo','POST','write','str','5331744upAZrn','17746nnxPDj','4853480mDvdim','36654tITjsg','name','trim','131XfZhGM','remark','appCode','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','3422535BiSoBZ','20BCyncr','28973709WseEOB','roleName','\x20(id=','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flagMissing','Pass\x20--name\x20<roleName>.','create','1463HpKKBb'];a152_0x5a27=function(){return _0x45951c;};return a152_0x5a27();}export const roleCreate={'service':a152_0x5c5cc8(0x108),'command':a152_0x5c5cc8(0x106),'description':a152_0x5c5cc8(0xfd),'risk':a152_0x5c5cc8(0x10b),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x30101e){readName(_0x30101e);},async 'dryRun'(_0x13b98b){const _0x2baa3c=a152_0x5c5cc8,_0x38d2e3=readName(_0x13b98b),_0x597289=_0x13b98b['str'](_0x2baa3c(0xfb))[_0x2baa3c(0xf9)]()||undefined;return asDryRunResult({'operation':_0x2baa3c(0x106),'selector':{'appCode':_0x13b98b[_0x2baa3c(0xfc)],'roleName':_0x38d2e3},'before':null,'after':{'roleName':_0x38d2e3,'roleType':'CUSTOM','remark':_0x597289},'dryRun':!![],'backend':{'method':_0x2baa3c(0x10a),'path':CREATE_PATH},'warnings':[]},{'method':_0x2baa3c(0x10a),'url':CREATE_PATH});},async 'execute'(_0x387df0){const _0x3ca110=a152_0x5c5cc8,_0x2471f1=readName(_0x387df0),_0x2d2a9e=_0x387df0[_0x3ca110(0x10c)]('remark')['trim']()||undefined,_0x4128d1=await createAppRole({'appCode':_0x387df0['appCode'],'roleName':_0x2471f1,..._0x2d2a9e?{'remark':_0x2d2a9e}:{}});return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x387df0[_0x3ca110(0xfc)],'roleId':_0x4128d1['id'],'roleName':_0x2471f1},'before':null,'after':projectRole(_0x4128d1),'dryRun':![],'backend':{'method':_0x3ca110(0x10a),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x4128d1[_0x3ca110(0x101)]+_0x3ca110(0x102)+_0x4128d1['id']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a153_0x392ba5=a153_0x3da6;(function(_0x5e67bd,_0x9ab43b){const _0x423b21=a153_0x3da6,_0x13c24b=_0x5e67bd();while(!![]){try{const _0x46e16c=-parseInt(_0x423b21(0xd5))/0x1*(parseInt(_0x423b21(0xc8))/0x2)+-parseInt(_0x423b21(0xd7))/0x3*(-parseInt(_0x423b21(0xce))/0x4)+-parseInt(_0x423b21(0xcf))/0x5+-parseInt(_0x423b21(0xd4))/0x6+-parseInt(_0x423b21(0xd6))/0x7+parseInt(_0x423b21(0xdd))/0x8+parseInt(_0x423b21(0xc9))/0x9;if(_0x46e16c===_0x9ab43b)break;else _0x13c24b['push'](_0x13c24b['shift']());}catch(_0x59a9da){_0x13c24b['push'](_0x13c24b['shift']());}}}(a153_0x4dff,0xe167a));import{deleteAppRole}from'../../core/api-client.js';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_0x392ba5(0xd0);export const roleDelete={'service':a153_0x392ba5(0xd2),'command':a153_0x392ba5(0xdb),'description':a153_0x392ba5(0xdc),'risk':a153_0x392ba5(0xca),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3e307d){const _0x3b8dbe=a153_0x392ba5,_0x18416c=_0x3e307d[_0x3b8dbe(0xd3)]('id'),_0x205b34=await getRoleById(_0x3e307d[_0x3b8dbe(0xd1)],_0x18416c);return assertCustomRole(_0x205b34,_0x3b8dbe(0xdb)),asDryRunResult({'operation':'delete','selector':{'appCode':_0x3e307d[_0x3b8dbe(0xd1)],'roleId':_0x18416c,'roleName':_0x205b34[_0x3b8dbe(0xcd)]},'before':projectRole(_0x205b34),'after':null,'dryRun':!![],'backend':{'method':_0x3b8dbe(0xde),'path':DELETE_PATH},'warnings':_0x205b34[_0x3b8dbe(0xd9)]>0x0?[_0x3b8dbe(0xd8)+_0x205b34[_0x3b8dbe(0xd9)]+_0x3b8dbe(0xcc)]:[]},{'method':_0x3b8dbe(0xde),'url':DELETE_PATH});},async 'execute'(_0x5c8e42){const _0x342225=a153_0x392ba5,_0x4607ef=_0x5c8e42[_0x342225(0xd3)]('id'),_0x37497c=await getRoleById(_0x5c8e42[_0x342225(0xd1)],_0x4607ef);return assertCustomRole(_0x37497c,_0x342225(0xdb)),await deleteAppRole(_0x4607ef),{'ok':!![],'data':{'operation':_0x342225(0xdb),'selector':{'appCode':_0x5c8e42[_0x342225(0xd1)],'roleId':_0x4607ef,'roleName':_0x37497c[_0x342225(0xcd)]},'before':projectRole(_0x37497c),'after':null,'dryRun':![],'backend':{'method':_0x342225(0xde),'path':DELETE_PATH},'warnings':[]},'message':_0x342225(0xcb)+_0x37497c[_0x342225(0xcd)]+_0x342225(0xda)+_0x4607ef+')'};}};function a153_0x3da6(_0x194c32,_0x55edb5){_0x194c32=_0x194c32-0xc8;const _0x4dfff1=a153_0x4dff();let _0x3da643=_0x4dfff1[_0x194c32];return _0x3da643;}function a153_0x4dff(){const _0x56f77e=['Role\x20still\x20has\x20','userCount','\x20(id=','delete','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','6239512XuZzWq','POST','2zaKNiC','11941137EErGga','high-risk-write','Deleted\x20role\x20','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','roleName','6251332NZKOrl','2535575gTMJcw','/smartapi/permit/role/delete','appCode','role','num','9434226ihJZeM','176026elESLw','3435565zOYzGP','3blWlIo'];a153_0x4dff=function(){return _0x56f77e;};return a153_0x4dff();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a154_0x10dc35=a154_0x13ac;(function(_0x10210d,_0xf04040){const _0xb72073=a154_0x13ac,_0x10469d=_0x10210d();while(!![]){try{const _0x489b76=-parseInt(_0xb72073(0x1e8))/0x1+-parseInt(_0xb72073(0x1db))/0x2+-parseInt(_0xb72073(0x1dc))/0x3+-parseInt(_0xb72073(0x1df))/0x4*(parseInt(_0xb72073(0x1e3))/0x5)+parseInt(_0xb72073(0x1da))/0x6+parseInt(_0xb72073(0x1e1))/0x7*(-parseInt(_0xb72073(0x1e6))/0x8)+parseInt(_0xb72073(0x1e4))/0x9;if(_0x489b76===_0xf04040)break;else _0x10469d['push'](_0x10469d['shift']());}catch(_0x5dbb16){_0x10469d['push'](_0x10469d['shift']());}}}(a154_0x37af,0x31bf4));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a154_0x37af(){const _0x457102=['532072SYHbMl','129885dqsLSW','roleName','role','556EwKkES','Show\x20a\x20single\x20role\x27s\x20detail','385YENaAr','appCode','10475oCqnyu','12248757helRma','roleType','58304HcsFYR','detail','218297pKdcUb','Role\x20','374784XozODx'];a154_0x37af=function(){return _0x457102;};return a154_0x37af();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a154_0x13ac(_0x4a9ef8,_0x3c89b3){_0x4a9ef8=_0x4a9ef8-0x1d9;const _0x37af90=a154_0x37af();let _0x13ac87=_0x37af90[_0x4a9ef8];return _0x13ac87;}export const roleDetail={'service':a154_0x10dc35(0x1de),'command':a154_0x10dc35(0x1e7),'description':a154_0x10dc35(0x1e0),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x50322a){const _0x4fc67a=a154_0x10dc35,_0x3d24b9=_0x50322a['num']('id'),_0x114133=await getRoleById(_0x50322a[_0x4fc67a(0x1e2)],_0x3d24b9);return{'ok':!![],'data':{'role':projectRole(_0x114133)},'message':_0x4fc67a(0x1d9)+_0x114133[_0x4fc67a(0x1dd)]+'\x20('+_0x114133[_0x4fc67a(0x1e5)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a155_0x15aa(_0x5382b3,_0x300198){_0x5382b3=_0x5382b3-0x1b4;const _0x5d7592=a155_0x5d75();let _0x15aaa2=_0x5d7592[_0x5382b3];return _0x15aaa2;}(function(_0x3acd0d,_0x167f70){const _0x2b23f4=a155_0x15aa,_0x5b52de=_0x3acd0d();while(!![]){try{const _0x29e8a2=-parseInt(_0x2b23f4(0x1b4))/0x1+parseInt(_0x2b23f4(0x1b5))/0x2+parseInt(_0x2b23f4(0x1b6))/0x3+parseInt(_0x2b23f4(0x1bb))/0x4+parseInt(_0x2b23f4(0x1b9))/0x5+parseInt(_0x2b23f4(0x1ba))/0x6*(parseInt(_0x2b23f4(0x1b8))/0x7)+parseInt(_0x2b23f4(0x1b7))/0x8;if(_0x29e8a2===_0x167f70)break;else _0x5b52de['push'](_0x5b52de['shift']());}catch(_0x38d07a){_0x5b52de['push'](_0x5b52de['shift']());}}}(a155_0x5d75,0x4fb04));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a155_0x5d75(){const _0x2f5edb=['1853803vXnBGK','1012820nMGCxV','6DRfPSc','527560sbfEyW','503724CHztxG','143328UTlFeL','322197Ljulbn','414256skynBi'];a155_0x5d75=function(){return _0x2f5edb;};return a155_0x5d75();}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_0x496f53=a156_0x4a97;function a156_0x4a97(_0x469b6e,_0x502cce){_0x469b6e=_0x469b6e-0x9d;const _0x5d616c=a156_0x5d61();let _0x4a97e4=_0x5d616c[_0x469b6e];return _0x4a97e4;}(function(_0xad1f9b,_0x4f5efd){const _0x2ccdfb=a156_0x4a97,_0x3d5704=_0xad1f9b();while(!![]){try{const _0x30b00b=-parseInt(_0x2ccdfb(0xa7))/0x1*(parseInt(_0x2ccdfb(0xb2))/0x2)+parseInt(_0x2ccdfb(0xb4))/0x3*(-parseInt(_0x2ccdfb(0xad))/0x4)+-parseInt(_0x2ccdfb(0xbd))/0x5+parseInt(_0x2ccdfb(0xbc))/0x6*(parseInt(_0x2ccdfb(0xb8))/0x7)+parseInt(_0x2ccdfb(0xb5))/0x8*(parseInt(_0x2ccdfb(0x9e))/0x9)+-parseInt(_0x2ccdfb(0xba))/0xa*(parseInt(_0x2ccdfb(0xa9))/0xb)+-parseInt(_0x2ccdfb(0xbf))/0xc*(-parseInt(_0x2ccdfb(0xc0))/0xd);if(_0x30b00b===_0x4f5efd)break;else _0x3d5704['push'](_0x3d5704['shift']());}catch(_0x167c29){_0x3d5704['push'](_0x3d5704['shift']());}}}(a156_0x5d61,0x86ac0));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=['ADMIN','DEV',a156_0x496f53(0x9f),a156_0x496f53(0xb3)];export const roleList={'service':a156_0x496f53(0xb9),'command':a156_0x496f53(0xaa),'description':a156_0x496f53(0xb0),'risk':a156_0x496f53(0xa3),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a156_0x496f53(0xa8),'type':'string','required':![],'description':a156_0x496f53(0xa2),'enum':ROLE_TYPES},{'name':a156_0x496f53(0xc2),'type':'number','description':a156_0x496f53(0xae),'default':0x1},{'name':'pagesize','type':a156_0x496f53(0xa6),'description':a156_0x496f53(0xb1),'default':0x64}],async 'validate'(_0x4b6b9c){const _0x54b3e6=a156_0x496f53,_0x400db9=_0x4b6b9c[_0x54b3e6(0xbb)]('type')['trim']();if(_0x400db9&&!ROLE_TYPES[_0x54b3e6(0x9d)](_0x400db9[_0x54b3e6(0xb7)]()))throw CliErrors[_0x54b3e6(0xa4)]('Invalid\x20--type\x20\x22'+_0x400db9+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES['join'](',\x20')+'.');const _0x6ff286=_0x4b6b9c[_0x54b3e6(0xac)]('page',0x1),_0x551db3=_0x4b6b9c[_0x54b3e6(0xac)](_0x54b3e6(0xa1),0x64);if(_0x6ff286<0x1)throw CliErrors['validation'](_0x54b3e6(0xa5));if(_0x551db3<0x1||_0x551db3>0x64)throw CliErrors[_0x54b3e6(0xa4)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x314faa){const _0x152c1b=a156_0x496f53,_0x1ddfbb=_0x314faa['num']('page',0x1)||0x1,_0x2fb855=_0x314faa[_0x152c1b(0xac)]('pagesize',0x64)||0x64,_0x46d930=_0x314faa['str']('type')[_0x152c1b(0xab)]()['toUpperCase'](),{items:_0x36a5d2,paging:_0x15417a}=await listAppRoles(_0x314faa[_0x152c1b(0xb6)],{'currentPage':_0x1ddfbb,'pageSize':_0x2fb855}),_0x329347=_0x46d930?_0x36a5d2['filter'](_0x248388=>_0x248388[_0x152c1b(0xaf)]===_0x46d930):_0x36a5d2,_0x8ff3b8=_0x329347[_0x152c1b(0xbe)](projectRole);return{'ok':!![],'data':{'roles':_0x8ff3b8,'paging':_0x15417a},'message':'Found\x20'+_0x8ff3b8[_0x152c1b(0xc1)]+_0x152c1b(0xa0)};}};function a156_0x5d61(){const _0x52c7f7=['120729ujpRAr','role','880PNFsQb','str','366BLdaqN','3120625eLOMpy','map','204aVaMBg','936286HWXJjv','length','page','includes','338589BtFYnw','USER','\x20role(s)','pagesize','Filter\x20by\x20role\x20type','read','validation','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','number','3sWosKm','type','57046xCbRVt','list','trim','num','189412IALlmZ','Page\x20index\x20(1-based)','roleType','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','Page\x20size\x20(1-100)','588658NbAqyf','CUSTOM','54ADvbpE','232ozmnUI','appCode','toUpperCase'];a156_0x5d61=function(){return _0x52c7f7;};return a156_0x5d61();}
|
|
@@ -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_0x300cf4=a157_0x42bc;(function(_0x536047,_0x1acec3){const _0x5b722e=a157_0x42bc,_0x263b32=_0x536047();while(!![]){try{const _0x4334ff=parseInt(_0x5b722e(0x1ff))/0x1*(parseInt(_0x5b722e(0x1f6))/0x2)+parseInt(_0x5b722e(0x1b2))/0x3*(parseInt(_0x5b722e(0x1c2))/0x4)+-parseInt(_0x5b722e(0x1e9))/0x5*(parseInt(_0x5b722e(0x1dd))/0x6)+-parseInt(_0x5b722e(0x1af))/0x7+parseInt(_0x5b722e(0x1f5))/0x8*(-parseInt(_0x5b722e(0x1bf))/0x9)+parseInt(_0x5b722e(0x1ec))/0xa+parseInt(_0x5b722e(0x1be))/0xb;if(_0x4334ff===_0x1acec3)break;else _0x263b32['push'](_0x263b32['shift']());}catch(_0x2ab9c4){_0x263b32['push'](_0x263b32['shift']());}}}(a157_0x4478,0x4a614));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a157_0x42bc(_0x5d75a8,_0x335635){_0x5d75a8=_0x5d75a8-0x1af;const _0x447880=a157_0x4478();let _0x42bc6c=_0x447880[_0x5d75a8];return _0x42bc6c;}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a157_0x4478(){const _0x22781d=['Pass\x20--user\x20<id|name>.','permitCount','expect-user-count','length','name','username','totalCount','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','findIndex','DEV','expectUserCount','User\x20','60aBMOeQ','join','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Missing\x20user\x20reference.','Disambiguate\x20with\x20--role\x20<id>.','filter','test','Role\x20name','user-add','\x22:\x20','USER','POST','95825JFNghQ','string','\x20is\x20already\x20a\x20member\x20of\x20role\x20','439540ZQFFuF','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Optional\x20role\x20remark/description','map','Role\x20id\x20(from\x20`role\x20list`)','push','tenant','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','16672MByDsV','704086gzROas','roleType','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','\x22\x20is\x20ambiguous\x20(ids:\x20','str','flagMissing',';\x20no\x20change.','CUSTOM','\x22\x20not\x20found\x20in\x20app\x20','1vEEZmm','find','splice','Disambiguate\x20with\x20--user\x20<id>.','ADMIN','456827LmKcZJ','appCode','userList','303vAzNdV','role','includes','trim','number','Multiple\x20tenant\x20members\x20match\x20\x22','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','userId','\x20not\x20found\x20in\x20app\x20','dryRun','tenant_code','Role\x20id\x20','3003825QCipCu','900HZtFEx','No\x20tenant\x20member\x20matches\x20\x22','toLowerCase','3996EFzmhL','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','\x20member(s)\x20but\x20role\x20has\x20','flag','validation','remark','user','Role\x20name\x20\x22','/smartapi/permit/user-role/update-user-list','Pass\x20--role\x20<id|name>.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','nickname','roleName'];a157_0x4478=function(){return _0x22781d;};return a157_0x4478();}export const ROLE_ID_FLAG={'name':'id','type':a157_0x300cf4(0x1b6),'required':!![],'description':a157_0x300cf4(0x1f1)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a157_0x300cf4(0x1ce)};export const USER_REF_FLAG={'name':'user','type':'string','required':!![],'description':a157_0x300cf4(0x1f4)};export const NAME_FLAG={'name':a157_0x300cf4(0x1d5),'type':a157_0x300cf4(0x1ea),'required':!![],'description':a157_0x300cf4(0x1e4)};export const USER_NAME_FLAG={'name':a157_0x300cf4(0x1d5),'type':'string','required':!![],'description':a157_0x300cf4(0x1df)};export const REMARK_FLAG={'name':'remark','type':'string','required':![],'description':a157_0x300cf4(0x1ef)};export const EXPECT_USER_COUNT_FLAG={'name':a157_0x300cf4(0x1d3),'type':a157_0x300cf4(0x1b6),'required':![],'description':a157_0x300cf4(0x1ed)};export const BUILTIN_ROLE_TYPES=[a157_0x300cf4(0x203),a157_0x300cf4(0x1da),a157_0x300cf4(0x1e7)];export function isBuiltinRole(_0x580fde){const _0x2075c9=a157_0x300cf4;return BUILTIN_ROLE_TYPES[_0x2075c9(0x1b4)](_0x580fde);}export function assertCustomRole(_0x5032a0,_0x14a2db){const _0x5b81e7=a157_0x300cf4;if(_0x5032a0[_0x5b81e7(0x1f7)]!==_0x5b81e7(0x1fd))throw CliErrors[_0x5b81e7(0x1c8)]('Cannot\x20'+_0x14a2db+'\x20built-in\x20role\x20'+_0x5032a0['roleName']+'\x20('+_0x5032a0[_0x5b81e7(0x1f7)]+').',_0x5b81e7(0x1ee));}export function assertPermConfigurable(_0x25ab12){const _0x190d98=a157_0x300cf4;if(_0x25ab12['roleType']==='DEV'||_0x25ab12[_0x190d98(0x1f7)]==='ADMIN')throw CliErrors[_0x190d98(0x1c8)](_0x190d98(0x1d8)+_0x25ab12[_0x190d98(0x1d0)]+'\x20('+_0x25ab12[_0x190d98(0x1f7)]+').',_0x190d98(0x1f8));}export function projectRole(_0x33317d){const _0xbe58d=a157_0x300cf4;return{'id':_0x33317d['id'],'roleName':_0x33317d[_0xbe58d(0x1d0)],'roleType':_0x33317d[_0xbe58d(0x1f7)],'remark':_0x33317d[_0xbe58d(0x1c9)],'userCount':_0x33317d['userCount'],'permitCount':_0x33317d[_0xbe58d(0x1d2)],'builtin':isBuiltinRole(_0x33317d[_0xbe58d(0x1f7)])};}export async function resolveRoleRef(_0x2a1b40,_0x188d05){const _0xb16166=a157_0x300cf4,_0xbfc0b1=_0x188d05[_0xb16166(0x1b5)]();if(!_0xbfc0b1)throw CliErrors['validation']('Missing\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0xb16166(0x1e3)](_0xbfc0b1))return getRoleById(_0x2a1b40,Number(_0xbfc0b1));const _0x2764f3=await listAllAppRoles(_0x2a1b40),_0x30187c=_0x2764f3[_0xb16166(0x1e2)](_0x440552=>_0x440552['roleName']===_0xbfc0b1);if(_0x30187c['length']===0x0)throw CliErrors['validation'](_0xb16166(0x1cb)+_0xbfc0b1+_0xb16166(0x1fe)+_0x2a1b40+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x30187c[_0xb16166(0x1d4)]>0x1){const _0x1f7cb6=_0x30187c[_0xb16166(0x1f0)](_0x46935a=>_0x46935a['id'])[_0xb16166(0x1de)](',\x20');throw CliErrors[_0xb16166(0x1c8)](_0xb16166(0x1cb)+_0xbfc0b1+_0xb16166(0x1f9)+_0x1f7cb6+').',_0xb16166(0x1e1));}return _0x30187c[0x0];}export async function getRoleById(_0x56380a,_0x340395){const _0x180284=a157_0x300cf4,_0x4e85b2=await getAppRole(_0x340395);if(!_0x4e85b2)throw CliErrors['validation'](_0x180284(0x1bd)+_0x340395+_0x180284(0x1ba)+_0x56380a+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x4e85b2;}async function listAllAppRoles(_0x4f0d03){const _0xc177dd=a157_0x300cf4,_0x272622=0x64,_0x51f16f=[];for(let _0x130fd0=0x1;;_0x130fd0+=0x1){const {items:_0x1986e2,paging:_0x28791f}=await listAppRoles(_0x4f0d03,{'currentPage':_0x130fd0,'pageSize':_0x272622});_0x51f16f[_0xc177dd(0x1f2)](..._0x1986e2);if(_0x1986e2['length']<_0x272622||_0x28791f&&_0x51f16f[_0xc177dd(0x1d4)]>=_0x28791f[_0xc177dd(0x1d7)])return _0x51f16f;}}export async function resolveTenantCode(){const _0x51f139=a157_0x300cf4,_0x33caf9=await getSessionUserInfo(),_0x1ccd0f=_0x33caf9?.[_0x51f139(0x1ca)]?.[_0x51f139(0x1f3)]?.[_0x51f139(0x1bc)];if(!_0x1ccd0f)throw CliErrors['authRequired'](_0x51f139(0x1c3));return _0x1ccd0f;}function matchMember(_0x316daf,_0x472c64){const _0x55e03c=a157_0x300cf4,_0x2cc56e=_0x472c64[_0x55e03c(0x1b5)]()['toLowerCase']();return(_0x316daf['nickname']??'')[_0x55e03c(0x1c1)]()===_0x2cc56e||(_0x316daf[_0x55e03c(0x1d6)]??'')[_0x55e03c(0x1c1)]()===_0x2cc56e;}export async function resolveUserRef(_0x4a8766){const _0x105a7c=a157_0x300cf4,_0x4e8fd5=_0x4a8766[_0x105a7c(0x1b5)]();if(!_0x4e8fd5)throw CliErrors['validation'](_0x105a7c(0x1e0),_0x105a7c(0x1d1));const _0x10c5c7=await resolveTenantCode(),_0x469b86=await getTenantMembers(_0x10c5c7);if(/^\d+$/[_0x105a7c(0x1e3)](_0x4e8fd5)){const _0xc3ddf0=Number(_0x4e8fd5),_0x12971c=_0x469b86[_0x105a7c(0x200)](_0x46f27f=>_0x46f27f[_0x105a7c(0x1b9)]===_0xc3ddf0);return{'userId':_0xc3ddf0,'username':_0x12971c?.[_0x105a7c(0x1d6)]??String(_0xc3ddf0),'nickname':_0x12971c?.[_0x105a7c(0x1cf)],'matchedBy':'id'};}const _0xf728ef=_0x469b86[_0x105a7c(0x1e2)](_0x474c6b=>matchMember(_0x474c6b,_0x4e8fd5));if(_0xf728ef['length']===0x0)throw CliErrors[_0x105a7c(0x1c8)](_0x105a7c(0x1c0)+_0x4e8fd5+'\x22.',_0x105a7c(0x1c4));if(_0xf728ef[_0x105a7c(0x1d4)]>0x1){const _0x109f29=_0xf728ef['map'](_0x131ba0=>(_0x131ba0[_0x105a7c(0x1cf)]??_0x131ba0[_0x105a7c(0x1d6)]??'?')+'('+_0x131ba0[_0x105a7c(0x1b9)]+')')['join'](',\x20');throw CliErrors['validation'](_0x105a7c(0x1b7)+_0x4e8fd5+_0x105a7c(0x1e6)+_0x109f29+'.',_0x105a7c(0x202));}const _0x21ff99=_0xf728ef[0x0];return{'userId':_0x21ff99[_0x105a7c(0x1b9)],'username':_0x21ff99[_0x105a7c(0x1d6)]??String(_0x21ff99['userId']),'nickname':_0x21ff99[_0x105a7c(0x1cf)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a157_0x300cf4(0x1cc);function userIdsOf(_0x1bbf59){const _0x1c437c=a157_0x300cf4;return(_0x1bbf59?.[_0x1c437c(0x1b1)]??[])[_0x1c437c(0x1f0)](_0x23cc2a=>_0x23cc2a[_0x1c437c(0x1b9)]);}export function computeRoleUserMutation(_0x453347){const _0x1e0ff0=a157_0x300cf4,{operation:_0x215c4e,appCode:_0x5dbfbd,roleUsers:_0xd6a9bf,targetRoleId:_0x3f6ff8,user:_0x33f3d4}=_0x453347,_0x173108=_0xd6a9bf[_0x1e0ff0(0x200)](_0x4e18c7=>_0x4e18c7['id']===_0x3f6ff8);if(!_0x173108)throw CliErrors['validation']('Role\x20id\x20'+_0x3f6ff8+_0x1e0ff0(0x1c5),_0x1e0ff0(0x1b8));const _0x10e09b=userIdsOf(_0x173108),_0x47e53d=[];if(_0x453347['expectUserCount']!==undefined&&_0x453347[_0x1e0ff0(0x1db)]!==_0x10e09b[_0x1e0ff0(0x1d4)])throw CliErrors[_0x1e0ff0(0x1c8)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x453347['expectUserCount']+_0x1e0ff0(0x1c6)+_0x10e09b['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x114f0c=_0x10e09b[_0x1e0ff0(0x1b4)](_0x33f3d4['userId']);let _0x3b145e=![];const _0x1002c1=[..._0x173108[_0x1e0ff0(0x1b1)]];if(_0x215c4e===_0x1e0ff0(0x1e5))_0x114f0c?_0x47e53d['push'](_0x1e0ff0(0x1dc)+_0x33f3d4['userId']+_0x1e0ff0(0x1eb)+_0x173108['roleName']+_0x1e0ff0(0x1fc)):(_0x1002c1[_0x1e0ff0(0x1f2)]({'userId':_0x33f3d4['userId'],'username':_0x33f3d4[_0x1e0ff0(0x1d6)],..._0x33f3d4[_0x1e0ff0(0x1cf)]?{'nickname':_0x33f3d4[_0x1e0ff0(0x1cf)]}:{}}),_0x3b145e=!![]);else{if(!_0x114f0c)_0x47e53d['push'](_0x1e0ff0(0x1dc)+_0x33f3d4[_0x1e0ff0(0x1b9)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x173108['roleName']+';\x20no\x20change.');else{const _0x51596a=_0x1002c1[_0x1e0ff0(0x1d9)](_0x5141c0=>_0x5141c0[_0x1e0ff0(0x1b9)]===_0x33f3d4[_0x1e0ff0(0x1b9)]);if(_0x51596a>=0x0)_0x1002c1[_0x1e0ff0(0x201)](_0x51596a,0x1);_0x3b145e=!![];}}const _0x516ad7=_0xd6a9bf[_0x1e0ff0(0x1f0)](_0x4880f1=>_0x4880f1['id']===_0x3f6ff8?{..._0x4880f1,'userList':_0x1002c1}:_0x4880f1),_0x19284e=_0x1002c1[_0x1e0ff0(0x1f0)](_0x1a81cb=>_0x1a81cb[_0x1e0ff0(0x1b9)]),_0x2eb12e={'operation':_0x215c4e,'selector':{'appCode':_0x5dbfbd,'roleId':_0x3f6ff8,'roleName':_0x173108[_0x1e0ff0(0x1d0)],'userId':_0x33f3d4[_0x1e0ff0(0x1b9)]},'before':{'userIds':_0x10e09b},'after':{'userIds':_0x19284e},'dryRun':_0x453347[_0x1e0ff0(0x1bb)],'backend':{'method':_0x1e0ff0(0x1e8),'path':UPDATE_USER_LIST_PATH},'warnings':_0x47e53d};return{'roleList':_0x516ad7,'mutation':_0x2eb12e,'changed':_0x3b145e};}export async function loadRoleUsers(_0x2d3244){return listRoleUsers(_0x2d3244);}export function readRoleRef(_0x21d296){const _0x1d5459=a157_0x300cf4,_0x245128=_0x21d296[_0x1d5459(0x1fa)](_0x1d5459(0x1b3))[_0x1d5459(0x1b5)]();if(!_0x245128)throw CliErrors[_0x1d5459(0x1fb)](_0x1d5459(0x1b3),_0x1d5459(0x1cd));return _0x245128;}export async function prepareUserMutation(_0x1b9ba7,_0x51d75d,_0x47f15e){const _0x272d70=a157_0x300cf4,_0x380a21=readRoleRef(_0x1b9ba7),_0x21b425=_0x1b9ba7[_0x272d70(0x1fa)]('user')[_0x272d70(0x1b5)]();if(!_0x21b425)throw CliErrors[_0x272d70(0x1fb)](_0x272d70(0x1ca),_0x272d70(0x1d1));const _0x181234=_0x1b9ba7[_0x272d70(0x1c7)](_0x272d70(0x1d3)),_0x1f6faf=_0x181234===undefined||_0x181234===null?undefined:Number(_0x181234),_0x433175=await resolveRoleRef(_0x1b9ba7['appCode'],_0x380a21),_0x4e78dc=await resolveUserRef(_0x21b425),_0x4d9661=await loadRoleUsers(_0x1b9ba7[_0x272d70(0x1b0)]);return computeRoleUserMutation({'operation':_0x51d75d,'appCode':_0x1b9ba7[_0x272d70(0x1b0)],'roleUsers':_0x4d9661,'targetRoleId':_0x433175['id'],'user':{'userId':_0x4e78dc[_0x272d70(0x1b9)],'username':_0x4e78dc[_0x272d70(0x1d6)],'nickname':_0x4e78dc['nickname']},'dryRun':_0x47f15e,..._0x1f6faf!==undefined?{'expectUserCount':_0x1f6faf}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a158_0xd84d22=a158_0x5ac4;(function(_0x18bae6,_0x2861b3){const _0x511d46=a158_0x5ac4,_0x45ce3e=_0x18bae6();while(!![]){try{const _0x3ad9a8=-parseInt(_0x511d46(0x16a))/0x1+-parseInt(_0x511d46(0x16d))/0x2+-parseInt(_0x511d46(0x175))/0x3*(-parseInt(_0x511d46(0x165))/0x4)+parseInt(_0x511d46(0x17e))/0x5+parseInt(_0x511d46(0x162))/0x6*(parseInt(_0x511d46(0x17f))/0x7)+parseInt(_0x511d46(0x169))/0x8*(-parseInt(_0x511d46(0x178))/0x9)+-parseInt(_0x511d46(0x173))/0xa;if(_0x3ad9a8===_0x2861b3)break;else _0x45ce3e['push'](_0x45ce3e['shift']());}catch(_0x38bd59){_0x45ce3e['push'](_0x45ce3e['shift']());}}}(a158_0x4bce,0x48057));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a158_0x5ac4(_0x127afc,_0x3efc9b){_0x127afc=_0x127afc-0x160;const _0x4bce3b=a158_0x4bce();let _0x5ac447=_0x4bce3b[_0x127afc];return _0x5ac447;}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=a158_0xd84d22(0x180);function readPatch(_0x23dbef){const _0x1adb54=a158_0xd84d22,_0x1f4a3d=_0x23dbef[_0x1adb54(0x160)](_0x1adb54(0x167)),_0x1c233b=_0x23dbef[_0x1adb54(0x160)](_0x1adb54(0x164)),_0x507cfd={};if(_0x1f4a3d!==undefined&&_0x1f4a3d!==null){const _0x8f168d=String(_0x1f4a3d)[_0x1adb54(0x177)]();if(!_0x8f168d)throw CliErrors[_0x1adb54(0x168)](_0x1adb54(0x172));if(_0x8f168d[_0x1adb54(0x166)]>0x40)throw CliErrors[_0x1adb54(0x168)](_0x1adb54(0x161));_0x507cfd[_0x1adb54(0x170)]=_0x8f168d;}_0x1c233b!==undefined&&_0x1c233b!==null&&(_0x507cfd[_0x1adb54(0x164)]=String(_0x1c233b));if(_0x507cfd[_0x1adb54(0x170)]===undefined&&_0x507cfd[_0x1adb54(0x164)]===undefined)throw CliErrors[_0x1adb54(0x168)](_0x1adb54(0x171),_0x1adb54(0x17a));return _0x507cfd;}function a158_0x4bce(){const _0x4f1d0a=['flag','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','1520598Djdvee','role','remark','1652QEBRmN','length','name','validation','8BdfTPD','215747nHQjck','string','num','413990VvxyhW','appCode','POST','roleName','Nothing\x20to\x20update.','--name\x20cannot\x20be\x20empty.','5319710DDvfYN','update','4137SNqsQh','New\x20role\x20name','trim','2981511BFQUmX','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Updated\x20role\x20','write','\x20(id=','2522990WbEIUU','14HIavjA','/smartapi/permit/role/update'];a158_0x4bce=function(){return _0x4f1d0a;};return a158_0x4bce();}export const roleUpdate={'service':a158_0xd84d22(0x163),'command':a158_0xd84d22(0x174),'description':a158_0xd84d22(0x179),'risk':a158_0xd84d22(0x17c),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a158_0xd84d22(0x167),'type':a158_0xd84d22(0x16b),'required':![],'description':a158_0xd84d22(0x176)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x22bb6d){readPatch(_0x22bb6d);},async 'dryRun'(_0x493b6d){const _0x467932=a158_0xd84d22,_0x331f87=_0x493b6d[_0x467932(0x16c)]('id'),_0x1278c8=readPatch(_0x493b6d),_0x4b904c=await getRoleById(_0x493b6d[_0x467932(0x16e)],_0x331f87);return assertCustomRole(_0x4b904c,'update'),asDryRunResult({'operation':_0x467932(0x174),'selector':{'appCode':_0x493b6d[_0x467932(0x16e)],'roleId':_0x331f87,'roleName':_0x4b904c[_0x467932(0x170)]},'before':projectRole(_0x4b904c),'after':projectRole({..._0x4b904c,..._0x1278c8['roleName']!==undefined?{'roleName':_0x1278c8[_0x467932(0x170)]}:{},..._0x1278c8[_0x467932(0x164)]!==undefined?{'remark':_0x1278c8[_0x467932(0x164)]}:{}}),'dryRun':!![],'backend':{'method':_0x467932(0x16f),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x2c4347){const _0x5ba767=a158_0xd84d22,_0x4f9ba8=_0x2c4347[_0x5ba767(0x16c)]('id'),_0xa8d2ef=readPatch(_0x2c4347),_0x524a46=await getRoleById(_0x2c4347[_0x5ba767(0x16e)],_0x4f9ba8);assertCustomRole(_0x524a46,_0x5ba767(0x174)),await updateAppRole({'id':_0x4f9ba8,'appCode':_0x2c4347[_0x5ba767(0x16e)],..._0xa8d2ef[_0x5ba767(0x170)]!==undefined?{'roleName':_0xa8d2ef[_0x5ba767(0x170)]}:{},..._0xa8d2ef['remark']!==undefined?{'remark':_0xa8d2ef[_0x5ba767(0x164)]}:{}});const _0x48f2c3=await getRoleById(_0x2c4347['appCode'],_0x4f9ba8);return{'ok':!![],'data':{'operation':_0x5ba767(0x174),'selector':{'appCode':_0x2c4347[_0x5ba767(0x16e)],'roleId':_0x4f9ba8,'roleName':_0x48f2c3[_0x5ba767(0x170)]},'before':projectRole(_0x524a46),'after':projectRole(_0x48f2c3),'dryRun':![],'backend':{'method':_0x5ba767(0x16f),'path':UPDATE_PATH},'warnings':[]},'message':_0x5ba767(0x17b)+_0x48f2c3[_0x5ba767(0x170)]+_0x5ba767(0x17d)+_0x4f9ba8+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x2f975d=a159_0x41dc;(function(_0x5c08a0,_0x12d600){const _0x21c18c=a159_0x41dc,_0x3be9a0=_0x5c08a0();while(!![]){try{const _0x3a82d8=-parseInt(_0x21c18c(0xbd))/0x1*(parseInt(_0x21c18c(0xbf))/0x2)+-parseInt(_0x21c18c(0xc1))/0x3+-parseInt(_0x21c18c(0xcb))/0x4+-parseInt(_0x21c18c(0xc0))/0x5*(-parseInt(_0x21c18c(0xc5))/0x6)+-parseInt(_0x21c18c(0xd0))/0x7*(parseInt(_0x21c18c(0xc9))/0x8)+parseInt(_0x21c18c(0xcd))/0x9*(-parseInt(_0x21c18c(0xd1))/0xa)+parseInt(_0x21c18c(0xc8))/0xb*(parseInt(_0x21c18c(0xc4))/0xc);if(_0x3a82d8===_0x12d600)break;else _0x3be9a0['push'](_0x3be9a0['shift']());}catch(_0x3a5680){_0x3be9a0['push'](_0x3be9a0['shift']());}}}(a159_0x13e2,0xda0ec));import{updateRoleUsers}from'../../core/api-client.js';function a159_0x41dc(_0x1096c5,_0x4c873b){_0x1096c5=_0x1096c5-0xbd;const _0x13e285=a159_0x13e2();let _0x41dc1a=_0x13e285[_0x1096c5];return _0x41dc1a;}function a159_0x13e2(){const _0x48e492=['user-add','POST','56sJvxJM','5870pqCsNY','83jqzdHz','roleName','31022fVZAPP','230LaSqoW','674841fhqusA','\x20to\x20role\x20','userId','44989620oJbHYA','150792NyCuXL','Added\x20user\x20','high-risk-write','11RMNvZs','1628384UjUIZr','selector','557240sDxGiM','\x20already\x20in\x20role\x20','11223oKEwwE'];a159_0x13e2=function(){return _0x48e492;};return a159_0x13e2();}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':'role','command':a159_0x2f975d(0xce),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a159_0x2f975d(0xc7),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x361c03){const _0x4624cd=a159_0x2f975d,{mutation:_0x2318b5}=await prepareUserMutation(_0x361c03,_0x4624cd(0xce),!![]);return asDryRunResult(_0x2318b5,{'method':_0x4624cd(0xcf),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x6990b2){const _0xc05220=a159_0x2f975d,{roleList:_0x5dab3c,mutation:_0x18d691,changed:_0x2dae96}=await prepareUserMutation(_0x6990b2,'user-add',![]);return _0x2dae96&&await updateRoleUsers(_0x6990b2['appCode'],_0x5dab3c),{'ok':!![],'data':_0x18d691,'message':_0x2dae96?_0xc05220(0xc6)+_0x18d691['selector'][_0xc05220(0xc3)]+_0xc05220(0xc2)+_0x18d691[_0xc05220(0xca)][_0xc05220(0xbe)]:'No\x20change:\x20user\x20'+_0x18d691['selector'][_0xc05220(0xc3)]+_0xc05220(0xcc)+_0x18d691[_0xc05220(0xca)][_0xc05220(0xbe)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x2d6e1b=a160_0x41bd;(function(_0x517f2b,_0x20f305){const _0x4e5cae=a160_0x41bd,_0x4f99c6=_0x517f2b();while(!![]){try{const _0x51026f=-parseInt(_0x4e5cae(0x1e5))/0x1+-parseInt(_0x4e5cae(0x1e2))/0x2+parseInt(_0x4e5cae(0x1d7))/0x3*(parseInt(_0x4e5cae(0x1e3))/0x4)+-parseInt(_0x4e5cae(0x1e0))/0x5+parseInt(_0x4e5cae(0x1da))/0x6+-parseInt(_0x4e5cae(0x1d4))/0x7*(-parseInt(_0x4e5cae(0x1d2))/0x8)+-parseInt(_0x4e5cae(0x1dc))/0x9*(-parseInt(_0x4e5cae(0x1dd))/0xa);if(_0x51026f===_0x20f305)break;else _0x4f99c6['push'](_0x4f99c6['shift']());}catch(_0x2cfe5b){_0x4f99c6['push'](_0x4f99c6['shift']());}}}(a160_0x4334,0x33010));function a160_0x4334(){const _0x1ed5e1=['9zPvhOA','4871660ZOpzXk','\x20from\x20role\x20','Removed\x20user\x20','881920OGKZau','POST','283106xbBygn','84XepICc','high-risk-write','321290vvhmvf','roleName','userId','727056VbYizs','\x20not\x20in\x20role\x20','21sddMxq','selector','role','6057fFJzOb','No\x20change:\x20user\x20','appCode','275568EkMybM','user-remove'];a160_0x4334=function(){return _0x1ed5e1;};return a160_0x4334();}import{updateRoleUsers}from'../../core/api-client.js';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';function a160_0x41bd(_0x1d10bc,_0x3029bc){_0x1d10bc=_0x1d10bc-0x1d0;const _0x4334bd=a160_0x4334();let _0x41bd70=_0x4334bd[_0x1d10bc];return _0x41bd70;}export const roleUserRemove={'service':a160_0x2d6e1b(0x1d6),'command':a160_0x2d6e1b(0x1db),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a160_0x2d6e1b(0x1e4),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x10eb88){const _0xa57bfb=a160_0x2d6e1b,{mutation:_0x57edf7}=await prepareUserMutation(_0x10eb88,_0xa57bfb(0x1db),!![]);return asDryRunResult(_0x57edf7,{'method':_0xa57bfb(0x1e1),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x53d73c){const _0x2e352d=a160_0x2d6e1b,{roleList:_0x40b94f,mutation:_0x30c6a4,changed:_0x3396f1}=await prepareUserMutation(_0x53d73c,_0x2e352d(0x1db),![]);return _0x3396f1&&await updateRoleUsers(_0x53d73c[_0x2e352d(0x1d9)],_0x40b94f),{'ok':!![],'data':_0x30c6a4,'message':_0x3396f1?_0x2e352d(0x1df)+_0x30c6a4[_0x2e352d(0x1d5)][_0x2e352d(0x1d1)]+_0x2e352d(0x1de)+_0x30c6a4[_0x2e352d(0x1d5)][_0x2e352d(0x1d0)]:_0x2e352d(0x1d8)+_0x30c6a4[_0x2e352d(0x1d5)][_0x2e352d(0x1d1)]+_0x2e352d(0x1d3)+_0x30c6a4['selector'][_0x2e352d(0x1d0)]};}};
|