@lovrabet/rabetbase-cli 2.5.2-beta.1 → 2.5.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.d.ts +2 -0
- package/lib/commands/deployment/sync-all.js +1 -0
- package/lib/commands/deployment/sync-jobs.d.ts +2 -0
- package/lib/commands/deployment/sync-jobs.js +1 -0
- package/lib/commands/deployment/sync-status.d.ts +2 -0
- package/lib/commands/deployment/sync-status.js +1 -0
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.d.ts +2 -0
- package/lib/commands/instant-api-policy/current.js +1 -0
- package/lib/commands/instant-api-policy/index.d.ts +2 -0
- package/lib/commands/instant-api-policy/index.js +1 -0
- package/lib/commands/instant-api-policy/init.d.ts +2 -0
- package/lib/commands/instant-api-policy/init.js +1 -0
- package/lib/commands/instant-api-policy/publish.d.ts +2 -0
- package/lib/commands/instant-api-policy/publish.js +1 -0
- package/lib/commands/instant-api-policy/pull.d.ts +2 -0
- package/lib/commands/instant-api-policy/pull.js +1 -0
- package/lib/commands/instant-api-policy/revision.d.ts +2 -0
- package/lib/commands/instant-api-policy/revision.js +1 -0
- package/lib/commands/instant-api-policy/revisions.d.ts +2 -0
- package/lib/commands/instant-api-policy/revisions.js +1 -0
- package/lib/commands/instant-api-policy/rollback.d.ts +2 -0
- package/lib/commands/instant-api-policy/rollback.js +1 -0
- package/lib/commands/instant-api-policy/shared.d.ts +82 -0
- package/lib/commands/instant-api-policy/shared.js +1 -0
- package/lib/commands/instant-api-policy/validate.d.ts +2 -0
- package/lib/commands/instant-api-policy/validate.js +1 -0
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +113 -0
- 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/instant-api-policy/config.d.ts +23 -0
- package/lib/core/instant-api-policy/config.js +1 -0
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +11 -5
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +41 -5
- package/skills/rabetbase/references/rabetbase-instant-api-policy.md +92 -0
- package/skills/rabetbase.manifest.json +4 -3
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a255_0x3cc7(_0x2d4575,_0x4c2cb3){_0x2d4575=_0x2d4575-0x136;const _0x1c1fbf=a255_0x1c1f();let _0x3cc7e6=_0x1c1fbf[_0x2d4575];return _0x3cc7e6;}(function(_0x3ab389,_0x440960){const _0x268307=a255_0x3cc7,_0x13485d=_0x3ab389();while(!![]){try{const _0x56a1c4=-parseInt(_0x268307(0x144))/0x1+-parseInt(_0x268307(0x154))/0x2*(-parseInt(_0x268307(0x152))/0x3)+parseInt(_0x268307(0x14a))/0x4*(parseInt(_0x268307(0x13c))/0x5)+-parseInt(_0x268307(0x13f))/0x6*(-parseInt(_0x268307(0x150))/0x7)+-parseInt(_0x268307(0x13e))/0x8+-parseInt(_0x268307(0x139))/0x9+-parseInt(_0x268307(0x14e))/0xa*(-parseInt(_0x268307(0x14f))/0xb);if(_0x56a1c4===_0x440960)break;else _0x13485d['push'](_0x13485d['shift']());}catch(_0x371fa7){_0x13485d['push'](_0x13485d['shift']());}}}(a255_0x1c1f,0x513a3));function a255_0x1c1f(){const _0x46470d=['2lROilM','toLowerCase','find','set','includes','5598063RVXeOC','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','db-','505NLXXnJ','No\x20database\x20matching\x20\x22','358744UCvFfz','354ZpWQNA','has','\x22\x20matches\x20multiple\x20databases:\x20','dbId','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','311471VdVcbV','entries','isNaN','length','dbName','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','4072cDJcAm','map','\x22\x20under\x20app\x20\x22','get','333540KPkRPZ','176VwhreM','64729xHPKYy','dbtableConfig','386919qUHCJg','join'];a255_0x1c1f=function(){return _0x46470d;};return a255_0x1c1f();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x4b527c){const _0x4e47bf=a255_0x3cc7;if(cache[_0x4e47bf(0x140)](_0x4b527c))return cache[_0x4e47bf(0x14d)](_0x4b527c);const _0x394648=await listDatasets(_0x4b527c),_0x4aaa41=new Map();for(const _0x446f68 of _0x394648){const _0x9184dd=_0x446f68[_0x4e47bf(0x151)];_0x9184dd?.[_0x4e47bf(0x142)]!=null&&_0x4aaa41['set'](_0x9184dd[_0x4e47bf(0x142)],_0x9184dd[_0x4e47bf(0x148)]??_0x4e47bf(0x13b)+_0x9184dd['dbId']);}const _0x3637c7=[..._0x4aaa41[_0x4e47bf(0x145)]()]['map'](([_0xa4e445,_0xd5aeea])=>({'dbId':_0xa4e445,'dbName':_0xd5aeea}));return cache[_0x4e47bf(0x137)](_0x4b527c,_0x3637c7),_0x3637c7;}export async function resolveDb(_0x2780b3,_0x1e3ebe){const _0x6caf76=a255_0x3cc7,_0x2df2a2=await listDatabases(_0x2780b3);if(_0x2df2a2['length']===0x0)return{'resolved':[],'error':_0x6caf76(0x149)+_0x2780b3+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x1e3ebe)return{'resolved':_0x2df2a2};const _0x325730=Number(_0x1e3ebe);if(!Number[_0x6caf76(0x146)](_0x325730)){const _0x14aeea=_0x2df2a2[_0x6caf76(0x136)](_0x487fb3=>_0x487fb3['dbId']===_0x325730);if(_0x14aeea)return{'resolved':[_0x14aeea]};}const _0x4bc014=_0x1e3ebe[_0x6caf76(0x155)](),_0x4eb115=_0x2df2a2['filter'](_0x2810b2=>_0x2810b2[_0x6caf76(0x148)]['toLowerCase']()[_0x6caf76(0x138)](_0x4bc014));if(_0x4eb115['length']>0x0)return{'resolved':_0x4eb115};const _0x1d07ec=_0x2df2a2[_0x6caf76(0x14b)](_0x4ad74c=>_0x4ad74c[_0x6caf76(0x148)]+'\x20('+_0x4ad74c['dbId']+')')[_0x6caf76(0x153)](',\x20');return{'resolved':[],'error':_0x6caf76(0x13d)+_0x1e3ebe+_0x6caf76(0x14c)+_0x2780b3+'\x22.\x20Available:\x20'+_0x1d07ec+_0x6caf76(0x13a)};}export async function resolveOneDb(_0x2a7e45,_0x1baad8){const _0x59d441=a255_0x3cc7,{resolved:_0x53fb9b,error:_0x1fe5b0}=await resolveDb(_0x2a7e45,_0x1baad8);if(_0x1fe5b0)return{'db':null,'error':_0x1fe5b0};if(_0x53fb9b[_0x59d441(0x147)]===0x1)return{'db':_0x53fb9b[0x0]};if(!_0x1baad8){const _0x1422cd=_0x53fb9b[_0x59d441(0x14b)](_0x3c48d7=>_0x3c48d7['dbName']+'\x20('+_0x3c48d7[_0x59d441(0x142)]+')')[_0x59d441(0x153)](',\x20');return{'db':null,'error':_0x59d441(0x143)+_0x1422cd};}const _0x1188ab=_0x53fb9b[_0x59d441(0x14b)](_0x181756=>_0x181756['dbName']+'\x20('+_0x181756['dbId']+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x1baad8+_0x59d441(0x141)+_0x1188ab+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x8db94a,_0xce1328){const _0x190e04=a255_0x3cc7,_0x419b65=await listDatabases(_0x8db94a);return _0x419b65[_0x190e04(0x136)](_0xb2bf84=>_0xb2bf84[_0x190e04(0x142)]===_0xce1328)?.['dbName'];}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { InstantApiPolicyConfig } from "../../core/api-client.js";
|
|
2
|
+
import { CliError } from "../../errors.js";
|
|
3
|
+
export declare const INSTANT_API_POLICY_RELATIVE_ROOT = ".rabetbase/instant-api-policy";
|
|
4
|
+
export declare const INSTANT_API_POLICY_FILE_NAME = "policy.json";
|
|
5
|
+
export declare const MAX_INSTANT_API_POLICY_BYTES: number;
|
|
6
|
+
export interface InstantApiPolicyLocalConfig {
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
appCode: string;
|
|
9
|
+
policyRoot: string;
|
|
10
|
+
policyFilePath: string;
|
|
11
|
+
policyRelativePath: string;
|
|
12
|
+
}
|
|
13
|
+
export interface InstantApiPolicyWriteResult {
|
|
14
|
+
action: "created" | "overwritten" | "unchanged";
|
|
15
|
+
filePath: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function instantApiPolicyError(code: string, message: string, hint?: string): CliError;
|
|
18
|
+
export declare function loadInstantApiPolicyLocalConfig(appCode: string, projectRoot?: string): InstantApiPolicyLocalConfig;
|
|
19
|
+
export declare function createDefaultInstantApiPolicyConfig(appCode: string, defaultAction?: "allow" | "deny"): InstantApiPolicyConfig;
|
|
20
|
+
export declare function readInstantApiPolicyConfigFile(local: InstantApiPolicyLocalConfig): Promise<InstantApiPolicyConfig>;
|
|
21
|
+
export declare function writeInstantApiPolicyConfigFile(local: InstantApiPolicyLocalConfig, config: InstantApiPolicyConfig, options?: {
|
|
22
|
+
force?: boolean;
|
|
23
|
+
}): Promise<InstantApiPolicyWriteResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a256_0x16db47=a256_0x2b64;(function(_0x54d29e,_0x51c2f4){const _0x81bb80=a256_0x2b64,_0x82699=_0x54d29e();while(!![]){try{const _0x318fd0=-parseInt(_0x81bb80(0x179))/0x1*(-parseInt(_0x81bb80(0x168))/0x2)+parseInt(_0x81bb80(0x194))/0x3*(-parseInt(_0x81bb80(0x195))/0x4)+-parseInt(_0x81bb80(0x199))/0x5+parseInt(_0x81bb80(0x175))/0x6*(parseInt(_0x81bb80(0x173))/0x7)+parseInt(_0x81bb80(0x17f))/0x8*(-parseInt(_0x81bb80(0x177))/0x9)+-parseInt(_0x81bb80(0x17c))/0xa*(-parseInt(_0x81bb80(0x172))/0xb)+-parseInt(_0x81bb80(0x1a0))/0xc*(-parseInt(_0x81bb80(0x164))/0xd);if(_0x318fd0===_0x51c2f4)break;else _0x82699['push'](_0x82699['shift']());}catch(_0x5725c0){_0x82699['push'](_0x82699['shift']());}}}(a256_0x549c,0x56988));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT='.rabetbase/instant-api-policy';export const INSTANT_API_POLICY_FILE_NAME=a256_0x16db47(0x16f);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x51bc59,_0x39a19b,_0x21cc6d){return new CliError(_0x51bc59,0x1,_0x39a19b,_0x21cc6d);}export function loadInstantApiPolicyLocalConfig(_0x197e75,_0x3f7b4f){assertSafeAppCode(_0x197e75);const _0x5cb58e=resolve(_0x3f7b4f??findProjectRootDirectory()),_0x326bc4=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x197e75+'/'+INSTANT_API_POLICY_FILE_NAME,_0xd2473b=resolve(_0x5cb58e,INSTANT_API_POLICY_RELATIVE_ROOT,_0x197e75),_0x3d1cf8=resolve(_0xd2473b,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5cb58e,'appCode':_0x197e75,'policyRoot':_0xd2473b,'policyFilePath':_0x3d1cf8,'policyRelativePath':_0x326bc4};}export function createDefaultInstantApiPolicyConfig(_0x16dfc2,_0x4c0f12=a256_0x16db47(0x190)){return assertSafeAppCode(_0x16dfc2),{'version':'1','appCode':_0x16dfc2,'defaults':{'instantApi':_0x4c0f12},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x135c58){const _0x2b772a=a256_0x16db47;let _0x1406ae;try{_0x1406ae=await stat(_0x135c58[_0x2b772a(0x15c)]);}catch(_0x3acbd3){throw instantApiPolicyError(_0x2b772a(0x178),_0x2b772a(0x180)+_0x135c58[_0x2b772a(0x15c)],'Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.');}if(!_0x1406ae[_0x2b772a(0x189)]())throw instantApiPolicyError(_0x2b772a(0x18c),_0x2b772a(0x15e)+_0x135c58[_0x2b772a(0x15c)]);if(_0x1406ae[_0x2b772a(0x182)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2b772a(0x17b));let _0x50c5df;try{_0x50c5df=await readFile(_0x135c58[_0x2b772a(0x15c)]);}catch{throw instantApiPolicyError(_0x2b772a(0x17d),_0x2b772a(0x16d)+_0x135c58['policyFilePath']);}if(_0x50c5df[_0x2b772a(0x188)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2b772a(0x192),_0x2b772a(0x17b));let _0x443298;try{_0x443298=new TextDecoder(_0x2b772a(0x167),{'fatal':!![],'ignoreBOM':!![]})[_0x2b772a(0x19e)](_0x50c5df);}catch{throw instantApiPolicyError(_0x2b772a(0x18c),_0x2b772a(0x161)+_0x135c58['policyFilePath']);}let _0x3d2398;try{_0x3d2398=JSON[_0x2b772a(0x162)](_0x443298);}catch{throw instantApiPolicyError(_0x2b772a(0x1a1),_0x2b772a(0x160)+_0x135c58['policyFilePath']);}return assertLocalPolicyContract(_0x3d2398,_0x135c58[_0x2b772a(0x15f)]);}function a256_0x2b64(_0x534e9b,_0x21ec43){_0x534e9b=_0x534e9b-0x15c;const _0x549c69=a256_0x549c();let _0x2b6463=_0x549c69[_0x534e9b];return _0x2b6463;}export async function writeInstantApiPolicyConfigFile(_0x51f50f,_0x2c7c29,_0x1d7360={}){const _0x1be947=a256_0x16db47,_0x1128cf=assertLocalPolicyContract(_0x2c7c29,_0x51f50f['appCode']),_0x24f3a0=JSON[_0x1be947(0x18b)](_0x1128cf,null,0x2)+'\x0a';if(Buffer[_0x1be947(0x188)](_0x24f3a0,'utf8')>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1be947(0x192),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x51f50f[_0x1be947(0x169)],{'recursive':!![]});let _0x4f9235;try{_0x4f9235=await readFile(_0x51f50f[_0x1be947(0x15c)],'utf8');}catch(_0x31a9f9){if(!isMissingFile(_0x31a9f9))throw instantApiPolicyError(_0x1be947(0x17d),_0x1be947(0x16e)+_0x51f50f['policyFilePath']);}if(_0x4f9235===_0x24f3a0)return{'action':_0x1be947(0x185),'filePath':_0x51f50f['policyFilePath']};if(_0x4f9235!==undefined&&!_0x1d7360['force'])throw instantApiPolicyError(_0x1be947(0x171),_0x1be947(0x196)+_0x51f50f[_0x1be947(0x15c)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x4f9235===undefined)try{return await writeFile(_0x51f50f[_0x1be947(0x15c)],_0x24f3a0,{'encoding':'utf8','flag':'wx'}),{'action':_0x1be947(0x18e),'filePath':_0x51f50f['policyFilePath']};}catch(_0x172b62){if(!isAlreadyExists(_0x172b62))throw instantApiPolicyError(_0x1be947(0x176),_0x1be947(0x183)+_0x51f50f[_0x1be947(0x15c)]);if(!_0x1d7360[_0x1be947(0x17a)])throw instantApiPolicyError(_0x1be947(0x171),_0x1be947(0x16a)+_0x51f50f[_0x1be947(0x15c)],_0x1be947(0x18d));}const _0x68ac=resolve(dirname(_0x51f50f[_0x1be947(0x15c)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x1be947(0x165)]+'.'+randomUUID()+'.tmp');try{await writeFile(_0x68ac,_0x24f3a0,{'encoding':_0x1be947(0x18f),'flag':'wx'}),await rename(_0x68ac,_0x51f50f[_0x1be947(0x15c)]);}catch{await unlink(_0x68ac)['catch'](()=>undefined);throw instantApiPolicyError(_0x1be947(0x176),_0x1be947(0x184)+_0x51f50f['policyFilePath']);}return{'action':_0x1be947(0x193),'filePath':_0x51f50f[_0x1be947(0x15c)]};}function assertSafeAppCode(_0x5998f3){const _0xbe1a20=a256_0x16db47,_0x44b8d4=_0x5998f3[_0xbe1a20(0x163)]();if(!_0x44b8d4||_0x44b8d4!==_0x5998f3||_0x44b8d4[_0xbe1a20(0x198)]>0x64||_0x44b8d4==='.'||_0x44b8d4==='..'||_0x44b8d4[_0xbe1a20(0x16b)]('/')||_0x44b8d4[_0xbe1a20(0x16b)]('\x5c')||_0x44b8d4[_0xbe1a20(0x16b)]('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0xbe1a20(0x19d));}function assertLocalPolicyContract(_0x3637f2,_0x3fefe8){const _0x545c8e=a256_0x16db47;if(!isObject(_0x3637f2))throw instantApiPolicyError(_0x545c8e(0x1a1),'Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.');if(_0x3637f2[_0x545c8e(0x18a)]!=='1')throw instantApiPolicyError(_0x545c8e(0x197),_0x545c8e(0x16c),_0x545c8e(0x17e));if(_0x3637f2['appCode']!==_0x3fefe8)throw instantApiPolicyError(_0x545c8e(0x166),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x3fefe8+'.');if(!isObject(_0x3637f2[_0x545c8e(0x181)])||typeof _0x3637f2['defaults'][_0x545c8e(0x19a)]!==_0x545c8e(0x174))throw instantApiPolicyError(_0x545c8e(0x186),_0x545c8e(0x187));if(_0x3637f2[_0x545c8e(0x19c)]!==undefined&&_0x3637f2[_0x545c8e(0x19c)]!==null&&!Array[_0x545c8e(0x15d)](_0x3637f2[_0x545c8e(0x19c)]))throw instantApiPolicyError('instant_api_policy_rules_invalid',_0x545c8e(0x19b));return _0x3637f2;}function isObject(_0x2ebb30){const _0x333086=a256_0x16db47;return _0x2ebb30!==null&&typeof _0x2ebb30===_0x333086(0x170)&&!Array['isArray'](_0x2ebb30);}function isMissingFile(_0x31b55d){const _0x23238a=a256_0x16db47;return Boolean(_0x31b55d&&typeof _0x31b55d==='object'&&_0x31b55d[_0x23238a(0x191)]===_0x23238a(0x19f));}function isAlreadyExists(_0x49b2c8){const _0x238b0c=a256_0x16db47;return Boolean(_0x49b2c8&&typeof _0x49b2c8===_0x238b0c(0x170)&&_0x49b2c8[_0x238b0c(0x191)]==='EEXIST');}function a256_0x549c(){const _0x1906c6=['policyRoot','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','includes','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','policy.json','object','instant_api_policy_file_exists','32153WSeuAF','110054DBseVh','string','18jkOxNi','instant_api_policy_file_unwritable','9iicTHR','instant_api_policy_file_missing','180106rRSXNm','force','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','1380PudVti','instant_api_policy_file_unreadable','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','5044808KEMiiN','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','defaults','size','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','unchanged','instant_api_policy_defaults_invalid','Policy\x20defaults.instantApi\x20is\x20required.','byteLength','isFile','version','stringify','instant_api_policy_file_invalid','Review\x20the\x20file\x20before\x20retrying.','created','utf8','allow','code','instant_api_policy_file_too_large','overwritten','6GCQuPy','236140ulCUBY','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','instant_api_policy_version_invalid','length','1530980pvcfma','instantApi','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','rules','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','decode','ENOENT','3372LwUjtk','instant_api_policy_json_invalid','policyFilePath','isArray','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','appCode','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','parse','trim','27703BTjbFT','pid','instant_api_policy_app_code_mismatch','utf-8','4XrsUCa'];a256_0x549c=function(){return _0x1906c6;};return a256_0x549c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a257_0x5eeb75=a257_0xad3d;(function(_0x2f7897,_0x2bcdd4){const _0x216267=a257_0xad3d,_0x205e75=_0x2f7897();while(!![]){try{const _0x2fa26c=-parseInt(_0x216267(0x21a))/0x1+-parseInt(_0x216267(0x1ec))/0x2*(-parseInt(_0x216267(0x217))/0x3)+-parseInt(_0x216267(0x207))/0x4+-parseInt(_0x216267(0x218))/0x5*(-parseInt(_0x216267(0x1ee))/0x6)+parseInt(_0x216267(0x1f9))/0x7+parseInt(_0x216267(0x222))/0x8+parseInt(_0x216267(0x20f))/0x9*(-parseInt(_0x216267(0x210))/0xa);if(_0x2fa26c===_0x2bcdd4)break;else _0x205e75['push'](_0x205e75['shift']());}catch(_0x26d7e5){_0x205e75['push'](_0x205e75['shift']());}}}(a257_0x4073,0x8fddf));function a257_0xad3d(_0x27f2bf,_0x57de86){_0x27f2bf=_0x27f2bf-0x1e5;const _0x40735b=a257_0x4073();let _0xad3d5b=_0x40735b[_0x27f2bf];return _0xad3d5b;}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion','profile',a257_0x5eeb75(0x1fc),a257_0x5eeb75(0x201),a257_0x5eeb75(0x206),a257_0x5eeb75(0x208)],HIT_KEYS=[a257_0x5eeb75(0x20a),a257_0x5eeb75(0x215),a257_0x5eeb75(0x1f1),a257_0x5eeb75(0x202),a257_0x5eeb75(0x20d),'text',a257_0x5eeb75(0x205),a257_0x5eeb75(0x1f4),'rawScore',a257_0x5eeb75(0x216),a257_0x5eeb75(0x1ed)];export async function searchDevelopmentKnowledge(_0x706c42){const _0xb14b81=a257_0x5eeb75,_0x29c3f6=_0x706c42[_0xb14b81(0x1fa)]['trim'](),_0x62285c=_0x706c42[_0xb14b81(0x1ef)][_0xb14b81(0x20b)]();if(!_0x29c3f6)throw CliErrors[_0xb14b81(0x21e)](_0xb14b81(0x230));if(!_0x706c42['cookie'][_0xb14b81(0x20b)]())throw CliErrors[_0xb14b81(0x204)]();if(!_0x62285c)throw CliErrors['validation']('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x706c42[_0xb14b81(0x200)]);const _0x3da50d=getKbDomain()+'/smartapi/knowledge/company-public/search';let _0x2a7a70;try{_0x2a7a70=await fetch(_0x3da50d,{'method':_0xb14b81(0x221),'headers':{'Content-Type':_0xb14b81(0x1fe),'Cookie':_0x706c42[_0xb14b81(0x203)],'X-Invoke-Source':_0xb14b81(0x22e)},'body':JSON['stringify']({'appCode':_0x29c3f6,'query':_0x62285c,..._0x706c42[_0xb14b81(0x200)]!==undefined?{'topK':_0x706c42[_0xb14b81(0x200)]}:{}}),'signal':_0x706c42[_0xb14b81(0x20c)]});}catch(_0x8677fd){if(_0x8677fd instanceof CliError)throw _0x8677fd;if(_0x8677fd instanceof Error&&_0x8677fd['name']==='AbortError')throw _0x8677fd;throw CliErrors[_0xb14b81(0x212)](_0xb14b81(0x21d));}if(!hasNoStore(_0x2a7a70[_0xb14b81(0x228)]))throw CliErrors[_0xb14b81(0x1fd)](_0xb14b81(0x226));if(_0x2a7a70[_0xb14b81(0x225)]===0x191)throw CliErrors[_0xb14b81(0x204)]();if(!_0x2a7a70['ok'])throw CliErrors[_0xb14b81(0x1fd)]('SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20'+_0x2a7a70[_0xb14b81(0x225)]+').');if(!(_0x2a7a70['headers'][_0xb14b81(0x227)](_0xb14b81(0x1f6))??'')[_0xb14b81(0x1e7)]()[_0xb14b81(0x224)](_0xb14b81(0x1fe)))throw CliErrors[_0xb14b81(0x1fd)](_0xb14b81(0x1ff));let _0x1222aa;try{_0x1222aa=await _0x2a7a70[_0xb14b81(0x229)]();}catch{throw CliErrors[_0xb14b81(0x1fd)](_0xb14b81(0x1f8));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x1222aa),_0x706c42[_0xb14b81(0x200)]);}function readEnvelopeData(_0x45652e){const _0x38c3dd=a257_0x5eeb75,_0x50e50f=requireRecord(_0x45652e,_0x38c3dd(0x223));if(_0x50e50f['success']===![])throw CliErrors[_0x38c3dd(0x1fd)](_0x38c3dd(0x1f0));if(!(_0x38c3dd(0x20e)in _0x50e50f))throw invalidContract(_0x38c3dd(0x223));return _0x50e50f[_0x38c3dd(0x20e)];}function validateTopK(_0x43adfd){const _0x4f8525=a257_0x5eeb75;if(_0x43adfd!==undefined&&(!Number[_0x4f8525(0x21c)](_0x43adfd)||_0x43adfd<0x1||_0x43adfd>0x32))throw CliErrors[_0x4f8525(0x21e)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x8c91e7){const _0x385aaa=a257_0x5eeb75;return(_0x8c91e7['get'](_0x385aaa(0x1eb))??'')['split'](',')['some'](_0x153594=>_0x153594['trim']()[_0x385aaa(0x1e7)]()===_0x385aaa(0x1ea));}function parseDevelopmentSearchResponse(_0x1d284d,_0xeaba53){const _0x1a5007=a257_0x5eeb75,_0xfc1e91=requireExactRecord(_0x1d284d,RESPONSE_KEYS,_0x1a5007(0x211));if(_0xfc1e91[_0x1a5007(0x209)]!==0x2||_0xfc1e91['profile']!=='development')throw invalidContract(_0x1a5007(0x1f7));if(!Array[_0x1a5007(0x1f2)](_0xfc1e91[_0x1a5007(0x201)])||_0xfc1e91[_0x1a5007(0x201)]['length']>(_0xeaba53??0x32))throw invalidContract('hits');if(typeof _0xfc1e91[_0x1a5007(0x206)]!==_0x1a5007(0x220)||!/^sha256:[0-9a-f]{64}$/[_0x1a5007(0x1fb)](_0xfc1e91[_0x1a5007(0x206)]))throw invalidContract('strategyFingerprint');const _0x1a09ec=requireRecord(_0xfc1e91[_0x1a5007(0x208)],'timingsMs'),_0x67fe02={};for(const [_0x276498,_0x11a615]of Object['entries'](_0x1a09ec)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x1a5007(0x1fb)](_0x276498)||typeof _0x11a615!=='number'||!Number[_0x1a5007(0x1e8)](_0x11a615)||_0x11a615<0x0)throw invalidContract('timingsMs');_0x67fe02[_0x276498]=_0x11a615;}const _0x2185b4=_0xfc1e91[_0x1a5007(0x201)][_0x1a5007(0x21b)]((_0x2609d5,_0x998c4b)=>parseHit(_0x2609d5,_0x998c4b));if(!Number[_0x1a5007(0x21c)](_0xfc1e91[_0x1a5007(0x1fc)])||_0xfc1e91['total']!==_0x2185b4[_0x1a5007(0x1e9)])throw invalidContract('total');return{'schemaVersion':_0xfc1e91[_0x1a5007(0x209)],'profile':_0xfc1e91[_0x1a5007(0x1f7)],'total':_0xfc1e91[_0x1a5007(0x1fc)],'strategyFingerprint':_0xfc1e91['strategyFingerprint'],'timingsMs':_0x67fe02,'hits':_0x2185b4};}function parseHit(_0x28d0a6,_0x530faf){const _0x19dff0=a257_0x5eeb75,_0x10a991=requireExactRecord(_0x28d0a6,HIT_KEYS,_0x19dff0(0x22b)+_0x530faf+']'),_0x12a947=_0x579e51=>{const _0x1a20e8=_0x19dff0,_0x152f88=_0x10a991[_0x579e51];if(typeof _0x152f88!==_0x1a20e8(0x220)||!_0x152f88)throw invalidContract(_0x579e51);return _0x152f88;};if(!Number[_0x19dff0(0x21c)](_0x10a991['revision'])||_0x10a991[_0x19dff0(0x215)]<0x1)throw invalidContract(_0x19dff0(0x215));if(_0x10a991[_0x19dff0(0x202)]!==_0x19dff0(0x1e5)&&_0x10a991['scope']!==_0x19dff0(0x1e6))throw invalidContract(_0x19dff0(0x202));if(typeof _0x10a991[_0x19dff0(0x20d)]!=='string'||typeof _0x10a991[_0x19dff0(0x214)]!==_0x19dff0(0x220))throw invalidContract('text');if(!Array[_0x19dff0(0x1f2)](_0x10a991[_0x19dff0(0x205)])||_0x10a991[_0x19dff0(0x205)][_0x19dff0(0x22c)](_0x1fdb31=>typeof _0x1fdb31!==_0x19dff0(0x220)))throw invalidContract(_0x19dff0(0x205));if(!Number[_0x19dff0(0x21c)](_0x10a991['rank'])||_0x10a991[_0x19dff0(0x1f4)]!==_0x530faf+0x1)throw invalidContract('rank');if(!isFiniteNumber(_0x10a991[_0x19dff0(0x22a)])||!isFiniteNumber(_0x10a991[_0x19dff0(0x216)]))throw invalidContract(_0x19dff0(0x22f));return{'documentId':_0x12a947(_0x19dff0(0x20a)),'revision':_0x10a991[_0x19dff0(0x215)],'chunkId':_0x12a947(_0x19dff0(0x1f1)),'scope':_0x10a991['scope'],'title':_0x10a991['title'],'text':_0x10a991[_0x19dff0(0x214)],'tags':[..._0x10a991[_0x19dff0(0x205)]],'rank':_0x10a991[_0x19dff0(0x1f4)],'rawScore':_0x10a991[_0x19dff0(0x22a)],'finalScore':_0x10a991[_0x19dff0(0x216)],'scoreKind':_0x12a947(_0x19dff0(0x1ed))};}function requireExactRecord(_0x4bad42,_0x5159c4,_0x57d2b6){const _0xce926c=a257_0x5eeb75,_0x2b7e6a=requireRecord(_0x4bad42,_0x57d2b6),_0x3eee85=Object[_0xce926c(0x219)](_0x2b7e6a)['sort'](),_0x230bea=[..._0x5159c4][_0xce926c(0x1f3)]();if(_0x3eee85['length']!==_0x230bea['length']||_0x3eee85['some']((_0x506c48,_0x3c0135)=>_0x506c48!==_0x230bea[_0x3c0135]))throw invalidContract(_0x57d2b6);return _0x2b7e6a;}function requireRecord(_0x4dfa58,_0x2adfad){const _0x285a6f=a257_0x5eeb75;if(!_0x4dfa58||typeof _0x4dfa58!==_0x285a6f(0x213)||Array[_0x285a6f(0x1f2)](_0x4dfa58))throw invalidContract(_0x2adfad);return _0x4dfa58;}function a257_0x4073(){const _0x4bfd09=['chunkId','isArray','sort','rank','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','content-type','profile','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','7273014PDWiHO','appCode','test','total','apiError','application/json','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','topK','hits','scope','cookie','authRequired','tags','strategyFingerprint','1333304briUHA','timingsMs','schemaVersion','documentId','trim','signal','title','data','9jwxymd','13872380HJnZTM','response','networkError','object','text','revision','finalScore','18ZWWYQr','539605PzbvQD','keys','729655vYGnGp','map','isSafeInteger','SmartCode\x20knowledge\x20search\x20request\x20failed.','validation','number','string','POST','7110776mZdmEx','response\x20envelope','includes','status','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','get','headers','json','rawScore','hits[','some','\x20contract.','cli:rabetbase','score','Knowledge\x20search\x20appCode\x20is\x20required.','public','company','toLowerCase','isFinite','length','no-store','cache-control','334576HVTqEc','scoreKind','6PzjdgW','query','SmartCode\x20knowledge\x20search\x20failed.'];a257_0x4073=function(){return _0x4bfd09;};return a257_0x4073();}function isFiniteNumber(_0x33d45e){const _0x5b68f6=a257_0x5eeb75;return typeof _0x33d45e===_0x5b68f6(0x21f)&&Number[_0x5b68f6(0x1e8)](_0x33d45e);}function invalidContract(_0x23eda4){const _0x3b8b8a=a257_0x5eeb75;return CliErrors['apiError'](_0x3b8b8a(0x1f5)+_0x23eda4+_0x3b8b8a(0x22d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a258_0x2e6fbf=a258_0x67b9;(function(_0xd50c2c,_0x152de5){const _0x4e085c=a258_0x67b9,_0x3f7cab=_0xd50c2c();while(!![]){try{const _0x3befec=parseInt(_0x4e085c(0x1b3))/0x1+parseInt(_0x4e085c(0x1b1))/0x2+parseInt(_0x4e085c(0x1b8))/0x3+parseInt(_0x4e085c(0x1b2))/0x4+parseInt(_0x4e085c(0x1af))/0x5+parseInt(_0x4e085c(0x1bc))/0x6*(-parseInt(_0x4e085c(0x1b7))/0x7)+-parseInt(_0x4e085c(0x1b9))/0x8;if(_0x3befec===_0x152de5)break;else _0x3f7cab['push'](_0x3f7cab['shift']());}catch(_0x1d140b){_0x3f7cab['push'](_0x3f7cab['shift']());}}}(a258_0xadfa,0x2b5fe));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x159298,_0x324306=process[a258_0x2e6fbf(0x1b6)]()){const _0x2fb401=a258_0x2e6fbf,_0x2f49f0=resolve(_0x324306),_0x4588c9=join(_0x2f49f0,_0x2fb401(0x1ba),_0x2fb401(0x1b5));return{'projectRoot':_0x2f49f0,'pagesBaseDir':_0x4588c9,'appPagesDir':join(_0x4588c9,_0x159298),'lockFilePath':join(_0x2f49f0,_0x2fb401(0x1ba),'page.lock.json')};}export function buildPageFileName(_0x5efd12,_0x4478ca){const _0x5acdcb=a258_0x2e6fbf;return _0x5efd12+'-'+String(_0x4478ca)[_0x5acdcb(0x1b0)]()+_0x5acdcb(0x1bb);}export function resolvePageFilePath(_0x4ab53f,_0x9dbd9e,_0xed8c){return join(_0x4ab53f['appPagesDir'],buildPageFileName(_0x9dbd9e,_0xed8c));}export async function ensureParentDirectory(_0x47a3e6){await mkdir(dirname(_0x47a3e6),{'recursive':!![]});}function a258_0x67b9(_0x147a2a,_0x41762f){_0x147a2a=_0x147a2a-0x1af;const _0xadfab2=a258_0xadfa();let _0x67b9af=_0xadfab2[_0x147a2a];return _0x67b9af;}export async function fileExists(_0x34476){const _0x2d10b8=a258_0x2e6fbf;try{return await access(_0x34476,constants[_0x2d10b8(0x1b4)]),!![];}catch{return![];}}function a258_0xadfa(){const _0x404ade=['79702DvEfnx','714855cAhWKf','9072608AXsMak','.rabetbase','.json','18xoVHsZ','1226690UWPxWF','toUpperCase','701742etGFUC','1235036rZGmHB','202643qUzSIJ','F_OK','page','cwd'];a258_0xadfa=function(){return _0x404ade;};return a258_0xadfa();}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26ddbb,_0xc1a51d){const _0x7ffde0=a259_0x4084,_0x46ad25=_0x26ddbb();while(!![]){try{const _0x411197=parseInt(_0x7ffde0(0x1d3))/0x1+-parseInt(_0x7ffde0(0x1c8))/0x2*(-parseInt(_0x7ffde0(0x1cf))/0x3)+-parseInt(_0x7ffde0(0x1d2))/0x4*(-parseInt(_0x7ffde0(0x1ce))/0x5)+-parseInt(_0x7ffde0(0x1d0))/0x6+parseInt(_0x7ffde0(0x1d1))/0x7+-parseInt(_0x7ffde0(0x1c9))/0x8*(-parseInt(_0x7ffde0(0x1d6))/0x9)+parseInt(_0x7ffde0(0x1d5))/0xa*(-parseInt(_0x7ffde0(0x1cc))/0xb);if(_0x411197===_0xc1a51d)break;else _0x46ad25['push'](_0x46ad25['shift']());}catch(_0x4e52b9){_0x46ad25['push'](_0x46ad25['shift']());}}}(a259_0x43eb,0x9c470));import a259_0x577c43 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x59dc5b){const _0x49dc65=a259_0x4084;return JSON[_0x49dc65(0x1d4)](JSON['parse'](_0x59dc5b),null,0x2)+'\x0a';}function a259_0x4084(_0x1fc126,_0xb01e2f){_0x1fc126=_0x1fc126-0x1c7;const _0x43eb92=a259_0x43eb();let _0x408445=_0x43eb92[_0x1fc126];return _0x408445;}export function computePageContentHash(_0x3e29f8){const _0x46f036=a259_0x4084;return a259_0x577c43['createHash'](_0x46f036(0x1cd))[_0x46f036(0x1d7)](_0x3e29f8)[_0x46f036(0x1c7)](_0x46f036(0x1ca));}export function computeSerializedSchemaHash(_0x15812b){return computePageContentHash(serializePageSchemaForFile(_0x15812b));}function a259_0x43eb(){const _0x566b75=['hex','utf8','11010857gwQAyX','md5','515jQkWHw','449238OvedhX','2519274kVNECb','4364262WjYown','1168UhZbyX','170543AqlDIj','stringify','20mQJzvV','27207wqpYvk','update','digest','16gknvIa','2752yhEcGm'];a259_0x43eb=function(){return _0x566b75;};return a259_0x43eb();}export async function computePageFileHash(_0x2c20a){const _0x186c48=a259_0x4084,_0x5786e5=await readFile(_0x2c20a,_0x186c48(0x1cb));return computePageContentHash(_0x5786e5);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a260_0x506a(){const _0x1de193=['4310586eVTGZv','1wgeMrb','5415730wePQNy','stringify','code','32361530JWukUD','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','4731930YCytUx','1881934YOLFVD','236hSBfKW','45102cYncLb','object','ENOENT','6454861myPPey','pages','apps','lastSync','8lXZrPD','utf8'];a260_0x506a=function(){return _0x1de193;};return a260_0x506a();}(function(_0x1fe069,_0x221953){const _0x1e8a87=a260_0x3de0,_0x36ba1a=_0x1fe069();while(!![]){try{const _0x27dd5d=parseInt(_0x1e8a87(0x188))/0x1*(-parseInt(_0x1e8a87(0x18f))/0x2)+-parseInt(_0x1e8a87(0x191))/0x3*(parseInt(_0x1e8a87(0x190))/0x4)+-parseInt(_0x1e8a87(0x189))/0x5+-parseInt(_0x1e8a87(0x18e))/0x6+-parseInt(_0x1e8a87(0x194))/0x7*(-parseInt(_0x1e8a87(0x185))/0x8)+parseInt(_0x1e8a87(0x187))/0x9+parseInt(_0x1e8a87(0x18c))/0xa;if(_0x27dd5d===_0x221953)break;else _0x36ba1a['push'](_0x36ba1a['shift']());}catch(_0x295170){_0x36ba1a['push'](_0x36ba1a['shift']());}}}(a260_0x506a,0xe4df0));function a260_0x3de0(_0x5e16f5,_0x74ac90){_0x5e16f5=_0x5e16f5-0x185;const _0x506ac7=a260_0x506a();let _0x3de04c=_0x506ac7[_0x5e16f5];return _0x3de04c;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x159c98,_0x350de4){const _0x2eea8c=a260_0x3de0,_0x362cb6={'apps':_0x159c98[_0x2eea8c(0x196)]&&typeof _0x159c98[_0x2eea8c(0x196)]===_0x2eea8c(0x192)?_0x159c98[_0x2eea8c(0x196)]:{}};let _0x24616f=_0x362cb6['apps'][_0x350de4];if(!_0x24616f)return _0x24616f={'lastSync':'','pages':{}},_0x362cb6[_0x2eea8c(0x196)][_0x350de4]=_0x24616f,{'lockData':_0x362cb6,'appLock':_0x24616f};return!_0x24616f['lastSync']&&(_0x24616f[_0x2eea8c(0x197)]=''),(!_0x24616f[_0x2eea8c(0x195)]||typeof _0x24616f[_0x2eea8c(0x195)]!==_0x2eea8c(0x192))&&(_0x24616f['pages']={}),{'lockData':_0x362cb6,'appLock':_0x24616f};}export async function readPageLockFile(_0x5c1775){const _0x7f104e=a260_0x3de0;try{const _0x381d61=await readFile(_0x5c1775,'utf8'),_0x53bad2=JSON['parse'](_0x381d61);return{'apps':_0x53bad2[_0x7f104e(0x196)]&&typeof _0x53bad2['apps']===_0x7f104e(0x192)?_0x53bad2[_0x7f104e(0x196)]:{}};}catch(_0x17b7a8){if(_0x17b7a8[_0x7f104e(0x18b)]===_0x7f104e(0x193))return null;throw new Error(_0x7f104e(0x18d)+String(_0x17b7a8));}}export async function writePageLockFile(_0x56acbc,_0x25b0f6){const _0x397d01=a260_0x3de0;await mkdir(dirname(_0x56acbc),{'recursive':!![]}),await writeFile(_0x56acbc,JSON[_0x397d01(0x18a)](_0x25b0f6,null,0x2),_0x397d01(0x186));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x12c3db,_0x35ff63){const _0x38e956=a248_0x56d4,_0x1fb464=_0x12c3db();while(!![]){try{const _0x452a27=-parseInt(_0x38e956(0x9a))/0x1+parseInt(_0x38e956(0xab))/0x2+-parseInt(_0x38e956(0x8d))/0x3*(parseInt(_0x38e956(0xad))/0x4)+-parseInt(_0x38e956(0x78))/0x5*(parseInt(_0x38e956(0x90))/0x6)+parseInt(_0x38e956(0xa2))/0x7+-parseInt(_0x38e956(0x7e))/0x8+parseInt(_0x38e956(0x70))/0x9;if(_0x452a27===_0x35ff63)break;else _0x1fb464['push'](_0x1fb464['shift']());}catch(_0x15d810){_0x1fb464['push'](_0x1fb464['shift']());}}}(a248_0x57f2,0x60d56));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x42abd6,_0x378818){const _0x268b33=a248_0x56d4,_0x50ad6c=[],_0x3d1e13=normalizeSqlForStaticAnalysis(_0x42abd6),_0x28ddd2=(_0x3d1e13['error']?[]:extractJoinFacts(_0x3d1e13[_0x268b33(0x97)]))['map'](_0x4df884=>{const _0x37d2a6=_0x268b33;if(_0x4df884['unsupportedPredicate']||_0x4df884[_0x37d2a6(0x98)][_0x37d2a6(0x9b)]===0x0)return _0x50ad6c['push']({'code':_0x37d2a6(0x81),'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884[_0x37d2a6(0x98)],'reason':_0x4df884[_0x37d2a6(0xa6)]??_0x37d2a6(0x71)}),{'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884[_0x37d2a6(0x98)],'status':_0x37d2a6(0xaf)};const _0x33bb13=resolveTableMetadata(_0x378818,_0x4df884[_0x37d2a6(0x7a)]),_0x163d3c=(_0x33bb13?.[_0x37d2a6(0x6e)]??[])[_0x37d2a6(0x7d)](_0x1c35c0=>({'index':_0x1c35c0,'matchedPrefix':findEqualityPrefix(_0x1c35c0[_0x37d2a6(0x98)],_0x4df884[_0x37d2a6(0x98)])}))[_0x37d2a6(0x77)](_0x2c52ef=>_0x2c52ef[_0x37d2a6(0x7b)][_0x37d2a6(0x9b)]>0x0),_0x4620fe=_0x163d3c['reduce']((_0x540d77,_0x240110)=>!_0x540d77||_0x240110['matchedPrefix'][_0x37d2a6(0x9b)]>_0x540d77['matchedPrefix'][_0x37d2a6(0x9b)]?_0x240110:_0x540d77,_0x163d3c[0x0]);if(_0x4620fe)return{'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884[_0x37d2a6(0x98)],'status':_0x37d2a6(0xa5),'matchedIndex':{..._0x4620fe[_0x37d2a6(0x79)],'matchedPrefix':_0x4620fe[_0x37d2a6(0x7b)]}};const _0x11581c=_0x33bb13?.[_0x37d2a6(0x6e)][_0x37d2a6(0x77)](_0x32bf03=>_0x32bf03[_0x37d2a6(0x98)][_0x37d2a6(0x8a)](_0x2eab4c=>_0x4df884['columns'][_0x37d2a6(0x8a)](_0x30c610=>columnNamesMatch(_0x2eab4c,_0x30c610))))??[];if(_0x11581c['length']>0x0)return _0x50ad6c['push']({'code':_0x37d2a6(0x67),'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884['columns'],'reason':_0x37d2a6(0x99)}),{'table':_0x4df884['table'],'alias':_0x4df884['alias'],'columns':_0x4df884[_0x37d2a6(0x98)],'status':_0x37d2a6(0xb0),'candidateIndexes':_0x11581c};if(_0x33bb13&&_0x33bb13[_0x37d2a6(0x89)]!==![]&&_0x33bb13['indexes'][_0x37d2a6(0x9b)]>0x0&&_0x4df884[_0x37d2a6(0x98)]['length']>0x0)return _0x50ad6c[_0x37d2a6(0x7c)]({'code':_0x37d2a6(0xae),'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884[_0x37d2a6(0x98)],'reason':_0x37d2a6(0xa3)}),{'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884[_0x37d2a6(0x98)],'status':_0x37d2a6(0xb0)};return _0x50ad6c[_0x37d2a6(0x7c)]({'code':_0x37d2a6(0xaa),'table':_0x4df884[_0x37d2a6(0x7a)],'alias':_0x4df884['alias'],'columns':_0x4df884[_0x37d2a6(0x98)],'reason':_0x33bb13?_0x37d2a6(0x8c):_0x37d2a6(0x76)}),{'table':_0x4df884['table'],'alias':_0x4df884[_0x37d2a6(0x95)],'columns':_0x4df884[_0x37d2a6(0x98)],'status':_0x37d2a6(0xaf)};});return{'checked':_0x28ddd2[_0x268b33(0x9b)]>0x0,'joins':_0x28ddd2,'warnings':_0x50ad6c};}function a248_0x57f2(){const _0x7d69cb=['push','map','887608fAxULd','match','replaceAll','JOIN_PREDICATE_UNSUPPORTED','split','trim','cross','right','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','tableName','left','metadataAvailable','some','includes','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','1263738OLlzDe','slice','max','515928BbgzTt','where','min','\x5c$&','inner','alias','containsUnresolvedInclude','sql','columns','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','584016bQvnlE','length','\x5cs*\x5c.\x5cs*[\x5cw$]+','unknown','test','startsWith','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','3954104ykHQJy','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','full','covered','unsupportedReason','position','exec','search','INDEX_METADATA_UNAVAILABLE','3278wzlywE','join','4CEctHb','JOIN_INDEX_MISSING','unavailable','warning','JOIN_INDEX_NOT_USABLE','has','matchAll','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','__sq__','toLowerCase','replace','indexes','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','14708124NMVwTm','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','toUpperCase','from','natural','INNER','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','filter','40IKdJga','index','table','matchedPrefix'];a248_0x57f2=function(){return _0x7d69cb;};return a248_0x57f2();}function extractJoinFacts(_0x3bc0f9){const _0x50f09e=a248_0x56d4,_0xc05889=maskNestedQueries(stripSqlNoise(_0x3bc0f9)),_0x1c6acf=maskQuotedIdentifiers(_0xc05889),_0x262a12=[],_0x4d6f31=new Set(),_0xbde846=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x2a4e38 of _0xc05889[_0x50f09e(0x69)](_0xbde846)){const _0x2c07dc=_0x2a4e38['index']??0x0,_0x440596=_0x2a4e38[0x0][_0x50f09e(0xa9)](/\bJOIN\b/i),_0x41e02a=_0x2c07dc+Math['max'](0x0,_0x440596);if(!/^JOIN\b/i[_0x50f09e(0x9e)](_0x1c6acf['slice'](_0x41e02a)))continue;_0x4d6f31['add'](_0x41e02a);const _0x532d52=normalizeIdentifier(_0x2a4e38[0x1]||_0x50f09e(0x75)),_0x43dcb5=normalizeIdentifier(_0x2a4e38[0x2]??''),_0x3ed64d=normalizeIdentifier(_0x2a4e38[0x3]||_0x43dcb5[_0x50f09e(0x82)]('.')['at'](-0x1)||_0x43dcb5),_0x11dcb8=[],_0x5545c6=_0x43dcb5===_0x50f09e(0x6b);let _0x5f320a=_0x532d52==='right'||_0x532d52===_0x50f09e(0xa4)||_0x5545c6,_0x131658=_0x5f320a?_0x5545c6?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x532d52[_0x50f09e(0x72)]()+_0x50f09e(0xa0):undefined;const _0x304291=stripOuterParentheses(_0x2a4e38[0x4]??''),_0x1fb712=_0x304291['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x304291[_0x50f09e(0x8b)](MYBATIS_DYNAMIC_END_MARKER),_0x2d7abf=_0x304291[_0x50f09e(0x8b)](MYBATIS_INCLUDE_MARKER);_0x1fb712&&(_0x5f320a=!![],_0x131658??=_0x50f09e(0x6f));_0x2d7abf&&(_0x5f320a=!![],_0x131658??=_0x50f09e(0xa1));const _0x3a27af=_0x304291[_0x50f09e(0x80)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x50f09e(0x80)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x50f09e(0x80)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3a27af,'OR')&&(_0x5f320a=!![],_0x131658??=_0x50f09e(0x6a));for(const _0x4c1ec4 of splitTopLevelAnd(_0x3a27af)){const _0x260c82=stripOuterParentheses(_0x4c1ec4);if(hasTopLevelKeyword(_0x260c82,'OR')){_0x5f320a=!![],_0x131658??=_0x50f09e(0x6a);continue;}const _0x3763f8=splitEquality(_0x260c82);if(!_0x3763f8){containsColumnReference(_0x4c1ec4,_0x3ed64d)&&(_0x5f320a=!![]);continue;}const _0x436535=parseDirectColumnReference(_0x3763f8[0x0],_0x3ed64d),_0x5a7c80=parseDirectColumnReference(_0x3763f8[0x1],_0x3ed64d),_0x1cd6a7=containsColumnReference(_0x3763f8[0x0],_0x3ed64d),_0x5e5f81=containsColumnReference(_0x3763f8[0x1],_0x3ed64d),_0xc03e89=_0x436535&&!_0x5e5f81?_0x436535:_0x5a7c80&&!_0x1cd6a7?_0x5a7c80:null;if(_0xc03e89&&!_0x11dcb8['includes'](_0xc03e89))_0x11dcb8[_0x50f09e(0x7c)](_0xc03e89);else!_0xc03e89&&containsColumnReference(_0x4c1ec4,_0x3ed64d)&&(_0x5f320a=!![]);}_0x262a12['push']({'table':_0x43dcb5,'alias':_0x3ed64d,'columns':_0x11dcb8,'unsupportedPredicate':_0x5f320a,'unsupportedReason':_0x131658,'containsUnresolvedInclude':_0x2d7abf,'position':_0x41e02a});}for(const _0x2a8797 of _0x1c6acf['matchAll'](/\bJOIN\b/gi)){const _0x22120f=_0x2a8797[_0x50f09e(0x79)]??0x0;if(_0x4d6f31[_0x50f09e(0x68)](_0x22120f))continue;const _0xeecfe3=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x50f09e(0xa8)](_0xc05889[_0x50f09e(0x8e)](_0x22120f+_0x2a8797[0x0][_0x50f09e(0x9b)])),_0x350baa=normalizeIdentifier(_0xeecfe3?.[0x1]||'unknown'),_0x227257=normalizeIdentifier(_0xeecfe3?.[0x2]||''),_0xd71bf4=isSqlClauseKeyword(_0x227257)?_0x350baa[_0x50f09e(0x82)]('.')['at'](-0x1)||_0x350baa:_0x227257||_0x350baa[_0x50f09e(0x82)]('.')['at'](-0x1)||_0x350baa;_0x262a12[_0x50f09e(0x7c)]({'table':_0x350baa,'alias':_0xd71bf4,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x22120f});}const _0x15296b=_0x1c6acf['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x15296b>=0x0&&!_0x262a12[_0x50f09e(0x8a)](_0x42b659=>_0x42b659[_0x50f09e(0x96)])&&_0x262a12['push']({'table':_0x50f09e(0x9d),'alias':_0x50f09e(0x9d),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x50f09e(0x86),'containsUnresolvedInclude':!![],'position':_0x15296b}),_0x262a12['sort']((_0x5d9342,_0x132c76)=>_0x5d9342[_0x50f09e(0xa7)]-_0x132c76[_0x50f09e(0xa7)]);}function stripSqlNoise(_0xe4b641){const _0x9464d3=a248_0x56d4,_0x59a722=Array[_0x9464d3(0x73)](_0xe4b641),_0x5e9b0f=(_0x114999,_0x59b3a5)=>{for(let _0x55927c=_0x114999;_0x55927c<_0x59b3a5;_0x55927c+=0x1){_0x59a722[_0x55927c]!=='\x0a'&&_0x59a722[_0x55927c]!=='\x0d'&&(_0x59a722[_0x55927c]='\x20');}};for(let _0x4092b4=0x0;_0x4092b4<_0x59a722[_0x9464d3(0x9b)];_0x4092b4+=0x1){const _0x43a8db=_0x59a722[_0x4092b4],_0x15a9a9=_0x59a722[_0x4092b4+0x1];if(_0x43a8db==='\x27'||_0x43a8db==='\x22'||_0x43a8db==='`'){const _0x24fb0d=_0x43a8db,_0x5c79a4=_0x4092b4;_0x4092b4+=0x1;while(_0x4092b4<_0x59a722[_0x9464d3(0x9b)]){if(_0x59a722[_0x4092b4]==='\x5c'&&_0x4092b4+0x1<_0x59a722['length']){_0x4092b4+=0x2;continue;}if(_0x59a722[_0x4092b4]!==_0x24fb0d){_0x4092b4+=0x1;continue;}if(_0x59a722[_0x4092b4+0x1]===_0x24fb0d){_0x4092b4+=0x2;continue;}break;}if(_0x24fb0d==='\x27')_0x5e9b0f(_0x5c79a4,Math[_0x9464d3(0x92)](_0x4092b4+0x1,_0x59a722[_0x9464d3(0x9b)]));continue;}if(_0x43a8db==='-'&&_0x15a9a9==='-'){const _0xd83f8f=_0x4092b4;while(_0x4092b4<_0x59a722['length']&&_0x59a722[_0x4092b4]!=='\x0a')_0x4092b4+=0x1;_0x5e9b0f(_0xd83f8f,_0x4092b4);continue;}if(_0x43a8db==='/'&&_0x15a9a9==='*'){const _0xf6830c=_0x4092b4;_0x4092b4+=0x2;while(_0x4092b4<_0x59a722['length']&&!(_0x59a722[_0x4092b4]==='*'&&_0x59a722[_0x4092b4+0x1]==='/')){_0x4092b4+=0x1;}_0x4092b4=Math[_0x9464d3(0x92)](_0x4092b4+0x1,_0x59a722[_0x9464d3(0x9b)]-0x1),_0x5e9b0f(_0xf6830c,_0x4092b4+0x1);continue;}if(_0x43a8db==='#'&&_0x15a9a9!=='{'){const _0x4c07a1=_0x4092b4;while(_0x4092b4<_0x59a722[_0x9464d3(0x9b)]&&_0x59a722[_0x4092b4]!=='\x0a')_0x4092b4+=0x1;_0x5e9b0f(_0x4c07a1,_0x4092b4);continue;}if((_0x43a8db==='#'||_0x43a8db==='$')&&_0x15a9a9==='{'){const _0x55e6ec=_0x4092b4;_0x4092b4+=0x2;while(_0x4092b4<_0x59a722[_0x9464d3(0x9b)]&&_0x59a722[_0x4092b4]!=='}')_0x4092b4+=0x1;_0x5e9b0f(_0x55e6ec,Math['min'](_0x4092b4+0x1,_0x59a722[_0x9464d3(0x9b)]));}}return _0x59a722[_0x9464d3(0xac)]('');}function maskQuotedIdentifiers(_0xdd8ee0){const _0x59621e=a248_0x56d4,_0x446c48=Array['from'](_0xdd8ee0);for(let _0x32bd7e=0x0;_0x32bd7e<_0x446c48['length'];_0x32bd7e+=0x1){const _0x5a81fd=_0x446c48[_0x32bd7e];if(_0x5a81fd!=='\x22'&&_0x5a81fd!=='`')continue;_0x32bd7e+=0x1;while(_0x32bd7e<_0x446c48[_0x59621e(0x9b)]){if(_0x446c48[_0x32bd7e]===_0x5a81fd){if(_0x446c48[_0x32bd7e+0x1]===_0x5a81fd){_0x446c48[_0x32bd7e]='\x20',_0x446c48[_0x32bd7e+0x1]='\x20',_0x32bd7e+=0x2;continue;}break;}_0x446c48[_0x32bd7e]='\x20',_0x32bd7e+=0x1;}}return _0x446c48['join']('');}function maskNestedQueries(_0x545771){const _0x3c0971=a248_0x56d4,_0x13029b=Array[_0x3c0971(0x73)](_0x545771);for(let _0x579ac5=0x0;_0x579ac5<_0x13029b[_0x3c0971(0x9b)];_0x579ac5+=0x1){if(_0x13029b[_0x579ac5]!=='(')continue;const _0x3c13fc=_0x545771[_0x3c0971(0x8e)](_0x579ac5+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x3c0971(0x9e)](_0x3c13fc))continue;let _0x52396c=0x1,_0x2e344d=_0x579ac5+0x1;for(;_0x2e344d<_0x13029b['length']&&_0x52396c>0x0;_0x2e344d+=0x1){if(_0x13029b[_0x2e344d]==='(')_0x52396c+=0x1;if(_0x13029b[_0x2e344d]===')')_0x52396c-=0x1;}if(_0x52396c!==0x0)continue;for(let _0x4bec39=_0x579ac5;_0x4bec39<_0x2e344d;_0x4bec39+=0x1){_0x13029b[_0x4bec39]='\x20';}const _0x51e612=_0x3c0971(0x6b);for(let _0x1ad248=0x0;_0x1ad248<_0x51e612['length']&&_0x579ac5+_0x1ad248<_0x2e344d;_0x1ad248+=0x1){_0x13029b[_0x579ac5+_0x1ad248]=_0x51e612[_0x1ad248];}_0x579ac5=_0x2e344d-0x1;}return _0x13029b['join']('');}function splitTopLevelAnd(_0x2c22b4){const _0x19209d=a248_0x56d4,_0x289629=[];let _0x3501f7=0x0,_0x32864f=0x0;for(let _0x263f5b=0x0;_0x263f5b<_0x2c22b4[_0x19209d(0x9b)];_0x263f5b+=0x1){const _0x2f0fbc=_0x2c22b4[_0x263f5b];if(_0x2f0fbc==='(')_0x3501f7+=0x1;if(_0x2f0fbc===')')_0x3501f7=Math[_0x19209d(0x8f)](0x0,_0x3501f7-0x1);_0x3501f7===0x0&&_0x2c22b4[_0x19209d(0x8e)](_0x263f5b)[_0x19209d(0x7f)](/^AND\b/i)&&(_0x263f5b===0x0||/\s/[_0x19209d(0x9e)](_0x2c22b4[_0x263f5b-0x1]??''))&&(_0x289629[_0x19209d(0x7c)](_0x2c22b4[_0x19209d(0x8e)](_0x32864f,_0x263f5b)['trim']()),_0x263f5b+=0x2,_0x32864f=_0x263f5b+0x1);}const _0x51d37b=_0x2c22b4[_0x19209d(0x8e)](_0x32864f)[_0x19209d(0x83)]();if(_0x51d37b)_0x289629[_0x19209d(0x7c)](_0x51d37b);return _0x289629;}function hasTopLevelKeyword(_0x42e0d4,_0x59adbc){const _0x195050=a248_0x56d4;let _0x41dd3e=0x0;for(let _0x207c3c=0x0;_0x207c3c<_0x42e0d4[_0x195050(0x9b)];_0x207c3c+=0x1){const _0x125125=_0x42e0d4[_0x207c3c];if(_0x125125==='(')_0x41dd3e+=0x1;if(_0x125125===')')_0x41dd3e=Math['max'](0x0,_0x41dd3e-0x1);if(_0x41dd3e!==0x0)continue;const _0x6744db=_0x42e0d4[_0x195050(0x8e)](_0x207c3c,_0x207c3c+_0x59adbc['length']),_0x2a10bc=_0x42e0d4[_0x207c3c-0x1]??'\x20',_0xf993c5=_0x42e0d4[_0x207c3c+_0x59adbc[_0x195050(0x9b)]]??'\x20';if(_0x6744db['toUpperCase']()===_0x59adbc[_0x195050(0x72)]()&&!/[\w$]/[_0x195050(0x9e)](_0x2a10bc)&&!/[\w$]/[_0x195050(0x9e)](_0xf993c5))return!![];}return![];}function splitEquality(_0xe47b8c){const _0xcfd837=a248_0x56d4,_0x4104de=stripOuterParentheses(_0xe47b8c);let _0x18029c=0x0,_0x5d0957;for(let _0x22d639=0x0;_0x22d639<_0x4104de[_0xcfd837(0x9b)];_0x22d639+=0x1){const _0x583671=_0x4104de[_0x22d639];if(_0x583671==='(')_0x18029c+=0x1;if(_0x583671===')')_0x18029c=Math[_0xcfd837(0x8f)](0x0,_0x18029c-0x1);const _0x321364=_0x4104de[_0x22d639-0x1]??'',_0x29452d=_0x4104de[_0x22d639+0x1]??'';if(_0x583671==='='&&_0x18029c===0x0&&!/[!<>=:]/[_0xcfd837(0x9e)](_0x321364)&&_0x29452d!=='='){if(_0x5d0957!==undefined)return null;_0x5d0957=_0x22d639;}}return _0x5d0957===undefined?null:[_0x4104de[_0xcfd837(0x8e)](0x0,_0x5d0957)[_0xcfd837(0x83)](),_0x4104de[_0xcfd837(0x8e)](_0x5d0957+0x1)[_0xcfd837(0x83)]()];}function parseDirectColumnReference(_0x2afe25,_0x313e68){const _0xef002d=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x2afe25));if(!_0xef002d)return null;if(normalizeIdentifier(_0xef002d[0x1]??'')!==normalizeIdentifier(_0x313e68))return null;return normalizeIdentifier(_0xef002d[0x2]??'');}function containsColumnReference(_0x35f4dc,_0x13fb4c){const _0xd2f0de=a248_0x56d4,_0x24e253=_0x35f4dc[_0xd2f0de(0x6d)](/[`"]/g,''),_0x4c2b97=_0x13fb4c[_0xd2f0de(0x6d)](/[.*+?^${}()|[\]\\]/g,_0xd2f0de(0x93));return new RegExp('(?:^|[^\x5cw$])'+_0x4c2b97+_0xd2f0de(0x9c),'i')[_0xd2f0de(0x9e)](_0x24e253);}function findEqualityPrefix(_0x1d8b50,_0x168b6b){const _0x5740dc=a248_0x56d4,_0x300ded=new Set(_0x168b6b[_0x5740dc(0x7d)](normalizeIdentifier)),_0x3e94ee=[];for(const _0x3e8c1d of _0x1d8b50){if(!_0x300ded[_0x5740dc(0x68)](normalizeIdentifier(_0x3e8c1d)))break;_0x3e94ee[_0x5740dc(0x7c)](_0x3e8c1d);}return _0x3e94ee;}function resolveTableMetadata(_0x321662,_0x567737){const _0x41344c=a248_0x56d4,_0x27c453=normalizeIdentifier(_0x567737),_0x13c860=_0x321662[_0x41344c(0x77)](_0x2ebdb7=>normalizeIdentifier(_0x2ebdb7[_0x41344c(0x87)])===_0x27c453);if(_0x13c860[_0x41344c(0x9b)]===0x1)return _0x13c860[0x0];const _0x1cbfa7=_0x27c453[_0x41344c(0x8b)]('.'),_0xb6051f=_0x27c453[_0x41344c(0x82)]('.')['at'](-0x1),_0x504e1c=_0x321662[_0x41344c(0x77)](_0x3c1995=>{const _0x280aa8=_0x41344c,_0x1ed555=normalizeIdentifier(_0x3c1995[_0x280aa8(0x87)]);if(_0x1cbfa7&&_0x1ed555['includes']('.'))return![];return _0x1ed555[_0x280aa8(0x82)]('.')['at'](-0x1)===_0xb6051f;});return _0x504e1c[_0x41344c(0x9b)]===0x1?_0x504e1c[0x0]:undefined;}function columnNamesMatch(_0x366e7a,_0x30b305){return normalizeIdentifier(_0x366e7a)===normalizeIdentifier(_0x30b305);}function normalizeIdentifier(_0x33dd4b){const _0x33a938=a248_0x56d4;return _0x33dd4b['replace'](/[`"]/g,'')[_0x33a938(0x83)]()[_0x33a938(0x6c)]();}function isSqlClauseKeyword(_0x1ec7fe){const _0x5e808f=a248_0x56d4;return new Set(['on','using',_0x5e808f(0x91),'join',_0x5e808f(0x94),_0x5e808f(0x88),_0x5e808f(0x85),_0x5e808f(0xa4),_0x5e808f(0x84),_0x5e808f(0x74)])[_0x5e808f(0x68)](_0x1ec7fe);}function a248_0x56d4(_0x2b19fe,_0x314d7a){_0x2b19fe=_0x2b19fe-0x67;const _0x57f260=a248_0x57f2();let _0x56d444=_0x57f260[_0x2b19fe];return _0x56d444;}function stripOuterParentheses(_0x382dbf){const _0x143503=a248_0x56d4;let _0x1438b5=_0x382dbf[_0x143503(0x83)]();while(_0x1438b5[_0x143503(0x9f)]('(')&&_0x1438b5['endsWith'](')')){let _0x5ee2e4=0x0,_0x474944=!![];for(let _0x73756a=0x0;_0x73756a<_0x1438b5[_0x143503(0x9b)];_0x73756a+=0x1){if(_0x1438b5[_0x73756a]==='(')_0x5ee2e4+=0x1;if(_0x1438b5[_0x73756a]===')')_0x5ee2e4-=0x1;if(_0x5ee2e4===0x0&&_0x73756a<_0x1438b5[_0x143503(0x9b)]-0x1){_0x474944=![];break;}}if(!_0x474944||_0x5ee2e4!==0x0)break;_0x1438b5=_0x1438b5[_0x143503(0x8e)](0x1,-0x1)[_0x143503(0x83)]();}return _0x1438b5;}
|
|
1
|
+
(function(_0x2c9476,_0x15b34c){const _0x19a096=a262_0x4135,_0x5d74fc=_0x2c9476();while(!![]){try{const _0x25923c=parseInt(_0x19a096(0x121))/0x1*(-parseInt(_0x19a096(0x14b))/0x2)+-parseInt(_0x19a096(0x11b))/0x3*(-parseInt(_0x19a096(0x147))/0x4)+-parseInt(_0x19a096(0x149))/0x5+-parseInt(_0x19a096(0x12c))/0x6*(parseInt(_0x19a096(0x137))/0x7)+-parseInt(_0x19a096(0x13d))/0x8*(-parseInt(_0x19a096(0x11f))/0x9)+parseInt(_0x19a096(0x115))/0xa+-parseInt(_0x19a096(0x127))/0xb;if(_0x25923c===_0x15b34c)break;else _0x5d74fc['push'](_0x5d74fc['shift']());}catch(_0x56d51b){_0x5d74fc['push'](_0x5d74fc['shift']());}}}(a262_0x57c1,0xcbd27));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x599de6,_0x16e1ab){const _0x137cc3=a262_0x4135,_0x10bc00=[],_0x4a9f29=normalizeSqlForStaticAnalysis(_0x599de6),_0x47c8d3=(_0x4a9f29[_0x137cc3(0x143)]?[]:extractJoinFacts(_0x4a9f29[_0x137cc3(0x131)]))[_0x137cc3(0x10e)](_0x4a2f2e=>{const _0x4d3717=_0x137cc3;if(_0x4a2f2e[_0x4d3717(0x13f)]||_0x4a2f2e['columns']['length']===0x0)return _0x10bc00[_0x4d3717(0x13b)]({'code':_0x4d3717(0x130),'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'reason':_0x4a2f2e[_0x4d3717(0x123)]??_0x4d3717(0x11c)}),{'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':_0x4d3717(0x12a)};const _0x377e69=resolveTableMetadata(_0x16e1ab,_0x4a2f2e[_0x4d3717(0x118)]),_0x530648=(_0x377e69?.[_0x4d3717(0x126)]??[])[_0x4d3717(0x10e)](_0x1ddab3=>({'index':_0x1ddab3,'matchedPrefix':findEqualityPrefix(_0x1ddab3[_0x4d3717(0x12f)],_0x4a2f2e[_0x4d3717(0x12f)])}))[_0x4d3717(0x11a)](_0x3f1b27=>_0x3f1b27['matchedPrefix'][_0x4d3717(0x119)]>0x0),_0x270c0=_0x530648['reduce']((_0x3202ea,_0x5b7e25)=>!_0x3202ea||_0x5b7e25[_0x4d3717(0x138)][_0x4d3717(0x119)]>_0x3202ea[_0x4d3717(0x138)][_0x4d3717(0x119)]?_0x5b7e25:_0x3202ea,_0x530648[0x0]);if(_0x270c0)return{'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':'covered','matchedIndex':{..._0x270c0[_0x4d3717(0x136)],'matchedPrefix':_0x270c0['matchedPrefix']}};const _0x1973d9=_0x377e69?.[_0x4d3717(0x126)][_0x4d3717(0x11a)](_0x3f1be6=>_0x3f1be6[_0x4d3717(0x12f)][_0x4d3717(0x120)](_0x34d83b=>_0x4a2f2e[_0x4d3717(0x12f)][_0x4d3717(0x120)](_0x539bcf=>columnNamesMatch(_0x34d83b,_0x539bcf))))??[];if(_0x1973d9[_0x4d3717(0x119)]>0x0)return _0x10bc00['push']({'code':_0x4d3717(0x152),'table':_0x4a2f2e['table'],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':_0x4d3717(0x145),'candidateIndexes':_0x1973d9};if(_0x377e69&&_0x377e69['metadataAvailable']!==![]&&_0x377e69[_0x4d3717(0x126)][_0x4d3717(0x119)]>0x0&&_0x4a2f2e[_0x4d3717(0x12f)][_0x4d3717(0x119)]>0x0)return _0x10bc00[_0x4d3717(0x13b)]({'code':_0x4d3717(0x112),'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'reason':_0x4d3717(0x12d)}),{'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'status':_0x4d3717(0x145)};return _0x10bc00[_0x4d3717(0x13b)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e[_0x4d3717(0x12f)],'reason':_0x377e69?_0x4d3717(0x135):_0x4d3717(0x157)}),{'table':_0x4a2f2e[_0x4d3717(0x118)],'alias':_0x4a2f2e[_0x4d3717(0x154)],'columns':_0x4a2f2e['columns'],'status':_0x4d3717(0x12a)};});return{'checked':_0x47c8d3[_0x137cc3(0x119)]>0x0,'joins':_0x47c8d3,'warnings':_0x10bc00};}function extractJoinFacts(_0x56ccd4){const _0x47983b=a262_0x4135,_0x50ee37=maskNestedQueries(stripSqlNoise(_0x56ccd4)),_0xc9b745=maskQuotedIdentifiers(_0x50ee37),_0xb73ee5=[],_0x252cb7=new Set(),_0x15756f=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x1188ca of _0x50ee37[_0x47983b(0x10a)](_0x15756f)){const _0x27233b=_0x1188ca[_0x47983b(0x136)]??0x0,_0x5d02fe=_0x1188ca[0x0][_0x47983b(0x125)](/\bJOIN\b/i),_0x28e098=_0x27233b+Math[_0x47983b(0x10d)](0x0,_0x5d02fe);if(!/^JOIN\b/i[_0x47983b(0x13a)](_0xc9b745[_0x47983b(0x156)](_0x28e098)))continue;_0x252cb7[_0x47983b(0x140)](_0x28e098);const _0x1ea0a5=normalizeIdentifier(_0x1188ca[0x1]||_0x47983b(0x158)),_0x50a985=normalizeIdentifier(_0x1188ca[0x2]??''),_0x4344ca=normalizeIdentifier(_0x1188ca[0x3]||_0x50a985[_0x47983b(0x146)]('.')['at'](-0x1)||_0x50a985),_0x5ce050=[],_0x57e0e5=_0x50a985==='__sq__';let _0xc3cc6a=_0x1ea0a5===_0x47983b(0x10c)||_0x1ea0a5===_0x47983b(0x155)||_0x57e0e5,_0x54b56d=_0xc3cc6a?_0x57e0e5?_0x47983b(0x111):_0x1ea0a5[_0x47983b(0x144)]()+_0x47983b(0x11d):undefined;const _0x20c969=stripOuterParentheses(_0x1188ca[0x4]??''),_0x188edf=_0x20c969[_0x47983b(0x142)](MYBATIS_DYNAMIC_START_MARKER)||_0x20c969[_0x47983b(0x142)](MYBATIS_DYNAMIC_END_MARKER),_0x460bbd=_0x20c969[_0x47983b(0x142)](MYBATIS_INCLUDE_MARKER);_0x188edf&&(_0xc3cc6a=!![],_0x54b56d??=_0x47983b(0x114));_0x460bbd&&(_0xc3cc6a=!![],_0x54b56d??=_0x47983b(0x10b));const _0x4e8258=_0x20c969[_0x47983b(0x117)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x47983b(0x117)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x47983b(0x117)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4e8258,'OR')&&(_0xc3cc6a=!![],_0x54b56d??=_0x47983b(0x148));for(const _0x5e6d17 of splitTopLevelAnd(_0x4e8258)){const _0x3fe3aa=stripOuterParentheses(_0x5e6d17);if(hasTopLevelKeyword(_0x3fe3aa,'OR')){_0xc3cc6a=!![],_0x54b56d??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x30f211=splitEquality(_0x3fe3aa);if(!_0x30f211){containsColumnReference(_0x5e6d17,_0x4344ca)&&(_0xc3cc6a=!![]);continue;}const _0x480e66=parseDirectColumnReference(_0x30f211[0x0],_0x4344ca),_0x552fd0=parseDirectColumnReference(_0x30f211[0x1],_0x4344ca),_0x53a6b9=containsColumnReference(_0x30f211[0x0],_0x4344ca),_0x46ac5a=containsColumnReference(_0x30f211[0x1],_0x4344ca),_0x3a9a6d=_0x480e66&&!_0x46ac5a?_0x480e66:_0x552fd0&&!_0x53a6b9?_0x552fd0:null;if(_0x3a9a6d&&!_0x5ce050[_0x47983b(0x142)](_0x3a9a6d))_0x5ce050['push'](_0x3a9a6d);else!_0x3a9a6d&&containsColumnReference(_0x5e6d17,_0x4344ca)&&(_0xc3cc6a=!![]);}_0xb73ee5[_0x47983b(0x13b)]({'table':_0x50a985,'alias':_0x4344ca,'columns':_0x5ce050,'unsupportedPredicate':_0xc3cc6a,'unsupportedReason':_0x54b56d,'containsUnresolvedInclude':_0x460bbd,'position':_0x28e098});}for(const _0x42b3f0 of _0xc9b745['matchAll'](/\bJOIN\b/gi)){const _0x39c784=_0x42b3f0['index']??0x0;if(_0x252cb7[_0x47983b(0x113)](_0x39c784))continue;const _0x4fc925=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x47983b(0x14d)](_0x50ee37['slice'](_0x39c784+_0x42b3f0[0x0][_0x47983b(0x119)])),_0x91fa61=normalizeIdentifier(_0x4fc925?.[0x1]||_0x47983b(0x116)),_0x3bf05d=normalizeIdentifier(_0x4fc925?.[0x2]||''),_0x42b5e1=isSqlClauseKeyword(_0x3bf05d)?_0x91fa61[_0x47983b(0x146)]('.')['at'](-0x1)||_0x91fa61:_0x3bf05d||_0x91fa61[_0x47983b(0x146)]('.')['at'](-0x1)||_0x91fa61;_0xb73ee5[_0x47983b(0x13b)]({'table':_0x91fa61,'alias':_0x42b5e1,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x47983b(0x12b),'position':_0x39c784});}const _0xcc6697=_0xc9b745['indexOf'](MYBATIS_INCLUDE_MARKER);return _0xcc6697>=0x0&&!_0xb73ee5[_0x47983b(0x120)](_0xd4f8e1=>_0xd4f8e1[_0x47983b(0x124)])&&_0xb73ee5[_0x47983b(0x13b)]({'table':_0x47983b(0x116),'alias':_0x47983b(0x116),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x47983b(0x14e),'containsUnresolvedInclude':!![],'position':_0xcc6697}),_0xb73ee5[_0x47983b(0x141)]((_0x188408,_0x39e04f)=>_0x188408[_0x47983b(0x133)]-_0x39e04f[_0x47983b(0x133)]);}function stripSqlNoise(_0x1bbf34){const _0x23be97=a262_0x4135,_0x102c87=Array[_0x23be97(0x139)](_0x1bbf34),_0x2d5dfa=(_0x22733b,_0x3d8c1c)=>{for(let _0x535679=_0x22733b;_0x535679<_0x3d8c1c;_0x535679+=0x1){_0x102c87[_0x535679]!=='\x0a'&&_0x102c87[_0x535679]!=='\x0d'&&(_0x102c87[_0x535679]='\x20');}};for(let _0x344035=0x0;_0x344035<_0x102c87['length'];_0x344035+=0x1){const _0x250281=_0x102c87[_0x344035],_0x5ae30e=_0x102c87[_0x344035+0x1];if(_0x250281==='\x27'||_0x250281==='\x22'||_0x250281==='`'){const _0x2b425=_0x250281,_0x2bcefc=_0x344035;_0x344035+=0x1;while(_0x344035<_0x102c87['length']){if(_0x102c87[_0x344035]==='\x5c'&&_0x344035+0x1<_0x102c87[_0x23be97(0x119)]){_0x344035+=0x2;continue;}if(_0x102c87[_0x344035]!==_0x2b425){_0x344035+=0x1;continue;}if(_0x102c87[_0x344035+0x1]===_0x2b425){_0x344035+=0x2;continue;}break;}if(_0x2b425==='\x27')_0x2d5dfa(_0x2bcefc,Math['min'](_0x344035+0x1,_0x102c87[_0x23be97(0x119)]));continue;}if(_0x250281==='-'&&_0x5ae30e==='-'){const _0x369f06=_0x344035;while(_0x344035<_0x102c87[_0x23be97(0x119)]&&_0x102c87[_0x344035]!=='\x0a')_0x344035+=0x1;_0x2d5dfa(_0x369f06,_0x344035);continue;}if(_0x250281==='/'&&_0x5ae30e==='*'){const _0x3a77a2=_0x344035;_0x344035+=0x2;while(_0x344035<_0x102c87['length']&&!(_0x102c87[_0x344035]==='*'&&_0x102c87[_0x344035+0x1]==='/')){_0x344035+=0x1;}_0x344035=Math[_0x23be97(0x12e)](_0x344035+0x1,_0x102c87['length']-0x1),_0x2d5dfa(_0x3a77a2,_0x344035+0x1);continue;}if(_0x250281==='#'&&_0x5ae30e!=='{'){const _0x3deca0=_0x344035;while(_0x344035<_0x102c87[_0x23be97(0x119)]&&_0x102c87[_0x344035]!=='\x0a')_0x344035+=0x1;_0x2d5dfa(_0x3deca0,_0x344035);continue;}if((_0x250281==='#'||_0x250281==='$')&&_0x5ae30e==='{'){const _0x401e48=_0x344035;_0x344035+=0x2;while(_0x344035<_0x102c87[_0x23be97(0x119)]&&_0x102c87[_0x344035]!=='}')_0x344035+=0x1;_0x2d5dfa(_0x401e48,Math[_0x23be97(0x12e)](_0x344035+0x1,_0x102c87[_0x23be97(0x119)]));}}return _0x102c87[_0x23be97(0x122)]('');}function maskQuotedIdentifiers(_0x3a9926){const _0x312cc9=a262_0x4135,_0x4cee42=Array[_0x312cc9(0x139)](_0x3a9926);for(let _0x21c8fe=0x0;_0x21c8fe<_0x4cee42[_0x312cc9(0x119)];_0x21c8fe+=0x1){const _0x2588fa=_0x4cee42[_0x21c8fe];if(_0x2588fa!=='\x22'&&_0x2588fa!=='`')continue;_0x21c8fe+=0x1;while(_0x21c8fe<_0x4cee42[_0x312cc9(0x119)]){if(_0x4cee42[_0x21c8fe]===_0x2588fa){if(_0x4cee42[_0x21c8fe+0x1]===_0x2588fa){_0x4cee42[_0x21c8fe]='\x20',_0x4cee42[_0x21c8fe+0x1]='\x20',_0x21c8fe+=0x2;continue;}break;}_0x4cee42[_0x21c8fe]='\x20',_0x21c8fe+=0x1;}}return _0x4cee42[_0x312cc9(0x122)]('');}function maskNestedQueries(_0x2736f3){const _0x2cb6c1=a262_0x4135,_0x35a4e2=Array[_0x2cb6c1(0x139)](_0x2736f3);for(let _0x766ca8=0x0;_0x766ca8<_0x35a4e2[_0x2cb6c1(0x119)];_0x766ca8+=0x1){if(_0x35a4e2[_0x766ca8]!=='(')continue;const _0x9408a7=_0x2736f3['slice'](_0x766ca8+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x2cb6c1(0x13a)](_0x9408a7))continue;let _0x477a73=0x1,_0x485ba5=_0x766ca8+0x1;for(;_0x485ba5<_0x35a4e2['length']&&_0x477a73>0x0;_0x485ba5+=0x1){if(_0x35a4e2[_0x485ba5]==='(')_0x477a73+=0x1;if(_0x35a4e2[_0x485ba5]===')')_0x477a73-=0x1;}if(_0x477a73!==0x0)continue;for(let _0x3feb52=_0x766ca8;_0x3feb52<_0x485ba5;_0x3feb52+=0x1){_0x35a4e2[_0x3feb52]='\x20';}const _0x1527e7=_0x2cb6c1(0x132);for(let _0x4df0e9=0x0;_0x4df0e9<_0x1527e7[_0x2cb6c1(0x119)]&&_0x766ca8+_0x4df0e9<_0x485ba5;_0x4df0e9+=0x1){_0x35a4e2[_0x766ca8+_0x4df0e9]=_0x1527e7[_0x4df0e9];}_0x766ca8=_0x485ba5-0x1;}return _0x35a4e2[_0x2cb6c1(0x122)]('');}function splitTopLevelAnd(_0x283e0e){const _0x5b26ac=a262_0x4135,_0x7c6b3f=[];let _0x4d3bc4=0x0,_0x2eab1c=0x0;for(let _0x37a5f7=0x0;_0x37a5f7<_0x283e0e['length'];_0x37a5f7+=0x1){const _0x17d877=_0x283e0e[_0x37a5f7];if(_0x17d877==='(')_0x4d3bc4+=0x1;if(_0x17d877===')')_0x4d3bc4=Math[_0x5b26ac(0x10d)](0x0,_0x4d3bc4-0x1);_0x4d3bc4===0x0&&_0x283e0e[_0x5b26ac(0x156)](_0x37a5f7)['match'](/^AND\b/i)&&(_0x37a5f7===0x0||/\s/[_0x5b26ac(0x13a)](_0x283e0e[_0x37a5f7-0x1]??''))&&(_0x7c6b3f[_0x5b26ac(0x13b)](_0x283e0e[_0x5b26ac(0x156)](_0x2eab1c,_0x37a5f7)[_0x5b26ac(0x151)]()),_0x37a5f7+=0x2,_0x2eab1c=_0x37a5f7+0x1);}const _0x32ce27=_0x283e0e[_0x5b26ac(0x156)](_0x2eab1c)['trim']();if(_0x32ce27)_0x7c6b3f['push'](_0x32ce27);return _0x7c6b3f;}function hasTopLevelKeyword(_0x35cba7,_0x1fee31){const _0x117b3a=a262_0x4135;let _0x19f060=0x0;for(let _0xd57afc=0x0;_0xd57afc<_0x35cba7[_0x117b3a(0x119)];_0xd57afc+=0x1){const _0x2020d4=_0x35cba7[_0xd57afc];if(_0x2020d4==='(')_0x19f060+=0x1;if(_0x2020d4===')')_0x19f060=Math[_0x117b3a(0x10d)](0x0,_0x19f060-0x1);if(_0x19f060!==0x0)continue;const _0x568d37=_0x35cba7['slice'](_0xd57afc,_0xd57afc+_0x1fee31[_0x117b3a(0x119)]),_0x355a22=_0x35cba7[_0xd57afc-0x1]??'\x20',_0x366e76=_0x35cba7[_0xd57afc+_0x1fee31['length']]??'\x20';if(_0x568d37[_0x117b3a(0x144)]()===_0x1fee31['toUpperCase']()&&!/[\w$]/['test'](_0x355a22)&&!/[\w$]/[_0x117b3a(0x13a)](_0x366e76))return!![];}return![];}function splitEquality(_0x1880cd){const _0x2d0a1a=a262_0x4135,_0x451d27=stripOuterParentheses(_0x1880cd);let _0x30cd16=0x0,_0x1f33e9;for(let _0x20b3c9=0x0;_0x20b3c9<_0x451d27[_0x2d0a1a(0x119)];_0x20b3c9+=0x1){const _0x4fa863=_0x451d27[_0x20b3c9];if(_0x4fa863==='(')_0x30cd16+=0x1;if(_0x4fa863===')')_0x30cd16=Math[_0x2d0a1a(0x10d)](0x0,_0x30cd16-0x1);const _0x830a2=_0x451d27[_0x20b3c9-0x1]??'',_0x444266=_0x451d27[_0x20b3c9+0x1]??'';if(_0x4fa863==='='&&_0x30cd16===0x0&&!/[!<>=:]/[_0x2d0a1a(0x13a)](_0x830a2)&&_0x444266!=='='){if(_0x1f33e9!==undefined)return null;_0x1f33e9=_0x20b3c9;}}return _0x1f33e9===undefined?null:[_0x451d27[_0x2d0a1a(0x156)](0x0,_0x1f33e9)[_0x2d0a1a(0x151)](),_0x451d27[_0x2d0a1a(0x156)](_0x1f33e9+0x1)[_0x2d0a1a(0x151)]()];}function parseDirectColumnReference(_0x1697a2,_0x4c1be1){const _0x309621=a262_0x4135,_0x5f183c=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x309621(0x14d)](stripOuterParentheses(_0x1697a2));if(!_0x5f183c)return null;if(normalizeIdentifier(_0x5f183c[0x1]??'')!==normalizeIdentifier(_0x4c1be1))return null;return normalizeIdentifier(_0x5f183c[0x2]??'');}function containsColumnReference(_0x8cdef8,_0xa26be4){const _0xd21aec=a262_0x4135,_0x1be945=_0x8cdef8[_0xd21aec(0x14a)](/[`"]/g,''),_0x2bc746=_0xa26be4[_0xd21aec(0x14a)](/[.*+?^${}()|[\]\\]/g,_0xd21aec(0x110));return new RegExp(_0xd21aec(0x13e)+_0x2bc746+_0xd21aec(0x128),'i')[_0xd21aec(0x13a)](_0x1be945);}function findEqualityPrefix(_0x5b533a,_0xe2d88f){const _0x299806=a262_0x4135,_0xc90845=new Set(_0xe2d88f[_0x299806(0x10e)](normalizeIdentifier)),_0x39cfda=[];for(const _0x5a5a31 of _0x5b533a){if(!_0xc90845[_0x299806(0x113)](normalizeIdentifier(_0x5a5a31)))break;_0x39cfda[_0x299806(0x13b)](_0x5a5a31);}return _0x39cfda;}function a262_0x57c1(){const _0x4ba5c9=['startsWith','63224CfRvhV','(?:^|[^\x5cw$])','unsupportedPredicate','add','sort','includes','error','toUpperCase','warning','split','5680604lIhPMQ','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','2302845VAGHrh','replace','2981626UEPiqR','left','exec','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','toLowerCase','natural','trim','JOIN_INDEX_NOT_USABLE','cross','alias','full','slice','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','INNER','matchAll','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','right','max','map','inner','\x5c$&','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','JOIN_INDEX_MISSING','has','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','10011440nMUZsZ','unknown','replaceAll','table','length','filter','3CfgsVE','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','where','1575gOuiuh','some','1mcdHZM','join','unsupportedReason','containsUnresolvedInclude','search','indexes','8428376BPMzuo','\x5cs*\x5c.\x5cs*[\x5cw$]+','endsWith','unavailable','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','6hNTyoF','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','min','columns','JOIN_PREDICATE_UNSUPPORTED','sql','__sq__','position','tableName','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','index','1763069gusHkh','matchedPrefix','from','test','push'];a262_0x57c1=function(){return _0x4ba5c9;};return a262_0x57c1();}function resolveTableMetadata(_0x5c6c11,_0xbbf50f){const _0xb3a389=a262_0x4135,_0x281865=normalizeIdentifier(_0xbbf50f),_0x1d3c2b=_0x5c6c11[_0xb3a389(0x11a)](_0x4f4612=>normalizeIdentifier(_0x4f4612[_0xb3a389(0x134)])===_0x281865);if(_0x1d3c2b[_0xb3a389(0x119)]===0x1)return _0x1d3c2b[0x0];const _0x30bda9=_0x281865['includes']('.'),_0x49c2f9=_0x281865[_0xb3a389(0x146)]('.')['at'](-0x1),_0x18c31f=_0x5c6c11['filter'](_0x1591d3=>{const _0x4a9d24=_0xb3a389,_0x25ff4d=normalizeIdentifier(_0x1591d3[_0x4a9d24(0x134)]);if(_0x30bda9&&_0x25ff4d[_0x4a9d24(0x142)]('.'))return![];return _0x25ff4d[_0x4a9d24(0x146)]('.')['at'](-0x1)===_0x49c2f9;});return _0x18c31f[_0xb3a389(0x119)]===0x1?_0x18c31f[0x0]:undefined;}function a262_0x4135(_0x22bd85,_0x2682ca){_0x22bd85=_0x22bd85-0x10a;const _0x57c158=a262_0x57c1();let _0x41351c=_0x57c158[_0x22bd85];return _0x41351c;}function columnNamesMatch(_0x4e3f82,_0x3f1436){return normalizeIdentifier(_0x4e3f82)===normalizeIdentifier(_0x3f1436);}function normalizeIdentifier(_0x1bebe4){const _0x53a040=a262_0x4135;return _0x1bebe4[_0x53a040(0x14a)](/[`"]/g,'')[_0x53a040(0x151)]()[_0x53a040(0x14f)]();}function isSqlClauseKeyword(_0x2eae77){const _0x2fe9e8=a262_0x4135;return new Set(['on','using',_0x2fe9e8(0x11e),_0x2fe9e8(0x122),_0x2fe9e8(0x10f),_0x2fe9e8(0x14c),_0x2fe9e8(0x10c),_0x2fe9e8(0x155),_0x2fe9e8(0x153),_0x2fe9e8(0x150)])[_0x2fe9e8(0x113)](_0x2eae77);}function stripOuterParentheses(_0x144580){const _0x59a453=a262_0x4135;let _0x57b573=_0x144580[_0x59a453(0x151)]();while(_0x57b573[_0x59a453(0x13c)]('(')&&_0x57b573[_0x59a453(0x129)](')')){let _0x1fd1b5=0x0,_0x23f7b6=!![];for(let _0x48af64=0x0;_0x48af64<_0x57b573[_0x59a453(0x119)];_0x48af64+=0x1){if(_0x57b573[_0x48af64]==='(')_0x1fd1b5+=0x1;if(_0x57b573[_0x48af64]===')')_0x1fd1b5-=0x1;if(_0x1fd1b5===0x0&&_0x48af64<_0x57b573[_0x59a453(0x119)]-0x1){_0x23f7b6=![];break;}}if(!_0x23f7b6||_0x1fd1b5!==0x0)break;_0x57b573=_0x57b573[_0x59a453(0x156)](0x1,-0x1)[_0x59a453(0x151)]();}return _0x57b573;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a263_0xbce9(){const _0x5dc20d=['77070DoVDkY','809324fQtGpR','2313qrcsSK','5XthYVt','305706TzkLun','270czJocm','sql.lock.json','sql-trash','10ZqbtSc','sql','576009XjcCds','9592uVmzCA','242033QxHVNI','.rabetbase','361299xipAAs'];a263_0xbce9=function(){return _0x5dc20d;};return a263_0xbce9();}const a263_0x3fab4f=a263_0x3d49;(function(_0x1edbbf,_0x4f6aed){const _0x44b46c=a263_0x3d49,_0x2d9545=_0x1edbbf();while(!![]){try{const _0x3d20d1=-parseInt(_0x44b46c(0x7b))/0x1*(parseInt(_0x44b46c(0x78))/0x2)+-parseInt(_0x44b46c(0x77))/0x3+parseInt(_0x44b46c(0x79))/0x4+parseInt(_0x44b46c(0x80))/0x5*(-parseInt(_0x44b46c(0x7c))/0x6)+parseInt(_0x44b46c(0x73))/0x7+parseInt(_0x44b46c(0x74))/0x8*(-parseInt(_0x44b46c(0x7a))/0x9)+-parseInt(_0x44b46c(0x7d))/0xa*(-parseInt(_0x44b46c(0x75))/0xb);if(_0x3d20d1===_0x4f6aed)break;else _0x2d9545['push'](_0x2d9545['shift']());}catch(_0x1d334b){_0x2d9545['push'](_0x2d9545['shift']());}}}(a263_0xbce9,0x25f9a));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a263_0x3fab4f(0x76),LOCK_FILE_NAME=a263_0x3fab4f(0x7e),TRASH_DIR_NAME=a263_0x3fab4f(0x7f);function a263_0x3d49(_0x2a9164,_0x831428){_0x2a9164=_0x2a9164-0x73;const _0xbce988=a263_0xbce9();let _0x3d4961=_0xbce988[_0x2a9164];return _0x3d4961;}export function loadSqlProjectConfig(_0x2c7e06,_0x497344){const _0x4b9c20=a263_0x3fab4f,_0x37d09b=resolve(_0x497344??findProjectRootDirectory()),_0x27ad30=DOT_DIR+'/sql',_0x2af170=_0x27ad30+'/'+_0x2c7e06;return{'projectRoot':_0x37d09b,'appCode':_0x2c7e06,'sqlWorkspaceRoot':_0x27ad30,'sqlRoot':_0x2af170,'sqlRootDir':resolve(_0x37d09b,DOT_DIR,_0x4b9c20(0x81),_0x2c7e06),'lockFilePath':resolve(_0x37d09b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x37d09b,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x377e97,_0x52de5d){const _0x2646cf=a264_0xf705,_0xbef8c8=_0x377e97();while(!![]){try{const _0x498af8=-parseInt(_0x2646cf(0xc7))/0x1*(-parseInt(_0x2646cf(0xc9))/0x2)+-parseInt(_0x2646cf(0xe7))/0x3*(parseInt(_0x2646cf(0xe2))/0x4)+parseInt(_0x2646cf(0xca))/0x5+-parseInt(_0x2646cf(0xda))/0x6+-parseInt(_0x2646cf(0xe4))/0x7*(-parseInt(_0x2646cf(0xe6))/0x8)+parseInt(_0x2646cf(0xce))/0x9*(-parseInt(_0x2646cf(0xe1))/0xa)+parseInt(_0x2646cf(0xd5))/0xb;if(_0x498af8===_0x52de5d)break;else _0xbef8c8['push'](_0xbef8c8['shift']());}catch(_0x52c4fb){_0xbef8c8['push'](_0xbef8c8['shift']());}}}(a264_0x1167,0x82b2d));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x566e7b){const _0x126cef=a264_0xf705;if(_0x566e7b===_0x126cef(0xd4))return _0x126cef(0xd9);if(_0x566e7b===_0x126cef(0xd3))return _0x126cef(0xdf);return undefined;}function a264_0x1167(){const _0x781734=['983144zhmCSo','11985tePnaj','5PtrccJ','name','25790FeOghr','1127715lbKDpy','test','isFile','mode','81NApubv','code','replace','dbName','isDirectory','.xml','.sql','13656610HErBjb','toLowerCase','ENOENT','slice','sql','268344xMQWpE','sqlCode','dbId','length','path','mybatisXml','filter','270440wOcCow','832IUMyyb','sqlRootDir','7BKNQuw','push'];a264_0x1167=function(){return _0x781734;};return a264_0x1167();}async function scanSqlFilesRecursively(_0x4c5e5b,_0x17d7e7){const _0x45ddeb=a264_0xf705,_0x3b352f=[];try{const _0x30ef41=await readdir(_0x4c5e5b,{'withFileTypes':!![]});for(const _0xb18492 of _0x30ef41){const _0x16781e=join(_0x4c5e5b,_0xb18492['name']);if(_0xb18492[_0x45ddeb(0xd2)]()){_0x3b352f[_0x45ddeb(0xe5)](...await scanSqlFilesRecursively(_0x16781e,_0x17d7e7));continue;}if(!_0xb18492[_0x45ddeb(0xcc)]())continue;const _0x112c65=extname(_0xb18492[_0x45ddeb(0xc8)])[_0x45ddeb(0xd6)](),_0x4deb87=extensionToMode(_0x112c65);if(!_0x4deb87)continue;const _0x435fbe=relative(_0x17d7e7,_0x16781e)[_0x45ddeb(0xd0)](/\\/g,'/'),_0x2d5b21=_0x435fbe['split']('/')[_0x45ddeb(0xe0)](Boolean),_0xc945d6=parseSqlPath(_0x2d5b21,_0xb18492[_0x45ddeb(0xc8)],_0x112c65);if(!_0xc945d6)continue;_0x3b352f['push']({'sqlCode':_0xc945d6['sqlCode'],'sqlName':_0xc945d6['sqlName'],'dbDirectory':_0x2d5b21[0x0],'filePath':_0x16781e,'relativePath':_0x435fbe,'lockKey':_0xc945d6[_0x45ddeb(0xdb)],'mode':_0x4deb87});}}catch(_0x3fce03){if(_0x3fce03[_0x45ddeb(0xcf)]!==_0x45ddeb(0xd7))throw _0x3fce03;}return _0x3b352f;}export async function scanLocalSqlQueries(_0x5798c8){const _0x6f0e7b=a264_0xf705;return scanSqlFilesRecursively(_0x5798c8[_0x6f0e7b(0xe3)],_0x5798c8[_0x6f0e7b(0xe3)]);}export function resolveLocalSqlFilePath(_0x249950,_0x5945b1,_0x124b4a){const _0x4e6b8c=a264_0xf705,_0x3a9210=_0x124b4a?.[_0x4e6b8c(0xde)]||(_0x124b4a?.['sqlName']||_0x124b4a?.['dbName']?buildSqlRelativePath(_0x5945b1,_0x124b4a?.['sqlName'],_0x124b4a?.[_0x4e6b8c(0xd1)],_0x124b4a?.[_0x4e6b8c(0xcd)]||_0x4e6b8c(0xd9),_0x124b4a?.[_0x4e6b8c(0xdc)]):buildDefaultSqlFileName(_0x5945b1,_0x124b4a?.[_0x4e6b8c(0xcd)]||'sql'));return join(_0x249950['sqlRootDir'],_0x3a9210);}function a264_0xf705(_0x5c321d,_0x321305){_0x5c321d=_0x5c321d-0xc7;const _0x116704=a264_0x1167();let _0xf705d6=_0x116704[_0x5c321d];return _0xf705d6;}export async function directoryExists(_0x2528fc){const _0x20d01a=a264_0xf705;try{const _0x3a317d=await stat(_0x2528fc);return _0x3a317d[_0x20d01a(0xd2)]();}catch{return![];}}function parseSqlPath(_0x43bae8,_0x99b827,_0x478c36){const _0x4be3c5=a264_0xf705,_0x4b57eb=_0x99b827[_0x4be3c5(0xd8)](0x0,-_0x478c36[_0x4be3c5(0xdd)]);if(_0x43bae8[_0x4be3c5(0xdd)]<0x2)return null;const _0x71b3d7=_0x4b57eb['indexOf']('_');if(_0x71b3d7<=0x0||_0x71b3d7>=_0x4b57eb[_0x4be3c5(0xdd)]-0x1)return null;const _0x473efb=_0x4b57eb[_0x4be3c5(0xd8)](0x0,_0x71b3d7);if(!isLikelySqlCode(_0x473efb))return null;return{'sqlCode':_0x473efb,'sqlName':_0x4b57eb[_0x4be3c5(0xd8)](_0x71b3d7+0x1)};}function isLikelySqlCode(_0x358b6d){const _0x2073ee=a264_0xf705;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2073ee(0xcb)](_0x358b6d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a265_0x13aa(){const _0xb2b0d4=['11rJhFtK','1140cnNYiP','788784OvIPMi','2432604TvuEhl','547674wxjGsS','update','48483enkzzk','42642VBYQKd','md5','54XrZuCm','25164ZIITJl','digest','hex','createHash','utf8','12RgIhlP','445045kxgPTj','329ElmqWD'];a265_0x13aa=function(){return _0xb2b0d4;};return a265_0x13aa();}function a265_0x349c(_0xbd09a,_0x553897){_0xbd09a=_0xbd09a-0xf5;const _0x13aab7=a265_0x13aa();let _0x349cbd=_0x13aab7[_0xbd09a];return _0x349cbd;}(function(_0x3c6acf,_0x35c3b6){const _0x4e2d3b=a265_0x349c,_0xd25437=_0x3c6acf();while(!![]){try{const _0x453292=parseInt(_0x4e2d3b(0xfe))/0x1+-parseInt(_0x4e2d3b(0x101))/0x2*(parseInt(_0x4e2d3b(0x103))/0x3)+parseInt(_0x4e2d3b(0xf7))/0x4*(-parseInt(_0x4e2d3b(0xf8))/0x5)+-parseInt(_0x4e2d3b(0x104))/0x6*(-parseInt(_0x4e2d3b(0xf9))/0x7)+-parseInt(_0x4e2d3b(0xfc))/0x8+parseInt(_0x4e2d3b(0x100))/0x9*(parseInt(_0x4e2d3b(0xfb))/0xa)+parseInt(_0x4e2d3b(0xfa))/0xb*(-parseInt(_0x4e2d3b(0xfd))/0xc);if(_0x453292===_0x35c3b6)break;else _0xd25437['push'](_0xd25437['shift']());}catch(_0xb4a06b){_0xd25437['push'](_0xd25437['shift']());}}}(a265_0x13aa,0x63506));import{readFile}from'node:fs/promises';import a265_0x2380f7 from'node:crypto';export function computeSqlContentHash(_0x4ebc69){const _0x2fc530=a265_0x349c;return a265_0x2380f7[_0x2fc530(0xf5)](_0x2fc530(0x102))[_0x2fc530(0xff)](_0x4ebc69)[_0x2fc530(0x105)](_0x2fc530(0x106));}export async function computeSqlFileHash(_0x253348){const _0x3f704d=a265_0x349c,_0x493b78=await readFile(_0x253348,_0x3f704d(0xf6));return computeSqlContentHash(_0x493b78);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x356c39,_0x10ef38){const _0x3dbc72=a266_0x39b0,_0x12deed=_0x356c39();while(!![]){try{const _0x31e99f=-parseInt(_0x3dbc72(0xb3))/0x1*(parseInt(_0x3dbc72(0xaa))/0x2)+-parseInt(_0x3dbc72(0xad))/0x3+parseInt(_0x3dbc72(0xb0))/0x4*(-parseInt(_0x3dbc72(0xae))/0x5)+parseInt(_0x3dbc72(0xb9))/0x6*(-parseInt(_0x3dbc72(0xb2))/0x7)+-parseInt(_0x3dbc72(0xa8))/0x8*(-parseInt(_0x3dbc72(0xa9))/0x9)+-parseInt(_0x3dbc72(0xb6))/0xa*(-parseInt(_0x3dbc72(0xa7))/0xb)+parseInt(_0x3dbc72(0xac))/0xc;if(_0x31e99f===_0x10ef38)break;else _0x12deed['push'](_0x12deed['shift']());}catch(_0xe826cb){_0x12deed['push'](_0x12deed['shift']());}}}(a266_0x3f4b,0xb2025));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x174c35,_0x1404ca,_0x55661b,_0x32fb6b){const _0x38fea0=a266_0x39b0,_0x259025=_0x174c35??createEmptySqlLock();let _0x36f7f1=_0x259025[_0x38fea0(0xbb)][_0x1404ca];if(!_0x36f7f1)return _0x36f7f1={'sqlRoot':_0x55661b,'lastSync':'','sqls':{}},_0x259025['apps'][_0x1404ca]=_0x36f7f1,{'lockData':_0x259025,'appLock':_0x36f7f1};if(!_0x36f7f1[_0x38fea0(0xa5)])_0x36f7f1[_0x38fea0(0xa5)]=_0x55661b;else{if(_0x36f7f1[_0x38fea0(0xa5)]!==_0x55661b)throw new Error(_0x32fb6b+_0x38fea0(0xab)+_0x55661b+'\x22\x20vs\x20lock\x20\x22'+_0x36f7f1[_0x38fea0(0xa5)]+'\x22.\x20'+_0x38fea0(0xb1));}return!_0x36f7f1[_0x38fea0(0xb7)]&&(_0x36f7f1[_0x38fea0(0xb7)]={}),!_0x36f7f1[_0x38fea0(0xaf)]&&(_0x36f7f1[_0x38fea0(0xaf)]=''),{'lockData':_0x259025,'appLock':_0x36f7f1};}function a266_0x39b0(_0x42a7ee,_0x2e54f7){_0x42a7ee=_0x42a7ee-0xa5;const _0x3f4bdd=a266_0x3f4b();let _0x39b0fb=_0x3f4bdd[_0x42a7ee];return _0x39b0fb;}export async function readSqlLockFile(_0x11027c){const _0x55e62a=a266_0x39b0;try{const _0x1ee065=await readFile(_0x11027c,'utf8');return JSON[_0x55e62a(0xb5)](_0x1ee065);}catch(_0xef3393){if(_0xef3393['code']===_0x55e62a(0xa6))return null;throw new Error(_0x55e62a(0xb4)+String(_0xef3393));}}function a266_0x3f4b(){const _0x3968e5=['parse','10YLGfRh','sqls','utf8','3155226xoMTyF','stringify','apps','sqlRoot','ENOENT','1528461uRNYXZ','128CiVIsi','559161ijpDlA','1128812atXrnm',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','31810944BVQKvY','3014796aTQTvd','1084305ZUtYUJ','lastSync','8Nvfmdj','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','14rjEBfK','1SvDXHM','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'];a266_0x3f4b=function(){return _0x3968e5;};return a266_0x3f4b();}export async function writeSqlLockFile(_0x302139,_0x13b37b){const _0x3757c8=a266_0x39b0;await mkdir(dirname(_0x302139),{'recursive':!![]}),await writeFile(_0x302139,JSON[_0x3757c8(0xba)](_0x13b37b,null,0x2),_0x3757c8(0xb8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x112a5d,_0x573c08){const _0xb86e7=a268_0x4298,_0x878d19=_0x112a5d();while(!![]){try{const _0x1b65ef=-parseInt(_0xb86e7(0xec))/0x1*(parseInt(_0xb86e7(0xee))/0x2)+-parseInt(_0xb86e7(0xea))/0x3+parseInt(_0xb86e7(0xe7))/0x4+-parseInt(_0xb86e7(0xeb))/0x5+parseInt(_0xb86e7(0xf1))/0x6*(parseInt(_0xb86e7(0xf0))/0x7)+-parseInt(_0xb86e7(0xf7))/0x8*(-parseInt(_0xb86e7(0xe6))/0x9)+-parseInt(_0xb86e7(0xed))/0xa*(-parseInt(_0xb86e7(0xf4))/0xb);if(_0x1b65ef===_0x573c08)break;else _0x878d19['push'](_0x878d19['shift']());}catch(_0x2a6296){_0x878d19['push'](_0x878d19['shift']());}}}(a268_0x721e,0xe121c));function a268_0x721e(){const _0x4a0cdd=['replace','217AuaFuQ','85944hVuSVZ','mybatisXml','trim','1532179sjLNLW','test','trimStart','31512MPqZdo','612HbEomS','4308784KnywcP','.xml','unknown-sql','1472157kvcPFG','7940765lxHsrz','1JGAwsX','170bRSlHf','2311986WJvpXJ'];a268_0x721e=function(){return _0x4a0cdd;};return a268_0x721e();}export function detectSqlMode(_0x525286){const _0x523285=a268_0x4298,_0x5d58fb=_0x525286[_0x523285(0xf6)]();if(/^<(select|insert|update|delete)\b/i[_0x523285(0xf5)](_0x5d58fb))return _0x523285(0xf2);return'sql';}export function getSqlFileExtension(_0x514bcd){const _0x4330bd=a268_0x4298;return _0x514bcd==='mybatisXml'?_0x4330bd(0xe8):'.sql';}export function buildDefaultSqlFileName(_0x191a05,_0x5aa766){return''+_0x191a05+getSqlFileExtension(_0x5aa766);}function a268_0x4298(_0x20e710,_0x3f5229){_0x20e710=_0x20e710-0xe6;const _0x721e77=a268_0x721e();let _0x4298ae=_0x721e77[_0x20e710];return _0x4298ae;}export function sanitizeSqlPathSegment(_0x14d30c,_0x3c99c3){const _0x7f986=a268_0x4298,_0x3f8c26=String(_0x14d30c??'')[_0x7f986(0xf3)](),_0x539956=_0x3f8c26[_0x7f986(0xef)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x7f986(0xef)](/\s+/g,'-')[_0x7f986(0xef)](/-+/g,'-')[_0x7f986(0xef)](/^\.+/,'')['replace'](/\.+$/,'')['replace'](/^-+/,'')[_0x7f986(0xef)](/-+$/,'');return _0x539956||_0x3c99c3;}export function buildDbDirectoryName(_0x143bde,_0x60268c){return sanitizeSqlPathSegment(_0x143bde,_0x60268c!=null?'db-'+_0x60268c:'unknown-db');}export function buildSqlRelativePath(_0x16daef,_0x4a476b,_0x411919,_0x59a2db,_0x4d7b97){const _0x5ac143=a268_0x4298,_0x3f5ae0=buildDbDirectoryName(_0x411919,_0x4d7b97),_0x51861f=sanitizeSqlPathSegment(_0x16daef,_0x5ac143(0xe9)),_0x446901=sanitizeSqlPathSegment(_0x4a476b,_0x51861f);return _0x3f5ae0+'/'+_0x51861f+'_'+_0x446901+getSqlFileExtension(_0x59a2db);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a255_0x580350=a255_0x1537;(function(_0x59c076,_0x755a2b){const _0x36b52a=a255_0x1537,_0x57bd39=_0x59c076();while(!![]){try{const _0x584ded=parseInt(_0x36b52a(0x112))/0x1*(-parseInt(_0x36b52a(0x106))/0x2)+parseInt(_0x36b52a(0xdd))/0x3*(parseInt(_0x36b52a(0x11a))/0x4)+-parseInt(_0x36b52a(0xdb))/0x5+parseInt(_0x36b52a(0x10b))/0x6*(-parseInt(_0x36b52a(0xeb))/0x7)+parseInt(_0x36b52a(0x139))/0x8*(parseInt(_0x36b52a(0x130))/0x9)+parseInt(_0x36b52a(0x102))/0xa+parseInt(_0x36b52a(0xfa))/0xb;if(_0x584ded===_0x755a2b)break;else _0x57bd39['push'](_0x57bd39['shift']());}catch(_0x503c0c){_0x57bd39['push'](_0x57bd39['shift']());}}}(a255_0x521a,0xcaf47));const MYBATIS_OUTER_TAGS=new Map([[a255_0x580350(0xf8),a255_0x580350(0xfd)],[a255_0x580350(0xee),a255_0x580350(0xfb)],['update','UPDATE'],['delete','DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a255_0x580350(0x11b),'choose','when',a255_0x580350(0x12d),a255_0x580350(0x127),a255_0x580350(0x129),a255_0x580350(0x118),a255_0x580350(0xf5),'property']),MYBATIS_BRANCH_TAGS=new Set(['if',a255_0x580350(0x11b),a255_0x580350(0x10c),a255_0x580350(0xfe),a255_0x580350(0x12d)]);export const MYBATIS_DYNAMIC_START_MARKER=a255_0x580350(0xd9);export const MYBATIS_DYNAMIC_END_MARKER=a255_0x580350(0x126);export const MYBATIS_INCLUDE_MARKER=a255_0x580350(0x11e);const UNRESOLVED_SQL_FRAGMENT=a255_0x580350(0x105),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a255_0x580350(0x107)+[...MYBATIS_OUTER_TAGS[a255_0x580350(0x121)]()][a255_0x580350(0xe3)]('|')+a255_0x580350(0x12e),'i');export function normalizeSqlForStaticAnalysis(_0x4ef783){const _0x2fcde2=a255_0x580350,_0x3de257=typeof _0x4ef783===_0x2fcde2(0x101)?_0x4ef783:'';if(!startsWithMybatisStatementWrapper(_0x3de257))return{'sql':_0x3de257,'mode':'sql'};let _0x397173=0x0,_0x5e6393='',_0x1a481d,_0x2b95b1=![],_0x300a6a=![];const _0x544e00=[];while(_0x397173<_0x3de257[_0x2fcde2(0xdf)]){if(_0x3de257[_0x2fcde2(0x109)](_0x2fcde2(0x120),_0x397173)){const _0x512035=_0x3de257[_0x2fcde2(0x10d)](_0x2fcde2(0xd8),_0x397173+0x4);if(_0x512035<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x5e6393+='\x20',_0x397173=_0x512035+0x3;continue;}if(_0x3de257[_0x2fcde2(0x109)](_0x2fcde2(0xf1),_0x397173)){if(!_0x2b95b1||_0x300a6a)return invalidMybatisSource(_0x2fcde2(0xed));const _0x16788f=_0x3de257[_0x2fcde2(0x10d)](_0x2fcde2(0xf2),_0x397173+0x9);if(_0x16788f<0x0)return invalidMybatisSource(_0x2fcde2(0xf4));_0x5e6393+=_0x3de257['slice'](_0x397173+0x9,_0x16788f),_0x397173=_0x16788f+0x3;continue;}if(_0x3de257['startsWith']('<?',_0x397173)){if(_0x2b95b1)return invalidMybatisSource('XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x3f4815=_0x3de257['indexOf']('?>',_0x397173+0x2);if(_0x3f4815<0x0)return invalidMybatisSource(_0x2fcde2(0xe0));_0x5e6393+='\x20',_0x397173=_0x3f4815+0x2;continue;}if(_0x3de257[_0x397173]!=='<'){const _0x2064cb=_0x3de257[_0x2fcde2(0x10d)]('<',_0x397173),_0x594fc8=_0x2064cb<0x0?_0x3de257['length']:_0x2064cb,_0x4bff9f=_0x3de257[_0x2fcde2(0x125)](_0x397173,_0x594fc8);if((!_0x2b95b1||_0x300a6a)&&_0x4bff9f[_0x2fcde2(0x127)]())return invalidMybatisSource(_0x2fcde2(0x124));if(_0x2b95b1&&!_0x300a6a){const _0x3e332e=decodeXmlEntities(_0x4bff9f);if(_0x3e332e===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0x5e6393+=_0x3e332e;}else _0x5e6393+='\x20';_0x397173=_0x594fc8;continue;}const _0xca79e7=findXmlTagEnd(_0x3de257,_0x397173);if(_0xca79e7<0x0)return invalidMybatisSource(_0x2fcde2(0xf3));const _0x4bf7aa=_0x3de257[_0x2fcde2(0x125)](_0x397173,_0xca79e7+0x1),_0x27423a=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x2fcde2(0x11d)](_0x4bf7aa);if(!_0x27423a)return invalidMybatisSource(_0x2fcde2(0x115));const _0x2efbdf=_0x27423a[0x1]==='/',_0x34aa08=_0x27423a[0x2]??'',_0x38ea95=_0x34aa08[_0x2fcde2(0xf7)](),_0x5a8220=_0x27423a[0x3]??'',_0x1b1f78=_0x27423a[0x4]==='/',_0x3de0b9=MYBATIS_OUTER_TAGS[_0x2fcde2(0xe1)](_0x38ea95);if(!_0x3de0b9&&!MYBATIS_DYNAMIC_TAGS['has'](_0x38ea95))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0x38ea95+'>.');if(!_0x3de0b9&&_0x34aa08!==_0x38ea95)return invalidMybatisSource(_0x2fcde2(0x135)+_0x34aa08+'>.');if(_0x2efbdf){if(_0x5a8220['trim']()||_0x1b1f78)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x34aa08+'>.');const _0x20e145=_0x544e00['at'](-0x1);if(!_0x20e145||(_0x20e145[_0x2fcde2(0xfc)]?_0x20e145[_0x2fcde2(0x119)]!==_0x38ea95:_0x20e145[_0x2fcde2(0x11c)]!==_0x34aa08))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x34aa08+'>.');_0x544e00[_0x2fcde2(0x128)]();if(_0x20e145['outer'])_0x300a6a=!![];_0x5e6393+=MYBATIS_BRANCH_TAGS['has'](_0x38ea95)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x5a8220))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x34aa08+'>.');if(_0x38ea95===_0x2fcde2(0x114)&&(!_0x1b1f78||_0x544e00['at'](-0x1)?.[_0x2fcde2(0x119)]!=='include'))return invalidMybatisSource(_0x2fcde2(0x10a));if(_0x3de0b9){if(_0x2b95b1||_0x544e00[_0x2fcde2(0xdf)]>0x0)return invalidMybatisSource(_0x2fcde2(0x117));_0x2b95b1=!![],_0x300a6a=_0x1b1f78,_0x1a481d=_0x3de0b9;}else{if(!_0x2b95b1||_0x300a6a)return invalidMybatisSource(_0x2fcde2(0x137)+_0x34aa08+'>.');}_0x5e6393+=_0x38ea95==='where'?_0x2fcde2(0xe9):_0x38ea95==='set'?_0x2fcde2(0x136):_0x38ea95===_0x2fcde2(0xf5)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x2fcde2(0x10f)](_0x38ea95)&&!_0x1b1f78?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x1b1f78&&_0x544e00[_0x2fcde2(0xe2)]({'rawName':_0x34aa08,'tagName':_0x38ea95,'outer':!!_0x3de0b9});}_0x397173=_0xca79e7+0x1;}if(_0x544e00[_0x2fcde2(0xdf)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x544e00['at'](-0x1)?.[_0x2fcde2(0x11c)]+'>.');if(!_0x2b95b1||!_0x300a6a)return invalidMybatisSource(_0x2fcde2(0x12c));return{'sql':_0x5e6393[_0x2fcde2(0x127)](),'mode':_0x2fcde2(0x104),..._0x1a481d?{'statementType':_0x1a481d}:{}};}function hasWellFormedXmlAttributes(_0x4a9adf){const _0x48e156=a255_0x580350;let _0x1f26d2=0x0;const _0x246e49=new Set();while(_0x1f26d2<_0x4a9adf['length']){while(_0x1f26d2<_0x4a9adf['length']&&/\s/[_0x48e156(0x111)](_0x4a9adf[_0x1f26d2]??''))_0x1f26d2+=0x1;if(_0x1f26d2>=_0x4a9adf[_0x48e156(0xdf)])return!![];const _0x3be1c0=/^[A-Za-z_:][\w:.-]*/[_0x48e156(0x11d)](_0x4a9adf[_0x48e156(0x125)](_0x1f26d2)),_0x209426=_0x3be1c0?.[0x0];if(!_0x209426||_0x246e49[_0x48e156(0x10f)](_0x209426))return![];_0x246e49[_0x48e156(0x133)](_0x209426),_0x1f26d2+=_0x209426['length'];while(_0x1f26d2<_0x4a9adf[_0x48e156(0xdf)]&&/\s/[_0x48e156(0x111)](_0x4a9adf[_0x1f26d2]??''))_0x1f26d2+=0x1;if(_0x4a9adf[_0x1f26d2]!=='=')return![];_0x1f26d2+=0x1;while(_0x1f26d2<_0x4a9adf[_0x48e156(0xdf)]&&/\s/['test'](_0x4a9adf[_0x1f26d2]??''))_0x1f26d2+=0x1;const _0x1fafc0=_0x4a9adf[_0x1f26d2];if(_0x1fafc0!=='\x22'&&_0x1fafc0!=='\x27')return![];_0x1f26d2+=0x1;const _0x619d28=_0x4a9adf[_0x48e156(0x10d)](_0x1fafc0,_0x1f26d2);if(_0x619d28<0x0)return![];if(decodeXmlEntities(_0x4a9adf['slice'](_0x1f26d2,_0x619d28))===null)return![];_0x1f26d2=_0x619d28+0x1;}return!![];}function a255_0x1537(_0x1d44c5,_0x225ed5){_0x1d44c5=_0x1d44c5-0xd8;const _0x521ad3=a255_0x521a();let _0x153729=_0x521ad3[_0x1d44c5];return _0x153729;}function startsWithMybatisStatementWrapper(_0x33a3e9){const _0x2e8a47=a255_0x580350;let _0x387755=0x0;const _0x49ac28=()=>{const _0x425ec3=a255_0x1537;while(_0x387755<_0x33a3e9['length']&&/\s/[_0x425ec3(0x111)](_0x33a3e9[_0x387755]??''))_0x387755+=0x1;};_0x49ac28();while(_0x387755<_0x33a3e9['length']){if(_0x33a3e9[_0x2e8a47(0x109)]('<!--',_0x387755)){const _0x272279=_0x33a3e9[_0x2e8a47(0x10d)](_0x2e8a47(0xd8),_0x387755+0x4);if(_0x272279<0x0)return!![];_0x387755=_0x272279+0x3,_0x49ac28();continue;}if(_0x33a3e9[_0x2e8a47(0x109)]('<?',_0x387755)){const _0x4e218d=_0x33a3e9[_0x2e8a47(0x10d)]('?>',_0x387755+0x2);if(_0x4e218d<0x0)return!![];_0x387755=_0x4e218d+0x2,_0x49ac28();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x2e8a47(0x111)](_0x33a3e9['slice'](_0x387755));}function invalidMybatisSource(_0x472a7c){const _0x32e0c3=a255_0x580350;return{'sql':'','mode':_0x32e0c3(0x104),'error':_0x472a7c};}function findXmlTagEnd(_0x573a5a,_0x4b98e2){let _0x35b37b;for(let _0x487ed6=_0x4b98e2+0x1;_0x487ed6<_0x573a5a['length'];_0x487ed6+=0x1){const _0x250486=_0x573a5a[_0x487ed6];if(_0x35b37b){if(_0x250486===_0x35b37b)_0x35b37b=undefined;continue;}if(_0x250486==='\x22'||_0x250486==='\x27'){_0x35b37b=_0x250486;continue;}if(_0x250486==='>')return _0x487ed6;}return-0x1;}function decodeXmlEntities(_0x575bfe){const _0x78e79d=a255_0x580350;let _0x331f9a=![];const _0x49ee1c=_0x575bfe[_0x78e79d(0x113)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x58a256=>{const _0x51a2d8=_0x78e79d;if(_0x58a256===_0x51a2d8(0xea))return'<';if(_0x58a256===_0x51a2d8(0xf0))return'>';if(_0x58a256==='"')return'\x22';if(_0x58a256===_0x51a2d8(0x103))return'\x27';if(_0x58a256===_0x51a2d8(0x116))return'&';const _0x2565b0=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x51a2d8(0x11d)](_0x58a256);if(_0x2565b0){const _0x366034=_0x2565b0[0x1],_0x4e0937=_0x2565b0[0x2],_0xd24d2a=Number[_0x51a2d8(0xe6)](_0x366034??_0x4e0937??'',_0x366034?0x10:0xa);if(isValidXmlCharacter(_0xd24d2a))return String['fromCodePoint'](_0xd24d2a);}return _0x331f9a=!![],'';});return _0x331f9a?null:_0x49ee1c;}function isValidXmlCharacter(_0x21484f){return _0x21484f===0x9||_0x21484f===0xa||_0x21484f===0xd||_0x21484f>=0x20&&_0x21484f<=0xd7ff||_0x21484f>=0xe000&&_0x21484f<=0xfffd||_0x21484f>=0x10000&&_0x21484f<=0x10ffff;}export function detectSqlType(_0x1e2ba5){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1e2ba5));}function detectNormalizedSqlType(_0x13b91e){const _0x27d1d1=a255_0x580350;if(_0x13b91e[_0x27d1d1(0x12a)])return{'type':_0x27d1d1(0x123),'isSelectOnly':![],'isDangerous':![],'reason':_0x13b91e[_0x27d1d1(0x12a)]};if(!_0x13b91e[_0x27d1d1(0xf6)][_0x27d1d1(0x127)]())return{'type':_0x27d1d1(0x123),'isSelectOnly':![],'isDangerous':![],'reason':_0x27d1d1(0xe7)};const _0x234e89=stripStaticAnalysisMarkers(_0x13b91e['sql'])[_0x27d1d1(0x113)](/#\{[^}]*\}/g,'?')[_0x27d1d1(0x113)](/\$\{[^}]*\}/g,'?')[_0x27d1d1(0x113)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x27d1d1(0x113)](/\/\*[\s\S]*?\*\//g,'')[_0x27d1d1(0x127)](),_0x48ac41=_0x234e89[_0x27d1d1(0xe8)]('\x0a');let _0x4e63d2='';for(const _0x36f7b1 of _0x48ac41){const _0x14f984=_0x36f7b1[_0x27d1d1(0x127)]();if(!_0x14f984||_0x14f984[_0x27d1d1(0x109)]('--')||_0x14f984[_0x27d1d1(0x109)]('/*'))continue;_0x4e63d2=_0x14f984;break;}const _0x4c0188=_0x4e63d2[_0x27d1d1(0xde)](),_0xd58f29=_0x13b91e[_0x27d1d1(0x100)],_0x2ff079=maskSqlTextForBlockedKeywordScan(_0x234e89),_0x1b69b4=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x27d1d1(0x111)](_0x2ff079);if(_0xd58f29===_0x27d1d1(0xfd)||!_0xd58f29&&(_0x4c0188['startsWith'](_0x27d1d1(0xfd))||_0x4c0188[_0x27d1d1(0x109)](_0x27d1d1(0xdc)))){const _0x5edc81=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x27d1d1(0x111)](_0x234e89);return{'type':'SELECT','isSelectOnly':!_0x5edc81,'isDangerous':_0x5edc81,'reason':_0x5edc81?_0x27d1d1(0x110):undefined};}if(_0xd58f29===_0x27d1d1(0xfb)||!_0xd58f29&&_0x4c0188['startsWith'](_0x27d1d1(0xfb)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x1b69b4,'reason':_0x1b69b4?_0x27d1d1(0x12b):undefined};if(_0xd58f29==='UPDATE'||!_0xd58f29&&_0x4c0188[_0x27d1d1(0x109)]('UPDATE'))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x1b69b4,'reason':_0x1b69b4?_0x27d1d1(0x12b):undefined};if(_0xd58f29===_0x27d1d1(0x122)||!_0xd58f29&&_0x4c0188[_0x27d1d1(0x109)](_0x27d1d1(0x122)))return{'type':_0x27d1d1(0x122),'isSelectOnly':![],'isDangerous':!![],'reason':_0x27d1d1(0x108)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x4c0188))return{'type':_0x27d1d1(0xec),'isSelectOnly':![],'isDangerous':!![],'reason':_0x27d1d1(0x11f)};return{'type':_0x27d1d1(0x123),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3e5448){const _0x2d2fa4=a255_0x580350;return _0x3e5448['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x2d2fa4(0x131)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x3c1149){const _0x29954f=a255_0x580350;return _0x3c1149['replace'](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x29954f(0x113)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x29954f(0x113)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x29954f(0x113)](/--.*$/gm,'\x20')[_0x29954f(0x113)](/#.*$/gm,'\x20')[_0x29954f(0x113)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x5bc90c){const _0xf1e602=a255_0x580350,_0x4befa5=_0x5bc90c['replace'](/#\{[^}]*\}/g,'?')[_0xf1e602(0x113)](/\$\{[^}]*\}/g,'?')[_0xf1e602(0x113)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0xf1e602(0x113)](/\/\*[\s\S]*?\*\//g,''),_0x180beb=[],_0x365643=_0x4befa5[_0xf1e602(0x12f)](/FROM\s+([^\s,)(]+)/i);addTable(_0x180beb,_0x365643?.[0x1]);for(const _0x27396f of _0x4befa5['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x180beb,_0x27396f[0x1]);}const _0x22e931=_0x4befa5[_0xf1e602(0x12f)](/INTO\s+([^\s(]+)/i);addTable(_0x180beb,_0x22e931?.[0x1]);const _0x2f3b8a=_0x4befa5['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x180beb,_0x2f3b8a?.[0x1]),_0x180beb;}function a255_0x521a(){const _0x271bdf=['unknown\x20table(s)','>','<![CDATA[',']]>','Unterminated\x20MyBatis\x20XML\x20tag.','Unterminated\x20CDATA\x20section.','include','sql','toLowerCase','select','matchAll','16989368qSFNAT','INSERT','outer','SELECT','when','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','statementType','string','9293240pRlfiH',''','mybatisXml','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','1566758UdMsTP','^<\x5cs*(?:','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','startsWith','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','646746HfvsMS','choose','indexOf','Unable\x20to\x20detect\x20SQL\x20type.\x20','has','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','test','1fufBfB','replace','property','Invalid\x20MyBatis\x20XML\x20tag.','&','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','bind','tagName','4539716ixnzbJ','foreach','rawName','exec','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','<!--','keys','DELETE','UNKNOWN','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','slice','__RABETBASE_MYBATIS_DYNAMIC_END__','trim','pop','set','error','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','otherwise',')\x5cb','match','2178mjsjTo','replaceAll','\x20query\x20targeting\x20','add','type','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','\x20SET\x20','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','6296VbsTIS','-->','__RABETBASE_MYBATIS_DYNAMIC_START__','includes','3916150rjKspR','WITH','3ADlGXV','toUpperCase','length','Unterminated\x20XML\x20declaration.','get','push','join','from','\x20with\x20parameters:\x20','parseInt','SQL\x20content\x20is\x20empty','split','\x20WHERE\x20','<','91BHtdsP','DDL','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','insert'];a255_0x521a=function(){return _0x271bdf;};return a255_0x521a();}function addTable(_0x1782e0,_0x4bdbf5){const _0x6207af=a255_0x580350,_0x47be33=_0x4bdbf5?.[_0x6207af(0x113)](/[`"]/g,'');_0x47be33&&_0x47be33!==UNRESOLVED_SQL_FRAGMENT&&!_0x1782e0[_0x6207af(0xda)](_0x47be33)&&_0x1782e0['push'](_0x47be33);}function extractParameters(_0x2b3256){const _0x56f950=a255_0x580350,_0x3c92fd=new Set();for(const _0x19ded8 of _0x2b3256[_0x56f950(0xf9)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x19ded8[0x1])_0x3c92fd[_0x56f950(0x133)](_0x19ded8[0x1]);}return Array[_0x56f950(0xe4)](_0x3c92fd);}export function validateSql(_0x51f173){const _0x36d100=a255_0x580350,_0x586d27=normalizeSqlForStaticAnalysis(_0x51f173),_0x14def0=detectNormalizedSqlType(_0x586d27),_0x5d128b=stripStaticAnalysisMarkers(_0x586d27[_0x36d100(0xf6)]),_0x3ac902=_0x586d27[_0x36d100(0x12a)]?[]:extractTables(_0x5d128b),_0x354b49=_0x586d27[_0x36d100(0x12a)]?[]:extractParameters(_0x5d128b);if(_0x14def0['isDangerous'])return{'valid':![],'sqlType':_0x14def0,'tables':_0x3ac902,'parameters':_0x354b49,'message':_0x14def0['reason']||_0x14def0['type']+_0x36d100(0x138)};if(_0x14def0[_0x36d100(0x134)]==='UNKNOWN')return{'valid':![],'sqlType':_0x14def0,'tables':_0x3ac902,'parameters':_0x354b49,'message':_0x586d27[_0x36d100(0x12a)]?_0x36d100(0x10e)+_0x586d27[_0x36d100(0x12a)]:_0x36d100(0xff)};return{'valid':!![],'sqlType':_0x14def0,'tables':_0x3ac902,'parameters':_0x354b49,'message':_0x14def0[_0x36d100(0x134)]+_0x36d100(0x132)+(_0x3ac902[_0x36d100(0xdf)]?_0x3ac902[_0x36d100(0xe3)](',\x20'):_0x36d100(0xef))+(_0x354b49[_0x36d100(0xdf)]?_0x36d100(0xe5)+_0x354b49[_0x36d100(0xe3)](',\x20'):'')};}
|
|
1
|
+
const a269_0x31b06a=a269_0x3945;(function(_0xd7fe11,_0x5e6ce0){const _0x6b6b14=a269_0x3945,_0x2c841c=_0xd7fe11();while(!![]){try{const _0x3ace62=-parseInt(_0x6b6b14(0x126))/0x1+-parseInt(_0x6b6b14(0x12b))/0x2+parseInt(_0x6b6b14(0x141))/0x3+-parseInt(_0x6b6b14(0x121))/0x4*(parseInt(_0x6b6b14(0x159))/0x5)+-parseInt(_0x6b6b14(0x142))/0x6+-parseInt(_0x6b6b14(0x153))/0x7*(parseInt(_0x6b6b14(0x16a))/0x8)+parseInt(_0x6b6b14(0x166))/0x9*(parseInt(_0x6b6b14(0x131))/0xa);if(_0x3ace62===_0x5e6ce0)break;else _0x2c841c['push'](_0x2c841c['shift']());}catch(_0x356b67){_0x2c841c['push'](_0x2c841c['shift']());}}}(a269_0x2115,0xe7624));const MYBATIS_OUTER_TAGS=new Map([[a269_0x31b06a(0x158),a269_0x31b06a(0x119)],['insert',a269_0x31b06a(0x160)],[a269_0x31b06a(0x165),a269_0x31b06a(0x129)],[a269_0x31b06a(0x134),a269_0x31b06a(0x13c)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a269_0x31b06a(0x150),'foreach',a269_0x31b06a(0x12e),'when',a269_0x31b06a(0x156),'trim',a269_0x31b06a(0x147),a269_0x31b06a(0x12f),a269_0x31b06a(0x157),a269_0x31b06a(0x14b)]),MYBATIS_BRANCH_TAGS=new Set(['if',a269_0x31b06a(0x13f),'choose','when',a269_0x31b06a(0x156)]);export const MYBATIS_DYNAMIC_START_MARKER=a269_0x31b06a(0x133);export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';export const MYBATIS_INCLUDE_MARKER=a269_0x31b06a(0x168);const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a269_0x31b06a(0x120)+[...MYBATIS_OUTER_TAGS[a269_0x31b06a(0x140)]()]['join']('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0xcd5101){const _0x191231=a269_0x31b06a,_0x4fca11=typeof _0xcd5101===_0x191231(0x117)?_0xcd5101:'';if(!startsWithMybatisStatementWrapper(_0x4fca11))return{'sql':_0x4fca11,'mode':_0x191231(0x152)};let _0x43a59c=0x0,_0x5d78a4='',_0x1e9c36,_0x291e39=![],_0x2ae505=![];const _0x5a5abb=[];while(_0x43a59c<_0x4fca11[_0x191231(0x11f)]){if(_0x4fca11[_0x191231(0x162)]('<!--',_0x43a59c)){const _0x37a317=_0x4fca11['indexOf'](_0x191231(0x118),_0x43a59c+0x4);if(_0x37a317<0x0)return invalidMybatisSource(_0x191231(0x16e));_0x5d78a4+='\x20',_0x43a59c=_0x37a317+0x3;continue;}if(_0x4fca11[_0x191231(0x162)]('<;if(_0x318366<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x5d78a4+=_0x4fca11[_0x191231(0x125)](_0x43a59c+0x9,_0x318366),_0x43a59c=_0x318366+0x3;continue;}if(_0x4fca11[_0x191231(0x162)]('<?',_0x43a59c)){if(_0x291e39)return invalidMybatisSource(_0x191231(0x11c));const _0x163038=_0x4fca11[_0x191231(0x135)]('?>',_0x43a59c+0x2);if(_0x163038<0x0)return invalidMybatisSource(_0x191231(0x139));_0x5d78a4+='\x20',_0x43a59c=_0x163038+0x2;continue;}if(_0x4fca11[_0x43a59c]!=='<'){const _0x47e044=_0x4fca11['indexOf']('<',_0x43a59c),_0x23793b=_0x47e044<0x0?_0x4fca11[_0x191231(0x11f)]:_0x47e044,_0x1439a1=_0x4fca11['slice'](_0x43a59c,_0x23793b);if((!_0x291e39||_0x2ae505)&&_0x1439a1[_0x191231(0x16d)]())return invalidMybatisSource(_0x191231(0x122));if(_0x291e39&&!_0x2ae505){const _0x32187b=decodeXmlEntities(_0x1439a1);if(_0x32187b===null)return invalidMybatisSource(_0x191231(0x13d));_0x5d78a4+=_0x32187b;}else _0x5d78a4+='\x20';_0x43a59c=_0x23793b;continue;}const _0x4be32e=findXmlTagEnd(_0x4fca11,_0x43a59c);if(_0x4be32e<0x0)return invalidMybatisSource(_0x191231(0x155));const _0x3acd21=_0x4fca11[_0x191231(0x125)](_0x43a59c,_0x4be32e+0x1),_0x104a97=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x3acd21);if(!_0x104a97)return invalidMybatisSource(_0x191231(0x14e));const _0x1d1049=_0x104a97[0x1]==='/',_0x193268=_0x104a97[0x2]??'',_0x371269=_0x193268[_0x191231(0x145)](),_0x233d41=_0x104a97[0x3]??'',_0x3c6518=_0x104a97[0x4]==='/',_0x243bdd=MYBATIS_OUTER_TAGS[_0x191231(0x146)](_0x371269);if(!_0x243bdd&&!MYBATIS_DYNAMIC_TAGS['has'](_0x371269))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0x371269+'>.');if(!_0x243bdd&&_0x193268!==_0x371269)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x193268+'>.');if(_0x1d1049){if(_0x233d41[_0x191231(0x16d)]()||_0x3c6518)return invalidMybatisSource(_0x191231(0x128)+_0x193268+'>.');const _0x454810=_0x5a5abb['at'](-0x1);if(!_0x454810||(_0x454810[_0x191231(0x16b)]?_0x454810['tagName']!==_0x371269:_0x454810[_0x191231(0x15f)]!==_0x193268))return invalidMybatisSource(_0x191231(0x124)+_0x193268+'>.');_0x5a5abb[_0x191231(0x15d)]();if(_0x454810[_0x191231(0x16b)])_0x2ae505=!![];_0x5d78a4+=MYBATIS_BRANCH_TAGS['has'](_0x371269)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x233d41))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x193268+'>.');if(_0x371269===_0x191231(0x14b)&&(!_0x3c6518||_0x5a5abb['at'](-0x1)?.[_0x191231(0x11a)]!=='include'))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x243bdd){if(_0x291e39||_0x5a5abb[_0x191231(0x11f)]>0x0)return invalidMybatisSource(_0x191231(0x164));_0x291e39=!![],_0x2ae505=_0x3c6518,_0x1e9c36=_0x243bdd;}else{if(!_0x291e39||_0x2ae505)return invalidMybatisSource(_0x191231(0x116)+_0x193268+'>.');}_0x5d78a4+=_0x371269==='where'?_0x191231(0x15b):_0x371269===_0x191231(0x147)?'\x20SET\x20':_0x371269===_0x191231(0x157)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x191231(0x130)](_0x371269)&&!_0x3c6518?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x3c6518&&_0x5a5abb['push']({'rawName':_0x193268,'tagName':_0x371269,'outer':!!_0x243bdd});}_0x43a59c=_0x4be32e+0x1;}if(_0x5a5abb['length']>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x5a5abb['at'](-0x1)?.[_0x191231(0x15f)]+'>.');if(!_0x291e39||!_0x2ae505)return invalidMybatisSource(_0x191231(0x11d));return{'sql':_0x5d78a4[_0x191231(0x16d)](),'mode':'mybatisXml',..._0x1e9c36?{'statementType':_0x1e9c36}:{}};}function hasWellFormedXmlAttributes(_0x33076b){const _0x3d5244=a269_0x31b06a;let _0x569f79=0x0;const _0x1dd030=new Set();while(_0x569f79<_0x33076b[_0x3d5244(0x11f)]){while(_0x569f79<_0x33076b[_0x3d5244(0x11f)]&&/\s/[_0x3d5244(0x151)](_0x33076b[_0x569f79]??''))_0x569f79+=0x1;if(_0x569f79>=_0x33076b[_0x3d5244(0x11f)])return!![];const _0x1e0db4=/^[A-Za-z_:][\w:.-]*/['exec'](_0x33076b['slice'](_0x569f79)),_0x2e8bba=_0x1e0db4?.[0x0];if(!_0x2e8bba||_0x1dd030['has'](_0x2e8bba))return![];_0x1dd030[_0x3d5244(0x13b)](_0x2e8bba),_0x569f79+=_0x2e8bba[_0x3d5244(0x11f)];while(_0x569f79<_0x33076b[_0x3d5244(0x11f)]&&/\s/[_0x3d5244(0x151)](_0x33076b[_0x569f79]??''))_0x569f79+=0x1;if(_0x33076b[_0x569f79]!=='=')return![];_0x569f79+=0x1;while(_0x569f79<_0x33076b[_0x3d5244(0x11f)]&&/\s/[_0x3d5244(0x151)](_0x33076b[_0x569f79]??''))_0x569f79+=0x1;const _0x2b4ae0=_0x33076b[_0x569f79];if(_0x2b4ae0!=='\x22'&&_0x2b4ae0!=='\x27')return![];_0x569f79+=0x1;const _0xfd816f=_0x33076b[_0x3d5244(0x135)](_0x2b4ae0,_0x569f79);if(_0xfd816f<0x0)return![];if(decodeXmlEntities(_0x33076b[_0x3d5244(0x125)](_0x569f79,_0xfd816f))===null)return![];_0x569f79=_0xfd816f+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x6d47f6){const _0x1a52ac=a269_0x31b06a;let _0xf54405=0x0;const _0x4a5e4c=()=>{const _0xb55f2=a269_0x3945;while(_0xf54405<_0x6d47f6[_0xb55f2(0x11f)]&&/\s/[_0xb55f2(0x151)](_0x6d47f6[_0xf54405]??''))_0xf54405+=0x1;};_0x4a5e4c();while(_0xf54405<_0x6d47f6['length']){if(_0x6d47f6[_0x1a52ac(0x162)](_0x1a52ac(0x11b),_0xf54405)){const _0x1261d6=_0x6d47f6[_0x1a52ac(0x135)]('-->',_0xf54405+0x4);if(_0x1261d6<0x0)return!![];_0xf54405=_0x1261d6+0x3,_0x4a5e4c();continue;}if(_0x6d47f6[_0x1a52ac(0x162)]('<?',_0xf54405)){const _0x13161a=_0x6d47f6[_0x1a52ac(0x135)]('?>',_0xf54405+0x2);if(_0x13161a<0x0)return!![];_0xf54405=_0x13161a+0x2,_0x4a5e4c();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x1a52ac(0x151)](_0x6d47f6[_0x1a52ac(0x125)](_0xf54405));}function invalidMybatisSource(_0x291b28){const _0x364299=a269_0x31b06a;return{'sql':'','mode':_0x364299(0x12d),'error':_0x291b28};}function findXmlTagEnd(_0x27a5cd,_0x29d307){let _0x2c4642;for(let _0x51a2ed=_0x29d307+0x1;_0x51a2ed<_0x27a5cd['length'];_0x51a2ed+=0x1){const _0x1217a9=_0x27a5cd[_0x51a2ed];if(_0x2c4642){if(_0x1217a9===_0x2c4642)_0x2c4642=undefined;continue;}if(_0x1217a9==='\x22'||_0x1217a9==='\x27'){_0x2c4642=_0x1217a9;continue;}if(_0x1217a9==='>')return _0x51a2ed;}return-0x1;}function decodeXmlEntities(_0x482018){const _0x4fddd5=a269_0x31b06a;let _0x4d4ab3=![];const _0x5b61ce=_0x482018[_0x4fddd5(0x16c)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x448b7e=>{const _0x5d0df2=_0x4fddd5;if(_0x448b7e===_0x5d0df2(0x137))return'<';if(_0x448b7e===_0x5d0df2(0x136))return'>';if(_0x448b7e==='"')return'\x22';if(_0x448b7e===_0x5d0df2(0x132))return'\x27';if(_0x448b7e===_0x5d0df2(0x15a))return'&';const _0x5aea61=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x5d0df2(0x127)](_0x448b7e);if(_0x5aea61){const _0x18142a=_0x5aea61[0x1],_0x1dcade=_0x5aea61[0x2],_0x3d2647=Number[_0x5d0df2(0x12c)](_0x18142a??_0x1dcade??'',_0x18142a?0x10:0xa);if(isValidXmlCharacter(_0x3d2647))return String['fromCodePoint'](_0x3d2647);}return _0x4d4ab3=!![],'';});return _0x4d4ab3?null:_0x5b61ce;}function a269_0x2115(){const _0x3c7182=['type','WITH','property','statementType','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','Invalid\x20MyBatis\x20XML\x20tag.','error','where','test','sql','77IaQOia','isDangerous','Unterminated\x20MyBatis\x20XML\x20tag.','otherwise','include','select','20MPsGCv','&','\x20WHERE\x20','split','pop','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','rawName','INSERT','toUpperCase','startsWith','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','update','65619459dLIpuo','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','UNKNOWN','1378088zSonpt','outer','replace','trim','Unterminated\x20XML\x20comment.','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','string','-->','SELECT','tagName','<!--','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','unknown\x20table(s)','length','^<\x5cs*(?:','922312Aambfz','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Unable\x20to\x20detect\x20SQL\x20type.\x20','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','slice','1676608wMztje','exec','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','UPDATE','match','3090836KUQWnW','parseInt','mybatisXml','choose','bind','has','10FbJlHr',''','__RABETBASE_MYBATIS_DYNAMIC_START__','delete','indexOf','>','<','replaceAll','Unterminated\x20XML\x20declaration.','includes','add','DELETE','Invalid\x20XML\x20entity\x20reference.','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','foreach','keys','1438632RKmKiC','4701828fxbXiQ','\x20with\x20parameters:\x20','matchAll','toLowerCase','get','set','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'];a269_0x2115=function(){return _0x3c7182;};return a269_0x2115();}function isValidXmlCharacter(_0x15a320){return _0x15a320===0x9||_0x15a320===0xa||_0x15a320===0xd||_0x15a320>=0x20&&_0x15a320<=0xd7ff||_0x15a320>=0xe000&&_0x15a320<=0xfffd||_0x15a320>=0x10000&&_0x15a320<=0x10ffff;}export function detectSqlType(_0x1b1bf3){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x1b1bf3));}function a269_0x3945(_0x207c36,_0x372c32){_0x207c36=_0x207c36-0x116;const _0x211558=a269_0x2115();let _0x3945ef=_0x211558[_0x207c36];return _0x3945ef;}function detectNormalizedSqlType(_0x2cec74){const _0x47e34a=a269_0x31b06a;if(_0x2cec74['error'])return{'type':_0x47e34a(0x169),'isSelectOnly':![],'isDangerous':![],'reason':_0x2cec74[_0x47e34a(0x14f)]};if(!_0x2cec74[_0x47e34a(0x152)][_0x47e34a(0x16d)]())return{'type':_0x47e34a(0x169),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x11586f=stripStaticAnalysisMarkers(_0x2cec74[_0x47e34a(0x152)])[_0x47e34a(0x16c)](/#\{[^}]*\}/g,'?')[_0x47e34a(0x16c)](/\$\{[^}]*\}/g,'?')[_0x47e34a(0x16c)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x47e34a(0x16c)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x23a04b=_0x11586f[_0x47e34a(0x15c)]('\x0a');let _0x12d4da='';for(const _0x483b78 of _0x23a04b){const _0x3741cf=_0x483b78[_0x47e34a(0x16d)]();if(!_0x3741cf||_0x3741cf['startsWith']('--')||_0x3741cf[_0x47e34a(0x162)]('/*'))continue;_0x12d4da=_0x3741cf;break;}const _0x26f7db=_0x12d4da[_0x47e34a(0x161)](),_0x49ae47=_0x2cec74[_0x47e34a(0x14c)],_0x4d5794=maskSqlTextForBlockedKeywordScan(_0x11586f),_0x725312=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x4d5794);if(_0x49ae47===_0x47e34a(0x119)||!_0x49ae47&&(_0x26f7db[_0x47e34a(0x162)](_0x47e34a(0x119))||_0x26f7db['startsWith'](_0x47e34a(0x14a)))){const _0x27f382=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x47e34a(0x151)](_0x11586f);return{'type':_0x47e34a(0x119),'isSelectOnly':!_0x27f382,'isDangerous':_0x27f382,'reason':_0x27f382?_0x47e34a(0x163):undefined};}if(_0x49ae47===_0x47e34a(0x160)||!_0x49ae47&&_0x26f7db[_0x47e34a(0x162)](_0x47e34a(0x160)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x725312,'reason':_0x725312?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x49ae47==='UPDATE'||!_0x49ae47&&_0x26f7db[_0x47e34a(0x162)]('UPDATE'))return{'type':_0x47e34a(0x129),'isSelectOnly':![],'isDangerous':_0x725312,'reason':_0x725312?_0x47e34a(0x13e):undefined};if(_0x49ae47==='DELETE'||!_0x49ae47&&_0x26f7db[_0x47e34a(0x162)](_0x47e34a(0x13c)))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x47e34a(0x14d)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x47e34a(0x151)](_0x26f7db))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':'DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'};return{'type':_0x47e34a(0x169),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x5e2235){const _0x196bc3=a269_0x31b06a;return _0x5e2235['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x196bc3(0x138)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x196bc3(0x138)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x322459){const _0x51243f=a269_0x31b06a;return _0x322459[_0x51243f(0x16c)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x51243f(0x16c)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x51243f(0x16c)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x51243f(0x16c)](/--.*$/gm,'\x20')['replace'](/#.*$/gm,'\x20')['replace'](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x421f97){const _0x458a8f=a269_0x31b06a,_0x17fa17=_0x421f97[_0x458a8f(0x16c)](/#\{[^}]*\}/g,'?')[_0x458a8f(0x16c)](/\$\{[^}]*\}/g,'?')[_0x458a8f(0x16c)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x54a370=[],_0x5259eb=_0x17fa17[_0x458a8f(0x12a)](/FROM\s+([^\s,)(]+)/i);addTable(_0x54a370,_0x5259eb?.[0x1]);for(const _0x2f848d of _0x17fa17['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x54a370,_0x2f848d[0x1]);}const _0xc961d=_0x17fa17[_0x458a8f(0x12a)](/INTO\s+([^\s(]+)/i);addTable(_0x54a370,_0xc961d?.[0x1]);const _0x2b370e=_0x17fa17[_0x458a8f(0x12a)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x54a370,_0x2b370e?.[0x1]),_0x54a370;}function addTable(_0x1be7b9,_0x428f36){const _0x24b110=a269_0x31b06a,_0x28ddf4=_0x428f36?.[_0x24b110(0x16c)](/[`"]/g,'');_0x28ddf4&&_0x28ddf4!==UNRESOLVED_SQL_FRAGMENT&&!_0x1be7b9[_0x24b110(0x13a)](_0x28ddf4)&&_0x1be7b9['push'](_0x28ddf4);}function extractParameters(_0x4877e3){const _0x2347af=a269_0x31b06a,_0x44037c=new Set();for(const _0x1774a9 of _0x4877e3[_0x2347af(0x144)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x1774a9[0x1])_0x44037c[_0x2347af(0x13b)](_0x1774a9[0x1]);}return Array['from'](_0x44037c);}export function validateSql(_0x1d2a86){const _0x67e829=a269_0x31b06a,_0x3c663e=normalizeSqlForStaticAnalysis(_0x1d2a86),_0x498404=detectNormalizedSqlType(_0x3c663e),_0x169e1b=stripStaticAnalysisMarkers(_0x3c663e['sql']),_0x4d5233=_0x3c663e[_0x67e829(0x14f)]?[]:extractTables(_0x169e1b),_0x4aa3a2=_0x3c663e[_0x67e829(0x14f)]?[]:extractParameters(_0x169e1b);if(_0x498404[_0x67e829(0x154)])return{'valid':![],'sqlType':_0x498404,'tables':_0x4d5233,'parameters':_0x4aa3a2,'message':_0x498404['reason']||_0x498404[_0x67e829(0x149)]+_0x67e829(0x148)};if(_0x498404['type']===_0x67e829(0x169))return{'valid':![],'sqlType':_0x498404,'tables':_0x4d5233,'parameters':_0x4aa3a2,'message':_0x3c663e[_0x67e829(0x14f)]?_0x67e829(0x123)+_0x3c663e[_0x67e829(0x14f)]:_0x67e829(0x15e)};return{'valid':!![],'sqlType':_0x498404,'tables':_0x4d5233,'parameters':_0x4aa3a2,'message':_0x498404[_0x67e829(0x149)]+'\x20query\x20targeting\x20'+(_0x4d5233[_0x67e829(0x11f)]?_0x4d5233['join'](',\x20'):_0x67e829(0x11e))+(_0x4aa3a2[_0x67e829(0x11f)]?_0x67e829(0x143)+_0x4aa3a2['join'](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a270_0x5b314a=a270_0x22da;(function(_0x13b506,_0xa7ccfd){const _0x4d93da=a270_0x22da,_0x1e02d=_0x13b506();while(!![]){try{const _0x3c7379=-parseInt(_0x4d93da(0x1d2))/0x1+-parseInt(_0x4d93da(0x1d1))/0x2+parseInt(_0x4d93da(0x1e5))/0x3+parseInt(_0x4d93da(0x1ea))/0x4*(parseInt(_0x4d93da(0x1df))/0x5)+-parseInt(_0x4d93da(0x1d0))/0x6+-parseInt(_0x4d93da(0x1cf))/0x7+parseInt(_0x4d93da(0x1dd))/0x8*(parseInt(_0x4d93da(0x1e4))/0x9);if(_0x3c7379===_0xa7ccfd)break;else _0x1e02d['push'](_0x1e02d['shift']());}catch(_0x2b5496){_0x1e02d['push'](_0x1e02d['shift']());}}}(a270_0x11d9,0x2b9b9));function a270_0x22da(_0x1bae1b,_0x3e4a2f){_0x1bae1b=_0x1bae1b-0x1ce;const _0x11d981=a270_0x11d9();let _0x22da5d=_0x11d981[_0x1bae1b];return _0x22da5d;}import{CliError,createCliErrors}from'@lovrabet/cli-framework';function a270_0x11d9(){const _0x4da52f=['826476UQOSKZ','416776wIEEJf','87514RAXWLt','Missing\x20required\x20flag:\x20--','Set\x20appcode\x20via\x20`','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`','\x20auth`\x20to\x20login\x20first.','\x20--help`\x20to\x20see\x20available\x20commands.','Configuration\x20file\x20not\x20found','network_error','unknown_command','Operation\x20cancelled.','Run\x20`','96BsNYnP','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','397810SJfAwG','Unknown\x20command:\x20','not_in_project','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','flag_missing','495396eAvhnJ','411918sHXHSF','auth_required','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','\x20project\x20directory','Not\x20in\x20a\x20','8YHFNQS','Network\x20error:\x20','2412851ryyuXi'];a270_0x11d9=function(){return _0x4da52f;};return a270_0x11d9();}import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a270_0x5b314a(0x1dc)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':a270_0x5b314a(0x1d4)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`'+CLI_BIN_NAME+a270_0x5b314a(0x1de),'notInProjectHint':a270_0x5b314a(0x1e2)});export const CliErrors={'authRequired'(_0x172f2a){const _0x5d5b80=a270_0x5b314a;return new CliError(_0x5d5b80(0x1e6),0x1,'Authentication\x20required',_0x172f2a??_0x5d5b80(0x1dc)+CLI_BIN_NAME+_0x5d5b80(0x1d6));},'configMissing'(_0x4ff35c){const _0x30099c=a270_0x5b314a;return new CliError('config_missing',0x1,_0x30099c(0x1d8),_0x4ff35c??_0x30099c(0x1d4)+CLI_BIN_NAME+_0x30099c(0x1d5)+CLI_BIN_NAME+_0x30099c(0x1de));},'notInProject'(){const _0x430251=a270_0x5b314a;return new CliError(_0x430251(0x1e1),0x1,_0x430251(0x1e9)+CLI_BIN_NAME+_0x430251(0x1e8),_0x430251(0x1e2));},'apiError'(_0x501e1f,_0xea232a){return baseCliErrors['apiError'](_0x501e1f,_0xea232a);},'networkError'(_0x271918){const _0x548004=a270_0x5b314a;return new CliError(_0x548004(0x1d9),0x2,_0x548004(0x1ce)+_0x271918,_0x548004(0x1e7));},'unknownCommand'(_0x10af0d){const _0x10e32a=a270_0x5b314a;return new CliError(_0x10e32a(0x1da),0x1,_0x10e32a(0x1e0)+_0x10af0d,'Run\x20`'+CLI_BIN_NAME+_0x10e32a(0x1d7));},'flagMissing'(_0xfac6de,_0x29c229){const _0x90accd=a270_0x5b314a;return new CliError(_0x90accd(0x1e3),0x1,_0x90accd(0x1d3)+_0xfac6de,_0x29c229);},'validation'(_0x258073,_0x52bb95){return baseCliErrors['validation'](_0x258073,_0x52bb95);},'cancelled'(_0x1856b1){const _0x1a144d=a270_0x5b314a;return new CliError('cancelled',0x0,_0x1856b1??_0x1a144d(0x1db));}};
|