@lovrabet/rabetbase-cli 2.5.1 → 2.5.2-beta.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.d.ts +3 -11
- 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/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.d.ts +0 -2
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +0 -2
- 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/supported-flags.d.ts +2 -0
- package/lib/framework/supported-flags.js +1 -0
- package/lib/framework/types.d.ts +2 -4
- 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 +3 -3
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +16 -44
- package/skills/rabetbase.manifest.json +3 -3
- package/lib/config/deployment-sync.d.ts +0 -10
- package/lib/config/deployment-sync.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x2e2b43=a185_0x25ee;function a185_0x4d37(){const _0x455dce=['Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flag','validation','num','27829104iURRyr','string','roleName','update','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','3642544drORsq','430705ZIBjmI','1359698UyhDom','Nothing\x20to\x20update.','dev','2166934mRjeIS','New\x20role\x20name','2581620VLvRhv','Updated\x20role\x20','appCode','POST','role','3cCubDp','remark','4139155EcEICB','name'];a185_0x4d37=function(){return _0x455dce;};return a185_0x4d37();}(function(_0x5ed277,_0x17ed7e){const _0xd50c2a=a185_0x25ee,_0x1f0b2d=_0x5ed277();while(!![]){try{const _0x41d8a9=-parseInt(_0xd50c2a(0xe1))/0x1+-parseInt(_0xd50c2a(0xe2))/0x2+parseInt(_0xd50c2a(0xd2))/0x3*(-parseInt(_0xd50c2a(0xe0))/0x4)+-parseInt(_0xd50c2a(0xd4))/0x5+-parseInt(_0xd50c2a(0xcd))/0x6+parseInt(_0xd50c2a(0xcb))/0x7+parseInt(_0xd50c2a(0xdb))/0x8;if(_0x41d8a9===_0x17ed7e)break;else _0x1f0b2d['push'](_0x1f0b2d['shift']());}catch(_0x216440){_0x1f0b2d['push'](_0x1f0b2d['shift']());}}}(a185_0x4d37,0x7c3ed));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a185_0x25ee(_0x4362e8,_0x29ec80){_0x4362e8=_0x4362e8-0xca;const _0x4d3780=a185_0x4d37();let _0x25ee5d=_0x4d3780[_0x4362e8];return _0x25ee5d;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x312bda){const _0x306e21=a185_0x25ee,_0x32efed=_0x312bda[_0x306e21(0xd8)](_0x306e21(0xd5)),_0x5b0e17=_0x312bda[_0x306e21(0xd8)](_0x306e21(0xd3)),_0x2f3007={};if(_0x32efed!==undefined&&_0x32efed!==null){const _0x271a35=String(_0x32efed)['trim']();if(!_0x271a35)throw CliErrors[_0x306e21(0xd9)]('--name\x20cannot\x20be\x20empty.');if(_0x271a35['length']>0x40)throw CliErrors['validation'](_0x306e21(0xd7));_0x2f3007[_0x306e21(0xdd)]=_0x271a35;}_0x5b0e17!==undefined&&_0x5b0e17!==null&&(_0x2f3007[_0x306e21(0xd3)]=String(_0x5b0e17));if(_0x2f3007['roleName']===undefined&&_0x2f3007['remark']===undefined)throw CliErrors[_0x306e21(0xd9)](_0x306e21(0xe3),_0x306e21(0xd6));return _0x2f3007;}export const roleUpdate={'service':a185_0x2e2b43(0xd1),'command':a185_0x2e2b43(0xde),'description':a185_0x2e2b43(0xdf),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a185_0x2e2b43(0xd5),'type':a185_0x2e2b43(0xdc),'required':![],'description':a185_0x2e2b43(0xcc)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x28971d){readPatch(_0x28971d);},async 'dryRun'(_0x586202){const _0x44057e=a185_0x2e2b43,_0x12d20b=_0x586202[_0x44057e(0xda)]('id'),_0x2aabe3=readPatch(_0x586202),_0x1d45f1=await getRoleById(_0x586202[_0x44057e(0xcf)],_0x12d20b);return assertCustomRole(_0x1d45f1,_0x44057e(0xde)),asDryRunResult({'scope':'dev','operation':_0x44057e(0xde),'selector':{'appCode':_0x586202['appCode'],'roleId':_0x12d20b,'roleName':_0x1d45f1[_0x44057e(0xdd)]},'before':projectRole(_0x1d45f1),'after':projectRole({..._0x1d45f1,..._0x2aabe3['roleName']!==undefined?{'roleName':_0x2aabe3[_0x44057e(0xdd)]}:{},..._0x2aabe3[_0x44057e(0xd3)]!==undefined?{'remark':_0x2aabe3[_0x44057e(0xd3)]}:{}}),'dryRun':!![],'backend':{'method':_0x44057e(0xd0),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x2a83b4){const _0x1d754d=a185_0x2e2b43,_0x43fa85=_0x2a83b4['num']('id'),_0x316cec=readPatch(_0x2a83b4),_0x11ddae=await getRoleById(_0x2a83b4[_0x1d754d(0xcf)],_0x43fa85);assertCustomRole(_0x11ddae,_0x1d754d(0xde)),await updateAppRole({'id':_0x43fa85,'appCode':_0x2a83b4[_0x1d754d(0xcf)],..._0x316cec[_0x1d754d(0xdd)]!==undefined?{'roleName':_0x316cec[_0x1d754d(0xdd)]}:{},..._0x316cec[_0x1d754d(0xd3)]!==undefined?{'remark':_0x316cec[_0x1d754d(0xd3)]}:{}});const _0x180c06=await getRoleById(_0x2a83b4['appCode'],_0x43fa85);return{'ok':!![],'data':{'scope':_0x1d754d(0xca),'operation':_0x1d754d(0xde),'selector':{'appCode':_0x2a83b4[_0x1d754d(0xcf)],'roleId':_0x43fa85,'roleName':_0x180c06[_0x1d754d(0xdd)]},'before':projectRole(_0x11ddae),'after':projectRole(_0x180c06),'dryRun':![],'backend':{'method':_0x1d754d(0xd0),'path':UPDATE_PATH},'warnings':[]},'message':_0x1d754d(0xce)+_0x180c06[_0x1d754d(0xdd)]+'\x20(id='+_0x43fa85+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a186_0x5095(){const _0x2967bd=['\x20already\x20in\x20role\x20','role','roleName','No\x20change:\x20user\x20','945HbjKiC','userId','36306FFTuqF','roleType','51464vSFZrQ','username','3137205OBovVR','user-add','selector','4390137obULIN','\x20to\x20role\x20','1000429yQcgGb','755kGwoGH','773062PfNVuB','1203436wPSGWE','appCode','POST','roleId'];a186_0x5095=function(){return _0x2967bd;};return a186_0x5095();}const a186_0x993015=a186_0x21e6;(function(_0x545f2e,_0x4411aa){const _0x59d0f2=a186_0x21e6,_0x10210d=_0x545f2e();while(!![]){try{const _0x247a96=-parseInt(_0x59d0f2(0x16b))/0x1+-parseInt(_0x59d0f2(0x16d))/0x2+parseInt(_0x59d0f2(0x166))/0x3+-parseInt(_0x59d0f2(0x16e))/0x4+-parseInt(_0x59d0f2(0x16c))/0x5*(-parseInt(_0x59d0f2(0x178))/0x6)+parseInt(_0x59d0f2(0x176))/0x7*(parseInt(_0x59d0f2(0x17a))/0x8)+-parseInt(_0x59d0f2(0x169))/0x9;if(_0x247a96===_0x4411aa)break;else _0x10210d['push'](_0x10210d['shift']());}catch(_0x284e50){_0x10210d['push'](_0x10210d['shift']());}}}(a186_0x5095,0x9f3f7));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a186_0x21e6(_0x25c408,_0x509040){_0x25c408=_0x25c408-0x166;const _0x5095b9=a186_0x5095();let _0x21e69e=_0x5095b9[_0x25c408];return _0x21e69e;}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_0x993015(0x173),'command':a186_0x993015(0x167),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4c7a4f){const _0x13edd5=a186_0x993015,{mutation:_0x4606d7}=await prepareUserMutation(_0x4c7a4f,_0x13edd5(0x167),!![]);return asDryRunResult(_0x4606d7,{'method':_0x13edd5(0x170),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2cbb41){const _0x506532=a186_0x993015,{mutation:_0x3d10a8,changed:_0x1c1c30,role:_0x58ac22,user:_0x5b738b}=await prepareUserMutation(_0x2cbb41,_0x506532(0x167),![]);return _0x1c1c30&&await createDevUserRole({'appCode':_0x2cbb41[_0x506532(0x16f)],'userId':_0x5b738b[_0x506532(0x177)],'username':_0x5b738b[_0x506532(0x17b)],'roleType':_0x58ac22[_0x506532(0x179)],'roleId':_0x3d10a8['selector'][_0x506532(0x171)]}),{'ok':!![],'data':_0x3d10a8,'message':_0x1c1c30?'Added\x20user\x20'+_0x3d10a8[_0x506532(0x168)]['userId']+_0x506532(0x16a)+_0x3d10a8[_0x506532(0x168)][_0x506532(0x174)]:_0x506532(0x175)+_0x3d10a8['selector'][_0x506532(0x177)]+_0x506532(0x172)+_0x3d10a8[_0x506532(0x168)][_0x506532(0x174)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a187_0x497f(){const _0x50e9c3=['24NsPuAr','high-risk-write','roleName','2318424iqgKYN','\x20not\x20in\x20role\x20','No\x20change:\x20user\x20','644796ognMId','userId','user-remove','336759FukPIK','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','28QCbsXY','7550564pGSSXd','selector','96745oRjxTr','4283510zkoNvN','144MYHpPG','\x20from\x20role\x20','21858AdoAMP'];a187_0x497f=function(){return _0x50e9c3;};return a187_0x497f();}const a187_0xf4de5e=a187_0x4955;(function(_0x3ec36d,_0x2dcd13){const _0x40f380=a187_0x4955,_0x5da859=_0x3ec36d();while(!![]){try{const _0x2fb8f1=parseInt(_0x40f380(0x1e2))/0x1*(-parseInt(_0x40f380(0x1e1))/0x2)+parseInt(_0x40f380(0x1d8))/0x3+-parseInt(_0x40f380(0x1da))/0x4*(parseInt(_0x40f380(0x1dd))/0x5)+parseInt(_0x40f380(0x1d2))/0x6+-parseInt(_0x40f380(0x1db))/0x7+parseInt(_0x40f380(0x1df))/0x8*(parseInt(_0x40f380(0x1d5))/0x9)+parseInt(_0x40f380(0x1de))/0xa;if(_0x2fb8f1===_0x2dcd13)break;else _0x5da859['push'](_0x5da859['shift']());}catch(_0x2cbadc){_0x5da859['push'](_0x5da859['shift']());}}}(a187_0x497f,0xb4b71));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x4955(_0x48d28c,_0x4cd2ad){_0x48d28c=_0x48d28c-0x1d1;const _0x497fa8=a187_0x497f();let _0x495558=_0x497fa8[_0x48d28c];return _0x495558;}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':'user-remove','description':a187_0xf4de5e(0x1d9),'risk':a187_0xf4de5e(0x1e3),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1c54d4){const _0x42d75f=a187_0xf4de5e,{mutation:_0x35953b}=await prepareUserMutation(_0x1c54d4,_0x42d75f(0x1d7),!![]);return asDryRunResult(_0x35953b,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5e2a88){const _0x32d825=a187_0xf4de5e,{matchingRelationIds:_0x1a8979,mutation:_0x1fbb2f,changed:_0x1ec4ce}=await prepareUserMutation(_0x5e2a88,_0x32d825(0x1d7),![]);if(_0x1ec4ce)for(const _0x1eccd6 of _0x1a8979){await deleteDevUserRole(_0x1eccd6);}return{'ok':!![],'data':_0x1fbb2f,'message':_0x1ec4ce?'Removed\x20user\x20'+_0x1fbb2f[_0x32d825(0x1dc)][_0x32d825(0x1d6)]+_0x32d825(0x1e0)+_0x1fbb2f[_0x32d825(0x1dc)][_0x32d825(0x1d1)]:_0x32d825(0x1d4)+_0x1fbb2f['selector'][_0x32d825(0x1d6)]+_0x32d825(0x1d3)+_0x1fbb2f[_0x32d825(0x1dc)][_0x32d825(0x1d1)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a188_0x15d10e=a188_0xb31a;(function(_0x1e7d47,_0x3cb1c9){const _0x35fabb=a188_0xb31a,_0x24e191=_0x1e7d47();while(!![]){try{const _0x45b35d=-parseInt(_0x35fabb(0x1b6))/0x1+-parseInt(_0x35fabb(0x1ba))/0x2+parseInt(_0x35fabb(0x1b5))/0x3*(-parseInt(_0x35fabb(0x1a5))/0x4)+-parseInt(_0x35fabb(0x1a8))/0x5+parseInt(_0x35fabb(0x1b4))/0x6*(parseInt(_0x35fabb(0x1af))/0x7)+parseInt(_0x35fabb(0x1ad))/0x8*(parseInt(_0x35fabb(0x1b2))/0x9)+parseInt(_0x35fabb(0x1a9))/0xa*(parseInt(_0x35fabb(0x1a6))/0xb);if(_0x45b35d===_0x3cb1c9)break;else _0x24e191['push'](_0x24e191['shift']());}catch(_0x571b1d){_0x24e191['push'](_0x24e191['shift']());}}}(a188_0x11b7,0x7add0));function a188_0xb31a(_0x1bd5c5,_0x197e69){_0x1bd5c5=_0x1bd5c5-0x1a3;const _0x11b761=a188_0x11b7();let _0xb31a9e=_0x11b761[_0x1bd5c5];return _0xb31a9e;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a188_0x11b7(){const _0x22dd65=['name','nickname','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','190864uXFwPG','username','28bOissm','role','Pass\x20--name\x20<nickname|username>.','162wrVdHd','str','481038aTOWPg','3PSUdzU','403370bMiYka','userId','read','user-resolve','814166sXyFHA','matchedBy','flagMissing','2008228yXzCHU','847CqrJjG','trim','4581405XRdzzS','257390sOSmip'];a188_0x11b7=function(){return _0x22dd65;};return a188_0x11b7();}export const roleUserResolve={'service':a188_0x15d10e(0x1b0),'command':a188_0x15d10e(0x1b9),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a188_0x15d10e(0x1b8),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x246810){const _0x382066=a188_0x15d10e;if(!_0x246810[_0x382066(0x1b3)](_0x382066(0x1aa))[_0x382066(0x1a7)]())throw CliErrors[_0x382066(0x1a4)]('name',_0x382066(0x1b1));},async 'execute'(_0x4c8b26){const _0x4e90b3=a188_0x15d10e,_0x44c4d4=_0x4c8b26[_0x4e90b3(0x1b3)](_0x4e90b3(0x1aa))[_0x4e90b3(0x1a7)](),_0x228103=await resolveUserRef(_0x44c4d4,_0x4e90b3(0x1ac));return{'ok':!![],'data':{'user':{'userId':_0x228103[_0x4e90b3(0x1b7)],'username':_0x228103[_0x4e90b3(0x1ae)],'nickname':_0x228103[_0x4e90b3(0x1ab)],'matchedBy':_0x228103[_0x4e90b3(0x1a3)]}},'message':'Resolved\x20\x22'+_0x44c4d4+'\x22\x20→\x20userId\x20'+_0x228103[_0x4e90b3(0x1b7)]};}};
|
package/lib/commands/rule/get.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a189_0x5d30(_0x29487c,_0x4743cd){_0x29487c=_0x29487c-0x1cc;const _0xbb5428=a189_0xbb54();let _0x5d30da=_0xbb5428[_0x29487c];return _0x5d30da;}const a189_0x1d3efd=a189_0x5d30;(function(_0x45cb16,_0x414d6b){const _0x3982b5=a189_0x5d30,_0x1262d4=_0x45cb16();while(!![]){try{const _0x32cfa7=parseInt(_0x3982b5(0x1cd))/0x1*(-parseInt(_0x3982b5(0x1df))/0x2)+-parseInt(_0x3982b5(0x1cc))/0x3*(-parseInt(_0x3982b5(0x1d1))/0x4)+parseInt(_0x3982b5(0x1dc))/0x5*(parseInt(_0x3982b5(0x1d7))/0x6)+parseInt(_0x3982b5(0x1da))/0x7*(-parseInt(_0x3982b5(0x1d8))/0x8)+-parseInt(_0x3982b5(0x1db))/0x9*(-parseInt(_0x3982b5(0x1d2))/0xa)+parseInt(_0x3982b5(0x1cf))/0xb+-parseInt(_0x3982b5(0x1e2))/0xc;if(_0x32cfa7===_0x414d6b)break;else _0x1262d4['push'](_0x1262d4['shift']());}catch(_0x22a50d){_0x1262d4['push'](_0x1262d4['shift']());}}}(a189_0xbb54,0xcfe66));import{getAppRule}from'../../core/api-client.js';function a189_0xbb54(){const _0x2684d2=['content','app_rule_not_found','1652878kLYMBb','Loaded\x20','\x20--file\x20<path>\x20--dry-run`.','26372040CqmDQF','get','80529izbVXC','1qHwlFd','cookie','15287954NQnTnQ','read','8uTHevd','140QRFJVO','\x20is\x20not\x20configured\x20for\x20app\x20','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','appCode','\x20for\x20','6XyPSrO','256kmCcnm','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','50547uYDGHt','652518oDUxtv','8241055YkCxGl'];a189_0xbb54=function(){return _0x2684d2;};return a189_0xbb54();}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':'rule','command':a189_0x1d3efd(0x1e3),'description':a189_0x1d3efd(0x1d4),'risk':a189_0x1d3efd(0x1d0),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x57f297){readAppRuleType(_0x57f297);},async 'execute'(_0x5368e7){const _0x519879=a189_0x1d3efd,_0x2d2416=readAppRuleType(_0x5368e7),_0x3fd306=await getAppRule(_0x5368e7[_0x519879(0x1ce)],{'appCode':_0x5368e7[_0x519879(0x1d5)],'type':_0x2d2416});if(!_0x3fd306)throw appRuleError(_0x519879(0x1de),appRuleFileName(_0x2d2416)+_0x519879(0x1d3)+_0x5368e7[_0x519879(0x1d5)]+'.',_0x519879(0x1d9)+_0x2d2416+_0x519879(0x1e1));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x2d2416,_0x3fd306),'content':_0x3fd306[_0x519879(0x1dd)]}},'message':_0x519879(0x1e0)+appRuleFileName(_0x2d2416)+_0x519879(0x1d6)+_0x5368e7[_0x519879(0x1d5)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a190_0x18df(_0x918dc4,_0x521052){_0x918dc4=_0x918dc4-0x151;const _0x5d368c=a190_0x5d36();let _0x18df84=_0x5d368c[_0x918dc4];return _0x18df84;}(function(_0x4333bb,_0x40245b){const _0x80025f=a190_0x18df,_0x33c151=_0x4333bb();while(!![]){try{const _0x39cff7=parseInt(_0x80025f(0x156))/0x1*(parseInt(_0x80025f(0x154))/0x2)+parseInt(_0x80025f(0x159))/0x3+parseInt(_0x80025f(0x151))/0x4*(-parseInt(_0x80025f(0x155))/0x5)+parseInt(_0x80025f(0x15d))/0x6*(parseInt(_0x80025f(0x153))/0x7)+parseInt(_0x80025f(0x15a))/0x8*(-parseInt(_0x80025f(0x15c))/0x9)+parseInt(_0x80025f(0x158))/0xa*(parseInt(_0x80025f(0x15b))/0xb)+parseInt(_0x80025f(0x152))/0xc*(-parseInt(_0x80025f(0x157))/0xd);if(_0x39cff7===_0x40245b)break;else _0x33c151['push'](_0x33c151['shift']());}catch(_0x4cc47d){_0x33c151['push'](_0x33c151['shift']());}}}(a190_0x5d36,0x45fc6));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';function a190_0x5d36(){const _0x549214=['33dLbJUX','3186RJJGSS','333978DHOWXr','910148xpCujz','180tXkkFJ','14jVJKEa','14DJzDre','5BOFLrv','75689vIFJzY','763464CrlBIf','1726850CjcNMO','904215SqQLQV','1480pXndxI'];a190_0x5d36=function(){return _0x549214;};return a190_0x5d36();}export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a191_0x2b6a0d=a191_0x4921;function a191_0x1ced(){const _0xeaabd5=['appCode','list','length','35dPiEJI','3897PZbJBo','3580FuBKrG','1082496xDfNTh','map','64892LyfCJF','156eXxMbt','434962Rdpwsm','998qBNqep','2097753qjlrGk','all','166512rcOUUB','57xNzEOr','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','388iBnaqq','rule'];a191_0x1ced=function(){return _0xeaabd5;};return a191_0x1ced();}(function(_0x570169,_0xe68810){const _0x53230a=a191_0x4921,_0x61f924=_0x570169();while(!![]){try{const _0x48966b=-parseInt(_0x53230a(0x8a))/0x1*(parseInt(_0x53230a(0x84))/0x2)+-parseInt(_0x53230a(0x88))/0x3*(parseInt(_0x53230a(0x81))/0x4)+-parseInt(_0x53230a(0x8f))/0x5*(-parseInt(_0x53230a(0x87))/0x6)+-parseInt(_0x53230a(0x85))/0x7+parseInt(_0x53230a(0x7f))/0x8+-parseInt(_0x53230a(0x90))/0x9*(-parseInt(_0x53230a(0x7e))/0xa)+parseInt(_0x53230a(0x83))/0xb*(parseInt(_0x53230a(0x82))/0xc);if(_0x48966b===_0xe68810)break;else _0x61f924['push'](_0x61f924['shift']());}catch(_0x4258b6){_0x61f924['push'](_0x61f924['shift']());}}}(a191_0x1ced,0x301f4));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a191_0x4921(_0x25d2b5,_0x7c0fb4){_0x25d2b5=_0x25d2b5-0x7e;const _0x1cedfd=a191_0x1ced();let _0x4921d1=_0x1cedfd[_0x25d2b5];return _0x4921d1;}export const ruleList={'service':a191_0x2b6a0d(0x8b),'command':a191_0x2b6a0d(0x8d),'description':a191_0x2b6a0d(0x89),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x23b85a){const _0x5bf825=a191_0x2b6a0d,_0x539b2c=await Promise[_0x5bf825(0x86)](APP_RULE_TYPES[_0x5bf825(0x80)](_0x3a93ec=>getAppRule(_0x23b85a['cookie'],{'appCode':_0x23b85a[_0x5bf825(0x8c)],'type':_0x3a93ec}))),_0x2e0aa0=APP_RULE_TYPES[_0x5bf825(0x80)]((_0x2ceab5,_0xa088d6)=>projectAppRule(_0x2ceab5,_0x539b2c[_0xa088d6]??null));return{'ok':!![],'data':{'total':_0x2e0aa0[_0x5bf825(0x8e)],'rules':_0x2e0aa0},'message':'Loaded\x20app\x20rule\x20configuration\x20for\x20'+_0x23b85a['appCode']};}};
|
package/lib/commands/rule/set.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a192_0x1fb0e3=a192_0x3684;(function(_0x343eaa,_0x3d9a3e){const _0x33034d=a192_0x3684,_0x1fb4b0=_0x343eaa();while(!![]){try{const _0x47ac81=parseInt(_0x33034d(0x18e))/0x1*(parseInt(_0x33034d(0x1a5))/0x2)+parseInt(_0x33034d(0x1c3))/0x3+parseInt(_0x33034d(0x199))/0x4*(-parseInt(_0x33034d(0x1c7))/0x5)+-parseInt(_0x33034d(0x19e))/0x6+parseInt(_0x33034d(0x198))/0x7+-parseInt(_0x33034d(0x1bd))/0x8*(-parseInt(_0x33034d(0x1a0))/0x9)+-parseInt(_0x33034d(0x1c1))/0xa;if(_0x47ac81===_0x3d9a3e)break;else _0x1fb4b0['push'](_0x1fb4b0['shift']());}catch(_0x444932){_0x1fb4b0['push'](_0x1fb4b0['shift']());}}}(a192_0x5a92,0x403b6));function a192_0x3684(_0x52a9a9,_0x28138a){_0x52a9a9=_0x52a9a9-0x18b;const _0x5a921f=a192_0x5a92();let _0x36846f=_0x5a921f[_0x52a9a9];return _0x36846f;}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';const SAVE_PATH=a192_0x1fb0e3(0x19f),NON_ATOMIC_WARNING=a192_0x1fb0e3(0x19b);function readSetInput(_0x1d7076){const _0x11c837=a192_0x1fb0e3,_0x5dc5ef=readAppRuleType(_0x1d7076),_0x2736f1=_0x1d7076[_0x11c837(0x1bb)](_0x11c837(0x1a8))[_0x11c837(0x1be)]();if(!_0x2736f1)throw appRuleError(_0x11c837(0x1b1),_0x11c837(0x1c0),_0x11c837(0x1a4));const _0x58af21=_0x1d7076[_0x11c837(0x1a1)](_0x11c837(0x1b6));let _0x5465e7;if(_0x58af21!==undefined){_0x5465e7=Number(_0x58af21);if(!Number['isSafeInteger'](_0x5465e7)||_0x5465e7<0x0)throw appRuleError(_0x11c837(0x1b8),_0x11c837(0x18f));}return{'type':_0x5dc5ef,'file':_0x2736f1,'expectedVersion':_0x5465e7};}async function prepareSet(_0x4f5d9c){const _0x1f13dc=a192_0x1fb0e3,_0x40fe15=readSetInput(_0x4f5d9c),_0x4ccd4a=await readAppRuleFile(_0x40fe15[_0x1f13dc(0x1a8)]),_0x50cede=await getAppRule(_0x4f5d9c[_0x1f13dc(0x191)],{'appCode':_0x4f5d9c['appCode'],'type':_0x40fe15['type']});if(_0x40fe15[_0x1f13dc(0x19c)]!==undefined&&_0x50cede?.[_0x1f13dc(0x1b3)]!==_0x40fe15[_0x1f13dc(0x19c)])throw appRuleError(_0x1f13dc(0x1ac),appRuleFileName(_0x40fe15[_0x1f13dc(0x1ad)])+_0x1f13dc(0x196),'Expected\x20'+_0x40fe15['expectedVersion']+_0x1f13dc(0x1ab)+(_0x50cede?.[_0x1f13dc(0x1b3)]??_0x1f13dc(0x18b))+_0x1f13dc(0x193));return{'input':_0x40fe15,'replacement':_0x4ccd4a,'beforeRecord':_0x50cede,'before':projectAppRule(_0x40fe15['type'],_0x50cede),'planned':{'type':_0x40fe15[_0x1f13dc(0x1ad)],'fileName':appRuleFileName(_0x40fe15[_0x1f13dc(0x1ad)]),'contextScope':appRuleContextScope(_0x40fe15[_0x1f13dc(0x1ad)]),'enabled':!![],'appCode':_0x4f5d9c[_0x1f13dc(0x1b9)],'scope':_0x1f13dc(0x1a9),'contentByteSize':_0x4ccd4a['byteSize'],'contentHash':_0x4ccd4a['contentHash']}};}function warningsFor(_0x20b047){return _0x20b047===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':'rule','command':a192_0x1fb0e3(0x1b4),'description':a192_0x1fb0e3(0x1a7),'risk':a192_0x1fb0e3(0x19d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':a192_0x1fb0e3(0x1b2),'required':!![],'description':a192_0x1fb0e3(0x1c8)},{'name':a192_0x1fb0e3(0x1b6),'type':a192_0x1fb0e3(0x1bf),'required':![],'description':a192_0x1fb0e3(0x1a6)}],async 'validate'(_0x2cb2fd){readSetInput(_0x2cb2fd);},async 'dryRun'(_0x3489c0){const _0x283119=a192_0x1fb0e3,_0x490398=await prepareSet(_0x3489c0);return asDryRunResult({'operation':_0x283119(0x1b4),'selector':{'appCode':_0x3489c0[_0x283119(0x1b9)],'scope':_0x283119(0x1a9),'type':_0x490398['input'][_0x283119(0x1ad)]},'before':_0x490398[_0x283119(0x1ae)],'after':_0x490398[_0x283119(0x1b5)],'dryRun':!![],'backend':{'method':_0x283119(0x1b0),'path':SAVE_PATH},'warnings':warningsFor(_0x490398[_0x283119(0x192)][_0x283119(0x19c)]),'verification':{'expectedVersion':_0x490398[_0x283119(0x192)][_0x283119(0x19c)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x283119(0x197)+_0x490398[_0x283119(0x192)][_0x283119(0x1ad)]+_0x283119(0x1c4)}},{'method':_0x283119(0x1b0),'url':SAVE_PATH});},async 'execute'(_0x2508fc){const _0x20ce8f=a192_0x1fb0e3,_0x56ee78=await prepareSet(_0x2508fc);let _0x2b33d2=![];try{await saveAppRule(_0x2508fc['cookie'],{'appCode':_0x2508fc[_0x20ce8f(0x1b9)],'type':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)],'content':_0x56ee78[_0x20ce8f(0x1b7)][_0x20ce8f(0x190)]});}catch(_0x55a99d){if(!isPlatformTransportFailure(_0x55a99d))throw _0x55a99d;_0x2b33d2=!![];}let _0x43b699;try{_0x43b699=await getAppRule(_0x2508fc[_0x20ce8f(0x191)],{'appCode':_0x2508fc[_0x20ce8f(0x1b9)],'type':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)]});}catch(_0x1b760b){const _0x20b326=appRuleError(_0x2b33d2?'app_rule_set_outcome_unknown':_0x20ce8f(0x19a),_0x20ce8f(0x1a2)+appRuleFileName(_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)])+_0x20ce8f(0x1a3),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object['defineProperty'](_0x20b326,_0x20ce8f(0x1c5),{'value':_0x1b760b,'enumerable':![]});throw _0x20b326;}const _0x21e9d9=_0x43b699&&inspectAppRuleContent(_0x43b699[_0x20ce8f(0x190)])[_0x20ce8f(0x1c6)]===_0x56ee78[_0x20ce8f(0x1b7)][_0x20ce8f(0x1c6)],_0x3445a2=_0x43b699&&(_0x56ee78['beforeRecord']===null||_0x43b699[_0x20ce8f(0x1b3)]>_0x56ee78[_0x20ce8f(0x18c)]['version']);if(!_0x43b699||!_0x21e9d9||!_0x3445a2)throw appRuleError(_0x2b33d2?_0x20ce8f(0x1c2):_0x20ce8f(0x1ba),appRuleFileName(_0x56ee78['input']['type'])+_0x20ce8f(0x1af),_0x20ce8f(0x18d)+_0x56ee78[_0x20ce8f(0x192)]['type']+_0x20ce8f(0x194));const _0x3d6809=warningsFor(_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x19c)]);_0x2b33d2&&_0x3d6809[_0x20ce8f(0x1aa)](_0x20ce8f(0x1bc));const _0x1b780d=projectAppRule(_0x56ee78['input']['type'],_0x43b699);return{'ok':!![],'data':{'operation':_0x20ce8f(0x1b4),'selector':{'appCode':_0x2508fc[_0x20ce8f(0x1b9)],'scope':_0x20ce8f(0x1a9),'type':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)]},'before':_0x56ee78[_0x20ce8f(0x1ae)],'after':_0x1b780d,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x3d6809,'verification':{'status':_0x20ce8f(0x195),'recoveredAfterUnknownResponse':_0x2b33d2,'expectedVersion':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x19c)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x20ce8f(0x197)+_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)]+_0x20ce8f(0x1c4)}},'message':'Set\x20'+appRuleFileName(_0x56ee78['input']['type'])+'\x20for\x20'+_0x2508fc[_0x20ce8f(0x1b9)]};}};function a192_0x5a92(){const _0x408ce2=['\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','verified','\x20version\x20changed\x20before\x20write.','rabetbase\x20rule\x20get\x20--type\x20','2400440pQZuLZ','107324QuzUGj','app_rule_verification_unavailable','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','expectedVersion','write','399816tTWMmP','/smartapi/knowledge-base/save','9negYvy','flag','The\x20set\x20request\x20was\x20sent,\x20but\x20','\x20could\x20not\x20be\x20verified.','Pass\x20a\x20UTF-8\x20Markdown\x20file.','4ohKCzF','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','file','rules','push',';\x20current\x20version\x20is\x20','app_rule_version_mismatch','type','before','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','POST','app_rule_file_required','string','version','set','planned','expected-version','replacement','app_rule_expected_version_invalid','appCode','app_rule_verification_failed','str','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','1925656DVSJsa','trim','number','--file\x20is\x20required.','1946940AwsZBF','app_rule_set_outcome_unknown','691128ygjjrM','\x20--format\x20compress','cause','contentHash','95BNGmCq','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','unconfigured','beforeRecord','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','110105HWgvRJ','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','content','cookie','input','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.'];a192_0x5a92=function(){return _0x408ce2;};return a192_0x5a92();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a193_0x3fc4f6=a193_0x40df;(function(_0x37bee8,_0x49a7f0){const _0x20ba93=a193_0x40df,_0x99c238=_0x37bee8();while(!![]){try{const _0x4658c0=-parseInt(_0x20ba93(0xca))/0x1+parseInt(_0x20ba93(0xcf))/0x2+parseInt(_0x20ba93(0xc5))/0x3+-parseInt(_0x20ba93(0xe9))/0x4*(parseInt(_0x20ba93(0xdf))/0x5)+-parseInt(_0x20ba93(0xcb))/0x6*(parseInt(_0x20ba93(0xe0))/0x7)+-parseInt(_0x20ba93(0xe7))/0x8*(parseInt(_0x20ba93(0xec))/0x9)+parseInt(_0x20ba93(0xe1))/0xa;if(_0x4658c0===_0x49a7f0)break;else _0x99c238['push'](_0x99c238['shift']());}catch(_0xdefe76){_0x99c238['push'](_0x99c238['shift']());}}}(a193_0x2d78,0x4e950));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';function a193_0x40df(_0x3537e3,_0x1236f0){_0x3537e3=_0x3537e3-0xc3;const _0x2d785b=a193_0x2d78();let _0x40df5c=_0x2d785b[_0x3537e3];return _0x40df5c;}import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a193_0x3fc4f6(0xd4),a193_0x3fc4f6(0xe3)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':'RULES.md','database':a193_0x3fc4f6(0xd0)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a193_0x3fc4f6(0xd7)};export function appRuleError(_0x216bb2,_0x5cafe8,_0x4dd83b){return new CliError(_0x216bb2,0x1,_0x5cafe8,_0x4dd83b);}export function readAppRuleType(_0x1a5705){const _0xdfa556=a193_0x3fc4f6,_0x411316=_0x1a5705[_0xdfa556(0xea)](_0xdfa556(0xed))[_0xdfa556(0xe4)]()['toLowerCase']();if(_0x411316!==_0xdfa556(0xd4)&&_0x411316!==_0xdfa556(0xe3))throw appRuleError(_0xdfa556(0xd6),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x411316;}function a193_0x2d78(){const _0x3f1a47=['109026Xybefk','DATABASE.md','message','--file\x20is\x20required.','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','rules','update','app_rule_type_invalid','database-analysis','size','byteLength','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','utf8','string','byteSize','sha256','45xBhNrz','4205299QPqMpa','14193570TPYMMI','contentHash','database','trim','App\x20rule\x20file\x20is\x20blank:\x20','from','24JoKjDs','scope','162076RVOBrR','str','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','470268nXubTP','type','Cannot\x20read\x20app\x20rule\x20file:\x20','createTime','882645ipHRkS','Cannot\x20access\x20app\x20rule\x20file:\x20','appCode','version','updateTime','324029fdqpXk','6ZEFfbn','app_rule_file_invalid','utf-8','app_rule_content_invalid'];a193_0x2d78=function(){return _0x3f1a47;};return a193_0x2d78();}export function appRuleFileName(_0xd0afa5){return APP_RULE_FILES[_0xd0afa5];}export function appRuleContextScope(_0x5a07ef){return APP_RULE_CONTEXT_SCOPES[_0x5a07ef];}export function inspectAppRuleContent(_0x345da7){const _0x2ed7c6=a193_0x3fc4f6,_0x87f795=Buffer[_0x2ed7c6(0xe6)](_0x345da7,_0x2ed7c6(0xdb));return{'content':_0x345da7,'byteSize':_0x87f795['byteLength'],'contentHash':'sha256:'+createHash(_0x2ed7c6(0xde))[_0x2ed7c6(0xd5)](_0x87f795)['digest']('hex')};}export async function readAppRuleFile(_0x3e11cd){const _0x1fcbad=a193_0x3fc4f6,_0x21dc63=_0x3e11cd[_0x1fcbad(0xe4)]();if(!_0x21dc63)throw appRuleError('app_rule_file_required',_0x1fcbad(0xd2),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x17ed0c=resolve(_0x21dc63);let _0x153a92;try{_0x153a92=await stat(_0x17ed0c);}catch(_0x4da2b7){throw appRuleError('app_rule_file_unreadable',_0x1fcbad(0xc6)+_0x21dc63,_0x4da2b7 instanceof Error?_0x4da2b7[_0x1fcbad(0xd1)]:String(_0x4da2b7));}if(!_0x153a92['isFile']())throw appRuleError(_0x1fcbad(0xcc),_0x1fcbad(0xd3)+_0x21dc63);if(_0x153a92[_0x1fcbad(0xd8)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x1fcbad(0xeb));let _0x273088;try{_0x273088=await readFile(_0x17ed0c);}catch(_0x18b9a2){throw appRuleError('app_rule_file_unreadable',_0x1fcbad(0xc3)+_0x21dc63,_0x18b9a2 instanceof Error?_0x18b9a2[_0x1fcbad(0xd1)]:String(_0x18b9a2));}if(_0x273088[_0x1fcbad(0xd9)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x1fcbad(0xeb));let _0x1232fa;try{_0x1232fa=new TextDecoder(_0x1fcbad(0xcd),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x273088);}catch{throw appRuleError(_0x1fcbad(0xce),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x21dc63);}if(!_0x1232fa[_0x1fcbad(0xe4)]())throw appRuleError(_0x1fcbad(0xce),_0x1fcbad(0xe5)+_0x21dc63);return inspectAppRuleContent(_0x1232fa);}export function projectAppRule(_0x159b80,_0x5f3b8d){const _0x3254f4=a193_0x3fc4f6;if(!_0x5f3b8d)return{'type':_0x159b80,'fileName':appRuleFileName(_0x159b80),'contextScope':appRuleContextScope(_0x159b80),'enabled':![]};const _0x156f94=inspectAppRuleContent(_0x5f3b8d['content']);return{'type':_0x159b80,'fileName':appRuleFileName(_0x159b80),'contextScope':appRuleContextScope(_0x159b80),'enabled':!![],'id':_0x5f3b8d['id'],'scope':_0x5f3b8d[_0x3254f4(0xe8)],'appCode':_0x5f3b8d[_0x3254f4(0xc7)],'version':_0x5f3b8d[_0x3254f4(0xc8)],'contentByteSize':_0x156f94[_0x3254f4(0xdd)],'contentHash':_0x156f94[_0x3254f4(0xe2)],..._0x5f3b8d['createTime']!==undefined&&_0x5f3b8d[_0x3254f4(0xc4)]!==null?{'createTime':_0x5f3b8d[_0x3254f4(0xc4)]}:{},..._0x5f3b8d[_0x3254f4(0xc9)]!==undefined&&_0x5f3b8d[_0x3254f4(0xc9)]!==null?{'updateTime':_0x5f3b8d[_0x3254f4(0xc9)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':'type','type':a193_0x3fc4f6(0xdc),'required':!![],'description':a193_0x3fc4f6(0xda),'enum':[...APP_RULE_TYPES]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a194_0x24aee1=a194_0x4077;(function(_0x24e076,_0x496871){const _0x2b0663=a194_0x4077,_0x24014e=_0x24e076();while(!![]){try{const _0x16818a=-parseInt(_0x2b0663(0x146))/0x1*(-parseInt(_0x2b0663(0x13e))/0x2)+parseInt(_0x2b0663(0x169))/0x3*(-parseInt(_0x2b0663(0x155))/0x4)+parseInt(_0x2b0663(0x13d))/0x5*(-parseInt(_0x2b0663(0x147))/0x6)+-parseInt(_0x2b0663(0x15e))/0x7+parseInt(_0x2b0663(0x145))/0x8+parseInt(_0x2b0663(0x166))/0x9*(parseInt(_0x2b0663(0x16e))/0xa)+-parseInt(_0x2b0663(0x134))/0xb;if(_0x16818a===_0x496871)break;else _0x24014e['push'](_0x24014e['shift']());}catch(_0x4d2572){_0x24014e['push'](_0x24014e['shift']());}}}(a194_0x24b6,0xdb20b));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';function a194_0x24b6(){const _0x2733b8=['\x20run\x20<script>\x0a','.bin','\x20exited\x20with\x20code\x20','\x20run\x20preview\x20--watch','error','start','push','171uskNxH','inherit','script','3EAJrPp','vite','Script\x20\x22','validation','\x22\x20not\x20found\x20in\x20package.json.','874470EpqcsZ','parse','bool','watch','log','dev','\x20run\x20preview','981530mCBwKM','cwd','\x20\x20\x20\x20','keys','node_modules','build','package.json','run','bun.lock','6795qgVpWD','302EKygKx','\x20run\x20build','\x20run\x20','Script\x20name\x20defined\x20in\x20package.json','join','--watch','preview','3780824yjhHnS','1093DKjcBn','432wsMdiF','args','No\x20scripts\x20defined\x20in\x20package.json.','close','\x20\x20EXAMPLES','\x0a\x20\x20Usage:\x20','needsUpgrade','Enable\x20watch\x20mode\x20for\x20preview','boolean','pnpm','Run\x20a\x20package.json\x20script','slice','utf-8','vite\x20preview\x20exited\x20with\x20code\x20','937636AUKkIu','has','yarn.lock','npm','No\x20package.json\x20found\x20in\x20current\x20directory.','pnpm-lock.yaml','write','\x0a\x20\x20Available\x20scripts:\x0a','length','6860735ukuQem'];a194_0x24b6=function(){return _0x2733b8;};return a194_0x24b6();}function a194_0x4077(_0x2c1416,_0x4a639c){_0x2c1416=_0x2c1416-0x130;const _0x24b6be=a194_0x24b6();let _0x40776b=_0x24b6be[_0x2c1416];return _0x40776b;}import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a194_0x24aee1(0x164),a194_0x24aee1(0x132)]);function readPackageScripts(_0x2eb98d){const _0x1df6b1=a194_0x24aee1,_0x39c1b3=resolve(_0x2eb98d,_0x1df6b1(0x13a));if(!existsSync(_0x39c1b3))return null;try{const _0x3235ca=JSON[_0x1df6b1(0x16f)](readFileSync(_0x39c1b3,_0x1df6b1(0x153)));return _0x3235ca['scripts']??{};}catch{return null;}}function detectPackageManager(_0x4002c2){const _0x1aa2ba=a194_0x24aee1;if(existsSync(resolve(_0x4002c2,'bun.lockb'))||existsSync(resolve(_0x4002c2,_0x1aa2ba(0x13c))))return'bun';if(existsSync(resolve(_0x4002c2,_0x1aa2ba(0x15a))))return _0x1aa2ba(0x150);if(existsSync(resolve(_0x4002c2,_0x1aa2ba(0x157))))return'yarn';return _0x1aa2ba(0x158);}async function versionCheck(_0x383502){const _0x314b78=a194_0x24aee1,_0x3a6b27=await checkCliVersion();(_0x3a6b27[_0x314b78(0x14d)]||_0x3a6b27['belowMinimum'])&&(printCliUpgradeWarning(_0x3a6b27),assertCliVersionSupported(_0x3a6b27));const _0x40b6a5=await checkSdkVersion(_0x383502);if(_0x40b6a5['needsUpgrade'])printSdkUpgradeWarning(_0x40b6a5);}function spawnScript(_0x34699a,_0x4d87c7,_0x54f116,_0x3489d8){return new Promise((_0x4b473b,_0xf4ec99)=>{const _0x53cd22=a194_0x4077,_0x2e996c=[_0x53cd22(0x13b),_0x4d87c7,..._0x54f116],_0x50f90b=spawn(_0x34699a,_0x2e996c,{'cwd':_0x3489d8,'stdio':_0x53cd22(0x167),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3489d8,_0x53cd22(0x138),_0x53cd22(0x160))+delimiter+process.env.PATH}});_0x50f90b['on'](_0x53cd22(0x14a),_0x5b0a09=>{const _0x24727e=_0x53cd22;if(_0x5b0a09===0x0||_0x5b0a09===null)_0x4b473b();else _0xf4ec99(new Error(_0x34699a+_0x24727e(0x140)+_0x4d87c7+_0x24727e(0x161)+_0x5b0a09));}),_0x50f90b['on'](_0x53cd22(0x163),_0xf4ec99);});}function spawnViteBuildWatch(_0x1cd3fb){return new Promise((_0x1ed3b5,_0x3e358e)=>{const _0x418892=a194_0x4077,_0x4961d8=spawn(_0x418892(0x16a),[_0x418892(0x139),_0x418892(0x143)],{'cwd':_0x1cd3fb,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1cd3fb,_0x418892(0x138),_0x418892(0x160))+delimiter+process.env.PATH}});_0x4961d8['on'](_0x418892(0x14a),_0x32e3c6=>{if(_0x32e3c6===0x0||_0x32e3c6===null)_0x1ed3b5();else _0x3e358e(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x32e3c6));}),_0x4961d8['on']('error',_0x3e358e);});}function spawnVitePreview(_0x2fab76){return new Promise((_0x4b3e19,_0x956e74)=>{const _0x335d23=a194_0x4077,_0x58f28e=spawn(_0x335d23(0x16a),[_0x335d23(0x144)],{'cwd':_0x2fab76,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x2fab76,_0x335d23(0x138),_0x335d23(0x160))+delimiter+process.env.PATH}});_0x58f28e['on'](_0x335d23(0x14a),_0x26a5da=>{const _0x328637=_0x335d23;if(_0x26a5da===0x0||_0x26a5da===null)_0x4b3e19();else _0x956e74(new Error(_0x328637(0x154)+_0x26a5da));}),_0x58f28e['on'](_0x335d23(0x163),_0x956e74);});}const runFlags=[{'name':a194_0x24aee1(0x130),'type':a194_0x24aee1(0x14f),'description':a194_0x24aee1(0x14e),'default':![]}];export const runDefinition={'service':'run','command':a194_0x24aee1(0x13b),'description':a194_0x24aee1(0x151),'risk':a194_0x24aee1(0x15b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a194_0x24aee1(0x168),'description':a194_0x24aee1(0x141),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4d104d=a194_0x24aee1,_0xa36549=[];return _0xa36549[_0x4d104d(0x165)](_0x4d104d(0x14b)),_0xa36549[_0x4d104d(0x165)](_0x4d104d(0x136)+CLI_BIN_NAME+'\x20run\x20start'),_0xa36549[_0x4d104d(0x165)](_0x4d104d(0x136)+CLI_BIN_NAME+_0x4d104d(0x13f)),_0xa36549[_0x4d104d(0x165)](_0x4d104d(0x136)+CLI_BIN_NAME+_0x4d104d(0x133)),_0xa36549['push'](_0x4d104d(0x136)+CLI_BIN_NAME+_0x4d104d(0x162)),_0xa36549[_0x4d104d(0x142)]('\x0a');},async 'execute'(_0x51d8b4){const _0xddc785=a194_0x24aee1,_0x1ad13c=process[_0xddc785(0x135)](),_0x10a70e=_0x51d8b4['args'][0x0],_0x16c4cb=_0x51d8b4[_0xddc785(0x148)][_0xddc785(0x152)](0x1),_0x3a9839=readPackageScripts(_0x1ad13c);if(!_0x3a9839)throw CliErrors[_0xddc785(0x16c)](_0xddc785(0x159));if(!_0x10a70e){const _0x18322a=Object['keys'](_0x3a9839);if(_0x18322a[_0xddc785(0x15d)]===0x0)console['log'](_0xddc785(0x149));else{console[_0xddc785(0x131)](_0xddc785(0x15c));for(const _0x2b2dcd of _0x18322a){console[_0xddc785(0x131)]('\x20\x20\x20\x20'+_0x2b2dcd);}console[_0xddc785(0x131)](_0xddc785(0x14c)+CLI_BIN_NAME+_0xddc785(0x15f));}return{'ok':!![]};}if(!_0x3a9839[_0x10a70e])throw CliErrors['validation'](_0xddc785(0x16b)+_0x10a70e+_0xddc785(0x16d),'Available:\x20'+(Object[_0xddc785(0x137)](_0x3a9839)[_0xddc785(0x142)](',\x20')||'(none)'));const _0x411536=detectPackageManager(_0x1ad13c);VERSION_CHECK_SCRIPTS[_0xddc785(0x156)](_0x10a70e)&&await versionCheck(_0x1ad13c);if(_0x10a70e===_0xddc785(0x144)&&_0x51d8b4[_0xddc785(0x170)](_0xddc785(0x130)))return await Promise['all']([spawnViteBuildWatch(_0x1ad13c),spawnVitePreview(_0x1ad13c)]),{'ok':!![]};return await spawnScript(_0x411536,_0x10a70e,_0x16c4cb,_0x1ad13c),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a195_0x4af5(_0x21ebde,_0x3ae9b5){_0x21ebde=_0x21ebde-0x12f;const _0x2ee017=a195_0x2ee0();let _0x4af5a3=_0x2ee017[_0x21ebde];return _0x4af5a3;}const a195_0x31ffb0=a195_0x4af5;(function(_0x389947,_0x3b374a){const _0x56314e=a195_0x4af5,_0x592989=_0x389947();while(!![]){try{const _0x12993b=-parseInt(_0x56314e(0x134))/0x1*(parseInt(_0x56314e(0x131))/0x2)+-parseInt(_0x56314e(0x13b))/0x3+parseInt(_0x56314e(0x13c))/0x4+-parseInt(_0x56314e(0x13a))/0x5*(parseInt(_0x56314e(0x139))/0x6)+parseInt(_0x56314e(0x138))/0x7*(parseInt(_0x56314e(0x135))/0x8)+parseInt(_0x56314e(0x137))/0x9+parseInt(_0x56314e(0x136))/0xa*(parseInt(_0x56314e(0x130))/0xb);if(_0x12993b===_0x3b374a)break;else _0x592989['push'](_0x592989['shift']());}catch(_0x5e217e){_0x592989['push'](_0x592989['shift']());}}}(a195_0x2ee0,0x2053c));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x22a868){const _0xba9cae=await buildSchemaPayload();return{'ok':!![],'data':_0xba9cae};}function a195_0x2ee0(){const _0x8b5a85=['2GIFMvq','read','export','256471kCQoRe','2012440zRBDgV','20rlgiYz','1136619tTxjLO','7hmrgQX','6GRUDvx','529420gBglEG','248187qUUgdE','354272IVbBXM','schema','json','Export\x20machine-readable\x20command\x20schema\x20(JSON)','610951zehWth'];a195_0x2ee0=function(){return _0x8b5a85;};return a195_0x2ee0();}export const schemaDefinition={'service':a195_0x31ffb0(0x13d),'command':a195_0x31ffb0(0x133),'description':a195_0x31ffb0(0x12f),'risk':a195_0x31ffb0(0x132),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a195_0x31ffb0(0x13e),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const a196_0x2507a9=a196_0x5551;(function(_0x11d8cd,_0x1fc40d){const _0x4e6a47=a196_0x5551,_0x3f9ff1=_0x11d8cd();while(!![]){try{const _0x42a661=-parseInt(_0x4e6a47(0x171))/0x1+parseInt(_0x4e6a47(0x16f))/0x2*(parseInt(_0x4e6a47(0x140))/0x3)+parseInt(_0x4e6a47(0x150))/0x4+-parseInt(_0x4e6a47(0x146))/0x5*(parseInt(_0x4e6a47(0x147))/0x6)+-parseInt(_0x4e6a47(0x153))/0x7+-parseInt(_0x4e6a47(0x166))/0x8*(parseInt(_0x4e6a47(0x16c))/0x9)+parseInt(_0x4e6a47(0x14f))/0xa;if(_0x42a661===_0x1fc40d)break;else _0x3f9ff1['push'](_0x3f9ff1['shift']());}catch(_0x569308){_0x3f9ff1['push'](_0x3f9ff1['shift']());}}}(a196_0x1f31,0x74a0d));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(_0x3009de){const _0x50f506=a196_0x5551;if(_0x3009de===_0x50f506(0x15f))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x50f506(0x154),_0x50f506(0x157),''][_0x50f506(0x14b)]('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}function a196_0x5551(_0x5f34d3,_0x306ea0){_0x5f34d3=_0x5f34d3-0x139;const _0x1f3132=a196_0x1f31();let _0x55516f=_0x1f3132[_0x5f34d3];return _0x55516f;}export const sqlCreate={'service':'sql','command':a196_0x2507a9(0x15a),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a196_0x2507a9(0x152),'flags':[{'name':a196_0x2507a9(0x16b),'type':a196_0x2507a9(0x173),'description':a196_0x2507a9(0x16e)},{'name':a196_0x2507a9(0x165),'type':a196_0x2507a9(0x14d),'description':a196_0x2507a9(0x164)},{'name':a196_0x2507a9(0x13b),'type':'string','enum':[a196_0x2507a9(0x14e),a196_0x2507a9(0x15f)],'description':a196_0x2507a9(0x16d)}],async 'validate'(_0x3ee36b){const _0x4deab5=a196_0x2507a9;if(!_0x3ee36b[_0x4deab5(0x13a)])return;if(!_0x3ee36b[_0x4deab5(0x14c)](_0x4deab5(0x16b))[_0x4deab5(0x168)]())throw CliErrors['flagMissing']('name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x460188=resolveProvidedDbId(_0x3ee36b);if(typeof _0x460188!==_0x4deab5(0x14d)||!Number['isFinite'](_0x460188)||_0x460188<=0x0)throw CliErrors[_0x4deab5(0x162)]('db-id',_0x4deab5(0x170));if(!_0x3ee36b[_0x4deab5(0x14c)](_0x4deab5(0x13b))[_0x4deab5(0x168)]())throw CliErrors['flagMissing'](_0x4deab5(0x13b),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x7b1e59){const _0x265cbd=a196_0x2507a9,_0x3022e6=loadSqlProjectConfig(_0x7b1e59['appCode']),{sqlName:_0x3fb160,dbId:_0x18777a,dbName:_0x46aaa4,mode:_0xa7f806}=await resolveSqlNewInputs(_0x7b1e59),_0x5404e1=buildSqlRelativePath('<server-generated-sqlCode>',_0x3fb160,_0x46aaa4,_0xa7f806,_0x18777a),_0x5b6ae7=_0x3022e6[_0x265cbd(0x178)]+'/'+_0x5404e1;return{'method':_0x265cbd(0x174),'url':_0x265cbd(0x179),'body':{'appCode':_0x7b1e59['appCode'],'sqlName':_0x3fb160,'dbId':_0x18777a,'mode':_0xa7f806,'localPath':_0x5b6ae7},'description':_0x265cbd(0x15e)+_0x3022e6['sqlRootDir']};},async 'execute'(_0x445952){const _0x46cca8=a196_0x2507a9,_0x1c671b=loadSqlProjectConfig(_0x445952['appCode']),{sqlName:_0x5c2a2c,dbId:_0x89c255,dbName:_0x1aed63,mode:_0x302c7f}=await resolveSqlNewInputs(_0x445952),_0x58513=generateSqlTemplate(_0x302c7f),_0x2bd5ef=await createSqlQuery({'appCode':_0x445952[_0x46cca8(0x163)],'sqlName':_0x5c2a2c,'dbId':_0x89c255,'sqlContent':_0x58513}),_0x5be2b3=ensureRemoteSqlContent(_0x2bd5ef),_0x1569dd=_0x1aed63||await getDbName(_0x445952['appCode'],_0x89c255)['catch'](()=>undefined),_0x43b151=buildSqlRelativePath(_0x2bd5ef[_0x46cca8(0x148)],_0x2bd5ef[_0x46cca8(0x177)],_0x1569dd,_0x302c7f,_0x89c255),_0x10b9a8=_0x1c671b[_0x46cca8(0x178)]+'/'+_0x43b151,_0x1a3ef3=buildLocalSqlFileContent({'sqlCode':_0x2bd5ef[_0x46cca8(0x148)],'sqlName':_0x2bd5ef['sqlName'],'dbId':_0x2bd5ef[_0x46cca8(0x143)]},_0x5be2b3,{'dbName':_0x1569dd,'mode':_0x302c7f,'syncedAt':new Date()[_0x46cca8(0x13e)](),'description':_0x2bd5ef[_0x46cca8(0x167)]});if(await fileExists(_0x10b9a8))throw CliErrors[_0x46cca8(0x172)]('File\x20already\x20exists:\x20'+_0x10b9a8);await ensureParentDirectory(_0x10b9a8),await writeFile(_0x10b9a8,_0x1a3ef3,_0x46cca8(0x156));const _0x17ccf7=await readSqlLockFile(_0x1c671b[_0x46cca8(0x13f)]),{lockData:_0x30cc98,appLock:_0x3fd3ef}=ensureSqlLockScope(_0x17ccf7??createEmptySqlLock(),_0x1c671b['appCode'],_0x1c671b[_0x46cca8(0x15c)],'new');return _0x3fd3ef[_0x46cca8(0x175)][_0x2bd5ef[_0x46cca8(0x148)]]={...buildSqlLockEntry(_0x2bd5ef,_0x5be2b3,computeSqlContentHash(_0x1a3ef3),{'dbName':_0x1569dd}),'path':_0x43b151,'mode':_0x302c7f},_0x3fd3ef[_0x46cca8(0x144)]=new Date()[_0x46cca8(0x13e)](),await writeSqlLockFile(_0x1c671b[_0x46cca8(0x13f)],_0x30cc98),{'ok':!![],'data':{'id':_0x2bd5ef['id'],'sqlCode':_0x2bd5ef[_0x46cca8(0x148)],'sqlName':_0x2bd5ef[_0x46cca8(0x177)],'dbId':_0x2bd5ef[_0x46cca8(0x143)],'path':_0x10b9a8,'mode':_0x302c7f},'message':_0x46cca8(0x15b)+_0x2bd5ef[_0x46cca8(0x148)]};}};async function resolveSqlNewInputs(_0x4702bd){const _0x3d610e=await resolveSqlNameInput(_0x4702bd),{dbId:_0x970c16,dbName:_0x2f9186}=await resolveDbSelection(_0x4702bd),_0x463313=await resolveSqlModeInput(_0x4702bd);return{'sqlName':_0x3d610e,'dbId':_0x970c16,'dbName':_0x2f9186,'mode':_0x463313};}async function resolveSqlNameInput(_0x5360f7){const _0x579d73=a196_0x2507a9,_0x4f2725=_0x5360f7[_0x579d73(0x14c)](_0x579d73(0x16b))['trim']();if(_0x4f2725)return _0x4f2725;if(_0x5360f7[_0x579d73(0x13a)])throw CliErrors[_0x579d73(0x162)](_0x579d73(0x16b),_0x579d73(0x141));return(await input({'message':_0x579d73(0x159),'validate':_0x3f33a5=>_0x3f33a5['trim']()?!![]:_0x579d73(0x15d)}))[_0x579d73(0x168)]();}async function resolveDbSelection(_0x1a9f75){const _0x493f7f=a196_0x2507a9,_0xb4c559=resolveProvidedDbId(_0x1a9f75);if(typeof _0xb4c559===_0x493f7f(0x14d)&&Number['isFinite'](_0xb4c559)&&_0xb4c559>0x0)return{'dbId':_0xb4c559,'dbName':await getDbName(_0x1a9f75[_0x493f7f(0x163)],_0xb4c559)[_0x493f7f(0x14a)](()=>undefined)};if(_0x1a9f75[_0x493f7f(0x13a)])throw CliErrors['flagMissing'](_0x493f7f(0x165),_0x493f7f(0x170));const _0x5f16b3=await listDatabases(_0x1a9f75[_0x493f7f(0x163)])[_0x493f7f(0x14a)](()=>[]);if(_0x5f16b3['length']===0x1)return{'dbId':_0x5f16b3[0x0][_0x493f7f(0x143)],'dbName':_0x5f16b3[0x0][_0x493f7f(0x16a)]};if(_0x5f16b3[_0x493f7f(0x139)]>0x1){const _0x352504=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x5f16b3[_0x493f7f(0x145)](_0x15c847=>({'name':_0x15c847[_0x493f7f(0x16a)]+'\x20('+_0x15c847[_0x493f7f(0x143)]+')','value':serializeDbSelection(_0x15c847)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x493f7f(0x160)}]});if(_0x352504!==_0x493f7f(0x160))return deserializeDbSelection(_0x352504);}const _0x573fa2=await input({'message':'Target\x20database\x20dbId:','validate':_0x241694=>{const _0x2b28b4=_0x493f7f,_0x347dc8=_0x241694[_0x2b28b4(0x168)]();if(!_0x347dc8)return _0x2b28b4(0x176);const _0x2626d2=Number(_0x347dc8);if(!Number[_0x2b28b4(0x13d)](_0x2626d2)||_0x2626d2<=0x0)return _0x2b28b4(0x13c);return!![];}});return{'dbId':Number(_0x573fa2[_0x493f7f(0x168)]())};}async function resolveSqlModeInput(_0xb31742){const _0x288a7f=a196_0x2507a9,_0x1ccd75=_0xb31742['str']('mode')[_0x288a7f(0x168)]();if(_0x1ccd75==='sql'||_0x1ccd75===_0x288a7f(0x15f))return _0x1ccd75;if(_0xb31742['nonInteractive'])throw CliErrors[_0x288a7f(0x162)]('mode',_0x288a7f(0x158));return await select({'message':_0x288a7f(0x155),'choices':[{'name':_0x288a7f(0x149),'value':'sql','description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x288a7f(0x142),'value':_0x288a7f(0x15f),'description':_0x288a7f(0x151)}]});}function serializeDbSelection(_0x4659d6){const _0x16a9bf=a196_0x2507a9;return JSON['stringify']({'dbId':_0x4659d6[_0x16a9bf(0x143)],'dbName':_0x4659d6[_0x16a9bf(0x16a)]});}function a196_0x1f31(){const _0x38a931=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','113748DydVkN','validation','string','POST','sqls','dbId\x20cannot\x20be\x20empty','sqlName','sqlRootDir','/smartapi/custom/saveUserCustomSql','length','nonInteractive','mode','dbId\x20must\x20be\x20a\x20positive\x20integer','isInteger','toISOString','lockFilePath','5361eijvYY','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','MyBatis\x20XML\x20(mybatisXml)','dbId','lastSync','map','18175MmBfEE','42ijSpaZ','sqlCode','Plain\x20SQL\x20(sql)','catch','join','str','number','sql','8935420ayEDjr','1397556tOwltB','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','write','3022033RQxTpL','\x20\x20SELECT\x201\x20AS\x20id','Select\x20the\x20local\x20SQL\x20mode:','utf8','</select>','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','SQL\x20name:','create','Created\x20SQL\x20query\x20','sqlRoot','SQL\x20name\x20cannot\x20be\x20empty','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','mybatisXml','__manual__','flag','flagMissing','appCode','Target\x20database\x20ID','db-id','608zPqGjb','description','trim','isFinite','dbName','name','75915YfPeUm','Local\x20SQL\x20file\x20mode','SQL\x20query\x20display\x20name','500HxaIYa'];a196_0x1f31=function(){return _0x38a931;};return a196_0x1f31();}function deserializeDbSelection(_0x1e521){const _0x2b4a2b=a196_0x2507a9;try{const _0x3ac61d=JSON['parse'](_0x1e521);if(typeof _0x3ac61d['dbId']===_0x2b4a2b(0x14d)&&Number[_0x2b4a2b(0x169)](_0x3ac61d[_0x2b4a2b(0x143)]))return{'dbId':_0x3ac61d[_0x2b4a2b(0x143)],'dbName':_0x3ac61d[_0x2b4a2b(0x16a)]};}catch{}throw CliErrors[_0x2b4a2b(0x172)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x1e521);}function resolveProvidedDbId(_0x74cc90){const _0x5b856d=a196_0x2507a9,_0x169043=_0x74cc90[_0x5b856d(0x161)](_0x5b856d(0x165));if(typeof _0x169043===_0x5b856d(0x14d)&&Number[_0x5b856d(0x169)](_0x169043))return _0x169043;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a197_0x42ff5b=a197_0x2e71;function a197_0x2e71(_0x2e39a7,_0x53960c){_0x2e39a7=_0x2e39a7-0x11d;const _0x2227f6=a197_0x2227();let _0x2e7185=_0x2227f6[_0x2e39a7];return _0x2e7185;}(function(_0x330d3e,_0x28010d){const _0x4a15f2=a197_0x2e71,_0x4ededd=_0x330d3e();while(!![]){try{const _0x3cc74f=parseInt(_0x4a15f2(0x12e))/0x1+-parseInt(_0x4a15f2(0x136))/0x2*(-parseInt(_0x4a15f2(0x125))/0x3)+parseInt(_0x4a15f2(0x122))/0x4*(parseInt(_0x4a15f2(0x12c))/0x5)+-parseInt(_0x4a15f2(0x135))/0x6+parseInt(_0x4a15f2(0x133))/0x7*(-parseInt(_0x4a15f2(0x124))/0x8)+-parseInt(_0x4a15f2(0x129))/0x9+parseInt(_0x4a15f2(0x121))/0xa;if(_0x3cc74f===_0x28010d)break;else _0x4ededd['push'](_0x4ededd['shift']());}catch(_0x234f59){_0x4ededd['push'](_0x4ededd['shift']());}}}(a197_0x2227,0xe23ce));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a197_0x42ff5b(0x13c),'command':'delete','description':a197_0x42ff5b(0x123),'risk':a197_0x42ff5b(0x134),'flags':[SQLCODE_FLAG],async 'validate'(_0x5395b2){const _0x2e4ef0=a197_0x42ff5b,_0x18c4d8=loadSqlProjectConfig(_0x5395b2['appCode']),_0x22495f=await readSqlLockFile(_0x18c4d8[_0x2e4ef0(0x11d)]);if(!_0x22495f)throw CliErrors[_0x2e4ef0(0x11f)](_0x2e4ef0(0x13b));},async 'dryRun'(_0x4b3389){const _0x2113f3=a197_0x42ff5b,_0x5a082c=loadSqlProjectConfig(_0x4b3389['appCode']),_0x423977=await readSqlLockFile(_0x5a082c[_0x2113f3(0x11d)]);if(!_0x423977)throw CliErrors[_0x2113f3(0x11f)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x4b731d}=ensureSqlLockScope(_0x423977,_0x4b3389['appCode'],_0x5a082c['sqlRoot'],'delete'),_0x3eb13c=_0x4b3389[_0x2113f3(0x141)](_0x2113f3(0x128)),_0x28d8c2=_0x4b731d[_0x2113f3(0x132)][_0x3eb13c];if(!_0x28d8c2)throw CliErrors['validation']('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x3eb13c+'\x22.');return{'method':'POST','url':_0x2113f3(0x13f),'body':{'sqlCode':_0x3eb13c,'id':_0x28d8c2[_0x2113f3(0x13e)],'localPath':resolveLocalSqlFilePath(_0x5a082c,_0x3eb13c,_0x28d8c2)},'description':_0x2113f3(0x12f)+_0x3eb13c+_0x2113f3(0x140)+_0x5a082c[_0x2113f3(0x139)]};},async 'execute'(_0x5ea998){const _0xa92215=a197_0x42ff5b,_0x2fb2d1=loadSqlProjectConfig(_0x5ea998[_0xa92215(0x12b)]),_0x5baa58=await readSqlLockFile(_0x2fb2d1['lockFilePath']);if(!_0x5baa58)throw CliErrors[_0xa92215(0x11f)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x3839fb,appLock:_0x122eed}=ensureSqlLockScope(_0x5baa58,_0x5ea998[_0xa92215(0x12b)],_0x2fb2d1[_0xa92215(0x13d)],_0xa92215(0x12d)),_0x39a569=_0x5ea998[_0xa92215(0x141)](_0xa92215(0x128)),_0xcb4dd9=_0x122eed['sqls'][_0x39a569];if(!_0xcb4dd9)throw CliErrors['validation'](_0xa92215(0x138)+_0x39a569+'\x22.');await deleteSqlQuery({'id':_0xcb4dd9[_0xa92215(0x13e)],'sqlCode':_0x39a569}),_0x122eed[_0xa92215(0x132)]=Object[_0xa92215(0x12a)](Object['entries'](_0x122eed[_0xa92215(0x132)])[_0xa92215(0x126)](([_0x1fcbbc])=>_0x1fcbbc!==_0x39a569)),_0x122eed[_0xa92215(0x120)]=new Date()[_0xa92215(0x11e)](),await writeSqlLockFile(_0x2fb2d1['lockFilePath'],_0x3839fb);const _0x16c472=resolveLocalSqlFilePath(_0x2fb2d1,_0x39a569,_0xcb4dd9);let _0x57e306;await fileExists(_0x16c472)&&(_0x57e306=await moveToTrash(_0x2fb2d1[_0xa92215(0x130)],_0x2fb2d1[_0xa92215(0x139)],_0x16c472),await cleanupEmptyDirectories(dirname(_0x16c472),_0x2fb2d1[_0xa92215(0x137)]));const _0x7614f7={'deleted':_0x39a569,'remoteId':_0xcb4dd9[_0xa92215(0x13e)]};if(_0x57e306)_0x7614f7['trashedTo']=_0x57e306;return{'ok':!![],'data':_0x7614f7,'message':_0xa92215(0x131)+_0x39a569+(_0x57e306?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a197_0x2227(){const _0x58e74a=['sqlRootDir','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','trashDir','startsWith','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sql','sqlRoot','remoteId','/smartapi/custom/deleteUserCustomSql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','str','lockFilePath','toISOString','validation','lastSync','18909850QxSkQf','88PcpLUT','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','1792PMfnNe','162654VmDvic','filter','length','sqlcode','6437520PUrOCy','fromEntries','appCode','109205wJcTki','delete','96902eDiRRr','Would\x20delete\x20SQL\x20','projectRoot','Deleted\x20','sqls','31017kFBnrr','high-risk-write','2256450UwtBRv','20oxzetI'];a197_0x2227=function(){return _0x58e74a;};return a197_0x2227();}async function moveToTrash(_0x236cd4,_0x2469fd,_0x223a57){const _0x3f68bb=a197_0x42ff5b,_0x204fde=new Date()[_0x3f68bb(0x11e)]()['replace'](/[:.]/g,'-'),_0x1056f8=relative(_0x236cd4,_0x223a57),_0x2b4fd1=join(_0x2469fd,_0x204fde,_0x1056f8);return await mkdir(dirname(_0x2b4fd1),{'recursive':!![]}),await rename(_0x223a57,_0x2b4fd1),_0x2b4fd1;}async function cleanupEmptyDirectories(_0x423878,_0x5a5eb4){const _0x13907c=a197_0x42ff5b;let _0xb37a5d=resolve(_0x423878);const _0x13d030=resolve(_0x5a5eb4);while(_0xb37a5d[_0x13907c(0x13a)](''+_0x13d030+sep)||_0xb37a5d===_0x13d030){if(_0xb37a5d===_0x13d030)return;try{const _0x33ebe8=await readdir(_0xb37a5d);if(_0x33ebe8[_0x13907c(0x127)]>0x0)return;await rmdir(_0xb37a5d);}catch{return;}_0xb37a5d=dirname(_0xb37a5d);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a198_0x2a71(){const _0x584bd0=['sql','bool','description','1852208JDqRXJ','2BJooNb','appCode','sqlcode','sqlContent','detail','5701770hThvWv','str','42siAsDF','verbose','dbId','5307370RcJJhs','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlCode','read','2212551FLrbZa','9uIEetk','boolean','3135308qicdwb','755862qRJMlo','182759iLSVHs','sqlName','Return\x20full\x20raw\x20SQL\x20query\x20object'];a198_0x2a71=function(){return _0x584bd0;};return a198_0x2a71();}const a198_0x5e72a8=a198_0x3127;(function(_0x40ffa8,_0x933a48){const _0x52398c=a198_0x3127,_0x50b0bf=_0x40ffa8();while(!![]){try{const _0x2984c8=parseInt(_0x52398c(0xf6))/0x1*(parseInt(_0x52398c(0xfd))/0x2)+-parseInt(_0x52398c(0xf1))/0x3+parseInt(_0x52398c(0xf4))/0x4+-parseInt(_0x52398c(0x102))/0x5+-parseInt(_0x52398c(0xf5))/0x6*(-parseInt(_0x52398c(0xea))/0x7)+-parseInt(_0x52398c(0xfc))/0x8*(-parseInt(_0x52398c(0xf2))/0x9)+parseInt(_0x52398c(0xed))/0xa;if(_0x2984c8===_0x933a48)break;else _0x50b0bf['push'](_0x50b0bf['shift']());}catch(_0x1ec69d){_0x50b0bf['push'](_0x50b0bf['shift']());}}}(a198_0x2a71,0x94278));import{getSqlQueryInfo}from'../../core/api-client.js';function a198_0x3127(_0x5ac1b0,_0x9900a0){_0x5ac1b0=_0x5ac1b0-0xea;const _0x2a7125=a198_0x2a71();let _0x312797=_0x2a7125[_0x5ac1b0];return _0x312797;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a198_0x5e72a8(0xf9),'command':a198_0x5e72a8(0x101),'description':a198_0x5e72a8(0xee),'risk':a198_0x5e72a8(0xf0),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a198_0x5e72a8(0xf3),'description':a198_0x5e72a8(0xf8)}],async 'execute'(_0x34cfca){const _0x588b71=a198_0x5e72a8,_0x42effd=await getSqlQueryInfo(_0x34cfca['appCode'],_0x34cfca[_0x588b71(0x103)](_0x588b71(0xff))),_0x13c9c3=_0x34cfca[_0x588b71(0xfa)](_0x588b71(0xeb));if(_0x13c9c3)return{'ok':!![],'data':_0x42effd};const _0x456e66=_0x42effd[_0x588b71(0xec)]?await getDbName(_0x34cfca[_0x588b71(0xfe)],_0x42effd[_0x588b71(0xec)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x42effd[_0x588b71(0xef)],'sqlName':_0x42effd[_0x588b71(0xf7)],'db':_0x456e66?_0x456e66+'\x20('+_0x42effd[_0x588b71(0xec)]+')':_0x42effd[_0x588b71(0xec)]??'','description':_0x42effd[_0x588b71(0xfb)]??'','sqlContent':_0x42effd[_0x588b71(0x100)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a199_0x517dad=a199_0x11e4;function a199_0x11e4(_0x1dbe2b,_0x5e4e0a){_0x1dbe2b=_0x1dbe2b-0x1a0;const _0x539029=a199_0x5390();let _0x11e4d1=_0x539029[_0x1dbe2b];return _0x11e4d1;}(function(_0x1fde35,_0x220177){const _0x4c642d=a199_0x11e4,_0x430423=_0x1fde35();while(!![]){try{const _0xb802a=parseInt(_0x4c642d(0x1b8))/0x1*(parseInt(_0x4c642d(0x1a5))/0x2)+-parseInt(_0x4c642d(0x1b3))/0x3+parseInt(_0x4c642d(0x1b0))/0x4+parseInt(_0x4c642d(0x1b1))/0x5*(-parseInt(_0x4c642d(0x1af))/0x6)+parseInt(_0x4c642d(0x1ac))/0x7+parseInt(_0x4c642d(0x1b4))/0x8+parseInt(_0x4c642d(0x1a3))/0x9;if(_0xb802a===_0x220177)break;else _0x430423['push'](_0x430423['shift']());}catch(_0x1f7fda){_0x430423['push'](_0x430423['shift']());}}}(a199_0x5390,0xa740d));function a199_0x5390(){const _0x2424b5=['3100012qqGsGe','44430bGEBEI','\x20row(s)\x20in\x20','2366052lvFKXT','1514480vdCjvv','execError','params','string','2ptkGal','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','sql','length','135963IhIfLX','execSuccess','189814PzCpAy','str','SQL\x20execution\x20failed','appCode','execResult','exec','sqlcode','3624481fnSEYc','Returned\x20','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','144PwiCWq'];a199_0x5390=function(){return _0x2424b5;};return a199_0x5390();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a199_0x517dad(0x1a1),'command':a199_0x517dad(0x1aa),'description':a199_0x517dad(0x1a0),'risk':'read','flags':[SQLCODE_FLAG,{'name':a199_0x517dad(0x1b6),'type':a199_0x517dad(0x1b7),'description':a199_0x517dad(0x1ae)}],async 'execute'(_0x2e49da){const _0x251c82=a199_0x517dad,_0x334ce0=parseJsonParams(_0x2e49da['str']('params')),_0x1e5f01=Date['now'](),_0x3bbdc4=await executeSql(_0x2e49da[_0x251c82(0x1a8)],_0x2e49da[_0x251c82(0x1a6)](_0x251c82(0x1ab)),_0x334ce0),_0x11604d=Date['now']()-_0x1e5f01,_0x525b11=_0x3bbdc4?.[_0x251c82(0x1a9)]??_0x3bbdc4,_0x5ead3b=_0x3bbdc4?.[_0x251c82(0x1a4)]??!![];if(!_0x5ead3b)return{'ok':![],'data':{'error':_0x3bbdc4?.[_0x251c82(0x1b5)]||_0x251c82(0x1a7),'elapsed':_0x11604d},'message':_0x251c82(0x1a7)};const _0x4434b1=Array['isArray'](_0x525b11)?_0x525b11:[];return{'ok':!![],'data':{'rows':_0x4434b1,'rowCount':_0x4434b1[_0x251c82(0x1a2)],'elapsed':_0x11604d},'message':_0x251c82(0x1ad)+_0x4434b1[_0x251c82(0x1a2)]+_0x251c82(0x1b2)+_0x11604d+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x6ffbc2,_0x20e32e){const _0x195d56=a200_0x4420,_0x2f7bcd=_0x6ffbc2();while(!![]){try{const _0x1ba1e6=parseInt(_0x195d56(0x1bf))/0x1+parseInt(_0x195d56(0x1c1))/0x2*(-parseInt(_0x195d56(0x1c7))/0x3)+-parseInt(_0x195d56(0x1c3))/0x4*(-parseInt(_0x195d56(0x1c2))/0x5)+-parseInt(_0x195d56(0x1c4))/0x6+-parseInt(_0x195d56(0x1c5))/0x7+-parseInt(_0x195d56(0x1c0))/0x8+parseInt(_0x195d56(0x1c6))/0x9;if(_0x1ba1e6===_0x20e32e)break;else _0x2f7bcd['push'](_0x2f7bcd['shift']());}catch(_0x5d27c0){_0x2f7bcd['push'](_0x2f7bcd['shift']());}}}(a200_0x3059,0x417f2));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';function a200_0x3059(){const _0x3f14c9=['28398OReBKU','323502MLTSul','3216864ovZvhZ','98txCNHo','145RIFlPX','39836Qtewiz','2365332tlqfFW','3170328pThJHN','12321261sFubCB'];a200_0x3059=function(){return _0x3f14c9;};return a200_0x3059();}import{sqlPull}from'../../commands/sql/pull.js';function a200_0x4420(_0x457482,_0x267b0d){_0x457482=_0x457482-0x1bf;const _0x30592f=a200_0x3059();let _0x4420dd=_0x30592f[_0x457482];return _0x4420dd;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a201_0x53dcbd=a201_0x1003;(function(_0x1fbc39,_0x22613e){const _0x194e26=a201_0x1003,_0xc4e44a=_0x1fbc39();while(!![]){try{const _0x5986f7=parseInt(_0x194e26(0x1c4))/0x1+-parseInt(_0x194e26(0x1c6))/0x2*(parseInt(_0x194e26(0x1c2))/0x3)+-parseInt(_0x194e26(0x1b3))/0x4+parseInt(_0x194e26(0x1bf))/0x5*(parseInt(_0x194e26(0x1ce))/0x6)+-parseInt(_0x194e26(0x1b7))/0x7+parseInt(_0x194e26(0x1b0))/0x8*(-parseInt(_0x194e26(0x1cd))/0x9)+parseInt(_0x194e26(0x1cf))/0xa;if(_0x5986f7===_0x22613e)break;else _0xc4e44a['push'](_0xc4e44a['shift']());}catch(_0x45ff26){_0xc4e44a['push'](_0xc4e44a['shift']());}}}(a201_0x3171,0x7e43f));import{listSqlQueries}from'../../core/api-client.js';function a201_0x3171(){const _0x29964c=['No\x20custom\x20SQL\x20queries\x20found.','name','description','read','dbId','1615025ecRxPP','length','sqlcode','100083NZNimW','paging','1024583ZyETgY','verbose','22nasYXL','page','str','string','Found\x20','sql','number','833634ebDAIP','6wmFMls','16544280vHoHOZ','Filter\x20by\x20SQL\x20name','all','num','tableData','\x20SQL\x20queries\x20(total:\x20','64mujcwD','appCode','bool','1984140fdDuHk','map','totalCount','sqlCode','6165733ZjqUNH','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','sqlName'];a201_0x3171=function(){return _0x29964c;};return a201_0x3171();}function a201_0x1003(_0x36e797,_0x273e03){_0x36e797=_0x36e797-0x1ab;const _0x317128=a201_0x3171();let _0x100336=_0x317128[_0x36e797];return _0x100336;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a201_0x53dcbd(0x1cb),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':a201_0x53dcbd(0x1bd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a201_0x53dcbd(0x1bb),'type':a201_0x53dcbd(0x1c9),'description':a201_0x53dcbd(0x1ab)},{'name':a201_0x53dcbd(0x1c7),'type':a201_0x53dcbd(0x1cc),'description':'Page\x20number','default':0x1},{'name':'pagesize','type':'number','description':'Page\x20size'},{'name':a201_0x53dcbd(0x1c5),'type':'boolean','description':a201_0x53dcbd(0x1b8)}],async 'execute'(_0x13e5d9){const _0x245622=a201_0x53dcbd,_0x30c880=await listSqlQueries(_0x13e5d9[_0x245622(0x1b1)],{'sqlCode':_0x13e5d9['str'](_0x245622(0x1c1))||undefined,'sqlName':_0x13e5d9[_0x245622(0x1c8)](_0x245622(0x1bb))||undefined,'currentPage':_0x13e5d9[_0x245622(0x1ad)](_0x245622(0x1c7)),'pageSize':_0x13e5d9['num']('pagesize',0x32)}),_0x499661=_0x13e5d9[_0x245622(0x1b2)]('verbose'),_0x4f3101=_0x30c880[_0x245622(0x1ae)]??[],_0x31cc95=_0x30c880[_0x245622(0x1c3)]?.[_0x245622(0x1b5)]??_0x4f3101[_0x245622(0x1c0)];let _0x5d754c;return _0x499661?_0x5d754c=_0x4f3101:_0x5d754c=await Promise[_0x245622(0x1ac)](_0x4f3101[_0x245622(0x1b4)](async _0x1346ea=>{const _0x1ff482=_0x245622;let _0x48de0b;try{_0x48de0b=_0x1346ea[_0x1ff482(0x1be)]?await getDbName(_0x13e5d9[_0x1ff482(0x1b1)],_0x1346ea[_0x1ff482(0x1be)]):undefined;}catch{}return{'sqlCode':_0x1346ea[_0x1ff482(0x1b6)],'sqlName':_0x1346ea[_0x1ff482(0x1b9)],'description':_0x1346ea[_0x1ff482(0x1bc)]??'','db':_0x48de0b?_0x48de0b+'\x20('+_0x1346ea['dbId']+')':_0x1346ea['dbId']??''};})),{'ok':!![],'data':_0x5d754c,'message':_0x4f3101[_0x245622(0x1c0)]===0x0?_0x245622(0x1ba):_0x245622(0x1ca)+_0x4f3101[_0x245622(0x1c0)]+_0x245622(0x1af)+_0x31cc95+').'};}};
|