@lovrabet/rabetbase-cli 2.5.0-beta.2 → 2.5.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +5 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a173_0x3fdc53=a173_0x1a66;(function(_0x3b9697,_0x3e5ed4){const _0x4c76e4=a173_0x1a66,_0x527bc1=_0x3b9697();while(!![]){try{const _0x53a650=-parseInt(_0x4c76e4(0x1c3))/0x1+parseInt(_0x4c76e4(0x1b8))/0x2*(parseInt(_0x4c76e4(0x1be))/0x3)+-parseInt(_0x4c76e4(0x1c1))/0x4*(-parseInt(_0x4c76e4(0x1bc))/0x5)+-parseInt(_0x4c76e4(0x1c2))/0x6*(-parseInt(_0x4c76e4(0x1bd))/0x7)+parseInt(_0x4c76e4(0x1b7))/0x8*(-parseInt(_0x4c76e4(0x1c7))/0x9)+-parseInt(_0x4c76e4(0x1b9))/0xa+parseInt(_0x4c76e4(0x1c5))/0xb*(parseInt(_0x4c76e4(0x1c6))/0xc);if(_0x53a650===_0x3e5ed4)break;else _0x527bc1['push'](_0x527bc1['shift']());}catch(_0xa6051b){_0x527bc1['push'](_0x527bc1['shift']());}}}(a173_0x3447,0xee5b1));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a173_0x1a66(_0x16b990,_0x226752){_0x16b990=_0x16b990-0x1ae;const _0x34477d=a173_0x3447();let _0x1a66f8=_0x34477d[_0x16b990];return _0x1a66f8;}function a173_0x3447(){const _0x45c099=['Deleted\x20role\x20','\x20(id=','14165kPjVBm','64806dXwDNp','15909LqTrsq','POST','dev','1588guJFzF','846ulAtMs','1910567XQqDiZ','num','72303viJitG','816qikMVR','522OioMMK','appCode','delete','high-risk-write','roleName','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','Role\x20still\x20has\x20','role','userCount','36224WhNJvE','570WRoNuC','12389020LvCscf'];a173_0x3447=function(){return _0x45c099;};return a173_0x3447();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a173_0x3fdc53(0x1b5),'command':a173_0x3fdc53(0x1af),'description':a173_0x3fdc53(0x1b3),'risk':a173_0x3fdc53(0x1b0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4f3917){const _0x5e2d9f=a173_0x3fdc53,_0x5a0c38=_0x4f3917[_0x5e2d9f(0x1c4)]('id'),_0x3e1da6=await getRoleById(_0x4f3917['appCode'],_0x5a0c38);return assertCustomRole(_0x3e1da6,_0x5e2d9f(0x1af)),asDryRunResult({'scope':_0x5e2d9f(0x1c0),'operation':_0x5e2d9f(0x1af),'selector':{'appCode':_0x4f3917[_0x5e2d9f(0x1ae)],'roleId':_0x5a0c38,'roleName':_0x3e1da6[_0x5e2d9f(0x1b1)]},'before':projectRole(_0x3e1da6),'after':null,'dryRun':!![],'backend':{'method':_0x5e2d9f(0x1bf),'path':DELETE_PATH},'warnings':_0x3e1da6[_0x5e2d9f(0x1b6)]>0x0?[_0x5e2d9f(0x1b4)+_0x3e1da6[_0x5e2d9f(0x1b6)]+_0x5e2d9f(0x1b2)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x2e19cc){const _0x8589c=a173_0x3fdc53,_0x2fe8ec=_0x2e19cc['num']('id'),_0xc8b944=await getRoleById(_0x2e19cc[_0x8589c(0x1ae)],_0x2fe8ec);return assertCustomRole(_0xc8b944,_0x8589c(0x1af)),await deleteAppRole(_0x2fe8ec),{'ok':!![],'data':{'scope':_0x8589c(0x1c0),'operation':'delete','selector':{'appCode':_0x2e19cc['appCode'],'roleId':_0x2fe8ec,'roleName':_0xc8b944[_0x8589c(0x1b1)]},'before':projectRole(_0xc8b944),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x8589c(0x1ba)+_0xc8b944['roleName']+_0x8589c(0x1bb)+_0x2fe8ec+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a174_0x11fb29=a174_0x4249;(function(_0x15a7b4,_0x5503c2){const _0x11a330=a174_0x4249,_0x3a7ece=_0x15a7b4();while(!![]){try{const _0x2ec21f=-parseInt(_0x11a330(0x19c))/0x1*(parseInt(_0x11a330(0x18d))/0x2)+parseInt(_0x11a330(0x199))/0x3+parseInt(_0x11a330(0x19b))/0x4+parseInt(_0x11a330(0x195))/0x5+-parseInt(_0x11a330(0x19a))/0x6+parseInt(_0x11a330(0x192))/0x7*(-parseInt(_0x11a330(0x19e))/0x8)+parseInt(_0x11a330(0x19d))/0x9;if(_0x2ec21f===_0x5503c2)break;else _0x3a7ece['push'](_0x3a7ece['shift']());}catch(_0x272f8d){_0x3a7ece['push'](_0x3a7ece['shift']());}}}(a174_0x2edc,0xa9353));function a174_0x4249(_0xd6c326,_0x453178){_0xd6c326=_0xd6c326-0x18d;const _0x2edcb8=a174_0x2edc();let _0x4249db=_0x2edcb8[_0xd6c326];return _0x4249db;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a174_0x2edc(){const _0x3eb8da=['944085gbhbbB','3842616xsKZgF','2043852OAJbqx','361866UbkRRh','6470199UeQcAm','48LYGDmm','2NoznJk','role','Role\x20','appCode','detail','1063489fSDwLe','Show\x20a\x20single\x20role\x27s\x20detail','read','5311850YwhZif','roleName','roleType','num'];a174_0x2edc=function(){return _0x3eb8da;};return a174_0x2edc();}export const roleDetail={'service':a174_0x11fb29(0x18e),'command':a174_0x11fb29(0x191),'description':a174_0x11fb29(0x193),'risk':a174_0x11fb29(0x194),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x145993){const _0x20729d=a174_0x11fb29,_0x1a1a35=_0x145993[_0x20729d(0x198)]('id'),_0x17dd31=await getRoleById(_0x145993[_0x20729d(0x190)],_0x1a1a35);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x17dd31)},'message':_0x20729d(0x18f)+_0x17dd31[_0x20729d(0x196)]+'\x20('+_0x17dd31[_0x20729d(0x197)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x35776d,_0x5373ff){const _0x3f1069=a175_0x22e5,_0x1ab550=_0x35776d();while(!![]){try{const _0x2cf026=parseInt(_0x3f1069(0xe2))/0x1+-parseInt(_0x3f1069(0xdf))/0x2+parseInt(_0x3f1069(0xe3))/0x3*(parseInt(_0x3f1069(0xe5))/0x4)+-parseInt(_0x3f1069(0xe7))/0x5+parseInt(_0x3f1069(0xe0))/0x6+-parseInt(_0x3f1069(0xe6))/0x7*(parseInt(_0x3f1069(0xe4))/0x8)+-parseInt(_0x3f1069(0xe1))/0x9;if(_0x2cf026===_0x5373ff)break;else _0x1ab550['push'](_0x1ab550['shift']());}catch(_0x39c4d5){_0x1ab550['push'](_0x1ab550['shift']());}}}(a175_0x14ec,0x2b1e0));function a175_0x14ec(){const _0x3c4808=['191157pFJSba','225333GhEDoA','1760752AyGnee','16UdJvIG','7BFJJCK','876085fUbvem','57252BsTbwu','1554642ATLVQl','1351467FRlbYx'];a175_0x14ec=function(){return _0x3c4808;};return a175_0x14ec();}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';function a175_0x22e5(_0x31ae9c,_0x216b5a){_0x31ae9c=_0x31ae9c-0xdf;const _0x14ecd3=a175_0x14ec();let _0x22e50e=_0x14ecd3[_0x31ae9c];return _0x22e50e;}import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a176_0x1216ea=a176_0x2cb2;function a176_0x2cb2(_0x516369,_0x584543){_0x516369=_0x516369-0x10f;const _0x222ffe=a176_0x222f();let _0x2cb225=_0x222ffe[_0x516369];return _0x2cb225;}function a176_0x222f(){const _0x819500=['list','role','string','5897680OGSPZR','12043170wRAVoR','\x20role(s)','11266qBhoZU','validation','4495765TtwWDU','number','trim','toUpperCase','Found\x20','includes','Page\x20index\x20(1-based)','10952515EQsXAz','type','OWNER','Filter\x20by\x20role\x20type','1746788uaVLJR','map','str','DEV','appCode','6JsrwCj','num','ADMIN','Invalid\x20--type\x20\x22','9KuzhVn','345noUhgj','dev','3606548VpEszn','Use\x20one\x20of:\x20','page','pagesize','CUSTOM','filter','roleType','length'];a176_0x222f=function(){return _0x819500;};return a176_0x222f();}(function(_0x416326,_0x3197de){const _0x10b378=a176_0x2cb2,_0x5dc703=_0x416326();while(!![]){try{const _0x498cc1=-parseInt(_0x10b378(0x12e))/0x1+parseInt(_0x10b378(0x121))/0x2*(parseInt(_0x10b378(0x111))/0x3)+-parseInt(_0x10b378(0x113))/0x4+parseInt(_0x10b378(0x123))/0x5*(parseInt(_0x10b378(0x133))/0x6)+parseInt(_0x10b378(0x12a))/0x7+-parseInt(_0x10b378(0x11e))/0x8+-parseInt(_0x10b378(0x110))/0x9*(-parseInt(_0x10b378(0x11f))/0xa);if(_0x498cc1===_0x3197de)break;else _0x5dc703['push'](_0x5dc703['shift']());}catch(_0x16e010){_0x5dc703['push'](_0x5dc703['shift']());}}}(a176_0x222f,0xe31e3));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a176_0x1216ea(0x135),a176_0x1216ea(0x131),a176_0x1216ea(0x12c),a176_0x1216ea(0x117)];export const roleList={'service':a176_0x1216ea(0x11c),'command':a176_0x1216ea(0x11b),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a176_0x1216ea(0x12b),'type':a176_0x1216ea(0x11d),'required':![],'description':a176_0x1216ea(0x12d),'enum':ROLE_TYPES},{'name':a176_0x1216ea(0x115),'type':a176_0x1216ea(0x124),'description':a176_0x1216ea(0x129),'default':0x1},{'name':'pagesize','type':a176_0x1216ea(0x124),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x2ad68a){const _0x3984c4=a176_0x1216ea,_0x225f2f=_0x2ad68a[_0x3984c4(0x130)]('type')[_0x3984c4(0x125)]();if(_0x225f2f&&!ROLE_TYPES[_0x3984c4(0x128)](_0x225f2f[_0x3984c4(0x126)]()))throw CliErrors['validation'](_0x3984c4(0x10f)+_0x225f2f+'\x22.',_0x3984c4(0x114)+ROLE_TYPES['join'](',\x20')+'.');const _0x5623e8=_0x2ad68a[_0x3984c4(0x134)]('page',0x1),_0x12d07c=_0x2ad68a[_0x3984c4(0x134)](_0x3984c4(0x116),0x64);if(_0x5623e8<0x1)throw CliErrors[_0x3984c4(0x122)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x12d07c<0x1||_0x12d07c>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x4756cd){const _0x1b38c8=a176_0x1216ea,_0x179b04=_0x4756cd[_0x1b38c8(0x134)](_0x1b38c8(0x115),0x1)||0x1,_0x26eabf=_0x4756cd[_0x1b38c8(0x134)](_0x1b38c8(0x116),0x64)||0x64,_0x3ab4e0=_0x4756cd[_0x1b38c8(0x130)]('type')['trim']()[_0x1b38c8(0x126)](),{items:_0x499f61,paging:_0x4cb68c}=await listAppRoles(_0x4756cd[_0x1b38c8(0x132)],{'currentPage':_0x179b04,'pageSize':_0x26eabf}),_0x7f8e46=_0x3ab4e0?_0x499f61[_0x1b38c8(0x118)](_0x5af4f2=>_0x5af4f2[_0x1b38c8(0x119)]===_0x3ab4e0):_0x499f61,_0x551930=_0x7f8e46[_0x1b38c8(0x12f)](projectRole);return{'ok':!![],'data':{'scope':_0x1b38c8(0x112),'roles':_0x551930,'paging':_0x4cb68c},'message':_0x1b38c8(0x127)+_0x551930[_0x1b38c8(0x11a)]+_0x1b38c8(0x120)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a177_0x30c665=a177_0x36d7;(function(_0x2e1484,_0x5b9147){const _0x490156=a177_0x36d7,_0x2b87e0=_0x2e1484();while(!![]){try{const _0x21842f=parseInt(_0x490156(0x147))/0x1*(-parseInt(_0x490156(0x13d))/0x2)+parseInt(_0x490156(0x157))/0x3*(-parseInt(_0x490156(0x127))/0x4)+-parseInt(_0x490156(0x12a))/0x5+-parseInt(_0x490156(0x11f))/0x6+parseInt(_0x490156(0x139))/0x7*(-parseInt(_0x490156(0x159))/0x8)+-parseInt(_0x490156(0x13c))/0x9*(-parseInt(_0x490156(0x122))/0xa)+parseInt(_0x490156(0x138))/0xb*(parseInt(_0x490156(0x12b))/0xc);if(_0x21842f===_0x5b9147)break;else _0x2b87e0['push'](_0x2b87e0['shift']());}catch(_0x543208){_0x2b87e0['push'](_0x2b87e0['shift']());}}}(a177_0x1073,0x35f17));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';function a177_0x36d7(_0x4b0ba,_0x2c87bf){_0x4b0ba=_0x4b0ba-0x113;const _0x10734f=a177_0x1073();let _0x36d713=_0x10734f[_0x4b0ba];return _0x36d713;}import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a177_0x30c665(0x12e),'required':!![],'description':a177_0x30c665(0x161)};export const ROLE_REF_FLAG={'name':'role','type':a177_0x30c665(0x152),'required':!![],'description':a177_0x30c665(0x123)};export const USER_REF_FLAG={'name':a177_0x30c665(0x118),'type':'string','required':!![],'description':a177_0x30c665(0x129)};export const NAME_FLAG={'name':a177_0x30c665(0x145),'type':'string','required':!![],'description':a177_0x30c665(0x15a)};export const USER_NAME_FLAG={'name':a177_0x30c665(0x145),'type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a177_0x30c665(0x11b),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a177_0x30c665(0x125),'type':'number','required':![],'description':a177_0x30c665(0x15c)};export const BUILTIN_ROLE_TYPES=[a177_0x30c665(0x12d),a177_0x30c665(0x134),a177_0x30c665(0x126)];function a177_0x1073(){const _0x501ab8=['\x20is\x20already\x20a\x20member\x20of\x20role\x20','toLowerCase','\x22\x20not\x20found\x20in\x20app\x20','\x22:\x20','nickname','filter','name','Pass\x20--user\x20<id|name>.','46362wtfXjz','POST','Missing\x20role\x20reference.','Role\x20name\x20\x22',';\x20no\x20change.','Pass\x20--role\x20<id|name>.','dryRun','/smartapi/permit/user-role/delete','CUSTOM','totalCount','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','string','/smartapi/permit/user-role/create','\x20duplicate\x20memberships\x20for\x20user\x20','user-add','flagMissing','4749xGqOwZ','userId','95896SdzQeU','Role\x20name','tenant','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x20members\x20of\x20the\x20OWNER\x20role.','flag','length','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Role\x20id\x20(from\x20`role\x20list`)','Check\x20the\x20nickname/username.\x20','\x20member(s)\x20but\x20role\x20has\x20','map','Missing\x20user\x20reference.','str','appCode','tenant_code','expectUserCount','user','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','roleName','remark','role','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','1138182wDmtUn','permitCount','push','30GqUDbJ','Role\x20id\x20or\x20exact\x20role\x20name','validation','expect-user-count','OWNER','456CkCLdi','dev','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','1256810cRqvLA','7238688wdXiUq','userCount','ADMIN','number','test','join','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Disambiguate\x20with\x20--role\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','DEV','roleType','username','find','22aXuZIN','35uUWuvl','trim','User\x20','200565zLzTae','16weuaYI','No\x20tenant\x20member\x20matches\x20\x22'];a177_0x1073=function(){return _0x501ab8;};return a177_0x1073();}export function isBuiltinRole(_0x53afc5){return BUILTIN_ROLE_TYPES['includes'](_0x53afc5);}export function assertCustomRole(_0x2d9754,_0x252f96){const _0xe26c31=a177_0x30c665;if(_0x2d9754[_0xe26c31(0x135)]!==_0xe26c31(0x14f))throw CliErrors[_0xe26c31(0x124)]('Cannot\x20'+_0x252f96+'\x20built-in\x20role\x20'+_0x2d9754[_0xe26c31(0x11a)]+'\x20('+_0x2d9754[_0xe26c31(0x135)]+').',_0xe26c31(0x151));}export function projectRole(_0x57dca6){const _0x3aa6d5=a177_0x30c665;return{'id':_0x57dca6['id'],'roleName':_0x57dca6[_0x3aa6d5(0x11a)],'roleType':_0x57dca6[_0x3aa6d5(0x135)],'remark':_0x57dca6['remark'],'userCount':_0x57dca6[_0x3aa6d5(0x12c)],'permitCount':_0x57dca6[_0x3aa6d5(0x120)],'builtin':isBuiltinRole(_0x57dca6[_0x3aa6d5(0x135)])};}export async function resolveRoleRef(_0x2200e0,_0x4aa7fc){const _0x3ba70c=a177_0x30c665,_0x51b436=_0x4aa7fc[_0x3ba70c(0x13a)]();if(!_0x51b436)throw CliErrors[_0x3ba70c(0x124)](_0x3ba70c(0x149),_0x3ba70c(0x14c));if(/^\d+$/['test'](_0x51b436))return getRoleById(_0x2200e0,Number(_0x51b436));const _0x48e641=await listAllAppRoles(_0x2200e0),_0x1cddcd=_0x48e641['filter'](_0xf329fa=>_0xf329fa[_0x3ba70c(0x11a)]===_0x51b436);if(_0x1cddcd[_0x3ba70c(0x15f)]===0x0)throw CliErrors[_0x3ba70c(0x124)](_0x3ba70c(0x14a)+_0x51b436+_0x3ba70c(0x141)+_0x2200e0+'.',_0x3ba70c(0x133));if(_0x1cddcd['length']>0x1){const _0x350adf=_0x1cddcd[_0x3ba70c(0x164)](_0x5af15f=>_0x5af15f['id'])[_0x3ba70c(0x130)](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x51b436+_0x3ba70c(0x11e)+_0x350adf+').',_0x3ba70c(0x132));}return _0x1cddcd[0x0];}export async function getRoleById(_0x65fecf,_0x2851a7){const _0x24a70c=a177_0x30c665,_0xaaafa=await listAllAppRoles(_0x65fecf),_0x59d11b=_0xaaafa[_0x24a70c(0x144)](_0x1caa53=>_0x1caa53['id']===_0x2851a7&&(!_0x1caa53[_0x24a70c(0x115)]||_0x1caa53[_0x24a70c(0x115)]===_0x65fecf));if(_0x59d11b[_0x24a70c(0x15f)]!==0x1)throw CliErrors[_0x24a70c(0x124)]('Role\x20id\x20'+_0x2851a7+'\x20not\x20found\x20in\x20app\x20'+_0x65fecf+'.',_0x24a70c(0x131));return _0x59d11b[0x0];}async function listAllAppRoles(_0x1be02e){const _0x21ea8a=a177_0x30c665,_0xfe3e4d=0x64,_0x2b30ca=[];for(let _0x598df6=0x1;;_0x598df6+=0x1){const {items:_0x315781,paging:_0x132d98}=await listAppRoles(_0x1be02e,{'currentPage':_0x598df6,'pageSize':_0xfe3e4d});_0x2b30ca[_0x21ea8a(0x121)](..._0x315781);if(_0x315781[_0x21ea8a(0x15f)]<_0xfe3e4d||_0x132d98&&_0x2b30ca[_0x21ea8a(0x15f)]>=_0x132d98[_0x21ea8a(0x150)])return _0x2b30ca;}}export async function resolveTenantCode(){const _0x247e22=a177_0x30c665,_0x226f79=await getSessionUserInfo(),_0x1bd467=_0x226f79?.['user']?.[_0x247e22(0x15b)]?.[_0x247e22(0x116)];if(!_0x1bd467)throw CliErrors['authRequired'](_0x247e22(0x119));return _0x1bd467;}function matchMember(_0x3e6577,_0x3742a5){const _0x547022=a177_0x30c665,_0x1120d9=_0x3742a5[_0x547022(0x13a)]()[_0x547022(0x140)]();return(_0x3e6577[_0x547022(0x143)]??'')[_0x547022(0x140)]()===_0x1120d9||(_0x3e6577[_0x547022(0x136)]??'')['toLowerCase']()===_0x1120d9;}export async function resolveUserRef(_0x5d3384,_0x2f8f13='Pass\x20--user\x20<id>.'){const _0xa3d98d=a177_0x30c665,_0x3472ea=_0x5d3384[_0xa3d98d(0x13a)]();if(!_0x3472ea)throw CliErrors[_0xa3d98d(0x124)](_0xa3d98d(0x113),'Pass\x20--user\x20<id|name>.');const _0xbb0f8d=await resolveTenantCode(),_0x366e64=await getTenantMembers(_0xbb0f8d);if(/^\d+$/[_0xa3d98d(0x12f)](_0x3472ea)){const _0x410811=Number(_0x3472ea),_0x1391c1=_0x366e64[_0xa3d98d(0x137)](_0xe1ac6b=>_0xe1ac6b[_0xa3d98d(0x158)]===_0x410811);return{'userId':_0x410811,'username':_0x1391c1?.[_0xa3d98d(0x136)]??String(_0x410811),'nickname':_0x1391c1?.['nickname'],'matchedBy':'id'};}const _0x504ac4=_0x366e64['filter'](_0x2f6846=>matchMember(_0x2f6846,_0x3472ea));if(_0x504ac4['length']===0x0)throw CliErrors[_0xa3d98d(0x124)](_0xa3d98d(0x13e)+_0x3472ea+'\x22.',_0xa3d98d(0x162)+_0x2f8f13);if(_0x504ac4['length']>0x1){const _0x4e8d6f=_0x504ac4['map'](_0x2a0092=>(_0x2a0092[_0xa3d98d(0x143)]??_0x2a0092['username']??'?')+'('+_0x2a0092[_0xa3d98d(0x158)]+')')[_0xa3d98d(0x130)](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x3472ea+_0xa3d98d(0x142)+_0x4e8d6f+'.',_0x2f8f13);}const _0x15262f=_0x504ac4[0x0];return{'userId':_0x15262f[_0xa3d98d(0x158)],'username':_0x15262f[_0xa3d98d(0x136)]??String(_0x15262f[_0xa3d98d(0x158)]),'nickname':_0x15262f[_0xa3d98d(0x143)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a177_0x30c665(0x153);export const DELETE_USER_ROLE_PATH=a177_0x30c665(0x14e);export function computeRoleUserMutation(_0x46db58){const _0x4d8778=a177_0x30c665,{operation:_0x381cd2,appCode:_0x5ad49b,role:_0x1ccceb,relations:_0x20d3fd,user:_0xa7980a}=_0x46db58,_0x2b6c57=[...new Set(_0x20d3fd['map'](_0x5fb61c=>_0x5fb61c['userId']))],_0xd23f08=[];if(_0x46db58[_0x4d8778(0x117)]!==undefined&&_0x46db58['expectUserCount']!==_0x2b6c57['length'])throw CliErrors[_0x4d8778(0x124)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x46db58[_0x4d8778(0x117)]+_0x4d8778(0x163)+_0x2b6c57[_0x4d8778(0x15f)]+'.',_0x4d8778(0x11d));const _0x41b8c6=_0x2b6c57['includes'](_0xa7980a[_0x4d8778(0x158)]),_0x2ce033=_0x20d3fd['filter'](_0x4210bd=>_0x4210bd[_0x4d8778(0x158)]===_0xa7980a[_0x4d8778(0x158)])[_0x4d8778(0x164)](_0x4cbbde=>_0x4cbbde['id']),_0x331cc5=_0x381cd2===_0x4d8778(0x155)?!_0x41b8c6:_0x41b8c6;let _0x29e655=_0x2b6c57;_0x381cd2===_0x4d8778(0x155)?_0x41b8c6?_0xd23f08['push'](_0x4d8778(0x13b)+_0xa7980a[_0x4d8778(0x158)]+_0x4d8778(0x13f)+_0x1ccceb[_0x4d8778(0x11a)]+';\x20no\x20change.'):_0x29e655=[..._0x2b6c57,_0xa7980a[_0x4d8778(0x158)]]:!_0x41b8c6?_0xd23f08[_0x4d8778(0x121)](_0x4d8778(0x13b)+_0xa7980a[_0x4d8778(0x158)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x1ccceb[_0x4d8778(0x11a)]+_0x4d8778(0x14b)):(_0x29e655=_0x2b6c57['filter'](_0x21a1bf=>_0x21a1bf!==_0xa7980a['userId']),_0x2ce033['length']>0x1&&_0xd23f08[_0x4d8778(0x121)]('Removed\x20'+_0x2ce033[_0x4d8778(0x15f)]+_0x4d8778(0x154)+_0xa7980a[_0x4d8778(0x158)]+'.'));const _0x29ca2f={'scope':_0x4d8778(0x128),'operation':_0x381cd2,'selector':{'appCode':_0x5ad49b,'roleId':_0x1ccceb['id'],'roleName':_0x1ccceb[_0x4d8778(0x11a)],'userId':_0xa7980a[_0x4d8778(0x158)]},'before':{'userIds':_0x2b6c57},'after':{'userIds':_0x29e655},'dryRun':_0x46db58[_0x4d8778(0x14d)],'backend':{'method':_0x4d8778(0x148),'path':_0x381cd2===_0x4d8778(0x155)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xd23f08};return{'mutation':_0x29ca2f,'changed':_0x331cc5,'matchingRelationIds':_0x2ce033};}export async function loadDevRoleRelations(_0x531964,_0x32b54b){const _0x4051fd=a177_0x30c665,_0x2f8013=0x64,_0x5b999b=[];for(let _0x5c0142=0x1;;_0x5c0142+=0x1){const {items:_0x49e90b,paging:_0x39c1d9}=await listDevUserRoleRelations(_0x531964,{'roleId':_0x32b54b,'currentPage':_0x5c0142,'pageSize':_0x2f8013});_0x5b999b[_0x4051fd(0x121)](..._0x49e90b);if(_0x49e90b['length']<_0x2f8013||_0x39c1d9&&_0x5b999b[_0x4051fd(0x15f)]>=_0x39c1d9[_0x4051fd(0x150)])return _0x5b999b;}}export function readRoleRef(_0x165123){const _0x4a9f00=a177_0x30c665,_0x4fbc29=_0x165123[_0x4a9f00(0x114)](_0x4a9f00(0x11c))[_0x4a9f00(0x13a)]();if(!_0x4fbc29)throw CliErrors[_0x4a9f00(0x156)]('role','Pass\x20--role\x20<id|name>.');return _0x4fbc29;}export async function prepareUserMutation(_0x497c9c,_0x1fbec3,_0x180cb4){const _0x158909=a177_0x30c665,_0x5ac347=readRoleRef(_0x497c9c),_0x1ea66b=_0x497c9c[_0x158909(0x114)](_0x158909(0x118))[_0x158909(0x13a)]();if(!_0x1ea66b)throw CliErrors[_0x158909(0x156)]('user',_0x158909(0x146));const _0x32289c=_0x497c9c[_0x158909(0x15e)](_0x158909(0x125)),_0x2d8a45=_0x32289c===undefined||_0x32289c===null?undefined:Number(_0x32289c),_0x1fe342=await resolveRoleRef(_0x497c9c[_0x158909(0x115)],_0x5ac347);if(_0x1fe342[_0x158909(0x135)]===_0x158909(0x126))throw CliErrors[_0x158909(0x124)]('Cannot\x20'+_0x1fbec3+_0x158909(0x15d),_0x158909(0x160));const _0x11df16=await resolveUserRef(_0x1ea66b),_0x5a4dce=await loadDevRoleRelations(_0x497c9c['appCode'],_0x1fe342['id']);return{...computeRoleUserMutation({'operation':_0x1fbec3,'appCode':_0x497c9c['appCode'],'role':_0x1fe342,'relations':_0x5a4dce,'user':{'userId':_0x11df16[_0x158909(0x158)],'username':_0x11df16[_0x158909(0x136)],'nickname':_0x11df16['nickname']},'dryRun':_0x180cb4,..._0x2d8a45!==undefined?{'expectUserCount':_0x2d8a45}:{}}),'role':_0x1fe342,'user':_0x11df16};}
|
|
1
|
+
const a177_0x3e1a28=a177_0x3acf;(function(_0x4abe13,_0xf6c6a6){const _0x5b5914=a177_0x3acf,_0x3f604c=_0x4abe13();while(!![]){try{const _0x1de7cb=-parseInt(_0x5b5914(0x134))/0x1*(-parseInt(_0x5b5914(0x123))/0x2)+parseInt(_0x5b5914(0x15b))/0x3+parseInt(_0x5b5914(0x129))/0x4*(parseInt(_0x5b5914(0x140))/0x5)+parseInt(_0x5b5914(0x128))/0x6*(parseInt(_0x5b5914(0x14f))/0x7)+parseInt(_0x5b5914(0x118))/0x8*(-parseInt(_0x5b5914(0x133))/0x9)+parseInt(_0x5b5914(0x135))/0xa+-parseInt(_0x5b5914(0x130))/0xb*(parseInt(_0x5b5914(0x162))/0xc);if(_0x1de7cb===_0xf6c6a6)break;else _0x3f604c['push'](_0x3f604c['shift']());}catch(_0x1ed4f7){_0x3f604c['push'](_0x3f604c['shift']());}}}(a177_0x220e,0xc5a11));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':a177_0x3e1a28(0x148),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a177_0x3e1a28(0x12c),'type':a177_0x3e1a28(0x15f),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a177_0x3e1a28(0x14b),'type':a177_0x3e1a28(0x15f),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a177_0x3e1a28(0x11e)};export const USER_NAME_FLAG={'name':a177_0x3e1a28(0x15e),'type':'string','required':!![],'description':a177_0x3e1a28(0x124)};export const REMARK_FLAG={'name':a177_0x3e1a28(0x120),'type':a177_0x3e1a28(0x15f),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a177_0x3e1a28(0x151),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a177_0x3e1a28(0x15c),a177_0x3e1a28(0x155),a177_0x3e1a28(0x136)];export function isBuiltinRole(_0x3f6294){const _0x1f3fdb=a177_0x3e1a28;return BUILTIN_ROLE_TYPES[_0x1f3fdb(0x141)](_0x3f6294);}export function assertCustomRole(_0x11b00e,_0x104881){const _0xa18291=a177_0x3e1a28;if(_0x11b00e[_0xa18291(0x137)]!==_0xa18291(0x167))throw CliErrors['validation'](_0xa18291(0x166)+_0x104881+_0xa18291(0x14d)+_0x11b00e[_0xa18291(0x121)]+'\x20('+_0x11b00e[_0xa18291(0x137)]+').',_0xa18291(0x138));}function a177_0x220e(){const _0x7b3679=['roleType','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','/smartapi/permit/user-role/create','str','Pass\x20--role\x20<id|name>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Pass\x20--user\x20<id>.','user-add','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','10HtltWO','includes','totalCount','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','Removed\x20','find','Missing\x20role\x20reference.','number','permitCount','expectUserCount','user','validation','\x20built-in\x20role\x20','dev','1434881FdIpNT','flag','expect-user-count','Disambiguate\x20with\x20--role\x20<id>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','push','DEV',';\x20no\x20change.','toLowerCase','Multiple\x20tenant\x20members\x20match\x20\x22','Check\x20the\x20nickname/username.\x20','username','3132438EFTFUY','ADMIN','\x20members\x20of\x20the\x20OWNER\x20role.','name','string','flagMissing','userId','876EMsjtA','\x22\x20not\x20found\x20in\x20app\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','authRequired','Cannot\x20','CUSTOM','\x20not\x20found\x20in\x20app\x20','POST','join','dryRun','\x20is\x20not\x20a\x20member\x20of\x20role\x20','/smartapi/permit/user-role/delete','3032QkTQvu','userCount','nickname','appCode','No\x20tenant\x20member\x20matches\x20\x22','Pass\x20--user\x20<id|name>.','Role\x20name','\x20duplicate\x20memberships\x20for\x20user\x20','remark','roleName','tenant','13082aiilgN','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','test','\x22:\x20','tenant_code','30lKjvPb','788288MMFgJD','map','Role\x20id\x20','role','length','trim','filter','353254DPXCsK','Role\x20name\x20\x22','Anti-drift\x20check\x20failed:\x20expected\x20','10494auPbFT','14unPeoE','10409460DIoIvO','OWNER'];a177_0x220e=function(){return _0x7b3679;};return a177_0x220e();}export function projectRole(_0x5ac05b){const _0x6b21c9=a177_0x3e1a28;return{'id':_0x5ac05b['id'],'roleName':_0x5ac05b[_0x6b21c9(0x121)],'roleType':_0x5ac05b['roleType'],'remark':_0x5ac05b[_0x6b21c9(0x120)],'userCount':_0x5ac05b[_0x6b21c9(0x119)],'permitCount':_0x5ac05b[_0x6b21c9(0x149)],'builtin':isBuiltinRole(_0x5ac05b['roleType'])};}export async function resolveRoleRef(_0x1aa8d8,_0xb19bba){const _0x206350=a177_0x3e1a28,_0x165638=_0xb19bba[_0x206350(0x12e)]();if(!_0x165638)throw CliErrors[_0x206350(0x14c)](_0x206350(0x147),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x165638))return getRoleById(_0x1aa8d8,Number(_0x165638));const _0x3499a9=await listAllAppRoles(_0x1aa8d8),_0x3fef17=_0x3499a9[_0x206350(0x12f)](_0x7a23e3=>_0x7a23e3[_0x206350(0x121)]===_0x165638);if(_0x3fef17[_0x206350(0x12d)]===0x0)throw CliErrors[_0x206350(0x14c)](_0x206350(0x131)+_0x165638+_0x206350(0x163)+_0x1aa8d8+'.',_0x206350(0x13f));if(_0x3fef17[_0x206350(0x12d)]>0x1){const _0x324ffe=_0x3fef17[_0x206350(0x12a)](_0x2336ec=>_0x2336ec['id'])[_0x206350(0x16a)](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x165638+_0x206350(0x144)+_0x324ffe+').',_0x206350(0x152));}return _0x3fef17[0x0];}export async function getRoleById(_0x247984,_0x3561d4){const _0x4dc75b=a177_0x3e1a28,_0x5235a0=await listAllAppRoles(_0x247984),_0x3582bf=_0x5235a0[_0x4dc75b(0x12f)](_0x1609ec=>_0x1609ec['id']===_0x3561d4&&(!_0x1609ec[_0x4dc75b(0x11b)]||_0x1609ec[_0x4dc75b(0x11b)]===_0x247984));if(_0x3582bf[_0x4dc75b(0x12d)]!==0x1)throw CliErrors['validation'](_0x4dc75b(0x12b)+_0x3561d4+_0x4dc75b(0x168)+_0x247984+'.',_0x4dc75b(0x13c));return _0x3582bf[0x0];}async function listAllAppRoles(_0x3ad18a){const _0x575390=a177_0x3e1a28,_0x192739=0x64,_0x205946=[];for(let _0x31a776=0x1;;_0x31a776+=0x1){const {items:_0xa5c87b,paging:_0x56d69b}=await listAppRoles(_0x3ad18a,{'currentPage':_0x31a776,'pageSize':_0x192739});_0x205946[_0x575390(0x154)](..._0xa5c87b);if(_0xa5c87b[_0x575390(0x12d)]<_0x192739||_0x56d69b&&_0x205946[_0x575390(0x12d)]>=_0x56d69b[_0x575390(0x142)])return _0x205946;}}function a177_0x3acf(_0x1a6c77,_0x53caf8){_0x1a6c77=_0x1a6c77-0x118;const _0x220e91=a177_0x220e();let _0x3acf11=_0x220e91[_0x1a6c77];return _0x3acf11;}export async function resolveTenantCode(){const _0x2f63f=a177_0x3e1a28,_0x235821=await getSessionUserInfo(),_0x4d5f55=_0x235821?.['user']?.[_0x2f63f(0x122)]?.[_0x2f63f(0x127)];if(!_0x4d5f55)throw CliErrors[_0x2f63f(0x165)](_0x2f63f(0x153));return _0x4d5f55;}function matchMember(_0x31bb97,_0x436af4){const _0x1e73a9=a177_0x3e1a28,_0x2d9b71=_0x436af4[_0x1e73a9(0x12e)]()[_0x1e73a9(0x157)]();return(_0x31bb97[_0x1e73a9(0x11a)]??'')['toLowerCase']()===_0x2d9b71||(_0x31bb97[_0x1e73a9(0x15a)]??'')[_0x1e73a9(0x157)]()===_0x2d9b71;}export async function resolveUserRef(_0x13da8a,_0x4bd5ca=a177_0x3e1a28(0x13d)){const _0x337190=a177_0x3e1a28,_0x83dbe5=_0x13da8a[_0x337190(0x12e)]();if(!_0x83dbe5)throw CliErrors['validation']('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x1cd546=await resolveTenantCode(),_0x29b9d0=await getTenantMembers(_0x1cd546);if(/^\d+$/[_0x337190(0x125)](_0x83dbe5)){const _0x207263=Number(_0x83dbe5),_0x56b2d5=_0x29b9d0[_0x337190(0x146)](_0x41b2a0=>_0x41b2a0[_0x337190(0x161)]===_0x207263);return{'userId':_0x207263,'username':_0x56b2d5?.[_0x337190(0x15a)]??String(_0x207263),'nickname':_0x56b2d5?.[_0x337190(0x11a)],'matchedBy':'id'};}const _0x8c714d=_0x29b9d0[_0x337190(0x12f)](_0x1194de=>matchMember(_0x1194de,_0x83dbe5));if(_0x8c714d[_0x337190(0x12d)]===0x0)throw CliErrors[_0x337190(0x14c)](_0x337190(0x11c)+_0x83dbe5+'\x22.',_0x337190(0x159)+_0x4bd5ca);if(_0x8c714d[_0x337190(0x12d)]>0x1){const _0x458e2e=_0x8c714d[_0x337190(0x12a)](_0x4f30fc=>(_0x4f30fc[_0x337190(0x11a)]??_0x4f30fc[_0x337190(0x15a)]??'?')+'('+_0x4f30fc[_0x337190(0x161)]+')')[_0x337190(0x16a)](',\x20');throw CliErrors[_0x337190(0x14c)](_0x337190(0x158)+_0x83dbe5+_0x337190(0x126)+_0x458e2e+'.',_0x4bd5ca);}const _0x54ebee=_0x8c714d[0x0];return{'userId':_0x54ebee[_0x337190(0x161)],'username':_0x54ebee['username']??String(_0x54ebee[_0x337190(0x161)]),'nickname':_0x54ebee[_0x337190(0x11a)],'matchedBy':_0x337190(0x15e)};}export const CREATE_USER_ROLE_PATH=a177_0x3e1a28(0x139);export const DELETE_USER_ROLE_PATH=a177_0x3e1a28(0x16d);export function computeRoleUserMutation(_0x21c26e){const _0x1ff0d9=a177_0x3e1a28,{operation:_0x3a18c7,appCode:_0x3c164e,role:_0x43a9d0,relations:_0x513109,user:_0x1f1927}=_0x21c26e,_0x336fd2=[...new Set(_0x513109[_0x1ff0d9(0x12a)](_0x28d3bc=>_0x28d3bc[_0x1ff0d9(0x161)]))],_0x330cb6=[];if(_0x21c26e[_0x1ff0d9(0x14a)]!==undefined&&_0x21c26e[_0x1ff0d9(0x14a)]!==_0x336fd2[_0x1ff0d9(0x12d)])throw CliErrors[_0x1ff0d9(0x14c)](_0x1ff0d9(0x132)+_0x21c26e[_0x1ff0d9(0x14a)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x336fd2[_0x1ff0d9(0x12d)]+'.',_0x1ff0d9(0x143));const _0x261f33=_0x336fd2[_0x1ff0d9(0x141)](_0x1f1927[_0x1ff0d9(0x161)]),_0x5d8683=_0x513109[_0x1ff0d9(0x12f)](_0x5c8ce1=>_0x5c8ce1[_0x1ff0d9(0x161)]===_0x1f1927[_0x1ff0d9(0x161)])[_0x1ff0d9(0x12a)](_0x2ceb41=>_0x2ceb41['id']),_0xd77712=_0x3a18c7===_0x1ff0d9(0x13e)?!_0x261f33:_0x261f33;let _0x3e55c1=_0x336fd2;_0x3a18c7==='user-add'?_0x261f33?_0x330cb6[_0x1ff0d9(0x154)]('User\x20'+_0x1f1927[_0x1ff0d9(0x161)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x43a9d0[_0x1ff0d9(0x121)]+';\x20no\x20change.'):_0x3e55c1=[..._0x336fd2,_0x1f1927['userId']]:!_0x261f33?_0x330cb6[_0x1ff0d9(0x154)]('User\x20'+_0x1f1927['userId']+_0x1ff0d9(0x16c)+_0x43a9d0['roleName']+_0x1ff0d9(0x156)):(_0x3e55c1=_0x336fd2['filter'](_0x586a76=>_0x586a76!==_0x1f1927['userId']),_0x5d8683['length']>0x1&&_0x330cb6['push'](_0x1ff0d9(0x145)+_0x5d8683[_0x1ff0d9(0x12d)]+_0x1ff0d9(0x11f)+_0x1f1927['userId']+'.'));const _0x2eb3e7={'scope':_0x1ff0d9(0x14e),'operation':_0x3a18c7,'selector':{'appCode':_0x3c164e,'roleId':_0x43a9d0['id'],'roleName':_0x43a9d0[_0x1ff0d9(0x121)],'userId':_0x1f1927[_0x1ff0d9(0x161)]},'before':{'userIds':_0x336fd2},'after':{'userIds':_0x3e55c1},'dryRun':_0x21c26e[_0x1ff0d9(0x16b)],'backend':{'method':_0x1ff0d9(0x169),'path':_0x3a18c7==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x330cb6};return{'mutation':_0x2eb3e7,'changed':_0xd77712,'matchingRelationIds':_0x5d8683};}export async function loadDevRoleRelations(_0x46517b,_0x2aa5a6){const _0x26a596=a177_0x3e1a28,_0x3e9122=0x64,_0x2222e2=[];for(let _0x18de9b=0x1;;_0x18de9b+=0x1){const {items:_0x5c6a24,paging:_0x5a12d2}=await listDevUserRoleRelations(_0x46517b,{'roleId':_0x2aa5a6,'currentPage':_0x18de9b,'pageSize':_0x3e9122});_0x2222e2[_0x26a596(0x154)](..._0x5c6a24);if(_0x5c6a24[_0x26a596(0x12d)]<_0x3e9122||_0x5a12d2&&_0x2222e2['length']>=_0x5a12d2[_0x26a596(0x142)])return _0x2222e2;}}export function readRoleRef(_0x667c6f){const _0x23379f=a177_0x3e1a28,_0x3eb5ff=_0x667c6f[_0x23379f(0x13a)]('role')['trim']();if(!_0x3eb5ff)throw CliErrors[_0x23379f(0x160)]('role',_0x23379f(0x13b));return _0x3eb5ff;}export async function prepareUserMutation(_0xc8f3ef,_0x5c116c,_0x147e84){const _0x4bcac6=a177_0x3e1a28,_0x4f923a=readRoleRef(_0xc8f3ef),_0x4dfff4=_0xc8f3ef['str'](_0x4bcac6(0x14b))[_0x4bcac6(0x12e)]();if(!_0x4dfff4)throw CliErrors[_0x4bcac6(0x160)](_0x4bcac6(0x14b),_0x4bcac6(0x11d));const _0x1637e4=_0xc8f3ef[_0x4bcac6(0x150)]('expect-user-count'),_0xb78754=_0x1637e4===undefined||_0x1637e4===null?undefined:Number(_0x1637e4),_0x574737=await resolveRoleRef(_0xc8f3ef[_0x4bcac6(0x11b)],_0x4f923a);if(_0x574737[_0x4bcac6(0x137)]===_0x4bcac6(0x136))throw CliErrors['validation'](_0x4bcac6(0x166)+_0x5c116c+_0x4bcac6(0x15d),_0x4bcac6(0x164));const _0x30ec6f=await resolveUserRef(_0x4dfff4),_0x38d004=await loadDevRoleRelations(_0xc8f3ef[_0x4bcac6(0x11b)],_0x574737['id']);return{...computeRoleUserMutation({'operation':_0x5c116c,'appCode':_0xc8f3ef[_0x4bcac6(0x11b)],'role':_0x574737,'relations':_0x38d004,'user':{'userId':_0x30ec6f['userId'],'username':_0x30ec6f[_0x4bcac6(0x15a)],'nickname':_0x30ec6f['nickname']},'dryRun':_0x147e84,..._0xb78754!==undefined?{'expectUserCount':_0xb78754}:{}}),'role':_0x574737,'user':_0x30ec6f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a178_0x3c343e=a178_0xca46;(function(_0x4b488f,_0x1e6008){const _0x31d094=a178_0xca46,_0x107354=_0x4b488f();while(!![]){try{const _0xd623fb=parseInt(_0x31d094(0x1e0))/0x1+-parseInt(_0x31d094(0x1d0))/0x2*(parseInt(_0x31d094(0x1c7))/0x3)+-parseInt(_0x31d094(0x1d2))/0x4*(parseInt(_0x31d094(0x1c1))/0x5)+parseInt(_0x31d094(0x1c4))/0x6*(-parseInt(_0x31d094(0x1d8))/0x7)+parseInt(_0x31d094(0x1d5))/0x8*(-parseInt(_0x31d094(0x1dc))/0x9)+parseInt(_0x31d094(0x1e1))/0xa+-parseInt(_0x31d094(0x1c5))/0xb*(-parseInt(_0x31d094(0x1ce))/0xc);if(_0xd623fb===_0x1e6008)break;else _0x107354['push'](_0x107354['shift']());}catch(_0x31db06){_0x107354['push'](_0x107354['shift']());}}}(a178_0x2329,0x3233b));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 a178_0x2329(){const _0x1cf5e3=['Nothing\x20to\x20update.','length','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','60vaCifF','string','364134ngteUh','remark','3928jrypFw','roleName','trim','8ystJFN','appCode','name','45451BRcJFN','validation','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','New\x20role\x20name','486324EQYhjT','flag','POST','write','32348AgugpZ','2190080SedDSU','--name\x20cannot\x20be\x20empty.','660ZsDiqR','Updated\x20role\x20','update','24lffKrR','761134cnkjgM','num','3dMTzcz','\x20(id=','dev','/smartapi/permit/role/update'];a178_0x2329=function(){return _0x1cf5e3;};return a178_0x2329();}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a178_0x3c343e(0x1ca);function readPatch(_0x2d83c2){const _0x4d5395=a178_0x3c343e,_0x47916a=_0x2d83c2['flag'](_0x4d5395(0x1d7)),_0x48d97c=_0x2d83c2[_0x4d5395(0x1dd)](_0x4d5395(0x1d1)),_0x2fc461={};if(_0x47916a!==undefined&&_0x47916a!==null){const _0x28bb36=String(_0x47916a)[_0x4d5395(0x1d4)]();if(!_0x28bb36)throw CliErrors[_0x4d5395(0x1d9)](_0x4d5395(0x1e2));if(_0x28bb36[_0x4d5395(0x1cc)]>0x40)throw CliErrors[_0x4d5395(0x1d9)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x2fc461[_0x4d5395(0x1d3)]=_0x28bb36;}_0x48d97c!==undefined&&_0x48d97c!==null&&(_0x2fc461[_0x4d5395(0x1d1)]=String(_0x48d97c));if(_0x2fc461[_0x4d5395(0x1d3)]===undefined&&_0x2fc461[_0x4d5395(0x1d1)]===undefined)throw CliErrors[_0x4d5395(0x1d9)](_0x4d5395(0x1cb),_0x4d5395(0x1da));return _0x2fc461;}function a178_0xca46(_0x5e0322,_0x57a1f1){_0x5e0322=_0x5e0322-0x1c1;const _0x2329fa=a178_0x2329();let _0xca4608=_0x2329fa[_0x5e0322];return _0xca4608;}export const roleUpdate={'service':'role','command':a178_0x3c343e(0x1c3),'description':a178_0x3c343e(0x1cd),'risk':a178_0x3c343e(0x1df),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a178_0x3c343e(0x1d7),'type':a178_0x3c343e(0x1cf),'required':![],'description':a178_0x3c343e(0x1db)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5aefc2){readPatch(_0x5aefc2);},async 'dryRun'(_0x234223){const _0x4aeec2=a178_0x3c343e,_0x156f23=_0x234223['num']('id'),_0x1ed196=readPatch(_0x234223),_0x2160c4=await getRoleById(_0x234223['appCode'],_0x156f23);return assertCustomRole(_0x2160c4,_0x4aeec2(0x1c3)),asDryRunResult({'scope':'dev','operation':_0x4aeec2(0x1c3),'selector':{'appCode':_0x234223[_0x4aeec2(0x1d6)],'roleId':_0x156f23,'roleName':_0x2160c4[_0x4aeec2(0x1d3)]},'before':projectRole(_0x2160c4),'after':projectRole({..._0x2160c4,..._0x1ed196[_0x4aeec2(0x1d3)]!==undefined?{'roleName':_0x1ed196[_0x4aeec2(0x1d3)]}:{},..._0x1ed196['remark']!==undefined?{'remark':_0x1ed196[_0x4aeec2(0x1d1)]}:{}}),'dryRun':!![],'backend':{'method':_0x4aeec2(0x1de),'path':UPDATE_PATH},'warnings':[]},{'method':_0x4aeec2(0x1de),'url':UPDATE_PATH});},async 'execute'(_0x1f6d8b){const _0x2d087b=a178_0x3c343e,_0x40066b=_0x1f6d8b[_0x2d087b(0x1c6)]('id'),_0xa5158b=readPatch(_0x1f6d8b),_0x50bd90=await getRoleById(_0x1f6d8b['appCode'],_0x40066b);assertCustomRole(_0x50bd90,_0x2d087b(0x1c3)),await updateAppRole({'id':_0x40066b,'appCode':_0x1f6d8b[_0x2d087b(0x1d6)],..._0xa5158b[_0x2d087b(0x1d3)]!==undefined?{'roleName':_0xa5158b['roleName']}:{},..._0xa5158b[_0x2d087b(0x1d1)]!==undefined?{'remark':_0xa5158b[_0x2d087b(0x1d1)]}:{}});const _0x758b7b=await getRoleById(_0x1f6d8b[_0x2d087b(0x1d6)],_0x40066b);return{'ok':!![],'data':{'scope':_0x2d087b(0x1c9),'operation':_0x2d087b(0x1c3),'selector':{'appCode':_0x1f6d8b['appCode'],'roleId':_0x40066b,'roleName':_0x758b7b['roleName']},'before':projectRole(_0x50bd90),'after':projectRole(_0x758b7b),'dryRun':![],'backend':{'method':_0x2d087b(0x1de),'path':UPDATE_PATH},'warnings':[]},'message':_0x2d087b(0x1c2)+_0x758b7b[_0x2d087b(0x1d3)]+_0x2d087b(0x1c8)+_0x40066b+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a179_0x1980(){const _0xefd09a=['96194yamPhs','role','5305cJlcCT','user-add','4404iLxfrg','roleId','Added\x20user\x20','No\x20change:\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','15807htZVPO','userId','305298ckyxEc','2047266mmjqLX','selector','username','POST','3444UTPsUH','176jtGgfm','roleName','10hiVJxF','\x20to\x20role\x20','538BWMFFX','7957370jwbPAt','9sJQzrh','33PJqNOq'];a179_0x1980=function(){return _0xefd09a;};return a179_0x1980();}const a179_0x5c8c4a=a179_0xadeb;(function(_0x51e05a,_0x288836){const _0x4b150c=a179_0xadeb,_0x13a35f=_0x51e05a();while(!![]){try{const _0x22645c=parseInt(_0x4b150c(0x136))/0x1*(parseInt(_0x4b150c(0x149))/0x2)+parseInt(_0x4b150c(0x14c))/0x3*(parseInt(_0x4b150c(0x144))/0x4)+parseInt(_0x4b150c(0x147))/0x5*(-parseInt(_0x4b150c(0x13f))/0x6)+-parseInt(_0x4b150c(0x14d))/0x7*(parseInt(_0x4b150c(0x145))/0x8)+-parseInt(_0x4b150c(0x14b))/0x9*(parseInt(_0x4b150c(0x14a))/0xa)+parseInt(_0x4b150c(0x13d))/0xb*(parseInt(_0x4b150c(0x138))/0xc)+parseInt(_0x4b150c(0x140))/0xd;if(_0x22645c===_0x288836)break;else _0x13a35f['push'](_0x13a35f['shift']());}catch(_0x1bb4cf){_0x13a35f['push'](_0x13a35f['shift']());}}}(a179_0x1980,0xe0fce));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0xadeb(_0x576df0,_0x3e3dc5){_0x576df0=_0x576df0-0x135;const _0x19803e=a179_0x1980();let _0xadebfa=_0x19803e[_0x576df0];return _0xadebfa;}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';export const roleUserAdd={'service':a179_0x5c8c4a(0x135),'command':a179_0x5c8c4a(0x137),'description':a179_0x5c8c4a(0x13c),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1ab18e){const _0x265d41=a179_0x5c8c4a,{mutation:_0x423d22}=await prepareUserMutation(_0x1ab18e,_0x265d41(0x137),!![]);return asDryRunResult(_0x423d22,{'method':_0x265d41(0x143),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2751af){const _0x19cfb5=a179_0x5c8c4a,{mutation:_0x417310,changed:_0x1425cd,role:_0x1168e6,user:_0x3163b9}=await prepareUserMutation(_0x2751af,_0x19cfb5(0x137),![]);return _0x1425cd&&await createDevUserRole({'appCode':_0x2751af['appCode'],'userId':_0x3163b9[_0x19cfb5(0x13e)],'username':_0x3163b9[_0x19cfb5(0x142)],'roleType':_0x1168e6['roleType'],'roleId':_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x139)]}),{'ok':!![],'data':_0x417310,'message':_0x1425cd?_0x19cfb5(0x13a)+_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x13e)]+_0x19cfb5(0x148)+_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x146)]:_0x19cfb5(0x13b)+_0x417310[_0x19cfb5(0x141)]['userId']+'\x20already\x20in\x20role\x20'+_0x417310[_0x19cfb5(0x141)][_0x19cfb5(0x146)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x2fd351=a180_0x52a7;function a180_0x52a7(_0x30dd5a,_0x3cb134){_0x30dd5a=_0x30dd5a-0x1b4;const _0x8458f2=a180_0x8458();let _0x52a725=_0x8458f2[_0x30dd5a];return _0x52a725;}(function(_0x4a7d0e,_0x1f972c){const _0x50c0b6=a180_0x52a7,_0x3ea18d=_0x4a7d0e();while(!![]){try{const _0x4eb4fb=parseInt(_0x50c0b6(0x1c0))/0x1+-parseInt(_0x50c0b6(0x1ba))/0x2*(-parseInt(_0x50c0b6(0x1bd))/0x3)+-parseInt(_0x50c0b6(0x1c9))/0x4+parseInt(_0x50c0b6(0x1b9))/0x5+parseInt(_0x50c0b6(0x1c7))/0x6*(parseInt(_0x50c0b6(0x1bc))/0x7)+parseInt(_0x50c0b6(0x1c2))/0x8+parseInt(_0x50c0b6(0x1c6))/0x9*(-parseInt(_0x50c0b6(0x1b5))/0xa);if(_0x4eb4fb===_0x1f972c)break;else _0x3ea18d['push'](_0x3ea18d['shift']());}catch(_0x510f66){_0x3ea18d['push'](_0x3ea18d['shift']());}}}(a180_0x8458,0x4afd3));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a180_0x2fd351(0x1b6),'command':a180_0x2fd351(0x1b7),'description':a180_0x2fd351(0x1b4),'risk':a180_0x2fd351(0x1bf),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5c8df4){const _0x69a699=a180_0x2fd351,{mutation:_0x22f083}=await prepareUserMutation(_0x5c8df4,'user-remove',!![]);return asDryRunResult(_0x22f083,{'method':_0x69a699(0x1c8),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4b410d){const _0x5bbf4b=a180_0x2fd351,{matchingRelationIds:_0x377475,mutation:_0x25b0d2,changed:_0x3e91ce}=await prepareUserMutation(_0x4b410d,_0x5bbf4b(0x1b7),![]);if(_0x3e91ce)for(const _0x43a611 of _0x377475){await deleteDevUserRole(_0x43a611);}return{'ok':!![],'data':_0x25b0d2,'message':_0x3e91ce?_0x5bbf4b(0x1c1)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1c3)]+_0x5bbf4b(0x1bb)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1b8)]:_0x5bbf4b(0x1c5)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1c3)]+_0x5bbf4b(0x1be)+_0x25b0d2[_0x5bbf4b(0x1c4)][_0x5bbf4b(0x1b8)]};}};function a180_0x8458(){const _0x288e77=['10Epprzq','role','user-remove','roleName','2560395UdaRta','502PPCiGM','\x20from\x20role\x20','3028263oxexCA','6309YHkxbI','\x20not\x20in\x20role\x20','high-risk-write','574968kxEVqO','Removed\x20user\x20','2977704SAHkQZ','userId','selector','No\x20change:\x20user\x20','18200655YvVZQY','6PPPWBR','POST','361088oynayd','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes'];a180_0x8458=function(){return _0x288e77;};return a180_0x8458();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x532d35=a181_0x2082;function a181_0x2082(_0x2e81ef,_0x34bed6){_0x2e81ef=_0x2e81ef-0x1ae;const _0x4fa38d=a181_0x4fa3();let _0x20820f=_0x4fa38d[_0x2e81ef];return _0x20820f;}(function(_0x13c1c8,_0x7cb9ce){const _0x17cb4a=a181_0x2082,_0x54b998=_0x13c1c8();while(!![]){try{const _0x391244=-parseInt(_0x17cb4a(0x1b7))/0x1*(parseInt(_0x17cb4a(0x1bf))/0x2)+parseInt(_0x17cb4a(0x1b2))/0x3*(-parseInt(_0x17cb4a(0x1b3))/0x4)+parseInt(_0x17cb4a(0x1b6))/0x5+parseInt(_0x17cb4a(0x1af))/0x6*(-parseInt(_0x17cb4a(0x1ba))/0x7)+parseInt(_0x17cb4a(0x1b0))/0x8+parseInt(_0x17cb4a(0x1c2))/0x9*(-parseInt(_0x17cb4a(0x1bc))/0xa)+parseInt(_0x17cb4a(0x1bb))/0xb;if(_0x391244===_0x7cb9ce)break;else _0x54b998['push'](_0x54b998['shift']());}catch(_0x451a96){_0x54b998['push'](_0x54b998['shift']());}}}(a181_0x4fa3,0x92a2f));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a181_0x4fa3(){const _0x2c95f4=['10jpuYRX','user-resolve','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','16142ZyCvAz','flagMissing','Resolved\x20\x22','933885sEIonI','name','role','str','matchedBy','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','12tZJRVw','1063384hqEkXD','read','1194lOgWgF','2132laHxPD','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','1525985WvpHYS','67AzeZDS','trim','userId','1475138mncTOl','15846897vszgdx'];a181_0x4fa3=function(){return _0x2c95f4;};return a181_0x4fa3();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a181_0x532d35(0x1c4),'command':a181_0x532d35(0x1bd),'description':a181_0x532d35(0x1be),'risk':a181_0x532d35(0x1b1),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x33cad4){const _0x32b258=a181_0x532d35;if(!_0x33cad4['str']('name')[_0x32b258(0x1b8)]())throw CliErrors[_0x32b258(0x1c0)](_0x32b258(0x1c3),_0x32b258(0x1b4));},async 'execute'(_0x44ba8a){const _0x4b212c=a181_0x532d35,_0x520de9=_0x44ba8a[_0x4b212c(0x1c5)]('name')['trim'](),_0x37c8a=await resolveUserRef(_0x520de9,_0x4b212c(0x1ae));return{'ok':!![],'data':{'user':{'userId':_0x37c8a[_0x4b212c(0x1b9)],'username':_0x37c8a['username'],'nickname':_0x37c8a['nickname'],'matchedBy':_0x37c8a[_0x4b212c(0x1c6)]}},'message':_0x4b212c(0x1c1)+_0x520de9+_0x4b212c(0x1b5)+_0x37c8a['userId']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a182_0x59cb3d=a182_0x1d77;(function(_0x29e60f,_0x231851){const _0x54c869=a182_0x1d77,_0xd4550=_0x29e60f();while(!![]){try{const _0x5ee72f=parseInt(_0x54c869(0x16b))/0x1+parseInt(_0x54c869(0x167))/0x2+-parseInt(_0x54c869(0x145))/0x3+-parseInt(_0x54c869(0x14b))/0x4+-parseInt(_0x54c869(0x16c))/0x5+-parseInt(_0x54c869(0x162))/0x6*(-parseInt(_0x54c869(0x14e))/0x7)+parseInt(_0x54c869(0x151))/0x8;if(_0x5ee72f===_0x231851)break;else _0xd4550['push'](_0xd4550['shift']());}catch(_0x3f6c9a){_0xd4550['push'](_0xd4550['shift']());}}}(a182_0x4c16,0xe54cf));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',a182_0x59cb3d(0x160)]);function a182_0x4c16(){const _0xd9dc3b=['bool','join','run','--watch','\x20run\x20start','bun.lockb','close','yarn.lock','package.json','has','validation','push','vite','utf-8','boolean','.bin','bun.lock','3849834aBIHrP','No\x20scripts\x20defined\x20in\x20package.json.','Script\x20\x22','node_modules','log','vite\x20preview\x20exited\x20with\x20code\x20','578048Hcywgx','\x20run\x20preview\x20--watch','args','2571226wQOUBv','Enable\x20watch\x20mode\x20for\x20preview','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','7691008KZmKRy','\x20\x20EXAMPLES','\x20\x20\x20\x20','write','inherit','build','needsUpgrade','keys','scripts','No\x20package.json\x20found\x20in\x20current\x20directory.','parse','length','all','pnpm','slice','dev','error','12sgGkpj','\x0a\x20\x20Available\x20scripts:\x0a','watch','(none)','script','3616322GNQhzF','npm','preview','\x0a\x20\x20Usage:\x20','447207Wnumpq','7921875JFXgNp','yarn','\x20run\x20build'];a182_0x4c16=function(){return _0xd9dc3b;};return a182_0x4c16();}function readPackageScripts(_0x37404b){const _0x1a0c09=a182_0x59cb3d,_0x288efa=resolve(_0x37404b,_0x1a0c09(0x13c));if(!existsSync(_0x288efa))return null;try{const _0xc05f3c=JSON[_0x1a0c09(0x15b)](readFileSync(_0x288efa,_0x1a0c09(0x141)));return _0xc05f3c[_0x1a0c09(0x159)]??{};}catch{return null;}}function detectPackageManager(_0x48bec7){const _0x5b7f15=a182_0x59cb3d;if(existsSync(resolve(_0x48bec7,_0x5b7f15(0x139)))||existsSync(resolve(_0x48bec7,_0x5b7f15(0x144))))return'bun';if(existsSync(resolve(_0x48bec7,'pnpm-lock.yaml')))return _0x5b7f15(0x15e);if(existsSync(resolve(_0x48bec7,_0x5b7f15(0x13b))))return _0x5b7f15(0x16d);return _0x5b7f15(0x168);}async function versionCheck(_0x2e8335){const _0x5e6129=a182_0x59cb3d,_0x551522=await checkCliVersion();(_0x551522[_0x5e6129(0x157)]||_0x551522['belowMinimum'])&&(printCliUpgradeWarning(_0x551522),assertCliVersionSupported(_0x551522));const _0x23b9be=await checkSdkVersion(_0x2e8335);if(_0x23b9be[_0x5e6129(0x157)])printSdkUpgradeWarning(_0x23b9be);}function spawnScript(_0x2e3338,_0x303a96,_0xeab24,_0x4d1bf1){return new Promise((_0x3235ef,_0x4d357c)=>{const _0x11d48d=a182_0x1d77,_0x241ce3=['run',_0x303a96,..._0xeab24],_0x35cfba=spawn(_0x2e3338,_0x241ce3,{'cwd':_0x4d1bf1,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x4d1bf1,_0x11d48d(0x148),'.bin')+delimiter+process.env.PATH}});_0x35cfba['on'](_0x11d48d(0x13a),_0x407bec=>{if(_0x407bec===0x0||_0x407bec===null)_0x3235ef();else _0x4d357c(new Error(_0x2e3338+'\x20run\x20'+_0x303a96+'\x20exited\x20with\x20code\x20'+_0x407bec));}),_0x35cfba['on']('error',_0x4d357c);});}function spawnViteBuildWatch(_0x4faa20){return new Promise((_0x3ee69d,_0x24166f)=>{const _0x1fd913=a182_0x1d77,_0x568efb=spawn(_0x1fd913(0x140),[_0x1fd913(0x156),_0x1fd913(0x172)],{'cwd':_0x4faa20,'stdio':_0x1fd913(0x155),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4faa20,_0x1fd913(0x148),_0x1fd913(0x143))+delimiter+process.env.PATH}});_0x568efb['on']('close',_0x32c96f=>{const _0x54b4d1=_0x1fd913;if(_0x32c96f===0x0||_0x32c96f===null)_0x3ee69d();else _0x24166f(new Error(_0x54b4d1(0x150)+_0x32c96f));}),_0x568efb['on'](_0x1fd913(0x161),_0x24166f);});}function a182_0x1d77(_0x326935,_0x17ab93){_0x326935=_0x326935-0x138;const _0x4c16b0=a182_0x4c16();let _0x1d774b=_0x4c16b0[_0x326935];return _0x1d774b;}function spawnVitePreview(_0x462de2){return new Promise((_0x51d2f4,_0x14e57b)=>{const _0x8034d3=a182_0x1d77,_0x594e15=spawn(_0x8034d3(0x140),['preview'],{'cwd':_0x462de2,'stdio':_0x8034d3(0x155),'shell':!![],'env':{...process.env,'PATH':''+join(_0x462de2,_0x8034d3(0x148),_0x8034d3(0x143))+delimiter+process.env.PATH}});_0x594e15['on']('close',_0x24c317=>{const _0x3ba75c=_0x8034d3;if(_0x24c317===0x0||_0x24c317===null)_0x51d2f4();else _0x14e57b(new Error(_0x3ba75c(0x14a)+_0x24c317));}),_0x594e15['on'](_0x8034d3(0x161),_0x14e57b);});}const runFlags=[{'name':a182_0x59cb3d(0x164),'type':a182_0x59cb3d(0x142),'description':a182_0x59cb3d(0x14f),'default':![]}];export const runDefinition={'service':a182_0x59cb3d(0x171),'command':a182_0x59cb3d(0x171),'description':'Run\x20a\x20package.json\x20script','risk':a182_0x59cb3d(0x154),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a182_0x59cb3d(0x166),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4dab88=a182_0x59cb3d,_0x1512b3=[];return _0x1512b3[_0x4dab88(0x13f)](_0x4dab88(0x152)),_0x1512b3['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4dab88(0x138)),_0x1512b3[_0x4dab88(0x13f)](_0x4dab88(0x153)+CLI_BIN_NAME+_0x4dab88(0x16e)),_0x1512b3[_0x4dab88(0x13f)](_0x4dab88(0x153)+CLI_BIN_NAME+'\x20run\x20preview'),_0x1512b3['push'](_0x4dab88(0x153)+CLI_BIN_NAME+_0x4dab88(0x14c)),_0x1512b3[_0x4dab88(0x170)]('\x0a');},async 'execute'(_0x510f47){const _0x18f7b9=a182_0x59cb3d,_0x271964=process['cwd'](),_0x299f67=_0x510f47[_0x18f7b9(0x14d)][0x0],_0x3aee1f=_0x510f47[_0x18f7b9(0x14d)][_0x18f7b9(0x15f)](0x1),_0x194a80=readPackageScripts(_0x271964);if(!_0x194a80)throw CliErrors[_0x18f7b9(0x13e)](_0x18f7b9(0x15a));if(!_0x299f67){const _0x2127a4=Object[_0x18f7b9(0x158)](_0x194a80);if(_0x2127a4[_0x18f7b9(0x15c)]===0x0)console['log'](_0x18f7b9(0x146));else{console[_0x18f7b9(0x149)](_0x18f7b9(0x163));for(const _0x593f45 of _0x2127a4){console[_0x18f7b9(0x149)](_0x18f7b9(0x153)+_0x593f45);}console[_0x18f7b9(0x149)](_0x18f7b9(0x16a)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x194a80[_0x299f67])throw CliErrors[_0x18f7b9(0x13e)](_0x18f7b9(0x147)+_0x299f67+'\x22\x20not\x20found\x20in\x20package.json.','Available:\x20'+(Object[_0x18f7b9(0x158)](_0x194a80)[_0x18f7b9(0x170)](',\x20')||_0x18f7b9(0x165)));const _0x46b3e8=detectPackageManager(_0x271964);VERSION_CHECK_SCRIPTS[_0x18f7b9(0x13d)](_0x299f67)&&await versionCheck(_0x271964);if(_0x299f67===_0x18f7b9(0x169)&&_0x510f47[_0x18f7b9(0x16f)](_0x18f7b9(0x164)))return await Promise[_0x18f7b9(0x15d)]([spawnViteBuildWatch(_0x271964),spawnVitePreview(_0x271964)]),{'ok':!![]};return await spawnScript(_0x46b3e8,_0x299f67,_0x3aee1f,_0x271964),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a183_0x3dcb(_0x55e62a,_0x50da93){_0x55e62a=_0x55e62a-0x13e;const _0x4a54f5=a183_0x4a54();let _0x3dcb0c=_0x4a54f5[_0x55e62a];return _0x3dcb0c;}const a183_0x2d166f=a183_0x3dcb;(function(_0x555565,_0x4eaa30){const _0x11ed87=a183_0x3dcb,_0x1bfed3=_0x555565();while(!![]){try{const _0x390de0=-parseInt(_0x11ed87(0x14c))/0x1+parseInt(_0x11ed87(0x143))/0x2*(-parseInt(_0x11ed87(0x149))/0x3)+parseInt(_0x11ed87(0x13e))/0x4+parseInt(_0x11ed87(0x140))/0x5*(parseInt(_0x11ed87(0x14a))/0x6)+-parseInt(_0x11ed87(0x142))/0x7+parseInt(_0x11ed87(0x145))/0x8*(parseInt(_0x11ed87(0x14b))/0x9)+parseInt(_0x11ed87(0x144))/0xa;if(_0x390de0===_0x4eaa30)break;else _0x1bfed3['push'](_0x1bfed3['shift']());}catch(_0x8cbaf3){_0x1bfed3['push'](_0x1bfed3['shift']());}}}(a183_0x4a54,0x76627));import{buildSchemaPayload}from'../framework/schema-export.js';function a183_0x4a54(){const _0x4812ac=['44703sBgtFW','387274iwCFto','3803484LSQZFN','json','475VFQFLI','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1309854gTUcgB','1752782uzYKav','1804370qomyNn','568fJpebR','read','export','schema','3VvIXzA','28530lnGQWo'];a183_0x4a54=function(){return _0x4812ac;};return a183_0x4a54();}async function execute(_0x281806){const _0x5d2ead=await buildSchemaPayload();return{'ok':!![],'data':_0x5d2ead};}export const schemaDefinition={'service':a183_0x2d166f(0x148),'command':a183_0x2d166f(0x147),'description':a183_0x2d166f(0x141),'risk':a183_0x2d166f(0x146),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a183_0x2d166f(0x13f),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a184_0x13fa(){const _0x51fdf7=['132IPMbZC','utf8','✎\x20Enter\x20dbId\x20manually','trim','validation','MyBatis\x20XML\x20(mybatisXml)','sqlCode','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','lockFilePath','sqlName','mode','dbId\x20cannot\x20be\x20empty','name','write','mybatisXml','File\x20already\x20exists:\x20','SQL\x20query\x20display\x20name','dbId\x20must\x20be\x20a\x20positive\x20integer','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','9JbEGiB','join','Local\x20SQL\x20file\x20mode','POST','</select>','appCode','toISOString','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','nonInteractive','17935YJBnUA','890028nFlmDw','Target\x20database\x20ID','flagMissing','7ydvhvr','Select\x20the\x20local\x20SQL\x20mode:','SELECT\x201\x20AS\x20id;','sql','sqlRoot','db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20dbId:','create','dbId','new','string','37130PtQsyi','sqlRootDir','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','length','\x20\x20SELECT\x201\x20AS\x20id','SQL\x20name:','Created\x20SQL\x20query\x20','number','flag','598899nxDnQy','SQL\x20name\x20cannot\x20be\x20empty','5644740aShzjW','isInteger','Select\x20the\x20target\x20database:','__manual__','description','150960YppQNv','145204EjmrzK','parse','catch','dbName','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Invalid\x20database\x20selection\x20payload:\x20','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','isFinite'];a184_0x13fa=function(){return _0x51fdf7;};return a184_0x13fa();}const a184_0x698090=a184_0x4380;function a184_0x4380(_0x1a5907,_0xda1138){_0x1a5907=_0x1a5907-0x1ad;const _0x13fa7b=a184_0x13fa();let _0x4380c0=_0x13fa7b[_0x1a5907];return _0x4380c0;}(function(_0x45c37b,_0x5afdd5){const _0x5d540a=a184_0x4380,_0x656a91=_0x45c37b();while(!![]){try{const _0x33c701=-parseInt(_0x5d540a(0x1be))/0x1+parseInt(_0x5d540a(0x1d1))/0x2+-parseInt(_0x5d540a(0x1c9))/0x3+parseInt(_0x5d540a(0x1d9))/0x4*(-parseInt(_0x5d540a(0x1ae))/0x5)+-parseInt(_0x5d540a(0x1af))/0x6+parseInt(_0x5d540a(0x1b2))/0x7*(-parseInt(_0x5d540a(0x1d0))/0x8)+-parseInt(_0x5d540a(0x1ec))/0x9*(-parseInt(_0x5d540a(0x1cb))/0xa);if(_0x33c701===_0x5afdd5)break;else _0x656a91['push'](_0x656a91['shift']());}catch(_0x5a96f0){_0x656a91['push'](_0x656a91['shift']());}}}(a184_0x13fa,0x1c02e));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x46c07a){const _0xe1052f=a184_0x4380;if(_0x46c07a===_0xe1052f(0x1e7))return[_0xe1052f(0x1f3),_0xe1052f(0x1c4),_0xe1052f(0x1f0),'']['join']('\x0a');return[_0xe1052f(0x1b4),''][_0xe1052f(0x1ed)]('\x0a');}export const sqlCreate={'service':a184_0x698090(0x1b5),'command':a184_0x698090(0x1ba),'description':a184_0x698090(0x1d5),'risk':a184_0x698090(0x1e6),'flags':[{'name':a184_0x698090(0x1e5),'type':a184_0x698090(0x1bd),'description':a184_0x698090(0x1e9)},{'name':a184_0x698090(0x1b7),'type':a184_0x698090(0x1c7),'description':a184_0x698090(0x1b0)},{'name':a184_0x698090(0x1e3),'type':a184_0x698090(0x1bd),'enum':['sql',a184_0x698090(0x1e7)],'description':a184_0x698090(0x1ee)}],async 'validate'(_0x415025){const _0x3bfe75=a184_0x698090;if(!_0x415025[_0x3bfe75(0x1ad)])return;if(!_0x415025['str'](_0x3bfe75(0x1e5))[_0x3bfe75(0x1dc)]())throw CliErrors['flagMissing'](_0x3bfe75(0x1e5),_0x3bfe75(0x1d7));const _0x47ae1e=resolveProvidedDbId(_0x415025);if(typeof _0x47ae1e!==_0x3bfe75(0x1c7)||!Number[_0x3bfe75(0x1d8)](_0x47ae1e)||_0x47ae1e<=0x0)throw CliErrors[_0x3bfe75(0x1b1)](_0x3bfe75(0x1b7),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x415025[_0x3bfe75(0x1c0)](_0x3bfe75(0x1e3))[_0x3bfe75(0x1dc)]())throw CliErrors['flagMissing']('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x4b283d){const _0x110d14=a184_0x698090,_0x5b9df8=loadSqlProjectConfig(_0x4b283d[_0x110d14(0x1f1)]),{sqlName:_0x2a4d6d,dbId:_0x4008e1,dbName:_0x3cc21b,mode:_0x1391f1}=await resolveSqlNewInputs(_0x4b283d),_0x2b59c1=buildSqlRelativePath('<server-generated-sqlCode>',_0x2a4d6d,_0x3cc21b,_0x1391f1,_0x4008e1),_0x45ddd=_0x5b9df8[_0x110d14(0x1bf)]+'/'+_0x2b59c1;return{'method':_0x110d14(0x1ef),'url':_0x110d14(0x1c2),'body':{'appCode':_0x4b283d[_0x110d14(0x1f1)],'sqlName':_0x2a4d6d,'dbId':_0x4008e1,'mode':_0x1391f1,'localPath':_0x45ddd},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x5b9df8[_0x110d14(0x1bf)]};},async 'execute'(_0x2a9a45){const _0x58cc3c=a184_0x698090,_0x5f40e6=loadSqlProjectConfig(_0x2a9a45[_0x58cc3c(0x1f1)]),{sqlName:_0x31cb44,dbId:_0x2975b8,dbName:_0xf56a6c,mode:_0x1d1cc0}=await resolveSqlNewInputs(_0x2a9a45),_0x4db404=generateSqlTemplate(_0x1d1cc0),_0x5410c=await createSqlQuery({'appCode':_0x2a9a45[_0x58cc3c(0x1f1)],'sqlName':_0x31cb44,'dbId':_0x2975b8,'sqlContent':_0x4db404}),_0x306a99=ensureRemoteSqlContent(_0x5410c),_0x2bfa4d=_0xf56a6c||await getDbName(_0x2a9a45[_0x58cc3c(0x1f1)],_0x2975b8)[_0x58cc3c(0x1d3)](()=>undefined),_0x3607c1=buildSqlRelativePath(_0x5410c[_0x58cc3c(0x1df)],_0x5410c[_0x58cc3c(0x1e2)],_0x2bfa4d,_0x1d1cc0,_0x2975b8),_0x17b426=_0x5f40e6[_0x58cc3c(0x1bf)]+'/'+_0x3607c1,_0x16e8a3=buildLocalSqlFileContent({'sqlCode':_0x5410c[_0x58cc3c(0x1df)],'sqlName':_0x5410c[_0x58cc3c(0x1e2)],'dbId':_0x5410c[_0x58cc3c(0x1bb)]},_0x306a99,{'dbName':_0x2bfa4d,'mode':_0x1d1cc0,'syncedAt':new Date()[_0x58cc3c(0x1f2)](),'description':_0x5410c[_0x58cc3c(0x1cf)]});if(await fileExists(_0x17b426))throw CliErrors['validation'](_0x58cc3c(0x1e8)+_0x17b426);await ensureParentDirectory(_0x17b426),await writeFile(_0x17b426,_0x16e8a3,_0x58cc3c(0x1da));const _0x5918ef=await readSqlLockFile(_0x5f40e6[_0x58cc3c(0x1e1)]),{lockData:_0x410bdf,appLock:_0x2fe973}=ensureSqlLockScope(_0x5918ef??createEmptySqlLock(),_0x5f40e6['appCode'],_0x5f40e6[_0x58cc3c(0x1b6)],_0x58cc3c(0x1bc));return _0x2fe973['sqls'][_0x5410c[_0x58cc3c(0x1df)]]={...buildSqlLockEntry(_0x5410c,_0x306a99,computeSqlContentHash(_0x16e8a3),{'dbName':_0x2bfa4d}),'path':_0x3607c1,'mode':_0x1d1cc0},_0x2fe973['lastSync']=new Date()[_0x58cc3c(0x1f2)](),await writeSqlLockFile(_0x5f40e6[_0x58cc3c(0x1e1)],_0x410bdf),{'ok':!![],'data':{'id':_0x5410c['id'],'sqlCode':_0x5410c[_0x58cc3c(0x1df)],'sqlName':_0x5410c['sqlName'],'dbId':_0x5410c[_0x58cc3c(0x1bb)],'path':_0x17b426,'mode':_0x1d1cc0},'message':_0x58cc3c(0x1c6)+_0x5410c['sqlCode']};}};async function resolveSqlNewInputs(_0x5c4887){const _0x3fe2ad=await resolveSqlNameInput(_0x5c4887),{dbId:_0x42e2b6,dbName:_0x5ab92e}=await resolveDbSelection(_0x5c4887),_0x31742d=await resolveSqlModeInput(_0x5c4887);return{'sqlName':_0x3fe2ad,'dbId':_0x42e2b6,'dbName':_0x5ab92e,'mode':_0x31742d};}async function resolveSqlNameInput(_0x5b764d){const _0x3986c6=a184_0x698090,_0x98b215=_0x5b764d['str'](_0x3986c6(0x1e5))[_0x3986c6(0x1dc)]();if(_0x98b215)return _0x98b215;if(_0x5b764d['nonInteractive'])throw CliErrors[_0x3986c6(0x1b1)]('name',_0x3986c6(0x1d7));return(await input({'message':_0x3986c6(0x1c5),'validate':_0x2734bb=>_0x2734bb[_0x3986c6(0x1dc)]()?!![]:_0x3986c6(0x1ca)}))[_0x3986c6(0x1dc)]();}async function resolveDbSelection(_0x19d4f3){const _0x4b3651=a184_0x698090,_0x4c45bf=resolveProvidedDbId(_0x19d4f3);if(typeof _0x4c45bf==='number'&&Number[_0x4b3651(0x1d8)](_0x4c45bf)&&_0x4c45bf>0x0)return{'dbId':_0x4c45bf,'dbName':await getDbName(_0x19d4f3[_0x4b3651(0x1f1)],_0x4c45bf)[_0x4b3651(0x1d3)](()=>undefined)};if(_0x19d4f3[_0x4b3651(0x1ad)])throw CliErrors[_0x4b3651(0x1b1)](_0x4b3651(0x1b7),_0x4b3651(0x1b8));const _0x6a1f2a=await listDatabases(_0x19d4f3[_0x4b3651(0x1f1)])['catch'](()=>[]);if(_0x6a1f2a[_0x4b3651(0x1c3)]===0x1)return{'dbId':_0x6a1f2a[0x0][_0x4b3651(0x1bb)],'dbName':_0x6a1f2a[0x0][_0x4b3651(0x1d4)]};if(_0x6a1f2a['length']>0x1){const _0x4f2e32=await select({'message':_0x4b3651(0x1cd),'choices':[..._0x6a1f2a['map'](_0x3eae75=>({'name':_0x3eae75[_0x4b3651(0x1d4)]+'\x20('+_0x3eae75[_0x4b3651(0x1bb)]+')','value':serializeDbSelection(_0x3eae75)})),{'name':_0x4b3651(0x1db),'value':_0x4b3651(0x1ce)}]});if(_0x4f2e32!==_0x4b3651(0x1ce))return deserializeDbSelection(_0x4f2e32);}const _0x4020ea=await input({'message':_0x4b3651(0x1b9),'validate':_0x432ff5=>{const _0x2c1c22=_0x4b3651,_0x1dd7cd=_0x432ff5[_0x2c1c22(0x1dc)]();if(!_0x1dd7cd)return _0x2c1c22(0x1e4);const _0x352034=Number(_0x1dd7cd);if(!Number[_0x2c1c22(0x1cc)](_0x352034)||_0x352034<=0x0)return _0x2c1c22(0x1ea);return!![];}});return{'dbId':Number(_0x4020ea[_0x4b3651(0x1dc)]())};}async function resolveSqlModeInput(_0x3448a0){const _0x39c0f9=a184_0x698090,_0xfafe2a=_0x3448a0[_0x39c0f9(0x1c0)]('mode')['trim']();if(_0xfafe2a===_0x39c0f9(0x1b5)||_0xfafe2a===_0x39c0f9(0x1e7))return _0xfafe2a;if(_0x3448a0[_0x39c0f9(0x1ad)])throw CliErrors[_0x39c0f9(0x1b1)]('mode',_0x39c0f9(0x1c1));return await select({'message':_0x39c0f9(0x1b3),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x39c0f9(0x1b5),'description':_0x39c0f9(0x1e0)},{'name':_0x39c0f9(0x1de),'value':_0x39c0f9(0x1e7),'description':_0x39c0f9(0x1eb)}]});}function serializeDbSelection(_0x3faa06){return JSON['stringify']({'dbId':_0x3faa06['dbId'],'dbName':_0x3faa06['dbName']});}function deserializeDbSelection(_0xd9dc63){const _0x596054=a184_0x698090;try{const _0x1af83a=JSON[_0x596054(0x1d2)](_0xd9dc63);if(typeof _0x1af83a['dbId']===_0x596054(0x1c7)&&Number[_0x596054(0x1d8)](_0x1af83a[_0x596054(0x1bb)]))return{'dbId':_0x1af83a['dbId'],'dbName':_0x1af83a[_0x596054(0x1d4)]};}catch{}throw CliErrors[_0x596054(0x1dd)](_0x596054(0x1d6)+_0xd9dc63);}function resolveProvidedDbId(_0x1bd261){const _0x31bda0=a184_0x698090,_0x113931=_0x1bd261[_0x31bda0(0x1c8)](_0x31bda0(0x1b7));if(typeof _0x113931===_0x31bda0(0x1c7)&&Number[_0x31bda0(0x1d8)](_0x113931))return _0x113931;return undefined;}
|
|
1
|
+
const a184_0xd03398=a184_0x5767;function a184_0x5767(_0xe0a65c,_0x56952b){_0xe0a65c=_0xe0a65c-0xae;const _0x4a8949=a184_0x4a89();let _0x5767de=_0x4a8949[_0xe0a65c];return _0x5767de;}(function(_0x7e319e,_0x1ef4fc){const _0x544d3d=a184_0x5767,_0x1a493f=_0x7e319e();while(!![]){try{const _0x48748a=-parseInt(_0x544d3d(0xee))/0x1*(-parseInt(_0x544d3d(0xb5))/0x2)+parseInt(_0x544d3d(0xbd))/0x3*(-parseInt(_0x544d3d(0xed))/0x4)+-parseInt(_0x544d3d(0xd6))/0x5*(parseInt(_0x544d3d(0xe3))/0x6)+parseInt(_0x544d3d(0xcd))/0x7+-parseInt(_0x544d3d(0xe7))/0x8+-parseInt(_0x544d3d(0xd1))/0x9*(parseInt(_0x544d3d(0xe8))/0xa)+parseInt(_0x544d3d(0xeb))/0xb*(parseInt(_0x544d3d(0xc1))/0xc);if(_0x48748a===_0x1ef4fc)break;else _0x1a493f['push'](_0x1a493f['shift']());}catch(_0x38b04){_0x1a493f['push'](_0x1a493f['shift']());}}}(a184_0x4a89,0x5e98a));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a184_0x4a89(){const _0x5c4c2a=['<server-generated-sqlCode>','SQL\x20query\x20display\x20name','1285216oYhfYJ','29790YtfbjD','flag','SQL\x20name:','7000191bpUblR','Target\x20database\x20ID','11508KUVkmr','2kRVixW','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','POST','nonInteractive','create','sqls','validation','db-id','join','isInteger','✎\x20Enter\x20dbId\x20manually','dbId\x20cannot\x20be\x20empty','Plain\x20SQL\x20(sql)','625102jLjCjJ','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','sqlCode','lockFilePath','utf8','Select\x20the\x20target\x20database:','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','catch','531fdWtfD','mybatisXml','Created\x20SQL\x20query\x20','Local\x20SQL\x20file\x20mode','12sWSVFK','write','new','flagMissing','mode','Select\x20the\x20local\x20SQL\x20mode:','number','/smartapi/custom/saveUserCustomSql','description','Invalid\x20database\x20selection\x20payload:\x20','sqlName','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','5056205dLVMVj','dbName','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','stringify','819IeYuzS','isFinite','toISOString','string','parse','690atJKAz','sql','trim','sqlRoot','</select>','length','SQL\x20name\x20cannot\x20be\x20empty','dbId','appCode','name','sqlRootDir','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','str','28494YmAnCw','Target\x20database\x20dbId:'];a184_0x4a89=function(){return _0x5c4c2a;};return a184_0x4a89();}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x50a19f){const _0xf2117f=a184_0x5767;if(_0x50a19f===_0xf2117f(0xbe))return[_0xf2117f(0xf0),'\x20\x20SELECT\x201\x20AS\x20id',_0xf2117f(0xda),''][_0xf2117f(0xb0)]('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a184_0xd03398(0xd7),'command':a184_0xd03398(0xf3),'description':a184_0xd03398(0xcf),'risk':a184_0xd03398(0xc2),'flags':[{'name':a184_0xd03398(0xdf),'type':a184_0xd03398(0xd4),'description':a184_0xd03398(0xe6)},{'name':a184_0xd03398(0xaf),'type':'number','description':a184_0xd03398(0xec)},{'name':a184_0xd03398(0xc5),'type':a184_0xd03398(0xd4),'enum':[a184_0xd03398(0xd7),a184_0xd03398(0xbe)],'description':a184_0xd03398(0xc0)}],async 'validate'(_0x50d9a8){const _0x5ca2ec=a184_0xd03398;if(!_0x50d9a8[_0x5ca2ec(0xf2)])return;if(!_0x50d9a8['str'](_0x5ca2ec(0xdf))['trim']())throw CliErrors[_0x5ca2ec(0xc4)](_0x5ca2ec(0xdf),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x277820=resolveProvidedDbId(_0x50d9a8);if(typeof _0x277820!==_0x5ca2ec(0xc7)||!Number['isFinite'](_0x277820)||_0x277820<=0x0)throw CliErrors[_0x5ca2ec(0xc4)](_0x5ca2ec(0xaf),_0x5ca2ec(0xe1));if(!_0x50d9a8['str'](_0x5ca2ec(0xc5))['trim']())throw CliErrors[_0x5ca2ec(0xc4)]('mode',_0x5ca2ec(0xcc));},async 'dryRun'(_0x33de8f){const _0x56efee=a184_0xd03398,_0x226d58=loadSqlProjectConfig(_0x33de8f[_0x56efee(0xde)]),{sqlName:_0x52ec42,dbId:_0x36af18,dbName:_0xb1eff7,mode:_0x5d92a0}=await resolveSqlNewInputs(_0x33de8f),_0x3bfff8=buildSqlRelativePath(_0x56efee(0xe5),_0x52ec42,_0xb1eff7,_0x5d92a0,_0x36af18),_0x4d101d=_0x226d58['sqlRootDir']+'/'+_0x3bfff8;return{'method':_0x56efee(0xf1),'url':_0x56efee(0xc8),'body':{'appCode':_0x33de8f[_0x56efee(0xde)],'sqlName':_0x52ec42,'dbId':_0x36af18,'mode':_0x5d92a0,'localPath':_0x4d101d},'description':_0x56efee(0xb6)+_0x226d58['sqlRootDir']};},async 'execute'(_0x5fcd88){const _0x2d868c=a184_0xd03398,_0x467add=loadSqlProjectConfig(_0x5fcd88['appCode']),{sqlName:_0x4bc8b1,dbId:_0x4c9d1d,dbName:_0x5da20b,mode:_0x311dfe}=await resolveSqlNewInputs(_0x5fcd88),_0x1cc593=generateSqlTemplate(_0x311dfe),_0x471709=await createSqlQuery({'appCode':_0x5fcd88[_0x2d868c(0xde)],'sqlName':_0x4bc8b1,'dbId':_0x4c9d1d,'sqlContent':_0x1cc593}),_0x2151e1=ensureRemoteSqlContent(_0x471709),_0x10a0b2=_0x5da20b||await getDbName(_0x5fcd88[_0x2d868c(0xde)],_0x4c9d1d)[_0x2d868c(0xbc)](()=>undefined),_0x146078=buildSqlRelativePath(_0x471709[_0x2d868c(0xb7)],_0x471709[_0x2d868c(0xcb)],_0x10a0b2,_0x311dfe,_0x4c9d1d),_0xb3bb83=_0x467add[_0x2d868c(0xe0)]+'/'+_0x146078,_0x395fdc=buildLocalSqlFileContent({'sqlCode':_0x471709[_0x2d868c(0xb7)],'sqlName':_0x471709[_0x2d868c(0xcb)],'dbId':_0x471709[_0x2d868c(0xdd)]},_0x2151e1,{'dbName':_0x10a0b2,'mode':_0x311dfe,'syncedAt':new Date()[_0x2d868c(0xd3)](),'description':_0x471709[_0x2d868c(0xc9)]});if(await fileExists(_0xb3bb83))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0xb3bb83);await ensureParentDirectory(_0xb3bb83),await writeFile(_0xb3bb83,_0x395fdc,_0x2d868c(0xb9));const _0x1da842=await readSqlLockFile(_0x467add[_0x2d868c(0xb8)]),{lockData:_0xf71977,appLock:_0x4ff3b4}=ensureSqlLockScope(_0x1da842??createEmptySqlLock(),_0x467add[_0x2d868c(0xde)],_0x467add[_0x2d868c(0xd9)],_0x2d868c(0xc3));return _0x4ff3b4[_0x2d868c(0xf4)][_0x471709['sqlCode']]={...buildSqlLockEntry(_0x471709,_0x2151e1,computeSqlContentHash(_0x395fdc),{'dbName':_0x10a0b2}),'path':_0x146078,'mode':_0x311dfe},_0x4ff3b4['lastSync']=new Date()[_0x2d868c(0xd3)](),await writeSqlLockFile(_0x467add[_0x2d868c(0xb8)],_0xf71977),{'ok':!![],'data':{'id':_0x471709['id'],'sqlCode':_0x471709[_0x2d868c(0xb7)],'sqlName':_0x471709[_0x2d868c(0xcb)],'dbId':_0x471709[_0x2d868c(0xdd)],'path':_0xb3bb83,'mode':_0x311dfe},'message':_0x2d868c(0xbf)+_0x471709['sqlCode']};}};async function resolveSqlNewInputs(_0x1ea6ff){const _0x3a72e6=await resolveSqlNameInput(_0x1ea6ff),{dbId:_0x1c0289,dbName:_0x19ad8f}=await resolveDbSelection(_0x1ea6ff),_0x2a70b9=await resolveSqlModeInput(_0x1ea6ff);return{'sqlName':_0x3a72e6,'dbId':_0x1c0289,'dbName':_0x19ad8f,'mode':_0x2a70b9};}async function resolveSqlNameInput(_0xd8ee81){const _0x11b1fb=a184_0xd03398,_0xc4a8d7=_0xd8ee81[_0x11b1fb(0xe2)]('name')[_0x11b1fb(0xd8)]();if(_0xc4a8d7)return _0xc4a8d7;if(_0xd8ee81[_0x11b1fb(0xf2)])throw CliErrors[_0x11b1fb(0xc4)]('name',_0x11b1fb(0xef));return(await input({'message':_0x11b1fb(0xea),'validate':_0x41a188=>_0x41a188[_0x11b1fb(0xd8)]()?!![]:_0x11b1fb(0xdc)}))[_0x11b1fb(0xd8)]();}async function resolveDbSelection(_0x58f529){const _0x52c865=a184_0xd03398,_0x207a95=resolveProvidedDbId(_0x58f529);if(typeof _0x207a95===_0x52c865(0xc7)&&Number[_0x52c865(0xd2)](_0x207a95)&&_0x207a95>0x0)return{'dbId':_0x207a95,'dbName':await getDbName(_0x58f529[_0x52c865(0xde)],_0x207a95)[_0x52c865(0xbc)](()=>undefined)};if(_0x58f529['nonInteractive'])throw CliErrors['flagMissing'](_0x52c865(0xaf),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x4de6b3=await listDatabases(_0x58f529['appCode'])[_0x52c865(0xbc)](()=>[]);if(_0x4de6b3[_0x52c865(0xdb)]===0x1)return{'dbId':_0x4de6b3[0x0][_0x52c865(0xdd)],'dbName':_0x4de6b3[0x0]['dbName']};if(_0x4de6b3['length']>0x1){const _0x2d3557=await select({'message':_0x52c865(0xba),'choices':[..._0x4de6b3['map'](_0x1fbc76=>({'name':_0x1fbc76['dbName']+'\x20('+_0x1fbc76[_0x52c865(0xdd)]+')','value':serializeDbSelection(_0x1fbc76)})),{'name':_0x52c865(0xb2),'value':'__manual__'}]});if(_0x2d3557!=='__manual__')return deserializeDbSelection(_0x2d3557);}const _0x47581c=await input({'message':_0x52c865(0xe4),'validate':_0x2fa5c3=>{const _0x4eae02=_0x52c865,_0x15f45f=_0x2fa5c3[_0x4eae02(0xd8)]();if(!_0x15f45f)return _0x4eae02(0xb3);const _0x29ce61=Number(_0x15f45f);if(!Number[_0x4eae02(0xb1)](_0x29ce61)||_0x29ce61<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0x47581c[_0x52c865(0xd8)]())};}async function resolveSqlModeInput(_0x107487){const _0x25e054=a184_0xd03398,_0x44514c=_0x107487[_0x25e054(0xe2)]('mode')[_0x25e054(0xd8)]();if(_0x44514c===_0x25e054(0xd7)||_0x44514c===_0x25e054(0xbe))return _0x44514c;if(_0x107487[_0x25e054(0xf2)])throw CliErrors['flagMissing'](_0x25e054(0xc5),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x25e054(0xc6),'choices':[{'name':_0x25e054(0xb4),'value':_0x25e054(0xd7),'description':_0x25e054(0xbb)},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':'mybatisXml','description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x3cf8ba){const _0x3667d8=a184_0xd03398;return JSON[_0x3667d8(0xd0)]({'dbId':_0x3cf8ba[_0x3667d8(0xdd)],'dbName':_0x3cf8ba[_0x3667d8(0xce)]});}function deserializeDbSelection(_0x37a400){const _0x4b553e=a184_0xd03398;try{const _0xd0386e=JSON[_0x4b553e(0xd5)](_0x37a400);if(typeof _0xd0386e[_0x4b553e(0xdd)]==='number'&&Number[_0x4b553e(0xd2)](_0xd0386e[_0x4b553e(0xdd)]))return{'dbId':_0xd0386e[_0x4b553e(0xdd)],'dbName':_0xd0386e['dbName']};}catch{}throw CliErrors[_0x4b553e(0xae)](_0x4b553e(0xca)+_0x37a400);}function resolveProvidedDbId(_0xc84548){const _0x52b90d=a184_0xd03398,_0x6cf2f9=_0xc84548[_0x52b90d(0xe9)]('db-id');if(typeof _0x6cf2f9===_0x52b90d(0xc7)&&Number[_0x52b90d(0xd2)](_0x6cf2f9))return _0x6cf2f9;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x364373=a185_0x2178;(function(_0x521859,_0x39cbb4){const _0x54d5f7=a185_0x2178,_0x266a21=_0x521859();while(!![]){try{const _0x27298d=parseInt(_0x54d5f7(0x1b7))/0x1*(parseInt(_0x54d5f7(0x1b0))/0x2)+parseInt(_0x54d5f7(0x1ba))/0x3*(-parseInt(_0x54d5f7(0x1a6))/0x4)+-parseInt(_0x54d5f7(0x1af))/0x5+-parseInt(_0x54d5f7(0x1b9))/0x6+parseInt(_0x54d5f7(0x1b5))/0x7*(-parseInt(_0x54d5f7(0x1b8))/0x8)+parseInt(_0x54d5f7(0x1a3))/0x9*(-parseInt(_0x54d5f7(0x1b6))/0xa)+parseInt(_0x54d5f7(0x1a8))/0xb;if(_0x27298d===_0x39cbb4)break;else _0x266a21['push'](_0x266a21['shift']());}catch(_0x116652){_0x266a21['push'](_0x266a21['shift']());}}}(a185_0x48ef,0xefbd0));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a185_0x48ef(){const _0x593cab=['1249902DWeodL','/smartapi/custom/deleteUserCustomSql','replace','1652clwKqZ','delete','56287638uocxuz','toISOString','Would\x20delete\x20SQL\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','trashedTo','startsWith','156915rsPKOx','2JBIhyC','appCode','validation','POST','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','42EgbUUF','40zjwikO','292286yjPSFC','1507528UNhHEP','11213802garQfl','6108IjYbYZ','remoteId','lockFilePath','fromEntries','filter','entries','projectRoot','sqlRootDir','SQL\x20lock\x20file\x20not\x20found.','trashDir','sqlRoot','high-risk-write','str','sqls','\x20(local\x20file\x20moved\x20to\x20trash)'];a185_0x48ef=function(){return _0x593cab;};return a185_0x48ef();}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a185_0x2178(_0x27a543,_0x5b0689){_0x27a543=_0x27a543-0x1a0;const _0x48efdb=a185_0x48ef();let _0x217834=_0x48efdb[_0x27a543];return _0x217834;}export const sqlDelete={'service':'sql','command':a185_0x364373(0x1a7),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a185_0x364373(0x1c5),'flags':[SQLCODE_FLAG],async 'validate'(_0x125367){const _0x468ed4=a185_0x364373,_0x1a2675=loadSqlProjectConfig(_0x125367[_0x468ed4(0x1b1)]),_0x53a85a=await readSqlLockFile(_0x1a2675[_0x468ed4(0x1bc)]);if(!_0x53a85a)throw CliErrors['validation'](_0x468ed4(0x1ac));},async 'dryRun'(_0xde224){const _0x414d0e=a185_0x364373,_0x2ac3de=loadSqlProjectConfig(_0xde224[_0x414d0e(0x1b1)]),_0x368ec=await readSqlLockFile(_0x2ac3de['lockFilePath']);if(!_0x368ec)throw CliErrors[_0x414d0e(0x1b2)](_0x414d0e(0x1ac));const {appLock:_0x2bdc17}=ensureSqlLockScope(_0x368ec,_0xde224[_0x414d0e(0x1b1)],_0x2ac3de[_0x414d0e(0x1c4)],_0x414d0e(0x1a7)),_0x873a5=_0xde224['str']('sqlcode'),_0x249a09=_0x2bdc17[_0x414d0e(0x1a1)][_0x873a5];if(!_0x249a09)throw CliErrors['validation']('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x873a5+'\x22.');return{'method':_0x414d0e(0x1b3),'url':_0x414d0e(0x1a4),'body':{'sqlCode':_0x873a5,'id':_0x249a09[_0x414d0e(0x1bb)],'localPath':resolveLocalSqlFilePath(_0x2ac3de,_0x873a5,_0x249a09)},'description':_0x414d0e(0x1aa)+_0x873a5+_0x414d0e(0x1ab)+_0x2ac3de[_0x414d0e(0x1c3)]};},async 'execute'(_0x4daee2){const _0x414780=a185_0x364373,_0x489781=loadSqlProjectConfig(_0x4daee2['appCode']),_0x51c8f3=await readSqlLockFile(_0x489781[_0x414780(0x1bc)]);if(!_0x51c8f3)throw CliErrors[_0x414780(0x1b2)](_0x414780(0x1c2));const {lockData:_0x1b5033,appLock:_0x47a7a3}=ensureSqlLockScope(_0x51c8f3,_0x4daee2['appCode'],_0x489781[_0x414780(0x1c4)],_0x414780(0x1a7)),_0x3d46ff=_0x4daee2[_0x414780(0x1a0)]('sqlcode'),_0x3ff591=_0x47a7a3['sqls'][_0x3d46ff];if(!_0x3ff591)throw CliErrors[_0x414780(0x1b2)](_0x414780(0x1b4)+_0x3d46ff+'\x22.');await deleteSqlQuery({'id':_0x3ff591[_0x414780(0x1bb)],'sqlCode':_0x3d46ff}),_0x47a7a3[_0x414780(0x1a1)]=Object[_0x414780(0x1bd)](Object[_0x414780(0x1bf)](_0x47a7a3[_0x414780(0x1a1)])[_0x414780(0x1be)](([_0xcb6b55])=>_0xcb6b55!==_0x3d46ff)),_0x47a7a3['lastSync']=new Date()[_0x414780(0x1a9)](),await writeSqlLockFile(_0x489781[_0x414780(0x1bc)],_0x1b5033);const _0x41f711=resolveLocalSqlFilePath(_0x489781,_0x3d46ff,_0x3ff591);let _0x29daeb;await fileExists(_0x41f711)&&(_0x29daeb=await moveToTrash(_0x489781[_0x414780(0x1c0)],_0x489781[_0x414780(0x1c3)],_0x41f711),await cleanupEmptyDirectories(dirname(_0x41f711),_0x489781[_0x414780(0x1c1)]));const _0x128b3e={'deleted':_0x3d46ff,'remoteId':_0x3ff591['remoteId']};if(_0x29daeb)_0x128b3e[_0x414780(0x1ad)]=_0x29daeb;return{'ok':!![],'data':_0x128b3e,'message':'Deleted\x20'+_0x3d46ff+(_0x29daeb?_0x414780(0x1a2):'')};}};async function moveToTrash(_0x29dfa6,_0x561a39,_0x4e83ec){const _0x27f983=a185_0x364373,_0x4d21e8=new Date()[_0x27f983(0x1a9)]()[_0x27f983(0x1a5)](/[:.]/g,'-'),_0x3d3aca=relative(_0x29dfa6,_0x4e83ec),_0x7fd91b=join(_0x561a39,_0x4d21e8,_0x3d3aca);return await mkdir(dirname(_0x7fd91b),{'recursive':!![]}),await rename(_0x4e83ec,_0x7fd91b),_0x7fd91b;}async function cleanupEmptyDirectories(_0x175d75,_0x288306){const _0x5e6f59=a185_0x364373;let _0x5d327f=resolve(_0x175d75);const _0x5f204d=resolve(_0x288306);while(_0x5d327f[_0x5e6f59(0x1ae)](''+_0x5f204d+sep)||_0x5d327f===_0x5f204d){if(_0x5d327f===_0x5f204d)return;try{const _0x3f32c9=await readdir(_0x5d327f);if(_0x3f32c9['length']>0x0)return;await rmdir(_0x5d327f);}catch{return;}_0x5d327f=dirname(_0x5d327f);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a186_0x2ba05f=a186_0x1ead;function a186_0xf1be(){const _0x56cee6=['detail','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sql','description','6924764StpKhd','verbose','6828402riNueR','sqlName','10655hhEEWZ','491748LRQhyl','read','93042bktGjI','str','sqlCode','1233880IhMJbb','bool','1159024VyNYnL','sqlContent','dbId','sqlcode','boolean','292mVJdgn','63CVvhri','appCode'];a186_0xf1be=function(){return _0x56cee6;};return a186_0xf1be();}(function(_0x3758ad,_0x468e28){const _0x284b71=a186_0x1ead,_0x5f4a63=_0x3758ad();while(!![]){try{const _0xa05448=parseInt(_0x284b71(0x133))/0x1+parseInt(_0x284b71(0x130))/0x2+parseInt(_0x284b71(0x12e))/0x3+-parseInt(_0x284b71(0x122))/0x4*(-parseInt(_0x284b71(0x12d))/0x5)+parseInt(_0x284b71(0x12b))/0x6+-parseInt(_0x284b71(0x129))/0x7+-parseInt(_0x284b71(0x135))/0x8*(parseInt(_0x284b71(0x123))/0x9);if(_0xa05448===_0x468e28)break;else _0x5f4a63['push'](_0x5f4a63['shift']());}catch(_0x25c216){_0x5f4a63['push'](_0x5f4a63['shift']());}}}(a186_0xf1be,0xb3555));import{getSqlQueryInfo}from'../../core/api-client.js';function a186_0x1ead(_0x5e1b05,_0x4e8f37){_0x5e1b05=_0x5e1b05-0x121;const _0xf1be5f=a186_0xf1be();let _0x1ead43=_0xf1be5f[_0x5e1b05];return _0x1ead43;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a186_0x2ba05f(0x127),'command':a186_0x2ba05f(0x125),'description':a186_0x2ba05f(0x126),'risk':a186_0x2ba05f(0x12f),'flags':[SQLCODE_FLAG,{'name':a186_0x2ba05f(0x12a),'type':a186_0x2ba05f(0x121),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x126548){const _0x2c22ba=a186_0x2ba05f,_0x489522=await getSqlQueryInfo(_0x126548[_0x2c22ba(0x124)],_0x126548[_0x2c22ba(0x131)](_0x2c22ba(0x138))),_0x48eec5=_0x126548[_0x2c22ba(0x134)]('verbose');if(_0x48eec5)return{'ok':!![],'data':_0x489522};const _0x4e0b4a=_0x489522['dbId']?await getDbName(_0x126548[_0x2c22ba(0x124)],_0x489522[_0x2c22ba(0x137)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x489522[_0x2c22ba(0x132)],'sqlName':_0x489522[_0x2c22ba(0x12c)],'db':_0x4e0b4a?_0x4e0b4a+'\x20('+_0x489522[_0x2c22ba(0x137)]+')':_0x489522['dbId']??'','description':_0x489522[_0x2c22ba(0x128)]??'','sqlContent':_0x489522[_0x2c22ba(0x136)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a187_0x34cc26=a187_0x98b5;(function(_0x1a60ca,_0x3d67e4){const _0x215ec1=a187_0x98b5,_0x26441b=_0x1a60ca();while(!![]){try{const _0x4db47d=-parseInt(_0x215ec1(0x1b0))/0x1+parseInt(_0x215ec1(0x1ad))/0x2*(parseInt(_0x215ec1(0x1b6))/0x3)+-parseInt(_0x215ec1(0x1b1))/0x4+-parseInt(_0x215ec1(0x1bb))/0x5*(parseInt(_0x215ec1(0x1ae))/0x6)+-parseInt(_0x215ec1(0x1af))/0x7*(parseInt(_0x215ec1(0x1bd))/0x8)+parseInt(_0x215ec1(0x1ac))/0x9+parseInt(_0x215ec1(0x1ba))/0xa;if(_0x4db47d===_0x3d67e4)break;else _0x26441b['push'](_0x26441b['shift']());}catch(_0x5df280){_0x26441b['push'](_0x26441b['shift']());}}}(a187_0x88a1,0x716dd));function a187_0x98b5(_0x4572c4,_0x38bcd7){_0x4572c4=_0x4572c4-0x1a7;const _0x88a1c4=a187_0x88a1();let _0x98b5cb=_0x88a1c4[_0x4572c4];return _0x98b5cb;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a187_0x88a1(){const _0xe5ba7c=['Returned\x20','\x20row(s)\x20in\x20','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','length','now','read','6790131bqZMTD','1444890YSODhn','14460ILEoiy','187313mUErzN','64925rVhvbV','1886612uwQkuQ','sql','string','execError','execResult','3cOkMih','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','params','sqlcode','1150580RvnTem','615RTIxyQ','str','88fRhSLc'];a187_0x88a1=function(){return _0xe5ba7c;};return a187_0x88a1();}export const sqlExec={'service':a187_0x34cc26(0x1b2),'command':'exec','description':a187_0x34cc26(0x1a8),'risk':a187_0x34cc26(0x1ab),'flags':[SQLCODE_FLAG,{'name':a187_0x34cc26(0x1b8),'type':a187_0x34cc26(0x1b3),'description':a187_0x34cc26(0x1b7)}],async 'execute'(_0xbeca54){const _0x3deb6a=a187_0x34cc26,_0x5894e1=parseJsonParams(_0xbeca54[_0x3deb6a(0x1bc)](_0x3deb6a(0x1b8))),_0x257b0a=Date[_0x3deb6a(0x1aa)](),_0x27abf4=await executeSql(_0xbeca54['appCode'],_0xbeca54['str'](_0x3deb6a(0x1b9)),_0x5894e1),_0x354491=Date[_0x3deb6a(0x1aa)]()-_0x257b0a,_0x1c0aea=_0x27abf4?.[_0x3deb6a(0x1b5)]??_0x27abf4,_0x32272e=_0x27abf4?.['execSuccess']??!![];if(!_0x32272e)return{'ok':![],'data':{'error':_0x27abf4?.[_0x3deb6a(0x1b4)]||'SQL\x20execution\x20failed','elapsed':_0x354491},'message':'SQL\x20execution\x20failed'};const _0x2a352a=Array['isArray'](_0x1c0aea)?_0x1c0aea:[];return{'ok':!![],'data':{'rows':_0x2a352a,'rowCount':_0x2a352a[_0x3deb6a(0x1a9)],'elapsed':_0x354491},'message':_0x3deb6a(0x1be)+_0x2a352a[_0x3deb6a(0x1a9)]+_0x3deb6a(0x1a7)+_0x354491+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ce65d,_0x110e3b){const _0x285720=a188_0x5d61,_0x5eb13d=_0x1ce65d();while(!![]){try{const _0x461ca5=-parseInt(_0x285720(0x119))/0x1*(-parseInt(_0x285720(0x113))/0x2)+-parseInt(_0x285720(0x116))/0x3+parseInt(_0x285720(0x114))/0x4*(parseInt(_0x285720(0x117))/0x5)+parseInt(_0x285720(0x118))/0x6*(parseInt(_0x285720(0x11c))/0x7)+-parseInt(_0x285720(0x11a))/0x8*(-parseInt(_0x285720(0x11b))/0x9)+-parseInt(_0x285720(0x11d))/0xa+-parseInt(_0x285720(0x112))/0xb*(-parseInt(_0x285720(0x115))/0xc);if(_0x461ca5===_0x110e3b)break;else _0x5eb13d['push'](_0x5eb13d['shift']());}catch(_0xed9b9){_0x5eb13d['push'](_0x5eb13d['shift']());}}}(a188_0x4e13,0x61c5f));function a188_0x5d61(_0x265262,_0x5755cd){_0x265262=_0x265262-0x112;const _0x4e137e=a188_0x4e13();let _0x5d61be=_0x4e137e[_0x265262];return _0x5d61be;}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';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 a188_0x4e13(){const _0x2eca83=['5154010Lqkxqd','99zYJrcL','423816Reschk','1023884PQrTFK','28068CObYZM','2099625ePMorW','15LrENgH','864JLrWtN','3VTAabu','28632YOBSLy','441nbQgAT','763iBSMJJ'];a188_0x4e13=function(){return _0x2eca83;};return a188_0x4e13();}
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a189_0x169a56=a189_0x165e;(function(_0x7d5769,_0x14258f){const _0x475744=a189_0x165e,_0x56a4e4=_0x7d5769();while(!![]){try{const _0x576e3f=parseInt(_0x475744(0x172))/0x1*(parseInt(_0x475744(0x187))/0x2)+-parseInt(_0x475744(0x16d))/0x3*(-parseInt(_0x475744(0x18b))/0x4)+-parseInt(_0x475744(0x17b))/0x5*(-parseInt(_0x475744(0x189))/0x6)+-parseInt(_0x475744(0x18c))/0x7+parseInt(_0x475744(0x17e))/0x8+-parseInt(_0x475744(0x17a))/0x9+-parseInt(_0x475744(0x170))/0xa;if(_0x576e3f===_0x14258f)break;else _0x56a4e4['push'](_0x56a4e4['shift']());}catch(_0x28f00f){_0x56a4e4['push'](_0x56a4e4['shift']());}}}(a189_0x3bf0,0xd3792));import{listSqlQueries}from'../../core/api-client.js';function a189_0x3bf0(){const _0x439fda=['77738hgBAam','page','map','paging','num','Page\x20size','length','description','2821986OSWfgl','660phjirD','read','Found\x20','11578264QUbgJH','verbose','Filter\x20by\x20SQL\x20name','tableData','totalCount','str','all','boolean','sqlcode','38trecqZ','name','1680BtMrUl','Page\x20number','148mufIUJ','8633807cwwktl','No\x20custom\x20SQL\x20queries\x20found.','list','number','dbId','30423pyFwLb','appCode','sql','9233330HUTafG','pagesize'];a189_0x3bf0=function(){return _0x439fda;};return a189_0x3bf0();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a189_0x165e(_0x291864,_0x5d673d){_0x291864=_0x291864-0x16d;const _0x3bf0a7=a189_0x3bf0();let _0x165ef1=_0x3bf0a7[_0x291864];return _0x165ef1;}export const sqlList={'service':a189_0x169a56(0x16f),'command':a189_0x169a56(0x18e),'description':'List\x20custom\x20SQL\x20queries','risk':a189_0x169a56(0x17c),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x169a56(0x188),'type':'string','description':a189_0x169a56(0x180)},{'name':a189_0x169a56(0x173),'type':a189_0x169a56(0x18f),'description':a189_0x169a56(0x18a),'default':0x1},{'name':a189_0x169a56(0x171),'type':a189_0x169a56(0x18f),'description':a189_0x169a56(0x177)},{'name':a189_0x169a56(0x17f),'type':a189_0x169a56(0x185),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x1b0e8a){const _0x3f5010=a189_0x169a56,_0x575886=await listSqlQueries(_0x1b0e8a[_0x3f5010(0x16e)],{'sqlCode':_0x1b0e8a[_0x3f5010(0x183)](_0x3f5010(0x186))||undefined,'sqlName':_0x1b0e8a['str']('name')||undefined,'currentPage':_0x1b0e8a[_0x3f5010(0x176)]('page'),'pageSize':_0x1b0e8a['num'](_0x3f5010(0x171),0x32)}),_0xf3669e=_0x1b0e8a['bool'](_0x3f5010(0x17f)),_0x330ebb=_0x575886[_0x3f5010(0x181)]??[],_0x27b29d=_0x575886[_0x3f5010(0x175)]?.[_0x3f5010(0x182)]??_0x330ebb[_0x3f5010(0x178)];let _0x4e514b;return _0xf3669e?_0x4e514b=_0x330ebb:_0x4e514b=await Promise[_0x3f5010(0x184)](_0x330ebb[_0x3f5010(0x174)](async _0x47cf6c=>{const _0x2aa0da=_0x3f5010;let _0x527e0e;try{_0x527e0e=_0x47cf6c[_0x2aa0da(0x190)]?await getDbName(_0x1b0e8a[_0x2aa0da(0x16e)],_0x47cf6c[_0x2aa0da(0x190)]):undefined;}catch{}return{'sqlCode':_0x47cf6c['sqlCode'],'sqlName':_0x47cf6c['sqlName'],'description':_0x47cf6c[_0x2aa0da(0x179)]??'','db':_0x527e0e?_0x527e0e+'\x20('+_0x47cf6c['dbId']+')':_0x47cf6c[_0x2aa0da(0x190)]??''};})),{'ok':!![],'data':_0x4e514b,'message':_0x330ebb[_0x3f5010(0x178)]===0x0?_0x3f5010(0x18d):_0x3f5010(0x17d)+_0x330ebb['length']+'\x20SQL\x20queries\x20(total:\x20'+_0x27b29d+').'};}};
|