@lovrabet/rabetbase-cli 2.5.1-beta.6 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/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-restore.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/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.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/domain-routing-sync.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/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.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/deployment-sync.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.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/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x46654c=a185_0x3c65;(function(_0x23953a,_0x1f6671){const _0x7a1144=a185_0x3c65,_0x461f69=_0x23953a();while(!![]){try{const _0x272611=-parseInt(_0x7a1144(0xb1))/0x1+parseInt(_0x7a1144(0xac))/0x2+parseInt(_0x7a1144(0xb3))/0x3+parseInt(_0x7a1144(0xaa))/0x4*(parseInt(_0x7a1144(0xad))/0x5)+-parseInt(_0x7a1144(0xb5))/0x6*(parseInt(_0x7a1144(0xb9))/0x7)+-parseInt(_0x7a1144(0xb8))/0x8*(-parseInt(_0x7a1144(0xae))/0x9)+parseInt(_0x7a1144(0xba))/0xa*(-parseInt(_0x7a1144(0xab))/0xb);if(_0x272611===_0x1f6671)break;else _0x461f69['push'](_0x461f69['shift']());}catch(_0x1fc132){_0x461f69['push'](_0x461f69['shift']());}}}(a185_0x2e1d,0xad4ea));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a185_0x3c65(_0x5165b4,_0x409f28){_0x5165b4=_0x5165b4-0xaa;const _0x2e1de6=a185_0x2e1d();let _0x3c65e1=_0x2e1de6[_0x5165b4];return _0x3c65e1;}const UPDATE_PATH=a185_0x46654c(0xbd);function readPatch(_0x1d41a8){const _0x252f0f=a185_0x46654c,_0x1e5b2b=_0x1d41a8[_0x252f0f(0xc7)](_0x252f0f(0xc3)),_0x3b5b51=_0x1d41a8['flag']('remark'),_0x43f3bc={};if(_0x1e5b2b!==undefined&&_0x1e5b2b!==null){const _0x538c3f=String(_0x1e5b2b)['trim']();if(!_0x538c3f)throw CliErrors[_0x252f0f(0xaf)](_0x252f0f(0xbc));if(_0x538c3f[_0x252f0f(0xb2)]>0x40)throw CliErrors[_0x252f0f(0xaf)](_0x252f0f(0xc4));_0x43f3bc[_0x252f0f(0xbe)]=_0x538c3f;}_0x3b5b51!==undefined&&_0x3b5b51!==null&&(_0x43f3bc[_0x252f0f(0xb7)]=String(_0x3b5b51));if(_0x43f3bc[_0x252f0f(0xbe)]===undefined&&_0x43f3bc[_0x252f0f(0xb7)]===undefined)throw CliErrors[_0x252f0f(0xaf)](_0x252f0f(0xc0),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x43f3bc;}export const roleUpdate={'service':a185_0x46654c(0xc5),'command':a185_0x46654c(0xc1),'description':a185_0x46654c(0xc6),'risk':a185_0x46654c(0xc8),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a185_0x46654c(0xc3),'type':a185_0x46654c(0xb0),'required':![],'description':a185_0x46654c(0xbb)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x24aaba){readPatch(_0x24aaba);},async 'dryRun'(_0x2b007f){const _0x407205=a185_0x46654c,_0x401679=_0x2b007f[_0x407205(0xc9)]('id'),_0x1d69ca=readPatch(_0x2b007f),_0xf883b9=await getRoleById(_0x2b007f[_0x407205(0xb4)],_0x401679);return assertCustomRole(_0xf883b9,_0x407205(0xc1)),asDryRunResult({'scope':_0x407205(0xbf),'operation':_0x407205(0xc1),'selector':{'appCode':_0x2b007f[_0x407205(0xb4)],'roleId':_0x401679,'roleName':_0xf883b9['roleName']},'before':projectRole(_0xf883b9),'after':projectRole({..._0xf883b9,..._0x1d69ca[_0x407205(0xbe)]!==undefined?{'roleName':_0x1d69ca[_0x407205(0xbe)]}:{},..._0x1d69ca[_0x407205(0xb7)]!==undefined?{'remark':_0x1d69ca[_0x407205(0xb7)]}:{}}),'dryRun':!![],'backend':{'method':_0x407205(0xc2),'path':UPDATE_PATH},'warnings':[]},{'method':_0x407205(0xc2),'url':UPDATE_PATH});},async 'execute'(_0x19a2a4){const _0x3b1791=a185_0x46654c,_0x4eb179=_0x19a2a4[_0x3b1791(0xc9)]('id'),_0x12923c=readPatch(_0x19a2a4),_0x497d04=await getRoleById(_0x19a2a4[_0x3b1791(0xb4)],_0x4eb179);assertCustomRole(_0x497d04,_0x3b1791(0xc1)),await updateAppRole({'id':_0x4eb179,'appCode':_0x19a2a4[_0x3b1791(0xb4)],..._0x12923c[_0x3b1791(0xbe)]!==undefined?{'roleName':_0x12923c[_0x3b1791(0xbe)]}:{},..._0x12923c[_0x3b1791(0xb7)]!==undefined?{'remark':_0x12923c['remark']}:{}});const _0x5f4f74=await getRoleById(_0x19a2a4[_0x3b1791(0xb4)],_0x4eb179);return{'ok':!![],'data':{'scope':_0x3b1791(0xbf),'operation':_0x3b1791(0xc1),'selector':{'appCode':_0x19a2a4[_0x3b1791(0xb4)],'roleId':_0x4eb179,'roleName':_0x5f4f74[_0x3b1791(0xbe)]},'before':projectRole(_0x497d04),'after':projectRole(_0x5f4f74),'dryRun':![],'backend':{'method':_0x3b1791(0xc2),'path':UPDATE_PATH},'warnings':[]},'message':_0x3b1791(0xb6)+_0x5f4f74[_0x3b1791(0xbe)]+'\x20(id='+_0x4eb179+')'};}};function a185_0x2e1d(){const _0x2f64ed=['2166270yORDrC','355eogFKo','153kHVjtX','validation','string','236565danLRM','length','177885CYptsB','appCode','5988882lHPAGf','Updated\x20role\x20','remark','187424vTFPhZ','7tKXykR','380fJMzzq','New\x20role\x20name','--name\x20cannot\x20be\x20empty.','/smartapi/permit/role/update','roleName','dev','Nothing\x20to\x20update.','update','POST','name','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','role','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','flag','write','num','27080rnoOKi','22231DzHvgk'];a185_0x2e1d=function(){return _0x2f64ed;};return a185_0x2e1d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a186_0x990c(){const _0x149630=['19925cHGFTp','username','354JwUBxE','user-add','role','133tmWPZB','10822ilwaCM','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','roleId','roleName','4FUJOTd','No\x20change:\x20user\x20','9277086ZzzfzL','appCode','11383520fPBOej','11Iiqcil','selector','29597550IXTaMY','1839888mYaWuM','high-risk-write','userId','roleType','\x20to\x20role\x20','\x20already\x20in\x20role\x20','2774667DPLega'];a186_0x990c=function(){return _0x149630;};return a186_0x990c();}const a186_0x247942=a186_0x262b;(function(_0x24764a,_0x3f5eb5){const _0x2ab184=a186_0x262b,_0x4c179b=_0x24764a();while(!![]){try{const _0x37ff02=parseInt(_0x2ab184(0xf8))/0x1*(-parseInt(_0x2ab184(0xf9))/0x2)+parseInt(_0x2ab184(0xf2))/0x3*(parseInt(_0x2ab184(0xe4))/0x4)+parseInt(_0x2ab184(0xf3))/0x5*(parseInt(_0x2ab184(0xf5))/0x6)+-parseInt(_0x2ab184(0xe6))/0x7+-parseInt(_0x2ab184(0xe8))/0x8+parseInt(_0x2ab184(0xec))/0x9+-parseInt(_0x2ab184(0xeb))/0xa*(-parseInt(_0x2ab184(0xe9))/0xb);if(_0x37ff02===_0x3f5eb5)break;else _0x4c179b['push'](_0x4c179b['shift']());}catch(_0x312cc8){_0x4c179b['push'](_0x4c179b['shift']());}}}(a186_0x990c,0xd10e2));import{createDevUserRole}from'../../core/api-client.js';function a186_0x262b(_0x1babf6,_0x394797){_0x1babf6=_0x1babf6-0xe2;const _0x990c63=a186_0x990c();let _0x262b8c=_0x990c63[_0x1babf6];return _0x262b8c;}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';export const roleUserAdd={'service':a186_0x247942(0xf7),'command':a186_0x247942(0xf6),'description':a186_0x247942(0xfa),'risk':a186_0x247942(0xed),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xe42b35){const _0x4f4470=a186_0x247942,{mutation:_0x18d65f}=await prepareUserMutation(_0xe42b35,_0x4f4470(0xf6),!![]);return asDryRunResult(_0x18d65f,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x3f7d75){const _0x547ce8=a186_0x247942,{mutation:_0x5c3561,changed:_0x4b9731,role:_0x2d55c5,user:_0x5befff}=await prepareUserMutation(_0x3f7d75,_0x547ce8(0xf6),![]);return _0x4b9731&&await createDevUserRole({'appCode':_0x3f7d75[_0x547ce8(0xe7)],'userId':_0x5befff[_0x547ce8(0xee)],'username':_0x5befff[_0x547ce8(0xf4)],'roleType':_0x2d55c5[_0x547ce8(0xef)],'roleId':_0x5c3561['selector'][_0x547ce8(0xe2)]}),{'ok':!![],'data':_0x5c3561,'message':_0x4b9731?'Added\x20user\x20'+_0x5c3561[_0x547ce8(0xea)]['userId']+_0x547ce8(0xf0)+_0x5c3561[_0x547ce8(0xea)][_0x547ce8(0xe3)]:_0x547ce8(0xe5)+_0x5c3561[_0x547ce8(0xea)][_0x547ce8(0xee)]+_0x547ce8(0xf1)+_0x5c3561[_0x547ce8(0xea)][_0x547ce8(0xe3)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a187_0x1f5916=a187_0x3c02;(function(_0x5a55b6,_0x5a3dfb){const _0x2906f9=a187_0x3c02,_0x381d70=_0x5a55b6();while(!![]){try{const _0x550b30=parseInt(_0x2906f9(0x161))/0x1+-parseInt(_0x2906f9(0x164))/0x2+-parseInt(_0x2906f9(0x166))/0x3*(-parseInt(_0x2906f9(0x167))/0x4)+parseInt(_0x2906f9(0x159))/0x5+parseInt(_0x2906f9(0x15e))/0x6*(-parseInt(_0x2906f9(0x15c))/0x7)+parseInt(_0x2906f9(0x168))/0x8+parseInt(_0x2906f9(0x15b))/0x9;if(_0x550b30===_0x5a3dfb)break;else _0x381d70['push'](_0x381d70['shift']());}catch(_0x32669f){_0x381d70['push'](_0x381d70['shift']());}}}(a187_0x3af9,0x52641));import{deleteDevUserRole}from'../../core/api-client.js';function a187_0x3af9(){const _0x148692=['Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','userId','97411kjYRvP','user-remove','Removed\x20user\x20','437146TlNRfT','\x20from\x20role\x20','1083279JYrzNd','4IukTdG','1049200qYQVKT','selector','No\x20change:\x20user\x20','high-risk-write','1051885Bgddlw','POST','2279043MSwSbj','870121RYTzuK','roleName','24QGweuy'];a187_0x3af9=function(){return _0x148692;};return a187_0x3af9();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x3c02(_0x2cd90d,_0x2f8f7b){_0x2cd90d=_0x2cd90d-0x156;const _0x3af9fb=a187_0x3af9();let _0x3c0260=_0x3af9fb[_0x2cd90d];return _0x3c0260;}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':'role','command':a187_0x1f5916(0x162),'description':a187_0x1f5916(0x15f),'risk':a187_0x1f5916(0x158),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x136608){const _0xbf4b5b=a187_0x1f5916,{mutation:_0x3f70b2}=await prepareUserMutation(_0x136608,_0xbf4b5b(0x162),!![]);return asDryRunResult(_0x3f70b2,{'method':_0xbf4b5b(0x15a),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x2e36ad){const _0x3a88a2=a187_0x1f5916,{matchingRelationIds:_0x11ac71,mutation:_0x4d6e4d,changed:_0x3c16ec}=await prepareUserMutation(_0x2e36ad,_0x3a88a2(0x162),![]);if(_0x3c16ec)for(const _0x3c2953 of _0x11ac71){await deleteDevUserRole(_0x3c2953);}return{'ok':!![],'data':_0x4d6e4d,'message':_0x3c16ec?_0x3a88a2(0x163)+_0x4d6e4d['selector']['userId']+_0x3a88a2(0x165)+_0x4d6e4d[_0x3a88a2(0x156)][_0x3a88a2(0x15d)]:_0x3a88a2(0x157)+_0x4d6e4d[_0x3a88a2(0x156)][_0x3a88a2(0x160)]+'\x20not\x20in\x20role\x20'+_0x4d6e4d[_0x3a88a2(0x156)][_0x3a88a2(0x15d)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x32bf13=a188_0xf4cc;function a188_0xf4cc(_0x529818,_0x4a97bf){_0x529818=_0x529818-0x166;const _0x180b57=a188_0x180b();let _0xf4cc60=_0x180b57[_0x529818];return _0xf4cc60;}(function(_0x4c80c3,_0xb497ba){const _0x19093e=a188_0xf4cc,_0x40aecf=_0x4c80c3();while(!![]){try{const _0x2030ad=-parseInt(_0x19093e(0x171))/0x1*(parseInt(_0x19093e(0x172))/0x2)+-parseInt(_0x19093e(0x168))/0x3*(parseInt(_0x19093e(0x178))/0x4)+-parseInt(_0x19093e(0x16d))/0x5+parseInt(_0x19093e(0x166))/0x6+-parseInt(_0x19093e(0x167))/0x7+-parseInt(_0x19093e(0x174))/0x8+parseInt(_0x19093e(0x177))/0x9;if(_0x2030ad===_0xb497ba)break;else _0x40aecf['push'](_0x40aecf['shift']());}catch(_0x2a8b4f){_0x40aecf['push'](_0x40aecf['shift']());}}}(a188_0x180b,0x734ed));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a188_0x180b(){const _0xb0ad81=['username','1855215EjIAws','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','trim','Resolved\x20\x22','580434WddVUl','2XBNGkw','flagMissing','271352NLKCwl','matchedBy','Pass\x20--name\x20<nickname|username>.','18676746iXRxeM','2134780CopYhD','name','\x22\x20→\x20userId\x20','str','2358840lcdAce','3338594VIVsdU','3kNqHxc','userId','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','nickname'];a188_0x180b=function(){return _0xb0ad81;};return a188_0x180b();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':'user-resolve','description':a188_0x32bf13(0x16a),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x36a574){const _0x306c21=a188_0x32bf13;if(!_0x36a574[_0x306c21(0x17b)](_0x306c21(0x179))[_0x306c21(0x16f)]())throw CliErrors[_0x306c21(0x173)](_0x306c21(0x179),_0x306c21(0x176));},async 'execute'(_0x1c03ab){const _0x3df888=a188_0x32bf13,_0x5247e5=_0x1c03ab['str'](_0x3df888(0x179))['trim'](),_0x4cd8d8=await resolveUserRef(_0x5247e5,_0x3df888(0x16e));return{'ok':!![],'data':{'user':{'userId':_0x4cd8d8[_0x3df888(0x169)],'username':_0x4cd8d8[_0x3df888(0x16c)],'nickname':_0x4cd8d8[_0x3df888(0x16b)],'matchedBy':_0x4cd8d8[_0x3df888(0x175)]}},'message':_0x3df888(0x170)+_0x5247e5+_0x3df888(0x17a)+_0x4cd8d8[_0x3df888(0x169)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a189_0x116181=a189_0x1187;function a189_0x1187(_0x3c46cb,_0x5186e3){_0x3c46cb=_0x3c46cb-0x151;const _0x4b97df=a189_0x4b97();let _0x118774=_0x4b97df[_0x3c46cb];return _0x118774;}(function(_0x1f8068,_0x318caf){const _0x374218=a189_0x1187,_0x429771=_0x1f8068();while(!![]){try{const _0x49e2d8=-parseInt(_0x374218(0x165))/0x1+-parseInt(_0x374218(0x15c))/0x2+parseInt(_0x374218(0x160))/0x3*(-parseInt(_0x374218(0x161))/0x4)+parseInt(_0x374218(0x163))/0x5*(parseInt(_0x374218(0x155))/0x6)+-parseInt(_0x374218(0x15d))/0x7*(-parseInt(_0x374218(0x162))/0x8)+parseInt(_0x374218(0x157))/0x9*(-parseInt(_0x374218(0x164))/0xa)+-parseInt(_0x374218(0x15b))/0xb*(-parseInt(_0x374218(0x158))/0xc);if(_0x49e2d8===_0x318caf)break;else _0x429771['push'](_0x429771['shift']());}catch(_0x31ff43){_0x429771['push'](_0x429771['shift']());}}}(a189_0x4b97,0xd1a0f));function a189_0x4b97(){const _0x4c4732=['read','80361VnVoQM','30516gdNVAB','get','cookie','13541KimJxo','1001730trwdCV','4493167UWqUOm','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','68322zSfmqT','88wCpzhN','8swpVfn','10venTuw','1070czRySk','987947mMjyQJ','\x20is\x20not\x20configured\x20for\x20app\x20','\x20for\x20','content','appCode','\x20--file\x20<path>\x20--dry-run`.','94704THtUWZ'];a189_0x4b97=function(){return _0x4c4732;};return a189_0x4b97();}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':'rule','command':a189_0x116181(0x159),'description':a189_0x116181(0x15e),'risk':a189_0x116181(0x156),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x278a45){readAppRuleType(_0x278a45);},async 'execute'(_0x507a72){const _0x56a1d2=a189_0x116181,_0x194db8=readAppRuleType(_0x507a72),_0x584fad=await getAppRule(_0x507a72[_0x56a1d2(0x15a)],{'appCode':_0x507a72[_0x56a1d2(0x153)],'type':_0x194db8});if(!_0x584fad)throw appRuleError('app_rule_not_found',appRuleFileName(_0x194db8)+_0x56a1d2(0x166)+_0x507a72[_0x56a1d2(0x153)]+'.',_0x56a1d2(0x15f)+_0x194db8+_0x56a1d2(0x154));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x194db8,_0x584fad),'content':_0x584fad[_0x56a1d2(0x152)]}},'message':'Loaded\x20'+appRuleFileName(_0x194db8)+_0x56a1d2(0x151)+_0x507a72['appCode']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b6fc1,_0x28c7ff){const _0x3708a1=a190_0x5d5f,_0x3f0e01=_0x1b6fc1();while(!![]){try{const _0x3edfe4=parseInt(_0x3708a1(0x111))/0x1+parseInt(_0x3708a1(0x110))/0x2*(parseInt(_0x3708a1(0x112))/0x3)+parseInt(_0x3708a1(0x10d))/0x4+-parseInt(_0x3708a1(0x108))/0x5*(parseInt(_0x3708a1(0x10f))/0x6)+parseInt(_0x3708a1(0x10a))/0x7*(-parseInt(_0x3708a1(0x10b))/0x8)+-parseInt(_0x3708a1(0x10c))/0x9+parseInt(_0x3708a1(0x10e))/0xa*(parseInt(_0x3708a1(0x109))/0xb);if(_0x3edfe4===_0x28c7ff)break;else _0x3f0e01['push'](_0x3f0e01['shift']());}catch(_0x5dfeff){_0x3f0e01['push'](_0x3f0e01['shift']());}}}(a190_0x413b,0x6e8ed));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';function a190_0x5d5f(_0x4f21dc,_0x5dc6be){_0x4f21dc=_0x4f21dc-0x108;const _0x413b29=a190_0x413b();let _0x5d5fce=_0x413b29[_0x4f21dc];return _0x5d5fce;}function a190_0x413b(){const _0x535b07=['1168Fkckhb','2443680VLguvG','1977368Ongybn','10dLagaU','6000rtENak','2768ysldXJ','511179riqXNk','1182NeULtn','3475VkmlYb','762278Sadnyy','9625GsoGZw'];a190_0x413b=function(){return _0x535b07;};return a190_0x413b();}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a191_0x3ab631=a191_0x5219;(function(_0x11104b,_0x4af542){const _0xa75722=a191_0x5219,_0x4e802f=_0x11104b();while(!![]){try{const _0x5262fd=-parseInt(_0xa75722(0xa5))/0x1*(parseInt(_0xa75722(0x9a))/0x2)+-parseInt(_0xa75722(0x95))/0x3+-parseInt(_0xa75722(0xa0))/0x4*(parseInt(_0xa75722(0x96))/0x5)+-parseInt(_0xa75722(0xa3))/0x6+-parseInt(_0xa75722(0xa2))/0x7+-parseInt(_0xa75722(0x9d))/0x8+-parseInt(_0xa75722(0x9b))/0x9*(-parseInt(_0xa75722(0x9e))/0xa);if(_0x5262fd===_0x4af542)break;else _0x4e802f['push'](_0x4e802f['shift']());}catch(_0x379a15){_0x4e802f['push'](_0x4e802f['shift']());}}}(a191_0x5226,0x4e92a));import{getAppRule}from'../../core/api-client.js';function a191_0x5226(){const _0x8c8899=['read','map','1550pWHmtK','207suhUsr','length','4405128WeWbzh','1158520sEkSRa','all','88VVledk','appCode','598549ECCUxD','3238662DpfItI','cookie','697YtVkDU','584010qPdWNm','98180cgnXue','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app'];a191_0x5226=function(){return _0x8c8899;};return a191_0x5226();}function a191_0x5219(_0x18158d,_0x109d11){_0x18158d=_0x18158d-0x95;const _0x522626=a191_0x5226();let _0x521941=_0x522626[_0x18158d];return _0x521941;}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':'list','description':a191_0x3ab631(0x97),'risk':a191_0x3ab631(0x98),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x2260a3){const _0x1038ec=a191_0x3ab631,_0x2c359d=await Promise[_0x1038ec(0x9f)](APP_RULE_TYPES[_0x1038ec(0x99)](_0x290c43=>getAppRule(_0x2260a3[_0x1038ec(0xa4)],{'appCode':_0x2260a3[_0x1038ec(0xa1)],'type':_0x290c43}))),_0xf65e48=APP_RULE_TYPES['map']((_0x69fadc,_0x153fbc)=>projectAppRule(_0x69fadc,_0x2c359d[_0x153fbc]??null));return{'ok':!![],'data':{'total':_0xf65e48[_0x1038ec(0x9c)],'rules':_0xf65e48},'message':'Loaded\x20app\x20rule\x20configuration\x20for\x20'+_0x2260a3[_0x1038ec(0xa1)]};}};
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a192_0x4eb518=a192_0x2f79;(function(_0x1b69a8,_0x32da91){const _0x5b8640=a192_0x2f79,_0x3ae770=_0x1b69a8();while(!![]){try{const _0x27656d=parseInt(_0x5b8640(0x152))/0x1*(parseInt(_0x5b8640(0x14e))/0x2)+-parseInt(_0x5b8640(0x133))/0x3+parseInt(_0x5b8640(0x150))/0x4*(parseInt(_0x5b8640(0x140))/0x5)+-parseInt(_0x5b8640(0x13d))/0x6+-parseInt(_0x5b8640(0x139))/0x7*(parseInt(_0x5b8640(0x15c))/0x8)+-parseInt(_0x5b8640(0x147))/0x9+parseInt(_0x5b8640(0x142))/0xa;if(_0x27656d===_0x32da91)break;else _0x3ae770['push'](_0x3ae770['shift']());}catch(_0x1c5f17){_0x3ae770['push'](_0x3ae770['shift']());}}}(a192_0x4b63,0x97359));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function a192_0x4b63(){const _0x4da33f=['125839oKpVOK','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','byteSize',';\x20current\x20version\x20is\x20','content','app_rule_version_mismatch','app_rule_verification_failed','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Set\x20','\x20--format\x20compress','24xOgMip','isSafeInteger','set','POST','\x20could\x20not\x20be\x20verified.','planned','Pass\x20a\x20UTF-8\x20Markdown\x20file.','rules','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','appCode','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','/smartapi/knowledge-base/save','version','flag','cookie','The\x20set\x20request\x20was\x20sent,\x20but\x20','write','1385499KBdxXn','expectedVersion','beforeRecord','app_rule_expected_version_invalid','cause','str','719145XyhUeP','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','expected-version','file','6488208QdmlFW','before','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','813410dEJsXO','contentHash','29982980SrIxuL','input','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','rule','replacement','10742193pBlPEB','push','verified','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','Expected\x20','rabetbase\x20rule\x20get\x20--type\x20','app_rule_set_outcome_unknown','8CBPntA','app_rule_file_required','4TfJcMZ','type'];a192_0x4b63=function(){return _0x4da33f;};return a192_0x4b63();}const SAVE_PATH=a192_0x4eb518(0x12d),NON_ATOMIC_WARNING=a192_0x4eb518(0x166);function readSetInput(_0x5dc4f6){const _0x50cd89=a192_0x4eb518,_0x17993a=readAppRuleType(_0x5dc4f6),_0x3c03ed=_0x5dc4f6[_0x50cd89(0x138)](_0x50cd89(0x13c))['trim']();if(!_0x3c03ed)throw appRuleError(_0x50cd89(0x14f),'--file\x20is\x20required.',_0x50cd89(0x162));const _0x2a627c=_0x5dc4f6[_0x50cd89(0x12f)](_0x50cd89(0x13b));let _0x581a3c;if(_0x2a627c!==undefined){_0x581a3c=Number(_0x2a627c);if(!Number[_0x50cd89(0x15d)](_0x581a3c)||_0x581a3c<0x0)throw appRuleError(_0x50cd89(0x136),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x17993a,'file':_0x3c03ed,'expectedVersion':_0x581a3c};}async function prepareSet(_0x4f745d){const _0xb28f42=a192_0x4eb518,_0x2c9b9e=readSetInput(_0x4f745d),_0x392cf0=await readAppRuleFile(_0x2c9b9e[_0xb28f42(0x13c)]),_0x19d2e8=await getAppRule(_0x4f745d[_0xb28f42(0x130)],{'appCode':_0x4f745d[_0xb28f42(0x165)],'type':_0x2c9b9e[_0xb28f42(0x151)]});if(_0x2c9b9e[_0xb28f42(0x134)]!==undefined&&_0x19d2e8?.[_0xb28f42(0x12e)]!==_0x2c9b9e['expectedVersion'])throw appRuleError(_0xb28f42(0x157),appRuleFileName(_0x2c9b9e[_0xb28f42(0x151)])+'\x20version\x20changed\x20before\x20write.',_0xb28f42(0x14b)+_0x2c9b9e[_0xb28f42(0x134)]+_0xb28f42(0x155)+(_0x19d2e8?.['version']??'unconfigured')+_0xb28f42(0x164));return{'input':_0x2c9b9e,'replacement':_0x392cf0,'beforeRecord':_0x19d2e8,'before':projectAppRule(_0x2c9b9e[_0xb28f42(0x151)],_0x19d2e8),'planned':{'type':_0x2c9b9e[_0xb28f42(0x151)],'fileName':appRuleFileName(_0x2c9b9e[_0xb28f42(0x151)]),'contextScope':appRuleContextScope(_0x2c9b9e[_0xb28f42(0x151)]),'enabled':!![],'appCode':_0x4f745d[_0xb28f42(0x165)],'scope':'rules','contentByteSize':_0x392cf0[_0xb28f42(0x154)],'contentHash':_0x392cf0[_0xb28f42(0x141)]}};}function a192_0x2f79(_0x173f27,_0x12846d){_0x173f27=_0x173f27-0x12d;const _0x4b6311=a192_0x4b63();let _0x2f79a5=_0x4b6311[_0x173f27];return _0x2f79a5;}function warningsFor(_0x19ed90){return _0x19ed90===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a192_0x4eb518(0x145),'command':a192_0x4eb518(0x15e),'description':a192_0x4eb518(0x144),'risk':a192_0x4eb518(0x132),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':'string','required':!![],'description':a192_0x4eb518(0x13a)},{'name':a192_0x4eb518(0x13b),'type':'number','required':![],'description':a192_0x4eb518(0x153)}],async 'validate'(_0x1e7281){readSetInput(_0x1e7281);},async 'dryRun'(_0x3900dd){const _0x48b1b7=a192_0x4eb518,_0x1fcd9a=await prepareSet(_0x3900dd);return asDryRunResult({'operation':_0x48b1b7(0x15e),'selector':{'appCode':_0x3900dd[_0x48b1b7(0x165)],'scope':'rules','type':_0x1fcd9a[_0x48b1b7(0x143)]['type']},'before':_0x1fcd9a[_0x48b1b7(0x13e)],'after':_0x1fcd9a[_0x48b1b7(0x161)],'dryRun':!![],'backend':{'method':_0x48b1b7(0x15f),'path':SAVE_PATH},'warnings':warningsFor(_0x1fcd9a[_0x48b1b7(0x143)][_0x48b1b7(0x134)]),'verification':{'expectedVersion':_0x1fcd9a[_0x48b1b7(0x143)][_0x48b1b7(0x134)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x48b1b7(0x14c)+_0x1fcd9a[_0x48b1b7(0x143)][_0x48b1b7(0x151)]+'\x20--format\x20compress'}},{'method':_0x48b1b7(0x15f),'url':SAVE_PATH});},async 'execute'(_0x59d7a5){const _0x3fabd9=a192_0x4eb518,_0xe3de15=await prepareSet(_0x59d7a5);let _0x5a8829=![];try{await saveAppRule(_0x59d7a5['cookie'],{'appCode':_0x59d7a5[_0x3fabd9(0x165)],'type':_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)],'content':_0xe3de15[_0x3fabd9(0x146)]['content']});}catch(_0x5ab34b){if(!isPlatformTransportFailure(_0x5ab34b))throw _0x5ab34b;_0x5a8829=!![];}let _0x444f9b;try{_0x444f9b=await getAppRule(_0x59d7a5[_0x3fabd9(0x130)],{'appCode':_0x59d7a5[_0x3fabd9(0x165)],'type':_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)]});}catch(_0x443604){const _0x44eb6e=appRuleError(_0x5a8829?_0x3fabd9(0x14d):'app_rule_verification_unavailable',_0x3fabd9(0x131)+appRuleFileName(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)])+_0x3fabd9(0x160),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object['defineProperty'](_0x44eb6e,_0x3fabd9(0x137),{'value':_0x443604,'enumerable':![]});throw _0x44eb6e;}const _0x4e7165=_0x444f9b&&inspectAppRuleContent(_0x444f9b[_0x3fabd9(0x156)])[_0x3fabd9(0x141)]===_0xe3de15[_0x3fabd9(0x146)][_0x3fabd9(0x141)],_0x59482b=_0x444f9b&&(_0xe3de15[_0x3fabd9(0x135)]===null||_0x444f9b[_0x3fabd9(0x12e)]>_0xe3de15['beforeRecord'][_0x3fabd9(0x12e)]);if(!_0x444f9b||!_0x4e7165||!_0x59482b)throw appRuleError(_0x5a8829?_0x3fabd9(0x14d):_0x3fabd9(0x158),appRuleFileName(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)])+_0x3fabd9(0x13f),_0x3fabd9(0x159)+_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x2e1a8e=warningsFor(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x134)]);_0x5a8829&&_0x2e1a8e[_0x3fabd9(0x148)](_0x3fabd9(0x14a));const _0x53800a=projectAppRule(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)],_0x444f9b);return{'ok':!![],'data':{'operation':_0x3fabd9(0x15e),'selector':{'appCode':_0x59d7a5[_0x3fabd9(0x165)],'scope':_0x3fabd9(0x163),'type':_0xe3de15[_0x3fabd9(0x143)]['type']},'before':_0xe3de15[_0x3fabd9(0x13e)],'after':_0x53800a,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x2e1a8e,'verification':{'status':_0x3fabd9(0x149),'recoveredAfterUnknownResponse':_0x5a8829,'expectedVersion':_0xe3de15[_0x3fabd9(0x143)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)]+_0x3fabd9(0x15b)}},'message':_0x3fabd9(0x15a)+appRuleFileName(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)])+'\x20for\x20'+_0x59d7a5['appCode']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a193_0x431c3a=a193_0x1242;function a193_0x53d5(){const _0x52c37a=['appCode','database','11842128ppMeDL','decode','33DczVui','message','content','digest','14050aZFASS','sha256:','1688582FpunpB','scope','rules','sha256','DATABASE.md','trim','app_rule_content_invalid','createTime','548290DBXUBQ','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','3610OypmSC','4204220ozCqng','utf8','updateTime','8166kHMjBC','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','string','app_rule_content_too_large','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','3573liDXJO','version','app_rule_file_required','type','isFile','byteLength','size','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','app_rule_file_invalid','RULES.md','database-analysis','app_rule_file_unreadable','Pass\x20a\x20UTF-8\x20Markdown\x20file.','662zScJaq','Cannot\x20access\x20app\x20rule\x20file:\x20','toLowerCase','16KNjohS'];a193_0x53d5=function(){return _0x52c37a;};return a193_0x53d5();}(function(_0x270501,_0x524224){const _0x103a87=a193_0x1242,_0x4e913c=_0x270501();while(!![]){try{const _0x37b357=-parseInt(_0x103a87(0x9a))/0x1+-parseInt(_0x103a87(0xbc))/0x2*(parseInt(_0x103a87(0xaf))/0x3)+parseInt(_0x103a87(0xa7))/0x4+-parseInt(_0x103a87(0xa6))/0x5*(parseInt(_0x103a87(0xaa))/0x6)+parseInt(_0x103a87(0x9c))/0x7*(-parseInt(_0x103a87(0xbf))/0x8)+parseInt(_0x103a87(0xc2))/0x9+parseInt(_0x103a87(0xa4))/0xa*(parseInt(_0x103a87(0xc4))/0xb);if(_0x37b357===_0x524224)break;else _0x4e913c['push'](_0x4e913c['shift']());}catch(_0x3a09d6){_0x4e913c['push'](_0x4e913c['shift']());}}}(a193_0x53d5,0xa0a31));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a193_0x431c3a(0x9e),a193_0x431c3a(0xc1)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a193_0x431c3a(0xb8),'database':a193_0x431c3a(0xa0)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a193_0x431c3a(0xb9)};export function appRuleError(_0x1bb820,_0x49706e,_0x5e8d7b){return new CliError(_0x1bb820,0x1,_0x49706e,_0x5e8d7b);}export function readAppRuleType(_0x5dfd3d){const _0xf0142b=a193_0x431c3a,_0x12751f=_0x5dfd3d['str'](_0xf0142b(0xb2))['trim']()[_0xf0142b(0xbe)]();if(_0x12751f!=='rules'&&_0x12751f!=='database')throw appRuleError('app_rule_type_invalid',_0xf0142b(0xb6));return _0x12751f;}export function appRuleFileName(_0xd810aa){return APP_RULE_FILES[_0xd810aa];}function a193_0x1242(_0x53ef58,_0x4f0dce){_0x53ef58=_0x53ef58-0x9a;const _0x53d508=a193_0x53d5();let _0x1242e3=_0x53d508[_0x53ef58];return _0x1242e3;}export function appRuleContextScope(_0x19180b){return APP_RULE_CONTEXT_SCOPES[_0x19180b];}export function inspectAppRuleContent(_0x23629f){const _0x2b77a1=a193_0x431c3a,_0x523245=Buffer['from'](_0x23629f,_0x2b77a1(0xa8));return{'content':_0x23629f,'byteSize':_0x523245[_0x2b77a1(0xb4)],'contentHash':_0x2b77a1(0x9b)+createHash(_0x2b77a1(0x9f))['update'](_0x523245)[_0x2b77a1(0xc7)]('hex')};}export async function readAppRuleFile(_0x33ee9c){const _0x363e89=a193_0x431c3a,_0x3c339d=_0x33ee9c[_0x363e89(0xa1)]();if(!_0x3c339d)throw appRuleError(_0x363e89(0xb1),'--file\x20is\x20required.',_0x363e89(0xbb));const _0x345354=resolve(_0x3c339d);let _0xd801b5;try{_0xd801b5=await stat(_0x345354);}catch(_0x5c88db){throw appRuleError(_0x363e89(0xba),_0x363e89(0xbd)+_0x3c339d,_0x5c88db instanceof Error?_0x5c88db[_0x363e89(0xc5)]:String(_0x5c88db));}if(!_0xd801b5[_0x363e89(0xb3)]())throw appRuleError(_0x363e89(0xb7),_0x363e89(0xab)+_0x3c339d);if(_0xd801b5[_0x363e89(0xb5)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x363e89(0xad),_0x363e89(0xae));let _0x383ce9;try{_0x383ce9=await readFile(_0x345354);}catch(_0xc83e2e){throw appRuleError(_0x363e89(0xba),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x3c339d,_0xc83e2e instanceof Error?_0xc83e2e[_0x363e89(0xc5)]:String(_0xc83e2e));}if(_0x383ce9[_0x363e89(0xb4)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x363e89(0xad),_0x363e89(0xae));let _0x410526;try{_0x410526=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x363e89(0xc3)](_0x383ce9);}catch{throw appRuleError(_0x363e89(0xa2),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x3c339d);}if(!_0x410526['trim']())throw appRuleError(_0x363e89(0xa2),'App\x20rule\x20file\x20is\x20blank:\x20'+_0x3c339d);return inspectAppRuleContent(_0x410526);}export function projectAppRule(_0x4822da,_0x36ec6b){const _0x4a619a=a193_0x431c3a;if(!_0x36ec6b)return{'type':_0x4822da,'fileName':appRuleFileName(_0x4822da),'contextScope':appRuleContextScope(_0x4822da),'enabled':![]};const _0x4af3e3=inspectAppRuleContent(_0x36ec6b[_0x4a619a(0xc6)]);return{'type':_0x4822da,'fileName':appRuleFileName(_0x4822da),'contextScope':appRuleContextScope(_0x4822da),'enabled':!![],'id':_0x36ec6b['id'],'scope':_0x36ec6b[_0x4a619a(0x9d)],'appCode':_0x36ec6b[_0x4a619a(0xc0)],'version':_0x36ec6b[_0x4a619a(0xb0)],'contentByteSize':_0x4af3e3['byteSize'],'contentHash':_0x4af3e3['contentHash'],..._0x36ec6b[_0x4a619a(0xa3)]!==undefined&&_0x36ec6b[_0x4a619a(0xa3)]!==null?{'createTime':_0x36ec6b[_0x4a619a(0xa3)]}:{},..._0x36ec6b['updateTime']!==undefined&&_0x36ec6b['updateTime']!==null?{'updateTime':_0x36ec6b[_0x4a619a(0xa9)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a193_0x431c3a(0xb2),'type':a193_0x431c3a(0xac),'required':!![],'description':a193_0x431c3a(0xa5),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a194_0x45b3fd=a194_0x4e54;(function(_0x4b5219,_0x46c36c){const _0x562d30=a194_0x4e54,_0xf69677=_0x4b5219();while(!![]){try{const _0x593e5e=-parseInt(_0x562d30(0x1d4))/0x1*(-parseInt(_0x562d30(0x1b5))/0x2)+-parseInt(_0x562d30(0x1c2))/0x3*(parseInt(_0x562d30(0x1b7))/0x4)+-parseInt(_0x562d30(0x1b9))/0x5*(-parseInt(_0x562d30(0x1be))/0x6)+-parseInt(_0x562d30(0x1ba))/0x7*(-parseInt(_0x562d30(0x1bf))/0x8)+parseInt(_0x562d30(0x1d0))/0x9*(parseInt(_0x562d30(0x1ca))/0xa)+-parseInt(_0x562d30(0x1c5))/0xb+-parseInt(_0x562d30(0x1c7))/0xc;if(_0x593e5e===_0x46c36c)break;else _0xf69677['push'](_0xf69677['shift']());}catch(_0xac92fd){_0xf69677['push'](_0xf69677['shift']());}}}(a194_0x1176,0x36a4e));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a194_0x1176(){const _0x2c1111=['\x20run\x20preview\x20--watch','package.json','65060BAngjW','log','\x20run\x20start','script','vite\x20preview\x20exited\x20with\x20code\x20','join','72nVHyaP','utf-8','Available:\x20','(none)','1kWObGy','args','bun.lock','\x20run\x20','Enable\x20watch\x20mode\x20for\x20preview','pnpm','\x20run\x20build','vite','Run\x20a\x20package.json\x20script','belowMinimum','keys','error','node_modules','\x20exited\x20with\x20code\x20','\x0a\x20\x20Usage:\x20','preview','boolean','watch','\x20\x20EXAMPLES','No\x20package.json\x20found\x20in\x20current\x20directory.','inherit','length','all','slice','has','parse','Script\x20\x22','run','\x20\x20\x20\x20','push','scripts','309476emRLGd','.bin','164568voHRaO','close','1189855osPbNs','7aktSbO','--watch','pnpm-lock.yaml','npm','6BvOHjX','3114152OsmbdR','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20preview','3JoKraD','validation','needsUpgrade','3871417BZxMlY','bool','2605380TjacUY'];a194_0x1176=function(){return _0x2c1111;};return a194_0x1176();}import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';function a194_0x4e54(_0x4de431,_0x5d26c2){_0x4de431=_0x4de431-0x1a7;const _0x1176ed=a194_0x1176();let _0x4e5406=_0x1176ed[_0x4de431];return _0x4e5406;}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start','dev']);function readPackageScripts(_0x4ce342){const _0x310afc=a194_0x4e54,_0x4405b4=resolve(_0x4ce342,_0x310afc(0x1c9));if(!existsSync(_0x4405b4))return null;try{const _0x573a10=JSON[_0x310afc(0x1af)](readFileSync(_0x4405b4,_0x310afc(0x1d1)));return _0x573a10[_0x310afc(0x1b4)]??{};}catch{return null;}}function detectPackageManager(_0x2a15bd){const _0x3a817d=a194_0x4e54;if(existsSync(resolve(_0x2a15bd,'bun.lockb'))||existsSync(resolve(_0x2a15bd,_0x3a817d(0x1d6))))return'bun';if(existsSync(resolve(_0x2a15bd,_0x3a817d(0x1bc))))return _0x3a817d(0x1d9);if(existsSync(resolve(_0x2a15bd,'yarn.lock')))return'yarn';return _0x3a817d(0x1bd);}async function versionCheck(_0x20bf49){const _0xbab53c=a194_0x4e54,_0x57e6dd=await checkCliVersion();(_0x57e6dd[_0xbab53c(0x1c4)]||_0x57e6dd[_0xbab53c(0x1dd)])&&(printCliUpgradeWarning(_0x57e6dd),assertCliVersionSupported(_0x57e6dd));const _0x264ff0=await checkSdkVersion(_0x20bf49);if(_0x264ff0[_0xbab53c(0x1c4)])printSdkUpgradeWarning(_0x264ff0);}function spawnScript(_0x1a4d1c,_0x42e407,_0x741752,_0x25bc8c){return new Promise((_0x56b00f,_0x3621f1)=>{const _0x5f1a34=a194_0x4e54,_0x1e0460=[_0x5f1a34(0x1b1),_0x42e407,..._0x741752],_0x5aa81a=spawn(_0x1a4d1c,_0x1e0460,{'cwd':_0x25bc8c,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x25bc8c,_0x5f1a34(0x1e0),_0x5f1a34(0x1b6))+delimiter+process.env.PATH}});_0x5aa81a['on'](_0x5f1a34(0x1b8),_0xcbb4ac=>{const _0x4aa4d4=_0x5f1a34;if(_0xcbb4ac===0x0||_0xcbb4ac===null)_0x56b00f();else _0x3621f1(new Error(_0x1a4d1c+_0x4aa4d4(0x1d7)+_0x42e407+_0x4aa4d4(0x1e1)+_0xcbb4ac));}),_0x5aa81a['on'](_0x5f1a34(0x1df),_0x3621f1);});}function spawnViteBuildWatch(_0x3c795d){return new Promise((_0x12455f,_0x2efede)=>{const _0x2c434d=a194_0x4e54,_0x52d0ee=spawn(_0x2c434d(0x1db),['build',_0x2c434d(0x1bb)],{'cwd':_0x3c795d,'stdio':_0x2c434d(0x1aa),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3c795d,_0x2c434d(0x1e0),_0x2c434d(0x1b6))+delimiter+process.env.PATH}});_0x52d0ee['on'](_0x2c434d(0x1b8),_0x4548c2=>{const _0x59c430=_0x2c434d;if(_0x4548c2===0x0||_0x4548c2===null)_0x12455f();else _0x2efede(new Error(_0x59c430(0x1c0)+_0x4548c2));}),_0x52d0ee['on'](_0x2c434d(0x1df),_0x2efede);});}function spawnVitePreview(_0x209d03){return new Promise((_0xe40bfb,_0x920ff7)=>{const _0x293b9f=a194_0x4e54,_0x4dcc1e=spawn(_0x293b9f(0x1db),[_0x293b9f(0x1e3)],{'cwd':_0x209d03,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x209d03,_0x293b9f(0x1e0),_0x293b9f(0x1b6))+delimiter+process.env.PATH}});_0x4dcc1e['on']('close',_0x4f4579=>{const _0x1e8fe3=_0x293b9f;if(_0x4f4579===0x0||_0x4f4579===null)_0xe40bfb();else _0x920ff7(new Error(_0x1e8fe3(0x1ce)+_0x4f4579));}),_0x4dcc1e['on'](_0x293b9f(0x1df),_0x920ff7);});}const runFlags=[{'name':'watch','type':a194_0x45b3fd(0x1e4),'description':a194_0x45b3fd(0x1d8),'default':![]}];export const runDefinition={'service':'run','command':a194_0x45b3fd(0x1b1),'description':a194_0x45b3fd(0x1dc),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a194_0x45b3fd(0x1cd),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x25eb61=a194_0x45b3fd,_0x399d0f=[];return _0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1a8)),_0x399d0f['push'](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1cc)),_0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1da)),_0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1c1)),_0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1c8)),_0x399d0f[_0x25eb61(0x1cf)]('\x0a');},async 'execute'(_0x5ed4d3){const _0x15099a=a194_0x45b3fd,_0x314bbd=process['cwd'](),_0x3a312f=_0x5ed4d3[_0x15099a(0x1d5)][0x0],_0x52e90f=_0x5ed4d3[_0x15099a(0x1d5)][_0x15099a(0x1ad)](0x1),_0x44bae5=readPackageScripts(_0x314bbd);if(!_0x44bae5)throw CliErrors[_0x15099a(0x1c3)](_0x15099a(0x1a9));if(!_0x3a312f){const _0x5ca5ab=Object[_0x15099a(0x1de)](_0x44bae5);if(_0x5ca5ab[_0x15099a(0x1ab)]===0x0)console[_0x15099a(0x1cb)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x15099a(0x1cb)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x5bdd5a of _0x5ca5ab){console[_0x15099a(0x1cb)](_0x15099a(0x1b2)+_0x5bdd5a);}console[_0x15099a(0x1cb)](_0x15099a(0x1e2)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x44bae5[_0x3a312f])throw CliErrors[_0x15099a(0x1c3)](_0x15099a(0x1b0)+_0x3a312f+'\x22\x20not\x20found\x20in\x20package.json.',_0x15099a(0x1d2)+(Object['keys'](_0x44bae5)[_0x15099a(0x1cf)](',\x20')||_0x15099a(0x1d3)));const _0x1366f1=detectPackageManager(_0x314bbd);VERSION_CHECK_SCRIPTS[_0x15099a(0x1ae)](_0x3a312f)&&await versionCheck(_0x314bbd);if(_0x3a312f===_0x15099a(0x1e3)&&_0x5ed4d3[_0x15099a(0x1c6)](_0x15099a(0x1a7)))return await Promise[_0x15099a(0x1ac)]([spawnViteBuildWatch(_0x314bbd),spawnVitePreview(_0x314bbd)]),{'ok':!![]};return await spawnScript(_0x1366f1,_0x3a312f,_0x52e90f,_0x314bbd),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a195_0x49c3b6=a195_0x4592;function a195_0x53d3(){const _0xe018f6=['read','35ZNloHn','2836134hRCSFg','6277180tDKzOC','17905MCrqWG','220OXnBWJ','506565AOpjul','1056icgpbS','158qkmCGe','export','2954392CpzhPM','100614WCiLau'];a195_0x53d3=function(){return _0xe018f6;};return a195_0x53d3();}function a195_0x4592(_0x3fffd1,_0x43d7e0){_0x3fffd1=_0x3fffd1-0x1a3;const _0x53d335=a195_0x53d3();let _0x4592e6=_0x53d335[_0x3fffd1];return _0x4592e6;}(function(_0x2047b7,_0x301dc9){const _0x4abdcb=a195_0x4592,_0x45447b=_0x2047b7();while(!![]){try{const _0x177ff1=-parseInt(_0x4abdcb(0x1a4))/0x1*(-parseInt(_0x4abdcb(0x1a3))/0x2)+parseInt(_0x4abdcb(0x1ae))/0x3+-parseInt(_0x4abdcb(0x1ad))/0x4*(parseInt(_0x4abdcb(0x1ac))/0x5)+parseInt(_0x4abdcb(0x1a7))/0x6*(parseInt(_0x4abdcb(0x1a9))/0x7)+parseInt(_0x4abdcb(0x1a6))/0x8+parseInt(_0x4abdcb(0x1aa))/0x9+-parseInt(_0x4abdcb(0x1ab))/0xa;if(_0x177ff1===_0x301dc9)break;else _0x45447b['push'](_0x45447b['shift']());}catch(_0x4fc130){_0x45447b['push'](_0x45447b['shift']());}}}(a195_0x53d3,0x2fd24));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x35489b){const _0x1568b0=await buildSchemaPayload();return{'ok':!![],'data':_0x1568b0};}export const schemaDefinition={'service':'schema','command':a195_0x49c3b6(0x1a5),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a195_0x49c3b6(0x1a8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a196_0x1942(_0x24f201,_0x452333){_0x24f201=_0x24f201-0x182;const _0x4e4611=a196_0x4e46();let _0x1942e4=_0x4e4611[_0x24f201];return _0x1942e4;}const a196_0x2670dc=a196_0x1942;(function(_0x5a6625,_0x2816d9){const _0x144951=a196_0x1942,_0x833367=_0x5a6625();while(!![]){try{const _0x28f1b6=-parseInt(_0x144951(0x1c7))/0x1+parseInt(_0x144951(0x1ba))/0x2+-parseInt(_0x144951(0x1bf))/0x3+-parseInt(_0x144951(0x1c2))/0x4*(parseInt(_0x144951(0x182))/0x5)+parseInt(_0x144951(0x1ac))/0x6+-parseInt(_0x144951(0x190))/0x7*(parseInt(_0x144951(0x18b))/0x8)+parseInt(_0x144951(0x1a1))/0x9;if(_0x28f1b6===_0x2816d9)break;else _0x833367['push'](_0x833367['shift']());}catch(_0x9470e8){_0x833367['push'](_0x833367['shift']());}}}(a196_0x4e46,0x1cc3c));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(_0x2a973b){const _0x12fdf8=a196_0x1942;if(_0x2a973b===_0x12fdf8(0x183))return[_0x12fdf8(0x19b),_0x12fdf8(0x1a3),_0x12fdf8(0x1a7),''][_0x12fdf8(0x19c)]('\x0a');return[_0x12fdf8(0x1a9),''][_0x12fdf8(0x19c)]('\x0a');}export const sqlCreate={'service':a196_0x2670dc(0x1ab),'command':'create','description':a196_0x2670dc(0x187),'risk':a196_0x2670dc(0x19d),'flags':[{'name':a196_0x2670dc(0x18a),'type':'string','description':a196_0x2670dc(0x198)},{'name':a196_0x2670dc(0x186),'type':a196_0x2670dc(0x185),'description':a196_0x2670dc(0x1af)},{'name':a196_0x2670dc(0x191),'type':a196_0x2670dc(0x1b1),'enum':[a196_0x2670dc(0x1ab),a196_0x2670dc(0x183)],'description':a196_0x2670dc(0x1be)}],async 'validate'(_0x169059){const _0x3267d6=a196_0x2670dc;if(!_0x169059[_0x3267d6(0x1c6)])return;if(!_0x169059[_0x3267d6(0x1a2)](_0x3267d6(0x18a))[_0x3267d6(0x188)]())throw CliErrors[_0x3267d6(0x1b7)](_0x3267d6(0x18a),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x24a63a=resolveProvidedDbId(_0x169059);if(typeof _0x24a63a!==_0x3267d6(0x185)||!Number['isFinite'](_0x24a63a)||_0x24a63a<=0x0)throw CliErrors[_0x3267d6(0x1b7)](_0x3267d6(0x186),_0x3267d6(0x1ae));if(!_0x169059[_0x3267d6(0x1a2)](_0x3267d6(0x191))[_0x3267d6(0x188)]())throw CliErrors['flagMissing'](_0x3267d6(0x191),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x41fcd3){const _0x45f8cf=a196_0x2670dc,_0x51ecc3=loadSqlProjectConfig(_0x41fcd3[_0x45f8cf(0x184)]),{sqlName:_0x38c39e,dbId:_0x18742b,dbName:_0x765f3f,mode:_0x5cefc9}=await resolveSqlNewInputs(_0x41fcd3),_0x403267=buildSqlRelativePath(_0x45f8cf(0x193),_0x38c39e,_0x765f3f,_0x5cefc9,_0x18742b),_0xe1aed4=_0x51ecc3[_0x45f8cf(0x18d)]+'/'+_0x403267;return{'method':_0x45f8cf(0x196),'url':_0x45f8cf(0x1c1),'body':{'appCode':_0x41fcd3[_0x45f8cf(0x184)],'sqlName':_0x38c39e,'dbId':_0x18742b,'mode':_0x5cefc9,'localPath':_0xe1aed4},'description':_0x45f8cf(0x19f)+_0x51ecc3[_0x45f8cf(0x18d)]};},async 'execute'(_0x24dc26){const _0x47d813=a196_0x2670dc,_0x4fbf96=loadSqlProjectConfig(_0x24dc26[_0x47d813(0x184)]),{sqlName:_0x238cff,dbId:_0x13e75a,dbName:_0x41c177,mode:_0x520294}=await resolveSqlNewInputs(_0x24dc26),_0x59492c=generateSqlTemplate(_0x520294),_0x45db92=await createSqlQuery({'appCode':_0x24dc26['appCode'],'sqlName':_0x238cff,'dbId':_0x13e75a,'sqlContent':_0x59492c}),_0x59fb84=ensureRemoteSqlContent(_0x45db92),_0x2ccd76=_0x41c177||await getDbName(_0x24dc26[_0x47d813(0x184)],_0x13e75a)[_0x47d813(0x1b6)](()=>undefined),_0x58fb11=buildSqlRelativePath(_0x45db92[_0x47d813(0x1a5)],_0x45db92[_0x47d813(0x1bc)],_0x2ccd76,_0x520294,_0x13e75a),_0x152675=_0x4fbf96[_0x47d813(0x18d)]+'/'+_0x58fb11,_0x414b88=buildLocalSqlFileContent({'sqlCode':_0x45db92[_0x47d813(0x1a5)],'sqlName':_0x45db92['sqlName'],'dbId':_0x45db92[_0x47d813(0x1ad)]},_0x59fb84,{'dbName':_0x2ccd76,'mode':_0x520294,'syncedAt':new Date()['toISOString'](),'description':_0x45db92[_0x47d813(0x1c0)]});if(await fileExists(_0x152675))throw CliErrors['validation'](_0x47d813(0x18e)+_0x152675);await ensureParentDirectory(_0x152675),await writeFile(_0x152675,_0x414b88,_0x47d813(0x1a8));const _0x908f7d=await readSqlLockFile(_0x4fbf96['lockFilePath']),{lockData:_0x57356f,appLock:_0x63a43a}=ensureSqlLockScope(_0x908f7d??createEmptySqlLock(),_0x4fbf96[_0x47d813(0x184)],_0x4fbf96['sqlRoot'],_0x47d813(0x1b4));return _0x63a43a[_0x47d813(0x1b3)][_0x45db92[_0x47d813(0x1a5)]]={...buildSqlLockEntry(_0x45db92,_0x59fb84,computeSqlContentHash(_0x414b88),{'dbName':_0x2ccd76}),'path':_0x58fb11,'mode':_0x520294},_0x63a43a[_0x47d813(0x1b0)]=new Date()[_0x47d813(0x18f)](),await writeSqlLockFile(_0x4fbf96[_0x47d813(0x1b2)],_0x57356f),{'ok':!![],'data':{'id':_0x45db92['id'],'sqlCode':_0x45db92[_0x47d813(0x1a5)],'sqlName':_0x45db92[_0x47d813(0x1bc)],'dbId':_0x45db92['dbId'],'path':_0x152675,'mode':_0x520294},'message':_0x47d813(0x199)+_0x45db92[_0x47d813(0x1a5)]};}};async function resolveSqlNewInputs(_0x282e4a){const _0x3032f2=await resolveSqlNameInput(_0x282e4a),{dbId:_0x1960e2,dbName:_0x163f69}=await resolveDbSelection(_0x282e4a),_0x327346=await resolveSqlModeInput(_0x282e4a);return{'sqlName':_0x3032f2,'dbId':_0x1960e2,'dbName':_0x163f69,'mode':_0x327346};}async function resolveSqlNameInput(_0x214ea7){const _0x28963c=a196_0x2670dc,_0x5f32b3=_0x214ea7[_0x28963c(0x1a2)]('name')[_0x28963c(0x188)]();if(_0x5f32b3)return _0x5f32b3;if(_0x214ea7[_0x28963c(0x1c6)])throw CliErrors[_0x28963c(0x1b7)](_0x28963c(0x18a),_0x28963c(0x1a6));return(await input({'message':'SQL\x20name:','validate':_0x57e3bb=>_0x57e3bb[_0x28963c(0x188)]()?!![]:_0x28963c(0x194)}))['trim']();}async function resolveDbSelection(_0x172148){const _0x13cb8b=a196_0x2670dc,_0x501a0f=resolveProvidedDbId(_0x172148);if(typeof _0x501a0f===_0x13cb8b(0x185)&&Number[_0x13cb8b(0x1c3)](_0x501a0f)&&_0x501a0f>0x0)return{'dbId':_0x501a0f,'dbName':await getDbName(_0x172148[_0x13cb8b(0x184)],_0x501a0f)['catch'](()=>undefined)};if(_0x172148['nonInteractive'])throw CliErrors[_0x13cb8b(0x1b7)](_0x13cb8b(0x186),_0x13cb8b(0x1ae));const _0x5e9723=await listDatabases(_0x172148[_0x13cb8b(0x184)])[_0x13cb8b(0x1b6)](()=>[]);if(_0x5e9723[_0x13cb8b(0x1a4)]===0x1)return{'dbId':_0x5e9723[0x0][_0x13cb8b(0x1ad)],'dbName':_0x5e9723[0x0][_0x13cb8b(0x1c5)]};if(_0x5e9723[_0x13cb8b(0x1a4)]>0x1){const _0x4804e3=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x5e9723[_0x13cb8b(0x1bd)](_0x5db211=>({'name':_0x5db211[_0x13cb8b(0x1c5)]+'\x20('+_0x5db211[_0x13cb8b(0x1ad)]+')','value':serializeDbSelection(_0x5db211)})),{'name':_0x13cb8b(0x18c),'value':'__manual__'}]});if(_0x4804e3!=='__manual__')return deserializeDbSelection(_0x4804e3);}const _0xb98cd5=await input({'message':_0x13cb8b(0x192),'validate':_0x4dff38=>{const _0x161a88=_0x13cb8b,_0x1052d8=_0x4dff38['trim']();if(!_0x1052d8)return _0x161a88(0x19e);const _0x15bfb0=Number(_0x1052d8);if(!Number[_0x161a88(0x19a)](_0x15bfb0)||_0x15bfb0<=0x0)return _0x161a88(0x1b9);return!![];}});return{'dbId':Number(_0xb98cd5[_0x13cb8b(0x188)]())};}async function resolveSqlModeInput(_0x25998b){const _0x27df0b=a196_0x2670dc,_0x58f06f=_0x25998b[_0x27df0b(0x1a2)](_0x27df0b(0x191))[_0x27df0b(0x188)]();if(_0x58f06f===_0x27df0b(0x1ab)||_0x58f06f==='mybatisXml')return _0x58f06f;if(_0x25998b[_0x27df0b(0x1c6)])throw CliErrors[_0x27df0b(0x1b7)](_0x27df0b(0x191),_0x27df0b(0x1aa));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x27df0b(0x1a0),'value':'sql','description':_0x27df0b(0x1bb)},{'name':_0x27df0b(0x195),'value':_0x27df0b(0x183),'description':_0x27df0b(0x1b8)}]});}function serializeDbSelection(_0xf961b3){const _0x1d4085=a196_0x2670dc;return JSON[_0x1d4085(0x1b5)]({'dbId':_0xf961b3[_0x1d4085(0x1ad)],'dbName':_0xf961b3[_0x1d4085(0x1c5)]});}function a196_0x4e46(){const _0x4c71d4=['183164eaUBBy','isFinite','validation','dbName','nonInteractive','72363YPfipt','20saVyoc','mybatisXml','appCode','number','db-id','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','trim','flag','name','1703576scuBbx','✎\x20Enter\x20dbId\x20manually','sqlRootDir','File\x20already\x20exists:\x20','toISOString','7NULRbW','mode','Target\x20database\x20dbId:','<server-generated-sqlCode>','SQL\x20name\x20cannot\x20be\x20empty','MyBatis\x20XML\x20(mybatisXml)','POST','Invalid\x20database\x20selection\x20payload:\x20','SQL\x20query\x20display\x20name','Created\x20SQL\x20query\x20','isInteger','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','join','write','dbId\x20cannot\x20be\x20empty','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','Plain\x20SQL\x20(sql)','4866183ViUcdw','str','\x20\x20SELECT\x201\x20AS\x20id','length','sqlCode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','</select>','utf8','SELECT\x201\x20AS\x20id;','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sql','23262xQFPTx','dbId','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20ID','lastSync','string','lockFilePath','sqls','new','stringify','catch','flagMissing','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','dbId\x20must\x20be\x20a\x20positive\x20integer','154932FxzOGi','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','sqlName','map','Local\x20SQL\x20file\x20mode','107208VPJIRx','description','/smartapi/custom/saveUserCustomSql'];a196_0x4e46=function(){return _0x4c71d4;};return a196_0x4e46();}function deserializeDbSelection(_0x9e7ce1){const _0x1ef66b=a196_0x2670dc;try{const _0x308824=JSON['parse'](_0x9e7ce1);if(typeof _0x308824[_0x1ef66b(0x1ad)]===_0x1ef66b(0x185)&&Number[_0x1ef66b(0x1c3)](_0x308824[_0x1ef66b(0x1ad)]))return{'dbId':_0x308824[_0x1ef66b(0x1ad)],'dbName':_0x308824[_0x1ef66b(0x1c5)]};}catch{}throw CliErrors[_0x1ef66b(0x1c4)](_0x1ef66b(0x197)+_0x9e7ce1);}function resolveProvidedDbId(_0x49bea0){const _0x4d6c75=a196_0x2670dc,_0x17b054=_0x49bea0[_0x4d6c75(0x189)](_0x4d6c75(0x186));if(typeof _0x17b054===_0x4d6c75(0x185)&&Number[_0x4d6c75(0x1c3)](_0x17b054))return _0x17b054;return undefined;}
|
|
1
|
+
const a196_0x492311=a196_0x3fb6;(function(_0x54e859,_0x417d5f){const _0xcdc7d=a196_0x3fb6,_0x3512c5=_0x54e859();while(!![]){try{const _0x324cf6=-parseInt(_0xcdc7d(0x1f7))/0x1*(-parseInt(_0xcdc7d(0x1dc))/0x2)+parseInt(_0xcdc7d(0x1e0))/0x3+-parseInt(_0xcdc7d(0x1fa))/0x4*(parseInt(_0xcdc7d(0x1da))/0x5)+parseInt(_0xcdc7d(0x1e4))/0x6*(parseInt(_0xcdc7d(0x1ec))/0x7)+parseInt(_0xcdc7d(0x1e6))/0x8+parseInt(_0xcdc7d(0x206))/0x9+-parseInt(_0xcdc7d(0x20c))/0xa;if(_0x324cf6===_0x417d5f)break;else _0x3512c5['push'](_0x3512c5['shift']());}catch(_0x335b9b){_0x3512c5['push'](_0x3512c5['shift']());}}}(a196_0x2239,0xa603a));function a196_0x3fb6(_0x5221fb,_0x3e4bef){_0x5221fb=_0x5221fb-0x1c8;const _0x2239c1=a196_0x2239();let _0x3fb6b4=_0x2239c1[_0x5221fb];return _0x3fb6b4;}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(_0x4b66fe){const _0x31bdd6=a196_0x3fb6;if(_0x4b66fe===_0x31bdd6(0x1ca))return[_0x31bdd6(0x1d0),_0x31bdd6(0x1f2),_0x31bdd6(0x1d6),''][_0x31bdd6(0x1d7)]('\x0a');return[_0x31bdd6(0x1d1),''][_0x31bdd6(0x1d7)]('\x0a');}function a196_0x2239(){const _0x2dc464=['isFinite','sqls','2703012PulBiV','nonInteractive','appCode','Select\x20the\x20local\x20SQL\x20mode:','420498dYvgwj','sql','2355960wPGrWm','create','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','db-id','/smartapi/custom/saveUserCustomSql','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','21cJJPHE','catch','sqlCode','dbName','File\x20already\x20exists:\x20','string','\x20\x20SELECT\x201\x20AS\x20id','POST','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','length','sqlRootDir','173041hdoVEb','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','888MrpCnH','number','name','new','parse','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','flag','Created\x20SQL\x20query\x20','SQL\x20query\x20display\x20name','trim','Invalid\x20database\x20selection\x20payload:\x20','11743317itYTKc','<server-generated-sqlCode>','description','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','flagMissing','10776240cZNibi','stringify','✎\x20Enter\x20dbId\x20manually','dbId','mybatisXml','isInteger','Target\x20database\x20ID','toISOString','lockFilePath','validation','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','SELECT\x201\x20AS\x20id;','SQL\x20name\x20cannot\x20be\x20empty','Local\x20SQL\x20file\x20mode','sqlName','write','</select>','join','__manual__','dbId\x20must\x20be\x20a\x20positive\x20integer','25360yhtHHf','map','2IpgGkk','dbId\x20cannot\x20be\x20empty'];a196_0x2239=function(){return _0x2dc464;};return a196_0x2239();}export const sqlCreate={'service':a196_0x492311(0x1e5),'command':a196_0x492311(0x1e7),'description':a196_0x492311(0x1f8),'risk':a196_0x492311(0x1d5),'flags':[{'name':a196_0x492311(0x1fc),'type':a196_0x492311(0x1f1),'description':a196_0x492311(0x203)},{'name':a196_0x492311(0x1e9),'type':a196_0x492311(0x1fb),'description':a196_0x492311(0x1cc)},{'name':'mode','type':a196_0x492311(0x1f1),'enum':[a196_0x492311(0x1e5),a196_0x492311(0x1ca)],'description':a196_0x492311(0x1d3)}],async 'validate'(_0x2ca04c){const _0x125b3c=a196_0x492311;if(!_0x2ca04c['nonInteractive'])return;if(!_0x2ca04c[_0x125b3c(0x1ff)](_0x125b3c(0x1fc))['trim']())throw CliErrors['flagMissing'](_0x125b3c(0x1fc),_0x125b3c(0x1eb));const _0x3ebf42=resolveProvidedDbId(_0x2ca04c);if(typeof _0x3ebf42!==_0x125b3c(0x1fb)||!Number[_0x125b3c(0x1de)](_0x3ebf42)||_0x3ebf42<=0x0)throw CliErrors[_0x125b3c(0x20b)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x2ca04c[_0x125b3c(0x1ff)](_0x125b3c(0x20a))[_0x125b3c(0x204)]())throw CliErrors['flagMissing'](_0x125b3c(0x20a),_0x125b3c(0x200));},async 'dryRun'(_0x27609b){const _0x201000=a196_0x492311,_0x27c848=loadSqlProjectConfig(_0x27609b[_0x201000(0x1e2)]),{sqlName:_0x3e958f,dbId:_0xfdf021,dbName:_0xd788df,mode:_0x17760f}=await resolveSqlNewInputs(_0x27609b),_0x4192aa=buildSqlRelativePath(_0x201000(0x207),_0x3e958f,_0xd788df,_0x17760f,_0xfdf021),_0x4402f5=_0x27c848[_0x201000(0x1f6)]+'/'+_0x4192aa;return{'method':_0x201000(0x1f3),'url':_0x201000(0x1ea),'body':{'appCode':_0x27609b['appCode'],'sqlName':_0x3e958f,'dbId':_0xfdf021,'mode':_0x17760f,'localPath':_0x4402f5},'description':_0x201000(0x1f9)+_0x27c848[_0x201000(0x1f6)]};},async 'execute'(_0x3658f3){const _0x4506d3=a196_0x492311,_0x3db16a=loadSqlProjectConfig(_0x3658f3[_0x4506d3(0x1e2)]),{sqlName:_0x204bc9,dbId:_0x227a8a,dbName:_0x399434,mode:_0x54604f}=await resolveSqlNewInputs(_0x3658f3),_0x2e4bfe=generateSqlTemplate(_0x54604f),_0xbad0a8=await createSqlQuery({'appCode':_0x3658f3['appCode'],'sqlName':_0x204bc9,'dbId':_0x227a8a,'sqlContent':_0x2e4bfe}),_0x58e73c=ensureRemoteSqlContent(_0xbad0a8),_0x2f31c4=_0x399434||await getDbName(_0x3658f3[_0x4506d3(0x1e2)],_0x227a8a)[_0x4506d3(0x1ed)](()=>undefined),_0x32f1f2=buildSqlRelativePath(_0xbad0a8['sqlCode'],_0xbad0a8['sqlName'],_0x2f31c4,_0x54604f,_0x227a8a),_0x760d7a=_0x3db16a[_0x4506d3(0x1f6)]+'/'+_0x32f1f2,_0x1f8dd9=buildLocalSqlFileContent({'sqlCode':_0xbad0a8[_0x4506d3(0x1ee)],'sqlName':_0xbad0a8[_0x4506d3(0x1d4)],'dbId':_0xbad0a8[_0x4506d3(0x1c9)]},_0x58e73c,{'dbName':_0x2f31c4,'mode':_0x54604f,'syncedAt':new Date()[_0x4506d3(0x1cd)](),'description':_0xbad0a8[_0x4506d3(0x208)]});if(await fileExists(_0x760d7a))throw CliErrors[_0x4506d3(0x1cf)](_0x4506d3(0x1f0)+_0x760d7a);await ensureParentDirectory(_0x760d7a),await writeFile(_0x760d7a,_0x1f8dd9,'utf8');const _0x283603=await readSqlLockFile(_0x3db16a[_0x4506d3(0x1ce)]),{lockData:_0x3546f7,appLock:_0xb719ea}=ensureSqlLockScope(_0x283603??createEmptySqlLock(),_0x3db16a[_0x4506d3(0x1e2)],_0x3db16a['sqlRoot'],_0x4506d3(0x1fd));return _0xb719ea[_0x4506d3(0x1df)][_0xbad0a8[_0x4506d3(0x1ee)]]={...buildSqlLockEntry(_0xbad0a8,_0x58e73c,computeSqlContentHash(_0x1f8dd9),{'dbName':_0x2f31c4}),'path':_0x32f1f2,'mode':_0x54604f},_0xb719ea['lastSync']=new Date()[_0x4506d3(0x1cd)](),await writeSqlLockFile(_0x3db16a[_0x4506d3(0x1ce)],_0x3546f7),{'ok':!![],'data':{'id':_0xbad0a8['id'],'sqlCode':_0xbad0a8[_0x4506d3(0x1ee)],'sqlName':_0xbad0a8[_0x4506d3(0x1d4)],'dbId':_0xbad0a8[_0x4506d3(0x1c9)],'path':_0x760d7a,'mode':_0x54604f},'message':_0x4506d3(0x202)+_0xbad0a8['sqlCode']};}};async function resolveSqlNewInputs(_0x223e0a){const _0x17d22b=await resolveSqlNameInput(_0x223e0a),{dbId:_0x4cb50a,dbName:_0x13ad82}=await resolveDbSelection(_0x223e0a),_0x25eb53=await resolveSqlModeInput(_0x223e0a);return{'sqlName':_0x17d22b,'dbId':_0x4cb50a,'dbName':_0x13ad82,'mode':_0x25eb53};}async function resolveSqlNameInput(_0x1ae09c){const _0x5388de=a196_0x492311,_0x552cf1=_0x1ae09c[_0x5388de(0x1ff)](_0x5388de(0x1fc))[_0x5388de(0x204)]();if(_0x552cf1)return _0x552cf1;if(_0x1ae09c[_0x5388de(0x1e1)])throw CliErrors[_0x5388de(0x20b)](_0x5388de(0x1fc),_0x5388de(0x1eb));return(await input({'message':'SQL\x20name:','validate':_0x2fef42=>_0x2fef42[_0x5388de(0x204)]()?!![]:_0x5388de(0x1d2)}))[_0x5388de(0x204)]();}async function resolveDbSelection(_0x2616bf){const _0x3913f5=a196_0x492311,_0x4c4573=resolveProvidedDbId(_0x2616bf);if(typeof _0x4c4573===_0x3913f5(0x1fb)&&Number[_0x3913f5(0x1de)](_0x4c4573)&&_0x4c4573>0x0)return{'dbId':_0x4c4573,'dbName':await getDbName(_0x2616bf[_0x3913f5(0x1e2)],_0x4c4573)[_0x3913f5(0x1ed)](()=>undefined)};if(_0x2616bf[_0x3913f5(0x1e1)])throw CliErrors['flagMissing'](_0x3913f5(0x1e9),_0x3913f5(0x209));const _0x4356c3=await listDatabases(_0x2616bf[_0x3913f5(0x1e2)])[_0x3913f5(0x1ed)](()=>[]);if(_0x4356c3[_0x3913f5(0x1f5)]===0x1)return{'dbId':_0x4356c3[0x0][_0x3913f5(0x1c9)],'dbName':_0x4356c3[0x0][_0x3913f5(0x1ef)]};if(_0x4356c3[_0x3913f5(0x1f5)]>0x1){const _0x5c30d6=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x4356c3[_0x3913f5(0x1db)](_0x37290e=>({'name':_0x37290e[_0x3913f5(0x1ef)]+'\x20('+_0x37290e[_0x3913f5(0x1c9)]+')','value':serializeDbSelection(_0x37290e)})),{'name':_0x3913f5(0x1c8),'value':_0x3913f5(0x1d8)}]});if(_0x5c30d6!==_0x3913f5(0x1d8))return deserializeDbSelection(_0x5c30d6);}const _0x4f50dc=await input({'message':'Target\x20database\x20dbId:','validate':_0x133d92=>{const _0x187203=_0x3913f5,_0x12dd77=_0x133d92['trim']();if(!_0x12dd77)return _0x187203(0x1dd);const _0x398761=Number(_0x12dd77);if(!Number[_0x187203(0x1cb)](_0x398761)||_0x398761<=0x0)return _0x187203(0x1d9);return!![];}});return{'dbId':Number(_0x4f50dc[_0x3913f5(0x204)]())};}async function resolveSqlModeInput(_0x39415c){const _0x5b7042=a196_0x492311,_0x41b34f=_0x39415c[_0x5b7042(0x1ff)]('mode')[_0x5b7042(0x204)]();if(_0x41b34f===_0x5b7042(0x1e5)||_0x41b34f===_0x5b7042(0x1ca))return _0x41b34f;if(_0x39415c[_0x5b7042(0x1e1)])throw CliErrors[_0x5b7042(0x20b)](_0x5b7042(0x20a),_0x5b7042(0x200));return await select({'message':_0x5b7042(0x1e3),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x5b7042(0x1e5),'description':_0x5b7042(0x1e8)},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':_0x5b7042(0x1ca),'description':_0x5b7042(0x1f4)}]});}function serializeDbSelection(_0x2d6659){const _0x5eaa18=a196_0x492311;return JSON[_0x5eaa18(0x20d)]({'dbId':_0x2d6659['dbId'],'dbName':_0x2d6659[_0x5eaa18(0x1ef)]});}function deserializeDbSelection(_0x41a362){const _0x5d685b=a196_0x492311;try{const _0x19b66c=JSON[_0x5d685b(0x1fe)](_0x41a362);if(typeof _0x19b66c[_0x5d685b(0x1c9)]==='number'&&Number[_0x5d685b(0x1de)](_0x19b66c[_0x5d685b(0x1c9)]))return{'dbId':_0x19b66c[_0x5d685b(0x1c9)],'dbName':_0x19b66c['dbName']};}catch{}throw CliErrors[_0x5d685b(0x1cf)](_0x5d685b(0x205)+_0x41a362);}function resolveProvidedDbId(_0x2b697a){const _0xdd6bed=a196_0x492311,_0x1bf510=_0x2b697a[_0xdd6bed(0x201)](_0xdd6bed(0x1e9));if(typeof _0x1bf510==='number'&&Number[_0xdd6bed(0x1de)](_0x1bf510))return _0x1bf510;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a197_0x2476de=a197_0x50aa;(function(_0x5648d9,_0x40eddf){const _0x5a8bc2=a197_0x50aa,_0x51e803=_0x5648d9();while(!![]){try{const _0x36fa7b=parseInt(_0x5a8bc2(0x153))/0x1*(parseInt(_0x5a8bc2(0x169))/0x2)+-parseInt(_0x5a8bc2(0x150))/0x3+parseInt(_0x5a8bc2(0x147))/0x4*(-parseInt(_0x5a8bc2(0x15e))/0x5)+parseInt(_0x5a8bc2(0x157))/0x6+parseInt(_0x5a8bc2(0x148))/0x7*(parseInt(_0x5a8bc2(0x14f))/0x8)+parseInt(_0x5a8bc2(0x151))/0x9+parseInt(_0x5a8bc2(0x146))/0xa*(parseInt(_0x5a8bc2(0x168))/0xb);if(_0x36fa7b===_0x40eddf)break;else _0x51e803['push'](_0x51e803['shift']());}catch(_0x3e600c){_0x51e803['push'](_0x51e803['shift']());}}}(a197_0x1671,0x8d5fd));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';function a197_0x1671(){const _0x4f9bfc=['42165tMMFDR','sql','sqls','validation','length','Deleted\x20','delete','lockFilePath','SQL\x20lock\x20file\x20not\x20found.','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','121waDaFp','46JXGPNJ','high-risk-write','POST','str','71870UWCUJt','356ffeBOK','153321yPQBxP','remoteId','projectRoot','toISOString','replace','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','fromEntries','72CWUJMW','2587422NPvWpF','2702961eofQbe','appCode','31885QSybHD','filter','sqlcode','sqlRoot','5293272jcgcAZ','startsWith','\x20(local\x20file\x20moved\x20to\x20trash)','entries','trashDir','trashedTo','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.'];a197_0x1671=function(){return _0x4f9bfc;};return a197_0x1671();}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';function a197_0x50aa(_0xfd0680,_0x420117){_0xfd0680=_0xfd0680-0x143;const _0x167128=a197_0x1671();let _0x50aa5f=_0x167128[_0xfd0680];return _0x50aa5f;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a197_0x2476de(0x15f),'command':a197_0x2476de(0x164),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a197_0x2476de(0x143),'flags':[SQLCODE_FLAG],async 'validate'(_0x190258){const _0x33546a=a197_0x2476de,_0x6eda05=loadSqlProjectConfig(_0x190258[_0x33546a(0x152)]),_0x2c2ed0=await readSqlLockFile(_0x6eda05[_0x33546a(0x165)]);if(!_0x2c2ed0)throw CliErrors[_0x33546a(0x161)](_0x33546a(0x15d));},async 'dryRun'(_0x26fa1b){const _0x7e178b=a197_0x2476de,_0x401315=loadSqlProjectConfig(_0x26fa1b[_0x7e178b(0x152)]),_0x5db8ad=await readSqlLockFile(_0x401315[_0x7e178b(0x165)]);if(!_0x5db8ad)throw CliErrors['validation'](_0x7e178b(0x15d));const {appLock:_0x2afd15}=ensureSqlLockScope(_0x5db8ad,_0x26fa1b[_0x7e178b(0x152)],_0x401315[_0x7e178b(0x156)],_0x7e178b(0x164)),_0x38e516=_0x26fa1b[_0x7e178b(0x145)](_0x7e178b(0x155)),_0x3edb47=_0x2afd15['sqls'][_0x38e516];if(!_0x3edb47)throw CliErrors[_0x7e178b(0x161)](_0x7e178b(0x167)+_0x38e516+'\x22.');return{'method':_0x7e178b(0x144),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x38e516,'id':_0x3edb47[_0x7e178b(0x149)],'localPath':resolveLocalSqlFilePath(_0x401315,_0x38e516,_0x3edb47)},'description':'Would\x20delete\x20SQL\x20'+_0x38e516+_0x7e178b(0x14d)+_0x401315['trashDir']};},async 'execute'(_0x4c032a){const _0x11015d=a197_0x2476de,_0x6d8f61=loadSqlProjectConfig(_0x4c032a[_0x11015d(0x152)]),_0x9555eb=await readSqlLockFile(_0x6d8f61[_0x11015d(0x165)]);if(!_0x9555eb)throw CliErrors['validation'](_0x11015d(0x166));const {lockData:_0x3feada,appLock:_0x7baf74}=ensureSqlLockScope(_0x9555eb,_0x4c032a[_0x11015d(0x152)],_0x6d8f61[_0x11015d(0x156)],_0x11015d(0x164)),_0x2fbe95=_0x4c032a[_0x11015d(0x145)](_0x11015d(0x155)),_0x4ee1aa=_0x7baf74[_0x11015d(0x160)][_0x2fbe95];if(!_0x4ee1aa)throw CliErrors['validation'](_0x11015d(0x167)+_0x2fbe95+'\x22.');await deleteSqlQuery({'id':_0x4ee1aa['remoteId'],'sqlCode':_0x2fbe95}),_0x7baf74[_0x11015d(0x160)]=Object[_0x11015d(0x14e)](Object[_0x11015d(0x15a)](_0x7baf74['sqls'])[_0x11015d(0x154)](([_0x1f3172])=>_0x1f3172!==_0x2fbe95)),_0x7baf74['lastSync']=new Date()[_0x11015d(0x14b)](),await writeSqlLockFile(_0x6d8f61['lockFilePath'],_0x3feada);const _0x1c399f=resolveLocalSqlFilePath(_0x6d8f61,_0x2fbe95,_0x4ee1aa);let _0x199ab3;await fileExists(_0x1c399f)&&(_0x199ab3=await moveToTrash(_0x6d8f61[_0x11015d(0x14a)],_0x6d8f61[_0x11015d(0x15b)],_0x1c399f),await cleanupEmptyDirectories(dirname(_0x1c399f),_0x6d8f61['sqlRootDir']));const _0x106590={'deleted':_0x2fbe95,'remoteId':_0x4ee1aa[_0x11015d(0x149)]};if(_0x199ab3)_0x106590[_0x11015d(0x15c)]=_0x199ab3;return{'ok':!![],'data':_0x106590,'message':_0x11015d(0x163)+_0x2fbe95+(_0x199ab3?_0x11015d(0x159):'')};}};async function moveToTrash(_0x12da92,_0x2c9171,_0x4113fe){const _0x27475a=a197_0x2476de,_0x158b5e=new Date()[_0x27475a(0x14b)]()[_0x27475a(0x14c)](/[:.]/g,'-'),_0x36736c=relative(_0x12da92,_0x4113fe),_0x422fc2=join(_0x2c9171,_0x158b5e,_0x36736c);return await mkdir(dirname(_0x422fc2),{'recursive':!![]}),await rename(_0x4113fe,_0x422fc2),_0x422fc2;}async function cleanupEmptyDirectories(_0x2bc47d,_0x203d8e){const _0x28c256=a197_0x2476de;let _0x293874=resolve(_0x2bc47d);const _0x52218f=resolve(_0x203d8e);while(_0x293874[_0x28c256(0x158)](''+_0x52218f+sep)||_0x293874===_0x52218f){if(_0x293874===_0x52218f)return;try{const _0x447e3d=await readdir(_0x293874);if(_0x447e3d[_0x28c256(0x162)]>0x0)return;await rmdir(_0x293874);}catch{return;}_0x293874=dirname(_0x293874);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a198_0x2c2983=a198_0x39f5;function a198_0x39f5(_0x3ac565,_0x2a47f6){_0x3ac565=_0x3ac565-0x96;const _0x5420dc=a198_0x5420();let _0x39f575=_0x5420dc[_0x3ac565];return _0x39f575;}(function(_0x29ce47,_0x8edf97){const _0x501015=a198_0x39f5,_0x214779=_0x29ce47();while(!![]){try{const _0x2b2a84=-parseInt(_0x501015(0xa7))/0x1+-parseInt(_0x501015(0x9f))/0x2+parseInt(_0x501015(0xa2))/0x3+parseInt(_0x501015(0x96))/0x4*(parseInt(_0x501015(0x99))/0x5)+parseInt(_0x501015(0xa9))/0x6*(parseInt(_0x501015(0xa3))/0x7)+parseInt(_0x501015(0x9c))/0x8*(parseInt(_0x501015(0xa6))/0x9)+parseInt(_0x501015(0xa5))/0xa*(parseInt(_0x501015(0xa4))/0xb);if(_0x2b2a84===_0x8edf97)break;else _0x214779['push'](_0x214779['shift']());}catch(_0x367632){_0x214779['push'](_0x214779['shift']());}}}(a198_0x5420,0xe56df));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a198_0x5420(){const _0x2b8666=['Return\x20full\x20raw\x20SQL\x20query\x20object','sql','1525210SsbeCd','sqlName','verbose','2242395tjCRKf','7klYBee','143YinEVS','126010rBASiK','5265HSKyuP','295056brHXgo','appCode','3461772VgBTvg','read','sqlcode','bool','8cjNvLB','str','boolean','450985StjuIX','description','dbId','4496zWRWEl'];a198_0x5420=function(){return _0x2b8666;};return a198_0x5420();}export const sqlDetail={'service':a198_0x2c2983(0x9e),'command':'detail','description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a198_0x2c2983(0xaa),'flags':[SQLCODE_FLAG,{'name':a198_0x2c2983(0xa1),'type':a198_0x2c2983(0x98),'description':a198_0x2c2983(0x9d)}],async 'execute'(_0x3d7396){const _0x4bbcbb=a198_0x2c2983,_0x50087e=await getSqlQueryInfo(_0x3d7396[_0x4bbcbb(0xa8)],_0x3d7396[_0x4bbcbb(0x97)](_0x4bbcbb(0xab))),_0x2c218b=_0x3d7396[_0x4bbcbb(0xac)](_0x4bbcbb(0xa1));if(_0x2c218b)return{'ok':!![],'data':_0x50087e};const _0x51bb94=_0x50087e[_0x4bbcbb(0x9b)]?await getDbName(_0x3d7396[_0x4bbcbb(0xa8)],_0x50087e[_0x4bbcbb(0x9b)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x50087e['sqlCode'],'sqlName':_0x50087e[_0x4bbcbb(0xa0)],'db':_0x51bb94?_0x51bb94+'\x20('+_0x50087e[_0x4bbcbb(0x9b)]+')':_0x50087e['dbId']??'','description':_0x50087e[_0x4bbcbb(0x9a)]??'','sqlContent':_0x50087e['sqlContent']??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a199_0x5328ae=a199_0x57b3;(function(_0x4e93ac,_0x27ca2e){const _0xc2da1c=a199_0x57b3,_0x21ab06=_0x4e93ac();while(!![]){try{const _0x4e39cf=parseInt(_0xc2da1c(0x9a))/0x1*(parseInt(_0xc2da1c(0xa1))/0x2)+-parseInt(_0xc2da1c(0x9c))/0x3*(parseInt(_0xc2da1c(0x9f))/0x4)+-parseInt(_0xc2da1c(0xa0))/0x5*(parseInt(_0xc2da1c(0x8d))/0x6)+-parseInt(_0xc2da1c(0x91))/0x7*(-parseInt(_0xc2da1c(0xaa))/0x8)+parseInt(_0xc2da1c(0xa8))/0x9*(-parseInt(_0xc2da1c(0x90))/0xa)+-parseInt(_0xc2da1c(0x9d))/0xb*(parseInt(_0xc2da1c(0xa7))/0xc)+-parseInt(_0xc2da1c(0x95))/0xd*(-parseInt(_0xc2da1c(0x99))/0xe);if(_0x4e39cf===_0x27ca2e)break;else _0x21ab06['push'](_0x21ab06['shift']());}catch(_0x501927){_0x21ab06['push'](_0x21ab06['shift']());}}}(a199_0x112e,0x25bad));import{executeSql}from'../../core/api-client.js';function a199_0x57b3(_0x456341,_0x4ee0cc){_0x456341=_0x456341-0x8d;const _0x112e53=a199_0x112e();let _0x57b3d9=_0x112e53[_0x456341];return _0x57b3d9;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a199_0x112e(){const _0xf3b403=['12DtbXEQ','11xOVQyW','string','172436fiwEei','10opDwjY','200730urAFwh','\x20row(s)\x20in\x20','isArray','appCode','Returned\x20','now','1410504jkqVIy','9ZaSnyz','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','600736DzmJnG','params','330564wuZzQS','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execError','1161070acUEGN','14HuopMW','SQL\x20execution\x20failed','str','sql','13PpFGIY','exec','read','length','5883710cQdRRb','1bbjhpr','execSuccess'];a199_0x112e=function(){return _0xf3b403;};return a199_0x112e();}export const sqlExec={'service':a199_0x5328ae(0x94),'command':a199_0x5328ae(0x96),'description':a199_0x5328ae(0x8e),'risk':a199_0x5328ae(0x97),'flags':[SQLCODE_FLAG,{'name':a199_0x5328ae(0xab),'type':a199_0x5328ae(0x9e),'description':a199_0x5328ae(0xa9)}],async 'execute'(_0x3008e6){const _0x16e6db=a199_0x5328ae,_0x2a571c=parseJsonParams(_0x3008e6['str'](_0x16e6db(0xab))),_0x4734ce=Date[_0x16e6db(0xa6)](),_0x4aabc3=await executeSql(_0x3008e6[_0x16e6db(0xa4)],_0x3008e6[_0x16e6db(0x93)]('sqlcode'),_0x2a571c),_0x391dde=Date[_0x16e6db(0xa6)]()-_0x4734ce,_0x36bb39=_0x4aabc3?.['execResult']??_0x4aabc3,_0x5a1e02=_0x4aabc3?.[_0x16e6db(0x9b)]??!![];if(!_0x5a1e02)return{'ok':![],'data':{'error':_0x4aabc3?.[_0x16e6db(0x8f)]||_0x16e6db(0x92),'elapsed':_0x391dde},'message':_0x16e6db(0x92)};const _0x4e1d9b=Array[_0x16e6db(0xa3)](_0x36bb39)?_0x36bb39:[];return{'ok':!![],'data':{'rows':_0x4e1d9b,'rowCount':_0x4e1d9b[_0x16e6db(0x98)],'elapsed':_0x391dde},'message':_0x16e6db(0xa5)+_0x4e1d9b['length']+_0x16e6db(0xa2)+_0x391dde+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4df921,_0x179264){const _0x36f203=a200_0x1d08,_0x20e2b2=_0x4df921();while(!![]){try{const _0x92e9ae=parseInt(_0x36f203(0x1b6))/0x1+parseInt(_0x36f203(0x1b9))/0x2*(parseInt(_0x36f203(0x1b8))/0x3)+-parseInt(_0x36f203(0x1b4))/0x4*(-parseInt(_0x36f203(0x1b0))/0x5)+-parseInt(_0x36f203(0x1b1))/0x6*(-parseInt(_0x36f203(0x1b3))/0x7)+parseInt(_0x36f203(0x1bb))/0x8*(parseInt(_0x36f203(0x1b7))/0x9)+parseInt(_0x36f203(0x1ba))/0xa+-parseInt(_0x36f203(0x1b5))/0xb*(parseInt(_0x36f203(0x1b2))/0xc);if(_0x92e9ae===_0x179264)break;else _0x20e2b2['push'](_0x20e2b2['shift']());}catch(_0x262ee8){_0x20e2b2['push'](_0x20e2b2['shift']());}}}(a200_0x43f4,0x28b65));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';function a200_0x1d08(_0x1da616,_0x5dae30){_0x1da616=_0x1da616-0x1b0;const _0x43f4b9=a200_0x43f4();let _0x1d089c=_0x43f4b9[_0x1da616];return _0x1d089c;}import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a200_0x43f4(){const _0x3192b7=['36gywfuU','11nSsWFC','297618CGtdVS','230643WpRjln','54411XWjuol','10ZXObFN','2683950aXyNCV','8eCYAXm','86725vwVWwt','786ZcwONy','8431068ioFfAs','1652iyEzvg'];a200_0x43f4=function(){return _0x3192b7;};return a200_0x43f4();}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 a201_0x25d7a3=a201_0x208c;(function(_0x42fce4,_0x41b14b){const _0x9331e4=a201_0x208c,_0x163045=_0x42fce4();while(!![]){try{const _0x337c11=-parseInt(_0x9331e4(0x150))/0x1*(-parseInt(_0x9331e4(0x157))/0x2)+parseInt(_0x9331e4(0x153))/0x3*(-parseInt(_0x9331e4(0x156))/0x4)+-parseInt(_0x9331e4(0x14d))/0x5*(-parseInt(_0x9331e4(0x14c))/0x6)+parseInt(_0x9331e4(0x15b))/0x7+parseInt(_0x9331e4(0x149))/0x8*(parseInt(_0x9331e4(0x147))/0x9)+-parseInt(_0x9331e4(0x155))/0xa+parseInt(_0x9331e4(0x144))/0xb*(-parseInt(_0x9331e4(0x152))/0xc);if(_0x337c11===_0x41b14b)break;else _0x163045['push'](_0x163045['shift']());}catch(_0x115a99){_0x163045['push'](_0x163045['shift']());}}}(a201_0x371b,0x3deed));import{listSqlQueries}from'../../core/api-client.js';function a201_0x371b(){const _0xc17bab=['boolean','name','dbId','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','1996489llBAua','length','read','18dVnEgR','sqlcode','1976872GfPXAm','totalCount','tableData','68496WsZBNd','185nPhtUT','map','pagesize','914eqffNf','page','24qRjiMt','171177cdsJFk','appCode','2204240RkVHHq','20kqXjQf','252rxiGqR','List\x20custom\x20SQL\x20queries','description','Page\x20size','634340xQmQdc','list','str','sqlCode','num','number','sql','verbose','Found\x20','bool','No\x20custom\x20SQL\x20queries\x20found.'];a201_0x371b=function(){return _0xc17bab;};return a201_0x371b();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a201_0x208c(_0x3d5e0e,_0x2ba049){_0x3d5e0e=_0x3d5e0e-0x143;const _0x371b08=a201_0x371b();let _0x208c9e=_0x371b08[_0x3d5e0e];return _0x208c9e;}export const sqlList={'service':a201_0x25d7a3(0x161),'command':a201_0x25d7a3(0x15c),'description':a201_0x25d7a3(0x158),'risk':a201_0x25d7a3(0x146),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a201_0x25d7a3(0x167),'type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a201_0x25d7a3(0x151),'type':'number','description':'Page\x20number','default':0x1},{'name':a201_0x25d7a3(0x14f),'type':a201_0x25d7a3(0x160),'description':a201_0x25d7a3(0x15a)},{'name':a201_0x25d7a3(0x162),'type':a201_0x25d7a3(0x166),'description':a201_0x25d7a3(0x143)}],async 'execute'(_0x1e3c0c){const _0x1ad4f6=a201_0x25d7a3,_0x12e421=await listSqlQueries(_0x1e3c0c[_0x1ad4f6(0x154)],{'sqlCode':_0x1e3c0c[_0x1ad4f6(0x15d)](_0x1ad4f6(0x148))||undefined,'sqlName':_0x1e3c0c[_0x1ad4f6(0x15d)](_0x1ad4f6(0x167))||undefined,'currentPage':_0x1e3c0c[_0x1ad4f6(0x15f)](_0x1ad4f6(0x151)),'pageSize':_0x1e3c0c[_0x1ad4f6(0x15f)](_0x1ad4f6(0x14f),0x32)}),_0x1c6b87=_0x1e3c0c[_0x1ad4f6(0x164)]('verbose'),_0x5c4b5f=_0x12e421[_0x1ad4f6(0x14b)]??[],_0x3c75b4=_0x12e421['paging']?.[_0x1ad4f6(0x14a)]??_0x5c4b5f[_0x1ad4f6(0x145)];let _0x46b36e;return _0x1c6b87?_0x46b36e=_0x5c4b5f:_0x46b36e=await Promise['all'](_0x5c4b5f[_0x1ad4f6(0x14e)](async _0x5a2279=>{const _0x3af562=_0x1ad4f6;let _0x185a6e;try{_0x185a6e=_0x5a2279['dbId']?await getDbName(_0x1e3c0c['appCode'],_0x5a2279['dbId']):undefined;}catch{}return{'sqlCode':_0x5a2279[_0x3af562(0x15e)],'sqlName':_0x5a2279['sqlName'],'description':_0x5a2279[_0x3af562(0x159)]??'','db':_0x185a6e?_0x185a6e+'\x20('+_0x5a2279[_0x3af562(0x168)]+')':_0x5a2279['dbId']??''};})),{'ok':!![],'data':_0x46b36e,'message':_0x5c4b5f[_0x1ad4f6(0x145)]===0x0?_0x1ad4f6(0x165):_0x1ad4f6(0x163)+_0x5c4b5f[_0x1ad4f6(0x145)]+'\x20SQL\x20queries\x20(total:\x20'+_0x3c75b4+').'};}};
|