@lovrabet/rabetbase-cli 2.3.12 → 2.3.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/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/external-link-create.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/move.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 a155_0x309357=a155_0x5d6e;(function(_0x49e5a6,_0x1b8eae){const _0x473210=a155_0x5d6e,_0x1079e2=_0x49e5a6();while(!![]){try{const _0x3fb1fe=-parseInt(_0x473210(0x191))/0x1*(parseInt(_0x473210(0x181))/0x2)+parseInt(_0x473210(0x195))/0x3+-parseInt(_0x473210(0x190))/0x4+parseInt(_0x473210(0x18e))/0x5*(-parseInt(_0x473210(0x18b))/0x6)+parseInt(_0x473210(0x182))/0x7+-parseInt(_0x473210(0x185))/0x8+parseInt(_0x473210(0x184))/0x9*(parseInt(_0x473210(0x197))/0xa);if(_0x3fb1fe===_0x1b8eae)break;else _0x1079e2['push'](_0x1079e2['shift']());}catch(_0x2e54be){_0x1079e2['push'](_0x1079e2['shift']());}}}(a155_0x526d,0x706ec));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a155_0x526d(){const _0x43911c=['Role\x20still\x20has\x20','userCount','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','3680550Tinoxw','POST','roleName','5JVgQTA','num','401272QBVEEy','3buglJN','delete','\x20(id=','Deleted\x20role\x20','357378nHrYpb','appCode','2420QvSVZt','250894JncJya','3510304mlkkhE','high-risk-write','44127tWPfUb','2052128HLdGma','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','/smartapi/permit/role/delete'];a155_0x526d=function(){return _0x43911c;};return a155_0x526d();}function a155_0x5d6e(_0x57691e,_0x63c5a9){_0x57691e=_0x57691e-0x181;const _0x526db3=a155_0x526d();let _0x5d6e10=_0x526db3[_0x57691e];return _0x5d6e10;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a155_0x309357(0x187);export const roleDelete={'service':'role','command':a155_0x309357(0x192),'description':a155_0x309357(0x186),'risk':a155_0x309357(0x183),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x10ef92){const _0x1bae03=a155_0x309357,_0x5e077a=_0x10ef92[_0x1bae03(0x18f)]('id'),_0x444c3f=await getRoleById(_0x10ef92['appCode'],_0x5e077a);return assertCustomRole(_0x444c3f,_0x1bae03(0x192)),asDryRunResult({'operation':_0x1bae03(0x192),'selector':{'appCode':_0x10ef92['appCode'],'roleId':_0x5e077a,'roleName':_0x444c3f[_0x1bae03(0x18d)]},'before':projectRole(_0x444c3f),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x444c3f[_0x1bae03(0x189)]>0x0?[_0x1bae03(0x188)+_0x444c3f[_0x1bae03(0x189)]+_0x1bae03(0x18a)]:[]},{'method':_0x1bae03(0x18c),'url':DELETE_PATH});},async 'execute'(_0x5a2b9f){const _0x2be3b8=a155_0x309357,_0x531aad=_0x5a2b9f[_0x2be3b8(0x18f)]('id'),_0x39df95=await getRoleById(_0x5a2b9f[_0x2be3b8(0x196)],_0x531aad);return assertCustomRole(_0x39df95,_0x2be3b8(0x192)),await deleteAppRole(_0x531aad),{'ok':!![],'data':{'operation':_0x2be3b8(0x192),'selector':{'appCode':_0x5a2b9f[_0x2be3b8(0x196)],'roleId':_0x531aad,'roleName':_0x39df95['roleName']},'before':projectRole(_0x39df95),'after':null,'dryRun':![],'backend':{'method':_0x2be3b8(0x18c),'path':DELETE_PATH},'warnings':[]},'message':_0x2be3b8(0x194)+_0x39df95['roleName']+_0x2be3b8(0x193)+_0x531aad+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a156_0x5a4c59=a156_0x86bb;(function(_0x4c6e1a,_0x198324){const _0x2d2ee0=a156_0x86bb,_0x543c3f=_0x4c6e1a();while(!![]){try{const _0x203c40=-parseInt(_0x2d2ee0(0x90))/0x1+-parseInt(_0x2d2ee0(0x89))/0x2+parseInt(_0x2d2ee0(0x87))/0x3*(-parseInt(_0x2d2ee0(0x8b))/0x4)+parseInt(_0x2d2ee0(0x93))/0x5*(-parseInt(_0x2d2ee0(0x8f))/0x6)+-parseInt(_0x2d2ee0(0x8c))/0x7+-parseInt(_0x2d2ee0(0x8d))/0x8*(parseInt(_0x2d2ee0(0x88))/0x9)+parseInt(_0x2d2ee0(0x8e))/0xa;if(_0x203c40===_0x198324)break;else _0x543c3f['push'](_0x543c3f['shift']());}catch(_0x559c5f){_0x543c3f['push'](_0x543c3f['shift']());}}}(a156_0x2aad,0x44f11));function a156_0x2aad(){const _0x250d07=['192AmghZg','454755QuQQzi','detail','appCode','74390GftNzi','roleType','read','Show\x20a\x20single\x20role\x27s\x20detail','role','num','1081137OtRfAw','213093ixNoWQ','565436hYcfGk','roleName','4qZACYF','1209243grKgql','144vUDQlO','24552680SBHROY'];a156_0x2aad=function(){return _0x250d07;};return a156_0x2aad();}function a156_0x86bb(_0x5466bb,_0x286584){_0x5466bb=_0x5466bb-0x86;const _0x2aadd3=a156_0x2aad();let _0x86bbd7=_0x2aadd3[_0x5466bb];return _0x86bbd7;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a156_0x5a4c59(0x97),'command':a156_0x5a4c59(0x91),'description':a156_0x5a4c59(0x96),'risk':a156_0x5a4c59(0x95),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x217478){const _0x3ce935=a156_0x5a4c59,_0x4ed48c=_0x217478[_0x3ce935(0x86)]('id'),_0x2fc4ad=await getRoleById(_0x217478[_0x3ce935(0x92)],_0x4ed48c);return{'ok':!![],'data':{'role':projectRole(_0x2fc4ad)},'message':'Role\x20'+_0x2fc4ad[_0x3ce935(0x8a)]+'\x20('+_0x2fc4ad[_0x3ce935(0x94)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x35c5ba,_0x4cd01f){const _0x5d2a5d=a157_0x1443,_0x1b3fd8=_0x35c5ba();while(!![]){try{const _0x55215f=-parseInt(_0x5d2a5d(0x185))/0x1*(-parseInt(_0x5d2a5d(0x190))/0x2)+parseInt(_0x5d2a5d(0x18d))/0x3*(parseInt(_0x5d2a5d(0x18c))/0x4)+-parseInt(_0x5d2a5d(0x186))/0x5*(-parseInt(_0x5d2a5d(0x18b))/0x6)+-parseInt(_0x5d2a5d(0x18a))/0x7*(parseInt(_0x5d2a5d(0x183))/0x8)+-parseInt(_0x5d2a5d(0x18f))/0x9*(-parseInt(_0x5d2a5d(0x18e))/0xa)+-parseInt(_0x5d2a5d(0x187))/0xb*(parseInt(_0x5d2a5d(0x188))/0xc)+-parseInt(_0x5d2a5d(0x184))/0xd*(-parseInt(_0x5d2a5d(0x189))/0xe);if(_0x55215f===_0x4cd01f)break;else _0x1b3fd8['push'](_0x1b3fd8['shift']());}catch(_0xee6c5){_0x1b3fd8['push'](_0x1b3fd8['shift']());}}}(a157_0x5f33,0xc210c));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';function a157_0x1443(_0x3d1c07,_0x1ea734){_0x3d1c07=_0x3d1c07-0x183;const _0x5f33dd=a157_0x5f33();let _0x1443ef=_0x5f33dd[_0x3d1c07];return _0x1443ef;}function a157_0x5f33(){const _0x4dbd20=['480575loyBsb','15712708WjmAzA','12qiKDYA','1064434RZgvqx','77aAdtyc','30QLISsY','452VaFHiz','19545vHSIno','623820OrvFvo','90EGmYMF','373564Hwgjak','797512dkwdjA','221HhznmH','1CwjIut'];a157_0x5f33=function(){return _0x4dbd20;};return a157_0x5f33();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x408e01=a158_0x2011;function a158_0x2a53(){const _0x611baf=['role','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1502872NclEDf','Found\x20','ADMIN','pagesize','validation','2515938YFMijL','1072236RcKrRb','str','6890712LPucXh','list','CUSTOM','join','Invalid\x20--type\x20\x22','string','1047650GgMwjK','7hcCXXA','3984309ZXVbls','Page\x20size\x20(1-100)','19991286hQpYeF','25XPcLAR','type','map','length','Page\x20index\x20(1-based)','num','DEV','roleType','page','USER','appCode','read','Filter\x20by\x20role\x20type','trim','toUpperCase','number','filter'];a158_0x2a53=function(){return _0x611baf;};return a158_0x2a53();}(function(_0x53cd48,_0xc90a7e){const _0x4e0025=a158_0x2011,_0x78c5af=_0x53cd48();while(!![]){try{const _0x5b3de3=-parseInt(_0x4e0025(0xea))/0x1+parseInt(_0x4e0025(0x107))/0x2+-parseInt(_0x4e0025(0xec))/0x3+-parseInt(_0x4e0025(0xe2))/0x4*(parseInt(_0x4e0025(0xef))/0x5)+parseInt(_0x4e0025(0xe4))/0x6+parseInt(_0x4e0025(0xeb))/0x7*(-parseInt(_0x4e0025(0x102))/0x8)+parseInt(_0x4e0025(0xee))/0x9;if(_0x5b3de3===_0xc90a7e)break;else _0x78c5af['push'](_0x78c5af['shift']());}catch(_0x515e79){_0x78c5af['push'](_0x78c5af['shift']());}}}(a158_0x2a53,0xb0b38));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a158_0x2011(_0x1d84f4,_0x1fd3dc){_0x1d84f4=_0x1d84f4-0xe2;const _0x2a53be=a158_0x2a53();let _0x201199=_0x2a53be[_0x1d84f4];return _0x201199;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a158_0x408e01(0x104),a158_0x408e01(0xf5),a158_0x408e01(0xf8),a158_0x408e01(0xe6)];export const roleList={'service':a158_0x408e01(0x100),'command':a158_0x408e01(0xe5),'description':a158_0x408e01(0x101),'risk':a158_0x408e01(0xfa),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a158_0x408e01(0xf0),'type':a158_0x408e01(0xe9),'required':![],'description':a158_0x408e01(0xfb),'enum':ROLE_TYPES},{'name':'page','type':a158_0x408e01(0xfe),'description':a158_0x408e01(0xf3),'default':0x1},{'name':'pagesize','type':a158_0x408e01(0xfe),'description':a158_0x408e01(0xed),'default':0x64}],async 'validate'(_0x26b791){const _0x3aff76=a158_0x408e01,_0xc5a291=_0x26b791['str']('type')[_0x3aff76(0xfc)]();if(_0xc5a291&&!ROLE_TYPES['includes'](_0xc5a291[_0x3aff76(0xfd)]()))throw CliErrors['validation'](_0x3aff76(0xe8)+_0xc5a291+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x3aff76(0xe7)](',\x20')+'.');const _0x2394e5=_0x26b791[_0x3aff76(0xf4)]('page',0x1),_0x255477=_0x26b791[_0x3aff76(0xf4)](_0x3aff76(0x105),0x64);if(_0x2394e5<0x1)throw CliErrors['validation']('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x255477<0x1||_0x255477>0x64)throw CliErrors[_0x3aff76(0x106)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x161243){const _0x487798=a158_0x408e01,_0x15b295=_0x161243[_0x487798(0xf4)](_0x487798(0xf7),0x1)||0x1,_0x9fbd60=_0x161243[_0x487798(0xf4)]('pagesize',0x64)||0x64,_0x421be=_0x161243[_0x487798(0xe3)](_0x487798(0xf0))['trim']()[_0x487798(0xfd)](),{items:_0x137a1c,paging:_0x2974c9}=await listAppRoles(_0x161243[_0x487798(0xf9)],{'currentPage':_0x15b295,'pageSize':_0x9fbd60}),_0x390db1=_0x421be?_0x137a1c[_0x487798(0xff)](_0x55498c=>_0x55498c[_0x487798(0xf6)]===_0x421be):_0x137a1c,_0x383f91=_0x390db1[_0x487798(0xf1)](projectRole);return{'ok':!![],'data':{'roles':_0x383f91,'paging':_0x2974c9},'message':_0x487798(0x103)+_0x383f91[_0x487798(0xf2)]+'\x20role(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a159_0x117748=a159_0xa3f7;(function(_0x4a79fe,_0xe6872b){const _0x28bbc4=a159_0xa3f7,_0x130f36=_0x4a79fe();while(!![]){try{const _0x5aa06c=-parseInt(_0x28bbc4(0x91))/0x1*(-parseInt(_0x28bbc4(0xa6))/0x2)+parseInt(_0x28bbc4(0x8d))/0x3*(parseInt(_0x28bbc4(0xbb))/0x4)+-parseInt(_0x28bbc4(0x90))/0x5+-parseInt(_0x28bbc4(0x80))/0x6*(-parseInt(_0x28bbc4(0xbf))/0x7)+parseInt(_0x28bbc4(0x9c))/0x8+-parseInt(_0x28bbc4(0x9b))/0x9*(-parseInt(_0x28bbc4(0x84))/0xa)+-parseInt(_0x28bbc4(0x96))/0xb;if(_0x5aa06c===_0xe6872b)break;else _0x130f36['push'](_0x130f36['shift']());}catch(_0x53e464){_0x130f36['push'](_0x130f36['shift']());}}}(a159_0xa201,0xbeb65));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':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a159_0xa3f7(_0x1ef433,_0x230a01){_0x1ef433=_0x1ef433-0x80;const _0xa201d2=a159_0xa201();let _0xa3f71b=_0xa201d2[_0x1ef433];return _0xa3f71b;}export const ROLE_REF_FLAG={'name':a159_0x117748(0xb5),'type':a159_0x117748(0xa5),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':'user','type':a159_0x117748(0xa5),'required':!![],'description':a159_0x117748(0x87)};export const NAME_FLAG={'name':a159_0x117748(0xb2),'type':'string','required':!![],'description':a159_0x117748(0x81)};export const USER_NAME_FLAG={'name':'name','type':a159_0x117748(0xa5),'required':!![],'description':a159_0x117748(0xa4)};export const REMARK_FLAG={'name':'remark','type':a159_0x117748(0xa5),'required':![],'description':a159_0x117748(0xa9)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x117748(0x9f),'type':a159_0x117748(0x9e),'required':![],'description':a159_0x117748(0xc9)};export const BUILTIN_ROLE_TYPES=[a159_0x117748(0x8a),'DEV','USER'];function a159_0xa201(){const _0x3896c2=['username','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Disambiguate\x20with\x20--role\x20<id>.','includes','push',';\x20no\x20change.','nickname','No\x20tenant\x20member\x20matches\x20\x22','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','splice','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x20member(s)\x20but\x20role\x20has\x20','Role\x20name\x20\x22','trim','userList','roleType','test','8907174myxCQu','Role\x20name','tenant','\x20not\x20found\x20in\x20app\x20','619270KlAKLy','expectUserCount','CUSTOM','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Anti-drift\x20check\x20failed:\x20expected\x20','User\x20','ADMIN','flagMissing','/smartapi/permit/user-role/update-user-list','267xlxuWL','str','Cannot\x20','3013280TLPajA','733297StPlez','Multiple\x20tenant\x20members\x20match\x20\x22','filter','dryRun','appCode','52571596CbYFap','\x20built-in\x20role\x20','user-add','flag','roleName','135PPrhMS','8071176tbCMMN','\x22:\x20','number','expect-user-count','\x22\x20is\x20ambiguous\x20(ids:\x20','map','Missing\x20role\x20reference.','DEV','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','string','4FomHBR','userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Optional\x20role\x20remark/description','\x20is\x20already\x20a\x20member\x20of\x20role\x20','userCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Pass\x20--role\x20<id|name>.','findIndex','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','toLowerCase','Pass\x20--user\x20<id|name>.','name','validation','length','role','Disambiguate\x20with\x20--user\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Role\x20id\x20','Missing\x20user\x20reference.','POST','57264nGXHmU','join','user','find','7zOxlDO','authRequired'];a159_0xa201=function(){return _0x3896c2;};return a159_0xa201();}export function isBuiltinRole(_0xf4f569){return BUILTIN_ROLE_TYPES['includes'](_0xf4f569);}export function assertCustomRole(_0x438ab1,_0x255577){const _0x1a6838=a159_0x117748;if(_0x438ab1['roleType']!==_0x1a6838(0x86))throw CliErrors[_0x1a6838(0xb3)](_0x1a6838(0x8f)+_0x255577+_0x1a6838(0x97)+_0x438ab1[_0x1a6838(0x9a)]+'\x20('+_0x438ab1[_0x1a6838(0xd0)]+').',_0x1a6838(0xc2));}export function assertPermConfigurable(_0x124895){const _0x4a8d4b=a159_0x117748;if(_0x124895[_0x4a8d4b(0xd0)]===_0x4a8d4b(0xa3)||_0x124895['roleType']==='ADMIN')throw CliErrors[_0x4a8d4b(0xb3)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x124895[_0x4a8d4b(0x9a)]+'\x20('+_0x124895[_0x4a8d4b(0xd0)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x508ac8){const _0x5a7e86=a159_0x117748;return{'id':_0x508ac8['id'],'roleName':_0x508ac8[_0x5a7e86(0x9a)],'roleType':_0x508ac8['roleType'],'remark':_0x508ac8['remark'],'userCount':_0x508ac8[_0x5a7e86(0xab)],'permitCount':_0x508ac8['permitCount'],'builtin':isBuiltinRole(_0x508ac8[_0x5a7e86(0xd0)])};}export async function resolveRoleRef(_0x4976e8,_0x966cc2){const _0x11d436=a159_0x117748,_0x17f4c8=_0x966cc2[_0x11d436(0xce)]();if(!_0x17f4c8)throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xa2),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x11d436(0xd1)](_0x17f4c8))return getRoleById(_0x4976e8,Number(_0x17f4c8));const _0x5ebe20=await listAllAppRoles(_0x4976e8),_0x223818=_0x5ebe20[_0x11d436(0x93)](_0x2411ab=>_0x2411ab[_0x11d436(0x9a)]===_0x17f4c8);if(_0x223818[_0x11d436(0xb4)]===0x0)throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xcd)+_0x17f4c8+'\x22\x20not\x20found\x20in\x20app\x20'+_0x4976e8+'.',_0x11d436(0xaf));if(_0x223818[_0x11d436(0xb4)]>0x1){const _0x400249=_0x223818['map'](_0x26e64f=>_0x26e64f['id'])[_0x11d436(0xbc)](',\x20');throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xcd)+_0x17f4c8+_0x11d436(0xa0)+_0x400249+').',_0x11d436(0xc3));}return _0x223818[0x0];}export async function getRoleById(_0x53da63,_0x2e4a03){const _0xc28b55=a159_0x117748,_0x215c4b=await getAppRole(_0x2e4a03);if(!_0x215c4b)throw CliErrors['validation'](_0xc28b55(0xb8)+_0x2e4a03+_0xc28b55(0x83)+_0x53da63+'.',_0xc28b55(0xa8));return _0x215c4b;}async function listAllAppRoles(_0x5b0886){const _0x3bb9d6=a159_0x117748,_0x5339ab=0x64,_0x5ca574=[];for(let _0x77319c=0x1;;_0x77319c+=0x1){const {items:_0xe0fc4f,paging:_0x416144}=await listAppRoles(_0x5b0886,{'currentPage':_0x77319c,'pageSize':_0x5339ab});_0x5ca574[_0x3bb9d6(0xc5)](..._0xe0fc4f);if(_0xe0fc4f[_0x3bb9d6(0xb4)]<_0x5339ab||_0x416144&&_0x5ca574[_0x3bb9d6(0xb4)]>=_0x416144['totalCount'])return _0x5ca574;}}export async function resolveTenantCode(){const _0x4d6762=a159_0x117748,_0x58dd37=await getSessionUserInfo(),_0x343917=_0x58dd37?.['user']?.[_0x4d6762(0x82)]?.['tenant_code'];if(!_0x343917)throw CliErrors[_0x4d6762(0xc0)](_0x4d6762(0xac));return _0x343917;}function matchMember(_0x363e97,_0x509b41){const _0x116afe=a159_0x117748,_0x94ebe1=_0x509b41['trim']()[_0x116afe(0xb0)]();return(_0x363e97['nickname']??'')[_0x116afe(0xb0)]()===_0x94ebe1||(_0x363e97[_0x116afe(0xc1)]??'')[_0x116afe(0xb0)]()===_0x94ebe1;}export async function resolveUserRef(_0x4b3563){const _0x462904=a159_0x117748,_0xdc658b=_0x4b3563[_0x462904(0xce)]();if(!_0xdc658b)throw CliErrors[_0x462904(0xb3)](_0x462904(0xb9),_0x462904(0xb1));const _0x4fb61d=await resolveTenantCode(),_0x34265a=await getTenantMembers(_0x4fb61d);if(/^\d+$/[_0x462904(0xd1)](_0xdc658b)){const _0x5c68ba=Number(_0xdc658b),_0x28f8b5=_0x34265a[_0x462904(0xbe)](_0x1f68c7=>_0x1f68c7[_0x462904(0xa7)]===_0x5c68ba);return{'userId':_0x5c68ba,'username':_0x28f8b5?.[_0x462904(0xc1)]??String(_0x5c68ba),'nickname':_0x28f8b5?.['nickname'],'matchedBy':'id'};}const _0x182bec=_0x34265a[_0x462904(0x93)](_0x25deaf=>matchMember(_0x25deaf,_0xdc658b));if(_0x182bec[_0x462904(0xb4)]===0x0)throw CliErrors[_0x462904(0xb3)](_0x462904(0xc8)+_0xdc658b+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x182bec[_0x462904(0xb4)]>0x1){const _0x146454=_0x182bec[_0x462904(0xa1)](_0x31a436=>(_0x31a436['nickname']??_0x31a436[_0x462904(0xc1)]??'?')+'('+_0x31a436['userId']+')')[_0x462904(0xbc)](',\x20');throw CliErrors[_0x462904(0xb3)](_0x462904(0x92)+_0xdc658b+_0x462904(0x9d)+_0x146454+'.',_0x462904(0xb6));}const _0x12462e=_0x182bec[0x0];return{'userId':_0x12462e[_0x462904(0xa7)],'username':_0x12462e['username']??String(_0x12462e[_0x462904(0xa7)]),'nickname':_0x12462e[_0x462904(0xc7)],'matchedBy':_0x462904(0xb2)};}export const UPDATE_USER_LIST_PATH=a159_0x117748(0x8c);function userIdsOf(_0x5e4c94){const _0x1ffa42=a159_0x117748;return(_0x5e4c94?.[_0x1ffa42(0xcf)]??[])[_0x1ffa42(0xa1)](_0x283297=>_0x283297[_0x1ffa42(0xa7)]);}export function computeRoleUserMutation(_0x3b5dac){const _0x5a9ed3=a159_0x117748,{operation:_0x5d2359,appCode:_0x1b98e7,roleUsers:_0x4cf3e8,targetRoleId:_0x2b1236,user:_0x1deed8}=_0x3b5dac,_0x287abb=_0x4cf3e8[_0x5a9ed3(0xbe)](_0x1954a6=>_0x1954a6['id']===_0x2b1236);if(!_0x287abb)throw CliErrors[_0x5a9ed3(0xb3)](_0x5a9ed3(0xb8)+_0x2b1236+_0x5a9ed3(0xb7),_0x5a9ed3(0xa8));const _0x1a0f75=userIdsOf(_0x287abb),_0x2378a5=[];if(_0x3b5dac[_0x5a9ed3(0x85)]!==undefined&&_0x3b5dac['expectUserCount']!==_0x1a0f75['length'])throw CliErrors['validation'](_0x5a9ed3(0x88)+_0x3b5dac[_0x5a9ed3(0x85)]+_0x5a9ed3(0xcc)+_0x1a0f75[_0x5a9ed3(0xb4)]+'.',_0x5a9ed3(0xcb));const _0x416d66=_0x1a0f75[_0x5a9ed3(0xc4)](_0x1deed8[_0x5a9ed3(0xa7)]);let _0x94150=![];const _0xec7841=[..._0x287abb[_0x5a9ed3(0xcf)]];if(_0x5d2359===_0x5a9ed3(0x98))_0x416d66?_0x2378a5[_0x5a9ed3(0xc5)]('User\x20'+_0x1deed8[_0x5a9ed3(0xa7)]+_0x5a9ed3(0xaa)+_0x287abb[_0x5a9ed3(0x9a)]+';\x20no\x20change.'):(_0xec7841[_0x5a9ed3(0xc5)]({'userId':_0x1deed8[_0x5a9ed3(0xa7)],'username':_0x1deed8[_0x5a9ed3(0xc1)],..._0x1deed8[_0x5a9ed3(0xc7)]?{'nickname':_0x1deed8[_0x5a9ed3(0xc7)]}:{}}),_0x94150=!![]);else{if(!_0x416d66)_0x2378a5[_0x5a9ed3(0xc5)](_0x5a9ed3(0x89)+_0x1deed8[_0x5a9ed3(0xa7)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x287abb[_0x5a9ed3(0x9a)]+_0x5a9ed3(0xc6));else{const _0x2fb23c=_0xec7841[_0x5a9ed3(0xae)](_0x44fa55=>_0x44fa55[_0x5a9ed3(0xa7)]===_0x1deed8['userId']);if(_0x2fb23c>=0x0)_0xec7841[_0x5a9ed3(0xca)](_0x2fb23c,0x1);_0x94150=!![];}}const _0x443d65=_0x4cf3e8[_0x5a9ed3(0xa1)](_0x4bd8d6=>_0x4bd8d6['id']===_0x2b1236?{..._0x4bd8d6,'userList':_0xec7841}:_0x4bd8d6),_0x2592da=_0xec7841[_0x5a9ed3(0xa1)](_0x4c27cf=>_0x4c27cf['userId']),_0xb27b4b={'operation':_0x5d2359,'selector':{'appCode':_0x1b98e7,'roleId':_0x2b1236,'roleName':_0x287abb['roleName'],'userId':_0x1deed8[_0x5a9ed3(0xa7)]},'before':{'userIds':_0x1a0f75},'after':{'userIds':_0x2592da},'dryRun':_0x3b5dac[_0x5a9ed3(0x94)],'backend':{'method':_0x5a9ed3(0xba),'path':UPDATE_USER_LIST_PATH},'warnings':_0x2378a5};return{'roleList':_0x443d65,'mutation':_0xb27b4b,'changed':_0x94150};}export async function loadRoleUsers(_0x85d9b9){return listRoleUsers(_0x85d9b9);}export function readRoleRef(_0x4d272b){const _0x5e64e4=a159_0x117748,_0x3feadb=_0x4d272b[_0x5e64e4(0x8e)](_0x5e64e4(0xb5))[_0x5e64e4(0xce)]();if(!_0x3feadb)throw CliErrors['flagMissing'](_0x5e64e4(0xb5),_0x5e64e4(0xad));return _0x3feadb;}export async function prepareUserMutation(_0xa83f04,_0x25acd8,_0x48f1f8){const _0x26f33b=a159_0x117748,_0x4c60d9=readRoleRef(_0xa83f04),_0x2ce28d=_0xa83f04[_0x26f33b(0x8e)](_0x26f33b(0xbd))[_0x26f33b(0xce)]();if(!_0x2ce28d)throw CliErrors[_0x26f33b(0x8b)](_0x26f33b(0xbd),_0x26f33b(0xb1));const _0x55fba6=_0xa83f04[_0x26f33b(0x99)](_0x26f33b(0x9f)),_0x3b6588=_0x55fba6===undefined||_0x55fba6===null?undefined:Number(_0x55fba6),_0x44ab47=await resolveRoleRef(_0xa83f04[_0x26f33b(0x95)],_0x4c60d9),_0x67c442=await resolveUserRef(_0x2ce28d),_0x39a63f=await loadRoleUsers(_0xa83f04['appCode']);return computeRoleUserMutation({'operation':_0x25acd8,'appCode':_0xa83f04[_0x26f33b(0x95)],'roleUsers':_0x39a63f,'targetRoleId':_0x44ab47['id'],'user':{'userId':_0x67c442[_0x26f33b(0xa7)],'username':_0x67c442[_0x26f33b(0xc1)],'nickname':_0x67c442[_0x26f33b(0xc7)]},'dryRun':_0x48f1f8,..._0x3b6588!==undefined?{'expectUserCount':_0x3b6588}:{}});}
|
|
1
|
+
const a159_0x2b9f00=a159_0x2b7c;(function(_0x22c7e2,_0x7efe7a){const _0x597fa2=a159_0x2b7c,_0x44ede2=_0x22c7e2();while(!![]){try{const _0x4d9881=parseInt(_0x597fa2(0x1f2))/0x1*(parseInt(_0x597fa2(0x1ed))/0x2)+parseInt(_0x597fa2(0x1f8))/0x3+-parseInt(_0x597fa2(0x1ce))/0x4*(parseInt(_0x597fa2(0x1cb))/0x5)+-parseInt(_0x597fa2(0x1ea))/0x6+-parseInt(_0x597fa2(0x1d2))/0x7*(-parseInt(_0x597fa2(0x1fd))/0x8)+parseInt(_0x597fa2(0x1ff))/0x9+parseInt(_0x597fa2(0x1d7))/0xa*(-parseInt(_0x597fa2(0x1b4))/0xb);if(_0x4d9881===_0x7efe7a)break;else _0x44ede2['push'](_0x44ede2['shift']());}catch(_0x16a898){_0x44ede2['push'](_0x44ede2['shift']());}}}(a159_0x3f4a,0x840aa));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':a159_0x2b9f00(0x1ee),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x2b9f00(0x1d1),'type':a159_0x2b9f00(0x1eb),'required':!![],'description':a159_0x2b9f00(0x1ca)};export const USER_REF_FLAG={'name':'user','type':'string','required':!![],'description':a159_0x2b9f00(0x1b1)};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a159_0x2b9f00(0x1cc)};export const USER_NAME_FLAG={'name':a159_0x2b9f00(0x1b6),'type':a159_0x2b9f00(0x1eb),'required':!![],'description':a159_0x2b9f00(0x202)};export const REMARK_FLAG={'name':'remark','type':'string','required':![],'description':a159_0x2b9f00(0x1e8)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x2b9f00(0x1b5),'type':a159_0x2b9f00(0x1ee),'required':![],'description':a159_0x2b9f00(0x1cf)};export const BUILTIN_ROLE_TYPES=[a159_0x2b9f00(0x1f5),a159_0x2b9f00(0x1e9),a159_0x2b9f00(0x1ef)];export function isBuiltinRole(_0x5dbb2c){const _0x406fe1=a159_0x2b9f00;return BUILTIN_ROLE_TYPES[_0x406fe1(0x1f4)](_0x5dbb2c);}export function assertCustomRole(_0x33328f,_0x2a8a84){const _0x252dbc=a159_0x2b9f00;if(_0x33328f[_0x252dbc(0x1d8)]!=='CUSTOM')throw CliErrors[_0x252dbc(0x1c8)](_0x252dbc(0x1f1)+_0x2a8a84+'\x20built-in\x20role\x20'+_0x33328f[_0x252dbc(0x1d0)]+'\x20('+_0x33328f[_0x252dbc(0x1d8)]+').',_0x252dbc(0x201));}export function assertPermConfigurable(_0x4cf64b){const _0x511ec9=a159_0x2b9f00;if(_0x4cf64b[_0x511ec9(0x1d8)]===_0x511ec9(0x1e9)||_0x4cf64b[_0x511ec9(0x1d8)]==='ADMIN')throw CliErrors[_0x511ec9(0x1c8)](_0x511ec9(0x1c0)+_0x4cf64b[_0x511ec9(0x1d0)]+'\x20('+_0x4cf64b[_0x511ec9(0x1d8)]+').',_0x511ec9(0x1fa));}export function projectRole(_0x24196b){const _0x3495c6=a159_0x2b9f00;return{'id':_0x24196b['id'],'roleName':_0x24196b[_0x3495c6(0x1d0)],'roleType':_0x24196b['roleType'],'remark':_0x24196b[_0x3495c6(0x1c6)],'userCount':_0x24196b[_0x3495c6(0x1e0)],'permitCount':_0x24196b['permitCount'],'builtin':isBuiltinRole(_0x24196b[_0x3495c6(0x1d8)])};}export async function resolveRoleRef(_0x3febdb,_0x127fb8){const _0x2c1483=a159_0x2b9f00,_0x2ae97b=_0x127fb8[_0x2c1483(0x200)]();if(!_0x2ae97b)throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1f6),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x2c1483(0x1bc)](_0x2ae97b))return getRoleById(_0x3febdb,Number(_0x2ae97b));const _0xd9ddd5=await listAllAppRoles(_0x3febdb),_0x846fd5=_0xd9ddd5[_0x2c1483(0x1da)](_0x1dfaf9=>_0x1dfaf9[_0x2c1483(0x1d0)]===_0x2ae97b);if(_0x846fd5['length']===0x0)throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1c9)+_0x2ae97b+_0x2c1483(0x1d3)+_0x3febdb+'.',_0x2c1483(0x1c2));if(_0x846fd5[_0x2c1483(0x1dc)]>0x1){const _0x1d0eff=_0x846fd5['map'](_0x1daa14=>_0x1daa14['id'])[_0x2c1483(0x1e7)](',\x20');throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1c9)+_0x2ae97b+_0x2c1483(0x1b2)+_0x1d0eff+').',_0x2c1483(0x1b8));}return _0x846fd5[0x0];}export async function getRoleById(_0x30d157,_0x47410d){const _0x47b232=a159_0x2b9f00,_0x69e615=await getAppRole(_0x47410d);if(!_0x69e615)throw CliErrors[_0x47b232(0x1c8)]('Role\x20id\x20'+_0x47410d+_0x47b232(0x1d5)+_0x30d157+'.',_0x47b232(0x1bd));return _0x69e615;}function a159_0x2b7c(_0x38a45c,_0x1d6288){_0x38a45c=_0x38a45c-0x1b0;const _0x3f4a04=a159_0x3f4a();let _0x2b7c97=_0x3f4a04[_0x38a45c];return _0x2b7c97;}async function listAllAppRoles(_0xc13232){const _0x1dd2d2=a159_0x2b9f00,_0x567a00=0x64,_0x1160d8=[];for(let _0x49bdec=0x1;;_0x49bdec+=0x1){const {items:_0x4daa6b,paging:_0xc7cfab}=await listAppRoles(_0xc13232,{'currentPage':_0x49bdec,'pageSize':_0x567a00});_0x1160d8[_0x1dd2d2(0x1e3)](..._0x4daa6b);if(_0x4daa6b[_0x1dd2d2(0x1dc)]<_0x567a00||_0xc7cfab&&_0x1160d8['length']>=_0xc7cfab[_0x1dd2d2(0x1fb)])return _0x1160d8;}}export async function resolveTenantCode(){const _0x308a2b=a159_0x2b9f00,_0x21f8a8=await getSessionUserInfo(),_0x538416=_0x21f8a8?.['user']?.[_0x308a2b(0x205)]?.[_0x308a2b(0x1e5)];if(!_0x538416)throw CliErrors['authRequired'](_0x308a2b(0x1c5));return _0x538416;}function matchMember(_0x1217d8,_0x37da8d){const _0x49dd61=a159_0x2b9f00,_0x257bf2=_0x37da8d[_0x49dd61(0x200)]()[_0x49dd61(0x1c1)]();return(_0x1217d8[_0x49dd61(0x1cd)]??'')[_0x49dd61(0x1c1)]()===_0x257bf2||(_0x1217d8[_0x49dd61(0x1f9)]??'')[_0x49dd61(0x1c1)]()===_0x257bf2;}export async function resolveUserRef(_0x2dfc6){const _0x1c627b=a159_0x2b9f00,_0x670be3=_0x2dfc6[_0x1c627b(0x200)]();if(!_0x670be3)throw CliErrors[_0x1c627b(0x1c8)](_0x1c627b(0x1fc),_0x1c627b(0x1b7));const _0x21cfe6=await resolveTenantCode(),_0x5b775c=await getTenantMembers(_0x21cfe6);if(/^\d+$/['test'](_0x670be3)){const _0x437e24=Number(_0x670be3),_0x3de7ca=_0x5b775c[_0x1c627b(0x203)](_0xc38d61=>_0xc38d61['userId']===_0x437e24);return{'userId':_0x437e24,'username':_0x3de7ca?.[_0x1c627b(0x1f9)]??String(_0x437e24),'nickname':_0x3de7ca?.['nickname'],'matchedBy':'id'};}const _0x1fa87f=_0x5b775c[_0x1c627b(0x1da)](_0x19c5f8=>matchMember(_0x19c5f8,_0x670be3));if(_0x1fa87f[_0x1c627b(0x1dc)]===0x0)throw CliErrors['validation'](_0x1c627b(0x1c7)+_0x670be3+'\x22.',_0x1c627b(0x1d6));if(_0x1fa87f[_0x1c627b(0x1dc)]>0x1){const _0x3ac3dc=_0x1fa87f['map'](_0x2f48df=>(_0x2f48df['nickname']??_0x2f48df[_0x1c627b(0x1f9)]??'?')+'('+_0x2f48df[_0x1c627b(0x1c3)]+')')[_0x1c627b(0x1e7)](',\x20');throw CliErrors[_0x1c627b(0x1c8)](_0x1c627b(0x1d9)+_0x670be3+_0x1c627b(0x1bf)+_0x3ac3dc+'.',_0x1c627b(0x1b3));}const _0x517c28=_0x1fa87f[0x0];return{'userId':_0x517c28['userId'],'username':_0x517c28['username']??String(_0x517c28['userId']),'nickname':_0x517c28[_0x1c627b(0x1cd)],'matchedBy':_0x1c627b(0x1b6)};}export const UPDATE_USER_LIST_PATH=a159_0x2b9f00(0x1db);function userIdsOf(_0x8f722a){const _0x1dd6e4=a159_0x2b9f00;return(_0x8f722a?.[_0x1dd6e4(0x1e2)]??[])[_0x1dd6e4(0x1fe)](_0x14a666=>_0x14a666[_0x1dd6e4(0x1c3)]);}export function computeRoleUserMutation(_0x3401e4){const _0x3943ce=a159_0x2b9f00,{operation:_0x3b5cc2,appCode:_0x551cc3,roleUsers:_0x5243ac,targetRoleId:_0x34d98e,user:_0x57ceea}=_0x3401e4,_0x434cac=_0x5243ac[_0x3943ce(0x203)](_0x119c41=>_0x119c41['id']===_0x34d98e);if(!_0x434cac)throw CliErrors[_0x3943ce(0x1c8)](_0x3943ce(0x204)+_0x34d98e+_0x3943ce(0x1b9),_0x3943ce(0x1bd));const _0x332280=userIdsOf(_0x434cac),_0x5b7ca8=[];if(_0x3401e4[_0x3943ce(0x1de)]!==undefined&&_0x3401e4[_0x3943ce(0x1de)]!==_0x332280[_0x3943ce(0x1dc)])throw CliErrors[_0x3943ce(0x1c8)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x3401e4[_0x3943ce(0x1de)]+_0x3943ce(0x1d4)+_0x332280[_0x3943ce(0x1dc)]+'.',_0x3943ce(0x1b0));const _0x5b0b93=_0x332280[_0x3943ce(0x1f4)](_0x57ceea[_0x3943ce(0x1c3)]);let _0x250fbd=![];const _0x2ecfa6=[..._0x434cac[_0x3943ce(0x1e2)]];if(_0x3b5cc2===_0x3943ce(0x1e1))_0x5b0b93?_0x5b7ca8[_0x3943ce(0x1e3)](_0x3943ce(0x1f0)+_0x57ceea[_0x3943ce(0x1c3)]+_0x3943ce(0x1ec)+_0x434cac['roleName']+_0x3943ce(0x1f7)):(_0x2ecfa6[_0x3943ce(0x1e3)]({'userId':_0x57ceea[_0x3943ce(0x1c3)],'username':_0x57ceea[_0x3943ce(0x1f9)],..._0x57ceea[_0x3943ce(0x1cd)]?{'nickname':_0x57ceea[_0x3943ce(0x1cd)]}:{}}),_0x250fbd=!![]);else{if(!_0x5b0b93)_0x5b7ca8['push'](_0x3943ce(0x1f0)+_0x57ceea[_0x3943ce(0x1c3)]+_0x3943ce(0x1df)+_0x434cac[_0x3943ce(0x1d0)]+';\x20no\x20change.');else{const _0x1fcda9=_0x2ecfa6[_0x3943ce(0x1bb)](_0x15c812=>_0x15c812[_0x3943ce(0x1c3)]===_0x57ceea['userId']);if(_0x1fcda9>=0x0)_0x2ecfa6[_0x3943ce(0x1dd)](_0x1fcda9,0x1);_0x250fbd=!![];}}const _0x4ae16a=_0x5243ac[_0x3943ce(0x1fe)](_0x559a29=>_0x559a29['id']===_0x34d98e?{..._0x559a29,'userList':_0x2ecfa6}:_0x559a29),_0x58b2db=_0x2ecfa6['map'](_0x5e1335=>_0x5e1335['userId']),_0x2787d5={'operation':_0x3b5cc2,'selector':{'appCode':_0x551cc3,'roleId':_0x34d98e,'roleName':_0x434cac[_0x3943ce(0x1d0)],'userId':_0x57ceea[_0x3943ce(0x1c3)]},'before':{'userIds':_0x332280},'after':{'userIds':_0x58b2db},'dryRun':_0x3401e4[_0x3943ce(0x1c4)],'backend':{'method':_0x3943ce(0x1e4),'path':UPDATE_USER_LIST_PATH},'warnings':_0x5b7ca8};return{'roleList':_0x4ae16a,'mutation':_0x2787d5,'changed':_0x250fbd};}export async function loadRoleUsers(_0x50e3a3){return listRoleUsers(_0x50e3a3);}export function readRoleRef(_0x3f40b5){const _0x26b612=a159_0x2b9f00,_0x2714=_0x3f40b5['str'](_0x26b612(0x1d1))[_0x26b612(0x200)]();if(!_0x2714)throw CliErrors[_0x26b612(0x1e6)](_0x26b612(0x1d1),'Pass\x20--role\x20<id|name>.');return _0x2714;}export async function prepareUserMutation(_0x155845,_0x14d805,_0x5b3166){const _0x5b3a2c=a159_0x2b9f00,_0x36f149=readRoleRef(_0x155845),_0x77a4bf=_0x155845['str']('user')[_0x5b3a2c(0x200)]();if(!_0x77a4bf)throw CliErrors['flagMissing'](_0x5b3a2c(0x1ba),_0x5b3a2c(0x1b7));const _0x1575bd=_0x155845[_0x5b3a2c(0x1f3)](_0x5b3a2c(0x1b5)),_0x3b2f1f=_0x1575bd===undefined||_0x1575bd===null?undefined:Number(_0x1575bd),_0x410812=await resolveRoleRef(_0x155845[_0x5b3a2c(0x1be)],_0x36f149),_0x50258d=await resolveUserRef(_0x77a4bf),_0x4535d1=await loadRoleUsers(_0x155845['appCode']);return computeRoleUserMutation({'operation':_0x14d805,'appCode':_0x155845[_0x5b3a2c(0x1be)],'roleUsers':_0x4535d1,'targetRoleId':_0x410812['id'],'user':{'userId':_0x50258d[_0x5b3a2c(0x1c3)],'username':_0x50258d[_0x5b3a2c(0x1f9)],'nickname':_0x50258d['nickname']},'dryRun':_0x5b3166,..._0x3b2f1f!==undefined?{'expectUserCount':_0x3b2f1f}:{}});}function a159_0x3f4a(){const _0x4d02de=['No\x20tenant\x20member\x20matches\x20\x22','validation','Role\x20name\x20\x22','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','3410siJGRJ','Role\x20name','nickname','2264bgDfSV','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','roleName','role','133SWpeQO','\x22\x20not\x20found\x20in\x20app\x20','\x20member(s)\x20but\x20role\x20has\x20','\x20not\x20found\x20in\x20app\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','1051040CqQiKJ','roleType','Multiple\x20tenant\x20members\x20match\x20\x22','filter','/smartapi/permit/user-role/update-user-list','length','splice','expectUserCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','userCount','user-add','userList','push','POST','tenant_code','flagMissing','join','Optional\x20role\x20remark/description','DEV','375432unObvN','string','\x20is\x20already\x20a\x20member\x20of\x20role\x20','6XsUjRa','number','USER','User\x20','Cannot\x20','53039iNIgSk','flag','includes','ADMIN','Missing\x20role\x20reference.',';\x20no\x20change.','1165743qIuhuH','username','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','totalCount','Missing\x20user\x20reference.','280120shunRv','map','1771731NKuzSn','trim','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','find','Role\x20id\x20','tenant','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--user\x20<id>.','44RoOjaS','expect-user-count','name','Pass\x20--user\x20<id|name>.','Disambiguate\x20with\x20--role\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','user','findIndex','test','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','appCode','\x22:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','toLowerCase','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','userId','dryRun','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','remark'];a159_0x3f4a=function(){return _0x4d02de;};return a159_0x3f4a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a160_0x157a8a=a160_0x12e0;(function(_0x1b4ee4,_0x24af76){const _0x2c9ae1=a160_0x12e0,_0x64ecf0=_0x1b4ee4();while(!![]){try{const _0x361f44=-parseInt(_0x2c9ae1(0xa0))/0x1*(-parseInt(_0x2c9ae1(0x96))/0x2)+-parseInt(_0x2c9ae1(0x9e))/0x3+-parseInt(_0x2c9ae1(0x9b))/0x4*(-parseInt(_0x2c9ae1(0x92))/0x5)+parseInt(_0x2c9ae1(0x8e))/0x6*(-parseInt(_0x2c9ae1(0xa6))/0x7)+parseInt(_0x2c9ae1(0x99))/0x8+-parseInt(_0x2c9ae1(0xa5))/0x9+-parseInt(_0x2c9ae1(0x91))/0xa;if(_0x361f44===_0x24af76)break;else _0x64ecf0['push'](_0x64ecf0['shift']());}catch(_0x3a6c27){_0x64ecf0['push'](_0x64ecf0['shift']());}}}(a160_0x40cb,0x97e43));import{updateAppRole}from'../../core/api-client.js';function a160_0x40cb(){const _0x1b9af8=['205Iagwpq','update','remark','Updated\x20role\x20','2ipvhvM','roleName','num','8713248pfGqdP','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','103036vxaISy','name','length','246117YXgkYt','New\x20role\x20name','845333sedpKU','appCode','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','string','flag','11114757XDthRS','301yvhbLa','\x20(id=','validation','role','write','--name\x20cannot\x20be\x20empty.','39306GpYFcK','POST','Nothing\x20to\x20update.','7697560auvLmy'];a160_0x40cb=function(){return _0x1b9af8;};return a160_0x40cb();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a160_0x12e0(_0x877e4e,_0x212784){_0x877e4e=_0x877e4e-0x8e;const _0x40cb1c=a160_0x40cb();let _0x12e03f=_0x40cb1c[_0x877e4e];return _0x12e03f;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x9456ab){const _0x2c70d7=a160_0x12e0,_0x3129db=_0x9456ab[_0x2c70d7(0xa4)]('name'),_0x51b134=_0x9456ab['flag'](_0x2c70d7(0x94)),_0xc6fd73={};if(_0x3129db!==undefined&&_0x3129db!==null){const _0xbe6223=String(_0x3129db)['trim']();if(!_0xbe6223)throw CliErrors[_0x2c70d7(0xa8)](_0x2c70d7(0xab));if(_0xbe6223[_0x2c70d7(0x9d)]>0x40)throw CliErrors[_0x2c70d7(0xa8)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0xc6fd73[_0x2c70d7(0x97)]=_0xbe6223;}_0x51b134!==undefined&&_0x51b134!==null&&(_0xc6fd73[_0x2c70d7(0x94)]=String(_0x51b134));if(_0xc6fd73[_0x2c70d7(0x97)]===undefined&&_0xc6fd73[_0x2c70d7(0x94)]===undefined)throw CliErrors[_0x2c70d7(0xa8)](_0x2c70d7(0x90),_0x2c70d7(0xa2));return _0xc6fd73;}export const roleUpdate={'service':a160_0x157a8a(0xa9),'command':a160_0x157a8a(0x93),'description':a160_0x157a8a(0x9a),'risk':a160_0x157a8a(0xaa),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0x157a8a(0x9c),'type':a160_0x157a8a(0xa3),'required':![],'description':a160_0x157a8a(0x9f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x62b27e){readPatch(_0x62b27e);},async 'dryRun'(_0x56fa7e){const _0x4dfe93=a160_0x157a8a,_0x1c5341=_0x56fa7e[_0x4dfe93(0x98)]('id'),_0x527fa2=readPatch(_0x56fa7e),_0xdb5352=await getRoleById(_0x56fa7e[_0x4dfe93(0xa1)],_0x1c5341);return assertCustomRole(_0xdb5352,_0x4dfe93(0x93)),asDryRunResult({'operation':_0x4dfe93(0x93),'selector':{'appCode':_0x56fa7e[_0x4dfe93(0xa1)],'roleId':_0x1c5341,'roleName':_0xdb5352[_0x4dfe93(0x97)]},'before':projectRole(_0xdb5352),'after':projectRole({..._0xdb5352,..._0x527fa2['roleName']!==undefined?{'roleName':_0x527fa2[_0x4dfe93(0x97)]}:{},..._0x527fa2[_0x4dfe93(0x94)]!==undefined?{'remark':_0x527fa2[_0x4dfe93(0x94)]}:{}}),'dryRun':!![],'backend':{'method':_0x4dfe93(0x8f),'path':UPDATE_PATH},'warnings':[]},{'method':_0x4dfe93(0x8f),'url':UPDATE_PATH});},async 'execute'(_0x2c2d39){const _0x193559=a160_0x157a8a,_0x4e8473=_0x2c2d39[_0x193559(0x98)]('id'),_0x585f55=readPatch(_0x2c2d39),_0xc3a137=await getRoleById(_0x2c2d39[_0x193559(0xa1)],_0x4e8473);assertCustomRole(_0xc3a137,_0x193559(0x93)),await updateAppRole({'id':_0x4e8473,'appCode':_0x2c2d39['appCode'],..._0x585f55['roleName']!==undefined?{'roleName':_0x585f55[_0x193559(0x97)]}:{},..._0x585f55[_0x193559(0x94)]!==undefined?{'remark':_0x585f55[_0x193559(0x94)]}:{}});const _0x1f3c42=await getRoleById(_0x2c2d39[_0x193559(0xa1)],_0x4e8473);return{'ok':!![],'data':{'operation':_0x193559(0x93),'selector':{'appCode':_0x2c2d39[_0x193559(0xa1)],'roleId':_0x4e8473,'roleName':_0x1f3c42['roleName']},'before':projectRole(_0xc3a137),'after':projectRole(_0x1f3c42),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x193559(0x95)+_0x1f3c42[_0x193559(0x97)]+_0x193559(0xa7)+_0x4e8473+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0xae86ec=a161_0x2b16;(function(_0x29c173,_0x4ee0d6){const _0x202e4c=a161_0x2b16,_0x45ef2e=_0x29c173();while(!![]){try{const _0x299ef9=parseInt(_0x202e4c(0x14b))/0x1*(parseInt(_0x202e4c(0x152))/0x2)+-parseInt(_0x202e4c(0x143))/0x3+parseInt(_0x202e4c(0x14a))/0x4+-parseInt(_0x202e4c(0x147))/0x5*(-parseInt(_0x202e4c(0x156))/0x6)+parseInt(_0x202e4c(0x14d))/0x7+-parseInt(_0x202e4c(0x155))/0x8*(-parseInt(_0x202e4c(0x151))/0x9)+parseInt(_0x202e4c(0x141))/0xa*(-parseInt(_0x202e4c(0x14f))/0xb);if(_0x299ef9===_0x4ee0d6)break;else _0x45ef2e['push'](_0x45ef2e['shift']());}catch(_0x56dd6e){_0x45ef2e['push'](_0x45ef2e['shift']());}}}(a161_0x3e62,0x619f4));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a161_0x2b16(_0x3946e9,_0x5ed6d8){_0x3946e9=_0x3946e9-0x141;const _0x3e62b4=a161_0x3e62();let _0x2b16d3=_0x3e62b4[_0x3946e9];return _0x2b16d3;}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':a161_0xae86ec(0x14e),'command':a161_0xae86ec(0x153),'description':a161_0xae86ec(0x150),'risk':a161_0xae86ec(0x149),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x165c83){const _0x4e5620=a161_0xae86ec,{mutation:_0x3b9628}=await prepareUserMutation(_0x165c83,_0x4e5620(0x153),!![]);return asDryRunResult(_0x3b9628,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x485805){const _0x47886b=a161_0xae86ec,{roleList:_0x5b7a33,mutation:_0x67f2e7,changed:_0x13b321}=await prepareUserMutation(_0x485805,_0x47886b(0x153),![]);return _0x13b321&&await updateRoleUsers(_0x485805[_0x47886b(0x154)],_0x5b7a33),{'ok':!![],'data':_0x67f2e7,'message':_0x13b321?_0x47886b(0x145)+_0x67f2e7[_0x47886b(0x148)][_0x47886b(0x144)]+'\x20to\x20role\x20'+_0x67f2e7[_0x47886b(0x148)][_0x47886b(0x142)]:_0x47886b(0x14c)+_0x67f2e7['selector']['userId']+_0x47886b(0x146)+_0x67f2e7[_0x47886b(0x148)][_0x47886b(0x142)]};}};function a161_0x3e62(){const _0x565191=['appCode','152sRfbjf','222cVEIXd','129810pckUxz','roleName','1532829yoQufp','userId','Added\x20user\x20','\x20already\x20in\x20role\x20','3170IzxlJK','selector','high-risk-write','2536012TXaOto','1rbNZsS','No\x20change:\x20user\x20','4626762jUlWGA','role','781BjcDWv','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','87750UyrOSI','657554chMRoF','user-add'];a161_0x3e62=function(){return _0x565191;};return a161_0x3e62();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x444845=a162_0x25ab;(function(_0x5e1bc5,_0x480e10){const _0x598df3=a162_0x25ab,_0x17fca8=_0x5e1bc5();while(!![]){try{const _0xfeac31=parseInt(_0x598df3(0x100))/0x1*(-parseInt(_0x598df3(0xfe))/0x2)+-parseInt(_0x598df3(0xfc))/0x3*(parseInt(_0x598df3(0x104))/0x4)+-parseInt(_0x598df3(0xf4))/0x5+parseInt(_0x598df3(0xf2))/0x6*(parseInt(_0x598df3(0xf6))/0x7)+parseInt(_0x598df3(0x106))/0x8+parseInt(_0x598df3(0xff))/0x9*(parseInt(_0x598df3(0x101))/0xa)+parseInt(_0x598df3(0xf8))/0xb;if(_0xfeac31===_0x480e10)break;else _0x17fca8['push'](_0x17fca8['shift']());}catch(_0x373600){_0x17fca8['push'](_0x17fca8['shift']());}}}(a162_0xa644,0x458df));function a162_0xa644(){const _0x5a474b=['\x20not\x20in\x20role\x20','4KrEkBs','appCode','813008kEPoRW','42nIwsHG','roleName','2529320zElYrM','role','528010LhCnVL','user-remove','2332803wUvrlN','\x20from\x20role\x20','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','selector','278412zKwMbY','POST','14aAptxM','209673tBluNW','43943fJCzGL','150ChehDo','userId'];a162_0xa644=function(){return _0x5a474b;};return a162_0xa644();}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 a162_0x25ab(_0x413970,_0x29c7d6){_0x413970=_0x413970-0xf2;const _0xa64430=a162_0xa644();let _0x25abfb=_0xa64430[_0x413970];return _0x25abfb;}export const roleUserRemove={'service':a162_0x444845(0xf5),'command':a162_0x444845(0xf7),'description':a162_0x444845(0xfa),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x562b4e){const _0x168999=a162_0x444845,{mutation:_0x148652}=await prepareUserMutation(_0x562b4e,_0x168999(0xf7),!![]);return asDryRunResult(_0x148652,{'method':_0x168999(0xfd),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x194897){const _0x3e17c5=a162_0x444845,{roleList:_0x34657e,mutation:_0x36667e,changed:_0x3764b7}=await prepareUserMutation(_0x194897,_0x3e17c5(0xf7),![]);return _0x3764b7&&await updateRoleUsers(_0x194897[_0x3e17c5(0x105)],_0x34657e),{'ok':!![],'data':_0x36667e,'message':_0x3764b7?'Removed\x20user\x20'+_0x36667e[_0x3e17c5(0xfb)]['userId']+_0x3e17c5(0xf9)+_0x36667e['selector'][_0x3e17c5(0xf3)]:'No\x20change:\x20user\x20'+_0x36667e[_0x3e17c5(0xfb)][_0x3e17c5(0x102)]+_0x3e17c5(0x103)+_0x36667e[_0x3e17c5(0xfb)][_0x3e17c5(0xf3)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a163_0x542e(){const _0x38e90a=['role','41ejdHxv','2269494JrZCyb','trim','name','username','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','str','Pass\x20--name\x20<nickname|username>.','flagMissing','matchedBy','8TrMCuo','4838589RnSBLI','5mBDmMR','37730uqqKfV','user-resolve','997760cNWRmc','userId','3503144ryFUuR','381174LeUoLg','\x22\x20→\x20userId\x20','read','4329045SzVegU','Resolved\x20\x22'];a163_0x542e=function(){return _0x38e90a;};return a163_0x542e();}const a163_0x3e0c64=a163_0x3d79;function a163_0x3d79(_0x1f9630,_0x370e03){_0x1f9630=_0x1f9630-0x76;const _0x542e81=a163_0x542e();let _0x3d79a0=_0x542e81[_0x1f9630];return _0x3d79a0;}(function(_0x4d2fda,_0x5d171f){const _0x9048fb=a163_0x3d79,_0x293145=_0x4d2fda();while(!![]){try{const _0x145bd6=parseInt(_0x9048fb(0x7b))/0x1*(parseInt(_0x9048fb(0x88))/0x2)+-parseInt(_0x9048fb(0x8d))/0x3*(parseInt(_0x9048fb(0x85))/0x4)+-parseInt(_0x9048fb(0x87))/0x5*(parseInt(_0x9048fb(0x7c))/0x6)+-parseInt(_0x9048fb(0x78))/0x7+parseInt(_0x9048fb(0x8c))/0x8+parseInt(_0x9048fb(0x86))/0x9+-parseInt(_0x9048fb(0x8a))/0xa;if(_0x145bd6===_0x5d171f)break;else _0x293145['push'](_0x293145['shift']());}catch(_0x388f5f){_0x293145['push'](_0x293145['shift']());}}}(a163_0x542e,0x61443));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':a163_0x3e0c64(0x7a),'command':a163_0x3e0c64(0x89),'description':a163_0x3e0c64(0x80),'risk':a163_0x3e0c64(0x77),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x46642a){const _0x1576a4=a163_0x3e0c64;if(!_0x46642a[_0x1576a4(0x81)]('name')[_0x1576a4(0x7d)]())throw CliErrors[_0x1576a4(0x83)](_0x1576a4(0x7e),_0x1576a4(0x82));},async 'execute'(_0x22818e){const _0x4548ff=a163_0x3e0c64,_0x8955f0=_0x22818e[_0x4548ff(0x81)](_0x4548ff(0x7e))[_0x4548ff(0x7d)](),_0x528efe=await resolveUserRef(_0x8955f0);return{'ok':!![],'data':{'user':{'userId':_0x528efe[_0x4548ff(0x8b)],'username':_0x528efe[_0x4548ff(0x7f)],'nickname':_0x528efe['nickname'],'matchedBy':_0x528efe[_0x4548ff(0x84)]}},'message':_0x4548ff(0x79)+_0x8955f0+_0x4548ff(0x76)+_0x528efe[_0x4548ff(0x8b)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x3e24ef=a164_0x8146;(function(_0x349284,_0x34c8e0){const _0x317f74=a164_0x8146,_0x2f3fde=_0x349284();while(!![]){try{const _0x175b23=-parseInt(_0x317f74(0xbe))/0x1+-parseInt(_0x317f74(0xb2))/0x2+-parseInt(_0x317f74(0xa8))/0x3+-parseInt(_0x317f74(0x9a))/0x4*(parseInt(_0x317f74(0xa5))/0x5)+-parseInt(_0x317f74(0x9c))/0x6*(parseInt(_0x317f74(0x8f))/0x7)+parseInt(_0x317f74(0x99))/0x8*(-parseInt(_0x317f74(0xc7))/0x9)+parseInt(_0x317f74(0xbf))/0xa*(parseInt(_0x317f74(0xca))/0xb);if(_0x175b23===_0x34c8e0)break;else _0x2f3fde['push'](_0x2f3fde['shift']());}catch(_0x3c3c35){_0x2f3fde['push'](_0x2f3fde['shift']());}}}(a164_0xa78c,0xc8b8f));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([a164_0x3e24ef(0x94),a164_0x3e24ef(0x9d)]);function readPackageScripts(_0x3b1494){const _0x3ec3d5=a164_0x3e24ef,_0x47e9ac=resolve(_0x3b1494,_0x3ec3d5(0xc5));if(!existsSync(_0x47e9ac))return null;try{const _0x169cc8=JSON['parse'](readFileSync(_0x47e9ac,_0x3ec3d5(0xb1)));return _0x169cc8[_0x3ec3d5(0x97)]??{};}catch{return null;}}function a164_0x8146(_0x583ea5,_0x28e001){_0x583ea5=_0x583ea5-0x8c;const _0xa78c9e=a164_0xa78c();let _0x814672=_0xa78c9e[_0x583ea5];return _0x814672;}function detectPackageManager(_0x361c33){const _0x2e0730=a164_0x3e24ef;if(existsSync(resolve(_0x361c33,_0x2e0730(0x95)))||existsSync(resolve(_0x361c33,_0x2e0730(0xb8))))return _0x2e0730(0xc2);if(existsSync(resolve(_0x361c33,_0x2e0730(0x96))))return _0x2e0730(0x8e);if(existsSync(resolve(_0x361c33,'yarn.lock')))return'yarn';return _0x2e0730(0xc9);}async function versionCheck(_0x2494ea){const _0x57e4b5=a164_0x3e24ef,_0x530258=await checkCliVersion();(_0x530258[_0x57e4b5(0xb7)]||_0x530258[_0x57e4b5(0xb6)])&&(printCliUpgradeWarning(_0x530258),assertCliVersionSupported(_0x530258));const _0x3ac32d=await checkSdkVersion(_0x2494ea);if(_0x3ac32d['needsUpgrade'])printSdkUpgradeWarning(_0x3ac32d);}function spawnScript(_0x3d08ac,_0x30da5e,_0xed3c53,_0x26f40e){return new Promise((_0x5ac411,_0x7fbdc8)=>{const _0x9b0bb9=a164_0x8146,_0xbd4fb7=[_0x9b0bb9(0xa7),_0x30da5e,..._0xed3c53],_0x130be0=spawn(_0x3d08ac,_0xbd4fb7,{'cwd':_0x26f40e,'stdio':_0x9b0bb9(0xc4),'shell':!![],'env':{...process.env,'PATH':''+join(_0x26f40e,_0x9b0bb9(0xc6),_0x9b0bb9(0x8c))+delimiter+process.env.PATH}});_0x130be0['on'](_0x9b0bb9(0xc8),_0x956290=>{const _0x543163=_0x9b0bb9;if(_0x956290===0x0||_0x956290===null)_0x5ac411();else _0x7fbdc8(new Error(_0x3d08ac+_0x543163(0xa1)+_0x30da5e+_0x543163(0xbd)+_0x956290));}),_0x130be0['on']('error',_0x7fbdc8);});}function spawnViteBuildWatch(_0x35c09f){return new Promise((_0x14f520,_0xa61ef9)=>{const _0x7b873=a164_0x8146,_0x485a5f=spawn('vite',['build',_0x7b873(0xab)],{'cwd':_0x35c09f,'stdio':_0x7b873(0xc4),'shell':!![],'env':{...process.env,'PATH':''+join(_0x35c09f,_0x7b873(0xc6),_0x7b873(0x8c))+delimiter+process.env.PATH}});_0x485a5f['on']('close',_0x2970d8=>{const _0x3e9df3=_0x7b873;if(_0x2970d8===0x0||_0x2970d8===null)_0x14f520();else _0xa61ef9(new Error(_0x3e9df3(0x9e)+_0x2970d8));}),_0x485a5f['on'](_0x7b873(0x8d),_0xa61ef9);});}function a164_0xa78c(){const _0x457be9=['9zpxHCD','close','npm','627GhdTAO','args','.bin','error','pnpm','389109pPQPXW','vite\x20preview\x20exited\x20with\x20code\x20','join','keys','has','start','bun.lockb','pnpm-lock.yaml','scripts','\x22\x20not\x20found\x20in\x20package.json.','4440496JmyewD','251108UtwIEP','validation','78ZKIhEP','dev','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20\x20\x20\x20','\x20run\x20preview','\x20run\x20','No\x20package.json\x20found\x20in\x20current\x20directory.','Script\x20\x22','preview','115JNkezE','push','run','1107168XlWPrC','\x20run\x20build','all','--watch','cwd','(none)','No\x20scripts\x20defined\x20in\x20package.json.','vite','log','utf-8','2219308YMJbXQ','bool','Available:\x20','watch','belowMinimum','needsUpgrade','bun.lock','\x20\x20EXAMPLES','Enable\x20watch\x20mode\x20for\x20preview','boolean','length','\x20exited\x20with\x20code\x20','814196KBbkfV','1023970lQpfrQ','\x20run\x20<script>\x0a','\x20run\x20start','bun','Run\x20a\x20package.json\x20script','inherit','package.json','node_modules'];a164_0xa78c=function(){return _0x457be9;};return a164_0xa78c();}function spawnVitePreview(_0x568709){return new Promise((_0x3b0834,_0x3f6469)=>{const _0xf67b75=a164_0x8146,_0xe43ac4=spawn(_0xf67b75(0xaf),[_0xf67b75(0xa4)],{'cwd':_0x568709,'stdio':_0xf67b75(0xc4),'shell':!![],'env':{...process.env,'PATH':''+join(_0x568709,_0xf67b75(0xc6),_0xf67b75(0x8c))+delimiter+process.env.PATH}});_0xe43ac4['on'](_0xf67b75(0xc8),_0x543b9a=>{const _0x4ac8d7=_0xf67b75;if(_0x543b9a===0x0||_0x543b9a===null)_0x3b0834();else _0x3f6469(new Error(_0x4ac8d7(0x90)+_0x543b9a));}),_0xe43ac4['on'](_0xf67b75(0x8d),_0x3f6469);});}const runFlags=[{'name':'watch','type':a164_0x3e24ef(0xbb),'description':a164_0x3e24ef(0xba),'default':![]}];export const runDefinition={'service':a164_0x3e24ef(0xa7),'command':a164_0x3e24ef(0xa7),'description':a164_0x3e24ef(0xc3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x588f4a=a164_0x3e24ef,_0x33dbb3=[];return _0x33dbb3['push'](_0x588f4a(0xb9)),_0x33dbb3[_0x588f4a(0xa6)](_0x588f4a(0x9f)+CLI_BIN_NAME+_0x588f4a(0xc1)),_0x33dbb3[_0x588f4a(0xa6)](_0x588f4a(0x9f)+CLI_BIN_NAME+_0x588f4a(0xa9)),_0x33dbb3['push'](_0x588f4a(0x9f)+CLI_BIN_NAME+_0x588f4a(0xa0)),_0x33dbb3[_0x588f4a(0xa6)](_0x588f4a(0x9f)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x33dbb3[_0x588f4a(0x91)]('\x0a');},async 'execute'(_0x243974){const _0x305169=a164_0x3e24ef,_0x5808ce=process[_0x305169(0xac)](),_0x4f6ae0=_0x243974[_0x305169(0xcb)][0x0],_0x29f845=_0x243974[_0x305169(0xcb)]['slice'](0x1),_0x2dcd6d=readPackageScripts(_0x5808ce);if(!_0x2dcd6d)throw CliErrors['validation'](_0x305169(0xa2));if(!_0x4f6ae0){const _0x1cbcfc=Object[_0x305169(0x92)](_0x2dcd6d);if(_0x1cbcfc[_0x305169(0xbc)]===0x0)console[_0x305169(0xb0)](_0x305169(0xae));else{console[_0x305169(0xb0)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x503c94 of _0x1cbcfc){console['log'](_0x305169(0x9f)+_0x503c94);}console[_0x305169(0xb0)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x305169(0xc0));}return{'ok':!![]};}if(!_0x2dcd6d[_0x4f6ae0])throw CliErrors[_0x305169(0x9b)](_0x305169(0xa3)+_0x4f6ae0+_0x305169(0x98),_0x305169(0xb4)+(Object['keys'](_0x2dcd6d)[_0x305169(0x91)](',\x20')||_0x305169(0xad)));const _0x8e3403=detectPackageManager(_0x5808ce);VERSION_CHECK_SCRIPTS[_0x305169(0x93)](_0x4f6ae0)&&await versionCheck(_0x5808ce);if(_0x4f6ae0===_0x305169(0xa4)&&_0x243974[_0x305169(0xb3)](_0x305169(0xb5)))return await Promise[_0x305169(0xaa)]([spawnViteBuildWatch(_0x5808ce),spawnVitePreview(_0x5808ce)]),{'ok':!![]};return await spawnScript(_0x8e3403,_0x4f6ae0,_0x29f845,_0x5808ce),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x36eaf0=a165_0x5462;(function(_0x71699e,_0x55560d){const _0x24b80e=a165_0x5462,_0x575913=_0x71699e();while(!![]){try{const _0x13806f=parseInt(_0x24b80e(0x1bd))/0x1+-parseInt(_0x24b80e(0x1bb))/0x2+parseInt(_0x24b80e(0x1c3))/0x3+-parseInt(_0x24b80e(0x1b9))/0x4*(-parseInt(_0x24b80e(0x1c5))/0x5)+parseInt(_0x24b80e(0x1c6))/0x6*(-parseInt(_0x24b80e(0x1c4))/0x7)+-parseInt(_0x24b80e(0x1bc))/0x8+parseInt(_0x24b80e(0x1bf))/0x9*(-parseInt(_0x24b80e(0x1c0))/0xa);if(_0x13806f===_0x55560d)break;else _0x575913['push'](_0x575913['shift']());}catch(_0x28f361){_0x575913['push'](_0x575913['shift']());}}}(a165_0x5f17,0x5c14a));function a165_0x5462(_0x656a8,_0x2c8acc){_0x656a8=_0x656a8-0x1b9;const _0x5f17e6=a165_0x5f17();let _0x546264=_0x5f17e6[_0x656a8];return _0x546264;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x8616d2){const _0x4f4383=await buildSchemaPayload();return{'ok':!![],'data':_0x4f4383};}export const schemaDefinition={'service':a165_0x36eaf0(0x1c2),'command':a165_0x36eaf0(0x1c1),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a165_0x36eaf0(0x1be),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a165_0x36eaf0(0x1ba),'flags':[],'execute':execute};function a165_0x5f17(){const _0x1f1cd9=['844462XhUfWQ','136304xpyZYK','331890mOQKAv','read','9fySJVx','3102640WIOKwp','export','schema','1237341azeWnF','196ImGWcs','742310fHfZNL','13506FDquNt','12oejScJ','json'];a165_0x5f17=function(){return _0x1f1cd9;};return a165_0x5f17();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a166_0x327c5e=a166_0x37ac;(function(_0x1cf99a,_0x5ec971){const _0x351cc5=a166_0x37ac,_0x2177bd=_0x1cf99a();while(!![]){try{const _0x3df1de=-parseInt(_0x351cc5(0x1e4))/0x1+parseInt(_0x351cc5(0x1d7))/0x2+parseInt(_0x351cc5(0x1d3))/0x3*(-parseInt(_0x351cc5(0x1df))/0x4)+-parseInt(_0x351cc5(0x1d4))/0x5*(parseInt(_0x351cc5(0x1f8))/0x6)+-parseInt(_0x351cc5(0x1bf))/0x7*(parseInt(_0x351cc5(0x1fa))/0x8)+-parseInt(_0x351cc5(0x1c7))/0x9+parseInt(_0x351cc5(0x1c0))/0xa;if(_0x3df1de===_0x5ec971)break;else _0x2177bd['push'](_0x2177bd['shift']());}catch(_0x303718){_0x2177bd['push'](_0x2177bd['shift']());}}}(a166_0x37f1,0x6bb81));function a166_0x37f1(){const _0x50b97a=['SQL\x20名称不能为空','description','dbName','appCode','high-risk-write','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','catch','5124189FIkknF','28623780crSVpt','SQL\x20query\x20display\x20name','请选择本地\x20SQL\x20模式:','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','请输入目标数据库\x20dbId:','POST','5285241cGEASP','sql','parse','str','mode','flagMissing','Created\x20SQL\x20query\x20','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','</select>','Local\x20SQL\x20file\x20mode','\x20\x20SELECT\x201\x20AS\x20id','trim','869163hoFMLx','5eQPsdw','name','File\x20already\x20exists:\x20','30018yOWXwo','Target\x20database\x20ID','普通\x20SQL(sql)','mybatisXml','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','map','flag','适合带动态标签的\x20MyBatis\x20XML\x20SQL','4bbUjKb','string','create','length','sqlName','340107dfHJZi','join','sqlRoot','new','lockFilePath','请选择目标数据库:','isFinite','sqls','isInteger','__manual__','dbId','sqlCode','toISOString','nonInteractive','validation','<server-generated-sqlCode>','db-id','SELECT\x201\x20AS\x20id;','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','number','2922396aHNqYM','Invalid\x20database\x20selection\x20payload:\x20','8yGpHhT','sqlRootDir','请输入\x20SQL\x20名称:'];a166_0x37f1=function(){return _0x50b97a;};return a166_0x37f1();}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';function a166_0x37ac(_0x2a4050,_0x19f194){_0x2a4050=_0x2a4050-0x1bf;const _0x37f1dd=a166_0x37f1();let _0x37acb4=_0x37f1dd[_0x2a4050];return _0x37acb4;}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(_0x466c35){const _0x398a65=a166_0x37ac;if(_0x466c35===_0x398a65(0x1da))return[_0x398a65(0x1ce),_0x398a65(0x1d1),_0x398a65(0x1cf),'']['join']('\x0a');return[_0x398a65(0x1f5),''][_0x398a65(0x1e5)]('\x0a');}export const sqlCreate={'service':'sql','command':a166_0x327c5e(0x1e1),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a166_0x327c5e(0x201),'flags':[{'name':a166_0x327c5e(0x1d5),'type':'string','description':a166_0x327c5e(0x1c1)},{'name':a166_0x327c5e(0x1f4),'type':a166_0x327c5e(0x1f7),'description':a166_0x327c5e(0x1d8)},{'name':a166_0x327c5e(0x1cb),'type':a166_0x327c5e(0x1e0),'enum':[a166_0x327c5e(0x1c8),a166_0x327c5e(0x1da)],'description':a166_0x327c5e(0x1d0)}],async 'validate'(_0x430456){const _0x254dc1=a166_0x327c5e;if(!_0x430456['nonInteractive'])return;if(!_0x430456[_0x254dc1(0x1ca)](_0x254dc1(0x1d5))[_0x254dc1(0x1d2)]())throw CliErrors['flagMissing'](_0x254dc1(0x1d5),_0x254dc1(0x1c4));const _0x14281c=resolveProvidedDbId(_0x430456);if(typeof _0x14281c!=='number'||!Number[_0x254dc1(0x1ea)](_0x14281c)||_0x14281c<=0x0)throw CliErrors['flagMissing'](_0x254dc1(0x1f4),_0x254dc1(0x202));if(!_0x430456[_0x254dc1(0x1ca)](_0x254dc1(0x1cb))[_0x254dc1(0x1d2)]())throw CliErrors[_0x254dc1(0x1cc)](_0x254dc1(0x1cb),_0x254dc1(0x1c3));},async 'dryRun'(_0x4780f2){const _0x32dc37=a166_0x327c5e,_0x3c1d56=loadSqlProjectConfig(_0x4780f2[_0x32dc37(0x200)]),{sqlName:_0x33b1a2,dbId:_0xd30844,dbName:_0x54d373,mode:_0x58d9e6}=await resolveSqlNewInputs(_0x4780f2),_0x278523=buildSqlRelativePath(_0x32dc37(0x1f3),_0x33b1a2,_0x54d373,_0x58d9e6,_0xd30844),_0x188c21=_0x3c1d56[_0x32dc37(0x1fb)]+'/'+_0x278523;return{'method':_0x32dc37(0x1c6),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x4780f2[_0x32dc37(0x200)],'sqlName':_0x33b1a2,'dbId':_0xd30844,'mode':_0x58d9e6,'localPath':_0x188c21},'description':_0x32dc37(0x1db)+_0x3c1d56[_0x32dc37(0x1fb)]};},async 'execute'(_0x41dc3c){const _0x226745=a166_0x327c5e,_0x5e451d=loadSqlProjectConfig(_0x41dc3c[_0x226745(0x200)]),{sqlName:_0x42f439,dbId:_0x1936c2,dbName:_0x1a7018,mode:_0x33ed77}=await resolveSqlNewInputs(_0x41dc3c),_0x4cb2d5=generateSqlTemplate(_0x33ed77),_0x18e9e6=await createSqlQuery({'appCode':_0x41dc3c[_0x226745(0x200)],'sqlName':_0x42f439,'dbId':_0x1936c2,'sqlContent':_0x4cb2d5}),_0x485cfa=ensureRemoteSqlContent(_0x18e9e6),_0x54fdda=_0x1a7018||await getDbName(_0x41dc3c[_0x226745(0x200)],_0x1936c2)[_0x226745(0x203)](()=>undefined),_0x10f909=buildSqlRelativePath(_0x18e9e6[_0x226745(0x1ef)],_0x18e9e6[_0x226745(0x1e3)],_0x54fdda,_0x33ed77,_0x1936c2),_0x3551be=_0x5e451d[_0x226745(0x1fb)]+'/'+_0x10f909,_0x5c46e5=buildLocalSqlFileContent({'sqlCode':_0x18e9e6[_0x226745(0x1ef)],'sqlName':_0x18e9e6[_0x226745(0x1e3)],'dbId':_0x18e9e6['dbId']},_0x485cfa,{'dbName':_0x54fdda,'mode':_0x33ed77,'syncedAt':new Date()[_0x226745(0x1f0)](),'description':_0x18e9e6[_0x226745(0x1fe)]});if(await fileExists(_0x3551be))throw CliErrors[_0x226745(0x1f2)](_0x226745(0x1d6)+_0x3551be);await ensureParentDirectory(_0x3551be),await writeFile(_0x3551be,_0x5c46e5,'utf8');const _0x1ea4f0=await readSqlLockFile(_0x5e451d[_0x226745(0x1e8)]),{lockData:_0x3bca2b,appLock:_0x316d45}=ensureSqlLockScope(_0x1ea4f0??createEmptySqlLock(),_0x5e451d[_0x226745(0x200)],_0x5e451d[_0x226745(0x1e6)],_0x226745(0x1e7));return _0x316d45[_0x226745(0x1eb)][_0x18e9e6[_0x226745(0x1ef)]]={...buildSqlLockEntry(_0x18e9e6,_0x485cfa,computeSqlContentHash(_0x5c46e5),{'dbName':_0x54fdda}),'path':_0x10f909,'mode':_0x33ed77},_0x316d45['lastSync']=new Date()[_0x226745(0x1f0)](),await writeSqlLockFile(_0x5e451d[_0x226745(0x1e8)],_0x3bca2b),{'ok':!![],'data':{'id':_0x18e9e6['id'],'sqlCode':_0x18e9e6[_0x226745(0x1ef)],'sqlName':_0x18e9e6['sqlName'],'dbId':_0x18e9e6['dbId'],'path':_0x3551be,'mode':_0x33ed77},'message':_0x226745(0x1cd)+_0x18e9e6['sqlCode']};}};async function resolveSqlNewInputs(_0xf3ea01){const _0x45904e=await resolveSqlNameInput(_0xf3ea01),{dbId:_0x1b3599,dbName:_0x536a5e}=await resolveDbSelection(_0xf3ea01),_0x532168=await resolveSqlModeInput(_0xf3ea01);return{'sqlName':_0x45904e,'dbId':_0x1b3599,'dbName':_0x536a5e,'mode':_0x532168};}async function resolveSqlNameInput(_0x1a975c){const _0x40d247=a166_0x327c5e,_0x4c0a83=_0x1a975c[_0x40d247(0x1ca)]('name')[_0x40d247(0x1d2)]();if(_0x4c0a83)return _0x4c0a83;if(_0x1a975c[_0x40d247(0x1f1)])throw CliErrors[_0x40d247(0x1cc)](_0x40d247(0x1d5),_0x40d247(0x1c4));return(await input({'message':_0x40d247(0x1fc),'validate':_0x229515=>_0x229515[_0x40d247(0x1d2)]()?!![]:_0x40d247(0x1fd)}))[_0x40d247(0x1d2)]();}async function resolveDbSelection(_0x1c5837){const _0x29394b=a166_0x327c5e,_0x5f34a2=resolveProvidedDbId(_0x1c5837);if(typeof _0x5f34a2===_0x29394b(0x1f7)&&Number[_0x29394b(0x1ea)](_0x5f34a2)&&_0x5f34a2>0x0)return{'dbId':_0x5f34a2,'dbName':await getDbName(_0x1c5837['appCode'],_0x5f34a2)[_0x29394b(0x203)](()=>undefined)};if(_0x1c5837[_0x29394b(0x1f1)])throw CliErrors['flagMissing'](_0x29394b(0x1f4),_0x29394b(0x202));const _0x40d9d0=await listDatabases(_0x1c5837[_0x29394b(0x200)])['catch'](()=>[]);if(_0x40d9d0[_0x29394b(0x1e2)]===0x1)return{'dbId':_0x40d9d0[0x0][_0x29394b(0x1ee)],'dbName':_0x40d9d0[0x0][_0x29394b(0x1ff)]};if(_0x40d9d0[_0x29394b(0x1e2)]>0x1){const _0x4ce6ca=await select({'message':_0x29394b(0x1e9),'choices':[..._0x40d9d0[_0x29394b(0x1dc)](_0x2eb15d=>({'name':_0x2eb15d['dbName']+'\x20('+_0x2eb15d[_0x29394b(0x1ee)]+')','value':serializeDbSelection(_0x2eb15d)})),{'name':'✎\x20手动输入\x20dbId','value':_0x29394b(0x1ed)}]});if(_0x4ce6ca!==_0x29394b(0x1ed))return deserializeDbSelection(_0x4ce6ca);}const _0x111be8=await input({'message':_0x29394b(0x1c5),'validate':_0x1fb447=>{const _0x452e30=_0x29394b,_0x49dadb=_0x1fb447[_0x452e30(0x1d2)]();if(!_0x49dadb)return'dbId\x20不能为空';const _0x1374b4=Number(_0x49dadb);if(!Number[_0x452e30(0x1ec)](_0x1374b4)||_0x1374b4<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x111be8[_0x29394b(0x1d2)]())};}async function resolveSqlModeInput(_0x478f6e){const _0x3c959e=a166_0x327c5e,_0xeef00=_0x478f6e[_0x3c959e(0x1ca)](_0x3c959e(0x1cb))[_0x3c959e(0x1d2)]();if(_0xeef00===_0x3c959e(0x1c8)||_0xeef00===_0x3c959e(0x1da))return _0xeef00;if(_0x478f6e[_0x3c959e(0x1f1)])throw CliErrors[_0x3c959e(0x1cc)](_0x3c959e(0x1cb),_0x3c959e(0x1c3));return await select({'message':_0x3c959e(0x1c2),'choices':[{'name':_0x3c959e(0x1d9),'value':_0x3c959e(0x1c8),'description':_0x3c959e(0x1f6)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x3c959e(0x1da),'description':_0x3c959e(0x1de)}]});}function serializeDbSelection(_0x59037c){const _0x4128d7=a166_0x327c5e;return JSON['stringify']({'dbId':_0x59037c[_0x4128d7(0x1ee)],'dbName':_0x59037c[_0x4128d7(0x1ff)]});}function deserializeDbSelection(_0x5308f0){const _0x1a6fa7=a166_0x327c5e;try{const _0xd68d0e=JSON[_0x1a6fa7(0x1c9)](_0x5308f0);if(typeof _0xd68d0e['dbId']===_0x1a6fa7(0x1f7)&&Number[_0x1a6fa7(0x1ea)](_0xd68d0e[_0x1a6fa7(0x1ee)]))return{'dbId':_0xd68d0e[_0x1a6fa7(0x1ee)],'dbName':_0xd68d0e['dbName']};}catch{}throw CliErrors[_0x1a6fa7(0x1f2)](_0x1a6fa7(0x1f9)+_0x5308f0);}function resolveProvidedDbId(_0x44da04){const _0x25d5f0=a166_0x327c5e,_0x3b1bee=_0x44da04[_0x25d5f0(0x1dd)](_0x25d5f0(0x1f4));if(typeof _0x3b1bee===_0x25d5f0(0x1f7)&&Number[_0x25d5f0(0x1ea)](_0x3b1bee))return _0x3b1bee;return undefined;}
|
|
1
|
+
const a166_0x3cf64e=a166_0x3f31;(function(_0x4b280d,_0x153a92){const _0x7ae830=a166_0x3f31,_0x5d0e23=_0x4b280d();while(!![]){try{const _0x4b247d=parseInt(_0x7ae830(0xb2))/0x1*(parseInt(_0x7ae830(0x99))/0x2)+-parseInt(_0x7ae830(0x7e))/0x3+-parseInt(_0x7ae830(0x9b))/0x4*(-parseInt(_0x7ae830(0xbb))/0x5)+parseInt(_0x7ae830(0xae))/0x6*(parseInt(_0x7ae830(0x87))/0x7)+parseInt(_0x7ae830(0xab))/0x8*(parseInt(_0x7ae830(0x80))/0x9)+parseInt(_0x7ae830(0x81))/0xa+-parseInt(_0x7ae830(0x7f))/0xb*(parseInt(_0x7ae830(0x92))/0xc);if(_0x4b247d===_0x153a92)break;else _0x5d0e23['push'](_0x5d0e23['shift']());}catch(_0x3e23bd){_0x5d0e23['push'](_0x5d0e23['shift']());}}}(a166_0x2caf,0x66912));function a166_0x2caf(){const _0x184d06=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','18bYoEef','</select>','db-id','lockFilePath','554335khSGVu','POST','toISOString','name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRootDir','length','catch','5xCEJbW','high-risk-write','sql','lastSync','str','description','314571gplKTZ','11MmOmNw','9ZLSNhF','1176530coLyMW','trim','appCode','__manual__','stringify','flagMissing','386554lZrjAg','sqls','validation','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','dbId\x20不能为空','<server-generated-sqlCode>','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','✎\x20手动输入\x20dbId','适合带动态标签的\x20MyBatis\x20XML\x20SQL','flag','19281180zcuykM','mybatisXml','请选择目标数据库:','sqlRoot','Created\x20SQL\x20query\x20','utf8','请选择本地\x20SQL\x20模式:','2bMaPqp','mode','1965464OKAHbt','dbName','/smartapi/custom/saveUserCustomSql','普通\x20SQL(sql)','请输入\x20SQL\x20名称:','create','nonInteractive','Target\x20database\x20ID','sqlName','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','number','string','SQL\x20query\x20display\x20name','dbId','File\x20already\x20exists:\x20','isFinite','6421728pkXOXC','sqlCode'];a166_0x2caf=function(){return _0x184d06;};return a166_0x2caf();}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';function a166_0x3f31(_0x40154d,_0x120cf2){_0x40154d=_0x40154d-0x79;const _0x2cafd2=a166_0x2caf();let _0x3f312b=_0x2cafd2[_0x40154d];return _0x3f312b;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x494806){const _0x1b9f7d=a166_0x3f31;if(_0x494806===_0x1b9f7d(0x93))return[_0x1b9f7d(0x8e),'\x20\x20SELECT\x201\x20AS\x20id',_0x1b9f7d(0xaf),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a166_0x3cf64e(0x7a),'command':a166_0x3cf64e(0xa0),'description':a166_0x3cf64e(0x8a),'risk':a166_0x3cf64e(0x79),'flags':[{'name':a166_0x3cf64e(0xb5),'type':a166_0x3cf64e(0xa6),'description':a166_0x3cf64e(0xa7)},{'name':'db-id','type':a166_0x3cf64e(0xa5),'description':a166_0x3cf64e(0xa2)},{'name':a166_0x3cf64e(0x9a),'type':a166_0x3cf64e(0xa6),'enum':[a166_0x3cf64e(0x7a),'mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x558b29){const _0x408255=a166_0x3cf64e;if(!_0x558b29[_0x408255(0xa1)])return;if(!_0x558b29[_0x408255(0x7c)](_0x408255(0xb5))[_0x408255(0x82)]())throw CliErrors[_0x408255(0x86)](_0x408255(0xb5),_0x408255(0xb6));const _0x34b1f1=resolveProvidedDbId(_0x558b29);if(typeof _0x34b1f1!=='number'||!Number[_0x408255(0xaa)](_0x34b1f1)||_0x34b1f1<=0x0)throw CliErrors[_0x408255(0x86)](_0x408255(0xb0),_0x408255(0xad));if(!_0x558b29[_0x408255(0x7c)](_0x408255(0x9a))['trim']())throw CliErrors['flagMissing'](_0x408255(0x9a),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x1e99ad){const _0x35109b=a166_0x3cf64e,_0x3fdc49=loadSqlProjectConfig(_0x1e99ad[_0x35109b(0x83)]),{sqlName:_0x5d7aa1,dbId:_0x3d945d,dbName:_0x5b4ab5,mode:_0x296fb1}=await resolveSqlNewInputs(_0x1e99ad),_0x220fa0=buildSqlRelativePath(_0x35109b(0x8d),_0x5d7aa1,_0x5b4ab5,_0x296fb1,_0x3d945d),_0x160e6e=_0x3fdc49[_0x35109b(0xb8)]+'/'+_0x220fa0;return{'method':_0x35109b(0xb3),'url':_0x35109b(0x9d),'body':{'appCode':_0x1e99ad['appCode'],'sqlName':_0x5d7aa1,'dbId':_0x3d945d,'mode':_0x296fb1,'localPath':_0x160e6e},'description':_0x35109b(0x8b)+_0x3fdc49[_0x35109b(0xb8)]};},async 'execute'(_0x208343){const _0x2e4af2=a166_0x3cf64e,_0x49a4b5=loadSqlProjectConfig(_0x208343[_0x2e4af2(0x83)]),{sqlName:_0x297f51,dbId:_0x5b3973,dbName:_0x8f3107,mode:_0x3a4199}=await resolveSqlNewInputs(_0x208343),_0x595f20=generateSqlTemplate(_0x3a4199),_0x262c29=await createSqlQuery({'appCode':_0x208343[_0x2e4af2(0x83)],'sqlName':_0x297f51,'dbId':_0x5b3973,'sqlContent':_0x595f20}),_0x5094fc=ensureRemoteSqlContent(_0x262c29),_0x5509e1=_0x8f3107||await getDbName(_0x208343[_0x2e4af2(0x83)],_0x5b3973)[_0x2e4af2(0xba)](()=>undefined),_0x358df0=buildSqlRelativePath(_0x262c29[_0x2e4af2(0xac)],_0x262c29['sqlName'],_0x5509e1,_0x3a4199,_0x5b3973),_0x23495b=_0x49a4b5[_0x2e4af2(0xb8)]+'/'+_0x358df0,_0x4c9c3b=buildLocalSqlFileContent({'sqlCode':_0x262c29[_0x2e4af2(0xac)],'sqlName':_0x262c29[_0x2e4af2(0xa3)],'dbId':_0x262c29[_0x2e4af2(0xa8)]},_0x5094fc,{'dbName':_0x5509e1,'mode':_0x3a4199,'syncedAt':new Date()[_0x2e4af2(0xb4)](),'description':_0x262c29[_0x2e4af2(0x7d)]});if(await fileExists(_0x23495b))throw CliErrors[_0x2e4af2(0x89)](_0x2e4af2(0xa9)+_0x23495b);await ensureParentDirectory(_0x23495b),await writeFile(_0x23495b,_0x4c9c3b,_0x2e4af2(0x97));const _0x3ca64c=await readSqlLockFile(_0x49a4b5[_0x2e4af2(0xb1)]),{lockData:_0x5932d4,appLock:_0x219024}=ensureSqlLockScope(_0x3ca64c??createEmptySqlLock(),_0x49a4b5[_0x2e4af2(0x83)],_0x49a4b5[_0x2e4af2(0x95)],'new');return _0x219024[_0x2e4af2(0x88)][_0x262c29[_0x2e4af2(0xac)]]={...buildSqlLockEntry(_0x262c29,_0x5094fc,computeSqlContentHash(_0x4c9c3b),{'dbName':_0x5509e1}),'path':_0x358df0,'mode':_0x3a4199},_0x219024[_0x2e4af2(0x7b)]=new Date()[_0x2e4af2(0xb4)](),await writeSqlLockFile(_0x49a4b5[_0x2e4af2(0xb1)],_0x5932d4),{'ok':!![],'data':{'id':_0x262c29['id'],'sqlCode':_0x262c29[_0x2e4af2(0xac)],'sqlName':_0x262c29['sqlName'],'dbId':_0x262c29[_0x2e4af2(0xa8)],'path':_0x23495b,'mode':_0x3a4199},'message':_0x2e4af2(0x96)+_0x262c29[_0x2e4af2(0xac)]};}};async function resolveSqlNewInputs(_0x39edd4){const _0x212aac=await resolveSqlNameInput(_0x39edd4),{dbId:_0x1f56ad,dbName:_0x161fc5}=await resolveDbSelection(_0x39edd4),_0x2538ba=await resolveSqlModeInput(_0x39edd4);return{'sqlName':_0x212aac,'dbId':_0x1f56ad,'dbName':_0x161fc5,'mode':_0x2538ba};}async function resolveSqlNameInput(_0x1b147c){const _0x563533=a166_0x3cf64e,_0xa7f95d=_0x1b147c[_0x563533(0x7c)]('name')[_0x563533(0x82)]();if(_0xa7f95d)return _0xa7f95d;if(_0x1b147c[_0x563533(0xa1)])throw CliErrors[_0x563533(0x86)]('name',_0x563533(0xb6));return(await input({'message':_0x563533(0x9f),'validate':_0x2e9b7e=>_0x2e9b7e['trim']()?!![]:'SQL\x20名称不能为空'}))[_0x563533(0x82)]();}async function resolveDbSelection(_0x4f4d50){const _0xf837bf=a166_0x3cf64e,_0x244e36=resolveProvidedDbId(_0x4f4d50);if(typeof _0x244e36===_0xf837bf(0xa5)&&Number[_0xf837bf(0xaa)](_0x244e36)&&_0x244e36>0x0)return{'dbId':_0x244e36,'dbName':await getDbName(_0x4f4d50[_0xf837bf(0x83)],_0x244e36)[_0xf837bf(0xba)](()=>undefined)};if(_0x4f4d50[_0xf837bf(0xa1)])throw CliErrors[_0xf837bf(0x86)](_0xf837bf(0xb0),_0xf837bf(0xad));const _0x3a8530=await listDatabases(_0x4f4d50['appCode'])[_0xf837bf(0xba)](()=>[]);if(_0x3a8530[_0xf837bf(0xb9)]===0x1)return{'dbId':_0x3a8530[0x0][_0xf837bf(0xa8)],'dbName':_0x3a8530[0x0][_0xf837bf(0x9c)]};if(_0x3a8530[_0xf837bf(0xb9)]>0x1){const _0xe2b1c5=await select({'message':_0xf837bf(0x94),'choices':[..._0x3a8530['map'](_0xef2951=>({'name':_0xef2951['dbName']+'\x20('+_0xef2951[_0xf837bf(0xa8)]+')','value':serializeDbSelection(_0xef2951)})),{'name':_0xf837bf(0x8f),'value':'__manual__'}]});if(_0xe2b1c5!==_0xf837bf(0x84))return deserializeDbSelection(_0xe2b1c5);}const _0x4ad779=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x4b78f8=>{const _0x1c923f=_0xf837bf,_0x131639=_0x4b78f8[_0x1c923f(0x82)]();if(!_0x131639)return _0x1c923f(0x8c);const _0x2c851e=Number(_0x131639);if(!Number['isInteger'](_0x2c851e)||_0x2c851e<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x4ad779[_0xf837bf(0x82)]())};}async function resolveSqlModeInput(_0x23b164){const _0x546b05=a166_0x3cf64e,_0x449471=_0x23b164[_0x546b05(0x7c)]('mode')[_0x546b05(0x82)]();if(_0x449471===_0x546b05(0x7a)||_0x449471===_0x546b05(0x93))return _0x449471;if(_0x23b164[_0x546b05(0xa1)])throw CliErrors['flagMissing'](_0x546b05(0x9a),_0x546b05(0xb7));return await select({'message':_0x546b05(0x98),'choices':[{'name':_0x546b05(0x9e),'value':_0x546b05(0x7a),'description':_0x546b05(0xa4)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x546b05(0x93),'description':_0x546b05(0x90)}]});}function serializeDbSelection(_0x58c014){const _0x51944b=a166_0x3cf64e;return JSON[_0x51944b(0x85)]({'dbId':_0x58c014[_0x51944b(0xa8)],'dbName':_0x58c014[_0x51944b(0x9c)]});}function deserializeDbSelection(_0x33dca3){const _0x260123=a166_0x3cf64e;try{const _0x464fa7=JSON['parse'](_0x33dca3);if(typeof _0x464fa7[_0x260123(0xa8)]===_0x260123(0xa5)&&Number[_0x260123(0xaa)](_0x464fa7[_0x260123(0xa8)]))return{'dbId':_0x464fa7[_0x260123(0xa8)],'dbName':_0x464fa7[_0x260123(0x9c)]};}catch{}throw CliErrors[_0x260123(0x89)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x33dca3);}function resolveProvidedDbId(_0x34e3e6){const _0x32e7af=a166_0x3cf64e,_0x10d983=_0x34e3e6[_0x32e7af(0x91)]('db-id');if(typeof _0x10d983===_0x32e7af(0xa5)&&Number[_0x32e7af(0xaa)](_0x10d983))return _0x10d983;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x1a6b2c=a167_0x1681;(function(_0x590953,_0x43af1f){const _0xbdc4da=a167_0x1681,_0x2c5095=_0x590953();while(!![]){try{const _0x28892d=-parseInt(_0xbdc4da(0x11c))/0x1*(parseInt(_0xbdc4da(0x128))/0x2)+-parseInt(_0xbdc4da(0x132))/0x3*(parseInt(_0xbdc4da(0x139))/0x4)+parseInt(_0xbdc4da(0x12f))/0x5+-parseInt(_0xbdc4da(0x138))/0x6+parseInt(_0xbdc4da(0x137))/0x7+-parseInt(_0xbdc4da(0x11b))/0x8+-parseInt(_0xbdc4da(0x12a))/0x9*(-parseInt(_0xbdc4da(0x129))/0xa);if(_0x28892d===_0x43af1f)break;else _0x2c5095['push'](_0x2c5095['shift']());}catch(_0x5d1834){_0x2c5095['push'](_0x2c5095['shift']());}}}(a167_0x1cc4,0x50d77));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';function a167_0x1681(_0x2dea11,_0x47924c){_0x2dea11=_0x2dea11-0x11b;const _0x1cc427=a167_0x1cc4();let _0x168154=_0x1cc427[_0x2dea11];return _0x168154;}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';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':a167_0x1a6b2c(0x125),'command':a167_0x1a6b2c(0x127),'description':a167_0x1a6b2c(0x133),'risk':a167_0x1a6b2c(0x13a),'flags':[SQLCODE_FLAG],async 'validate'(_0x1ac8cd){const _0x54964d=a167_0x1a6b2c,_0x85ad8c=loadSqlProjectConfig(_0x1ac8cd['appCode']),_0x205636=await readSqlLockFile(_0x85ad8c['lockFilePath']);if(!_0x205636)throw CliErrors['validation'](_0x54964d(0x130));},async 'dryRun'(_0x4150e6){const _0xa6e054=a167_0x1a6b2c,_0x1dceff=loadSqlProjectConfig(_0x4150e6['appCode']),_0x2e9f47=await readSqlLockFile(_0x1dceff['lockFilePath']);if(!_0x2e9f47)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x5a7c94}=ensureSqlLockScope(_0x2e9f47,_0x4150e6[_0xa6e054(0x124)],_0x1dceff[_0xa6e054(0x13b)],_0xa6e054(0x127)),_0x176560=_0x4150e6[_0xa6e054(0x13d)](_0xa6e054(0x120)),_0x4b6ba3=_0x5a7c94[_0xa6e054(0x123)][_0x176560];if(!_0x4b6ba3)throw CliErrors['validation'](_0xa6e054(0x11f)+_0x176560+'\x22.');return{'method':'POST','url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x176560,'id':_0x4b6ba3['remoteId'],'localPath':resolveLocalSqlFilePath(_0x1dceff,_0x176560,_0x4b6ba3)},'description':_0xa6e054(0x126)+_0x176560+_0xa6e054(0x136)+_0x1dceff[_0xa6e054(0x131)]};},async 'execute'(_0x1540a9){const _0x18fcc7=a167_0x1a6b2c,_0x2ce3fd=loadSqlProjectConfig(_0x1540a9[_0x18fcc7(0x124)]),_0xb51726=await readSqlLockFile(_0x2ce3fd[_0x18fcc7(0x121)]);if(!_0xb51726)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x8f194c,appLock:_0x1a32be}=ensureSqlLockScope(_0xb51726,_0x1540a9[_0x18fcc7(0x124)],_0x2ce3fd[_0x18fcc7(0x13b)],_0x18fcc7(0x127)),_0x1dc282=_0x1540a9['str'](_0x18fcc7(0x120)),_0x5b227c=_0x1a32be[_0x18fcc7(0x123)][_0x1dc282];if(!_0x5b227c)throw CliErrors[_0x18fcc7(0x122)](_0x18fcc7(0x11f)+_0x1dc282+'\x22.');await deleteSqlQuery({'id':_0x5b227c[_0x18fcc7(0x12b)],'sqlCode':_0x1dc282}),_0x1a32be[_0x18fcc7(0x123)]=Object['fromEntries'](Object[_0x18fcc7(0x135)](_0x1a32be['sqls'])['filter'](([_0x498946])=>_0x498946!==_0x1dc282)),_0x1a32be[_0x18fcc7(0x11e)]=new Date()[_0x18fcc7(0x134)](),await writeSqlLockFile(_0x2ce3fd['lockFilePath'],_0x8f194c);const _0x4aa554=resolveLocalSqlFilePath(_0x2ce3fd,_0x1dc282,_0x5b227c);let _0x366a41;await fileExists(_0x4aa554)&&(_0x366a41=await moveToTrash(_0x2ce3fd[_0x18fcc7(0x11d)],_0x2ce3fd[_0x18fcc7(0x131)],_0x4aa554),await cleanupEmptyDirectories(dirname(_0x4aa554),_0x2ce3fd[_0x18fcc7(0x12d)]));const _0x46f807={'deleted':_0x1dc282,'remoteId':_0x5b227c['remoteId']};if(_0x366a41)_0x46f807[_0x18fcc7(0x13c)]=_0x366a41;return{'ok':!![],'data':_0x46f807,'message':'Deleted\x20'+_0x1dc282+(_0x366a41?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x18d911,_0x1acd3b,_0x7f83f3){const _0x3bc32f=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x2ce79a=relative(_0x18d911,_0x7f83f3),_0x120f54=join(_0x1acd3b,_0x3bc32f,_0x2ce79a);return await mkdir(dirname(_0x120f54),{'recursive':!![]}),await rename(_0x7f83f3,_0x120f54),_0x120f54;}async function cleanupEmptyDirectories(_0x2146cd,_0x30385a){const _0x3c5c30=a167_0x1a6b2c;let _0x30dd5b=resolve(_0x2146cd);const _0x39daea=resolve(_0x30385a);while(_0x30dd5b[_0x3c5c30(0x12e)](''+_0x39daea+sep)||_0x30dd5b===_0x39daea){if(_0x30dd5b===_0x39daea)return;try{const _0x2a279f=await readdir(_0x30dd5b);if(_0x2a279f[_0x3c5c30(0x12c)]>0x0)return;await rmdir(_0x30dd5b);}catch{return;}_0x30dd5b=dirname(_0x30dd5b);}}function a167_0x1cc4(){const _0x1692f3=['lockFilePath','validation','sqls','appCode','sql','Would\x20delete\x20SQL\x20','delete','6rwIrPA','15055650DTjqDy','9VVwboy','remoteId','length','sqlRootDir','startsWith','1508035nuUSWc','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','trashDir','33429zhMDqP','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','toISOString','entries','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','1557920AFQkrM','186240edIrpl','236tSfmzI','high-risk-write','sqlRoot','trashedTo','str','4816016dBbCZV','136042CxWWvo','projectRoot','lastSync','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','sqlcode'];a167_0x1cc4=function(){return _0x1692f3;};return a167_0x1cc4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a168_0x1faa6f=a168_0x1234;(function(_0x975320,_0x2e506e){const _0x49ab29=a168_0x1234,_0x417526=_0x975320();while(!![]){try{const _0x2fce01=parseInt(_0x49ab29(0x137))/0x1+parseInt(_0x49ab29(0x139))/0x2+-parseInt(_0x49ab29(0x138))/0x3+-parseInt(_0x49ab29(0x131))/0x4+parseInt(_0x49ab29(0x133))/0x5*(-parseInt(_0x49ab29(0x12a))/0x6)+-parseInt(_0x49ab29(0x136))/0x7+-parseInt(_0x49ab29(0x134))/0x8*(-parseInt(_0x49ab29(0x132))/0x9);if(_0x2fce01===_0x2e506e)break;else _0x417526['push'](_0x417526['shift']());}catch(_0x4423cc){_0x417526['push'](_0x417526['shift']());}}}(a168_0x4663,0x75e11));function a168_0x4663(){const _0x491adc=['22045IGVDPn','8GMPnoE','boolean','311360RpPaNF','81275zYrfCL','7329MKvjcy','143700dJReGX','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','appCode','sqlCode','sqlName','sqlContent','354guPCie','dbId','description','read','sqlcode','sql','verbose','670004InOjhi','7238367mCqIYQ'];a168_0x4663=function(){return _0x491adc;};return a168_0x4663();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a168_0x1234(_0x20dc14,_0x5517d2){_0x20dc14=_0x20dc14-0x128;const _0x466324=a168_0x4663();let _0x1234c9=_0x466324[_0x20dc14];return _0x1234c9;}export const sqlDetail={'service':a168_0x1faa6f(0x12f),'command':'detail','description':a168_0x1faa6f(0x13a),'risk':a168_0x1faa6f(0x12d),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a168_0x1faa6f(0x135),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x344432){const _0xdabb8f=a168_0x1faa6f,_0xe2c379=await getSqlQueryInfo(_0x344432['appCode'],_0x344432['str'](_0xdabb8f(0x12e))),_0x16c6a5=_0x344432['bool'](_0xdabb8f(0x130));if(_0x16c6a5)return{'ok':!![],'data':_0xe2c379};const _0x15f507=_0xe2c379[_0xdabb8f(0x12b)]?await getDbName(_0x344432[_0xdabb8f(0x13b)],_0xe2c379[_0xdabb8f(0x12b)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xe2c379[_0xdabb8f(0x13c)],'sqlName':_0xe2c379[_0xdabb8f(0x128)],'db':_0x15f507?_0x15f507+'\x20('+_0xe2c379[_0xdabb8f(0x12b)]+')':_0xe2c379[_0xdabb8f(0x12b)]??'','description':_0xe2c379[_0xdabb8f(0x12c)]??'','sqlContent':_0xe2c379[_0xdabb8f(0x129)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a169_0x58c0cf=a169_0x251b;function a169_0x251b(_0x5bd49d,_0x2549b0){_0x5bd49d=_0x5bd49d-0xa2;const _0x30027e=a169_0x3002();let _0x251bc1=_0x30027e[_0x5bd49d];return _0x251bc1;}(function(_0xa844cc,_0x23502c){const _0x5416e0=a169_0x251b,_0x3fe793=_0xa844cc();while(!![]){try{const _0xd18b7c=parseInt(_0x5416e0(0xb9))/0x1*(parseInt(_0x5416e0(0xaf))/0x2)+-parseInt(_0x5416e0(0xb4))/0x3+parseInt(_0x5416e0(0xa5))/0x4+parseInt(_0x5416e0(0xbd))/0x5*(-parseInt(_0x5416e0(0xa7))/0x6)+parseInt(_0x5416e0(0xa6))/0x7*(parseInt(_0x5416e0(0xab))/0x8)+parseInt(_0x5416e0(0xb8))/0x9+parseInt(_0x5416e0(0xb6))/0xa*(parseInt(_0x5416e0(0xb5))/0xb);if(_0xd18b7c===_0x23502c)break;else _0x3fe793['push'](_0x3fe793['shift']());}catch(_0x56b864){_0x3fe793['push'](_0x3fe793['shift']());}}}(a169_0x3002,0xcdb7a));import{executeSql}from'../../core/api-client.js';function a169_0x3002(){const _0x5badc1=['5313FvlPhD','198606eUjwBp','\x20row(s)\x20in\x20','sql','exec','11080HQaUwk','sqlcode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','str','3446LcVpCG','length','appCode','execResult','isArray','3616068klOQEx','22nqTZXI','3258080qlmZCc','now','648099xmyAvm','32jVktmT','execSuccess','read','Returned\x20','50TuMgjz','params','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execError','2196024Czajpg'];a169_0x3002=function(){return _0x5badc1;};return a169_0x3002();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a169_0x58c0cf(0xa9),'command':a169_0x58c0cf(0xaa),'description':a169_0x58c0cf(0xa3),'risk':a169_0x58c0cf(0xbb),'flags':[SQLCODE_FLAG,{'name':a169_0x58c0cf(0xa2),'type':'string','description':a169_0x58c0cf(0xad)}],async 'execute'(_0xc57a9){const _0x8de298=a169_0x58c0cf,_0x2d0133=parseJsonParams(_0xc57a9[_0x8de298(0xae)](_0x8de298(0xa2))),_0x2b7825=Date['now'](),_0x5724a2=await executeSql(_0xc57a9[_0x8de298(0xb1)],_0xc57a9[_0x8de298(0xae)](_0x8de298(0xac)),_0x2d0133),_0x260f49=Date[_0x8de298(0xb7)]()-_0x2b7825,_0x472627=_0x5724a2?.[_0x8de298(0xb2)]??_0x5724a2,_0xb3995e=_0x5724a2?.[_0x8de298(0xba)]??!![];if(!_0xb3995e)return{'ok':![],'data':{'error':_0x5724a2?.[_0x8de298(0xa4)]||'SQL\x20execution\x20failed','elapsed':_0x260f49},'message':'SQL\x20execution\x20failed'};const _0x1b3328=Array[_0x8de298(0xb3)](_0x472627)?_0x472627:[];return{'ok':!![],'data':{'rows':_0x1b3328,'rowCount':_0x1b3328[_0x8de298(0xb0)],'elapsed':_0x260f49},'message':_0x8de298(0xbc)+_0x1b3328[_0x8de298(0xb0)]+_0x8de298(0xa8)+_0x260f49+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7e368f,_0x220c75){const _0x458dc6=a170_0x12da,_0x30bed2=_0x7e368f();while(!![]){try{const _0x42bdd1=parseInt(_0x458dc6(0x1d3))/0x1+-parseInt(_0x458dc6(0x1d4))/0x2+-parseInt(_0x458dc6(0x1d5))/0x3*(-parseInt(_0x458dc6(0x1d9))/0x4)+parseInt(_0x458dc6(0x1d1))/0x5+-parseInt(_0x458dc6(0x1d8))/0x6*(parseInt(_0x458dc6(0x1d7))/0x7)+-parseInt(_0x458dc6(0x1da))/0x8*(-parseInt(_0x458dc6(0x1d0))/0x9)+-parseInt(_0x458dc6(0x1d6))/0xa*(parseInt(_0x458dc6(0x1d2))/0xb);if(_0x42bdd1===_0x220c75)break;else _0x30bed2['push'](_0x30bed2['shift']());}catch(_0x282e6f){_0x30bed2['push'](_0x30bed2['shift']());}}}(a170_0x239d,0xa0817));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';function a170_0x12da(_0x56589f,_0x2572e7){_0x56589f=_0x56589f-0x1d0;const _0x239d55=a170_0x239d();let _0x12da01=_0x239d55[_0x56589f];return _0x12da01;}import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a170_0x239d(){const _0x59cb3c=['3983930LOiJHt','946UijICD','1151319ePIwpB','933298kEiKCM','33AIjNNa','287930BlXDjX','365421gfyfth','78YzBgEw','407788MDHBdi','15992JipmJe','5445THYywA'];a170_0x239d=function(){return _0x59cb3c;};return a170_0x239d();}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a171_0x3e7d10=a171_0x522d;(function(_0x25a805,_0xe3828c){const _0x482a1f=a171_0x522d,_0x258846=_0x25a805();while(!![]){try{const _0x126b8a=-parseInt(_0x482a1f(0x138))/0x1*(parseInt(_0x482a1f(0x121))/0x2)+-parseInt(_0x482a1f(0x137))/0x3*(parseInt(_0x482a1f(0x139))/0x4)+-parseInt(_0x482a1f(0x124))/0x5*(parseInt(_0x482a1f(0x141))/0x6)+parseInt(_0x482a1f(0x134))/0x7+parseInt(_0x482a1f(0x123))/0x8+-parseInt(_0x482a1f(0x126))/0x9*(-parseInt(_0x482a1f(0x120))/0xa)+parseInt(_0x482a1f(0x135))/0xb;if(_0x126b8a===_0xe3828c)break;else _0x258846['push'](_0x258846['shift']());}catch(_0x3c4bed){_0x258846['push'](_0x258846['shift']());}}}(a171_0x5850,0x29a91));function a171_0x522d(_0x117a88,_0x252aee){_0x117a88=_0x117a88-0x11f;const _0x5850e0=a171_0x5850();let _0x522dd2=_0x5850e0[_0x117a88];return _0x522dd2;}function a171_0x5850(){const _0x1bb55d=['sql','List\x20custom\x20SQL\x20queries','\x20SQL\x20queries\x20(total:\x20','paging','map','name','description','str','verbose','num','length','boolean','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','568953RysiKp','6287556yFImvN','appCode','226020CSHeZJ','58854pLAVjy','16flDbmU','dbId','pagesize','totalCount','number','list','page','all','12fUNeUf','Page\x20size','230210oUVvky','2GhdrNb','Filter\x20by\x20SQL\x20name','413256CdmBwj','491745YnXVem','Found\x20','9kFLYzm'];a171_0x5850=function(){return _0x1bb55d;};return a171_0x5850();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a171_0x3e7d10(0x127),'command':a171_0x3e7d10(0x13e),'description':a171_0x3e7d10(0x128),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a171_0x3e7d10(0x12c),'type':'string','description':a171_0x3e7d10(0x122)},{'name':a171_0x3e7d10(0x13f),'type':'number','description':'Page\x20number','default':0x1},{'name':a171_0x3e7d10(0x13b),'type':a171_0x3e7d10(0x13d),'description':a171_0x3e7d10(0x11f)},{'name':a171_0x3e7d10(0x12f),'type':a171_0x3e7d10(0x132),'description':a171_0x3e7d10(0x133)}],async 'execute'(_0x16573f){const _0x35b8a4=a171_0x3e7d10,_0x3b8199=await listSqlQueries(_0x16573f[_0x35b8a4(0x136)],{'sqlCode':_0x16573f[_0x35b8a4(0x12e)]('sqlcode')||undefined,'sqlName':_0x16573f[_0x35b8a4(0x12e)](_0x35b8a4(0x12c))||undefined,'currentPage':_0x16573f[_0x35b8a4(0x130)](_0x35b8a4(0x13f)),'pageSize':_0x16573f[_0x35b8a4(0x130)](_0x35b8a4(0x13b),0x32)}),_0x1d84a2=_0x16573f['bool'](_0x35b8a4(0x12f)),_0x482442=_0x3b8199['tableData']??[],_0x4a0ef7=_0x3b8199[_0x35b8a4(0x12a)]?.[_0x35b8a4(0x13c)]??_0x482442[_0x35b8a4(0x131)];let _0x445a07;return _0x1d84a2?_0x445a07=_0x482442:_0x445a07=await Promise[_0x35b8a4(0x140)](_0x482442[_0x35b8a4(0x12b)](async _0x128a82=>{const _0xbe6db7=_0x35b8a4;let _0x2241ee;try{_0x2241ee=_0x128a82[_0xbe6db7(0x13a)]?await getDbName(_0x16573f['appCode'],_0x128a82['dbId']):undefined;}catch{}return{'sqlCode':_0x128a82['sqlCode'],'sqlName':_0x128a82['sqlName'],'description':_0x128a82[_0xbe6db7(0x12d)]??'','db':_0x2241ee?_0x2241ee+'\x20('+_0x128a82[_0xbe6db7(0x13a)]+')':_0x128a82[_0xbe6db7(0x13a)]??''};})),{'ok':!![],'data':_0x445a07,'message':_0x482442[_0x35b8a4(0x131)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x35b8a4(0x125)+_0x482442[_0x35b8a4(0x131)]+_0x35b8a4(0x129)+_0x4a0ef7+').'};}};
|