@lovrabet/rabetbase-cli 2.5.2-beta.1 → 2.5.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/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.d.ts +1 -0
- 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.d.ts +3 -7
- 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 +114 -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.d.ts +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +1 -3
- 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 +12 -6
- package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
- 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_0xd829(_0x62f8b5,_0x2689cb){_0x62f8b5=_0x62f8b5-0x15a;const _0x3ca656=a255_0x3ca6();let _0xd829a5=_0x3ca656[_0x62f8b5];return _0xd829a5;}(function(_0x207959,_0x344dbf){const _0x52a324=a255_0xd829,_0xb4f89c=_0x207959();while(!![]){try{const _0x48c847=-parseInt(_0x52a324(0x173))/0x1*(parseInt(_0x52a324(0x16a))/0x2)+parseInt(_0x52a324(0x163))/0x3+parseInt(_0x52a324(0x169))/0x4+-parseInt(_0x52a324(0x177))/0x5+-parseInt(_0x52a324(0x178))/0x6*(-parseInt(_0x52a324(0x16e))/0x7)+-parseInt(_0x52a324(0x176))/0x8*(parseInt(_0x52a324(0x16d))/0x9)+parseInt(_0x52a324(0x160))/0xa;if(_0x48c847===_0x344dbf)break;else _0xb4f89c['push'](_0xb4f89c['shift']());}catch(_0x280f38){_0xb4f89c['push'](_0xb4f89c['shift']());}}}(a255_0x3ca6,0xcb0bf));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x456408){const _0x31eb40=a255_0xd829;if(cache[_0x31eb40(0x15f)](_0x456408))return cache[_0x31eb40(0x166)](_0x456408);const _0x987544=await listDatasets(_0x456408),_0x2b2643=new Map();for(const _0x414fcb of _0x987544){const _0x3729d8=_0x414fcb[_0x31eb40(0x179)];_0x3729d8?.['dbId']!=null&&_0x2b2643[_0x31eb40(0x162)](_0x3729d8[_0x31eb40(0x17a)],_0x3729d8[_0x31eb40(0x16c)]??'db-'+_0x3729d8[_0x31eb40(0x17a)]);}const _0x525f3f=[..._0x2b2643[_0x31eb40(0x172)]()]['map'](([_0x5a2551,_0x2cef36])=>({'dbId':_0x5a2551,'dbName':_0x2cef36}));return cache['set'](_0x456408,_0x525f3f),_0x525f3f;}export async function resolveDb(_0x5da4fd,_0x4baf53){const _0x44358=a255_0xd829,_0x4b8f87=await listDatabases(_0x5da4fd);if(_0x4b8f87[_0x44358(0x168)]===0x0)return{'resolved':[],'error':_0x44358(0x15b)+_0x5da4fd+_0x44358(0x16b)};if(!_0x4baf53)return{'resolved':_0x4b8f87};const _0x3e126b=Number(_0x4baf53);if(!Number[_0x44358(0x164)](_0x3e126b)){const _0x1cba2e=_0x4b8f87[_0x44358(0x165)](_0x62c9=>_0x62c9[_0x44358(0x17a)]===_0x3e126b);if(_0x1cba2e)return{'resolved':[_0x1cba2e]};}const _0x52ca0b=_0x4baf53[_0x44358(0x15c)](),_0x9ebba7=_0x4b8f87[_0x44358(0x174)](_0x4934c2=>_0x4934c2[_0x44358(0x16c)][_0x44358(0x15c)]()['includes'](_0x52ca0b));if(_0x9ebba7[_0x44358(0x168)]>0x0)return{'resolved':_0x9ebba7};const _0xe7f2c6=_0x4b8f87['map'](_0x296797=>_0x296797[_0x44358(0x16c)]+'\x20('+_0x296797['dbId']+')')[_0x44358(0x15a)](',\x20');return{'resolved':[],'error':_0x44358(0x167)+_0x4baf53+_0x44358(0x171)+_0x5da4fd+_0x44358(0x161)+_0xe7f2c6+_0x44358(0x175)};}export async function resolveOneDb(_0x4f1aa9,_0x1dfff7){const _0x417aa7=a255_0xd829,{resolved:_0x4dd8cf,error:_0xb250da}=await resolveDb(_0x4f1aa9,_0x1dfff7);if(_0xb250da)return{'db':null,'error':_0xb250da};if(_0x4dd8cf[_0x417aa7(0x168)]===0x1)return{'db':_0x4dd8cf[0x0]};if(!_0x1dfff7){const _0x553b52=_0x4dd8cf[_0x417aa7(0x15d)](_0x5f4477=>_0x5f4477[_0x417aa7(0x16c)]+'\x20('+_0x5f4477[_0x417aa7(0x17a)]+')')[_0x417aa7(0x15a)](',\x20');return{'db':null,'error':_0x417aa7(0x170)+_0x553b52};}const _0x366248=_0x4dd8cf['map'](_0x19ffab=>_0x19ffab[_0x417aa7(0x16c)]+'\x20('+_0x19ffab[_0x417aa7(0x17a)]+')')[_0x417aa7(0x15a)](',\x20');return{'db':null,'error':'\x22'+_0x1dfff7+_0x417aa7(0x15e)+_0x366248+_0x417aa7(0x16f)};}export async function getDbName(_0x58d428,_0x2ffd1b){const _0x21b2ec=a255_0xd829,_0x410a1f=await listDatabases(_0x58d428);return _0x410a1f['find'](_0x36cfb7=>_0x36cfb7[_0x21b2ec(0x17a)]===_0x2ffd1b)?.[_0x21b2ec(0x16c)];}function a255_0x3ca6(){const _0x1ae9e0=['set','1312128ykolLw','isNaN','find','get','No\x20database\x20matching\x20\x22','length','1230700UfsTPA','6528MxylDg','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbName','18QgyaEk','1239JeEqqg','.\x20Be\x20more\x20specific.','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','\x22\x20under\x20app\x20\x22','entries','271GaKARV','filter','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','6631208oQRUDu','6839720xGLVIv','40098VNBPgZ','dbtableConfig','dbId','join','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','toLowerCase','map','\x22\x20matches\x20multiple\x20databases:\x20','has','28140270YgVhvR','\x22.\x20Available:\x20'];a255_0x3ca6=function(){return _0x1ae9e0;};return a255_0x3ca6();}
|
|
@@ -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_0x5f36c5=a256_0x550a;(function(_0x173293,_0x1912f3){const _0x3c2f5e=a256_0x550a,_0x2aaacd=_0x173293();while(!![]){try{const _0x119f5e=-parseInt(_0x3c2f5e(0x127))/0x1*(-parseInt(_0x3c2f5e(0x123))/0x2)+parseInt(_0x3c2f5e(0x12c))/0x3+parseInt(_0x3c2f5e(0x14f))/0x4+-parseInt(_0x3c2f5e(0x143))/0x5*(parseInt(_0x3c2f5e(0x138))/0x6)+-parseInt(_0x3c2f5e(0x14a))/0x7*(-parseInt(_0x3c2f5e(0x153))/0x8)+-parseInt(_0x3c2f5e(0x119))/0x9*(parseInt(_0x3c2f5e(0x14c))/0xa)+-parseInt(_0x3c2f5e(0x11c))/0xb;if(_0x119f5e===_0x1912f3)break;else _0x2aaacd['push'](_0x2aaacd['shift']());}catch(_0x8fcf57){_0x2aaacd['push'](_0x2aaacd['shift']());}}}(a256_0x5152,0x9b22e));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=a256_0x5f36c5(0x133);export const INSTANT_API_POLICY_FILE_NAME=a256_0x5f36c5(0x150);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x527852,_0x2bf85c,_0x3203b3){return new CliError(_0x527852,0x1,_0x2bf85c,_0x3203b3);}function a256_0x550a(_0x423839,_0x1c87e4){_0x423839=_0x423839-0x115;const _0x5152e0=a256_0x5152();let _0x550acc=_0x5152e0[_0x423839];return _0x550acc;}export function loadInstantApiPolicyLocalConfig(_0x17aaf1,_0x2bec2b){assertSafeAppCode(_0x17aaf1);const _0x5e7cc1=resolve(_0x2bec2b??findProjectRootDirectory()),_0x224909=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x17aaf1+'/'+INSTANT_API_POLICY_FILE_NAME,_0x4b01e5=resolve(_0x5e7cc1,INSTANT_API_POLICY_RELATIVE_ROOT,_0x17aaf1),_0x2cb04b=resolve(_0x4b01e5,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5e7cc1,'appCode':_0x17aaf1,'policyRoot':_0x4b01e5,'policyFilePath':_0x2cb04b,'policyRelativePath':_0x224909};}export function createDefaultInstantApiPolicyConfig(_0xf8c297,_0x4402b4='allow'){return assertSafeAppCode(_0xf8c297),{'version':'1','appCode':_0xf8c297,'defaults':{'instantApi':_0x4402b4},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x544af0){const _0x5d873b=a256_0x5f36c5;let _0x903066;try{_0x903066=await stat(_0x544af0[_0x5d873b(0x139)]);}catch(_0x42ff1a){throw instantApiPolicyError(_0x5d873b(0x126),_0x5d873b(0x125)+_0x544af0[_0x5d873b(0x139)],'Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.');}if(!_0x903066['isFile']())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x5d873b(0x151)+_0x544af0['policyFilePath']);if(_0x903066[_0x5d873b(0x124)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x5d873b(0x128));let _0x4a317f;try{_0x4a317f=await readFile(_0x544af0[_0x5d873b(0x139)]);}catch{throw instantApiPolicyError(_0x5d873b(0x137),'Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x544af0['policyFilePath']);}if(_0x4a317f[_0x5d873b(0x147)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x5d873b(0x128));let _0x2bd207;try{_0x2bd207=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x5d873b(0x11f)](_0x4a317f);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x5d873b(0x13b)+_0x544af0[_0x5d873b(0x139)]);}let _0x444524;try{_0x444524=JSON['parse'](_0x2bd207);}catch{throw instantApiPolicyError(_0x5d873b(0x130),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x544af0[_0x5d873b(0x139)]);}return assertLocalPolicyContract(_0x444524,_0x544af0[_0x5d873b(0x146)]);}export async function writeInstantApiPolicyConfigFile(_0x339569,_0xa383ea,_0x43d614={}){const _0x2bb864=a256_0x5f36c5,_0xe3677b=assertLocalPolicyContract(_0xa383ea,_0x339569[_0x2bb864(0x146)]),_0x2448a7=JSON[_0x2bb864(0x115)](_0xe3677b,null,0x2)+'\x0a';if(Buffer[_0x2bb864(0x147)](_0x2448a7,'utf8')>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2bb864(0x149),_0x2bb864(0x128));await mkdir(_0x339569[_0x2bb864(0x121)],{'recursive':!![]});let _0x33d907;try{_0x33d907=await readFile(_0x339569[_0x2bb864(0x139)],'utf8');}catch(_0x53186c){if(!isMissingFile(_0x53186c))throw instantApiPolicyError(_0x2bb864(0x137),_0x2bb864(0x12a)+_0x339569[_0x2bb864(0x139)]);}if(_0x33d907===_0x2448a7)return{'action':_0x2bb864(0x135),'filePath':_0x339569[_0x2bb864(0x139)]};if(_0x33d907!==undefined&&!_0x43d614[_0x2bb864(0x122)])throw instantApiPolicyError(_0x2bb864(0x155),_0x2bb864(0x132)+_0x339569[_0x2bb864(0x139)],_0x2bb864(0x12f));if(_0x33d907===undefined)try{return await writeFile(_0x339569[_0x2bb864(0x139)],_0x2448a7,{'encoding':'utf8','flag':'wx'}),{'action':_0x2bb864(0x140),'filePath':_0x339569[_0x2bb864(0x139)]};}catch(_0x1df347){if(!isAlreadyExists(_0x1df347))throw instantApiPolicyError(_0x2bb864(0x145),_0x2bb864(0x156)+_0x339569['policyFilePath']);if(!_0x43d614[_0x2bb864(0x122)])throw instantApiPolicyError(_0x2bb864(0x155),_0x2bb864(0x13d)+_0x339569[_0x2bb864(0x139)],_0x2bb864(0x152));}const _0x235b23=resolve(dirname(_0x339569[_0x2bb864(0x139)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x2bb864(0x14e)]+'.'+randomUUID()+_0x2bb864(0x148));try{await writeFile(_0x235b23,_0x2448a7,{'encoding':_0x2bb864(0x11b),'flag':'wx'}),await rename(_0x235b23,_0x339569[_0x2bb864(0x139)]);}catch{await unlink(_0x235b23)[_0x2bb864(0x13f)](()=>undefined);throw instantApiPolicyError(_0x2bb864(0x145),_0x2bb864(0x13c)+_0x339569[_0x2bb864(0x139)]);}return{'action':_0x2bb864(0x144),'filePath':_0x339569[_0x2bb864(0x139)]};}function assertSafeAppCode(_0x1a2db0){const _0x3f4d70=a256_0x5f36c5,_0x10e781=_0x1a2db0['trim']();if(!_0x10e781||_0x10e781!==_0x1a2db0||_0x10e781[_0x3f4d70(0x131)]>0x64||_0x10e781==='.'||_0x10e781==='..'||_0x10e781[_0x3f4d70(0x129)]('/')||_0x10e781[_0x3f4d70(0x129)]('\x5c')||_0x10e781[_0x3f4d70(0x129)]('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0x3f4d70(0x11d));}function assertLocalPolicyContract(_0x3ea582,_0x5eedfc){const _0x325957=a256_0x5f36c5;if(!isObject(_0x3ea582))throw instantApiPolicyError(_0x325957(0x130),_0x325957(0x141));if(_0x3ea582[_0x325957(0x154)]!=='1')throw instantApiPolicyError('instant_api_policy_version_invalid',_0x325957(0x14b),_0x325957(0x14d));if(_0x3ea582[_0x325957(0x146)]!==_0x5eedfc)throw instantApiPolicyError(_0x325957(0x12b),_0x325957(0x117)+_0x5eedfc+'.');if(!isObject(_0x3ea582[_0x325957(0x11a)])||typeof _0x3ea582['defaults'][_0x325957(0x11e)]!==_0x325957(0x136))throw instantApiPolicyError(_0x325957(0x142),_0x325957(0x116));if(_0x3ea582[_0x325957(0x13e)]!==undefined&&_0x3ea582[_0x325957(0x13e)]!==null&&!Array[_0x325957(0x118)](_0x3ea582[_0x325957(0x13e)]))throw instantApiPolicyError('instant_api_policy_rules_invalid',_0x325957(0x120));return _0x3ea582;}function a256_0x5152(){const _0x553fdb=['appCode','byteLength','.tmp','instant_api_policy_file_too_large','8834077DsrYQn','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','11378860uHUbFb','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','pid','542988luoQSx','policy.json','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Review\x20the\x20file\x20before\x20retrying.','8QLJskZ','version','instant_api_policy_file_exists','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','stringify','Policy\x20defaults.instantApi\x20is\x20required.','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','isArray','9TuxgBO','defaults','utf8','5832365zxqUdU','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','instantApi','decode','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','policyRoot','force','58598hddacs','size','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','instant_api_policy_file_missing','34YxmEJk','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','includes','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_app_code_mismatch','2904573BUhoYK','ENOENT','object','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','instant_api_policy_json_invalid','length','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','.rabetbase/instant-api-policy','EEXIST','unchanged','string','instant_api_policy_file_unreadable','6351456VZXrmd','policyFilePath','code','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','rules','catch','created','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','instant_api_policy_defaults_invalid','5AKYGuy','overwritten','instant_api_policy_file_unwritable'];a256_0x5152=function(){return _0x553fdb;};return a256_0x5152();}function isObject(_0x541f10){const _0x32f955=a256_0x5f36c5;return _0x541f10!==null&&typeof _0x541f10===_0x32f955(0x12e)&&!Array[_0x32f955(0x118)](_0x541f10);}function isMissingFile(_0x3ddf00){const _0x33fb7f=a256_0x5f36c5;return Boolean(_0x3ddf00&&typeof _0x3ddf00===_0x33fb7f(0x12e)&&_0x3ddf00[_0x33fb7f(0x13a)]===_0x33fb7f(0x12d));}function isAlreadyExists(_0x3b684f){const _0x2fbee7=a256_0x5f36c5;return Boolean(_0x3b684f&&typeof _0x3b684f==='object'&&_0x3b684f['code']===_0x2fbee7(0x134));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a257_0x5369a6=a257_0x1649;(function(_0x2efc57,_0x145937){const _0x3e9349=a257_0x1649,_0x484b97=_0x2efc57();while(!![]){try{const _0x2b661f=-parseInt(_0x3e9349(0x16e))/0x1*(-parseInt(_0x3e9349(0x134))/0x2)+-parseInt(_0x3e9349(0x12f))/0x3*(parseInt(_0x3e9349(0x133))/0x4)+parseInt(_0x3e9349(0x14e))/0x5+-parseInt(_0x3e9349(0x15a))/0x6+-parseInt(_0x3e9349(0x130))/0x7*(parseInt(_0x3e9349(0x141))/0x8)+parseInt(_0x3e9349(0x169))/0x9*(-parseInt(_0x3e9349(0x148))/0xa)+-parseInt(_0x3e9349(0x149))/0xb*(-parseInt(_0x3e9349(0x136))/0xc);if(_0x2b661f===_0x145937)break;else _0x484b97['push'](_0x484b97['shift']());}catch(_0x530091){_0x484b97['push'](_0x484b97['shift']());}}}(a257_0x351f,0x5917a));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a257_0x5369a6(0x13b),a257_0x5369a6(0x14d),a257_0x5369a6(0x157),'hits',a257_0x5369a6(0x15c),a257_0x5369a6(0x176)],HIT_KEYS=[a257_0x5369a6(0x174),a257_0x5369a6(0x152),a257_0x5369a6(0x142),a257_0x5369a6(0x172),a257_0x5369a6(0x158),a257_0x5369a6(0x151),a257_0x5369a6(0x166),a257_0x5369a6(0x154),a257_0x5369a6(0x15d),a257_0x5369a6(0x163),a257_0x5369a6(0x177)];export async function searchDevelopmentKnowledge(_0x1e0cd7){const _0x35651e=a257_0x5369a6,_0x1adb1a=_0x1e0cd7[_0x35651e(0x139)]['trim'](),_0x476dda=_0x1e0cd7['query'][_0x35651e(0x168)]();if(!_0x1adb1a)throw CliErrors[_0x35651e(0x155)](_0x35651e(0x13d));if(!_0x1e0cd7['cookie'][_0x35651e(0x168)]())throw CliErrors[_0x35651e(0x13f)]();if(!_0x476dda)throw CliErrors['validation'](_0x35651e(0x16a));validateTopK(_0x1e0cd7[_0x35651e(0x14f)]);const _0x544d18=getKbDomain()+_0x35651e(0x171);let _0x7af756;try{_0x7af756=await fetch(_0x544d18,{'method':_0x35651e(0x150),'headers':{'Content-Type':_0x35651e(0x14c),'Cookie':_0x1e0cd7['cookie'],'X-Invoke-Source':'cli:rabetbase'},'body':JSON[_0x35651e(0x15b)]({'appCode':_0x1adb1a,'query':_0x476dda,..._0x1e0cd7['topK']!==undefined?{'topK':_0x1e0cd7[_0x35651e(0x14f)]}:{}}),'signal':_0x1e0cd7['signal']});}catch(_0x438a09){if(_0x438a09 instanceof CliError)throw _0x438a09;if(_0x438a09 instanceof Error&&_0x438a09['name']===_0x35651e(0x162))throw _0x438a09;throw CliErrors[_0x35651e(0x173)](_0x35651e(0x131));}if(!hasNoStore(_0x7af756[_0x35651e(0x16c)]))throw CliErrors[_0x35651e(0x145)]('SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(_0x7af756[_0x35651e(0x13c)]===0x191)throw CliErrors[_0x35651e(0x13f)]();if(!_0x7af756['ok'])throw CliErrors['apiError'](_0x35651e(0x14b)+_0x7af756[_0x35651e(0x13c)]+').');if(!(_0x7af756[_0x35651e(0x16c)][_0x35651e(0x13a)]('content-type')??'')[_0x35651e(0x137)]()[_0x35651e(0x16d)](_0x35651e(0x14c)))throw CliErrors[_0x35651e(0x145)](_0x35651e(0x161));let _0xabd6d;try{_0xabd6d=await _0x7af756['json']();}catch{throw CliErrors[_0x35651e(0x145)]('SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.');}return parseDevelopmentSearchResponse(readEnvelopeData(_0xabd6d),_0x1e0cd7[_0x35651e(0x14f)]);}function readEnvelopeData(_0x51b5a6){const _0x391f5c=a257_0x5369a6,_0x725a6a=requireRecord(_0x51b5a6,_0x391f5c(0x132));if(_0x725a6a['success']===![])throw CliErrors[_0x391f5c(0x145)](_0x391f5c(0x175));if(!('data'in _0x725a6a))throw invalidContract('response\x20envelope');return _0x725a6a[_0x391f5c(0x140)];}function validateTopK(_0x19d676){const _0x1fec9c=a257_0x5369a6;if(_0x19d676!==undefined&&(!Number[_0x1fec9c(0x153)](_0x19d676)||_0x19d676<0x1||_0x19d676>0x32))throw CliErrors[_0x1fec9c(0x155)](_0x1fec9c(0x138));}function a257_0x1649(_0x27d115,_0x170c33){_0x27d115=_0x27d115-0x12f;const _0x351fd0=a257_0x351f();let _0x1649f4=_0x351fd0[_0x27d115];return _0x1649f4;}function hasNoStore(_0x11745c){const _0xcb514e=a257_0x5369a6;return(_0x11745c['get'](_0xcb514e(0x14a))??'')['split'](',')[_0xcb514e(0x16f)](_0x1a9327=>_0x1a9327[_0xcb514e(0x168)]()['toLowerCase']()===_0xcb514e(0x147));}function parseDevelopmentSearchResponse(_0x4716d6,_0x391764){const _0x46eadf=a257_0x5369a6,_0x26b65b=requireExactRecord(_0x4716d6,RESPONSE_KEYS,'response');if(_0x26b65b['schemaVersion']!==0x2||_0x26b65b[_0x46eadf(0x14d)]!==_0x46eadf(0x16b))throw invalidContract(_0x46eadf(0x14d));if(!Array[_0x46eadf(0x156)](_0x26b65b[_0x46eadf(0x144)])||_0x26b65b[_0x46eadf(0x144)][_0x46eadf(0x167)]>(_0x391764??0x32))throw invalidContract(_0x46eadf(0x144));if(typeof _0x26b65b[_0x46eadf(0x15c)]!==_0x46eadf(0x146)||!/^sha256:[0-9a-f]{64}$/[_0x46eadf(0x164)](_0x26b65b[_0x46eadf(0x15c)]))throw invalidContract(_0x46eadf(0x15c));const _0x1e8dff=requireRecord(_0x26b65b[_0x46eadf(0x176)],_0x46eadf(0x176)),_0x558cba={};for(const [_0x4970ac,_0xaed6b1]of Object[_0x46eadf(0x170)](_0x1e8dff)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x46eadf(0x164)](_0x4970ac)||typeof _0xaed6b1!==_0x46eadf(0x15e)||!Number[_0x46eadf(0x160)](_0xaed6b1)||_0xaed6b1<0x0)throw invalidContract(_0x46eadf(0x176));_0x558cba[_0x4970ac]=_0xaed6b1;}const _0x39150b=_0x26b65b['hits']['map']((_0x5d842b,_0x320568)=>parseHit(_0x5d842b,_0x320568));if(!Number[_0x46eadf(0x153)](_0x26b65b[_0x46eadf(0x157)])||_0x26b65b[_0x46eadf(0x157)]!==_0x39150b[_0x46eadf(0x167)])throw invalidContract(_0x46eadf(0x157));return{'schemaVersion':_0x26b65b['schemaVersion'],'profile':_0x26b65b['profile'],'total':_0x26b65b['total'],'strategyFingerprint':_0x26b65b[_0x46eadf(0x15c)],'timingsMs':_0x558cba,'hits':_0x39150b};}function parseHit(_0x1d79d8,_0x242230){const _0x21b926=a257_0x5369a6,_0x599494=requireExactRecord(_0x1d79d8,HIT_KEYS,'hits['+_0x242230+']'),_0x3d1e2b=_0x4758e6=>{const _0x289896=a257_0x1649,_0x57eb33=_0x599494[_0x4758e6];if(typeof _0x57eb33!==_0x289896(0x146)||!_0x57eb33)throw invalidContract(_0x4758e6);return _0x57eb33;};if(!Number[_0x21b926(0x153)](_0x599494[_0x21b926(0x152)])||_0x599494['revision']<0x1)throw invalidContract('revision');if(_0x599494[_0x21b926(0x172)]!==_0x21b926(0x143)&&_0x599494[_0x21b926(0x172)]!==_0x21b926(0x159))throw invalidContract('scope');if(typeof _0x599494[_0x21b926(0x158)]!==_0x21b926(0x146)||typeof _0x599494[_0x21b926(0x151)]!==_0x21b926(0x146))throw invalidContract(_0x21b926(0x151));if(!Array['isArray'](_0x599494['tags'])||_0x599494[_0x21b926(0x166)][_0x21b926(0x16f)](_0x44ac55=>typeof _0x44ac55!==_0x21b926(0x146)))throw invalidContract('tags');if(!Number[_0x21b926(0x153)](_0x599494[_0x21b926(0x154)])||_0x599494[_0x21b926(0x154)]!==_0x242230+0x1)throw invalidContract(_0x21b926(0x154));if(!isFiniteNumber(_0x599494['rawScore'])||!isFiniteNumber(_0x599494[_0x21b926(0x163)]))throw invalidContract('score');return{'documentId':_0x3d1e2b(_0x21b926(0x174)),'revision':_0x599494['revision'],'chunkId':_0x3d1e2b('chunkId'),'scope':_0x599494[_0x21b926(0x172)],'title':_0x599494[_0x21b926(0x158)],'text':_0x599494[_0x21b926(0x151)],'tags':[..._0x599494[_0x21b926(0x166)]],'rank':_0x599494[_0x21b926(0x154)],'rawScore':_0x599494[_0x21b926(0x15d)],'finalScore':_0x599494['finalScore'],'scoreKind':_0x3d1e2b('scoreKind')};}function a257_0x351f(){const _0x218dfd=['hits','apiError','string','no-store','21370HeeBOw','2754741YEGJuU','cache-control','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','application/json','profile','788470nyPUpe','topK','POST','text','revision','isSafeInteger','rank','validation','isArray','total','title','company','1510410iHpyym','stringify','strategyFingerprint','rawScore','number','sort','isFinite','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','AbortError','finalScore','test','keys','tags','length','trim','1152KdqkJz','Knowledge\x20search\x20query\x20is\x20required.','development','headers','includes','85KnYkBd','some','entries','/smartapi/knowledge/company-public/search','scope','networkError','documentId','SmartCode\x20knowledge\x20search\x20failed.','timingsMs','scoreKind','367212kwlAUh','11459FMpcMB','SmartCode\x20knowledge\x20search\x20request\x20failed.','response\x20envelope','16FGObSX','8730lRPaWD','\x20contract.','60RCDPnr','toLowerCase','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','appCode','get','schemaVersion','status','Knowledge\x20search\x20appCode\x20is\x20required.','object','authRequired','data','1960qXgiZe','chunkId','public'];a257_0x351f=function(){return _0x218dfd;};return a257_0x351f();}function requireExactRecord(_0x243a23,_0xc17177,_0xaa4fc6){const _0x177569=a257_0x5369a6,_0x12c6a1=requireRecord(_0x243a23,_0xaa4fc6),_0x5484df=Object[_0x177569(0x165)](_0x12c6a1)[_0x177569(0x15f)](),_0x40a0a0=[..._0xc17177][_0x177569(0x15f)]();if(_0x5484df[_0x177569(0x167)]!==_0x40a0a0['length']||_0x5484df[_0x177569(0x16f)]((_0x570d80,_0x3a9ff4)=>_0x570d80!==_0x40a0a0[_0x3a9ff4]))throw invalidContract(_0xaa4fc6);return _0x12c6a1;}function requireRecord(_0x27a5aa,_0x1e9da5){const _0x2f2f2e=a257_0x5369a6;if(!_0x27a5aa||typeof _0x27a5aa!==_0x2f2f2e(0x13e)||Array[_0x2f2f2e(0x156)](_0x27a5aa))throw invalidContract(_0x1e9da5);return _0x27a5aa;}function isFiniteNumber(_0x13fa33){const _0x5dc707=a257_0x5369a6;return typeof _0x13fa33===_0x5dc707(0x15e)&&Number[_0x5dc707(0x160)](_0x13fa33);}function invalidContract(_0x480331){const _0x1c402a=a257_0x5369a6;return CliErrors['apiError']('SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20'+_0x480331+_0x1c402a(0x135));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3f610b,_0x4c88c7){const _0x461a32=a258_0x5d91,_0x5a53f0=_0x3f610b();while(!![]){try{const _0x4ea5ce=parseInt(_0x461a32(0xef))/0x1+parseInt(_0x461a32(0xec))/0x2+-parseInt(_0x461a32(0xf3))/0x3*(-parseInt(_0x461a32(0xe8))/0x4)+-parseInt(_0x461a32(0xf1))/0x5*(-parseInt(_0x461a32(0xf0))/0x6)+parseInt(_0x461a32(0xf2))/0x7+-parseInt(_0x461a32(0xed))/0x8*(-parseInt(_0x461a32(0xea))/0x9)+parseInt(_0x461a32(0xee))/0xa*(-parseInt(_0x461a32(0xe6))/0xb);if(_0x4ea5ce===_0x4c88c7)break;else _0x5a53f0['push'](_0x5a53f0['shift']());}catch(_0x57eba8){_0x5a53f0['push'](_0x5a53f0['shift']());}}}(a258_0x28e0,0xebe92));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x2eb13c,_0x54e5a4=process['cwd']()){const _0x23a490=a258_0x5d91,_0x13a2ce=resolve(_0x54e5a4),_0x5479b3=join(_0x13a2ce,'.rabetbase','page');return{'projectRoot':_0x13a2ce,'pagesBaseDir':_0x5479b3,'appPagesDir':join(_0x5479b3,_0x2eb13c),'lockFilePath':join(_0x13a2ce,_0x23a490(0xeb),'page.lock.json')};}export function buildPageFileName(_0x59b926,_0x1272e0){const _0x15f5da=a258_0x5d91;return _0x59b926+'-'+String(_0x1272e0)['toUpperCase']()+_0x15f5da(0xe9);}export function resolvePageFilePath(_0xcc6135,_0x5af38f,_0x188502){const _0x1dbee2=a258_0x5d91;return join(_0xcc6135[_0x1dbee2(0xe7)],buildPageFileName(_0x5af38f,_0x188502));}function a258_0x5d91(_0x527ca5,_0x3c19a8){_0x527ca5=_0x527ca5-0xe6;const _0x28e052=a258_0x28e0();let _0x5d91c5=_0x28e052[_0x527ca5];return _0x5d91c5;}export async function ensureParentDirectory(_0x1e90a6){await mkdir(dirname(_0x1e90a6),{'recursive':!![]});}export async function fileExists(_0x513bfb){try{return await access(_0x513bfb,constants['F_OK']),!![];}catch{return![];}}function a258_0x28e0(){const _0xed5ca8=['5QQHHFL','7865116UMRcRd','741219XLrwZR','9262mNMayj','appPagesDir','4CuIbqL','.json','63TtYlgJ','.rabetbase','3606766TvmGJs','511320XWGBtU','54140iowVaT','628277VrdVfq','7650912hoLeVr'];a258_0x28e0=function(){return _0xed5ca8;};return a258_0x28e0();}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e3efd,_0xc34fd8){const _0xa8cab5=a259_0x7240,_0x6f53b=_0x1e3efd();while(!![]){try{const _0x1c86fa=-parseInt(_0xa8cab5(0xb7))/0x1*(parseInt(_0xa8cab5(0xb2))/0x2)+parseInt(_0xa8cab5(0xaf))/0x3+-parseInt(_0xa8cab5(0xb0))/0x4+parseInt(_0xa8cab5(0xac))/0x5*(parseInt(_0xa8cab5(0xad))/0x6)+parseInt(_0xa8cab5(0xb4))/0x7*(-parseInt(_0xa8cab5(0xb1))/0x8)+parseInt(_0xa8cab5(0xb8))/0x9+-parseInt(_0xa8cab5(0xa9))/0xa*(-parseInt(_0xa8cab5(0xae))/0xb);if(_0x1c86fa===_0xc34fd8)break;else _0x6f53b['push'](_0x6f53b['shift']());}catch(_0x1d0948){_0x6f53b['push'](_0x6f53b['shift']());}}}(a259_0xe1a4,0x85dab));import a259_0x593f69 from'node:crypto';function a259_0x7240(_0x2e15bf,_0x221d38){_0x2e15bf=_0x2e15bf-0xa9;const _0xe1a42e=a259_0xe1a4();let _0x7240d9=_0xe1a42e[_0x2e15bf];return _0x7240d9;}import{readFile}from'node:fs/promises';function a259_0xe1a4(){const _0x5e7ffb=['46812mBAVgV','4920075KeetVa','2602100BnRGMa','digest','createHash','4705IjUcXj','5274OzrtvA','22DHUVTG','1164768cSKNZn','3507520GjGgQE','24nbBfAU','12YVaAcr','hex','1345099fLGZqZ','utf8','md5'];a259_0xe1a4=function(){return _0x5e7ffb;};return a259_0xe1a4();}export function serializePageSchemaForFile(_0x1948b2){return JSON['stringify'](JSON['parse'](_0x1948b2),null,0x2)+'\x0a';}export function computePageContentHash(_0x365b78){const _0x24447b=a259_0x7240;return a259_0x593f69[_0x24447b(0xab)](_0x24447b(0xb6))['update'](_0x365b78)[_0x24447b(0xaa)](_0x24447b(0xb3));}export function computeSerializedSchemaHash(_0x578f8d){return computePageContentHash(serializePageSchemaForFile(_0x578f8d));}export async function computePageFileHash(_0x321d4e){const _0x38dc5c=a259_0x7240,_0x326b81=await readFile(_0x321d4e,_0x38dc5c(0xb5));return computePageContentHash(_0x326b81);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x481917,_0x4167a3){const _0x2ef5e0=a260_0x1123,_0x1a28cc=_0x481917();while(!![]){try{const _0x772a03=parseInt(_0x2ef5e0(0x168))/0x1*(-parseInt(_0x2ef5e0(0x167))/0x2)+parseInt(_0x2ef5e0(0x16a))/0x3+-parseInt(_0x2ef5e0(0x16d))/0x4*(parseInt(_0x2ef5e0(0x15f))/0x5)+-parseInt(_0x2ef5e0(0x16f))/0x6*(-parseInt(_0x2ef5e0(0x165))/0x7)+-parseInt(_0x2ef5e0(0x16c))/0x8+parseInt(_0x2ef5e0(0x15d))/0x9+parseInt(_0x2ef5e0(0x161))/0xa;if(_0x772a03===_0x4167a3)break;else _0x1a28cc['push'](_0x1a28cc['shift']());}catch(_0x7d131d){_0x1a28cc['push'](_0x1a28cc['shift']());}}}(a260_0x28c4,0xb94c8));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a260_0x1123(_0x2588e2,_0x2402fd){_0x2588e2=_0x2588e2-0x15d;const _0x28c4d4=a260_0x28c4();let _0x1123ac=_0x28c4d4[_0x2588e2];return _0x1123ac;}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x27c6ec,_0x319f55){const _0x4cc283=a260_0x1123,_0x426ade={'apps':_0x27c6ec['apps']&&typeof _0x27c6ec[_0x4cc283(0x164)]===_0x4cc283(0x163)?_0x27c6ec[_0x4cc283(0x164)]:{}};let _0x46523d=_0x426ade[_0x4cc283(0x164)][_0x319f55];if(!_0x46523d)return _0x46523d={'lastSync':'','pages':{}},_0x426ade['apps'][_0x319f55]=_0x46523d,{'lockData':_0x426ade,'appLock':_0x46523d};return!_0x46523d[_0x4cc283(0x16b)]&&(_0x46523d['lastSync']=''),(!_0x46523d[_0x4cc283(0x15e)]||typeof _0x46523d['pages']!==_0x4cc283(0x163))&&(_0x46523d['pages']={}),{'lockData':_0x426ade,'appLock':_0x46523d};}export async function readPageLockFile(_0x3fcec2){const _0x15715c=a260_0x1123;try{const _0xdee752=await readFile(_0x3fcec2,'utf8'),_0x5c8f00=JSON['parse'](_0xdee752);return{'apps':_0x5c8f00['apps']&&typeof _0x5c8f00[_0x15715c(0x164)]===_0x15715c(0x163)?_0x5c8f00['apps']:{}};}catch(_0x2b26ad){if(_0x2b26ad[_0x15715c(0x160)]===_0x15715c(0x162))return null;throw new Error(_0x15715c(0x16e)+String(_0x2b26ad));}}function a260_0x28c4(){const _0x33d094=['6393600TSnaQb','pages','414385mZDcew','code','13247340mzOTLO','ENOENT','object','apps','30611kcKXMk','utf8','594488uBuOoa','3aczhPv','stringify','1016493FdiXYl','lastSync','3875312soBiUf','32mnSxto','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','582nTqEKL'];a260_0x28c4=function(){return _0x33d094;};return a260_0x28c4();}export async function writePageLockFile(_0x1301a1,_0x2beb7b){const _0x14a49f=a260_0x1123;await mkdir(dirname(_0x1301a1),{'recursive':!![]}),await writeFile(_0x1301a1,JSON[_0x14a49f(0x169)](_0x2beb7b,null,0x2),_0x14a49f(0x166));}
|
|
@@ -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 a262_0x23ea(){const _0x456ce0=['2Kzvqvl','map','trim','natural','split','138921lErmQm','__sq__','metadataAvailable','exec','21105864HcLrQZ','unavailable','5220495skVOhU','from','matchedPrefix','table','reduce','toUpperCase','178677iObPko','max','index','containsUnresolvedInclude','endsWith','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','toLowerCase','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','inner','where','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','columns','232DUHCph','unknown','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','710NVSKZc','27174pUlnlC','cross','position','JOIN_INDEX_NOT_USABLE','\x5cs*\x5c.\x5cs*[\x5cw$]+','132HSBzlt','includes','search','join','unsupportedPredicate','covered','has','test','3277ExXuJS','warning','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','length','57530rFjQfL','INNER','min','full','alias','JOIN_INDEX_MISSING','replace','2508NgcHLM','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','push','right','some','(?:^|[^\x5cw$])','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','slice','INDEX_METADATA_UNAVAILABLE','indexes','using','match','matchAll','indexOf','filter'];a262_0x23ea=function(){return _0x456ce0;};return a262_0x23ea();}(function(_0x1c1fc4,_0x4549cb){const _0x1685be=a262_0x557d,_0x4a7c9a=_0x1c1fc4();while(!![]){try{const _0xc9cb2f=-parseInt(_0x1685be(0x116))/0x1*(parseInt(_0x1685be(0x131))/0x2)+parseInt(_0x1685be(0x136))/0x3*(-parseInt(_0x1685be(0x158))/0x4)+parseInt(_0x1685be(0x152))/0x5*(parseInt(_0x1685be(0x153))/0x6)+-parseInt(_0x1685be(0x13c))/0x7+-parseInt(_0x1685be(0x14f))/0x8*(parseInt(_0x1685be(0x142))/0x9)+parseInt(_0x1685be(0x11a))/0xa*(parseInt(_0x1685be(0x121))/0xb)+parseInt(_0x1685be(0x13a))/0xc;if(_0xc9cb2f===_0x4549cb)break;else _0x4a7c9a['push'](_0x4a7c9a['shift']());}catch(_0x5da186){_0x4a7c9a['push'](_0x4a7c9a['shift']());}}}(a262_0x23ea,0xd2216));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x26cf97,_0x12e237){const _0x48ff65=a262_0x557d,_0x1bdfb1=[],_0x5a0261=normalizeSqlForStaticAnalysis(_0x26cf97),_0x514cd9=(_0x5a0261['error']?[]:extractJoinFacts(_0x5a0261['sql']))['map'](_0x896c23=>{const _0x4dda8b=a262_0x557d;if(_0x896c23[_0x4dda8b(0x112)]||_0x896c23[_0x4dda8b(0x14e)][_0x4dda8b(0x119)]===0x0)return _0x1bdfb1[_0x4dda8b(0x123)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x896c23['table'],'alias':_0x896c23[_0x4dda8b(0x11e)],'columns':_0x896c23[_0x4dda8b(0x14e)],'reason':_0x896c23['unsupportedReason']??_0x4dda8b(0x151)}),{'table':_0x896c23[_0x4dda8b(0x13f)],'alias':_0x896c23['alias'],'columns':_0x896c23[_0x4dda8b(0x14e)],'status':_0x4dda8b(0x13b)};const _0xd9ac0c=resolveTableMetadata(_0x12e237,_0x896c23['table']),_0xafcf80=(_0xd9ac0c?.['indexes']??[])[_0x4dda8b(0x132)](_0x1815f3=>({'index':_0x1815f3,'matchedPrefix':findEqualityPrefix(_0x1815f3[_0x4dda8b(0x14e)],_0x896c23[_0x4dda8b(0x14e)])}))['filter'](_0x3e91e9=>_0x3e91e9[_0x4dda8b(0x13e)][_0x4dda8b(0x119)]>0x0),_0x2f1ca1=_0xafcf80[_0x4dda8b(0x140)]((_0x5f5c48,_0x5ecd4d)=>!_0x5f5c48||_0x5ecd4d[_0x4dda8b(0x13e)][_0x4dda8b(0x119)]>_0x5f5c48[_0x4dda8b(0x13e)][_0x4dda8b(0x119)]?_0x5ecd4d:_0x5f5c48,_0xafcf80[0x0]);if(_0x2f1ca1)return{'table':_0x896c23[_0x4dda8b(0x13f)],'alias':_0x896c23[_0x4dda8b(0x11e)],'columns':_0x896c23[_0x4dda8b(0x14e)],'status':_0x4dda8b(0x113),'matchedIndex':{..._0x2f1ca1[_0x4dda8b(0x144)],'matchedPrefix':_0x2f1ca1[_0x4dda8b(0x13e)]}};const _0x1ce25d=_0xd9ac0c?.[_0x4dda8b(0x12b)][_0x4dda8b(0x130)](_0x1e2220=>_0x1e2220[_0x4dda8b(0x14e)]['some'](_0x2874cf=>_0x896c23[_0x4dda8b(0x14e)][_0x4dda8b(0x125)](_0x472ea4=>columnNamesMatch(_0x2874cf,_0x472ea4))))??[];if(_0x1ce25d[_0x4dda8b(0x119)]>0x0)return _0x1bdfb1[_0x4dda8b(0x123)]({'code':_0x4dda8b(0x156),'table':_0x896c23['table'],'alias':_0x896c23['alias'],'columns':_0x896c23[_0x4dda8b(0x14e)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x896c23[_0x4dda8b(0x13f)],'alias':_0x896c23['alias'],'columns':_0x896c23['columns'],'status':'warning','candidateIndexes':_0x1ce25d};if(_0xd9ac0c&&_0xd9ac0c[_0x4dda8b(0x138)]!==![]&&_0xd9ac0c[_0x4dda8b(0x12b)][_0x4dda8b(0x119)]>0x0&&_0x896c23[_0x4dda8b(0x14e)][_0x4dda8b(0x119)]>0x0)return _0x1bdfb1['push']({'code':_0x4dda8b(0x11f),'table':_0x896c23[_0x4dda8b(0x13f)],'alias':_0x896c23['alias'],'columns':_0x896c23['columns'],'reason':_0x4dda8b(0x118)}),{'table':_0x896c23[_0x4dda8b(0x13f)],'alias':_0x896c23[_0x4dda8b(0x11e)],'columns':_0x896c23[_0x4dda8b(0x14e)],'status':_0x4dda8b(0x117)};return _0x1bdfb1[_0x4dda8b(0x123)]({'code':_0x4dda8b(0x12a),'table':_0x896c23['table'],'alias':_0x896c23[_0x4dda8b(0x11e)],'columns':_0x896c23['columns'],'reason':_0xd9ac0c?_0x4dda8b(0x128):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x896c23[_0x4dda8b(0x13f)],'alias':_0x896c23[_0x4dda8b(0x11e)],'columns':_0x896c23[_0x4dda8b(0x14e)],'status':_0x4dda8b(0x13b)};});return{'checked':_0x514cd9[_0x48ff65(0x119)]>0x0,'joins':_0x514cd9,'warnings':_0x1bdfb1};}function extractJoinFacts(_0x9eb5a1){const _0x2d1a08=a262_0x557d,_0x4ff1a1=maskNestedQueries(stripSqlNoise(_0x9eb5a1)),_0x387589=maskQuotedIdentifiers(_0x4ff1a1),_0x3c0f91=[],_0x5717c5=new Set(),_0x36bb1e=/\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 _0x51270d of _0x4ff1a1[_0x2d1a08(0x12e)](_0x36bb1e)){const _0xc6d9a7=_0x51270d[_0x2d1a08(0x144)]??0x0,_0x4e01e2=_0x51270d[0x0][_0x2d1a08(0x110)](/\bJOIN\b/i),_0xf4b880=_0xc6d9a7+Math[_0x2d1a08(0x143)](0x0,_0x4e01e2);if(!/^JOIN\b/i[_0x2d1a08(0x115)](_0x387589[_0x2d1a08(0x129)](_0xf4b880)))continue;_0x5717c5['add'](_0xf4b880);const _0x246a38=normalizeIdentifier(_0x51270d[0x1]||_0x2d1a08(0x11b)),_0x54adcf=normalizeIdentifier(_0x51270d[0x2]??''),_0x2df325=normalizeIdentifier(_0x51270d[0x3]||_0x54adcf['split']('.')['at'](-0x1)||_0x54adcf),_0x2ed331=[],_0x560c7a=_0x54adcf===_0x2d1a08(0x137);let _0xf00e3b=_0x246a38===_0x2d1a08(0x124)||_0x246a38===_0x2d1a08(0x11d)||_0x560c7a,_0x2d31e9=_0xf00e3b?_0x560c7a?_0x2d1a08(0x127):_0x246a38[_0x2d1a08(0x141)]()+_0x2d1a08(0x14c):undefined;const _0x30ad4c=stripOuterParentheses(_0x51270d[0x4]??''),_0x354d34=_0x30ad4c['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x30ad4c[_0x2d1a08(0x159)](MYBATIS_DYNAMIC_END_MARKER),_0x592741=_0x30ad4c[_0x2d1a08(0x159)](MYBATIS_INCLUDE_MARKER);_0x354d34&&(_0xf00e3b=!![],_0x2d31e9??=_0x2d1a08(0x122));_0x592741&&(_0xf00e3b=!![],_0x2d31e9??=_0x2d1a08(0x149));const _0x77ffbd=_0x30ad4c['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x77ffbd,'OR')&&(_0xf00e3b=!![],_0x2d31e9??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x193192 of splitTopLevelAnd(_0x77ffbd)){const _0x1f4fbf=stripOuterParentheses(_0x193192);if(hasTopLevelKeyword(_0x1f4fbf,'OR')){_0xf00e3b=!![],_0x2d31e9??=_0x2d1a08(0x147);continue;}const _0x2eb61a=splitEquality(_0x1f4fbf);if(!_0x2eb61a){containsColumnReference(_0x193192,_0x2df325)&&(_0xf00e3b=!![]);continue;}const _0x55ef87=parseDirectColumnReference(_0x2eb61a[0x0],_0x2df325),_0x4d27f3=parseDirectColumnReference(_0x2eb61a[0x1],_0x2df325),_0x1cd9f7=containsColumnReference(_0x2eb61a[0x0],_0x2df325),_0x25fc59=containsColumnReference(_0x2eb61a[0x1],_0x2df325),_0x25b688=_0x55ef87&&!_0x25fc59?_0x55ef87:_0x4d27f3&&!_0x1cd9f7?_0x4d27f3:null;if(_0x25b688&&!_0x2ed331['includes'](_0x25b688))_0x2ed331[_0x2d1a08(0x123)](_0x25b688);else!_0x25b688&&containsColumnReference(_0x193192,_0x2df325)&&(_0xf00e3b=!![]);}_0x3c0f91[_0x2d1a08(0x123)]({'table':_0x54adcf,'alias':_0x2df325,'columns':_0x2ed331,'unsupportedPredicate':_0xf00e3b,'unsupportedReason':_0x2d31e9,'containsUnresolvedInclude':_0x592741,'position':_0xf4b880});}for(const _0x385d59 of _0x387589[_0x2d1a08(0x12e)](/\bJOIN\b/gi)){const _0x1f066d=_0x385d59[_0x2d1a08(0x144)]??0x0;if(_0x5717c5['has'](_0x1f066d))continue;const _0x3a6b9c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x2d1a08(0x139)](_0x4ff1a1[_0x2d1a08(0x129)](_0x1f066d+_0x385d59[0x0][_0x2d1a08(0x119)])),_0x43eac4=normalizeIdentifier(_0x3a6b9c?.[0x1]||_0x2d1a08(0x150)),_0x3a45c7=normalizeIdentifier(_0x3a6b9c?.[0x2]||''),_0x5510f2=isSqlClauseKeyword(_0x3a45c7)?_0x43eac4[_0x2d1a08(0x135)]('.')['at'](-0x1)||_0x43eac4:_0x3a45c7||_0x43eac4[_0x2d1a08(0x135)]('.')['at'](-0x1)||_0x43eac4;_0x3c0f91[_0x2d1a08(0x123)]({'table':_0x43eac4,'alias':_0x5510f2,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1f066d});}const _0x357777=_0x387589[_0x2d1a08(0x12f)](MYBATIS_INCLUDE_MARKER);return _0x357777>=0x0&&!_0x3c0f91[_0x2d1a08(0x125)](_0x3a7a40=>_0x3a7a40[_0x2d1a08(0x145)])&&_0x3c0f91['push']({'table':_0x2d1a08(0x150),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x2d1a08(0x14d),'containsUnresolvedInclude':!![],'position':_0x357777}),_0x3c0f91['sort']((_0x57ef09,_0x2f21c0)=>_0x57ef09[_0x2d1a08(0x155)]-_0x2f21c0[_0x2d1a08(0x155)]);}function stripSqlNoise(_0x417c84){const _0x314531=a262_0x557d,_0x41f5b7=Array[_0x314531(0x13d)](_0x417c84),_0x27f0eb=(_0x327ddf,_0x5e35dc)=>{for(let _0x50e23e=_0x327ddf;_0x50e23e<_0x5e35dc;_0x50e23e+=0x1){_0x41f5b7[_0x50e23e]!=='\x0a'&&_0x41f5b7[_0x50e23e]!=='\x0d'&&(_0x41f5b7[_0x50e23e]='\x20');}};for(let _0x22a752=0x0;_0x22a752<_0x41f5b7[_0x314531(0x119)];_0x22a752+=0x1){const _0x38f44a=_0x41f5b7[_0x22a752],_0x409d0b=_0x41f5b7[_0x22a752+0x1];if(_0x38f44a==='\x27'||_0x38f44a==='\x22'||_0x38f44a==='`'){const _0x52cd16=_0x38f44a,_0x1df58b=_0x22a752;_0x22a752+=0x1;while(_0x22a752<_0x41f5b7[_0x314531(0x119)]){if(_0x41f5b7[_0x22a752]==='\x5c'&&_0x22a752+0x1<_0x41f5b7[_0x314531(0x119)]){_0x22a752+=0x2;continue;}if(_0x41f5b7[_0x22a752]!==_0x52cd16){_0x22a752+=0x1;continue;}if(_0x41f5b7[_0x22a752+0x1]===_0x52cd16){_0x22a752+=0x2;continue;}break;}if(_0x52cd16==='\x27')_0x27f0eb(_0x1df58b,Math[_0x314531(0x11c)](_0x22a752+0x1,_0x41f5b7[_0x314531(0x119)]));continue;}if(_0x38f44a==='-'&&_0x409d0b==='-'){const _0x51d7ef=_0x22a752;while(_0x22a752<_0x41f5b7[_0x314531(0x119)]&&_0x41f5b7[_0x22a752]!=='\x0a')_0x22a752+=0x1;_0x27f0eb(_0x51d7ef,_0x22a752);continue;}if(_0x38f44a==='/'&&_0x409d0b==='*'){const _0xeeed39=_0x22a752;_0x22a752+=0x2;while(_0x22a752<_0x41f5b7['length']&&!(_0x41f5b7[_0x22a752]==='*'&&_0x41f5b7[_0x22a752+0x1]==='/')){_0x22a752+=0x1;}_0x22a752=Math[_0x314531(0x11c)](_0x22a752+0x1,_0x41f5b7['length']-0x1),_0x27f0eb(_0xeeed39,_0x22a752+0x1);continue;}if(_0x38f44a==='#'&&_0x409d0b!=='{'){const _0x42c0e7=_0x22a752;while(_0x22a752<_0x41f5b7[_0x314531(0x119)]&&_0x41f5b7[_0x22a752]!=='\x0a')_0x22a752+=0x1;_0x27f0eb(_0x42c0e7,_0x22a752);continue;}if((_0x38f44a==='#'||_0x38f44a==='$')&&_0x409d0b==='{'){const _0x27fb6d=_0x22a752;_0x22a752+=0x2;while(_0x22a752<_0x41f5b7[_0x314531(0x119)]&&_0x41f5b7[_0x22a752]!=='}')_0x22a752+=0x1;_0x27f0eb(_0x27fb6d,Math['min'](_0x22a752+0x1,_0x41f5b7[_0x314531(0x119)]));}}return _0x41f5b7[_0x314531(0x111)]('');}function maskQuotedIdentifiers(_0x43cd76){const _0x3a9ca6=a262_0x557d,_0x114b75=Array['from'](_0x43cd76);for(let _0x3c41c0=0x0;_0x3c41c0<_0x114b75[_0x3a9ca6(0x119)];_0x3c41c0+=0x1){const _0x2f75cf=_0x114b75[_0x3c41c0];if(_0x2f75cf!=='\x22'&&_0x2f75cf!=='`')continue;_0x3c41c0+=0x1;while(_0x3c41c0<_0x114b75['length']){if(_0x114b75[_0x3c41c0]===_0x2f75cf){if(_0x114b75[_0x3c41c0+0x1]===_0x2f75cf){_0x114b75[_0x3c41c0]='\x20',_0x114b75[_0x3c41c0+0x1]='\x20',_0x3c41c0+=0x2;continue;}break;}_0x114b75[_0x3c41c0]='\x20',_0x3c41c0+=0x1;}}return _0x114b75[_0x3a9ca6(0x111)]('');}function maskNestedQueries(_0x37622e){const _0x122699=a262_0x557d,_0x5cd30a=Array['from'](_0x37622e);for(let _0x563934=0x0;_0x563934<_0x5cd30a[_0x122699(0x119)];_0x563934+=0x1){if(_0x5cd30a[_0x563934]!=='(')continue;const _0x366696=_0x37622e[_0x122699(0x129)](_0x563934+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x122699(0x115)](_0x366696))continue;let _0x13a8b1=0x1,_0x1b5853=_0x563934+0x1;for(;_0x1b5853<_0x5cd30a[_0x122699(0x119)]&&_0x13a8b1>0x0;_0x1b5853+=0x1){if(_0x5cd30a[_0x1b5853]==='(')_0x13a8b1+=0x1;if(_0x5cd30a[_0x1b5853]===')')_0x13a8b1-=0x1;}if(_0x13a8b1!==0x0)continue;for(let _0x417a95=_0x563934;_0x417a95<_0x1b5853;_0x417a95+=0x1){_0x5cd30a[_0x417a95]='\x20';}const _0x1ac846=_0x122699(0x137);for(let _0x3cb5da=0x0;_0x3cb5da<_0x1ac846['length']&&_0x563934+_0x3cb5da<_0x1b5853;_0x3cb5da+=0x1){_0x5cd30a[_0x563934+_0x3cb5da]=_0x1ac846[_0x3cb5da];}_0x563934=_0x1b5853-0x1;}return _0x5cd30a[_0x122699(0x111)]('');}function a262_0x557d(_0x2d8d2,_0x2c2f40){_0x2d8d2=_0x2d8d2-0x110;const _0x23ea50=a262_0x23ea();let _0x557dc0=_0x23ea50[_0x2d8d2];return _0x557dc0;}function splitTopLevelAnd(_0x5b51a1){const _0x3381c4=a262_0x557d,_0x40a2c0=[];let _0x5b0f94=0x0,_0x77c59a=0x0;for(let _0x15c6d6=0x0;_0x15c6d6<_0x5b51a1[_0x3381c4(0x119)];_0x15c6d6+=0x1){const _0x6d4f25=_0x5b51a1[_0x15c6d6];if(_0x6d4f25==='(')_0x5b0f94+=0x1;if(_0x6d4f25===')')_0x5b0f94=Math[_0x3381c4(0x143)](0x0,_0x5b0f94-0x1);_0x5b0f94===0x0&&_0x5b51a1[_0x3381c4(0x129)](_0x15c6d6)[_0x3381c4(0x12d)](/^AND\b/i)&&(_0x15c6d6===0x0||/\s/[_0x3381c4(0x115)](_0x5b51a1[_0x15c6d6-0x1]??''))&&(_0x40a2c0[_0x3381c4(0x123)](_0x5b51a1['slice'](_0x77c59a,_0x15c6d6)[_0x3381c4(0x133)]()),_0x15c6d6+=0x2,_0x77c59a=_0x15c6d6+0x1);}const _0x3bbcf2=_0x5b51a1['slice'](_0x77c59a)[_0x3381c4(0x133)]();if(_0x3bbcf2)_0x40a2c0[_0x3381c4(0x123)](_0x3bbcf2);return _0x40a2c0;}function hasTopLevelKeyword(_0x1a7eaa,_0x2672c7){const _0x1d33b3=a262_0x557d;let _0x5f2bb1=0x0;for(let _0x4ddddc=0x0;_0x4ddddc<_0x1a7eaa['length'];_0x4ddddc+=0x1){const _0x5ccc73=_0x1a7eaa[_0x4ddddc];if(_0x5ccc73==='(')_0x5f2bb1+=0x1;if(_0x5ccc73===')')_0x5f2bb1=Math[_0x1d33b3(0x143)](0x0,_0x5f2bb1-0x1);if(_0x5f2bb1!==0x0)continue;const _0x505adf=_0x1a7eaa[_0x1d33b3(0x129)](_0x4ddddc,_0x4ddddc+_0x2672c7[_0x1d33b3(0x119)]),_0x11db74=_0x1a7eaa[_0x4ddddc-0x1]??'\x20',_0x114973=_0x1a7eaa[_0x4ddddc+_0x2672c7[_0x1d33b3(0x119)]]??'\x20';if(_0x505adf['toUpperCase']()===_0x2672c7[_0x1d33b3(0x141)]()&&!/[\w$]/['test'](_0x11db74)&&!/[\w$]/[_0x1d33b3(0x115)](_0x114973))return!![];}return![];}function splitEquality(_0x287152){const _0x6cb46b=a262_0x557d,_0x551c1=stripOuterParentheses(_0x287152);let _0x29a9a3=0x0,_0x4d2c65;for(let _0x15ec1a=0x0;_0x15ec1a<_0x551c1[_0x6cb46b(0x119)];_0x15ec1a+=0x1){const _0x9463c8=_0x551c1[_0x15ec1a];if(_0x9463c8==='(')_0x29a9a3+=0x1;if(_0x9463c8===')')_0x29a9a3=Math[_0x6cb46b(0x143)](0x0,_0x29a9a3-0x1);const _0x245549=_0x551c1[_0x15ec1a-0x1]??'',_0x3f8ff4=_0x551c1[_0x15ec1a+0x1]??'';if(_0x9463c8==='='&&_0x29a9a3===0x0&&!/[!<>=:]/[_0x6cb46b(0x115)](_0x245549)&&_0x3f8ff4!=='='){if(_0x4d2c65!==undefined)return null;_0x4d2c65=_0x15ec1a;}}return _0x4d2c65===undefined?null:[_0x551c1['slice'](0x0,_0x4d2c65)['trim'](),_0x551c1['slice'](_0x4d2c65+0x1)[_0x6cb46b(0x133)]()];}function parseDirectColumnReference(_0x790701,_0x57a581){const _0x8df899=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x790701));if(!_0x8df899)return null;if(normalizeIdentifier(_0x8df899[0x1]??'')!==normalizeIdentifier(_0x57a581))return null;return normalizeIdentifier(_0x8df899[0x2]??'');}function containsColumnReference(_0x349623,_0x2cb685){const _0x2c1f88=a262_0x557d,_0x30ad76=_0x349623[_0x2c1f88(0x120)](/[`"]/g,''),_0x31899d=_0x2cb685[_0x2c1f88(0x120)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x2c1f88(0x126)+_0x31899d+_0x2c1f88(0x157),'i')[_0x2c1f88(0x115)](_0x30ad76);}function findEqualityPrefix(_0x188a00,_0x289229){const _0x52861e=a262_0x557d,_0x37bb5e=new Set(_0x289229['map'](normalizeIdentifier)),_0x5f1e93=[];for(const _0x21fe39 of _0x188a00){if(!_0x37bb5e[_0x52861e(0x114)](normalizeIdentifier(_0x21fe39)))break;_0x5f1e93[_0x52861e(0x123)](_0x21fe39);}return _0x5f1e93;}function resolveTableMetadata(_0x591f7a,_0x5acef9){const _0x58d4fe=a262_0x557d,_0x2795c0=normalizeIdentifier(_0x5acef9),_0x5edcbb=_0x591f7a[_0x58d4fe(0x130)](_0x496b64=>normalizeIdentifier(_0x496b64['tableName'])===_0x2795c0);if(_0x5edcbb[_0x58d4fe(0x119)]===0x1)return _0x5edcbb[0x0];const _0x176655=_0x2795c0['includes']('.'),_0xa345ec=_0x2795c0['split']('.')['at'](-0x1),_0x2f587b=_0x591f7a[_0x58d4fe(0x130)](_0x32e342=>{const _0x5427b9=_0x58d4fe,_0x3811dd=normalizeIdentifier(_0x32e342['tableName']);if(_0x176655&&_0x3811dd['includes']('.'))return![];return _0x3811dd[_0x5427b9(0x135)]('.')['at'](-0x1)===_0xa345ec;});return _0x2f587b[_0x58d4fe(0x119)]===0x1?_0x2f587b[0x0]:undefined;}function columnNamesMatch(_0x372fe6,_0x3f25f7){return normalizeIdentifier(_0x372fe6)===normalizeIdentifier(_0x3f25f7);}function normalizeIdentifier(_0x19eecf){const _0x1fae02=a262_0x557d;return _0x19eecf[_0x1fae02(0x120)](/[`"]/g,'')[_0x1fae02(0x133)]()[_0x1fae02(0x148)]();}function isSqlClauseKeyword(_0x3a451f){const _0x3d8cb5=a262_0x557d;return new Set(['on',_0x3d8cb5(0x12c),_0x3d8cb5(0x14b),_0x3d8cb5(0x111),_0x3d8cb5(0x14a),'left',_0x3d8cb5(0x124),_0x3d8cb5(0x11d),_0x3d8cb5(0x154),_0x3d8cb5(0x134)])['has'](_0x3a451f);}function stripOuterParentheses(_0x4da3c1){const _0x5539d9=a262_0x557d;let _0x59aa49=_0x4da3c1[_0x5539d9(0x133)]();while(_0x59aa49['startsWith']('(')&&_0x59aa49[_0x5539d9(0x146)](')')){let _0x424bc4=0x0,_0x363df7=!![];for(let _0xb71b8b=0x0;_0xb71b8b<_0x59aa49[_0x5539d9(0x119)];_0xb71b8b+=0x1){if(_0x59aa49[_0xb71b8b]==='(')_0x424bc4+=0x1;if(_0x59aa49[_0xb71b8b]===')')_0x424bc4-=0x1;if(_0x424bc4===0x0&&_0xb71b8b<_0x59aa49['length']-0x1){_0x363df7=![];break;}}if(!_0x363df7||_0x424bc4!==0x0)break;_0x59aa49=_0x59aa49[_0x5539d9(0x129)](0x1,-0x1)['trim']();}return _0x59aa49;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a263_0x1285(_0x52f21f,_0x287cdd){_0x52f21f=_0x52f21f-0x1be;const _0x2b4dad=a263_0x2b4d();let _0x1285bd=_0x2b4dad[_0x52f21f];return _0x1285bd;}const a263_0x429786=a263_0x1285;(function(_0x5237fa,_0x5eb307){const _0x442107=a263_0x1285,_0xc03e6b=_0x5237fa();while(!![]){try{const _0x554f01=-parseInt(_0x442107(0x1c9))/0x1*(parseInt(_0x442107(0x1c2))/0x2)+parseInt(_0x442107(0x1be))/0x3+parseInt(_0x442107(0x1c6))/0x4+parseInt(_0x442107(0x1c5))/0x5*(-parseInt(_0x442107(0x1c0))/0x6)+parseInt(_0x442107(0x1cd))/0x7*(-parseInt(_0x442107(0x1cb))/0x8)+-parseInt(_0x442107(0x1bf))/0x9*(-parseInt(_0x442107(0x1c7))/0xa)+-parseInt(_0x442107(0x1c1))/0xb*(-parseInt(_0x442107(0x1c4))/0xc);if(_0x554f01===_0x5eb307)break;else _0xc03e6b['push'](_0xc03e6b['shift']());}catch(_0x53f806){_0xc03e6b['push'](_0xc03e6b['shift']());}}}(a263_0x2b4d,0x1f142));import{resolve}from'node:path';function a263_0x2b4d(){const _0x5d1a69=['sql','8GVhKQE','.rabetbase','1664747vXXcal','358878QhnCEM','1521DZvOfQ','116526wQJJdp','3443TBBSdZ','26vOumXU','sql-trash','13044tdPvmu','25UHyltb','161464TSHuQe','8080ndeFhY','sql.lock.json','13427UEyyUx'];a263_0x2b4d=function(){return _0x5d1a69;};return a263_0x2b4d();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a263_0x429786(0x1cc),LOCK_FILE_NAME=a263_0x429786(0x1c8),TRASH_DIR_NAME=a263_0x429786(0x1c3);export function loadSqlProjectConfig(_0x4dadf7,_0x11a07a){const _0x45a2ed=a263_0x429786,_0xa09632=resolve(_0x11a07a??findProjectRootDirectory()),_0x5c8be6=DOT_DIR+'/sql',_0x25deda=_0x5c8be6+'/'+_0x4dadf7;return{'projectRoot':_0xa09632,'appCode':_0x4dadf7,'sqlWorkspaceRoot':_0x5c8be6,'sqlRoot':_0x25deda,'sqlRootDir':resolve(_0xa09632,DOT_DIR,_0x45a2ed(0x1ca),_0x4dadf7),'lockFilePath':resolve(_0xa09632,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xa09632,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a264_0x5e98(_0x2e712a,_0x23b634){_0x2e712a=_0x2e712a-0x15a;const _0x10dcc8=a264_0x10dc();let _0x5e989e=_0x10dcc8[_0x2e712a];return _0x5e989e;}(function(_0x6dd2d5,_0x5a2da8){const _0x3f8602=a264_0x5e98,_0x36d87e=_0x6dd2d5();while(!![]){try{const _0x1e1017=-parseInt(_0x3f8602(0x171))/0x1*(-parseInt(_0x3f8602(0x161))/0x2)+parseInt(_0x3f8602(0x15d))/0x3*(parseInt(_0x3f8602(0x173))/0x4)+parseInt(_0x3f8602(0x16b))/0x5*(-parseInt(_0x3f8602(0x16a))/0x6)+-parseInt(_0x3f8602(0x170))/0x7*(parseInt(_0x3f8602(0x16f))/0x8)+-parseInt(_0x3f8602(0x163))/0x9+-parseInt(_0x3f8602(0x175))/0xa+parseInt(_0x3f8602(0x160))/0xb*(parseInt(_0x3f8602(0x15c))/0xc);if(_0x1e1017===_0x5a2da8)break;else _0x36d87e['push'](_0x36d87e['shift']());}catch(_0x19c41d){_0x36d87e['push'](_0x36d87e['shift']());}}}(a264_0x10dc,0x55a0c));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x5874db){const _0xf1a7fa=a264_0x5e98;if(_0x5874db==='.sql')return _0xf1a7fa(0x15f);if(_0x5874db===_0xf1a7fa(0x176))return _0xf1a7fa(0x15e);return undefined;}async function scanSqlFilesRecursively(_0x44aec6,_0x4707dd){const _0x49f127=a264_0x5e98,_0x1536f6=[];try{const _0x468d00=await readdir(_0x44aec6,{'withFileTypes':!![]});for(const _0x335084 of _0x468d00){const _0x5c2956=join(_0x44aec6,_0x335084[_0x49f127(0x167)]);if(_0x335084[_0x49f127(0x16d)]()){_0x1536f6['push'](...await scanSqlFilesRecursively(_0x5c2956,_0x4707dd));continue;}if(!_0x335084[_0x49f127(0x16c)]())continue;const _0x14eaa6=extname(_0x335084[_0x49f127(0x167)])[_0x49f127(0x179)](),_0x5f468a=extensionToMode(_0x14eaa6);if(!_0x5f468a)continue;const _0x108bc6=relative(_0x4707dd,_0x5c2956)[_0x49f127(0x172)](/\\/g,'/'),_0x3c7394=_0x108bc6['split']('/')['filter'](Boolean),_0x2e7730=parseSqlPath(_0x3c7394,_0x335084[_0x49f127(0x167)],_0x14eaa6);if(!_0x2e7730)continue;_0x1536f6[_0x49f127(0x164)]({'sqlCode':_0x2e7730['sqlCode'],'sqlName':_0x2e7730[_0x49f127(0x177)],'dbDirectory':_0x3c7394[0x0],'filePath':_0x5c2956,'relativePath':_0x108bc6,'lockKey':_0x2e7730[_0x49f127(0x15b)],'mode':_0x5f468a});}}catch(_0x3c00c7){if(_0x3c00c7[_0x49f127(0x15a)]!=='ENOENT')throw _0x3c00c7;}return _0x1536f6;}export async function scanLocalSqlQueries(_0x13d414){const _0x480541=a264_0x5e98;return scanSqlFilesRecursively(_0x13d414[_0x480541(0x178)],_0x13d414[_0x480541(0x178)]);}export function resolveLocalSqlFilePath(_0x56c09e,_0x289ed2,_0x293b69){const _0x45ffe9=a264_0x5e98,_0xe1c789=_0x293b69?.[_0x45ffe9(0x166)]||(_0x293b69?.['sqlName']||_0x293b69?.[_0x45ffe9(0x162)]?buildSqlRelativePath(_0x289ed2,_0x293b69?.[_0x45ffe9(0x177)],_0x293b69?.[_0x45ffe9(0x162)],_0x293b69?.[_0x45ffe9(0x168)]||_0x45ffe9(0x15f),_0x293b69?.[_0x45ffe9(0x16e)]):buildDefaultSqlFileName(_0x289ed2,_0x293b69?.[_0x45ffe9(0x168)]||_0x45ffe9(0x15f)));return join(_0x56c09e['sqlRootDir'],_0xe1c789);}export async function directoryExists(_0x70b13f){const _0x4074f6=a264_0x5e98;try{const _0x1656bd=await stat(_0x70b13f);return _0x1656bd[_0x4074f6(0x16d)]();}catch{return![];}}function a264_0x10dc(){const _0x571162=['6231303WGtnvD','push','test','path','name','mode','length','14340DbjeCz','275hDjqig','isFile','isDirectory','dbId','11080uIAqcR','1561uypMys','53hetXcw','replace','3984UGOKug','indexOf','2201690yNDYsz','.xml','sqlName','sqlRootDir','toLowerCase','slice','code','sqlCode','48wMZfzp','1563zOBuUE','mybatisXml','sql','3079263JzefNE','2450DSXsHI','dbName'];a264_0x10dc=function(){return _0x571162;};return a264_0x10dc();}function parseSqlPath(_0x3fbaff,_0x4ba993,_0x530a63){const _0x2d2acd=a264_0x5e98,_0x16f172=_0x4ba993[_0x2d2acd(0x17a)](0x0,-_0x530a63[_0x2d2acd(0x169)]);if(_0x3fbaff[_0x2d2acd(0x169)]<0x2)return null;const _0x31d7dd=_0x16f172[_0x2d2acd(0x174)]('_');if(_0x31d7dd<=0x0||_0x31d7dd>=_0x16f172[_0x2d2acd(0x169)]-0x1)return null;const _0xdae210=_0x16f172['slice'](0x0,_0x31d7dd);if(!isLikelySqlCode(_0xdae210))return null;return{'sqlCode':_0xdae210,'sqlName':_0x16f172[_0x2d2acd(0x17a)](_0x31d7dd+0x1)};}function isLikelySqlCode(_0x199ff9){const _0x23e445=a264_0x5e98;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x23e445(0x165)](_0x199ff9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x469a86,_0x29816d){const _0x1a2efe=a265_0x1f7d,_0x2aa4db=_0x469a86();while(!![]){try{const _0x233338=parseInt(_0x1a2efe(0x1c1))/0x1+-parseInt(_0x1a2efe(0x1bb))/0x2*(-parseInt(_0x1a2efe(0x1c2))/0x3)+parseInt(_0x1a2efe(0x1ba))/0x4+-parseInt(_0x1a2efe(0x1bd))/0x5*(parseInt(_0x1a2efe(0x1b9))/0x6)+-parseInt(_0x1a2efe(0x1c5))/0x7+parseInt(_0x1a2efe(0x1c3))/0x8+-parseInt(_0x1a2efe(0x1bc))/0x9*(parseInt(_0x1a2efe(0x1bf))/0xa);if(_0x233338===_0x29816d)break;else _0x2aa4db['push'](_0x2aa4db['shift']());}catch(_0x1fedc6){_0x2aa4db['push'](_0x2aa4db['shift']());}}}(a265_0x22ad,0xafdda));import{readFile}from'node:fs/promises';import a265_0x343bdd from'node:crypto';export function computeSqlContentHash(_0x5506be){const _0x289041=a265_0x1f7d;return a265_0x343bdd[_0x289041(0x1be)]('md5')['update'](_0x5506be)['digest'](_0x289041(0x1c4));}function a265_0x1f7d(_0xcc44a2,_0x52c2e2){_0xcc44a2=_0xcc44a2-0x1b9;const _0x22ad68=a265_0x22ad();let _0x1f7d2c=_0x22ad68[_0xcc44a2];return _0x1f7d2c;}export async function computeSqlFileHash(_0x3ba03d){const _0x232089=a265_0x1f7d,_0x3af5ea=await readFile(_0x3ba03d,_0x232089(0x1c0));return computeSqlContentHash(_0x3af5ea);}function a265_0x22ad(){const _0x2db39f=['48191cSAytH','519msMDMa','9389440SOOjRU','hex','8081563OUeWtf','535002lRPrKf','435040OEmZlP','10910jNxAxU','252CSFWFW','5cAHdXO','createHash','110830dFjoLY','utf8'];a265_0x22ad=function(){return _0x2db39f;};return a265_0x22ad();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23d5d1,_0xb802c1){const _0x5e1fae=a266_0x4533,_0x53cd77=_0x23d5d1();while(!![]){try{const _0x19d563=-parseInt(_0x5e1fae(0xcc))/0x1+-parseInt(_0x5e1fae(0xbb))/0x2+-parseInt(_0x5e1fae(0xba))/0x3+parseInt(_0x5e1fae(0xce))/0x4*(parseInt(_0x5e1fae(0xc8))/0x5)+parseInt(_0x5e1fae(0xc6))/0x6*(-parseInt(_0x5e1fae(0xca))/0x7)+-parseInt(_0x5e1fae(0xc2))/0x8*(parseInt(_0x5e1fae(0xbf))/0x9)+-parseInt(_0x5e1fae(0xd0))/0xa*(-parseInt(_0x5e1fae(0xcb))/0xb);if(_0x19d563===_0xb802c1)break;else _0x53cd77['push'](_0x53cd77['shift']());}catch(_0x37d57a){_0x53cd77['push'](_0x53cd77['shift']());}}}(a266_0x47d0,0x99824));function a266_0x4533(_0x9bbd4,_0x3b971a){_0x9bbd4=_0x9bbd4-0xba;const _0x47d0f0=a266_0x47d0();let _0x453332=_0x47d0f0[_0x9bbd4];return _0x453332;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x2748a0,_0x173fd7,_0x495a26,_0x3bfc3f){const _0xa894da=a266_0x4533,_0xbd19c7=_0x2748a0??createEmptySqlLock();let _0x3388d2=_0xbd19c7['apps'][_0x173fd7];if(!_0x3388d2)return _0x3388d2={'sqlRoot':_0x495a26,'lastSync':'','sqls':{}},_0xbd19c7[_0xa894da(0xbd)][_0x173fd7]=_0x3388d2,{'lockData':_0xbd19c7,'appLock':_0x3388d2};if(!_0x3388d2[_0xa894da(0xc0)])_0x3388d2['sqlRoot']=_0x495a26;else{if(_0x3388d2[_0xa894da(0xc0)]!==_0x495a26)throw new Error(_0x3bfc3f+_0xa894da(0xc3)+_0x495a26+_0xa894da(0xc9)+_0x3388d2[_0xa894da(0xc0)]+_0xa894da(0xc4)+_0xa894da(0xcf));}return!_0x3388d2[_0xa894da(0xcd)]&&(_0x3388d2[_0xa894da(0xcd)]={}),!_0x3388d2[_0xa894da(0xc1)]&&(_0x3388d2[_0xa894da(0xc1)]=''),{'lockData':_0xbd19c7,'appLock':_0x3388d2};}function a266_0x47d0(){const _0x32b83b=['1652406WIVHJH','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','apps','utf8','4816953ZXmmkJ','sqlRoot','lastSync','8hUiFUf',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22.\x20','code','60870ipzzCR','parse','5EIugHn','\x22\x20vs\x20lock\x20\x22','588eZNWxX','44XLVCyU','413575nHuWQM','sqls','4194404LUgTFY','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','6088810TtkrkD','684534xEgHwi'];a266_0x47d0=function(){return _0x32b83b;};return a266_0x47d0();}export async function readSqlLockFile(_0x293b7f){const _0x518cbf=a266_0x4533;try{const _0x2f9c4c=await readFile(_0x293b7f,_0x518cbf(0xbe));return JSON[_0x518cbf(0xc7)](_0x2f9c4c);}catch(_0x3a4c75){if(_0x3a4c75[_0x518cbf(0xc5)]==='ENOENT')return null;throw new Error(_0x518cbf(0xbc)+String(_0x3a4c75));}}export async function writeSqlLockFile(_0x298c59,_0x3f9316){await mkdir(dirname(_0x298c59),{'recursive':!![]}),await writeFile(_0x298c59,JSON['stringify'](_0x3f9316,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3297ed,_0x2dd50b){const _0x14c5b3=a268_0x5beb,_0x4209ae=_0x3297ed();while(!![]){try{const _0x298168=-parseInt(_0x14c5b3(0x1b5))/0x1+parseInt(_0x14c5b3(0x1c0))/0x2*(-parseInt(_0x14c5b3(0x1bd))/0x3)+parseInt(_0x14c5b3(0x1c2))/0x4*(-parseInt(_0x14c5b3(0x1bf))/0x5)+-parseInt(_0x14c5b3(0x1b2))/0x6+-parseInt(_0x14c5b3(0x1c3))/0x7+-parseInt(_0x14c5b3(0x1ba))/0x8+parseInt(_0x14c5b3(0x1be))/0x9;if(_0x298168===_0x2dd50b)break;else _0x4209ae['push'](_0x4209ae['shift']());}catch(_0x536829){_0x4209ae['push'](_0x4209ae['shift']());}}}(a268_0x2032,0x4b86f));function a268_0x5beb(_0x25d7b3,_0x195f4d){_0x25d7b3=_0x25d7b3-0x1b2;const _0x2032a7=a268_0x2032();let _0x5beb3d=_0x2032a7[_0x25d7b3];return _0x5beb3d;}export function detectSqlMode(_0x2fab15){const _0x1af23e=a268_0x5beb,_0x544d75=_0x2fab15[_0x1af23e(0x1b7)]();if(/^<(select|insert|update|delete)\b/i[_0x1af23e(0x1b8)](_0x544d75))return _0x1af23e(0x1bb);return _0x1af23e(0x1b3);}export function getSqlFileExtension(_0x3f09f2){const _0x318782=a268_0x5beb;return _0x3f09f2==='mybatisXml'?_0x318782(0x1c1):_0x318782(0x1b9);}export function buildDefaultSqlFileName(_0x1dc3aa,_0x1255e2){return''+_0x1dc3aa+getSqlFileExtension(_0x1255e2);}export function sanitizeSqlPathSegment(_0x255b69,_0x4aec52){const _0x4aaae0=a268_0x5beb,_0x572e9a=String(_0x255b69??'')[_0x4aaae0(0x1b4)](),_0x2741dd=_0x572e9a[_0x4aaae0(0x1c4)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x4aaae0(0x1c4)](/\s+/g,'-')[_0x4aaae0(0x1c4)](/-+/g,'-')[_0x4aaae0(0x1c4)](/^\.+/,'')[_0x4aaae0(0x1c4)](/\.+$/,'')[_0x4aaae0(0x1c4)](/^-+/,'')[_0x4aaae0(0x1c4)](/-+$/,'');return _0x2741dd||_0x4aec52;}function a268_0x2032(){const _0x14eddf=['2660576BvjtSk','mybatisXml','unknown-db','84EzmDnz','17394201RmMZYp','49485OybxEA','43288puhonJ','.xml','12HEtPlR','765961FUwcao','replace','2245134oDNqAL','sql','trim','171423BgESyN','db-','trimStart','test','.sql'];a268_0x2032=function(){return _0x14eddf;};return a268_0x2032();}export function buildDbDirectoryName(_0x2a49fb,_0x4c58ad){const _0x43f438=a268_0x5beb;return sanitizeSqlPathSegment(_0x2a49fb,_0x4c58ad!=null?_0x43f438(0x1b6)+_0x4c58ad:_0x43f438(0x1bc));}export function buildSqlRelativePath(_0x3a7765,_0x4cd59d,_0x48bcbf,_0x445ae3,_0x586548){const _0x3037d6=buildDbDirectoryName(_0x48bcbf,_0x586548),_0x2f5e75=sanitizeSqlPathSegment(_0x3a7765,'unknown-sql'),_0x43fb36=sanitizeSqlPathSegment(_0x4cd59d,_0x2f5e75);return _0x3037d6+'/'+_0x2f5e75+'_'+_0x43fb36+getSqlFileExtension(_0x445ae3);}
|
|
@@ -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_0x17c50e=a269_0x31db;function a269_0x4392(){const _0x43b07e=['-->','split','bind','startsWith','__RABETBASE_MYBATIS_DYNAMIC_END__','select','SELECT','Invalid\x20XML\x20entity\x20reference.','Invalid\x20MyBatis\x20XML\x20tag.','keys','WITH','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','INSERT','slice','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','parseInt','\x20with\x20parameters:\x20','3370hKoies','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','185167quFUox',''','&','<![CDATA[','has','join','add','2540304buWoqI','UNKNOWN','>','where','insert','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','outer','reason','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','<!--','length','string','push','delete','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','choose','match','otherwise','94GjxXle','property','7QMozxn','35085QEnKIZ','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','trim','foreach','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','9gdSxSy','update','3507112MZEHUp','4045386ktkTJV','replaceAll','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','type','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','sql','Unterminated\x20XML\x20comment.','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','error','includes','52iPXrpI','toUpperCase','unknown\x20table(s)','tagName','mybatisXml','exec','test','replace','toLowerCase','224095xIlkdz','include','^<\x5cs*(?:','set','DELETE','"','Unterminated\x20XML\x20declaration.','UPDATE','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','fromCodePoint','11132ODPOuy','statementType','\x20SET\x20','when','<','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','\x20WHERE\x20','pop','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','matchAll','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','rawName','indexOf','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.'];a269_0x4392=function(){return _0x43b07e;};return a269_0x4392();}(function(_0x4faa24,_0x91c6f4){const _0x783f4e=a269_0x31db,_0x2f7251=_0x4faa24();while(!![]){try{const _0x447c82=parseInt(_0x783f4e(0xcf))/0x1+-parseInt(_0x783f4e(0xe8))/0x2*(-parseInt(_0x783f4e(0x87))/0x3)+parseInt(_0x783f4e(0x99))/0x4*(-parseInt(_0x783f4e(0xa2))/0x5)+-parseInt(_0x783f4e(0x8f))/0x6*(-parseInt(_0x783f4e(0x86))/0x7)+-parseInt(_0x783f4e(0x8e))/0x8*(-parseInt(_0x783f4e(0x8c))/0x9)+-parseInt(_0x783f4e(0xcd))/0xa*(parseInt(_0x783f4e(0xae))/0xb)+-parseInt(_0x783f4e(0xd6))/0xc;if(_0x447c82===_0x91c6f4)break;else _0x2f7251['push'](_0x2f7251['shift']());}catch(_0xc95972){_0x2f7251['push'](_0x2f7251['shift']());}}}(a269_0x4392,0xadd85));const MYBATIS_OUTER_TAGS=new Map([[a269_0x17c50e(0xc1),a269_0x17c50e(0xc2)],[a269_0x17c50e(0xda),a269_0x17c50e(0xc8)],[a269_0x17c50e(0x8d),a269_0x17c50e(0xa9)],[a269_0x17c50e(0xe3),a269_0x17c50e(0xa6)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a269_0x17c50e(0x8a),a269_0x17c50e(0xe5),a269_0x17c50e(0xb1),'otherwise',a269_0x17c50e(0x89),'set',a269_0x17c50e(0xbe),a269_0x17c50e(0xa3),a269_0x17c50e(0x85)]),MYBATIS_BRANCH_TAGS=new Set(['if',a269_0x17c50e(0x8a),'choose',a269_0x17c50e(0xb1),a269_0x17c50e(0xe7)]);export const MYBATIS_DYNAMIC_START_MARKER='__RABETBASE_MYBATIS_DYNAMIC_START__';export const MYBATIS_DYNAMIC_END_MARKER=a269_0x17c50e(0xc0);function a269_0x31db(_0x422ec6,_0xd6f0ed){_0x422ec6=_0x422ec6-0x85;const _0x4392f0=a269_0x4392();let _0x31db50=_0x4392f0[_0x422ec6];return _0x31db50;}export const MYBATIS_INCLUDE_MARKER=a269_0x17c50e(0x88);const UNRESOLVED_SQL_FRAGMENT=a269_0x17c50e(0xca),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a269_0x17c50e(0xa4)+[...MYBATIS_OUTER_TAGS[a269_0x17c50e(0xc5)]()][a269_0x17c50e(0xd4)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x3afd04){const _0x8e59db=a269_0x17c50e,_0x3d85d4=typeof _0x3afd04===_0x8e59db(0xe1)?_0x3afd04:'';if(!startsWithMybatisStatementWrapper(_0x3d85d4))return{'sql':_0x3d85d4,'mode':_0x8e59db(0x94)};let _0x30d18a=0x0,_0xb20c21='',_0x19f4ff,_0x58d4e7=![],_0x49434f=![];const _0xe55f3b=[];while(_0x30d18a<_0x3d85d4[_0x8e59db(0xe0)]){if(_0x3d85d4[_0x8e59db(0xbf)](_0x8e59db(0xdf),_0x30d18a)){const _0x362e37=_0x3d85d4[_0x8e59db(0xba)](_0x8e59db(0xbc),_0x30d18a+0x4);if(_0x362e37<0x0)return invalidMybatisSource(_0x8e59db(0x95));_0xb20c21+='\x20',_0x30d18a=_0x362e37+0x3;continue;}if(_0x3d85d4[_0x8e59db(0xbf)](_0x8e59db(0xd2),_0x30d18a)){if(!_0x58d4e7||_0x49434f)return invalidMybatisSource(_0x8e59db(0xab));const _0x3302ed=_0x3d85d4[_0x8e59db(0xba)](']]>',_0x30d18a+0x9);if(_0x3302ed<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0xb20c21+=_0x3d85d4[_0x8e59db(0xc9)](_0x30d18a+0x9,_0x3302ed),_0x30d18a=_0x3302ed+0x3;continue;}if(_0x3d85d4[_0x8e59db(0xbf)]('<?',_0x30d18a)){if(_0x58d4e7)return invalidMybatisSource(_0x8e59db(0xbb));const _0x269168=_0x3d85d4['indexOf']('?>',_0x30d18a+0x2);if(_0x269168<0x0)return invalidMybatisSource(_0x8e59db(0xa8));_0xb20c21+='\x20',_0x30d18a=_0x269168+0x2;continue;}if(_0x3d85d4[_0x30d18a]!=='<'){const _0x4fc31f=_0x3d85d4[_0x8e59db(0xba)]('<',_0x30d18a),_0x315081=_0x4fc31f<0x0?_0x3d85d4[_0x8e59db(0xe0)]:_0x4fc31f,_0x2d8829=_0x3d85d4['slice'](_0x30d18a,_0x315081);if((!_0x58d4e7||_0x49434f)&&_0x2d8829[_0x8e59db(0x89)]())return invalidMybatisSource(_0x8e59db(0xe4));if(_0x58d4e7&&!_0x49434f){const _0x3877d2=decodeXmlEntities(_0x2d8829);if(_0x3877d2===null)return invalidMybatisSource(_0x8e59db(0xc3));_0xb20c21+=_0x3877d2;}else _0xb20c21+='\x20';_0x30d18a=_0x315081;continue;}const _0xe299ef=findXmlTagEnd(_0x3d85d4,_0x30d18a);if(_0xe299ef<0x0)return invalidMybatisSource('Unterminated\x20MyBatis\x20XML\x20tag.');const _0x260389=_0x3d85d4[_0x8e59db(0xc9)](_0x30d18a,_0xe299ef+0x1),_0x41ed3d=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x8e59db(0x9e)](_0x260389);if(!_0x41ed3d)return invalidMybatisSource(_0x8e59db(0xc4));const _0x18e91c=_0x41ed3d[0x1]==='/',_0x2984a2=_0x41ed3d[0x2]??'',_0x154042=_0x2984a2[_0x8e59db(0xa1)](),_0x5b01ed=_0x41ed3d[0x3]??'',_0x446c88=_0x41ed3d[0x4]==='/',_0x1a40e2=MYBATIS_OUTER_TAGS['get'](_0x154042);if(!_0x1a40e2&&!MYBATIS_DYNAMIC_TAGS[_0x8e59db(0xd3)](_0x154042))return invalidMybatisSource(_0x8e59db(0xb3)+_0x154042+'>.');if(!_0x1a40e2&&_0x2984a2!==_0x154042)return invalidMybatisSource(_0x8e59db(0xaa)+_0x2984a2+'>.');if(_0x18e91c){if(_0x5b01ed[_0x8e59db(0x89)]()||_0x446c88)return invalidMybatisSource(_0x8e59db(0x93)+_0x2984a2+'>.');const _0x19635e=_0xe55f3b['at'](-0x1);if(!_0x19635e||(_0x19635e[_0x8e59db(0xdc)]?_0x19635e[_0x8e59db(0x9c)]!==_0x154042:_0x19635e[_0x8e59db(0xb9)]!==_0x2984a2))return invalidMybatisSource(_0x8e59db(0xde)+_0x2984a2+'>.');_0xe55f3b[_0x8e59db(0xb5)]();if(_0x19635e[_0x8e59db(0xdc)])_0x49434f=!![];_0xb20c21+=MYBATIS_BRANCH_TAGS[_0x8e59db(0xd3)](_0x154042)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x5b01ed))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x2984a2+'>.');if(_0x154042===_0x8e59db(0x85)&&(!_0x446c88||_0xe55f3b['at'](-0x1)?.['tagName']!=='include'))return invalidMybatisSource(_0x8e59db(0x8b));if(_0x1a40e2){if(_0x58d4e7||_0xe55f3b[_0x8e59db(0xe0)]>0x0)return invalidMybatisSource(_0x8e59db(0xac));_0x58d4e7=!![],_0x49434f=_0x446c88,_0x19f4ff=_0x1a40e2;}else{if(!_0x58d4e7||_0x49434f)return invalidMybatisSource(_0x8e59db(0xc7)+_0x2984a2+'>.');}_0xb20c21+=_0x154042===_0x8e59db(0xd9)?_0x8e59db(0xb4):_0x154042===_0x8e59db(0xa5)?_0x8e59db(0xb0):_0x154042===_0x8e59db(0xa3)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x154042)&&!_0x446c88?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x446c88&&_0xe55f3b[_0x8e59db(0xe2)]({'rawName':_0x2984a2,'tagName':_0x154042,'outer':!!_0x1a40e2});}_0x30d18a=_0xe299ef+0x1;}if(_0xe55f3b[_0x8e59db(0xe0)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0xe55f3b['at'](-0x1)?.['rawName']+'>.');if(!_0x58d4e7||!_0x49434f)return invalidMybatisSource(_0x8e59db(0xdb));return{'sql':_0xb20c21[_0x8e59db(0x89)](),'mode':_0x8e59db(0x9d),..._0x19f4ff?{'statementType':_0x19f4ff}:{}};}function hasWellFormedXmlAttributes(_0x533f5c){const _0x214517=a269_0x17c50e;let _0x4aeb4f=0x0;const _0x22c625=new Set();while(_0x4aeb4f<_0x533f5c['length']){while(_0x4aeb4f<_0x533f5c[_0x214517(0xe0)]&&/\s/['test'](_0x533f5c[_0x4aeb4f]??''))_0x4aeb4f+=0x1;if(_0x4aeb4f>=_0x533f5c[_0x214517(0xe0)])return!![];const _0x5ddd81=/^[A-Za-z_:][\w:.-]*/[_0x214517(0x9e)](_0x533f5c[_0x214517(0xc9)](_0x4aeb4f)),_0x41e2be=_0x5ddd81?.[0x0];if(!_0x41e2be||_0x22c625[_0x214517(0xd3)](_0x41e2be))return![];_0x22c625[_0x214517(0xd5)](_0x41e2be),_0x4aeb4f+=_0x41e2be[_0x214517(0xe0)];while(_0x4aeb4f<_0x533f5c[_0x214517(0xe0)]&&/\s/[_0x214517(0x9f)](_0x533f5c[_0x4aeb4f]??''))_0x4aeb4f+=0x1;if(_0x533f5c[_0x4aeb4f]!=='=')return![];_0x4aeb4f+=0x1;while(_0x4aeb4f<_0x533f5c[_0x214517(0xe0)]&&/\s/[_0x214517(0x9f)](_0x533f5c[_0x4aeb4f]??''))_0x4aeb4f+=0x1;const _0x38e735=_0x533f5c[_0x4aeb4f];if(_0x38e735!=='\x22'&&_0x38e735!=='\x27')return![];_0x4aeb4f+=0x1;const _0x381fd6=_0x533f5c[_0x214517(0xba)](_0x38e735,_0x4aeb4f);if(_0x381fd6<0x0)return![];if(decodeXmlEntities(_0x533f5c[_0x214517(0xc9)](_0x4aeb4f,_0x381fd6))===null)return![];_0x4aeb4f=_0x381fd6+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x506374){const _0x277b4b=a269_0x17c50e;let _0x24c68b=0x0;const _0x2230e2=()=>{const _0x292586=a269_0x31db;while(_0x24c68b<_0x506374[_0x292586(0xe0)]&&/\s/[_0x292586(0x9f)](_0x506374[_0x24c68b]??''))_0x24c68b+=0x1;};_0x2230e2();while(_0x24c68b<_0x506374['length']){if(_0x506374[_0x277b4b(0xbf)](_0x277b4b(0xdf),_0x24c68b)){const _0x2a6927=_0x506374[_0x277b4b(0xba)](_0x277b4b(0xbc),_0x24c68b+0x4);if(_0x2a6927<0x0)return!![];_0x24c68b=_0x2a6927+0x3,_0x2230e2();continue;}if(_0x506374['startsWith']('<?',_0x24c68b)){const _0x4486f8=_0x506374['indexOf']('?>',_0x24c68b+0x2);if(_0x4486f8<0x0)return!![];_0x24c68b=_0x4486f8+0x2,_0x2230e2();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x277b4b(0x9f)](_0x506374[_0x277b4b(0xc9)](_0x24c68b));}function invalidMybatisSource(_0x3dfad8){const _0x23a092=a269_0x17c50e;return{'sql':'','mode':_0x23a092(0x9d),'error':_0x3dfad8};}function findXmlTagEnd(_0x1f82fa,_0x20912c){const _0x296e32=a269_0x17c50e;let _0x83df07;for(let _0x247c98=_0x20912c+0x1;_0x247c98<_0x1f82fa[_0x296e32(0xe0)];_0x247c98+=0x1){const _0x4b04bd=_0x1f82fa[_0x247c98];if(_0x83df07){if(_0x4b04bd===_0x83df07)_0x83df07=undefined;continue;}if(_0x4b04bd==='\x22'||_0x4b04bd==='\x27'){_0x83df07=_0x4b04bd;continue;}if(_0x4b04bd==='>')return _0x247c98;}return-0x1;}function decodeXmlEntities(_0x3dc64d){let _0x3da148=![];const _0x323ce5=_0x3dc64d['replace'](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x5c6524=>{const _0x10f2e1=a269_0x31db;if(_0x5c6524===_0x10f2e1(0xb2))return'<';if(_0x5c6524===_0x10f2e1(0xd8))return'>';if(_0x5c6524===_0x10f2e1(0xa7))return'\x22';if(_0x5c6524===_0x10f2e1(0xd0))return'\x27';if(_0x5c6524===_0x10f2e1(0xd1))return'&';const _0x14ff41=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x10f2e1(0x9e)](_0x5c6524);if(_0x14ff41){const _0x11ba98=_0x14ff41[0x1],_0x1bf4d3=_0x14ff41[0x2],_0x3757fa=Number[_0x10f2e1(0xcb)](_0x11ba98??_0x1bf4d3??'',_0x11ba98?0x10:0xa);if(isValidXmlCharacter(_0x3757fa))return String[_0x10f2e1(0xad)](_0x3757fa);}return _0x3da148=!![],'';});return _0x3da148?null:_0x323ce5;}function isValidXmlCharacter(_0x135c71){return _0x135c71===0x9||_0x135c71===0xa||_0x135c71===0xd||_0x135c71>=0x20&&_0x135c71<=0xd7ff||_0x135c71>=0xe000&&_0x135c71<=0xfffd||_0x135c71>=0x10000&&_0x135c71<=0x10ffff;}export function detectSqlType(_0x3972ba){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3972ba));}function detectNormalizedSqlType(_0x5c064c){const _0x4e96da=a269_0x17c50e;if(_0x5c064c['error'])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x5c064c['error']};if(!_0x5c064c[_0x4e96da(0x94)][_0x4e96da(0x89)]())return{'type':_0x4e96da(0xd7),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x48bb7c=stripStaticAnalysisMarkers(_0x5c064c[_0x4e96da(0x94)])[_0x4e96da(0xa0)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x4e96da(0xa0)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x4e96da(0xa0)](/\/\*[\s\S]*?\*\//g,'')[_0x4e96da(0x89)](),_0x45e24f=_0x48bb7c[_0x4e96da(0xbd)]('\x0a');let _0x5b0598='';for(const _0x4c6dcb of _0x45e24f){const _0xf80e2d=_0x4c6dcb[_0x4e96da(0x89)]();if(!_0xf80e2d||_0xf80e2d['startsWith']('--')||_0xf80e2d['startsWith']('/*'))continue;_0x5b0598=_0xf80e2d;break;}const _0x1ed93b=_0x5b0598[_0x4e96da(0x9a)](),_0x1af5bc=_0x5c064c[_0x4e96da(0xaf)],_0x54eb0e=maskSqlTextForBlockedKeywordScan(_0x48bb7c),_0x8bd1bb=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x4e96da(0x9f)](_0x54eb0e);if(_0x1af5bc===_0x4e96da(0xc2)||!_0x1af5bc&&(_0x1ed93b[_0x4e96da(0xbf)](_0x4e96da(0xc2))||_0x1ed93b[_0x4e96da(0xbf)](_0x4e96da(0xc6)))){const _0x357a20=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x4e96da(0x9f)](_0x48bb7c);return{'type':_0x4e96da(0xc2),'isSelectOnly':!_0x357a20,'isDangerous':_0x357a20,'reason':_0x357a20?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x1af5bc===_0x4e96da(0xc8)||!_0x1af5bc&&_0x1ed93b['startsWith']('INSERT'))return{'type':_0x4e96da(0xc8),'isSelectOnly':![],'isDangerous':_0x8bd1bb,'reason':_0x8bd1bb?_0x4e96da(0xb8):undefined};if(_0x1af5bc==='UPDATE'||!_0x1af5bc&&_0x1ed93b[_0x4e96da(0xbf)](_0x4e96da(0xa9)))return{'type':_0x4e96da(0xa9),'isSelectOnly':![],'isDangerous':_0x8bd1bb,'reason':_0x8bd1bb?_0x4e96da(0xb8):undefined};if(_0x1af5bc===_0x4e96da(0xa6)||!_0x1af5bc&&_0x1ed93b[_0x4e96da(0xbf)](_0x4e96da(0xa6)))return{'type':_0x4e96da(0xa6),'isSelectOnly':![],'isDangerous':!![],'reason':_0x4e96da(0xce)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x4e96da(0x9f)](_0x1ed93b))return{'type':'DDL','isSelectOnly':![],'isDangerous':!![],'reason':_0x4e96da(0xb6)};return{'type':_0x4e96da(0xd7),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3209ea){const _0x380ebb=a269_0x17c50e;return _0x3209ea[_0x380ebb(0x90)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x380ebb(0x90)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x542987){const _0x4da611=a269_0x17c50e;return _0x542987[_0x4da611(0xa0)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x4da611(0xa0)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x4da611(0xa0)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x4da611(0xa0)](/--.*$/gm,'\x20')[_0x4da611(0xa0)](/#.*$/gm,'\x20')[_0x4da611(0xa0)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x4c365f){const _0xcf4ffb=a269_0x17c50e,_0x3e0061=_0x4c365f[_0xcf4ffb(0xa0)](/#\{[^}]*\}/g,'?')[_0xcf4ffb(0xa0)](/\$\{[^}]*\}/g,'?')[_0xcf4ffb(0xa0)](/'[^']*'/g,'\x27\x27')[_0xcf4ffb(0xa0)](/--.*$/gm,'')[_0xcf4ffb(0xa0)](/\/\*[\s\S]*?\*\//g,''),_0x43f865=[],_0x1a16b4=_0x3e0061['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x43f865,_0x1a16b4?.[0x1]);for(const _0x605f6d of _0x3e0061[_0xcf4ffb(0xb7)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x43f865,_0x605f6d[0x1]);}const _0x1ad00e=_0x3e0061['match'](/INTO\s+([^\s(]+)/i);addTable(_0x43f865,_0x1ad00e?.[0x1]);const _0x1cb08e=_0x3e0061[_0xcf4ffb(0xe6)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x43f865,_0x1cb08e?.[0x1]),_0x43f865;}function addTable(_0x31f635,_0x2e409f){const _0x566609=a269_0x17c50e,_0x542f10=_0x2e409f?.['replace'](/[`"]/g,'');_0x542f10&&_0x542f10!==UNRESOLVED_SQL_FRAGMENT&&!_0x31f635[_0x566609(0x98)](_0x542f10)&&_0x31f635[_0x566609(0xe2)](_0x542f10);}function extractParameters(_0x30c102){const _0x517dde=a269_0x17c50e,_0x158516=new Set();for(const _0x48e316 of _0x30c102[_0x517dde(0xb7)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x48e316[0x1])_0x158516[_0x517dde(0xd5)](_0x48e316[0x1]);}return Array['from'](_0x158516);}export function validateSql(_0x2b0758){const _0x16b2b1=a269_0x17c50e,_0x599bf1=normalizeSqlForStaticAnalysis(_0x2b0758),_0x45675d=detectNormalizedSqlType(_0x599bf1),_0x956abf=stripStaticAnalysisMarkers(_0x599bf1['sql']),_0x56270a=_0x599bf1[_0x16b2b1(0x97)]?[]:extractTables(_0x956abf),_0x28bb50=_0x599bf1[_0x16b2b1(0x97)]?[]:extractParameters(_0x956abf);if(_0x45675d['isDangerous'])return{'valid':![],'sqlType':_0x45675d,'tables':_0x56270a,'parameters':_0x28bb50,'message':_0x45675d[_0x16b2b1(0xdd)]||_0x45675d[_0x16b2b1(0x92)]+_0x16b2b1(0x91)};if(_0x45675d[_0x16b2b1(0x92)]===_0x16b2b1(0xd7))return{'valid':![],'sqlType':_0x45675d,'tables':_0x56270a,'parameters':_0x28bb50,'message':_0x599bf1[_0x16b2b1(0x97)]?'Unable\x20to\x20detect\x20SQL\x20type.\x20'+_0x599bf1[_0x16b2b1(0x97)]:_0x16b2b1(0x96)};return{'valid':!![],'sqlType':_0x45675d,'tables':_0x56270a,'parameters':_0x28bb50,'message':_0x45675d['type']+'\x20query\x20targeting\x20'+(_0x56270a[_0x16b2b1(0xe0)]?_0x56270a[_0x16b2b1(0xd4)](',\x20'):_0x16b2b1(0x9b))+(_0x28bb50[_0x16b2b1(0xe0)]?_0x16b2b1(0xcc)+_0x28bb50[_0x16b2b1(0xd4)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a270_0x1b570c=a270_0x174a;(function(_0x4301e6,_0x1d4e25){const _0x55473e=a270_0x174a,_0xe8a09c=_0x4301e6();while(!![]){try{const _0x26bc48=-parseInt(_0x55473e(0x11e))/0x1*(-parseInt(_0x55473e(0x107))/0x2)+parseInt(_0x55473e(0x10e))/0x3+parseInt(_0x55473e(0x109))/0x4*(-parseInt(_0x55473e(0x100))/0x5)+-parseInt(_0x55473e(0x11a))/0x6+-parseInt(_0x55473e(0x101))/0x7*(parseInt(_0x55473e(0x117))/0x8)+parseInt(_0x55473e(0x11b))/0x9*(-parseInt(_0x55473e(0x10c))/0xa)+parseInt(_0x55473e(0x115))/0xb;if(_0x26bc48===_0x1d4e25)break;else _0xe8a09c['push'](_0xe8a09c['shift']());}catch(_0x29fd2d){_0xe8a09c['push'](_0xe8a09c['shift']());}}}(a270_0x28f8,0xc00bd));function a270_0x28f8(){const _0x2327b0=['Configuration\x20file\x20not\x20found','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','config_missing','network_error','validation','32114984kHxGhK','\x20auth`\x20to\x20login\x20first.','32uZlpYx','auth_required','\x20--help`\x20to\x20see\x20available\x20commands.','3101004eHImNP','32733xRcaLD','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`','Network\x20error:\x20','1LHvXHG','not_in_project','flag_missing','933655OXbxPh','1482362svaPUC','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','Missing\x20required\x20flag:\x20--','Unknown\x20command:\x20','unknown_command','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','2169882KvtmHJ','apiError','28piqnjg','\x20project\x20directory','Run\x20`','2880JlgPpB','Not\x20in\x20a\x20','1501821WAiRMU','cancelled'];a270_0x28f8=function(){return _0x2327b0;};return a270_0x28f8();}function a270_0x174a(_0x35bb49,_0x3249a0){_0x35bb49=_0x35bb49-0x100;const _0x28f801=a270_0x28f8();let _0x174a19=_0x28f801[_0x35bb49];return _0x174a19;}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a270_0x1b570c(0x10b)+CLI_BIN_NAME+a270_0x1b570c(0x116),'configMissingHint':'Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a270_0x1b570c(0x11c)+CLI_BIN_NAME+a270_0x1b570c(0x102),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});export const CliErrors={'authRequired'(_0x21ee56){const _0x7ab93=a270_0x1b570c;return new CliError(_0x7ab93(0x118),0x1,'Authentication\x20required',_0x21ee56??_0x7ab93(0x10b)+CLI_BIN_NAME+_0x7ab93(0x116));},'configMissing'(_0x4d82b8){const _0x320050=a270_0x1b570c;return new CliError(_0x320050(0x112),0x1,_0x320050(0x110),_0x4d82b8??'Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+_0x320050(0x11c)+CLI_BIN_NAME+_0x320050(0x102));},'notInProject'(){const _0x1e6f7c=a270_0x1b570c;return new CliError(_0x1e6f7c(0x11f),0x1,_0x1e6f7c(0x10d)+CLI_BIN_NAME+_0x1e6f7c(0x10a),_0x1e6f7c(0x111));},'apiError'(_0x3a6a1b,_0x1871cb){const _0x4a04ff=a270_0x1b570c;return baseCliErrors[_0x4a04ff(0x108)](_0x3a6a1b,_0x1871cb);},'networkError'(_0x1a3ce8){const _0x1e08de=a270_0x1b570c;return new CliError(_0x1e08de(0x113),0x2,_0x1e08de(0x11d)+_0x1a3ce8,_0x1e08de(0x106));},'unknownCommand'(_0x349bf){const _0x351e1c=a270_0x1b570c;return new CliError(_0x351e1c(0x105),0x1,_0x351e1c(0x104)+_0x349bf,_0x351e1c(0x10b)+CLI_BIN_NAME+_0x351e1c(0x119));},'flagMissing'(_0x35c6f9,_0xe90c68){const _0x2abf9b=a270_0x1b570c;return new CliError(_0x2abf9b(0x120),0x1,_0x2abf9b(0x103)+_0x35c6f9,_0xe90c68);},'validation'(_0x33df71,_0x1db5b0){const _0x2f7e2e=a270_0x1b570c;return baseCliErrors[_0x2f7e2e(0x114)](_0x33df71,_0x1db5b0);},'cancelled'(_0x4d7f2b){const _0x48d913=a270_0x1b570c;return new CliError(_0x48d913(0x10f),0x0,_0x4d7f2b??'Operation\x20cancelled.');}};
|