@lovrabet/rabetbase-cli 2.5.0-beta.6 → 2.5.0
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/api/generate-sdk-config-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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/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/table-diff-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/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.js +1 -1
- 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/domain-config.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.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/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 +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a174_0x5c0367=a174_0x39a5;(function(_0x2ce8dd,_0x1d6504){const _0x5399a8=a174_0x39a5,_0x39bd14=_0x2ce8dd();while(!![]){try{const _0x4ceb82=-parseInt(_0x5399a8(0x16a))/0x1*(-parseInt(_0x5399a8(0x164))/0x2)+-parseInt(_0x5399a8(0x166))/0x3*(-parseInt(_0x5399a8(0x15f))/0x4)+parseInt(_0x5399a8(0x167))/0x5*(-parseInt(_0x5399a8(0x15c))/0x6)+parseInt(_0x5399a8(0x16c))/0x7+-parseInt(_0x5399a8(0x16e))/0x8+-parseInt(_0x5399a8(0x163))/0x9*(parseInt(_0x5399a8(0x15b))/0xa)+parseInt(_0x5399a8(0x15e))/0xb;if(_0x4ceb82===_0x1d6504)break;else _0x39bd14['push'](_0x39bd14['shift']());}catch(_0x5ae98c){_0x39bd14['push'](_0x39bd14['shift']());}}}(a174_0x39c2,0x22c92));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a174_0x5c0367(0x16b);function a174_0x39c2(){const _0x23056f=['28fiurRp','num','3EXMHUQ','16045gcCYTv','appCode','Role\x20still\x20has\x20','7013fKEvwB','/smartapi/permit/role/delete','1630167CjQHlx','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','2274296dOfvZr','Deleted\x20role\x20','userCount','170PXygOU','366opEfsD','dev','4772603xSXNfp','163436qdRLnC','roleName','delete','\x20(id=','97029LOoKfn'];a174_0x39c2=function(){return _0x23056f;};return a174_0x39c2();}function a174_0x39a5(_0x24eb89,_0x197932){_0x24eb89=_0x24eb89-0x15b;const _0x39c2e9=a174_0x39c2();let _0x39a53b=_0x39c2e9[_0x24eb89];return _0x39a53b;}export const roleDelete={'service':'role','command':'delete','description':a174_0x5c0367(0x16d),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x363763){const _0x3f98e1=a174_0x5c0367,_0x312437=_0x363763[_0x3f98e1(0x165)]('id'),_0x4c5a62=await getRoleById(_0x363763[_0x3f98e1(0x168)],_0x312437);return assertCustomRole(_0x4c5a62,'delete'),asDryRunResult({'scope':_0x3f98e1(0x15d),'operation':_0x3f98e1(0x161),'selector':{'appCode':_0x363763['appCode'],'roleId':_0x312437,'roleName':_0x4c5a62[_0x3f98e1(0x160)]},'before':projectRole(_0x4c5a62),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x4c5a62[_0x3f98e1(0x170)]>0x0?[_0x3f98e1(0x169)+_0x4c5a62[_0x3f98e1(0x170)]+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x54013e){const _0x2a7afa=a174_0x5c0367,_0x51edbb=_0x54013e['num']('id'),_0x368e87=await getRoleById(_0x54013e[_0x2a7afa(0x168)],_0x51edbb);return assertCustomRole(_0x368e87,_0x2a7afa(0x161)),await deleteAppRole(_0x51edbb),{'ok':!![],'data':{'scope':_0x2a7afa(0x15d),'operation':'delete','selector':{'appCode':_0x54013e[_0x2a7afa(0x168)],'roleId':_0x51edbb,'roleName':_0x368e87['roleName']},'before':projectRole(_0x368e87),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x2a7afa(0x16f)+_0x368e87[_0x2a7afa(0x160)]+_0x2a7afa(0x162)+_0x51edbb+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a175_0x429f(_0x291a0f,_0x221601){_0x291a0f=_0x291a0f-0x183;const _0x3d2827=a175_0x3d28();let _0x429fa2=_0x3d2827[_0x291a0f];return _0x429fa2;}const a175_0x44c5a2=a175_0x429f;function a175_0x3d28(){const _0x462676=['read','dev','Role\x20','roleName','1035505RIdzkP','detail','appCode','4769862kZSdIj','12BeJKgq','num','35AmvgcH','1199737lNTYdg','4hcXfzq','36600DQucvK','2196280BshPdk','role','18MPWwOv','107530BgvQvI','4jrAlLX','2967318TCQevV'];a175_0x3d28=function(){return _0x462676;};return a175_0x3d28();}(function(_0xf6d1a0,_0x23c0ca){const _0x1c9a8f=a175_0x429f,_0x30baa1=_0xf6d1a0();while(!![]){try{const _0xafbd60=parseInt(_0x1c9a8f(0x18e))/0x1*(-parseInt(_0x1c9a8f(0x189))/0x2)+parseInt(_0x1c9a8f(0x190))/0x3+parseInt(_0x1c9a8f(0x18f))/0x4*(parseInt(_0x1c9a8f(0x195))/0x5)+-parseInt(_0x1c9a8f(0x184))/0x6+-parseInt(_0x1c9a8f(0x187))/0x7*(-parseInt(_0x1c9a8f(0x18a))/0x8)+parseInt(_0x1c9a8f(0x18d))/0x9*(parseInt(_0x1c9a8f(0x18b))/0xa)+-parseInt(_0x1c9a8f(0x188))/0xb*(parseInt(_0x1c9a8f(0x185))/0xc);if(_0xafbd60===_0x23c0ca)break;else _0x30baa1['push'](_0x30baa1['shift']());}catch(_0x487f13){_0x30baa1['push'](_0x30baa1['shift']());}}}(a175_0x3d28,0x83a62));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a175_0x44c5a2(0x18c),'command':a175_0x44c5a2(0x196),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a175_0x44c5a2(0x191),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x6130d3){const _0x4654a3=a175_0x44c5a2,_0x3a353d=_0x6130d3[_0x4654a3(0x186)]('id'),_0x387e26=await getRoleById(_0x6130d3[_0x4654a3(0x183)],_0x3a353d);return{'ok':!![],'data':{'scope':_0x4654a3(0x192),'role':projectRole(_0x387e26)},'message':_0x4654a3(0x193)+_0x387e26[_0x4654a3(0x194)]+'\x20('+_0x387e26['roleType']+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x406e1d,_0x3fcc3c){const _0x476d57=a176_0x3a4e,_0x54fb7f=_0x406e1d();while(!![]){try{const _0x25c97c=parseInt(_0x476d57(0x1f8))/0x1*(-parseInt(_0x476d57(0x1f3))/0x2)+-parseInt(_0x476d57(0x1f6))/0x3+-parseInt(_0x476d57(0x1f0))/0x4*(parseInt(_0x476d57(0x1f5))/0x5)+parseInt(_0x476d57(0x1f7))/0x6+-parseInt(_0x476d57(0x1f4))/0x7*(-parseInt(_0x476d57(0x1f1))/0x8)+-parseInt(_0x476d57(0x1f9))/0x9+parseInt(_0x476d57(0x1f2))/0xa;if(_0x25c97c===_0x3fcc3c)break;else _0x54fb7f['push'](_0x54fb7f['shift']());}catch(_0x2a85d1){_0x54fb7f['push'](_0x54fb7f['shift']());}}}(a176_0x462f,0x9d1a7));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';function a176_0x462f(){const _0x2ca440=['20eNdXtA','225424TMGHFZ','16224350gLYNlq','8DYzQQz','203SpGPhm','803915pbJguO','2083593iYRWGv','5703534nMJIWk','180429BFvgMd','4738761DITfQh'];a176_0x462f=function(){return _0x2ca440;};return a176_0x462f();}function a176_0x3a4e(_0xf2f9bf,_0xf9430e){_0xf2f9bf=_0xf2f9bf-0x1f0;const _0x462f35=a176_0x462f();let _0x3a4e5c=_0x462f35[_0xf2f9bf];return _0x3a4e5c;}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 a177_0x3a2e43=a177_0x478a;function a177_0x478a(_0xa0c3fd,_0x4d8b1d){_0xa0c3fd=_0xa0c3fd-0x89;const _0x1c4b95=a177_0x1c4b();let _0x478a55=_0x1c4b95[_0xa0c3fd];return _0x478a55;}(function(_0x380c74,_0x3b2d26){const _0x3c7387=a177_0x478a,_0x385dda=_0x380c74();while(!![]){try{const _0x40bb5d=parseInt(_0x3c7387(0x9e))/0x1+-parseInt(_0x3c7387(0xa2))/0x2*(-parseInt(_0x3c7387(0x8d))/0x3)+-parseInt(_0x3c7387(0xa4))/0x4+parseInt(_0x3c7387(0x9f))/0x5*(parseInt(_0x3c7387(0x9d))/0x6)+parseInt(_0x3c7387(0x8e))/0x7*(-parseInt(_0x3c7387(0x94))/0x8)+-parseInt(_0x3c7387(0xa6))/0x9+parseInt(_0x3c7387(0x99))/0xa;if(_0x40bb5d===_0x3b2d26)break;else _0x385dda['push'](_0x385dda['shift']());}catch(_0x2ea52a){_0x385dda['push'](_0x385dda['shift']());}}}(a177_0x1c4b,0xc3869));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a177_0x1c4b(){const _0x14e0a0=['trim','validation','role','54zWxCRv','348603JiBAfO','610455eNxmGa','length','pagesize','186182plGXXF','DEV','2648676wzegiJ','CUSTOM','1121229CTFylF','Filter\x20by\x20role\x20type','str','read','number','type','dev','num','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Use\x20one\x20of:\x20','Page\x20index\x20(1-based)','roleType','6AnNEQd','994wxhuDe','toUpperCase','join','Invalid\x20--type\x20\x22','Found\x20','map','39448GcdYJy','OWNER','page','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','ADMIN','6542210TZVyLV'];a177_0x1c4b=function(){return _0x14e0a0;};return a177_0x1c4b();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a177_0x3a2e43(0x98),a177_0x3a2e43(0xa3),a177_0x3a2e43(0x95),a177_0x3a2e43(0xa5)];export const roleList={'service':a177_0x3a2e43(0x9c),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a177_0x3a2e43(0xa9),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':'string','required':![],'description':a177_0x3a2e43(0xa7),'enum':ROLE_TYPES},{'name':a177_0x3a2e43(0x96),'type':'number','description':a177_0x3a2e43(0x8b),'default':0x1},{'name':'pagesize','type':a177_0x3a2e43(0xaa),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x2b4dcf){const _0x358d3e=a177_0x3a2e43,_0x1c5004=_0x2b4dcf[_0x358d3e(0xa8)](_0x358d3e(0xab))[_0x358d3e(0x9a)]();if(_0x1c5004&&!ROLE_TYPES['includes'](_0x1c5004['toUpperCase']()))throw CliErrors['validation'](_0x358d3e(0x91)+_0x1c5004+'\x22.',_0x358d3e(0x8a)+ROLE_TYPES[_0x358d3e(0x90)](',\x20')+'.');const _0x39fb3a=_0x2b4dcf[_0x358d3e(0xad)](_0x358d3e(0x96),0x1),_0x2e67e5=_0x2b4dcf[_0x358d3e(0xad)](_0x358d3e(0xa1),0x64);if(_0x39fb3a<0x1)throw CliErrors[_0x358d3e(0x9b)](_0x358d3e(0x97));if(_0x2e67e5<0x1||_0x2e67e5>0x64)throw CliErrors[_0x358d3e(0x9b)](_0x358d3e(0x89));},async 'execute'(_0x2cb053){const _0x2a3a6d=a177_0x3a2e43,_0x4e7c00=_0x2cb053[_0x2a3a6d(0xad)]('page',0x1)||0x1,_0x452ceb=_0x2cb053[_0x2a3a6d(0xad)]('pagesize',0x64)||0x64,_0x53799a=_0x2cb053[_0x2a3a6d(0xa8)](_0x2a3a6d(0xab))[_0x2a3a6d(0x9a)]()[_0x2a3a6d(0x8f)](),{items:_0x5ca0cd,paging:_0x5a7998}=await listAppRoles(_0x2cb053['appCode'],{'currentPage':_0x4e7c00,'pageSize':_0x452ceb}),_0xce67cf=_0x53799a?_0x5ca0cd['filter'](_0x352d5b=>_0x352d5b[_0x2a3a6d(0x8c)]===_0x53799a):_0x5ca0cd,_0xdac75b=_0xce67cf[_0x2a3a6d(0x93)](projectRole);return{'ok':!![],'data':{'scope':_0x2a3a6d(0xac),'roles':_0xdac75b,'paging':_0x5a7998},'message':_0x2a3a6d(0x92)+_0xdac75b[_0x2a3a6d(0xa0)]+'\x20role(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a178_0x2245a4=a178_0x53e1;function a178_0x5a31(){const _0x30b702=['4AdvGun','totalCount','dryRun','tenant_code','1033012zjkhOs','push','permitCount','\x20not\x20found\x20in\x20app\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','string','user','Role\x20id\x20or\x20exact\x20role\x20name','toLowerCase','DEV','tenant','\x20built-in\x20role\x20','\x22\x20not\x20found\x20in\x20app\x20','number','name','Check\x20the\x20nickname/username.\x20','test','Missing\x20user\x20reference.','\x20members\x20of\x20the\x20OWNER\x20role.','Optional\x20role\x20remark/description','join','map','Role\x20id\x20','dev','11490984RdUcjB','Multiple\x20tenant\x20members\x20match\x20\x22','8XfbqQM','Cannot\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Pass\x20--user\x20<id|name>.','Pass\x20--role\x20<id|name>.','roleName','username','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','role','remark','flagMissing','Role\x20name\x20\x22','\x20duplicate\x20memberships\x20for\x20user\x20','filter','authRequired','User\x20','includes','143WyCOpC','ADMIN','Role\x20name','13466243SPoLWS','\x22\x20is\x20ambiguous\x20(ids:\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.',';\x20no\x20change.','/smartapi/permit/user-role/create','1254030DKGzSr','\x20member(s)\x20but\x20role\x20has\x20','userId','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','length','str','find','userCount','Anti-drift\x20check\x20failed:\x20expected\x20','CUSTOM','3amVYSy','9025715idsAqI','flag','roleType','validation','expect-user-count','OWNER','POST','expectUserCount','1713456hShFsX','nickname','appCode','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','trim','4991097zVMszN','user-add','Pass\x20--user\x20<id>.','Role\x20id\x20(from\x20`role\x20list`)'];a178_0x5a31=function(){return _0x30b702;};return a178_0x5a31();}(function(_0x31d315,_0x5d98fa){const _0x558024=a178_0x53e1,_0x4b08a8=_0x31d315();while(!![]){try{const _0x575042=parseInt(_0x558024(0xce))/0x1*(-parseInt(_0x558024(0xe5))/0x2)+-parseInt(_0x558024(0xdd))/0x3+-parseInt(_0x558024(0xe1))/0x4*(-parseInt(_0x558024(0xcf))/0x5)+parseInt(_0x558024(0xfd))/0x6+parseInt(_0x558024(0xbf))/0x7*(parseInt(_0x558024(0xff))/0x8)+parseInt(_0x558024(0xd7))/0x9+parseInt(_0x558024(0xc4))/0xa*(-parseInt(_0x558024(0xbc))/0xb);if(_0x575042===_0x5d98fa)break;else _0x4b08a8['push'](_0x4b08a8['shift']());}catch(_0x327add){_0x4b08a8['push'](_0x4b08a8['shift']());}}}(a178_0x5a31,0xf1f08));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_0x2245a4(0xf2),'required':!![],'description':a178_0x2245a4(0xe0)};export const ROLE_REF_FLAG={'name':a178_0x2245a4(0x107),'type':a178_0x2245a4(0xea),'required':!![],'description':a178_0x2245a4(0xec)};export const USER_REF_FLAG={'name':a178_0x2245a4(0xeb),'type':'string','required':!![],'description':a178_0x2245a4(0x106)};export const NAME_FLAG={'name':a178_0x2245a4(0xf3),'type':a178_0x2245a4(0xea),'required':!![],'description':a178_0x2245a4(0xbe)};export const USER_NAME_FLAG={'name':a178_0x2245a4(0xf3),'type':a178_0x2245a4(0xea),'required':!![],'description':a178_0x2245a4(0xda)};export const REMARK_FLAG={'name':a178_0x2245a4(0x108),'type':a178_0x2245a4(0xea),'required':![],'description':a178_0x2245a4(0xf8)};export const EXPECT_USER_COUNT_FLAG={'name':a178_0x2245a4(0xd3),'type':'number','required':![],'description':a178_0x2245a4(0xc7)};export const BUILTIN_ROLE_TYPES=[a178_0x2245a4(0xbd),a178_0x2245a4(0xee),a178_0x2245a4(0xd4)];export function isBuiltinRole(_0x4cbc79){const _0x13b477=a178_0x2245a4;return BUILTIN_ROLE_TYPES[_0x13b477(0xbb)](_0x4cbc79);}export function assertCustomRole(_0x250e7c,_0x37e7ae){const _0x10a901=a178_0x2245a4;if(_0x250e7c[_0x10a901(0xd1)]!==_0x10a901(0xcd))throw CliErrors[_0x10a901(0xd2)](_0x10a901(0x100)+_0x37e7ae+_0x10a901(0xf0)+_0x250e7c[_0x10a901(0x104)]+'\x20('+_0x250e7c[_0x10a901(0xd1)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x59617d){const _0x1ece3f=a178_0x2245a4;return{'id':_0x59617d['id'],'roleName':_0x59617d[_0x1ece3f(0x104)],'roleType':_0x59617d['roleType'],'remark':_0x59617d[_0x1ece3f(0x108)],'userCount':_0x59617d[_0x1ece3f(0xcb)],'permitCount':_0x59617d[_0x1ece3f(0xe7)],'builtin':isBuiltinRole(_0x59617d['roleType'])};}export async function resolveRoleRef(_0x25f4b5,_0xaa2baf){const _0x1cd7cf=a178_0x2245a4,_0xc6a977=_0xaa2baf['trim']();if(!_0xc6a977)throw CliErrors[_0x1cd7cf(0xd2)]('Missing\x20role\x20reference.',_0x1cd7cf(0x103));if(/^\d+$/[_0x1cd7cf(0xf5)](_0xc6a977))return getRoleById(_0x25f4b5,Number(_0xc6a977));const _0x10b647=await listAllAppRoles(_0x25f4b5),_0x3ac98b=_0x10b647[_0x1cd7cf(0xb8)](_0x355658=>_0x355658[_0x1cd7cf(0x104)]===_0xc6a977);if(_0x3ac98b[_0x1cd7cf(0xc8)]===0x0)throw CliErrors[_0x1cd7cf(0xd2)](_0x1cd7cf(0xb6)+_0xc6a977+_0x1cd7cf(0xf1)+_0x25f4b5+'.',_0x1cd7cf(0x101));if(_0x3ac98b[_0x1cd7cf(0xc8)]>0x1){const _0x795451=_0x3ac98b['map'](_0x29eee4=>_0x29eee4['id'])[_0x1cd7cf(0xf9)](',\x20');throw CliErrors[_0x1cd7cf(0xd2)]('Role\x20name\x20\x22'+_0xc6a977+_0x1cd7cf(0xc0)+_0x795451+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x3ac98b[0x0];}export async function getRoleById(_0x7a98e0,_0x54cc49){const _0x50eb89=a178_0x2245a4,_0x2e38b5=await listAllAppRoles(_0x7a98e0),_0x2edb7d=_0x2e38b5[_0x50eb89(0xb8)](_0x154b2c=>_0x154b2c['id']===_0x54cc49&&(!_0x154b2c[_0x50eb89(0xd9)]||_0x154b2c[_0x50eb89(0xd9)]===_0x7a98e0));if(_0x2edb7d[_0x50eb89(0xc8)]!==0x1)throw CliErrors[_0x50eb89(0xd2)](_0x50eb89(0xfb)+_0x54cc49+_0x50eb89(0xe8)+_0x7a98e0+'.',_0x50eb89(0xc1));return _0x2edb7d[0x0];}async function listAllAppRoles(_0x206fd0){const _0x371b8f=a178_0x2245a4,_0x155cc7=0x64,_0x21766a=[];for(let _0x260698=0x1;;_0x260698+=0x1){const {items:_0x107c72,paging:_0x5a4ba0}=await listAppRoles(_0x206fd0,{'currentPage':_0x260698,'pageSize':_0x155cc7});_0x21766a[_0x371b8f(0xe6)](..._0x107c72);if(_0x107c72[_0x371b8f(0xc8)]<_0x155cc7||_0x5a4ba0&&_0x21766a['length']>=_0x5a4ba0[_0x371b8f(0xe2)])return _0x21766a;}}export async function resolveTenantCode(){const _0xb5bb83=a178_0x2245a4,_0x1b878d=await getSessionUserInfo(),_0x4ef568=_0x1b878d?.['user']?.[_0xb5bb83(0xef)]?.[_0xb5bb83(0xe4)];if(!_0x4ef568)throw CliErrors[_0xb5bb83(0xb9)](_0xb5bb83(0xdb));return _0x4ef568;}function matchMember(_0x45106e,_0x3fbfe1){const _0x4bbae9=a178_0x2245a4,_0x24dc39=_0x3fbfe1['trim']()['toLowerCase']();return(_0x45106e[_0x4bbae9(0xd8)]??'')[_0x4bbae9(0xed)]()===_0x24dc39||(_0x45106e[_0x4bbae9(0x105)]??'')[_0x4bbae9(0xed)]()===_0x24dc39;}export async function resolveUserRef(_0x4da721,_0x4332d5=a178_0x2245a4(0xdf)){const _0x6ec11b=a178_0x2245a4,_0x29a028=_0x4da721[_0x6ec11b(0xdc)]();if(!_0x29a028)throw CliErrors[_0x6ec11b(0xd2)](_0x6ec11b(0xf6),_0x6ec11b(0x102));const _0x250031=await resolveTenantCode(),_0x2629b0=await getTenantMembers(_0x250031);if(/^\d+$/['test'](_0x29a028)){const _0x49063d=Number(_0x29a028),_0x56eee6=_0x2629b0[_0x6ec11b(0xca)](_0x44b79f=>_0x44b79f[_0x6ec11b(0xc6)]===_0x49063d);return{'userId':_0x49063d,'username':_0x56eee6?.[_0x6ec11b(0x105)]??String(_0x49063d),'nickname':_0x56eee6?.['nickname'],'matchedBy':'id'};}const _0xaa0f8f=_0x2629b0[_0x6ec11b(0xb8)](_0x16cb43=>matchMember(_0x16cb43,_0x29a028));if(_0xaa0f8f[_0x6ec11b(0xc8)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x29a028+'\x22.',_0x6ec11b(0xf4)+_0x4332d5);if(_0xaa0f8f[_0x6ec11b(0xc8)]>0x1){const _0x2d43b4=_0xaa0f8f[_0x6ec11b(0xfa)](_0x585ad1=>(_0x585ad1[_0x6ec11b(0xd8)]??_0x585ad1[_0x6ec11b(0x105)]??'?')+'('+_0x585ad1[_0x6ec11b(0xc6)]+')')[_0x6ec11b(0xf9)](',\x20');throw CliErrors[_0x6ec11b(0xd2)](_0x6ec11b(0xfe)+_0x29a028+'\x22:\x20'+_0x2d43b4+'.',_0x4332d5);}const _0x2c2689=_0xaa0f8f[0x0];return{'userId':_0x2c2689[_0x6ec11b(0xc6)],'username':_0x2c2689['username']??String(_0x2c2689['userId']),'nickname':_0x2c2689[_0x6ec11b(0xd8)],'matchedBy':_0x6ec11b(0xf3)};}export const CREATE_USER_ROLE_PATH=a178_0x2245a4(0xc3);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x26b519){const _0x49c4a7=a178_0x2245a4,{operation:_0x2e0b5a,appCode:_0x27a344,role:_0x25fdb1,relations:_0xaa9a12,user:_0x10092f}=_0x26b519,_0x146762=[...new Set(_0xaa9a12[_0x49c4a7(0xfa)](_0x2982ed=>_0x2982ed[_0x49c4a7(0xc6)]))],_0x1806bd=[];if(_0x26b519['expectUserCount']!==undefined&&_0x26b519[_0x49c4a7(0xd6)]!==_0x146762[_0x49c4a7(0xc8)])throw CliErrors['validation'](_0x49c4a7(0xcc)+_0x26b519[_0x49c4a7(0xd6)]+_0x49c4a7(0xc5)+_0x146762[_0x49c4a7(0xc8)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x45882f=_0x146762['includes'](_0x10092f[_0x49c4a7(0xc6)]),_0x50f497=_0xaa9a12[_0x49c4a7(0xb8)](_0x12b155=>_0x12b155[_0x49c4a7(0xc6)]===_0x10092f[_0x49c4a7(0xc6)])['map'](_0x5c9598=>_0x5c9598['id']),_0x4a645d=_0x2e0b5a===_0x49c4a7(0xde)?!_0x45882f:_0x45882f;let _0x550833=_0x146762;_0x2e0b5a===_0x49c4a7(0xde)?_0x45882f?_0x1806bd[_0x49c4a7(0xe6)]('User\x20'+_0x10092f['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x25fdb1['roleName']+_0x49c4a7(0xc2)):_0x550833=[..._0x146762,_0x10092f[_0x49c4a7(0xc6)]]:!_0x45882f?_0x1806bd['push'](_0x49c4a7(0xba)+_0x10092f[_0x49c4a7(0xc6)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x25fdb1[_0x49c4a7(0x104)]+';\x20no\x20change.'):(_0x550833=_0x146762[_0x49c4a7(0xb8)](_0x42e21f=>_0x42e21f!==_0x10092f['userId']),_0x50f497['length']>0x1&&_0x1806bd['push']('Removed\x20'+_0x50f497[_0x49c4a7(0xc8)]+_0x49c4a7(0xb7)+_0x10092f[_0x49c4a7(0xc6)]+'.'));const _0x5b712b={'scope':_0x49c4a7(0xfc),'operation':_0x2e0b5a,'selector':{'appCode':_0x27a344,'roleId':_0x25fdb1['id'],'roleName':_0x25fdb1[_0x49c4a7(0x104)],'userId':_0x10092f[_0x49c4a7(0xc6)]},'before':{'userIds':_0x146762},'after':{'userIds':_0x550833},'dryRun':_0x26b519[_0x49c4a7(0xe3)],'backend':{'method':_0x49c4a7(0xd5),'path':_0x2e0b5a===_0x49c4a7(0xde)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1806bd};return{'mutation':_0x5b712b,'changed':_0x4a645d,'matchingRelationIds':_0x50f497};}export async function loadDevRoleRelations(_0x524cad,_0x306480){const _0x503fcb=a178_0x2245a4,_0x5ae35a=0x64,_0x2cc7ce=[];for(let _0x2b8627=0x1;;_0x2b8627+=0x1){const {items:_0x51f44c,paging:_0x545cf2}=await listDevUserRoleRelations(_0x524cad,{'roleId':_0x306480,'currentPage':_0x2b8627,'pageSize':_0x5ae35a});_0x2cc7ce['push'](..._0x51f44c);if(_0x51f44c['length']<_0x5ae35a||_0x545cf2&&_0x2cc7ce[_0x503fcb(0xc8)]>=_0x545cf2[_0x503fcb(0xe2)])return _0x2cc7ce;}}function a178_0x53e1(_0xbdb43d,_0x22b739){_0xbdb43d=_0xbdb43d-0xb5;const _0x5a318a=a178_0x5a31();let _0x53e1ad=_0x5a318a[_0xbdb43d];return _0x53e1ad;}export function readRoleRef(_0x25d18f){const _0x3a60d0=a178_0x2245a4,_0x377914=_0x25d18f[_0x3a60d0(0xc9)](_0x3a60d0(0x107))[_0x3a60d0(0xdc)]();if(!_0x377914)throw CliErrors[_0x3a60d0(0xb5)](_0x3a60d0(0x107),_0x3a60d0(0x103));return _0x377914;}export async function prepareUserMutation(_0x3bd98d,_0x3429ff,_0x1f7cbc){const _0x2289d5=a178_0x2245a4,_0x57500a=readRoleRef(_0x3bd98d),_0x2b6284=_0x3bd98d[_0x2289d5(0xc9)](_0x2289d5(0xeb))[_0x2289d5(0xdc)]();if(!_0x2b6284)throw CliErrors[_0x2289d5(0xb5)]('user','Pass\x20--user\x20<id|name>.');const _0x14f532=_0x3bd98d[_0x2289d5(0xd0)]('expect-user-count'),_0xd47555=_0x14f532===undefined||_0x14f532===null?undefined:Number(_0x14f532),_0x4ef455=await resolveRoleRef(_0x3bd98d[_0x2289d5(0xd9)],_0x57500a);if(_0x4ef455['roleType']==='OWNER')throw CliErrors[_0x2289d5(0xd2)](_0x2289d5(0x100)+_0x3429ff+_0x2289d5(0xf7),_0x2289d5(0xe9));const _0x391be5=await resolveUserRef(_0x2b6284),_0x514186=await loadDevRoleRelations(_0x3bd98d[_0x2289d5(0xd9)],_0x4ef455['id']);return{...computeRoleUserMutation({'operation':_0x3429ff,'appCode':_0x3bd98d[_0x2289d5(0xd9)],'role':_0x4ef455,'relations':_0x514186,'user':{'userId':_0x391be5['userId'],'username':_0x391be5[_0x2289d5(0x105)],'nickname':_0x391be5[_0x2289d5(0xd8)]},'dryRun':_0x1f7cbc,..._0xd47555!==undefined?{'expectUserCount':_0xd47555}:{}}),'role':_0x4ef455,'user':_0x391be5};}
|
|
1
|
+
const a178_0x1bf84c=a178_0x1c5d;(function(_0x555d14,_0x3e5b74){const _0x4f744b=a178_0x1c5d,_0x377e63=_0x555d14();while(!![]){try{const _0x30da00=parseInt(_0x4f744b(0x188))/0x1*(-parseInt(_0x4f744b(0x160))/0x2)+parseInt(_0x4f744b(0x185))/0x3+parseInt(_0x4f744b(0x17d))/0x4+parseInt(_0x4f744b(0x15c))/0x5*(parseInt(_0x4f744b(0x16b))/0x6)+parseInt(_0x4f744b(0x157))/0x7+parseInt(_0x4f744b(0x167))/0x8+-parseInt(_0x4f744b(0x178))/0x9;if(_0x30da00===_0x3e5b74)break;else _0x377e63['push'](_0x377e63['shift']());}catch(_0x4afdd0){_0x377e63['push'](_0x377e63['shift']());}}}(a178_0x5236,0xde3dd));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a178_0x5236(){const _0x155656=['Role\x20id\x20','\x20members\x20of\x20the\x20OWNER\x20role.','Optional\x20role\x20remark/description','flagMissing','User\x20','number','Missing\x20role\x20reference.','Anti-drift\x20check\x20failed:\x20expected\x20','str','trim','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','totalCount',';\x20no\x20change.','filter','\x20is\x20not\x20a\x20member\x20of\x20role\x20','592172SbRnjs','\x20not\x20found\x20in\x20app\x20','\x22\x20is\x20ambiguous\x20(ids:\x20','toLowerCase','expect-user-count','4110515JJQOgP','validation','nickname','CUSTOM','1532956meFUTj','Missing\x20user\x20reference.','find','Check\x20the\x20nickname/username.\x20','user-add','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','13785584DGDUIL','ADMIN','roleType','\x20duplicate\x20memberships\x20for\x20user\x20','12mRqyGf','name','push','Cannot\x20','Disambiguate\x20with\x20--role\x20<id>.','tenant_code','Role\x20id\x20(from\x20`role\x20list`)','\x20member(s)\x20but\x20role\x20has\x20','string','role','/smartapi/permit/user-role/create','permitCount','Pass\x20--role\x20<id|name>.','24434721yTHXBb','expectUserCount','Role\x20id\x20or\x20exact\x20role\x20name','userId','Pass\x20--user\x20<id|name>.','3660656JYqbsU','authRequired','user','OWNER','includes','dryRun','map','flag','2373186SVgcgr','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Pass\x20--user\x20<id>.','2DHrQNC','userCount','tenant','username','appCode','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Role\x20name\x20\x22','roleName','remark','test','length','/smartapi/permit/user-role/delete'];a178_0x5236=function(){return _0x155656;};return a178_0x5236();}export const ROLE_ID_FLAG={'name':'id','type':a178_0x1bf84c(0x14c),'required':!![],'description':a178_0x1bf84c(0x171)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a178_0x1bf84c(0x17a)};export const USER_REF_FLAG={'name':'user','type':'string','required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a178_0x1bf84c(0x16c),'type':a178_0x1bf84c(0x173),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a178_0x1bf84c(0x16c),'type':a178_0x1bf84c(0x173),'required':!![],'description':a178_0x1bf84c(0x186)};export const REMARK_FLAG={'name':a178_0x1bf84c(0x143),'type':'string','required':![],'description':a178_0x1bf84c(0x149)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a178_0x1bf84c(0x14c),'required':![],'description':a178_0x1bf84c(0x165)};export const BUILTIN_ROLE_TYPES=[a178_0x1bf84c(0x168),'DEV','OWNER'];export function isBuiltinRole(_0x3d5fe2){const _0x516e9b=a178_0x1bf84c;return BUILTIN_ROLE_TYPES[_0x516e9b(0x181)](_0x3d5fe2);}export function assertCustomRole(_0x749aa7,_0x2c2b29){const _0xcf551f=a178_0x1bf84c;if(_0x749aa7[_0xcf551f(0x169)]!==_0xcf551f(0x15f))throw CliErrors[_0xcf551f(0x15d)]('Cannot\x20'+_0x2c2b29+'\x20built-in\x20role\x20'+_0x749aa7['roleName']+'\x20('+_0x749aa7['roleType']+').',_0xcf551f(0x18d));}export function projectRole(_0x1b0b34){const _0x3f5373=a178_0x1bf84c;return{'id':_0x1b0b34['id'],'roleName':_0x1b0b34[_0x3f5373(0x142)],'roleType':_0x1b0b34['roleType'],'remark':_0x1b0b34[_0x3f5373(0x143)],'userCount':_0x1b0b34[_0x3f5373(0x189)],'permitCount':_0x1b0b34[_0x3f5373(0x176)],'builtin':isBuiltinRole(_0x1b0b34[_0x3f5373(0x169)])};}export async function resolveRoleRef(_0x348cd8,_0x51190b){const _0x1f613a=a178_0x1bf84c,_0xeb4715=_0x51190b[_0x1f613a(0x150)]();if(!_0xeb4715)throw CliErrors['validation'](_0x1f613a(0x14d),_0x1f613a(0x177));if(/^\d+$/[_0x1f613a(0x144)](_0xeb4715))return getRoleById(_0x348cd8,Number(_0xeb4715));const _0x3ec2d7=await listAllAppRoles(_0x348cd8),_0x1086fb=_0x3ec2d7[_0x1f613a(0x155)](_0x5196d2=>_0x5196d2[_0x1f613a(0x142)]===_0xeb4715);if(_0x1086fb['length']===0x0)throw CliErrors[_0x1f613a(0x15d)](_0x1f613a(0x141)+_0xeb4715+'\x22\x20not\x20found\x20in\x20app\x20'+_0x348cd8+'.',_0x1f613a(0x152));if(_0x1086fb[_0x1f613a(0x145)]>0x1){const _0x10af14=_0x1086fb[_0x1f613a(0x183)](_0x2f8573=>_0x2f8573['id'])['join'](',\x20');throw CliErrors[_0x1f613a(0x15d)]('Role\x20name\x20\x22'+_0xeb4715+_0x1f613a(0x159)+_0x10af14+').',_0x1f613a(0x16f));}return _0x1086fb[0x0];}export async function getRoleById(_0x4704ac,_0x4ef812){const _0x49c92a=a178_0x1bf84c,_0x1b94bd=await listAllAppRoles(_0x4704ac),_0x1d9128=_0x1b94bd['filter'](_0xcd5507=>_0xcd5507['id']===_0x4ef812&&(!_0xcd5507[_0x49c92a(0x18c)]||_0xcd5507[_0x49c92a(0x18c)]===_0x4704ac));if(_0x1d9128[_0x49c92a(0x145)]!==0x1)throw CliErrors[_0x49c92a(0x15d)](_0x49c92a(0x147)+_0x4ef812+_0x49c92a(0x158)+_0x4704ac+'.',_0x49c92a(0x166));return _0x1d9128[0x0];}async function listAllAppRoles(_0x57151f){const _0x3deaf6=a178_0x1bf84c,_0x2bfc2e=0x64,_0x2b667f=[];for(let _0x9f84fb=0x1;;_0x9f84fb+=0x1){const {items:_0x5d1af2,paging:_0x5924a2}=await listAppRoles(_0x57151f,{'currentPage':_0x9f84fb,'pageSize':_0x2bfc2e});_0x2b667f[_0x3deaf6(0x16d)](..._0x5d1af2);if(_0x5d1af2[_0x3deaf6(0x145)]<_0x2bfc2e||_0x5924a2&&_0x2b667f[_0x3deaf6(0x145)]>=_0x5924a2[_0x3deaf6(0x153)])return _0x2b667f;}}export async function resolveTenantCode(){const _0x2c9566=a178_0x1bf84c,_0x38e360=await getSessionUserInfo(),_0x443903=_0x38e360?.[_0x2c9566(0x17f)]?.[_0x2c9566(0x18a)]?.[_0x2c9566(0x170)];if(!_0x443903)throw CliErrors[_0x2c9566(0x17e)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x443903;}function a178_0x1c5d(_0x497bd2,_0x6f48fe){_0x497bd2=_0x497bd2-0x141;const _0x5236cc=a178_0x5236();let _0x1c5db1=_0x5236cc[_0x497bd2];return _0x1c5db1;}function matchMember(_0x4e176c,_0x300b28){const _0x41e5ba=a178_0x1bf84c,_0x7c3098=_0x300b28['trim']()[_0x41e5ba(0x15a)]();return(_0x4e176c[_0x41e5ba(0x15e)]??'')[_0x41e5ba(0x15a)]()===_0x7c3098||(_0x4e176c[_0x41e5ba(0x18b)]??'')['toLowerCase']()===_0x7c3098;}export async function resolveUserRef(_0x2eab44,_0x3474c5=a178_0x1bf84c(0x187)){const _0x1eb35b=a178_0x1bf84c,_0x1bfd4f=_0x2eab44['trim']();if(!_0x1bfd4f)throw CliErrors['validation'](_0x1eb35b(0x161),'Pass\x20--user\x20<id|name>.');const _0x3a0ee4=await resolveTenantCode(),_0x2272c6=await getTenantMembers(_0x3a0ee4);if(/^\d+$/[_0x1eb35b(0x144)](_0x1bfd4f)){const _0x36d6b5=Number(_0x1bfd4f),_0x1d05a7=_0x2272c6[_0x1eb35b(0x162)](_0x15ae4b=>_0x15ae4b[_0x1eb35b(0x17b)]===_0x36d6b5);return{'userId':_0x36d6b5,'username':_0x1d05a7?.[_0x1eb35b(0x18b)]??String(_0x36d6b5),'nickname':_0x1d05a7?.[_0x1eb35b(0x15e)],'matchedBy':'id'};}const _0x1357eb=_0x2272c6[_0x1eb35b(0x155)](_0x2333b2=>matchMember(_0x2333b2,_0x1bfd4f));if(_0x1357eb[_0x1eb35b(0x145)]===0x0)throw CliErrors[_0x1eb35b(0x15d)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x1bfd4f+'\x22.',_0x1eb35b(0x163)+_0x3474c5);if(_0x1357eb[_0x1eb35b(0x145)]>0x1){const _0x26d64e=_0x1357eb[_0x1eb35b(0x183)](_0x388ef1=>(_0x388ef1[_0x1eb35b(0x15e)]??_0x388ef1[_0x1eb35b(0x18b)]??'?')+'('+_0x388ef1['userId']+')')['join'](',\x20');throw CliErrors[_0x1eb35b(0x15d)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x1bfd4f+'\x22:\x20'+_0x26d64e+'.',_0x3474c5);}const _0x216489=_0x1357eb[0x0];return{'userId':_0x216489['userId'],'username':_0x216489[_0x1eb35b(0x18b)]??String(_0x216489[_0x1eb35b(0x17b)]),'nickname':_0x216489[_0x1eb35b(0x15e)],'matchedBy':_0x1eb35b(0x16c)};}export const CREATE_USER_ROLE_PATH=a178_0x1bf84c(0x175);export const DELETE_USER_ROLE_PATH=a178_0x1bf84c(0x146);export function computeRoleUserMutation(_0x3300ed){const _0x1d090b=a178_0x1bf84c,{operation:_0x4d977b,appCode:_0x2d6b92,role:_0x112f95,relations:_0x237d4b,user:_0x2c697a}=_0x3300ed,_0x4598c5=[...new Set(_0x237d4b[_0x1d090b(0x183)](_0x419afe=>_0x419afe[_0x1d090b(0x17b)]))],_0x36192d=[];if(_0x3300ed[_0x1d090b(0x179)]!==undefined&&_0x3300ed[_0x1d090b(0x179)]!==_0x4598c5['length'])throw CliErrors[_0x1d090b(0x15d)](_0x1d090b(0x14e)+_0x3300ed[_0x1d090b(0x179)]+_0x1d090b(0x172)+_0x4598c5[_0x1d090b(0x145)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x9cbea=_0x4598c5[_0x1d090b(0x181)](_0x2c697a[_0x1d090b(0x17b)]),_0x3b7c75=_0x237d4b[_0x1d090b(0x155)](_0x3992c9=>_0x3992c9[_0x1d090b(0x17b)]===_0x2c697a[_0x1d090b(0x17b)])['map'](_0xea21f3=>_0xea21f3['id']),_0x5b2ee0=_0x4d977b===_0x1d090b(0x164)?!_0x9cbea:_0x9cbea;let _0x164d4c=_0x4598c5;_0x4d977b===_0x1d090b(0x164)?_0x9cbea?_0x36192d[_0x1d090b(0x16d)]('User\x20'+_0x2c697a['userId']+_0x1d090b(0x151)+_0x112f95[_0x1d090b(0x142)]+_0x1d090b(0x154)):_0x164d4c=[..._0x4598c5,_0x2c697a[_0x1d090b(0x17b)]]:!_0x9cbea?_0x36192d[_0x1d090b(0x16d)](_0x1d090b(0x14b)+_0x2c697a[_0x1d090b(0x17b)]+_0x1d090b(0x156)+_0x112f95[_0x1d090b(0x142)]+_0x1d090b(0x154)):(_0x164d4c=_0x4598c5['filter'](_0x41b886=>_0x41b886!==_0x2c697a[_0x1d090b(0x17b)]),_0x3b7c75[_0x1d090b(0x145)]>0x1&&_0x36192d[_0x1d090b(0x16d)]('Removed\x20'+_0x3b7c75[_0x1d090b(0x145)]+_0x1d090b(0x16a)+_0x2c697a['userId']+'.'));const _0x5436ef={'scope':'dev','operation':_0x4d977b,'selector':{'appCode':_0x2d6b92,'roleId':_0x112f95['id'],'roleName':_0x112f95['roleName'],'userId':_0x2c697a[_0x1d090b(0x17b)]},'before':{'userIds':_0x4598c5},'after':{'userIds':_0x164d4c},'dryRun':_0x3300ed[_0x1d090b(0x182)],'backend':{'method':'POST','path':_0x4d977b===_0x1d090b(0x164)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x36192d};return{'mutation':_0x5436ef,'changed':_0x5b2ee0,'matchingRelationIds':_0x3b7c75};}export async function loadDevRoleRelations(_0x4af39a,_0x549706){const _0x48696b=a178_0x1bf84c,_0x523797=0x64,_0x25c6ed=[];for(let _0x648f0e=0x1;;_0x648f0e+=0x1){const {items:_0x1df40b,paging:_0x537c45}=await listDevUserRoleRelations(_0x4af39a,{'roleId':_0x549706,'currentPage':_0x648f0e,'pageSize':_0x523797});_0x25c6ed[_0x48696b(0x16d)](..._0x1df40b);if(_0x1df40b[_0x48696b(0x145)]<_0x523797||_0x537c45&&_0x25c6ed['length']>=_0x537c45[_0x48696b(0x153)])return _0x25c6ed;}}export function readRoleRef(_0x683bcb){const _0x556505=a178_0x1bf84c,_0x847bfe=_0x683bcb[_0x556505(0x14f)](_0x556505(0x174))[_0x556505(0x150)]();if(!_0x847bfe)throw CliErrors[_0x556505(0x14a)](_0x556505(0x174),_0x556505(0x177));return _0x847bfe;}export async function prepareUserMutation(_0x292442,_0x261321,_0x26f083){const _0x53bf73=a178_0x1bf84c,_0x474bad=readRoleRef(_0x292442),_0x1c8d70=_0x292442[_0x53bf73(0x14f)](_0x53bf73(0x17f))[_0x53bf73(0x150)]();if(!_0x1c8d70)throw CliErrors[_0x53bf73(0x14a)]('user',_0x53bf73(0x17c));const _0x1d4645=_0x292442[_0x53bf73(0x184)](_0x53bf73(0x15b)),_0xf2d283=_0x1d4645===undefined||_0x1d4645===null?undefined:Number(_0x1d4645),_0x132f81=await resolveRoleRef(_0x292442[_0x53bf73(0x18c)],_0x474bad);if(_0x132f81['roleType']===_0x53bf73(0x180))throw CliErrors[_0x53bf73(0x15d)](_0x53bf73(0x16e)+_0x261321+_0x53bf73(0x148),'Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x4df3c2=await resolveUserRef(_0x1c8d70),_0x4569d1=await loadDevRoleRelations(_0x292442[_0x53bf73(0x18c)],_0x132f81['id']);return{...computeRoleUserMutation({'operation':_0x261321,'appCode':_0x292442[_0x53bf73(0x18c)],'role':_0x132f81,'relations':_0x4569d1,'user':{'userId':_0x4df3c2['userId'],'username':_0x4df3c2[_0x53bf73(0x18b)],'nickname':_0x4df3c2[_0x53bf73(0x15e)]},'dryRun':_0x26f083,..._0xf2d283!==undefined?{'expectUserCount':_0xf2d283}:{}}),'role':_0x132f81,'user':_0x4df3c2};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x5abfc8=a179_0x1919;(function(_0x122ebd,_0xbc74d9){const _0x357a24=a179_0x1919,_0x13d3ed=_0x122ebd();while(!![]){try{const _0x14dc03=-parseInt(_0x357a24(0xbb))/0x1+parseInt(_0x357a24(0xc5))/0x2+-parseInt(_0x357a24(0xc6))/0x3*(-parseInt(_0x357a24(0xc1))/0x4)+parseInt(_0x357a24(0xbe))/0x5*(-parseInt(_0x357a24(0xb0))/0x6)+parseInt(_0x357a24(0xc9))/0x7+-parseInt(_0x357a24(0xbc))/0x8*(-parseInt(_0x357a24(0xb2))/0x9)+-parseInt(_0x357a24(0xba))/0xa;if(_0x14dc03===_0xbc74d9)break;else _0x13d3ed['push'](_0x13d3ed['shift']());}catch(_0x5a7015){_0x13d3ed['push'](_0x13d3ed['shift']());}}}(a179_0x2eab,0xd912f));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a179_0x2eab(){const _0x51674d=['validation','2718420LrGJlk','1454591hVaHss','168648PCiFVO','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','266945ZNjeYI','update','appCode','609624KloLtI','dev','Updated\x20role\x20','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','3282206KDuHKh','21rKzeZK','trim','New\x20role\x20name','8253735BtKZPh','flag','name','150DIwcKy','roleName','27qjgKdi','num','--name\x20cannot\x20be\x20empty.','string','length','POST','remark'];a179_0x2eab=function(){return _0x51674d;};return a179_0x2eab();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function a179_0x1919(_0x122b74,_0x1b5b2d){_0x122b74=_0x122b74-0xae;const _0x2eab75=a179_0x2eab();let _0x1919ad=_0x2eab75[_0x122b74];return _0x1919ad;}function readPatch(_0x5929cb){const _0x235f06=a179_0x1919,_0x1c0a12=_0x5929cb[_0x235f06(0xae)](_0x235f06(0xaf)),_0x3d5a30=_0x5929cb['flag'](_0x235f06(0xb8)),_0x16c551={};if(_0x1c0a12!==undefined&&_0x1c0a12!==null){const _0x30b982=String(_0x1c0a12)[_0x235f06(0xc7)]();if(!_0x30b982)throw CliErrors[_0x235f06(0xb9)](_0x235f06(0xb4));if(_0x30b982[_0x235f06(0xb6)]>0x40)throw CliErrors[_0x235f06(0xb9)](_0x235f06(0xc4));_0x16c551[_0x235f06(0xb1)]=_0x30b982;}_0x3d5a30!==undefined&&_0x3d5a30!==null&&(_0x16c551['remark']=String(_0x3d5a30));if(_0x16c551[_0x235f06(0xb1)]===undefined&&_0x16c551[_0x235f06(0xb8)]===undefined)throw CliErrors['validation']('Nothing\x20to\x20update.','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x16c551;}export const roleUpdate={'service':'role','command':'update','description':a179_0x5abfc8(0xbd),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a179_0x5abfc8(0xb5),'required':![],'description':a179_0x5abfc8(0xc8)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2053ed){readPatch(_0x2053ed);},async 'dryRun'(_0xaf197f){const _0x1bfd7a=a179_0x5abfc8,_0x5f370b=_0xaf197f['num']('id'),_0x2cad7b=readPatch(_0xaf197f),_0x502f6e=await getRoleById(_0xaf197f['appCode'],_0x5f370b);return assertCustomRole(_0x502f6e,'update'),asDryRunResult({'scope':'dev','operation':_0x1bfd7a(0xbf),'selector':{'appCode':_0xaf197f[_0x1bfd7a(0xc0)],'roleId':_0x5f370b,'roleName':_0x502f6e['roleName']},'before':projectRole(_0x502f6e),'after':projectRole({..._0x502f6e,..._0x2cad7b[_0x1bfd7a(0xb1)]!==undefined?{'roleName':_0x2cad7b[_0x1bfd7a(0xb1)]}:{},..._0x2cad7b[_0x1bfd7a(0xb8)]!==undefined?{'remark':_0x2cad7b[_0x1bfd7a(0xb8)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x1bfd7a(0xb7),'url':UPDATE_PATH});},async 'execute'(_0x24834f){const _0x529b91=a179_0x5abfc8,_0x21466b=_0x24834f[_0x529b91(0xb3)]('id'),_0x1b9798=readPatch(_0x24834f),_0x58a891=await getRoleById(_0x24834f['appCode'],_0x21466b);assertCustomRole(_0x58a891,'update'),await updateAppRole({'id':_0x21466b,'appCode':_0x24834f[_0x529b91(0xc0)],..._0x1b9798[_0x529b91(0xb1)]!==undefined?{'roleName':_0x1b9798['roleName']}:{},..._0x1b9798[_0x529b91(0xb8)]!==undefined?{'remark':_0x1b9798[_0x529b91(0xb8)]}:{}});const _0x453ef3=await getRoleById(_0x24834f[_0x529b91(0xc0)],_0x21466b);return{'ok':!![],'data':{'scope':_0x529b91(0xc2),'operation':_0x529b91(0xbf),'selector':{'appCode':_0x24834f[_0x529b91(0xc0)],'roleId':_0x21466b,'roleName':_0x453ef3[_0x529b91(0xb1)]},'before':projectRole(_0x58a891),'after':projectRole(_0x453ef3),'dryRun':![],'backend':{'method':_0x529b91(0xb7),'path':UPDATE_PATH},'warnings':[]},'message':_0x529b91(0xc3)+_0x453ef3[_0x529b91(0xb1)]+'\x20(id='+_0x21466b+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x9a0b79=a180_0x5699;(function(_0x2da9c3,_0x51d79a){const _0x2871ca=a180_0x5699,_0x5a3aba=_0x2da9c3();while(!![]){try{const _0x34923d=-parseInt(_0x2871ca(0xe0))/0x1*(-parseInt(_0x2871ca(0xd5))/0x2)+-parseInt(_0x2871ca(0xdb))/0x3+parseInt(_0x2871ca(0xd8))/0x4+parseInt(_0x2871ca(0xd7))/0x5+parseInt(_0x2871ca(0xe6))/0x6*(-parseInt(_0x2871ca(0xec))/0x7)+parseInt(_0x2871ca(0xe4))/0x8*(parseInt(_0x2871ca(0xdf))/0x9)+-parseInt(_0x2871ca(0xda))/0xa*(parseInt(_0x2871ca(0xe9))/0xb);if(_0x34923d===_0x51d79a)break;else _0x5a3aba['push'](_0x5a3aba['shift']());}catch(_0xcb90a0){_0x5a3aba['push'](_0x5a3aba['shift']());}}}(a180_0x3076,0x26975));import{createDevUserRole}from'../../core/api-client.js';function a180_0x5699(_0x2ad421,_0x514419){_0x2ad421=_0x2ad421-0xd4;const _0x307689=a180_0x3076();let _0x569984=_0x307689[_0x2ad421];return _0x569984;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a180_0x3076(){const _0x1ea2d7=['userId','Added\x20user\x20','14zqxikM','appCode','91538UEfZqT','username','1306175EjyICI','1147760OghNdE','roleType','270YNvjXp','537774aoMXWC','POST','\x20already\x20in\x20role\x20','user-add','4302xidWJZ','4HdJDCS','roleId','role','No\x20change:\x20user\x20','232hOJdEs','high-risk-write','529026NNGdRE','selector','roleName','94292HydGvr'];a180_0x3076=function(){return _0x1ea2d7;};return a180_0x3076();}export const roleUserAdd={'service':a180_0x9a0b79(0xe2),'command':a180_0x9a0b79(0xde),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a180_0x9a0b79(0xe5),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5de45d){const _0x471952=a180_0x9a0b79,{mutation:_0x20a101}=await prepareUserMutation(_0x5de45d,'user-add',!![]);return asDryRunResult(_0x20a101,{'method':_0x471952(0xdc),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x3af5d5){const _0x2041a5=a180_0x9a0b79,{mutation:_0x408350,changed:_0x3c3257,role:_0x4c7e6b,user:_0x5269ab}=await prepareUserMutation(_0x3af5d5,_0x2041a5(0xde),![]);return _0x3c3257&&await createDevUserRole({'appCode':_0x3af5d5[_0x2041a5(0xd4)],'userId':_0x5269ab[_0x2041a5(0xea)],'username':_0x5269ab[_0x2041a5(0xd6)],'roleType':_0x4c7e6b[_0x2041a5(0xd9)],'roleId':_0x408350[_0x2041a5(0xe7)][_0x2041a5(0xe1)]}),{'ok':!![],'data':_0x408350,'message':_0x3c3257?_0x2041a5(0xeb)+_0x408350[_0x2041a5(0xe7)][_0x2041a5(0xea)]+'\x20to\x20role\x20'+_0x408350[_0x2041a5(0xe7)]['roleName']:_0x2041a5(0xe3)+_0x408350[_0x2041a5(0xe7)]['userId']+_0x2041a5(0xdd)+_0x408350[_0x2041a5(0xe7)][_0x2041a5(0xe8)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x2db40e=a181_0x1713;(function(_0x3fa9ad,_0x123e52){const _0x190c77=a181_0x1713,_0x5a986e=_0x3fa9ad();while(!![]){try{const _0x3ae059=parseInt(_0x190c77(0x188))/0x1+-parseInt(_0x190c77(0x181))/0x2+parseInt(_0x190c77(0x180))/0x3*(parseInt(_0x190c77(0x187))/0x4)+parseInt(_0x190c77(0x17f))/0x5*(parseInt(_0x190c77(0x184))/0x6)+parseInt(_0x190c77(0x18a))/0x7+-parseInt(_0x190c77(0x18c))/0x8*(parseInt(_0x190c77(0x189))/0x9)+-parseInt(_0x190c77(0x182))/0xa;if(_0x3ae059===_0x123e52)break;else _0x5a986e['push'](_0x5a986e['shift']());}catch(_0x4ae341){_0x5a986e['push'](_0x5a986e['shift']());}}}(a181_0x5c3e,0x2ef2a));function a181_0x5c3e(){const _0x1602ec=['No\x20change:\x20user\x20','selector','roleName','65SEjdSd','57bImvVZ','305094DwstPk','621410slroVK','POST','136002qjmmwx','user-remove','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','27932FbktSt','160945ZoRGSU','2873241gyExsm','965594ZHRBLg','Removed\x20user\x20','8eTkhXT'];a181_0x5c3e=function(){return _0x1602ec;};return a181_0x5c3e();}import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a181_0x1713(_0x18b4f8,_0x6516ff){_0x18b4f8=_0x18b4f8-0x17d;const _0x5c3ef6=a181_0x5c3e();let _0x171369=_0x5c3ef6[_0x18b4f8];return _0x171369;}export const roleUserRemove={'service':'role','command':'user-remove','description':a181_0x2db40e(0x186),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x411ec8){const _0x119035=a181_0x2db40e,{mutation:_0x14a978}=await prepareUserMutation(_0x411ec8,_0x119035(0x185),!![]);return asDryRunResult(_0x14a978,{'method':_0x119035(0x183),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x16f8da){const _0x328b2b=a181_0x2db40e,{matchingRelationIds:_0x187f71,mutation:_0x388dd5,changed:_0x32be71}=await prepareUserMutation(_0x16f8da,'user-remove',![]);if(_0x32be71)for(const _0x2023a5 of _0x187f71){await deleteDevUserRole(_0x2023a5);}return{'ok':!![],'data':_0x388dd5,'message':_0x32be71?_0x328b2b(0x18b)+_0x388dd5[_0x328b2b(0x17d)]['userId']+'\x20from\x20role\x20'+_0x388dd5[_0x328b2b(0x17d)][_0x328b2b(0x17e)]:_0x328b2b(0x18d)+_0x388dd5[_0x328b2b(0x17d)]['userId']+'\x20not\x20in\x20role\x20'+_0x388dd5[_0x328b2b(0x17d)][_0x328b2b(0x17e)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a182_0x21e074=a182_0x5a7e;(function(_0xef7313,_0x1ff7a8){const _0x2081ce=a182_0x5a7e,_0x50859d=_0xef7313();while(!![]){try{const _0x15b0d=-parseInt(_0x2081ce(0xf4))/0x1*(parseInt(_0x2081ce(0xe7))/0x2)+-parseInt(_0x2081ce(0xfc))/0x3*(parseInt(_0x2081ce(0xfb))/0x4)+parseInt(_0x2081ce(0xf0))/0x5*(parseInt(_0x2081ce(0xee))/0x6)+-parseInt(_0x2081ce(0xf6))/0x7*(-parseInt(_0x2081ce(0xf2))/0x8)+parseInt(_0x2081ce(0xe8))/0x9+-parseInt(_0x2081ce(0xe9))/0xa*(-parseInt(_0x2081ce(0xfd))/0xb)+parseInt(_0x2081ce(0xea))/0xc*(-parseInt(_0x2081ce(0xe5))/0xd);if(_0x15b0d===_0x1ff7a8)break;else _0x50859d['push'](_0x50859d['shift']());}catch(_0x14e9bd){_0x50859d['push'](_0x50859d['shift']());}}}(a182_0x4fed,0xb0334));import{CliErrors}from'../../errors.js';function a182_0x4fed(){const _0x54431a=['6vIipqG','role','6377780yUltTe','user-resolve','16pzBCfH','userId','5mCoGEW','Pass\x20--name\x20<nickname|username>.','2179387UbhmVi','nickname','trim','flagMissing','matchedBy','303528hBxQuB','3ppJJze','234652YuWVbY','13ulNVdg','str','445196PNqlIk','10098495GVATyM','340JywvaW','22019916ZpoXwA','read','username','name'];a182_0x4fed=function(){return _0x54431a;};return a182_0x4fed();}function a182_0x5a7e(_0xc15b27,_0x4a7bf6){_0xc15b27=_0xc15b27-0xe5;const _0x4fed62=a182_0x4fed();let _0x5a7e94=_0x4fed62[_0xc15b27];return _0x5a7e94;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a182_0x21e074(0xef),'command':a182_0x21e074(0xf1),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a182_0x21e074(0xeb),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2c8f46){const _0x5e4490=a182_0x21e074;if(!_0x2c8f46[_0x5e4490(0xe6)](_0x5e4490(0xed))[_0x5e4490(0xf8)]())throw CliErrors[_0x5e4490(0xf9)]('name',_0x5e4490(0xf5));},async 'execute'(_0x1f1f0b){const _0x458afb=a182_0x21e074,_0x4682fd=_0x1f1f0b[_0x458afb(0xe6)](_0x458afb(0xed))[_0x458afb(0xf8)](),_0x3e480c=await resolveUserRef(_0x4682fd,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x3e480c[_0x458afb(0xf3)],'username':_0x3e480c[_0x458afb(0xec)],'nickname':_0x3e480c[_0x458afb(0xf7)],'matchedBy':_0x3e480c[_0x458afb(0xfa)]}},'message':'Resolved\x20\x22'+_0x4682fd+'\x22\x20→\x20userId\x20'+_0x3e480c[_0x458afb(0xf3)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x5b0922=a183_0x16d9;function a183_0x4092(){const _0x26011c=['start','Enable\x20watch\x20mode\x20for\x20preview','80952uOwWek','9EzLSFW','close','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','boolean','\x20run\x20start','join','Script\x20name\x20defined\x20in\x20package.json','\x20run\x20preview','\x20run\x20preview\x20--watch','pnpm-lock.yaml','21642VzIoPd','\x22\x20not\x20found\x20in\x20package.json.','belowMinimum','\x20\x20EXAMPLES','bun.lockb','args','inherit','Available:\x20','length','node_modules','package.json','33VHszWS','--watch','8790310NxdHEV','error','36NebpUJ','35ELiKdU','\x20run\x20<script>\x0a','push','needsUpgrade','keys','.bin','scripts','No\x20scripts\x20defined\x20in\x20package.json.','yarn','preview','vite','9067408RXwUAz','parse','validation','watch','slice','542040ssNOIH','log','write','dev','Script\x20\x22','312780VVhAfv','all','\x20\x20\x20\x20','2114qXtKVs','bool','22518108ebuWwF','build','run'];a183_0x4092=function(){return _0x26011c;};return a183_0x4092();}(function(_0x1f61b3,_0xfe3456){const _0x26c9bf=a183_0x16d9,_0x1f46fe=_0x1f61b3();while(!![]){try{const _0x5b84c6=-parseInt(_0x26c9bf(0x134))/0x1+parseInt(_0x26c9bf(0x13e))/0x2*(-parseInt(_0x26c9bf(0x158))/0x3)+-parseInt(_0x26c9bf(0x169))/0x4*(parseInt(_0x26c9bf(0x159))/0x5)+parseInt(_0x26c9bf(0x149))/0x6*(-parseInt(_0x26c9bf(0x137))/0x7)+-parseInt(_0x26c9bf(0x164))/0x8+-parseInt(_0x26c9bf(0x13f))/0x9*(parseInt(_0x26c9bf(0x156))/0xa)+-parseInt(_0x26c9bf(0x154))/0xb*(-parseInt(_0x26c9bf(0x139))/0xc);if(_0x5b84c6===_0xfe3456)break;else _0x1f46fe['push'](_0x1f46fe['shift']());}catch(_0x3217a8){_0x1f46fe['push'](_0x1f46fe['shift']());}}}(a183_0x4092,0xbe996));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a183_0x16d9(_0x3005e3,_0x5588e0){_0x3005e3=_0x3005e3-0x131;const _0x4092d2=a183_0x4092();let _0x16d92a=_0x4092d2[_0x3005e3];return _0x16d92a;}import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a183_0x5b0922(0x13c),a183_0x5b0922(0x132)]);function readPackageScripts(_0x129057){const _0x449e71=a183_0x5b0922,_0xa403f4=resolve(_0x129057,_0x449e71(0x153));if(!existsSync(_0xa403f4))return null;try{const _0x3af487=JSON[_0x449e71(0x165)](readFileSync(_0xa403f4,'utf-8'));return _0x3af487[_0x449e71(0x15f)]??{};}catch{return null;}}function detectPackageManager(_0x28ef96){const _0x2a58d3=a183_0x5b0922;if(existsSync(resolve(_0x28ef96,_0x2a58d3(0x14d)))||existsSync(resolve(_0x28ef96,'bun.lock')))return'bun';if(existsSync(resolve(_0x28ef96,_0x2a58d3(0x148))))return'pnpm';if(existsSync(resolve(_0x28ef96,'yarn.lock')))return _0x2a58d3(0x161);return'npm';}async function versionCheck(_0x67ed69){const _0x379569=a183_0x5b0922,_0x3998bb=await checkCliVersion();(_0x3998bb['needsUpgrade']||_0x3998bb[_0x379569(0x14b)])&&(printCliUpgradeWarning(_0x3998bb),assertCliVersionSupported(_0x3998bb));const _0x5ee6e5=await checkSdkVersion(_0x67ed69);if(_0x5ee6e5[_0x379569(0x15c)])printSdkUpgradeWarning(_0x5ee6e5);}function spawnScript(_0x518afd,_0x45ebca,_0x510253,_0x4a03ae){return new Promise((_0x1c1450,_0x2279fa)=>{const _0x28cf7f=a183_0x16d9,_0x2ea4c3=['run',_0x45ebca,..._0x510253],_0x4060d3=spawn(_0x518afd,_0x2ea4c3,{'cwd':_0x4a03ae,'stdio':_0x28cf7f(0x14f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4a03ae,_0x28cf7f(0x152),_0x28cf7f(0x15e))+delimiter+process.env.PATH}});_0x4060d3['on']('close',_0xaf50c3=>{if(_0xaf50c3===0x0||_0xaf50c3===null)_0x1c1450();else _0x2279fa(new Error(_0x518afd+'\x20run\x20'+_0x45ebca+'\x20exited\x20with\x20code\x20'+_0xaf50c3));}),_0x4060d3['on'](_0x28cf7f(0x157),_0x2279fa);});}function spawnViteBuildWatch(_0x321896){return new Promise((_0x3a7832,_0x109df4)=>{const _0x2d93eb=a183_0x16d9,_0xf03ade=spawn(_0x2d93eb(0x163),[_0x2d93eb(0x13a),_0x2d93eb(0x155)],{'cwd':_0x321896,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x321896,'node_modules',_0x2d93eb(0x15e))+delimiter+process.env.PATH}});_0xf03ade['on'](_0x2d93eb(0x140),_0x156772=>{const _0x3a6367=_0x2d93eb;if(_0x156772===0x0||_0x156772===null)_0x3a7832();else _0x109df4(new Error(_0x3a6367(0x141)+_0x156772));}),_0xf03ade['on']('error',_0x109df4);});}function spawnVitePreview(_0x59c2a6){return new Promise((_0x43a1fa,_0xc84201)=>{const _0x27e491=a183_0x16d9,_0x3794c4=spawn(_0x27e491(0x163),[_0x27e491(0x162)],{'cwd':_0x59c2a6,'stdio':_0x27e491(0x14f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x59c2a6,_0x27e491(0x152),'.bin')+delimiter+process.env.PATH}});_0x3794c4['on'](_0x27e491(0x140),_0xe7a640=>{if(_0xe7a640===0x0||_0xe7a640===null)_0x43a1fa();else _0xc84201(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0xe7a640));}),_0x3794c4['on']('error',_0xc84201);});}const runFlags=[{'name':'watch','type':a183_0x5b0922(0x142),'description':a183_0x5b0922(0x13d),'default':![]}];export const runDefinition={'service':a183_0x5b0922(0x13b),'command':a183_0x5b0922(0x13b),'description':'Run\x20a\x20package.json\x20script','risk':a183_0x5b0922(0x131),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a183_0x5b0922(0x145),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5a7e51=a183_0x5b0922,_0x218bec=[];return _0x218bec['push'](_0x5a7e51(0x14c)),_0x218bec['push'](_0x5a7e51(0x136)+CLI_BIN_NAME+_0x5a7e51(0x143)),_0x218bec['push'](_0x5a7e51(0x136)+CLI_BIN_NAME+'\x20run\x20build'),_0x218bec[_0x5a7e51(0x15b)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5a7e51(0x146)),_0x218bec['push'](_0x5a7e51(0x136)+CLI_BIN_NAME+_0x5a7e51(0x147)),_0x218bec[_0x5a7e51(0x144)]('\x0a');},async 'execute'(_0x4f24ae){const _0x15473a=a183_0x5b0922,_0x23001c=process['cwd'](),_0x6ee3e1=_0x4f24ae[_0x15473a(0x14e)][0x0],_0x3bc851=_0x4f24ae[_0x15473a(0x14e)][_0x15473a(0x168)](0x1),_0x535a31=readPackageScripts(_0x23001c);if(!_0x535a31)throw CliErrors['validation']('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x6ee3e1){const _0x1d5000=Object[_0x15473a(0x15d)](_0x535a31);if(_0x1d5000[_0x15473a(0x151)]===0x0)console[_0x15473a(0x16a)](_0x15473a(0x160));else{console[_0x15473a(0x16a)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x4f8ea9 of _0x1d5000){console['log'](_0x15473a(0x136)+_0x4f8ea9);}console['log']('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x15473a(0x15a));}return{'ok':!![]};}if(!_0x535a31[_0x6ee3e1])throw CliErrors[_0x15473a(0x166)](_0x15473a(0x133)+_0x6ee3e1+_0x15473a(0x14a),_0x15473a(0x150)+(Object['keys'](_0x535a31)[_0x15473a(0x144)](',\x20')||'(none)'));const _0x132b67=detectPackageManager(_0x23001c);VERSION_CHECK_SCRIPTS['has'](_0x6ee3e1)&&await versionCheck(_0x23001c);if(_0x6ee3e1===_0x15473a(0x162)&&_0x4f24ae[_0x15473a(0x138)](_0x15473a(0x167)))return await Promise[_0x15473a(0x135)]([spawnViteBuildWatch(_0x23001c),spawnVitePreview(_0x23001c)]),{'ok':!![]};return await spawnScript(_0x132b67,_0x6ee3e1,_0x3bc851,_0x23001c),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a184_0x596b61=a184_0x4f0a;(function(_0x2c2047,_0x226434){const _0x4e4e82=a184_0x4f0a,_0x193200=_0x2c2047();while(!![]){try{const _0x40c10d=-parseInt(_0x4e4e82(0x170))/0x1*(parseInt(_0x4e4e82(0x174))/0x2)+parseInt(_0x4e4e82(0x16b))/0x3+-parseInt(_0x4e4e82(0x16f))/0x4*(parseInt(_0x4e4e82(0x175))/0x5)+parseInt(_0x4e4e82(0x173))/0x6*(parseInt(_0x4e4e82(0x167))/0x7)+parseInt(_0x4e4e82(0x16a))/0x8*(parseInt(_0x4e4e82(0x176))/0x9)+-parseInt(_0x4e4e82(0x16c))/0xa+parseInt(_0x4e4e82(0x169))/0xb;if(_0x40c10d===_0x226434)break;else _0x193200['push'](_0x193200['shift']());}catch(_0x586e03){_0x193200['push'](_0x193200['shift']());}}}(a184_0x502f,0xa96e4));function a184_0x4f0a(_0x593dc2,_0xc6d344){_0x593dc2=_0x593dc2-0x167;const _0x502fb6=a184_0x502f();let _0x4f0ad3=_0x502fb6[_0x593dc2];return _0x4f0ad3;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5a3230){const _0x37e86a=await buildSchemaPayload();return{'ok':!![],'data':_0x37e86a};}export const schemaDefinition={'service':a184_0x596b61(0x168),'command':a184_0x596b61(0x171),'description':a184_0x596b61(0x16e),'risk':a184_0x596b61(0x16d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a184_0x596b61(0x172),'flags':[],'execute':execute};function a184_0x502f(){const _0x185f58=['3429339ZxyAFA','8209590dLoxpd','read','Export\x20machine-readable\x20command\x20schema\x20(JSON)','8060QtamXW','1091863RCPjKI','export','json','6OhYemh','2sgwIVn','2165XEMCgH','248463fRyqtV','3565982HjJlTy','schema','13413532xQpMPK','176jRwENK'];a184_0x502f=function(){return _0x185f58;};return a184_0x502f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a185_0x4c194e=a185_0x3135;(function(_0x290318,_0x139e07){const _0x1a20bb=a185_0x3135,_0x4fc720=_0x290318();while(!![]){try{const _0x3a3f6f=parseInt(_0x1a20bb(0xf7))/0x1*(parseInt(_0x1a20bb(0x104))/0x2)+-parseInt(_0x1a20bb(0x10b))/0x3*(parseInt(_0x1a20bb(0x10a))/0x4)+-parseInt(_0x1a20bb(0x11b))/0x5*(-parseInt(_0x1a20bb(0xe4))/0x6)+parseInt(_0x1a20bb(0x110))/0x7+parseInt(_0x1a20bb(0xe9))/0x8+-parseInt(_0x1a20bb(0x111))/0x9+parseInt(_0x1a20bb(0xe3))/0xa;if(_0x3a3f6f===_0x139e07)break;else _0x4fc720['push'](_0x4fc720['shift']());}catch(_0x13a468){_0x4fc720['push'](_0x4fc720['shift']());}}}(a185_0x2683,0x58b37));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a185_0x2683(){const _0x4bef14=['<server-generated-sqlCode>','10733CcmHKB','mybatisXml','SELECT\x201\x20AS\x20id;','stringify','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','length','new','Select\x20the\x20local\x20SQL\x20mode:','/smartapi/custom/saveUserCustomSql','create','dbId\x20cannot\x20be\x20empty','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','</select>','10ZDIQFt','Created\x20SQL\x20query\x20','sqlRootDir','isInteger','description','catch','724cbgCnr','11847vaVWsL','__manual__','dbName','number','sqlCode','3973438nzxxXh','4232853SKlJZH','string','Target\x20database\x20dbId:','sqlName','toISOString','sql','SQL\x20name\x20cannot\x20be\x20empty','File\x20already\x20exists:\x20','utf8','isFinite','170RxnobN','SQL\x20query\x20display\x20name','lockFilePath','str','Target\x20database\x20ID','appCode','nonInteractive','dbId\x20must\x20be\x20a\x20positive\x20integer','parse','1787990UKOTwd','35934bouLhq','sqls','mode','trim','Local\x20SQL\x20file\x20mode','4357448wSvGMf','Select\x20the\x20target\x20database:','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','join','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','lastSync','dbId','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','flagMissing','db-id','MyBatis\x20XML\x20(mybatisXml)','name','validation'];a185_0x2683=function(){return _0x4bef14;};return a185_0x2683();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a185_0x3135(_0x20a79a,_0x169896){_0x20a79a=_0x20a79a-0xe3;const _0x26835b=a185_0x2683();let _0x313516=_0x26835b[_0x20a79a];return _0x313516;}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(_0x134102){const _0x1cd155=a185_0x3135;if(_0x134102==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','\x20\x20SELECT\x201\x20AS\x20id',_0x1cd155(0x103),''][_0x1cd155(0xec)]('\x0a');return[_0x1cd155(0xf9),''][_0x1cd155(0xec)]('\x0a');}export const sqlCreate={'service':a185_0x4c194e(0x116),'command':a185_0x4c194e(0x100),'description':a185_0x4c194e(0xeb),'risk':'write','flags':[{'name':a185_0x4c194e(0xf4),'type':a185_0x4c194e(0x112),'description':a185_0x4c194e(0x11c)},{'name':a185_0x4c194e(0xf2),'type':'number','description':a185_0x4c194e(0x11f)},{'name':a185_0x4c194e(0xe6),'type':a185_0x4c194e(0x112),'enum':[a185_0x4c194e(0x116),a185_0x4c194e(0xf8)],'description':a185_0x4c194e(0xe8)}],async 'validate'(_0x24cbb){const _0x146292=a185_0x4c194e;if(!_0x24cbb[_0x146292(0x121)])return;if(!_0x24cbb['str'](_0x146292(0xf4))[_0x146292(0xe7)]())throw CliErrors[_0x146292(0xf1)](_0x146292(0xf4),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x395861=resolveProvidedDbId(_0x24cbb);if(typeof _0x395861!=='number'||!Number[_0x146292(0x11a)](_0x395861)||_0x395861<=0x0)throw CliErrors[_0x146292(0xf1)](_0x146292(0xf2),_0x146292(0xfb));if(!_0x24cbb[_0x146292(0x11e)](_0x146292(0xe6))['trim']())throw CliErrors[_0x146292(0xf1)](_0x146292(0xe6),_0x146292(0xf0));},async 'dryRun'(_0x5c2701){const _0x12b7d8=a185_0x4c194e,_0xb20e=loadSqlProjectConfig(_0x5c2701[_0x12b7d8(0x120)]),{sqlName:_0x958599,dbId:_0x3af1f9,dbName:_0x5710d4,mode:_0x538bde}=await resolveSqlNewInputs(_0x5c2701),_0x16ab80=buildSqlRelativePath(_0x12b7d8(0xf6),_0x958599,_0x5710d4,_0x538bde,_0x3af1f9),_0x27d268=_0xb20e[_0x12b7d8(0x106)]+'/'+_0x16ab80;return{'method':'POST','url':_0x12b7d8(0xff),'body':{'appCode':_0x5c2701[_0x12b7d8(0x120)],'sqlName':_0x958599,'dbId':_0x3af1f9,'mode':_0x538bde,'localPath':_0x27d268},'description':_0x12b7d8(0xed)+_0xb20e[_0x12b7d8(0x106)]};},async 'execute'(_0x86e8e1){const _0x13ba4d=a185_0x4c194e,_0x11fa6e=loadSqlProjectConfig(_0x86e8e1['appCode']),{sqlName:_0x20ad94,dbId:_0x3c735b,dbName:_0x1971ff,mode:_0x1b3f0c}=await resolveSqlNewInputs(_0x86e8e1),_0x1131f4=generateSqlTemplate(_0x1b3f0c),_0x39917d=await createSqlQuery({'appCode':_0x86e8e1[_0x13ba4d(0x120)],'sqlName':_0x20ad94,'dbId':_0x3c735b,'sqlContent':_0x1131f4}),_0x27b4c7=ensureRemoteSqlContent(_0x39917d),_0x25cd2b=_0x1971ff||await getDbName(_0x86e8e1['appCode'],_0x3c735b)[_0x13ba4d(0x109)](()=>undefined),_0x12d5ae=buildSqlRelativePath(_0x39917d['sqlCode'],_0x39917d[_0x13ba4d(0x114)],_0x25cd2b,_0x1b3f0c,_0x3c735b),_0x198715=_0x11fa6e['sqlRootDir']+'/'+_0x12d5ae,_0x3e5049=buildLocalSqlFileContent({'sqlCode':_0x39917d[_0x13ba4d(0x10f)],'sqlName':_0x39917d[_0x13ba4d(0x114)],'dbId':_0x39917d['dbId']},_0x27b4c7,{'dbName':_0x25cd2b,'mode':_0x1b3f0c,'syncedAt':new Date()[_0x13ba4d(0x115)](),'description':_0x39917d[_0x13ba4d(0x108)]});if(await fileExists(_0x198715))throw CliErrors[_0x13ba4d(0xf5)](_0x13ba4d(0x118)+_0x198715);await ensureParentDirectory(_0x198715),await writeFile(_0x198715,_0x3e5049,_0x13ba4d(0x119));const _0x39d6be=await readSqlLockFile(_0x11fa6e[_0x13ba4d(0x11d)]),{lockData:_0x393baf,appLock:_0x34845f}=ensureSqlLockScope(_0x39d6be??createEmptySqlLock(),_0x11fa6e[_0x13ba4d(0x120)],_0x11fa6e['sqlRoot'],_0x13ba4d(0xfd));return _0x34845f[_0x13ba4d(0xe5)][_0x39917d[_0x13ba4d(0x10f)]]={...buildSqlLockEntry(_0x39917d,_0x27b4c7,computeSqlContentHash(_0x3e5049),{'dbName':_0x25cd2b}),'path':_0x12d5ae,'mode':_0x1b3f0c},_0x34845f[_0x13ba4d(0xee)]=new Date()[_0x13ba4d(0x115)](),await writeSqlLockFile(_0x11fa6e[_0x13ba4d(0x11d)],_0x393baf),{'ok':!![],'data':{'id':_0x39917d['id'],'sqlCode':_0x39917d[_0x13ba4d(0x10f)],'sqlName':_0x39917d['sqlName'],'dbId':_0x39917d['dbId'],'path':_0x198715,'mode':_0x1b3f0c},'message':_0x13ba4d(0x105)+_0x39917d[_0x13ba4d(0x10f)]};}};async function resolveSqlNewInputs(_0x101613){const _0x2d8313=await resolveSqlNameInput(_0x101613),{dbId:_0x3872b3,dbName:_0xfcfdf}=await resolveDbSelection(_0x101613),_0x552e67=await resolveSqlModeInput(_0x101613);return{'sqlName':_0x2d8313,'dbId':_0x3872b3,'dbName':_0xfcfdf,'mode':_0x552e67};}async function resolveSqlNameInput(_0x5b7b8c){const _0x499329=a185_0x4c194e,_0x18aa52=_0x5b7b8c[_0x499329(0x11e)](_0x499329(0xf4))['trim']();if(_0x18aa52)return _0x18aa52;if(_0x5b7b8c['nonInteractive'])throw CliErrors['flagMissing'](_0x499329(0xf4),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':'SQL\x20name:','validate':_0x3c6d78=>_0x3c6d78[_0x499329(0xe7)]()?!![]:_0x499329(0x117)}))[_0x499329(0xe7)]();}async function resolveDbSelection(_0x2a9dc0){const _0x5595fd=a185_0x4c194e,_0x45eed8=resolveProvidedDbId(_0x2a9dc0);if(typeof _0x45eed8===_0x5595fd(0x10e)&&Number['isFinite'](_0x45eed8)&&_0x45eed8>0x0)return{'dbId':_0x45eed8,'dbName':await getDbName(_0x2a9dc0[_0x5595fd(0x120)],_0x45eed8)[_0x5595fd(0x109)](()=>undefined)};if(_0x2a9dc0['nonInteractive'])throw CliErrors[_0x5595fd(0xf1)](_0x5595fd(0xf2),_0x5595fd(0xfb));const _0xe8ed5b=await listDatabases(_0x2a9dc0[_0x5595fd(0x120)])['catch'](()=>[]);if(_0xe8ed5b[_0x5595fd(0xfc)]===0x1)return{'dbId':_0xe8ed5b[0x0][_0x5595fd(0xef)],'dbName':_0xe8ed5b[0x0][_0x5595fd(0x10d)]};if(_0xe8ed5b[_0x5595fd(0xfc)]>0x1){const _0x226e67=await select({'message':_0x5595fd(0xea),'choices':[..._0xe8ed5b['map'](_0x25f823=>({'name':_0x25f823[_0x5595fd(0x10d)]+'\x20('+_0x25f823[_0x5595fd(0xef)]+')','value':serializeDbSelection(_0x25f823)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x5595fd(0x10c)}]});if(_0x226e67!==_0x5595fd(0x10c))return deserializeDbSelection(_0x226e67);}const _0x3b3f81=await input({'message':_0x5595fd(0x113),'validate':_0x4277cb=>{const _0x1af4b5=_0x5595fd,_0x365258=_0x4277cb[_0x1af4b5(0xe7)]();if(!_0x365258)return _0x1af4b5(0x101);const _0x4d5d24=Number(_0x365258);if(!Number[_0x1af4b5(0x107)](_0x4d5d24)||_0x4d5d24<=0x0)return _0x1af4b5(0x122);return!![];}});return{'dbId':Number(_0x3b3f81['trim']())};}async function resolveSqlModeInput(_0x187481){const _0x37045c=a185_0x4c194e,_0x439ac0=_0x187481[_0x37045c(0x11e)](_0x37045c(0xe6))['trim']();if(_0x439ac0===_0x37045c(0x116)||_0x439ac0===_0x37045c(0xf8))return _0x439ac0;if(_0x187481[_0x37045c(0x121)])throw CliErrors[_0x37045c(0xf1)](_0x37045c(0xe6),_0x37045c(0xf0));return await select({'message':_0x37045c(0xfe),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x37045c(0x116),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x37045c(0xf3),'value':_0x37045c(0xf8),'description':_0x37045c(0x102)}]});}function serializeDbSelection(_0x4f692c){const _0x55c168=a185_0x4c194e;return JSON[_0x55c168(0xfa)]({'dbId':_0x4f692c[_0x55c168(0xef)],'dbName':_0x4f692c['dbName']});}function deserializeDbSelection(_0x4d8cc9){const _0x9913d7=a185_0x4c194e;try{const _0x5756ac=JSON[_0x9913d7(0x123)](_0x4d8cc9);if(typeof _0x5756ac['dbId']===_0x9913d7(0x10e)&&Number[_0x9913d7(0x11a)](_0x5756ac[_0x9913d7(0xef)]))return{'dbId':_0x5756ac['dbId'],'dbName':_0x5756ac[_0x9913d7(0x10d)]};}catch{}throw CliErrors[_0x9913d7(0xf5)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x4d8cc9);}function resolveProvidedDbId(_0x1da503){const _0x374a70=a185_0x4c194e,_0x3dcb31=_0x1da503['flag'](_0x374a70(0xf2));if(typeof _0x3dcb31===_0x374a70(0x10e)&&Number[_0x374a70(0x11a)](_0x3dcb31))return _0x3dcb31;return undefined;}
|
|
1
|
+
const a185_0xe38f20=a185_0x48ff;(function(_0x2e396d,_0x686bce){const _0x58e6d6=a185_0x48ff,_0x47517f=_0x2e396d();while(!![]){try{const _0x1a3eea=parseInt(_0x58e6d6(0x200))/0x1+-parseInt(_0x58e6d6(0x1d8))/0x2*(-parseInt(_0x58e6d6(0x1e2))/0x3)+parseInt(_0x58e6d6(0x201))/0x4*(parseInt(_0x58e6d6(0x207))/0x5)+parseInt(_0x58e6d6(0x1fd))/0x6*(parseInt(_0x58e6d6(0x1cb))/0x7)+parseInt(_0x58e6d6(0x1fa))/0x8*(parseInt(_0x58e6d6(0x1de))/0x9)+-parseInt(_0x58e6d6(0x1f4))/0xa+-parseInt(_0x58e6d6(0x210))/0xb*(parseInt(_0x58e6d6(0x206))/0xc);if(_0x1a3eea===_0x686bce)break;else _0x47517f['push'](_0x47517f['shift']());}catch(_0x5ee7f9){_0x47517f['push'](_0x47517f['shift']());}}}(a185_0x2124,0x5d12e));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';function a185_0x2124(){const _0x3819e7=['\x20\x20SELECT\x201\x20AS\x20id','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','77rhpLxk','appCode','MyBatis\x20XML\x20(mybatisXml)','7qIpFIA','Select\x20the\x20local\x20SQL\x20mode:','flag','dbId','description','Local\x20SQL\x20file\x20mode','File\x20already\x20exists:\x20','utf8','toISOString','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','</select>','lastSync','validation','54654bSeqVD','POST','isInteger','sqlRootDir','str','trim','9243tMrGcV','SELECT\x201\x20AS\x20id;','name','length','66fvJHIJ','map','sqlName','flagMissing','nonInteractive','number','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId\x20must\x20be\x20a\x20positive\x20integer','Invalid\x20database\x20selection\x20payload:\x20','dbName','join','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','lockFilePath','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','write','Target\x20database\x20ID','Plain\x20SQL\x20(sql)','sqlRoot','3031430OGzZHX','db-id','stringify','mybatisXml','parse','__manual__','4360rQRhxj','SQL\x20name\x20cannot\x20be\x20empty','SQL\x20name:','2173854ICcZAe','isFinite','✎\x20Enter\x20dbId\x20manually','514804LcfFHs','270212KgfgJh','Select\x20the\x20target\x20database:','sql','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','mode','3015372MwRRRH','30cVTurU','Target\x20database\x20dbId:','catch','create','/smartapi/custom/saveUserCustomSql','sqlCode','string'];a185_0x2124=function(){return _0x3819e7;};return a185_0x2124();}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';function a185_0x48ff(_0x4ed106,_0x5d0f38){_0x4ed106=_0x4ed106-0x1c9;const _0x2124fe=a185_0x2124();let _0x48ff72=_0x2124fe[_0x4ed106];return _0x48ff72;}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(_0x276263){const _0x436d55=a185_0x48ff;if(_0x276263==='mybatisXml')return[_0x436d55(0x1ed),_0x436d55(0x20e),_0x436d55(0x1d5),''][_0x436d55(0x1ec)]('\x0a');return[_0x436d55(0x1df),''][_0x436d55(0x1ec)]('\x0a');}export const sqlCreate={'service':'sql','command':a185_0xe38f20(0x20a),'description':a185_0xe38f20(0x20f),'risk':a185_0xe38f20(0x1f0),'flags':[{'name':'name','type':a185_0xe38f20(0x20d),'description':'SQL\x20query\x20display\x20name'},{'name':a185_0xe38f20(0x1f5),'type':'number','description':a185_0xe38f20(0x1f1)},{'name':'mode','type':a185_0xe38f20(0x20d),'enum':[a185_0xe38f20(0x203),a185_0xe38f20(0x1f7)],'description':a185_0xe38f20(0x1d0)}],async 'validate'(_0x98bf6b){const _0x5514ac=a185_0xe38f20;if(!_0x98bf6b[_0x5514ac(0x1e6)])return;if(!_0x98bf6b[_0x5514ac(0x1dc)]('name')[_0x5514ac(0x1dd)]())throw CliErrors[_0x5514ac(0x1e5)](_0x5514ac(0x1e0),_0x5514ac(0x1e8));const _0x3561ba=resolveProvidedDbId(_0x98bf6b);if(typeof _0x3561ba!==_0x5514ac(0x1e7)||!Number['isFinite'](_0x3561ba)||_0x3561ba<=0x0)throw CliErrors[_0x5514ac(0x1e5)]('db-id',_0x5514ac(0x1d4));if(!_0x98bf6b[_0x5514ac(0x1dc)](_0x5514ac(0x205))['trim']())throw CliErrors[_0x5514ac(0x1e5)](_0x5514ac(0x205),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x1d028d){const _0x97619a=a185_0xe38f20,_0x267bd4=loadSqlProjectConfig(_0x1d028d['appCode']),{sqlName:_0x2223b9,dbId:_0x42c569,dbName:_0x2540dc,mode:_0x449e85}=await resolveSqlNewInputs(_0x1d028d),_0x9743b7=buildSqlRelativePath('<server-generated-sqlCode>',_0x2223b9,_0x2540dc,_0x449e85,_0x42c569),_0x29c732=_0x267bd4[_0x97619a(0x1db)]+'/'+_0x9743b7;return{'method':_0x97619a(0x1d9),'url':_0x97619a(0x20b),'body':{'appCode':_0x1d028d[_0x97619a(0x1c9)],'sqlName':_0x2223b9,'dbId':_0x42c569,'mode':_0x449e85,'localPath':_0x29c732},'description':_0x97619a(0x1ef)+_0x267bd4[_0x97619a(0x1db)]};},async 'execute'(_0x392f28){const _0x3b2b4f=a185_0xe38f20,_0x29ec56=loadSqlProjectConfig(_0x392f28[_0x3b2b4f(0x1c9)]),{sqlName:_0x4b0b71,dbId:_0x3dbb32,dbName:_0xe6de3d,mode:_0x3d2ef7}=await resolveSqlNewInputs(_0x392f28),_0x4276f7=generateSqlTemplate(_0x3d2ef7),_0x4bb2ec=await createSqlQuery({'appCode':_0x392f28[_0x3b2b4f(0x1c9)],'sqlName':_0x4b0b71,'dbId':_0x3dbb32,'sqlContent':_0x4276f7}),_0x164547=ensureRemoteSqlContent(_0x4bb2ec),_0x1b1be3=_0xe6de3d||await getDbName(_0x392f28['appCode'],_0x3dbb32)[_0x3b2b4f(0x209)](()=>undefined),_0x5a595b=buildSqlRelativePath(_0x4bb2ec[_0x3b2b4f(0x20c)],_0x4bb2ec[_0x3b2b4f(0x1e4)],_0x1b1be3,_0x3d2ef7,_0x3dbb32),_0x496438=_0x29ec56[_0x3b2b4f(0x1db)]+'/'+_0x5a595b,_0x36ab7c=buildLocalSqlFileContent({'sqlCode':_0x4bb2ec[_0x3b2b4f(0x20c)],'sqlName':_0x4bb2ec[_0x3b2b4f(0x1e4)],'dbId':_0x4bb2ec[_0x3b2b4f(0x1ce)]},_0x164547,{'dbName':_0x1b1be3,'mode':_0x3d2ef7,'syncedAt':new Date()[_0x3b2b4f(0x1d3)](),'description':_0x4bb2ec[_0x3b2b4f(0x1cf)]});if(await fileExists(_0x496438))throw CliErrors['validation'](_0x3b2b4f(0x1d1)+_0x496438);await ensureParentDirectory(_0x496438),await writeFile(_0x496438,_0x36ab7c,_0x3b2b4f(0x1d2));const _0x218f1e=await readSqlLockFile(_0x29ec56['lockFilePath']),{lockData:_0x1ccf9f,appLock:_0x3a018d}=ensureSqlLockScope(_0x218f1e??createEmptySqlLock(),_0x29ec56[_0x3b2b4f(0x1c9)],_0x29ec56[_0x3b2b4f(0x1f3)],'new');return _0x3a018d['sqls'][_0x4bb2ec[_0x3b2b4f(0x20c)]]={...buildSqlLockEntry(_0x4bb2ec,_0x164547,computeSqlContentHash(_0x36ab7c),{'dbName':_0x1b1be3}),'path':_0x5a595b,'mode':_0x3d2ef7},_0x3a018d[_0x3b2b4f(0x1d6)]=new Date()[_0x3b2b4f(0x1d3)](),await writeSqlLockFile(_0x29ec56[_0x3b2b4f(0x1ee)],_0x1ccf9f),{'ok':!![],'data':{'id':_0x4bb2ec['id'],'sqlCode':_0x4bb2ec[_0x3b2b4f(0x20c)],'sqlName':_0x4bb2ec['sqlName'],'dbId':_0x4bb2ec['dbId'],'path':_0x496438,'mode':_0x3d2ef7},'message':'Created\x20SQL\x20query\x20'+_0x4bb2ec['sqlCode']};}};async function resolveSqlNewInputs(_0xd90520){const _0x49916d=await resolveSqlNameInput(_0xd90520),{dbId:_0x6270ca,dbName:_0x3d62b4}=await resolveDbSelection(_0xd90520),_0x3a6ce2=await resolveSqlModeInput(_0xd90520);return{'sqlName':_0x49916d,'dbId':_0x6270ca,'dbName':_0x3d62b4,'mode':_0x3a6ce2};}async function resolveSqlNameInput(_0x27954c){const _0x21e6de=a185_0xe38f20,_0x4465df=_0x27954c[_0x21e6de(0x1dc)](_0x21e6de(0x1e0))['trim']();if(_0x4465df)return _0x4465df;if(_0x27954c[_0x21e6de(0x1e6)])throw CliErrors[_0x21e6de(0x1e5)](_0x21e6de(0x1e0),_0x21e6de(0x1e8));return(await input({'message':_0x21e6de(0x1fc),'validate':_0x9fa908=>_0x9fa908[_0x21e6de(0x1dd)]()?!![]:_0x21e6de(0x1fb)}))[_0x21e6de(0x1dd)]();}async function resolveDbSelection(_0xf75c86){const _0x429d6b=a185_0xe38f20,_0x1c967d=resolveProvidedDbId(_0xf75c86);if(typeof _0x1c967d==='number'&&Number[_0x429d6b(0x1fe)](_0x1c967d)&&_0x1c967d>0x0)return{'dbId':_0x1c967d,'dbName':await getDbName(_0xf75c86[_0x429d6b(0x1c9)],_0x1c967d)['catch'](()=>undefined)};if(_0xf75c86[_0x429d6b(0x1e6)])throw CliErrors[_0x429d6b(0x1e5)](_0x429d6b(0x1f5),_0x429d6b(0x1d4));const _0x5183a8=await listDatabases(_0xf75c86[_0x429d6b(0x1c9)])['catch'](()=>[]);if(_0x5183a8[_0x429d6b(0x1e1)]===0x1)return{'dbId':_0x5183a8[0x0][_0x429d6b(0x1ce)],'dbName':_0x5183a8[0x0][_0x429d6b(0x1eb)]};if(_0x5183a8[_0x429d6b(0x1e1)]>0x1){const _0x26c50d=await select({'message':_0x429d6b(0x202),'choices':[..._0x5183a8[_0x429d6b(0x1e3)](_0x407fb6=>({'name':_0x407fb6[_0x429d6b(0x1eb)]+'\x20('+_0x407fb6['dbId']+')','value':serializeDbSelection(_0x407fb6)})),{'name':_0x429d6b(0x1ff),'value':_0x429d6b(0x1f9)}]});if(_0x26c50d!==_0x429d6b(0x1f9))return deserializeDbSelection(_0x26c50d);}const _0x3d8f1f=await input({'message':_0x429d6b(0x208),'validate':_0x5ac167=>{const _0x36e74e=_0x429d6b,_0xd651e4=_0x5ac167[_0x36e74e(0x1dd)]();if(!_0xd651e4)return'dbId\x20cannot\x20be\x20empty';const _0xa71210=Number(_0xd651e4);if(!Number[_0x36e74e(0x1da)](_0xa71210)||_0xa71210<=0x0)return _0x36e74e(0x1e9);return!![];}});return{'dbId':Number(_0x3d8f1f['trim']())};}async function resolveSqlModeInput(_0x3d0a8d){const _0x2ffde0=a185_0xe38f20,_0x48cbf0=_0x3d0a8d[_0x2ffde0(0x1dc)]('mode')[_0x2ffde0(0x1dd)]();if(_0x48cbf0===_0x2ffde0(0x203)||_0x48cbf0===_0x2ffde0(0x1f7))return _0x48cbf0;if(_0x3d0a8d[_0x2ffde0(0x1e6)])throw CliErrors[_0x2ffde0(0x1e5)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x2ffde0(0x1cc),'choices':[{'name':_0x2ffde0(0x1f2),'value':'sql','description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x2ffde0(0x1ca),'value':_0x2ffde0(0x1f7),'description':_0x2ffde0(0x204)}]});}function serializeDbSelection(_0x44f9a4){const _0x1deefd=a185_0xe38f20;return JSON[_0x1deefd(0x1f6)]({'dbId':_0x44f9a4['dbId'],'dbName':_0x44f9a4[_0x1deefd(0x1eb)]});}function deserializeDbSelection(_0x58a555){const _0x3544a3=a185_0xe38f20;try{const _0x426fd5=JSON[_0x3544a3(0x1f8)](_0x58a555);if(typeof _0x426fd5[_0x3544a3(0x1ce)]===_0x3544a3(0x1e7)&&Number[_0x3544a3(0x1fe)](_0x426fd5[_0x3544a3(0x1ce)]))return{'dbId':_0x426fd5[_0x3544a3(0x1ce)],'dbName':_0x426fd5[_0x3544a3(0x1eb)]};}catch{}throw CliErrors[_0x3544a3(0x1d7)](_0x3544a3(0x1ea)+_0x58a555);}function resolveProvidedDbId(_0x3f6770){const _0x4a0113=a185_0xe38f20,_0x23434b=_0x3f6770[_0x4a0113(0x1cd)](_0x4a0113(0x1f5));if(typeof _0x23434b===_0x4a0113(0x1e7)&&Number[_0x4a0113(0x1fe)](_0x23434b))return _0x23434b;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a186_0x689056=a186_0x46e3;(function(_0x4decff,_0x1bc46b){const _0x242d6d=a186_0x46e3,_0xbf7f03=_0x4decff();while(!![]){try{const _0x16a8a1=-parseInt(_0x242d6d(0x161))/0x1+-parseInt(_0x242d6d(0x15c))/0x2+parseInt(_0x242d6d(0x173))/0x3*(parseInt(_0x242d6d(0x168))/0x4)+-parseInt(_0x242d6d(0x163))/0x5+parseInt(_0x242d6d(0x180))/0x6+parseInt(_0x242d6d(0x15f))/0x7+parseInt(_0x242d6d(0x166))/0x8*(parseInt(_0x242d6d(0x16d))/0x9);if(_0x16a8a1===_0x1bc46b)break;else _0xbf7f03['push'](_0xbf7f03['shift']());}catch(_0x52af03){_0xbf7f03['push'](_0xbf7f03['shift']());}}}(a186_0x2f66,0x99275));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a186_0x2f66(){const _0x22b6e5=['32WNdfVD','toISOString','sqlRoot','Would\x20delete\x20SQL\x20','trashDir','4443813qvtnnS','fromEntries','validation','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','/smartapi/custom/deleteUserCustomSql','POST','94395GHowse','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','lockFilePath','length','projectRoot','appCode','\x20(local\x20file\x20moved\x20to\x20trash)','str','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sqlcode','startsWith','sqlRootDir','3085500qoSkEC','trashedTo','666556MRKABA','high-risk-write','delete','3017693gCocwP','entries','916189SFkXaE','sqls','4007780aJbIYv','lastSync','Deleted\x20','24XmMUnM','remoteId'];a186_0x2f66=function(){return _0x22b6e5;};return a186_0x2f66();}import{dirname,join,relative,resolve,sep}from'node:path';function a186_0x46e3(_0x49b47c,_0x348b44){_0x49b47c=_0x49b47c-0x15c;const _0x2f66bb=a186_0x2f66();let _0x46e31c=_0x2f66bb[_0x49b47c];return _0x46e31c;}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';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':'sql','command':a186_0x689056(0x15e),'description':a186_0x689056(0x170),'risk':a186_0x689056(0x15d),'flags':[SQLCODE_FLAG],async 'validate'(_0x279aca){const _0x5a4741=a186_0x689056,_0x25021d=loadSqlProjectConfig(_0x279aca[_0x5a4741(0x179)]),_0x5c9849=await readSqlLockFile(_0x25021d['lockFilePath']);if(!_0x5c9849)throw CliErrors['validation'](_0x5a4741(0x17c));},async 'dryRun'(_0x908410){const _0x4d48c2=a186_0x689056,_0x806875=loadSqlProjectConfig(_0x908410[_0x4d48c2(0x179)]),_0x4dfafb=await readSqlLockFile(_0x806875[_0x4d48c2(0x176)]);if(!_0x4dfafb)throw CliErrors[_0x4d48c2(0x16f)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x3d37fd}=ensureSqlLockScope(_0x4dfafb,_0x908410[_0x4d48c2(0x179)],_0x806875[_0x4d48c2(0x16a)],_0x4d48c2(0x15e)),_0x5c498e=_0x908410[_0x4d48c2(0x17b)](_0x4d48c2(0x17d)),_0x1a06a3=_0x3d37fd['sqls'][_0x5c498e];if(!_0x1a06a3)throw CliErrors[_0x4d48c2(0x16f)](_0x4d48c2(0x175)+_0x5c498e+'\x22.');return{'method':_0x4d48c2(0x172),'url':_0x4d48c2(0x171),'body':{'sqlCode':_0x5c498e,'id':_0x1a06a3[_0x4d48c2(0x167)],'localPath':resolveLocalSqlFilePath(_0x806875,_0x5c498e,_0x1a06a3)},'description':_0x4d48c2(0x16b)+_0x5c498e+_0x4d48c2(0x174)+_0x806875[_0x4d48c2(0x16c)]};},async 'execute'(_0x5670b5){const _0x2e6c5f=a186_0x689056,_0xf01ba4=loadSqlProjectConfig(_0x5670b5['appCode']),_0x48cba3=await readSqlLockFile(_0xf01ba4[_0x2e6c5f(0x176)]);if(!_0x48cba3)throw CliErrors[_0x2e6c5f(0x16f)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x52d2aa,appLock:_0x17ce34}=ensureSqlLockScope(_0x48cba3,_0x5670b5[_0x2e6c5f(0x179)],_0xf01ba4[_0x2e6c5f(0x16a)],_0x2e6c5f(0x15e)),_0x1e08b5=_0x5670b5[_0x2e6c5f(0x17b)](_0x2e6c5f(0x17d)),_0x5503ee=_0x17ce34[_0x2e6c5f(0x162)][_0x1e08b5];if(!_0x5503ee)throw CliErrors[_0x2e6c5f(0x16f)](_0x2e6c5f(0x175)+_0x1e08b5+'\x22.');await deleteSqlQuery({'id':_0x5503ee[_0x2e6c5f(0x167)],'sqlCode':_0x1e08b5}),_0x17ce34['sqls']=Object[_0x2e6c5f(0x16e)](Object[_0x2e6c5f(0x160)](_0x17ce34[_0x2e6c5f(0x162)])['filter'](([_0x5cb836])=>_0x5cb836!==_0x1e08b5)),_0x17ce34[_0x2e6c5f(0x164)]=new Date()['toISOString'](),await writeSqlLockFile(_0xf01ba4[_0x2e6c5f(0x176)],_0x52d2aa);const _0x3649e7=resolveLocalSqlFilePath(_0xf01ba4,_0x1e08b5,_0x5503ee);let _0x35f114;await fileExists(_0x3649e7)&&(_0x35f114=await moveToTrash(_0xf01ba4[_0x2e6c5f(0x178)],_0xf01ba4[_0x2e6c5f(0x16c)],_0x3649e7),await cleanupEmptyDirectories(dirname(_0x3649e7),_0xf01ba4[_0x2e6c5f(0x17f)]));const _0xb8ca75={'deleted':_0x1e08b5,'remoteId':_0x5503ee[_0x2e6c5f(0x167)]};if(_0x35f114)_0xb8ca75[_0x2e6c5f(0x181)]=_0x35f114;return{'ok':!![],'data':_0xb8ca75,'message':_0x2e6c5f(0x165)+_0x1e08b5+(_0x35f114?_0x2e6c5f(0x17a):'')};}};async function moveToTrash(_0x432fba,_0x3f9bcc,_0xbb338d){const _0x151664=a186_0x689056,_0x4b0de8=new Date()[_0x151664(0x169)]()['replace'](/[:.]/g,'-'),_0x24d846=relative(_0x432fba,_0xbb338d),_0xe662b6=join(_0x3f9bcc,_0x4b0de8,_0x24d846);return await mkdir(dirname(_0xe662b6),{'recursive':!![]}),await rename(_0xbb338d,_0xe662b6),_0xe662b6;}async function cleanupEmptyDirectories(_0x4c45bb,_0x19b983){const _0x3a2e57=a186_0x689056;let _0x547099=resolve(_0x4c45bb);const _0x493458=resolve(_0x19b983);while(_0x547099[_0x3a2e57(0x17e)](''+_0x493458+sep)||_0x547099===_0x493458){if(_0x547099===_0x493458)return;try{const _0x2f4076=await readdir(_0x547099);if(_0x2f4076[_0x3a2e57(0x177)]>0x0)return;await rmdir(_0x547099);}catch{return;}_0x547099=dirname(_0x547099);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a187_0x4c3a65=a187_0x2a75;function a187_0x4880(){const _0x5a7f75=['Return\x20full\x20raw\x20SQL\x20query\x20object','10oTnqpB','1135962zdnLtq','sqlContent','4492IhrvrO','12520571jqViUn','6418sYjdKB','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','7265BzuPbG','9alvJOy','bool','sqlcode','read','19803311EsWJMf','appCode','160212hLrcUW','4972808QbhErN','sql','str','317miMoln','boolean','sqlName','dbId'];a187_0x4880=function(){return _0x5a7f75;};return a187_0x4880();}(function(_0x3acc8e,_0x506518){const _0x460d0b=a187_0x2a75,_0x3f889e=_0x3acc8e();while(!![]){try{const _0x2a62b8=parseInt(_0x460d0b(0x1fa))/0x1*(-parseInt(_0x460d0b(0x1ec))/0x2)+-parseInt(_0x460d0b(0x1e8))/0x3+-parseInt(_0x460d0b(0x1ea))/0x4*(-parseInt(_0x460d0b(0x1ef))/0x5)+parseInt(_0x460d0b(0x1f6))/0x6+-parseInt(_0x460d0b(0x1eb))/0x7+-parseInt(_0x460d0b(0x1f7))/0x8*(-parseInt(_0x460d0b(0x1f0))/0x9)+-parseInt(_0x460d0b(0x1e7))/0xa*(-parseInt(_0x460d0b(0x1f4))/0xb);if(_0x2a62b8===_0x506518)break;else _0x3f889e['push'](_0x3f889e['shift']());}catch(_0x52a89d){_0x3f889e['push'](_0x3f889e['shift']());}}}(a187_0x4880,0xdab13));import{getSqlQueryInfo}from'../../core/api-client.js';function a187_0x2a75(_0x314e81,_0x41d92a){_0x314e81=_0x314e81-0x1e3;const _0x4880fe=a187_0x4880();let _0x2a7587=_0x4880fe[_0x314e81];return _0x2a7587;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a187_0x4c3a65(0x1f8),'command':'detail','description':a187_0x4c3a65(0x1ed),'risk':a187_0x4c3a65(0x1f3),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a187_0x4c3a65(0x1e3),'description':a187_0x4c3a65(0x1e6)}],async 'execute'(_0xdd7c7c){const _0x3495cb=a187_0x4c3a65,_0x4bf880=await getSqlQueryInfo(_0xdd7c7c[_0x3495cb(0x1f5)],_0xdd7c7c[_0x3495cb(0x1f9)](_0x3495cb(0x1f2))),_0x432a7e=_0xdd7c7c[_0x3495cb(0x1f1)](_0x3495cb(0x1ee));if(_0x432a7e)return{'ok':!![],'data':_0x4bf880};const _0x1af7cc=_0x4bf880[_0x3495cb(0x1e5)]?await getDbName(_0xdd7c7c[_0x3495cb(0x1f5)],_0x4bf880[_0x3495cb(0x1e5)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4bf880['sqlCode'],'sqlName':_0x4bf880[_0x3495cb(0x1e4)],'db':_0x1af7cc?_0x1af7cc+'\x20('+_0x4bf880['dbId']+')':_0x4bf880[_0x3495cb(0x1e5)]??'','description':_0x4bf880['description']??'','sqlContent':_0x4bf880[_0x3495cb(0x1e9)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x3ecefe=a188_0x136b;(function(_0x161539,_0x4e3324){const _0x4ba639=a188_0x136b,_0x140df6=_0x161539();while(!![]){try{const _0x12ac11=parseInt(_0x4ba639(0x1c3))/0x1+parseInt(_0x4ba639(0x1cd))/0x2*(parseInt(_0x4ba639(0x1d0))/0x3)+-parseInt(_0x4ba639(0x1bd))/0x4+-parseInt(_0x4ba639(0x1c8))/0x5*(parseInt(_0x4ba639(0x1d3))/0x6)+parseInt(_0x4ba639(0x1cf))/0x7*(parseInt(_0x4ba639(0x1d1))/0x8)+-parseInt(_0x4ba639(0x1bc))/0x9+parseInt(_0x4ba639(0x1c0))/0xa*(-parseInt(_0x4ba639(0x1c5))/0xb);if(_0x12ac11===_0x4e3324)break;else _0x140df6['push'](_0x140df6['shift']());}catch(_0x5635fb){_0x140df6['push'](_0x140df6['shift']());}}}(a188_0xdc2e,0x76f00));function a188_0xdc2e(){const _0x6ca9ff=['22FqFCSa','\x20row(s)\x20in\x20','execError','5RYdGTj','Returned\x20','params','now','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','1795354xGVlBl','str','91SsuUOI','3PWVBJn','347648EKlVnF','appCode','423606YrqaVX','execResult','read','6113700nQiIta','3291652qZIqjL','length','sqlcode','852810UdTNmN','exec','SQL\x20execution\x20failed','767939QBpgLw','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'];a188_0xdc2e=function(){return _0x6ca9ff;};return a188_0xdc2e();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a188_0x136b(_0x389963,_0x644cc6){_0x389963=_0x389963-0x1ba;const _0xdc2e85=a188_0xdc2e();let _0x136bd7=_0xdc2e85[_0x389963];return _0x136bd7;}export const sqlExec={'service':'sql','command':a188_0x3ecefe(0x1c1),'description':a188_0x3ecefe(0x1cc),'risk':a188_0x3ecefe(0x1bb),'flags':[SQLCODE_FLAG,{'name':a188_0x3ecefe(0x1ca),'type':'string','description':a188_0x3ecefe(0x1c4)}],async 'execute'(_0x105777){const _0x505d48=a188_0x3ecefe,_0x4d64db=parseJsonParams(_0x105777[_0x505d48(0x1ce)](_0x505d48(0x1ca))),_0x35e5e1=Date['now'](),_0xe1686d=await executeSql(_0x105777[_0x505d48(0x1d2)],_0x105777['str'](_0x505d48(0x1bf)),_0x4d64db),_0xecedf3=Date[_0x505d48(0x1cb)]()-_0x35e5e1,_0x51dc5f=_0xe1686d?.[_0x505d48(0x1ba)]??_0xe1686d,_0x950a16=_0xe1686d?.['execSuccess']??!![];if(!_0x950a16)return{'ok':![],'data':{'error':_0xe1686d?.[_0x505d48(0x1c7)]||_0x505d48(0x1c2),'elapsed':_0xecedf3},'message':'SQL\x20execution\x20failed'};const _0x3ca88a=Array['isArray'](_0x51dc5f)?_0x51dc5f:[];return{'ok':!![],'data':{'rows':_0x3ca88a,'rowCount':_0x3ca88a[_0x505d48(0x1be)],'elapsed':_0xecedf3},'message':_0x505d48(0x1c9)+_0x3ca88a[_0x505d48(0x1be)]+_0x505d48(0x1c6)+_0xecedf3+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c23e1,_0x268210){const _0x56c75a=a189_0x2558,_0x5e3ab4=_0x1c23e1();while(!![]){try{const _0x40dcdd=-parseInt(_0x56c75a(0x196))/0x1*(-parseInt(_0x56c75a(0x195))/0x2)+-parseInt(_0x56c75a(0x191))/0x3+parseInt(_0x56c75a(0x18f))/0x4*(-parseInt(_0x56c75a(0x197))/0x5)+parseInt(_0x56c75a(0x193))/0x6+-parseInt(_0x56c75a(0x194))/0x7*(parseInt(_0x56c75a(0x190))/0x8)+-parseInt(_0x56c75a(0x192))/0x9*(-parseInt(_0x56c75a(0x198))/0xa)+parseInt(_0x56c75a(0x18e))/0xb;if(_0x40dcdd===_0x268210)break;else _0x5e3ab4['push'](_0x5e3ab4['shift']());}catch(_0x2ae45c){_0x5e3ab4['push'](_0x5e3ab4['shift']());}}}(a189_0x1362,0xafb52));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';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';function a189_0x2558(_0x1da206,_0x25f892){_0x1da206=_0x1da206-0x18e;const _0x13629f=a189_0x1362();let _0x255869=_0x13629f[_0x1da206];return _0x255869;}import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a189_0x1362(){const _0x330514=['235368cARxxX','4242474BRLklG','5359991rubOpV','20iUjHHW','31796Wqmvas','410uhWbqS','550nGVsCp','6032653RFmQVL','13996CesaXI','8gRMkGl','3718479PXIDjG'];a189_0x1362=function(){return _0x330514;};return a189_0x1362();}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a190_0x3c6c22=a190_0x1a51;(function(_0x458300,_0x3d6704){const _0x1b8122=a190_0x1a51,_0x42a9d5=_0x458300();while(!![]){try{const _0x162197=parseInt(_0x1b8122(0xce))/0x1+parseInt(_0x1b8122(0xf2))/0x2+parseInt(_0x1b8122(0xe4))/0x3*(parseInt(_0x1b8122(0xe2))/0x4)+-parseInt(_0x1b8122(0xdf))/0x5*(parseInt(_0x1b8122(0xe8))/0x6)+-parseInt(_0x1b8122(0xe0))/0x7*(parseInt(_0x1b8122(0xeb))/0x8)+parseInt(_0x1b8122(0xdd))/0x9*(-parseInt(_0x1b8122(0xed))/0xa)+parseInt(_0x1b8122(0xd1))/0xb*(parseInt(_0x1b8122(0xd8))/0xc);if(_0x162197===_0x3d6704)break;else _0x42a9d5['push'](_0x42a9d5['shift']());}catch(_0x5655b1){_0x42a9d5['push'](_0x42a9d5['shift']());}}}(a190_0x5616,0x77941));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a190_0x1a51(_0x433f92,_0x51903a){_0x433f92=_0x433f92-0xcb;const _0x56163c=a190_0x5616();let _0x1a51fb=_0x56163c[_0x433f92];return _0x1a51fb;}export const sqlList={'service':a190_0x3c6c22(0xd9),'command':a190_0x3c6c22(0xd4),'description':a190_0x3c6c22(0xf0),'risk':a190_0x3c6c22(0xe5),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0x3c6c22(0xec),'type':a190_0x3c6c22(0xcc),'description':a190_0x3c6c22(0xcb)},{'name':a190_0x3c6c22(0xcf),'type':a190_0x3c6c22(0xe3),'description':a190_0x3c6c22(0xe6),'default':0x1},{'name':a190_0x3c6c22(0xde),'type':a190_0x3c6c22(0xe3),'description':a190_0x3c6c22(0xf1)},{'name':a190_0x3c6c22(0xcd),'type':'boolean','description':a190_0x3c6c22(0xd5)}],async 'execute'(_0x406838){const _0x375d83=a190_0x3c6c22,_0x507951=await listSqlQueries(_0x406838['appCode'],{'sqlCode':_0x406838[_0x375d83(0xee)](_0x375d83(0xea))||undefined,'sqlName':_0x406838['str'](_0x375d83(0xec))||undefined,'currentPage':_0x406838[_0x375d83(0xda)](_0x375d83(0xcf)),'pageSize':_0x406838['num'](_0x375d83(0xde),0x32)}),_0x63faf1=_0x406838[_0x375d83(0xd7)](_0x375d83(0xcd)),_0x3d6618=_0x507951[_0x375d83(0xd2)]??[],_0x3b4bd7=_0x507951[_0x375d83(0xd6)]?.['totalCount']??_0x3d6618['length'];let _0x3f4dd7;return _0x63faf1?_0x3f4dd7=_0x3d6618:_0x3f4dd7=await Promise[_0x375d83(0xd0)](_0x3d6618[_0x375d83(0xf4)](async _0x4b204f=>{const _0x3ebd5b=_0x375d83;let _0x1a1c7a;try{_0x1a1c7a=_0x4b204f[_0x3ebd5b(0xdb)]?await getDbName(_0x406838[_0x3ebd5b(0xe7)],_0x4b204f[_0x3ebd5b(0xdb)]):undefined;}catch{}return{'sqlCode':_0x4b204f[_0x3ebd5b(0xe1)],'sqlName':_0x4b204f[_0x3ebd5b(0xd3)],'description':_0x4b204f[_0x3ebd5b(0xf5)]??'','db':_0x1a1c7a?_0x1a1c7a+'\x20('+_0x4b204f[_0x3ebd5b(0xdb)]+')':_0x4b204f[_0x3ebd5b(0xdb)]??''};})),{'ok':!![],'data':_0x3f4dd7,'message':_0x3d6618[_0x375d83(0xf3)]===0x0?_0x375d83(0xdc):_0x375d83(0xef)+_0x3d6618['length']+_0x375d83(0xe9)+_0x3b4bd7+').'};}};function a190_0x5616(){const _0x33d56d=['verbose','9959RhXkSU','page','all','12543157lRLSVE','tableData','sqlName','list','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','paging','bool','12GbyFoc','sql','num','dbId','No\x20custom\x20SQL\x20queries\x20found.','9IangVs','pagesize','89035hNaHtC','7KuCygn','sqlCode','52PXmgoE','number','64662oCYsFY','read','Page\x20number','appCode','132PSRFZY','\x20SQL\x20queries\x20(total:\x20','sqlcode','4112592PNuDlI','name','2303550brTXji','str','Found\x20','List\x20custom\x20SQL\x20queries','Page\x20size','391056vbrLZZ','length','map','description','Filter\x20by\x20SQL\x20name','string'];a190_0x5616=function(){return _0x33d56d;};return a190_0x5616();}
|