@lovrabet/rabetbase-cli 2.4.7-beta.1 → 2.4.7
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/README.md +4 -4
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.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/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +2 -2
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +1 -1
- package/lib/core/bff/utils.d.ts +2 -2
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/sidecar/flags.json +1 -1
- package/skills/rabetbase/SKILL.md +28 -28
- package/skills/rabetbase/guides/backend-function.md +30 -30
- package/skills/rabetbase/guides/best-practices.md +8 -8
- package/skills/rabetbase/guides/bff-creation-workflow.md +16 -16
- package/skills/rabetbase/guides/conflict-detection.md +3 -3
- package/skills/rabetbase/guides/custom-page-workflow.md +8 -8
- package/skills/rabetbase/guides/data-api-guidelines.md +6 -6
- package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +8 -8
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/troubleshooting.md +6 -6
- package/skills/rabetbase/guides/typescript-sdk.md +10 -10
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +1 -1
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +10 -10
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-bff-delete.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-detail.md +4 -4
- package/skills/rabetbase/references/rabetbase-bff-list.md +8 -8
- package/skills/rabetbase/references/rabetbase-bff-pull.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-push.md +3 -3
- package/skills/rabetbase/references/rabetbase-bff-status.md +1 -1
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -3
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +3 -3
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/rules/lovrabet_rules.mdc.tpl +7 -7
- package/templates/skill/SKILL.md.tpl +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a175_0x3992b9=a175_0x3812;function a175_0x3812(_0x578c37,_0x50179b){_0x578c37=_0x578c37-0x159;const _0x1077a3=a175_0x1077();let _0x381214=_0x1077a3[_0x578c37];return _0x381214;}(function(_0x1d9c44,_0x19eaf3){const _0x2c36a0=a175_0x3812,_0x35e76a=_0x1d9c44();while(!![]){try{const _0x7b878d=-parseInt(_0x2c36a0(0x163))/0x1*(-parseInt(_0x2c36a0(0x169))/0x2)+parseInt(_0x2c36a0(0x15b))/0x3*(-parseInt(_0x2c36a0(0x16d))/0x4)+parseInt(_0x2c36a0(0x160))/0x5*(parseInt(_0x2c36a0(0x16a))/0x6)+parseInt(_0x2c36a0(0x16b))/0x7+-parseInt(_0x2c36a0(0x15e))/0x8*(-parseInt(_0x2c36a0(0x168))/0x9)+parseInt(_0x2c36a0(0x15d))/0xa+-parseInt(_0x2c36a0(0x15f))/0xb;if(_0x7b878d===_0x19eaf3)break;else _0x35e76a['push'](_0x35e76a['shift']());}catch(_0xc63d49){_0x35e76a['push'](_0x35e76a['shift']());}}}(a175_0x1077,0x4d526));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=a175_0x3992b9(0x166);function a175_0x1077(){const _0xb72803=['27EwebMW','3316tgMLTN','18sOjNqw','2698962uOOgBj','\x20(id=','4FCEoXd','appCode','POST','role','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','318630yJXqWa','Role\x20still\x20has\x20','6263640ILNbnu','525384lURteh','14218028jekSGd','327455qWxJwq','userCount','Deleted\x20role\x20','187eQgzAD','high-risk-write','delete','/smartapi/permit/role/delete','roleName'];a175_0x1077=function(){return _0xb72803;};return a175_0x1077();}export const roleDelete={'service':a175_0x3992b9(0x159),'command':'delete','description':a175_0x3992b9(0x15a),'risk':a175_0x3992b9(0x164),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2ebb4e){const _0xabb17b=a175_0x3992b9,_0x120956=_0x2ebb4e['num']('id'),_0x289840=await getRoleById(_0x2ebb4e[_0xabb17b(0x16e)],_0x120956);return assertCustomRole(_0x289840,_0xabb17b(0x165)),asDryRunResult({'scope':'dev','operation':'delete','selector':{'appCode':_0x2ebb4e[_0xabb17b(0x16e)],'roleId':_0x120956,'roleName':_0x289840[_0xabb17b(0x167)]},'before':projectRole(_0x289840),'after':null,'dryRun':!![],'backend':{'method':_0xabb17b(0x16f),'path':DELETE_PATH},'warnings':_0x289840[_0xabb17b(0x161)]>0x0?[_0xabb17b(0x15c)+_0x289840[_0xabb17b(0x161)]+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0xabb17b(0x16f),'url':DELETE_PATH});},async 'execute'(_0x1df1d8){const _0x17412a=a175_0x3992b9,_0x19f628=_0x1df1d8['num']('id'),_0x563149=await getRoleById(_0x1df1d8['appCode'],_0x19f628);return assertCustomRole(_0x563149,'delete'),await deleteAppRole(_0x19f628),{'ok':!![],'data':{'scope':'dev','operation':'delete','selector':{'appCode':_0x1df1d8['appCode'],'roleId':_0x19f628,'roleName':_0x563149[_0x17412a(0x167)]},'before':projectRole(_0x563149),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x17412a(0x162)+_0x563149[_0x17412a(0x167)]+_0x17412a(0x16c)+_0x19f628+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a176_0x4e41c4=a176_0x7827;(function(_0x2c30e5,_0x4d0d9a){const _0x214a18=a176_0x7827,_0x4e20c6=_0x2c30e5();while(!![]){try{const _0xf44ae9=parseInt(_0x214a18(0x119))/0x1*(parseInt(_0x214a18(0x11d))/0x2)+-parseInt(_0x214a18(0x11c))/0x3+parseInt(_0x214a18(0x118))/0x4+parseInt(_0x214a18(0x117))/0x5*(parseInt(_0x214a18(0x111))/0x6)+-parseInt(_0x214a18(0x114))/0x7+parseInt(_0x214a18(0x11b))/0x8+parseInt(_0x214a18(0x113))/0x9*(-parseInt(_0x214a18(0x112))/0xa);if(_0xf44ae9===_0x4d0d9a)break;else _0x4e20c6['push'](_0x4e20c6['shift']());}catch(_0x5af6e7){_0x4e20c6['push'](_0x4e20c6['shift']());}}}(a176_0x1e21,0x569b0));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a176_0x7827(_0xc5879b,_0xa86316){_0xc5879b=_0xc5879b-0x111;const _0x1e2171=a176_0x1e21();let _0x7827a9=_0x1e2171[_0xc5879b];return _0x7827a9;}function a176_0x1e21(){const _0x35ee45=['Show\x20a\x20single\x20role\x27s\x20detail','Role\x20','4735qSPvBZ','2441132tBtHtH','233718AxUZUJ','dev','3896416gnjPEp','458523gzSdlR','2DeGTLS','num','appCode','read','roleType','roleName','4338YWMRsG','464150ygzMmr','207BxNCen','3084284vNXXaL'];a176_0x1e21=function(){return _0x35ee45;};return a176_0x1e21();}export const roleDetail={'service':'role','command':'detail','description':a176_0x4e41c4(0x115),'risk':a176_0x4e41c4(0x120),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x256c93){const _0x2ba86d=a176_0x4e41c4,_0x5248a9=_0x256c93[_0x2ba86d(0x11e)]('id'),_0x475b16=await getRoleById(_0x256c93[_0x2ba86d(0x11f)],_0x5248a9);return{'ok':!![],'data':{'scope':_0x2ba86d(0x11a),'role':projectRole(_0x475b16)},'message':_0x2ba86d(0x116)+_0x475b16[_0x2ba86d(0x122)]+'\x20('+_0x475b16[_0x2ba86d(0x121)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30729f,_0xa45b88){const _0x3d5eea=a177_0x22ac,_0x2aa4bc=_0x30729f();while(!![]){try{const _0x48984f=parseInt(_0x3d5eea(0x1ed))/0x1+parseInt(_0x3d5eea(0x1f2))/0x2+parseInt(_0x3d5eea(0x1ec))/0x3+parseInt(_0x3d5eea(0x1f0))/0x4*(parseInt(_0x3d5eea(0x1f4))/0x5)+-parseInt(_0x3d5eea(0x1ee))/0x6*(-parseInt(_0x3d5eea(0x1f5))/0x7)+parseInt(_0x3d5eea(0x1f1))/0x8+-parseInt(_0x3d5eea(0x1ef))/0x9*(parseInt(_0x3d5eea(0x1f3))/0xa);if(_0x48984f===_0xa45b88)break;else _0x2aa4bc['push'](_0x2aa4bc['shift']());}catch(_0x5e6401){_0x2aa4bc['push'](_0x2aa4bc['shift']());}}}(a177_0x2ee9,0xb3477));function a177_0x22ac(_0x8b8406,_0x4058f7){_0x8b8406=_0x8b8406-0x1ec;const _0x2ee9b6=a177_0x2ee9();let _0x22acfe=_0x2ee9b6[_0x8b8406];return _0x22acfe;}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a177_0x2ee9(){const _0x2abcf4=['2290480NuoThB','283806pevfvK','19124950YGobZy','5DXDkCM','26369nIiizy','1905471SVfpft','834524wkSWVd','570OCQMml','9SYiaDW','1564252sLyNzr'];a177_0x2ee9=function(){return _0x2abcf4;};return a177_0x2ee9();}import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0x1d82d4=a178_0x48c5;(function(_0x46b509,_0x2d40a9){const _0x11f401=a178_0x48c5,_0x4d8068=_0x46b509();while(!![]){try{const _0x2e8ab3=parseInt(_0x11f401(0x1d6))/0x1+-parseInt(_0x11f401(0x1d9))/0x2*(-parseInt(_0x11f401(0x1de))/0x3)+-parseInt(_0x11f401(0x1c8))/0x4+-parseInt(_0x11f401(0x1c9))/0x5*(-parseInt(_0x11f401(0x1c2))/0x6)+parseInt(_0x11f401(0x1cd))/0x7*(-parseInt(_0x11f401(0x1ca))/0x8)+parseInt(_0x11f401(0x1db))/0x9+-parseInt(_0x11f401(0x1bf))/0xa;if(_0x2e8ab3===_0x2d40a9)break;else _0x4d8068['push'](_0x4d8068['shift']());}catch(_0x1688f3){_0x4d8068['push'](_0x4d8068['shift']());}}}(a178_0x1455,0xbb161));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a178_0x1455(){const _0x5451e9=['1265381ULzgnD','map','toUpperCase','682wubouW','pagesize','343368dCZcYC','Page\x20size\x20(1-100)','read','5013RpiZKB','roleType','Page\x20index\x20(1-based)','type','str','trim','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','7709650icHtGb','appCode','ADMIN','198BrIeYY','\x20role(s)','number','includes','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','CUSTOM','4013376IXKiDa','123805WCkCrX','232PqZZsJ','filter','num','36169yUAalV','Found\x20','Filter\x20by\x20role\x20type','OWNER','Use\x20one\x20of:\x20','validation','length','string','page'];a178_0x1455=function(){return _0x5451e9;};return a178_0x1455();}const ROLE_TYPES=[a178_0x1d82d4(0x1c1),'DEV',a178_0x1d82d4(0x1d0),a178_0x1d82d4(0x1c7)];function a178_0x48c5(_0x3dd37b,_0x24682f){_0x3dd37b=_0x3dd37b-0x1bb;const _0x14550b=a178_0x1455();let _0x48c575=_0x14550b[_0x3dd37b];return _0x48c575;}export const roleList={'service':'role','command':'list','description':a178_0x1d82d4(0x1be),'risk':a178_0x1d82d4(0x1dd),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a178_0x1d82d4(0x1bb),'type':a178_0x1d82d4(0x1d4),'required':![],'description':a178_0x1d82d4(0x1cf),'enum':ROLE_TYPES},{'name':a178_0x1d82d4(0x1d5),'type':a178_0x1d82d4(0x1c4),'description':a178_0x1d82d4(0x1e0),'default':0x1},{'name':a178_0x1d82d4(0x1da),'type':'number','description':a178_0x1d82d4(0x1dc),'default':0x64}],async 'validate'(_0x13a6af){const _0x5bc0fe=a178_0x1d82d4,_0x1af351=_0x13a6af[_0x5bc0fe(0x1bc)](_0x5bc0fe(0x1bb))[_0x5bc0fe(0x1bd)]();if(_0x1af351&&!ROLE_TYPES[_0x5bc0fe(0x1c5)](_0x1af351[_0x5bc0fe(0x1d8)]()))throw CliErrors[_0x5bc0fe(0x1d2)]('Invalid\x20--type\x20\x22'+_0x1af351+'\x22.',_0x5bc0fe(0x1d1)+ROLE_TYPES['join'](',\x20')+'.');const _0x825658=_0x13a6af[_0x5bc0fe(0x1cc)]('page',0x1),_0x8530dd=_0x13a6af[_0x5bc0fe(0x1cc)](_0x5bc0fe(0x1da),0x64);if(_0x825658<0x1)throw CliErrors['validation'](_0x5bc0fe(0x1c6));if(_0x8530dd<0x1||_0x8530dd>0x64)throw CliErrors[_0x5bc0fe(0x1d2)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x263010){const _0x4c2924=a178_0x1d82d4,_0x1eaa48=_0x263010[_0x4c2924(0x1cc)]('page',0x1)||0x1,_0x37d023=_0x263010[_0x4c2924(0x1cc)](_0x4c2924(0x1da),0x64)||0x64,_0x8bb91d=_0x263010[_0x4c2924(0x1bc)](_0x4c2924(0x1bb))[_0x4c2924(0x1bd)]()[_0x4c2924(0x1d8)](),{items:_0x43b6f7,paging:_0xc39cc7}=await listAppRoles(_0x263010[_0x4c2924(0x1c0)],{'currentPage':_0x1eaa48,'pageSize':_0x37d023}),_0x2e7849=_0x8bb91d?_0x43b6f7[_0x4c2924(0x1cb)](_0xaa19ea=>_0xaa19ea[_0x4c2924(0x1df)]===_0x8bb91d):_0x43b6f7,_0x56078f=_0x2e7849[_0x4c2924(0x1d7)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x56078f,'paging':_0xc39cc7},'message':_0x4c2924(0x1ce)+_0x56078f[_0x4c2924(0x1d3)]+_0x4c2924(0x1c3)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a179_0x56e9b8=a179_0x1679;(function(_0x2b0669,_0x550f58){const _0x143645=a179_0x1679,_0x8a037d=_0x2b0669();while(!![]){try{const _0x775521=parseInt(_0x143645(0x17b))/0x1*(-parseInt(_0x143645(0x178))/0x2)+-parseInt(_0x143645(0x16b))/0x3*(parseInt(_0x143645(0x151))/0x4)+-parseInt(_0x143645(0x133))/0x5+parseInt(_0x143645(0x141))/0x6*(-parseInt(_0x143645(0x142))/0x7)+-parseInt(_0x143645(0x15c))/0x8+parseInt(_0x143645(0x16d))/0x9*(-parseInt(_0x143645(0x160))/0xa)+parseInt(_0x143645(0x171))/0xb;if(_0x775521===_0x550f58)break;else _0x8a037d['push'](_0x8a037d['shift']());}catch(_0x3a3481){_0x8a037d['push'](_0x8a037d['shift']());}}}(a179_0x20cc,0x349a3));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';function a179_0x1679(_0x2a1578,_0x17925e){_0x2a1578=_0x2a1578-0x132;const _0x20cccc=a179_0x20cc();let _0x16791b=_0x20cccc[_0x2a1578];return _0x16791b;}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a179_0x56e9b8(0x144),'required':!![],'description':a179_0x56e9b8(0x148)};export const ROLE_REF_FLAG={'name':a179_0x56e9b8(0x138),'type':a179_0x56e9b8(0x13f),'required':!![],'description':a179_0x56e9b8(0x163)};export const USER_REF_FLAG={'name':a179_0x56e9b8(0x139),'type':'string','required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':a179_0x56e9b8(0x13f),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a179_0x56e9b8(0x153),'type':'string','required':!![],'description':a179_0x56e9b8(0x15f)};export const REMARK_FLAG={'name':'remark','type':a179_0x56e9b8(0x13f),'required':![],'description':a179_0x56e9b8(0x152)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a179_0x56e9b8(0x144),'required':![],'description':a179_0x56e9b8(0x15d)};export const BUILTIN_ROLE_TYPES=['ADMIN',a179_0x56e9b8(0x16f),a179_0x56e9b8(0x158)];export function isBuiltinRole(_0x1546df){const _0xe1b313=a179_0x56e9b8;return BUILTIN_ROLE_TYPES[_0xe1b313(0x166)](_0x1546df);}export function assertCustomRole(_0x5c9580,_0x23a961){const _0x399b7a=a179_0x56e9b8;if(_0x5c9580[_0x399b7a(0x16c)]!==_0x399b7a(0x17c))throw CliErrors[_0x399b7a(0x13a)](_0x399b7a(0x150)+_0x23a961+_0x399b7a(0x159)+_0x5c9580[_0x399b7a(0x14b)]+'\x20('+_0x5c9580['roleType']+').',_0x399b7a(0x15e));}function a179_0x20cc(){const _0x43bd10=['DEV','Pass\x20--role\x20<id|name>.','19111895nlsbLU','length','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','join','authRequired','dev','2ohejBv','\x20not\x20found\x20in\x20app\x20','userId','236584rsozYm','CUSTOM','username','POST','Disambiguate\x20with\x20--role\x20<id>.','tenant_code','706835ceHHzO','user-add','str','remark','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','role','user','validation','tenant','flagMissing','Missing\x20role\x20reference.','push','string','toLowerCase','6KHMukh','2171806pQtCFX','flag','number','trim','map','nickname','Role\x20id\x20(from\x20`role\x20list`)','User\x20',';\x20no\x20change.','roleName','appCode','\x22\x20is\x20ambiguous\x20(ids:\x20','totalCount','Missing\x20user\x20reference.','Cannot\x20','8WHIRJR','Optional\x20role\x20remark/description','name','\x20duplicate\x20memberships\x20for\x20user\x20','dryRun','Anti-drift\x20check\x20failed:\x20expected\x20','find','OWNER','\x20built-in\x20role\x20','Pass\x20--user\x20<id|name>.','test','3015048FyAgpX','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','1288370RVjkde','filter','userCount','Role\x20id\x20or\x20exact\x20role\x20name','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20member(s)\x20but\x20role\x20has\x20','includes','\x22\x20not\x20found\x20in\x20app\x20','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x22:\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','298833ZPUIFo','roleType','18RFmjiS','expectUserCount'];a179_0x20cc=function(){return _0x43bd10;};return a179_0x20cc();}export function projectRole(_0x94495e){const _0x204e81=a179_0x56e9b8;return{'id':_0x94495e['id'],'roleName':_0x94495e[_0x204e81(0x14b)],'roleType':_0x94495e[_0x204e81(0x16c)],'remark':_0x94495e[_0x204e81(0x136)],'userCount':_0x94495e[_0x204e81(0x162)],'permitCount':_0x94495e['permitCount'],'builtin':isBuiltinRole(_0x94495e[_0x204e81(0x16c)])};}export async function resolveRoleRef(_0x36d5ca,_0x39092b){const _0x3ad65e=a179_0x56e9b8,_0x5b87a9=_0x39092b['trim']();if(!_0x5b87a9)throw CliErrors[_0x3ad65e(0x13a)](_0x3ad65e(0x13d),_0x3ad65e(0x170));if(/^\d+$/[_0x3ad65e(0x15b)](_0x5b87a9))return getRoleById(_0x36d5ca,Number(_0x5b87a9));const _0x58f960=await listAllAppRoles(_0x36d5ca),_0x3232ae=_0x58f960[_0x3ad65e(0x161)](_0x4898d8=>_0x4898d8[_0x3ad65e(0x14b)]===_0x5b87a9);if(_0x3232ae[_0x3ad65e(0x172)]===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x5b87a9+_0x3ad65e(0x167)+_0x36d5ca+'.',_0x3ad65e(0x173));if(_0x3232ae[_0x3ad65e(0x172)]>0x1){const _0x173579=_0x3232ae[_0x3ad65e(0x146)](_0x1de1d3=>_0x1de1d3['id'])[_0x3ad65e(0x175)](',\x20');throw CliErrors[_0x3ad65e(0x13a)]('Role\x20name\x20\x22'+_0x5b87a9+_0x3ad65e(0x14d)+_0x173579+').',_0x3ad65e(0x17f));}return _0x3232ae[0x0];}export async function getRoleById(_0x5a9163,_0x5a111b){const _0x8453d6=a179_0x56e9b8,_0x1d1ad4=await listAllAppRoles(_0x5a9163),_0x4e04e2=_0x1d1ad4[_0x8453d6(0x161)](_0x49460e=>_0x49460e['id']===_0x5a111b&&(!_0x49460e[_0x8453d6(0x14c)]||_0x49460e[_0x8453d6(0x14c)]===_0x5a9163));if(_0x4e04e2['length']!==0x1)throw CliErrors[_0x8453d6(0x13a)]('Role\x20id\x20'+_0x5a111b+_0x8453d6(0x179)+_0x5a9163+'.',_0x8453d6(0x137));return _0x4e04e2[0x0];}async function listAllAppRoles(_0x4b3ec3){const _0x4ee1cb=a179_0x56e9b8,_0xbbdc5b=0x64,_0x320074=[];for(let _0xa16021=0x1;;_0xa16021+=0x1){const {items:_0x364145,paging:_0xbf1475}=await listAppRoles(_0x4b3ec3,{'currentPage':_0xa16021,'pageSize':_0xbbdc5b});_0x320074[_0x4ee1cb(0x13e)](..._0x364145);if(_0x364145[_0x4ee1cb(0x172)]<_0xbbdc5b||_0xbf1475&&_0x320074[_0x4ee1cb(0x172)]>=_0xbf1475[_0x4ee1cb(0x14e)])return _0x320074;}}export async function resolveTenantCode(){const _0x4a1a73=a179_0x56e9b8,_0x5412f5=await getSessionUserInfo(),_0x4ae246=_0x5412f5?.[_0x4a1a73(0x139)]?.[_0x4a1a73(0x13b)]?.[_0x4a1a73(0x132)];if(!_0x4ae246)throw CliErrors[_0x4a1a73(0x176)](_0x4a1a73(0x168));return _0x4ae246;}function matchMember(_0x23c5b3,_0x226ecc){const _0xf4ad4f=a179_0x56e9b8,_0x2f0a7d=_0x226ecc[_0xf4ad4f(0x145)]()['toLowerCase']();return(_0x23c5b3[_0xf4ad4f(0x147)]??'')[_0xf4ad4f(0x140)]()===_0x2f0a7d||(_0x23c5b3['username']??'')[_0xf4ad4f(0x140)]()===_0x2f0a7d;}export async function resolveUserRef(_0x5b99f5){const _0x124aa8=a179_0x56e9b8,_0x37f977=_0x5b99f5['trim']();if(!_0x37f977)throw CliErrors['validation'](_0x124aa8(0x14f),_0x124aa8(0x15a));const _0x516001=await resolveTenantCode(),_0x49edd5=await getTenantMembers(_0x516001);if(/^\d+$/['test'](_0x37f977)){const _0x1b1eb3=Number(_0x37f977),_0x105305=_0x49edd5[_0x124aa8(0x157)](_0x3d7e15=>_0x3d7e15[_0x124aa8(0x17a)]===_0x1b1eb3);return{'userId':_0x1b1eb3,'username':_0x105305?.[_0x124aa8(0x17d)]??String(_0x1b1eb3),'nickname':_0x105305?.[_0x124aa8(0x147)],'matchedBy':'id'};}const _0x52b9de=_0x49edd5[_0x124aa8(0x161)](_0x53b593=>matchMember(_0x53b593,_0x37f977));if(_0x52b9de[_0x124aa8(0x172)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x37f977+'\x22.',_0x124aa8(0x174));if(_0x52b9de[_0x124aa8(0x172)]>0x1){const _0x743fda=_0x52b9de[_0x124aa8(0x146)](_0x18313b=>(_0x18313b[_0x124aa8(0x147)]??_0x18313b[_0x124aa8(0x17d)]??'?')+'('+_0x18313b[_0x124aa8(0x17a)]+')')[_0x124aa8(0x175)](',\x20');throw CliErrors[_0x124aa8(0x13a)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x37f977+_0x124aa8(0x169)+_0x743fda+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x43182b=_0x52b9de[0x0];return{'userId':_0x43182b[_0x124aa8(0x17a)],'username':_0x43182b[_0x124aa8(0x17d)]??String(_0x43182b[_0x124aa8(0x17a)]),'nickname':_0x43182b[_0x124aa8(0x147)],'matchedBy':_0x124aa8(0x153)};}export const CREATE_USER_ROLE_PATH='/smartapi/permit/user-role/create';export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x4ea75f){const _0x5b4468=a179_0x56e9b8,{operation:_0x18b7d8,appCode:_0x17333d,role:_0x4448cc,relations:_0x3e6954,user:_0x1592fa}=_0x4ea75f,_0x2f21f7=[...new Set(_0x3e6954[_0x5b4468(0x146)](_0x504de2=>_0x504de2['userId']))],_0xf5d68f=[];if(_0x4ea75f[_0x5b4468(0x16e)]!==undefined&&_0x4ea75f[_0x5b4468(0x16e)]!==_0x2f21f7['length'])throw CliErrors[_0x5b4468(0x13a)](_0x5b4468(0x156)+_0x4ea75f[_0x5b4468(0x16e)]+_0x5b4468(0x165)+_0x2f21f7[_0x5b4468(0x172)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x35f8da=_0x2f21f7[_0x5b4468(0x166)](_0x1592fa[_0x5b4468(0x17a)]),_0x33b339=_0x3e6954[_0x5b4468(0x161)](_0x4a04cf=>_0x4a04cf[_0x5b4468(0x17a)]===_0x1592fa['userId'])[_0x5b4468(0x146)](_0x4377a9=>_0x4377a9['id']),_0x5e1fbf=_0x18b7d8===_0x5b4468(0x134)?!_0x35f8da:_0x35f8da;let _0x506611=_0x2f21f7;_0x18b7d8==='user-add'?_0x35f8da?_0xf5d68f[_0x5b4468(0x13e)]('User\x20'+_0x1592fa[_0x5b4468(0x17a)]+_0x5b4468(0x16a)+_0x4448cc['roleName']+_0x5b4468(0x14a)):_0x506611=[..._0x2f21f7,_0x1592fa[_0x5b4468(0x17a)]]:!_0x35f8da?_0xf5d68f[_0x5b4468(0x13e)](_0x5b4468(0x149)+_0x1592fa[_0x5b4468(0x17a)]+_0x5b4468(0x164)+_0x4448cc['roleName']+_0x5b4468(0x14a)):(_0x506611=_0x2f21f7['filter'](_0x106302=>_0x106302!==_0x1592fa['userId']),_0x33b339[_0x5b4468(0x172)]>0x1&&_0xf5d68f[_0x5b4468(0x13e)]('Removed\x20'+_0x33b339[_0x5b4468(0x172)]+_0x5b4468(0x154)+_0x1592fa[_0x5b4468(0x17a)]+'.'));const _0x95c811={'scope':_0x5b4468(0x177),'operation':_0x18b7d8,'selector':{'appCode':_0x17333d,'roleId':_0x4448cc['id'],'roleName':_0x4448cc[_0x5b4468(0x14b)],'userId':_0x1592fa[_0x5b4468(0x17a)]},'before':{'userIds':_0x2f21f7},'after':{'userIds':_0x506611},'dryRun':_0x4ea75f[_0x5b4468(0x155)],'backend':{'method':_0x5b4468(0x17e),'path':_0x18b7d8===_0x5b4468(0x134)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xf5d68f};return{'mutation':_0x95c811,'changed':_0x5e1fbf,'matchingRelationIds':_0x33b339};}export async function loadDevRoleRelations(_0x5392e9,_0x4c0de8){const _0x12eb88=a179_0x56e9b8,_0x9c24bd=0x64,_0x4f5744=[];for(let _0x43d046=0x1;;_0x43d046+=0x1){const {items:_0x58d222,paging:_0x4a7a16}=await listDevUserRoleRelations(_0x5392e9,{'roleId':_0x4c0de8,'currentPage':_0x43d046,'pageSize':_0x9c24bd});_0x4f5744['push'](..._0x58d222);if(_0x58d222['length']<_0x9c24bd||_0x4a7a16&&_0x4f5744[_0x12eb88(0x172)]>=_0x4a7a16[_0x12eb88(0x14e)])return _0x4f5744;}}export function readRoleRef(_0x38cbc5){const _0x5f187a=a179_0x56e9b8,_0x3f5798=_0x38cbc5[_0x5f187a(0x135)](_0x5f187a(0x138))[_0x5f187a(0x145)]();if(!_0x3f5798)throw CliErrors[_0x5f187a(0x13c)](_0x5f187a(0x138),_0x5f187a(0x170));return _0x3f5798;}export async function prepareUserMutation(_0x50511c,_0x39f136,_0x10b8a3){const _0x24ef3a=a179_0x56e9b8,_0x461516=readRoleRef(_0x50511c),_0x21d4bc=_0x50511c[_0x24ef3a(0x135)]('user')[_0x24ef3a(0x145)]();if(!_0x21d4bc)throw CliErrors[_0x24ef3a(0x13c)](_0x24ef3a(0x139),_0x24ef3a(0x15a));const _0x517358=_0x50511c[_0x24ef3a(0x143)]('expect-user-count'),_0x29d3dc=_0x517358===undefined||_0x517358===null?undefined:Number(_0x517358),_0x11df95=await resolveRoleRef(_0x50511c[_0x24ef3a(0x14c)],_0x461516);if(_0x11df95[_0x24ef3a(0x16c)]===_0x24ef3a(0x158))throw CliErrors[_0x24ef3a(0x13a)](_0x24ef3a(0x150)+_0x39f136+'\x20members\x20of\x20the\x20OWNER\x20role.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x4a51ac=await resolveUserRef(_0x21d4bc),_0x5b2a57=await loadDevRoleRelations(_0x50511c['appCode'],_0x11df95['id']);return{...computeRoleUserMutation({'operation':_0x39f136,'appCode':_0x50511c['appCode'],'role':_0x11df95,'relations':_0x5b2a57,'user':{'userId':_0x4a51ac[_0x24ef3a(0x17a)],'username':_0x4a51ac[_0x24ef3a(0x17d)],'nickname':_0x4a51ac[_0x24ef3a(0x147)]},'dryRun':_0x10b8a3,..._0x29d3dc!==undefined?{'expectUserCount':_0x29d3dc}:{}}),'role':_0x11df95,'user':_0x4a51ac};}
|
|
1
|
+
const a179_0x4f7b6a=a179_0x253a;(function(_0x1e9ff6,_0x44c434){const _0x2e2350=a179_0x253a,_0x240ebe=_0x1e9ff6();while(!![]){try{const _0x5371b9=-parseInt(_0x2e2350(0x1fa))/0x1*(parseInt(_0x2e2350(0x231))/0x2)+-parseInt(_0x2e2350(0x21d))/0x3+parseInt(_0x2e2350(0x208))/0x4*(parseInt(_0x2e2350(0x1eb))/0x5)+parseInt(_0x2e2350(0x204))/0x6+parseInt(_0x2e2350(0x207))/0x7*(-parseInt(_0x2e2350(0x22f))/0x8)+parseInt(_0x2e2350(0x222))/0x9+-parseInt(_0x2e2350(0x217))/0xa*(-parseInt(_0x2e2350(0x1ea))/0xb);if(_0x5371b9===_0x44c434)break;else _0x240ebe['push'](_0x240ebe['shift']());}catch(_0x2063c5){_0x240ebe['push'](_0x240ebe['shift']());}}}(a179_0x1020,0x2df04));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':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a179_0x1020(){const _0x3f9fae=['roleType','Role\x20id\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','trim',';\x20no\x20change.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','flagMissing','14650CTRsuf','map','appCode','/smartapi/permit/user-role/delete','authRequired','toLowerCase','235341dgEoxP','totalCount','user','\x20members\x20of\x20the\x20OWNER\x20role.','ADMIN','1435509hyKrZJ','dev','\x22\x20is\x20ambiguous\x20(ids:\x20','userId','join','tenant','Cannot\x20','Anti-drift\x20check\x20failed:\x20expected\x20','Role\x20name','role','\x20duplicate\x20memberships\x20for\x20user\x20','user-add','nickname','8doBVOS','\x20built-in\x20role\x20','2swBsPu','Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.','\x20not\x20found\x20in\x20app\x20','Pass\x20--role\x20<id|name>.','Removed\x20','remark','validation','User\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','583nxjBmf','6140yNyKRL','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','permitCount','length','/smartapi/permit/user-role/create','filter','Optional\x20role\x20remark/description','string','includes','flag','roleName','No\x20tenant\x20member\x20matches\x20\x22','187871PHXYyh','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x22:\x20','expect-user-count','str','name','Multiple\x20tenant\x20members\x20match\x20\x22','\x20member(s)\x20but\x20role\x20has\x20','userCount','dryRun','1868142kwTUrZ','push','find','1767031FIUFyJ','516IowgIn','Disambiguate\x20with\x20--user\x20<id>.','POST','username','Role\x20name\x20\x22','CUSTOM','number','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.'];a179_0x1020=function(){return _0x3f9fae;};return a179_0x1020();}export const ROLE_REF_FLAG={'name':a179_0x4f7b6a(0x22b),'type':a179_0x4f7b6a(0x1f5),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':'user','type':a179_0x4f7b6a(0x1f5),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':a179_0x4f7b6a(0x1f5),'required':!![],'description':a179_0x4f7b6a(0x22a)};export const USER_NAME_FLAG={'name':'name','type':a179_0x4f7b6a(0x1f5),'required':!![],'description':a179_0x4f7b6a(0x1ef)};export const REMARK_FLAG={'name':'remark','type':a179_0x4f7b6a(0x1f5),'required':![],'description':a179_0x4f7b6a(0x1f4)};export const EXPECT_USER_COUNT_FLAG={'name':a179_0x4f7b6a(0x1fd),'type':a179_0x4f7b6a(0x20e),'required':![],'description':a179_0x4f7b6a(0x1fb)};export const BUILTIN_ROLE_TYPES=[a179_0x4f7b6a(0x221),'DEV','OWNER'];export function isBuiltinRole(_0x403998){const _0x1e399e=a179_0x4f7b6a;return BUILTIN_ROLE_TYPES[_0x1e399e(0x1f6)](_0x403998);}export function assertCustomRole(_0x300224,_0x15c0a2){const _0x253117=a179_0x4f7b6a;if(_0x300224[_0x253117(0x210)]!==_0x253117(0x20d))throw CliErrors['validation'](_0x253117(0x228)+_0x15c0a2+_0x253117(0x230)+_0x300224[_0x253117(0x1f8)]+'\x20('+_0x300224['roleType']+').',_0x253117(0x20f));}export function projectRole(_0x4311d5){const _0x486fe9=a179_0x4f7b6a;return{'id':_0x4311d5['id'],'roleName':_0x4311d5[_0x486fe9(0x1f8)],'roleType':_0x4311d5[_0x486fe9(0x210)],'remark':_0x4311d5[_0x486fe9(0x1e6)],'userCount':_0x4311d5[_0x486fe9(0x202)],'permitCount':_0x4311d5[_0x486fe9(0x1f0)],'builtin':isBuiltinRole(_0x4311d5['roleType'])};}export async function resolveRoleRef(_0x13032a,_0x482a3f){const _0xe56a27=a179_0x4f7b6a,_0x299790=_0x482a3f['trim']();if(!_0x299790)throw CliErrors[_0xe56a27(0x1e7)]('Missing\x20role\x20reference.',_0xe56a27(0x235));if(/^\d+$/['test'](_0x299790))return getRoleById(_0x13032a,Number(_0x299790));const _0x2af15f=await listAllAppRoles(_0x13032a),_0x1fb516=_0x2af15f[_0xe56a27(0x1f3)](_0x207029=>_0x207029[_0xe56a27(0x1f8)]===_0x299790);if(_0x1fb516[_0xe56a27(0x1f1)]===0x0)throw CliErrors['validation'](_0xe56a27(0x20c)+_0x299790+'\x22\x20not\x20found\x20in\x20app\x20'+_0x13032a+'.',_0xe56a27(0x215));if(_0x1fb516[_0xe56a27(0x1f1)]>0x1){const _0x30c03e=_0x1fb516[_0xe56a27(0x218)](_0x3d26e9=>_0x3d26e9['id'])[_0xe56a27(0x226)](',\x20');throw CliErrors[_0xe56a27(0x1e7)]('Role\x20name\x20\x22'+_0x299790+_0xe56a27(0x224)+_0x30c03e+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x1fb516[0x0];}export async function getRoleById(_0x277719,_0x5e1e88){const _0x1cd843=a179_0x4f7b6a,_0x1c0e99=await listAllAppRoles(_0x277719),_0x5f1a00=_0x1c0e99[_0x1cd843(0x1f3)](_0x2a5f86=>_0x2a5f86['id']===_0x5e1e88&&(!_0x2a5f86[_0x1cd843(0x219)]||_0x2a5f86[_0x1cd843(0x219)]===_0x277719));if(_0x5f1a00[_0x1cd843(0x1f1)]!==0x1)throw CliErrors['validation'](_0x1cd843(0x211)+_0x5e1e88+_0x1cd843(0x234)+_0x277719+'.',_0x1cd843(0x1e9));return _0x5f1a00[0x0];}async function listAllAppRoles(_0x4e067f){const _0x17a491=a179_0x4f7b6a,_0x35b506=0x64,_0x24413c=[];for(let _0x495778=0x1;;_0x495778+=0x1){const {items:_0x200725,paging:_0x4306db}=await listAppRoles(_0x4e067f,{'currentPage':_0x495778,'pageSize':_0x35b506});_0x24413c[_0x17a491(0x205)](..._0x200725);if(_0x200725[_0x17a491(0x1f1)]<_0x35b506||_0x4306db&&_0x24413c[_0x17a491(0x1f1)]>=_0x4306db[_0x17a491(0x21e)])return _0x24413c;}}export async function resolveTenantCode(){const _0x4eb624=a179_0x4f7b6a,_0x7a95ff=await getSessionUserInfo(),_0x2f4d5d=_0x7a95ff?.[_0x4eb624(0x21f)]?.[_0x4eb624(0x227)]?.['tenant_code'];if(!_0x2f4d5d)throw CliErrors[_0x4eb624(0x21b)](_0x4eb624(0x1ed));return _0x2f4d5d;}function matchMember(_0x1db60c,_0x192a39){const _0xd01bee=a179_0x4f7b6a,_0x34c9f2=_0x192a39['trim']()['toLowerCase']();return(_0x1db60c[_0xd01bee(0x22e)]??'')[_0xd01bee(0x21c)]()===_0x34c9f2||(_0x1db60c[_0xd01bee(0x20b)]??'')[_0xd01bee(0x21c)]()===_0x34c9f2;}export async function resolveUserRef(_0x511f28){const _0x4f946d=a179_0x4f7b6a,_0x538634=_0x511f28[_0x4f946d(0x213)]();if(!_0x538634)throw CliErrors[_0x4f946d(0x1e7)](_0x4f946d(0x232),_0x4f946d(0x233));const _0x3f4733=await resolveTenantCode(),_0x422f82=await getTenantMembers(_0x3f4733);if(/^\d+$/['test'](_0x538634)){const _0x293d95=Number(_0x538634),_0x14debc=_0x422f82[_0x4f946d(0x206)](_0x2d4d65=>_0x2d4d65[_0x4f946d(0x225)]===_0x293d95);return{'userId':_0x293d95,'username':_0x14debc?.[_0x4f946d(0x20b)]??String(_0x293d95),'nickname':_0x14debc?.[_0x4f946d(0x22e)],'matchedBy':'id'};}const _0xfda78=_0x422f82[_0x4f946d(0x1f3)](_0x3860ff=>matchMember(_0x3860ff,_0x538634));if(_0xfda78[_0x4f946d(0x1f1)]===0x0)throw CliErrors[_0x4f946d(0x1e7)](_0x4f946d(0x1f9)+_0x538634+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0xfda78[_0x4f946d(0x1f1)]>0x1){const _0x279947=_0xfda78[_0x4f946d(0x218)](_0x741186=>(_0x741186[_0x4f946d(0x22e)]??_0x741186[_0x4f946d(0x20b)]??'?')+'('+_0x741186[_0x4f946d(0x225)]+')')[_0x4f946d(0x226)](',\x20');throw CliErrors['validation'](_0x4f946d(0x200)+_0x538634+_0x4f946d(0x1fc)+_0x279947+'.',_0x4f946d(0x209));}const _0x666244=_0xfda78[0x0];return{'userId':_0x666244[_0x4f946d(0x225)],'username':_0x666244[_0x4f946d(0x20b)]??String(_0x666244[_0x4f946d(0x225)]),'nickname':_0x666244['nickname'],'matchedBy':_0x4f946d(0x1ff)};}function a179_0x253a(_0x3a144e,_0x13e3e1){_0x3a144e=_0x3a144e-0x1e6;const _0x1020eb=a179_0x1020();let _0x253aa6=_0x1020eb[_0x3a144e];return _0x253aa6;}export const CREATE_USER_ROLE_PATH=a179_0x4f7b6a(0x1f2);export const DELETE_USER_ROLE_PATH=a179_0x4f7b6a(0x21a);export function computeRoleUserMutation(_0x40e850){const _0x40e9de=a179_0x4f7b6a,{operation:_0x5ebf10,appCode:_0x42a652,role:_0x20cb95,relations:_0x1e498f,user:_0x47b3f7}=_0x40e850,_0x5166a2=[...new Set(_0x1e498f[_0x40e9de(0x218)](_0x2d9aad=>_0x2d9aad[_0x40e9de(0x225)]))],_0x4a2037=[];if(_0x40e850['expectUserCount']!==undefined&&_0x40e850['expectUserCount']!==_0x5166a2[_0x40e9de(0x1f1)])throw CliErrors[_0x40e9de(0x1e7)](_0x40e9de(0x229)+_0x40e850['expectUserCount']+_0x40e9de(0x201)+_0x5166a2[_0x40e9de(0x1f1)]+'.',_0x40e9de(0x1ec));const _0x46558a=_0x5166a2[_0x40e9de(0x1f6)](_0x47b3f7['userId']),_0x155f8d=_0x1e498f[_0x40e9de(0x1f3)](_0x277748=>_0x277748[_0x40e9de(0x225)]===_0x47b3f7[_0x40e9de(0x225)])[_0x40e9de(0x218)](_0x184f01=>_0x184f01['id']),_0x24bee9=_0x5ebf10===_0x40e9de(0x22d)?!_0x46558a:_0x46558a;let _0x12d490=_0x5166a2;_0x5ebf10==='user-add'?_0x46558a?_0x4a2037[_0x40e9de(0x205)](_0x40e9de(0x1e8)+_0x47b3f7[_0x40e9de(0x225)]+_0x40e9de(0x212)+_0x20cb95['roleName']+_0x40e9de(0x214)):_0x12d490=[..._0x5166a2,_0x47b3f7['userId']]:!_0x46558a?_0x4a2037['push']('User\x20'+_0x47b3f7[_0x40e9de(0x225)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x20cb95[_0x40e9de(0x1f8)]+_0x40e9de(0x214)):(_0x12d490=_0x5166a2[_0x40e9de(0x1f3)](_0x118041=>_0x118041!==_0x47b3f7[_0x40e9de(0x225)]),_0x155f8d['length']>0x1&&_0x4a2037[_0x40e9de(0x205)](_0x40e9de(0x236)+_0x155f8d[_0x40e9de(0x1f1)]+_0x40e9de(0x22c)+_0x47b3f7[_0x40e9de(0x225)]+'.'));const _0x2dac46={'scope':_0x40e9de(0x223),'operation':_0x5ebf10,'selector':{'appCode':_0x42a652,'roleId':_0x20cb95['id'],'roleName':_0x20cb95[_0x40e9de(0x1f8)],'userId':_0x47b3f7[_0x40e9de(0x225)]},'before':{'userIds':_0x5166a2},'after':{'userIds':_0x12d490},'dryRun':_0x40e850[_0x40e9de(0x203)],'backend':{'method':_0x40e9de(0x20a),'path':_0x5ebf10===_0x40e9de(0x22d)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x4a2037};return{'mutation':_0x2dac46,'changed':_0x24bee9,'matchingRelationIds':_0x155f8d};}export async function loadDevRoleRelations(_0x24dea3,_0x5699e1){const _0x2d2e6a=a179_0x4f7b6a,_0x3585d7=0x64,_0x38c7f3=[];for(let _0x43b30c=0x1;;_0x43b30c+=0x1){const {items:_0x2c5b05,paging:_0xc34876}=await listDevUserRoleRelations(_0x24dea3,{'roleId':_0x5699e1,'currentPage':_0x43b30c,'pageSize':_0x3585d7});_0x38c7f3['push'](..._0x2c5b05);if(_0x2c5b05[_0x2d2e6a(0x1f1)]<_0x3585d7||_0xc34876&&_0x38c7f3[_0x2d2e6a(0x1f1)]>=_0xc34876[_0x2d2e6a(0x21e)])return _0x38c7f3;}}export function readRoleRef(_0x252251){const _0x25ada2=a179_0x4f7b6a,_0x3570ed=_0x252251[_0x25ada2(0x1fe)](_0x25ada2(0x22b))['trim']();if(!_0x3570ed)throw CliErrors[_0x25ada2(0x216)]('role','Pass\x20--role\x20<id|name>.');return _0x3570ed;}export async function prepareUserMutation(_0x1edfdc,_0x1c3e01,_0x518098){const _0x265128=a179_0x4f7b6a,_0x3a9656=readRoleRef(_0x1edfdc),_0x5c9150=_0x1edfdc[_0x265128(0x1fe)](_0x265128(0x21f))['trim']();if(!_0x5c9150)throw CliErrors[_0x265128(0x216)](_0x265128(0x21f),_0x265128(0x233));const _0x294288=_0x1edfdc[_0x265128(0x1f7)]('expect-user-count'),_0x4b9be9=_0x294288===undefined||_0x294288===null?undefined:Number(_0x294288),_0xb2684d=await resolveRoleRef(_0x1edfdc[_0x265128(0x219)],_0x3a9656);if(_0xb2684d['roleType']==='OWNER')throw CliErrors[_0x265128(0x1e7)](_0x265128(0x228)+_0x1c3e01+_0x265128(0x220),_0x265128(0x1ee));const _0x7f1a62=await resolveUserRef(_0x5c9150),_0x2437fe=await loadDevRoleRelations(_0x1edfdc[_0x265128(0x219)],_0xb2684d['id']);return{...computeRoleUserMutation({'operation':_0x1c3e01,'appCode':_0x1edfdc[_0x265128(0x219)],'role':_0xb2684d,'relations':_0x2437fe,'user':{'userId':_0x7f1a62[_0x265128(0x225)],'username':_0x7f1a62[_0x265128(0x20b)],'nickname':_0x7f1a62[_0x265128(0x22e)]},'dryRun':_0x518098,..._0x4b9be9!==undefined?{'expectUserCount':_0x4b9be9}:{}}),'role':_0xb2684d,'user':_0x7f1a62};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x36d943=a180_0x41f8;(function(_0x1c7081,_0x31b858){const _0x193450=a180_0x41f8,_0x57f09d=_0x1c7081();while(!![]){try{const _0x38aaef=-parseInt(_0x193450(0x197))/0x1+parseInt(_0x193450(0x1a0))/0x2+parseInt(_0x193450(0x1a2))/0x3*(-parseInt(_0x193450(0x1a3))/0x4)+parseInt(_0x193450(0x19a))/0x5*(parseInt(_0x193450(0x19e))/0x6)+-parseInt(_0x193450(0x1a7))/0x7+-parseInt(_0x193450(0x195))/0x8*(-parseInt(_0x193450(0x191))/0x9)+-parseInt(_0x193450(0x199))/0xa*(parseInt(_0x193450(0x1a6))/0xb);if(_0x38aaef===_0x31b858)break;else _0x57f09d['push'](_0x57f09d['shift']());}catch(_0x14df1f){_0x57f09d['push'](_0x57f09d['shift']());}}}(a180_0xc751,0x38fbd));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a180_0x41f8(_0xd045ce,_0x4438f8){_0xd045ce=_0xd045ce-0x189;const _0xc7514f=a180_0xc751();let _0x41f8e1=_0xc7514f[_0xd045ce];return _0x41f8e1;}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a180_0x36d943(0x193);function a180_0xc751(){const _0x334c72=['validation','1443184GhqJYm','trim','117539EBOtBj','flag','725840IUPKvF','505gNeXrb','\x20(id=','dev','name','26064bRhekw','length','649618RKZgDG','num','60822GPYaxr','16efyWCN','roleName','update','55kAjJTA','1042937KVcCDa','Nothing\x20to\x20update.','New\x20role\x20name','remark','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','role','appCode','POST','9bRAyAf','string','/smartapi/permit/role/update'];a180_0xc751=function(){return _0x334c72;};return a180_0xc751();}function readPatch(_0x2963ce){const _0xcc5076=a180_0x36d943,_0x20e3c0=_0x2963ce[_0xcc5076(0x198)]('name'),_0x53157f=_0x2963ce[_0xcc5076(0x198)]('remark'),_0x1d7da1={};if(_0x20e3c0!==undefined&&_0x20e3c0!==null){const _0x164b7f=String(_0x20e3c0)[_0xcc5076(0x196)]();if(!_0x164b7f)throw CliErrors[_0xcc5076(0x194)]('--name\x20cannot\x20be\x20empty.');if(_0x164b7f[_0xcc5076(0x19f)]>0x40)throw CliErrors['validation'](_0xcc5076(0x18d));_0x1d7da1[_0xcc5076(0x1a4)]=_0x164b7f;}_0x53157f!==undefined&&_0x53157f!==null&&(_0x1d7da1[_0xcc5076(0x18b)]=String(_0x53157f));if(_0x1d7da1['roleName']===undefined&&_0x1d7da1['remark']===undefined)throw CliErrors[_0xcc5076(0x194)](_0xcc5076(0x189),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x1d7da1;}export const roleUpdate={'service':a180_0x36d943(0x18e),'command':a180_0x36d943(0x1a5),'description':a180_0x36d943(0x18c),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a180_0x36d943(0x19d),'type':a180_0x36d943(0x192),'required':![],'description':a180_0x36d943(0x18a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x537e74){readPatch(_0x537e74);},async 'dryRun'(_0xfb526f){const _0x1e0341=a180_0x36d943,_0x57c4ef=_0xfb526f[_0x1e0341(0x1a1)]('id'),_0x4c453a=readPatch(_0xfb526f),_0x16747f=await getRoleById(_0xfb526f['appCode'],_0x57c4ef);return assertCustomRole(_0x16747f,'update'),asDryRunResult({'scope':_0x1e0341(0x19c),'operation':'update','selector':{'appCode':_0xfb526f[_0x1e0341(0x18f)],'roleId':_0x57c4ef,'roleName':_0x16747f[_0x1e0341(0x1a4)]},'before':projectRole(_0x16747f),'after':projectRole({..._0x16747f,..._0x4c453a['roleName']!==undefined?{'roleName':_0x4c453a['roleName']}:{},..._0x4c453a['remark']!==undefined?{'remark':_0x4c453a[_0x1e0341(0x18b)]}:{}}),'dryRun':!![],'backend':{'method':_0x1e0341(0x190),'path':UPDATE_PATH},'warnings':[]},{'method':_0x1e0341(0x190),'url':UPDATE_PATH});},async 'execute'(_0x66d345){const _0x5bc6e1=a180_0x36d943,_0x531dca=_0x66d345[_0x5bc6e1(0x1a1)]('id'),_0x590dab=readPatch(_0x66d345),_0x3da22e=await getRoleById(_0x66d345[_0x5bc6e1(0x18f)],_0x531dca);assertCustomRole(_0x3da22e,_0x5bc6e1(0x1a5)),await updateAppRole({'id':_0x531dca,'appCode':_0x66d345[_0x5bc6e1(0x18f)],..._0x590dab[_0x5bc6e1(0x1a4)]!==undefined?{'roleName':_0x590dab[_0x5bc6e1(0x1a4)]}:{},..._0x590dab[_0x5bc6e1(0x18b)]!==undefined?{'remark':_0x590dab[_0x5bc6e1(0x18b)]}:{}});const _0x100873=await getRoleById(_0x66d345[_0x5bc6e1(0x18f)],_0x531dca);return{'ok':!![],'data':{'scope':_0x5bc6e1(0x19c),'operation':'update','selector':{'appCode':_0x66d345[_0x5bc6e1(0x18f)],'roleId':_0x531dca,'roleName':_0x100873[_0x5bc6e1(0x1a4)]},'before':projectRole(_0x3da22e),'after':projectRole(_0x100873),'dryRun':![],'backend':{'method':_0x5bc6e1(0x190),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x100873[_0x5bc6e1(0x1a4)]+_0x5bc6e1(0x19b)+_0x531dca+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x3082e6=a181_0x7678;(function(_0x6abfbf,_0x1ba503){const _0x240850=a181_0x7678,_0x2d0278=_0x6abfbf();while(!![]){try{const _0xd5063e=parseInt(_0x240850(0x98))/0x1*(-parseInt(_0x240850(0x9e))/0x2)+-parseInt(_0x240850(0x8e))/0x3*(-parseInt(_0x240850(0x87))/0x4)+-parseInt(_0x240850(0x93))/0x5*(parseInt(_0x240850(0x8c))/0x6)+-parseInt(_0x240850(0x8f))/0x7+parseInt(_0x240850(0x89))/0x8+-parseInt(_0x240850(0x9c))/0x9+parseInt(_0x240850(0x9a))/0xa;if(_0xd5063e===_0x1ba503)break;else _0x2d0278['push'](_0x2d0278['shift']());}catch(_0x50c0c3){_0x2d0278['push'](_0x2d0278['shift']());}}}(a181_0x5001,0x7829d));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a181_0x5001(){const _0xb0b311=['Added\x20user\x20','8685702kTMRTL','appCode','341410MMLMni','263308cGGhuX','high-risk-write','4470720TIzUnt','\x20already\x20in\x20role\x20','user-add','511926dCzSqB','selector','6bUfZwH','3881024NfVdmn','No\x20change:\x20user\x20','roleName','roleId','35Mfyako','roleType','userId','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','username','5DTCXUV','POST','27719770VqecZj'];a181_0x5001=function(){return _0xb0b311;};return a181_0x5001();}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 a181_0x7678(_0xa9392a,_0x138330){_0xa9392a=_0xa9392a-0x87;const _0x500138=a181_0x5001();let _0x76781d=_0x500138[_0xa9392a];return _0x76781d;}export const roleUserAdd={'service':'role','command':a181_0x3082e6(0x8b),'description':a181_0x3082e6(0x96),'risk':a181_0x3082e6(0x88),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x8c832a){const _0x3d681c=a181_0x3082e6,{mutation:_0x44cb58}=await prepareUserMutation(_0x8c832a,_0x3d681c(0x8b),!![]);return asDryRunResult(_0x44cb58,{'method':_0x3d681c(0x99),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x9fdb80){const _0x3341e7=a181_0x3082e6,{mutation:_0x1ff42c,changed:_0x3716da,role:_0xfed24d,user:_0x621671}=await prepareUserMutation(_0x9fdb80,'user-add',![]);return _0x3716da&&await createDevUserRole({'appCode':_0x9fdb80[_0x3341e7(0x9d)],'userId':_0x621671[_0x3341e7(0x95)],'username':_0x621671[_0x3341e7(0x97)],'roleType':_0xfed24d[_0x3341e7(0x94)],'roleId':_0x1ff42c[_0x3341e7(0x8d)][_0x3341e7(0x92)]}),{'ok':!![],'data':_0x1ff42c,'message':_0x3716da?_0x3341e7(0x9b)+_0x1ff42c['selector'][_0x3341e7(0x95)]+'\x20to\x20role\x20'+_0x1ff42c['selector'][_0x3341e7(0x91)]:_0x3341e7(0x90)+_0x1ff42c[_0x3341e7(0x8d)][_0x3341e7(0x95)]+_0x3341e7(0x8a)+_0x1ff42c[_0x3341e7(0x8d)]['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a182_0x48fa(_0x5764b8,_0x3fb070){_0x5764b8=_0x5764b8-0x1d2;const _0x76a2ec=a182_0x76a2();let _0x48fa1e=_0x76a2ec[_0x5764b8];return _0x48fa1e;}const a182_0x3276d8=a182_0x48fa;(function(_0xf02ba,_0x53efd3){const _0x53f0f1=a182_0x48fa,_0x350d18=_0xf02ba();while(!![]){try{const _0x1afd2f=-parseInt(_0x53f0f1(0x1dd))/0x1*(-parseInt(_0x53f0f1(0x1e3))/0x2)+-parseInt(_0x53f0f1(0x1d3))/0x3*(parseInt(_0x53f0f1(0x1e0))/0x4)+-parseInt(_0x53f0f1(0x1d4))/0x5+parseInt(_0x53f0f1(0x1d6))/0x6+parseInt(_0x53f0f1(0x1db))/0x7*(parseInt(_0x53f0f1(0x1d5))/0x8)+parseInt(_0x53f0f1(0x1e5))/0x9+-parseInt(_0x53f0f1(0x1de))/0xa;if(_0x1afd2f===_0x53efd3)break;else _0x350d18['push'](_0x350d18['shift']());}catch(_0x1ac63a){_0x350d18['push'](_0x350d18['shift']());}}}(a182_0x76a2,0x98cf1));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a182_0x76a2(){const _0x50dc96=['\x20from\x20role\x20','160696UvBIqK','POST','3023883ZRuBpY','No\x20change:\x20user\x20','userId','selector','59487uFqPro','1189240SmzKcm','8CTVYsd','7376736UYlKgZ','user-remove','roleName','high-risk-write','Removed\x20user\x20','8099035xiSKry','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','8OvZhOk','24816500DOmnVO','\x20not\x20in\x20role\x20','4ihNmEj','role'];a182_0x76a2=function(){return _0x50dc96;};return a182_0x76a2();}import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a182_0x3276d8(0x1e1),'command':'user-remove','description':a182_0x3276d8(0x1dc),'risk':a182_0x3276d8(0x1d9),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5bb495){const _0x1e43a3=a182_0x3276d8,{mutation:_0x81adfd}=await prepareUserMutation(_0x5bb495,_0x1e43a3(0x1d7),!![]);return asDryRunResult(_0x81adfd,{'method':_0x1e43a3(0x1e4),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x550486){const _0xaad92c=a182_0x3276d8,{matchingRelationIds:_0x4712ee,mutation:_0x46e049,changed:_0x224b19}=await prepareUserMutation(_0x550486,_0xaad92c(0x1d7),![]);if(_0x224b19)for(const _0x4b1a05 of _0x4712ee){await deleteDevUserRole(_0x4b1a05);}return{'ok':!![],'data':_0x46e049,'message':_0x224b19?_0xaad92c(0x1da)+_0x46e049[_0xaad92c(0x1d2)][_0xaad92c(0x1e7)]+_0xaad92c(0x1e2)+_0x46e049[_0xaad92c(0x1d2)][_0xaad92c(0x1d8)]:_0xaad92c(0x1e6)+_0x46e049[_0xaad92c(0x1d2)][_0xaad92c(0x1e7)]+_0xaad92c(0x1df)+_0x46e049[_0xaad92c(0x1d2)]['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x5ded9b=a183_0x19cc;(function(_0xbe690b,_0x4ef310){const _0x5b7ef1=a183_0x19cc,_0xfe32fe=_0xbe690b();while(!![]){try{const _0x850fce=-parseInt(_0x5b7ef1(0x9d))/0x1*(parseInt(_0x5b7ef1(0x8f))/0x2)+parseInt(_0x5b7ef1(0x87))/0x3+-parseInt(_0x5b7ef1(0x84))/0x4*(-parseInt(_0x5b7ef1(0x90))/0x5)+parseInt(_0x5b7ef1(0x99))/0x6*(parseInt(_0x5b7ef1(0x89))/0x7)+-parseInt(_0x5b7ef1(0x94))/0x8*(-parseInt(_0x5b7ef1(0x91))/0x9)+parseInt(_0x5b7ef1(0x96))/0xa*(-parseInt(_0x5b7ef1(0x8e))/0xb)+parseInt(_0x5b7ef1(0x9a))/0xc*(-parseInt(_0x5b7ef1(0x97))/0xd);if(_0x850fce===_0x4ef310)break;else _0xfe32fe['push'](_0xfe32fe['shift']());}catch(_0x492a08){_0xfe32fe['push'](_0xfe32fe['shift']());}}}(a183_0xe793,0x6a57c));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a183_0x19cc(_0x38296a,_0x5079c7){_0x38296a=_0x38296a-0x84;const _0xe7933=a183_0xe793();let _0x19ccc4=_0xe7933[_0x38296a];return _0x19ccc4;}function a183_0xe793(){const _0x201ac7=['36586GJxzsN','409722OZXVgp','5dQJuXY','477zVyboU','role','name','113640kMPlMx','flagMissing','60skiOEQ','13PloHqJ','userId','204PQKUgb','9878844YxJPvO','str','trim','1tmEhtJ','2499252RKoBVe','username','Pass\x20--name\x20<nickname|username>.','2484pQJsUN','Resolved\x20\x22','21644IEmgTh','\x22\x20→\x20userId\x20','user-resolve','nickname','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)'];a183_0xe793=function(){return _0x201ac7;};return a183_0xe793();}export const roleUserResolve={'service':a183_0x5ded9b(0x92),'command':a183_0x5ded9b(0x8b),'description':a183_0x5ded9b(0x8d),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x289983){const _0x48d0a9=a183_0x5ded9b;if(!_0x289983[_0x48d0a9(0x9b)](_0x48d0a9(0x93))[_0x48d0a9(0x9c)]())throw CliErrors[_0x48d0a9(0x95)](_0x48d0a9(0x93),_0x48d0a9(0x86));},async 'execute'(_0x1ddf48){const _0x29226f=a183_0x5ded9b,_0x24ff70=_0x1ddf48[_0x29226f(0x9b)](_0x29226f(0x93))['trim'](),_0x182497=await resolveUserRef(_0x24ff70);return{'ok':!![],'data':{'user':{'userId':_0x182497['userId'],'username':_0x182497[_0x29226f(0x85)],'nickname':_0x182497[_0x29226f(0x8c)],'matchedBy':_0x182497['matchedBy']}},'message':_0x29226f(0x88)+_0x24ff70+_0x29226f(0x8a)+_0x182497[_0x29226f(0x98)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a184_0x177a54=a184_0x1d18;(function(_0x57e77a,_0x2416b1){const _0x5496fc=a184_0x1d18,_0x3f33d6=_0x57e77a();while(!![]){try{const _0x85559c=parseInt(_0x5496fc(0x11a))/0x1+parseInt(_0x5496fc(0x112))/0x2+-parseInt(_0x5496fc(0x11b))/0x3*(parseInt(_0x5496fc(0xf6))/0x4)+-parseInt(_0x5496fc(0x12a))/0x5+-parseInt(_0x5496fc(0x10f))/0x6+parseInt(_0x5496fc(0x115))/0x7+parseInt(_0x5496fc(0x10b))/0x8;if(_0x85559c===_0x2416b1)break;else _0x3f33d6['push'](_0x3f33d6['shift']());}catch(_0x111242){_0x3f33d6['push'](_0x3f33d6['shift']());}}}(a184_0x2f24,0xba37b));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a184_0x177a54(0xec)]);function readPackageScripts(_0x559641){const _0x193849=a184_0x177a54,_0x1c0bc9=resolve(_0x559641,_0x193849(0xfd));if(!existsSync(_0x1c0bc9))return null;try{const _0xa2f60d=JSON[_0x193849(0x10c)](readFileSync(_0x1c0bc9,_0x193849(0x110)));return _0xa2f60d[_0x193849(0x103)]??{};}catch{return null;}}function detectPackageManager(_0x56918d){const _0x24bfe8=a184_0x177a54;if(existsSync(resolve(_0x56918d,_0x24bfe8(0xed)))||existsSync(resolve(_0x56918d,'bun.lock')))return'bun';if(existsSync(resolve(_0x56918d,'pnpm-lock.yaml')))return _0x24bfe8(0xf7);if(existsSync(resolve(_0x56918d,_0x24bfe8(0x11c))))return'yarn';return _0x24bfe8(0x113);}async function versionCheck(_0x804e71){const _0xbcf439=a184_0x177a54,_0x8c2464=await checkCliVersion();(_0x8c2464[_0xbcf439(0x10d)]||_0x8c2464[_0xbcf439(0x107)])&&(printCliUpgradeWarning(_0x8c2464),assertCliVersionSupported(_0x8c2464));const _0x1863f4=await checkSdkVersion(_0x804e71);if(_0x1863f4[_0xbcf439(0x10d)])printSdkUpgradeWarning(_0x1863f4);}function spawnScript(_0xc2e632,_0x17a05e,_0x264d19,_0x441747){return new Promise((_0x5122f5,_0xac68ce)=>{const _0xd132ab=a184_0x1d18,_0x4775e5=[_0xd132ab(0xf4),_0x17a05e,..._0x264d19],_0x2031f1=spawn(_0xc2e632,_0x4775e5,{'cwd':_0x441747,'stdio':_0xd132ab(0xf2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x441747,'node_modules',_0xd132ab(0xfb))+delimiter+process.env.PATH}});_0x2031f1['on'](_0xd132ab(0x111),_0x4c80c1=>{const _0x5ae992=_0xd132ab;if(_0x4c80c1===0x0||_0x4c80c1===null)_0x5122f5();else _0xac68ce(new Error(_0xc2e632+_0x5ae992(0x116)+_0x17a05e+_0x5ae992(0xee)+_0x4c80c1));}),_0x2031f1['on'](_0xd132ab(0x129),_0xac68ce);});}function spawnViteBuildWatch(_0xeeb250){return new Promise((_0x27455a,_0x2a50f6)=>{const _0x4c0696=a184_0x1d18,_0x4c2f47=spawn('vite',[_0x4c0696(0x118),_0x4c0696(0x11e)],{'cwd':_0xeeb250,'stdio':_0x4c0696(0xf2),'shell':!![],'env':{...process.env,'PATH':''+join(_0xeeb250,_0x4c0696(0x124),_0x4c0696(0xfb))+delimiter+process.env.PATH}});_0x4c2f47['on'](_0x4c0696(0x111),_0x3c5f80=>{const _0x14ae06=_0x4c0696;if(_0x3c5f80===0x0||_0x3c5f80===null)_0x27455a();else _0x2a50f6(new Error(_0x14ae06(0x10e)+_0x3c5f80));}),_0x4c2f47['on']('error',_0x2a50f6);});}function spawnVitePreview(_0x3f5374){return new Promise((_0x41cc56,_0x3d22ff)=>{const _0x2633b4=a184_0x1d18,_0x5a308d=spawn(_0x2633b4(0xf0),[_0x2633b4(0x11f)],{'cwd':_0x3f5374,'stdio':_0x2633b4(0xf2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3f5374,_0x2633b4(0x124),_0x2633b4(0xfb))+delimiter+process.env.PATH}});_0x5a308d['on'](_0x2633b4(0x111),_0x570822=>{const _0x351ae6=_0x2633b4;if(_0x570822===0x0||_0x570822===null)_0x41cc56();else _0x3d22ff(new Error(_0x351ae6(0xf1)+_0x570822));}),_0x5a308d['on'](_0x2633b4(0x129),_0x3d22ff);});}function a184_0x1d18(_0x4e03c9,_0x58b41f){_0x4e03c9=_0x4e03c9-0xec;const _0x2f2466=a184_0x2f24();let _0x1d1857=_0x2f2466[_0x4e03c9];return _0x1d1857;}const runFlags=[{'name':'watch','type':a184_0x177a54(0xf8),'description':a184_0x177a54(0x106),'default':![]}];export const runDefinition={'service':'run','command':a184_0x177a54(0xf4),'description':a184_0x177a54(0x11d),'risk':a184_0x177a54(0x117),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a184_0x177a54(0x120),'description':a184_0x177a54(0x102),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x167b13=a184_0x177a54,_0x41c046=[];return _0x41c046[_0x167b13(0x100)](_0x167b13(0x122)),_0x41c046[_0x167b13(0x100)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x167b13(0x108)),_0x41c046['push'](_0x167b13(0x119)+CLI_BIN_NAME+'\x20run\x20build'),_0x41c046[_0x167b13(0x100)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x167b13(0xfa)),_0x41c046['push'](_0x167b13(0x119)+CLI_BIN_NAME+_0x167b13(0x121)),_0x41c046[_0x167b13(0xf5)]('\x0a');},async 'execute'(_0x45d8e8){const _0x5126d2=a184_0x177a54,_0x58f586=process[_0x5126d2(0x101)](),_0x323da0=_0x45d8e8[_0x5126d2(0xf9)][0x0],_0x490f4d=_0x45d8e8[_0x5126d2(0xf9)]['slice'](0x1),_0x59ab0d=readPackageScripts(_0x58f586);if(!_0x59ab0d)throw CliErrors[_0x5126d2(0x105)](_0x5126d2(0x109));if(!_0x323da0){const _0x408577=Object[_0x5126d2(0x128)](_0x59ab0d);if(_0x408577[_0x5126d2(0xfc)]===0x0)console[_0x5126d2(0xef)](_0x5126d2(0x126));else{console['log'](_0x5126d2(0x114));for(const _0x5b1dd4 of _0x408577){console[_0x5126d2(0xef)](_0x5126d2(0x119)+_0x5b1dd4);}console[_0x5126d2(0xef)](_0x5126d2(0xff)+CLI_BIN_NAME+_0x5126d2(0xf3));}return{'ok':!![]};}if(!_0x59ab0d[_0x323da0])throw CliErrors[_0x5126d2(0x105)](_0x5126d2(0x10a)+_0x323da0+'\x22\x20not\x20found\x20in\x20package.json.',_0x5126d2(0x104)+(Object[_0x5126d2(0x128)](_0x59ab0d)[_0x5126d2(0xf5)](',\x20')||'(none)'));const _0x1e6928=detectPackageManager(_0x58f586);VERSION_CHECK_SCRIPTS[_0x5126d2(0xfe)](_0x323da0)&&await versionCheck(_0x58f586);if(_0x323da0==='preview'&&_0x45d8e8[_0x5126d2(0x125)](_0x5126d2(0x123)))return await Promise[_0x5126d2(0x127)]([spawnViteBuildWatch(_0x58f586),spawnVitePreview(_0x58f586)]),{'ok':!![]};return await spawnScript(_0x1e6928,_0x323da0,_0x490f4d,_0x58f586),{'ok':!![]};}};function a184_0x2f24(){const _0x243a09=['7745922GYCjNb','utf-8','close','2996052eRDmIt','npm','\x0a\x20\x20Available\x20scripts:\x0a','3273368ROLRXQ','\x20run\x20','write','build','\x20\x20\x20\x20','985512NIdZpQ','111165jLnHRm','yarn.lock','Run\x20a\x20package.json\x20script','--watch','preview','script','\x20run\x20preview\x20--watch','\x20\x20EXAMPLES','watch','node_modules','bool','No\x20scripts\x20defined\x20in\x20package.json.','all','keys','error','7173780xOYiuT','dev','bun.lockb','\x20exited\x20with\x20code\x20','log','vite','vite\x20preview\x20exited\x20with\x20code\x20','inherit','\x20run\x20<script>\x0a','run','join','108rGzImG','pnpm','boolean','args','\x20run\x20preview','.bin','length','package.json','has','\x0a\x20\x20Usage:\x20','push','cwd','Script\x20name\x20defined\x20in\x20package.json','scripts','Available:\x20','validation','Enable\x20watch\x20mode\x20for\x20preview','belowMinimum','\x20run\x20start','No\x20package.json\x20found\x20in\x20current\x20directory.','Script\x20\x22','12302504Lxpfxa','parse','needsUpgrade','vite\x20build\x20--watch\x20exited\x20with\x20code\x20'];a184_0x2f24=function(){return _0x243a09;};return a184_0x2f24();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a185_0x51197d=a185_0x1940;(function(_0x18d7e8,_0x2f345f){const _0x5eba0d=a185_0x1940,_0xd1f210=_0x18d7e8();while(!![]){try{const _0x28562d=-parseInt(_0x5eba0d(0xd4))/0x1+-parseInt(_0x5eba0d(0xdc))/0x2+-parseInt(_0x5eba0d(0xda))/0x3+-parseInt(_0x5eba0d(0xdf))/0x4+-parseInt(_0x5eba0d(0xdb))/0x5*(parseInt(_0x5eba0d(0xd7))/0x6)+parseInt(_0x5eba0d(0xd8))/0x7*(-parseInt(_0x5eba0d(0xd5))/0x8)+parseInt(_0x5eba0d(0xd6))/0x9;if(_0x28562d===_0x2f345f)break;else _0xd1f210['push'](_0xd1f210['shift']());}catch(_0x2005af){_0xd1f210['push'](_0xd1f210['shift']());}}}(a185_0x5580,0xb5793));import{buildSchemaPayload}from'../framework/schema-export.js';function a185_0x1940(_0x16499d,_0x195345){_0x16499d=_0x16499d-0xd4;const _0x558039=a185_0x5580();let _0x194046=_0x558039[_0x16499d];return _0x194046;}async function execute(_0x594708){const _0xe79759=await buildSchemaPayload();return{'ok':!![],'data':_0xe79759};}function a185_0x5580(){const _0xc2f5b0=['328hEAvmv','46092978uypqVq','268362eLGTjS','18627DTAmVX','read','1561803ZHGOPz','160pSpmdP','1808722BIucgM','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','541860zbQgOh','1277335ZIQhDQ'];a185_0x5580=function(){return _0xc2f5b0;};return a185_0x5580();}export const schemaDefinition={'service':a185_0x51197d(0xde),'command':'export','description':a185_0x51197d(0xdd),'risk':a185_0x51197d(0xd9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a186_0x7aa9ef=a186_0x1c79;(function(_0x5bc4fc,_0x2ff1a5){const _0x14b1aa=a186_0x1c79,_0x4562e6=_0x5bc4fc();while(!![]){try{const _0x5dd383=parseInt(_0x14b1aa(0x1ce))/0x1*(parseInt(_0x14b1aa(0x1d0))/0x2)+-parseInt(_0x14b1aa(0x1d1))/0x3+-parseInt(_0x14b1aa(0x1cc))/0x4*(-parseInt(_0x14b1aa(0x1a7))/0x5)+-parseInt(_0x14b1aa(0x1d9))/0x6+-parseInt(_0x14b1aa(0x1ca))/0x7*(-parseInt(_0x14b1aa(0x1b8))/0x8)+-parseInt(_0x14b1aa(0x1af))/0x9+parseInt(_0x14b1aa(0x1db))/0xa;if(_0x5dd383===_0x2ff1a5)break;else _0x4562e6['push'](_0x4562e6['shift']());}catch(_0x4a94fd){_0x4562e6['push'](_0x4562e6['shift']());}}}(a186_0x2745,0x67987));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a186_0x2745(){const _0x32bb0b=['write','10GVNtBR','sqlCode','</select>','普通\x20SQL(sql)','flagMissing','dbId\x20必须为正整数','__manual__','sqlRootDir','6881733pFjJPV','请输入\x20SQL\x20名称:','lastSync','description','toISOString','nonInteractive','map','请选择目标数据库:','Local\x20SQL\x20file\x20mode','3592088ajpRch','sqlRoot','isInteger','create','MyBatis\x20XML(mybatisXml)','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','mybatisXml','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','length','mode','isFinite','new','dbName','Invalid\x20database\x20selection\x20payload:\x20','适合带动态标签的\x20MyBatis\x20XML\x20SQL','sqlName','✎\x20手动输入\x20dbId','parse','7Nercis','string','28212Ltzlty','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','189792wCICyy','appCode','6aiQzba','1421019eVtRFL','<server-generated-sqlCode>','trim','name','SQL\x20query\x20display\x20name','join','Created\x20SQL\x20query\x20','dbId\x20不能为空','4450734cMgjWb','str','13719330oDDsTD','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','number','File\x20already\x20exists:\x20','POST','flag','SQL\x20名称不能为空','db-id','dbId','stringify','sql','validation','Target\x20database\x20ID','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'];a186_0x2745=function(){return _0x32bb0b;};return a186_0x2745();}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a186_0x1c79(_0x435454,_0xcdf4dd){_0x435454=_0x435454-0x1a1;const _0x274532=a186_0x2745();let _0x1c7997=_0x274532[_0x435454];return _0x1c7997;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x32858b){const _0xd47f66=a186_0x1c79;if(_0x32858b===_0xd47f66(0x1be))return[_0xd47f66(0x1cd),'\x20\x20SELECT\x201\x20AS\x20id',_0xd47f66(0x1a9),''][_0xd47f66(0x1d6)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0xd47f66(0x1d6)]('\x0a');}export const sqlCreate={'service':a186_0x7aa9ef(0x1a2),'command':a186_0x7aa9ef(0x1bb),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a186_0x7aa9ef(0x1a6),'flags':[{'name':a186_0x7aa9ef(0x1d4),'type':'string','description':a186_0x7aa9ef(0x1d5)},{'name':'db-id','type':'number','description':a186_0x7aa9ef(0x1a4)},{'name':'mode','type':a186_0x7aa9ef(0x1cb),'enum':[a186_0x7aa9ef(0x1a2),a186_0x7aa9ef(0x1be)],'description':a186_0x7aa9ef(0x1b7)}],async 'validate'(_0x398fe7){const _0x4140ce=a186_0x7aa9ef;if(!_0x398fe7[_0x4140ce(0x1b4)])return;if(!_0x398fe7[_0x4140ce(0x1da)](_0x4140ce(0x1d4))[_0x4140ce(0x1d3)]())throw CliErrors['flagMissing'](_0x4140ce(0x1d4),_0x4140ce(0x1bd));const _0x27a687=resolveProvidedDbId(_0x398fe7);if(typeof _0x27a687!==_0x4140ce(0x1dd)||!Number[_0x4140ce(0x1c2)](_0x27a687)||_0x27a687<=0x0)throw CliErrors[_0x4140ce(0x1ab)](_0x4140ce(0x1e2),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x398fe7['str'](_0x4140ce(0x1c1))[_0x4140ce(0x1d3)]())throw CliErrors[_0x4140ce(0x1ab)](_0x4140ce(0x1c1),_0x4140ce(0x1dc));},async 'dryRun'(_0x32fda5){const _0x4a97c2=a186_0x7aa9ef,_0x2c5ff6=loadSqlProjectConfig(_0x32fda5[_0x4a97c2(0x1cf)]),{sqlName:_0x44f840,dbId:_0x3e5927,dbName:_0x15f321,mode:_0x184aee}=await resolveSqlNewInputs(_0x32fda5),_0xa3fb30=buildSqlRelativePath(_0x4a97c2(0x1d2),_0x44f840,_0x15f321,_0x184aee,_0x3e5927),_0x2275b8=_0x2c5ff6[_0x4a97c2(0x1ae)]+'/'+_0xa3fb30;return{'method':_0x4a97c2(0x1df),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x32fda5[_0x4a97c2(0x1cf)],'sqlName':_0x44f840,'dbId':_0x3e5927,'mode':_0x184aee,'localPath':_0x2275b8},'description':_0x4a97c2(0x1bf)+_0x2c5ff6[_0x4a97c2(0x1ae)]};},async 'execute'(_0x3e66e5){const _0x623107=a186_0x7aa9ef,_0x35bbcf=loadSqlProjectConfig(_0x3e66e5[_0x623107(0x1cf)]),{sqlName:_0x195b74,dbId:_0x4488e2,dbName:_0x127718,mode:_0x19e0bf}=await resolveSqlNewInputs(_0x3e66e5),_0x3fc44f=generateSqlTemplate(_0x19e0bf),_0x5c2085=await createSqlQuery({'appCode':_0x3e66e5[_0x623107(0x1cf)],'sqlName':_0x195b74,'dbId':_0x4488e2,'sqlContent':_0x3fc44f}),_0x5766f4=ensureRemoteSqlContent(_0x5c2085),_0x3facea=_0x127718||await getDbName(_0x3e66e5[_0x623107(0x1cf)],_0x4488e2)['catch'](()=>undefined),_0x2dc60a=buildSqlRelativePath(_0x5c2085[_0x623107(0x1a8)],_0x5c2085[_0x623107(0x1c7)],_0x3facea,_0x19e0bf,_0x4488e2),_0x38d3a8=_0x35bbcf[_0x623107(0x1ae)]+'/'+_0x2dc60a,_0x381d31=buildLocalSqlFileContent({'sqlCode':_0x5c2085[_0x623107(0x1a8)],'sqlName':_0x5c2085[_0x623107(0x1c7)],'dbId':_0x5c2085[_0x623107(0x1e3)]},_0x5766f4,{'dbName':_0x3facea,'mode':_0x19e0bf,'syncedAt':new Date()[_0x623107(0x1b3)](),'description':_0x5c2085[_0x623107(0x1b2)]});if(await fileExists(_0x38d3a8))throw CliErrors[_0x623107(0x1a3)](_0x623107(0x1de)+_0x38d3a8);await ensureParentDirectory(_0x38d3a8),await writeFile(_0x38d3a8,_0x381d31,'utf8');const _0xbe1343=await readSqlLockFile(_0x35bbcf['lockFilePath']),{lockData:_0x529061,appLock:_0x28a094}=ensureSqlLockScope(_0xbe1343??createEmptySqlLock(),_0x35bbcf[_0x623107(0x1cf)],_0x35bbcf[_0x623107(0x1b9)],_0x623107(0x1c3));return _0x28a094['sqls'][_0x5c2085[_0x623107(0x1a8)]]={...buildSqlLockEntry(_0x5c2085,_0x5766f4,computeSqlContentHash(_0x381d31),{'dbName':_0x3facea}),'path':_0x2dc60a,'mode':_0x19e0bf},_0x28a094[_0x623107(0x1b1)]=new Date()['toISOString'](),await writeSqlLockFile(_0x35bbcf['lockFilePath'],_0x529061),{'ok':!![],'data':{'id':_0x5c2085['id'],'sqlCode':_0x5c2085[_0x623107(0x1a8)],'sqlName':_0x5c2085[_0x623107(0x1c7)],'dbId':_0x5c2085[_0x623107(0x1e3)],'path':_0x38d3a8,'mode':_0x19e0bf},'message':_0x623107(0x1d7)+_0x5c2085['sqlCode']};}};async function resolveSqlNewInputs(_0x1475f5){const _0x41e5d8=await resolveSqlNameInput(_0x1475f5),{dbId:_0x2ef08b,dbName:_0x4aaef4}=await resolveDbSelection(_0x1475f5),_0x2d0b08=await resolveSqlModeInput(_0x1475f5);return{'sqlName':_0x41e5d8,'dbId':_0x2ef08b,'dbName':_0x4aaef4,'mode':_0x2d0b08};}async function resolveSqlNameInput(_0x5df417){const _0xf4f2e4=a186_0x7aa9ef,_0x47bc69=_0x5df417[_0xf4f2e4(0x1da)](_0xf4f2e4(0x1d4))[_0xf4f2e4(0x1d3)]();if(_0x47bc69)return _0x47bc69;if(_0x5df417[_0xf4f2e4(0x1b4)])throw CliErrors[_0xf4f2e4(0x1ab)]('name',_0xf4f2e4(0x1bd));return(await input({'message':_0xf4f2e4(0x1b0),'validate':_0x540a1a=>_0x540a1a[_0xf4f2e4(0x1d3)]()?!![]:_0xf4f2e4(0x1e1)}))[_0xf4f2e4(0x1d3)]();}async function resolveDbSelection(_0x27b626){const _0x1c8c06=a186_0x7aa9ef,_0x5e2091=resolveProvidedDbId(_0x27b626);if(typeof _0x5e2091===_0x1c8c06(0x1dd)&&Number[_0x1c8c06(0x1c2)](_0x5e2091)&&_0x5e2091>0x0)return{'dbId':_0x5e2091,'dbName':await getDbName(_0x27b626[_0x1c8c06(0x1cf)],_0x5e2091)['catch'](()=>undefined)};if(_0x27b626['nonInteractive'])throw CliErrors[_0x1c8c06(0x1ab)](_0x1c8c06(0x1e2),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x234f68=await listDatabases(_0x27b626[_0x1c8c06(0x1cf)])['catch'](()=>[]);if(_0x234f68[_0x1c8c06(0x1c0)]===0x1)return{'dbId':_0x234f68[0x0][_0x1c8c06(0x1e3)],'dbName':_0x234f68[0x0][_0x1c8c06(0x1c4)]};if(_0x234f68[_0x1c8c06(0x1c0)]>0x1){const _0x4baa6f=await select({'message':_0x1c8c06(0x1b6),'choices':[..._0x234f68[_0x1c8c06(0x1b5)](_0x1f7e78=>({'name':_0x1f7e78[_0x1c8c06(0x1c4)]+'\x20('+_0x1f7e78[_0x1c8c06(0x1e3)]+')','value':serializeDbSelection(_0x1f7e78)})),{'name':_0x1c8c06(0x1c8),'value':_0x1c8c06(0x1ad)}]});if(_0x4baa6f!=='__manual__')return deserializeDbSelection(_0x4baa6f);}const _0x42a681=await input({'message':'请输入目标数据库\x20dbId:','validate':_0xf79abf=>{const _0x4d864b=_0x1c8c06,_0x3fa902=_0xf79abf[_0x4d864b(0x1d3)]();if(!_0x3fa902)return _0x4d864b(0x1d8);const _0x5eaa9d=Number(_0x3fa902);if(!Number[_0x4d864b(0x1ba)](_0x5eaa9d)||_0x5eaa9d<=0x0)return _0x4d864b(0x1ac);return!![];}});return{'dbId':Number(_0x42a681[_0x1c8c06(0x1d3)]())};}async function resolveSqlModeInput(_0x391662){const _0x2c570e=a186_0x7aa9ef,_0x3347f8=_0x391662[_0x2c570e(0x1da)](_0x2c570e(0x1c1))[_0x2c570e(0x1d3)]();if(_0x3347f8===_0x2c570e(0x1a2)||_0x3347f8===_0x2c570e(0x1be))return _0x3347f8;if(_0x391662[_0x2c570e(0x1b4)])throw CliErrors['flagMissing'](_0x2c570e(0x1c1),_0x2c570e(0x1dc));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x2c570e(0x1aa),'value':_0x2c570e(0x1a2),'description':_0x2c570e(0x1a5)},{'name':_0x2c570e(0x1bc),'value':'mybatisXml','description':_0x2c570e(0x1c6)}]});}function serializeDbSelection(_0x35c34e){const _0x50d61f=a186_0x7aa9ef;return JSON[_0x50d61f(0x1a1)]({'dbId':_0x35c34e[_0x50d61f(0x1e3)],'dbName':_0x35c34e['dbName']});}function deserializeDbSelection(_0x4148a1){const _0x268563=a186_0x7aa9ef;try{const _0xe765f5=JSON[_0x268563(0x1c9)](_0x4148a1);if(typeof _0xe765f5[_0x268563(0x1e3)]===_0x268563(0x1dd)&&Number[_0x268563(0x1c2)](_0xe765f5[_0x268563(0x1e3)]))return{'dbId':_0xe765f5[_0x268563(0x1e3)],'dbName':_0xe765f5[_0x268563(0x1c4)]};}catch{}throw CliErrors[_0x268563(0x1a3)](_0x268563(0x1c5)+_0x4148a1);}function resolveProvidedDbId(_0xd2074d){const _0x4f3a94=a186_0x7aa9ef,_0x4b5b00=_0xd2074d[_0x4f3a94(0x1e0)](_0x4f3a94(0x1e2));if(typeof _0x4b5b00==='number'&&Number[_0x4f3a94(0x1c2)](_0x4b5b00))return _0x4b5b00;return undefined;}
|
|
1
|
+
const a186_0xfe09ee=a186_0x5e73;(function(_0xd6ba43,_0x33d051){const _0x199fda=a186_0x5e73,_0xabacae=_0xd6ba43();while(!![]){try{const _0x14b207=parseInt(_0x199fda(0x167))/0x1+parseInt(_0x199fda(0x163))/0x2*(parseInt(_0x199fda(0x18a))/0x3)+-parseInt(_0x199fda(0x15d))/0x4+-parseInt(_0x199fda(0x17c))/0x5*(parseInt(_0x199fda(0x183))/0x6)+parseInt(_0x199fda(0x161))/0x7*(-parseInt(_0x199fda(0x192))/0x8)+parseInt(_0x199fda(0x159))/0x9*(parseInt(_0x199fda(0x172))/0xa)+parseInt(_0x199fda(0x15b))/0xb;if(_0x14b207===_0x33d051)break;else _0xabacae['push'](_0xabacae['shift']());}catch(_0x410c8e){_0xabacae['push'](_0xabacae['shift']());}}}(a186_0xcd2a,0x1f5cb));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a186_0xcd2a(){const _0x5b8e37=['__manual__','6IGjguW','name','\x20\x20SELECT\x201\x20AS\x20id','sqls','81353frLLje','catch','Created\x20SQL\x20query\x20','sql','validation','sqlRootDir','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','lastSync','dbId','SQL\x20query\x20display\x20name','请选择目标数据库:','10IrGaXU','lockFilePath','join','flag','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','isInteger','string','mode','stringify','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','15BTBsOT','</select>','str','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','普通\x20SQL(sql)','appCode','sqlRoot','87390iGRYwj','请选择本地\x20SQL\x20模式:','map','Invalid\x20database\x20selection\x20payload:\x20','number','MyBatis\x20XML(mybatisXml)','db-id','45912gljKBg','SELECT\x201\x20AS\x20id;','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','dbName','请输入目标数据库\x20dbId:','sqlName','parse','mybatisXml','16pZvmiS','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20ID','/smartapi/custom/saveUserCustomSql','适合带动态标签的\x20MyBatis\x20XML\x20SQL','utf8','✎\x20手动输入\x20dbId','nonInteractive','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','flagMissing','请输入\x20SQL\x20名称:','write','description','length','dbId\x20不能为空','1465731YPVkyH','Local\x20SQL\x20file\x20mode','2365484MjrSMV','trim','391968HiSFNG','sqlCode','<server-generated-sqlCode>','isFinite','822577geDeQs'];a186_0xcd2a=function(){return _0x5b8e37;};return a186_0xcd2a();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a186_0x5e73(_0x43d335,_0x2fa034){_0x43d335=_0x43d335-0x155;const _0xcd2a36=a186_0xcd2a();let _0x5e7300=_0xcd2a36[_0x43d335];return _0x5e7300;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0xbf5652){const _0x1fff0a=a186_0x5e73;if(_0xbf5652==='mybatisXml')return[_0x1fff0a(0x176),_0x1fff0a(0x165),_0x1fff0a(0x17d),''][_0x1fff0a(0x174)]('\x0a');return[_0x1fff0a(0x18b),''][_0x1fff0a(0x174)]('\x0a');}export const sqlCreate={'service':a186_0xfe09ee(0x16a),'command':'create','description':a186_0xfe09ee(0x17f),'risk':a186_0xfe09ee(0x155),'flags':[{'name':a186_0xfe09ee(0x164),'type':a186_0xfe09ee(0x178),'description':a186_0xfe09ee(0x170)},{'name':a186_0xfe09ee(0x189),'type':a186_0xfe09ee(0x187),'description':a186_0xfe09ee(0x194)},{'name':a186_0xfe09ee(0x179),'type':a186_0xfe09ee(0x178),'enum':['sql','mybatisXml'],'description':a186_0xfe09ee(0x15a)}],async 'validate'(_0x3b4d03){const _0x2cd5e3=a186_0xfe09ee;if(!_0x3b4d03[_0x2cd5e3(0x199)])return;if(!_0x3b4d03[_0x2cd5e3(0x17e)](_0x2cd5e3(0x164))[_0x2cd5e3(0x15c)]())throw CliErrors[_0x2cd5e3(0x19b)](_0x2cd5e3(0x164),_0x2cd5e3(0x193));const _0x43bcbd=resolveProvidedDbId(_0x3b4d03);if(typeof _0x43bcbd!==_0x2cd5e3(0x187)||!Number['isFinite'](_0x43bcbd)||_0x43bcbd<=0x0)throw CliErrors[_0x2cd5e3(0x19b)](_0x2cd5e3(0x189),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x3b4d03[_0x2cd5e3(0x17e)](_0x2cd5e3(0x179))[_0x2cd5e3(0x15c)]())throw CliErrors[_0x2cd5e3(0x19b)]('mode',_0x2cd5e3(0x19a));},async 'dryRun'(_0x501a4f){const _0x1f37fa=a186_0xfe09ee,_0x32e87a=loadSqlProjectConfig(_0x501a4f[_0x1f37fa(0x181)]),{sqlName:_0x59f3e4,dbId:_0x2f8e1e,dbName:_0xde3bec,mode:_0x5b00a5}=await resolveSqlNewInputs(_0x501a4f),_0xc60fa3=buildSqlRelativePath(_0x1f37fa(0x15f),_0x59f3e4,_0xde3bec,_0x5b00a5,_0x2f8e1e),_0x3215ce=_0x32e87a[_0x1f37fa(0x16c)]+'/'+_0xc60fa3;return{'method':'POST','url':_0x1f37fa(0x195),'body':{'appCode':_0x501a4f[_0x1f37fa(0x181)],'sqlName':_0x59f3e4,'dbId':_0x2f8e1e,'mode':_0x5b00a5,'localPath':_0x3215ce},'description':_0x1f37fa(0x17b)+_0x32e87a['sqlRootDir']};},async 'execute'(_0x3d6554){const _0x511c43=a186_0xfe09ee,_0x441d0b=loadSqlProjectConfig(_0x3d6554[_0x511c43(0x181)]),{sqlName:_0x5083ef,dbId:_0x8735d0,dbName:_0x28abd6,mode:_0x30fb7f}=await resolveSqlNewInputs(_0x3d6554),_0x32741d=generateSqlTemplate(_0x30fb7f),_0x3f1055=await createSqlQuery({'appCode':_0x3d6554[_0x511c43(0x181)],'sqlName':_0x5083ef,'dbId':_0x8735d0,'sqlContent':_0x32741d}),_0x13d6d8=ensureRemoteSqlContent(_0x3f1055),_0x2f07af=_0x28abd6||await getDbName(_0x3d6554[_0x511c43(0x181)],_0x8735d0)[_0x511c43(0x168)](()=>undefined),_0x17c3db=buildSqlRelativePath(_0x3f1055['sqlCode'],_0x3f1055[_0x511c43(0x18f)],_0x2f07af,_0x30fb7f,_0x8735d0),_0x24beaa=_0x441d0b['sqlRootDir']+'/'+_0x17c3db,_0xe3841a=buildLocalSqlFileContent({'sqlCode':_0x3f1055[_0x511c43(0x15e)],'sqlName':_0x3f1055['sqlName'],'dbId':_0x3f1055[_0x511c43(0x16f)]},_0x13d6d8,{'dbName':_0x2f07af,'mode':_0x30fb7f,'syncedAt':new Date()['toISOString'](),'description':_0x3f1055[_0x511c43(0x156)]});if(await fileExists(_0x24beaa))throw CliErrors[_0x511c43(0x16b)]('File\x20already\x20exists:\x20'+_0x24beaa);await ensureParentDirectory(_0x24beaa),await writeFile(_0x24beaa,_0xe3841a,_0x511c43(0x197));const _0x3c2188=await readSqlLockFile(_0x441d0b['lockFilePath']),{lockData:_0x1f36cc,appLock:_0x314c6b}=ensureSqlLockScope(_0x3c2188??createEmptySqlLock(),_0x441d0b[_0x511c43(0x181)],_0x441d0b[_0x511c43(0x182)],'new');return _0x314c6b[_0x511c43(0x166)][_0x3f1055[_0x511c43(0x15e)]]={...buildSqlLockEntry(_0x3f1055,_0x13d6d8,computeSqlContentHash(_0xe3841a),{'dbName':_0x2f07af}),'path':_0x17c3db,'mode':_0x30fb7f},_0x314c6b[_0x511c43(0x16e)]=new Date()['toISOString'](),await writeSqlLockFile(_0x441d0b[_0x511c43(0x173)],_0x1f36cc),{'ok':!![],'data':{'id':_0x3f1055['id'],'sqlCode':_0x3f1055[_0x511c43(0x15e)],'sqlName':_0x3f1055['sqlName'],'dbId':_0x3f1055[_0x511c43(0x16f)],'path':_0x24beaa,'mode':_0x30fb7f},'message':_0x511c43(0x169)+_0x3f1055[_0x511c43(0x15e)]};}};async function resolveSqlNewInputs(_0x599546){const _0x9aedb9=await resolveSqlNameInput(_0x599546),{dbId:_0x1266a5,dbName:_0x59c0d2}=await resolveDbSelection(_0x599546),_0x4b365e=await resolveSqlModeInput(_0x599546);return{'sqlName':_0x9aedb9,'dbId':_0x1266a5,'dbName':_0x59c0d2,'mode':_0x4b365e};}async function resolveSqlNameInput(_0x41bd86){const _0x1e4cb9=a186_0xfe09ee,_0x5799cd=_0x41bd86['str']('name')[_0x1e4cb9(0x15c)]();if(_0x5799cd)return _0x5799cd;if(_0x41bd86['nonInteractive'])throw CliErrors[_0x1e4cb9(0x19b)]('name',_0x1e4cb9(0x193));return(await input({'message':_0x1e4cb9(0x19c),'validate':_0x352101=>_0x352101[_0x1e4cb9(0x15c)]()?!![]:'SQL\x20名称不能为空'}))[_0x1e4cb9(0x15c)]();}async function resolveDbSelection(_0x3d02b7){const _0x647586=a186_0xfe09ee,_0x482316=resolveProvidedDbId(_0x3d02b7);if(typeof _0x482316===_0x647586(0x187)&&Number[_0x647586(0x160)](_0x482316)&&_0x482316>0x0)return{'dbId':_0x482316,'dbName':await getDbName(_0x3d02b7[_0x647586(0x181)],_0x482316)[_0x647586(0x168)](()=>undefined)};if(_0x3d02b7['nonInteractive'])throw CliErrors['flagMissing'](_0x647586(0x189),_0x647586(0x18c));const _0x30c1fe=await listDatabases(_0x3d02b7[_0x647586(0x181)])[_0x647586(0x168)](()=>[]);if(_0x30c1fe[_0x647586(0x157)]===0x1)return{'dbId':_0x30c1fe[0x0][_0x647586(0x16f)],'dbName':_0x30c1fe[0x0][_0x647586(0x18d)]};if(_0x30c1fe[_0x647586(0x157)]>0x1){const _0x2a605b=await select({'message':_0x647586(0x171),'choices':[..._0x30c1fe[_0x647586(0x185)](_0x3ac5c1=>({'name':_0x3ac5c1[_0x647586(0x18d)]+'\x20('+_0x3ac5c1[_0x647586(0x16f)]+')','value':serializeDbSelection(_0x3ac5c1)})),{'name':_0x647586(0x198),'value':_0x647586(0x162)}]});if(_0x2a605b!==_0x647586(0x162))return deserializeDbSelection(_0x2a605b);}const _0x1e297d=await input({'message':_0x647586(0x18e),'validate':_0x5d06cb=>{const _0x1ba6fa=_0x647586,_0x9b5775=_0x5d06cb['trim']();if(!_0x9b5775)return _0x1ba6fa(0x158);const _0x58e58b=Number(_0x9b5775);if(!Number[_0x1ba6fa(0x177)](_0x58e58b)||_0x58e58b<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x1e297d[_0x647586(0x15c)]())};}async function resolveSqlModeInput(_0x3aa24c){const _0x5610eb=a186_0xfe09ee,_0x34894a=_0x3aa24c[_0x5610eb(0x17e)](_0x5610eb(0x179))[_0x5610eb(0x15c)]();if(_0x34894a==='sql'||_0x34894a==='mybatisXml')return _0x34894a;if(_0x3aa24c[_0x5610eb(0x199)])throw CliErrors[_0x5610eb(0x19b)](_0x5610eb(0x179),_0x5610eb(0x19a));return await select({'message':_0x5610eb(0x184),'choices':[{'name':_0x5610eb(0x180),'value':_0x5610eb(0x16a),'description':_0x5610eb(0x16d)},{'name':_0x5610eb(0x188),'value':_0x5610eb(0x191),'description':_0x5610eb(0x196)}]});}function serializeDbSelection(_0x1bb553){const _0x565616=a186_0xfe09ee;return JSON[_0x565616(0x17a)]({'dbId':_0x1bb553['dbId'],'dbName':_0x1bb553[_0x565616(0x18d)]});}function deserializeDbSelection(_0x1afb11){const _0x4de605=a186_0xfe09ee;try{const _0x30ab1c=JSON[_0x4de605(0x190)](_0x1afb11);if(typeof _0x30ab1c['dbId']===_0x4de605(0x187)&&Number[_0x4de605(0x160)](_0x30ab1c[_0x4de605(0x16f)]))return{'dbId':_0x30ab1c[_0x4de605(0x16f)],'dbName':_0x30ab1c['dbName']};}catch{}throw CliErrors['validation'](_0x4de605(0x186)+_0x1afb11);}function resolveProvidedDbId(_0x3008ce){const _0x2e9aa1=a186_0xfe09ee,_0x143134=_0x3008ce[_0x2e9aa1(0x175)](_0x2e9aa1(0x189));if(typeof _0x143134===_0x2e9aa1(0x187)&&Number['isFinite'](_0x143134))return _0x143134;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a187_0x9c068f=a187_0x5372;(function(_0x9a0cfb,_0x5160b9){const _0x15ee05=a187_0x5372,_0x1802a1=_0x9a0cfb();while(!![]){try{const _0x2cf5e0=parseInt(_0x15ee05(0x185))/0x1*(parseInt(_0x15ee05(0x193))/0x2)+parseInt(_0x15ee05(0x190))/0x3+parseInt(_0x15ee05(0x177))/0x4*(-parseInt(_0x15ee05(0x180))/0x5)+parseInt(_0x15ee05(0x181))/0x6+parseInt(_0x15ee05(0x189))/0x7*(-parseInt(_0x15ee05(0x186))/0x8)+-parseInt(_0x15ee05(0x178))/0x9+parseInt(_0x15ee05(0x192))/0xa;if(_0x2cf5e0===_0x5160b9)break;else _0x1802a1['push'](_0x1802a1['shift']());}catch(_0x45f360){_0x1802a1['push'](_0x1802a1['shift']());}}}(a187_0xea06,0x7dd74));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a187_0x5372(_0x50a804,_0x17cfe6){_0x50a804=_0x50a804-0x171;const _0xea06f4=a187_0xea06();let _0x537294=_0xea06f4[_0x50a804];return _0x537294;}import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a187_0x9c068f(0x172),'command':a187_0x9c068f(0x196),'description':a187_0x9c068f(0x17a),'risk':a187_0x9c068f(0x184),'flags':[SQLCODE_FLAG],async 'validate'(_0x59bd5c){const _0x45298d=a187_0x9c068f,_0x3fed38=loadSqlProjectConfig(_0x59bd5c['appCode']),_0x5a1048=await readSqlLockFile(_0x3fed38[_0x45298d(0x17f)]);if(!_0x5a1048)throw CliErrors[_0x45298d(0x174)](_0x45298d(0x195));},async 'dryRun'(_0x4b1cc0){const _0x5bd224=a187_0x9c068f,_0x581796=loadSqlProjectConfig(_0x4b1cc0[_0x5bd224(0x194)]),_0x2901b7=await readSqlLockFile(_0x581796[_0x5bd224(0x17f)]);if(!_0x2901b7)throw CliErrors['validation'](_0x5bd224(0x195));const {appLock:_0x207913}=ensureSqlLockScope(_0x2901b7,_0x4b1cc0[_0x5bd224(0x194)],_0x581796[_0x5bd224(0x183)],_0x5bd224(0x196)),_0x2be07d=_0x4b1cc0[_0x5bd224(0x191)](_0x5bd224(0x18c)),_0x539f72=_0x207913[_0x5bd224(0x18b)][_0x2be07d];if(!_0x539f72)throw CliErrors[_0x5bd224(0x174)](_0x5bd224(0x17d)+_0x2be07d+'\x22.');return{'method':_0x5bd224(0x18a),'url':_0x5bd224(0x187),'body':{'sqlCode':_0x2be07d,'id':_0x539f72[_0x5bd224(0x197)],'localPath':resolveLocalSqlFilePath(_0x581796,_0x2be07d,_0x539f72)},'description':_0x5bd224(0x175)+_0x2be07d+_0x5bd224(0x18d)+_0x581796['trashDir']};},async 'execute'(_0x41e59b){const _0x1c13e4=a187_0x9c068f,_0x2f3aea=loadSqlProjectConfig(_0x41e59b[_0x1c13e4(0x194)]),_0x2592a2=await readSqlLockFile(_0x2f3aea[_0x1c13e4(0x17f)]);if(!_0x2592a2)throw CliErrors[_0x1c13e4(0x174)](_0x1c13e4(0x173));const {lockData:_0xdf0604,appLock:_0x15fef2}=ensureSqlLockScope(_0x2592a2,_0x41e59b[_0x1c13e4(0x194)],_0x2f3aea[_0x1c13e4(0x183)],_0x1c13e4(0x196)),_0x23e539=_0x41e59b[_0x1c13e4(0x191)](_0x1c13e4(0x18c)),_0x3f6699=_0x15fef2[_0x1c13e4(0x18b)][_0x23e539];if(!_0x3f6699)throw CliErrors[_0x1c13e4(0x174)](_0x1c13e4(0x17d)+_0x23e539+'\x22.');await deleteSqlQuery({'id':_0x3f6699[_0x1c13e4(0x197)],'sqlCode':_0x23e539}),_0x15fef2['sqls']=Object['fromEntries'](Object['entries'](_0x15fef2[_0x1c13e4(0x18b)])[_0x1c13e4(0x17c)](([_0x486dd4])=>_0x486dd4!==_0x23e539)),_0x15fef2[_0x1c13e4(0x179)]=new Date()[_0x1c13e4(0x17b)](),await writeSqlLockFile(_0x2f3aea[_0x1c13e4(0x17f)],_0xdf0604);const _0x4e0f09=resolveLocalSqlFilePath(_0x2f3aea,_0x23e539,_0x3f6699);let _0x39913e;await fileExists(_0x4e0f09)&&(_0x39913e=await moveToTrash(_0x2f3aea[_0x1c13e4(0x18f)],_0x2f3aea['trashDir'],_0x4e0f09),await cleanupEmptyDirectories(dirname(_0x4e0f09),_0x2f3aea[_0x1c13e4(0x18e)]));const _0x5db69c={'deleted':_0x23e539,'remoteId':_0x3f6699[_0x1c13e4(0x197)]};if(_0x39913e)_0x5db69c['trashedTo']=_0x39913e;return{'ok':!![],'data':_0x5db69c,'message':_0x1c13e4(0x176)+_0x23e539+(_0x39913e?_0x1c13e4(0x17e):'')};}};async function moveToTrash(_0x23d152,_0xecc3cf,_0x4d2a33){const _0x567ecd=a187_0x9c068f,_0x35fe5a=new Date()['toISOString']()[_0x567ecd(0x182)](/[:.]/g,'-'),_0x4d9627=relative(_0x23d152,_0x4d2a33),_0x447b7e=join(_0xecc3cf,_0x35fe5a,_0x4d9627);return await mkdir(dirname(_0x447b7e),{'recursive':!![]}),await rename(_0x4d2a33,_0x447b7e),_0x447b7e;}async function cleanupEmptyDirectories(_0x50567c,_0x2e530f){const _0x390848=a187_0x9c068f;let _0x3fdef9=resolve(_0x50567c);const _0x10d4f1=resolve(_0x2e530f);while(_0x3fdef9[_0x390848(0x188)](''+_0x10d4f1+sep)||_0x3fdef9===_0x10d4f1){if(_0x3fdef9===_0x10d4f1)return;try{const _0x58a6ca=await readdir(_0x3fdef9);if(_0x58a6ca[_0x390848(0x171)]>0x0)return;await rmdir(_0x3fdef9);}catch{return;}_0x3fdef9=dirname(_0x3fdef9);}}function a187_0xea06(){const _0x5e776a=['16840gQterk','/smartapi/custom/deleteUserCustomSql','startsWith','3017KjhAfB','POST','sqls','sqlcode','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','sqlRootDir','projectRoot','976530HSyyAV','str','23847530wSjtXm','34326awcCst','appCode','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','delete','remoteId','length','sql','SQL\x20lock\x20file\x20not\x20found.','validation','Would\x20delete\x20SQL\x20','Deleted\x20','54256ZTjJwE','8881875exCCkf','lastSync','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','toISOString','filter','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','\x20(local\x20file\x20moved\x20to\x20trash)','lockFilePath','275oyhAqr','715404FSRwOW','replace','sqlRoot','high-risk-write','19WawkHh'];a187_0xea06=function(){return _0x5e776a;};return a187_0xea06();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a188_0x4c2f98=a188_0x58b0;(function(_0x342ce7,_0x34a243){const _0xf1628d=a188_0x58b0,_0xd64704=_0x342ce7();while(!![]){try{const _0x160f1e=parseInt(_0xf1628d(0x7f))/0x1+-parseInt(_0xf1628d(0x86))/0x2+-parseInt(_0xf1628d(0x83))/0x3*(-parseInt(_0xf1628d(0x84))/0x4)+parseInt(_0xf1628d(0x90))/0x5*(parseInt(_0xf1628d(0x8e))/0x6)+-parseInt(_0xf1628d(0x85))/0x7*(-parseInt(_0xf1628d(0x7e))/0x8)+-parseInt(_0xf1628d(0x8f))/0x9*(-parseInt(_0xf1628d(0x80))/0xa)+parseInt(_0xf1628d(0x8c))/0xb*(-parseInt(_0xf1628d(0x81))/0xc);if(_0x160f1e===_0x34a243)break;else _0xd64704['push'](_0xd64704['shift']());}catch(_0x556c64){_0xd64704['push'](_0xd64704['shift']());}}}(a188_0x597a,0x50d5c));import{getSqlQueryInfo}from'../../core/api-client.js';function a188_0x58b0(_0x1a65e5,_0x6a2723){_0x1a65e5=_0x1a65e5-0x7c;const _0x597a16=a188_0x597a();let _0x58b05d=_0x597a16[_0x1a65e5];return _0x58b05d;}function a188_0x597a(){const _0x533ca4=['detail','verbose','Return\x20full\x20raw\x20SQL\x20query\x20object','description','1242872rOfIcq','443689QggPOj','1190DjWCYK','792MATgUJ','str','3EOCpkd','1896288tDbGxU','7SetXJT','240448fjQaln','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlName','dbId','sqlcode','234817eHeeOY','appCode','330oTZrnm','16776LoPWVJ','51390gIPHvc','sql'];a188_0x597a=function(){return _0x533ca4;};return a188_0x597a();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a188_0x4c2f98(0x91),'command':a188_0x4c2f98(0x92),'description':a188_0x4c2f98(0x88),'risk':'read','flags':[SQLCODE_FLAG,{'name':a188_0x4c2f98(0x93),'type':'boolean','description':a188_0x4c2f98(0x7c)}],async 'execute'(_0x544f57){const _0x32ada9=a188_0x4c2f98,_0x3447f5=await getSqlQueryInfo(_0x544f57[_0x32ada9(0x8d)],_0x544f57[_0x32ada9(0x82)](_0x32ada9(0x8b))),_0x4f7563=_0x544f57['bool'](_0x32ada9(0x93));if(_0x4f7563)return{'ok':!![],'data':_0x3447f5};const _0x467598=_0x3447f5[_0x32ada9(0x8a)]?await getDbName(_0x544f57[_0x32ada9(0x8d)],_0x3447f5[_0x32ada9(0x8a)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3447f5['sqlCode'],'sqlName':_0x3447f5[_0x32ada9(0x89)],'db':_0x467598?_0x467598+'\x20('+_0x3447f5[_0x32ada9(0x8a)]+')':_0x3447f5[_0x32ada9(0x8a)]??'','description':_0x3447f5[_0x32ada9(0x7d)]??'','sqlContent':_0x3447f5[_0x32ada9(0x87)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a189_0x293016=a189_0x46ea;(function(_0x4d9e35,_0x58c051){const _0x2f4743=a189_0x46ea,_0x5d8f44=_0x4d9e35();while(!![]){try{const _0x50fd3f=parseInt(_0x2f4743(0x14d))/0x1*(-parseInt(_0x2f4743(0x13c))/0x2)+parseInt(_0x2f4743(0x14c))/0x3+parseInt(_0x2f4743(0x146))/0x4+parseInt(_0x2f4743(0x142))/0x5+parseInt(_0x2f4743(0x13e))/0x6+-parseInt(_0x2f4743(0x138))/0x7+parseInt(_0x2f4743(0x148))/0x8*(-parseInt(_0x2f4743(0x14b))/0x9);if(_0x50fd3f===_0x58c051)break;else _0x5d8f44['push'](_0x5d8f44['shift']());}catch(_0x4acd77){_0x5d8f44['push'](_0x5d8f44['shift']());}}}(a189_0x278a,0x7da7b));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a189_0x293016(0x13d),'command':a189_0x293016(0x14a),'description':a189_0x293016(0x145),'risk':a189_0x293016(0x135),'flags':[SQLCODE_FLAG,{'name':'params','type':a189_0x293016(0x141),'description':a189_0x293016(0x13f)}],async 'execute'(_0x27d9d8){const _0x32da0d=a189_0x293016,_0x427579=parseJsonParams(_0x27d9d8[_0x32da0d(0x144)](_0x32da0d(0x13b))),_0x35a061=Date[_0x32da0d(0x149)](),_0x2f3d3c=await executeSql(_0x27d9d8[_0x32da0d(0x136)],_0x27d9d8['str']('sqlcode'),_0x427579),_0x10143f=Date['now']()-_0x35a061,_0x2878df=_0x2f3d3c?.['execResult']??_0x2f3d3c,_0x1c85db=_0x2f3d3c?.['execSuccess']??!![];if(!_0x1c85db)return{'ok':![],'data':{'error':_0x2f3d3c?.[_0x32da0d(0x140)]||_0x32da0d(0x147),'elapsed':_0x10143f},'message':_0x32da0d(0x147)};const _0x386b08=Array[_0x32da0d(0x13a)](_0x2878df)?_0x2878df:[];return{'ok':!![],'data':{'rows':_0x386b08,'rowCount':_0x386b08[_0x32da0d(0x143)],'elapsed':_0x10143f},'message':_0x32da0d(0x137)+_0x386b08['length']+_0x32da0d(0x139)+_0x10143f+'ms'};}};function a189_0x46ea(_0x2f8628,_0x44c1b1){_0x2f8628=_0x2f8628-0x135;const _0x278ad4=a189_0x278a();let _0x46eabb=_0x278ad4[_0x2f8628];return _0x46eabb;}function a189_0x278a(){const _0x106663=['512964FZABro','2534205krIpAl','1tIyGHz','read','appCode','Returned\x20','5056702Icuwlc','\x20row(s)\x20in\x20','isArray','params','1665406vOfXdt','sql','3982194uVVHnN','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execError','string','2962845GLhAMt','length','str','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','103060fbLSiI','SQL\x20execution\x20failed','8DakseG','now','exec'];a189_0x278a=function(){return _0x106663;};return a189_0x278a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5a5979,_0x13f174){const _0xc7508a=a190_0xfa35,_0x364b46=_0x5a5979();while(!![]){try{const _0x1e74b3=parseInt(_0xc7508a(0xf3))/0x1+-parseInt(_0xc7508a(0xef))/0x2+parseInt(_0xc7508a(0xf6))/0x3+parseInt(_0xc7508a(0xf4))/0x4*(parseInt(_0xc7508a(0xf0))/0x5)+-parseInt(_0xc7508a(0xf2))/0x6*(parseInt(_0xc7508a(0xee))/0x7)+-parseInt(_0xc7508a(0xf5))/0x8+-parseInt(_0xc7508a(0xed))/0x9*(-parseInt(_0xc7508a(0xf1))/0xa);if(_0x1e74b3===_0x13f174)break;else _0x364b46['push'](_0x364b46['shift']());}catch(_0x330f21){_0x364b46['push'](_0x364b46['shift']());}}}(a190_0x2ac6,0x50b6b));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';function a190_0xfa35(_0x4215f1,_0x29546b){_0x4215f1=_0x4215f1-0xed;const _0x2ac673=a190_0x2ac6();let _0xfa3538=_0x2ac673[_0x4215f1];return _0xfa3538;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];function a190_0x2ac6(){const _0x3da098=['228OyJslZ','15048paHoRz','60DKeZVn','2918216LBTGpf','755247OupNTt','9437283DbTCpS','116851WKAkmA','272210EGZrjQ','50145ZkElAh','10kVdThb'];a190_0x2ac6=function(){return _0x3da098;};return a190_0x2ac6();}
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a191_0x8a9ce8=a191_0x3aeb;function a191_0x3aeb(_0x31006b,_0x39b816){_0x31006b=_0x31006b-0x1c4;const _0x3f7e31=a191_0x3f7e();let _0x3aeb27=_0x3f7e31[_0x31006b];return _0x3aeb27;}(function(_0x2dc88d,_0x2997dd){const _0x526ac=a191_0x3aeb,_0x236da3=_0x2dc88d();while(!![]){try{const _0xa15041=parseInt(_0x526ac(0x1ca))/0x1+parseInt(_0x526ac(0x1c5))/0x2+-parseInt(_0x526ac(0x1cb))/0x3*(-parseInt(_0x526ac(0x1c9))/0x4)+parseInt(_0x526ac(0x1c7))/0x5+-parseInt(_0x526ac(0x1dc))/0x6*(-parseInt(_0x526ac(0x1d7))/0x7)+-parseInt(_0x526ac(0x1e1))/0x8*(-parseInt(_0x526ac(0x1c4))/0x9)+parseInt(_0x526ac(0x1e3))/0xa*(-parseInt(_0x526ac(0x1d3))/0xb);if(_0xa15041===_0x2997dd)break;else _0x236da3['push'](_0x236da3['shift']());}catch(_0x3ec124){_0x236da3['push'](_0x236da3['shift']());}}}(a191_0x3f7e,0xd93aa));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a191_0x8a9ce8(0x1d6),'command':a191_0x8a9ce8(0x1eb),'description':a191_0x8a9ce8(0x1e0),'risk':a191_0x8a9ce8(0x1d0),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a191_0x8a9ce8(0x1da),'type':a191_0x8a9ce8(0x1d2),'description':a191_0x8a9ce8(0x1d5)},{'name':a191_0x8a9ce8(0x1d9),'type':a191_0x8a9ce8(0x1c6),'description':a191_0x8a9ce8(0x1e2),'default':0x1},{'name':a191_0x8a9ce8(0x1cf),'type':a191_0x8a9ce8(0x1c6),'description':a191_0x8a9ce8(0x1ea)},{'name':a191_0x8a9ce8(0x1e5),'type':'boolean','description':a191_0x8a9ce8(0x1cd)}],async 'execute'(_0x2a17e8){const _0x36f8b4=a191_0x8a9ce8,_0x1d300e=await listSqlQueries(_0x2a17e8[_0x36f8b4(0x1db)],{'sqlCode':_0x2a17e8['str'](_0x36f8b4(0x1ce))||undefined,'sqlName':_0x2a17e8[_0x36f8b4(0x1cc)]('name')||undefined,'currentPage':_0x2a17e8['num'](_0x36f8b4(0x1d9)),'pageSize':_0x2a17e8[_0x36f8b4(0x1e4)](_0x36f8b4(0x1cf),0x32)}),_0x1617ec=_0x2a17e8[_0x36f8b4(0x1e7)](_0x36f8b4(0x1e5)),_0x41afc2=_0x1d300e[_0x36f8b4(0x1dd)]??[],_0x5716fe=_0x1d300e['paging']?.[_0x36f8b4(0x1c8)]??_0x41afc2[_0x36f8b4(0x1d8)];let _0x459ce1;return _0x1617ec?_0x459ce1=_0x41afc2:_0x459ce1=await Promise[_0x36f8b4(0x1e6)](_0x41afc2['map'](async _0x31eb8b=>{const _0x142fc0=_0x36f8b4;let _0x33bbd6;try{_0x33bbd6=_0x31eb8b['dbId']?await getDbName(_0x2a17e8[_0x142fc0(0x1db)],_0x31eb8b[_0x142fc0(0x1df)]):undefined;}catch{}return{'sqlCode':_0x31eb8b[_0x142fc0(0x1d4)],'sqlName':_0x31eb8b[_0x142fc0(0x1de)],'description':_0x31eb8b[_0x142fc0(0x1d1)]??'','db':_0x33bbd6?_0x33bbd6+'\x20('+_0x31eb8b[_0x142fc0(0x1df)]+')':_0x31eb8b['dbId']??''};})),{'ok':!![],'data':_0x459ce1,'message':_0x41afc2[_0x36f8b4(0x1d8)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x36f8b4(0x1e8)+_0x41afc2[_0x36f8b4(0x1d8)]+_0x36f8b4(0x1e9)+_0x5716fe+').'};}};function a191_0x3f7e(){const _0x47d0ae=['read','description','string','43219ODnTOs','sqlCode','Filter\x20by\x20SQL\x20name','sql','7dghsmr','length','page','name','appCode','5227344JrMQrF','tableData','sqlName','dbId','List\x20custom\x20SQL\x20queries','1144864yNwndk','Page\x20number','11230rrjgsX','num','verbose','all','bool','Found\x20','\x20SQL\x20queries\x20(total:\x20','Page\x20size','list','72HrRwDT','1809536fCaIZL','number','4322225Ndpltr','totalCount','596mUlCwQ','1478890rDtKKV','762hPRXqH','str','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','sqlcode','pagesize'];a191_0x3f7e=function(){return _0x47d0ae;};return a191_0x3f7e();}
|