@lovrabet/rabetbase-cli 2.3.9-beta.3 → 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 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/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 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
const
|
|
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 a157_0x47db1b=a157_0x35ed;(function(_0xa585f5,_0x9ae274){const _0x568d4c=a157_0x35ed,_0x490a9a=_0xa585f5();while(!![]){try{const _0x1b86c2=-parseInt(_0x568d4c(0x150))/0x1+-parseInt(_0x568d4c(0x148))/0x2*(parseInt(_0x568d4c(0x173))/0x3)+-parseInt(_0x568d4c(0x136))/0x4*(-parseInt(_0x568d4c(0x15a))/0x5)+-parseInt(_0x568d4c(0x169))/0x6*(parseInt(_0x568d4c(0x129))/0x7)+parseInt(_0x568d4c(0x159))/0x8+parseInt(_0x568d4c(0x167))/0x9*(-parseInt(_0x568d4c(0x176))/0xa)+parseInt(_0x568d4c(0x161))/0xb;if(_0x1b86c2===_0x9ae274)break;else _0x490a9a['push'](_0x490a9a['shift']());}catch(_0xedce1f){_0x490a9a['push'](_0x490a9a['shift']());}}}(a157_0x3da6,0x48992));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a157_0x47db1b(0x160),'required':!![],'description':a157_0x47db1b(0x13d)};export const ROLE_REF_FLAG={'name':a157_0x47db1b(0x126),'type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x139)};export const USER_REF_FLAG={'name':a157_0x47db1b(0x152),'type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x134)};export const NAME_FLAG={'name':'name','type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x15c)};export const USER_NAME_FLAG={'name':'name','type':a157_0x47db1b(0x13f),'required':!![],'description':a157_0x47db1b(0x172)};export const REMARK_FLAG={'name':a157_0x47db1b(0x162),'type':a157_0x47db1b(0x13f),'required':![],'description':a157_0x47db1b(0x12d)};export const EXPECT_USER_COUNT_FLAG={'name':a157_0x47db1b(0x16f),'type':'number','required':![],'description':a157_0x47db1b(0x15d)};function a157_0x35ed(_0x395130,_0x42b388){_0x395130=_0x395130-0x125;const _0x3da65a=a157_0x3da6();let _0x35ed4c=_0x3da65a[_0x395130];return _0x35ed4c;}export const BUILTIN_ROLE_TYPES=['ADMIN',a157_0x47db1b(0x12e),a157_0x47db1b(0x16a)];export function isBuiltinRole(_0x4ea701){const _0x5c566a=a157_0x47db1b;return BUILTIN_ROLE_TYPES[_0x5c566a(0x145)](_0x4ea701);}export function assertCustomRole(_0xa33889,_0x4369c0){const _0x5c7601=a157_0x47db1b;if(_0xa33889[_0x5c7601(0x156)]!==_0x5c7601(0x151))throw CliErrors[_0x5c7601(0x14c)](_0x5c7601(0x16d)+_0x4369c0+_0x5c7601(0x146)+_0xa33889[_0x5c7601(0x13a)]+'\x20('+_0xa33889[_0x5c7601(0x156)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x1dfe08){const _0x17a8d8=a157_0x47db1b;if(_0x1dfe08[_0x17a8d8(0x156)]===_0x17a8d8(0x12e)||_0x1dfe08['roleType']===_0x17a8d8(0x15b))throw CliErrors[_0x17a8d8(0x14c)](_0x17a8d8(0x155)+_0x1dfe08[_0x17a8d8(0x13a)]+'\x20('+_0x1dfe08[_0x17a8d8(0x156)]+').',_0x17a8d8(0x147));}export function projectRole(_0x1f4517){const _0xc4b04c=a157_0x47db1b;return{'id':_0x1f4517['id'],'roleName':_0x1f4517[_0xc4b04c(0x13a)],'roleType':_0x1f4517[_0xc4b04c(0x156)],'remark':_0x1f4517[_0xc4b04c(0x162)],'userCount':_0x1f4517['userCount'],'permitCount':_0x1f4517[_0xc4b04c(0x14d)],'builtin':isBuiltinRole(_0x1f4517['roleType'])};}export async function resolveRoleRef(_0x30505b,_0x4d0bd7){const _0xe0511a=a157_0x47db1b,_0x1a7648=_0x4d0bd7['trim']();if(!_0x1a7648)throw CliErrors[_0xe0511a(0x14c)](_0xe0511a(0x166),_0xe0511a(0x13e));if(/^\d+$/[_0xe0511a(0x142)](_0x1a7648))return getRoleById(_0x30505b,Number(_0x1a7648));const _0x589ee4=await listAllAppRoles(_0x30505b),_0xdccd7e=_0x589ee4[_0xe0511a(0x131)](_0x43ce67=>_0x43ce67[_0xe0511a(0x13a)]===_0x1a7648);if(_0xdccd7e[_0xe0511a(0x170)]===0x0)throw CliErrors['validation'](_0xe0511a(0x177)+_0x1a7648+_0xe0511a(0x12a)+_0x30505b+'.',_0xe0511a(0x12b));if(_0xdccd7e[_0xe0511a(0x170)]>0x1){const _0x58e47c=_0xdccd7e['map'](_0x3af98d=>_0x3af98d['id'])[_0xe0511a(0x157)](',\x20');throw CliErrors[_0xe0511a(0x14c)](_0xe0511a(0x177)+_0x1a7648+_0xe0511a(0x14e)+_0x58e47c+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0xdccd7e[0x0];}export async function getRoleById(_0x5e6e99,_0x480693){const _0x4bdc15=a157_0x47db1b,_0xdaf2c8=await getAppRole(_0x480693);if(!_0xdaf2c8)throw CliErrors[_0x4bdc15(0x14c)](_0x4bdc15(0x130)+_0x480693+_0x4bdc15(0x174)+_0x5e6e99+'.',_0x4bdc15(0x14b));return _0xdaf2c8;}async function listAllAppRoles(_0x54e081){const _0x32aa8f=a157_0x47db1b,_0x108608=0x64,_0x54f9a8=[];for(let _0x334ada=0x1;;_0x334ada+=0x1){const {items:_0x2b6bc4,paging:_0x445f0f}=await listAppRoles(_0x54e081,{'currentPage':_0x334ada,'pageSize':_0x108608});_0x54f9a8[_0x32aa8f(0x14a)](..._0x2b6bc4);if(_0x2b6bc4[_0x32aa8f(0x170)]<_0x108608||_0x445f0f&&_0x54f9a8[_0x32aa8f(0x170)]>=_0x445f0f[_0x32aa8f(0x175)])return _0x54f9a8;}}export async function resolveTenantCode(){const _0x35dbf6=a157_0x47db1b,_0x2779b8=await getSessionUserInfo(),_0x23641a=_0x2779b8?.['user']?.[_0x35dbf6(0x171)]?.[_0x35dbf6(0x143)];if(!_0x23641a)throw CliErrors['authRequired'](_0x35dbf6(0x163));return _0x23641a;}function matchMember(_0x2d04f6,_0x237dc3){const _0x40bb7c=a157_0x47db1b,_0x2c357f=_0x237dc3[_0x40bb7c(0x133)]()['toLowerCase']();return(_0x2d04f6['nickname']??'')['toLowerCase']()===_0x2c357f||(_0x2d04f6[_0x40bb7c(0x153)]??'')[_0x40bb7c(0x141)]()===_0x2c357f;}export async function resolveUserRef(_0x428331){const _0x518ce6=a157_0x47db1b,_0x5d5c1a=_0x428331[_0x518ce6(0x133)]();if(!_0x5d5c1a)throw CliErrors[_0x518ce6(0x14c)](_0x518ce6(0x125),_0x518ce6(0x135));const _0x491de4=await resolveTenantCode(),_0x557287=await getTenantMembers(_0x491de4);if(/^\d+$/[_0x518ce6(0x142)](_0x5d5c1a)){const _0x1e8e26=Number(_0x5d5c1a),_0x213c26=_0x557287[_0x518ce6(0x12c)](_0x5634e3=>_0x5634e3[_0x518ce6(0x168)]===_0x1e8e26);return{'userId':_0x1e8e26,'username':_0x213c26?.[_0x518ce6(0x153)]??String(_0x1e8e26),'nickname':_0x213c26?.[_0x518ce6(0x149)],'matchedBy':'id'};}const _0x424066=_0x557287[_0x518ce6(0x131)](_0x342b61=>matchMember(_0x342b61,_0x5d5c1a));if(_0x424066[_0x518ce6(0x170)]===0x0)throw CliErrors[_0x518ce6(0x14c)](_0x518ce6(0x154)+_0x5d5c1a+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x424066[_0x518ce6(0x170)]>0x1){const _0x4911ca=_0x424066['map'](_0x272685=>(_0x272685['nickname']??_0x272685[_0x518ce6(0x153)]??'?')+'('+_0x272685['userId']+')')[_0x518ce6(0x157)](',\x20');throw CliErrors[_0x518ce6(0x14c)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x5d5c1a+_0x518ce6(0x16e)+_0x4911ca+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x4d9a61=_0x424066[0x0];return{'userId':_0x4d9a61[_0x518ce6(0x168)],'username':_0x4d9a61[_0x518ce6(0x153)]??String(_0x4d9a61[_0x518ce6(0x168)]),'nickname':_0x4d9a61[_0x518ce6(0x149)],'matchedBy':_0x518ce6(0x13c)};}export const UPDATE_USER_LIST_PATH=a157_0x47db1b(0x165);function userIdsOf(_0x43d612){const _0x131bd2=a157_0x47db1b;return(_0x43d612?.[_0x131bd2(0x16c)]??[])[_0x131bd2(0x12f)](_0x4936c9=>_0x4936c9['userId']);}function a157_0x3da6(){const _0x501bf7=['3641984jDTtzn','1551605Bsohtp','ADMIN','Role\x20name','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','User\x20','\x20member(s)\x20but\x20role\x20has\x20','number','9595960EhBDmv','remark','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','str','/smartapi/permit/user-role/update-user-list','Missing\x20role\x20reference.','54lIMzNd','userId','26766LwVrqg','USER','expectUserCount','userList','Cannot\x20','\x22:\x20','expect-user-count','length','tenant','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','6oGupEJ','\x20not\x20found\x20in\x20app\x20','totalCount','336320vKdmfm','Role\x20name\x20\x22','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20user\x20reference.','role','appCode','flagMissing','91RFnYtl','\x22\x20not\x20found\x20in\x20app\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','find','Optional\x20role\x20remark/description','DEV','map','Role\x20id\x20','filter','\x20is\x20already\x20a\x20member\x20of\x20role\x20','trim','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Pass\x20--user\x20<id|name>.','4tyvKji',';\x20no\x20change.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','roleName','dryRun','name','Role\x20id\x20(from\x20`role\x20list`)','Pass\x20--role\x20<id|name>.','string','user-add','toLowerCase','test','tenant_code','findIndex','includes','\x20built-in\x20role\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','534922JHHinP','nickname','push','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','validation','permitCount','\x22\x20is\x20ambiguous\x20(ids:\x20','POST','545860DqpKJX','CUSTOM','user','username','No\x20tenant\x20member\x20matches\x20\x22','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','roleType','join','\x20not\x20found\x20in\x20the\x20user-role\x20list.'];a157_0x3da6=function(){return _0x501bf7;};return a157_0x3da6();}export function computeRoleUserMutation(_0x58d045){const _0x3d8a67=a157_0x47db1b,{operation:_0x2025fe,appCode:_0xa49190,roleUsers:_0x144466,targetRoleId:_0x417b61,user:_0x6adc83}=_0x58d045,_0x75f037=_0x144466['find'](_0x3f1277=>_0x3f1277['id']===_0x417b61);if(!_0x75f037)throw CliErrors['validation']('Role\x20id\x20'+_0x417b61+_0x3d8a67(0x158),_0x3d8a67(0x14b));const _0x390e60=userIdsOf(_0x75f037),_0x679d35=[];if(_0x58d045[_0x3d8a67(0x16b)]!==undefined&&_0x58d045[_0x3d8a67(0x16b)]!==_0x390e60[_0x3d8a67(0x170)])throw CliErrors[_0x3d8a67(0x14c)](_0x3d8a67(0x178)+_0x58d045[_0x3d8a67(0x16b)]+_0x3d8a67(0x15f)+_0x390e60['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x243086=_0x390e60['includes'](_0x6adc83[_0x3d8a67(0x168)]);let _0x1e0eb7=![];const _0x514d9c=[..._0x75f037[_0x3d8a67(0x16c)]];if(_0x2025fe===_0x3d8a67(0x140))_0x243086?_0x679d35[_0x3d8a67(0x14a)](_0x3d8a67(0x15e)+_0x6adc83[_0x3d8a67(0x168)]+_0x3d8a67(0x132)+_0x75f037[_0x3d8a67(0x13a)]+_0x3d8a67(0x137)):(_0x514d9c[_0x3d8a67(0x14a)]({'userId':_0x6adc83[_0x3d8a67(0x168)],'username':_0x6adc83[_0x3d8a67(0x153)],..._0x6adc83[_0x3d8a67(0x149)]?{'nickname':_0x6adc83[_0x3d8a67(0x149)]}:{}}),_0x1e0eb7=!![]);else{if(!_0x243086)_0x679d35[_0x3d8a67(0x14a)](_0x3d8a67(0x15e)+_0x6adc83[_0x3d8a67(0x168)]+_0x3d8a67(0x138)+_0x75f037[_0x3d8a67(0x13a)]+_0x3d8a67(0x137));else{const _0x563ba1=_0x514d9c[_0x3d8a67(0x144)](_0x19d584=>_0x19d584[_0x3d8a67(0x168)]===_0x6adc83[_0x3d8a67(0x168)]);if(_0x563ba1>=0x0)_0x514d9c['splice'](_0x563ba1,0x1);_0x1e0eb7=!![];}}const _0x1281c8=_0x144466['map'](_0x13ec87=>_0x13ec87['id']===_0x417b61?{..._0x13ec87,'userList':_0x514d9c}:_0x13ec87),_0x493e59=_0x514d9c[_0x3d8a67(0x12f)](_0xf71b07=>_0xf71b07[_0x3d8a67(0x168)]),_0x4da149={'operation':_0x2025fe,'selector':{'appCode':_0xa49190,'roleId':_0x417b61,'roleName':_0x75f037[_0x3d8a67(0x13a)],'userId':_0x6adc83[_0x3d8a67(0x168)]},'before':{'userIds':_0x390e60},'after':{'userIds':_0x493e59},'dryRun':_0x58d045[_0x3d8a67(0x13b)],'backend':{'method':_0x3d8a67(0x14f),'path':UPDATE_USER_LIST_PATH},'warnings':_0x679d35};return{'roleList':_0x1281c8,'mutation':_0x4da149,'changed':_0x1e0eb7};}export async function loadRoleUsers(_0x1c2ab6){return listRoleUsers(_0x1c2ab6);}export function readRoleRef(_0x43babe){const _0x1b36e8=a157_0x47db1b,_0x1da103=_0x43babe['str']('role')[_0x1b36e8(0x133)]();if(!_0x1da103)throw CliErrors[_0x1b36e8(0x128)]('role','Pass\x20--role\x20<id|name>.');return _0x1da103;}export async function prepareUserMutation(_0x20a5ce,_0x539c70,_0x59a48d){const _0x3a4154=a157_0x47db1b,_0x3cbf02=readRoleRef(_0x20a5ce),_0x3458e6=_0x20a5ce[_0x3a4154(0x164)](_0x3a4154(0x152))[_0x3a4154(0x133)]();if(!_0x3458e6)throw CliErrors[_0x3a4154(0x128)](_0x3a4154(0x152),_0x3a4154(0x135));const _0x4781a0=_0x20a5ce['flag']('expect-user-count'),_0xdafdad=_0x4781a0===undefined||_0x4781a0===null?undefined:Number(_0x4781a0),_0x4e3dac=await resolveRoleRef(_0x20a5ce['appCode'],_0x3cbf02),_0x26d2a1=await resolveUserRef(_0x3458e6),_0x195981=await loadRoleUsers(_0x20a5ce[_0x3a4154(0x127)]);return computeRoleUserMutation({'operation':_0x539c70,'appCode':_0x20a5ce[_0x3a4154(0x127)],'roleUsers':_0x195981,'targetRoleId':_0x4e3dac['id'],'user':{'userId':_0x26d2a1[_0x3a4154(0x168)],'username':_0x26d2a1[_0x3a4154(0x153)],'nickname':_0x26d2a1[_0x3a4154(0x149)]},'dryRun':_0x59a48d,..._0xdafdad!==undefined?{'expectUserCount':_0xdafdad}:{}});}
|
|
1
|
+
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
|
-
const
|
|
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
|
-
|
|
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)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a161_0xc79a(_0x480d56,_0xa722f3){_0x480d56=_0x480d56-0x79;const _0x3b389d=a161_0x3b38();let _0xc79a06=_0x3b389d[_0x480d56];return _0xc79a06;}const a161_0x55d611=a161_0xc79a;(function(_0x39c526,_0x384326){const _0x280071=a161_0xc79a,_0x384ad9=_0x39c526();while(!![]){try{const _0x10b5f7=parseInt(_0x280071(0x81))/0x1+parseInt(_0x280071(0x84))/0x2+-parseInt(_0x280071(0x7b))/0x3+-parseInt(_0x280071(0x87))/0x4+parseInt(_0x280071(0x7d))/0x5*(parseInt(_0x280071(0x8b))/0x6)+parseInt(_0x280071(0x7c))/0x7+-parseInt(_0x280071(0x80))/0x8;if(_0x10b5f7===_0x384326)break;else _0x384ad9['push'](_0x384ad9['shift']());}catch(_0x3ab14f){_0x384ad9['push'](_0x384ad9['shift']());}}}(a161_0x3b38,0xc6b27));function a161_0x3b38(){const _0x35a77a=['Pass\x20--name\x20<nickname|username>.','role','2156824EVtOos','userId','username','2497800yqqrFm','read','trim','flagMissing','6789174LSPpMv','nickname','user-resolve','str','1361478wqMess','7543655xfGLdJ','5poqTpD','name','Resolved\x20\x22','16299528nvMqDH','641974LAXqxp'];a161_0x3b38=function(){return _0x35a77a;};return a161_0x3b38();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a161_0x55d611(0x83),'command':a161_0x55d611(0x79),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a161_0x55d611(0x88),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x51c648){const _0x3c1056=a161_0x55d611;if(!_0x51c648[_0x3c1056(0x7a)](_0x3c1056(0x7e))[_0x3c1056(0x89)]())throw CliErrors[_0x3c1056(0x8a)](_0x3c1056(0x7e),_0x3c1056(0x82));},async 'execute'(_0x59e2b2){const _0x19e305=a161_0x55d611,_0x3eec17=_0x59e2b2[_0x19e305(0x7a)]('name')[_0x19e305(0x89)](),_0x2b26a1=await resolveUserRef(_0x3eec17);return{'ok':!![],'data':{'user':{'userId':_0x2b26a1[_0x19e305(0x85)],'username':_0x2b26a1[_0x19e305(0x86)],'nickname':_0x2b26a1[_0x19e305(0x8c)],'matchedBy':_0x2b26a1['matchedBy']}},'message':_0x19e305(0x7f)+_0x3eec17+'\x22\x20→\x20userId\x20'+_0x2b26a1[_0x19e305(0x85)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x4a16b5=a162_0x29d3;function a162_0x29d3(_0x52e830,_0x2cca74){_0x52e830=_0x52e830-0x15c;const _0x512d01=a162_0x512d();let _0x29d3e5=_0x512d01[_0x52e830];return _0x29d3e5;}(function(_0x4e9522,_0x1fe202){const _0x3bdd84=a162_0x29d3,_0x12ef5c=_0x4e9522();while(!![]){try{const _0x364b10=-parseInt(_0x3bdd84(0x171))/0x1*(-parseInt(_0x3bdd84(0x164))/0x2)+parseInt(_0x3bdd84(0x17a))/0x3+-parseInt(_0x3bdd84(0x17c))/0x4+parseInt(_0x3bdd84(0x176))/0x5*(parseInt(_0x3bdd84(0x15f))/0x6)+-parseInt(_0x3bdd84(0x184))/0x7*(parseInt(_0x3bdd84(0x168))/0x8)+parseInt(_0x3bdd84(0x17f))/0x9+-parseInt(_0x3bdd84(0x167))/0xa;if(_0x364b10===_0x1fe202)break;else _0x12ef5c['push'](_0x12ef5c['shift']());}catch(_0x4c2073){_0x12ef5c['push'](_0x12ef5c['shift']());}}}(a162_0x512d,0x718f7));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a162_0x4a16b5(0x170),'dev']);function readPackageScripts(_0x4a3bde){const _0x197db7=a162_0x4a16b5,_0x15123d=resolve(_0x4a3bde,_0x197db7(0x160));if(!existsSync(_0x15123d))return null;try{const _0x2c9daa=JSON[_0x197db7(0x17d)](readFileSync(_0x15123d,_0x197db7(0x18e)));return _0x2c9daa[_0x197db7(0x161)]??{};}catch{return null;}}function detectPackageManager(_0x5c2717){const _0x2b7112=a162_0x4a16b5;if(existsSync(resolve(_0x5c2717,'bun.lockb'))||existsSync(resolve(_0x5c2717,_0x2b7112(0x18d))))return _0x2b7112(0x177);if(existsSync(resolve(_0x5c2717,_0x2b7112(0x165))))return _0x2b7112(0x179);if(existsSync(resolve(_0x5c2717,_0x2b7112(0x175))))return'yarn';return'npm';}async function versionCheck(_0x4175b1){const _0x1569fa=a162_0x4a16b5,_0x1780ce=await checkCliVersion();(_0x1780ce['needsUpgrade']||_0x1780ce[_0x1569fa(0x188)])&&(printCliUpgradeWarning(_0x1780ce),assertCliVersionSupported(_0x1780ce));const _0x54f3bf=await checkSdkVersion(_0x4175b1);if(_0x54f3bf['needsUpgrade'])printSdkUpgradeWarning(_0x54f3bf);}function spawnScript(_0x84a2f4,_0x2dc86f,_0x5444cc,_0x132be1){return new Promise((_0x28bae9,_0xebfa9f)=>{const _0x19441a=a162_0x29d3,_0x33c781=[_0x19441a(0x183),_0x2dc86f,..._0x5444cc],_0x78694f=spawn(_0x84a2f4,_0x33c781,{'cwd':_0x132be1,'stdio':_0x19441a(0x169),'shell':!![],'env':{...process.env,'PATH':''+join(_0x132be1,_0x19441a(0x16f),'.bin')+delimiter+process.env.PATH}});_0x78694f['on'](_0x19441a(0x191),_0x37b8ca=>{const _0x257aea=_0x19441a;if(_0x37b8ca===0x0||_0x37b8ca===null)_0x28bae9();else _0xebfa9f(new Error(_0x84a2f4+_0x257aea(0x172)+_0x2dc86f+_0x257aea(0x163)+_0x37b8ca));}),_0x78694f['on'](_0x19441a(0x15d),_0xebfa9f);});}function spawnViteBuildWatch(_0x57e653){return new Promise((_0x536e02,_0x313ce6)=>{const _0xa95267=a162_0x29d3,_0x2346c2=spawn('vite',[_0xa95267(0x15c),_0xa95267(0x192)],{'cwd':_0x57e653,'stdio':_0xa95267(0x169),'shell':!![],'env':{...process.env,'PATH':''+join(_0x57e653,_0xa95267(0x16f),_0xa95267(0x193))+delimiter+process.env.PATH}});_0x2346c2['on'](_0xa95267(0x191),_0x58feff=>{if(_0x58feff===0x0||_0x58feff===null)_0x536e02();else _0x313ce6(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x58feff));}),_0x2346c2['on'](_0xa95267(0x15d),_0x313ce6);});}function a162_0x512d(){const _0x47f259=['package.json','scripts','validation','\x20exited\x20with\x20code\x20','634iBGsND','pnpm-lock.yaml','watch','11889430zLipBO','8EaUOmB','inherit','args','Enable\x20watch\x20mode\x20for\x20preview','has','preview','log','node_modules','start','2137bsagzw','\x20run\x20','\x20run\x20build','No\x20package.json\x20found\x20in\x20current\x20directory.','yarn.lock','11955ERmnMC','bun','Available:\x20','pnpm','62145MTBCER','\x20run\x20<script>\x0a','1262972JfiWZo','parse','push','4543002jeDFTy','bool','boolean','keys','run','974974SxyPCH','\x0a\x20\x20Available\x20scripts:\x0a','length','read','belowMinimum','Script\x20\x22','Run\x20a\x20package.json\x20script','\x20\x20\x20\x20','No\x20scripts\x20defined\x20in\x20package.json.','bun.lock','utf-8','\x20run\x20preview\x20--watch','\x22\x20not\x20found\x20in\x20package.json.','close','--watch','.bin','all','build','error','join','2274idVovI'];a162_0x512d=function(){return _0x47f259;};return a162_0x512d();}function spawnVitePreview(_0x5cce35){return new Promise((_0xbcf9c5,_0x4539e9)=>{const _0x49cfed=a162_0x29d3,_0x510f7f=spawn('vite',['preview'],{'cwd':_0x5cce35,'stdio':_0x49cfed(0x169),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5cce35,_0x49cfed(0x16f),'.bin')+delimiter+process.env.PATH}});_0x510f7f['on'](_0x49cfed(0x191),_0x58ca49=>{if(_0x58ca49===0x0||_0x58ca49===null)_0xbcf9c5();else _0x4539e9(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x58ca49));}),_0x510f7f['on']('error',_0x4539e9);});}const runFlags=[{'name':a162_0x4a16b5(0x166),'type':a162_0x4a16b5(0x181),'description':a162_0x4a16b5(0x16b),'default':![]}];export const runDefinition={'service':a162_0x4a16b5(0x183),'command':'run','description':a162_0x4a16b5(0x18a),'risk':a162_0x4a16b5(0x187),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2d8fb7=a162_0x4a16b5,_0x3d81af=[];return _0x3d81af[_0x2d8fb7(0x17e)]('\x20\x20EXAMPLES'),_0x3d81af[_0x2d8fb7(0x17e)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20start'),_0x3d81af[_0x2d8fb7(0x17e)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2d8fb7(0x173)),_0x3d81af[_0x2d8fb7(0x17e)](_0x2d8fb7(0x18b)+CLI_BIN_NAME+'\x20run\x20preview'),_0x3d81af[_0x2d8fb7(0x17e)](_0x2d8fb7(0x18b)+CLI_BIN_NAME+_0x2d8fb7(0x18f)),_0x3d81af[_0x2d8fb7(0x15e)]('\x0a');},async 'execute'(_0x505201){const _0x315af3=a162_0x4a16b5,_0x236c3d=process['cwd'](),_0x30afe2=_0x505201[_0x315af3(0x16a)][0x0],_0x583440=_0x505201[_0x315af3(0x16a)]['slice'](0x1),_0x1a72f1=readPackageScripts(_0x236c3d);if(!_0x1a72f1)throw CliErrors[_0x315af3(0x162)](_0x315af3(0x174));if(!_0x30afe2){const _0x900e76=Object[_0x315af3(0x182)](_0x1a72f1);if(_0x900e76[_0x315af3(0x186)]===0x0)console[_0x315af3(0x16e)](_0x315af3(0x18c));else{console[_0x315af3(0x16e)](_0x315af3(0x185));for(const _0x4a84be of _0x900e76){console[_0x315af3(0x16e)](_0x315af3(0x18b)+_0x4a84be);}console[_0x315af3(0x16e)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x315af3(0x17b));}return{'ok':!![]};}if(!_0x1a72f1[_0x30afe2])throw CliErrors[_0x315af3(0x162)](_0x315af3(0x189)+_0x30afe2+_0x315af3(0x190),_0x315af3(0x178)+(Object[_0x315af3(0x182)](_0x1a72f1)[_0x315af3(0x15e)](',\x20')||'(none)'));const _0x58c615=detectPackageManager(_0x236c3d);VERSION_CHECK_SCRIPTS[_0x315af3(0x16c)](_0x30afe2)&&await versionCheck(_0x236c3d);if(_0x30afe2===_0x315af3(0x16d)&&_0x505201[_0x315af3(0x180)](_0x315af3(0x166)))return await Promise[_0x315af3(0x194)]([spawnViteBuildWatch(_0x236c3d),spawnVitePreview(_0x236c3d)]),{'ok':!![]};return await spawnScript(_0x58c615,_0x30afe2,_0x583440,_0x236c3d),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x369067=a163_0x41b5;(function(_0x29a7a2,_0x16e959){const _0x4f311c=a163_0x41b5,_0x450710=_0x29a7a2();while(!![]){try{const _0x10aa99=-parseInt(_0x4f311c(0x6a))/0x1*(parseInt(_0x4f311c(0x68))/0x2)+-parseInt(_0x4f311c(0x69))/0x3+-parseInt(_0x4f311c(0x6c))/0x4*(parseInt(_0x4f311c(0x6f))/0x5)+-parseInt(_0x4f311c(0x70))/0x6*(parseInt(_0x4f311c(0x71))/0x7)+-parseInt(_0x4f311c(0x72))/0x8*(-parseInt(_0x4f311c(0x66))/0x9)+parseInt(_0x4f311c(0x6b))/0xa*(-parseInt(_0x4f311c(0x6e))/0xb)+parseInt(_0x4f311c(0x65))/0xc;if(_0x10aa99===_0x16e959)break;else _0x450710['push'](_0x450710['shift']());}catch(_0x1a170c){_0x450710['push'](_0x450710['shift']());}}}(a163_0x3244,0x30724));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3fc8ae){const _0x4710f6=await buildSchemaPayload();return{'ok':!![],'data':_0x4710f6};}export const schemaDefinition={'service':'schema','command':a163_0x369067(0x67),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a163_0x369067(0x6d),'flags':[],'execute':execute};function a163_0x41b5(_0x1bf0f5,_0x4bd15f){_0x1bf0f5=_0x1bf0f5-0x65;const _0x3244d1=a163_0x3244();let _0x41b5db=_0x3244d1[_0x1bf0f5];return _0x41b5db;}function a163_0x3244(){const _0x459a22=['27GoPIHm','54530LcinyQ','60ANKpKS','json','638Czegcu','122455FnVDHG','24NRiPdT','455427HZnavf','132040TrXOZM','18664356fPictr','117aFHUeA','export','17246EyTIsX','1184364DEmVAg'];a163_0x3244=function(){return _0x459a22;};return a163_0x3244();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a164_0x5a2ef4=a164_0x4e09;(function(_0x15ee02,_0x26fc7d){const _0x3bb970=a164_0x4e09,_0x18fbf3=_0x15ee02();while(!![]){try{const _0x2e61fa=parseInt(_0x3bb970(0x1cb))/0x1+-parseInt(_0x3bb970(0x19f))/0x2*(parseInt(_0x3bb970(0x1c9))/0x3)+-parseInt(_0x3bb970(0x1cf))/0x4+parseInt(_0x3bb970(0x1a3))/0x5*(-parseInt(_0x3bb970(0x1a4))/0x6)+-parseInt(_0x3bb970(0x1b9))/0x7+parseInt(_0x3bb970(0x1b2))/0x8+parseInt(_0x3bb970(0x1a1))/0x9;if(_0x2e61fa===_0x26fc7d)break;else _0x18fbf3['push'](_0x18fbf3['shift']());}catch(_0x1e5697){_0x18fbf3['push'](_0x18fbf3['shift']());}}}(a164_0xe0ab,0xee62c));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a164_0xe0ab(){const _0x183e8b=['dbName','create','nonInteractive','407958CGgkIm','/smartapi/custom/saveUserCustomSql','230046HwUzyC','__manual__','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','普通\x20SQL(sql)','323980oKtfNd','POST','SQL\x20名称不能为空','number','\x20\x20SELECT\x201\x20AS\x20id','length','trim','File\x20already\x20exists:\x20','flagMissing','db-id','catch','sqlRoot','sql','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','dbId\x20不能为空','new','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','12rWeFaJ','mybatisXml','32513715ONQDpQ','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','3707095TMKXwv','6eXKGKV','MyBatis\x20XML(mybatisXml)','sqls','sqlRootDir','sqlName','sqlCode','</select>','utf8','lockFilePath','dbId\x20必须为正整数','SELECT\x201\x20AS\x20id;','请选择目标数据库:','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','parse','736192nHudVf','Local\x20SQL\x20file\x20mode','Created\x20SQL\x20query\x20','mode','请输入目标数据库\x20dbId:','appCode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','9239629Fpuyrq','<server-generated-sqlCode>','description','name','toISOString','string','SQL\x20query\x20display\x20name','str','validation','isFinite','适合带动态标签的\x20MyBatis\x20XML\x20SQL','dbId','join'];a164_0xe0ab=function(){return _0x183e8b;};return a164_0xe0ab();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a164_0x4e09(_0x4a8015,_0x26e290){_0x4a8015=_0x4a8015-0x19f;const _0xe0ab30=a164_0xe0ab();let _0x4e0999=_0xe0ab30[_0x4a8015];return _0x4e0999;}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x43970a){const _0x17abc5=a164_0x4e09;if(_0x43970a===_0x17abc5(0x1a0))return[_0x17abc5(0x1a2),_0x17abc5(0x1d3),_0x17abc5(0x1aa),''][_0x17abc5(0x1c5)]('\x0a');return[_0x17abc5(0x1ae),'']['join']('\x0a');}export const sqlCreate={'service':a164_0x5a2ef4(0x1db),'command':a164_0x5a2ef4(0x1c7),'description':a164_0x5a2ef4(0x1dc),'risk':'high-risk-write','flags':[{'name':a164_0x5a2ef4(0x1bc),'type':a164_0x5a2ef4(0x1be),'description':a164_0x5a2ef4(0x1bf)},{'name':a164_0x5a2ef4(0x1d8),'type':'number','description':'Target\x20database\x20ID'},{'name':a164_0x5a2ef4(0x1b5),'type':a164_0x5a2ef4(0x1be),'enum':['sql','mybatisXml'],'description':a164_0x5a2ef4(0x1b3)}],async 'validate'(_0x1098b2){const _0x5a7845=a164_0x5a2ef4;if(!_0x1098b2[_0x5a7845(0x1c8)])return;if(!_0x1098b2[_0x5a7845(0x1c0)](_0x5a7845(0x1bc))[_0x5a7845(0x1d5)]())throw CliErrors['flagMissing'](_0x5a7845(0x1bc),_0x5a7845(0x1cd));const _0x3a61dc=resolveProvidedDbId(_0x1098b2);if(typeof _0x3a61dc!=='number'||!Number[_0x5a7845(0x1c2)](_0x3a61dc)||_0x3a61dc<=0x0)throw CliErrors['flagMissing'](_0x5a7845(0x1d8),_0x5a7845(0x1b0));if(!_0x1098b2['str'](_0x5a7845(0x1b5))['trim']())throw CliErrors[_0x5a7845(0x1d7)](_0x5a7845(0x1b5),_0x5a7845(0x1b8));},async 'dryRun'(_0xe398ec){const _0x1348da=a164_0x5a2ef4,_0x3a61ce=loadSqlProjectConfig(_0xe398ec[_0x1348da(0x1b7)]),{sqlName:_0x39d16f,dbId:_0x165a81,dbName:_0x159207,mode:_0x13b27b}=await resolveSqlNewInputs(_0xe398ec),_0x22ec63=buildSqlRelativePath(_0x1348da(0x1ba),_0x39d16f,_0x159207,_0x13b27b,_0x165a81),_0x57b5a1=_0x3a61ce['sqlRootDir']+'/'+_0x22ec63;return{'method':_0x1348da(0x1d0),'url':_0x1348da(0x1ca),'body':{'appCode':_0xe398ec[_0x1348da(0x1b7)],'sqlName':_0x39d16f,'dbId':_0x165a81,'mode':_0x13b27b,'localPath':_0x57b5a1},'description':_0x1348da(0x1df)+_0x3a61ce['sqlRootDir']};},async 'execute'(_0x5e7f63){const _0x43eed2=a164_0x5a2ef4,_0x2ca017=loadSqlProjectConfig(_0x5e7f63[_0x43eed2(0x1b7)]),{sqlName:_0x57832c,dbId:_0x11291d,dbName:_0x453de6,mode:_0x5ea0bd}=await resolveSqlNewInputs(_0x5e7f63),_0x198197=generateSqlTemplate(_0x5ea0bd),_0x18e253=await createSqlQuery({'appCode':_0x5e7f63['appCode'],'sqlName':_0x57832c,'dbId':_0x11291d,'sqlContent':_0x198197}),_0x52ed27=ensureRemoteSqlContent(_0x18e253),_0x3e3535=_0x453de6||await getDbName(_0x5e7f63[_0x43eed2(0x1b7)],_0x11291d)[_0x43eed2(0x1d9)](()=>undefined),_0xaaf74f=buildSqlRelativePath(_0x18e253[_0x43eed2(0x1a9)],_0x18e253[_0x43eed2(0x1a8)],_0x3e3535,_0x5ea0bd,_0x11291d),_0xfbc677=_0x2ca017[_0x43eed2(0x1a7)]+'/'+_0xaaf74f,_0xcd28f0=buildLocalSqlFileContent({'sqlCode':_0x18e253[_0x43eed2(0x1a9)],'sqlName':_0x18e253[_0x43eed2(0x1a8)],'dbId':_0x18e253[_0x43eed2(0x1c4)]},_0x52ed27,{'dbName':_0x3e3535,'mode':_0x5ea0bd,'syncedAt':new Date()[_0x43eed2(0x1bd)](),'description':_0x18e253[_0x43eed2(0x1bb)]});if(await fileExists(_0xfbc677))throw CliErrors[_0x43eed2(0x1c1)](_0x43eed2(0x1d6)+_0xfbc677);await ensureParentDirectory(_0xfbc677),await writeFile(_0xfbc677,_0xcd28f0,_0x43eed2(0x1ab));const _0x328631=await readSqlLockFile(_0x2ca017['lockFilePath']),{lockData:_0x1f1b40,appLock:_0x27de0f}=ensureSqlLockScope(_0x328631??createEmptySqlLock(),_0x2ca017[_0x43eed2(0x1b7)],_0x2ca017[_0x43eed2(0x1da)],_0x43eed2(0x1de));return _0x27de0f[_0x43eed2(0x1a6)][_0x18e253[_0x43eed2(0x1a9)]]={...buildSqlLockEntry(_0x18e253,_0x52ed27,computeSqlContentHash(_0xcd28f0),{'dbName':_0x3e3535}),'path':_0xaaf74f,'mode':_0x5ea0bd},_0x27de0f['lastSync']=new Date()[_0x43eed2(0x1bd)](),await writeSqlLockFile(_0x2ca017[_0x43eed2(0x1ac)],_0x1f1b40),{'ok':!![],'data':{'id':_0x18e253['id'],'sqlCode':_0x18e253['sqlCode'],'sqlName':_0x18e253[_0x43eed2(0x1a8)],'dbId':_0x18e253[_0x43eed2(0x1c4)],'path':_0xfbc677,'mode':_0x5ea0bd},'message':_0x43eed2(0x1b4)+_0x18e253[_0x43eed2(0x1a9)]};}};async function resolveSqlNewInputs(_0x2d947e){const _0x57f8ae=await resolveSqlNameInput(_0x2d947e),{dbId:_0x1a2b24,dbName:_0xcb7eae}=await resolveDbSelection(_0x2d947e),_0x18c5b2=await resolveSqlModeInput(_0x2d947e);return{'sqlName':_0x57f8ae,'dbId':_0x1a2b24,'dbName':_0xcb7eae,'mode':_0x18c5b2};}async function resolveSqlNameInput(_0x340f43){const _0x100613=a164_0x5a2ef4,_0x3f59f6=_0x340f43[_0x100613(0x1c0)](_0x100613(0x1bc))[_0x100613(0x1d5)]();if(_0x3f59f6)return _0x3f59f6;if(_0x340f43[_0x100613(0x1c8)])throw CliErrors['flagMissing'](_0x100613(0x1bc),_0x100613(0x1cd));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0xb4f2e3=>_0xb4f2e3[_0x100613(0x1d5)]()?!![]:_0x100613(0x1d1)}))[_0x100613(0x1d5)]();}async function resolveDbSelection(_0x626782){const _0x12db64=a164_0x5a2ef4,_0x43cbfa=resolveProvidedDbId(_0x626782);if(typeof _0x43cbfa==='number'&&Number[_0x12db64(0x1c2)](_0x43cbfa)&&_0x43cbfa>0x0)return{'dbId':_0x43cbfa,'dbName':await getDbName(_0x626782[_0x12db64(0x1b7)],_0x43cbfa)[_0x12db64(0x1d9)](()=>undefined)};if(_0x626782['nonInteractive'])throw CliErrors['flagMissing'](_0x12db64(0x1d8),_0x12db64(0x1b0));const _0x1f00cd=await listDatabases(_0x626782[_0x12db64(0x1b7)])[_0x12db64(0x1d9)](()=>[]);if(_0x1f00cd[_0x12db64(0x1d4)]===0x1)return{'dbId':_0x1f00cd[0x0][_0x12db64(0x1c4)],'dbName':_0x1f00cd[0x0]['dbName']};if(_0x1f00cd[_0x12db64(0x1d4)]>0x1){const _0x18e383=await select({'message':_0x12db64(0x1af),'choices':[..._0x1f00cd['map'](_0x431c21=>({'name':_0x431c21[_0x12db64(0x1c6)]+'\x20('+_0x431c21[_0x12db64(0x1c4)]+')','value':serializeDbSelection(_0x431c21)})),{'name':'✎\x20手动输入\x20dbId','value':_0x12db64(0x1cc)}]});if(_0x18e383!=='__manual__')return deserializeDbSelection(_0x18e383);}const _0x5c27b6=await input({'message':_0x12db64(0x1b6),'validate':_0x4a36d5=>{const _0x340c33=_0x12db64,_0x1bb1c5=_0x4a36d5[_0x340c33(0x1d5)]();if(!_0x1bb1c5)return _0x340c33(0x1dd);const _0x24cd8e=Number(_0x1bb1c5);if(!Number['isInteger'](_0x24cd8e)||_0x24cd8e<=0x0)return _0x340c33(0x1ad);return!![];}});return{'dbId':Number(_0x5c27b6['trim']())};}async function resolveSqlModeInput(_0x149818){const _0x4feb5b=a164_0x5a2ef4,_0x481cf2=_0x149818[_0x4feb5b(0x1c0)](_0x4feb5b(0x1b5))[_0x4feb5b(0x1d5)]();if(_0x481cf2===_0x4feb5b(0x1db)||_0x481cf2===_0x4feb5b(0x1a0))return _0x481cf2;if(_0x149818['nonInteractive'])throw CliErrors[_0x4feb5b(0x1d7)](_0x4feb5b(0x1b5),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x4feb5b(0x1ce),'value':_0x4feb5b(0x1db),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x4feb5b(0x1a5),'value':_0x4feb5b(0x1a0),'description':_0x4feb5b(0x1c3)}]});}function serializeDbSelection(_0x1762ed){const _0x474e52=a164_0x5a2ef4;return JSON['stringify']({'dbId':_0x1762ed[_0x474e52(0x1c4)],'dbName':_0x1762ed['dbName']});}function deserializeDbSelection(_0x1643f0){const _0x5a20e4=a164_0x5a2ef4;try{const _0x5ea944=JSON[_0x5a20e4(0x1b1)](_0x1643f0);if(typeof _0x5ea944[_0x5a20e4(0x1c4)]==='number'&&Number[_0x5a20e4(0x1c2)](_0x5ea944[_0x5a20e4(0x1c4)]))return{'dbId':_0x5ea944[_0x5a20e4(0x1c4)],'dbName':_0x5ea944['dbName']};}catch{}throw CliErrors[_0x5a20e4(0x1c1)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x1643f0);}function resolveProvidedDbId(_0x471f33){const _0x563131=a164_0x5a2ef4,_0x4353ab=_0x471f33['flag']('db-id');if(typeof _0x4353ab===_0x563131(0x1d2)&&Number['isFinite'](_0x4353ab))return _0x4353ab;return undefined;}
|
|
1
|
+
const a164_0x33e086=a164_0x30a2;(function(_0x4963a6,_0x46afad){const _0x2fd205=a164_0x30a2,_0x27a595=_0x4963a6();while(!![]){try{const _0x2dfa87=parseInt(_0x2fd205(0x1ab))/0x1+-parseInt(_0x2fd205(0x1c0))/0x2*(parseInt(_0x2fd205(0x1a1))/0x3)+parseInt(_0x2fd205(0x18b))/0x4+parseInt(_0x2fd205(0x192))/0x5*(-parseInt(_0x2fd205(0x198))/0x6)+parseInt(_0x2fd205(0x1b8))/0x7*(-parseInt(_0x2fd205(0x1bf))/0x8)+-parseInt(_0x2fd205(0x1a3))/0x9+parseInt(_0x2fd205(0x195))/0xa;if(_0x2dfa87===_0x46afad)break;else _0x27a595['push'](_0x27a595['shift']());}catch(_0x1fd9bb){_0x27a595['push'](_0x27a595['shift']());}}}(a164_0x37d1,0x32574));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x88b9f7){const _0x2d57c6=a164_0x30a2;if(_0x88b9f7===_0x2d57c6(0x185))return[_0x2d57c6(0x1a4),_0x2d57c6(0x188),_0x2d57c6(0x19a),''][_0x2d57c6(0x186)]('\x0a');return[_0x2d57c6(0x1b1),''][_0x2d57c6(0x186)]('\x0a');}export const sqlCreate={'service':'sql','command':'create','description':a164_0x33e086(0x1bb),'risk':'high-risk-write','flags':[{'name':a164_0x33e086(0x1c6),'type':a164_0x33e086(0x1ae),'description':a164_0x33e086(0x1a0)},{'name':a164_0x33e086(0x193),'type':'number','description':'Target\x20database\x20ID'},{'name':a164_0x33e086(0x1b3),'type':a164_0x33e086(0x1ae),'enum':[a164_0x33e086(0x1c1),a164_0x33e086(0x185)],'description':a164_0x33e086(0x184)}],async 'validate'(_0x29dfb6){const _0xa6f17f=a164_0x33e086;if(!_0x29dfb6['nonInteractive'])return;if(!_0x29dfb6[_0xa6f17f(0x1c4)](_0xa6f17f(0x1c6))['trim']())throw CliErrors[_0xa6f17f(0x18c)](_0xa6f17f(0x1c6),_0xa6f17f(0x1a8));const _0x465406=resolveProvidedDbId(_0x29dfb6);if(typeof _0x465406!==_0xa6f17f(0x197)||!Number['isFinite'](_0x465406)||_0x465406<=0x0)throw CliErrors[_0xa6f17f(0x18c)](_0xa6f17f(0x193),_0xa6f17f(0x1b9));if(!_0x29dfb6['str']('mode')[_0xa6f17f(0x1ad)]())throw CliErrors['flagMissing'](_0xa6f17f(0x1b3),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x59ce8d){const _0x870881=a164_0x33e086,_0x28fbfd=loadSqlProjectConfig(_0x59ce8d['appCode']),{sqlName:_0x14897d,dbId:_0x11568e,dbName:_0x8410f7,mode:_0x26753a}=await resolveSqlNewInputs(_0x59ce8d),_0xf7a87e=buildSqlRelativePath('<server-generated-sqlCode>',_0x14897d,_0x8410f7,_0x26753a,_0x11568e),_0x44051e=_0x28fbfd[_0x870881(0x1b0)]+'/'+_0xf7a87e;return{'method':_0x870881(0x199),'url':_0x870881(0x1af),'body':{'appCode':_0x59ce8d[_0x870881(0x18f)],'sqlName':_0x14897d,'dbId':_0x11568e,'mode':_0x26753a,'localPath':_0x44051e},'description':_0x870881(0x1b7)+_0x28fbfd[_0x870881(0x1b0)]};},async 'execute'(_0x728b7c){const _0x403088=a164_0x33e086,_0x1f9e5c=loadSqlProjectConfig(_0x728b7c[_0x403088(0x18f)]),{sqlName:_0x122eea,dbId:_0x4765d1,dbName:_0x4da587,mode:_0x587a2d}=await resolveSqlNewInputs(_0x728b7c),_0x207caa=generateSqlTemplate(_0x587a2d),_0xe2c5e4=await createSqlQuery({'appCode':_0x728b7c['appCode'],'sqlName':_0x122eea,'dbId':_0x4765d1,'sqlContent':_0x207caa}),_0x16b3d6=ensureRemoteSqlContent(_0xe2c5e4),_0x19be16=_0x4da587||await getDbName(_0x728b7c[_0x403088(0x18f)],_0x4765d1)[_0x403088(0x1c8)](()=>undefined),_0x1c7b6f=buildSqlRelativePath(_0xe2c5e4[_0x403088(0x19c)],_0xe2c5e4[_0x403088(0x1a7)],_0x19be16,_0x587a2d,_0x4765d1),_0x20c4ca=_0x1f9e5c[_0x403088(0x1b0)]+'/'+_0x1c7b6f,_0x372787=buildLocalSqlFileContent({'sqlCode':_0xe2c5e4[_0x403088(0x19c)],'sqlName':_0xe2c5e4['sqlName'],'dbId':_0xe2c5e4[_0x403088(0x1ac)]},_0x16b3d6,{'dbName':_0x19be16,'mode':_0x587a2d,'syncedAt':new Date()['toISOString'](),'description':_0xe2c5e4[_0x403088(0x1a5)]});if(await fileExists(_0x20c4ca))throw CliErrors[_0x403088(0x1be)](_0x403088(0x190)+_0x20c4ca);await ensureParentDirectory(_0x20c4ca),await writeFile(_0x20c4ca,_0x372787,_0x403088(0x19b));const _0x4b7736=await readSqlLockFile(_0x1f9e5c['lockFilePath']),{lockData:_0x1e170c,appLock:_0xaeb209}=ensureSqlLockScope(_0x4b7736??createEmptySqlLock(),_0x1f9e5c['appCode'],_0x1f9e5c['sqlRoot'],_0x403088(0x1bd));return _0xaeb209[_0x403088(0x1ba)][_0xe2c5e4[_0x403088(0x19c)]]={...buildSqlLockEntry(_0xe2c5e4,_0x16b3d6,computeSqlContentHash(_0x372787),{'dbName':_0x19be16}),'path':_0x1c7b6f,'mode':_0x587a2d},_0xaeb209[_0x403088(0x1a9)]=new Date()[_0x403088(0x183)](),await writeSqlLockFile(_0x1f9e5c[_0x403088(0x1b2)],_0x1e170c),{'ok':!![],'data':{'id':_0xe2c5e4['id'],'sqlCode':_0xe2c5e4[_0x403088(0x19c)],'sqlName':_0xe2c5e4[_0x403088(0x1a7)],'dbId':_0xe2c5e4['dbId'],'path':_0x20c4ca,'mode':_0x587a2d},'message':'Created\x20SQL\x20query\x20'+_0xe2c5e4[_0x403088(0x19c)]};}};async function resolveSqlNewInputs(_0xc09fff){const _0x3ee0d0=await resolveSqlNameInput(_0xc09fff),{dbId:_0x173a4f,dbName:_0x4740c6}=await resolveDbSelection(_0xc09fff),_0x2b9ed9=await resolveSqlModeInput(_0xc09fff);return{'sqlName':_0x3ee0d0,'dbId':_0x173a4f,'dbName':_0x4740c6,'mode':_0x2b9ed9};}async function resolveSqlNameInput(_0x15629f){const _0x2de3bb=a164_0x33e086,_0x45c383=_0x15629f['str'](_0x2de3bb(0x1c6))[_0x2de3bb(0x1ad)]();if(_0x45c383)return _0x45c383;if(_0x15629f[_0x2de3bb(0x191)])throw CliErrors[_0x2de3bb(0x18c)](_0x2de3bb(0x1c6),_0x2de3bb(0x1a8));return(await input({'message':_0x2de3bb(0x1c5),'validate':_0x5257c7=>_0x5257c7[_0x2de3bb(0x1ad)]()?!![]:_0x2de3bb(0x1b6)}))['trim']();}async function resolveDbSelection(_0x1c69c0){const _0x4f1982=a164_0x33e086,_0x2f7459=resolveProvidedDbId(_0x1c69c0);if(typeof _0x2f7459===_0x4f1982(0x197)&&Number['isFinite'](_0x2f7459)&&_0x2f7459>0x0)return{'dbId':_0x2f7459,'dbName':await getDbName(_0x1c69c0[_0x4f1982(0x18f)],_0x2f7459)[_0x4f1982(0x1c8)](()=>undefined)};if(_0x1c69c0[_0x4f1982(0x191)])throw CliErrors[_0x4f1982(0x18c)]('db-id',_0x4f1982(0x1b9));const _0x429a09=await listDatabases(_0x1c69c0[_0x4f1982(0x18f)])[_0x4f1982(0x1c8)](()=>[]);if(_0x429a09[_0x4f1982(0x1c2)]===0x1)return{'dbId':_0x429a09[0x0][_0x4f1982(0x1ac)],'dbName':_0x429a09[0x0][_0x4f1982(0x1c3)]};if(_0x429a09['length']>0x1){const _0x153f1b=await select({'message':_0x4f1982(0x19f),'choices':[..._0x429a09[_0x4f1982(0x1b4)](_0x1cb93f=>({'name':_0x1cb93f[_0x4f1982(0x1c3)]+'\x20('+_0x1cb93f['dbId']+')','value':serializeDbSelection(_0x1cb93f)})),{'name':_0x4f1982(0x1c7),'value':'__manual__'}]});if(_0x153f1b!==_0x4f1982(0x1b5))return deserializeDbSelection(_0x153f1b);}const _0x4a9e4a=await input({'message':_0x4f1982(0x196),'validate':_0xc6c30e=>{const _0x17f884=_0x4f1982,_0x50b519=_0xc6c30e[_0x17f884(0x1ad)]();if(!_0x50b519)return _0x17f884(0x18d);const _0x13265e=Number(_0x50b519);if(!Number[_0x17f884(0x1aa)](_0x13265e)||_0x13265e<=0x0)return _0x17f884(0x19e);return!![];}});return{'dbId':Number(_0x4a9e4a[_0x4f1982(0x1ad)]())};}async function resolveSqlModeInput(_0x30e9c3){const _0x26a004=a164_0x33e086,_0x153f61=_0x30e9c3[_0x26a004(0x1c4)]('mode')[_0x26a004(0x1ad)]();if(_0x153f61===_0x26a004(0x1c1)||_0x153f61===_0x26a004(0x185))return _0x153f61;if(_0x30e9c3[_0x26a004(0x191)])throw CliErrors['flagMissing'](_0x26a004(0x1b3),_0x26a004(0x1a6));return await select({'message':_0x26a004(0x189),'choices':[{'name':'普通\x20SQL(sql)','value':_0x26a004(0x1c1),'description':_0x26a004(0x18a)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x26a004(0x185),'description':_0x26a004(0x19d)}]});}function serializeDbSelection(_0x322938){const _0x20d30d=a164_0x33e086;return JSON[_0x20d30d(0x194)]({'dbId':_0x322938[_0x20d30d(0x1ac)],'dbName':_0x322938[_0x20d30d(0x1c3)]});}function a164_0x37d1(){const _0x12b61c=['number','288WlayHx','POST','</select>','utf8','sqlCode','适合带动态标签的\x20MyBatis\x20XML\x20SQL','dbId\x20必须为正整数','请选择目标数据库:','SQL\x20query\x20display\x20name','39ijwbiL','flag','3496428rgsLkJ','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','description','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlName','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','lastSync','isInteger','52793OHYfwG','dbId','trim','string','/smartapi/custom/saveUserCustomSql','sqlRootDir','SELECT\x201\x20AS\x20id;','lockFilePath','mode','map','__manual__','SQL\x20名称不能为空','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','7zFpXcM','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqls','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','parse','new','validation','2817512jLwObM','27282HnuOnr','sql','length','dbName','str','请输入\x20SQL\x20名称:','name','✎\x20手动输入\x20dbId','catch','toISOString','Local\x20SQL\x20file\x20mode','mybatisXml','join','Invalid\x20database\x20selection\x20payload:\x20','\x20\x20SELECT\x201\x20AS\x20id','请选择本地\x20SQL\x20模式:','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','1443432EDjjVm','flagMissing','dbId\x20不能为空','isFinite','appCode','File\x20already\x20exists:\x20','nonInteractive','4490JFwvYS','db-id','stringify','7536630eksjqN','请输入目标数据库\x20dbId:'];a164_0x37d1=function(){return _0x12b61c;};return a164_0x37d1();}function deserializeDbSelection(_0x15741a){const _0x3e7fc9=a164_0x33e086;try{const _0x4a552b=JSON[_0x3e7fc9(0x1bc)](_0x15741a);if(typeof _0x4a552b[_0x3e7fc9(0x1ac)]===_0x3e7fc9(0x197)&&Number[_0x3e7fc9(0x18e)](_0x4a552b[_0x3e7fc9(0x1ac)]))return{'dbId':_0x4a552b[_0x3e7fc9(0x1ac)],'dbName':_0x4a552b[_0x3e7fc9(0x1c3)]};}catch{}throw CliErrors[_0x3e7fc9(0x1be)](_0x3e7fc9(0x187)+_0x15741a);}function a164_0x30a2(_0x5b797d,_0x3095eb){_0x5b797d=_0x5b797d-0x183;const _0x37d157=a164_0x37d1();let _0x30a2f4=_0x37d157[_0x5b797d];return _0x30a2f4;}function resolveProvidedDbId(_0x212aef){const _0x1a45d2=a164_0x33e086,_0x3be258=_0x212aef[_0x1a45d2(0x1a2)](_0x1a45d2(0x193));if(typeof _0x3be258===_0x1a45d2(0x197)&&Number['isFinite'](_0x3be258))return _0x3be258;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a165_0x4826(){const _0x582996=['fromEntries','3053235rEFCrf','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','filter','delete','lockFilePath','entries','sqlRoot','sql','Would\x20delete\x20SQL\x20','Deleted\x20','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','20RAyekc','sqls','high-risk-write','appCode','lastSync','272280vGarYs','4374416qbgQGO','trashDir','sqlcode','str','7VKYHAI','18kkXclD','remoteId','45128DaiyJv','sqlRootDir','1159926SGEdGd','length','15129521bOFVRn','\x20(local\x20file\x20moved\x20to\x20trash)','replace','projectRoot','POST','3MHpFmG','SQL\x20lock\x20file\x20not\x20found.','startsWith','12tvoWzi','validation','199596kDZqHm'];a165_0x4826=function(){return _0x582996;};return a165_0x4826();}const a165_0x2a0931=a165_0xffc2;(function(_0xecd39b,_0x83b419){const _0x563fb3=a165_0xffc2,_0x316779=_0xecd39b();while(!![]){try{const _0x1f2d09=-parseInt(_0x563fb3(0x86))/0x1*(-parseInt(_0x563fb3(0x6b))/0x2)+parseInt(_0x563fb3(0x74))/0x3*(-parseInt(_0x563fb3(0x79))/0x4)+-parseInt(_0x563fb3(0x7b))/0x5+-parseInt(_0x563fb3(0x6d))/0x6+-parseInt(_0x563fb3(0x68))/0x7*(parseInt(_0x563fb3(0x8c))/0x8)+-parseInt(_0x563fb3(0x69))/0x9*(parseInt(_0x563fb3(0x8b))/0xa)+-parseInt(_0x563fb3(0x6f))/0xb*(-parseInt(_0x563fb3(0x77))/0xc);if(_0x1f2d09===_0x83b419)break;else _0x316779['push'](_0x316779['shift']());}catch(_0x2d7772){_0x316779['push'](_0x316779['shift']());}}}(a165_0x4826,0x5ab6e));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a165_0xffc2(_0x5a6091,_0x254240){_0x5a6091=_0x5a6091-0x68;const _0x4826f6=a165_0x4826();let _0xffc28f=_0x4826f6[_0x5a6091];return _0xffc28f;}import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a165_0x2a0931(0x82),'command':a165_0x2a0931(0x7e),'description':a165_0x2a0931(0x7c),'risk':a165_0x2a0931(0x88),'flags':[SQLCODE_FLAG],async 'validate'(_0x496df9){const _0x33913f=a165_0x2a0931,_0x56adaf=loadSqlProjectConfig(_0x496df9[_0x33913f(0x89)]),_0x3bff8b=await readSqlLockFile(_0x56adaf[_0x33913f(0x7f)]);if(!_0x3bff8b)throw CliErrors[_0x33913f(0x78)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x294399){const _0x52c033=a165_0x2a0931,_0x990485=loadSqlProjectConfig(_0x294399[_0x52c033(0x89)]),_0x1b17bb=await readSqlLockFile(_0x990485[_0x52c033(0x7f)]);if(!_0x1b17bb)throw CliErrors[_0x52c033(0x78)](_0x52c033(0x85));const {appLock:_0x5cf559}=ensureSqlLockScope(_0x1b17bb,_0x294399[_0x52c033(0x89)],_0x990485['sqlRoot'],_0x52c033(0x7e)),_0x150826=_0x294399['str']('sqlcode'),_0x4e1f6c=_0x5cf559[_0x52c033(0x87)][_0x150826];if(!_0x4e1f6c)throw CliErrors[_0x52c033(0x78)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x150826+'\x22.');return{'method':_0x52c033(0x73),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x150826,'id':_0x4e1f6c[_0x52c033(0x6a)],'localPath':resolveLocalSqlFilePath(_0x990485,_0x150826,_0x4e1f6c)},'description':_0x52c033(0x83)+_0x150826+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x990485[_0x52c033(0x8d)]};},async 'execute'(_0x4397d6){const _0x2bff40=a165_0x2a0931,_0x50bc5f=loadSqlProjectConfig(_0x4397d6[_0x2bff40(0x89)]),_0xcd7b5c=await readSqlLockFile(_0x50bc5f['lockFilePath']);if(!_0xcd7b5c)throw CliErrors[_0x2bff40(0x78)](_0x2bff40(0x75));const {lockData:_0x46c7b9,appLock:_0x2c7bd7}=ensureSqlLockScope(_0xcd7b5c,_0x4397d6['appCode'],_0x50bc5f[_0x2bff40(0x81)],_0x2bff40(0x7e)),_0x53371b=_0x4397d6[_0x2bff40(0x8f)](_0x2bff40(0x8e)),_0x1fd213=_0x2c7bd7[_0x2bff40(0x87)][_0x53371b];if(!_0x1fd213)throw CliErrors[_0x2bff40(0x78)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x53371b+'\x22.');await deleteSqlQuery({'id':_0x1fd213[_0x2bff40(0x6a)],'sqlCode':_0x53371b}),_0x2c7bd7[_0x2bff40(0x87)]=Object[_0x2bff40(0x7a)](Object[_0x2bff40(0x80)](_0x2c7bd7[_0x2bff40(0x87)])[_0x2bff40(0x7d)](([_0x368611])=>_0x368611!==_0x53371b)),_0x2c7bd7[_0x2bff40(0x8a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x50bc5f[_0x2bff40(0x7f)],_0x46c7b9);const _0x28478d=resolveLocalSqlFilePath(_0x50bc5f,_0x53371b,_0x1fd213);let _0x49b572;await fileExists(_0x28478d)&&(_0x49b572=await moveToTrash(_0x50bc5f[_0x2bff40(0x72)],_0x50bc5f[_0x2bff40(0x8d)],_0x28478d),await cleanupEmptyDirectories(dirname(_0x28478d),_0x50bc5f[_0x2bff40(0x6c)]));const _0xcf5028={'deleted':_0x53371b,'remoteId':_0x1fd213[_0x2bff40(0x6a)]};if(_0x49b572)_0xcf5028['trashedTo']=_0x49b572;return{'ok':!![],'data':_0xcf5028,'message':_0x2bff40(0x84)+_0x53371b+(_0x49b572?_0x2bff40(0x70):'')};}};async function moveToTrash(_0x420867,_0xa5baec,_0x4503ee){const _0x5d1c05=a165_0x2a0931,_0x191f29=new Date()['toISOString']()[_0x5d1c05(0x71)](/[:.]/g,'-'),_0x367358=relative(_0x420867,_0x4503ee),_0x4f995b=join(_0xa5baec,_0x191f29,_0x367358);return await mkdir(dirname(_0x4f995b),{'recursive':!![]}),await rename(_0x4503ee,_0x4f995b),_0x4f995b;}async function cleanupEmptyDirectories(_0x49c655,_0x42c5c3){const _0x16baee=a165_0x2a0931;let _0xe4fffd=resolve(_0x49c655);const _0x44612b=resolve(_0x42c5c3);while(_0xe4fffd[_0x16baee(0x76)](''+_0x44612b+sep)||_0xe4fffd===_0x44612b){if(_0xe4fffd===_0x44612b)return;try{const _0x2bbcfe=await readdir(_0xe4fffd);if(_0x2bbcfe[_0x16baee(0x6e)]>0x0)return;await rmdir(_0xe4fffd);}catch{return;}_0xe4fffd=dirname(_0xe4fffd);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x2ec610=a166_0xd923;(function(_0x499602,_0x5d5797){const _0x3f6bef=a166_0xd923,_0x320348=_0x499602();while(!![]){try{const _0x25c457=-parseInt(_0x3f6bef(0x103))/0x1*(parseInt(_0x3f6bef(0xfc))/0x2)+-parseInt(_0x3f6bef(0xf8))/0x3*(parseInt(_0x3f6bef(0x102))/0x4)+-parseInt(_0x3f6bef(0xfe))/0x5+parseInt(_0x3f6bef(0x109))/0x6+parseInt(_0x3f6bef(0xfd))/0x7*(-parseInt(_0x3f6bef(0x107))/0x8)+-parseInt(_0x3f6bef(0x10b))/0x9*(-parseInt(_0x3f6bef(0x105))/0xa)+parseInt(_0x3f6bef(0x10d))/0xb;if(_0x25c457===_0x5d5797)break;else _0x320348['push'](_0x320348['shift']());}catch(_0x3d77e4){_0x320348['push'](_0x320348['shift']());}}}(a166_0x36bc,0xcbe29));import{getSqlQueryInfo}from'../../core/api-client.js';function a166_0x36bc(){const _0x17a209=['bool','2036330ZOnFzZ','dbId','8UuOaOS','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','9418446hTUCZL','appCode','9ZGhROO','detail','32973083vxOCBJ','sql','read','6rvxsif','verbose','boolean','sqlName','2Ivlllb','5829887YqLwbM','3823530gPwpvG','description','sqlContent','sqlcode','1843804ANzXxx','1416365GOfOMd'];a166_0x36bc=function(){return _0x17a209;};return a166_0x36bc();}function a166_0xd923(_0x1f023f,_0x340b80){_0x1f023f=_0x1f023f-0xf7;const _0x36bca1=a166_0x36bc();let _0xd923d3=_0x36bca1[_0x1f023f];return _0xd923d3;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a166_0x2ec610(0x10e),'command':a166_0x2ec610(0x10c),'description':a166_0x2ec610(0x108),'risk':a166_0x2ec610(0xf7),'flags':[SQLCODE_FLAG,{'name':a166_0x2ec610(0xf9),'type':a166_0x2ec610(0xfa),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x4e8069){const _0x2ba2c7=a166_0x2ec610,_0xc18b4d=await getSqlQueryInfo(_0x4e8069[_0x2ba2c7(0x10a)],_0x4e8069['str'](_0x2ba2c7(0x101))),_0xbedd6a=_0x4e8069[_0x2ba2c7(0x104)](_0x2ba2c7(0xf9));if(_0xbedd6a)return{'ok':!![],'data':_0xc18b4d};const _0x580680=_0xc18b4d[_0x2ba2c7(0x106)]?await getDbName(_0x4e8069[_0x2ba2c7(0x10a)],_0xc18b4d[_0x2ba2c7(0x106)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xc18b4d['sqlCode'],'sqlName':_0xc18b4d[_0x2ba2c7(0xfb)],'db':_0x580680?_0x580680+'\x20('+_0xc18b4d[_0x2ba2c7(0x106)]+')':_0xc18b4d[_0x2ba2c7(0x106)]??'','description':_0xc18b4d[_0x2ba2c7(0xff)]??'','sqlContent':_0xc18b4d[_0x2ba2c7(0x100)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x47c050=a167_0x2ab9;(function(_0x7a1c9a,_0x170e29){const _0x3ae5be=a167_0x2ab9,_0x138479=_0x7a1c9a();while(!![]){try{const _0xe4c679=parseInt(_0x3ae5be(0xf7))/0x1+-parseInt(_0x3ae5be(0xf2))/0x2+-parseInt(_0x3ae5be(0xf0))/0x3*(-parseInt(_0x3ae5be(0x106))/0x4)+parseInt(_0x3ae5be(0xf9))/0x5*(parseInt(_0x3ae5be(0xf4))/0x6)+parseInt(_0x3ae5be(0x105))/0x7*(-parseInt(_0x3ae5be(0xff))/0x8)+parseInt(_0x3ae5be(0x102))/0x9*(-parseInt(_0x3ae5be(0xf3))/0xa)+parseInt(_0x3ae5be(0x10c))/0xb;if(_0xe4c679===_0x170e29)break;else _0x138479['push'](_0x138479['shift']());}catch(_0x5d2a6f){_0x138479['push'](_0x138479['shift']());}}}(a167_0x440c,0x21476));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a167_0x2ab9(_0x2cf50a,_0x492af6){_0x2cf50a=_0x2cf50a-0xf0;const _0x440c63=a167_0x440c();let _0x2ab989=_0x440c63[_0x2cf50a];return _0x2ab989;}function a167_0x440c(){const _0x5c0a=['876552xmLWtJ','str','execResult','441JPTXse','SQL\x20execution\x20failed','now','14NsTNZc','76IKCrmU','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','sqlcode','appCode','sql','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','2916694nEXFEv','23637ksWtFg','params','463364gkMVIw','48040BlPTLU','66mnQLCu','string','execSuccess','227920PdVXWY','\x20row(s)\x20in\x20','81705fctQhg','length','isArray','Returned\x20','exec','execError'];a167_0x440c=function(){return _0x5c0a;};return a167_0x440c();}export const sqlExec={'service':a167_0x47c050(0x10a),'command':a167_0x47c050(0xfd),'description':a167_0x47c050(0x107),'risk':'read','flags':[SQLCODE_FLAG,{'name':'params','type':a167_0x47c050(0xf5),'description':a167_0x47c050(0x10b)}],async 'execute'(_0x109971){const _0x39992b=a167_0x47c050,_0xb6d4=parseJsonParams(_0x109971[_0x39992b(0x100)](_0x39992b(0xf1))),_0x13537b=Date[_0x39992b(0x104)](),_0x437edf=await executeSql(_0x109971[_0x39992b(0x109)],_0x109971['str'](_0x39992b(0x108)),_0xb6d4),_0x374132=Date[_0x39992b(0x104)]()-_0x13537b,_0x134972=_0x437edf?.[_0x39992b(0x101)]??_0x437edf,_0x2d68a0=_0x437edf?.[_0x39992b(0xf6)]??!![];if(!_0x2d68a0)return{'ok':![],'data':{'error':_0x437edf?.[_0x39992b(0xfe)]||'SQL\x20execution\x20failed','elapsed':_0x374132},'message':_0x39992b(0x103)};const _0x1b2990=Array[_0x39992b(0xfb)](_0x134972)?_0x134972:[];return{'ok':!![],'data':{'rows':_0x1b2990,'rowCount':_0x1b2990[_0x39992b(0xfa)],'elapsed':_0x374132},'message':_0x39992b(0xfc)+_0x1b2990['length']+_0x39992b(0xf8)+_0x374132+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3733f0,_0x33dd14){const _0x29960d=a168_0x9f57,_0x31dc9c=_0x3733f0();while(!![]){try{const _0x4cd48a=-parseInt(_0x29960d(0x12d))/0x1*(-parseInt(_0x29960d(0x139))/0x2)+parseInt(_0x29960d(0x136))/0x3*(-parseInt(_0x29960d(0x138))/0x4)+-parseInt(_0x29960d(0x134))/0x5+-parseInt(_0x29960d(0x133))/0x6*(-parseInt(_0x29960d(0x135))/0x7)+parseInt(_0x29960d(0x12e))/0x8*(parseInt(_0x29960d(0x137))/0x9)+-parseInt(_0x29960d(0x131))/0xa*(parseInt(_0x29960d(0x132))/0xb)+-parseInt(_0x29960d(0x130))/0xc*(-parseInt(_0x29960d(0x12f))/0xd);if(_0x4cd48a===_0x33dd14)break;else _0x31dc9c['push'](_0x31dc9c['shift']());}catch(_0x4b2347){_0x31dc9c['push'](_0x31dc9c['shift']());}}}(a168_0x4cd2,0xbe721));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a168_0x9f57(_0x3ac0c3,_0x139255){_0x3ac0c3=_0x3ac0c3-0x12d;const _0x4cd2bf=a168_0x4cd2();let _0x9f57b7=_0x4cd2bf[_0x3ac0c3];return _0x9f57b7;}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';function a168_0x4cd2(){const _0x12a432=['8GgcrKw','899405FUQYJE','300bBsHHF','1490iktLbl','106436rwEWhL','258TocoCd','2768200IhHSJs','148141VdhHcH','1135359CdWPgi','9400230jOtgUx','12bePKIq','2jfZEzy','226684OdmZlz'];a168_0x4cd2=function(){return _0x12a432;};return a168_0x4cd2();}import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
|