@lovrabet/rabetbase-cli 2.3.12-beta.1 → 2.3.12
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/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/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.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/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.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/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/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/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.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/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.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/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.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/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a159_0x491fc5=a159_0x51e7;(function(_0x4572c4,_0x32d0cc){const _0x356877=a159_0x51e7,_0x48e070=_0x4572c4();while(!![]){try{const _0x463fbe=parseInt(_0x356877(0x12b))/0x1+parseInt(_0x356877(0x160))/0x2+parseInt(_0x356877(0x152))/0x3*(parseInt(_0x356877(0x12c))/0x4)+-parseInt(_0x356877(0x134))/0x5+-parseInt(_0x356877(0x155))/0x6*(parseInt(_0x356877(0x12a))/0x7)+parseInt(_0x356877(0x154))/0x8*(-parseInt(_0x356877(0x16d))/0x9)+parseInt(_0x356877(0x146))/0xa;if(_0x463fbe===_0x32d0cc)break;else _0x48e070['push'](_0x48e070['shift']());}catch(_0x58b2ab){_0x48e070['push'](_0x48e070['shift']());}}}(a159_0x23d2,0x78f5c));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x491fc5(0x164),'type':a159_0x491fc5(0x145),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a159_0x491fc5(0x13e),'type':a159_0x491fc5(0x145),'required':!![],'description':a159_0x491fc5(0x15b)};export const NAME_FLAG={'name':a159_0x491fc5(0x15e),'type':'string','required':!![],'description':a159_0x491fc5(0x173)};export const USER_NAME_FLAG={'name':a159_0x491fc5(0x15e),'type':a159_0x491fc5(0x145),'required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a159_0x491fc5(0x138),'type':a159_0x491fc5(0x145),'required':![],'description':a159_0x491fc5(0x169)};function a159_0x51e7(_0x35a7d8,_0x92e5e1){_0x35a7d8=_0x35a7d8-0x126;const _0x23d2de=a159_0x23d2();let _0x51e716=_0x23d2de[_0x35a7d8];return _0x51e716;}export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a159_0x491fc5(0x132),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a159_0x491fc5(0x149),a159_0x491fc5(0x13f),a159_0x491fc5(0x16e)];export function isBuiltinRole(_0x166189){return BUILTIN_ROLE_TYPES['includes'](_0x166189);}export function assertCustomRole(_0x3128ef,_0x2b4b0a){const _0x5e6fd2=a159_0x491fc5;if(_0x3128ef[_0x5e6fd2(0x16f)]!==_0x5e6fd2(0x137))throw CliErrors[_0x5e6fd2(0x168)](_0x5e6fd2(0x14b)+_0x2b4b0a+_0x5e6fd2(0x13c)+_0x3128ef[_0x5e6fd2(0x167)]+'\x20('+_0x3128ef['roleType']+').',_0x5e6fd2(0x14f));}export function assertPermConfigurable(_0x3b8243){const _0x485aac=a159_0x491fc5;if(_0x3b8243[_0x485aac(0x16f)]==='DEV'||_0x3b8243[_0x485aac(0x16f)]===_0x485aac(0x149))throw CliErrors[_0x485aac(0x168)](_0x485aac(0x13a)+_0x3b8243['roleName']+'\x20('+_0x3b8243[_0x485aac(0x16f)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0xc45af9){const _0x3f6d13=a159_0x491fc5;return{'id':_0xc45af9['id'],'roleName':_0xc45af9[_0x3f6d13(0x167)],'roleType':_0xc45af9['roleType'],'remark':_0xc45af9[_0x3f6d13(0x138)],'userCount':_0xc45af9[_0x3f6d13(0x172)],'permitCount':_0xc45af9[_0x3f6d13(0x174)],'builtin':isBuiltinRole(_0xc45af9[_0x3f6d13(0x16f)])};}export async function resolveRoleRef(_0x29acfb,_0x36e81e){const _0x596077=a159_0x491fc5,_0x3ad6b8=_0x36e81e[_0x596077(0x139)]();if(!_0x3ad6b8)throw CliErrors['validation']('Missing\x20role\x20reference.',_0x596077(0x147));if(/^\d+$/[_0x596077(0x16b)](_0x3ad6b8))return getRoleById(_0x29acfb,Number(_0x3ad6b8));const _0x37ff18=await listAllAppRoles(_0x29acfb),_0x32fb3b=_0x37ff18[_0x596077(0x153)](_0x5beae4=>_0x5beae4[_0x596077(0x167)]===_0x3ad6b8);if(_0x32fb3b['length']===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x3ad6b8+_0x596077(0x128)+_0x29acfb+'.',_0x596077(0x158));if(_0x32fb3b[_0x596077(0x159)]>0x1){const _0x25d342=_0x32fb3b[_0x596077(0x130)](_0x1b8c55=>_0x1b8c55['id'])[_0x596077(0x151)](',\x20');throw CliErrors[_0x596077(0x168)](_0x596077(0x14c)+_0x3ad6b8+_0x596077(0x171)+_0x25d342+').',_0x596077(0x15d));}return _0x32fb3b[0x0];}export async function getRoleById(_0x31ba85,_0xf2d1aa){const _0x4829e3=a159_0x491fc5,_0x5ef091=await getAppRole(_0xf2d1aa);if(!_0x5ef091)throw CliErrors[_0x4829e3(0x168)](_0x4829e3(0x12f)+_0xf2d1aa+_0x4829e3(0x16c)+_0x31ba85+'.',_0x4829e3(0x162));return _0x5ef091;}async function listAllAppRoles(_0x169839){const _0x2d88bf=a159_0x491fc5,_0x2734d7=0x64,_0x5d126a=[];for(let _0x208b3f=0x1;;_0x208b3f+=0x1){const {items:_0x59167e,paging:_0x488dce}=await listAppRoles(_0x169839,{'currentPage':_0x208b3f,'pageSize':_0x2734d7});_0x5d126a[_0x2d88bf(0x12d)](..._0x59167e);if(_0x59167e['length']<_0x2734d7||_0x488dce&&_0x5d126a[_0x2d88bf(0x159)]>=_0x488dce[_0x2d88bf(0x170)])return _0x5d126a;}}export async function resolveTenantCode(){const _0x3b7982=a159_0x491fc5,_0x562ba5=await getSessionUserInfo(),_0x3ac0c0=_0x562ba5?.['user']?.[_0x3b7982(0x14d)]?.[_0x3b7982(0x157)];if(!_0x3ac0c0)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x3ac0c0;}function matchMember(_0x1b7e0f,_0x13bec7){const _0x1e5978=a159_0x491fc5,_0x195679=_0x13bec7[_0x1e5978(0x139)]()[_0x1e5978(0x15f)]();return(_0x1b7e0f[_0x1e5978(0x126)]??'')[_0x1e5978(0x15f)]()===_0x195679||(_0x1b7e0f[_0x1e5978(0x127)]??'')[_0x1e5978(0x15f)]()===_0x195679;}export async function resolveUserRef(_0x51f27e){const _0x542ac9=a159_0x491fc5,_0x285d29=_0x51f27e[_0x542ac9(0x139)]();if(!_0x285d29)throw CliErrors[_0x542ac9(0x168)](_0x542ac9(0x131),'Pass\x20--user\x20<id|name>.');const _0xed5a1a=await resolveTenantCode(),_0x1b4812=await getTenantMembers(_0xed5a1a);if(/^\d+$/[_0x542ac9(0x16b)](_0x285d29)){const _0x31580a=Number(_0x285d29),_0x37332b=_0x1b4812[_0x542ac9(0x142)](_0x126d65=>_0x126d65[_0x542ac9(0x156)]===_0x31580a);return{'userId':_0x31580a,'username':_0x37332b?.[_0x542ac9(0x127)]??String(_0x31580a),'nickname':_0x37332b?.[_0x542ac9(0x126)],'matchedBy':'id'};}const _0x34aa62=_0x1b4812[_0x542ac9(0x153)](_0x4be98a=>matchMember(_0x4be98a,_0x285d29));if(_0x34aa62[_0x542ac9(0x159)]===0x0)throw CliErrors[_0x542ac9(0x168)](_0x542ac9(0x143)+_0x285d29+'\x22.',_0x542ac9(0x161));if(_0x34aa62['length']>0x1){const _0x448cdd=_0x34aa62['map'](_0xb880fd=>(_0xb880fd[_0x542ac9(0x126)]??_0xb880fd['username']??'?')+'('+_0xb880fd[_0x542ac9(0x156)]+')')[_0x542ac9(0x151)](',\x20');throw CliErrors[_0x542ac9(0x168)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x285d29+_0x542ac9(0x12e)+_0x448cdd+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x2fbdfb=_0x34aa62[0x0];return{'userId':_0x2fbdfb['userId'],'username':_0x2fbdfb['username']??String(_0x2fbdfb[_0x542ac9(0x156)]),'nickname':_0x2fbdfb[_0x542ac9(0x126)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a159_0x491fc5(0x148);function a159_0x23d2(){const _0x5f5a51=['Disambiguate\x20with\x20--role\x20<id>.','name','toLowerCase','634976jNZOVx','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','\x20is\x20already\x20a\x20member\x20of\x20role\x20','role','findIndex','POST','roleName','validation','Optional\x20role\x20remark/description','\x20not\x20found\x20in\x20the\x20user-role\x20list.','test','\x20not\x20found\x20in\x20app\x20','46854SHkpzn','USER','roleType','totalCount','\x22\x20is\x20ambiguous\x20(ids:\x20','userCount','Role\x20name','permitCount','Pass\x20--user\x20<id|name>.','nickname','username','\x22\x20not\x20found\x20in\x20app\x20','\x20member(s)\x20but\x20role\x20has\x20','217xEmlKd','777224tGECty','3789472mNWJQk','push','\x22:\x20','Role\x20id\x20','map','Missing\x20user\x20reference.','number','flag','4649885hcMdRL','expectUserCount','appCode','CUSTOM','remark','trim','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','userList','\x20built-in\x20role\x20','user-add','user','DEV',';\x20no\x20change.','User\x20','find','No\x20tenant\x20member\x20matches\x20\x22','dryRun','string','1357210eTMSBs','Pass\x20--role\x20<id|name>.','/smartapi/permit/user-role/update-user-list','ADMIN','str','Cannot\x20','Role\x20name\x20\x22','tenant','flagMissing','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','join','3WSTEFu','filter','488mcpnVt','84156guWdcZ','userId','tenant_code','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','length','expect-user-count','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','splice'];a159_0x23d2=function(){return _0x5f5a51;};return a159_0x23d2();}function userIdsOf(_0x3ecfe0){const _0x26e821=a159_0x491fc5;return(_0x3ecfe0?.['userList']??[])[_0x26e821(0x130)](_0x20f62c=>_0x20f62c[_0x26e821(0x156)]);}export function computeRoleUserMutation(_0x38bacb){const _0x12423b=a159_0x491fc5,{operation:_0x26f703,appCode:_0x2b3666,roleUsers:_0x21a2bf,targetRoleId:_0x3acd41,user:_0x5e774c}=_0x38bacb,_0x1cca14=_0x21a2bf[_0x12423b(0x142)](_0x40efab=>_0x40efab['id']===_0x3acd41);if(!_0x1cca14)throw CliErrors[_0x12423b(0x168)](_0x12423b(0x12f)+_0x3acd41+_0x12423b(0x16a),_0x12423b(0x162));const _0x1dfdf8=userIdsOf(_0x1cca14),_0x10af43=[];if(_0x38bacb[_0x12423b(0x135)]!==undefined&&_0x38bacb['expectUserCount']!==_0x1dfdf8[_0x12423b(0x159)])throw CliErrors[_0x12423b(0x168)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x38bacb[_0x12423b(0x135)]+_0x12423b(0x129)+_0x1dfdf8[_0x12423b(0x159)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x1a710c=_0x1dfdf8['includes'](_0x5e774c[_0x12423b(0x156)]);let _0x29c8fa=![];const _0x591897=[..._0x1cca14[_0x12423b(0x13b)]];if(_0x26f703===_0x12423b(0x13d))_0x1a710c?_0x10af43['push'](_0x12423b(0x141)+_0x5e774c['userId']+_0x12423b(0x163)+_0x1cca14[_0x12423b(0x167)]+_0x12423b(0x140)):(_0x591897[_0x12423b(0x12d)]({'userId':_0x5e774c[_0x12423b(0x156)],'username':_0x5e774c[_0x12423b(0x127)],..._0x5e774c[_0x12423b(0x126)]?{'nickname':_0x5e774c['nickname']}:{}}),_0x29c8fa=!![]);else{if(!_0x1a710c)_0x10af43[_0x12423b(0x12d)](_0x12423b(0x141)+_0x5e774c[_0x12423b(0x156)]+_0x12423b(0x150)+_0x1cca14[_0x12423b(0x167)]+';\x20no\x20change.');else{const _0x45f601=_0x591897[_0x12423b(0x165)](_0x18ecf2=>_0x18ecf2[_0x12423b(0x156)]===_0x5e774c[_0x12423b(0x156)]);if(_0x45f601>=0x0)_0x591897[_0x12423b(0x15c)](_0x45f601,0x1);_0x29c8fa=!![];}}const _0x27f689=_0x21a2bf[_0x12423b(0x130)](_0x43367e=>_0x43367e['id']===_0x3acd41?{..._0x43367e,'userList':_0x591897}:_0x43367e),_0xc6d90f=_0x591897[_0x12423b(0x130)](_0x326845=>_0x326845[_0x12423b(0x156)]),_0x5199fd={'operation':_0x26f703,'selector':{'appCode':_0x2b3666,'roleId':_0x3acd41,'roleName':_0x1cca14[_0x12423b(0x167)],'userId':_0x5e774c[_0x12423b(0x156)]},'before':{'userIds':_0x1dfdf8},'after':{'userIds':_0xc6d90f},'dryRun':_0x38bacb[_0x12423b(0x144)],'backend':{'method':_0x12423b(0x166),'path':UPDATE_USER_LIST_PATH},'warnings':_0x10af43};return{'roleList':_0x27f689,'mutation':_0x5199fd,'changed':_0x29c8fa};}export async function loadRoleUsers(_0x2b2a7b){return listRoleUsers(_0x2b2a7b);}export function readRoleRef(_0x5dd307){const _0x4f1e08=a159_0x491fc5,_0x3b4ee4=_0x5dd307[_0x4f1e08(0x14a)](_0x4f1e08(0x164))['trim']();if(!_0x3b4ee4)throw CliErrors['flagMissing']('role',_0x4f1e08(0x147));return _0x3b4ee4;}export async function prepareUserMutation(_0x17b19f,_0x56b5dd,_0x5eb7c7){const _0x5421f7=a159_0x491fc5,_0x922c73=readRoleRef(_0x17b19f),_0x1ffca2=_0x17b19f[_0x5421f7(0x14a)](_0x5421f7(0x13e))[_0x5421f7(0x139)]();if(!_0x1ffca2)throw CliErrors[_0x5421f7(0x14e)](_0x5421f7(0x13e),_0x5421f7(0x175));const _0x125c80=_0x17b19f[_0x5421f7(0x133)](_0x5421f7(0x15a)),_0x3659b8=_0x125c80===undefined||_0x125c80===null?undefined:Number(_0x125c80),_0x2322a5=await resolveRoleRef(_0x17b19f[_0x5421f7(0x136)],_0x922c73),_0x3fa817=await resolveUserRef(_0x1ffca2),_0x2b800c=await loadRoleUsers(_0x17b19f[_0x5421f7(0x136)]);return computeRoleUserMutation({'operation':_0x56b5dd,'appCode':_0x17b19f[_0x5421f7(0x136)],'roleUsers':_0x2b800c,'targetRoleId':_0x2322a5['id'],'user':{'userId':_0x3fa817[_0x5421f7(0x156)],'username':_0x3fa817[_0x5421f7(0x127)],'nickname':_0x3fa817[_0x5421f7(0x126)]},'dryRun':_0x5eb7c7,..._0x3659b8!==undefined?{'expectUserCount':_0x3659b8}:{}});}
|
|
1
|
+
const a159_0x117748=a159_0xa3f7;(function(_0x4a79fe,_0xe6872b){const _0x28bbc4=a159_0xa3f7,_0x130f36=_0x4a79fe();while(!![]){try{const _0x5aa06c=-parseInt(_0x28bbc4(0x91))/0x1*(-parseInt(_0x28bbc4(0xa6))/0x2)+parseInt(_0x28bbc4(0x8d))/0x3*(parseInt(_0x28bbc4(0xbb))/0x4)+-parseInt(_0x28bbc4(0x90))/0x5+-parseInt(_0x28bbc4(0x80))/0x6*(-parseInt(_0x28bbc4(0xbf))/0x7)+parseInt(_0x28bbc4(0x9c))/0x8+-parseInt(_0x28bbc4(0x9b))/0x9*(-parseInt(_0x28bbc4(0x84))/0xa)+-parseInt(_0x28bbc4(0x96))/0xb;if(_0x5aa06c===_0xe6872b)break;else _0x130f36['push'](_0x130f36['shift']());}catch(_0x53e464){_0x130f36['push'](_0x130f36['shift']());}}}(a159_0xa201,0xbeb65));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};function a159_0xa3f7(_0x1ef433,_0x230a01){_0x1ef433=_0x1ef433-0x80;const _0xa201d2=a159_0xa201();let _0xa3f71b=_0xa201d2[_0x1ef433];return _0xa3f71b;}export const ROLE_REF_FLAG={'name':a159_0x117748(0xb5),'type':a159_0x117748(0xa5),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':'user','type':a159_0x117748(0xa5),'required':!![],'description':a159_0x117748(0x87)};export const NAME_FLAG={'name':a159_0x117748(0xb2),'type':'string','required':!![],'description':a159_0x117748(0x81)};export const USER_NAME_FLAG={'name':'name','type':a159_0x117748(0xa5),'required':!![],'description':a159_0x117748(0xa4)};export const REMARK_FLAG={'name':'remark','type':a159_0x117748(0xa5),'required':![],'description':a159_0x117748(0xa9)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x117748(0x9f),'type':a159_0x117748(0x9e),'required':![],'description':a159_0x117748(0xc9)};export const BUILTIN_ROLE_TYPES=[a159_0x117748(0x8a),'DEV','USER'];function a159_0xa201(){const _0x3896c2=['username','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Disambiguate\x20with\x20--role\x20<id>.','includes','push',';\x20no\x20change.','nickname','No\x20tenant\x20member\x20matches\x20\x22','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','splice','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x20member(s)\x20but\x20role\x20has\x20','Role\x20name\x20\x22','trim','userList','roleType','test','8907174myxCQu','Role\x20name','tenant','\x20not\x20found\x20in\x20app\x20','619270KlAKLy','expectUserCount','CUSTOM','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Anti-drift\x20check\x20failed:\x20expected\x20','User\x20','ADMIN','flagMissing','/smartapi/permit/user-role/update-user-list','267xlxuWL','str','Cannot\x20','3013280TLPajA','733297StPlez','Multiple\x20tenant\x20members\x20match\x20\x22','filter','dryRun','appCode','52571596CbYFap','\x20built-in\x20role\x20','user-add','flag','roleName','135PPrhMS','8071176tbCMMN','\x22:\x20','number','expect-user-count','\x22\x20is\x20ambiguous\x20(ids:\x20','map','Missing\x20role\x20reference.','DEV','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','string','4FomHBR','userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Optional\x20role\x20remark/description','\x20is\x20already\x20a\x20member\x20of\x20role\x20','userCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Pass\x20--role\x20<id|name>.','findIndex','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','toLowerCase','Pass\x20--user\x20<id|name>.','name','validation','length','role','Disambiguate\x20with\x20--user\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Role\x20id\x20','Missing\x20user\x20reference.','POST','57264nGXHmU','join','user','find','7zOxlDO','authRequired'];a159_0xa201=function(){return _0x3896c2;};return a159_0xa201();}export function isBuiltinRole(_0xf4f569){return BUILTIN_ROLE_TYPES['includes'](_0xf4f569);}export function assertCustomRole(_0x438ab1,_0x255577){const _0x1a6838=a159_0x117748;if(_0x438ab1['roleType']!==_0x1a6838(0x86))throw CliErrors[_0x1a6838(0xb3)](_0x1a6838(0x8f)+_0x255577+_0x1a6838(0x97)+_0x438ab1[_0x1a6838(0x9a)]+'\x20('+_0x438ab1[_0x1a6838(0xd0)]+').',_0x1a6838(0xc2));}export function assertPermConfigurable(_0x124895){const _0x4a8d4b=a159_0x117748;if(_0x124895[_0x4a8d4b(0xd0)]===_0x4a8d4b(0xa3)||_0x124895['roleType']==='ADMIN')throw CliErrors[_0x4a8d4b(0xb3)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x124895[_0x4a8d4b(0x9a)]+'\x20('+_0x124895[_0x4a8d4b(0xd0)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x508ac8){const _0x5a7e86=a159_0x117748;return{'id':_0x508ac8['id'],'roleName':_0x508ac8[_0x5a7e86(0x9a)],'roleType':_0x508ac8['roleType'],'remark':_0x508ac8['remark'],'userCount':_0x508ac8[_0x5a7e86(0xab)],'permitCount':_0x508ac8['permitCount'],'builtin':isBuiltinRole(_0x508ac8[_0x5a7e86(0xd0)])};}export async function resolveRoleRef(_0x4976e8,_0x966cc2){const _0x11d436=a159_0x117748,_0x17f4c8=_0x966cc2[_0x11d436(0xce)]();if(!_0x17f4c8)throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xa2),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x11d436(0xd1)](_0x17f4c8))return getRoleById(_0x4976e8,Number(_0x17f4c8));const _0x5ebe20=await listAllAppRoles(_0x4976e8),_0x223818=_0x5ebe20[_0x11d436(0x93)](_0x2411ab=>_0x2411ab[_0x11d436(0x9a)]===_0x17f4c8);if(_0x223818[_0x11d436(0xb4)]===0x0)throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xcd)+_0x17f4c8+'\x22\x20not\x20found\x20in\x20app\x20'+_0x4976e8+'.',_0x11d436(0xaf));if(_0x223818[_0x11d436(0xb4)]>0x1){const _0x400249=_0x223818['map'](_0x26e64f=>_0x26e64f['id'])[_0x11d436(0xbc)](',\x20');throw CliErrors[_0x11d436(0xb3)](_0x11d436(0xcd)+_0x17f4c8+_0x11d436(0xa0)+_0x400249+').',_0x11d436(0xc3));}return _0x223818[0x0];}export async function getRoleById(_0x53da63,_0x2e4a03){const _0xc28b55=a159_0x117748,_0x215c4b=await getAppRole(_0x2e4a03);if(!_0x215c4b)throw CliErrors['validation'](_0xc28b55(0xb8)+_0x2e4a03+_0xc28b55(0x83)+_0x53da63+'.',_0xc28b55(0xa8));return _0x215c4b;}async function listAllAppRoles(_0x5b0886){const _0x3bb9d6=a159_0x117748,_0x5339ab=0x64,_0x5ca574=[];for(let _0x77319c=0x1;;_0x77319c+=0x1){const {items:_0xe0fc4f,paging:_0x416144}=await listAppRoles(_0x5b0886,{'currentPage':_0x77319c,'pageSize':_0x5339ab});_0x5ca574[_0x3bb9d6(0xc5)](..._0xe0fc4f);if(_0xe0fc4f[_0x3bb9d6(0xb4)]<_0x5339ab||_0x416144&&_0x5ca574[_0x3bb9d6(0xb4)]>=_0x416144['totalCount'])return _0x5ca574;}}export async function resolveTenantCode(){const _0x4d6762=a159_0x117748,_0x58dd37=await getSessionUserInfo(),_0x343917=_0x58dd37?.['user']?.[_0x4d6762(0x82)]?.['tenant_code'];if(!_0x343917)throw CliErrors[_0x4d6762(0xc0)](_0x4d6762(0xac));return _0x343917;}function matchMember(_0x363e97,_0x509b41){const _0x116afe=a159_0x117748,_0x94ebe1=_0x509b41['trim']()[_0x116afe(0xb0)]();return(_0x363e97['nickname']??'')[_0x116afe(0xb0)]()===_0x94ebe1||(_0x363e97[_0x116afe(0xc1)]??'')[_0x116afe(0xb0)]()===_0x94ebe1;}export async function resolveUserRef(_0x4b3563){const _0x462904=a159_0x117748,_0xdc658b=_0x4b3563[_0x462904(0xce)]();if(!_0xdc658b)throw CliErrors[_0x462904(0xb3)](_0x462904(0xb9),_0x462904(0xb1));const _0x4fb61d=await resolveTenantCode(),_0x34265a=await getTenantMembers(_0x4fb61d);if(/^\d+$/[_0x462904(0xd1)](_0xdc658b)){const _0x5c68ba=Number(_0xdc658b),_0x28f8b5=_0x34265a[_0x462904(0xbe)](_0x1f68c7=>_0x1f68c7[_0x462904(0xa7)]===_0x5c68ba);return{'userId':_0x5c68ba,'username':_0x28f8b5?.[_0x462904(0xc1)]??String(_0x5c68ba),'nickname':_0x28f8b5?.['nickname'],'matchedBy':'id'};}const _0x182bec=_0x34265a[_0x462904(0x93)](_0x25deaf=>matchMember(_0x25deaf,_0xdc658b));if(_0x182bec[_0x462904(0xb4)]===0x0)throw CliErrors[_0x462904(0xb3)](_0x462904(0xc8)+_0xdc658b+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x182bec[_0x462904(0xb4)]>0x1){const _0x146454=_0x182bec[_0x462904(0xa1)](_0x31a436=>(_0x31a436['nickname']??_0x31a436[_0x462904(0xc1)]??'?')+'('+_0x31a436['userId']+')')[_0x462904(0xbc)](',\x20');throw CliErrors[_0x462904(0xb3)](_0x462904(0x92)+_0xdc658b+_0x462904(0x9d)+_0x146454+'.',_0x462904(0xb6));}const _0x12462e=_0x182bec[0x0];return{'userId':_0x12462e[_0x462904(0xa7)],'username':_0x12462e['username']??String(_0x12462e[_0x462904(0xa7)]),'nickname':_0x12462e[_0x462904(0xc7)],'matchedBy':_0x462904(0xb2)};}export const UPDATE_USER_LIST_PATH=a159_0x117748(0x8c);function userIdsOf(_0x5e4c94){const _0x1ffa42=a159_0x117748;return(_0x5e4c94?.[_0x1ffa42(0xcf)]??[])[_0x1ffa42(0xa1)](_0x283297=>_0x283297[_0x1ffa42(0xa7)]);}export function computeRoleUserMutation(_0x3b5dac){const _0x5a9ed3=a159_0x117748,{operation:_0x5d2359,appCode:_0x1b98e7,roleUsers:_0x4cf3e8,targetRoleId:_0x2b1236,user:_0x1deed8}=_0x3b5dac,_0x287abb=_0x4cf3e8[_0x5a9ed3(0xbe)](_0x1954a6=>_0x1954a6['id']===_0x2b1236);if(!_0x287abb)throw CliErrors[_0x5a9ed3(0xb3)](_0x5a9ed3(0xb8)+_0x2b1236+_0x5a9ed3(0xb7),_0x5a9ed3(0xa8));const _0x1a0f75=userIdsOf(_0x287abb),_0x2378a5=[];if(_0x3b5dac[_0x5a9ed3(0x85)]!==undefined&&_0x3b5dac['expectUserCount']!==_0x1a0f75['length'])throw CliErrors['validation'](_0x5a9ed3(0x88)+_0x3b5dac[_0x5a9ed3(0x85)]+_0x5a9ed3(0xcc)+_0x1a0f75[_0x5a9ed3(0xb4)]+'.',_0x5a9ed3(0xcb));const _0x416d66=_0x1a0f75[_0x5a9ed3(0xc4)](_0x1deed8[_0x5a9ed3(0xa7)]);let _0x94150=![];const _0xec7841=[..._0x287abb[_0x5a9ed3(0xcf)]];if(_0x5d2359===_0x5a9ed3(0x98))_0x416d66?_0x2378a5[_0x5a9ed3(0xc5)]('User\x20'+_0x1deed8[_0x5a9ed3(0xa7)]+_0x5a9ed3(0xaa)+_0x287abb[_0x5a9ed3(0x9a)]+';\x20no\x20change.'):(_0xec7841[_0x5a9ed3(0xc5)]({'userId':_0x1deed8[_0x5a9ed3(0xa7)],'username':_0x1deed8[_0x5a9ed3(0xc1)],..._0x1deed8[_0x5a9ed3(0xc7)]?{'nickname':_0x1deed8[_0x5a9ed3(0xc7)]}:{}}),_0x94150=!![]);else{if(!_0x416d66)_0x2378a5[_0x5a9ed3(0xc5)](_0x5a9ed3(0x89)+_0x1deed8[_0x5a9ed3(0xa7)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x287abb[_0x5a9ed3(0x9a)]+_0x5a9ed3(0xc6));else{const _0x2fb23c=_0xec7841[_0x5a9ed3(0xae)](_0x44fa55=>_0x44fa55[_0x5a9ed3(0xa7)]===_0x1deed8['userId']);if(_0x2fb23c>=0x0)_0xec7841[_0x5a9ed3(0xca)](_0x2fb23c,0x1);_0x94150=!![];}}const _0x443d65=_0x4cf3e8[_0x5a9ed3(0xa1)](_0x4bd8d6=>_0x4bd8d6['id']===_0x2b1236?{..._0x4bd8d6,'userList':_0xec7841}:_0x4bd8d6),_0x2592da=_0xec7841[_0x5a9ed3(0xa1)](_0x4c27cf=>_0x4c27cf['userId']),_0xb27b4b={'operation':_0x5d2359,'selector':{'appCode':_0x1b98e7,'roleId':_0x2b1236,'roleName':_0x287abb['roleName'],'userId':_0x1deed8[_0x5a9ed3(0xa7)]},'before':{'userIds':_0x1a0f75},'after':{'userIds':_0x2592da},'dryRun':_0x3b5dac[_0x5a9ed3(0x94)],'backend':{'method':_0x5a9ed3(0xba),'path':UPDATE_USER_LIST_PATH},'warnings':_0x2378a5};return{'roleList':_0x443d65,'mutation':_0xb27b4b,'changed':_0x94150};}export async function loadRoleUsers(_0x85d9b9){return listRoleUsers(_0x85d9b9);}export function readRoleRef(_0x4d272b){const _0x5e64e4=a159_0x117748,_0x3feadb=_0x4d272b[_0x5e64e4(0x8e)](_0x5e64e4(0xb5))[_0x5e64e4(0xce)]();if(!_0x3feadb)throw CliErrors['flagMissing'](_0x5e64e4(0xb5),_0x5e64e4(0xad));return _0x3feadb;}export async function prepareUserMutation(_0xa83f04,_0x25acd8,_0x48f1f8){const _0x26f33b=a159_0x117748,_0x4c60d9=readRoleRef(_0xa83f04),_0x2ce28d=_0xa83f04[_0x26f33b(0x8e)](_0x26f33b(0xbd))[_0x26f33b(0xce)]();if(!_0x2ce28d)throw CliErrors[_0x26f33b(0x8b)](_0x26f33b(0xbd),_0x26f33b(0xb1));const _0x55fba6=_0xa83f04[_0x26f33b(0x99)](_0x26f33b(0x9f)),_0x3b6588=_0x55fba6===undefined||_0x55fba6===null?undefined:Number(_0x55fba6),_0x44ab47=await resolveRoleRef(_0xa83f04[_0x26f33b(0x95)],_0x4c60d9),_0x67c442=await resolveUserRef(_0x2ce28d),_0x39a63f=await loadRoleUsers(_0xa83f04['appCode']);return computeRoleUserMutation({'operation':_0x25acd8,'appCode':_0xa83f04[_0x26f33b(0x95)],'roleUsers':_0x39a63f,'targetRoleId':_0x44ab47['id'],'user':{'userId':_0x67c442[_0x26f33b(0xa7)],'username':_0x67c442[_0x26f33b(0xc1)],'nickname':_0x67c442[_0x26f33b(0xc7)]},'dryRun':_0x48f1f8,..._0x3b6588!==undefined?{'expectUserCount':_0x3b6588}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a160_0x2744(_0x43f307,_0x564bed){_0x43f307=_0x43f307-0x120;const _0x62f850=a160_0x62f8();let _0x27445f=_0x62f850[_0x43f307];return _0x27445f;}const a160_0x2f68de=a160_0x2744;(function(_0x164ab0,_0x4cbb3d){const _0x2e65af=a160_0x2744,_0x1c7630=_0x164ab0();while(!![]){try{const _0xadad7d=-parseInt(_0x2e65af(0x121))/0x1*(parseInt(_0x2e65af(0x138))/0x2)+-parseInt(_0x2e65af(0x12c))/0x3+-parseInt(_0x2e65af(0x139))/0x4*(-parseInt(_0x2e65af(0x137))/0x5)+parseInt(_0x2e65af(0x127))/0x6*(-parseInt(_0x2e65af(0x12f))/0x7)+parseInt(_0x2e65af(0x128))/0x8+-parseInt(_0x2e65af(0x130))/0x9+parseInt(_0x2e65af(0x136))/0xa;if(_0xadad7d===_0x4cbb3d)break;else _0x1c7630['push'](_0x1c7630['shift']());}catch(_0x23c14f){_0x1c7630['push'](_0x1c7630['shift']());}}}(a160_0x62f8,0xde759));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a160_0x62f8(){const _0x1453ef=['flag','1603EQAvXU','2148579EALPDr','roleName','Updated\x20role\x20','/smartapi/permit/role/update','remark','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','18567660DlOQZp','1797595dEinPQ','4mAlhpW','4hLPXgg','num','Nothing\x20to\x20update.','New\x20role\x20name','role','update','--name\x20cannot\x20be\x20empty.','13630EaQxVt','POST','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','appCode','validation','\x20(id=','28716qUxeME','14032056jEICKo','name','string','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','5091342VLVtNZ','length'];a160_0x62f8=function(){return _0x1453ef;};return a160_0x62f8();}const UPDATE_PATH=a160_0x2f68de(0x133);function readPatch(_0x289d32){const _0x5c3be0=a160_0x2f68de,_0x3cd3d1=_0x289d32[_0x5c3be0(0x12e)](_0x5c3be0(0x129)),_0x541e95=_0x289d32[_0x5c3be0(0x12e)](_0x5c3be0(0x134)),_0x1d3ac2={};if(_0x3cd3d1!==undefined&&_0x3cd3d1!==null){const _0x241734=String(_0x3cd3d1)['trim']();if(!_0x241734)throw CliErrors[_0x5c3be0(0x125)](_0x5c3be0(0x120));if(_0x241734[_0x5c3be0(0x12d)]>0x40)throw CliErrors[_0x5c3be0(0x125)](_0x5c3be0(0x135));_0x1d3ac2['roleName']=_0x241734;}_0x541e95!==undefined&&_0x541e95!==null&&(_0x1d3ac2[_0x5c3be0(0x134)]=String(_0x541e95));if(_0x1d3ac2[_0x5c3be0(0x131)]===undefined&&_0x1d3ac2[_0x5c3be0(0x134)]===undefined)throw CliErrors['validation'](_0x5c3be0(0x13b),_0x5c3be0(0x12b));return _0x1d3ac2;}export const roleUpdate={'service':a160_0x2f68de(0x13d),'command':'update','description':a160_0x2f68de(0x123),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a160_0x2f68de(0x129),'type':a160_0x2f68de(0x12a),'required':![],'description':a160_0x2f68de(0x13c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x49ff98){readPatch(_0x49ff98);},async 'dryRun'(_0x58c491){const _0x5450c0=a160_0x2f68de,_0x268c20=_0x58c491[_0x5450c0(0x13a)]('id'),_0x21f37c=readPatch(_0x58c491),_0x5dc3d1=await getRoleById(_0x58c491[_0x5450c0(0x124)],_0x268c20);return assertCustomRole(_0x5dc3d1,_0x5450c0(0x13e)),asDryRunResult({'operation':_0x5450c0(0x13e),'selector':{'appCode':_0x58c491[_0x5450c0(0x124)],'roleId':_0x268c20,'roleName':_0x5dc3d1[_0x5450c0(0x131)]},'before':projectRole(_0x5dc3d1),'after':projectRole({..._0x5dc3d1,..._0x21f37c[_0x5450c0(0x131)]!==undefined?{'roleName':_0x21f37c['roleName']}:{},..._0x21f37c['remark']!==undefined?{'remark':_0x21f37c[_0x5450c0(0x134)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x5450c0(0x122),'url':UPDATE_PATH});},async 'execute'(_0x153902){const _0x278c21=a160_0x2f68de,_0x288445=_0x153902[_0x278c21(0x13a)]('id'),_0x3d28b6=readPatch(_0x153902),_0x1ee0e2=await getRoleById(_0x153902[_0x278c21(0x124)],_0x288445);assertCustomRole(_0x1ee0e2,'update'),await updateAppRole({'id':_0x288445,'appCode':_0x153902['appCode'],..._0x3d28b6[_0x278c21(0x131)]!==undefined?{'roleName':_0x3d28b6[_0x278c21(0x131)]}:{},..._0x3d28b6[_0x278c21(0x134)]!==undefined?{'remark':_0x3d28b6[_0x278c21(0x134)]}:{}});const _0x368e40=await getRoleById(_0x153902[_0x278c21(0x124)],_0x288445);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x153902[_0x278c21(0x124)],'roleId':_0x288445,'roleName':_0x368e40['roleName']},'before':projectRole(_0x1ee0e2),'after':projectRole(_0x368e40),'dryRun':![],'backend':{'method':_0x278c21(0x122),'path':UPDATE_PATH},'warnings':[]},'message':_0x278c21(0x132)+_0x368e40[_0x278c21(0x131)]+_0x278c21(0x126)+_0x288445+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0xd5c4fb=a161_0x598d;(function(_0x30555d,_0x207669){const _0xd00d3d=a161_0x598d,_0x16b0f0=_0x30555d();while(!![]){try{const _0x1cea7d=-parseInt(_0xd00d3d(0x137))/0x1*(-parseInt(_0xd00d3d(0x127))/0x2)+-parseInt(_0xd00d3d(0x133))/0x3+-parseInt(_0xd00d3d(0x13c))/0x4+-parseInt(_0xd00d3d(0x136))/0x5+parseInt(_0xd00d3d(0x129))/0x6*(-parseInt(_0xd00d3d(0x13a))/0x7)+parseInt(_0xd00d3d(0x139))/0x8*(-parseInt(_0xd00d3d(0x134))/0x9)+parseInt(_0xd00d3d(0x12f))/0xa;if(_0x1cea7d===_0x207669)break;else _0x16b0f0['push'](_0x16b0f0['shift']());}catch(_0x200771){_0x16b0f0['push'](_0x16b0f0['shift']());}}}(a161_0x5e75,0x458ea));import{updateRoleUsers}from'../../core/api-client.js';function a161_0x5e75(){const _0x1d5286=['572106BHhUcj','user-add','high-risk-write','role','No\x20change:\x20user\x20','selector','18103020zJvoCs','appCode','roleName','\x20already\x20in\x20role\x20','1607139ZZbEyx','42759EpVOGb','userId','920065BcsmJb','844fLjQCG','\x20to\x20role\x20','808QDFttQ','7zkGerp','POST','1333744vziXlm','244cPYKov','Added\x20user\x20'];a161_0x5e75=function(){return _0x1d5286;};return a161_0x5e75();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a161_0x598d(_0x2a4aae,_0x181a0f){_0x2a4aae=_0x2a4aae-0x127;const _0x5e752d=a161_0x5e75();let _0x598da4=_0x5e752d[_0x2a4aae];return _0x598da4;}export const roleUserAdd={'service':a161_0xd5c4fb(0x12c),'command':a161_0xd5c4fb(0x12a),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a161_0xd5c4fb(0x12b),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3fb647){const _0x1f82ea=a161_0xd5c4fb,{mutation:_0x4a34b2}=await prepareUserMutation(_0x3fb647,_0x1f82ea(0x12a),!![]);return asDryRunResult(_0x4a34b2,{'method':_0x1f82ea(0x13b),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x32032c){const _0x55e2f3=a161_0xd5c4fb,{roleList:_0x484a0e,mutation:_0x228a68,changed:_0x5414bf}=await prepareUserMutation(_0x32032c,_0x55e2f3(0x12a),![]);return _0x5414bf&&await updateRoleUsers(_0x32032c[_0x55e2f3(0x130)],_0x484a0e),{'ok':!![],'data':_0x228a68,'message':_0x5414bf?_0x55e2f3(0x128)+_0x228a68['selector'][_0x55e2f3(0x135)]+_0x55e2f3(0x138)+_0x228a68[_0x55e2f3(0x12e)]['roleName']:_0x55e2f3(0x12d)+_0x228a68[_0x55e2f3(0x12e)][_0x55e2f3(0x135)]+_0x55e2f3(0x132)+_0x228a68[_0x55e2f3(0x12e)][_0x55e2f3(0x131)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x21210d=a162_0x4d4b;(function(_0x7d3ad1,_0xba3bd3){const _0x1008da=a162_0x4d4b,_0x4df9ac=_0x7d3ad1();while(!![]){try{const _0x5d155f=-parseInt(_0x1008da(0x1a2))/0x1*(parseInt(_0x1008da(0x196))/0x2)+-parseInt(_0x1008da(0x199))/0x3+-parseInt(_0x1008da(0x19a))/0x4*(parseInt(_0x1008da(0x18f))/0x5)+parseInt(_0x1008da(0x194))/0x6+-parseInt(_0x1008da(0x18e))/0x7+-parseInt(_0x1008da(0x19b))/0x8+-parseInt(_0x1008da(0x19d))/0x9*(-parseInt(_0x1008da(0x191))/0xa);if(_0x5d155f===_0xba3bd3)break;else _0x4df9ac['push'](_0x4df9ac['shift']());}catch(_0x4e9e3e){_0x4df9ac['push'](_0x4df9ac['shift']());}}}(a162_0xc189,0x98f3c));function a162_0x4d4b(_0x1158a2,_0x26d179){_0x1158a2=_0x1158a2-0x18d;const _0xc189dc=a162_0xc189();let _0x4d4b34=_0xc189dc[_0x1158a2];return _0x4d4b34;}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a162_0x21210d(0x19c),'command':a162_0x21210d(0x1a1),'description':a162_0x21210d(0x19e),'risk':a162_0x21210d(0x1a0),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x553874){const _0x2c3b04=a162_0x21210d,{mutation:_0x15b2ff}=await prepareUserMutation(_0x553874,_0x2c3b04(0x1a1),!![]);return asDryRunResult(_0x15b2ff,{'method':_0x2c3b04(0x18d),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3e912a){const _0x3bb419=a162_0x21210d,{roleList:_0x8ccbdf,mutation:_0x42a3d6,changed:_0x1f7688}=await prepareUserMutation(_0x3e912a,_0x3bb419(0x1a1),![]);return _0x1f7688&&await updateRoleUsers(_0x3e912a[_0x3bb419(0x195)],_0x8ccbdf),{'ok':!![],'data':_0x42a3d6,'message':_0x1f7688?_0x3bb419(0x197)+_0x42a3d6[_0x3bb419(0x192)]['userId']+_0x3bb419(0x190)+_0x42a3d6[_0x3bb419(0x192)][_0x3bb419(0x19f)]:_0x3bb419(0x198)+_0x42a3d6['selector']['userId']+_0x3bb419(0x193)+_0x42a3d6['selector']['roleName']};}};function a162_0xc189(){const _0x547c79=['31143483vSozNm','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','roleName','high-risk-write','user-remove','58187YUNLXr','POST','3452407Oyxngj','125390LqaWqu','\x20from\x20role\x20','10rbDhPP','selector','\x20not\x20in\x20role\x20','1400208TWPBMa','appCode','36CwLrqX','Removed\x20user\x20','No\x20change:\x20user\x20','1137495jFpzgR','136YhKSOi','2359032RMACVU','role'];a162_0xc189=function(){return _0x547c79;};return a162_0xc189();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a163_0x34741b=a163_0x36c2;(function(_0x28140f,_0x33d51e){const _0x373f99=a163_0x36c2,_0x5569a7=_0x28140f();while(!![]){try{const _0x4c2b64=parseInt(_0x373f99(0x93))/0x1+parseInt(_0x373f99(0x7e))/0x2+parseInt(_0x373f99(0x8b))/0x3+parseInt(_0x373f99(0x90))/0x4+parseInt(_0x373f99(0x81))/0x5*(-parseInt(_0x373f99(0x8f))/0x6)+-parseInt(_0x373f99(0x7f))/0x7+parseInt(_0x373f99(0x92))/0x8*(-parseInt(_0x373f99(0x8a))/0x9);if(_0x4c2b64===_0x33d51e)break;else _0x5569a7['push'](_0x5569a7['shift']());}catch(_0x2a5fa4){_0x5569a7['push'](_0x5569a7['shift']());}}}(a163_0x4c61,0x649e3));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 a163_0x36c2(_0x186714,_0x557305){_0x186714=_0x186714-0x7e;const _0x4c6130=a163_0x4c61();let _0x36c2d5=_0x4c6130[_0x186714];return _0x36c2d5;}export const roleUserResolve={'service':a163_0x34741b(0x86),'command':a163_0x34741b(0x8c),'description':a163_0x34741b(0x84),'risk':a163_0x34741b(0x8d),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1b8248){const _0x55e10a=a163_0x34741b;if(!_0x1b8248[_0x55e10a(0x80)](_0x55e10a(0x88))[_0x55e10a(0x83)]())throw CliErrors[_0x55e10a(0x87)](_0x55e10a(0x88),_0x55e10a(0x91));},async 'execute'(_0x5b297e){const _0x1e263f=a163_0x34741b,_0x3f8482=_0x5b297e['str'](_0x1e263f(0x88))['trim'](),_0x2c746c=await resolveUserRef(_0x3f8482);return{'ok':!![],'data':{'user':{'userId':_0x2c746c[_0x1e263f(0x85)],'username':_0x2c746c[_0x1e263f(0x82)],'nickname':_0x2c746c[_0x1e263f(0x8e)],'matchedBy':_0x2c746c[_0x1e263f(0x89)]}},'message':'Resolved\x20\x22'+_0x3f8482+'\x22\x20→\x20userId\x20'+_0x2c746c[_0x1e263f(0x85)]};}};function a163_0x4c61(){const _0x4f9b64=['name','matchedBy','33039UMPnoV','1843089ssCkRu','user-resolve','read','nickname','2946pnZMVH','693276txMSNF','Pass\x20--name\x20<nickname|username>.','1928ufzPKJ','593839Huyexc','1118974yVJovS','4340749GdkyOj','str','245DEmnkm','username','trim','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','userId','role','flagMissing'];a163_0x4c61=function(){return _0x4f9b64;};return a163_0x4c61();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x22a4ad=a164_0x3ba6;(function(_0x309c5c,_0x51ff2a){const _0x5f0265=a164_0x3ba6,_0xcfe03=_0x309c5c();while(!![]){try{const _0x4145f1=parseInt(_0x5f0265(0x211))/0x1*(parseInt(_0x5f0265(0x207))/0x2)+parseInt(_0x5f0265(0x1d9))/0x3+parseInt(_0x5f0265(0x20d))/0x4*(-parseInt(_0x5f0265(0x1e7))/0x5)+parseInt(_0x5f0265(0x208))/0x6*(-parseInt(_0x5f0265(0x1e6))/0x7)+parseInt(_0x5f0265(0x1fc))/0x8*(-parseInt(_0x5f0265(0x1ea))/0x9)+-parseInt(_0x5f0265(0x1fd))/0xa*(parseInt(_0x5f0265(0x1d3))/0xb)+-parseInt(_0x5f0265(0x200))/0xc*(-parseInt(_0x5f0265(0x1f8))/0xd);if(_0x4145f1===_0x51ff2a)break;else _0xcfe03['push'](_0xcfe03['shift']());}catch(_0x2aec25){_0xcfe03['push'](_0xcfe03['shift']());}}}(a164_0x16b5,0x1fca3));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';function a164_0x16b5(){const _0x26c3b0=['511mEUVbC','1265WDoueO','npm','preview','77598yjBJRY','package.json','join','validation','build','node_modules','(none)','\x20\x20EXAMPLES','log','\x20run\x20','args','Run\x20a\x20package.json\x20script','\x22\x20not\x20found\x20in\x20package.json.','needsUpgrade','13kyFjSO','\x20\x20\x20\x20','pnpm','boolean','88oovBku','10nXzTJx','error','No\x20scripts\x20defined\x20in\x20package.json.','3325776bzqrti','all','watch','slice','No\x20package.json\x20found\x20in\x20current\x20directory.','Available:\x20','bun.lockb','77486WAENJT','3054cDJiKf','pnpm-lock.yaml','bun','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','utf-8','628rKIKzB','bun.lock','inherit','yarn.lock','5gmHexB','script','close','length','\x0a\x20\x20Available\x20scripts:\x0a','.bin','Script\x20\x22','2731641MBCGLF','dev','yarn','push','run','\x20run\x20preview\x20--watch','238197nvizAq','start','\x20run\x20preview','Script\x20name\x20defined\x20in\x20package.json','\x20exited\x20with\x20code\x20','vite','keys','parse','read','Enable\x20watch\x20mode\x20for\x20preview','vite\x20preview\x20exited\x20with\x20code\x20','scripts','\x20run\x20start'];a164_0x16b5=function(){return _0x26c3b0;};return a164_0x16b5();}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([a164_0x22a4ad(0x1da),a164_0x22a4ad(0x1d4)]);function readPackageScripts(_0x51ec52){const _0x5b22c8=a164_0x22a4ad,_0x4dd889=resolve(_0x51ec52,_0x5b22c8(0x1eb));if(!existsSync(_0x4dd889))return null;try{const _0xba07cf=JSON[_0x5b22c8(0x1e0)](readFileSync(_0x4dd889,_0x5b22c8(0x20c)));return _0xba07cf[_0x5b22c8(0x1e4)]??{};}catch{return null;}}function detectPackageManager(_0x241453){const _0x39b1f8=a164_0x22a4ad;if(existsSync(resolve(_0x241453,_0x39b1f8(0x206)))||existsSync(resolve(_0x241453,_0x39b1f8(0x20e))))return _0x39b1f8(0x20a);if(existsSync(resolve(_0x241453,_0x39b1f8(0x209))))return _0x39b1f8(0x1fa);if(existsSync(resolve(_0x241453,_0x39b1f8(0x210))))return _0x39b1f8(0x1d5);return _0x39b1f8(0x1e8);}async function versionCheck(_0x233a74){const _0x3ef598=a164_0x22a4ad,_0x1fd4f9=await checkCliVersion();(_0x1fd4f9[_0x3ef598(0x1f7)]||_0x1fd4f9['belowMinimum'])&&(printCliUpgradeWarning(_0x1fd4f9),assertCliVersionSupported(_0x1fd4f9));const _0x364ddf=await checkSdkVersion(_0x233a74);if(_0x364ddf[_0x3ef598(0x1f7)])printSdkUpgradeWarning(_0x364ddf);}function a164_0x3ba6(_0x8eb9d6,_0x85b99f){_0x8eb9d6=_0x8eb9d6-0x1cf;const _0x16b5fb=a164_0x16b5();let _0x3ba60a=_0x16b5fb[_0x8eb9d6];return _0x3ba60a;}function spawnScript(_0x59589b,_0x18dd57,_0x329042,_0x30371a){return new Promise((_0x58c698,_0x348c87)=>{const _0x4c96b2=a164_0x3ba6,_0x2bfaa5=[_0x4c96b2(0x1d7),_0x18dd57,..._0x329042],_0x51730c=spawn(_0x59589b,_0x2bfaa5,{'cwd':_0x30371a,'stdio':_0x4c96b2(0x20f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x30371a,_0x4c96b2(0x1ef),_0x4c96b2(0x1d1))+delimiter+process.env.PATH}});_0x51730c['on'](_0x4c96b2(0x213),_0x5bc3e2=>{const _0x3ac603=_0x4c96b2;if(_0x5bc3e2===0x0||_0x5bc3e2===null)_0x58c698();else _0x348c87(new Error(_0x59589b+_0x3ac603(0x1f3)+_0x18dd57+_0x3ac603(0x1dd)+_0x5bc3e2));}),_0x51730c['on'](_0x4c96b2(0x1fe),_0x348c87);});}function spawnViteBuildWatch(_0x4ea02c){return new Promise((_0x595059,_0x414753)=>{const _0x5496ba=a164_0x3ba6,_0x546e79=spawn('vite',[_0x5496ba(0x1ee),'--watch'],{'cwd':_0x4ea02c,'stdio':_0x5496ba(0x20f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4ea02c,_0x5496ba(0x1ef),'.bin')+delimiter+process.env.PATH}});_0x546e79['on']('close',_0x455aab=>{const _0x2545b7=_0x5496ba;if(_0x455aab===0x0||_0x455aab===null)_0x595059();else _0x414753(new Error(_0x2545b7(0x20b)+_0x455aab));}),_0x546e79['on'](_0x5496ba(0x1fe),_0x414753);});}function spawnVitePreview(_0x3944c){return new Promise((_0x5b6131,_0xa9a187)=>{const _0x331fba=a164_0x3ba6,_0x4f1c6b=spawn(_0x331fba(0x1de),[_0x331fba(0x1e9)],{'cwd':_0x3944c,'stdio':_0x331fba(0x20f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3944c,_0x331fba(0x1ef),_0x331fba(0x1d1))+delimiter+process.env.PATH}});_0x4f1c6b['on'](_0x331fba(0x213),_0x50ba76=>{const _0x3e8ce5=_0x331fba;if(_0x50ba76===0x0||_0x50ba76===null)_0x5b6131();else _0xa9a187(new Error(_0x3e8ce5(0x1e3)+_0x50ba76));}),_0x4f1c6b['on'](_0x331fba(0x1fe),_0xa9a187);});}const runFlags=[{'name':a164_0x22a4ad(0x202),'type':a164_0x22a4ad(0x1fb),'description':a164_0x22a4ad(0x1e2),'default':![]}];export const runDefinition={'service':a164_0x22a4ad(0x1d7),'command':a164_0x22a4ad(0x1d7),'description':a164_0x22a4ad(0x1f5),'risk':a164_0x22a4ad(0x1e1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a164_0x22a4ad(0x212),'description':a164_0x22a4ad(0x1dc),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x105d99=a164_0x22a4ad,_0xfd032f=[];return _0xfd032f[_0x105d99(0x1d6)](_0x105d99(0x1f1)),_0xfd032f[_0x105d99(0x1d6)](_0x105d99(0x1f9)+CLI_BIN_NAME+_0x105d99(0x1e5)),_0xfd032f['push'](_0x105d99(0x1f9)+CLI_BIN_NAME+'\x20run\x20build'),_0xfd032f[_0x105d99(0x1d6)](_0x105d99(0x1f9)+CLI_BIN_NAME+_0x105d99(0x1db)),_0xfd032f[_0x105d99(0x1d6)](_0x105d99(0x1f9)+CLI_BIN_NAME+_0x105d99(0x1d8)),_0xfd032f[_0x105d99(0x1ec)]('\x0a');},async 'execute'(_0x1336d2){const _0x493e1f=a164_0x22a4ad,_0x1d406b=process['cwd'](),_0x4f6e81=_0x1336d2['args'][0x0],_0x7a1a80=_0x1336d2[_0x493e1f(0x1f4)][_0x493e1f(0x203)](0x1),_0x16ebf8=readPackageScripts(_0x1d406b);if(!_0x16ebf8)throw CliErrors[_0x493e1f(0x1ed)](_0x493e1f(0x204));if(!_0x4f6e81){const _0x520a56=Object[_0x493e1f(0x1df)](_0x16ebf8);if(_0x520a56[_0x493e1f(0x1cf)]===0x0)console[_0x493e1f(0x1f2)](_0x493e1f(0x1ff));else{console[_0x493e1f(0x1f2)](_0x493e1f(0x1d0));for(const _0x14b30e of _0x520a56){console[_0x493e1f(0x1f2)](_0x493e1f(0x1f9)+_0x14b30e);}console[_0x493e1f(0x1f2)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x16ebf8[_0x4f6e81])throw CliErrors[_0x493e1f(0x1ed)](_0x493e1f(0x1d2)+_0x4f6e81+_0x493e1f(0x1f6),_0x493e1f(0x205)+(Object[_0x493e1f(0x1df)](_0x16ebf8)[_0x493e1f(0x1ec)](',\x20')||_0x493e1f(0x1f0)));const _0x4f91fc=detectPackageManager(_0x1d406b);VERSION_CHECK_SCRIPTS['has'](_0x4f6e81)&&await versionCheck(_0x1d406b);if(_0x4f6e81===_0x493e1f(0x1e9)&&_0x1336d2['bool'](_0x493e1f(0x202)))return await Promise[_0x493e1f(0x201)]([spawnViteBuildWatch(_0x1d406b),spawnVitePreview(_0x1d406b)]),{'ok':!![]};return await spawnScript(_0x4f91fc,_0x4f6e81,_0x7a1a80,_0x1d406b),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a165_0x1d8312=a165_0x38ed;function a165_0x38ed(_0x5bc4e3,_0x36bb01){_0x5bc4e3=_0x5bc4e3-0x67;const _0x4c2467=a165_0x4c24();let _0x38ed3b=_0x4c2467[_0x5bc4e3];return _0x38ed3b;}(function(_0x4a5357,_0x3ea57d){const _0x44ac65=a165_0x38ed,_0x4b9a82=_0x4a5357();while(!![]){try{const _0x26f485=-parseInt(_0x44ac65(0x6d))/0x1*(-parseInt(_0x44ac65(0x6e))/0x2)+parseInt(_0x44ac65(0x6f))/0x3*(parseInt(_0x44ac65(0x69))/0x4)+-parseInt(_0x44ac65(0x74))/0x5*(parseInt(_0x44ac65(0x70))/0x6)+parseInt(_0x44ac65(0x6c))/0x7*(-parseInt(_0x44ac65(0x76))/0x8)+-parseInt(_0x44ac65(0x75))/0x9+parseInt(_0x44ac65(0x67))/0xa*(parseInt(_0x44ac65(0x6a))/0xb)+-parseInt(_0x44ac65(0x72))/0xc*(-parseInt(_0x44ac65(0x73))/0xd);if(_0x26f485===_0x3ea57d)break;else _0x4b9a82['push'](_0x4b9a82['shift']());}catch(_0x2604a2){_0x4b9a82['push'](_0x4b9a82['shift']());}}}(a165_0x4c24,0xe4862));function a165_0x4c24(){const _0x552f66=['13lsAsrG','5AtoXmt','16010748UVURUn','80HxKCLb','70ZmcSBn','schema','16bweyWK','649JrznZr','json','728266fBLTRu','489347BIhPsb','2SQZhMj','688236azXsbB','7147482tJtqTF','Export\x20machine-readable\x20command\x20schema\x20(JSON)','42470700tXZwEk'];a165_0x4c24=function(){return _0x552f66;};return a165_0x4c24();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x48e7e9){const _0x47e83e=await buildSchemaPayload();return{'ok':!![],'data':_0x47e83e};}export const schemaDefinition={'service':a165_0x1d8312(0x68),'command':'export','description':a165_0x1d8312(0x71),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a165_0x1d8312(0x6b),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a166_0x23d486=a166_0x4105;(function(_0x455a02,_0x446fc8){const _0x36a101=a166_0x4105,_0x3b47ee=_0x455a02();while(!![]){try{const _0x2cc04d=parseInt(_0x36a101(0x1fb))/0x1+-parseInt(_0x36a101(0x1e9))/0x2+-parseInt(_0x36a101(0x1f7))/0x3+parseInt(_0x36a101(0x1fa))/0x4*(parseInt(_0x36a101(0x211))/0x5)+-parseInt(_0x36a101(0x1e7))/0x6+-parseInt(_0x36a101(0x1e1))/0x7+-parseInt(_0x36a101(0x204))/0x8*(-parseInt(_0x36a101(0x1de))/0x9);if(_0x2cc04d===_0x446fc8)break;else _0x3b47ee['push'](_0x3b47ee['shift']());}catch(_0x27f1f0){_0x3b47ee['push'](_0x3b47ee['shift']());}}}(a166_0x2a7e,0x71ab2));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 a166_0x2a7e(){const _0x41ea6a=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','trim','SQL\x20query\x20display\x20name','dbName','Invalid\x20database\x20selection\x20payload:\x20','24718743DzdKYm','description','请选择本地\x20SQL\x20模式:','3650780gYqFVl','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','appCode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId\x20不能为空','number','5137662TdDrPT','sqlRoot','1720700rbmHns','mode','validation','catch','str','POST','flag','isFinite','new','SQL\x20名称不能为空','/smartapi/custom/saveUserCustomSql','sql','sqlRootDir','isInteger','2132379LecfPW','flagMissing','</select>','4viZeVs','505557hcEcir','db-id','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','sqls','适合带动态标签的\x20MyBatis\x20XML\x20SQL','lastSync','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','length','MyBatis\x20XML(mybatisXml)','8SdioTY','utf8','__manual__','name','sqlCode','Target\x20database\x20ID','stringify','请输入\x20SQL\x20名称:','\x20\x20SELECT\x201\x20AS\x20id','string','Created\x20SQL\x20query\x20','请输入目标数据库\x20dbId:','lockFilePath','812310OtQQvb','mybatisXml','join','nonInteractive','sqlName','SELECT\x201\x20AS\x20id;','<server-generated-sqlCode>','toISOString','dbId'];a166_0x2a7e=function(){return _0x41ea6a;};return a166_0x2a7e();}function a166_0x4105(_0x12eef2,_0x306d00){_0x12eef2=_0x12eef2-0x1db;const _0x2a7e61=a166_0x2a7e();let _0x410524=_0x2a7e61[_0x12eef2];return _0x410524;}function generateSqlTemplate(_0x48d132){const _0x4d8331=a166_0x4105;if(_0x48d132===_0x4d8331(0x212))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x4d8331(0x20c),_0x4d8331(0x1f9),'']['join']('\x0a');return[_0x4d8331(0x216),''][_0x4d8331(0x213)]('\x0a');}export const sqlCreate={'service':'sql','command':'create','description':a166_0x23d486(0x1e2),'risk':'high-risk-write','flags':[{'name':a166_0x23d486(0x207),'type':a166_0x23d486(0x20d),'description':a166_0x23d486(0x1db)},{'name':a166_0x23d486(0x1fc),'type':a166_0x23d486(0x1e6),'description':a166_0x23d486(0x209)},{'name':a166_0x23d486(0x1ea),'type':a166_0x23d486(0x20d),'enum':[a166_0x23d486(0x1f4),a166_0x23d486(0x212)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x5d9e8d){const _0x13023c=a166_0x23d486;if(!_0x5d9e8d[_0x13023c(0x214)])return;if(!_0x5d9e8d['str'](_0x13023c(0x207))[_0x13023c(0x21b)]())throw CliErrors['flagMissing']('name',_0x13023c(0x201));const _0x27bcee=resolveProvidedDbId(_0x5d9e8d);if(typeof _0x27bcee!=='number'||!Number[_0x13023c(0x1f0)](_0x27bcee)||_0x27bcee<=0x0)throw CliErrors[_0x13023c(0x1f8)](_0x13023c(0x1fc),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x5d9e8d[_0x13023c(0x1ed)](_0x13023c(0x1ea))[_0x13023c(0x21b)]())throw CliErrors[_0x13023c(0x1f8)](_0x13023c(0x1ea),_0x13023c(0x1e4));},async 'dryRun'(_0x40d2bc){const _0x3fc550=a166_0x23d486,_0x171b29=loadSqlProjectConfig(_0x40d2bc[_0x3fc550(0x1e3)]),{sqlName:_0x1790e4,dbId:_0x45bd5f,dbName:_0x2037b6,mode:_0x350728}=await resolveSqlNewInputs(_0x40d2bc),_0x54ae31=buildSqlRelativePath(_0x3fc550(0x217),_0x1790e4,_0x2037b6,_0x350728,_0x45bd5f),_0x1c05a5=_0x171b29[_0x3fc550(0x1f5)]+'/'+_0x54ae31;return{'method':_0x3fc550(0x1ee),'url':_0x3fc550(0x1f3),'body':{'appCode':_0x40d2bc[_0x3fc550(0x1e3)],'sqlName':_0x1790e4,'dbId':_0x45bd5f,'mode':_0x350728,'localPath':_0x1c05a5},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x171b29[_0x3fc550(0x1f5)]};},async 'execute'(_0x41c191){const _0x4a3dff=a166_0x23d486,_0x2e7bac=loadSqlProjectConfig(_0x41c191[_0x4a3dff(0x1e3)]),{sqlName:_0xf571a7,dbId:_0x76761f,dbName:_0x3b5acf,mode:_0x24f56e}=await resolveSqlNewInputs(_0x41c191),_0x1a9d25=generateSqlTemplate(_0x24f56e),_0x4a64ea=await createSqlQuery({'appCode':_0x41c191[_0x4a3dff(0x1e3)],'sqlName':_0xf571a7,'dbId':_0x76761f,'sqlContent':_0x1a9d25}),_0x424d8d=ensureRemoteSqlContent(_0x4a64ea),_0x330ed4=_0x3b5acf||await getDbName(_0x41c191[_0x4a3dff(0x1e3)],_0x76761f)[_0x4a3dff(0x1ec)](()=>undefined),_0x5cf504=buildSqlRelativePath(_0x4a64ea[_0x4a3dff(0x208)],_0x4a64ea['sqlName'],_0x330ed4,_0x24f56e,_0x76761f),_0x1f741e=_0x2e7bac[_0x4a3dff(0x1f5)]+'/'+_0x5cf504,_0x1f4a36=buildLocalSqlFileContent({'sqlCode':_0x4a64ea[_0x4a3dff(0x208)],'sqlName':_0x4a64ea[_0x4a3dff(0x215)],'dbId':_0x4a64ea[_0x4a3dff(0x219)]},_0x424d8d,{'dbName':_0x330ed4,'mode':_0x24f56e,'syncedAt':new Date()[_0x4a3dff(0x218)](),'description':_0x4a64ea[_0x4a3dff(0x1df)]});if(await fileExists(_0x1f741e))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x1f741e);await ensureParentDirectory(_0x1f741e),await writeFile(_0x1f741e,_0x1f4a36,_0x4a3dff(0x205));const _0x1ad186=await readSqlLockFile(_0x2e7bac['lockFilePath']),{lockData:_0x580d22,appLock:_0x126099}=ensureSqlLockScope(_0x1ad186??createEmptySqlLock(),_0x2e7bac[_0x4a3dff(0x1e3)],_0x2e7bac[_0x4a3dff(0x1e8)],_0x4a3dff(0x1f1));return _0x126099[_0x4a3dff(0x1fe)][_0x4a64ea['sqlCode']]={...buildSqlLockEntry(_0x4a64ea,_0x424d8d,computeSqlContentHash(_0x1f4a36),{'dbName':_0x330ed4}),'path':_0x5cf504,'mode':_0x24f56e},_0x126099[_0x4a3dff(0x200)]=new Date()[_0x4a3dff(0x218)](),await writeSqlLockFile(_0x2e7bac[_0x4a3dff(0x210)],_0x580d22),{'ok':!![],'data':{'id':_0x4a64ea['id'],'sqlCode':_0x4a64ea[_0x4a3dff(0x208)],'sqlName':_0x4a64ea['sqlName'],'dbId':_0x4a64ea['dbId'],'path':_0x1f741e,'mode':_0x24f56e},'message':_0x4a3dff(0x20e)+_0x4a64ea[_0x4a3dff(0x208)]};}};async function resolveSqlNewInputs(_0x4645c2){const _0x57f053=await resolveSqlNameInput(_0x4645c2),{dbId:_0xf4f642,dbName:_0x36f70f}=await resolveDbSelection(_0x4645c2),_0x16a97a=await resolveSqlModeInput(_0x4645c2);return{'sqlName':_0x57f053,'dbId':_0xf4f642,'dbName':_0x36f70f,'mode':_0x16a97a};}async function resolveSqlNameInput(_0x436ab0){const _0x4908c8=a166_0x23d486,_0x2fdda1=_0x436ab0[_0x4908c8(0x1ed)](_0x4908c8(0x207))[_0x4908c8(0x21b)]();if(_0x2fdda1)return _0x2fdda1;if(_0x436ab0['nonInteractive'])throw CliErrors[_0x4908c8(0x1f8)]('name',_0x4908c8(0x201));return(await input({'message':_0x4908c8(0x20b),'validate':_0x3d97a0=>_0x3d97a0[_0x4908c8(0x21b)]()?!![]:_0x4908c8(0x1f2)}))[_0x4908c8(0x21b)]();}async function resolveDbSelection(_0xb01376){const _0x52c07c=a166_0x23d486,_0x247bc7=resolveProvidedDbId(_0xb01376);if(typeof _0x247bc7===_0x52c07c(0x1e6)&&Number[_0x52c07c(0x1f0)](_0x247bc7)&&_0x247bc7>0x0)return{'dbId':_0x247bc7,'dbName':await getDbName(_0xb01376[_0x52c07c(0x1e3)],_0x247bc7)[_0x52c07c(0x1ec)](()=>undefined)};if(_0xb01376['nonInteractive'])throw CliErrors[_0x52c07c(0x1f8)](_0x52c07c(0x1fc),_0x52c07c(0x21a));const _0x499f2e=await listDatabases(_0xb01376[_0x52c07c(0x1e3)])[_0x52c07c(0x1ec)](()=>[]);if(_0x499f2e[_0x52c07c(0x202)]===0x1)return{'dbId':_0x499f2e[0x0][_0x52c07c(0x219)],'dbName':_0x499f2e[0x0][_0x52c07c(0x1dc)]};if(_0x499f2e['length']>0x1){const _0x4c5a28=await select({'message':'请选择目标数据库:','choices':[..._0x499f2e['map'](_0x43f96e=>({'name':_0x43f96e[_0x52c07c(0x1dc)]+'\x20('+_0x43f96e['dbId']+')','value':serializeDbSelection(_0x43f96e)})),{'name':'✎\x20手动输入\x20dbId','value':_0x52c07c(0x206)}]});if(_0x4c5a28!==_0x52c07c(0x206))return deserializeDbSelection(_0x4c5a28);}const _0x21f16=await input({'message':_0x52c07c(0x20f),'validate':_0x2cd028=>{const _0xfa328a=_0x52c07c,_0x3e5036=_0x2cd028[_0xfa328a(0x21b)]();if(!_0x3e5036)return _0xfa328a(0x1e5);const _0x17f03b=Number(_0x3e5036);if(!Number[_0xfa328a(0x1f6)](_0x17f03b)||_0x17f03b<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x21f16['trim']())};}async function resolveSqlModeInput(_0x5e0675){const _0x487899=a166_0x23d486,_0x339961=_0x5e0675[_0x487899(0x1ed)](_0x487899(0x1ea))[_0x487899(0x21b)]();if(_0x339961===_0x487899(0x1f4)||_0x339961===_0x487899(0x212))return _0x339961;if(_0x5e0675[_0x487899(0x214)])throw CliErrors[_0x487899(0x1f8)](_0x487899(0x1ea),_0x487899(0x1e4));return await select({'message':_0x487899(0x1e0),'choices':[{'name':'普通\x20SQL(sql)','value':_0x487899(0x1f4),'description':_0x487899(0x1fd)},{'name':_0x487899(0x203),'value':_0x487899(0x212),'description':_0x487899(0x1ff)}]});}function serializeDbSelection(_0x338b74){const _0x5266a0=a166_0x23d486;return JSON[_0x5266a0(0x20a)]({'dbId':_0x338b74['dbId'],'dbName':_0x338b74[_0x5266a0(0x1dc)]});}function deserializeDbSelection(_0x21d40e){const _0xfceb8b=a166_0x23d486;try{const _0x2a2917=JSON['parse'](_0x21d40e);if(typeof _0x2a2917[_0xfceb8b(0x219)]===_0xfceb8b(0x1e6)&&Number[_0xfceb8b(0x1f0)](_0x2a2917[_0xfceb8b(0x219)]))return{'dbId':_0x2a2917[_0xfceb8b(0x219)],'dbName':_0x2a2917[_0xfceb8b(0x1dc)]};}catch{}throw CliErrors[_0xfceb8b(0x1eb)](_0xfceb8b(0x1dd)+_0x21d40e);}function resolveProvidedDbId(_0x2936ee){const _0x26ee34=a166_0x23d486,_0x50e43f=_0x2936ee[_0x26ee34(0x1ef)](_0x26ee34(0x1fc));if(typeof _0x50e43f===_0x26ee34(0x1e6)&&Number[_0x26ee34(0x1f0)](_0x50e43f))return _0x50e43f;return undefined;}
|
|
1
|
+
const a166_0x327c5e=a166_0x37ac;(function(_0x1cf99a,_0x5ec971){const _0x351cc5=a166_0x37ac,_0x2177bd=_0x1cf99a();while(!![]){try{const _0x3df1de=-parseInt(_0x351cc5(0x1e4))/0x1+parseInt(_0x351cc5(0x1d7))/0x2+parseInt(_0x351cc5(0x1d3))/0x3*(-parseInt(_0x351cc5(0x1df))/0x4)+-parseInt(_0x351cc5(0x1d4))/0x5*(parseInt(_0x351cc5(0x1f8))/0x6)+-parseInt(_0x351cc5(0x1bf))/0x7*(parseInt(_0x351cc5(0x1fa))/0x8)+-parseInt(_0x351cc5(0x1c7))/0x9+parseInt(_0x351cc5(0x1c0))/0xa;if(_0x3df1de===_0x5ec971)break;else _0x2177bd['push'](_0x2177bd['shift']());}catch(_0x303718){_0x2177bd['push'](_0x2177bd['shift']());}}}(a166_0x37f1,0x6bb81));function a166_0x37f1(){const _0x50b97a=['SQL\x20名称不能为空','description','dbName','appCode','high-risk-write','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','catch','5124189FIkknF','28623780crSVpt','SQL\x20query\x20display\x20name','请选择本地\x20SQL\x20模式:','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','请输入目标数据库\x20dbId:','POST','5285241cGEASP','sql','parse','str','mode','flagMissing','Created\x20SQL\x20query\x20','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','</select>','Local\x20SQL\x20file\x20mode','\x20\x20SELECT\x201\x20AS\x20id','trim','869163hoFMLx','5eQPsdw','name','File\x20already\x20exists:\x20','30018yOWXwo','Target\x20database\x20ID','普通\x20SQL(sql)','mybatisXml','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','map','flag','适合带动态标签的\x20MyBatis\x20XML\x20SQL','4bbUjKb','string','create','length','sqlName','340107dfHJZi','join','sqlRoot','new','lockFilePath','请选择目标数据库:','isFinite','sqls','isInteger','__manual__','dbId','sqlCode','toISOString','nonInteractive','validation','<server-generated-sqlCode>','db-id','SELECT\x201\x20AS\x20id;','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','number','2922396aHNqYM','Invalid\x20database\x20selection\x20payload:\x20','8yGpHhT','sqlRootDir','请输入\x20SQL\x20名称:'];a166_0x37f1=function(){return _0x50b97a;};return a166_0x37f1();}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';function a166_0x37ac(_0x2a4050,_0x19f194){_0x2a4050=_0x2a4050-0x1bf;const _0x37f1dd=a166_0x37f1();let _0x37acb4=_0x37f1dd[_0x2a4050];return _0x37acb4;}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(_0x466c35){const _0x398a65=a166_0x37ac;if(_0x466c35===_0x398a65(0x1da))return[_0x398a65(0x1ce),_0x398a65(0x1d1),_0x398a65(0x1cf),'']['join']('\x0a');return[_0x398a65(0x1f5),''][_0x398a65(0x1e5)]('\x0a');}export const sqlCreate={'service':'sql','command':a166_0x327c5e(0x1e1),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a166_0x327c5e(0x201),'flags':[{'name':a166_0x327c5e(0x1d5),'type':'string','description':a166_0x327c5e(0x1c1)},{'name':a166_0x327c5e(0x1f4),'type':a166_0x327c5e(0x1f7),'description':a166_0x327c5e(0x1d8)},{'name':a166_0x327c5e(0x1cb),'type':a166_0x327c5e(0x1e0),'enum':[a166_0x327c5e(0x1c8),a166_0x327c5e(0x1da)],'description':a166_0x327c5e(0x1d0)}],async 'validate'(_0x430456){const _0x254dc1=a166_0x327c5e;if(!_0x430456['nonInteractive'])return;if(!_0x430456[_0x254dc1(0x1ca)](_0x254dc1(0x1d5))[_0x254dc1(0x1d2)]())throw CliErrors['flagMissing'](_0x254dc1(0x1d5),_0x254dc1(0x1c4));const _0x14281c=resolveProvidedDbId(_0x430456);if(typeof _0x14281c!=='number'||!Number[_0x254dc1(0x1ea)](_0x14281c)||_0x14281c<=0x0)throw CliErrors['flagMissing'](_0x254dc1(0x1f4),_0x254dc1(0x202));if(!_0x430456[_0x254dc1(0x1ca)](_0x254dc1(0x1cb))[_0x254dc1(0x1d2)]())throw CliErrors[_0x254dc1(0x1cc)](_0x254dc1(0x1cb),_0x254dc1(0x1c3));},async 'dryRun'(_0x4780f2){const _0x32dc37=a166_0x327c5e,_0x3c1d56=loadSqlProjectConfig(_0x4780f2[_0x32dc37(0x200)]),{sqlName:_0x33b1a2,dbId:_0xd30844,dbName:_0x54d373,mode:_0x58d9e6}=await resolveSqlNewInputs(_0x4780f2),_0x278523=buildSqlRelativePath(_0x32dc37(0x1f3),_0x33b1a2,_0x54d373,_0x58d9e6,_0xd30844),_0x188c21=_0x3c1d56[_0x32dc37(0x1fb)]+'/'+_0x278523;return{'method':_0x32dc37(0x1c6),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x4780f2[_0x32dc37(0x200)],'sqlName':_0x33b1a2,'dbId':_0xd30844,'mode':_0x58d9e6,'localPath':_0x188c21},'description':_0x32dc37(0x1db)+_0x3c1d56[_0x32dc37(0x1fb)]};},async 'execute'(_0x41dc3c){const _0x226745=a166_0x327c5e,_0x5e451d=loadSqlProjectConfig(_0x41dc3c[_0x226745(0x200)]),{sqlName:_0x42f439,dbId:_0x1936c2,dbName:_0x1a7018,mode:_0x33ed77}=await resolveSqlNewInputs(_0x41dc3c),_0x4cb2d5=generateSqlTemplate(_0x33ed77),_0x18e9e6=await createSqlQuery({'appCode':_0x41dc3c[_0x226745(0x200)],'sqlName':_0x42f439,'dbId':_0x1936c2,'sqlContent':_0x4cb2d5}),_0x485cfa=ensureRemoteSqlContent(_0x18e9e6),_0x54fdda=_0x1a7018||await getDbName(_0x41dc3c[_0x226745(0x200)],_0x1936c2)[_0x226745(0x203)](()=>undefined),_0x10f909=buildSqlRelativePath(_0x18e9e6[_0x226745(0x1ef)],_0x18e9e6[_0x226745(0x1e3)],_0x54fdda,_0x33ed77,_0x1936c2),_0x3551be=_0x5e451d[_0x226745(0x1fb)]+'/'+_0x10f909,_0x5c46e5=buildLocalSqlFileContent({'sqlCode':_0x18e9e6[_0x226745(0x1ef)],'sqlName':_0x18e9e6[_0x226745(0x1e3)],'dbId':_0x18e9e6['dbId']},_0x485cfa,{'dbName':_0x54fdda,'mode':_0x33ed77,'syncedAt':new Date()[_0x226745(0x1f0)](),'description':_0x18e9e6[_0x226745(0x1fe)]});if(await fileExists(_0x3551be))throw CliErrors[_0x226745(0x1f2)](_0x226745(0x1d6)+_0x3551be);await ensureParentDirectory(_0x3551be),await writeFile(_0x3551be,_0x5c46e5,'utf8');const _0x1ea4f0=await readSqlLockFile(_0x5e451d[_0x226745(0x1e8)]),{lockData:_0x3bca2b,appLock:_0x316d45}=ensureSqlLockScope(_0x1ea4f0??createEmptySqlLock(),_0x5e451d[_0x226745(0x200)],_0x5e451d[_0x226745(0x1e6)],_0x226745(0x1e7));return _0x316d45[_0x226745(0x1eb)][_0x18e9e6[_0x226745(0x1ef)]]={...buildSqlLockEntry(_0x18e9e6,_0x485cfa,computeSqlContentHash(_0x5c46e5),{'dbName':_0x54fdda}),'path':_0x10f909,'mode':_0x33ed77},_0x316d45['lastSync']=new Date()[_0x226745(0x1f0)](),await writeSqlLockFile(_0x5e451d[_0x226745(0x1e8)],_0x3bca2b),{'ok':!![],'data':{'id':_0x18e9e6['id'],'sqlCode':_0x18e9e6[_0x226745(0x1ef)],'sqlName':_0x18e9e6['sqlName'],'dbId':_0x18e9e6['dbId'],'path':_0x3551be,'mode':_0x33ed77},'message':_0x226745(0x1cd)+_0x18e9e6['sqlCode']};}};async function resolveSqlNewInputs(_0xf3ea01){const _0x45904e=await resolveSqlNameInput(_0xf3ea01),{dbId:_0x1b3599,dbName:_0x536a5e}=await resolveDbSelection(_0xf3ea01),_0x532168=await resolveSqlModeInput(_0xf3ea01);return{'sqlName':_0x45904e,'dbId':_0x1b3599,'dbName':_0x536a5e,'mode':_0x532168};}async function resolveSqlNameInput(_0x1a975c){const _0x40d247=a166_0x327c5e,_0x4c0a83=_0x1a975c[_0x40d247(0x1ca)]('name')[_0x40d247(0x1d2)]();if(_0x4c0a83)return _0x4c0a83;if(_0x1a975c[_0x40d247(0x1f1)])throw CliErrors[_0x40d247(0x1cc)](_0x40d247(0x1d5),_0x40d247(0x1c4));return(await input({'message':_0x40d247(0x1fc),'validate':_0x229515=>_0x229515[_0x40d247(0x1d2)]()?!![]:_0x40d247(0x1fd)}))[_0x40d247(0x1d2)]();}async function resolveDbSelection(_0x1c5837){const _0x29394b=a166_0x327c5e,_0x5f34a2=resolveProvidedDbId(_0x1c5837);if(typeof _0x5f34a2===_0x29394b(0x1f7)&&Number[_0x29394b(0x1ea)](_0x5f34a2)&&_0x5f34a2>0x0)return{'dbId':_0x5f34a2,'dbName':await getDbName(_0x1c5837['appCode'],_0x5f34a2)[_0x29394b(0x203)](()=>undefined)};if(_0x1c5837[_0x29394b(0x1f1)])throw CliErrors['flagMissing'](_0x29394b(0x1f4),_0x29394b(0x202));const _0x40d9d0=await listDatabases(_0x1c5837[_0x29394b(0x200)])['catch'](()=>[]);if(_0x40d9d0[_0x29394b(0x1e2)]===0x1)return{'dbId':_0x40d9d0[0x0][_0x29394b(0x1ee)],'dbName':_0x40d9d0[0x0][_0x29394b(0x1ff)]};if(_0x40d9d0[_0x29394b(0x1e2)]>0x1){const _0x4ce6ca=await select({'message':_0x29394b(0x1e9),'choices':[..._0x40d9d0[_0x29394b(0x1dc)](_0x2eb15d=>({'name':_0x2eb15d['dbName']+'\x20('+_0x2eb15d[_0x29394b(0x1ee)]+')','value':serializeDbSelection(_0x2eb15d)})),{'name':'✎\x20手动输入\x20dbId','value':_0x29394b(0x1ed)}]});if(_0x4ce6ca!==_0x29394b(0x1ed))return deserializeDbSelection(_0x4ce6ca);}const _0x111be8=await input({'message':_0x29394b(0x1c5),'validate':_0x1fb447=>{const _0x452e30=_0x29394b,_0x49dadb=_0x1fb447[_0x452e30(0x1d2)]();if(!_0x49dadb)return'dbId\x20不能为空';const _0x1374b4=Number(_0x49dadb);if(!Number[_0x452e30(0x1ec)](_0x1374b4)||_0x1374b4<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x111be8[_0x29394b(0x1d2)]())};}async function resolveSqlModeInput(_0x478f6e){const _0x3c959e=a166_0x327c5e,_0xeef00=_0x478f6e[_0x3c959e(0x1ca)](_0x3c959e(0x1cb))[_0x3c959e(0x1d2)]();if(_0xeef00===_0x3c959e(0x1c8)||_0xeef00===_0x3c959e(0x1da))return _0xeef00;if(_0x478f6e[_0x3c959e(0x1f1)])throw CliErrors[_0x3c959e(0x1cc)](_0x3c959e(0x1cb),_0x3c959e(0x1c3));return await select({'message':_0x3c959e(0x1c2),'choices':[{'name':_0x3c959e(0x1d9),'value':_0x3c959e(0x1c8),'description':_0x3c959e(0x1f6)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x3c959e(0x1da),'description':_0x3c959e(0x1de)}]});}function serializeDbSelection(_0x59037c){const _0x4128d7=a166_0x327c5e;return JSON['stringify']({'dbId':_0x59037c[_0x4128d7(0x1ee)],'dbName':_0x59037c[_0x4128d7(0x1ff)]});}function deserializeDbSelection(_0x5308f0){const _0x1a6fa7=a166_0x327c5e;try{const _0xd68d0e=JSON[_0x1a6fa7(0x1c9)](_0x5308f0);if(typeof _0xd68d0e['dbId']===_0x1a6fa7(0x1f7)&&Number[_0x1a6fa7(0x1ea)](_0xd68d0e[_0x1a6fa7(0x1ee)]))return{'dbId':_0xd68d0e[_0x1a6fa7(0x1ee)],'dbName':_0xd68d0e['dbName']};}catch{}throw CliErrors[_0x1a6fa7(0x1f2)](_0x1a6fa7(0x1f9)+_0x5308f0);}function resolveProvidedDbId(_0x44da04){const _0x25d5f0=a166_0x327c5e,_0x3b1bee=_0x44da04[_0x25d5f0(0x1dd)](_0x25d5f0(0x1f4));if(typeof _0x3b1bee===_0x25d5f0(0x1f7)&&Number[_0x25d5f0(0x1ea)](_0x3b1bee))return _0x3b1bee;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x5da502=a167_0x4951;(function(_0x504453,_0x362375){const _0x2e19c9=a167_0x4951,_0x3c0e02=_0x504453();while(!![]){try{const _0x24a101=parseInt(_0x2e19c9(0x107))/0x1+-parseInt(_0x2e19c9(0xf6))/0x2*(-parseInt(_0x2e19c9(0xfc))/0x3)+parseInt(_0x2e19c9(0xf2))/0x4*(-parseInt(_0x2e19c9(0xee))/0x5)+-parseInt(_0x2e19c9(0x10b))/0x6*(parseInt(_0x2e19c9(0x104))/0x7)+-parseInt(_0x2e19c9(0xfa))/0x8+-parseInt(_0x2e19c9(0xed))/0x9*(parseInt(_0x2e19c9(0x10e))/0xa)+parseInt(_0x2e19c9(0xef))/0xb;if(_0x24a101===_0x362375)break;else _0x3c0e02['push'](_0x3c0e02['shift']());}catch(_0x36efaf){_0x3c0e02['push'](_0x3c0e02['shift']());}}}(a167_0x5482,0x2a3eb));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a167_0x5482(){const _0x5a15bf=['remoteId','delete','Deleted\x20','56WhQlaK','POST','str','sqlRoot','369408nxlqSg','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','29523Lvqggn','lockFilePath','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','trashDir','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','high-risk-write','/smartapi/custom/deleteUserCustomSql','14xsWcAj','validation','sqls','320884PLkdMv','fromEntries','sqlRootDir','appCode','340506peZalS','toISOString','entries','20atrDjb','207639ZMFklb','20crlLKB','814869KSLcxk','sqlcode','\x20(local\x20file\x20moved\x20to\x20trash)','291656wQwnFi'];a167_0x5482=function(){return _0x5a15bf;};return a167_0x5482();}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';function a167_0x4951(_0x7524c,_0x58778d){_0x7524c=_0x7524c-0xed;const _0x548280=a167_0x5482();let _0x49514e=_0x548280[_0x7524c];return _0x49514e;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a167_0x5da502(0xf4),'description':a167_0x5da502(0xff),'risk':a167_0x5da502(0x102),'flags':[SQLCODE_FLAG],async 'validate'(_0x27f92d){const _0x9e1f03=a167_0x5da502,_0x223f02=loadSqlProjectConfig(_0x27f92d[_0x9e1f03(0x10a)]),_0x4f1136=await readSqlLockFile(_0x223f02[_0x9e1f03(0xfd)]);if(!_0x4f1136)throw CliErrors[_0x9e1f03(0x105)](_0x9e1f03(0x101));},async 'dryRun'(_0x164c33){const _0x545afe=a167_0x5da502,_0x44d5f4=loadSqlProjectConfig(_0x164c33['appCode']),_0xc13881=await readSqlLockFile(_0x44d5f4['lockFilePath']);if(!_0xc13881)throw CliErrors[_0x545afe(0x105)](_0x545afe(0x101));const {appLock:_0x593f50}=ensureSqlLockScope(_0xc13881,_0x164c33[_0x545afe(0x10a)],_0x44d5f4[_0x545afe(0xf9)],_0x545afe(0xf4)),_0x4d7d35=_0x164c33[_0x545afe(0xf8)]('sqlcode'),_0x2ce56d=_0x593f50[_0x545afe(0x106)][_0x4d7d35];if(!_0x2ce56d)throw CliErrors[_0x545afe(0x105)](_0x545afe(0xfb)+_0x4d7d35+'\x22.');return{'method':_0x545afe(0xf7),'url':_0x545afe(0x103),'body':{'sqlCode':_0x4d7d35,'id':_0x2ce56d[_0x545afe(0xf3)],'localPath':resolveLocalSqlFilePath(_0x44d5f4,_0x4d7d35,_0x2ce56d)},'description':'Would\x20delete\x20SQL\x20'+_0x4d7d35+_0x545afe(0xfe)+_0x44d5f4['trashDir']};},async 'execute'(_0x7262d2){const _0x29915d=a167_0x5da502,_0x48ee6d=loadSqlProjectConfig(_0x7262d2[_0x29915d(0x10a)]),_0x4e0d4b=await readSqlLockFile(_0x48ee6d['lockFilePath']);if(!_0x4e0d4b)throw CliErrors[_0x29915d(0x105)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x3cf31f,appLock:_0x43040e}=ensureSqlLockScope(_0x4e0d4b,_0x7262d2['appCode'],_0x48ee6d['sqlRoot'],_0x29915d(0xf4)),_0x3f4d96=_0x7262d2[_0x29915d(0xf8)](_0x29915d(0xf0)),_0x2d6b09=_0x43040e[_0x29915d(0x106)][_0x3f4d96];if(!_0x2d6b09)throw CliErrors[_0x29915d(0x105)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x3f4d96+'\x22.');await deleteSqlQuery({'id':_0x2d6b09['remoteId'],'sqlCode':_0x3f4d96}),_0x43040e[_0x29915d(0x106)]=Object[_0x29915d(0x108)](Object[_0x29915d(0x10d)](_0x43040e[_0x29915d(0x106)])['filter'](([_0x35e4c6])=>_0x35e4c6!==_0x3f4d96)),_0x43040e['lastSync']=new Date()[_0x29915d(0x10c)](),await writeSqlLockFile(_0x48ee6d[_0x29915d(0xfd)],_0x3cf31f);const _0x23b98f=resolveLocalSqlFilePath(_0x48ee6d,_0x3f4d96,_0x2d6b09);let _0x2f2d6e;await fileExists(_0x23b98f)&&(_0x2f2d6e=await moveToTrash(_0x48ee6d['projectRoot'],_0x48ee6d[_0x29915d(0x100)],_0x23b98f),await cleanupEmptyDirectories(dirname(_0x23b98f),_0x48ee6d[_0x29915d(0x109)]));const _0x3d074d={'deleted':_0x3f4d96,'remoteId':_0x2d6b09[_0x29915d(0xf3)]};if(_0x2f2d6e)_0x3d074d['trashedTo']=_0x2f2d6e;return{'ok':!![],'data':_0x3d074d,'message':_0x29915d(0xf5)+_0x3f4d96+(_0x2f2d6e?_0x29915d(0xf1):'')};}};async function moveToTrash(_0x2a4d48,_0xb2a246,_0x55d876){const _0x4f595f=a167_0x5da502,_0x37c486=new Date()[_0x4f595f(0x10c)]()['replace'](/[:.]/g,'-'),_0x19f876=relative(_0x2a4d48,_0x55d876),_0x1ce5a3=join(_0xb2a246,_0x37c486,_0x19f876);return await mkdir(dirname(_0x1ce5a3),{'recursive':!![]}),await rename(_0x55d876,_0x1ce5a3),_0x1ce5a3;}async function cleanupEmptyDirectories(_0x27eee5,_0x4b5e91){let _0x10edd0=resolve(_0x27eee5);const _0x396c1e=resolve(_0x4b5e91);while(_0x10edd0['startsWith'](''+_0x396c1e+sep)||_0x10edd0===_0x396c1e){if(_0x10edd0===_0x396c1e)return;try{const _0x149952=await readdir(_0x10edd0);if(_0x149952['length']>0x0)return;await rmdir(_0x10edd0);}catch{return;}_0x10edd0=dirname(_0x10edd0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a168_0x4439(_0x1c9488,_0x3deee5){_0x1c9488=_0x1c9488-0xc1;const _0x9234fb=a168_0x9234();let _0x443933=_0x9234fb[_0x1c9488];return _0x443933;}const a168_0x40cb9a=a168_0x4439;(function(_0x1ebad0,_0x2093c4){const _0x5223e7=a168_0x4439,_0x2c60bf=_0x1ebad0();while(!![]){try{const _0x298ecb=parseInt(_0x5223e7(0xcd))/0x1*(parseInt(_0x5223e7(0xd1))/0x2)+parseInt(_0x5223e7(0xd5))/0x3*(parseInt(_0x5223e7(0xd0))/0x4)+parseInt(_0x5223e7(0xd2))/0x5+parseInt(_0x5223e7(0xc9))/0x6+-parseInt(_0x5223e7(0xd4))/0x7*(-parseInt(_0x5223e7(0xc4))/0x8)+parseInt(_0x5223e7(0xc1))/0x9*(-parseInt(_0x5223e7(0xc2))/0xa)+-parseInt(_0x5223e7(0xcb))/0xb;if(_0x298ecb===_0x2093c4)break;else _0x2c60bf['push'](_0x2c60bf['shift']());}catch(_0x591194){_0x2c60bf['push'](_0x2c60bf['shift']());}}}(a168_0x9234,0x7b4ad));function a168_0x9234(){const _0x35b5c8=['402eiJStI','sql','bool','279JmHrHW','252410VytUvF','description','16tNjBxb','sqlcode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','appCode','str','1577832IXLUVf','boolean','11700337AVfLxP','verbose','2uPyZXE','dbId','sqlName','18924xGOKTP','254102jlYGWW','2290165OGgZTV','sqlContent','2597287sZypHd'];a168_0x9234=function(){return _0x35b5c8;};return a168_0x9234();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a168_0x40cb9a(0xd6),'command':'detail','description':a168_0x40cb9a(0xc6),'risk':'read','flags':[SQLCODE_FLAG,{'name':a168_0x40cb9a(0xcc),'type':a168_0x40cb9a(0xca),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x20dbbc){const _0xdbb60c=a168_0x40cb9a,_0x358a8f=await getSqlQueryInfo(_0x20dbbc[_0xdbb60c(0xc7)],_0x20dbbc[_0xdbb60c(0xc8)](_0xdbb60c(0xc5))),_0x5cf044=_0x20dbbc[_0xdbb60c(0xd7)](_0xdbb60c(0xcc));if(_0x5cf044)return{'ok':!![],'data':_0x358a8f};const _0x295e84=_0x358a8f[_0xdbb60c(0xce)]?await getDbName(_0x20dbbc['appCode'],_0x358a8f[_0xdbb60c(0xce)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x358a8f['sqlCode'],'sqlName':_0x358a8f[_0xdbb60c(0xcf)],'db':_0x295e84?_0x295e84+'\x20('+_0x358a8f[_0xdbb60c(0xce)]+')':_0x358a8f['dbId']??'','description':_0x358a8f[_0xdbb60c(0xc3)]??'','sqlContent':_0x358a8f[_0xdbb60c(0xd3)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a169_0x2df5(){const _0x250932=['params','execError','34518MzPnfI','str','now','read','isArray','3738hulMUX','9133430TtvqCx','2135VeYkzg','5752840OAJMKV','22536LlUwvp','exec','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','length','SQL\x20execution\x20failed','9428tpGgCW','2515kxWRoC','Returned\x20','24396ATmnEE','appCode','1449782GkhfBR','execResult','9XZyoIg','1618GYtEhz'];a169_0x2df5=function(){return _0x250932;};return a169_0x2df5();}const a169_0x4f0f10=a169_0x50c3;(function(_0x37b519,_0x16591c){const _0x24c32c=a169_0x50c3,_0x4b7489=_0x37b519();while(!![]){try{const _0x29a1b6=-parseInt(_0x24c32c(0x19c))/0x1+parseInt(_0x24c32c(0x19f))/0x2*(-parseInt(_0x24c32c(0x18e))/0x3)+-parseInt(_0x24c32c(0x197))/0x4*(parseInt(_0x24c32c(0x198))/0x5)+-parseInt(_0x24c32c(0x19a))/0x6*(parseInt(_0x24c32c(0x190))/0x7)+parseInt(_0x24c32c(0x191))/0x8+parseInt(_0x24c32c(0x19e))/0x9*(-parseInt(_0x24c32c(0x18f))/0xa)+-parseInt(_0x24c32c(0x189))/0xb*(-parseInt(_0x24c32c(0x192))/0xc);if(_0x29a1b6===_0x16591c)break;else _0x4b7489['push'](_0x4b7489['shift']());}catch(_0x2c6c33){_0x4b7489['push'](_0x4b7489['shift']());}}}(a169_0x2df5,0xc7145));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a169_0x50c3(_0x3844f6,_0x258ce8){_0x3844f6=_0x3844f6-0x189;const _0x2df56c=a169_0x2df5();let _0x50c33f=_0x2df56c[_0x3844f6];return _0x50c33f;}export const sqlExec={'service':'sql','command':a169_0x4f0f10(0x193),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a169_0x4f0f10(0x18c),'flags':[SQLCODE_FLAG,{'name':a169_0x4f0f10(0x1a0),'type':'string','description':a169_0x4f0f10(0x194)}],async 'execute'(_0xdf8b2f){const _0x45e5cf=a169_0x4f0f10,_0x3dd66d=parseJsonParams(_0xdf8b2f[_0x45e5cf(0x18a)](_0x45e5cf(0x1a0))),_0x482e54=Date[_0x45e5cf(0x18b)](),_0x184f35=await executeSql(_0xdf8b2f[_0x45e5cf(0x19b)],_0xdf8b2f[_0x45e5cf(0x18a)]('sqlcode'),_0x3dd66d),_0x404e77=Date[_0x45e5cf(0x18b)]()-_0x482e54,_0xf6de90=_0x184f35?.[_0x45e5cf(0x19d)]??_0x184f35,_0x1ac7cf=_0x184f35?.['execSuccess']??!![];if(!_0x1ac7cf)return{'ok':![],'data':{'error':_0x184f35?.[_0x45e5cf(0x1a1)]||'SQL\x20execution\x20failed','elapsed':_0x404e77},'message':_0x45e5cf(0x196)};const _0x2df03c=Array[_0x45e5cf(0x18d)](_0xf6de90)?_0xf6de90:[];return{'ok':!![],'data':{'rows':_0x2df03c,'rowCount':_0x2df03c[_0x45e5cf(0x195)],'elapsed':_0x404e77},'message':_0x45e5cf(0x199)+_0x2df03c[_0x45e5cf(0x195)]+'\x20row(s)\x20in\x20'+_0x404e77+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b994b,_0x34cc09){const _0x3be7ef=a170_0x3bff,_0x326dc4=_0x3b994b();while(!![]){try{const _0x585786=-parseInt(_0x3be7ef(0x177))/0x1*(parseInt(_0x3be7ef(0x174))/0x2)+-parseInt(_0x3be7ef(0x176))/0x3+-parseInt(_0x3be7ef(0x178))/0x4+-parseInt(_0x3be7ef(0x173))/0x5+parseInt(_0x3be7ef(0x171))/0x6*(-parseInt(_0x3be7ef(0x170))/0x7)+-parseInt(_0x3be7ef(0x175))/0x8*(parseInt(_0x3be7ef(0x179))/0x9)+parseInt(_0x3be7ef(0x172))/0xa;if(_0x585786===_0x34cc09)break;else _0x326dc4['push'](_0x326dc4['shift']());}catch(_0x46aa74){_0x326dc4['push'](_0x326dc4['shift']());}}}(a170_0x29f0,0x4d849));function a170_0x3bff(_0x37ba7a,_0x4b79f7){_0x37ba7a=_0x37ba7a-0x170;const _0x29f040=a170_0x29f0();let _0x3bff02=_0x29f040[_0x37ba7a];return _0x3bff02;}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a170_0x29f0(){const _0x9d9669=['112oBZfnB','141468lVIjLC','20208880xKkWFG','1458915NDkGUr','214mAHoEB','34192VwIjIz','922170fTHvKe','1015RkhJFO','1174100SEhVdn','684xfehbu'];a170_0x29f0=function(){return _0x9d9669;};return a170_0x29f0();}import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a171_0x504b(_0xffe642,_0x37af91){_0xffe642=_0xffe642-0xe5;const _0x3eb015=a171_0x3eb0();let _0x504bdd=_0x3eb015[_0xffe642];return _0x504bdd;}const a171_0x4fd8f7=a171_0x504b;(function(_0x12280e,_0xf0d70c){const _0x547b00=a171_0x504b,_0x50a7e6=_0x12280e();while(!![]){try{const _0x28c85d=-parseInt(_0x547b00(0xe8))/0x1*(parseInt(_0x547b00(0xf5))/0x2)+-parseInt(_0x547b00(0x104))/0x3*(parseInt(_0x547b00(0xff))/0x4)+parseInt(_0x547b00(0xed))/0x5*(parseInt(_0x547b00(0xf2))/0x6)+-parseInt(_0x547b00(0x102))/0x7+parseInt(_0x547b00(0xfa))/0x8+parseInt(_0x547b00(0xfe))/0x9+parseInt(_0x547b00(0xeb))/0xa;if(_0x28c85d===_0xf0d70c)break;else _0x50a7e6['push'](_0x50a7e6['shift']());}catch(_0x1a540a){_0x50a7e6['push'](_0x50a7e6['shift']());}}}(a171_0x3eb0,0x98ce1));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a171_0x4fd8f7(0xea),'command':a171_0x4fd8f7(0xf8),'description':a171_0x4fd8f7(0xfd),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a171_0x4fd8f7(0xf3),'type':a171_0x4fd8f7(0xf7),'description':a171_0x4fd8f7(0xf0)},{'name':a171_0x4fd8f7(0xec),'type':a171_0x4fd8f7(0x101),'description':a171_0x4fd8f7(0xe7),'default':0x1},{'name':a171_0x4fd8f7(0x106),'type':a171_0x4fd8f7(0x101),'description':'Page\x20size'},{'name':a171_0x4fd8f7(0x109),'type':a171_0x4fd8f7(0xfb),'description':a171_0x4fd8f7(0x103)}],async 'execute'(_0x80f404){const _0x26ae5e=a171_0x4fd8f7,_0x41d339=await listSqlQueries(_0x80f404['appCode'],{'sqlCode':_0x80f404['str'](_0x26ae5e(0x108))||undefined,'sqlName':_0x80f404[_0x26ae5e(0x105)](_0x26ae5e(0xf3))||undefined,'currentPage':_0x80f404['num'](_0x26ae5e(0xec)),'pageSize':_0x80f404['num'](_0x26ae5e(0x106),0x32)}),_0xa4a5c3=_0x80f404[_0x26ae5e(0xf6)](_0x26ae5e(0x109)),_0x527271=_0x41d339[_0x26ae5e(0xee)]??[],_0x500fde=_0x41d339[_0x26ae5e(0x100)]?.[_0x26ae5e(0xf9)]??_0x527271['length'];let _0x3f4ad6;return _0xa4a5c3?_0x3f4ad6=_0x527271:_0x3f4ad6=await Promise['all'](_0x527271[_0x26ae5e(0x107)](async _0x2e267a=>{const _0x2bbba9=_0x26ae5e;let _0x4b684f;try{_0x4b684f=_0x2e267a['dbId']?await getDbName(_0x80f404[_0x2bbba9(0xe5)],_0x2e267a[_0x2bbba9(0xf4)]):undefined;}catch{}return{'sqlCode':_0x2e267a[_0x2bbba9(0xfc)],'sqlName':_0x2e267a['sqlName'],'description':_0x2e267a[_0x2bbba9(0xf1)]??'','db':_0x4b684f?_0x4b684f+'\x20('+_0x2e267a['dbId']+')':_0x2e267a[_0x2bbba9(0xf4)]??''};})),{'ok':!![],'data':_0x3f4ad6,'message':_0x527271[_0x26ae5e(0xef)]===0x0?_0x26ae5e(0xe6):'Found\x20'+_0x527271[_0x26ae5e(0xef)]+_0x26ae5e(0xe9)+_0x500fde+').'};}};function a171_0x3eb0(){const _0xca2ea1=['name','dbId','335858uukqvv','bool','string','list','totalCount','4683896gebeku','boolean','sqlCode','List\x20custom\x20SQL\x20queries','8016633xbQUal','116mNhekH','paging','number','7932344qzsuwd','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','112758DvKLYQ','str','pagesize','map','sqlcode','verbose','appCode','No\x20custom\x20SQL\x20queries\x20found.','Page\x20number','1FbmApq','\x20SQL\x20queries\x20(total:\x20','sql','9848910PvLLsr','page','2935NiZXFn','tableData','length','Filter\x20by\x20SQL\x20name','description','5682IESluf'];a171_0x3eb0=function(){return _0xca2ea1;};return a171_0x3eb0();}
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a172_0x5be294=a172_0x7049;(function(_0x4acaff,_0x5eedd4){const _0x4836fb=a172_0x7049,_0x5c63e3=_0x4acaff();while(!![]){try{const _0x429018=parseInt(_0x4836fb(0x1f4))/0x1+parseInt(_0x4836fb(0x1d5))/0x2+parseInt(_0x4836fb(0x1e3))/0x3*(-parseInt(_0x4836fb(0x207))/0x4)+-parseInt(_0x4836fb(0x1fe))/0x5*(parseInt(_0x4836fb(0x1fa))/0x6)+-parseInt(_0x4836fb(0x202))/0x7*(parseInt(_0x4836fb(0x1e5))/0x8)+-parseInt(_0x4836fb(0x1db))/0x9+-parseInt(_0x4836fb(0x1d3))/0xa*(-parseInt(_0x4836fb(0x206))/0xb);if(_0x429018===_0x5eedd4)break;else _0x5c63e3['push'](_0x5c63e3['shift']());}catch(_0x473356){_0x5c63e3['push'](_0x5c63e3['shift']());}}}(a172_0x59d1,0x5d85b));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a172_0x7049(_0x740445,_0x50f38e){_0x740445=_0x740445-0x1ce;const _0x59d10f=a172_0x59d1();let _0x7049bd=_0x59d10f[_0x740445];return _0x7049bd;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';function a172_0x59d1(){const _0x382da8=['Force\x20pull\x20cancelled.','apps','59838ClOnbO','appCode','length','toISOString','265BGeKdb','pull','Pull\x20complete:\x20','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','419223WFXGut','Would\x20pull\x20','filter','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','22EtbadP','1222472XukNVk','POST','name','write','unchanged','path','push','sqlRoot','8019590BxGwbO','tableData','1004528JVhdrt','utf8','sqls','mybatisXml','dbId','test','4973760qXORnI','sql','sqlRootDir','cancelled','sqlcode','sqlContent','lockFilePath','trimStart','6ywVvHH','Force\x20overwrite\x20local\x20unsynced\x20changes','88uELttE','No\x20remote\x20SQL\x20queries\x20matched.','split','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlName','force','string','nonInteractive','lastSync','paging','boolean','catch','\x20SQL\x20file(s)\x20into\x20','str','sqlCode','628109DuXuGg','\x20failed','message','replace'];a172_0x59d1=function(){return _0x382da8;};return a172_0x59d1();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1a41a2,_0x3025a2){const _0x990949=a172_0x7049,_0x4c24dd=[];let _0x119c28=0x1;while(!![]){const _0x42c274=await listSqlQueries(_0x1a41a2,{'currentPage':_0x119c28,'pageSize':PAGE_SIZE,'sqlCode':_0x3025a2['sqlCode'],'sqlName':_0x3025a2['sqlName']}),_0x18c0ad=_0x42c274[_0x990949(0x1d4)]??[];_0x4c24dd['push'](..._0x18c0ad);if(_0x18c0ad[_0x990949(0x1fc)]===0x0)break;const _0x4adffa=_0x42c274[_0x990949(0x1ee)]?.['totalCount'];if(_0x4adffa!=null?_0x4c24dd[_0x990949(0x1fc)]>=_0x4adffa:_0x18c0ad[_0x990949(0x1fc)]<PAGE_SIZE)break;_0x119c28++;}return _0x4c24dd;}async function ensureSqlContent(_0x1270ea){const _0x46d2ec=a172_0x7049;if(_0x1270ea[_0x46d2ec(0x1e0)]!=null&&String(_0x1270ea[_0x46d2ec(0x1e0)])['length']>0x0)return _0x1270ea;return getSqlQueryDetail(_0x1270ea[_0x46d2ec(0x1f3)]);}export const sqlPull={'service':a172_0x5be294(0x1dc),'command':a172_0x5be294(0x1ff),'description':a172_0x5be294(0x1e8),'risk':a172_0x5be294(0x1ce),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x5be294(0x209),'type':a172_0x5be294(0x1eb),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a172_0x5be294(0x1ea),'type':a172_0x5be294(0x1ef),'description':a172_0x5be294(0x1e4)}],async 'dryRun'(_0x1a3fa6){const _0x1ed66e=a172_0x5be294,_0x599127=loadSqlProjectConfig(_0x1a3fa6[_0x1ed66e(0x1fb)]),_0x390b6f=await readSqlLockFile(_0x599127[_0x1ed66e(0x1e1)]),{appLock:_0x1e7fea}=ensureSqlLockScope(_0x390b6f??createEmptySqlLock(),_0x599127[_0x1ed66e(0x1fb)],_0x599127[_0x1ed66e(0x1d2)],_0x1ed66e(0x1ff)),_0x4fb3cf=await fetchAllSqlQueries(_0x1a3fa6[_0x1ed66e(0x1fb)],{'sqlCode':_0x1a3fa6[_0x1ed66e(0x1f2)]('sqlcode')||undefined,'sqlName':_0x1a3fa6['str'](_0x1ed66e(0x209))||undefined}),_0x24e14e=[];for(const _0xc1a635 of _0x4fb3cf){const _0x6cce35=await ensureSqlContent(_0xc1a635),_0x443399=ensureRemoteSqlContent(_0x6cce35),_0x18cafb=detectModeFromSql(_0x6cce35),_0x9de1c4=_0x6cce35[_0x1ed66e(0x1d9)]?await getDbName(_0x1a3fa6['appCode'],Number(_0x6cce35[_0x1ed66e(0x1d9)]))['catch'](()=>undefined):undefined,_0x35de20=buildLocalSqlFileContent({'sqlCode':_0x6cce35[_0x1ed66e(0x1f3)],'sqlName':_0x6cce35['sqlName'],'dbId':_0x6cce35['dbId']},_0x443399,{'dbName':_0x9de1c4,'mode':_0x18cafb,'syncedAt':new Date()[_0x1ed66e(0x1fd)](),'description':_0x6cce35['description']}),_0x1a4b3a=buildSqlLockEntry(_0x6cce35,_0x443399,'',{'dbName':_0x9de1c4}),_0x32b7a3=resolveLocalSqlFilePath(_0x599127,_0x6cce35[_0x1ed66e(0x1f3)],_0x1a4b3a);let _0x4f561d='would_pull',_0x241f3c;if(await fileExists(_0x32b7a3)){const _0x8afb1c=await readFile(_0x32b7a3,_0x1ed66e(0x1d6));isEquivalentPulledSqlFile(_0x8afb1c,_0x35de20,_0x18cafb)?(_0x4f561d='skipped',_0x241f3c='unchanged'):(_0x4f561d='conflict',_0x241f3c=_0x1ed66e(0x205));}_0x24e14e[_0x1ed66e(0x1d1)]({'sqlCode':_0x6cce35['sqlCode'],'sqlName':_0x6cce35[_0x1ed66e(0x1e9)],'filePath':_0x32b7a3,'status':_0x4f561d,'reason':_0x241f3c});}return{'method':_0x1ed66e(0x208),'url':_0x1ed66e(0x201),'body':{'appCode':_0x1a3fa6['appCode'],'sqlCode':_0x1a3fa6[_0x1ed66e(0x1f2)](_0x1ed66e(0x1df))||null,'sqlName':_0x1a3fa6['str']('name')||null,'files':_0x24e14e},'description':_0x1ed66e(0x203)+_0x24e14e[_0x1ed66e(0x1fc)]+_0x1ed66e(0x1f1)+_0x599127['sqlRootDir']};},async 'execute'(_0x5a8d20){const _0x32103d=a172_0x5be294,_0x2628ab=loadSqlProjectConfig(_0x5a8d20[_0x32103d(0x1fb)]),_0x275910=await readSqlLockFile(_0x2628ab[_0x32103d(0x1e1)]),{lockData:_0xb1cd73,appLock:_0x10f00a}=ensureSqlLockScope(_0x275910??createEmptySqlLock(),_0x2628ab[_0x32103d(0x1fb)],_0x2628ab[_0x32103d(0x1d2)],_0x32103d(0x1ff)),_0x368f11=_0x5a8d20['bool']('force'),_0x5abc02=await fetchAllSqlQueries(_0x5a8d20[_0x32103d(0x1fb)],{'sqlCode':_0x5a8d20[_0x32103d(0x1f2)](_0x32103d(0x1df))||undefined,'sqlName':_0x5a8d20[_0x32103d(0x1f2)](_0x32103d(0x209))||undefined});if(_0x5abc02['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x32103d(0x1e6)};const _0x4f0604=[],_0x3215db=[];for(const _0x51bd36 of _0x5abc02){try{_0x4f0604[_0x32103d(0x1d1)](await ensureSqlContent(_0x51bd36));}catch(_0x5b1a2e){_0x3215db[_0x32103d(0x1d1)]({'sqlCode':_0x51bd36[_0x32103d(0x1f3)],'error':_0x5b1a2e instanceof Error?_0x5b1a2e[_0x32103d(0x1f6)]:String(_0x5b1a2e)});}}if(_0x368f11&&!_0x5a8d20[_0x32103d(0x1ec)]){let _0x297d54=![];for(const _0x50f1d3 of _0x4f0604){const _0x157255=detectModeFromSql(_0x50f1d3),_0x464627=_0x50f1d3['dbId']?await getDbName(_0x5a8d20['appCode'],Number(_0x50f1d3['dbId']))[_0x32103d(0x1f0)](()=>undefined):undefined,_0x180b52=buildLocalSqlFileContent({'sqlCode':_0x50f1d3[_0x32103d(0x1f3)],'sqlName':_0x50f1d3['sqlName'],'dbId':_0x50f1d3[_0x32103d(0x1d9)]},ensureRemoteSqlContent(_0x50f1d3),{'dbName':_0x464627,'mode':_0x157255,'syncedAt':new Date()['toISOString'](),'description':_0x50f1d3['description']}),_0x280e45=resolveLocalSqlFilePath(_0x2628ab,_0x50f1d3['sqlCode'],buildSqlLockEntry(_0x50f1d3,ensureRemoteSqlContent(_0x50f1d3),'',{'dbName':_0x464627}));if(await fileExists(_0x280e45)){const _0x1f30b2=await readFile(_0x280e45,_0x32103d(0x1d6));if(!isEquivalentPulledSqlFile(_0x1f30b2,_0x180b52,_0x157255)){_0x297d54=!![];break;}}}if(_0x297d54){const _0x113b00=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x113b00)throw CliErrors[_0x32103d(0x1de)](_0x32103d(0x1f8));}}const _0x15cd7f=cloneSqlLockData(_0xb1cd73),_0x2444da=_0x15cd7f[_0x32103d(0x1f9)][_0x2628ab[_0x32103d(0x1fb)]],_0x120401=[],_0x15cf41=[];for(const _0x2bd5e5 of _0x4f0604){const _0x585da8=_0x2444da['sqls'][_0x2bd5e5[_0x32103d(0x1f3)]],_0x29057c=ensureRemoteSqlContent(_0x2bd5e5),_0x3f150c=detectModeFromSql(_0x2bd5e5),_0x25735a=_0x2bd5e5['dbId']?await getDbName(_0x5a8d20[_0x32103d(0x1fb)],Number(_0x2bd5e5[_0x32103d(0x1d9)]))[_0x32103d(0x1f0)](()=>undefined):undefined,_0x171286=buildLocalSqlFileContent({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'sqlName':_0x2bd5e5[_0x32103d(0x1e9)],'dbId':_0x2bd5e5['dbId']},_0x29057c,{'dbName':_0x25735a,'mode':_0x3f150c,'syncedAt':new Date()['toISOString'](),'description':_0x2bd5e5['description']}),_0x4d4ad4=buildSqlLockEntry(_0x2bd5e5,_0x29057c,computeSqlContentHash(_0x171286),{'dbName':_0x25735a}),_0x41bf29=_0x4d4ad4['path'],_0x135aca=join(_0x2628ab['sqlRootDir'],_0x41bf29);try{if(await fileExists(_0x135aca)){const _0x389bdb=await readFile(_0x135aca,_0x32103d(0x1d6));if(isEquivalentPulledSqlFile(_0x389bdb,_0x171286,_0x3f150c)){_0x15cf41[_0x32103d(0x1d1)]({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'reason':_0x32103d(0x1cf)}),_0x2444da[_0x32103d(0x1d7)][_0x2bd5e5[_0x32103d(0x1f3)]]={..._0x4d4ad4,'hash':computeSqlContentHash(_0x389bdb),'path':_0x41bf29};continue;}if(!_0x368f11){_0x15cf41[_0x32103d(0x1d1)]({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x36f2c4=_0x585da8?.[_0x32103d(0x1d0)]?join(_0x2628ab[_0x32103d(0x1dd)],_0x585da8[_0x32103d(0x1d0)]):undefined;_0x36f2c4&&_0x36f2c4!==_0x135aca&&await fileExists(_0x36f2c4)&&await rm(_0x36f2c4,{'force':!![]}),await ensureParentDirectory(_0x135aca),await writeFile(_0x135aca,_0x171286,_0x32103d(0x1d6)),_0x2444da['sqls'][_0x2bd5e5['sqlCode']]={..._0x4d4ad4,'path':_0x41bf29},_0x120401[_0x32103d(0x1d1)]({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'filePath':_0x135aca});}catch(_0x359f14){_0x3215db['push']({'sqlCode':_0x2bd5e5[_0x32103d(0x1f3)],'error':_0x359f14 instanceof Error?_0x359f14[_0x32103d(0x1f6)]:String(_0x359f14)});}}return _0x2444da[_0x32103d(0x1ed)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2628ab[_0x32103d(0x1e1)],_0x15cd7f),{'ok':_0x3215db[_0x32103d(0x1fc)]===0x0,'data':{'pulled':_0x120401,'skipped':_0x15cf41,'failed':_0x3215db},'message':_0x32103d(0x200)+_0x120401[_0x32103d(0x1fc)]+'\x20written,\x20'+_0x15cf41['length']+'\x20skipped,\x20'+_0x3215db[_0x32103d(0x1fc)]+_0x32103d(0x1f5)};}};function detectModeFromSql(_0x288a71){const _0x4dbccb=a172_0x5be294,_0x271b9f=ensureRemoteSqlContent(_0x288a71),_0x1a3d01=stripLocalSqlMetadata(_0x271b9f,_0x4dbccb(0x1d8))[_0x4dbccb(0x1e2)]();if(/^<(select|insert|update|delete)\b/i[_0x4dbccb(0x1da)](_0x1a3d01))return _0x4dbccb(0x1d8);return'sql';}function isEquivalentPulledSqlFile(_0x44f7cc,_0x48afea,_0x17f323){return normalizePullComparableContent(_0x44f7cc,_0x17f323)===normalizePullComparableContent(_0x48afea,_0x17f323);}function normalizePullComparableContent(_0xb66c69,_0x54948a){const _0x497ca1=a172_0x5be294,_0x4d1c44=_0xb66c69[_0x497ca1(0x1f7)](/\r\n/g,'\x0a')[_0x497ca1(0x1e7)]('\x0a'),_0x5dbdcd=_0x4d1c44[_0x497ca1(0x204)](_0x208daa=>!isSyncedAtMetadataLine(_0x208daa,_0x54948a));return _0x5dbdcd['join']('\x0a');}function isSyncedAtMetadataLine(_0x227fd5,_0x2b14aa){const _0x3f9024=a172_0x5be294;if(_0x2b14aa==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x3f9024(0x1da)](_0x227fd5);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x227fd5);}
|
|
1
|
+
const a172_0x980794=a172_0x1a6a;(function(_0x591d28,_0x1b2198){const _0x7947d7=a172_0x1a6a,_0x597092=_0x591d28();while(!![]){try{const _0x15adc0=parseInt(_0x7947d7(0xed))/0x1*(-parseInt(_0x7947d7(0xe8))/0x2)+parseInt(_0x7947d7(0xd2))/0x3*(parseInt(_0x7947d7(0xcb))/0x4)+-parseInt(_0x7947d7(0xf6))/0x5*(parseInt(_0x7947d7(0xcc))/0x6)+parseInt(_0x7947d7(0xe9))/0x7*(parseInt(_0x7947d7(0xf4))/0x8)+-parseInt(_0x7947d7(0xec))/0x9*(-parseInt(_0x7947d7(0xbb))/0xa)+parseInt(_0x7947d7(0xc7))/0xb*(-parseInt(_0x7947d7(0xd4))/0xc)+-parseInt(_0x7947d7(0xbe))/0xd;if(_0x15adc0===_0x1b2198)break;else _0x597092['push'](_0x597092['shift']());}catch(_0x2437b1){_0x597092['push'](_0x597092['shift']());}}}(a172_0x198a,0xf3d1d));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';function a172_0x198a(){const _0x5c2f47=['message','str','string','path','bool','sqls','force','skipped','trimStart','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlcode','sqlRoot','sql','utf8','name','replace','127898KATkIh','665HTIaBT','paging','\x20written,\x20','8926974nvZldT','10tGtQsL','unchanged','toISOString','split','POST','Force\x20overwrite\x20local\x20unsynced\x20changes','test','145960svHJRz','appCode','317620sHJtdy','No\x20remote\x20SQL\x20queries\x20matched.','catch','20wSCErq','dbId','sqlRootDir','37360388qgTNvd','would_pull','length','pull','sqlName','lockFilePath','apps','push','lastSync','3837581skIFHS','Filter\x20by\x20SQL\x20display\x20name','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Pull\x20complete:\x20','151132SFjvTj','24OmOqbS','tableData','nonInteractive','mybatisXml','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlContent','111SllBlk','sqlCode','12ZPVQNt','\x20failed','conflict','description'];a172_0x198a=function(){return _0x5c2f47;};return a172_0x198a();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x505263,_0x4f70c9){const _0x5971ee=a172_0x1a6a,_0x4f6cfb=[];let _0x286e2c=0x1;while(!![]){const _0x234ead=await listSqlQueries(_0x505263,{'currentPage':_0x286e2c,'pageSize':PAGE_SIZE,'sqlCode':_0x4f70c9[_0x5971ee(0xd3)],'sqlName':_0x4f70c9['sqlName']}),_0x4aed92=_0x234ead[_0x5971ee(0xcd)]??[];_0x4f6cfb['push'](..._0x4aed92);if(_0x4aed92[_0x5971ee(0xc0)]===0x0)break;const _0xcc5616=_0x234ead[_0x5971ee(0xea)]?.['totalCount'];if(_0xcc5616!=null?_0x4f6cfb[_0x5971ee(0xc0)]>=_0xcc5616:_0x4aed92['length']<PAGE_SIZE)break;_0x286e2c++;}return _0x4f6cfb;}function a172_0x1a6a(_0x1d9116,_0x3e82eb){_0x1d9116=_0x1d9116-0xb9;const _0x198a4e=a172_0x198a();let _0x1a6a86=_0x198a4e[_0x1d9116];return _0x1a6a86;}async function ensureSqlContent(_0x4ef3a5){const _0xddad2c=a172_0x1a6a;if(_0x4ef3a5[_0xddad2c(0xd1)]!=null&&String(_0x4ef3a5[_0xddad2c(0xd1)])[_0xddad2c(0xc0)]>0x0)return _0x4ef3a5;return getSqlQueryDetail(_0x4ef3a5['sqlCode']);}export const sqlPull={'service':a172_0x980794(0xe4),'command':'pull','description':a172_0x980794(0xd0),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x980794(0xe6),'type':a172_0x980794(0xda),'description':a172_0x980794(0xc8)},{'name':'force','type':'boolean','description':a172_0x980794(0xf2)}],async 'dryRun'(_0x32061e){const _0x3392d7=a172_0x980794,_0x3251d2=loadSqlProjectConfig(_0x32061e[_0x3392d7(0xf5)]),_0x49c3bb=await readSqlLockFile(_0x3251d2[_0x3392d7(0xc3)]),{appLock:_0x46c486}=ensureSqlLockScope(_0x49c3bb??createEmptySqlLock(),_0x3251d2[_0x3392d7(0xf5)],_0x3251d2[_0x3392d7(0xe3)],_0x3392d7(0xc1)),_0x3976f3=await fetchAllSqlQueries(_0x32061e['appCode'],{'sqlCode':_0x32061e['str']('sqlcode')||undefined,'sqlName':_0x32061e[_0x3392d7(0xd9)]('name')||undefined}),_0x49b5be=[];for(const _0xec37a3 of _0x3976f3){const _0x4d1a20=await ensureSqlContent(_0xec37a3),_0x5a938d=ensureRemoteSqlContent(_0x4d1a20),_0x5c30d4=detectModeFromSql(_0x4d1a20),_0x53163f=_0x4d1a20[_0x3392d7(0xbc)]?await getDbName(_0x32061e[_0x3392d7(0xf5)],Number(_0x4d1a20['dbId']))[_0x3392d7(0xba)](()=>undefined):undefined,_0x2525ca=buildLocalSqlFileContent({'sqlCode':_0x4d1a20[_0x3392d7(0xd3)],'sqlName':_0x4d1a20[_0x3392d7(0xc2)],'dbId':_0x4d1a20[_0x3392d7(0xbc)]},_0x5a938d,{'dbName':_0x53163f,'mode':_0x5c30d4,'syncedAt':new Date()[_0x3392d7(0xef)](),'description':_0x4d1a20[_0x3392d7(0xd7)]}),_0x101587=buildSqlLockEntry(_0x4d1a20,_0x5a938d,'',{'dbName':_0x53163f}),_0x2dc89b=resolveLocalSqlFilePath(_0x3251d2,_0x4d1a20[_0x3392d7(0xd3)],_0x101587);let _0x5e9e00=_0x3392d7(0xbf),_0x3b9d64;if(await fileExists(_0x2dc89b)){const _0x179697=await readFile(_0x2dc89b,_0x3392d7(0xe5));isEquivalentPulledSqlFile(_0x179697,_0x2525ca,_0x5c30d4)?(_0x5e9e00=_0x3392d7(0xdf),_0x3b9d64=_0x3392d7(0xee)):(_0x5e9e00=_0x3392d7(0xd6),_0x3b9d64=_0x3392d7(0xc9));}_0x49b5be[_0x3392d7(0xc5)]({'sqlCode':_0x4d1a20[_0x3392d7(0xd3)],'sqlName':_0x4d1a20[_0x3392d7(0xc2)],'filePath':_0x2dc89b,'status':_0x5e9e00,'reason':_0x3b9d64});}return{'method':_0x3392d7(0xf1),'url':_0x3392d7(0xe1),'body':{'appCode':_0x32061e[_0x3392d7(0xf5)],'sqlCode':_0x32061e['str'](_0x3392d7(0xe2))||null,'sqlName':_0x32061e['str'](_0x3392d7(0xe6))||null,'files':_0x49b5be},'description':'Would\x20pull\x20'+_0x49b5be['length']+'\x20SQL\x20file(s)\x20into\x20'+_0x3251d2[_0x3392d7(0xbd)]};},async 'execute'(_0x6e924f){const _0x4600c9=a172_0x980794,_0x246868=loadSqlProjectConfig(_0x6e924f[_0x4600c9(0xf5)]),_0x411869=await readSqlLockFile(_0x246868[_0x4600c9(0xc3)]),{lockData:_0x274edb,appLock:_0x1db03a}=ensureSqlLockScope(_0x411869??createEmptySqlLock(),_0x246868[_0x4600c9(0xf5)],_0x246868['sqlRoot'],'pull'),_0x1fc599=_0x6e924f[_0x4600c9(0xdc)](_0x4600c9(0xde)),_0x404232=await fetchAllSqlQueries(_0x6e924f[_0x4600c9(0xf5)],{'sqlCode':_0x6e924f[_0x4600c9(0xd9)]('sqlcode')||undefined,'sqlName':_0x6e924f['str'](_0x4600c9(0xe6))||undefined});if(_0x404232[_0x4600c9(0xc0)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4600c9(0xb9)};const _0x4e6ca2=[],_0x4a8dc6=[];for(const _0x377d02 of _0x404232){try{_0x4e6ca2[_0x4600c9(0xc5)](await ensureSqlContent(_0x377d02));}catch(_0x3caed0){_0x4a8dc6[_0x4600c9(0xc5)]({'sqlCode':_0x377d02[_0x4600c9(0xd3)],'error':_0x3caed0 instanceof Error?_0x3caed0[_0x4600c9(0xd8)]:String(_0x3caed0)});}}if(_0x1fc599&&!_0x6e924f[_0x4600c9(0xce)]){let _0x390689=![];for(const _0x387db4 of _0x4e6ca2){const _0x4a1bea=detectModeFromSql(_0x387db4),_0x4b1911=_0x387db4[_0x4600c9(0xbc)]?await getDbName(_0x6e924f['appCode'],Number(_0x387db4[_0x4600c9(0xbc)]))[_0x4600c9(0xba)](()=>undefined):undefined,_0xe8ef11=buildLocalSqlFileContent({'sqlCode':_0x387db4[_0x4600c9(0xd3)],'sqlName':_0x387db4['sqlName'],'dbId':_0x387db4[_0x4600c9(0xbc)]},ensureRemoteSqlContent(_0x387db4),{'dbName':_0x4b1911,'mode':_0x4a1bea,'syncedAt':new Date()[_0x4600c9(0xef)](),'description':_0x387db4['description']}),_0x4a8918=resolveLocalSqlFilePath(_0x246868,_0x387db4[_0x4600c9(0xd3)],buildSqlLockEntry(_0x387db4,ensureRemoteSqlContent(_0x387db4),'',{'dbName':_0x4b1911}));if(await fileExists(_0x4a8918)){const _0x415785=await readFile(_0x4a8918,_0x4600c9(0xe5));if(!isEquivalentPulledSqlFile(_0x415785,_0xe8ef11,_0x4a1bea)){_0x390689=!![];break;}}}if(_0x390689){const _0x145953=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x145953)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x5795af=cloneSqlLockData(_0x274edb),_0x56b351=_0x5795af[_0x4600c9(0xc4)][_0x246868[_0x4600c9(0xf5)]],_0x49ee0b=[],_0x12fbba=[];for(const _0x1c744c of _0x4e6ca2){const _0x5ee369=_0x56b351[_0x4600c9(0xdd)][_0x1c744c['sqlCode']],_0x2273b1=ensureRemoteSqlContent(_0x1c744c),_0x597177=detectModeFromSql(_0x1c744c),_0x53f65a=_0x1c744c[_0x4600c9(0xbc)]?await getDbName(_0x6e924f['appCode'],Number(_0x1c744c[_0x4600c9(0xbc)]))[_0x4600c9(0xba)](()=>undefined):undefined,_0x194f69=buildLocalSqlFileContent({'sqlCode':_0x1c744c[_0x4600c9(0xd3)],'sqlName':_0x1c744c[_0x4600c9(0xc2)],'dbId':_0x1c744c[_0x4600c9(0xbc)]},_0x2273b1,{'dbName':_0x53f65a,'mode':_0x597177,'syncedAt':new Date()[_0x4600c9(0xef)](),'description':_0x1c744c[_0x4600c9(0xd7)]}),_0x4ebfd5=buildSqlLockEntry(_0x1c744c,_0x2273b1,computeSqlContentHash(_0x194f69),{'dbName':_0x53f65a}),_0x4881ed=_0x4ebfd5[_0x4600c9(0xdb)],_0x272529=join(_0x246868[_0x4600c9(0xbd)],_0x4881ed);try{if(await fileExists(_0x272529)){const _0x5a40e1=await readFile(_0x272529,_0x4600c9(0xe5));if(isEquivalentPulledSqlFile(_0x5a40e1,_0x194f69,_0x597177)){_0x12fbba[_0x4600c9(0xc5)]({'sqlCode':_0x1c744c[_0x4600c9(0xd3)],'reason':_0x4600c9(0xee)}),_0x56b351[_0x4600c9(0xdd)][_0x1c744c['sqlCode']]={..._0x4ebfd5,'hash':computeSqlContentHash(_0x5a40e1),'path':_0x4881ed};continue;}if(!_0x1fc599){_0x12fbba['push']({'sqlCode':_0x1c744c[_0x4600c9(0xd3)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x92402c=_0x5ee369?.[_0x4600c9(0xdb)]?join(_0x246868['sqlRootDir'],_0x5ee369[_0x4600c9(0xdb)]):undefined;_0x92402c&&_0x92402c!==_0x272529&&await fileExists(_0x92402c)&&await rm(_0x92402c,{'force':!![]}),await ensureParentDirectory(_0x272529),await writeFile(_0x272529,_0x194f69,_0x4600c9(0xe5)),_0x56b351[_0x4600c9(0xdd)][_0x1c744c['sqlCode']]={..._0x4ebfd5,'path':_0x4881ed},_0x49ee0b[_0x4600c9(0xc5)]({'sqlCode':_0x1c744c[_0x4600c9(0xd3)],'filePath':_0x272529});}catch(_0x3b9985){_0x4a8dc6[_0x4600c9(0xc5)]({'sqlCode':_0x1c744c[_0x4600c9(0xd3)],'error':_0x3b9985 instanceof Error?_0x3b9985[_0x4600c9(0xd8)]:String(_0x3b9985)});}}return _0x56b351[_0x4600c9(0xc6)]=new Date()['toISOString'](),await writeSqlLockFile(_0x246868[_0x4600c9(0xc3)],_0x5795af),{'ok':_0x4a8dc6[_0x4600c9(0xc0)]===0x0,'data':{'pulled':_0x49ee0b,'skipped':_0x12fbba,'failed':_0x4a8dc6},'message':_0x4600c9(0xca)+_0x49ee0b[_0x4600c9(0xc0)]+_0x4600c9(0xeb)+_0x12fbba[_0x4600c9(0xc0)]+'\x20skipped,\x20'+_0x4a8dc6[_0x4600c9(0xc0)]+_0x4600c9(0xd5)};}};function detectModeFromSql(_0x170694){const _0x50c71f=a172_0x980794,_0x2d012f=ensureRemoteSqlContent(_0x170694),_0x1a9db9=stripLocalSqlMetadata(_0x2d012f,_0x50c71f(0xcf))[_0x50c71f(0xe0)]();if(/^<(select|insert|update|delete)\b/i[_0x50c71f(0xf3)](_0x1a9db9))return _0x50c71f(0xcf);return _0x50c71f(0xe4);}function isEquivalentPulledSqlFile(_0xdf74e5,_0x46b75e,_0x3fc4f2){return normalizePullComparableContent(_0xdf74e5,_0x3fc4f2)===normalizePullComparableContent(_0x46b75e,_0x3fc4f2);}function normalizePullComparableContent(_0x552bc9,_0x2a431b){const _0x5b822d=a172_0x980794,_0x96783a=_0x552bc9[_0x5b822d(0xe7)](/\r\n/g,'\x0a')[_0x5b822d(0xf0)]('\x0a'),_0x1e5cf3=_0x96783a['filter'](_0x5a3ed7=>!isSyncedAtMetadataLine(_0x5a3ed7,_0x2a431b));return _0x1e5cf3['join']('\x0a');}function isSyncedAtMetadataLine(_0x2012d1,_0x36d0c1){const _0x5e804d=a172_0x980794;if(_0x36d0c1===_0x5e804d(0xcf))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x2012d1);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x2012d1);}
|