@lovrabet/rabetbase-cli 2.5.0-beta.2 → 2.5.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.d.ts +13 -0
- package/lib/commands/db/table-diff-shared.js +1 -0
- 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.d.ts +1 -7
- 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 +6 -6
- package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
- package/skills/rabetbase/guides/database-connection-workflow.md +9 -9
- package/skills/rabetbase/references/rabetbase-config.md +2 -3
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -3
- package/skills/rabetbase/references/rabetbase-db-diff.md +7 -22
- package/skills/rabetbase/references/rabetbase-db-tables.md +14 -2
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +5 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a174_0x44b5(){const _0x569c32=['9zaNUjQ','\x20(id=','dev','appCode','POST','Deleted\x20role\x20','906740RjYOpM','10560880kWwPCZ','6wmWaAx','delete','4967300pdfJcq','3674785fViaoR','4397028dBEbvW','296PpEjbM','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','userCount','roleName','Role\x20still\x20has\x20','288477XtgGEx','1116419BcQDNv','Delete\x20a\x20CUSTOM\x20role\x20(built-in\x20roles\x20rejected);\x20requires\x20--yes','role','3WZszaR','/smartapi/permit/role/delete','num'];a174_0x44b5=function(){return _0x569c32;};return a174_0x44b5();}function a174_0x49d5(_0x563ca4,_0xee911f){_0x563ca4=_0x563ca4-0x1c9;const _0x44b50a=a174_0x44b5();let _0x49d575=_0x44b50a[_0x563ca4];return _0x49d575;}const a174_0x14be88=a174_0x49d5;(function(_0x8765aa,_0x56d7f9){const _0x42fe2d=a174_0x49d5,_0x1317cd=_0x8765aa();while(!![]){try{const _0x479d5a=parseInt(_0x42fe2d(0x1ca))/0x1+parseInt(_0x42fe2d(0x1d6))/0x2*(parseInt(_0x42fe2d(0x1cd))/0x3)+-parseInt(_0x42fe2d(0x1dc))/0x4+parseInt(_0x42fe2d(0x1db))/0x5*(-parseInt(_0x42fe2d(0x1d8))/0x6)+-parseInt(_0x42fe2d(0x1c9))/0x7*(-parseInt(_0x42fe2d(0x1dd))/0x8)+-parseInt(_0x42fe2d(0x1d0))/0x9*(-parseInt(_0x42fe2d(0x1da))/0xa)+-parseInt(_0x42fe2d(0x1d7))/0xb;if(_0x479d5a===_0x56d7f9)break;else _0x1317cd['push'](_0x1317cd['shift']());}catch(_0x4655af){_0x1317cd['push'](_0x1317cd['shift']());}}}(a174_0x44b5,0xc2968));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a174_0x14be88(0x1ce);export const roleDelete={'service':a174_0x14be88(0x1cc),'command':a174_0x14be88(0x1d9),'description':a174_0x14be88(0x1cb),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x35f4fc){const _0x2a552b=a174_0x14be88,_0x46064b=_0x35f4fc[_0x2a552b(0x1cf)]('id'),_0x1e78df=await getRoleById(_0x35f4fc[_0x2a552b(0x1d3)],_0x46064b);return assertCustomRole(_0x1e78df,_0x2a552b(0x1d9)),asDryRunResult({'scope':_0x2a552b(0x1d2),'operation':_0x2a552b(0x1d9),'selector':{'appCode':_0x35f4fc[_0x2a552b(0x1d3)],'roleId':_0x46064b,'roleName':_0x1e78df['roleName']},'before':projectRole(_0x1e78df),'after':null,'dryRun':!![],'backend':{'method':_0x2a552b(0x1d4),'path':DELETE_PATH},'warnings':_0x1e78df[_0x2a552b(0x1df)]>0x0?[_0x2a552b(0x1e1)+_0x1e78df[_0x2a552b(0x1df)]+_0x2a552b(0x1de)]:[]},{'method':_0x2a552b(0x1d4),'url':DELETE_PATH});},async 'execute'(_0x3826aa){const _0xab74c9=a174_0x14be88,_0x19fcaf=_0x3826aa[_0xab74c9(0x1cf)]('id'),_0x50830a=await getRoleById(_0x3826aa[_0xab74c9(0x1d3)],_0x19fcaf);return assertCustomRole(_0x50830a,_0xab74c9(0x1d9)),await deleteAppRole(_0x19fcaf),{'ok':!![],'data':{'scope':_0xab74c9(0x1d2),'operation':_0xab74c9(0x1d9),'selector':{'appCode':_0x3826aa[_0xab74c9(0x1d3)],'roleId':_0x19fcaf,'roleName':_0x50830a[_0xab74c9(0x1e0)]},'before':projectRole(_0x50830a),'after':null,'dryRun':![],'backend':{'method':_0xab74c9(0x1d4),'path':DELETE_PATH},'warnings':[]},'message':_0xab74c9(0x1d5)+_0x50830a[_0xab74c9(0x1e0)]+_0xab74c9(0x1d1)+_0x19fcaf+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a175_0x57fe64=a175_0x1103;function a175_0x1103(_0x29212,_0x57f6f8){_0x29212=_0x29212-0x18c;const _0x218f2b=a175_0x218f();let _0x1103f0=_0x218f2b[_0x29212];return _0x1103f0;}(function(_0x5a8967,_0x2aef2c){const _0x31db69=a175_0x1103,_0x539b48=_0x5a8967();while(!![]){try{const _0x192c81=-parseInt(_0x31db69(0x19a))/0x1*(-parseInt(_0x31db69(0x19b))/0x2)+-parseInt(_0x31db69(0x195))/0x3+-parseInt(_0x31db69(0x18e))/0x4+-parseInt(_0x31db69(0x190))/0x5+-parseInt(_0x31db69(0x18c))/0x6+-parseInt(_0x31db69(0x194))/0x7+parseInt(_0x31db69(0x18d))/0x8;if(_0x192c81===_0x2aef2c)break;else _0x539b48['push'](_0x539b48['shift']());}catch(_0x38b37a){_0x539b48['push'](_0x539b48['shift']());}}}(a175_0x218f,0x82481));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a175_0x218f(){const _0x352ff5=['num','Role\x20','Show\x20a\x20single\x20role\x27s\x20detail','822182Cwhiib','2EEslpR','3751488sjXbzJ','22376664LagfzN','2064280YiAjSS','appCode','3616760Gdoozd','detail','dev','read','6593160rprLdC','837246EVsGEP','roleType'];a175_0x218f=function(){return _0x352ff5;};return a175_0x218f();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':'role','command':a175_0x57fe64(0x191),'description':a175_0x57fe64(0x199),'risk':a175_0x57fe64(0x193),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x54e76c){const _0x615a68=a175_0x57fe64,_0x8e0890=_0x54e76c[_0x615a68(0x197)]('id'),_0x5361e6=await getRoleById(_0x54e76c[_0x615a68(0x18f)],_0x8e0890);return{'ok':!![],'data':{'scope':_0x615a68(0x192),'role':projectRole(_0x5361e6)},'message':_0x615a68(0x198)+_0x5361e6['roleName']+'\x20('+_0x5361e6[_0x615a68(0x196)]+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x13569,_0x4710e0){const _0x1cfdd5=a176_0x5789,_0x52926f=_0x13569();while(!![]){try{const _0x5e08a8=-parseInt(_0x1cfdd5(0xde))/0x1+parseInt(_0x1cfdd5(0xdd))/0x2*(-parseInt(_0x1cfdd5(0xdb))/0x3)+parseInt(_0x1cfdd5(0xdc))/0x4*(-parseInt(_0x1cfdd5(0xd7))/0x5)+-parseInt(_0x1cfdd5(0xd6))/0x6+parseInt(_0x1cfdd5(0xd8))/0x7*(-parseInt(_0x1cfdd5(0xd5))/0x8)+-parseInt(_0x1cfdd5(0xd9))/0x9+parseInt(_0x1cfdd5(0xda))/0xa;if(_0x5e08a8===_0x4710e0)break;else _0x52926f['push'](_0x52926f['shift']());}catch(_0x580c20){_0x52926f['push'](_0x52926f['shift']());}}}(a176_0x2f10,0x2f62e));function a176_0x2f10(){const _0x977018=['7651bGxTKI','1977075LQUvjz','10689510wPoffZ','261723ZieEat','246916mggGNw','6iJxngL','61140cskVAB','72wgsriW','1564518cquASy','5oZpShk'];a176_0x2f10=function(){return _0x977018;};return a176_0x2f10();}import{roleList}from'../../commands/role/list.js';function a176_0x5789(_0x3af55a,_0x229974){_0x3af55a=_0x3af55a-0xd5;const _0x2f10f8=a176_0x2f10();let _0x57894d=_0x2f10f8[_0x3af55a];return _0x57894d;}import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a177_0x426358=a177_0x2405;(function(_0x4e613c,_0xacc8e0){const _0x2007ff=a177_0x2405,_0x1f2d82=_0x4e613c();while(!![]){try{const _0xfcf1e2=parseInt(_0x2007ff(0x16e))/0x1+parseInt(_0x2007ff(0x177))/0x2+parseInt(_0x2007ff(0x16c))/0x3+-parseInt(_0x2007ff(0x160))/0x4*(-parseInt(_0x2007ff(0x163))/0x5)+parseInt(_0x2007ff(0x172))/0x6*(parseInt(_0x2007ff(0x15c))/0x7)+parseInt(_0x2007ff(0x15b))/0x8*(parseInt(_0x2007ff(0x171))/0x9)+-parseInt(_0x2007ff(0x17b))/0xa*(parseInt(_0x2007ff(0x167))/0xb);if(_0xfcf1e2===_0xacc8e0)break;else _0x1f2d82['push'](_0x1f2d82['shift']());}catch(_0x1411c0){_0x1f2d82['push'](_0x1f2d82['shift']());}}}(a177_0x3c2c,0x4e7ec));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a177_0x2405(_0x426ee0,_0x1b4925){_0x426ee0=_0x426ee0-0x159;const _0x3c2cca=a177_0x3c2c();let _0x240541=_0x3c2cca[_0x426ee0];return _0x240541;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a177_0x426358(0x170),a177_0x426358(0x15d),a177_0x426358(0x16b),'CUSTOM'];export const roleList={'service':a177_0x426358(0x165),'command':'list','description':a177_0x426358(0x161),'risk':a177_0x426358(0x174),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a177_0x426358(0x17a),'type':'string','required':![],'description':a177_0x426358(0x16f),'enum':ROLE_TYPES},{'name':a177_0x426358(0x178),'type':a177_0x426358(0x162),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a177_0x426358(0x176),'type':a177_0x426358(0x162),'description':a177_0x426358(0x17c),'default':0x64}],async 'validate'(_0x182f3f){const _0x37127b=a177_0x426358,_0x6c287a=_0x182f3f[_0x37127b(0x15e)](_0x37127b(0x17a))[_0x37127b(0x166)]();if(_0x6c287a&&!ROLE_TYPES[_0x37127b(0x16a)](_0x6c287a[_0x37127b(0x179)]()))throw CliErrors[_0x37127b(0x15f)]('Invalid\x20--type\x20\x22'+_0x6c287a+'\x22.',_0x37127b(0x15a)+ROLE_TYPES[_0x37127b(0x164)](',\x20')+'.');const _0xf339df=_0x182f3f[_0x37127b(0x169)](_0x37127b(0x178),0x1),_0x5621e4=_0x182f3f[_0x37127b(0x169)](_0x37127b(0x176),0x64);if(_0xf339df<0x1)throw CliErrors[_0x37127b(0x15f)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x5621e4<0x1||_0x5621e4>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x2655ca){const _0x3cae68=a177_0x426358,_0x6b0a1=_0x2655ca[_0x3cae68(0x169)](_0x3cae68(0x178),0x1)||0x1,_0x34429e=_0x2655ca[_0x3cae68(0x169)]('pagesize',0x64)||0x64,_0x333e2e=_0x2655ca[_0x3cae68(0x15e)]('type')[_0x3cae68(0x166)]()[_0x3cae68(0x179)](),{items:_0x584e26,paging:_0x1751e7}=await listAppRoles(_0x2655ca['appCode'],{'currentPage':_0x6b0a1,'pageSize':_0x34429e}),_0x32a0a8=_0x333e2e?_0x584e26[_0x3cae68(0x16d)](_0x21060d=>_0x21060d[_0x3cae68(0x173)]===_0x333e2e):_0x584e26,_0x568bc5=_0x32a0a8['map'](projectRole);return{'ok':!![],'data':{'scope':_0x3cae68(0x168),'roles':_0x568bc5,'paging':_0x1751e7},'message':_0x3cae68(0x175)+_0x568bc5[_0x3cae68(0x159)]+_0x3cae68(0x17d)};}};function a177_0x3c2c(){const _0x4a6b82=['List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','number','1248855powrgz','join','role','trim','902nnvTuR','dev','num','includes','OWNER','1082559BQfAYC','filter','611478ncOxWO','Filter\x20by\x20role\x20type','ADMIN','18CuesUE','6KKmFiU','roleType','read','Found\x20','pagesize','557564NUcmbZ','page','toUpperCase','type','199660uAWXIc','Page\x20size\x20(1-100)','\x20role(s)','length','Use\x20one\x20of:\x20','355064SWXeWy','835149qdSBLR','DEV','str','validation','8XLGAYM'];a177_0x3c2c=function(){return _0x4a6b82;};return a177_0x3c2c();}
|
|
@@ -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 a178_0x5584a3=a178_0x3abb;(function(_0x2d2736,_0x267c01){const _0x3fcb1a=a178_0x3abb,_0x515b73=_0x2d2736();while(!![]){try{const _0x3dd831=parseInt(_0x3fcb1a(0x1cf))/0x1+parseInt(_0x3fcb1a(0x206))/0x2*(parseInt(_0x3fcb1a(0x1c1))/0x3)+parseInt(_0x3fcb1a(0x1d0))/0x4*(-parseInt(_0x3fcb1a(0x1f7))/0x5)+parseInt(_0x3fcb1a(0x20f))/0x6+parseInt(_0x3fcb1a(0x1d2))/0x7*(-parseInt(_0x3fcb1a(0x1da))/0x8)+-parseInt(_0x3fcb1a(0x216))/0x9*(parseInt(_0x3fcb1a(0x20d))/0xa)+-parseInt(_0x3fcb1a(0x1e7))/0xb*(parseInt(_0x3fcb1a(0x202))/0xc);if(_0x3dd831===_0x267c01)break;else _0x515b73['push'](_0x515b73['shift']());}catch(_0x137230){_0x515b73['push'](_0x515b73['shift']());}}}(a178_0x3195,0xe59d8));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a178_0x5584a3(0x1fb),'type':a178_0x5584a3(0x1f9),'required':!![],'description':a178_0x5584a3(0x1c0)};export const USER_REF_FLAG={'name':a178_0x5584a3(0x1f2),'type':a178_0x5584a3(0x1f9),'required':!![],'description':a178_0x5584a3(0x1ec)};export const NAME_FLAG={'name':a178_0x5584a3(0x20a),'type':a178_0x5584a3(0x1f9),'required':!![],'description':a178_0x5584a3(0x1e5)};export const USER_NAME_FLAG={'name':a178_0x5584a3(0x20a),'type':a178_0x5584a3(0x1f9),'required':!![],'description':a178_0x5584a3(0x1d3)};export const REMARK_FLAG={'name':a178_0x5584a3(0x1cb),'type':'string','required':![],'description':a178_0x5584a3(0x204)};function a178_0x3195(){const _0xc1b9d7=['8624262vwkgVs','Pass\x20--role\x20<id|name>.','/smartapi/permit/user-role/create','DEV','length','/smartapi/permit/user-role/delete','join','27evGBaT','OWNER','Cannot\x20','Role\x20id\x20or\x20exact\x20role\x20name','33QjURxs','str','map','Pass\x20--user\x20<id>.','Removed\x20','userId','\x20is\x20already\x20a\x20member\x20of\x20role\x20','\x22\x20not\x20found\x20in\x20app\x20','\x20duplicate\x20memberships\x20for\x20user\x20','Anti-drift\x20check\x20failed:\x20expected\x20','remark','CUSTOM','\x22:\x20','\x22\x20is\x20ambiguous\x20(ids:\x20','1879918vOgYMW','789636TQzwjk','includes','133UiSWUl','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','trim','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x20members\x20of\x20the\x20OWNER\x20role.','dryRun','username','Pass\x20--user\x20<id|name>.','44168DiCVUq','appCode','roleType','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.',';\x20no\x20change.','Disambiguate\x20with\x20--role\x20<id>.','Multiple\x20tenant\x20members\x20match\x20\x22','expect-user-count','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x20not\x20found\x20in\x20app\x20','nickname','Role\x20name','ADMIN','11RtEsIv','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Missing\x20role\x20reference.','validation','tenant_code','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','number','find','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x20built-in\x20role\x20','Role\x20id\x20','user','userCount','push','flagMissing','Check\x20the\x20nickname/username.\x20','20SYUGTs','flag','string','User\x20','role','Role\x20name\x20\x22','totalCount','user-add','toLowerCase','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','expectUserCount','34959588EdczMH','\x20member(s)\x20but\x20role\x20has\x20','Optional\x20role\x20remark/description','permitCount','265084CApNjq','No\x20tenant\x20member\x20matches\x20\x22','roleName','test','name','filter','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','89730EyJEDN','authRequired'];a178_0x3195=function(){return _0xc1b9d7;};return a178_0x3195();}export const EXPECT_USER_COUNT_FLAG={'name':a178_0x5584a3(0x1e1),'type':a178_0x5584a3(0x1ed),'required':![],'description':a178_0x5584a3(0x1ef)};export const BUILTIN_ROLE_TYPES=[a178_0x5584a3(0x1e6),a178_0x5584a3(0x212),'OWNER'];export function isBuiltinRole(_0x34b6ba){const _0x2bd8fc=a178_0x5584a3;return BUILTIN_ROLE_TYPES[_0x2bd8fc(0x1d1)](_0x34b6ba);}export function assertCustomRole(_0x73a7b5,_0x2de209){const _0x10091a=a178_0x5584a3;if(_0x73a7b5[_0x10091a(0x1dc)]!==_0x10091a(0x1cc))throw CliErrors[_0x10091a(0x1ea)]('Cannot\x20'+_0x2de209+_0x10091a(0x1f0)+_0x73a7b5[_0x10091a(0x208)]+'\x20('+_0x73a7b5['roleType']+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x2e74b7){const _0x140ff7=a178_0x5584a3;return{'id':_0x2e74b7['id'],'roleName':_0x2e74b7[_0x140ff7(0x208)],'roleType':_0x2e74b7[_0x140ff7(0x1dc)],'remark':_0x2e74b7[_0x140ff7(0x1cb)],'userCount':_0x2e74b7[_0x140ff7(0x1f3)],'permitCount':_0x2e74b7[_0x140ff7(0x205)],'builtin':isBuiltinRole(_0x2e74b7[_0x140ff7(0x1dc)])};}export async function resolveRoleRef(_0x1fe697,_0x253afe){const _0x57d16e=a178_0x5584a3,_0x2bb742=_0x253afe[_0x57d16e(0x1d4)]();if(!_0x2bb742)throw CliErrors[_0x57d16e(0x1ea)](_0x57d16e(0x1e9),_0x57d16e(0x210));if(/^\d+$/[_0x57d16e(0x209)](_0x2bb742))return getRoleById(_0x1fe697,Number(_0x2bb742));const _0x50c206=await listAllAppRoles(_0x1fe697),_0x17b2ad=_0x50c206['filter'](_0xcf39ab=>_0xcf39ab['roleName']===_0x2bb742);if(_0x17b2ad[_0x57d16e(0x213)]===0x0)throw CliErrors[_0x57d16e(0x1ea)](_0x57d16e(0x1fc)+_0x2bb742+_0x57d16e(0x1c8)+_0x1fe697+'.',_0x57d16e(0x20c));if(_0x17b2ad[_0x57d16e(0x213)]>0x1){const _0x3c213b=_0x17b2ad[_0x57d16e(0x1c3)](_0x41851f=>_0x41851f['id'])[_0x57d16e(0x215)](',\x20');throw CliErrors[_0x57d16e(0x1ea)](_0x57d16e(0x1fc)+_0x2bb742+_0x57d16e(0x1ce)+_0x3c213b+').',_0x57d16e(0x1df));}return _0x17b2ad[0x0];}export async function getRoleById(_0x59383f,_0x351719){const _0x488a09=a178_0x5584a3,_0x46d04a=await listAllAppRoles(_0x59383f),_0x11842c=_0x46d04a[_0x488a09(0x20b)](_0xe230c3=>_0xe230c3['id']===_0x351719&&(!_0xe230c3[_0x488a09(0x1db)]||_0xe230c3[_0x488a09(0x1db)]===_0x59383f));if(_0x11842c['length']!==0x1)throw CliErrors['validation'](_0x488a09(0x1f1)+_0x351719+_0x488a09(0x1e3)+_0x59383f+'.',_0x488a09(0x1e2));return _0x11842c[0x0];}function a178_0x3abb(_0x2bff80,_0x2f20bf){_0x2bff80=_0x2bff80-0x1bf;const _0x319599=a178_0x3195();let _0x3abbc7=_0x319599[_0x2bff80];return _0x3abbc7;}async function listAllAppRoles(_0x3a878f){const _0x3ef0ed=a178_0x5584a3,_0x22d7f3=0x64,_0xfc725b=[];for(let _0x19fd46=0x1;;_0x19fd46+=0x1){const {items:_0x3ff8ba,paging:_0x8bfaa8}=await listAppRoles(_0x3a878f,{'currentPage':_0x19fd46,'pageSize':_0x22d7f3});_0xfc725b[_0x3ef0ed(0x1f4)](..._0x3ff8ba);if(_0x3ff8ba[_0x3ef0ed(0x213)]<_0x22d7f3||_0x8bfaa8&&_0xfc725b[_0x3ef0ed(0x213)]>=_0x8bfaa8['totalCount'])return _0xfc725b;}}export async function resolveTenantCode(){const _0x5849aa=a178_0x5584a3,_0x21f477=await getSessionUserInfo(),_0xff0807=_0x21f477?.[_0x5849aa(0x1f2)]?.['tenant']?.[_0x5849aa(0x1eb)];if(!_0xff0807)throw CliErrors[_0x5849aa(0x20e)](_0x5849aa(0x200));return _0xff0807;}function matchMember(_0x2728b8,_0x332911){const _0x27d1d4=a178_0x5584a3,_0x59a750=_0x332911[_0x27d1d4(0x1d4)]()[_0x27d1d4(0x1ff)]();return(_0x2728b8['nickname']??'')[_0x27d1d4(0x1ff)]()===_0x59a750||(_0x2728b8[_0x27d1d4(0x1d8)]??'')[_0x27d1d4(0x1ff)]()===_0x59a750;}export async function resolveUserRef(_0x3f1000,_0x42d915=a178_0x5584a3(0x1c4)){const _0x38e36e=a178_0x5584a3,_0xfd501e=_0x3f1000[_0x38e36e(0x1d4)]();if(!_0xfd501e)throw CliErrors[_0x38e36e(0x1ea)]('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x490bd8=await resolveTenantCode(),_0x374de8=await getTenantMembers(_0x490bd8);if(/^\d+$/[_0x38e36e(0x209)](_0xfd501e)){const _0x211a7f=Number(_0xfd501e),_0x5c2f21=_0x374de8[_0x38e36e(0x1ee)](_0x1e2561=>_0x1e2561['userId']===_0x211a7f);return{'userId':_0x211a7f,'username':_0x5c2f21?.[_0x38e36e(0x1d8)]??String(_0x211a7f),'nickname':_0x5c2f21?.[_0x38e36e(0x1e4)],'matchedBy':'id'};}const _0x5f1bda=_0x374de8[_0x38e36e(0x20b)](_0x952073=>matchMember(_0x952073,_0xfd501e));if(_0x5f1bda[_0x38e36e(0x213)]===0x0)throw CliErrors[_0x38e36e(0x1ea)](_0x38e36e(0x207)+_0xfd501e+'\x22.',_0x38e36e(0x1f6)+_0x42d915);if(_0x5f1bda[_0x38e36e(0x213)]>0x1){const _0x4e1145=_0x5f1bda['map'](_0x2c978f=>(_0x2c978f[_0x38e36e(0x1e4)]??_0x2c978f[_0x38e36e(0x1d8)]??'?')+'('+_0x2c978f[_0x38e36e(0x1c6)]+')')['join'](',\x20');throw CliErrors[_0x38e36e(0x1ea)](_0x38e36e(0x1e0)+_0xfd501e+_0x38e36e(0x1cd)+_0x4e1145+'.',_0x42d915);}const _0x34c3cd=_0x5f1bda[0x0];return{'userId':_0x34c3cd[_0x38e36e(0x1c6)],'username':_0x34c3cd[_0x38e36e(0x1d8)]??String(_0x34c3cd[_0x38e36e(0x1c6)]),'nickname':_0x34c3cd[_0x38e36e(0x1e4)],'matchedBy':_0x38e36e(0x20a)};}export const CREATE_USER_ROLE_PATH=a178_0x5584a3(0x211);export const DELETE_USER_ROLE_PATH=a178_0x5584a3(0x214);export function computeRoleUserMutation(_0x2af2c4){const _0x1bbdc3=a178_0x5584a3,{operation:_0x44a132,appCode:_0x3c42fd,role:_0x51647f,relations:_0x2eb851,user:_0x5638a8}=_0x2af2c4,_0x288771=[...new Set(_0x2eb851[_0x1bbdc3(0x1c3)](_0x1a8322=>_0x1a8322[_0x1bbdc3(0x1c6)]))],_0x10b5bb=[];if(_0x2af2c4[_0x1bbdc3(0x201)]!==undefined&&_0x2af2c4['expectUserCount']!==_0x288771[_0x1bbdc3(0x213)])throw CliErrors[_0x1bbdc3(0x1ea)](_0x1bbdc3(0x1ca)+_0x2af2c4['expectUserCount']+_0x1bbdc3(0x203)+_0x288771['length']+'.',_0x1bbdc3(0x1d5));const _0x332f08=_0x288771[_0x1bbdc3(0x1d1)](_0x5638a8[_0x1bbdc3(0x1c6)]),_0x7e0a8=_0x2eb851[_0x1bbdc3(0x20b)](_0x5c72f1=>_0x5c72f1[_0x1bbdc3(0x1c6)]===_0x5638a8[_0x1bbdc3(0x1c6)])[_0x1bbdc3(0x1c3)](_0x89b3b4=>_0x89b3b4['id']),_0x5c7873=_0x44a132==='user-add'?!_0x332f08:_0x332f08;let _0x391897=_0x288771;_0x44a132===_0x1bbdc3(0x1fe)?_0x332f08?_0x10b5bb[_0x1bbdc3(0x1f4)](_0x1bbdc3(0x1fa)+_0x5638a8[_0x1bbdc3(0x1c6)]+_0x1bbdc3(0x1c7)+_0x51647f[_0x1bbdc3(0x208)]+_0x1bbdc3(0x1de)):_0x391897=[..._0x288771,_0x5638a8[_0x1bbdc3(0x1c6)]]:!_0x332f08?_0x10b5bb[_0x1bbdc3(0x1f4)](_0x1bbdc3(0x1fa)+_0x5638a8['userId']+_0x1bbdc3(0x1e8)+_0x51647f['roleName']+_0x1bbdc3(0x1de)):(_0x391897=_0x288771[_0x1bbdc3(0x20b)](_0x3b2d2a=>_0x3b2d2a!==_0x5638a8['userId']),_0x7e0a8[_0x1bbdc3(0x213)]>0x1&&_0x10b5bb[_0x1bbdc3(0x1f4)](_0x1bbdc3(0x1c5)+_0x7e0a8[_0x1bbdc3(0x213)]+_0x1bbdc3(0x1c9)+_0x5638a8[_0x1bbdc3(0x1c6)]+'.'));const _0x10deec={'scope':'dev','operation':_0x44a132,'selector':{'appCode':_0x3c42fd,'roleId':_0x51647f['id'],'roleName':_0x51647f[_0x1bbdc3(0x208)],'userId':_0x5638a8[_0x1bbdc3(0x1c6)]},'before':{'userIds':_0x288771},'after':{'userIds':_0x391897},'dryRun':_0x2af2c4[_0x1bbdc3(0x1d7)],'backend':{'method':'POST','path':_0x44a132==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x10b5bb};return{'mutation':_0x10deec,'changed':_0x5c7873,'matchingRelationIds':_0x7e0a8};}export async function loadDevRoleRelations(_0x3709b7,_0x404d32){const _0x4227d5=a178_0x5584a3,_0x26dc6a=0x64,_0x56d630=[];for(let _0x5d0a68=0x1;;_0x5d0a68+=0x1){const {items:_0x64dbdc,paging:_0x58396f}=await listDevUserRoleRelations(_0x3709b7,{'roleId':_0x404d32,'currentPage':_0x5d0a68,'pageSize':_0x26dc6a});_0x56d630[_0x4227d5(0x1f4)](..._0x64dbdc);if(_0x64dbdc[_0x4227d5(0x213)]<_0x26dc6a||_0x58396f&&_0x56d630[_0x4227d5(0x213)]>=_0x58396f[_0x4227d5(0x1fd)])return _0x56d630;}}export function readRoleRef(_0x343442){const _0x447d0c=a178_0x5584a3,_0x10a8b5=_0x343442[_0x447d0c(0x1c2)](_0x447d0c(0x1fb))[_0x447d0c(0x1d4)]();if(!_0x10a8b5)throw CliErrors[_0x447d0c(0x1f5)](_0x447d0c(0x1fb),_0x447d0c(0x210));return _0x10a8b5;}export async function prepareUserMutation(_0x33baad,_0x2d01e5,_0x129daf){const _0x96b53a=a178_0x5584a3,_0x4e0546=readRoleRef(_0x33baad),_0x24e2bd=_0x33baad[_0x96b53a(0x1c2)](_0x96b53a(0x1f2))[_0x96b53a(0x1d4)]();if(!_0x24e2bd)throw CliErrors[_0x96b53a(0x1f5)](_0x96b53a(0x1f2),_0x96b53a(0x1d9));const _0x3020ca=_0x33baad[_0x96b53a(0x1f8)](_0x96b53a(0x1e1)),_0x1c79b5=_0x3020ca===undefined||_0x3020ca===null?undefined:Number(_0x3020ca),_0x123a8a=await resolveRoleRef(_0x33baad[_0x96b53a(0x1db)],_0x4e0546);if(_0x123a8a['roleType']===_0x96b53a(0x217))throw CliErrors[_0x96b53a(0x1ea)](_0x96b53a(0x1bf)+_0x2d01e5+_0x96b53a(0x1d6),_0x96b53a(0x1dd));const _0x463ab1=await resolveUserRef(_0x24e2bd),_0x3323dc=await loadDevRoleRelations(_0x33baad[_0x96b53a(0x1db)],_0x123a8a['id']);return{...computeRoleUserMutation({'operation':_0x2d01e5,'appCode':_0x33baad[_0x96b53a(0x1db)],'role':_0x123a8a,'relations':_0x3323dc,'user':{'userId':_0x463ab1[_0x96b53a(0x1c6)],'username':_0x463ab1['username'],'nickname':_0x463ab1[_0x96b53a(0x1e4)]},'dryRun':_0x129daf,..._0x1c79b5!==undefined?{'expectUserCount':_0x1c79b5}:{}}),'role':_0x123a8a,'user':_0x463ab1};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a179_0x60d659=a179_0x33fd;(function(_0x2ae82b,_0x8344b9){const _0x311e63=a179_0x33fd,_0x420436=_0x2ae82b();while(!![]){try{const _0x43c9fc=parseInt(_0x311e63(0x7e))/0x1+-parseInt(_0x311e63(0x83))/0x2+parseInt(_0x311e63(0x8b))/0x3*(-parseInt(_0x311e63(0x9a))/0x4)+parseInt(_0x311e63(0x7f))/0x5*(-parseInt(_0x311e63(0x88))/0x6)+-parseInt(_0x311e63(0x81))/0x7+-parseInt(_0x311e63(0x82))/0x8*(parseInt(_0x311e63(0x87))/0x9)+-parseInt(_0x311e63(0x94))/0xa*(-parseInt(_0x311e63(0x8a))/0xb);if(_0x43c9fc===_0x8344b9)break;else _0x420436['push'](_0x420436['shift']());}catch(_0x20b597){_0x420436['push'](_0x420436['shift']());}}}(a179_0x3f7f,0x2edd6));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a179_0x3f7f(){const _0x20c15e=['15bsPmQH','New\x20role\x20name','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flag','name','Updated\x20role\x20','roleName','--name\x20cannot\x20be\x20empty.','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','30mcTcNK','num','/smartapi/permit/role/update','trim','update','remark','119300DytPHV','Nothing\x20to\x20update.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','appCode','dev','352483IHQiSQ','61570Xyomnq','POST','1809829nIfEwI','84552HpEZXm','257790urzmox','\x20(id=','length','validation','261pSkgMy','114NILQTK','role','3360533nAECJF'];a179_0x3f7f=function(){return _0x20c15e;};return a179_0x3f7f();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a179_0x33fd(_0xdabf55,_0x3777ca){_0xdabf55=_0xdabf55-0x7a;const _0x3f7fe0=a179_0x3f7f();let _0x33fd19=_0x3f7fe0[_0xdabf55];return _0x33fd19;}const UPDATE_PATH=a179_0x60d659(0x96);function readPatch(_0x211acc){const _0x4c2e0f=a179_0x60d659,_0x2d1d11=_0x211acc['flag'](_0x4c2e0f(0x8f)),_0x10abd9=_0x211acc[_0x4c2e0f(0x8e)]('remark'),_0x4635e6={};if(_0x2d1d11!==undefined&&_0x2d1d11!==null){const _0x5e1225=String(_0x2d1d11)[_0x4c2e0f(0x97)]();if(!_0x5e1225)throw CliErrors['validation'](_0x4c2e0f(0x92));if(_0x5e1225[_0x4c2e0f(0x85)]>0x40)throw CliErrors['validation'](_0x4c2e0f(0x8d));_0x4635e6[_0x4c2e0f(0x91)]=_0x5e1225;}_0x10abd9!==undefined&&_0x10abd9!==null&&(_0x4635e6[_0x4c2e0f(0x99)]=String(_0x10abd9));if(_0x4635e6[_0x4c2e0f(0x91)]===undefined&&_0x4635e6[_0x4c2e0f(0x99)]===undefined)throw CliErrors[_0x4c2e0f(0x86)](_0x4c2e0f(0x7a),_0x4c2e0f(0x93));return _0x4635e6;}export const roleUpdate={'service':a179_0x60d659(0x89),'command':a179_0x60d659(0x98),'description':a179_0x60d659(0x7b),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a179_0x60d659(0x8f),'type':'string','required':![],'description':a179_0x60d659(0x8c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x20146f){readPatch(_0x20146f);},async 'dryRun'(_0x17e851){const _0x2a934a=a179_0x60d659,_0x4047a3=_0x17e851[_0x2a934a(0x95)]('id'),_0x515cb0=readPatch(_0x17e851),_0x12c950=await getRoleById(_0x17e851['appCode'],_0x4047a3);return assertCustomRole(_0x12c950,_0x2a934a(0x98)),asDryRunResult({'scope':'dev','operation':_0x2a934a(0x98),'selector':{'appCode':_0x17e851[_0x2a934a(0x7c)],'roleId':_0x4047a3,'roleName':_0x12c950[_0x2a934a(0x91)]},'before':projectRole(_0x12c950),'after':projectRole({..._0x12c950,..._0x515cb0[_0x2a934a(0x91)]!==undefined?{'roleName':_0x515cb0[_0x2a934a(0x91)]}:{},..._0x515cb0[_0x2a934a(0x99)]!==undefined?{'remark':_0x515cb0[_0x2a934a(0x99)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x2a934a(0x80),'url':UPDATE_PATH});},async 'execute'(_0x341845){const _0x265bc5=a179_0x60d659,_0xd17e9c=_0x341845[_0x265bc5(0x95)]('id'),_0x503577=readPatch(_0x341845),_0x1163d8=await getRoleById(_0x341845['appCode'],_0xd17e9c);assertCustomRole(_0x1163d8,_0x265bc5(0x98)),await updateAppRole({'id':_0xd17e9c,'appCode':_0x341845['appCode'],..._0x503577[_0x265bc5(0x91)]!==undefined?{'roleName':_0x503577[_0x265bc5(0x91)]}:{},..._0x503577['remark']!==undefined?{'remark':_0x503577['remark']}:{}});const _0x1796e1=await getRoleById(_0x341845['appCode'],_0xd17e9c);return{'ok':!![],'data':{'scope':_0x265bc5(0x7d),'operation':_0x265bc5(0x98),'selector':{'appCode':_0x341845['appCode'],'roleId':_0xd17e9c,'roleName':_0x1796e1[_0x265bc5(0x91)]},'before':projectRole(_0x1163d8),'after':projectRole(_0x1796e1),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x265bc5(0x90)+_0x1796e1['roleName']+_0x265bc5(0x84)+_0xd17e9c+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a180_0x33f05a=a180_0x3eb3;(function(_0x10cd3a,_0x31298e){const _0x36828b=a180_0x3eb3,_0x589c34=_0x10cd3a();while(!![]){try{const _0x3e9b02=parseInt(_0x36828b(0x87))/0x1+-parseInt(_0x36828b(0x82))/0x2*(-parseInt(_0x36828b(0x85))/0x3)+-parseInt(_0x36828b(0x86))/0x4*(parseInt(_0x36828b(0x7d))/0x5)+parseInt(_0x36828b(0x84))/0x6+-parseInt(_0x36828b(0x8e))/0x7*(parseInt(_0x36828b(0x94))/0x8)+-parseInt(_0x36828b(0x81))/0x9*(parseInt(_0x36828b(0x8c))/0xa)+parseInt(_0x36828b(0x83))/0xb;if(_0x3e9b02===_0x31298e)break;else _0x589c34['push'](_0x589c34['shift']());}catch(_0x58d958){_0x589c34['push'](_0x589c34['shift']());}}}(a180_0x34d8,0xea4cc));function a180_0x34d8(){const _0xe8bbe1=['272616PhQvpc','No\x20change:\x20user\x20','5DHNsHr','selector','Added\x20user\x20','roleType','1838709XjIKka','2vdSHAW','39123084BxPuNJ','100974aSroLM','4539207vJIEnI','2114156ROUNwT','80556ZVDXEO','role','appCode','\x20to\x20role\x20','POST','90BlmQhZ','roleName','378pQVctn','\x20already\x20in\x20role\x20','userId','high-risk-write','roleId','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes'];a180_0x34d8=function(){return _0xe8bbe1;};return a180_0x34d8();}import{createDevUserRole}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,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a180_0x3eb3(_0x6af33f,_0x3b7875){_0x6af33f=_0x6af33f-0x7c;const _0x34d83c=a180_0x34d8();let _0x3eb35d=_0x34d83c[_0x6af33f];return _0x3eb35d;}export const roleUserAdd={'service':a180_0x33f05a(0x88),'command':'user-add','description':a180_0x33f05a(0x93),'risk':a180_0x33f05a(0x91),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x861924){const _0x420353=a180_0x33f05a,{mutation:_0x44cdca}=await prepareUserMutation(_0x861924,'user-add',!![]);return asDryRunResult(_0x44cdca,{'method':_0x420353(0x8b),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x529c05){const _0x5e38ec=a180_0x33f05a,{mutation:_0x23a2cc,changed:_0x2ba684,role:_0x48a640,user:_0x5745bd}=await prepareUserMutation(_0x529c05,'user-add',![]);return _0x2ba684&&await createDevUserRole({'appCode':_0x529c05[_0x5e38ec(0x89)],'userId':_0x5745bd[_0x5e38ec(0x90)],'username':_0x5745bd['username'],'roleType':_0x48a640[_0x5e38ec(0x80)],'roleId':_0x23a2cc['selector'][_0x5e38ec(0x92)]}),{'ok':!![],'data':_0x23a2cc,'message':_0x2ba684?_0x5e38ec(0x7f)+_0x23a2cc[_0x5e38ec(0x7e)]['userId']+_0x5e38ec(0x8a)+_0x23a2cc[_0x5e38ec(0x7e)][_0x5e38ec(0x8d)]:_0x5e38ec(0x7c)+_0x23a2cc[_0x5e38ec(0x7e)][_0x5e38ec(0x90)]+_0x5e38ec(0x8f)+_0x23a2cc['selector'][_0x5e38ec(0x8d)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a181_0x1e8a73=a181_0xd365;(function(_0x4bcf7f,_0x3a827a){const _0x2ed901=a181_0xd365,_0x3752f9=_0x4bcf7f();while(!![]){try{const _0x40e587=parseInt(_0x2ed901(0xfb))/0x1*(-parseInt(_0x2ed901(0xf2))/0x2)+parseInt(_0x2ed901(0xf3))/0x3*(-parseInt(_0x2ed901(0xf8))/0x4)+parseInt(_0x2ed901(0xf7))/0x5+parseInt(_0x2ed901(0xeb))/0x6+parseInt(_0x2ed901(0xfd))/0x7+parseInt(_0x2ed901(0xf5))/0x8*(-parseInt(_0x2ed901(0xf6))/0x9)+-parseInt(_0x2ed901(0xf9))/0xa;if(_0x40e587===_0x3a827a)break;else _0x3752f9['push'](_0x3752f9['shift']());}catch(_0x718be1){_0x3752f9['push'](_0x3752f9['shift']());}}}(a181_0x3d8c,0xb385c));import{deleteDevUserRole}from'../../core/api-client.js';function a181_0x3d8c(){const _0x541bf4=['9khYRhp','1732095qssxfJ','240140nQuvzX','1126140WsKLoQ','roleName','1359871zaBGdA','high-risk-write','8737841kNdjWl','userId','POST','7964454rmrUgg','role','selector','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','user-remove','\x20not\x20in\x20role\x20','\x20from\x20role\x20','2FKZUfV','33FDPOlI','Removed\x20user\x20','431176mVDUYC'];a181_0x3d8c=function(){return _0x541bf4;};return a181_0x3d8c();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a181_0xd365(_0x32caad,_0x2a3d06){_0x32caad=_0x32caad-0xeb;const _0x3d8c02=a181_0x3d8c();let _0xd365d7=_0x3d8c02[_0x32caad];return _0xd365d7;}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':a181_0x1e8a73(0xec),'command':a181_0x1e8a73(0xef),'description':a181_0x1e8a73(0xee),'risk':a181_0x1e8a73(0xfc),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x214be0){const _0x1a4733=a181_0x1e8a73,{mutation:_0x8df161}=await prepareUserMutation(_0x214be0,_0x1a4733(0xef),!![]);return asDryRunResult(_0x8df161,{'method':_0x1a4733(0xff),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4c4796){const _0x596ce7=a181_0x1e8a73,{matchingRelationIds:_0x34bc64,mutation:_0x51008d,changed:_0x297159}=await prepareUserMutation(_0x4c4796,_0x596ce7(0xef),![]);if(_0x297159)for(const _0xe1d887 of _0x34bc64){await deleteDevUserRole(_0xe1d887);}return{'ok':!![],'data':_0x51008d,'message':_0x297159?_0x596ce7(0xf4)+_0x51008d[_0x596ce7(0xed)][_0x596ce7(0xfe)]+_0x596ce7(0xf1)+_0x51008d['selector'][_0x596ce7(0xfa)]:'No\x20change:\x20user\x20'+_0x51008d[_0x596ce7(0xed)][_0x596ce7(0xfe)]+_0x596ce7(0xf0)+_0x51008d['selector']['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a182_0x54ac4d=a182_0x745d;function a182_0x43e5(){const _0x5e1bdf=['1992924ahSGai','1832525kLlUYS','name','userId','887084QyvXOd','3774231qilJVt','8547590qGIOcG','Pass\x20--name\x20<nickname|username>.','flagMissing','str','trim','6BGTMfw','nickname','8uMScNK','Resolved\x20\x22','username','role','3493waZQgw','read','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','186699qPXyca','8248jbpjYQ','\x22\x20→\x20userId\x20'];a182_0x43e5=function(){return _0x5e1bdf;};return a182_0x43e5();}function a182_0x745d(_0x3829c7,_0x5f1771){_0x3829c7=_0x3829c7-0x1d6;const _0x43e597=a182_0x43e5();let _0x745d48=_0x43e597[_0x3829c7];return _0x745d48;}(function(_0x19df01,_0x8d56b2){const _0x34c142=a182_0x745d,_0x121751=_0x19df01();while(!![]){try{const _0x3de1e3=-parseInt(_0x34c142(0x1db))/0x1*(parseInt(_0x34c142(0x1eb))/0x2)+parseInt(_0x34c142(0x1e9))/0x3*(parseInt(_0x34c142(0x1e2))/0x4)+parseInt(_0x34c142(0x1df))/0x5+parseInt(_0x34c142(0x1de))/0x6+-parseInt(_0x34c142(0x1d8))/0x7*(-parseInt(_0x34c142(0x1dc))/0x8)+parseInt(_0x34c142(0x1e3))/0x9+-parseInt(_0x34c142(0x1e4))/0xa;if(_0x3de1e3===_0x8d56b2)break;else _0x121751['push'](_0x121751['shift']());}catch(_0x5a7c7d){_0x121751['push'](_0x121751['shift']());}}}(a182_0x43e5,0x73d6a));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a182_0x54ac4d(0x1d7),'command':'user-resolve','description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a182_0x54ac4d(0x1d9),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4496a3){const _0x2e9668=a182_0x54ac4d;if(!_0x4496a3[_0x2e9668(0x1e7)](_0x2e9668(0x1e0))[_0x2e9668(0x1e8)]())throw CliErrors[_0x2e9668(0x1e6)](_0x2e9668(0x1e0),_0x2e9668(0x1e5));},async 'execute'(_0x3a0748){const _0xda4987=a182_0x54ac4d,_0x2d4e61=_0x3a0748[_0xda4987(0x1e7)]('name')[_0xda4987(0x1e8)](),_0x5745c8=await resolveUserRef(_0x2d4e61,_0xda4987(0x1da));return{'ok':!![],'data':{'user':{'userId':_0x5745c8['userId'],'username':_0x5745c8[_0xda4987(0x1d6)],'nickname':_0x5745c8[_0xda4987(0x1ea)],'matchedBy':_0x5745c8['matchedBy']}},'message':_0xda4987(0x1ec)+_0x2d4e61+_0xda4987(0x1dd)+_0x5745c8[_0xda4987(0x1e1)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a183_0x4ed15b=a183_0x4c10;(function(_0x323755,_0x30f1ee){const _0x280def=a183_0x4c10,_0x1bac3b=_0x323755();while(!![]){try{const _0x34851a=-parseInt(_0x280def(0x18f))/0x1*(-parseInt(_0x280def(0x1b3))/0x2)+-parseInt(_0x280def(0x184))/0x3+-parseInt(_0x280def(0x19e))/0x4*(-parseInt(_0x280def(0x183))/0x5)+parseInt(_0x280def(0x1a2))/0x6*(-parseInt(_0x280def(0x1ae))/0x7)+parseInt(_0x280def(0x1a4))/0x8+parseInt(_0x280def(0x1b9))/0x9*(parseInt(_0x280def(0x18b))/0xa)+-parseInt(_0x280def(0x1be))/0xb;if(_0x34851a===_0x30f1ee)break;else _0x1bac3b['push'](_0x1bac3b['shift']());}catch(_0x59ec2c){_0x1bac3b['push'](_0x1bac3b['shift']());}}}(a183_0x4b23,0xe6c30));import{readFileSync,existsSync}from'node:fs';function a183_0x4c10(_0xc4153e,_0x1effa5){_0xc4153e=_0xc4153e-0x182;const _0x4b239f=a183_0x4b23();let _0x4c10f8=_0x4b239f[_0xc4153e];return _0x4c10f8;}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([a183_0x4ed15b(0x197),a183_0x4ed15b(0x19b)]);function readPackageScripts(_0x1423e8){const _0x3d0a96=a183_0x4ed15b,_0x333818=resolve(_0x1423e8,_0x3d0a96(0x189));if(!existsSync(_0x333818))return null;try{const _0x8533cf=JSON['parse'](readFileSync(_0x333818,_0x3d0a96(0x18e)));return _0x8533cf[_0x3d0a96(0x1ba)]??{};}catch{return null;}}function detectPackageManager(_0x1d3de1){const _0x4b6dde=a183_0x4ed15b;if(existsSync(resolve(_0x1d3de1,_0x4b6dde(0x18c)))||existsSync(resolve(_0x1d3de1,_0x4b6dde(0x191))))return'bun';if(existsSync(resolve(_0x1d3de1,'pnpm-lock.yaml')))return _0x4b6dde(0x1a3);if(existsSync(resolve(_0x1d3de1,_0x4b6dde(0x1b4))))return _0x4b6dde(0x19f);return _0x4b6dde(0x192);}function a183_0x4b23(){const _0x1d8de6=['\x20run\x20build','6bfpvmZ','pnpm','4985360NeBdeh','vite\x20preview\x20exited\x20with\x20code\x20','error','\x20run\x20<script>\x0a','\x20run\x20preview','\x0a\x20\x20Usage:\x20','vite','bool','\x20\x20\x20\x20','No\x20package.json\x20found\x20in\x20current\x20directory.','9937179KUCnen','push','join','\x20run\x20start','\x20run\x20preview\x20--watch','233516pRNsaO','yarn.lock','log','boolean','has','No\x20scripts\x20defined\x20in\x20package.json.','14146047BOvIDQ','scripts','watch','Script\x20\x22','length','9195714JHEJvl','script','\x20exited\x20with\x20code\x20','819435UGaIXE','2378043LYHZRM','(none)','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Script\x20name\x20defined\x20in\x20package.json','--watch','package.json','build','10OWRjjg','bun.lockb','all','utf-8','14rwAPoR','node_modules','bun.lock','npm','\x20run\x20','needsUpgrade','inherit','\x0a\x20\x20Available\x20scripts:\x0a','start','validation','.bin','keys','dev','Run\x20a\x20package.json\x20script','\x22\x20not\x20found\x20in\x20package.json.','4xVnihl','yarn','run'];a183_0x4b23=function(){return _0x1d8de6;};return a183_0x4b23();}async function versionCheck(_0x4d2ea7){const _0x5553ef=a183_0x4ed15b,_0x2bf87c=await checkCliVersion();(_0x2bf87c['needsUpgrade']||_0x2bf87c['belowMinimum'])&&(printCliUpgradeWarning(_0x2bf87c),assertCliVersionSupported(_0x2bf87c));const _0x57f6a3=await checkSdkVersion(_0x4d2ea7);if(_0x57f6a3[_0x5553ef(0x194)])printSdkUpgradeWarning(_0x57f6a3);}function spawnScript(_0x3aef50,_0x472909,_0x2e8104,_0x3fc707){return new Promise((_0x357c95,_0x2071a0)=>{const _0x15ea5d=a183_0x4c10,_0x51d325=[_0x15ea5d(0x1a0),_0x472909,..._0x2e8104],_0x308d7f=spawn(_0x3aef50,_0x51d325,{'cwd':_0x3fc707,'stdio':_0x15ea5d(0x195),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3fc707,_0x15ea5d(0x190),_0x15ea5d(0x199))+delimiter+process.env.PATH}});_0x308d7f['on']('close',_0xffd052=>{const _0x195cd4=_0x15ea5d;if(_0xffd052===0x0||_0xffd052===null)_0x357c95();else _0x2071a0(new Error(_0x3aef50+_0x195cd4(0x193)+_0x472909+_0x195cd4(0x182)+_0xffd052));}),_0x308d7f['on'](_0x15ea5d(0x1a6),_0x2071a0);});}function spawnViteBuildWatch(_0x3f181f){return new Promise((_0x3dc1cb,_0xb6469c)=>{const _0x1c08f6=a183_0x4c10,_0x130b86=spawn(_0x1c08f6(0x1aa),[_0x1c08f6(0x18a),_0x1c08f6(0x188)],{'cwd':_0x3f181f,'stdio':_0x1c08f6(0x195),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3f181f,'node_modules',_0x1c08f6(0x199))+delimiter+process.env.PATH}});_0x130b86['on']('close',_0x104713=>{const _0x42f83d=_0x1c08f6;if(_0x104713===0x0||_0x104713===null)_0x3dc1cb();else _0xb6469c(new Error(_0x42f83d(0x186)+_0x104713));}),_0x130b86['on']('error',_0xb6469c);});}function spawnVitePreview(_0x511292){return new Promise((_0x1de20d,_0x23303c)=>{const _0x55f02d=a183_0x4c10,_0x34dc64=spawn(_0x55f02d(0x1aa),['preview'],{'cwd':_0x511292,'stdio':_0x55f02d(0x195),'shell':!![],'env':{...process.env,'PATH':''+join(_0x511292,'node_modules',_0x55f02d(0x199))+delimiter+process.env.PATH}});_0x34dc64['on']('close',_0x1b8d87=>{const _0x2cb600=_0x55f02d;if(_0x1b8d87===0x0||_0x1b8d87===null)_0x1de20d();else _0x23303c(new Error(_0x2cb600(0x1a5)+_0x1b8d87));}),_0x34dc64['on'](_0x55f02d(0x1a6),_0x23303c);});}const runFlags=[{'name':a183_0x4ed15b(0x1bb),'type':a183_0x4ed15b(0x1b6),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':'run','command':a183_0x4ed15b(0x1a0),'description':a183_0x4ed15b(0x19c),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a183_0x4ed15b(0x1bf),'description':a183_0x4ed15b(0x187),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x171e05=a183_0x4ed15b,_0x156683=[];return _0x156683[_0x171e05(0x1af)]('\x20\x20EXAMPLES'),_0x156683[_0x171e05(0x1af)](_0x171e05(0x1ac)+CLI_BIN_NAME+_0x171e05(0x1b1)),_0x156683['push'](_0x171e05(0x1ac)+CLI_BIN_NAME+_0x171e05(0x1a1)),_0x156683[_0x171e05(0x1af)](_0x171e05(0x1ac)+CLI_BIN_NAME+_0x171e05(0x1a8)),_0x156683[_0x171e05(0x1af)](_0x171e05(0x1ac)+CLI_BIN_NAME+_0x171e05(0x1b2)),_0x156683[_0x171e05(0x1b0)]('\x0a');},async 'execute'(_0x2604a4){const _0x44ba5c=a183_0x4ed15b,_0x1e5401=process['cwd'](),_0x373cae=_0x2604a4['args'][0x0],_0x330617=_0x2604a4['args']['slice'](0x1),_0x384dff=readPackageScripts(_0x1e5401);if(!_0x384dff)throw CliErrors[_0x44ba5c(0x198)](_0x44ba5c(0x1ad));if(!_0x373cae){const _0x175666=Object[_0x44ba5c(0x19a)](_0x384dff);if(_0x175666[_0x44ba5c(0x1bd)]===0x0)console['log'](_0x44ba5c(0x1b8));else{console[_0x44ba5c(0x1b5)](_0x44ba5c(0x196));for(const _0x2bc711 of _0x175666){console[_0x44ba5c(0x1b5)](_0x44ba5c(0x1ac)+_0x2bc711);}console['log'](_0x44ba5c(0x1a9)+CLI_BIN_NAME+_0x44ba5c(0x1a7));}return{'ok':!![]};}if(!_0x384dff[_0x373cae])throw CliErrors[_0x44ba5c(0x198)](_0x44ba5c(0x1bc)+_0x373cae+_0x44ba5c(0x19d),'Available:\x20'+(Object['keys'](_0x384dff)[_0x44ba5c(0x1b0)](',\x20')||_0x44ba5c(0x185)));const _0x586ea7=detectPackageManager(_0x1e5401);VERSION_CHECK_SCRIPTS[_0x44ba5c(0x1b7)](_0x373cae)&&await versionCheck(_0x1e5401);if(_0x373cae==='preview'&&_0x2604a4[_0x44ba5c(0x1ab)](_0x44ba5c(0x1bb)))return await Promise[_0x44ba5c(0x18d)]([spawnViteBuildWatch(_0x1e5401),spawnVitePreview(_0x1e5401)]),{'ok':!![]};return await spawnScript(_0x586ea7,_0x373cae,_0x330617,_0x1e5401),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a184_0x3504(_0x10d9e8,_0x113dea){_0x10d9e8=_0x10d9e8-0xb5;const _0x303601=a184_0x3036();let _0x350482=_0x303601[_0x10d9e8];return _0x350482;}const a184_0x3b3968=a184_0x3504;(function(_0xdc9c4e,_0x2d5a0f){const _0x3c9628=a184_0x3504,_0x958289=_0xdc9c4e();while(!![]){try{const _0x32207e=-parseInt(_0x3c9628(0xbc))/0x1+-parseInt(_0x3c9628(0xc2))/0x2+-parseInt(_0x3c9628(0xc0))/0x3+-parseInt(_0x3c9628(0xbb))/0x4*(parseInt(_0x3c9628(0xc1))/0x5)+parseInt(_0x3c9628(0xb9))/0x6*(parseInt(_0x3c9628(0xb7))/0x7)+parseInt(_0x3c9628(0xb6))/0x8*(-parseInt(_0x3c9628(0xbe))/0x9)+parseInt(_0x3c9628(0xbd))/0xa;if(_0x32207e===_0x2d5a0f)break;else _0x958289['push'](_0x958289['shift']());}catch(_0x95bc62){_0x958289['push'](_0x958289['shift']());}}}(a184_0x3036,0x66b9b));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x460005){const _0x36aaa7=await buildSchemaPayload();return{'ok':!![],'data':_0x36aaa7};}export const schemaDefinition={'service':a184_0x3b3968(0xbf),'command':a184_0x3b3968(0xb5),'description':a184_0x3b3968(0xba),'risk':a184_0x3b3968(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};function a184_0x3036(){const _0x57c791=['766230IoNdGq','3157450YEEfBJ','291760zUfuxm','export','43696mHntgm','189zHAqaV','read','153678jntTTh','Export\x20machine-readable\x20command\x20schema\x20(JSON)','4vQMtGx','40134JNiOzd','13974840cFokTN','981TSBjzD','schema'];a184_0x3036=function(){return _0x57c791;};return a184_0x3036();}
|
|
@@ -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 a185_0x3ba458=a185_0x6264;(function(_0x466e30,_0x9f748d){const _0x407cb6=a185_0x6264,_0x158fbb=_0x466e30();while(!![]){try{const _0x84ae18=-parseInt(_0x407cb6(0x1f6))/0x1*(parseInt(_0x407cb6(0x216))/0x2)+-parseInt(_0x407cb6(0x202))/0x3*(parseInt(_0x407cb6(0x1fa))/0x4)+-parseInt(_0x407cb6(0x1f7))/0x5+-parseInt(_0x407cb6(0x206))/0x6*(parseInt(_0x407cb6(0x1e9))/0x7)+-parseInt(_0x407cb6(0x1e6))/0x8+parseInt(_0x407cb6(0x20e))/0x9*(-parseInt(_0x407cb6(0x207))/0xa)+parseInt(_0x407cb6(0x20a))/0xb;if(_0x84ae18===_0x9f748d)break;else _0x158fbb['push'](_0x158fbb['shift']());}catch(_0x2a2ff0){_0x158fbb['push'](_0x158fbb['shift']());}}}(a185_0x3737,0x9064e));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(_0x13796b){const _0x5891f2=a185_0x6264;if(_0x13796b===_0x5891f2(0x219))return[_0x5891f2(0x20b),_0x5891f2(0x211),_0x5891f2(0x1ee),''][_0x5891f2(0x1eb)]('\x0a');return[_0x5891f2(0x1d6),''][_0x5891f2(0x1eb)]('\x0a');}export const sqlCreate={'service':a185_0x3ba458(0x1f1),'command':a185_0x3ba458(0x1dd),'description':a185_0x3ba458(0x1db),'risk':a185_0x3ba458(0x1e3),'flags':[{'name':a185_0x3ba458(0x1fc),'type':a185_0x3ba458(0x21a),'description':a185_0x3ba458(0x1d9)},{'name':a185_0x3ba458(0x1ef),'type':a185_0x3ba458(0x201),'description':a185_0x3ba458(0x209)},{'name':'mode','type':a185_0x3ba458(0x21a),'enum':[a185_0x3ba458(0x1f1),a185_0x3ba458(0x219)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0xf768cb){const _0x101e8d=a185_0x3ba458;if(!_0xf768cb['nonInteractive'])return;if(!_0xf768cb[_0x101e8d(0x214)](_0x101e8d(0x1fc))[_0x101e8d(0x1e4)]())throw CliErrors['flagMissing'](_0x101e8d(0x1fc),_0x101e8d(0x1fe));const _0x58de27=resolveProvidedDbId(_0xf768cb);if(typeof _0x58de27!==_0x101e8d(0x201)||!Number[_0x101e8d(0x218)](_0x58de27)||_0x58de27<=0x0)throw CliErrors['flagMissing'](_0x101e8d(0x1ef),_0x101e8d(0x20d));if(!_0xf768cb['str']('mode')[_0x101e8d(0x1e4)]())throw CliErrors['flagMissing']('mode',_0x101e8d(0x1fd));},async 'dryRun'(_0x4223a7){const _0x3a7718=a185_0x3ba458,_0x26fb35=loadSqlProjectConfig(_0x4223a7[_0x3a7718(0x1f0)]),{sqlName:_0x33baf2,dbId:_0x59c953,dbName:_0x166821,mode:_0xccc066}=await resolveSqlNewInputs(_0x4223a7),_0xe43f8=buildSqlRelativePath(_0x3a7718(0x1f9),_0x33baf2,_0x166821,_0xccc066,_0x59c953),_0x2b5452=_0x26fb35[_0x3a7718(0x208)]+'/'+_0xe43f8;return{'method':_0x3a7718(0x217),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x4223a7[_0x3a7718(0x1f0)],'sqlName':_0x33baf2,'dbId':_0x59c953,'mode':_0xccc066,'localPath':_0x2b5452},'description':_0x3a7718(0x20c)+_0x26fb35[_0x3a7718(0x208)]};},async 'execute'(_0xa3ca){const _0xb40d60=a185_0x3ba458,_0x3630e9=loadSqlProjectConfig(_0xa3ca['appCode']),{sqlName:_0x3155fb,dbId:_0x5e550a,dbName:_0x3d49fe,mode:_0xf5feef}=await resolveSqlNewInputs(_0xa3ca),_0x19db0d=generateSqlTemplate(_0xf5feef),_0x3712b6=await createSqlQuery({'appCode':_0xa3ca['appCode'],'sqlName':_0x3155fb,'dbId':_0x5e550a,'sqlContent':_0x19db0d}),_0x2f9e03=ensureRemoteSqlContent(_0x3712b6),_0x3f5e65=_0x3d49fe||await getDbName(_0xa3ca[_0xb40d60(0x1f0)],_0x5e550a)['catch'](()=>undefined),_0x465a85=buildSqlRelativePath(_0x3712b6[_0xb40d60(0x1e2)],_0x3712b6[_0xb40d60(0x1f8)],_0x3f5e65,_0xf5feef,_0x5e550a),_0xd3f91=_0x3630e9[_0xb40d60(0x208)]+'/'+_0x465a85,_0x51daba=buildLocalSqlFileContent({'sqlCode':_0x3712b6[_0xb40d60(0x1e2)],'sqlName':_0x3712b6[_0xb40d60(0x1f8)],'dbId':_0x3712b6['dbId']},_0x2f9e03,{'dbName':_0x3f5e65,'mode':_0xf5feef,'syncedAt':new Date()[_0xb40d60(0x1e5)](),'description':_0x3712b6[_0xb40d60(0x200)]});if(await fileExists(_0xd3f91))throw CliErrors[_0xb40d60(0x1df)]('File\x20already\x20exists:\x20'+_0xd3f91);await ensureParentDirectory(_0xd3f91),await writeFile(_0xd3f91,_0x51daba,_0xb40d60(0x1da));const _0x4782a0=await readSqlLockFile(_0x3630e9['lockFilePath']),{lockData:_0x1725ea,appLock:_0x67be98}=ensureSqlLockScope(_0x4782a0??createEmptySqlLock(),_0x3630e9[_0xb40d60(0x1f0)],_0x3630e9[_0xb40d60(0x1ec)],_0xb40d60(0x1f4));return _0x67be98[_0xb40d60(0x215)][_0x3712b6[_0xb40d60(0x1e2)]]={...buildSqlLockEntry(_0x3712b6,_0x2f9e03,computeSqlContentHash(_0x51daba),{'dbName':_0x3f5e65}),'path':_0x465a85,'mode':_0xf5feef},_0x67be98['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x3630e9[_0xb40d60(0x1ed)],_0x1725ea),{'ok':!![],'data':{'id':_0x3712b6['id'],'sqlCode':_0x3712b6[_0xb40d60(0x1e2)],'sqlName':_0x3712b6[_0xb40d60(0x1f8)],'dbId':_0x3712b6[_0xb40d60(0x205)],'path':_0xd3f91,'mode':_0xf5feef},'message':_0xb40d60(0x1ff)+_0x3712b6['sqlCode']};}};async function resolveSqlNewInputs(_0x12e3ff){const _0x2b9dd3=await resolveSqlNameInput(_0x12e3ff),{dbId:_0x106f01,dbName:_0x16ea6d}=await resolveDbSelection(_0x12e3ff),_0x2d24ff=await resolveSqlModeInput(_0x12e3ff);return{'sqlName':_0x2b9dd3,'dbId':_0x106f01,'dbName':_0x16ea6d,'mode':_0x2d24ff};}function a185_0x6264(_0x1cb691,_0x54c087){_0x1cb691=_0x1cb691-0x1d6;const _0x3737c1=a185_0x3737();let _0x6264cd=_0x3737c1[_0x1cb691];return _0x6264cd;}async function resolveSqlNameInput(_0x431d0b){const _0x4170dc=a185_0x3ba458,_0x46f352=_0x431d0b[_0x4170dc(0x214)](_0x4170dc(0x1fc))[_0x4170dc(0x1e4)]();if(_0x46f352)return _0x46f352;if(_0x431d0b[_0x4170dc(0x203)])throw CliErrors[_0x4170dc(0x1d7)](_0x4170dc(0x1fc),_0x4170dc(0x1fe));return(await input({'message':'SQL\x20name:','validate':_0x4a02f1=>_0x4a02f1[_0x4170dc(0x1e4)]()?!![]:_0x4170dc(0x1e7)}))['trim']();}async function resolveDbSelection(_0x361797){const _0xaeda22=a185_0x3ba458,_0x3e7581=resolveProvidedDbId(_0x361797);if(typeof _0x3e7581===_0xaeda22(0x201)&&Number[_0xaeda22(0x218)](_0x3e7581)&&_0x3e7581>0x0)return{'dbId':_0x3e7581,'dbName':await getDbName(_0x361797[_0xaeda22(0x1f0)],_0x3e7581)[_0xaeda22(0x1e0)](()=>undefined)};if(_0x361797[_0xaeda22(0x203)])throw CliErrors[_0xaeda22(0x1d7)](_0xaeda22(0x1ef),_0xaeda22(0x20d));const _0x15f139=await listDatabases(_0x361797['appCode'])[_0xaeda22(0x1e0)](()=>[]);if(_0x15f139[_0xaeda22(0x1f5)]===0x1)return{'dbId':_0x15f139[0x0][_0xaeda22(0x205)],'dbName':_0x15f139[0x0][_0xaeda22(0x1ea)]};if(_0x15f139['length']>0x1){const _0x34b43a=await select({'message':_0xaeda22(0x1d8),'choices':[..._0x15f139['map'](_0x373148=>({'name':_0x373148[_0xaeda22(0x1ea)]+'\x20('+_0x373148[_0xaeda22(0x205)]+')','value':serializeDbSelection(_0x373148)})),{'name':_0xaeda22(0x1fb),'value':_0xaeda22(0x1de)}]});if(_0x34b43a!==_0xaeda22(0x1de))return deserializeDbSelection(_0x34b43a);}const _0x5f5587=await input({'message':_0xaeda22(0x1f2),'validate':_0x581d18=>{const _0x13da51=_0xaeda22,_0x4ef75c=_0x581d18[_0x13da51(0x1e4)]();if(!_0x4ef75c)return _0x13da51(0x1dc);const _0x4fd455=Number(_0x4ef75c);if(!Number[_0x13da51(0x212)](_0x4fd455)||_0x4fd455<=0x0)return _0x13da51(0x20f);return!![];}});return{'dbId':Number(_0x5f5587[_0xaeda22(0x1e4)]())};}async function resolveSqlModeInput(_0x29f14){const _0x347464=a185_0x3ba458,_0x4335cd=_0x29f14['str'](_0x347464(0x1f3))[_0x347464(0x1e4)]();if(_0x4335cd===_0x347464(0x1f1)||_0x4335cd===_0x347464(0x219))return _0x4335cd;if(_0x29f14[_0x347464(0x203)])throw CliErrors['flagMissing']('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x347464(0x1e1),'value':_0x347464(0x1f1),'description':_0x347464(0x21b)},{'name':_0x347464(0x213),'value':_0x347464(0x219),'description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function a185_0x3737(){const _0x584a43=['parse','21uhizOA','dbName','join','sqlRoot','lockFilePath','</select>','db-id','appCode','sql','Target\x20database\x20dbId:','mode','new','length','19489gttART','2102435OoSGUW','sqlName','<server-generated-sqlCode>','42892aNRdpd','✎\x20Enter\x20dbId\x20manually','name','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','Created\x20SQL\x20query\x20','description','number','318GNuWXo','nonInteractive','Invalid\x20database\x20selection\x20payload:\x20','dbId','2298132TeSQea','10BCxhGz','sqlRootDir','Target\x20database\x20ID','53020627vbWmhE','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','6759063FnvFKG','dbId\x20must\x20be\x20a\x20positive\x20integer','flag','\x20\x20SELECT\x201\x20AS\x20id','isInteger','MyBatis\x20XML\x20(mybatisXml)','str','sqls','22SepbZs','POST','isFinite','mybatisXml','string','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','SELECT\x201\x20AS\x20id;','flagMissing','Select\x20the\x20target\x20database:','SQL\x20query\x20display\x20name','utf8','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','dbId\x20cannot\x20be\x20empty','create','__manual__','validation','catch','Plain\x20SQL\x20(sql)','sqlCode','write','trim','toISOString','4456336IHKDsw','SQL\x20name\x20cannot\x20be\x20empty'];a185_0x3737=function(){return _0x584a43;};return a185_0x3737();}function serializeDbSelection(_0x28571d){const _0x22a3ad=a185_0x3ba458;return JSON['stringify']({'dbId':_0x28571d[_0x22a3ad(0x205)],'dbName':_0x28571d[_0x22a3ad(0x1ea)]});}function deserializeDbSelection(_0xcdbe51){const _0x5d53ec=a185_0x3ba458;try{const _0x397662=JSON[_0x5d53ec(0x1e8)](_0xcdbe51);if(typeof _0x397662['dbId']===_0x5d53ec(0x201)&&Number['isFinite'](_0x397662[_0x5d53ec(0x205)]))return{'dbId':_0x397662[_0x5d53ec(0x205)],'dbName':_0x397662[_0x5d53ec(0x1ea)]};}catch{}throw CliErrors[_0x5d53ec(0x1df)](_0x5d53ec(0x204)+_0xcdbe51);}function resolveProvidedDbId(_0x1d269a){const _0x3d304d=a185_0x3ba458,_0x354171=_0x1d269a[_0x3d304d(0x210)](_0x3d304d(0x1ef));if(typeof _0x354171==='number'&&Number[_0x3d304d(0x218)](_0x354171))return _0x354171;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a186_0x5b8031=a186_0x5146;(function(_0x1fcf61,_0x409e60){const _0x330a34=a186_0x5146,_0x3370dd=_0x1fcf61();while(!![]){try{const _0xf5bb4a=-parseInt(_0x330a34(0x1c1))/0x1+parseInt(_0x330a34(0x1c6))/0x2*(parseInt(_0x330a34(0x1b6))/0x3)+parseInt(_0x330a34(0x1d3))/0x4*(-parseInt(_0x330a34(0x1b4))/0x5)+-parseInt(_0x330a34(0x1ba))/0x6*(parseInt(_0x330a34(0x1b5))/0x7)+-parseInt(_0x330a34(0x1cc))/0x8*(-parseInt(_0x330a34(0x1b1))/0x9)+parseInt(_0x330a34(0x1c4))/0xa+-parseInt(_0x330a34(0x1be))/0xb*(-parseInt(_0x330a34(0x1bb))/0xc);if(_0xf5bb4a===_0x409e60)break;else _0x3370dd['push'](_0x3370dd['shift']());}catch(_0x2d9055){_0x3370dd['push'](_0x3370dd['shift']());}}}(a186_0x2e35,0x76814));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a186_0x5146(_0xd15005,_0x514d83){_0xd15005=_0xd15005-0x1b0;const _0x2e35d1=a186_0x2e35();let _0x51466d=_0x2e35d1[_0xd15005];return _0x51466d;}export const sqlDelete={'service':'sql','command':a186_0x5b8031(0x1b2),'description':a186_0x5b8031(0x1d0),'risk':a186_0x5b8031(0x1bd),'flags':[SQLCODE_FLAG],async 'validate'(_0x10dd54){const _0x39c63a=a186_0x5b8031,_0x316d0b=loadSqlProjectConfig(_0x10dd54[_0x39c63a(0x1cb)]),_0x23956e=await readSqlLockFile(_0x316d0b[_0x39c63a(0x1d2)]);if(!_0x23956e)throw CliErrors[_0x39c63a(0x1c3)](_0x39c63a(0x1cf));},async 'dryRun'(_0x408f55){const _0x205f00=a186_0x5b8031,_0x1cccc0=loadSqlProjectConfig(_0x408f55[_0x205f00(0x1cb)]),_0x5c05bf=await readSqlLockFile(_0x1cccc0['lockFilePath']);if(!_0x5c05bf)throw CliErrors[_0x205f00(0x1c3)](_0x205f00(0x1cf));const {appLock:_0xe053e2}=ensureSqlLockScope(_0x5c05bf,_0x408f55[_0x205f00(0x1cb)],_0x1cccc0[_0x205f00(0x1b3)],'delete'),_0xae91ab=_0x408f55[_0x205f00(0x1cd)](_0x205f00(0x1b9)),_0x557314=_0xe053e2['sqls'][_0xae91ab];if(!_0x557314)throw CliErrors[_0x205f00(0x1c3)](_0x205f00(0x1c2)+_0xae91ab+'\x22.');return{'method':'POST','url':_0x205f00(0x1ca),'body':{'sqlCode':_0xae91ab,'id':_0x557314[_0x205f00(0x1c0)],'localPath':resolveLocalSqlFilePath(_0x1cccc0,_0xae91ab,_0x557314)},'description':_0x205f00(0x1bf)+_0xae91ab+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x1cccc0[_0x205f00(0x1d1)]};},async 'execute'(_0x4b6d8d){const _0x3408a1=a186_0x5b8031,_0x23e118=loadSqlProjectConfig(_0x4b6d8d[_0x3408a1(0x1cb)]),_0x1194a2=await readSqlLockFile(_0x23e118[_0x3408a1(0x1d2)]);if(!_0x1194a2)throw CliErrors[_0x3408a1(0x1c3)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x426696,appLock:_0x12f1c3}=ensureSqlLockScope(_0x1194a2,_0x4b6d8d[_0x3408a1(0x1cb)],_0x23e118['sqlRoot'],_0x3408a1(0x1b2)),_0x18a984=_0x4b6d8d['str'](_0x3408a1(0x1b9)),_0x171570=_0x12f1c3[_0x3408a1(0x1b7)][_0x18a984];if(!_0x171570)throw CliErrors[_0x3408a1(0x1c3)](_0x3408a1(0x1c2)+_0x18a984+'\x22.');await deleteSqlQuery({'id':_0x171570[_0x3408a1(0x1c0)],'sqlCode':_0x18a984}),_0x12f1c3[_0x3408a1(0x1b7)]=Object[_0x3408a1(0x1d4)](Object['entries'](_0x12f1c3[_0x3408a1(0x1b7)])[_0x3408a1(0x1c7)](([_0x149fda])=>_0x149fda!==_0x18a984)),_0x12f1c3[_0x3408a1(0x1c5)]=new Date()[_0x3408a1(0x1c9)](),await writeSqlLockFile(_0x23e118[_0x3408a1(0x1d2)],_0x426696);const _0xa6ccee=resolveLocalSqlFilePath(_0x23e118,_0x18a984,_0x171570);let _0x1732d7;await fileExists(_0xa6ccee)&&(_0x1732d7=await moveToTrash(_0x23e118[_0x3408a1(0x1bc)],_0x23e118[_0x3408a1(0x1d1)],_0xa6ccee),await cleanupEmptyDirectories(dirname(_0xa6ccee),_0x23e118[_0x3408a1(0x1c8)]));const _0x306c75={'deleted':_0x18a984,'remoteId':_0x171570[_0x3408a1(0x1c0)]};if(_0x1732d7)_0x306c75['trashedTo']=_0x1732d7;return{'ok':!![],'data':_0x306c75,'message':'Deleted\x20'+_0x18a984+(_0x1732d7?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a186_0x2e35(){const _0x32b79a=['lockFilePath','410556uVqEOK','fromEntries','length','1336194VYtZRb','delete','sqlRoot','5cORZCI','105nqQewd','312777wHsqos','sqls','startsWith','sqlcode','426LkIhox','2710788QTrTQk','projectRoot','high-risk-write','11GoZtFe','Would\x20delete\x20SQL\x20','remoteId','468652LFBtqX','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','validation','3706100tHFuuv','lastSync','6zatpfM','filter','sqlRootDir','toISOString','/smartapi/custom/deleteUserCustomSql','appCode','8TragSK','str','replace','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','trashDir'];a186_0x2e35=function(){return _0x32b79a;};return a186_0x2e35();}async function moveToTrash(_0x2c68cd,_0x29528e,_0x54ccbc){const _0x13c7bd=a186_0x5b8031,_0x4a8929=new Date()['toISOString']()[_0x13c7bd(0x1ce)](/[:.]/g,'-'),_0x30d53b=relative(_0x2c68cd,_0x54ccbc),_0x5482fa=join(_0x29528e,_0x4a8929,_0x30d53b);return await mkdir(dirname(_0x5482fa),{'recursive':!![]}),await rename(_0x54ccbc,_0x5482fa),_0x5482fa;}async function cleanupEmptyDirectories(_0xa660f7,_0x1dc4d6){const _0x14e8c2=a186_0x5b8031;let _0x1e498d=resolve(_0xa660f7);const _0x579a7a=resolve(_0x1dc4d6);while(_0x1e498d[_0x14e8c2(0x1b8)](''+_0x579a7a+sep)||_0x1e498d===_0x579a7a){if(_0x1e498d===_0x579a7a)return;try{const _0x1467d2=await readdir(_0x1e498d);if(_0x1467d2[_0x14e8c2(0x1b0)]>0x0)return;await rmdir(_0x1e498d);}catch{return;}_0x1e498d=dirname(_0x1e498d);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a187_0x457a9b=a187_0xc4ae;(function(_0x4c51d5,_0x2c451c){const _0x54efc7=a187_0xc4ae,_0x572a1b=_0x4c51d5();while(!![]){try{const _0x25d9d6=-parseInt(_0x54efc7(0x91))/0x1+parseInt(_0x54efc7(0x7e))/0x2*(-parseInt(_0x54efc7(0x81))/0x3)+parseInt(_0x54efc7(0x85))/0x4*(-parseInt(_0x54efc7(0x8f))/0x5)+-parseInt(_0x54efc7(0x83))/0x6*(-parseInt(_0x54efc7(0x82))/0x7)+-parseInt(_0x54efc7(0x90))/0x8+parseInt(_0x54efc7(0x89))/0x9*(-parseInt(_0x54efc7(0x7c))/0xa)+parseInt(_0x54efc7(0x80))/0xb;if(_0x25d9d6===_0x2c451c)break;else _0x572a1b['push'](_0x572a1b['shift']());}catch(_0x2854bb){_0x572a1b['push'](_0x572a1b['shift']());}}}(a187_0x2b89,0xb252a));import{getSqlQueryInfo}from'../../core/api-client.js';function a187_0x2b89(){const _0x332ad5=['42zxwjAF','788064aUTSyt','sql','324kSbzrw','description','boolean','dbId','5319DiYsAQ','verbose','appCode','sqlcode','read','str','8535HFayef','10861856uBGgKR','969861BoGMxq','21910ygfGMD','sqlName','4EwTwMf','bool','43345247vPOalc','356085WBGLvH'];a187_0x2b89=function(){return _0x332ad5;};return a187_0x2b89();}import{getDbName}from'../../core/db-resolver.js';function a187_0xc4ae(_0x249b8a,_0x3ee58d){_0x249b8a=_0x249b8a-0x7c;const _0x2b89a7=a187_0x2b89();let _0xc4aed2=_0x2b89a7[_0x249b8a];return _0xc4aed2;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a187_0x457a9b(0x84),'command':'detail','description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a187_0x457a9b(0x8d),'flags':[SQLCODE_FLAG,{'name':a187_0x457a9b(0x8a),'type':a187_0x457a9b(0x87),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x2660dc){const _0x328240=a187_0x457a9b,_0x5c818f=await getSqlQueryInfo(_0x2660dc['appCode'],_0x2660dc[_0x328240(0x8e)](_0x328240(0x8c))),_0x3d04e4=_0x2660dc[_0x328240(0x7f)](_0x328240(0x8a));if(_0x3d04e4)return{'ok':!![],'data':_0x5c818f};const _0xbf1b41=_0x5c818f['dbId']?await getDbName(_0x2660dc[_0x328240(0x8b)],_0x5c818f[_0x328240(0x88)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x5c818f['sqlCode'],'sqlName':_0x5c818f[_0x328240(0x7d)],'db':_0xbf1b41?_0xbf1b41+'\x20('+_0x5c818f[_0x328240(0x88)]+')':_0x5c818f['dbId']??'','description':_0x5c818f[_0x328240(0x86)]??'','sqlContent':_0x5c818f['sqlContent']??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a188_0xf271f9=a188_0x2ed6;function a188_0x854f(){const _0x12c57e=['20RXOKXh','1078728qrsBds','appCode','sqlcode','now','309113HtYDrU','34893iAYfaA','params','7233974UimtkB','280wwrreJ','7302516FSpHhx','exec','290796bRTQtI','SQL\x20execution\x20failed','32vGvSQD','355890ueaoub','length','execResult','str','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','4CFZdxq','sql','execSuccess'];a188_0x854f=function(){return _0x12c57e;};return a188_0x854f();}(function(_0x48e356,_0x5d2e41){const _0x18c7a7=a188_0x2ed6,_0x13bb4f=_0x48e356();while(!![]){try{const _0x525c33=parseInt(_0x18c7a7(0x1ad))/0x1+parseInt(_0x18c7a7(0x1a9))/0x2*(-parseInt(_0x18c7a7(0x1a4))/0x3)+parseInt(_0x18c7a7(0x1a1))/0x4*(parseInt(_0x18c7a7(0x1ac))/0x5)+-parseInt(_0x18c7a7(0x1b6))/0x6+-parseInt(_0x18c7a7(0x1b1))/0x7*(-parseInt(_0x18c7a7(0x1a3))/0x8)+-parseInt(_0x18c7a7(0x1b2))/0x9*(parseInt(_0x18c7a7(0x1b5))/0xa)+parseInt(_0x18c7a7(0x1b4))/0xb;if(_0x525c33===_0x5d2e41)break;else _0x13bb4f['push'](_0x13bb4f['shift']());}catch(_0x431f75){_0x13bb4f['push'](_0x13bb4f['shift']());}}}(a188_0x854f,0x9c77c));function a188_0x2ed6(_0x512489,_0x9c8327){_0x512489=_0x512489-0x1a1;const _0x854f51=a188_0x854f();let _0x2ed67e=_0x854f51[_0x512489];return _0x2ed67e;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a188_0xf271f9(0x1aa),'command':a188_0xf271f9(0x1b7),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a188_0xf271f9(0x1b3),'type':'string','description':a188_0xf271f9(0x1a8)}],async 'execute'(_0x50ae3d){const _0xd3e92a=a188_0xf271f9,_0x3572b5=parseJsonParams(_0x50ae3d[_0xd3e92a(0x1a7)](_0xd3e92a(0x1b3))),_0x579c9c=Date[_0xd3e92a(0x1b0)](),_0x8cb23=await executeSql(_0x50ae3d[_0xd3e92a(0x1ae)],_0x50ae3d[_0xd3e92a(0x1a7)](_0xd3e92a(0x1af)),_0x3572b5),_0x1da2af=Date[_0xd3e92a(0x1b0)]()-_0x579c9c,_0x403a9d=_0x8cb23?.[_0xd3e92a(0x1a6)]??_0x8cb23,_0x160b81=_0x8cb23?.[_0xd3e92a(0x1ab)]??!![];if(!_0x160b81)return{'ok':![],'data':{'error':_0x8cb23?.['execError']||_0xd3e92a(0x1a2),'elapsed':_0x1da2af},'message':_0xd3e92a(0x1a2)};const _0x127ff5=Array['isArray'](_0x403a9d)?_0x403a9d:[];return{'ok':!![],'data':{'rows':_0x127ff5,'rowCount':_0x127ff5['length'],'elapsed':_0x1da2af},'message':'Returned\x20'+_0x127ff5[_0xd3e92a(0x1a5)]+'\x20row(s)\x20in\x20'+_0x1da2af+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ee798,_0x4a75c8){const _0x1589d7=a189_0xf29d,_0x145f58=_0x3ee798();while(!![]){try{const _0xa89f0a=-parseInt(_0x1589d7(0x10d))/0x1*(parseInt(_0x1589d7(0x108))/0x2)+-parseInt(_0x1589d7(0x10f))/0x3*(parseInt(_0x1589d7(0x109))/0x4)+-parseInt(_0x1589d7(0x10e))/0x5*(parseInt(_0x1589d7(0x10a))/0x6)+parseInt(_0x1589d7(0x10c))/0x7+parseInt(_0x1589d7(0x105))/0x8+parseInt(_0x1589d7(0x107))/0x9*(-parseInt(_0x1589d7(0x110))/0xa)+-parseInt(_0x1589d7(0x106))/0xb*(-parseInt(_0x1589d7(0x10b))/0xc);if(_0xa89f0a===_0x4a75c8)break;else _0x145f58['push'](_0x145f58['shift']());}catch(_0xcfccf3){_0x145f58['push'](_0x145f58['shift']());}}}(a189_0x4453,0xaf158));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a189_0xf29d(_0x26680a,_0x21d632){_0x26680a=_0x26680a-0x105;const _0x4453c8=a189_0x4453();let _0xf29d3b=_0x4453c8[_0x26680a];return _0xf29d3b;}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';function a189_0x4453(){const _0x53c022=['27avxLeC','1876pfCEsm','1972XXqbBS','1764qvYjrt','222948wwGawV','297339MZsIxq','601uxpJoQ','17865UBdMPk','939MgKhFN','2468710UVgJXG','8377632xrNvTi','1265mrPIGw'];a189_0x4453=function(){return _0x53c022;};return a189_0x4453();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a190_0x2e0e91=a190_0x54f7;(function(_0x6e5085,_0x50345c){const _0x2b2447=a190_0x54f7,_0x1300a4=_0x6e5085();while(!![]){try{const _0x482153=parseInt(_0x2b2447(0x1bf))/0x1*(-parseInt(_0x2b2447(0x1cf))/0x2)+-parseInt(_0x2b2447(0x1ca))/0x3*(parseInt(_0x2b2447(0x1cd))/0x4)+parseInt(_0x2b2447(0x1c5))/0x5+parseInt(_0x2b2447(0x1d4))/0x6*(-parseInt(_0x2b2447(0x1c9))/0x7)+-parseInt(_0x2b2447(0x1c1))/0x8+-parseInt(_0x2b2447(0x1be))/0x9*(-parseInt(_0x2b2447(0x1c4))/0xa)+-parseInt(_0x2b2447(0x1df))/0xb*(parseInt(_0x2b2447(0x1e1))/0xc);if(_0x482153===_0x50345c)break;else _0x1300a4['push'](_0x1300a4['shift']());}catch(_0xa15303){_0x1300a4['push'](_0x1300a4['shift']());}}}(a190_0x5146,0x1c479));import{listSqlQueries}from'../../core/api-client.js';function a190_0x54f7(_0x16500d,_0x26654d){_0x16500d=_0x16500d-0x1bd;const _0x514665=a190_0x5146();let _0x54f701=_0x514665[_0x16500d];return _0x54f701;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a190_0x2e0e91(0x1dc),'command':a190_0x2e0e91(0x1d6),'description':a190_0x2e0e91(0x1da),'risk':a190_0x2e0e91(0x1d3),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0x2e0e91(0x1c7),'type':a190_0x2e0e91(0x1e4),'description':'Filter\x20by\x20SQL\x20name'},{'name':'page','type':a190_0x2e0e91(0x1d5),'description':a190_0x2e0e91(0x1cb),'default':0x1},{'name':a190_0x2e0e91(0x1bd),'type':'number','description':a190_0x2e0e91(0x1c6)},{'name':a190_0x2e0e91(0x1d9),'type':a190_0x2e0e91(0x1ce),'description':a190_0x2e0e91(0x1c2)}],async 'execute'(_0x43344b){const _0x48e292=a190_0x2e0e91,_0x54b3e9=await listSqlQueries(_0x43344b['appCode'],{'sqlCode':_0x43344b[_0x48e292(0x1c0)]('sqlcode')||undefined,'sqlName':_0x43344b[_0x48e292(0x1c0)](_0x48e292(0x1c7))||undefined,'currentPage':_0x43344b[_0x48e292(0x1d8)](_0x48e292(0x1dd)),'pageSize':_0x43344b[_0x48e292(0x1d8)]('pagesize',0x32)}),_0x32df52=_0x43344b[_0x48e292(0x1e0)](_0x48e292(0x1d9)),_0x52d702=_0x54b3e9[_0x48e292(0x1d0)]??[],_0x32b2b1=_0x54b3e9[_0x48e292(0x1cc)]?.[_0x48e292(0x1db)]??_0x52d702[_0x48e292(0x1d1)];let _0x5783e0;return _0x32df52?_0x5783e0=_0x52d702:_0x5783e0=await Promise['all'](_0x52d702[_0x48e292(0x1d2)](async _0x23f4fd=>{const _0x5bf1a1=_0x48e292;let _0x4ce53e;try{_0x4ce53e=_0x23f4fd[_0x5bf1a1(0x1de)]?await getDbName(_0x43344b['appCode'],_0x23f4fd['dbId']):undefined;}catch{}return{'sqlCode':_0x23f4fd[_0x5bf1a1(0x1d7)],'sqlName':_0x23f4fd[_0x5bf1a1(0x1e2)],'description':_0x23f4fd[_0x5bf1a1(0x1c8)]??'','db':_0x4ce53e?_0x4ce53e+'\x20('+_0x23f4fd[_0x5bf1a1(0x1de)]+')':_0x23f4fd['dbId']??''};})),{'ok':!![],'data':_0x5783e0,'message':_0x52d702['length']===0x0?_0x48e292(0x1c3):'Found\x20'+_0x52d702[_0x48e292(0x1d1)]+_0x48e292(0x1e3)+_0x32b2b1+').'};}};function a190_0x5146(){const _0x29e0d6=['60rhcIqu','sqlName','\x20SQL\x20queries\x20(total:\x20','string','pagesize','216513FgjVZv','3739pwofJe','str','185016FnPHFj','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','No\x20custom\x20SQL\x20queries\x20found.','90howSxp','1058960tTYYBi','Page\x20size','name','description','14KSZYmd','3zWRKNN','Page\x20number','paging','528764QiUGhc','boolean','58GHdvKR','tableData','length','map','read','5724pCgIHM','number','list','sqlCode','num','verbose','List\x20custom\x20SQL\x20queries','totalCount','sql','page','dbId','102993NYzlWb','bool'];a190_0x5146=function(){return _0x29e0d6;};return a190_0x5146();}
|