@lovrabet/rabetbase-cli 2.3.13-beta.1 → 2.3.13-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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/asset-update.js +1 -0
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -0
- 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/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
- package/lib/commands/menu/update.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a159_0x2b9f00=a159_0x2b7c;(function(_0x22c7e2,_0x7efe7a){const _0x597fa2=a159_0x2b7c,_0x44ede2=_0x22c7e2();while(!![]){try{const _0x4d9881=parseInt(_0x597fa2(0x1f2))/0x1*(parseInt(_0x597fa2(0x1ed))/0x2)+parseInt(_0x597fa2(0x1f8))/0x3+-parseInt(_0x597fa2(0x1ce))/0x4*(parseInt(_0x597fa2(0x1cb))/0x5)+-parseInt(_0x597fa2(0x1ea))/0x6+-parseInt(_0x597fa2(0x1d2))/0x7*(-parseInt(_0x597fa2(0x1fd))/0x8)+parseInt(_0x597fa2(0x1ff))/0x9+parseInt(_0x597fa2(0x1d7))/0xa*(-parseInt(_0x597fa2(0x1b4))/0xb);if(_0x4d9881===_0x7efe7a)break;else _0x44ede2['push'](_0x44ede2['shift']());}catch(_0x16a898){_0x44ede2['push'](_0x44ede2['shift']());}}}(a159_0x3f4a,0x840aa));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':a159_0x2b9f00(0x1ee),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a159_0x2b9f00(0x1d1),'type':a159_0x2b9f00(0x1eb),'required':!![],'description':a159_0x2b9f00(0x1ca)};export const USER_REF_FLAG={'name':'user','type':'string','required':!![],'description':a159_0x2b9f00(0x1b1)};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a159_0x2b9f00(0x1cc)};export const USER_NAME_FLAG={'name':a159_0x2b9f00(0x1b6),'type':a159_0x2b9f00(0x1eb),'required':!![],'description':a159_0x2b9f00(0x202)};export const REMARK_FLAG={'name':'remark','type':'string','required':![],'description':a159_0x2b9f00(0x1e8)};export const EXPECT_USER_COUNT_FLAG={'name':a159_0x2b9f00(0x1b5),'type':a159_0x2b9f00(0x1ee),'required':![],'description':a159_0x2b9f00(0x1cf)};export const BUILTIN_ROLE_TYPES=[a159_0x2b9f00(0x1f5),a159_0x2b9f00(0x1e9),a159_0x2b9f00(0x1ef)];export function isBuiltinRole(_0x5dbb2c){const _0x406fe1=a159_0x2b9f00;return BUILTIN_ROLE_TYPES[_0x406fe1(0x1f4)](_0x5dbb2c);}export function assertCustomRole(_0x33328f,_0x2a8a84){const _0x252dbc=a159_0x2b9f00;if(_0x33328f[_0x252dbc(0x1d8)]!=='CUSTOM')throw CliErrors[_0x252dbc(0x1c8)](_0x252dbc(0x1f1)+_0x2a8a84+'\x20built-in\x20role\x20'+_0x33328f[_0x252dbc(0x1d0)]+'\x20('+_0x33328f[_0x252dbc(0x1d8)]+').',_0x252dbc(0x201));}export function assertPermConfigurable(_0x4cf64b){const _0x511ec9=a159_0x2b9f00;if(_0x4cf64b[_0x511ec9(0x1d8)]===_0x511ec9(0x1e9)||_0x4cf64b[_0x511ec9(0x1d8)]==='ADMIN')throw CliErrors[_0x511ec9(0x1c8)](_0x511ec9(0x1c0)+_0x4cf64b[_0x511ec9(0x1d0)]+'\x20('+_0x4cf64b[_0x511ec9(0x1d8)]+').',_0x511ec9(0x1fa));}export function projectRole(_0x24196b){const _0x3495c6=a159_0x2b9f00;return{'id':_0x24196b['id'],'roleName':_0x24196b[_0x3495c6(0x1d0)],'roleType':_0x24196b['roleType'],'remark':_0x24196b[_0x3495c6(0x1c6)],'userCount':_0x24196b[_0x3495c6(0x1e0)],'permitCount':_0x24196b['permitCount'],'builtin':isBuiltinRole(_0x24196b[_0x3495c6(0x1d8)])};}export async function resolveRoleRef(_0x3febdb,_0x127fb8){const _0x2c1483=a159_0x2b9f00,_0x2ae97b=_0x127fb8[_0x2c1483(0x200)]();if(!_0x2ae97b)throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1f6),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x2c1483(0x1bc)](_0x2ae97b))return getRoleById(_0x3febdb,Number(_0x2ae97b));const _0xd9ddd5=await listAllAppRoles(_0x3febdb),_0x846fd5=_0xd9ddd5[_0x2c1483(0x1da)](_0x1dfaf9=>_0x1dfaf9[_0x2c1483(0x1d0)]===_0x2ae97b);if(_0x846fd5['length']===0x0)throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1c9)+_0x2ae97b+_0x2c1483(0x1d3)+_0x3febdb+'.',_0x2c1483(0x1c2));if(_0x846fd5[_0x2c1483(0x1dc)]>0x1){const _0x1d0eff=_0x846fd5['map'](_0x1daa14=>_0x1daa14['id'])[_0x2c1483(0x1e7)](',\x20');throw CliErrors[_0x2c1483(0x1c8)](_0x2c1483(0x1c9)+_0x2ae97b+_0x2c1483(0x1b2)+_0x1d0eff+').',_0x2c1483(0x1b8));}return _0x846fd5[0x0];}export async function getRoleById(_0x30d157,_0x47410d){const _0x47b232=a159_0x2b9f00,_0x69e615=await getAppRole(_0x47410d);if(!_0x69e615)throw CliErrors[_0x47b232(0x1c8)]('Role\x20id\x20'+_0x47410d+_0x47b232(0x1d5)+_0x30d157+'.',_0x47b232(0x1bd));return _0x69e615;}function a159_0x2b7c(_0x38a45c,_0x1d6288){_0x38a45c=_0x38a45c-0x1b0;const _0x3f4a04=a159_0x3f4a();let _0x2b7c97=_0x3f4a04[_0x38a45c];return _0x2b7c97;}async function listAllAppRoles(_0xc13232){const _0x1dd2d2=a159_0x2b9f00,_0x567a00=0x64,_0x1160d8=[];for(let _0x49bdec=0x1;;_0x49bdec+=0x1){const {items:_0x4daa6b,paging:_0xc7cfab}=await listAppRoles(_0xc13232,{'currentPage':_0x49bdec,'pageSize':_0x567a00});_0x1160d8[_0x1dd2d2(0x1e3)](..._0x4daa6b);if(_0x4daa6b[_0x1dd2d2(0x1dc)]<_0x567a00||_0xc7cfab&&_0x1160d8['length']>=_0xc7cfab[_0x1dd2d2(0x1fb)])return _0x1160d8;}}export async function resolveTenantCode(){const _0x308a2b=a159_0x2b9f00,_0x21f8a8=await getSessionUserInfo(),_0x538416=_0x21f8a8?.['user']?.[_0x308a2b(0x205)]?.[_0x308a2b(0x1e5)];if(!_0x538416)throw CliErrors['authRequired'](_0x308a2b(0x1c5));return _0x538416;}function matchMember(_0x1217d8,_0x37da8d){const _0x49dd61=a159_0x2b9f00,_0x257bf2=_0x37da8d[_0x49dd61(0x200)]()[_0x49dd61(0x1c1)]();return(_0x1217d8[_0x49dd61(0x1cd)]??'')[_0x49dd61(0x1c1)]()===_0x257bf2||(_0x1217d8[_0x49dd61(0x1f9)]??'')[_0x49dd61(0x1c1)]()===_0x257bf2;}export async function resolveUserRef(_0x2dfc6){const _0x1c627b=a159_0x2b9f00,_0x670be3=_0x2dfc6[_0x1c627b(0x200)]();if(!_0x670be3)throw CliErrors[_0x1c627b(0x1c8)](_0x1c627b(0x1fc),_0x1c627b(0x1b7));const _0x21cfe6=await resolveTenantCode(),_0x5b775c=await getTenantMembers(_0x21cfe6);if(/^\d+$/['test'](_0x670be3)){const _0x437e24=Number(_0x670be3),_0x3de7ca=_0x5b775c[_0x1c627b(0x203)](_0xc38d61=>_0xc38d61['userId']===_0x437e24);return{'userId':_0x437e24,'username':_0x3de7ca?.[_0x1c627b(0x1f9)]??String(_0x437e24),'nickname':_0x3de7ca?.['nickname'],'matchedBy':'id'};}const _0x1fa87f=_0x5b775c[_0x1c627b(0x1da)](_0x19c5f8=>matchMember(_0x19c5f8,_0x670be3));if(_0x1fa87f[_0x1c627b(0x1dc)]===0x0)throw CliErrors['validation'](_0x1c627b(0x1c7)+_0x670be3+'\x22.',_0x1c627b(0x1d6));if(_0x1fa87f[_0x1c627b(0x1dc)]>0x1){const _0x3ac3dc=_0x1fa87f['map'](_0x2f48df=>(_0x2f48df['nickname']??_0x2f48df[_0x1c627b(0x1f9)]??'?')+'('+_0x2f48df[_0x1c627b(0x1c3)]+')')[_0x1c627b(0x1e7)](',\x20');throw CliErrors[_0x1c627b(0x1c8)](_0x1c627b(0x1d9)+_0x670be3+_0x1c627b(0x1bf)+_0x3ac3dc+'.',_0x1c627b(0x1b3));}const _0x517c28=_0x1fa87f[0x0];return{'userId':_0x517c28['userId'],'username':_0x517c28['username']??String(_0x517c28['userId']),'nickname':_0x517c28[_0x1c627b(0x1cd)],'matchedBy':_0x1c627b(0x1b6)};}export const UPDATE_USER_LIST_PATH=a159_0x2b9f00(0x1db);function userIdsOf(_0x8f722a){const _0x1dd6e4=a159_0x2b9f00;return(_0x8f722a?.[_0x1dd6e4(0x1e2)]??[])[_0x1dd6e4(0x1fe)](_0x14a666=>_0x14a666[_0x1dd6e4(0x1c3)]);}export function computeRoleUserMutation(_0x3401e4){const _0x3943ce=a159_0x2b9f00,{operation:_0x3b5cc2,appCode:_0x551cc3,roleUsers:_0x5243ac,targetRoleId:_0x34d98e,user:_0x57ceea}=_0x3401e4,_0x434cac=_0x5243ac[_0x3943ce(0x203)](_0x119c41=>_0x119c41['id']===_0x34d98e);if(!_0x434cac)throw CliErrors[_0x3943ce(0x1c8)](_0x3943ce(0x204)+_0x34d98e+_0x3943ce(0x1b9),_0x3943ce(0x1bd));const _0x332280=userIdsOf(_0x434cac),_0x5b7ca8=[];if(_0x3401e4[_0x3943ce(0x1de)]!==undefined&&_0x3401e4[_0x3943ce(0x1de)]!==_0x332280[_0x3943ce(0x1dc)])throw CliErrors[_0x3943ce(0x1c8)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x3401e4[_0x3943ce(0x1de)]+_0x3943ce(0x1d4)+_0x332280[_0x3943ce(0x1dc)]+'.',_0x3943ce(0x1b0));const _0x5b0b93=_0x332280[_0x3943ce(0x1f4)](_0x57ceea[_0x3943ce(0x1c3)]);let _0x250fbd=![];const _0x2ecfa6=[..._0x434cac[_0x3943ce(0x1e2)]];if(_0x3b5cc2===_0x3943ce(0x1e1))_0x5b0b93?_0x5b7ca8[_0x3943ce(0x1e3)](_0x3943ce(0x1f0)+_0x57ceea[_0x3943ce(0x1c3)]+_0x3943ce(0x1ec)+_0x434cac['roleName']+_0x3943ce(0x1f7)):(_0x2ecfa6[_0x3943ce(0x1e3)]({'userId':_0x57ceea[_0x3943ce(0x1c3)],'username':_0x57ceea[_0x3943ce(0x1f9)],..._0x57ceea[_0x3943ce(0x1cd)]?{'nickname':_0x57ceea[_0x3943ce(0x1cd)]}:{}}),_0x250fbd=!![]);else{if(!_0x5b0b93)_0x5b7ca8['push'](_0x3943ce(0x1f0)+_0x57ceea[_0x3943ce(0x1c3)]+_0x3943ce(0x1df)+_0x434cac[_0x3943ce(0x1d0)]+';\x20no\x20change.');else{const _0x1fcda9=_0x2ecfa6[_0x3943ce(0x1bb)](_0x15c812=>_0x15c812[_0x3943ce(0x1c3)]===_0x57ceea['userId']);if(_0x1fcda9>=0x0)_0x2ecfa6[_0x3943ce(0x1dd)](_0x1fcda9,0x1);_0x250fbd=!![];}}const _0x4ae16a=_0x5243ac[_0x3943ce(0x1fe)](_0x559a29=>_0x559a29['id']===_0x34d98e?{..._0x559a29,'userList':_0x2ecfa6}:_0x559a29),_0x58b2db=_0x2ecfa6['map'](_0x5e1335=>_0x5e1335['userId']),_0x2787d5={'operation':_0x3b5cc2,'selector':{'appCode':_0x551cc3,'roleId':_0x34d98e,'roleName':_0x434cac[_0x3943ce(0x1d0)],'userId':_0x57ceea[_0x3943ce(0x1c3)]},'before':{'userIds':_0x332280},'after':{'userIds':_0x58b2db},'dryRun':_0x3401e4[_0x3943ce(0x1c4)],'backend':{'method':_0x3943ce(0x1e4),'path':UPDATE_USER_LIST_PATH},'warnings':_0x5b7ca8};return{'roleList':_0x4ae16a,'mutation':_0x2787d5,'changed':_0x250fbd};}export async function loadRoleUsers(_0x50e3a3){return listRoleUsers(_0x50e3a3);}export function readRoleRef(_0x3f40b5){const _0x26b612=a159_0x2b9f00,_0x2714=_0x3f40b5['str'](_0x26b612(0x1d1))[_0x26b612(0x200)]();if(!_0x2714)throw CliErrors[_0x26b612(0x1e6)](_0x26b612(0x1d1),'Pass\x20--role\x20<id|name>.');return _0x2714;}export async function prepareUserMutation(_0x155845,_0x14d805,_0x5b3166){const _0x5b3a2c=a159_0x2b9f00,_0x36f149=readRoleRef(_0x155845),_0x77a4bf=_0x155845['str']('user')[_0x5b3a2c(0x200)]();if(!_0x77a4bf)throw CliErrors['flagMissing'](_0x5b3a2c(0x1ba),_0x5b3a2c(0x1b7));const _0x1575bd=_0x155845[_0x5b3a2c(0x1f3)](_0x5b3a2c(0x1b5)),_0x3b2f1f=_0x1575bd===undefined||_0x1575bd===null?undefined:Number(_0x1575bd),_0x410812=await resolveRoleRef(_0x155845[_0x5b3a2c(0x1be)],_0x36f149),_0x50258d=await resolveUserRef(_0x77a4bf),_0x4535d1=await loadRoleUsers(_0x155845['appCode']);return computeRoleUserMutation({'operation':_0x14d805,'appCode':_0x155845[_0x5b3a2c(0x1be)],'roleUsers':_0x4535d1,'targetRoleId':_0x410812['id'],'user':{'userId':_0x50258d[_0x5b3a2c(0x1c3)],'username':_0x50258d[_0x5b3a2c(0x1f9)],'nickname':_0x50258d['nickname']},'dryRun':_0x5b3166,..._0x3b2f1f!==undefined?{'expectUserCount':_0x3b2f1f}:{}});}function a159_0x3f4a(){const _0x4d02de=['No\x20tenant\x20member\x20matches\x20\x22','validation','Role\x20name\x20\x22','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','3410siJGRJ','Role\x20name','nickname','2264bgDfSV','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','roleName','role','133SWpeQO','\x22\x20not\x20found\x20in\x20app\x20','\x20member(s)\x20but\x20role\x20has\x20','\x20not\x20found\x20in\x20app\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','1051040CqQiKJ','roleType','Multiple\x20tenant\x20members\x20match\x20\x22','filter','/smartapi/permit/user-role/update-user-list','length','splice','expectUserCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','userCount','user-add','userList','push','POST','tenant_code','flagMissing','join','Optional\x20role\x20remark/description','DEV','375432unObvN','string','\x20is\x20already\x20a\x20member\x20of\x20role\x20','6XsUjRa','number','USER','User\x20','Cannot\x20','53039iNIgSk','flag','includes','ADMIN','Missing\x20role\x20reference.',';\x20no\x20change.','1165743qIuhuH','username','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','totalCount','Missing\x20user\x20reference.','280120shunRv','map','1771731NKuzSn','trim','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','find','Role\x20id\x20','tenant','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--user\x20<id>.','44RoOjaS','expect-user-count','name','Pass\x20--user\x20<id|name>.','Disambiguate\x20with\x20--role\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','user','findIndex','test','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','appCode','\x22:\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','toLowerCase','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','userId','dryRun','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','remark'];a159_0x3f4a=function(){return _0x4d02de;};return a159_0x3f4a();}
|
|
1
|
+
const a160_0xb268fd=a160_0x38c3;(function(_0x474452,_0x5ab439){const _0x1a3c54=a160_0x38c3,_0x47c74b=_0x474452();while(!![]){try{const _0x3baa18=parseInt(_0x1a3c54(0xa9))/0x1*(-parseInt(_0x1a3c54(0xa7))/0x2)+-parseInt(_0x1a3c54(0xc6))/0x3+parseInt(_0x1a3c54(0xb8))/0x4*(-parseInt(_0x1a3c54(0xcc))/0x5)+-parseInt(_0x1a3c54(0xbe))/0x6+-parseInt(_0x1a3c54(0xb1))/0x7*(parseInt(_0x1a3c54(0xc8))/0x8)+-parseInt(_0x1a3c54(0xb0))/0x9*(-parseInt(_0x1a3c54(0xcf))/0xa)+parseInt(_0x1a3c54(0xaa))/0xb;if(_0x3baa18===_0x5ab439)break;else _0x47c74b['push'](_0x47c74b['shift']());}catch(_0x25b3cb){_0x47c74b['push'](_0x47c74b['shift']());}}}(a160_0x5ea9,0x4547a));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':a160_0xb268fd(0xcd),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a160_0xb268fd(0xbb),'type':'string','required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};function a160_0x5ea9(){const _0x5a73d9=['splice','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','No\x20tenant\x20member\x20matches\x20\x22','3241773zQMICf','173418lDkvty','map','expectUserCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','flagMissing','Cannot\x20','roleType','4QBsOUS','push','nickname','role','dryRun','flag','1396140mOeUsB','userList','Pass\x20--user\x20<id|name>.','validation','userCount','includes','username',';\x20no\x20change.','1646484eGzRlK','\x20member(s)\x20but\x20role\x20has\x20','136YxVtUs','\x20is\x20not\x20a\x20member\x20of\x20role\x20','DEV','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','2636495KgcJHd','number','trim','10wvOsyr','appCode','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','roleName','string','filter','Disambiguate\x20with\x20--role\x20<id>.','\x20built-in\x20role\x20','USER','findIndex','Role\x20id\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Missing\x20user\x20reference.','Disambiguate\x20with\x20--user\x20<id>.','Role\x20name\x20\x22','CUSTOM','User\x20','tenant','userId','\x20not\x20found\x20in\x20app\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','permitCount','Pass\x20--role\x20<id|name>.','test','\x22\x20not\x20found\x20in\x20app\x20','authRequired','user','toLowerCase','/smartapi/permit/user-role/update-user-list','tenant_code','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','str','Optional\x20role\x20remark/description','expect-user-count','length','join','name','118GOooFC','remark','7757KwZUMv','23223321GpSDxG','\x22:\x20'];a160_0x5ea9=function(){return _0x5a73d9;};return a160_0x5ea9();}export const USER_REF_FLAG={'name':a160_0xb268fd(0x9c),'type':a160_0xb268fd(0xd3),'required':!![],'description':a160_0xb268fd(0xad)};export const NAME_FLAG={'name':a160_0xb268fd(0xa6),'type':a160_0xb268fd(0xd3),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a160_0xb268fd(0xa6),'type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a160_0xb268fd(0xa8),'type':a160_0xb268fd(0xd3),'required':![],'description':a160_0xb268fd(0xa2)};export const EXPECT_USER_COUNT_FLAG={'name':a160_0xb268fd(0xa3),'type':a160_0xb268fd(0xcd),'required':![],'description':a160_0xb268fd(0xcb)};export const BUILTIN_ROLE_TYPES=['ADMIN',a160_0xb268fd(0xca),a160_0xb268fd(0xd7)];export function isBuiltinRole(_0x2fc15f){const _0x41784b=a160_0xb268fd;return BUILTIN_ROLE_TYPES[_0x41784b(0xc3)](_0x2fc15f);}export function assertCustomRole(_0x87756b,_0x5b72ce){const _0x256c95=a160_0xb268fd;if(_0x87756b[_0x256c95(0xb7)]!==_0x256c95(0x90))throw CliErrors[_0x256c95(0xc1)](_0x256c95(0xb6)+_0x5b72ce+_0x256c95(0xd6)+_0x87756b[_0x256c95(0xd2)]+'\x20('+_0x87756b[_0x256c95(0xb7)]+').',_0x256c95(0xae));}export function assertPermConfigurable(_0x29ba50){const _0x11906c=a160_0xb268fd;if(_0x29ba50[_0x11906c(0xb7)]===_0x11906c(0xca)||_0x29ba50[_0x11906c(0xb7)]==='ADMIN')throw CliErrors['validation'](_0x11906c(0xd1)+_0x29ba50[_0x11906c(0xd2)]+'\x20('+_0x29ba50['roleType']+').',_0x11906c(0x8c));}export function projectRole(_0xdbf3a1){const _0xf34f52=a160_0xb268fd;return{'id':_0xdbf3a1['id'],'roleName':_0xdbf3a1[_0xf34f52(0xd2)],'roleType':_0xdbf3a1[_0xf34f52(0xb7)],'remark':_0xdbf3a1[_0xf34f52(0xa8)],'userCount':_0xdbf3a1[_0xf34f52(0xc2)],'permitCount':_0xdbf3a1[_0xf34f52(0x97)],'builtin':isBuiltinRole(_0xdbf3a1[_0xf34f52(0xb7)])};}export async function resolveRoleRef(_0x473d28,_0x8402ec){const _0x58a190=a160_0xb268fd,_0x3f5de7=_0x8402ec[_0x58a190(0xce)]();if(!_0x3f5de7)throw CliErrors['validation']('Missing\x20role\x20reference.',_0x58a190(0x98));if(/^\d+$/[_0x58a190(0x99)](_0x3f5de7))return getRoleById(_0x473d28,Number(_0x3f5de7));const _0x14354c=await listAllAppRoles(_0x473d28),_0x1cdd8c=_0x14354c[_0x58a190(0xd4)](_0x3a7bce=>_0x3a7bce[_0x58a190(0xd2)]===_0x3f5de7);if(_0x1cdd8c[_0x58a190(0xa4)]===0x0)throw CliErrors['validation'](_0x58a190(0x8f)+_0x3f5de7+_0x58a190(0x9a)+_0x473d28+'.',_0x58a190(0x95));if(_0x1cdd8c[_0x58a190(0xa4)]>0x1){const _0x46240a=_0x1cdd8c[_0x58a190(0xb2)](_0x4713c5=>_0x4713c5['id'])[_0x58a190(0xa5)](',\x20');throw CliErrors['validation'](_0x58a190(0x8f)+_0x3f5de7+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x46240a+').',_0x58a190(0xd5));}return _0x1cdd8c[0x0];}export async function getRoleById(_0x3be381,_0x9c974e){const _0xa4245e=a160_0xb268fd,_0x1b86d4=await getAppRole(_0x9c974e);if(!_0x1b86d4)throw CliErrors['validation'](_0xa4245e(0xd9)+_0x9c974e+_0xa4245e(0x94)+_0x3be381+'.',_0xa4245e(0x96));return _0x1b86d4;}async function listAllAppRoles(_0x3e6d92){const _0x6131ba=a160_0xb268fd,_0xfebe19=0x64,_0x53ee3d=[];for(let _0x218375=0x1;;_0x218375+=0x1){const {items:_0xf16aba,paging:_0x39c791}=await listAppRoles(_0x3e6d92,{'currentPage':_0x218375,'pageSize':_0xfebe19});_0x53ee3d[_0x6131ba(0xb9)](..._0xf16aba);if(_0xf16aba[_0x6131ba(0xa4)]<_0xfebe19||_0x39c791&&_0x53ee3d[_0x6131ba(0xa4)]>=_0x39c791['totalCount'])return _0x53ee3d;}}export async function resolveTenantCode(){const _0xd66a56=a160_0xb268fd,_0x4db146=await getSessionUserInfo(),_0x18f252=_0x4db146?.[_0xd66a56(0x9c)]?.[_0xd66a56(0x92)]?.[_0xd66a56(0x9f)];if(!_0x18f252)throw CliErrors[_0xd66a56(0x9b)](_0xd66a56(0xb4));return _0x18f252;}function matchMember(_0x22a901,_0x3d25fe){const _0x49148e=a160_0xb268fd,_0xca66da=_0x3d25fe[_0x49148e(0xce)]()[_0x49148e(0x9d)]();return(_0x22a901[_0x49148e(0xba)]??'')['toLowerCase']()===_0xca66da||(_0x22a901[_0x49148e(0xc4)]??'')['toLowerCase']()===_0xca66da;}export async function resolveUserRef(_0x43181d){const _0x1df27e=a160_0xb268fd,_0x382acf=_0x43181d[_0x1df27e(0xce)]();if(!_0x382acf)throw CliErrors['validation'](_0x1df27e(0x8d),_0x1df27e(0xc0));const _0x21b6ff=await resolveTenantCode(),_0x4210b0=await getTenantMembers(_0x21b6ff);if(/^\d+$/[_0x1df27e(0x99)](_0x382acf)){const _0x8c620d=Number(_0x382acf),_0x386680=_0x4210b0['find'](_0x2e550a=>_0x2e550a[_0x1df27e(0x93)]===_0x8c620d);return{'userId':_0x8c620d,'username':_0x386680?.['username']??String(_0x8c620d),'nickname':_0x386680?.['nickname'],'matchedBy':'id'};}const _0x53e46b=_0x4210b0[_0x1df27e(0xd4)](_0x2469c4=>matchMember(_0x2469c4,_0x382acf));if(_0x53e46b['length']===0x0)throw CliErrors[_0x1df27e(0xc1)](_0x1df27e(0xaf)+_0x382acf+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x53e46b[_0x1df27e(0xa4)]>0x1){const _0x35edd6=_0x53e46b[_0x1df27e(0xb2)](_0x54cf79=>(_0x54cf79[_0x1df27e(0xba)]??_0x54cf79['username']??'?')+'('+_0x54cf79[_0x1df27e(0x93)]+')')[_0x1df27e(0xa5)](',\x20');throw CliErrors[_0x1df27e(0xc1)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x382acf+_0x1df27e(0xab)+_0x35edd6+'.',_0x1df27e(0x8e));}const _0x226e33=_0x53e46b[0x0];return{'userId':_0x226e33[_0x1df27e(0x93)],'username':_0x226e33['username']??String(_0x226e33['userId']),'nickname':_0x226e33[_0x1df27e(0xba)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH=a160_0xb268fd(0x9e);function userIdsOf(_0xd5c9ab){const _0x2e2a1c=a160_0xb268fd;return(_0xd5c9ab?.[_0x2e2a1c(0xbf)]??[])[_0x2e2a1c(0xb2)](_0x6a41ec=>_0x6a41ec[_0x2e2a1c(0x93)]);}export function computeRoleUserMutation(_0x33426b){const _0x3de930=a160_0xb268fd,{operation:_0x47317e,appCode:_0x3f71f9,roleUsers:_0x1a3222,targetRoleId:_0x275f07,user:_0xa73c5}=_0x33426b,_0x45a901=_0x1a3222['find'](_0x3e9420=>_0x3e9420['id']===_0x275f07);if(!_0x45a901)throw CliErrors[_0x3de930(0xc1)](_0x3de930(0xd9)+_0x275f07+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x3de930(0x96));const _0x48b3de=userIdsOf(_0x45a901),_0x3beddc=[];if(_0x33426b[_0x3de930(0xb3)]!==undefined&&_0x33426b[_0x3de930(0xb3)]!==_0x48b3de['length'])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x33426b[_0x3de930(0xb3)]+_0x3de930(0xc7)+_0x48b3de[_0x3de930(0xa4)]+'.',_0x3de930(0xa0));const _0x161326=_0x48b3de[_0x3de930(0xc3)](_0xa73c5[_0x3de930(0x93)]);let _0x431014=![];const _0x2e74a8=[..._0x45a901[_0x3de930(0xbf)]];if(_0x47317e==='user-add')_0x161326?_0x3beddc['push']('User\x20'+_0xa73c5[_0x3de930(0x93)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x45a901[_0x3de930(0xd2)]+_0x3de930(0xc5)):(_0x2e74a8[_0x3de930(0xb9)]({'userId':_0xa73c5[_0x3de930(0x93)],'username':_0xa73c5[_0x3de930(0xc4)],..._0xa73c5['nickname']?{'nickname':_0xa73c5[_0x3de930(0xba)]}:{}}),_0x431014=!![]);else{if(!_0x161326)_0x3beddc[_0x3de930(0xb9)](_0x3de930(0x91)+_0xa73c5['userId']+_0x3de930(0xc9)+_0x45a901[_0x3de930(0xd2)]+_0x3de930(0xc5));else{const _0x32f899=_0x2e74a8[_0x3de930(0xd8)](_0x2a3722=>_0x2a3722[_0x3de930(0x93)]===_0xa73c5[_0x3de930(0x93)]);if(_0x32f899>=0x0)_0x2e74a8[_0x3de930(0xac)](_0x32f899,0x1);_0x431014=!![];}}const _0x3f86d5=_0x1a3222[_0x3de930(0xb2)](_0x472685=>_0x472685['id']===_0x275f07?{..._0x472685,'userList':_0x2e74a8}:_0x472685),_0x573115=_0x2e74a8[_0x3de930(0xb2)](_0x483c2a=>_0x483c2a[_0x3de930(0x93)]),_0x247cdf={'operation':_0x47317e,'selector':{'appCode':_0x3f71f9,'roleId':_0x275f07,'roleName':_0x45a901[_0x3de930(0xd2)],'userId':_0xa73c5[_0x3de930(0x93)]},'before':{'userIds':_0x48b3de},'after':{'userIds':_0x573115},'dryRun':_0x33426b[_0x3de930(0xbc)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x3beddc};return{'roleList':_0x3f86d5,'mutation':_0x247cdf,'changed':_0x431014};}export async function loadRoleUsers(_0x3cb2dd){return listRoleUsers(_0x3cb2dd);}function a160_0x38c3(_0x3ac20d,_0x35addb){_0x3ac20d=_0x3ac20d-0x8c;const _0x5ea909=a160_0x5ea9();let _0x38c36d=_0x5ea909[_0x3ac20d];return _0x38c36d;}export function readRoleRef(_0x4b1d2d){const _0x2c261f=a160_0xb268fd,_0x5402a2=_0x4b1d2d['str'](_0x2c261f(0xbb))[_0x2c261f(0xce)]();if(!_0x5402a2)throw CliErrors[_0x2c261f(0xb5)]('role','Pass\x20--role\x20<id|name>.');return _0x5402a2;}export async function prepareUserMutation(_0x2d5747,_0x2ade25,_0x424536){const _0x5445c8=a160_0xb268fd,_0x23192d=readRoleRef(_0x2d5747),_0x47b81c=_0x2d5747[_0x5445c8(0xa1)](_0x5445c8(0x9c))[_0x5445c8(0xce)]();if(!_0x47b81c)throw CliErrors['flagMissing'](_0x5445c8(0x9c),_0x5445c8(0xc0));const _0x13e052=_0x2d5747[_0x5445c8(0xbd)](_0x5445c8(0xa3)),_0x185951=_0x13e052===undefined||_0x13e052===null?undefined:Number(_0x13e052),_0x2748b0=await resolveRoleRef(_0x2d5747['appCode'],_0x23192d),_0xadc40b=await resolveUserRef(_0x47b81c),_0x97567c=await loadRoleUsers(_0x2d5747[_0x5445c8(0xd0)]);return computeRoleUserMutation({'operation':_0x2ade25,'appCode':_0x2d5747[_0x5445c8(0xd0)],'roleUsers':_0x97567c,'targetRoleId':_0x2748b0['id'],'user':{'userId':_0xadc40b[_0x5445c8(0x93)],'username':_0xadc40b['username'],'nickname':_0xadc40b[_0x5445c8(0xba)]},'dryRun':_0x424536,..._0x185951!==undefined?{'expectUserCount':_0x185951}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x389a99=a161_0x3489;function a161_0x1ce9(){const _0xd813cb=['roleName','POST','trim','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','/smartapi/permit/role/update','2664060klsJvr','4786xDelJf','appCode','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','861630GlobrY','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','993172WzwSVc','flag','62sShNyC','validation','write','num','6MLfZFp','update','504558FqzlkO','--name\x20cannot\x20be\x20empty.','Nothing\x20to\x20update.','69734zooihL','Updated\x20role\x20','name','string','remark','40LvJrdg','256965DAPjAc'];a161_0x1ce9=function(){return _0xd813cb;};return a161_0x1ce9();}(function(_0x334447,_0x1b5436){const _0x3d2e54=a161_0x3489,_0x5c9c34=_0x334447();while(!![]){try{const _0x2c1a8d=parseInt(_0x3d2e54(0x1fb))/0x1*(-parseInt(_0x3d2e54(0x202))/0x2)+-parseInt(_0x3d2e54(0x206))/0x3*(-parseInt(_0x3d2e54(0x200))/0x4)+parseInt(_0x3d2e54(0x1f4))/0x5+-parseInt(_0x3d2e54(0x1fe))/0x6+parseInt(_0x3d2e54(0x1ee))/0x7+parseInt(_0x3d2e54(0x1f3))/0x8*(-parseInt(_0x3d2e54(0x208))/0x9)+parseInt(_0x3d2e54(0x1fa))/0xa;if(_0x2c1a8d===_0x1b5436)break;else _0x5c9c34['push'](_0x5c9c34['shift']());}catch(_0x163cc1){_0x5c9c34['push'](_0x5c9c34['shift']());}}}(a161_0x1ce9,0x3d8a2));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';const UPDATE_PATH=a161_0x389a99(0x1f9);function a161_0x3489(_0x18bd46,_0x2375a0){_0x18bd46=_0x18bd46-0x1ed;const _0x1ce9d1=a161_0x1ce9();let _0x3489fa=_0x1ce9d1[_0x18bd46];return _0x3489fa;}function readPatch(_0x589fa7){const _0x19f48b=a161_0x389a99,_0x1c0e03=_0x589fa7['flag']('name'),_0x135feb=_0x589fa7[_0x19f48b(0x201)](_0x19f48b(0x1f2)),_0x55b07f={};if(_0x1c0e03!==undefined&&_0x1c0e03!==null){const _0x5039c6=String(_0x1c0e03)[_0x19f48b(0x1f7)]();if(!_0x5039c6)throw CliErrors[_0x19f48b(0x203)](_0x19f48b(0x209));if(_0x5039c6['length']>0x40)throw CliErrors[_0x19f48b(0x203)](_0x19f48b(0x1fd));_0x55b07f[_0x19f48b(0x1f5)]=_0x5039c6;}_0x135feb!==undefined&&_0x135feb!==null&&(_0x55b07f['remark']=String(_0x135feb));if(_0x55b07f[_0x19f48b(0x1f5)]===undefined&&_0x55b07f[_0x19f48b(0x1f2)]===undefined)throw CliErrors['validation'](_0x19f48b(0x1ed),_0x19f48b(0x1ff));return _0x55b07f;}export const roleUpdate={'service':'role','command':a161_0x389a99(0x207),'description':a161_0x389a99(0x1f8),'risk':a161_0x389a99(0x204),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a161_0x389a99(0x1f0),'type':a161_0x389a99(0x1f1),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x14f105){readPatch(_0x14f105);},async 'dryRun'(_0x22b751){const _0x33ebda=a161_0x389a99,_0xec9860=_0x22b751[_0x33ebda(0x205)]('id'),_0x66c618=readPatch(_0x22b751),_0x539b67=await getRoleById(_0x22b751[_0x33ebda(0x1fc)],_0xec9860);return assertCustomRole(_0x539b67,_0x33ebda(0x207)),asDryRunResult({'operation':_0x33ebda(0x207),'selector':{'appCode':_0x22b751[_0x33ebda(0x1fc)],'roleId':_0xec9860,'roleName':_0x539b67['roleName']},'before':projectRole(_0x539b67),'after':projectRole({..._0x539b67,..._0x66c618[_0x33ebda(0x1f5)]!==undefined?{'roleName':_0x66c618['roleName']}:{},..._0x66c618[_0x33ebda(0x1f2)]!==undefined?{'remark':_0x66c618[_0x33ebda(0x1f2)]}:{}}),'dryRun':!![],'backend':{'method':_0x33ebda(0x1f6),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x5b2383){const _0x17d8db=a161_0x389a99,_0x3357e4=_0x5b2383['num']('id'),_0x4eecfc=readPatch(_0x5b2383),_0x23a1b7=await getRoleById(_0x5b2383[_0x17d8db(0x1fc)],_0x3357e4);assertCustomRole(_0x23a1b7,_0x17d8db(0x207)),await updateAppRole({'id':_0x3357e4,'appCode':_0x5b2383['appCode'],..._0x4eecfc[_0x17d8db(0x1f5)]!==undefined?{'roleName':_0x4eecfc[_0x17d8db(0x1f5)]}:{},..._0x4eecfc['remark']!==undefined?{'remark':_0x4eecfc[_0x17d8db(0x1f2)]}:{}});const _0x47115b=await getRoleById(_0x5b2383[_0x17d8db(0x1fc)],_0x3357e4);return{'ok':!![],'data':{'operation':_0x17d8db(0x207),'selector':{'appCode':_0x5b2383[_0x17d8db(0x1fc)],'roleId':_0x3357e4,'roleName':_0x47115b[_0x17d8db(0x1f5)]},'before':projectRole(_0x23a1b7),'after':projectRole(_0x47115b),'dryRun':![],'backend':{'method':_0x17d8db(0x1f6),'path':UPDATE_PATH},'warnings':[]},'message':_0x17d8db(0x1ef)+_0x47115b['roleName']+'\x20(id='+_0x3357e4+')'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x2900f8=a162_0x269e;(function(_0x36a152,_0x154674){const _0x5eef90=a162_0x269e,_0x520c73=_0x36a152();while(!![]){try{const _0x2409cb=parseInt(_0x5eef90(0x13e))/0x1*(parseInt(_0x5eef90(0x133))/0x2)+-parseInt(_0x5eef90(0x141))/0x3*(-parseInt(_0x5eef90(0x140))/0x4)+-parseInt(_0x5eef90(0x143))/0x5+parseInt(_0x5eef90(0x13c))/0x6*(parseInt(_0x5eef90(0x13b))/0x7)+-parseInt(_0x5eef90(0x136))/0x8+parseInt(_0x5eef90(0x135))/0x9*(-parseInt(_0x5eef90(0x13d))/0xa)+parseInt(_0x5eef90(0x139))/0xb*(parseInt(_0x5eef90(0x138))/0xc);if(_0x2409cb===_0x154674)break;else _0x520c73['push'](_0x520c73['shift']());}catch(_0x5a8e0e){_0x520c73['push'](_0x520c73['shift']());}}}(a162_0x28c3,0xd11be));function a162_0x269e(_0x55af50,_0x56459d){_0x55af50=_0x55af50-0x130;const _0x28c35f=a162_0x28c3();let _0x269ed3=_0x28c35f[_0x55af50];return _0x269ed3;}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';function a162_0x28c3(){const _0x501aad=['roleName','userId','5366KkAxFp','user-add','613062aZMAhJ','6942272DtYYdA','high-risk-write','102984gwvIzM','1837VMtovg','role','802284uRfHKl','78GqcwEL','90rwIxwt','268OmXbLl','appCode','4vDjApP','1017150WKpnsj','No\x20change:\x20user\x20','8219440tmApBP','\x20to\x20role\x20','selector'];a162_0x28c3=function(){return _0x501aad;};return a162_0x28c3();}export const roleUserAdd={'service':a162_0x2900f8(0x13a),'command':a162_0x2900f8(0x134),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a162_0x2900f8(0x137),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3479da){const _0x3b29c7=a162_0x2900f8,{mutation:_0x3e6904}=await prepareUserMutation(_0x3479da,_0x3b29c7(0x134),!![]);return asDryRunResult(_0x3e6904,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0xa6e759){const _0x42dbb0=a162_0x2900f8,{roleList:_0x57b250,mutation:_0xf65a81,changed:_0x212ff9}=await prepareUserMutation(_0xa6e759,_0x42dbb0(0x134),![]);return _0x212ff9&&await updateRoleUsers(_0xa6e759[_0x42dbb0(0x13f)],_0x57b250),{'ok':!![],'data':_0xf65a81,'message':_0x212ff9?'Added\x20user\x20'+_0xf65a81[_0x42dbb0(0x130)][_0x42dbb0(0x132)]+_0x42dbb0(0x144)+_0xf65a81['selector'][_0x42dbb0(0x131)]:_0x42dbb0(0x142)+_0xf65a81[_0x42dbb0(0x130)][_0x42dbb0(0x132)]+'\x20already\x20in\x20role\x20'+_0xf65a81[_0x42dbb0(0x130)][_0x42dbb0(0x131)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a163_0x3954(){const _0x5a78fa=['4623345pbbphN','high-risk-write','30DsYtJj','role','46579YygJRM','1115192GjNkIK','22jmLczn','4sOOoeo','userId','selector','Removed\x20user\x20','roleName','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','1666BHhiTH','user-remove','\x20from\x20role\x20','704070ZTpcsL','2318565dSeQxP','7790440zTWlvl','28144iDwbrY','\x20not\x20in\x20role\x20'];a163_0x3954=function(){return _0x5a78fa;};return a163_0x3954();}const a163_0x58ccb2=a163_0x2a54;(function(_0x2ee086,_0x9beeaa){const _0x6684e1=a163_0x2a54,_0x45b3b9=_0x2ee086();while(!![]){try{const _0x4c7265=-parseInt(_0x6684e1(0x136))/0x1+-parseInt(_0x6684e1(0x137))/0x2+-parseInt(_0x6684e1(0x12e))/0x3*(-parseInt(_0x6684e1(0x139))/0x4)+parseInt(_0x6684e1(0x134))/0x5*(parseInt(_0x6684e1(0x12d))/0x6)+parseInt(_0x6684e1(0x12a))/0x7*(parseInt(_0x6684e1(0x130))/0x8)+parseInt(_0x6684e1(0x132))/0x9+parseInt(_0x6684e1(0x12f))/0xa*(-parseInt(_0x6684e1(0x138))/0xb);if(_0x4c7265===_0x9beeaa)break;else _0x45b3b9['push'](_0x45b3b9['shift']());}catch(_0x476334){_0x45b3b9['push'](_0x45b3b9['shift']());}}}(a163_0x3954,0xa2833));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a163_0x2a54(_0x449702,_0xf947f5){_0x449702=_0x449702-0x129;const _0x3954c6=a163_0x3954();let _0x2a54c6=_0x3954c6[_0x449702];return _0x2a54c6;}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':a163_0x58ccb2(0x135),'command':a163_0x58ccb2(0x12b),'description':a163_0x58ccb2(0x129),'risk':a163_0x58ccb2(0x133),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5bf312){const {mutation:_0x3159c3}=await prepareUserMutation(_0x5bf312,'user-remove',!![]);return asDryRunResult(_0x3159c3,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x5ace4b){const _0x1a3cdd=a163_0x58ccb2,{roleList:_0x386f73,mutation:_0x1f289f,changed:_0x55ae6c}=await prepareUserMutation(_0x5ace4b,_0x1a3cdd(0x12b),![]);return _0x55ae6c&&await updateRoleUsers(_0x5ace4b['appCode'],_0x386f73),{'ok':!![],'data':_0x1f289f,'message':_0x55ae6c?_0x1a3cdd(0x13c)+_0x1f289f[_0x1a3cdd(0x13b)][_0x1a3cdd(0x13a)]+_0x1a3cdd(0x12c)+_0x1f289f[_0x1a3cdd(0x13b)][_0x1a3cdd(0x13d)]:'No\x20change:\x20user\x20'+_0x1f289f['selector'][_0x1a3cdd(0x13a)]+_0x1a3cdd(0x131)+_0x1f289f['selector']['roleName']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a164_0x2946(){const _0x478ad2=['read','name','626220JzxqlC','userId','str','2991276SSWmQy','24BSxJjH','username','11979567DQDbTP','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','role','49njISkn','282540GCzMHk','1510784EbHbsJ','trim','538305UsqWFD','flagMissing','124105UAgNPX','matchedBy'];a164_0x2946=function(){return _0x478ad2;};return a164_0x2946();}const a164_0x5add17=a164_0x2566;(function(_0x62961a,_0x4cb760){const _0x1076a2=a164_0x2566,_0x15efca=_0x62961a();while(!![]){try{const _0x2da154=parseInt(_0x1076a2(0x1b2))/0x1+-parseInt(_0x1076a2(0x1b8))/0x2+-parseInt(_0x1076a2(0x1bb))/0x3+parseInt(_0x1076a2(0x1bc))/0x4*(parseInt(_0x1076a2(0x1b4))/0x5)+parseInt(_0x1076a2(0x1af))/0x6*(-parseInt(_0x1076a2(0x1ae))/0x7)+parseInt(_0x1076a2(0x1b0))/0x8+parseInt(_0x1076a2(0x1aa))/0x9;if(_0x2da154===_0x4cb760)break;else _0x15efca['push'](_0x15efca['shift']());}catch(_0x4b885d){_0x15efca['push'](_0x15efca['shift']());}}}(a164_0x2946,0x8a80e));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a164_0x2566(_0x767f97,_0x8b2e88){_0x767f97=_0x767f97-0x1aa;const _0x2946b3=a164_0x2946();let _0x2566c3=_0x2946b3[_0x767f97];return _0x2566c3;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a164_0x5add17(0x1ad),'command':'user-resolve','description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a164_0x5add17(0x1b6),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x38ef5d){const _0x5ff59f=a164_0x5add17;if(!_0x38ef5d[_0x5ff59f(0x1ba)](_0x5ff59f(0x1b7))[_0x5ff59f(0x1b1)]())throw CliErrors[_0x5ff59f(0x1b3)]('name',_0x5ff59f(0x1ab));},async 'execute'(_0x481854){const _0x296ddf=a164_0x5add17,_0x9dac86=_0x481854['str'](_0x296ddf(0x1b7))[_0x296ddf(0x1b1)](),_0x17500e=await resolveUserRef(_0x9dac86);return{'ok':!![],'data':{'user':{'userId':_0x17500e[_0x296ddf(0x1b9)],'username':_0x17500e[_0x296ddf(0x1bd)],'nickname':_0x17500e['nickname'],'matchedBy':_0x17500e[_0x296ddf(0x1b5)]}},'message':'Resolved\x20\x22'+_0x9dac86+_0x296ddf(0x1ac)+_0x17500e['userId']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x3acf9c=a165_0x46a9;(function(_0x3d69d2,_0x8469b5){const _0x386846=a165_0x46a9,_0x567c4e=_0x3d69d2();while(!![]){try{const _0x15fa6a=-parseInt(_0x386846(0x1c3))/0x1+-parseInt(_0x386846(0x1ce))/0x2*(parseInt(_0x386846(0x199))/0x3)+-parseInt(_0x386846(0x1a7))/0x4+parseInt(_0x386846(0x1c2))/0x5+-parseInt(_0x386846(0x1ae))/0x6*(-parseInt(_0x386846(0x1c8))/0x7)+-parseInt(_0x386846(0x19d))/0x8*(-parseInt(_0x386846(0x1b7))/0x9)+parseInt(_0x386846(0x1cd))/0xa*(parseInt(_0x386846(0x194))/0xb);if(_0x15fa6a===_0x8469b5)break;else _0x567c4e['push'](_0x567c4e['shift']());}catch(_0x39e677){_0x567c4e['push'](_0x567c4e['shift']());}}}(a165_0x330e,0x5c6ea));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a165_0x3acf9c(0x1a8),a165_0x3acf9c(0x1d1)]);function readPackageScripts(_0x5448f4){const _0xe0093b=a165_0x3acf9c,_0x4778e1=resolve(_0x5448f4,_0xe0093b(0x1ab));if(!existsSync(_0x4778e1))return null;try{const _0x41cb3d=JSON['parse'](readFileSync(_0x4778e1,_0xe0093b(0x1cb)));return _0x41cb3d[_0xe0093b(0x1ad)]??{};}catch{return null;}}function detectPackageManager(_0x2eaf08){const _0x3db944=a165_0x3acf9c;if(existsSync(resolve(_0x2eaf08,_0x3db944(0x1af)))||existsSync(resolve(_0x2eaf08,_0x3db944(0x1c6))))return'bun';if(existsSync(resolve(_0x2eaf08,_0x3db944(0x1bf))))return _0x3db944(0x1b8);if(existsSync(resolve(_0x2eaf08,_0x3db944(0x1a3))))return _0x3db944(0x198);return _0x3db944(0x193);}async function versionCheck(_0xc0c3c6){const _0x1b0949=a165_0x3acf9c,_0x13aec4=await checkCliVersion();(_0x13aec4[_0x1b0949(0x1ac)]||_0x13aec4[_0x1b0949(0x1ba)])&&(printCliUpgradeWarning(_0x13aec4),assertCliVersionSupported(_0x13aec4));const _0x102d27=await checkSdkVersion(_0xc0c3c6);if(_0x102d27[_0x1b0949(0x1ac)])printSdkUpgradeWarning(_0x102d27);}function a165_0x46a9(_0x4a7507,_0x3adb83){_0x4a7507=_0x4a7507-0x193;const _0x330ef3=a165_0x330e();let _0x46a931=_0x330ef3[_0x4a7507];return _0x46a931;}function spawnScript(_0x2b8629,_0x4d7fec,_0x557f79,_0x3416c2){return new Promise((_0x4294a8,_0x4dc997)=>{const _0x210919=a165_0x46a9,_0x22ee12=['run',_0x4d7fec,..._0x557f79],_0x35d595=spawn(_0x2b8629,_0x22ee12,{'cwd':_0x3416c2,'stdio':_0x210919(0x195),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3416c2,_0x210919(0x1aa),'.bin')+delimiter+process.env.PATH}});_0x35d595['on'](_0x210919(0x19f),_0x46026e=>{const _0x53c30e=_0x210919;if(_0x46026e===0x0||_0x46026e===null)_0x4294a8();else _0x4dc997(new Error(_0x2b8629+_0x53c30e(0x1cc)+_0x4d7fec+_0x53c30e(0x1a4)+_0x46026e));}),_0x35d595['on'](_0x210919(0x1b5),_0x4dc997);});}function spawnViteBuildWatch(_0x20f45b){return new Promise((_0x429d42,_0x3f67a8)=>{const _0x512587=a165_0x46a9,_0x4c522c=spawn(_0x512587(0x1b9),['build',_0x512587(0x1c5)],{'cwd':_0x20f45b,'stdio':_0x512587(0x195),'shell':!![],'env':{...process.env,'PATH':''+join(_0x20f45b,_0x512587(0x1aa),_0x512587(0x19e))+delimiter+process.env.PATH}});_0x4c522c['on']('close',_0x483207=>{const _0x3761fb=_0x512587;if(_0x483207===0x0||_0x483207===null)_0x429d42();else _0x3f67a8(new Error(_0x3761fb(0x1c0)+_0x483207));}),_0x4c522c['on'](_0x512587(0x1b5),_0x3f67a8);});}function spawnVitePreview(_0xf8a9f8){return new Promise((_0xcd4563,_0x49a093)=>{const _0x3a748c=a165_0x46a9,_0x34cf4a=spawn(_0x3a748c(0x1b9),[_0x3a748c(0x1bd)],{'cwd':_0xf8a9f8,'stdio':_0x3a748c(0x195),'shell':!![],'env':{...process.env,'PATH':''+join(_0xf8a9f8,_0x3a748c(0x1aa),'.bin')+delimiter+process.env.PATH}});_0x34cf4a['on'](_0x3a748c(0x19f),_0x3002f2=>{if(_0x3002f2===0x0||_0x3002f2===null)_0xcd4563();else _0x49a093(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x3002f2));}),_0x34cf4a['on'](_0x3a748c(0x1b5),_0x49a093);});}const runFlags=[{'name':'watch','type':a165_0x3acf9c(0x1cf),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];function a165_0x330e(){const _0x22dfc7=['yarn.lock','\x20exited\x20with\x20code\x20','\x20run\x20start','run','1980596ABzViI','start','script','node_modules','package.json','needsUpgrade','scripts','26118vBhvbf','bun.lockb','has','keys','\x20run\x20preview','\x0a\x20\x20Usage:\x20','bool','error','Available:\x20','90SdAuEb','pnpm','vite','belowMinimum','join','slice','preview','length','pnpm-lock.yaml','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20\x20\x20\x20','1031085dyjNLm','706726KuuTte','\x20\x20EXAMPLES','--watch','bun.lock','\x20run\x20<script>\x0a','161kdFDcZ','\x20run\x20preview\x20--watch','args','utf-8','\x20run\x20','5305140zCOGAr','106QTitNn','boolean','push','dev','Script\x20name\x20defined\x20in\x20package.json','No\x20scripts\x20defined\x20in\x20package.json.','npm','33xziGvm','inherit','No\x20package.json\x20found\x20in\x20current\x20directory.','\x0a\x20\x20Available\x20scripts:\x0a','yarn','19701plFmkh','watch','(none)','read','24520HLXIzo','.bin','close','Run\x20a\x20package.json\x20script','validation','log'];a165_0x330e=function(){return _0x22dfc7;};return a165_0x330e();}export const runDefinition={'service':a165_0x3acf9c(0x1a6),'command':'run','description':a165_0x3acf9c(0x1a0),'risk':a165_0x3acf9c(0x19c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a165_0x3acf9c(0x1a9),'description':a165_0x3acf9c(0x1d2),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x3bd937=a165_0x3acf9c,_0x280ccb=[];return _0x280ccb['push'](_0x3bd937(0x1c4)),_0x280ccb['push'](_0x3bd937(0x1c1)+CLI_BIN_NAME+_0x3bd937(0x1a5)),_0x280ccb[_0x3bd937(0x1d0)](_0x3bd937(0x1c1)+CLI_BIN_NAME+'\x20run\x20build'),_0x280ccb['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x3bd937(0x1b2)),_0x280ccb[_0x3bd937(0x1d0)](_0x3bd937(0x1c1)+CLI_BIN_NAME+_0x3bd937(0x1c9)),_0x280ccb['join']('\x0a');},async 'execute'(_0x209d1a){const _0xa12c72=a165_0x3acf9c,_0x14cdf5=process['cwd'](),_0x9605dd=_0x209d1a['args'][0x0],_0x1ff8cc=_0x209d1a[_0xa12c72(0x1ca)][_0xa12c72(0x1bc)](0x1),_0x375693=readPackageScripts(_0x14cdf5);if(!_0x375693)throw CliErrors[_0xa12c72(0x1a1)](_0xa12c72(0x196));if(!_0x9605dd){const _0x1cfe3c=Object[_0xa12c72(0x1b1)](_0x375693);if(_0x1cfe3c[_0xa12c72(0x1be)]===0x0)console['log'](_0xa12c72(0x1d3));else{console[_0xa12c72(0x1a2)](_0xa12c72(0x197));for(const _0x28e2c5 of _0x1cfe3c){console['log'](_0xa12c72(0x1c1)+_0x28e2c5);}console[_0xa12c72(0x1a2)](_0xa12c72(0x1b3)+CLI_BIN_NAME+_0xa12c72(0x1c7));}return{'ok':!![]};}if(!_0x375693[_0x9605dd])throw CliErrors[_0xa12c72(0x1a1)]('Script\x20\x22'+_0x9605dd+'\x22\x20not\x20found\x20in\x20package.json.',_0xa12c72(0x1b6)+(Object['keys'](_0x375693)[_0xa12c72(0x1bb)](',\x20')||_0xa12c72(0x19b)));const _0x22cee3=detectPackageManager(_0x14cdf5);VERSION_CHECK_SCRIPTS[_0xa12c72(0x1b0)](_0x9605dd)&&await versionCheck(_0x14cdf5);if(_0x9605dd===_0xa12c72(0x1bd)&&_0x209d1a[_0xa12c72(0x1b4)](_0xa12c72(0x19a)))return await Promise['all']([spawnViteBuildWatch(_0x14cdf5),spawnVitePreview(_0x14cdf5)]),{'ok':!![]};return await spawnScript(_0x22cee3,_0x9605dd,_0x1ff8cc,_0x14cdf5),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x3648f2=a166_0x1573;(function(_0x52c036,_0x5a44b2){const _0x4e8ca3=a166_0x1573,_0x3f0429=_0x52c036();while(!![]){try{const _0xc9827b=parseInt(_0x4e8ca3(0x9a))/0x1*(parseInt(_0x4e8ca3(0x99))/0x2)+parseInt(_0x4e8ca3(0x91))/0x3*(parseInt(_0x4e8ca3(0x93))/0x4)+-parseInt(_0x4e8ca3(0x8f))/0x5*(-parseInt(_0x4e8ca3(0x9c))/0x6)+-parseInt(_0x4e8ca3(0x96))/0x7*(parseInt(_0x4e8ca3(0x9e))/0x8)+-parseInt(_0x4e8ca3(0x98))/0x9+parseInt(_0x4e8ca3(0x97))/0xa*(-parseInt(_0x4e8ca3(0x92))/0xb)+-parseInt(_0x4e8ca3(0x9d))/0xc*(-parseInt(_0x4e8ca3(0x94))/0xd);if(_0xc9827b===_0x5a44b2)break;else _0x3f0429['push'](_0x3f0429['shift']());}catch(_0x40ea77){_0x3f0429['push'](_0x3f0429['shift']());}}}(a166_0x29f4,0x1999d));import{buildSchemaPayload}from'../framework/schema-export.js';function a166_0x1573(_0x397980,_0x320102){_0x397980=_0x397980-0x8f;const _0x29f474=a166_0x29f4();let _0x15731e=_0x29f474[_0x397980];return _0x15731e;}async function execute(_0x4eae35){const _0x41d497=await buildSchemaPayload();return{'ok':!![],'data':_0x41d497};}export const schemaDefinition={'service':'schema','command':a166_0x3648f2(0x95),'description':a166_0x3648f2(0x90),'risk':a166_0x3648f2(0x9b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};function a166_0x29f4(){const _0x14ef82=['10BkkNTF','606807PyZsyK','90634MRDQHK','3lsOqmw','read','1140606xnfaMF','1338204QEKkTA','8384ZcJNnx','5CLFKZF','Export\x20machine-readable\x20command\x20schema\x20(JSON)','9681rjHNgg','1828453PfSodR','24YOEhlb','13ztbFiH','export','791SpbvNP'];a166_0x29f4=function(){return _0x14ef82;};return a166_0x29f4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a166_0x3cf64e=a166_0x3f31;(function(_0x4b280d,_0x153a92){const _0x7ae830=a166_0x3f31,_0x5d0e23=_0x4b280d();while(!![]){try{const _0x4b247d=parseInt(_0x7ae830(0xb2))/0x1*(parseInt(_0x7ae830(0x99))/0x2)+-parseInt(_0x7ae830(0x7e))/0x3+-parseInt(_0x7ae830(0x9b))/0x4*(-parseInt(_0x7ae830(0xbb))/0x5)+parseInt(_0x7ae830(0xae))/0x6*(parseInt(_0x7ae830(0x87))/0x7)+parseInt(_0x7ae830(0xab))/0x8*(parseInt(_0x7ae830(0x80))/0x9)+parseInt(_0x7ae830(0x81))/0xa+-parseInt(_0x7ae830(0x7f))/0xb*(parseInt(_0x7ae830(0x92))/0xc);if(_0x4b247d===_0x153a92)break;else _0x5d0e23['push'](_0x5d0e23['shift']());}catch(_0x3e23bd){_0x5d0e23['push'](_0x5d0e23['shift']());}}}(a166_0x2caf,0x66912));function a166_0x2caf(){const _0x184d06=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','18bYoEef','</select>','db-id','lockFilePath','554335khSGVu','POST','toISOString','name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRootDir','length','catch','5xCEJbW','high-risk-write','sql','lastSync','str','description','314571gplKTZ','11MmOmNw','9ZLSNhF','1176530coLyMW','trim','appCode','__manual__','stringify','flagMissing','386554lZrjAg','sqls','validation','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','dbId\x20不能为空','<server-generated-sqlCode>','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','✎\x20手动输入\x20dbId','适合带动态标签的\x20MyBatis\x20XML\x20SQL','flag','19281180zcuykM','mybatisXml','请选择目标数据库:','sqlRoot','Created\x20SQL\x20query\x20','utf8','请选择本地\x20SQL\x20模式:','2bMaPqp','mode','1965464OKAHbt','dbName','/smartapi/custom/saveUserCustomSql','普通\x20SQL(sql)','请输入\x20SQL\x20名称:','create','nonInteractive','Target\x20database\x20ID','sqlName','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','number','string','SQL\x20query\x20display\x20name','dbId','File\x20already\x20exists:\x20','isFinite','6421728pkXOXC','sqlCode'];a166_0x2caf=function(){return _0x184d06;};return a166_0x2caf();}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';function a166_0x3f31(_0x40154d,_0x120cf2){_0x40154d=_0x40154d-0x79;const _0x2cafd2=a166_0x2caf();let _0x3f312b=_0x2cafd2[_0x40154d];return _0x3f312b;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x494806){const _0x1b9f7d=a166_0x3f31;if(_0x494806===_0x1b9f7d(0x93))return[_0x1b9f7d(0x8e),'\x20\x20SELECT\x201\x20AS\x20id',_0x1b9f7d(0xaf),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a166_0x3cf64e(0x7a),'command':a166_0x3cf64e(0xa0),'description':a166_0x3cf64e(0x8a),'risk':a166_0x3cf64e(0x79),'flags':[{'name':a166_0x3cf64e(0xb5),'type':a166_0x3cf64e(0xa6),'description':a166_0x3cf64e(0xa7)},{'name':'db-id','type':a166_0x3cf64e(0xa5),'description':a166_0x3cf64e(0xa2)},{'name':a166_0x3cf64e(0x9a),'type':a166_0x3cf64e(0xa6),'enum':[a166_0x3cf64e(0x7a),'mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x558b29){const _0x408255=a166_0x3cf64e;if(!_0x558b29[_0x408255(0xa1)])return;if(!_0x558b29[_0x408255(0x7c)](_0x408255(0xb5))[_0x408255(0x82)]())throw CliErrors[_0x408255(0x86)](_0x408255(0xb5),_0x408255(0xb6));const _0x34b1f1=resolveProvidedDbId(_0x558b29);if(typeof _0x34b1f1!=='number'||!Number[_0x408255(0xaa)](_0x34b1f1)||_0x34b1f1<=0x0)throw CliErrors[_0x408255(0x86)](_0x408255(0xb0),_0x408255(0xad));if(!_0x558b29[_0x408255(0x7c)](_0x408255(0x9a))['trim']())throw CliErrors['flagMissing'](_0x408255(0x9a),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x1e99ad){const _0x35109b=a166_0x3cf64e,_0x3fdc49=loadSqlProjectConfig(_0x1e99ad[_0x35109b(0x83)]),{sqlName:_0x5d7aa1,dbId:_0x3d945d,dbName:_0x5b4ab5,mode:_0x296fb1}=await resolveSqlNewInputs(_0x1e99ad),_0x220fa0=buildSqlRelativePath(_0x35109b(0x8d),_0x5d7aa1,_0x5b4ab5,_0x296fb1,_0x3d945d),_0x160e6e=_0x3fdc49[_0x35109b(0xb8)]+'/'+_0x220fa0;return{'method':_0x35109b(0xb3),'url':_0x35109b(0x9d),'body':{'appCode':_0x1e99ad['appCode'],'sqlName':_0x5d7aa1,'dbId':_0x3d945d,'mode':_0x296fb1,'localPath':_0x160e6e},'description':_0x35109b(0x8b)+_0x3fdc49[_0x35109b(0xb8)]};},async 'execute'(_0x208343){const _0x2e4af2=a166_0x3cf64e,_0x49a4b5=loadSqlProjectConfig(_0x208343[_0x2e4af2(0x83)]),{sqlName:_0x297f51,dbId:_0x5b3973,dbName:_0x8f3107,mode:_0x3a4199}=await resolveSqlNewInputs(_0x208343),_0x595f20=generateSqlTemplate(_0x3a4199),_0x262c29=await createSqlQuery({'appCode':_0x208343[_0x2e4af2(0x83)],'sqlName':_0x297f51,'dbId':_0x5b3973,'sqlContent':_0x595f20}),_0x5094fc=ensureRemoteSqlContent(_0x262c29),_0x5509e1=_0x8f3107||await getDbName(_0x208343[_0x2e4af2(0x83)],_0x5b3973)[_0x2e4af2(0xba)](()=>undefined),_0x358df0=buildSqlRelativePath(_0x262c29[_0x2e4af2(0xac)],_0x262c29['sqlName'],_0x5509e1,_0x3a4199,_0x5b3973),_0x23495b=_0x49a4b5[_0x2e4af2(0xb8)]+'/'+_0x358df0,_0x4c9c3b=buildLocalSqlFileContent({'sqlCode':_0x262c29[_0x2e4af2(0xac)],'sqlName':_0x262c29[_0x2e4af2(0xa3)],'dbId':_0x262c29[_0x2e4af2(0xa8)]},_0x5094fc,{'dbName':_0x5509e1,'mode':_0x3a4199,'syncedAt':new Date()[_0x2e4af2(0xb4)](),'description':_0x262c29[_0x2e4af2(0x7d)]});if(await fileExists(_0x23495b))throw CliErrors[_0x2e4af2(0x89)](_0x2e4af2(0xa9)+_0x23495b);await ensureParentDirectory(_0x23495b),await writeFile(_0x23495b,_0x4c9c3b,_0x2e4af2(0x97));const _0x3ca64c=await readSqlLockFile(_0x49a4b5[_0x2e4af2(0xb1)]),{lockData:_0x5932d4,appLock:_0x219024}=ensureSqlLockScope(_0x3ca64c??createEmptySqlLock(),_0x49a4b5[_0x2e4af2(0x83)],_0x49a4b5[_0x2e4af2(0x95)],'new');return _0x219024[_0x2e4af2(0x88)][_0x262c29[_0x2e4af2(0xac)]]={...buildSqlLockEntry(_0x262c29,_0x5094fc,computeSqlContentHash(_0x4c9c3b),{'dbName':_0x5509e1}),'path':_0x358df0,'mode':_0x3a4199},_0x219024[_0x2e4af2(0x7b)]=new Date()[_0x2e4af2(0xb4)](),await writeSqlLockFile(_0x49a4b5[_0x2e4af2(0xb1)],_0x5932d4),{'ok':!![],'data':{'id':_0x262c29['id'],'sqlCode':_0x262c29[_0x2e4af2(0xac)],'sqlName':_0x262c29['sqlName'],'dbId':_0x262c29[_0x2e4af2(0xa8)],'path':_0x23495b,'mode':_0x3a4199},'message':_0x2e4af2(0x96)+_0x262c29[_0x2e4af2(0xac)]};}};async function resolveSqlNewInputs(_0x39edd4){const _0x212aac=await resolveSqlNameInput(_0x39edd4),{dbId:_0x1f56ad,dbName:_0x161fc5}=await resolveDbSelection(_0x39edd4),_0x2538ba=await resolveSqlModeInput(_0x39edd4);return{'sqlName':_0x212aac,'dbId':_0x1f56ad,'dbName':_0x161fc5,'mode':_0x2538ba};}async function resolveSqlNameInput(_0x1b147c){const _0x563533=a166_0x3cf64e,_0xa7f95d=_0x1b147c[_0x563533(0x7c)]('name')[_0x563533(0x82)]();if(_0xa7f95d)return _0xa7f95d;if(_0x1b147c[_0x563533(0xa1)])throw CliErrors[_0x563533(0x86)]('name',_0x563533(0xb6));return(await input({'message':_0x563533(0x9f),'validate':_0x2e9b7e=>_0x2e9b7e['trim']()?!![]:'SQL\x20名称不能为空'}))[_0x563533(0x82)]();}async function resolveDbSelection(_0x4f4d50){const _0xf837bf=a166_0x3cf64e,_0x244e36=resolveProvidedDbId(_0x4f4d50);if(typeof _0x244e36===_0xf837bf(0xa5)&&Number[_0xf837bf(0xaa)](_0x244e36)&&_0x244e36>0x0)return{'dbId':_0x244e36,'dbName':await getDbName(_0x4f4d50[_0xf837bf(0x83)],_0x244e36)[_0xf837bf(0xba)](()=>undefined)};if(_0x4f4d50[_0xf837bf(0xa1)])throw CliErrors[_0xf837bf(0x86)](_0xf837bf(0xb0),_0xf837bf(0xad));const _0x3a8530=await listDatabases(_0x4f4d50['appCode'])[_0xf837bf(0xba)](()=>[]);if(_0x3a8530[_0xf837bf(0xb9)]===0x1)return{'dbId':_0x3a8530[0x0][_0xf837bf(0xa8)],'dbName':_0x3a8530[0x0][_0xf837bf(0x9c)]};if(_0x3a8530[_0xf837bf(0xb9)]>0x1){const _0xe2b1c5=await select({'message':_0xf837bf(0x94),'choices':[..._0x3a8530['map'](_0xef2951=>({'name':_0xef2951['dbName']+'\x20('+_0xef2951[_0xf837bf(0xa8)]+')','value':serializeDbSelection(_0xef2951)})),{'name':_0xf837bf(0x8f),'value':'__manual__'}]});if(_0xe2b1c5!==_0xf837bf(0x84))return deserializeDbSelection(_0xe2b1c5);}const _0x4ad779=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x4b78f8=>{const _0x1c923f=_0xf837bf,_0x131639=_0x4b78f8[_0x1c923f(0x82)]();if(!_0x131639)return _0x1c923f(0x8c);const _0x2c851e=Number(_0x131639);if(!Number['isInteger'](_0x2c851e)||_0x2c851e<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x4ad779[_0xf837bf(0x82)]())};}async function resolveSqlModeInput(_0x23b164){const _0x546b05=a166_0x3cf64e,_0x449471=_0x23b164[_0x546b05(0x7c)]('mode')[_0x546b05(0x82)]();if(_0x449471===_0x546b05(0x7a)||_0x449471===_0x546b05(0x93))return _0x449471;if(_0x23b164[_0x546b05(0xa1)])throw CliErrors['flagMissing'](_0x546b05(0x9a),_0x546b05(0xb7));return await select({'message':_0x546b05(0x98),'choices':[{'name':_0x546b05(0x9e),'value':_0x546b05(0x7a),'description':_0x546b05(0xa4)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x546b05(0x93),'description':_0x546b05(0x90)}]});}function serializeDbSelection(_0x58c014){const _0x51944b=a166_0x3cf64e;return JSON[_0x51944b(0x85)]({'dbId':_0x58c014[_0x51944b(0xa8)],'dbName':_0x58c014[_0x51944b(0x9c)]});}function deserializeDbSelection(_0x33dca3){const _0x260123=a166_0x3cf64e;try{const _0x464fa7=JSON['parse'](_0x33dca3);if(typeof _0x464fa7[_0x260123(0xa8)]===_0x260123(0xa5)&&Number[_0x260123(0xaa)](_0x464fa7[_0x260123(0xa8)]))return{'dbId':_0x464fa7[_0x260123(0xa8)],'dbName':_0x464fa7[_0x260123(0x9c)]};}catch{}throw CliErrors[_0x260123(0x89)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x33dca3);}function resolveProvidedDbId(_0x34e3e6){const _0x32e7af=a166_0x3cf64e,_0x10d983=_0x34e3e6[_0x32e7af(0x91)]('db-id');if(typeof _0x10d983===_0x32e7af(0xa5)&&Number[_0x32e7af(0xaa)](_0x10d983))return _0x10d983;return undefined;}
|
|
1
|
+
const a167_0x451451=a167_0x4eb9;(function(_0x5ba56a,_0x4db8c8){const _0x2f10e9=a167_0x4eb9,_0x4d7336=_0x5ba56a();while(!![]){try{const _0x4d3157=-parseInt(_0x2f10e9(0x188))/0x1*(parseInt(_0x2f10e9(0x17e))/0x2)+-parseInt(_0x2f10e9(0x1b5))/0x3*(-parseInt(_0x2f10e9(0x1a8))/0x4)+parseInt(_0x2f10e9(0x194))/0x5*(-parseInt(_0x2f10e9(0x1ae))/0x6)+-parseInt(_0x2f10e9(0x186))/0x7*(parseInt(_0x2f10e9(0x197))/0x8)+parseInt(_0x2f10e9(0x172))/0x9+-parseInt(_0x2f10e9(0x183))/0xa+parseInt(_0x2f10e9(0x180))/0xb;if(_0x4d3157===_0x4db8c8)break;else _0x4d7336['push'](_0x4d7336['shift']());}catch(_0x1993ab){_0x4d7336['push'](_0x4d7336['shift']());}}}(a167_0xe7c3,0xe33c3));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';function a167_0x4eb9(_0x517354,_0x21ecdb){_0x517354=_0x517354-0x16f;const _0xe7c3f5=a167_0xe7c3();let _0x4eb952=_0xe7c3f5[_0x517354];return _0x4eb952;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x18fbe7){const _0x5ade7f=a167_0x4eb9;if(_0x18fbe7===_0x5ade7f(0x17a))return[_0x5ade7f(0x1a5),_0x5ade7f(0x177),_0x5ade7f(0x19b),''][_0x5ade7f(0x16f)]('\x0a');return[_0x5ade7f(0x174),''][_0x5ade7f(0x16f)]('\x0a');}export const sqlCreate={'service':a167_0x451451(0x1ad),'command':a167_0x451451(0x1a7),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a167_0x451451(0x171),'flags':[{'name':a167_0x451451(0x1a9),'type':a167_0x451451(0x1ab),'description':a167_0x451451(0x195)},{'name':a167_0x451451(0x189),'type':a167_0x451451(0x184),'description':a167_0x451451(0x17c)},{'name':a167_0x451451(0x198),'type':a167_0x451451(0x1ab),'enum':[a167_0x451451(0x1ad),'mybatisXml'],'description':a167_0x451451(0x185)}],async 'validate'(_0x3fb753){const _0x23cb28=a167_0x451451;if(!_0x3fb753[_0x23cb28(0x1ac)])return;if(!_0x3fb753[_0x23cb28(0x1b4)](_0x23cb28(0x1a9))[_0x23cb28(0x193)]())throw CliErrors[_0x23cb28(0x1b0)](_0x23cb28(0x1a9),_0x23cb28(0x192));const _0x4b7dbe=resolveProvidedDbId(_0x3fb753);if(typeof _0x4b7dbe!==_0x23cb28(0x184)||!Number[_0x23cb28(0x18a)](_0x4b7dbe)||_0x4b7dbe<=0x0)throw CliErrors[_0x23cb28(0x1b0)](_0x23cb28(0x189),_0x23cb28(0x19a));if(!_0x3fb753['str'](_0x23cb28(0x198))['trim']())throw CliErrors[_0x23cb28(0x1b0)]('mode',_0x23cb28(0x17d));},async 'dryRun'(_0x435a64){const _0x57b28a=a167_0x451451,_0x58aeec=loadSqlProjectConfig(_0x435a64['appCode']),{sqlName:_0x5419f9,dbId:_0x201dad,dbName:_0x42ec11,mode:_0x1b8c89}=await resolveSqlNewInputs(_0x435a64),_0x2f8d37=buildSqlRelativePath('<server-generated-sqlCode>',_0x5419f9,_0x42ec11,_0x1b8c89,_0x201dad),_0x41771c=_0x58aeec['sqlRootDir']+'/'+_0x2f8d37;return{'method':_0x57b28a(0x19e),'url':_0x57b28a(0x18e),'body':{'appCode':_0x435a64[_0x57b28a(0x1b3)],'sqlName':_0x5419f9,'dbId':_0x201dad,'mode':_0x1b8c89,'localPath':_0x41771c},'description':_0x57b28a(0x17f)+_0x58aeec[_0x57b28a(0x176)]};},async 'execute'(_0x35cc70){const _0x4ac7be=a167_0x451451,_0x3a09b6=loadSqlProjectConfig(_0x35cc70['appCode']),{sqlName:_0x316d83,dbId:_0x289136,dbName:_0x3ce37c,mode:_0x56a743}=await resolveSqlNewInputs(_0x35cc70),_0x81d4a5=generateSqlTemplate(_0x56a743),_0x1e347f=await createSqlQuery({'appCode':_0x35cc70[_0x4ac7be(0x1b3)],'sqlName':_0x316d83,'dbId':_0x289136,'sqlContent':_0x81d4a5}),_0x18acc2=ensureRemoteSqlContent(_0x1e347f),_0x4f3d90=_0x3ce37c||await getDbName(_0x35cc70['appCode'],_0x289136)[_0x4ac7be(0x199)](()=>undefined),_0x22bf37=buildSqlRelativePath(_0x1e347f[_0x4ac7be(0x18b)],_0x1e347f[_0x4ac7be(0x1a3)],_0x4f3d90,_0x56a743,_0x289136),_0x4c207d=_0x3a09b6[_0x4ac7be(0x176)]+'/'+_0x22bf37,_0x360770=buildLocalSqlFileContent({'sqlCode':_0x1e347f[_0x4ac7be(0x18b)],'sqlName':_0x1e347f['sqlName'],'dbId':_0x1e347f[_0x4ac7be(0x1aa)]},_0x18acc2,{'dbName':_0x4f3d90,'mode':_0x56a743,'syncedAt':new Date()[_0x4ac7be(0x18c)](),'description':_0x1e347f['description']});if(await fileExists(_0x4c207d))throw CliErrors[_0x4ac7be(0x181)](_0x4ac7be(0x1af)+_0x4c207d);await ensureParentDirectory(_0x4c207d),await writeFile(_0x4c207d,_0x360770,_0x4ac7be(0x170));const _0xf695c0=await readSqlLockFile(_0x3a09b6['lockFilePath']),{lockData:_0x390c08,appLock:_0x4d3b90}=ensureSqlLockScope(_0xf695c0??createEmptySqlLock(),_0x3a09b6[_0x4ac7be(0x1b3)],_0x3a09b6[_0x4ac7be(0x178)],_0x4ac7be(0x17b));return _0x4d3b90[_0x4ac7be(0x18f)][_0x1e347f[_0x4ac7be(0x18b)]]={...buildSqlLockEntry(_0x1e347f,_0x18acc2,computeSqlContentHash(_0x360770),{'dbName':_0x4f3d90}),'path':_0x22bf37,'mode':_0x56a743},_0x4d3b90[_0x4ac7be(0x175)]=new Date()[_0x4ac7be(0x18c)](),await writeSqlLockFile(_0x3a09b6[_0x4ac7be(0x1b1)],_0x390c08),{'ok':!![],'data':{'id':_0x1e347f['id'],'sqlCode':_0x1e347f[_0x4ac7be(0x18b)],'sqlName':_0x1e347f[_0x4ac7be(0x1a3)],'dbId':_0x1e347f[_0x4ac7be(0x1aa)],'path':_0x4c207d,'mode':_0x56a743},'message':_0x4ac7be(0x1a1)+_0x1e347f[_0x4ac7be(0x18b)]};}};async function resolveSqlNewInputs(_0x17c971){const _0xea5a94=await resolveSqlNameInput(_0x17c971),{dbId:_0x51c3d8,dbName:_0x583371}=await resolveDbSelection(_0x17c971),_0xeac7da=await resolveSqlModeInput(_0x17c971);return{'sqlName':_0xea5a94,'dbId':_0x51c3d8,'dbName':_0x583371,'mode':_0xeac7da};}function a167_0xe7c3(){const _0xa9fe7d=['31270778kEuMlf','validation','length','10878470XwWxqB','number','Local\x20SQL\x20file\x20mode','57883ChuNci','stringify','4932cZzyas','db-id','isFinite','sqlCode','toISOString','flag','/smartapi/custom/saveUserCustomSql','sqls','isInteger','请输入目标数据库\x20dbId:','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','trim','5HevQVP','SQL\x20query\x20display\x20name','map','328xhbBtR','mode','catch','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','</select>','dbId\x20不能为空','请输入\x20SQL\x20名称:','POST','__manual__','Invalid\x20database\x20selection\x20payload:\x20','Created\x20SQL\x20query\x20','普通\x20SQL(sql)','sqlName','parse','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','请选择本地\x20SQL\x20模式:','create','8yCXMoV','name','dbId','string','nonInteractive','sql','9559050KxQFBd','File\x20already\x20exists:\x20','flagMissing','lockFilePath','请选择目标数据库:','appCode','str','887244fhotmQ','join','utf8','high-risk-write','14902236HfVGhs','MyBatis\x20XML(mybatisXml)','SELECT\x201\x20AS\x20id;','lastSync','sqlRootDir','\x20\x20SELECT\x201\x20AS\x20id','sqlRoot','dbName','mybatisXml','new','Target\x20database\x20ID','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','462uzLSXh','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'];a167_0xe7c3=function(){return _0xa9fe7d;};return a167_0xe7c3();}async function resolveSqlNameInput(_0x377d6a){const _0x52f3fd=a167_0x451451,_0x4edbf3=_0x377d6a[_0x52f3fd(0x1b4)](_0x52f3fd(0x1a9))['trim']();if(_0x4edbf3)return _0x4edbf3;if(_0x377d6a[_0x52f3fd(0x1ac)])throw CliErrors[_0x52f3fd(0x1b0)](_0x52f3fd(0x1a9),_0x52f3fd(0x192));return(await input({'message':_0x52f3fd(0x19d),'validate':_0x4144e3=>_0x4144e3[_0x52f3fd(0x193)]()?!![]:'SQL\x20名称不能为空'}))['trim']();}async function resolveDbSelection(_0x130e7f){const _0x251fb0=a167_0x451451,_0x48e4fe=resolveProvidedDbId(_0x130e7f);if(typeof _0x48e4fe===_0x251fb0(0x184)&&Number[_0x251fb0(0x18a)](_0x48e4fe)&&_0x48e4fe>0x0)return{'dbId':_0x48e4fe,'dbName':await getDbName(_0x130e7f[_0x251fb0(0x1b3)],_0x48e4fe)['catch'](()=>undefined)};if(_0x130e7f[_0x251fb0(0x1ac)])throw CliErrors[_0x251fb0(0x1b0)](_0x251fb0(0x189),_0x251fb0(0x19a));const _0x32120e=await listDatabases(_0x130e7f[_0x251fb0(0x1b3)])[_0x251fb0(0x199)](()=>[]);if(_0x32120e[_0x251fb0(0x182)]===0x1)return{'dbId':_0x32120e[0x0][_0x251fb0(0x1aa)],'dbName':_0x32120e[0x0]['dbName']};if(_0x32120e['length']>0x1){const _0x4d6217=await select({'message':_0x251fb0(0x1b2),'choices':[..._0x32120e[_0x251fb0(0x196)](_0x4d9f1e=>({'name':_0x4d9f1e['dbName']+'\x20('+_0x4d9f1e[_0x251fb0(0x1aa)]+')','value':serializeDbSelection(_0x4d9f1e)})),{'name':'✎\x20手动输入\x20dbId','value':_0x251fb0(0x19f)}]});if(_0x4d6217!=='__manual__')return deserializeDbSelection(_0x4d6217);}const _0x3e3067=await input({'message':_0x251fb0(0x191),'validate':_0x3e8a97=>{const _0x2c6f7f=_0x251fb0,_0x9547cb=_0x3e8a97['trim']();if(!_0x9547cb)return _0x2c6f7f(0x19c);const _0x22a12a=Number(_0x9547cb);if(!Number[_0x2c6f7f(0x190)](_0x22a12a)||_0x22a12a<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x3e3067[_0x251fb0(0x193)]())};}async function resolveSqlModeInput(_0x1742d9){const _0x44fd0f=a167_0x451451,_0xa42fa1=_0x1742d9[_0x44fd0f(0x1b4)](_0x44fd0f(0x198))[_0x44fd0f(0x193)]();if(_0xa42fa1===_0x44fd0f(0x1ad)||_0xa42fa1==='mybatisXml')return _0xa42fa1;if(_0x1742d9[_0x44fd0f(0x1ac)])throw CliErrors[_0x44fd0f(0x1b0)]('mode',_0x44fd0f(0x17d));return await select({'message':_0x44fd0f(0x1a6),'choices':[{'name':_0x44fd0f(0x1a2),'value':_0x44fd0f(0x1ad),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x44fd0f(0x173),'value':'mybatisXml','description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x2c6f34){const _0x354d39=a167_0x451451;return JSON[_0x354d39(0x187)]({'dbId':_0x2c6f34[_0x354d39(0x1aa)],'dbName':_0x2c6f34['dbName']});}function deserializeDbSelection(_0x285007){const _0x433963=a167_0x451451;try{const _0x36be6a=JSON[_0x433963(0x1a4)](_0x285007);if(typeof _0x36be6a[_0x433963(0x1aa)]===_0x433963(0x184)&&Number[_0x433963(0x18a)](_0x36be6a[_0x433963(0x1aa)]))return{'dbId':_0x36be6a[_0x433963(0x1aa)],'dbName':_0x36be6a[_0x433963(0x179)]};}catch{}throw CliErrors[_0x433963(0x181)](_0x433963(0x1a0)+_0x285007);}function resolveProvidedDbId(_0x130eea){const _0x3335a7=a167_0x451451,_0x199361=_0x130eea[_0x3335a7(0x18d)](_0x3335a7(0x189));if(typeof _0x199361===_0x3335a7(0x184)&&Number[_0x3335a7(0x18a)](_0x199361))return _0x199361;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a168_0x332e4f=a168_0x38b8;(function(_0x4ebae0,_0xa3c0f2){const _0x547b51=a168_0x38b8,_0x36fe23=_0x4ebae0();while(!![]){try{const _0x15a3b7=parseInt(_0x547b51(0x149))/0x1*(parseInt(_0x547b51(0x157))/0x2)+-parseInt(_0x547b51(0x136))/0x3*(-parseInt(_0x547b51(0x144))/0x4)+-parseInt(_0x547b51(0x155))/0x5+-parseInt(_0x547b51(0x13c))/0x6+-parseInt(_0x547b51(0x148))/0x7*(-parseInt(_0x547b51(0x137))/0x8)+parseInt(_0x547b51(0x14d))/0x9+parseInt(_0x547b51(0x141))/0xa*(-parseInt(_0x547b51(0x13f))/0xb);if(_0x15a3b7===_0xa3c0f2)break;else _0x36fe23['push'](_0x36fe23['shift']());}catch(_0x4784ef){_0x36fe23['push'](_0x36fe23['shift']());}}}(a168_0x3146,0x365c3));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a168_0x3146(){const _0x614b42=['384560yocdPh','lockFilePath','231484llpZFG','delete','Would\x20delete\x20SQL\x20','SQL\x20lock\x20file\x20not\x20found.','projectRoot','sqlcode','entries','sqlRoot','trashDir','82773uSHcfq','1892120hcKHyZ','lastSync','filter','high-risk-write','sqls','2524038LlIuus','remoteId','appCode','3113XgsUvQ','POST','11470aaJCSN','length','fromEntries','44jSbmEq','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','validation','replace','7yZACOP','2eIrWQN','\x20(local\x20file\x20moved\x20to\x20trash)','startsWith','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','2460105VqLSxX','str','sql','/smartapi/custom/deleteUserCustomSql','trashedTo','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','toISOString','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local'];a168_0x3146=function(){return _0x614b42;};return a168_0x3146();}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a168_0x38b8(_0x30dec9,_0x329f64){_0x30dec9=_0x30dec9-0x136;const _0x3146eb=a168_0x3146();let _0x38b8fa=_0x3146eb[_0x30dec9];return _0x38b8fa;}export const sqlDelete={'service':a168_0x332e4f(0x14f),'command':a168_0x332e4f(0x158),'description':a168_0x332e4f(0x154),'risk':a168_0x332e4f(0x13a),'flags':[SQLCODE_FLAG],async 'validate'(_0x5819f3){const _0xdd61ea=a168_0x332e4f,_0x30bdc1=loadSqlProjectConfig(_0x5819f3[_0xdd61ea(0x13e)]),_0x45aeae=await readSqlLockFile(_0x30bdc1['lockFilePath']);if(!_0x45aeae)throw CliErrors[_0xdd61ea(0x146)](_0xdd61ea(0x152));},async 'dryRun'(_0x5b694f){const _0x46b8df=a168_0x332e4f,_0x3ddf08=loadSqlProjectConfig(_0x5b694f[_0x46b8df(0x13e)]),_0x49f7aa=await readSqlLockFile(_0x3ddf08['lockFilePath']);if(!_0x49f7aa)throw CliErrors[_0x46b8df(0x146)](_0x46b8df(0x152));const {appLock:_0x1b2f62}=ensureSqlLockScope(_0x49f7aa,_0x5b694f[_0x46b8df(0x13e)],_0x3ddf08['sqlRoot'],_0x46b8df(0x158)),_0x2c8043=_0x5b694f[_0x46b8df(0x14e)]('sqlcode'),_0x187c1d=_0x1b2f62[_0x46b8df(0x13b)][_0x2c8043];if(!_0x187c1d)throw CliErrors['validation'](_0x46b8df(0x145)+_0x2c8043+'\x22.');return{'method':_0x46b8df(0x140),'url':_0x46b8df(0x150),'body':{'sqlCode':_0x2c8043,'id':_0x187c1d['remoteId'],'localPath':resolveLocalSqlFilePath(_0x3ddf08,_0x2c8043,_0x187c1d)},'description':_0x46b8df(0x159)+_0x2c8043+_0x46b8df(0x14c)+_0x3ddf08[_0x46b8df(0x15f)]};},async 'execute'(_0x266fc){const _0x1cba8e=a168_0x332e4f,_0x16ed58=loadSqlProjectConfig(_0x266fc[_0x1cba8e(0x13e)]),_0x4263ea=await readSqlLockFile(_0x16ed58[_0x1cba8e(0x156)]);if(!_0x4263ea)throw CliErrors[_0x1cba8e(0x146)](_0x1cba8e(0x15a));const {lockData:_0x18291f,appLock:_0x5a5cce}=ensureSqlLockScope(_0x4263ea,_0x266fc['appCode'],_0x16ed58[_0x1cba8e(0x15e)],_0x1cba8e(0x158)),_0x1bcb35=_0x266fc['str'](_0x1cba8e(0x15c)),_0x6f6396=_0x5a5cce[_0x1cba8e(0x13b)][_0x1bcb35];if(!_0x6f6396)throw CliErrors[_0x1cba8e(0x146)](_0x1cba8e(0x145)+_0x1bcb35+'\x22.');await deleteSqlQuery({'id':_0x6f6396[_0x1cba8e(0x13d)],'sqlCode':_0x1bcb35}),_0x5a5cce[_0x1cba8e(0x13b)]=Object[_0x1cba8e(0x143)](Object[_0x1cba8e(0x15d)](_0x5a5cce[_0x1cba8e(0x13b)])[_0x1cba8e(0x139)](([_0x7c73])=>_0x7c73!==_0x1bcb35)),_0x5a5cce[_0x1cba8e(0x138)]=new Date()['toISOString'](),await writeSqlLockFile(_0x16ed58[_0x1cba8e(0x156)],_0x18291f);const _0x4c1195=resolveLocalSqlFilePath(_0x16ed58,_0x1bcb35,_0x6f6396);let _0x5525ed;await fileExists(_0x4c1195)&&(_0x5525ed=await moveToTrash(_0x16ed58[_0x1cba8e(0x15b)],_0x16ed58['trashDir'],_0x4c1195),await cleanupEmptyDirectories(dirname(_0x4c1195),_0x16ed58['sqlRootDir']));const _0x7168bd={'deleted':_0x1bcb35,'remoteId':_0x6f6396['remoteId']};if(_0x5525ed)_0x7168bd[_0x1cba8e(0x151)]=_0x5525ed;return{'ok':!![],'data':_0x7168bd,'message':'Deleted\x20'+_0x1bcb35+(_0x5525ed?_0x1cba8e(0x14a):'')};}};async function moveToTrash(_0x3c8f43,_0x100696,_0x24baa2){const _0x446dc5=a168_0x332e4f,_0x9e8b24=new Date()[_0x446dc5(0x153)]()[_0x446dc5(0x147)](/[:.]/g,'-'),_0x56022a=relative(_0x3c8f43,_0x24baa2),_0x402a4d=join(_0x100696,_0x9e8b24,_0x56022a);return await mkdir(dirname(_0x402a4d),{'recursive':!![]}),await rename(_0x24baa2,_0x402a4d),_0x402a4d;}async function cleanupEmptyDirectories(_0x1b5513,_0x1f35fb){const _0x40b1cb=a168_0x332e4f;let _0x2a860b=resolve(_0x1b5513);const _0x52aa7e=resolve(_0x1f35fb);while(_0x2a860b[_0x40b1cb(0x14b)](''+_0x52aa7e+sep)||_0x2a860b===_0x52aa7e){if(_0x2a860b===_0x52aa7e)return;try{const _0x3d2d0c=await readdir(_0x2a860b);if(_0x3d2d0c[_0x40b1cb(0x142)]>0x0)return;await rmdir(_0x2a860b);}catch{return;}_0x2a860b=dirname(_0x2a860b);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a169_0x2801a3=a169_0x4469;(function(_0x389311,_0x38939b){const _0x1ba09d=a169_0x4469,_0xd20a18=_0x389311();while(!![]){try{const _0x20ada1=-parseInt(_0x1ba09d(0x17c))/0x1+-parseInt(_0x1ba09d(0x18c))/0x2*(parseInt(_0x1ba09d(0x179))/0x3)+-parseInt(_0x1ba09d(0x18a))/0x4*(-parseInt(_0x1ba09d(0x18e))/0x5)+parseInt(_0x1ba09d(0x17b))/0x6*(parseInt(_0x1ba09d(0x180))/0x7)+parseInt(_0x1ba09d(0x188))/0x8*(-parseInt(_0x1ba09d(0x17f))/0x9)+parseInt(_0x1ba09d(0x17e))/0xa+parseInt(_0x1ba09d(0x18f))/0xb;if(_0x20ada1===_0x38939b)break;else _0xd20a18['push'](_0xd20a18['shift']());}catch(_0x31f633){_0xd20a18['push'](_0xd20a18['shift']());}}}(a169_0x25b3,0x1f1cf));function a169_0x25b3(){const _0x431083=['verbose','6GeGieP','234416uixOQO','boolean','1237660WggjaQ','9zlTvzt','164339dQsIQl','sqlCode','appCode','dbId','read','str','sql','description','819536xggDxM','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','52iQiowE','sqlName','6122LkkUFI','sqlcode','92635MbnBKs','1511653PavcXQ','bool','60GHkBjA'];a169_0x25b3=function(){return _0x431083;};return a169_0x25b3();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a169_0x4469(_0x291d32,_0x5440fd){_0x291d32=_0x291d32-0x179;const _0x25b38d=a169_0x25b3();let _0x4469ed=_0x25b38d[_0x291d32];return _0x4469ed;}export const sqlDetail={'service':a169_0x2801a3(0x186),'command':'detail','description':a169_0x2801a3(0x189),'risk':a169_0x2801a3(0x184),'flags':[SQLCODE_FLAG,{'name':a169_0x2801a3(0x17a),'type':a169_0x2801a3(0x17d),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x5f42fb){const _0x1524d4=a169_0x2801a3,_0x31581a=await getSqlQueryInfo(_0x5f42fb['appCode'],_0x5f42fb[_0x1524d4(0x185)](_0x1524d4(0x18d))),_0x3d6bbc=_0x5f42fb[_0x1524d4(0x190)](_0x1524d4(0x17a));if(_0x3d6bbc)return{'ok':!![],'data':_0x31581a};const _0x116371=_0x31581a[_0x1524d4(0x183)]?await getDbName(_0x5f42fb[_0x1524d4(0x182)],_0x31581a['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x31581a[_0x1524d4(0x181)],'sqlName':_0x31581a[_0x1524d4(0x18b)],'db':_0x116371?_0x116371+'\x20('+_0x31581a['dbId']+')':_0x31581a[_0x1524d4(0x183)]??'','description':_0x31581a[_0x1524d4(0x187)]??'','sqlContent':_0x31581a['sqlContent']??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a170_0x2684(_0x167c9b,_0x2d0f12){_0x167c9b=_0x167c9b-0x164;const _0x68f18e=a170_0x68f1();let _0x2684ac=_0x68f18e[_0x167c9b];return _0x2684ac;}const a170_0x544b74=a170_0x2684;(function(_0x2058f5,_0x21aeeb){const _0x4b607b=a170_0x2684,_0xd51805=_0x2058f5();while(!![]){try{const _0x2145d8=-parseInt(_0x4b607b(0x177))/0x1+-parseInt(_0x4b607b(0x176))/0x2+-parseInt(_0x4b607b(0x165))/0x3+-parseInt(_0x4b607b(0x16e))/0x4+parseInt(_0x4b607b(0x16a))/0x5+-parseInt(_0x4b607b(0x164))/0x6+-parseInt(_0x4b607b(0x167))/0x7*(-parseInt(_0x4b607b(0x16f))/0x8);if(_0x2145d8===_0x21aeeb)break;else _0xd51805['push'](_0xd51805['shift']());}catch(_0x2c22ed){_0xd51805['push'](_0xd51805['shift']());}}}(a170_0x68f1,0x7494f));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a170_0x68f1(){const _0x66cd8b=['28qoXUBA','SQL\x20execution\x20failed','Returned\x20','4206785KaDDMj','now','sql','sqlcode','3723808sekyiZ','4191024jiOyHx','params','\x20row(s)\x20in\x20','string','str','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execError','1174530blSDJp','261594RHxJll','execResult','length','1783806YVCDhk','1146714HbfWRE','appCode'];a170_0x68f1=function(){return _0x66cd8b;};return a170_0x68f1();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a170_0x544b74(0x16c),'command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a170_0x544b74(0x170),'type':a170_0x544b74(0x172),'description':a170_0x544b74(0x174)}],async 'execute'(_0x51c5d4){const _0xeb178d=a170_0x544b74,_0x2f7a6c=parseJsonParams(_0x51c5d4[_0xeb178d(0x173)]('params')),_0x22427=Date[_0xeb178d(0x16b)](),_0x32b553=await executeSql(_0x51c5d4[_0xeb178d(0x166)],_0x51c5d4[_0xeb178d(0x173)](_0xeb178d(0x16d)),_0x2f7a6c),_0x58b948=Date[_0xeb178d(0x16b)]()-_0x22427,_0x48cd83=_0x32b553?.[_0xeb178d(0x178)]??_0x32b553,_0x5c14b5=_0x32b553?.['execSuccess']??!![];if(!_0x5c14b5)return{'ok':![],'data':{'error':_0x32b553?.[_0xeb178d(0x175)]||_0xeb178d(0x168),'elapsed':_0x58b948},'message':_0xeb178d(0x168)};const _0x1abb1e=Array['isArray'](_0x48cd83)?_0x48cd83:[];return{'ok':!![],'data':{'rows':_0x1abb1e,'rowCount':_0x1abb1e[_0xeb178d(0x179)],'elapsed':_0x58b948},'message':_0xeb178d(0x169)+_0x1abb1e[_0xeb178d(0x179)]+_0xeb178d(0x171)+_0x58b948+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44a937,_0xb07195){const _0x50e4c3=a171_0x377e,_0x1bbf1a=_0x44a937();while(!![]){try{const _0x801d45=-parseInt(_0x50e4c3(0x132))/0x1+parseInt(_0x50e4c3(0x137))/0x2+-parseInt(_0x50e4c3(0x134))/0x3+-parseInt(_0x50e4c3(0x139))/0x4+parseInt(_0x50e4c3(0x138))/0x5+-parseInt(_0x50e4c3(0x136))/0x6+parseInt(_0x50e4c3(0x135))/0x7*(parseInt(_0x50e4c3(0x133))/0x8);if(_0x801d45===_0xb07195)break;else _0x1bbf1a['push'](_0x1bbf1a['shift']());}catch(_0x5e77ed){_0x1bbf1a['push'](_0x1bbf1a['shift']());}}}(a171_0x44b9,0x511b0));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a171_0x377e(_0x148a41,_0x5c5e2c){_0x148a41=_0x148a41-0x132;const _0x44b9b8=a171_0x44b9();let _0x377ee2=_0x44b9b8[_0x148a41];return _0x377ee2;}import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a171_0x44b9(){const _0x1a0608=['226482fCbOSs','5234qZsBru','3265265csQFqO','652740AxQxQx','205526WPnMAm','8LaOzLE','1165071xrWRRB','3299471mCmtbt'];a171_0x44b9=function(){return _0x1a0608;};return a171_0x44b9();}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
|
+
const a172_0x50aaaa=a172_0x30bf;(function(_0x283277,_0x1bec65){const _0x11d575=a172_0x30bf,_0x4f9166=_0x283277();while(!![]){try{const _0x37790e=-parseInt(_0x11d575(0x14a))/0x1*(parseInt(_0x11d575(0x13b))/0x2)+-parseInt(_0x11d575(0x158))/0x3*(-parseInt(_0x11d575(0x156))/0x4)+parseInt(_0x11d575(0x136))/0x5*(-parseInt(_0x11d575(0x154))/0x6)+-parseInt(_0x11d575(0x13d))/0x7+parseInt(_0x11d575(0x153))/0x8*(parseInt(_0x11d575(0x138))/0x9)+parseInt(_0x11d575(0x145))/0xa*(parseInt(_0x11d575(0x144))/0xb)+parseInt(_0x11d575(0x140))/0xc;if(_0x37790e===_0x1bec65)break;else _0x4f9166['push'](_0x4f9166['shift']());}catch(_0x33f011){_0x4f9166['push'](_0x4f9166['shift']());}}}(a172_0x10fd,0x31a58));function a172_0x30bf(_0xf3435,_0x4f3476){_0xf3435=_0xf3435-0x136;const _0x10fd46=a172_0x10fd();let _0x30bf17=_0x10fd46[_0xf3435];return _0x30bf17;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a172_0x10fd(){const _0x47ccac=['dbId','12rApwGp','string','339348BJBEzm','5wjLRGR','pagesize','11673ysEYgy','sqlName','List\x20custom\x20SQL\x20queries','2764gOBPhV','appCode','2281083XDPqbT','length','sqlCode','4203816KOstaz','Page\x20number','\x20SQL\x20queries\x20(total:\x20','Found\x20','28083VWiGKM','470dyjpNT','name','Page\x20size','boolean','num','97CaSBqm','read','bool','Filter\x20by\x20SQL\x20name','all','No\x20custom\x20SQL\x20queries\x20found.','sql','sqlcode','page','1304JozPiF','2146758Qdnvee'];a172_0x10fd=function(){return _0x47ccac;};return a172_0x10fd();}export const sqlList={'service':a172_0x50aaaa(0x150),'command':'list','description':a172_0x50aaaa(0x13a),'risk':a172_0x50aaaa(0x14b),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x50aaaa(0x146),'type':a172_0x50aaaa(0x157),'description':a172_0x50aaaa(0x14d)},{'name':a172_0x50aaaa(0x152),'type':'number','description':a172_0x50aaaa(0x141),'default':0x1},{'name':'pagesize','type':'number','description':a172_0x50aaaa(0x147)},{'name':'verbose','type':a172_0x50aaaa(0x148),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x63dfe8){const _0x189dce=a172_0x50aaaa,_0x49308d=await listSqlQueries(_0x63dfe8[_0x189dce(0x13c)],{'sqlCode':_0x63dfe8['str'](_0x189dce(0x151))||undefined,'sqlName':_0x63dfe8['str'](_0x189dce(0x146))||undefined,'currentPage':_0x63dfe8['num'](_0x189dce(0x152)),'pageSize':_0x63dfe8[_0x189dce(0x149)](_0x189dce(0x137),0x32)}),_0x164308=_0x63dfe8[_0x189dce(0x14c)]('verbose'),_0x711d17=_0x49308d['tableData']??[],_0x2ce5d7=_0x49308d['paging']?.['totalCount']??_0x711d17[_0x189dce(0x13e)];let _0x2573e1;return _0x164308?_0x2573e1=_0x711d17:_0x2573e1=await Promise[_0x189dce(0x14e)](_0x711d17['map'](async _0x142504=>{const _0x6c7b5c=_0x189dce;let _0x1410b5;try{_0x1410b5=_0x142504['dbId']?await getDbName(_0x63dfe8[_0x6c7b5c(0x13c)],_0x142504[_0x6c7b5c(0x155)]):undefined;}catch{}return{'sqlCode':_0x142504[_0x6c7b5c(0x13f)],'sqlName':_0x142504[_0x6c7b5c(0x139)],'description':_0x142504['description']??'','db':_0x1410b5?_0x1410b5+'\x20('+_0x142504[_0x6c7b5c(0x155)]+')':_0x142504[_0x6c7b5c(0x155)]??''};})),{'ok':!![],'data':_0x2573e1,'message':_0x711d17[_0x189dce(0x13e)]===0x0?_0x189dce(0x14f):_0x189dce(0x143)+_0x711d17[_0x189dce(0x13e)]+_0x189dce(0x142)+_0x2ce5d7+').'};}};
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a172_0x518cec=a172_0x73db;(function(_0x54795d,_0x1dbca9){const _0x242e13=a172_0x73db,_0x847ba4=_0x54795d();while(!![]){try{const _0x29a423=-parseInt(_0x242e13(0x18b))/0x1*(-parseInt(_0x242e13(0x1a0))/0x2)+-parseInt(_0x242e13(0x188))/0x3+-parseInt(_0x242e13(0x19e))/0x4*(-parseInt(_0x242e13(0x191))/0x5)+-parseInt(_0x242e13(0x1bc))/0x6+-parseInt(_0x242e13(0x1b7))/0x7+-parseInt(_0x242e13(0x1b3))/0x8+parseInt(_0x242e13(0x1ad))/0x9;if(_0x29a423===_0x1dbca9)break;else _0x847ba4['push'](_0x847ba4['shift']());}catch(_0x2ff41d){_0x847ba4['push'](_0x847ba4['shift']());}}}(a172_0x4107,0x57116));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';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a172_0x4107(){const _0xb29091=['pull','dbId','join','sqlContent','write','\x20SQL\x20file(s)\x20into\x20','sql','string','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Force\x20pull\x20cancelled.','paging','16765335WTCbNi','boolean','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlCode','local\x20differs\x20from\x20remote','sqls','4591776Xvnxpf','would_pull','tableData','push','4456956ZwLpSe','sqlcode','path','Filter\x20by\x20SQL\x20display\x20name','unchanged','4002510qKZoVH','force','catch','skipped','name','sqlName','utf8','cancelled','1319256hixzbV','lastSync','trimStart','53782OqQthf','No\x20remote\x20SQL\x20queries\x20matched.','totalCount','length','description','sqlRootDir','16495mQRiQz','apps','lockFilePath','\x20written,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','bool','mybatisXml','filter','test','appCode','split','POST','sqlRoot','136xHzKTh','Force\x20overwrite\x20local\x20unsynced\x20changes','26fIVcYb','str'];a172_0x4107=function(){return _0xb29091;};return a172_0x4107();}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(_0x2a8bcc,_0x28f66c){const _0x1286b1=a172_0x73db,_0x8a033b=[];let _0xcf9b72=0x1;while(!![]){const _0x2f55d9=await listSqlQueries(_0x2a8bcc,{'currentPage':_0xcf9b72,'pageSize':PAGE_SIZE,'sqlCode':_0x28f66c[_0x1286b1(0x1b0)],'sqlName':_0x28f66c[_0x1286b1(0x185)]}),_0x305d23=_0x2f55d9[_0x1286b1(0x1b5)]??[];_0x8a033b['push'](..._0x305d23);if(_0x305d23[_0x1286b1(0x18e)]===0x0)break;const _0x1a99ce=_0x2f55d9[_0x1286b1(0x1ac)]?.[_0x1286b1(0x18d)];if(_0x1a99ce!=null?_0x8a033b[_0x1286b1(0x18e)]>=_0x1a99ce:_0x305d23[_0x1286b1(0x18e)]<PAGE_SIZE)break;_0xcf9b72++;}return _0x8a033b;}async function ensureSqlContent(_0x3df757){const _0x43c603=a172_0x73db;if(_0x3df757[_0x43c603(0x1a5)]!=null&&String(_0x3df757[_0x43c603(0x1a5)])[_0x43c603(0x18e)]>0x0)return _0x3df757;return getSqlQueryDetail(_0x3df757[_0x43c603(0x1b0)]);}function a172_0x73db(_0x2bbb08,_0x23f962){_0x2bbb08=_0x2bbb08-0x182;const _0x410711=a172_0x4107();let _0x73db98=_0x410711[_0x2bbb08];return _0x73db98;}export const sqlPull={'service':a172_0x518cec(0x1a8),'command':a172_0x518cec(0x1a2),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a172_0x518cec(0x1a6),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a172_0x518cec(0x184),'type':a172_0x518cec(0x1a9),'description':a172_0x518cec(0x1ba)},{'name':a172_0x518cec(0x1bd),'type':a172_0x518cec(0x1ae),'description':a172_0x518cec(0x19f)}],async 'dryRun'(_0xb456e5){const _0x444027=a172_0x518cec,_0x37fdd2=loadSqlProjectConfig(_0xb456e5[_0x444027(0x19a)]),_0x38eaec=await readSqlLockFile(_0x37fdd2[_0x444027(0x193)]),{appLock:_0x4984c8}=ensureSqlLockScope(_0x38eaec??createEmptySqlLock(),_0x37fdd2[_0x444027(0x19a)],_0x37fdd2[_0x444027(0x19d)],_0x444027(0x1a2)),_0x59503f=await fetchAllSqlQueries(_0xb456e5['appCode'],{'sqlCode':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x1b8))||undefined,'sqlName':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x184))||undefined}),_0x39924e=[];for(const _0x51df11 of _0x59503f){const _0x46f8e8=await ensureSqlContent(_0x51df11),_0x58e130=ensureRemoteSqlContent(_0x46f8e8),_0x30773d=detectModeFromSql(_0x46f8e8),_0x3e871f=_0x46f8e8[_0x444027(0x1a3)]?await getDbName(_0xb456e5[_0x444027(0x19a)],Number(_0x46f8e8['dbId']))[_0x444027(0x182)](()=>undefined):undefined,_0x3e908a=buildLocalSqlFileContent({'sqlCode':_0x46f8e8[_0x444027(0x1b0)],'sqlName':_0x46f8e8[_0x444027(0x185)],'dbId':_0x46f8e8[_0x444027(0x1a3)]},_0x58e130,{'dbName':_0x3e871f,'mode':_0x30773d,'syncedAt':new Date()['toISOString'](),'description':_0x46f8e8['description']}),_0x1d1ca2=buildSqlLockEntry(_0x46f8e8,_0x58e130,'',{'dbName':_0x3e871f}),_0x2c3633=resolveLocalSqlFilePath(_0x37fdd2,_0x46f8e8['sqlCode'],_0x1d1ca2);let _0x7a4cd8=_0x444027(0x1b4),_0x4fc09d;if(await fileExists(_0x2c3633)){const _0x2b86c4=await readFile(_0x2c3633,_0x444027(0x186));isEquivalentPulledSqlFile(_0x2b86c4,_0x3e908a,_0x30773d)?(_0x7a4cd8=_0x444027(0x183),_0x4fc09d=_0x444027(0x1bb)):(_0x7a4cd8='conflict',_0x4fc09d=_0x444027(0x1aa));}_0x39924e[_0x444027(0x1b6)]({'sqlCode':_0x46f8e8[_0x444027(0x1b0)],'sqlName':_0x46f8e8['sqlName'],'filePath':_0x2c3633,'status':_0x7a4cd8,'reason':_0x4fc09d});}return{'method':_0x444027(0x19c),'url':_0x444027(0x1af),'body':{'appCode':_0xb456e5[_0x444027(0x19a)],'sqlCode':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x1b8))||null,'sqlName':_0xb456e5[_0x444027(0x1a1)](_0x444027(0x184))||null,'files':_0x39924e},'description':'Would\x20pull\x20'+_0x39924e[_0x444027(0x18e)]+_0x444027(0x1a7)+_0x37fdd2['sqlRootDir']};},async 'execute'(_0xddccb0){const _0x1e51b5=a172_0x518cec,_0x48bd17=loadSqlProjectConfig(_0xddccb0[_0x1e51b5(0x19a)]),_0x14f8ea=await readSqlLockFile(_0x48bd17[_0x1e51b5(0x193)]),{lockData:_0x145172,appLock:_0x36a21a}=ensureSqlLockScope(_0x14f8ea??createEmptySqlLock(),_0x48bd17[_0x1e51b5(0x19a)],_0x48bd17[_0x1e51b5(0x19d)],'pull'),_0x565b11=_0xddccb0[_0x1e51b5(0x196)]('force'),_0x312b95=await fetchAllSqlQueries(_0xddccb0[_0x1e51b5(0x19a)],{'sqlCode':_0xddccb0['str'](_0x1e51b5(0x1b8))||undefined,'sqlName':_0xddccb0[_0x1e51b5(0x1a1)](_0x1e51b5(0x184))||undefined});if(_0x312b95[_0x1e51b5(0x18e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1e51b5(0x18c)};const _0x444039=[],_0x3f82f6=[];for(const _0x53cc83 of _0x312b95){try{_0x444039[_0x1e51b5(0x1b6)](await ensureSqlContent(_0x53cc83));}catch(_0x51b773){_0x3f82f6[_0x1e51b5(0x1b6)]({'sqlCode':_0x53cc83[_0x1e51b5(0x1b0)],'error':_0x51b773 instanceof Error?_0x51b773['message']:String(_0x51b773)});}}if(_0x565b11&&!_0xddccb0['nonInteractive']){let _0x42137c=![];for(const _0x22bccc of _0x444039){const _0x4e563f=detectModeFromSql(_0x22bccc),_0x430140=_0x22bccc[_0x1e51b5(0x1a3)]?await getDbName(_0xddccb0['appCode'],Number(_0x22bccc['dbId']))[_0x1e51b5(0x182)](()=>undefined):undefined,_0x370d03=buildLocalSqlFileContent({'sqlCode':_0x22bccc[_0x1e51b5(0x1b0)],'sqlName':_0x22bccc[_0x1e51b5(0x185)],'dbId':_0x22bccc[_0x1e51b5(0x1a3)]},ensureRemoteSqlContent(_0x22bccc),{'dbName':_0x430140,'mode':_0x4e563f,'syncedAt':new Date()['toISOString'](),'description':_0x22bccc[_0x1e51b5(0x18f)]}),_0x1d331e=resolveLocalSqlFilePath(_0x48bd17,_0x22bccc[_0x1e51b5(0x1b0)],buildSqlLockEntry(_0x22bccc,ensureRemoteSqlContent(_0x22bccc),'',{'dbName':_0x430140}));if(await fileExists(_0x1d331e)){const _0x3aed33=await readFile(_0x1d331e,_0x1e51b5(0x186));if(!isEquivalentPulledSqlFile(_0x3aed33,_0x370d03,_0x4e563f)){_0x42137c=!![];break;}}}if(_0x42137c){const _0x4056b2=await confirmForceOverwrite(_0x1e51b5(0x195));if(!_0x4056b2)throw CliErrors[_0x1e51b5(0x187)](_0x1e51b5(0x1ab));}}const _0x1cefab=cloneSqlLockData(_0x145172),_0x3a699d=_0x1cefab[_0x1e51b5(0x192)][_0x48bd17[_0x1e51b5(0x19a)]],_0x181f62=[],_0xd61585=[];for(const _0x2c4e34 of _0x444039){const _0xccc11b=_0x3a699d[_0x1e51b5(0x1b2)][_0x2c4e34['sqlCode']],_0x32e1da=ensureRemoteSqlContent(_0x2c4e34),_0xa04e86=detectModeFromSql(_0x2c4e34),_0x2d1424=_0x2c4e34[_0x1e51b5(0x1a3)]?await getDbName(_0xddccb0[_0x1e51b5(0x19a)],Number(_0x2c4e34[_0x1e51b5(0x1a3)]))[_0x1e51b5(0x182)](()=>undefined):undefined,_0x4f0a90=buildLocalSqlFileContent({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'sqlName':_0x2c4e34['sqlName'],'dbId':_0x2c4e34[_0x1e51b5(0x1a3)]},_0x32e1da,{'dbName':_0x2d1424,'mode':_0xa04e86,'syncedAt':new Date()['toISOString'](),'description':_0x2c4e34[_0x1e51b5(0x18f)]}),_0x44718a=buildSqlLockEntry(_0x2c4e34,_0x32e1da,computeSqlContentHash(_0x4f0a90),{'dbName':_0x2d1424}),_0x506a97=_0x44718a[_0x1e51b5(0x1b9)],_0x3c89ab=join(_0x48bd17[_0x1e51b5(0x190)],_0x506a97);try{if(await fileExists(_0x3c89ab)){const _0x5b6d9a=await readFile(_0x3c89ab,_0x1e51b5(0x186));if(isEquivalentPulledSqlFile(_0x5b6d9a,_0x4f0a90,_0xa04e86)){_0xd61585[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'reason':_0x1e51b5(0x1bb)}),_0x3a699d[_0x1e51b5(0x1b2)][_0x2c4e34[_0x1e51b5(0x1b0)]]={..._0x44718a,'hash':computeSqlContentHash(_0x5b6d9a),'path':_0x506a97};continue;}if(!_0x565b11){_0xd61585[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'reason':_0x1e51b5(0x1b1)});continue;}}const _0x27ac51=_0xccc11b?.[_0x1e51b5(0x1b9)]?join(_0x48bd17[_0x1e51b5(0x190)],_0xccc11b[_0x1e51b5(0x1b9)]):undefined;_0x27ac51&&_0x27ac51!==_0x3c89ab&&await fileExists(_0x27ac51)&&await rm(_0x27ac51,{'force':!![]}),await ensureParentDirectory(_0x3c89ab),await writeFile(_0x3c89ab,_0x4f0a90,_0x1e51b5(0x186)),_0x3a699d[_0x1e51b5(0x1b2)][_0x2c4e34[_0x1e51b5(0x1b0)]]={..._0x44718a,'path':_0x506a97},_0x181f62[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'filePath':_0x3c89ab});}catch(_0x94f76d){_0x3f82f6[_0x1e51b5(0x1b6)]({'sqlCode':_0x2c4e34[_0x1e51b5(0x1b0)],'error':_0x94f76d instanceof Error?_0x94f76d['message']:String(_0x94f76d)});}}return _0x3a699d[_0x1e51b5(0x189)]=new Date()['toISOString'](),await writeSqlLockFile(_0x48bd17[_0x1e51b5(0x193)],_0x1cefab),{'ok':_0x3f82f6[_0x1e51b5(0x18e)]===0x0,'data':{'pulled':_0x181f62,'skipped':_0xd61585,'failed':_0x3f82f6},'message':'Pull\x20complete:\x20'+_0x181f62[_0x1e51b5(0x18e)]+_0x1e51b5(0x194)+_0xd61585[_0x1e51b5(0x18e)]+'\x20skipped,\x20'+_0x3f82f6[_0x1e51b5(0x18e)]+'\x20failed'};}};function detectModeFromSql(_0x2002e4){const _0x4b787c=a172_0x518cec,_0x5943a0=ensureRemoteSqlContent(_0x2002e4),_0xd1ac67=stripLocalSqlMetadata(_0x5943a0,_0x4b787c(0x197))[_0x4b787c(0x18a)]();if(/^<(select|insert|update|delete)\b/i['test'](_0xd1ac67))return _0x4b787c(0x197);return _0x4b787c(0x1a8);}function isEquivalentPulledSqlFile(_0x3e8842,_0x4601e7,_0x4e684c){return normalizePullComparableContent(_0x3e8842,_0x4e684c)===normalizePullComparableContent(_0x4601e7,_0x4e684c);}function normalizePullComparableContent(_0x2ab356,_0x4af141){const _0x382628=a172_0x518cec,_0x206a5d=_0x2ab356['replace'](/\r\n/g,'\x0a')[_0x382628(0x19b)]('\x0a'),_0x6752e6=_0x206a5d[_0x382628(0x198)](_0x4039cd=>!isSyncedAtMetadataLine(_0x4039cd,_0x4af141));return _0x6752e6[_0x382628(0x1a4)]('\x0a');}function isSyncedAtMetadataLine(_0x6a9b82,_0x2d9041){const _0x481f3b=a172_0x518cec;if(_0x2d9041===_0x481f3b(0x197))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x481f3b(0x199)](_0x6a9b82);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x6a9b82);}
|
|
1
|
+
const a173_0x10c41d=a173_0x258e;function a173_0x258e(_0x234a14,_0x52dfa1){_0x234a14=_0x234a14-0x94;const _0x3a0608=a173_0x3a06();let _0x258e61=_0x3a0608[_0x234a14];return _0x258e61;}(function(_0x35ae67,_0x4e46ef){const _0x1ce396=a173_0x258e,_0x18a08d=_0x35ae67();while(!![]){try{const _0x24f981=parseInt(_0x1ce396(0xcd))/0x1*(-parseInt(_0x1ce396(0x95))/0x2)+parseInt(_0x1ce396(0x94))/0x3+parseInt(_0x1ce396(0x98))/0x4*(-parseInt(_0x1ce396(0xab))/0x5)+-parseInt(_0x1ce396(0xd1))/0x6*(-parseInt(_0x1ce396(0xa5))/0x7)+parseInt(_0x1ce396(0xc6))/0x8*(-parseInt(_0x1ce396(0x9c))/0x9)+-parseInt(_0x1ce396(0xb6))/0xa+parseInt(_0x1ce396(0xa0))/0xb;if(_0x24f981===_0x4e46ef)break;else _0x18a08d['push'](_0x18a08d['shift']());}catch(_0x1433b2){_0x18a08d['push'](_0x18a08d['shift']());}}}(a173_0x3a06,0x9aeba));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';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a173_0x3a06(){const _0x3dd4da=['str','1232cJlCnZ','sqlName','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','message','sqlContent','sqls','1136495zLohxe','Would\x20pull\x20','sqlRootDir','description','utf8','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','Force\x20pull\x20cancelled.','catch','toISOString','sql','skipped','11961200qULwrg','paging','unchanged','sqlRoot','length','test','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Force\x20overwrite\x20local\x20unsynced\x20changes','\x20SQL\x20file(s)\x20into\x20','\x20skipped,\x20','Pull\x20complete:\x20','sqlCode','nonInteractive','No\x20remote\x20SQL\x20queries\x20matched.','local\x20differs\x20from\x20remote','conflict','288qIMBkh','dbId','boolean','filter','lockFilePath','Filter\x20by\x20SQL\x20display\x20name','sqlcode','3557BdtCGI','bool','mybatisXml','write','3498TMkgmc','2845446eWpvDa','136QRHGrn','path','name','8XPBIOc','lastSync','pull','appCode','257067CTprFg','join','string','trimStart','27547586vSnSit','tableData','force','push'];a173_0x3a06=function(){return _0x3dd4da;};return a173_0x3a06();}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(_0x276e58,_0xbe03a1){const _0x1183fe=a173_0x258e,_0x258365=[];let _0x193cef=0x1;while(!![]){const _0x8a83ba=await listSqlQueries(_0x276e58,{'currentPage':_0x193cef,'pageSize':PAGE_SIZE,'sqlCode':_0xbe03a1[_0x1183fe(0xc1)],'sqlName':_0xbe03a1[_0x1183fe(0xa6)]}),_0x54e9f8=_0x8a83ba[_0x1183fe(0xa1)]??[];_0x258365[_0x1183fe(0xa3)](..._0x54e9f8);if(_0x54e9f8[_0x1183fe(0xba)]===0x0)break;const _0x14cea5=_0x8a83ba[_0x1183fe(0xb7)]?.['totalCount'];if(_0x14cea5!=null?_0x258365[_0x1183fe(0xba)]>=_0x14cea5:_0x54e9f8[_0x1183fe(0xba)]<PAGE_SIZE)break;_0x193cef++;}return _0x258365;}async function ensureSqlContent(_0x30394e){const _0x162028=a173_0x258e;if(_0x30394e['sqlContent']!=null&&String(_0x30394e[_0x162028(0xa9)])[_0x162028(0xba)]>0x0)return _0x30394e;return getSqlQueryDetail(_0x30394e['sqlCode']);}export const sqlPull={'service':a173_0x10c41d(0xb4),'command':a173_0x10c41d(0x9a),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a173_0x10c41d(0xd0),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a173_0x10c41d(0x9e),'description':a173_0x10c41d(0xcb)},{'name':'force','type':a173_0x10c41d(0xc8),'description':a173_0x10c41d(0xbd)}],async 'dryRun'(_0x4ebba1){const _0x1010bc=a173_0x10c41d,_0x35ae97=loadSqlProjectConfig(_0x4ebba1['appCode']),_0xf97b52=await readSqlLockFile(_0x35ae97[_0x1010bc(0xca)]),{appLock:_0x293f82}=ensureSqlLockScope(_0xf97b52??createEmptySqlLock(),_0x35ae97[_0x1010bc(0x9b)],_0x35ae97[_0x1010bc(0xb9)],_0x1010bc(0x9a)),_0x55475f=await fetchAllSqlQueries(_0x4ebba1[_0x1010bc(0x9b)],{'sqlCode':_0x4ebba1[_0x1010bc(0xa4)](_0x1010bc(0xcc))||undefined,'sqlName':_0x4ebba1['str']('name')||undefined}),_0x1f259f=[];for(const _0x55f200 of _0x55475f){const _0x54ee57=await ensureSqlContent(_0x55f200),_0x2bec37=ensureRemoteSqlContent(_0x54ee57),_0x5a06aa=detectModeFromSql(_0x54ee57),_0x81ffdc=_0x54ee57[_0x1010bc(0xc7)]?await getDbName(_0x4ebba1['appCode'],Number(_0x54ee57[_0x1010bc(0xc7)]))[_0x1010bc(0xb2)](()=>undefined):undefined,_0x5420dc=buildLocalSqlFileContent({'sqlCode':_0x54ee57['sqlCode'],'sqlName':_0x54ee57['sqlName'],'dbId':_0x54ee57[_0x1010bc(0xc7)]},_0x2bec37,{'dbName':_0x81ffdc,'mode':_0x5a06aa,'syncedAt':new Date()[_0x1010bc(0xb3)](),'description':_0x54ee57[_0x1010bc(0xae)]}),_0x29ba4a=buildSqlLockEntry(_0x54ee57,_0x2bec37,'',{'dbName':_0x81ffdc}),_0x1881f1=resolveLocalSqlFilePath(_0x35ae97,_0x54ee57[_0x1010bc(0xc1)],_0x29ba4a);let _0x2df6c7='would_pull',_0x1fc25e;if(await fileExists(_0x1881f1)){const _0x32d1fb=await readFile(_0x1881f1,'utf8');isEquivalentPulledSqlFile(_0x32d1fb,_0x5420dc,_0x5a06aa)?(_0x2df6c7=_0x1010bc(0xb5),_0x1fc25e=_0x1010bc(0xb8)):(_0x2df6c7=_0x1010bc(0xc5),_0x1fc25e=_0x1010bc(0xa7));}_0x1f259f['push']({'sqlCode':_0x54ee57['sqlCode'],'sqlName':_0x54ee57[_0x1010bc(0xa6)],'filePath':_0x1881f1,'status':_0x2df6c7,'reason':_0x1fc25e});}return{'method':'POST','url':_0x1010bc(0xbc),'body':{'appCode':_0x4ebba1[_0x1010bc(0x9b)],'sqlCode':_0x4ebba1[_0x1010bc(0xa4)](_0x1010bc(0xcc))||null,'sqlName':_0x4ebba1[_0x1010bc(0xa4)](_0x1010bc(0x97))||null,'files':_0x1f259f},'description':_0x1010bc(0xac)+_0x1f259f[_0x1010bc(0xba)]+_0x1010bc(0xbe)+_0x35ae97[_0x1010bc(0xad)]};},async 'execute'(_0x5a54c4){const _0x4b7661=a173_0x10c41d,_0x3da1aa=loadSqlProjectConfig(_0x5a54c4[_0x4b7661(0x9b)]),_0x3c41dc=await readSqlLockFile(_0x3da1aa[_0x4b7661(0xca)]),{lockData:_0xd5879f,appLock:_0x40e856}=ensureSqlLockScope(_0x3c41dc??createEmptySqlLock(),_0x3da1aa[_0x4b7661(0x9b)],_0x3da1aa[_0x4b7661(0xb9)],_0x4b7661(0x9a)),_0x3567dd=_0x5a54c4[_0x4b7661(0xce)](_0x4b7661(0xa2)),_0x40d435=await fetchAllSqlQueries(_0x5a54c4[_0x4b7661(0x9b)],{'sqlCode':_0x5a54c4[_0x4b7661(0xa4)](_0x4b7661(0xcc))||undefined,'sqlName':_0x5a54c4[_0x4b7661(0xa4)](_0x4b7661(0x97))||undefined});if(_0x40d435[_0x4b7661(0xba)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4b7661(0xc3)};const _0x531efc=[],_0x1d68ed=[];for(const _0x1a5efc of _0x40d435){try{_0x531efc[_0x4b7661(0xa3)](await ensureSqlContent(_0x1a5efc));}catch(_0x1610bf){_0x1d68ed[_0x4b7661(0xa3)]({'sqlCode':_0x1a5efc['sqlCode'],'error':_0x1610bf instanceof Error?_0x1610bf[_0x4b7661(0xa8)]:String(_0x1610bf)});}}if(_0x3567dd&&!_0x5a54c4[_0x4b7661(0xc2)]){let _0x1c549e=![];for(const _0x30bdaa of _0x531efc){const _0xf5db11=detectModeFromSql(_0x30bdaa),_0x460507=_0x30bdaa[_0x4b7661(0xc7)]?await getDbName(_0x5a54c4[_0x4b7661(0x9b)],Number(_0x30bdaa[_0x4b7661(0xc7)]))[_0x4b7661(0xb2)](()=>undefined):undefined,_0x59b93c=buildLocalSqlFileContent({'sqlCode':_0x30bdaa[_0x4b7661(0xc1)],'sqlName':_0x30bdaa['sqlName'],'dbId':_0x30bdaa[_0x4b7661(0xc7)]},ensureRemoteSqlContent(_0x30bdaa),{'dbName':_0x460507,'mode':_0xf5db11,'syncedAt':new Date()[_0x4b7661(0xb3)](),'description':_0x30bdaa[_0x4b7661(0xae)]}),_0x5eb53d=resolveLocalSqlFilePath(_0x3da1aa,_0x30bdaa[_0x4b7661(0xc1)],buildSqlLockEntry(_0x30bdaa,ensureRemoteSqlContent(_0x30bdaa),'',{'dbName':_0x460507}));if(await fileExists(_0x5eb53d)){const _0x18646d=await readFile(_0x5eb53d,_0x4b7661(0xaf));if(!isEquivalentPulledSqlFile(_0x18646d,_0x59b93c,_0xf5db11)){_0x1c549e=!![];break;}}}if(_0x1c549e){const _0x59ccdb=await confirmForceOverwrite(_0x4b7661(0xb0));if(!_0x59ccdb)throw CliErrors['cancelled'](_0x4b7661(0xb1));}}const _0x5cafce=cloneSqlLockData(_0xd5879f),_0x1cff1c=_0x5cafce['apps'][_0x3da1aa['appCode']],_0x2db5f2=[],_0x13c062=[];for(const _0x3900d0 of _0x531efc){const _0x3ed5c9=_0x1cff1c[_0x4b7661(0xaa)][_0x3900d0['sqlCode']],_0x2c2390=ensureRemoteSqlContent(_0x3900d0),_0x47de37=detectModeFromSql(_0x3900d0),_0x347741=_0x3900d0[_0x4b7661(0xc7)]?await getDbName(_0x5a54c4['appCode'],Number(_0x3900d0['dbId']))['catch'](()=>undefined):undefined,_0x3b5d7b=buildLocalSqlFileContent({'sqlCode':_0x3900d0[_0x4b7661(0xc1)],'sqlName':_0x3900d0[_0x4b7661(0xa6)],'dbId':_0x3900d0[_0x4b7661(0xc7)]},_0x2c2390,{'dbName':_0x347741,'mode':_0x47de37,'syncedAt':new Date()[_0x4b7661(0xb3)](),'description':_0x3900d0[_0x4b7661(0xae)]}),_0x2a97a4=buildSqlLockEntry(_0x3900d0,_0x2c2390,computeSqlContentHash(_0x3b5d7b),{'dbName':_0x347741}),_0x1820b2=_0x2a97a4['path'],_0x2f7593=join(_0x3da1aa[_0x4b7661(0xad)],_0x1820b2);try{if(await fileExists(_0x2f7593)){const _0x46f66b=await readFile(_0x2f7593,_0x4b7661(0xaf));if(isEquivalentPulledSqlFile(_0x46f66b,_0x3b5d7b,_0x47de37)){_0x13c062[_0x4b7661(0xa3)]({'sqlCode':_0x3900d0[_0x4b7661(0xc1)],'reason':_0x4b7661(0xb8)}),_0x1cff1c[_0x4b7661(0xaa)][_0x3900d0['sqlCode']]={..._0x2a97a4,'hash':computeSqlContentHash(_0x46f66b),'path':_0x1820b2};continue;}if(!_0x3567dd){_0x13c062[_0x4b7661(0xa3)]({'sqlCode':_0x3900d0[_0x4b7661(0xc1)],'reason':_0x4b7661(0xc4)});continue;}}const _0xf2a503=_0x3ed5c9?.[_0x4b7661(0x96)]?join(_0x3da1aa[_0x4b7661(0xad)],_0x3ed5c9[_0x4b7661(0x96)]):undefined;_0xf2a503&&_0xf2a503!==_0x2f7593&&await fileExists(_0xf2a503)&&await rm(_0xf2a503,{'force':!![]}),await ensureParentDirectory(_0x2f7593),await writeFile(_0x2f7593,_0x3b5d7b,'utf8'),_0x1cff1c[_0x4b7661(0xaa)][_0x3900d0[_0x4b7661(0xc1)]]={..._0x2a97a4,'path':_0x1820b2},_0x2db5f2[_0x4b7661(0xa3)]({'sqlCode':_0x3900d0['sqlCode'],'filePath':_0x2f7593});}catch(_0x452cb4){_0x1d68ed['push']({'sqlCode':_0x3900d0[_0x4b7661(0xc1)],'error':_0x452cb4 instanceof Error?_0x452cb4['message']:String(_0x452cb4)});}}return _0x1cff1c[_0x4b7661(0x99)]=new Date()[_0x4b7661(0xb3)](),await writeSqlLockFile(_0x3da1aa['lockFilePath'],_0x5cafce),{'ok':_0x1d68ed[_0x4b7661(0xba)]===0x0,'data':{'pulled':_0x2db5f2,'skipped':_0x13c062,'failed':_0x1d68ed},'message':_0x4b7661(0xc0)+_0x2db5f2[_0x4b7661(0xba)]+'\x20written,\x20'+_0x13c062[_0x4b7661(0xba)]+_0x4b7661(0xbf)+_0x1d68ed['length']+'\x20failed'};}};function detectModeFromSql(_0x534bb9){const _0x254cbe=a173_0x10c41d,_0x8d2ba9=ensureRemoteSqlContent(_0x534bb9),_0x54a67c=stripLocalSqlMetadata(_0x8d2ba9,_0x254cbe(0xcf))[_0x254cbe(0x9f)]();if(/^<(select|insert|update|delete)\b/i[_0x254cbe(0xbb)](_0x54a67c))return _0x254cbe(0xcf);return _0x254cbe(0xb4);}function isEquivalentPulledSqlFile(_0x28f633,_0x4e0507,_0x4813f){return normalizePullComparableContent(_0x28f633,_0x4813f)===normalizePullComparableContent(_0x4e0507,_0x4813f);}function normalizePullComparableContent(_0x3c7ed7,_0x42275d){const _0x469ec7=a173_0x10c41d,_0x43a2ee=_0x3c7ed7['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x388097=_0x43a2ee[_0x469ec7(0xc9)](_0x7fbde4=>!isSyncedAtMetadataLine(_0x7fbde4,_0x42275d));return _0x388097[_0x469ec7(0x9d)]('\x0a');}function isSyncedAtMetadataLine(_0x41a1e2,_0x5f4fcd){const _0x16a4a4=a173_0x10c41d;if(_0x5f4fcd===_0x16a4a4(0xcf))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x41a1e2);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x16a4a4(0xbb)](_0x41a1e2);}
|