@lovrabet/rabetbase-cli 2.4.6 → 2.4.7-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.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/business-groups.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.d.ts +2 -0
- package/lib/commands/kb/search.js +1 -0
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.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/external-link-update.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/rename.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/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/upgrade.js +1 -1
- package/lib/commands/registry.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/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/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.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.d.ts +16 -0
- 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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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/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
- package/skills/rabetbase/SKILL.md +4 -4
- package/skills/rabetbase/references/rabetbase-kb.md +13 -3
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a175_0x1dc6e7=a175_0x61d2;(function(_0x5d8525,_0x1a7388){const _0x3d076f=a175_0x61d2,_0x1c770a=_0x5d8525();while(!![]){try{const _0x1208ac=-parseInt(_0x3d076f(0xb3))/0x1+parseInt(_0x3d076f(0xb8))/0x2+parseInt(_0x3d076f(0xb0))/0x3+-parseInt(_0x3d076f(0xab))/0x4*(-parseInt(_0x3d076f(0xb5))/0x5)+-parseInt(_0x3d076f(0xad))/0x6+-parseInt(_0x3d076f(0xaa))/0x7+parseInt(_0x3d076f(0xb2))/0x8;if(_0x1208ac===_0x1a7388)break;else _0x1c770a['push'](_0x1c770a['shift']());}catch(_0x1c9045){_0x1c770a['push'](_0x1c770a['shift']());}}}(a175_0x80d6,0x7972a));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 a175_0x80d6(){const _0x35e92e=['Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','1969437DulOWy','high-risk-write','10041536uoKnfu','951060AnesAD','role','195EhvzDm','\x20(id=','roleName','329094LPwVom','delete','dev','Role\x20still\x20has\x20','userCount','appCode','3601661TgkIBv','15376mfsVFc','num','1578606NixErL','POST'];a175_0x80d6=function(){return _0x35e92e;};return a175_0x80d6();}function a175_0x61d2(_0x586066,_0x1a8609){_0x586066=_0x586066-0xaa;const _0x80d615=a175_0x80d6();let _0x61d29a=_0x80d615[_0x586066];return _0x61d29a;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a175_0x1dc6e7(0xb4),'command':'delete','description':a175_0x1dc6e7(0xaf),'risk':a175_0x1dc6e7(0xb1),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x344739){const _0x3c51ca=a175_0x1dc6e7,_0x19e08b=_0x344739[_0x3c51ca(0xac)]('id'),_0x1ed05b=await getRoleById(_0x344739[_0x3c51ca(0xbd)],_0x19e08b);return assertCustomRole(_0x1ed05b,'delete'),asDryRunResult({'scope':_0x3c51ca(0xba),'operation':_0x3c51ca(0xb9),'selector':{'appCode':_0x344739['appCode'],'roleId':_0x19e08b,'roleName':_0x1ed05b[_0x3c51ca(0xb7)]},'before':projectRole(_0x1ed05b),'after':null,'dryRun':!![],'backend':{'method':_0x3c51ca(0xae),'path':DELETE_PATH},'warnings':_0x1ed05b[_0x3c51ca(0xbc)]>0x0?[_0x3c51ca(0xbb)+_0x1ed05b['userCount']+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x3c51ca(0xae),'url':DELETE_PATH});},async 'execute'(_0x5b4267){const _0x2851f9=a175_0x1dc6e7,_0x457ee2=_0x5b4267[_0x2851f9(0xac)]('id'),_0x3cc6e4=await getRoleById(_0x5b4267[_0x2851f9(0xbd)],_0x457ee2);return assertCustomRole(_0x3cc6e4,_0x2851f9(0xb9)),await deleteAppRole(_0x457ee2),{'ok':!![],'data':{'scope':_0x2851f9(0xba),'operation':_0x2851f9(0xb9),'selector':{'appCode':_0x5b4267[_0x2851f9(0xbd)],'roleId':_0x457ee2,'roleName':_0x3cc6e4[_0x2851f9(0xb7)]},'before':projectRole(_0x3cc6e4),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x3cc6e4[_0x2851f9(0xb7)]+_0x2851f9(0xb6)+_0x457ee2+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a176_0x41e5(){const _0x22c469=['dev','Show\x20a\x20single\x20role\x27s\x20detail','appCode','4xdWwOl','919946cAdExj','role','9yyAsHp','1967ianyos','num','35430140iDAgkW','detail','Role\x20','4149300EaxPUs','28472KNVqSA','2379456Giokqs','roleName','roleType','read','1282817uSrtJW','2762463hcrqgz'];a176_0x41e5=function(){return _0x22c469;};return a176_0x41e5();}const a176_0x520b2e=a176_0x544f;(function(_0x2e2060,_0x4fc497){const _0x8a3d1c=a176_0x544f,_0x418e2a=_0x2e2060();while(!![]){try{const _0x5c5caf=-parseInt(_0x8a3d1c(0x118))/0x1+-parseInt(_0x8a3d1c(0x11e))/0x2+parseInt(_0x8a3d1c(0x119))/0x3*(-parseInt(_0x8a3d1c(0x11d))/0x4)+-parseInt(_0x8a3d1c(0x112))/0x5+-parseInt(_0x8a3d1c(0x114))/0x6+-parseInt(_0x8a3d1c(0x10d))/0x7*(-parseInt(_0x8a3d1c(0x113))/0x8)+parseInt(_0x8a3d1c(0x10c))/0x9*(parseInt(_0x8a3d1c(0x10f))/0xa);if(_0x5c5caf===_0x4fc497)break;else _0x418e2a['push'](_0x418e2a['shift']());}catch(_0x3d712c){_0x418e2a['push'](_0x418e2a['shift']());}}}(a176_0x41e5,0x9f6f6));function a176_0x544f(_0x2e8341,_0x1fb64c){_0x2e8341=_0x2e8341-0x10c;const _0x41e554=a176_0x41e5();let _0x544f9f=_0x41e554[_0x2e8341];return _0x544f9f;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a176_0x520b2e(0x11f),'command':a176_0x520b2e(0x110),'description':a176_0x520b2e(0x11b),'risk':a176_0x520b2e(0x117),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x543a5b){const _0x116d3c=a176_0x520b2e,_0x147042=_0x543a5b[_0x116d3c(0x10e)]('id'),_0x12a1e1=await getRoleById(_0x543a5b[_0x116d3c(0x11c)],_0x147042);return{'ok':!![],'data':{'scope':_0x116d3c(0x11a),'role':projectRole(_0x12a1e1)},'message':_0x116d3c(0x111)+_0x12a1e1[_0x116d3c(0x115)]+'\x20('+_0x12a1e1[_0x116d3c(0x116)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5352f7,_0x23a328){const _0x109785=a177_0xa6c1,_0x3e7b21=_0x5352f7();while(!![]){try{const _0x3be3c4=parseInt(_0x109785(0x7b))/0x1+-parseInt(_0x109785(0x7d))/0x2*(parseInt(_0x109785(0x7f))/0x3)+parseInt(_0x109785(0x78))/0x4+parseInt(_0x109785(0x79))/0x5*(parseInt(_0x109785(0x77))/0x6)+-parseInt(_0x109785(0x76))/0x7+parseInt(_0x109785(0x7c))/0x8*(parseInt(_0x109785(0x7e))/0x9)+-parseInt(_0x109785(0x7a))/0xa;if(_0x3be3c4===_0x23a328)break;else _0x3e7b21['push'](_0x3e7b21['shift']());}catch(_0x4474c7){_0x3e7b21['push'](_0x3e7b21['shift']());}}}(a177_0x55d6,0x9ce60));function a177_0xa6c1(_0x236180,_0x282391){_0x236180=_0x236180-0x76;const _0x55d6dc=a177_0x55d6();let _0xa6c101=_0x55d6dc[_0x236180];return _0xa6c101;}import{roleList}from'../../commands/role/list.js';function a177_0x55d6(){const _0x466580=['919368tCTCaA','5091xZiBRI','2812061VYLWfG','6IrzBCx','3420440rlLlPR','5398585GJzJOm','9101740sMJksS','314672sXPChI','8vTeioC','468HhMOBS'];a177_0x55d6=function(){return _0x466580;};return a177_0x55d6();}import{roleDetail}from'../../commands/role/detail.js';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,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0x369794=a178_0x4c5c;function a178_0x4c5c(_0x130d9a,_0x2b6189){_0x130d9a=_0x130d9a-0x16b;const _0x2a20b1=a178_0x2a20();let _0x4c5cdc=_0x2a20b1[_0x130d9a];return _0x4c5cdc;}function a178_0x2a20(){const _0x27f845=['str','2185465EyMqVw','trim','number','join','filter','validation','string','num','read','\x20role(s)','DEV','120xuVWdO','1vNjXki','page','map','CUSTOM','toUpperCase','1351AdcRzR','Use\x20one\x20of:\x20','1287192pHUSgU','pagesize','list','1395KJILnh','2956536DwEFfb','dev','523629wFaKZD','714226jXAfYx','10158IMpVxO','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','ADMIN','Page\x20index\x20(1-based)','length','Page\x20size\x20(1-100)','appCode','type','roleType','includes','OWNER'];a178_0x2a20=function(){return _0x27f845;};return a178_0x2a20();}(function(_0x2812f3,_0x817db3){const _0x12684b=a178_0x4c5c,_0x26f0a6=_0x2812f3();while(!![]){try{const _0x4a8f05=-parseInt(_0x12684b(0x18e))/0x1*(-parseInt(_0x12684b(0x174))/0x2)+-parseInt(_0x12684b(0x173))/0x3+parseInt(_0x12684b(0x16d))/0x4+parseInt(_0x12684b(0x182))/0x5+-parseInt(_0x12684b(0x175))/0x6*(parseInt(_0x12684b(0x16b))/0x7)+-parseInt(_0x12684b(0x171))/0x8+-parseInt(_0x12684b(0x170))/0x9*(parseInt(_0x12684b(0x18d))/0xa);if(_0x4a8f05===_0x817db3)break;else _0x26f0a6['push'](_0x26f0a6['shift']());}catch(_0x2fa77b){_0x26f0a6['push'](_0x26f0a6['shift']());}}}(a178_0x2a20,0x3b655));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a178_0x369794(0x178),a178_0x369794(0x18c),a178_0x369794(0x180),a178_0x369794(0x191)];export const roleList={'service':'role','command':a178_0x369794(0x16f),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a178_0x369794(0x18a),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a178_0x369794(0x188),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a178_0x369794(0x18f),'type':a178_0x369794(0x184),'description':a178_0x369794(0x179),'default':0x1},{'name':a178_0x369794(0x16e),'type':a178_0x369794(0x184),'description':a178_0x369794(0x17b),'default':0x64}],async 'validate'(_0x354cbb){const _0x3cf750=a178_0x369794,_0x44e050=_0x354cbb['str'](_0x3cf750(0x17d))[_0x3cf750(0x183)]();if(_0x44e050&&!ROLE_TYPES[_0x3cf750(0x17f)](_0x44e050['toUpperCase']()))throw CliErrors[_0x3cf750(0x187)]('Invalid\x20--type\x20\x22'+_0x44e050+'\x22.',_0x3cf750(0x16c)+ROLE_TYPES[_0x3cf750(0x185)](',\x20')+'.');const _0x5b6feb=_0x354cbb[_0x3cf750(0x189)](_0x3cf750(0x18f),0x1),_0x1d304b=_0x354cbb['num'](_0x3cf750(0x16e),0x64);if(_0x5b6feb<0x1)throw CliErrors[_0x3cf750(0x187)](_0x3cf750(0x176));if(_0x1d304b<0x1||_0x1d304b>0x64)throw CliErrors[_0x3cf750(0x187)](_0x3cf750(0x177));},async 'execute'(_0x2672d6){const _0x3436d0=a178_0x369794,_0x2831ed=_0x2672d6[_0x3436d0(0x189)](_0x3436d0(0x18f),0x1)||0x1,_0x1fcb18=_0x2672d6['num']('pagesize',0x64)||0x64,_0x1249a8=_0x2672d6[_0x3436d0(0x181)](_0x3436d0(0x17d))['trim']()[_0x3436d0(0x192)](),{items:_0x5ef966,paging:_0x393288}=await listAppRoles(_0x2672d6[_0x3436d0(0x17c)],{'currentPage':_0x2831ed,'pageSize':_0x1fcb18}),_0x4f6dea=_0x1249a8?_0x5ef966[_0x3436d0(0x186)](_0x3a4f56=>_0x3a4f56[_0x3436d0(0x17e)]===_0x1249a8):_0x5ef966,_0x352436=_0x4f6dea[_0x3436d0(0x190)](projectRole);return{'ok':!![],'data':{'scope':_0x3436d0(0x172),'roles':_0x352436,'paging':_0x393288},'message':'Found\x20'+_0x352436[_0x3436d0(0x17a)]+_0x3436d0(0x18b)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a178_0x5add86=a178_0x35d5;(function(_0x3d0a51,_0x32826a){const _0x1ad506=a178_0x35d5,_0x10532c=_0x3d0a51();while(!![]){try{const _0x2d5949=parseInt(_0x1ad506(0x180))/0x1+-parseInt(_0x1ad506(0x17b))/0x2*(-parseInt(_0x1ad506(0x179))/0x3)+parseInt(_0x1ad506(0x1a9))/0x4*(parseInt(_0x1ad506(0x191))/0x5)+-parseInt(_0x1ad506(0x1a6))/0x6+-parseInt(_0x1ad506(0x1ae))/0x7+parseInt(_0x1ad506(0x19f))/0x8*(parseInt(_0x1ad506(0x1a4))/0x9)+parseInt(_0x1ad506(0x1c3))/0xa;if(_0x2d5949===_0x32826a)break;else _0x10532c['push'](_0x10532c['shift']());}catch(_0x34acdf){_0x10532c['push'](_0x10532c['shift']());}}}(a178_0x4e6d,0x75073));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}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':a178_0x5add86(0x1bf),'required':!![],'description':a178_0x5add86(0x177)};export const ROLE_REF_FLAG={'name':a178_0x5add86(0x193),'type':a178_0x5add86(0x1a0),'required':!![],'description':a178_0x5add86(0x18b)};function a178_0x35d5(_0x47b2b6,_0x5d7083){_0x47b2b6=_0x47b2b6-0x171;const _0x4e6d5d=a178_0x4e6d();let _0x35d557=_0x4e6d5d[_0x47b2b6];return _0x35d557;}export const USER_REF_FLAG={'name':a178_0x5add86(0x192),'type':'string','required':!![],'description':a178_0x5add86(0x18e)};export const NAME_FLAG={'name':a178_0x5add86(0x1bd),'type':a178_0x5add86(0x1a0),'required':!![],'description':a178_0x5add86(0x183)};export const USER_NAME_FLAG={'name':a178_0x5add86(0x1bd),'type':a178_0x5add86(0x1a0),'required':!![],'description':a178_0x5add86(0x173)};export const REMARK_FLAG={'name':a178_0x5add86(0x17d),'type':a178_0x5add86(0x1a0),'required':![],'description':a178_0x5add86(0x1b0)};export const EXPECT_USER_COUNT_FLAG={'name':a178_0x5add86(0x189),'type':a178_0x5add86(0x1bf),'required':![],'description':a178_0x5add86(0x1af)};export const BUILTIN_ROLE_TYPES=[a178_0x5add86(0x18f),a178_0x5add86(0x194),a178_0x5add86(0x1a1)];export function isBuiltinRole(_0x5188fe){const _0x91973a=a178_0x5add86;return BUILTIN_ROLE_TYPES[_0x91973a(0x1b8)](_0x5188fe);}export function assertCustomRole(_0xe25aa0,_0xf83177){const _0x33c801=a178_0x5add86;if(_0xe25aa0['roleType']!==_0x33c801(0x184))throw CliErrors[_0x33c801(0x190)]('Cannot\x20'+_0xf83177+_0x33c801(0x1b5)+_0xe25aa0[_0x33c801(0x1ad)]+'\x20('+_0xe25aa0[_0x33c801(0x19c)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x581f14){const _0x56dda0=a178_0x5add86;return{'id':_0x581f14['id'],'roleName':_0x581f14[_0x56dda0(0x1ad)],'roleType':_0x581f14[_0x56dda0(0x19c)],'remark':_0x581f14[_0x56dda0(0x17d)],'userCount':_0x581f14[_0x56dda0(0x186)],'permitCount':_0x581f14[_0x56dda0(0x1bc)],'builtin':isBuiltinRole(_0x581f14[_0x56dda0(0x19c)])};}export async function resolveRoleRef(_0x3b9dfc,_0x4f8e69){const _0x557021=a178_0x5add86,_0x1edd42=_0x4f8e69['trim']();if(!_0x1edd42)throw CliErrors[_0x557021(0x190)]('Missing\x20role\x20reference.',_0x557021(0x19e));if(/^\d+$/[_0x557021(0x197)](_0x1edd42))return getRoleById(_0x3b9dfc,Number(_0x1edd42));const _0x5eaf00=await listAllAppRoles(_0x3b9dfc),_0x4bb9fb=_0x5eaf00[_0x557021(0x1a5)](_0x1a7917=>_0x1a7917['roleName']===_0x1edd42);if(_0x4bb9fb[_0x557021(0x1be)]===0x0)throw CliErrors[_0x557021(0x190)](_0x557021(0x1ac)+_0x1edd42+_0x557021(0x1c7)+_0x3b9dfc+'.',_0x557021(0x19d));if(_0x4bb9fb['length']>0x1){const _0x77b2ab=_0x4bb9fb['map'](_0xfd832a=>_0xfd832a['id'])[_0x557021(0x1aa)](',\x20');throw CliErrors[_0x557021(0x190)](_0x557021(0x1ac)+_0x1edd42+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x77b2ab+').',_0x557021(0x1b2));}return _0x4bb9fb[0x0];}export async function getRoleById(_0x3c869c,_0x4a1e68){const _0xd64ab9=a178_0x5add86,_0x25488a=await listAllAppRoles(_0x3c869c),_0x1e7c92=_0x25488a[_0xd64ab9(0x1a5)](_0x141b47=>_0x141b47['id']===_0x4a1e68&&(!_0x141b47[_0xd64ab9(0x1ab)]||_0x141b47[_0xd64ab9(0x1ab)]===_0x3c869c));if(_0x1e7c92[_0xd64ab9(0x1be)]!==0x1)throw CliErrors[_0xd64ab9(0x190)](_0xd64ab9(0x185)+_0x4a1e68+_0xd64ab9(0x172)+_0x3c869c+'.',_0xd64ab9(0x1b6));return _0x1e7c92[0x0];}async function listAllAppRoles(_0x4089e3){const _0x5a1c39=a178_0x5add86,_0x4acf90=0x64,_0x5b45df=[];for(let _0x2bf425=0x1;;_0x2bf425+=0x1){const {items:_0x202d7a,paging:_0x543433}=await listAppRoles(_0x4089e3,{'currentPage':_0x2bf425,'pageSize':_0x4acf90});_0x5b45df[_0x5a1c39(0x18d)](..._0x202d7a);if(_0x202d7a[_0x5a1c39(0x1be)]<_0x4acf90||_0x543433&&_0x5b45df[_0x5a1c39(0x1be)]>=_0x543433[_0x5a1c39(0x174)])return _0x5b45df;}}function a178_0x4e6d(){const _0x781954=['ADMIN','validation','2100UAFyfk','user','role','DEV','dev','Multiple\x20tenant\x20members\x20match\x20\x22','test','\x20member(s)\x20but\x20role\x20has\x20','tenant','\x20is\x20already\x20a\x20member\x20of\x20role\x20','find','roleType','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Pass\x20--role\x20<id|name>.','24mmUDmw','string','OWNER','nickname',';\x20no\x20change.','909693bmwuoe','filter','3770664tGcZYQ','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','flagMissing','320sItlAy','join','appCode','Role\x20name\x20\x22','roleName','1744638tQjYfa','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Optional\x20role\x20remark/description','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Disambiguate\x20with\x20--role\x20<id>.','tenant_code','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','\x20built-in\x20role\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','authRequired','includes','/smartapi/permit/user-role/create','POST','Pass\x20--user\x20<id|name>.','permitCount','name','length','number','\x20duplicate\x20memberships\x20for\x20user\x20','User\x20','\x20members\x20of\x20the\x20OWNER\x20role.','4534380bQWAhg','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','userId','username','\x22\x20not\x20found\x20in\x20app\x20','Missing\x20user\x20reference.','\x20not\x20found\x20in\x20app\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','totalCount','expectUserCount','trim','Role\x20id\x20(from\x20`role\x20list`)','No\x20tenant\x20member\x20matches\x20\x22','82743qDDSaG','\x20is\x20not\x20a\x20member\x20of\x20role\x20','26neIxZg','dryRun','remark','\x22:\x20','toLowerCase','208203MWeHJU','str','map','Role\x20name','CUSTOM','Role\x20id\x20','userCount','Removed\x20','Anti-drift\x20check\x20failed:\x20expected\x20','expect-user-count','user-add','Role\x20id\x20or\x20exact\x20role\x20name','Disambiguate\x20with\x20--user\x20<id>.','push','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'];a178_0x4e6d=function(){return _0x781954;};return a178_0x4e6d();}export async function resolveTenantCode(){const _0x539069=a178_0x5add86,_0x129612=await getSessionUserInfo(),_0xbe9d63=_0x129612?.[_0x539069(0x192)]?.[_0x539069(0x199)]?.[_0x539069(0x1b3)];if(!_0xbe9d63)throw CliErrors[_0x539069(0x1b7)](_0x539069(0x1a7));return _0xbe9d63;}function matchMember(_0x4dbf87,_0x161a07){const _0x5af721=a178_0x5add86,_0x39e83a=_0x161a07['trim']()[_0x5af721(0x17f)]();return(_0x4dbf87[_0x5af721(0x1a2)]??'')[_0x5af721(0x17f)]()===_0x39e83a||(_0x4dbf87[_0x5af721(0x1c6)]??'')['toLowerCase']()===_0x39e83a;}export async function resolveUserRef(_0x114c8e){const _0x5e35a9=a178_0x5add86,_0x2fc438=_0x114c8e['trim']();if(!_0x2fc438)throw CliErrors[_0x5e35a9(0x190)](_0x5e35a9(0x171),_0x5e35a9(0x1bb));const _0x122902=await resolveTenantCode(),_0x38d1e9=await getTenantMembers(_0x122902);if(/^\d+$/[_0x5e35a9(0x197)](_0x2fc438)){const _0x35d47f=Number(_0x2fc438),_0xa8fca8=_0x38d1e9[_0x5e35a9(0x19b)](_0x46eb23=>_0x46eb23[_0x5e35a9(0x1c5)]===_0x35d47f);return{'userId':_0x35d47f,'username':_0xa8fca8?.['username']??String(_0x35d47f),'nickname':_0xa8fca8?.[_0x5e35a9(0x1a2)],'matchedBy':'id'};}const _0x51b65e=_0x38d1e9[_0x5e35a9(0x1a5)](_0x2c9eb9=>matchMember(_0x2c9eb9,_0x2fc438));if(_0x51b65e[_0x5e35a9(0x1be)]===0x0)throw CliErrors['validation'](_0x5e35a9(0x178)+_0x2fc438+'\x22.',_0x5e35a9(0x1b4));if(_0x51b65e[_0x5e35a9(0x1be)]>0x1){const _0x272288=_0x51b65e[_0x5e35a9(0x182)](_0x27747b=>(_0x27747b[_0x5e35a9(0x1a2)]??_0x27747b[_0x5e35a9(0x1c6)]??'?')+'('+_0x27747b[_0x5e35a9(0x1c5)]+')')[_0x5e35a9(0x1aa)](',\x20');throw CliErrors[_0x5e35a9(0x190)](_0x5e35a9(0x196)+_0x2fc438+_0x5e35a9(0x17e)+_0x272288+'.',_0x5e35a9(0x18c));}const _0x5ddc12=_0x51b65e[0x0];return{'userId':_0x5ddc12[_0x5e35a9(0x1c5)],'username':_0x5ddc12['username']??String(_0x5ddc12[_0x5e35a9(0x1c5)]),'nickname':_0x5ddc12[_0x5e35a9(0x1a2)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a178_0x5add86(0x1b9);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x574eb4){const _0x54bc05=a178_0x5add86,{operation:_0x4bafbb,appCode:_0x4f324f,role:_0x36b0e7,relations:_0x4f264f,user:_0x129d9f}=_0x574eb4,_0x44468d=[...new Set(_0x4f264f[_0x54bc05(0x182)](_0x3310da=>_0x3310da['userId']))],_0x40ca17=[];if(_0x574eb4[_0x54bc05(0x175)]!==undefined&&_0x574eb4[_0x54bc05(0x175)]!==_0x44468d[_0x54bc05(0x1be)])throw CliErrors[_0x54bc05(0x190)](_0x54bc05(0x188)+_0x574eb4[_0x54bc05(0x175)]+_0x54bc05(0x198)+_0x44468d[_0x54bc05(0x1be)]+'.',_0x54bc05(0x1b1));const _0x5363ca=_0x44468d[_0x54bc05(0x1b8)](_0x129d9f['userId']),_0x6ac78e=_0x4f264f['filter'](_0x32ec47=>_0x32ec47[_0x54bc05(0x1c5)]===_0x129d9f[_0x54bc05(0x1c5)])[_0x54bc05(0x182)](_0x1409a5=>_0x1409a5['id']),_0x1745b5=_0x4bafbb===_0x54bc05(0x18a)?!_0x5363ca:_0x5363ca;let _0x34edef=_0x44468d;_0x4bafbb===_0x54bc05(0x18a)?_0x5363ca?_0x40ca17[_0x54bc05(0x18d)]('User\x20'+_0x129d9f[_0x54bc05(0x1c5)]+_0x54bc05(0x19a)+_0x36b0e7[_0x54bc05(0x1ad)]+_0x54bc05(0x1a3)):_0x34edef=[..._0x44468d,_0x129d9f['userId']]:!_0x5363ca?_0x40ca17[_0x54bc05(0x18d)](_0x54bc05(0x1c1)+_0x129d9f['userId']+_0x54bc05(0x17a)+_0x36b0e7['roleName']+_0x54bc05(0x1a3)):(_0x34edef=_0x44468d['filter'](_0x3dce3c=>_0x3dce3c!==_0x129d9f[_0x54bc05(0x1c5)]),_0x6ac78e[_0x54bc05(0x1be)]>0x1&&_0x40ca17[_0x54bc05(0x18d)](_0x54bc05(0x187)+_0x6ac78e[_0x54bc05(0x1be)]+_0x54bc05(0x1c0)+_0x129d9f['userId']+'.'));const _0xf7b143={'scope':_0x54bc05(0x195),'operation':_0x4bafbb,'selector':{'appCode':_0x4f324f,'roleId':_0x36b0e7['id'],'roleName':_0x36b0e7[_0x54bc05(0x1ad)],'userId':_0x129d9f[_0x54bc05(0x1c5)]},'before':{'userIds':_0x44468d},'after':{'userIds':_0x34edef},'dryRun':_0x574eb4[_0x54bc05(0x17c)],'backend':{'method':_0x54bc05(0x1ba),'path':_0x4bafbb===_0x54bc05(0x18a)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x40ca17};return{'mutation':_0xf7b143,'changed':_0x1745b5,'matchingRelationIds':_0x6ac78e};}export async function loadDevRoleRelations(_0x21c72a,_0x983d49){const _0x1fe9fa=a178_0x5add86,_0x5cc542=0x64,_0x24d0c6=[];for(let _0x2ee3d3=0x1;;_0x2ee3d3+=0x1){const {items:_0x42ae16,paging:_0x46de36}=await listDevUserRoleRelations(_0x21c72a,{'roleId':_0x983d49,'currentPage':_0x2ee3d3,'pageSize':_0x5cc542});_0x24d0c6[_0x1fe9fa(0x18d)](..._0x42ae16);if(_0x42ae16[_0x1fe9fa(0x1be)]<_0x5cc542||_0x46de36&&_0x24d0c6[_0x1fe9fa(0x1be)]>=_0x46de36['totalCount'])return _0x24d0c6;}}export function readRoleRef(_0x210d42){const _0x38cb29=a178_0x5add86,_0x293d72=_0x210d42[_0x38cb29(0x181)](_0x38cb29(0x193))[_0x38cb29(0x176)]();if(!_0x293d72)throw CliErrors[_0x38cb29(0x1a8)](_0x38cb29(0x193),'Pass\x20--role\x20<id|name>.');return _0x293d72;}export async function prepareUserMutation(_0x323720,_0x2d9330,_0x9746ed){const _0x11823c=a178_0x5add86,_0x51ae02=readRoleRef(_0x323720),_0x5de1b7=_0x323720['str'](_0x11823c(0x192))[_0x11823c(0x176)]();if(!_0x5de1b7)throw CliErrors[_0x11823c(0x1a8)](_0x11823c(0x192),'Pass\x20--user\x20<id|name>.');const _0x23723d=_0x323720['flag']('expect-user-count'),_0x37d033=_0x23723d===undefined||_0x23723d===null?undefined:Number(_0x23723d),_0x5aec11=await resolveRoleRef(_0x323720[_0x11823c(0x1ab)],_0x51ae02);if(_0x5aec11[_0x11823c(0x19c)]===_0x11823c(0x1a1))throw CliErrors[_0x11823c(0x190)]('Cannot\x20'+_0x2d9330+_0x11823c(0x1c2),_0x11823c(0x1c4));const _0x46f930=await resolveUserRef(_0x5de1b7),_0x5a1ba7=await loadDevRoleRelations(_0x323720[_0x11823c(0x1ab)],_0x5aec11['id']);return{...computeRoleUserMutation({'operation':_0x2d9330,'appCode':_0x323720[_0x11823c(0x1ab)],'role':_0x5aec11,'relations':_0x5a1ba7,'user':{'userId':_0x46f930[_0x11823c(0x1c5)],'username':_0x46f930[_0x11823c(0x1c6)],'nickname':_0x46f930['nickname']},'dryRun':_0x9746ed,..._0x37d033!==undefined?{'expectUserCount':_0x37d033}:{}}),'role':_0x5aec11,'user':_0x46f930};}
|
|
1
|
+
const a179_0x56e9b8=a179_0x1679;(function(_0x2b0669,_0x550f58){const _0x143645=a179_0x1679,_0x8a037d=_0x2b0669();while(!![]){try{const _0x775521=parseInt(_0x143645(0x17b))/0x1*(-parseInt(_0x143645(0x178))/0x2)+-parseInt(_0x143645(0x16b))/0x3*(parseInt(_0x143645(0x151))/0x4)+-parseInt(_0x143645(0x133))/0x5+parseInt(_0x143645(0x141))/0x6*(-parseInt(_0x143645(0x142))/0x7)+-parseInt(_0x143645(0x15c))/0x8+parseInt(_0x143645(0x16d))/0x9*(-parseInt(_0x143645(0x160))/0xa)+parseInt(_0x143645(0x171))/0xb;if(_0x775521===_0x550f58)break;else _0x8a037d['push'](_0x8a037d['shift']());}catch(_0x3a3481){_0x8a037d['push'](_0x8a037d['shift']());}}}(a179_0x20cc,0x349a3));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';function a179_0x1679(_0x2a1578,_0x17925e){_0x2a1578=_0x2a1578-0x132;const _0x20cccc=a179_0x20cc();let _0x16791b=_0x20cccc[_0x2a1578];return _0x16791b;}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a179_0x56e9b8(0x144),'required':!![],'description':a179_0x56e9b8(0x148)};export const ROLE_REF_FLAG={'name':a179_0x56e9b8(0x138),'type':a179_0x56e9b8(0x13f),'required':!![],'description':a179_0x56e9b8(0x163)};export const USER_REF_FLAG={'name':a179_0x56e9b8(0x139),'type':'string','required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':a179_0x56e9b8(0x13f),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a179_0x56e9b8(0x153),'type':'string','required':!![],'description':a179_0x56e9b8(0x15f)};export const REMARK_FLAG={'name':'remark','type':a179_0x56e9b8(0x13f),'required':![],'description':a179_0x56e9b8(0x152)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a179_0x56e9b8(0x144),'required':![],'description':a179_0x56e9b8(0x15d)};export const BUILTIN_ROLE_TYPES=['ADMIN',a179_0x56e9b8(0x16f),a179_0x56e9b8(0x158)];export function isBuiltinRole(_0x1546df){const _0xe1b313=a179_0x56e9b8;return BUILTIN_ROLE_TYPES[_0xe1b313(0x166)](_0x1546df);}export function assertCustomRole(_0x5c9580,_0x23a961){const _0x399b7a=a179_0x56e9b8;if(_0x5c9580[_0x399b7a(0x16c)]!==_0x399b7a(0x17c))throw CliErrors[_0x399b7a(0x13a)](_0x399b7a(0x150)+_0x23a961+_0x399b7a(0x159)+_0x5c9580[_0x399b7a(0x14b)]+'\x20('+_0x5c9580['roleType']+').',_0x399b7a(0x15e));}function a179_0x20cc(){const _0x43bd10=['DEV','Pass\x20--role\x20<id|name>.','19111895nlsbLU','length','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','join','authRequired','dev','2ohejBv','\x20not\x20found\x20in\x20app\x20','userId','236584rsozYm','CUSTOM','username','POST','Disambiguate\x20with\x20--role\x20<id>.','tenant_code','706835ceHHzO','user-add','str','remark','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','role','user','validation','tenant','flagMissing','Missing\x20role\x20reference.','push','string','toLowerCase','6KHMukh','2171806pQtCFX','flag','number','trim','map','nickname','Role\x20id\x20(from\x20`role\x20list`)','User\x20',';\x20no\x20change.','roleName','appCode','\x22\x20is\x20ambiguous\x20(ids:\x20','totalCount','Missing\x20user\x20reference.','Cannot\x20','8WHIRJR','Optional\x20role\x20remark/description','name','\x20duplicate\x20memberships\x20for\x20user\x20','dryRun','Anti-drift\x20check\x20failed:\x20expected\x20','find','OWNER','\x20built-in\x20role\x20','Pass\x20--user\x20<id|name>.','test','3015048FyAgpX','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','1288370RVjkde','filter','userCount','Role\x20id\x20or\x20exact\x20role\x20name','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20member(s)\x20but\x20role\x20has\x20','includes','\x22\x20not\x20found\x20in\x20app\x20','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x22:\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','298833ZPUIFo','roleType','18RFmjiS','expectUserCount'];a179_0x20cc=function(){return _0x43bd10;};return a179_0x20cc();}export function projectRole(_0x94495e){const _0x204e81=a179_0x56e9b8;return{'id':_0x94495e['id'],'roleName':_0x94495e[_0x204e81(0x14b)],'roleType':_0x94495e[_0x204e81(0x16c)],'remark':_0x94495e[_0x204e81(0x136)],'userCount':_0x94495e[_0x204e81(0x162)],'permitCount':_0x94495e['permitCount'],'builtin':isBuiltinRole(_0x94495e[_0x204e81(0x16c)])};}export async function resolveRoleRef(_0x36d5ca,_0x39092b){const _0x3ad65e=a179_0x56e9b8,_0x5b87a9=_0x39092b['trim']();if(!_0x5b87a9)throw CliErrors[_0x3ad65e(0x13a)](_0x3ad65e(0x13d),_0x3ad65e(0x170));if(/^\d+$/[_0x3ad65e(0x15b)](_0x5b87a9))return getRoleById(_0x36d5ca,Number(_0x5b87a9));const _0x58f960=await listAllAppRoles(_0x36d5ca),_0x3232ae=_0x58f960[_0x3ad65e(0x161)](_0x4898d8=>_0x4898d8[_0x3ad65e(0x14b)]===_0x5b87a9);if(_0x3232ae[_0x3ad65e(0x172)]===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x5b87a9+_0x3ad65e(0x167)+_0x36d5ca+'.',_0x3ad65e(0x173));if(_0x3232ae[_0x3ad65e(0x172)]>0x1){const _0x173579=_0x3232ae[_0x3ad65e(0x146)](_0x1de1d3=>_0x1de1d3['id'])[_0x3ad65e(0x175)](',\x20');throw CliErrors[_0x3ad65e(0x13a)]('Role\x20name\x20\x22'+_0x5b87a9+_0x3ad65e(0x14d)+_0x173579+').',_0x3ad65e(0x17f));}return _0x3232ae[0x0];}export async function getRoleById(_0x5a9163,_0x5a111b){const _0x8453d6=a179_0x56e9b8,_0x1d1ad4=await listAllAppRoles(_0x5a9163),_0x4e04e2=_0x1d1ad4[_0x8453d6(0x161)](_0x49460e=>_0x49460e['id']===_0x5a111b&&(!_0x49460e[_0x8453d6(0x14c)]||_0x49460e[_0x8453d6(0x14c)]===_0x5a9163));if(_0x4e04e2['length']!==0x1)throw CliErrors[_0x8453d6(0x13a)]('Role\x20id\x20'+_0x5a111b+_0x8453d6(0x179)+_0x5a9163+'.',_0x8453d6(0x137));return _0x4e04e2[0x0];}async function listAllAppRoles(_0x4b3ec3){const _0x4ee1cb=a179_0x56e9b8,_0xbbdc5b=0x64,_0x320074=[];for(let _0xa16021=0x1;;_0xa16021+=0x1){const {items:_0x364145,paging:_0xbf1475}=await listAppRoles(_0x4b3ec3,{'currentPage':_0xa16021,'pageSize':_0xbbdc5b});_0x320074[_0x4ee1cb(0x13e)](..._0x364145);if(_0x364145[_0x4ee1cb(0x172)]<_0xbbdc5b||_0xbf1475&&_0x320074[_0x4ee1cb(0x172)]>=_0xbf1475[_0x4ee1cb(0x14e)])return _0x320074;}}export async function resolveTenantCode(){const _0x4a1a73=a179_0x56e9b8,_0x5412f5=await getSessionUserInfo(),_0x4ae246=_0x5412f5?.[_0x4a1a73(0x139)]?.[_0x4a1a73(0x13b)]?.[_0x4a1a73(0x132)];if(!_0x4ae246)throw CliErrors[_0x4a1a73(0x176)](_0x4a1a73(0x168));return _0x4ae246;}function matchMember(_0x23c5b3,_0x226ecc){const _0xf4ad4f=a179_0x56e9b8,_0x2f0a7d=_0x226ecc[_0xf4ad4f(0x145)]()['toLowerCase']();return(_0x23c5b3[_0xf4ad4f(0x147)]??'')[_0xf4ad4f(0x140)]()===_0x2f0a7d||(_0x23c5b3['username']??'')[_0xf4ad4f(0x140)]()===_0x2f0a7d;}export async function resolveUserRef(_0x5b99f5){const _0x124aa8=a179_0x56e9b8,_0x37f977=_0x5b99f5['trim']();if(!_0x37f977)throw CliErrors['validation'](_0x124aa8(0x14f),_0x124aa8(0x15a));const _0x516001=await resolveTenantCode(),_0x49edd5=await getTenantMembers(_0x516001);if(/^\d+$/['test'](_0x37f977)){const _0x1b1eb3=Number(_0x37f977),_0x105305=_0x49edd5[_0x124aa8(0x157)](_0x3d7e15=>_0x3d7e15[_0x124aa8(0x17a)]===_0x1b1eb3);return{'userId':_0x1b1eb3,'username':_0x105305?.[_0x124aa8(0x17d)]??String(_0x1b1eb3),'nickname':_0x105305?.[_0x124aa8(0x147)],'matchedBy':'id'};}const _0x52b9de=_0x49edd5[_0x124aa8(0x161)](_0x53b593=>matchMember(_0x53b593,_0x37f977));if(_0x52b9de[_0x124aa8(0x172)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x37f977+'\x22.',_0x124aa8(0x174));if(_0x52b9de[_0x124aa8(0x172)]>0x1){const _0x743fda=_0x52b9de[_0x124aa8(0x146)](_0x18313b=>(_0x18313b[_0x124aa8(0x147)]??_0x18313b[_0x124aa8(0x17d)]??'?')+'('+_0x18313b[_0x124aa8(0x17a)]+')')[_0x124aa8(0x175)](',\x20');throw CliErrors[_0x124aa8(0x13a)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x37f977+_0x124aa8(0x169)+_0x743fda+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x43182b=_0x52b9de[0x0];return{'userId':_0x43182b[_0x124aa8(0x17a)],'username':_0x43182b[_0x124aa8(0x17d)]??String(_0x43182b[_0x124aa8(0x17a)]),'nickname':_0x43182b[_0x124aa8(0x147)],'matchedBy':_0x124aa8(0x153)};}export const CREATE_USER_ROLE_PATH='/smartapi/permit/user-role/create';export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x4ea75f){const _0x5b4468=a179_0x56e9b8,{operation:_0x18b7d8,appCode:_0x17333d,role:_0x4448cc,relations:_0x3e6954,user:_0x1592fa}=_0x4ea75f,_0x2f21f7=[...new Set(_0x3e6954[_0x5b4468(0x146)](_0x504de2=>_0x504de2['userId']))],_0xf5d68f=[];if(_0x4ea75f[_0x5b4468(0x16e)]!==undefined&&_0x4ea75f[_0x5b4468(0x16e)]!==_0x2f21f7['length'])throw CliErrors[_0x5b4468(0x13a)](_0x5b4468(0x156)+_0x4ea75f[_0x5b4468(0x16e)]+_0x5b4468(0x165)+_0x2f21f7[_0x5b4468(0x172)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x35f8da=_0x2f21f7[_0x5b4468(0x166)](_0x1592fa[_0x5b4468(0x17a)]),_0x33b339=_0x3e6954[_0x5b4468(0x161)](_0x4a04cf=>_0x4a04cf[_0x5b4468(0x17a)]===_0x1592fa['userId'])[_0x5b4468(0x146)](_0x4377a9=>_0x4377a9['id']),_0x5e1fbf=_0x18b7d8===_0x5b4468(0x134)?!_0x35f8da:_0x35f8da;let _0x506611=_0x2f21f7;_0x18b7d8==='user-add'?_0x35f8da?_0xf5d68f[_0x5b4468(0x13e)]('User\x20'+_0x1592fa[_0x5b4468(0x17a)]+_0x5b4468(0x16a)+_0x4448cc['roleName']+_0x5b4468(0x14a)):_0x506611=[..._0x2f21f7,_0x1592fa[_0x5b4468(0x17a)]]:!_0x35f8da?_0xf5d68f[_0x5b4468(0x13e)](_0x5b4468(0x149)+_0x1592fa[_0x5b4468(0x17a)]+_0x5b4468(0x164)+_0x4448cc['roleName']+_0x5b4468(0x14a)):(_0x506611=_0x2f21f7['filter'](_0x106302=>_0x106302!==_0x1592fa['userId']),_0x33b339[_0x5b4468(0x172)]>0x1&&_0xf5d68f[_0x5b4468(0x13e)]('Removed\x20'+_0x33b339[_0x5b4468(0x172)]+_0x5b4468(0x154)+_0x1592fa[_0x5b4468(0x17a)]+'.'));const _0x95c811={'scope':_0x5b4468(0x177),'operation':_0x18b7d8,'selector':{'appCode':_0x17333d,'roleId':_0x4448cc['id'],'roleName':_0x4448cc[_0x5b4468(0x14b)],'userId':_0x1592fa[_0x5b4468(0x17a)]},'before':{'userIds':_0x2f21f7},'after':{'userIds':_0x506611},'dryRun':_0x4ea75f[_0x5b4468(0x155)],'backend':{'method':_0x5b4468(0x17e),'path':_0x18b7d8===_0x5b4468(0x134)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xf5d68f};return{'mutation':_0x95c811,'changed':_0x5e1fbf,'matchingRelationIds':_0x33b339};}export async function loadDevRoleRelations(_0x5392e9,_0x4c0de8){const _0x12eb88=a179_0x56e9b8,_0x9c24bd=0x64,_0x4f5744=[];for(let _0x43d046=0x1;;_0x43d046+=0x1){const {items:_0x58d222,paging:_0x4a7a16}=await listDevUserRoleRelations(_0x5392e9,{'roleId':_0x4c0de8,'currentPage':_0x43d046,'pageSize':_0x9c24bd});_0x4f5744['push'](..._0x58d222);if(_0x58d222['length']<_0x9c24bd||_0x4a7a16&&_0x4f5744[_0x12eb88(0x172)]>=_0x4a7a16[_0x12eb88(0x14e)])return _0x4f5744;}}export function readRoleRef(_0x38cbc5){const _0x5f187a=a179_0x56e9b8,_0x3f5798=_0x38cbc5[_0x5f187a(0x135)](_0x5f187a(0x138))[_0x5f187a(0x145)]();if(!_0x3f5798)throw CliErrors[_0x5f187a(0x13c)](_0x5f187a(0x138),_0x5f187a(0x170));return _0x3f5798;}export async function prepareUserMutation(_0x50511c,_0x39f136,_0x10b8a3){const _0x24ef3a=a179_0x56e9b8,_0x461516=readRoleRef(_0x50511c),_0x21d4bc=_0x50511c[_0x24ef3a(0x135)]('user')[_0x24ef3a(0x145)]();if(!_0x21d4bc)throw CliErrors[_0x24ef3a(0x13c)](_0x24ef3a(0x139),_0x24ef3a(0x15a));const _0x517358=_0x50511c[_0x24ef3a(0x143)]('expect-user-count'),_0x29d3dc=_0x517358===undefined||_0x517358===null?undefined:Number(_0x517358),_0x11df95=await resolveRoleRef(_0x50511c[_0x24ef3a(0x14c)],_0x461516);if(_0x11df95[_0x24ef3a(0x16c)]===_0x24ef3a(0x158))throw CliErrors[_0x24ef3a(0x13a)](_0x24ef3a(0x150)+_0x39f136+'\x20members\x20of\x20the\x20OWNER\x20role.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x4a51ac=await resolveUserRef(_0x21d4bc),_0x5b2a57=await loadDevRoleRelations(_0x50511c['appCode'],_0x11df95['id']);return{...computeRoleUserMutation({'operation':_0x39f136,'appCode':_0x50511c['appCode'],'role':_0x11df95,'relations':_0x5b2a57,'user':{'userId':_0x4a51ac[_0x24ef3a(0x17a)],'username':_0x4a51ac[_0x24ef3a(0x17d)],'nickname':_0x4a51ac[_0x24ef3a(0x147)]},'dryRun':_0x10b8a3,..._0x29d3dc!==undefined?{'expectUserCount':_0x29d3dc}:{}}),'role':_0x11df95,'user':_0x4a51ac};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x86da50=a180_0xc556;(function(_0x39f47c,_0x1d0923){const _0x3b8e35=a180_0xc556,_0x42aca5=_0x39f47c();while(!![]){try{const _0x181a15=parseInt(_0x3b8e35(0xe3))/0x1*(parseInt(_0x3b8e35(0xeb))/0x2)+parseInt(_0x3b8e35(0xd4))/0x3+parseInt(_0x3b8e35(0xd9))/0x4*(parseInt(_0x3b8e35(0xea))/0x5)+-parseInt(_0x3b8e35(0xd5))/0x6*(parseInt(_0x3b8e35(0xf0))/0x7)+parseInt(_0x3b8e35(0xee))/0x8+parseInt(_0x3b8e35(0xf3))/0x9+parseInt(_0x3b8e35(0xda))/0xa*(-parseInt(_0x3b8e35(0xe5))/0xb);if(_0x181a15===_0x1d0923)break;else _0x42aca5['push'](_0x42aca5['shift']());}catch(_0x3c5e73){_0x42aca5['push'](_0x42aca5['shift']());}}}(a180_0xc25b,0x99b36));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a180_0xc556(_0x3ae22a,_0x15561c){_0x3ae22a=_0x3ae22a-0xd3;const _0xc25bd9=a180_0xc25b();let _0xc55610=_0xc25bd9[_0x3ae22a];return _0xc55610;}function a180_0xc25b(){const _0x5e4dd9=['27045290tvZnLM','trim','update','--name\x20cannot\x20be\x20empty.','appCode','name','POST','flag','dev','6614OkNUcA','New\x20role\x20name','11pkaHmV','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','num','roleName','865HjRpku','308BYGjEk','validation','write','5290144CtrZQk','Nothing\x20to\x20update.','1137619uaAWDe','length','Updated\x20role\x20','5216931hCJDtO','string','remark','210708IctHHo','6OhReRt','/smartapi/permit/role/update','\x20(id=','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','26980wpsNXp'];a180_0xc25b=function(){return _0x5e4dd9;};return a180_0xc25b();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a180_0x86da50(0xd6);function readPatch(_0x4b1907){const _0x69fbcf=a180_0x86da50,_0x3eba19=_0x4b1907[_0x69fbcf(0xe1)](_0x69fbcf(0xdf)),_0x284208=_0x4b1907['flag'](_0x69fbcf(0xd3)),_0x5c526c={};if(_0x3eba19!==undefined&&_0x3eba19!==null){const _0x5ae4d7=String(_0x3eba19)[_0x69fbcf(0xdb)]();if(!_0x5ae4d7)throw CliErrors[_0x69fbcf(0xec)](_0x69fbcf(0xdd));if(_0x5ae4d7[_0x69fbcf(0xf1)]>0x40)throw CliErrors['validation'](_0x69fbcf(0xe6));_0x5c526c['roleName']=_0x5ae4d7;}_0x284208!==undefined&&_0x284208!==null&&(_0x5c526c[_0x69fbcf(0xd3)]=String(_0x284208));if(_0x5c526c[_0x69fbcf(0xe9)]===undefined&&_0x5c526c[_0x69fbcf(0xd3)]===undefined)throw CliErrors[_0x69fbcf(0xec)](_0x69fbcf(0xef),_0x69fbcf(0xd8));return _0x5c526c;}export const roleUpdate={'service':'role','command':'update','description':a180_0x86da50(0xe7),'risk':a180_0x86da50(0xed),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a180_0x86da50(0xf4),'required':![],'description':a180_0x86da50(0xe4)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x32bf5b){readPatch(_0x32bf5b);},async 'dryRun'(_0x5909d1){const _0x21aa73=a180_0x86da50,_0x3e9cdd=_0x5909d1[_0x21aa73(0xe8)]('id'),_0x498465=readPatch(_0x5909d1),_0x270810=await getRoleById(_0x5909d1[_0x21aa73(0xde)],_0x3e9cdd);return assertCustomRole(_0x270810,'update'),asDryRunResult({'scope':_0x21aa73(0xe2),'operation':'update','selector':{'appCode':_0x5909d1[_0x21aa73(0xde)],'roleId':_0x3e9cdd,'roleName':_0x270810[_0x21aa73(0xe9)]},'before':projectRole(_0x270810),'after':projectRole({..._0x270810,..._0x498465['roleName']!==undefined?{'roleName':_0x498465['roleName']}:{},..._0x498465[_0x21aa73(0xd3)]!==undefined?{'remark':_0x498465[_0x21aa73(0xd3)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x21aa73(0xe0),'url':UPDATE_PATH});},async 'execute'(_0x454f77){const _0x517b8e=a180_0x86da50,_0x1c8c48=_0x454f77[_0x517b8e(0xe8)]('id'),_0x376670=readPatch(_0x454f77),_0x33f8e0=await getRoleById(_0x454f77[_0x517b8e(0xde)],_0x1c8c48);assertCustomRole(_0x33f8e0,'update'),await updateAppRole({'id':_0x1c8c48,'appCode':_0x454f77[_0x517b8e(0xde)],..._0x376670[_0x517b8e(0xe9)]!==undefined?{'roleName':_0x376670[_0x517b8e(0xe9)]}:{},..._0x376670[_0x517b8e(0xd3)]!==undefined?{'remark':_0x376670[_0x517b8e(0xd3)]}:{}});const _0x38a6b2=await getRoleById(_0x454f77[_0x517b8e(0xde)],_0x1c8c48);return{'ok':!![],'data':{'scope':_0x517b8e(0xe2),'operation':_0x517b8e(0xdc),'selector':{'appCode':_0x454f77[_0x517b8e(0xde)],'roleId':_0x1c8c48,'roleName':_0x38a6b2[_0x517b8e(0xe9)]},'before':projectRole(_0x33f8e0),'after':projectRole(_0x38a6b2),'dryRun':![],'backend':{'method':_0x517b8e(0xe0),'path':UPDATE_PATH},'warnings':[]},'message':_0x517b8e(0xf2)+_0x38a6b2[_0x517b8e(0xe9)]+_0x517b8e(0xd7)+_0x1c8c48+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x34cedb=a181_0xead1;(function(_0x16a90c,_0x146dc1){const _0x42c9bd=a181_0xead1,_0x6e1773=_0x16a90c();while(!![]){try{const _0x968db6=-parseInt(_0x42c9bd(0xbf))/0x1+-parseInt(_0x42c9bd(0xc7))/0x2+-parseInt(_0x42c9bd(0xca))/0x3*(-parseInt(_0x42c9bd(0xc8))/0x4)+parseInt(_0x42c9bd(0xc3))/0x5+-parseInt(_0x42c9bd(0xc9))/0x6+parseInt(_0x42c9bd(0xc1))/0x7+-parseInt(_0x42c9bd(0xcb))/0x8*(-parseInt(_0x42c9bd(0xc4))/0x9);if(_0x968db6===_0x146dc1)break;else _0x6e1773['push'](_0x6e1773['shift']());}catch(_0x46d04f){_0x6e1773['push'](_0x6e1773['shift']());}}}(a181_0x4fc0,0xf0c71));import{createDevUserRole}from'../../core/api-client.js';function a181_0x4fc0(){const _0x449375=['12423558YewlEb','POST','2026410TlKZox','800343apFtWY','No\x20change:\x20user\x20','userId','2604914ZZWhoV','36PYMNbn','1002858fzDZsE','356547pNjgdQ','8JADzoI','\x20to\x20role\x20','\x20already\x20in\x20role\x20','selector','username','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','user-add','roleType','882819wbisde','roleId'];a181_0x4fc0=function(){return _0x449375;};return a181_0x4fc0();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a181_0xead1(_0x575e44,_0x10d019){_0x575e44=_0x575e44-0xbe;const _0x4fc0e0=a181_0x4fc0();let _0xead1e6=_0x4fc0e0[_0x575e44];return _0xead1e6;}import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':'user-add','description':a181_0x34cedb(0xd0),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x15d827){const _0x68d610=a181_0x34cedb,{mutation:_0x4e2788}=await prepareUserMutation(_0x15d827,'user-add',!![]);return asDryRunResult(_0x4e2788,{'method':_0x68d610(0xc2),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x259685){const _0x3acbc3=a181_0x34cedb,{mutation:_0x130c1e,changed:_0x827d5,role:_0x5d4490,user:_0x59f7d9}=await prepareUserMutation(_0x259685,_0x3acbc3(0xd1),![]);return _0x827d5&&await createDevUserRole({'appCode':_0x259685['appCode'],'userId':_0x59f7d9[_0x3acbc3(0xc6)],'username':_0x59f7d9[_0x3acbc3(0xcf)],'roleType':_0x5d4490[_0x3acbc3(0xbe)],'roleId':_0x130c1e['selector'][_0x3acbc3(0xc0)]}),{'ok':!![],'data':_0x130c1e,'message':_0x827d5?'Added\x20user\x20'+_0x130c1e[_0x3acbc3(0xce)][_0x3acbc3(0xc6)]+_0x3acbc3(0xcc)+_0x130c1e[_0x3acbc3(0xce)]['roleName']:_0x3acbc3(0xc5)+_0x130c1e[_0x3acbc3(0xce)][_0x3acbc3(0xc6)]+_0x3acbc3(0xcd)+_0x130c1e['selector']['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a182_0x31ac(_0x5b1ee1,_0x5677de){_0x5b1ee1=_0x5b1ee1-0x194;const _0x35a23f=a182_0x35a2();let _0x31ac63=_0x35a23f[_0x5b1ee1];return _0x31ac63;}const a182_0x2d4eb5=a182_0x31ac;(function(_0x234cdb,_0x207dad){const _0x5d236b=a182_0x31ac,_0x294461=_0x234cdb();while(!![]){try{const _0x2cd2ea=-parseInt(_0x5d236b(0x196))/0x1+-parseInt(_0x5d236b(0x19c))/0x2*(-parseInt(_0x5d236b(0x19e))/0x3)+parseInt(_0x5d236b(0x198))/0x4+parseInt(_0x5d236b(0x19d))/0x5*(parseInt(_0x5d236b(0x1a2))/0x6)+-parseInt(_0x5d236b(0x199))/0x7+-parseInt(_0x5d236b(0x19a))/0x8*(parseInt(_0x5d236b(0x194))/0x9)+-parseInt(_0x5d236b(0x1a6))/0xa*(-parseInt(_0x5d236b(0x1a7))/0xb);if(_0x2cd2ea===_0x207dad)break;else _0x294461['push'](_0x294461['shift']());}catch(_0x3eb2c2){_0x294461['push'](_0x294461['shift']());}}}(a182_0x35a2,0xcf17b));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a182_0x35a2(){const _0x335838=['roleName','1314084ZLyHPf','\x20not\x20in\x20role\x20','3945712QsAghs','2010085lHxnZi','4334808VdAjzi','high-risk-write','865586ZkRYfC','1631145Riiqcp','6fuhqwU','No\x20change:\x20user\x20','POST','userId','12IXECzc','selector','user-remove','Removed\x20user\x20','4868690PHDQEM','11bbipAL','9QbCEmM'];a182_0x35a2=function(){return _0x335838;};return a182_0x35a2();}import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a182_0x2d4eb5(0x19b),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3c2deb){const _0x2ef875=a182_0x2d4eb5,{mutation:_0x201d06}=await prepareUserMutation(_0x3c2deb,'user-remove',!![]);return asDryRunResult(_0x201d06,{'method':_0x2ef875(0x1a0),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x42086c){const _0x26a27b=a182_0x2d4eb5,{matchingRelationIds:_0x27df5f,mutation:_0x1fabcc,changed:_0x59895e}=await prepareUserMutation(_0x42086c,_0x26a27b(0x1a4),![]);if(_0x59895e)for(const _0x531b11 of _0x27df5f){await deleteDevUserRole(_0x531b11);}return{'ok':!![],'data':_0x1fabcc,'message':_0x59895e?_0x26a27b(0x1a5)+_0x1fabcc[_0x26a27b(0x1a3)][_0x26a27b(0x1a1)]+'\x20from\x20role\x20'+_0x1fabcc[_0x26a27b(0x1a3)][_0x26a27b(0x195)]:_0x26a27b(0x19f)+_0x1fabcc['selector'][_0x26a27b(0x1a1)]+_0x26a27b(0x197)+_0x1fabcc[_0x26a27b(0x1a3)][_0x26a27b(0x195)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a183_0x281788=a183_0x21ef;(function(_0x873128,_0x17c0ef){const _0x1f3d4a=a183_0x21ef,_0x934bd8=_0x873128();while(!![]){try{const _0x386dc5=parseInt(_0x1f3d4a(0xa8))/0x1*(parseInt(_0x1f3d4a(0xa4))/0x2)+-parseInt(_0x1f3d4a(0xb0))/0x3*(parseInt(_0x1f3d4a(0xb3))/0x4)+-parseInt(_0x1f3d4a(0xb4))/0x5+-parseInt(_0x1f3d4a(0xad))/0x6+parseInt(_0x1f3d4a(0xa9))/0x7+parseInt(_0x1f3d4a(0xb2))/0x8*(parseInt(_0x1f3d4a(0xb1))/0x9)+parseInt(_0x1f3d4a(0xac))/0xa;if(_0x386dc5===_0x17c0ef)break;else _0x934bd8['push'](_0x934bd8['shift']());}catch(_0x4f6764){_0x934bd8['push'](_0x934bd8['shift']());}}}(a183_0x4749,0x88673));import{CliErrors}from'../../errors.js';function a183_0x4749(){const _0x57acde=['flagMissing','1hbPeNU','7266511ndUtUs','username','trim','6325480LfKCPy','3717798gdVRoU','Pass\x20--name\x20<nickname|username>.','Resolved\x20\x22','3kXvPhp','9swDhNb','1098032sTHAyN','2433772YVjQTD','963470dIOXaG','str','name','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','343204rgyYNy','role','user-resolve'];a183_0x4749=function(){return _0x57acde;};return a183_0x4749();}function a183_0x21ef(_0x35da64,_0x4a82d1){_0x35da64=_0x35da64-0xa1;const _0x4749b2=a183_0x4749();let _0x21ef74=_0x4749b2[_0x35da64];return _0x21ef74;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a183_0x281788(0xa5),'command':a183_0x281788(0xa6),'description':a183_0x281788(0xa3),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2c39a7){const _0x4ed0df=a183_0x281788;if(!_0x2c39a7[_0x4ed0df(0xa1)](_0x4ed0df(0xa2))[_0x4ed0df(0xab)]())throw CliErrors[_0x4ed0df(0xa7)]('name',_0x4ed0df(0xae));},async 'execute'(_0x2ac424){const _0x42e2cd=a183_0x281788,_0x183a9a=_0x2ac424[_0x42e2cd(0xa1)](_0x42e2cd(0xa2))['trim'](),_0x3a44cb=await resolveUserRef(_0x183a9a);return{'ok':!![],'data':{'user':{'userId':_0x3a44cb['userId'],'username':_0x3a44cb[_0x42e2cd(0xaa)],'nickname':_0x3a44cb['nickname'],'matchedBy':_0x3a44cb['matchedBy']}},'message':_0x42e2cd(0xaf)+_0x183a9a+'\x22\x20→\x20userId\x20'+_0x3a44cb['userId']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a184_0x1914de=a184_0xef58;(function(_0x1cc5ee,_0x57780a){const _0x477d27=a184_0xef58,_0x3b7f53=_0x1cc5ee();while(!![]){try{const _0xfbb421=parseInt(_0x477d27(0x165))/0x1*(parseInt(_0x477d27(0x153))/0x2)+parseInt(_0x477d27(0x173))/0x3*(parseInt(_0x477d27(0x17e))/0x4)+-parseInt(_0x477d27(0x187))/0x5*(parseInt(_0x477d27(0x179))/0x6)+-parseInt(_0x477d27(0x175))/0x7+-parseInt(_0x477d27(0x188))/0x8*(-parseInt(_0x477d27(0x180))/0x9)+-parseInt(_0x477d27(0x176))/0xa+parseInt(_0x477d27(0x18b))/0xb;if(_0xfbb421===_0x57780a)break;else _0x3b7f53['push'](_0x3b7f53['shift']());}catch(_0x1d7818){_0x3b7f53['push'](_0x3b7f53['shift']());}}}(a184_0x198d,0xd8bbe));function a184_0xef58(_0xe1350b,_0x21ab08){_0xe1350b=_0xe1350b-0x152;const _0x198d19=a184_0x198d();let _0xef581d=_0x198d19[_0xe1350b];return _0xef581d;}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';function a184_0x198d(){const _0x1d7abc=['\x20run\x20build','node_modules','vite','113vmqQMO','npm','package.json','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20\x20EXAMPLES','length','run','all','\x20run\x20<script>\x0a','utf-8','Run\x20a\x20package.json\x20script','boolean','\x20\x20\x20\x20','\x20run\x20preview\x20--watch','3oResCJ','has','11291791yvLMne','13369080TtVlXA','bun.lock','join','744VzMaLE','needsUpgrade','parse','yarn.lock','build','3772936TuPVvM','bun','2979675psjXGq','Script\x20\x22','slice','keys','yarn','bool','preview','36460gtjNbP','8rrPHtB','cwd','(none)','25474383vzfDan','\x22\x20not\x20found\x20in\x20package.json.','pnpm-lock.yaml','\x0a\x20\x20Usage:\x20','\x0a\x20\x20Available\x20scripts:\x0a','args','script','20386ADlhAp','scripts','inherit','error','validation','No\x20package.json\x20found\x20in\x20current\x20directory.','dev','\x20run\x20preview','.bin','log','No\x20scripts\x20defined\x20in\x20package.json.','watch','close','vite\x20preview\x20exited\x20with\x20code\x20','push'];a184_0x198d=function(){return _0x1d7abc;};return a184_0x198d();}const VERSION_CHECK_SCRIPTS=new Set(['start',a184_0x1914de(0x159)]);function readPackageScripts(_0x1f6fbe){const _0x35371c=a184_0x1914de,_0x2529fd=resolve(_0x1f6fbe,_0x35371c(0x167));if(!existsSync(_0x2529fd))return null;try{const _0x697fc5=JSON[_0x35371c(0x17b)](readFileSync(_0x2529fd,_0x35371c(0x16e)));return _0x697fc5[_0x35371c(0x154)]??{};}catch{return null;}}function detectPackageManager(_0x3a7646){const _0x1d1667=a184_0x1914de;if(existsSync(resolve(_0x3a7646,'bun.lockb'))||existsSync(resolve(_0x3a7646,_0x1d1667(0x177))))return _0x1d1667(0x17f);if(existsSync(resolve(_0x3a7646,_0x1d1667(0x18d))))return'pnpm';if(existsSync(resolve(_0x3a7646,_0x1d1667(0x17c))))return _0x1d1667(0x184);return _0x1d1667(0x166);}async function versionCheck(_0x113d69){const _0x5406d2=a184_0x1914de,_0x34d4ac=await checkCliVersion();(_0x34d4ac[_0x5406d2(0x17a)]||_0x34d4ac['belowMinimum'])&&(printCliUpgradeWarning(_0x34d4ac),assertCliVersionSupported(_0x34d4ac));const _0x2bdeaa=await checkSdkVersion(_0x113d69);if(_0x2bdeaa[_0x5406d2(0x17a)])printSdkUpgradeWarning(_0x2bdeaa);}function spawnScript(_0xb33ea1,_0x2f480b,_0x4246c5,_0x1ebb74){return new Promise((_0x284f7b,_0x4a0a24)=>{const _0x5bd770=a184_0xef58,_0x3e4fb4=[_0x5bd770(0x16b),_0x2f480b,..._0x4246c5],_0x2cd924=spawn(_0xb33ea1,_0x3e4fb4,{'cwd':_0x1ebb74,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1ebb74,_0x5bd770(0x163),_0x5bd770(0x15b))+delimiter+process.env.PATH}});_0x2cd924['on'](_0x5bd770(0x15f),_0x3e01c5=>{if(_0x3e01c5===0x0||_0x3e01c5===null)_0x284f7b();else _0x4a0a24(new Error(_0xb33ea1+'\x20run\x20'+_0x2f480b+'\x20exited\x20with\x20code\x20'+_0x3e01c5));}),_0x2cd924['on'](_0x5bd770(0x156),_0x4a0a24);});}function spawnViteBuildWatch(_0xb5a905){return new Promise((_0x3c7087,_0x1283b3)=>{const _0x3a4c94=a184_0xef58,_0x221507=spawn(_0x3a4c94(0x164),[_0x3a4c94(0x17d),'--watch'],{'cwd':_0xb5a905,'stdio':_0x3a4c94(0x155),'shell':!![],'env':{...process.env,'PATH':''+join(_0xb5a905,'node_modules','.bin')+delimiter+process.env.PATH}});_0x221507['on'](_0x3a4c94(0x15f),_0x1c1209=>{const _0x56d275=_0x3a4c94;if(_0x1c1209===0x0||_0x1c1209===null)_0x3c7087();else _0x1283b3(new Error(_0x56d275(0x168)+_0x1c1209));}),_0x221507['on']('error',_0x1283b3);});}function spawnVitePreview(_0x3081ad){return new Promise((_0x4e6d76,_0x27a73d)=>{const _0x2fd7c4=a184_0xef58,_0x211200=spawn(_0x2fd7c4(0x164),[_0x2fd7c4(0x186)],{'cwd':_0x3081ad,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x3081ad,'node_modules',_0x2fd7c4(0x15b))+delimiter+process.env.PATH}});_0x211200['on'](_0x2fd7c4(0x15f),_0x31f778=>{const _0x3ebb68=_0x2fd7c4;if(_0x31f778===0x0||_0x31f778===null)_0x4e6d76();else _0x27a73d(new Error(_0x3ebb68(0x160)+_0x31f778));}),_0x211200['on']('error',_0x27a73d);});}const runFlags=[{'name':a184_0x1914de(0x15e),'type':a184_0x1914de(0x170),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':'run','command':a184_0x1914de(0x16b),'description':a184_0x1914de(0x16f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a184_0x1914de(0x152),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x423a53=a184_0x1914de,_0x3ea8a3=[];return _0x3ea8a3[_0x423a53(0x161)](_0x423a53(0x169)),_0x3ea8a3[_0x423a53(0x161)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20start'),_0x3ea8a3[_0x423a53(0x161)](_0x423a53(0x171)+CLI_BIN_NAME+_0x423a53(0x162)),_0x3ea8a3['push'](_0x423a53(0x171)+CLI_BIN_NAME+_0x423a53(0x15a)),_0x3ea8a3[_0x423a53(0x161)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x423a53(0x172)),_0x3ea8a3[_0x423a53(0x178)]('\x0a');},async 'execute'(_0x1cb27f){const _0x3851f9=a184_0x1914de,_0x3788b0=process[_0x3851f9(0x189)](),_0x140360=_0x1cb27f[_0x3851f9(0x190)][0x0],_0x4f7782=_0x1cb27f[_0x3851f9(0x190)][_0x3851f9(0x182)](0x1),_0x40ba6=readPackageScripts(_0x3788b0);if(!_0x40ba6)throw CliErrors['validation'](_0x3851f9(0x158));if(!_0x140360){const _0x4886a7=Object[_0x3851f9(0x183)](_0x40ba6);if(_0x4886a7[_0x3851f9(0x16a)]===0x0)console[_0x3851f9(0x15c)](_0x3851f9(0x15d));else{console[_0x3851f9(0x15c)](_0x3851f9(0x18f));for(const _0x199a03 of _0x4886a7){console[_0x3851f9(0x15c)](_0x3851f9(0x171)+_0x199a03);}console[_0x3851f9(0x15c)](_0x3851f9(0x18e)+CLI_BIN_NAME+_0x3851f9(0x16d));}return{'ok':!![]};}if(!_0x40ba6[_0x140360])throw CliErrors[_0x3851f9(0x157)](_0x3851f9(0x181)+_0x140360+_0x3851f9(0x18c),'Available:\x20'+(Object[_0x3851f9(0x183)](_0x40ba6)[_0x3851f9(0x178)](',\x20')||_0x3851f9(0x18a)));const _0x52db7f=detectPackageManager(_0x3788b0);VERSION_CHECK_SCRIPTS[_0x3851f9(0x174)](_0x140360)&&await versionCheck(_0x3788b0);if(_0x140360===_0x3851f9(0x186)&&_0x1cb27f[_0x3851f9(0x185)]('watch'))return await Promise[_0x3851f9(0x16c)]([spawnViteBuildWatch(_0x3788b0),spawnVitePreview(_0x3788b0)]),{'ok':!![]};return await spawnScript(_0x52db7f,_0x140360,_0x4f7782,_0x3788b0),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a185_0x49b9(_0x51c863,_0x166875){_0x51c863=_0x51c863-0x7d;const _0x5da2d2=a185_0x5da2();let _0x49b9e7=_0x5da2d2[_0x51c863];return _0x49b9e7;}function a185_0x5da2(){const _0x5944b7=['5806717TBpbGP','40OTqYxz','26785240fZGUmw','read','4844312lYhRkp','15WyKtim','4963449qQbOyW','102348vMFQtA','37991lMuOeN','28EvaHrY','json','1241622bptYkn','export','schema'];a185_0x5da2=function(){return _0x5944b7;};return a185_0x5da2();}const a185_0x5b9904=a185_0x49b9;(function(_0x254c27,_0x3bf378){const _0x4d4f39=a185_0x49b9,_0x35fe22=_0x254c27();while(!![]){try{const _0x3a7779=-parseInt(_0x4d4f39(0x84))/0x1*(parseInt(_0x4d4f39(0x85))/0x2)+-parseInt(_0x4d4f39(0x82))/0x3+-parseInt(_0x4d4f39(0x80))/0x4+parseInt(_0x4d4f39(0x81))/0x5*(parseInt(_0x4d4f39(0x83))/0x6)+parseInt(_0x4d4f39(0x8a))/0x7+parseInt(_0x4d4f39(0x7d))/0x8*(parseInt(_0x4d4f39(0x87))/0x9)+parseInt(_0x4d4f39(0x7e))/0xa;if(_0x3a7779===_0x3bf378)break;else _0x35fe22['push'](_0x35fe22['shift']());}catch(_0x51f921){_0x35fe22['push'](_0x35fe22['shift']());}}}(a185_0x5da2,0xcfe80));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2e4381){const _0x1ee534=await buildSchemaPayload();return{'ok':!![],'data':_0x1ee534};}export const schemaDefinition={'service':a185_0x5b9904(0x89),'command':a185_0x5b9904(0x88),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a185_0x5b9904(0x7f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a185_0x5b9904(0x86),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a185_0x149a8b=a185_0x2c45;(function(_0x37019b,_0x5bcf17){const _0x21958f=a185_0x2c45,_0x58a1b8=_0x37019b();while(!![]){try{const _0x5302db=-parseInt(_0x21958f(0x18f))/0x1+-parseInt(_0x21958f(0x1c8))/0x2+parseInt(_0x21958f(0x1c3))/0x3+-parseInt(_0x21958f(0x1be))/0x4*(-parseInt(_0x21958f(0x1b4))/0x5)+parseInt(_0x21958f(0x19c))/0x6*(parseInt(_0x21958f(0x1a5))/0x7)+parseInt(_0x21958f(0x1c6))/0x8+parseInt(_0x21958f(0x1c7))/0x9*(-parseInt(_0x21958f(0x1cc))/0xa);if(_0x5302db===_0x5bcf17)break;else _0x58a1b8['push'](_0x58a1b8['shift']());}catch(_0x413b17){_0x58a1b8['push'](_0x58a1b8['shift']());}}}(a185_0xaf19,0xa16cd));function a185_0xaf19(){const _0x155994=['lockFilePath','string','description','Invalid\x20database\x20selection\x20payload:\x20','SELECT\x201\x20AS\x20id;','sqlName','<server-generated-sqlCode>','</select>','number','db-id','str','join','10UpXULg','write','sql','sqlCode','nonInteractive','SQL\x20query\x20display\x20name','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','map','stringify','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','1574036yXekGK','sqlRootDir','appCode','请输入目标数据库\x20dbId:','mode','3818751INBouO','请选择目标数据库:','POST','4096352VHybIz','694395ztAFSa','1021234ijpmqH','toISOString','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','260NEFwtM','validation','isInteger','dbName','name','123324ougrlJ','请输入\x20SQL\x20名称:','dbId\x20必须为正整数','length','MyBatis\x20XML(mybatisXml)','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','isFinite','flagMissing','utf8','适合带动态标签的\x20MyBatis\x20XML\x20SQL','mybatisXml','lastSync','✎\x20手动输入\x20dbId','1458378JsVEFw','trim','Local\x20SQL\x20file\x20mode','new','catch','create','sqlRoot','__manual__','普通\x20SQL(sql)','21eABcDm','\x20\x20SELECT\x201\x20AS\x20id','dbId'];a185_0xaf19=function(){return _0x155994;};return a185_0xaf19();}import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x1baa76){const _0xb6981c=a185_0x2c45;if(_0x1baa76===_0xb6981c(0x199))return[_0xb6981c(0x194),_0xb6981c(0x1a6),_0xb6981c(0x1af),''][_0xb6981c(0x1b3)]('\x0a');return[_0xb6981c(0x1ac),''][_0xb6981c(0x1b3)]('\x0a');}export const sqlCreate={'service':a185_0x149a8b(0x1b6),'command':a185_0x149a8b(0x1a1),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a185_0x149a8b(0x1b5),'flags':[{'name':a185_0x149a8b(0x1d0),'type':a185_0x149a8b(0x1a9),'description':a185_0x149a8b(0x1b9)},{'name':a185_0x149a8b(0x1b1),'type':'number','description':'Target\x20database\x20ID'},{'name':a185_0x149a8b(0x1c2),'type':a185_0x149a8b(0x1a9),'enum':['sql',a185_0x149a8b(0x199)],'description':a185_0x149a8b(0x19e)}],async 'validate'(_0x107b25){const _0x784498=a185_0x149a8b;if(!_0x107b25[_0x784498(0x1b8)])return;if(!_0x107b25['str'](_0x784498(0x1d0))[_0x784498(0x19d)]())throw CliErrors[_0x784498(0x196)]('name',_0x784498(0x1ca));const _0x2c70b7=resolveProvidedDbId(_0x107b25);if(typeof _0x2c70b7!=='number'||!Number[_0x784498(0x195)](_0x2c70b7)||_0x2c70b7<=0x0)throw CliErrors[_0x784498(0x196)](_0x784498(0x1b1),_0x784498(0x1cb));if(!_0x107b25[_0x784498(0x1b2)]('mode')[_0x784498(0x19d)]())throw CliErrors[_0x784498(0x196)]('mode',_0x784498(0x1ba));},async 'dryRun'(_0x318be5){const _0x168dab=a185_0x149a8b,_0x423770=loadSqlProjectConfig(_0x318be5['appCode']),{sqlName:_0x299db,dbId:_0x5f17fe,dbName:_0x19dd14,mode:_0x35d169}=await resolveSqlNewInputs(_0x318be5),_0x1e37c3=buildSqlRelativePath(_0x168dab(0x1ae),_0x299db,_0x19dd14,_0x35d169,_0x5f17fe),_0x446838=_0x423770[_0x168dab(0x1bf)]+'/'+_0x1e37c3;return{'method':_0x168dab(0x1c5),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x318be5[_0x168dab(0x1c0)],'sqlName':_0x299db,'dbId':_0x5f17fe,'mode':_0x35d169,'localPath':_0x446838},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x423770['sqlRootDir']};},async 'execute'(_0x44138b){const _0x18b80d=a185_0x149a8b,_0x2d97e8=loadSqlProjectConfig(_0x44138b['appCode']),{sqlName:_0x4e8cb0,dbId:_0x1150e5,dbName:_0x4cdfa4,mode:_0x58bdb3}=await resolveSqlNewInputs(_0x44138b),_0x529ac9=generateSqlTemplate(_0x58bdb3),_0xa86a9d=await createSqlQuery({'appCode':_0x44138b[_0x18b80d(0x1c0)],'sqlName':_0x4e8cb0,'dbId':_0x1150e5,'sqlContent':_0x529ac9}),_0x177a5e=ensureRemoteSqlContent(_0xa86a9d),_0x1f9895=_0x4cdfa4||await getDbName(_0x44138b[_0x18b80d(0x1c0)],_0x1150e5)[_0x18b80d(0x1a0)](()=>undefined),_0x20d0cd=buildSqlRelativePath(_0xa86a9d[_0x18b80d(0x1b7)],_0xa86a9d[_0x18b80d(0x1ad)],_0x1f9895,_0x58bdb3,_0x1150e5),_0x47107f=_0x2d97e8['sqlRootDir']+'/'+_0x20d0cd,_0x46657a=buildLocalSqlFileContent({'sqlCode':_0xa86a9d[_0x18b80d(0x1b7)],'sqlName':_0xa86a9d[_0x18b80d(0x1ad)],'dbId':_0xa86a9d[_0x18b80d(0x1a7)]},_0x177a5e,{'dbName':_0x1f9895,'mode':_0x58bdb3,'syncedAt':new Date()['toISOString'](),'description':_0xa86a9d[_0x18b80d(0x1aa)]});if(await fileExists(_0x47107f))throw CliErrors[_0x18b80d(0x1cd)]('File\x20already\x20exists:\x20'+_0x47107f);await ensureParentDirectory(_0x47107f),await writeFile(_0x47107f,_0x46657a,_0x18b80d(0x197));const _0x18cfbb=await readSqlLockFile(_0x2d97e8[_0x18b80d(0x1a8)]),{lockData:_0x1ecf8a,appLock:_0x2d298a}=ensureSqlLockScope(_0x18cfbb??createEmptySqlLock(),_0x2d97e8['appCode'],_0x2d97e8[_0x18b80d(0x1a2)],_0x18b80d(0x19f));return _0x2d298a['sqls'][_0xa86a9d[_0x18b80d(0x1b7)]]={...buildSqlLockEntry(_0xa86a9d,_0x177a5e,computeSqlContentHash(_0x46657a),{'dbName':_0x1f9895}),'path':_0x20d0cd,'mode':_0x58bdb3},_0x2d298a[_0x18b80d(0x19a)]=new Date()[_0x18b80d(0x1c9)](),await writeSqlLockFile(_0x2d97e8['lockFilePath'],_0x1ecf8a),{'ok':!![],'data':{'id':_0xa86a9d['id'],'sqlCode':_0xa86a9d[_0x18b80d(0x1b7)],'sqlName':_0xa86a9d['sqlName'],'dbId':_0xa86a9d['dbId'],'path':_0x47107f,'mode':_0x58bdb3},'message':'Created\x20SQL\x20query\x20'+_0xa86a9d[_0x18b80d(0x1b7)]};}};async function resolveSqlNewInputs(_0x24a146){const _0x2fdc9a=await resolveSqlNameInput(_0x24a146),{dbId:_0x443133,dbName:_0x222215}=await resolveDbSelection(_0x24a146),_0x41f4c2=await resolveSqlModeInput(_0x24a146);return{'sqlName':_0x2fdc9a,'dbId':_0x443133,'dbName':_0x222215,'mode':_0x41f4c2};}async function resolveSqlNameInput(_0x476f17){const _0xd3eda7=a185_0x149a8b,_0x2d15e3=_0x476f17[_0xd3eda7(0x1b2)](_0xd3eda7(0x1d0))['trim']();if(_0x2d15e3)return _0x2d15e3;if(_0x476f17[_0xd3eda7(0x1b8)])throw CliErrors['flagMissing'](_0xd3eda7(0x1d0),_0xd3eda7(0x1ca));return(await input({'message':_0xd3eda7(0x190),'validate':_0x4e39e8=>_0x4e39e8[_0xd3eda7(0x19d)]()?!![]:'SQL\x20名称不能为空'}))['trim']();}async function resolveDbSelection(_0x2e1520){const _0x4f3b30=a185_0x149a8b,_0x4560d3=resolveProvidedDbId(_0x2e1520);if(typeof _0x4560d3==='number'&&Number[_0x4f3b30(0x195)](_0x4560d3)&&_0x4560d3>0x0)return{'dbId':_0x4560d3,'dbName':await getDbName(_0x2e1520[_0x4f3b30(0x1c0)],_0x4560d3)[_0x4f3b30(0x1a0)](()=>undefined)};if(_0x2e1520[_0x4f3b30(0x1b8)])throw CliErrors['flagMissing'](_0x4f3b30(0x1b1),_0x4f3b30(0x1cb));const _0x4fe2da=await listDatabases(_0x2e1520[_0x4f3b30(0x1c0)])[_0x4f3b30(0x1a0)](()=>[]);if(_0x4fe2da['length']===0x1)return{'dbId':_0x4fe2da[0x0][_0x4f3b30(0x1a7)],'dbName':_0x4fe2da[0x0][_0x4f3b30(0x1cf)]};if(_0x4fe2da[_0x4f3b30(0x192)]>0x1){const _0x21236b=await select({'message':_0x4f3b30(0x1c4),'choices':[..._0x4fe2da[_0x4f3b30(0x1bb)](_0x38f315=>({'name':_0x38f315[_0x4f3b30(0x1cf)]+'\x20('+_0x38f315[_0x4f3b30(0x1a7)]+')','value':serializeDbSelection(_0x38f315)})),{'name':_0x4f3b30(0x19b),'value':_0x4f3b30(0x1a3)}]});if(_0x21236b!==_0x4f3b30(0x1a3))return deserializeDbSelection(_0x21236b);}const _0x449555=await input({'message':_0x4f3b30(0x1c1),'validate':_0x754d3e=>{const _0x4c85a0=_0x4f3b30,_0x96f6c6=_0x754d3e[_0x4c85a0(0x19d)]();if(!_0x96f6c6)return'dbId\x20不能为空';const _0x162fe5=Number(_0x96f6c6);if(!Number[_0x4c85a0(0x1ce)](_0x162fe5)||_0x162fe5<=0x0)return _0x4c85a0(0x191);return!![];}});return{'dbId':Number(_0x449555['trim']())};}async function resolveSqlModeInput(_0x4f95bc){const _0x5709c0=a185_0x149a8b,_0x26822b=_0x4f95bc[_0x5709c0(0x1b2)]('mode')[_0x5709c0(0x19d)]();if(_0x26822b==='sql'||_0x26822b===_0x5709c0(0x199))return _0x26822b;if(_0x4f95bc[_0x5709c0(0x1b8)])throw CliErrors[_0x5709c0(0x196)]('mode',_0x5709c0(0x1ba));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x5709c0(0x1a4),'value':_0x5709c0(0x1b6),'description':_0x5709c0(0x1bd)},{'name':_0x5709c0(0x193),'value':_0x5709c0(0x199),'description':_0x5709c0(0x198)}]});}function serializeDbSelection(_0x25cca5){const _0x4363f3=a185_0x149a8b;return JSON[_0x4363f3(0x1bc)]({'dbId':_0x25cca5[_0x4363f3(0x1a7)],'dbName':_0x25cca5[_0x4363f3(0x1cf)]});}function a185_0x2c45(_0x44f3e1,_0x4535b3){_0x44f3e1=_0x44f3e1-0x18f;const _0xaf197e=a185_0xaf19();let _0x2c4514=_0xaf197e[_0x44f3e1];return _0x2c4514;}function deserializeDbSelection(_0x27adbc){const _0x42f5c8=a185_0x149a8b;try{const _0x5d1fc5=JSON['parse'](_0x27adbc);if(typeof _0x5d1fc5[_0x42f5c8(0x1a7)]==='number'&&Number[_0x42f5c8(0x195)](_0x5d1fc5[_0x42f5c8(0x1a7)]))return{'dbId':_0x5d1fc5['dbId'],'dbName':_0x5d1fc5[_0x42f5c8(0x1cf)]};}catch{}throw CliErrors[_0x42f5c8(0x1cd)](_0x42f5c8(0x1ab)+_0x27adbc);}function resolveProvidedDbId(_0x433c5a){const _0x53913d=a185_0x149a8b,_0x2ee14b=_0x433c5a['flag'](_0x53913d(0x1b1));if(typeof _0x2ee14b===_0x53913d(0x1b0)&&Number['isFinite'](_0x2ee14b))return _0x2ee14b;return undefined;}
|
|
1
|
+
const a186_0x7aa9ef=a186_0x1c79;(function(_0x5bc4fc,_0x2ff1a5){const _0x14b1aa=a186_0x1c79,_0x4562e6=_0x5bc4fc();while(!![]){try{const _0x5dd383=parseInt(_0x14b1aa(0x1ce))/0x1*(parseInt(_0x14b1aa(0x1d0))/0x2)+-parseInt(_0x14b1aa(0x1d1))/0x3+-parseInt(_0x14b1aa(0x1cc))/0x4*(-parseInt(_0x14b1aa(0x1a7))/0x5)+-parseInt(_0x14b1aa(0x1d9))/0x6+-parseInt(_0x14b1aa(0x1ca))/0x7*(-parseInt(_0x14b1aa(0x1b8))/0x8)+-parseInt(_0x14b1aa(0x1af))/0x9+parseInt(_0x14b1aa(0x1db))/0xa;if(_0x5dd383===_0x2ff1a5)break;else _0x4562e6['push'](_0x4562e6['shift']());}catch(_0x4a94fd){_0x4562e6['push'](_0x4562e6['shift']());}}}(a186_0x2745,0x67987));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a186_0x2745(){const _0x32bb0b=['write','10GVNtBR','sqlCode','</select>','普通\x20SQL(sql)','flagMissing','dbId\x20必须为正整数','__manual__','sqlRootDir','6881733pFjJPV','请输入\x20SQL\x20名称:','lastSync','description','toISOString','nonInteractive','map','请选择目标数据库:','Local\x20SQL\x20file\x20mode','3592088ajpRch','sqlRoot','isInteger','create','MyBatis\x20XML(mybatisXml)','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','mybatisXml','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','length','mode','isFinite','new','dbName','Invalid\x20database\x20selection\x20payload:\x20','适合带动态标签的\x20MyBatis\x20XML\x20SQL','sqlName','✎\x20手动输入\x20dbId','parse','7Nercis','string','28212Ltzlty','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','189792wCICyy','appCode','6aiQzba','1421019eVtRFL','<server-generated-sqlCode>','trim','name','SQL\x20query\x20display\x20name','join','Created\x20SQL\x20query\x20','dbId\x20不能为空','4450734cMgjWb','str','13719330oDDsTD','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','number','File\x20already\x20exists:\x20','POST','flag','SQL\x20名称不能为空','db-id','dbId','stringify','sql','validation','Target\x20database\x20ID','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'];a186_0x2745=function(){return _0x32bb0b;};return a186_0x2745();}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 a186_0x1c79(_0x435454,_0xcdf4dd){_0x435454=_0x435454-0x1a1;const _0x274532=a186_0x2745();let _0x1c7997=_0x274532[_0x435454];return _0x1c7997;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x32858b){const _0xd47f66=a186_0x1c79;if(_0x32858b===_0xd47f66(0x1be))return[_0xd47f66(0x1cd),'\x20\x20SELECT\x201\x20AS\x20id',_0xd47f66(0x1a9),''][_0xd47f66(0x1d6)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0xd47f66(0x1d6)]('\x0a');}export const sqlCreate={'service':a186_0x7aa9ef(0x1a2),'command':a186_0x7aa9ef(0x1bb),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a186_0x7aa9ef(0x1a6),'flags':[{'name':a186_0x7aa9ef(0x1d4),'type':'string','description':a186_0x7aa9ef(0x1d5)},{'name':'db-id','type':'number','description':a186_0x7aa9ef(0x1a4)},{'name':'mode','type':a186_0x7aa9ef(0x1cb),'enum':[a186_0x7aa9ef(0x1a2),a186_0x7aa9ef(0x1be)],'description':a186_0x7aa9ef(0x1b7)}],async 'validate'(_0x398fe7){const _0x4140ce=a186_0x7aa9ef;if(!_0x398fe7[_0x4140ce(0x1b4)])return;if(!_0x398fe7[_0x4140ce(0x1da)](_0x4140ce(0x1d4))[_0x4140ce(0x1d3)]())throw CliErrors['flagMissing'](_0x4140ce(0x1d4),_0x4140ce(0x1bd));const _0x27a687=resolveProvidedDbId(_0x398fe7);if(typeof _0x27a687!==_0x4140ce(0x1dd)||!Number[_0x4140ce(0x1c2)](_0x27a687)||_0x27a687<=0x0)throw CliErrors[_0x4140ce(0x1ab)](_0x4140ce(0x1e2),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x398fe7['str'](_0x4140ce(0x1c1))[_0x4140ce(0x1d3)]())throw CliErrors[_0x4140ce(0x1ab)](_0x4140ce(0x1c1),_0x4140ce(0x1dc));},async 'dryRun'(_0x32fda5){const _0x4a97c2=a186_0x7aa9ef,_0x2c5ff6=loadSqlProjectConfig(_0x32fda5[_0x4a97c2(0x1cf)]),{sqlName:_0x44f840,dbId:_0x3e5927,dbName:_0x15f321,mode:_0x184aee}=await resolveSqlNewInputs(_0x32fda5),_0xa3fb30=buildSqlRelativePath(_0x4a97c2(0x1d2),_0x44f840,_0x15f321,_0x184aee,_0x3e5927),_0x2275b8=_0x2c5ff6[_0x4a97c2(0x1ae)]+'/'+_0xa3fb30;return{'method':_0x4a97c2(0x1df),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x32fda5[_0x4a97c2(0x1cf)],'sqlName':_0x44f840,'dbId':_0x3e5927,'mode':_0x184aee,'localPath':_0x2275b8},'description':_0x4a97c2(0x1bf)+_0x2c5ff6[_0x4a97c2(0x1ae)]};},async 'execute'(_0x3e66e5){const _0x623107=a186_0x7aa9ef,_0x35bbcf=loadSqlProjectConfig(_0x3e66e5[_0x623107(0x1cf)]),{sqlName:_0x195b74,dbId:_0x4488e2,dbName:_0x127718,mode:_0x19e0bf}=await resolveSqlNewInputs(_0x3e66e5),_0x3fc44f=generateSqlTemplate(_0x19e0bf),_0x5c2085=await createSqlQuery({'appCode':_0x3e66e5[_0x623107(0x1cf)],'sqlName':_0x195b74,'dbId':_0x4488e2,'sqlContent':_0x3fc44f}),_0x5766f4=ensureRemoteSqlContent(_0x5c2085),_0x3facea=_0x127718||await getDbName(_0x3e66e5[_0x623107(0x1cf)],_0x4488e2)['catch'](()=>undefined),_0x2dc60a=buildSqlRelativePath(_0x5c2085[_0x623107(0x1a8)],_0x5c2085[_0x623107(0x1c7)],_0x3facea,_0x19e0bf,_0x4488e2),_0x38d3a8=_0x35bbcf[_0x623107(0x1ae)]+'/'+_0x2dc60a,_0x381d31=buildLocalSqlFileContent({'sqlCode':_0x5c2085[_0x623107(0x1a8)],'sqlName':_0x5c2085[_0x623107(0x1c7)],'dbId':_0x5c2085[_0x623107(0x1e3)]},_0x5766f4,{'dbName':_0x3facea,'mode':_0x19e0bf,'syncedAt':new Date()[_0x623107(0x1b3)](),'description':_0x5c2085[_0x623107(0x1b2)]});if(await fileExists(_0x38d3a8))throw CliErrors[_0x623107(0x1a3)](_0x623107(0x1de)+_0x38d3a8);await ensureParentDirectory(_0x38d3a8),await writeFile(_0x38d3a8,_0x381d31,'utf8');const _0xbe1343=await readSqlLockFile(_0x35bbcf['lockFilePath']),{lockData:_0x529061,appLock:_0x28a094}=ensureSqlLockScope(_0xbe1343??createEmptySqlLock(),_0x35bbcf[_0x623107(0x1cf)],_0x35bbcf[_0x623107(0x1b9)],_0x623107(0x1c3));return _0x28a094['sqls'][_0x5c2085[_0x623107(0x1a8)]]={...buildSqlLockEntry(_0x5c2085,_0x5766f4,computeSqlContentHash(_0x381d31),{'dbName':_0x3facea}),'path':_0x2dc60a,'mode':_0x19e0bf},_0x28a094[_0x623107(0x1b1)]=new Date()['toISOString'](),await writeSqlLockFile(_0x35bbcf['lockFilePath'],_0x529061),{'ok':!![],'data':{'id':_0x5c2085['id'],'sqlCode':_0x5c2085[_0x623107(0x1a8)],'sqlName':_0x5c2085[_0x623107(0x1c7)],'dbId':_0x5c2085[_0x623107(0x1e3)],'path':_0x38d3a8,'mode':_0x19e0bf},'message':_0x623107(0x1d7)+_0x5c2085['sqlCode']};}};async function resolveSqlNewInputs(_0x1475f5){const _0x41e5d8=await resolveSqlNameInput(_0x1475f5),{dbId:_0x2ef08b,dbName:_0x4aaef4}=await resolveDbSelection(_0x1475f5),_0x2d0b08=await resolveSqlModeInput(_0x1475f5);return{'sqlName':_0x41e5d8,'dbId':_0x2ef08b,'dbName':_0x4aaef4,'mode':_0x2d0b08};}async function resolveSqlNameInput(_0x5df417){const _0xf4f2e4=a186_0x7aa9ef,_0x47bc69=_0x5df417[_0xf4f2e4(0x1da)](_0xf4f2e4(0x1d4))[_0xf4f2e4(0x1d3)]();if(_0x47bc69)return _0x47bc69;if(_0x5df417[_0xf4f2e4(0x1b4)])throw CliErrors[_0xf4f2e4(0x1ab)]('name',_0xf4f2e4(0x1bd));return(await input({'message':_0xf4f2e4(0x1b0),'validate':_0x540a1a=>_0x540a1a[_0xf4f2e4(0x1d3)]()?!![]:_0xf4f2e4(0x1e1)}))[_0xf4f2e4(0x1d3)]();}async function resolveDbSelection(_0x27b626){const _0x1c8c06=a186_0x7aa9ef,_0x5e2091=resolveProvidedDbId(_0x27b626);if(typeof _0x5e2091===_0x1c8c06(0x1dd)&&Number[_0x1c8c06(0x1c2)](_0x5e2091)&&_0x5e2091>0x0)return{'dbId':_0x5e2091,'dbName':await getDbName(_0x27b626[_0x1c8c06(0x1cf)],_0x5e2091)['catch'](()=>undefined)};if(_0x27b626['nonInteractive'])throw CliErrors[_0x1c8c06(0x1ab)](_0x1c8c06(0x1e2),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x234f68=await listDatabases(_0x27b626[_0x1c8c06(0x1cf)])['catch'](()=>[]);if(_0x234f68[_0x1c8c06(0x1c0)]===0x1)return{'dbId':_0x234f68[0x0][_0x1c8c06(0x1e3)],'dbName':_0x234f68[0x0][_0x1c8c06(0x1c4)]};if(_0x234f68[_0x1c8c06(0x1c0)]>0x1){const _0x4baa6f=await select({'message':_0x1c8c06(0x1b6),'choices':[..._0x234f68[_0x1c8c06(0x1b5)](_0x1f7e78=>({'name':_0x1f7e78[_0x1c8c06(0x1c4)]+'\x20('+_0x1f7e78[_0x1c8c06(0x1e3)]+')','value':serializeDbSelection(_0x1f7e78)})),{'name':_0x1c8c06(0x1c8),'value':_0x1c8c06(0x1ad)}]});if(_0x4baa6f!=='__manual__')return deserializeDbSelection(_0x4baa6f);}const _0x42a681=await input({'message':'请输入目标数据库\x20dbId:','validate':_0xf79abf=>{const _0x4d864b=_0x1c8c06,_0x3fa902=_0xf79abf[_0x4d864b(0x1d3)]();if(!_0x3fa902)return _0x4d864b(0x1d8);const _0x5eaa9d=Number(_0x3fa902);if(!Number[_0x4d864b(0x1ba)](_0x5eaa9d)||_0x5eaa9d<=0x0)return _0x4d864b(0x1ac);return!![];}});return{'dbId':Number(_0x42a681[_0x1c8c06(0x1d3)]())};}async function resolveSqlModeInput(_0x391662){const _0x2c570e=a186_0x7aa9ef,_0x3347f8=_0x391662[_0x2c570e(0x1da)](_0x2c570e(0x1c1))[_0x2c570e(0x1d3)]();if(_0x3347f8===_0x2c570e(0x1a2)||_0x3347f8===_0x2c570e(0x1be))return _0x3347f8;if(_0x391662[_0x2c570e(0x1b4)])throw CliErrors['flagMissing'](_0x2c570e(0x1c1),_0x2c570e(0x1dc));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x2c570e(0x1aa),'value':_0x2c570e(0x1a2),'description':_0x2c570e(0x1a5)},{'name':_0x2c570e(0x1bc),'value':'mybatisXml','description':_0x2c570e(0x1c6)}]});}function serializeDbSelection(_0x35c34e){const _0x50d61f=a186_0x7aa9ef;return JSON[_0x50d61f(0x1a1)]({'dbId':_0x35c34e[_0x50d61f(0x1e3)],'dbName':_0x35c34e['dbName']});}function deserializeDbSelection(_0x4148a1){const _0x268563=a186_0x7aa9ef;try{const _0xe765f5=JSON[_0x268563(0x1c9)](_0x4148a1);if(typeof _0xe765f5[_0x268563(0x1e3)]===_0x268563(0x1dd)&&Number[_0x268563(0x1c2)](_0xe765f5[_0x268563(0x1e3)]))return{'dbId':_0xe765f5[_0x268563(0x1e3)],'dbName':_0xe765f5[_0x268563(0x1c4)]};}catch{}throw CliErrors[_0x268563(0x1a3)](_0x268563(0x1c5)+_0x4148a1);}function resolveProvidedDbId(_0xd2074d){const _0x4f3a94=a186_0x7aa9ef,_0x4b5b00=_0xd2074d[_0x4f3a94(0x1e0)](_0x4f3a94(0x1e2));if(typeof _0x4b5b00==='number'&&Number[_0x4f3a94(0x1c2)](_0x4b5b00))return _0x4b5b00;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a187_0x34c746=a187_0x16f5;(function(_0x17e899,_0x14c252){const _0x8ec694=a187_0x16f5,_0x4021bc=_0x17e899();while(!![]){try{const _0x27719a=-parseInt(_0x8ec694(0x7b))/0x1*(parseInt(_0x8ec694(0x7c))/0x2)+parseInt(_0x8ec694(0x84))/0x3*(parseInt(_0x8ec694(0x91))/0x4)+parseInt(_0x8ec694(0x85))/0x5*(parseInt(_0x8ec694(0x80))/0x6)+parseInt(_0x8ec694(0x82))/0x7+-parseInt(_0x8ec694(0x6f))/0x8*(parseInt(_0x8ec694(0x73))/0x9)+-parseInt(_0x8ec694(0x97))/0xa*(-parseInt(_0x8ec694(0x8a))/0xb)+-parseInt(_0x8ec694(0x93))/0xc;if(_0x27719a===_0x14c252)break;else _0x4021bc['push'](_0x4021bc['shift']());}catch(_0x44c58f){_0x4021bc['push'](_0x4021bc['shift']());}}}(a187_0x38d1,0xa9f5f));function a187_0x16f5(_0x586d88,_0x4470e1){_0x586d88=_0x586d88-0x6e;const _0x38d14b=a187_0x38d1();let _0x16f50d=_0x38d14b[_0x586d88];return _0x16f50d;}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a187_0x38d1(){const _0xb919af=['sqls','23uMAadk','27654SwfswZ','Deleted\x20','toISOString','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','708IrtBoH','trashDir','8549044ZvqmNZ','\x20(local\x20file\x20moved\x20to\x20trash)','27PvBGRq','5590BLqXCh','validation','trashedTo','appCode','delete','1134089nTFLrB','entries','filter','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','length','sqlcode','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','235924sbUJUf','lockFilePath','11945484rOkkqx','lastSync','high-risk-write','sqlRoot','100zZwUvS','remoteId','str','5744irfQBg','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','startsWith','POST','11349cHAbqG','sqlRootDir','/smartapi/custom/deleteUserCustomSql','projectRoot','SQL\x20lock\x20file\x20not\x20found.','sql','fromEntries'];a187_0x38d1=function(){return _0xb919af;};return a187_0x38d1();}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':a187_0x34c746(0x78),'command':a187_0x34c746(0x89),'description':a187_0x34c746(0x8d),'risk':a187_0x34c746(0x95),'flags':[SQLCODE_FLAG],async 'validate'(_0x3d489d){const _0x4d0cc5=a187_0x34c746,_0x391001=loadSqlProjectConfig(_0x3d489d[_0x4d0cc5(0x88)]),_0x2e2a72=await readSqlLockFile(_0x391001[_0x4d0cc5(0x92)]);if(!_0x2e2a72)throw CliErrors[_0x4d0cc5(0x86)](_0x4d0cc5(0x90));},async 'dryRun'(_0x27586b){const _0x5d9466=a187_0x34c746,_0x5a2afc=loadSqlProjectConfig(_0x27586b[_0x5d9466(0x88)]),_0x384081=await readSqlLockFile(_0x5a2afc[_0x5d9466(0x92)]);if(!_0x384081)throw CliErrors['validation'](_0x5d9466(0x90));const {appLock:_0x406fa4}=ensureSqlLockScope(_0x384081,_0x27586b[_0x5d9466(0x88)],_0x5a2afc[_0x5d9466(0x96)],'delete'),_0x581a67=_0x27586b[_0x5d9466(0x6e)](_0x5d9466(0x8f)),_0x570735=_0x406fa4[_0x5d9466(0x7a)][_0x581a67];if(!_0x570735)throw CliErrors[_0x5d9466(0x86)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x581a67+'\x22.');return{'method':_0x5d9466(0x72),'url':_0x5d9466(0x75),'body':{'sqlCode':_0x581a67,'id':_0x570735[_0x5d9466(0x98)],'localPath':resolveLocalSqlFilePath(_0x5a2afc,_0x581a67,_0x570735)},'description':'Would\x20delete\x20SQL\x20'+_0x581a67+_0x5d9466(0x7f)+_0x5a2afc[_0x5d9466(0x81)]};},async 'execute'(_0x1fa140){const _0x1c8b8d=a187_0x34c746,_0x51d504=loadSqlProjectConfig(_0x1fa140[_0x1c8b8d(0x88)]),_0x265954=await readSqlLockFile(_0x51d504['lockFilePath']);if(!_0x265954)throw CliErrors['validation'](_0x1c8b8d(0x77));const {lockData:_0x4678f5,appLock:_0x1c4896}=ensureSqlLockScope(_0x265954,_0x1fa140[_0x1c8b8d(0x88)],_0x51d504[_0x1c8b8d(0x96)],_0x1c8b8d(0x89)),_0x4fcb23=_0x1fa140['str'](_0x1c8b8d(0x8f)),_0x3562d8=_0x1c4896[_0x1c8b8d(0x7a)][_0x4fcb23];if(!_0x3562d8)throw CliErrors[_0x1c8b8d(0x86)](_0x1c8b8d(0x70)+_0x4fcb23+'\x22.');await deleteSqlQuery({'id':_0x3562d8[_0x1c8b8d(0x98)],'sqlCode':_0x4fcb23}),_0x1c4896[_0x1c8b8d(0x7a)]=Object[_0x1c8b8d(0x79)](Object[_0x1c8b8d(0x8b)](_0x1c4896['sqls'])[_0x1c8b8d(0x8c)](([_0x5e8f2f])=>_0x5e8f2f!==_0x4fcb23)),_0x1c4896[_0x1c8b8d(0x94)]=new Date()['toISOString'](),await writeSqlLockFile(_0x51d504['lockFilePath'],_0x4678f5);const _0x12e71e=resolveLocalSqlFilePath(_0x51d504,_0x4fcb23,_0x3562d8);let _0x43ff03;await fileExists(_0x12e71e)&&(_0x43ff03=await moveToTrash(_0x51d504[_0x1c8b8d(0x76)],_0x51d504['trashDir'],_0x12e71e),await cleanupEmptyDirectories(dirname(_0x12e71e),_0x51d504[_0x1c8b8d(0x74)]));const _0xf750c9={'deleted':_0x4fcb23,'remoteId':_0x3562d8[_0x1c8b8d(0x98)]};if(_0x43ff03)_0xf750c9[_0x1c8b8d(0x87)]=_0x43ff03;return{'ok':!![],'data':_0xf750c9,'message':_0x1c8b8d(0x7d)+_0x4fcb23+(_0x43ff03?_0x1c8b8d(0x83):'')};}};async function moveToTrash(_0x11dc19,_0x448010,_0x1b8190){const _0x34ff3c=a187_0x34c746,_0x3e416a=new Date()[_0x34ff3c(0x7e)]()['replace'](/[:.]/g,'-'),_0x5d1338=relative(_0x11dc19,_0x1b8190),_0x259378=join(_0x448010,_0x3e416a,_0x5d1338);return await mkdir(dirname(_0x259378),{'recursive':!![]}),await rename(_0x1b8190,_0x259378),_0x259378;}async function cleanupEmptyDirectories(_0x40926e,_0x133509){const _0x214927=a187_0x34c746;let _0x379eab=resolve(_0x40926e);const _0x28a565=resolve(_0x133509);while(_0x379eab[_0x214927(0x71)](''+_0x28a565+sep)||_0x379eab===_0x28a565){if(_0x379eab===_0x28a565)return;try{const _0x56f1b9=await readdir(_0x379eab);if(_0x56f1b9[_0x214927(0x8e)]>0x0)return;await rmdir(_0x379eab);}catch{return;}_0x379eab=dirname(_0x379eab);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a188_0x724b(){const _0x42ba91=['read','63LylcFX','boolean','9488130OylwiZ','str','587325nkPczN','11247813FvsSmn','verbose','15VaSsoS','bool','sqlName','appCode','853419agbPaO','dbId','124992sAzmql','Return\x20full\x20raw\x20SQL\x20query\x20object','328080SPYhpq','detail','sqlContent','208574YsCIss','66bFlmCb','sqlCode','description'];a188_0x724b=function(){return _0x42ba91;};return a188_0x724b();}function a188_0x210d(_0x25186c,_0x224df7){_0x25186c=_0x25186c-0x78;const _0x724b67=a188_0x724b();let _0x210dd3=_0x724b67[_0x25186c];return _0x210dd3;}const a188_0x2baabd=a188_0x210d;(function(_0x44afa5,_0x4c5eb3){const _0x3eaf63=a188_0x210d,_0xfa8387=_0x44afa5();while(!![]){try{const _0x709fa=parseInt(_0x3eaf63(0x88))/0x1*(-parseInt(_0x3eaf63(0x7c))/0x2)+-parseInt(_0x3eaf63(0x81))/0x3*(-parseInt(_0x3eaf63(0x8e))/0x4)+parseInt(_0x3eaf63(0x85))/0x5+-parseInt(_0x3eaf63(0x7d))/0x6*(-parseInt(_0x3eaf63(0x8c))/0x7)+-parseInt(_0x3eaf63(0x79))/0x8+parseInt(_0x3eaf63(0x86))/0x9+-parseInt(_0x3eaf63(0x83))/0xa;if(_0x709fa===_0x4c5eb3)break;else _0xfa8387['push'](_0xfa8387['shift']());}catch(_0x25b495){_0xfa8387['push'](_0xfa8387['shift']());}}}(a188_0x724b,0xc5d95));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a188_0x2baabd(0x7a),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a188_0x2baabd(0x80),'flags':[SQLCODE_FLAG,{'name':a188_0x2baabd(0x87),'type':a188_0x2baabd(0x82),'description':a188_0x2baabd(0x78)}],async 'execute'(_0x279e1e){const _0xb2be04=a188_0x2baabd,_0x3bb7d4=await getSqlQueryInfo(_0x279e1e[_0xb2be04(0x8b)],_0x279e1e[_0xb2be04(0x84)]('sqlcode')),_0x5889ab=_0x279e1e[_0xb2be04(0x89)]('verbose');if(_0x5889ab)return{'ok':!![],'data':_0x3bb7d4};const _0x4de3dd=_0x3bb7d4[_0xb2be04(0x8d)]?await getDbName(_0x279e1e[_0xb2be04(0x8b)],_0x3bb7d4[_0xb2be04(0x8d)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3bb7d4[_0xb2be04(0x7e)],'sqlName':_0x3bb7d4[_0xb2be04(0x8a)],'db':_0x4de3dd?_0x4de3dd+'\x20('+_0x3bb7d4['dbId']+')':_0x3bb7d4[_0xb2be04(0x8d)]??'','description':_0x3bb7d4[_0xb2be04(0x7f)]??'','sqlContent':_0x3bb7d4[_0xb2be04(0x7b)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a189_0x325c(){const _0x5a784e=['SQL\x20execution\x20failed','1102295cBuORn','771582XkToHX','str','38227XGwWOt','Returned\x20','2598130JrHreV','\x20row(s)\x20in\x20','now','9Mncvyi','8GrFIdc','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','474viBvxv','723futlDO','params','appCode','932ahHpJy','9509038XmtmzR','execSuccess','read','length','sql','exec','string','1967648gAAqRc','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','isArray'];a189_0x325c=function(){return _0x5a784e;};return a189_0x325c();}const a189_0x21bb2f=a189_0x225a;function a189_0x225a(_0x3128c2,_0x30e801){_0x3128c2=_0x3128c2-0x122;const _0x325c0b=a189_0x325c();let _0x225a0b=_0x325c0b[_0x3128c2];return _0x225a0b;}(function(_0x485c50,_0x5ef5f7){const _0xd29e14=a189_0x225a,_0x12f185=_0x485c50();while(!![]){try{const _0x43056f=-parseInt(_0xd29e14(0x136))/0x1*(parseInt(_0xd29e14(0x139))/0x2)+-parseInt(_0xd29e14(0x12b))/0x3+-parseInt(_0xd29e14(0x133))/0x4*(-parseInt(_0xd29e14(0x12a))/0x5)+-parseInt(_0xd29e14(0x135))/0x6*(parseInt(_0xd29e14(0x12d))/0x7)+parseInt(_0xd29e14(0x126))/0x8+-parseInt(_0xd29e14(0x132))/0x9*(parseInt(_0xd29e14(0x12f))/0xa)+parseInt(_0xd29e14(0x13a))/0xb;if(_0x43056f===_0x5ef5f7)break;else _0x12f185['push'](_0x12f185['shift']());}catch(_0x54fd7e){_0x12f185['push'](_0x12f185['shift']());}}}(a189_0x325c,0x40f04));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a189_0x21bb2f(0x123),'command':a189_0x21bb2f(0x124),'description':a189_0x21bb2f(0x127),'risk':a189_0x21bb2f(0x13c),'flags':[SQLCODE_FLAG,{'name':a189_0x21bb2f(0x137),'type':a189_0x21bb2f(0x125),'description':a189_0x21bb2f(0x134)}],async 'execute'(_0x25741b){const _0x57c31a=a189_0x21bb2f,_0x4508b7=parseJsonParams(_0x25741b['str'](_0x57c31a(0x137))),_0x1b5f9b=Date[_0x57c31a(0x131)](),_0x5c13b5=await executeSql(_0x25741b[_0x57c31a(0x138)],_0x25741b[_0x57c31a(0x12c)]('sqlcode'),_0x4508b7),_0x4205b5=Date[_0x57c31a(0x131)]()-_0x1b5f9b,_0x50b4d9=_0x5c13b5?.['execResult']??_0x5c13b5,_0x498e9d=_0x5c13b5?.[_0x57c31a(0x13b)]??!![];if(!_0x498e9d)return{'ok':![],'data':{'error':_0x5c13b5?.['execError']||_0x57c31a(0x129),'elapsed':_0x4205b5},'message':'SQL\x20execution\x20failed'};const _0x25ae43=Array[_0x57c31a(0x128)](_0x50b4d9)?_0x50b4d9:[];return{'ok':!![],'data':{'rows':_0x25ae43,'rowCount':_0x25ae43[_0x57c31a(0x122)],'elapsed':_0x4205b5},'message':_0x57c31a(0x12e)+_0x25ae43['length']+_0x57c31a(0x130)+_0x4205b5+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x41c69f,_0x387af0){const _0x247da4=a190_0x5841,_0x3e4768=_0x41c69f();while(!![]){try{const _0x518cfa=parseInt(_0x247da4(0x11f))/0x1+parseInt(_0x247da4(0x126))/0x2+parseInt(_0x247da4(0x125))/0x3*(parseInt(_0x247da4(0x123))/0x4)+parseInt(_0x247da4(0x120))/0x5*(-parseInt(_0x247da4(0x11e))/0x6)+-parseInt(_0x247da4(0x124))/0x7+-parseInt(_0x247da4(0x127))/0x8+-parseInt(_0x247da4(0x122))/0x9*(-parseInt(_0x247da4(0x121))/0xa);if(_0x518cfa===_0x387af0)break;else _0x3e4768['push'](_0x3e4768['shift']());}catch(_0x28f6dd){_0x3e4768['push'](_0x3e4768['shift']());}}}(a190_0x138b,0x23ae5));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a190_0x138b(){const _0x1bb28b=['296204tggWPS','2094864hDAqUb','522642UZqlGe','62004TbRcQH','5wxJwXN','10190rHcCPu','2250XifNxp','12uYSoST','162813lJgHKE','53517bhAJac'];a190_0x138b=function(){return _0x1bb28b;};return a190_0x138b();}function a190_0x5841(_0x223c61,_0x1fb663){_0x223c61=_0x223c61-0x11e;const _0x138bd6=a190_0x138b();let _0x584131=_0x138bd6[_0x223c61];return _0x584131;}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a191_0x5b11(){const _0x286bc0=['page','96HgGtZX','10lbjuuI','No\x20custom\x20SQL\x20queries\x20found.','num','dbId','869252gvIdMI','sql','pagesize','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','List\x20custom\x20SQL\x20queries','Page\x20number','170369KRrGOa','445602obWBMN','paging','10694420JVQaZC','str','map','length','sqlName','Page\x20size','number','appCode','boolean','131427WhLDLs','read','totalCount','string','197424oQMWUY','verbose','description','sqlCode','14TLHGSZ','Filter\x20by\x20SQL\x20name','462004yvBeyS','name','sqlcode'];a191_0x5b11=function(){return _0x286bc0;};return a191_0x5b11();}const a191_0x47b02d=a191_0x3eb1;(function(_0x38846c,_0x5183a0){const _0x36f09c=a191_0x3eb1,_0x3def7f=_0x38846c();while(!![]){try{const _0x330f2d=parseInt(_0x36f09c(0x1bc))/0x1+parseInt(_0x36f09c(0x1b6))/0x2+parseInt(_0x36f09c(0x1c8))/0x3+parseInt(_0x36f09c(0x1d2))/0x4*(parseInt(_0x36f09c(0x1d7))/0x5)+-parseInt(_0x36f09c(0x1bd))/0x6*(-parseInt(_0x36f09c(0x1d0))/0x7)+parseInt(_0x36f09c(0x1d6))/0x8*(parseInt(_0x36f09c(0x1cc))/0x9)+-parseInt(_0x36f09c(0x1bf))/0xa;if(_0x330f2d===_0x5183a0)break;else _0x3def7f['push'](_0x3def7f['shift']());}catch(_0x3329ae){_0x3def7f['push'](_0x3def7f['shift']());}}}(a191_0x5b11,0x363b2));import{listSqlQueries}from'../../core/api-client.js';function a191_0x3eb1(_0x4e7ca8,_0x2a7ccd){_0x4e7ca8=_0x4e7ca8-0x1b6;const _0x5b112a=a191_0x5b11();let _0x3eb177=_0x5b112a[_0x4e7ca8];return _0x3eb177;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a191_0x47b02d(0x1b7),'command':'list','description':a191_0x47b02d(0x1ba),'risk':a191_0x47b02d(0x1c9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a191_0x47b02d(0x1cb),'description':a191_0x47b02d(0x1d1)},{'name':a191_0x47b02d(0x1d5),'type':a191_0x47b02d(0x1c5),'description':a191_0x47b02d(0x1bb),'default':0x1},{'name':a191_0x47b02d(0x1b8),'type':a191_0x47b02d(0x1c5),'description':a191_0x47b02d(0x1c4)},{'name':a191_0x47b02d(0x1cd),'type':a191_0x47b02d(0x1c7),'description':a191_0x47b02d(0x1b9)}],async 'execute'(_0x4b98ce){const _0x143081=a191_0x47b02d,_0x80c6e6=await listSqlQueries(_0x4b98ce[_0x143081(0x1c6)],{'sqlCode':_0x4b98ce[_0x143081(0x1c0)](_0x143081(0x1d4))||undefined,'sqlName':_0x4b98ce[_0x143081(0x1c0)](_0x143081(0x1d3))||undefined,'currentPage':_0x4b98ce[_0x143081(0x1d9)](_0x143081(0x1d5)),'pageSize':_0x4b98ce[_0x143081(0x1d9)]('pagesize',0x32)}),_0x239094=_0x4b98ce['bool'](_0x143081(0x1cd)),_0x4fa230=_0x80c6e6['tableData']??[],_0x1383cf=_0x80c6e6[_0x143081(0x1be)]?.[_0x143081(0x1ca)]??_0x4fa230[_0x143081(0x1c2)];let _0x5a0797;return _0x239094?_0x5a0797=_0x4fa230:_0x5a0797=await Promise['all'](_0x4fa230[_0x143081(0x1c1)](async _0x28b708=>{const _0xd1caa6=_0x143081;let _0x9435fa;try{_0x9435fa=_0x28b708['dbId']?await getDbName(_0x4b98ce['appCode'],_0x28b708[_0xd1caa6(0x1da)]):undefined;}catch{}return{'sqlCode':_0x28b708[_0xd1caa6(0x1cf)],'sqlName':_0x28b708[_0xd1caa6(0x1c3)],'description':_0x28b708[_0xd1caa6(0x1ce)]??'','db':_0x9435fa?_0x9435fa+'\x20('+_0x28b708[_0xd1caa6(0x1da)]+')':_0x28b708['dbId']??''};})),{'ok':!![],'data':_0x5a0797,'message':_0x4fa230[_0x143081(0x1c2)]===0x0?_0x143081(0x1d8):'Found\x20'+_0x4fa230[_0x143081(0x1c2)]+'\x20SQL\x20queries\x20(total:\x20'+_0x1383cf+').'};}};
|