@lovrabet/rabetbase-cli 2.5.0-beta.1 → 2.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/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/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/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/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/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.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 +1 -1
- package/skills/rabetbase/references/rabetbase-config.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +17 -6
- package/skills/rabetbase/references/rabetbase-kb.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27ff3b,_0x1ad3c1){const _0x475df8=a228_0x4e42,_0x38d5df=_0x27ff3b();while(!![]){try{const _0x40e106=parseInt(_0x475df8(0x81))/0x1*(parseInt(_0x475df8(0x69))/0x2)+parseInt(_0x475df8(0x67))/0x3*(parseInt(_0x475df8(0x70))/0x4)+parseInt(_0x475df8(0x68))/0x5+parseInt(_0x475df8(0x85))/0x6+parseInt(_0x475df8(0x84))/0x7*(-parseInt(_0x475df8(0x7d))/0x8)+parseInt(_0x475df8(0x7e))/0x9+parseInt(_0x475df8(0x6b))/0xa*(-parseInt(_0x475df8(0x72))/0xb);if(_0x40e106===_0x1ad3c1)break;else _0x38d5df['push'](_0x38d5df['shift']());}catch(_0x4d93ad){_0x38d5df['push'](_0x38d5df['shift']());}}}(a228_0x21ed,0x1bf46));import{listDatasets}from'../core/api-client.js';function a228_0x4e42(_0x2e0849,_0x2ae9bd){_0x2e0849=_0x2e0849-0x67;const _0x21ed55=a228_0x21ed();let _0x4e4218=_0x21ed55[_0x2e0849];return _0x4e4218;}const cache=new Map();export async function listDatabases(_0x4b1b73){const _0x457883=a228_0x4e42;if(cache['has'](_0x4b1b73))return cache['get'](_0x4b1b73);const _0x36a001=await listDatasets(_0x4b1b73),_0x18fc9d=new Map();for(const _0x5973df of _0x36a001){const _0x1d51eb=_0x5973df[_0x457883(0x7c)];_0x1d51eb?.['dbId']!=null&&_0x18fc9d[_0x457883(0x6a)](_0x1d51eb[_0x457883(0x6d)],_0x1d51eb[_0x457883(0x77)]??_0x457883(0x78)+_0x1d51eb[_0x457883(0x6d)]);}const _0x4da971=[..._0x18fc9d[_0x457883(0x7f)]()][_0x457883(0x83)](([_0x2452ce,_0x3e9e6a])=>({'dbId':_0x2452ce,'dbName':_0x3e9e6a}));return cache[_0x457883(0x6a)](_0x4b1b73,_0x4da971),_0x4da971;}function a228_0x21ed(){const _0x5772ae=['393990uJCWSk','118OTukWa','set','252020FLnjEA','length','dbId','\x22\x20under\x20app\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','1236jaZGDC','find','88DzjgmW','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','isNaN','\x22.\x20Available:\x20','dbName','db-','toLowerCase','No\x20database\x20matching\x20\x22','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbtableConfig','1195928EcGUBr','1378314hMALPV','entries','join','521lwTGTC','filter','map','7UAHqKe','945018hzhqab','441rruKHe'];a228_0x21ed=function(){return _0x5772ae;};return a228_0x21ed();}export async function resolveDb(_0x26bc61,_0x4e9fd0){const _0x54cc4f=a228_0x4e42,_0x565e5b=await listDatabases(_0x26bc61);if(_0x565e5b[_0x54cc4f(0x6c)]===0x0)return{'resolved':[],'error':_0x54cc4f(0x6f)+_0x26bc61+_0x54cc4f(0x7b)};if(!_0x4e9fd0)return{'resolved':_0x565e5b};const _0x4bef5b=Number(_0x4e9fd0);if(!Number[_0x54cc4f(0x75)](_0x4bef5b)){const _0x448f20=_0x565e5b['find'](_0x3db5ad=>_0x3db5ad['dbId']===_0x4bef5b);if(_0x448f20)return{'resolved':[_0x448f20]};}const _0x91a946=_0x4e9fd0['toLowerCase'](),_0x1af711=_0x565e5b[_0x54cc4f(0x82)](_0x9adc88=>_0x9adc88[_0x54cc4f(0x77)][_0x54cc4f(0x79)]()['includes'](_0x91a946));if(_0x1af711[_0x54cc4f(0x6c)]>0x0)return{'resolved':_0x1af711};const _0x17d34c=_0x565e5b['map'](_0x3f6149=>_0x3f6149['dbName']+'\x20('+_0x3f6149[_0x54cc4f(0x6d)]+')')['join'](',\x20');return{'resolved':[],'error':_0x54cc4f(0x7a)+_0x4e9fd0+_0x54cc4f(0x6e)+_0x26bc61+_0x54cc4f(0x76)+_0x17d34c+_0x54cc4f(0x74)};}export async function resolveOneDb(_0xb3c93b,_0x52fc51){const _0x1f0f7a=a228_0x4e42,{resolved:_0x2b18ea,error:_0x567bcf}=await resolveDb(_0xb3c93b,_0x52fc51);if(_0x567bcf)return{'db':null,'error':_0x567bcf};if(_0x2b18ea['length']===0x1)return{'db':_0x2b18ea[0x0]};if(!_0x52fc51){const _0x526570=_0x2b18ea[_0x1f0f7a(0x83)](_0x47fc5d=>_0x47fc5d[_0x1f0f7a(0x77)]+'\x20('+_0x47fc5d[_0x1f0f7a(0x6d)]+')')[_0x1f0f7a(0x80)](',\x20');return{'db':null,'error':_0x1f0f7a(0x73)+_0x526570};}const _0x3cbe69=_0x2b18ea[_0x1f0f7a(0x83)](_0x23e3cd=>_0x23e3cd[_0x1f0f7a(0x77)]+'\x20('+_0x23e3cd[_0x1f0f7a(0x6d)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x52fc51+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x3cbe69+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x328390,_0x41fec3){const _0x66b2b6=a228_0x4e42,_0x40415c=await listDatabases(_0x328390);return _0x40415c[_0x66b2b6(0x71)](_0x5d1f35=>_0x5d1f35[_0x66b2b6(0x6d)]===_0x41fec3)?.[_0x66b2b6(0x77)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a229_0x49e6f3=a229_0x5aca;(function(_0x184a69,_0x6a8fd5){const _0x35b592=a229_0x5aca,_0x95eb86=_0x184a69();while(!![]){try{const _0x341a7e=parseInt(_0x35b592(0xe0))/0x1*(-parseInt(_0x35b592(0xe1))/0x2)+-parseInt(_0x35b592(0xe4))/0x3+parseInt(_0x35b592(0xea))/0x4*(parseInt(_0x35b592(0xe5))/0x5)+-parseInt(_0x35b592(0xe8))/0x6+-parseInt(_0x35b592(0xe9))/0x7*(parseInt(_0x35b592(0xe3))/0x8)+parseInt(_0x35b592(0xe7))/0x9*(parseInt(_0x35b592(0xdc))/0xa)+parseInt(_0x35b592(0xdb))/0xb*(parseInt(_0x35b592(0xdd))/0xc);if(_0x341a7e===_0x6a8fd5)break;else _0x95eb86['push'](_0x95eb86['shift']());}catch(_0x2856ea){_0x95eb86['push'](_0x95eb86['shift']());}}}(a229_0x4abe,0x2174c));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x26d6d9,_0x2ff7a=process[a229_0x49e6f3(0xda)]()){const _0x1e6536=a229_0x49e6f3,_0x468f79=resolve(_0x2ff7a),_0x9c7c88=join(_0x468f79,_0x1e6536(0xe2),'page');return{'projectRoot':_0x468f79,'pagesBaseDir':_0x9c7c88,'appPagesDir':join(_0x9c7c88,_0x26d6d9),'lockFilePath':join(_0x468f79,_0x1e6536(0xe2),_0x1e6536(0xdf))};}function a229_0x4abe(){const _0x868937=['toUpperCase','45Pirplw','1092288SSrnif','1794205HWHiUb','1016LpZxgD','cwd','110858URDozq','294240LMWIAs','516qweKqj','F_OK','page.lock.json','2169rpnuVY','122mBPFBn','.rabetbase','8ESBavT','122742gtcZhR','3310kyTOYL'];a229_0x4abe=function(){return _0x868937;};return a229_0x4abe();}export function buildPageFileName(_0x1821df,_0x407534){const _0x405886=a229_0x49e6f3;return _0x1821df+'-'+String(_0x407534)[_0x405886(0xe6)]()+'.json';}export function resolvePageFilePath(_0x302fce,_0x58a12b,_0x2170ac){return join(_0x302fce['appPagesDir'],buildPageFileName(_0x58a12b,_0x2170ac));}export async function ensureParentDirectory(_0x1e917e){await mkdir(dirname(_0x1e917e),{'recursive':!![]});}function a229_0x5aca(_0x3c10de,_0x1526b2){_0x3c10de=_0x3c10de-0xda;const _0x4abe1d=a229_0x4abe();let _0x5aca26=_0x4abe1d[_0x3c10de];return _0x5aca26;}export async function fileExists(_0x487bdd){const _0x974900=a229_0x49e6f3;try{return await access(_0x487bdd,constants[_0x974900(0xde)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x288611,_0x124cb5){const _0x5dd7c9=a230_0x1684,_0x41f612=_0x288611();while(!![]){try{const _0x771988=parseInt(_0x5dd7c9(0xeb))/0x1*(-parseInt(_0x5dd7c9(0xe7))/0x2)+-parseInt(_0x5dd7c9(0xed))/0x3+parseInt(_0x5dd7c9(0xe6))/0x4+-parseInt(_0x5dd7c9(0xe1))/0x5+-parseInt(_0x5dd7c9(0xea))/0x6*(-parseInt(_0x5dd7c9(0xdf))/0x7)+parseInt(_0x5dd7c9(0xec))/0x8*(-parseInt(_0x5dd7c9(0xef))/0x9)+-parseInt(_0x5dd7c9(0xe9))/0xa*(-parseInt(_0x5dd7c9(0xe4))/0xb);if(_0x771988===_0x124cb5)break;else _0x41f612['push'](_0x41f612['shift']());}catch(_0x513951){_0x41f612['push'](_0x41f612['shift']());}}}(a230_0x9b2e,0xdc124));import a230_0x185abe from'node:crypto';function a230_0x1684(_0x2b7edb,_0x133c01){_0x2b7edb=_0x2b7edb-0xdf;const _0x9b2ecf=a230_0x9b2e();let _0x16846b=_0x9b2ecf[_0x2b7edb];return _0x16846b;}function a230_0x9b2e(){const _0x6b44c=['265584BCPtxo','createHash','580380SyTZVS','762QrzAZX','digest','1110TbXBIu','4236oWJoQT','1511dsJqva','8wgaOiR','2745198YwpiRs','parse','2530701fMAaXZ','2996LrlvCP','update','2269445aufSJd','hex','utf8'];a230_0x9b2e=function(){return _0x6b44c;};return a230_0x9b2e();}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x6f3a85){const _0x38b5df=a230_0x1684;return JSON['stringify'](JSON[_0x38b5df(0xee)](_0x6f3a85),null,0x2)+'\x0a';}export function computePageContentHash(_0x468f74){const _0x4e5e43=a230_0x1684;return a230_0x185abe[_0x4e5e43(0xe5)]('md5')[_0x4e5e43(0xe0)](_0x468f74)[_0x4e5e43(0xe8)](_0x4e5e43(0xe2));}export function computeSerializedSchemaHash(_0x5a9cde){return computePageContentHash(serializePageSchemaForFile(_0x5a9cde));}export async function computePageFileHash(_0x27415c){const _0x314a03=a230_0x1684,_0x4e4ef7=await readFile(_0x27415c,_0x314a03(0xe3));return computePageContentHash(_0x4e4ef7);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2052d9,_0x53e914){const _0x1125b4=a231_0x3654,_0x4e06d1=_0x2052d9();while(!![]){try{const _0x5de3b1=-parseInt(_0x1125b4(0x13f))/0x1*(parseInt(_0x1125b4(0x14c))/0x2)+-parseInt(_0x1125b4(0x14e))/0x3+parseInt(_0x1125b4(0x144))/0x4*(-parseInt(_0x1125b4(0x143))/0x5)+parseInt(_0x1125b4(0x147))/0x6*(parseInt(_0x1125b4(0x140))/0x7)+-parseInt(_0x1125b4(0x13b))/0x8+parseInt(_0x1125b4(0x142))/0x9*(-parseInt(_0x1125b4(0x145))/0xa)+parseInt(_0x1125b4(0x146))/0xb;if(_0x5de3b1===_0x53e914)break;else _0x4e06d1['push'](_0x4e06d1['shift']());}catch(_0x19dfe2){_0x4e06d1['push'](_0x4e06d1['shift']());}}}(a231_0x5c3f,0x37d6f));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a231_0x5c3f(){const _0x5dbc51=['ENOENT','utf8','718mzElkZ','apps','965253bsGONU','lastSync','2295440XcPist','code','stringify','object','11hpXFkc','7kYKYGm','parse','9CxCdoV','10LRspNl','446584wXJmEc','3834910qFZuVZ','12188165FubdPd','2040702RmdFVp','pages','Failed\x20to\x20read\x20page\x20lock\x20file:\x20'];a231_0x5c3f=function(){return _0x5dbc51;};return a231_0x5c3f();}export function ensurePageLockScope(_0x229985,_0x147dec){const _0x56a0bd=a231_0x3654,_0x1e8abe={'apps':_0x229985[_0x56a0bd(0x14d)]&&typeof _0x229985['apps']===_0x56a0bd(0x13e)?_0x229985[_0x56a0bd(0x14d)]:{}};let _0x235221=_0x1e8abe[_0x56a0bd(0x14d)][_0x147dec];if(!_0x235221)return _0x235221={'lastSync':'','pages':{}},_0x1e8abe[_0x56a0bd(0x14d)][_0x147dec]=_0x235221,{'lockData':_0x1e8abe,'appLock':_0x235221};return!_0x235221[_0x56a0bd(0x14f)]&&(_0x235221[_0x56a0bd(0x14f)]=''),(!_0x235221['pages']||typeof _0x235221[_0x56a0bd(0x148)]!==_0x56a0bd(0x13e))&&(_0x235221['pages']={}),{'lockData':_0x1e8abe,'appLock':_0x235221};}export async function readPageLockFile(_0x670768){const _0x30c134=a231_0x3654;try{const _0x541793=await readFile(_0x670768,_0x30c134(0x14b)),_0x2a9d63=JSON[_0x30c134(0x141)](_0x541793);return{'apps':_0x2a9d63[_0x30c134(0x14d)]&&typeof _0x2a9d63['apps']===_0x30c134(0x13e)?_0x2a9d63[_0x30c134(0x14d)]:{}};}catch(_0x4795a2){if(_0x4795a2[_0x30c134(0x13c)]===_0x30c134(0x14a))return null;throw new Error(_0x30c134(0x149)+String(_0x4795a2));}}function a231_0x3654(_0x1749be,_0x10f35b){_0x1749be=_0x1749be-0x13b;const _0x5c3f1a=a231_0x5c3f();let _0x365464=_0x5c3f1a[_0x1749be];return _0x365464;}export async function writePageLockFile(_0x761bcf,_0x2a5122){const _0x56308d=a231_0x3654;await mkdir(dirname(_0x761bcf),{'recursive':!![]}),await writeFile(_0x761bcf,JSON[_0x56308d(0x13d)](_0x2a5122,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x43bd73,_0x4cd5b7){const _0x309beb=a233_0x3833,_0x5a7206=_0x43bd73();while(!![]){try{const _0x2e6649=-parseInt(_0x309beb(0x1af))/0x1+parseInt(_0x309beb(0x1bd))/0x2*(parseInt(_0x309beb(0x1ad))/0x3)+parseInt(_0x309beb(0x19a))/0x4+parseInt(_0x309beb(0x1d1))/0x5+parseInt(_0x309beb(0x1ba))/0x6+parseInt(_0x309beb(0x195))/0x7+-parseInt(_0x309beb(0x1b1))/0x8;if(_0x2e6649===_0x4cd5b7)break;else _0x5a7206['push'](_0x5a7206['shift']());}catch(_0x48c8aa){_0x5a7206['push'](_0x5a7206['shift']());}}}(a233_0x77ee,0xa4458));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x4548ef,_0x178df2){const _0x4566dc=a233_0x3833,_0x2636f3=[],_0x4dffa1=normalizeSqlForStaticAnalysis(_0x4548ef),_0x40ecc4=(_0x4dffa1['error']?[]:extractJoinFacts(_0x4dffa1[_0x4566dc(0x1c7)]))['map'](_0x1e48e0=>{const _0x24f4dd=_0x4566dc;if(_0x1e48e0[_0x24f4dd(0x1c1)]||_0x1e48e0[_0x24f4dd(0x1b2)]['length']===0x0)return _0x2636f3['push']({'code':_0x24f4dd(0x1c4),'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0[_0x24f4dd(0x1b6)],'columns':_0x1e48e0[_0x24f4dd(0x1b2)],'reason':_0x1e48e0[_0x24f4dd(0x1c5)]??_0x24f4dd(0x1d6)}),{'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0[_0x24f4dd(0x1b6)],'columns':_0x1e48e0[_0x24f4dd(0x1b2)],'status':'unavailable'};const _0x3fd777=resolveTableMetadata(_0x178df2,_0x1e48e0[_0x24f4dd(0x199)]),_0x43a8e5=(_0x3fd777?.[_0x24f4dd(0x1a3)]??[])['map'](_0x442a1d=>({'index':_0x442a1d,'matchedPrefix':findEqualityPrefix(_0x442a1d[_0x24f4dd(0x1b2)],_0x1e48e0['columns'])}))[_0x24f4dd(0x1b3)](_0x127dff=>_0x127dff[_0x24f4dd(0x1b0)][_0x24f4dd(0x1be)]>0x0),_0x24cc28=_0x43a8e5['reduce']((_0x7acf14,_0x3f92c5)=>!_0x7acf14||_0x3f92c5[_0x24f4dd(0x1b0)][_0x24f4dd(0x1be)]>_0x7acf14[_0x24f4dd(0x1b0)][_0x24f4dd(0x1be)]?_0x3f92c5:_0x7acf14,_0x43a8e5[0x0]);if(_0x24cc28)return{'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0['alias'],'columns':_0x1e48e0[_0x24f4dd(0x1b2)],'status':_0x24f4dd(0x1a8),'matchedIndex':{..._0x24cc28[_0x24f4dd(0x19c)],'matchedPrefix':_0x24cc28[_0x24f4dd(0x1b0)]}};const _0x49f2b9=_0x3fd777?.[_0x24f4dd(0x1a3)][_0x24f4dd(0x1b3)](_0x49f96f=>_0x49f96f[_0x24f4dd(0x1b2)][_0x24f4dd(0x198)](_0x55a0ad=>_0x1e48e0[_0x24f4dd(0x1b2)][_0x24f4dd(0x198)](_0x161ca4=>columnNamesMatch(_0x55a0ad,_0x161ca4))))??[];if(_0x49f2b9[_0x24f4dd(0x1be)]>0x0)return _0x2636f3[_0x24f4dd(0x1a6)]({'code':_0x24f4dd(0x197),'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0[_0x24f4dd(0x1b6)],'columns':_0x1e48e0['columns'],'reason':_0x24f4dd(0x1a0)}),{'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0[_0x24f4dd(0x1b6)],'columns':_0x1e48e0[_0x24f4dd(0x1b2)],'status':'warning','candidateIndexes':_0x49f2b9};if(_0x3fd777&&_0x3fd777[_0x24f4dd(0x1a2)]!==![]&&_0x3fd777['indexes'][_0x24f4dd(0x1be)]>0x0&&_0x1e48e0[_0x24f4dd(0x1b2)][_0x24f4dd(0x1be)]>0x0)return _0x2636f3[_0x24f4dd(0x1a6)]({'code':_0x24f4dd(0x194),'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0['alias'],'columns':_0x1e48e0['columns'],'reason':_0x24f4dd(0x1d2)}),{'table':_0x1e48e0['table'],'alias':_0x1e48e0['alias'],'columns':_0x1e48e0['columns'],'status':_0x24f4dd(0x1b4)};return _0x2636f3[_0x24f4dd(0x1a6)]({'code':_0x24f4dd(0x1c2),'table':_0x1e48e0['table'],'alias':_0x1e48e0['alias'],'columns':_0x1e48e0['columns'],'reason':_0x3fd777?_0x24f4dd(0x1d8):_0x24f4dd(0x1aa)}),{'table':_0x1e48e0[_0x24f4dd(0x199)],'alias':_0x1e48e0[_0x24f4dd(0x1b6)],'columns':_0x1e48e0[_0x24f4dd(0x1b2)],'status':'unavailable'};});return{'checked':_0x40ecc4[_0x4566dc(0x1be)]>0x0,'joins':_0x40ecc4,'warnings':_0x2636f3};}function extractJoinFacts(_0x35c5e0){const _0x1cbe97=a233_0x3833,_0x31f049=maskNestedQueries(stripSqlNoise(_0x35c5e0)),_0x42974c=maskQuotedIdentifiers(_0x31f049),_0x2dc6b4=[],_0xee7591=new Set(),_0x693cde=/\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 _0x1b89d7 of _0x31f049[_0x1cbe97(0x1ae)](_0x693cde)){const _0x5ec05f=_0x1b89d7[_0x1cbe97(0x19c)]??0x0,_0x19a3e0=_0x1b89d7[0x0][_0x1cbe97(0x1cf)](/\bJOIN\b/i),_0x32f11a=_0x5ec05f+Math[_0x1cbe97(0x1bb)](0x0,_0x19a3e0);if(!/^JOIN\b/i['test'](_0x42974c[_0x1cbe97(0x1d9)](_0x32f11a)))continue;_0xee7591[_0x1cbe97(0x1d7)](_0x32f11a);const _0x88a092=normalizeIdentifier(_0x1b89d7[0x1]||_0x1cbe97(0x1a5)),_0x1df382=normalizeIdentifier(_0x1b89d7[0x2]??''),_0x16c501=normalizeIdentifier(_0x1b89d7[0x3]||_0x1df382[_0x1cbe97(0x1a9)]('.')['at'](-0x1)||_0x1df382),_0x4f8c37=[],_0x4cdaeb=_0x1df382===_0x1cbe97(0x1ca);let _0x3296e1=_0x88a092===_0x1cbe97(0x19e)||_0x88a092===_0x1cbe97(0x1bf)||_0x4cdaeb,_0x4e1cb7=_0x3296e1?_0x4cdaeb?_0x1cbe97(0x1ab):_0x88a092[_0x1cbe97(0x19f)]()+_0x1cbe97(0x1c9):undefined;const _0x2a6533=stripOuterParentheses(_0x1b89d7[0x4]??''),_0xc7436d=_0x2a6533[_0x1cbe97(0x1cb)](MYBATIS_DYNAMIC_START_MARKER)||_0x2a6533[_0x1cbe97(0x1cb)](MYBATIS_DYNAMIC_END_MARKER),_0xbcd816=_0x2a6533[_0x1cbe97(0x1cb)](MYBATIS_INCLUDE_MARKER);_0xc7436d&&(_0x3296e1=!![],_0x4e1cb7??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0xbcd816&&(_0x3296e1=!![],_0x4e1cb7??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0xe5e15=_0x2a6533[_0x1cbe97(0x1a1)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1cbe97(0x1a1)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1cbe97(0x1a1)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0xe5e15,'OR')&&(_0x3296e1=!![],_0x4e1cb7??=_0x1cbe97(0x1b9));for(const _0xe74f3d of splitTopLevelAnd(_0xe5e15)){const _0x4e925b=stripOuterParentheses(_0xe74f3d);if(hasTopLevelKeyword(_0x4e925b,'OR')){_0x3296e1=!![],_0x4e1cb7??=_0x1cbe97(0x1b9);continue;}const _0x2b30df=splitEquality(_0x4e925b);if(!_0x2b30df){containsColumnReference(_0xe74f3d,_0x16c501)&&(_0x3296e1=!![]);continue;}const _0x6d1a0=parseDirectColumnReference(_0x2b30df[0x0],_0x16c501),_0x262762=parseDirectColumnReference(_0x2b30df[0x1],_0x16c501),_0x3caacf=containsColumnReference(_0x2b30df[0x0],_0x16c501),_0x21f284=containsColumnReference(_0x2b30df[0x1],_0x16c501),_0x202210=_0x6d1a0&&!_0x21f284?_0x6d1a0:_0x262762&&!_0x3caacf?_0x262762:null;if(_0x202210&&!_0x4f8c37[_0x1cbe97(0x1cb)](_0x202210))_0x4f8c37[_0x1cbe97(0x1a6)](_0x202210);else!_0x202210&&containsColumnReference(_0xe74f3d,_0x16c501)&&(_0x3296e1=!![]);}_0x2dc6b4[_0x1cbe97(0x1a6)]({'table':_0x1df382,'alias':_0x16c501,'columns':_0x4f8c37,'unsupportedPredicate':_0x3296e1,'unsupportedReason':_0x4e1cb7,'containsUnresolvedInclude':_0xbcd816,'position':_0x32f11a});}for(const _0x302646 of _0x42974c[_0x1cbe97(0x1ae)](/\bJOIN\b/gi)){const _0x15e8a2=_0x302646[_0x1cbe97(0x19c)]??0x0;if(_0xee7591[_0x1cbe97(0x1c3)](_0x15e8a2))continue;const _0x2ca373=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1cbe97(0x1bc)](_0x31f049[_0x1cbe97(0x1d9)](_0x15e8a2+_0x302646[0x0][_0x1cbe97(0x1be)])),_0x36792b=normalizeIdentifier(_0x2ca373?.[0x1]||_0x1cbe97(0x1cc)),_0x5cbb32=normalizeIdentifier(_0x2ca373?.[0x2]||''),_0x4a6dcb=isSqlClauseKeyword(_0x5cbb32)?_0x36792b[_0x1cbe97(0x1a9)]('.')['at'](-0x1)||_0x36792b:_0x5cbb32||_0x36792b[_0x1cbe97(0x1a9)]('.')['at'](-0x1)||_0x36792b;_0x2dc6b4[_0x1cbe97(0x1a6)]({'table':_0x36792b,'alias':_0x4a6dcb,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x15e8a2});}const _0x24a85e=_0x42974c[_0x1cbe97(0x1d3)](MYBATIS_INCLUDE_MARKER);return _0x24a85e>=0x0&&!_0x2dc6b4['some'](_0x4bc70c=>_0x4bc70c[_0x1cbe97(0x1a4)])&&_0x2dc6b4[_0x1cbe97(0x1a6)]({'table':_0x1cbe97(0x1cc),'alias':_0x1cbe97(0x1cc),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1cbe97(0x19d),'containsUnresolvedInclude':!![],'position':_0x24a85e}),_0x2dc6b4['sort']((_0xec9105,_0xdd126c)=>_0xec9105[_0x1cbe97(0x1c6)]-_0xdd126c['position']);}function stripSqlNoise(_0x1b87d7){const _0x8593fa=a233_0x3833,_0x4ab967=Array[_0x8593fa(0x1b7)](_0x1b87d7),_0x10f97e=(_0x4eb855,_0x61de5a)=>{for(let _0x3f4c01=_0x4eb855;_0x3f4c01<_0x61de5a;_0x3f4c01+=0x1){_0x4ab967[_0x3f4c01]!=='\x0a'&&_0x4ab967[_0x3f4c01]!=='\x0d'&&(_0x4ab967[_0x3f4c01]='\x20');}};for(let _0x21bc08=0x0;_0x21bc08<_0x4ab967[_0x8593fa(0x1be)];_0x21bc08+=0x1){const _0x4998a4=_0x4ab967[_0x21bc08],_0x4610c2=_0x4ab967[_0x21bc08+0x1];if(_0x4998a4==='\x27'||_0x4998a4==='\x22'||_0x4998a4==='`'){const _0x577fdd=_0x4998a4,_0x4e41ad=_0x21bc08;_0x21bc08+=0x1;while(_0x21bc08<_0x4ab967[_0x8593fa(0x1be)]){if(_0x4ab967[_0x21bc08]==='\x5c'&&_0x21bc08+0x1<_0x4ab967[_0x8593fa(0x1be)]){_0x21bc08+=0x2;continue;}if(_0x4ab967[_0x21bc08]!==_0x577fdd){_0x21bc08+=0x1;continue;}if(_0x4ab967[_0x21bc08+0x1]===_0x577fdd){_0x21bc08+=0x2;continue;}break;}if(_0x577fdd==='\x27')_0x10f97e(_0x4e41ad,Math[_0x8593fa(0x1ac)](_0x21bc08+0x1,_0x4ab967[_0x8593fa(0x1be)]));continue;}if(_0x4998a4==='-'&&_0x4610c2==='-'){const _0x1c9dec=_0x21bc08;while(_0x21bc08<_0x4ab967['length']&&_0x4ab967[_0x21bc08]!=='\x0a')_0x21bc08+=0x1;_0x10f97e(_0x1c9dec,_0x21bc08);continue;}if(_0x4998a4==='/'&&_0x4610c2==='*'){const _0x38ae91=_0x21bc08;_0x21bc08+=0x2;while(_0x21bc08<_0x4ab967[_0x8593fa(0x1be)]&&!(_0x4ab967[_0x21bc08]==='*'&&_0x4ab967[_0x21bc08+0x1]==='/')){_0x21bc08+=0x1;}_0x21bc08=Math['min'](_0x21bc08+0x1,_0x4ab967[_0x8593fa(0x1be)]-0x1),_0x10f97e(_0x38ae91,_0x21bc08+0x1);continue;}if(_0x4998a4==='#'&&_0x4610c2!=='{'){const _0x55780a=_0x21bc08;while(_0x21bc08<_0x4ab967[_0x8593fa(0x1be)]&&_0x4ab967[_0x21bc08]!=='\x0a')_0x21bc08+=0x1;_0x10f97e(_0x55780a,_0x21bc08);continue;}if((_0x4998a4==='#'||_0x4998a4==='$')&&_0x4610c2==='{'){const _0x1938e0=_0x21bc08;_0x21bc08+=0x2;while(_0x21bc08<_0x4ab967[_0x8593fa(0x1be)]&&_0x4ab967[_0x21bc08]!=='}')_0x21bc08+=0x1;_0x10f97e(_0x1938e0,Math[_0x8593fa(0x1ac)](_0x21bc08+0x1,_0x4ab967[_0x8593fa(0x1be)]));}}return _0x4ab967['join']('');}function maskQuotedIdentifiers(_0x2a2b35){const _0x213e79=a233_0x3833,_0x4d74fc=Array[_0x213e79(0x1b7)](_0x2a2b35);for(let _0x1fb17f=0x0;_0x1fb17f<_0x4d74fc[_0x213e79(0x1be)];_0x1fb17f+=0x1){const _0x33189f=_0x4d74fc[_0x1fb17f];if(_0x33189f!=='\x22'&&_0x33189f!=='`')continue;_0x1fb17f+=0x1;while(_0x1fb17f<_0x4d74fc[_0x213e79(0x1be)]){if(_0x4d74fc[_0x1fb17f]===_0x33189f){if(_0x4d74fc[_0x1fb17f+0x1]===_0x33189f){_0x4d74fc[_0x1fb17f]='\x20',_0x4d74fc[_0x1fb17f+0x1]='\x20',_0x1fb17f+=0x2;continue;}break;}_0x4d74fc[_0x1fb17f]='\x20',_0x1fb17f+=0x1;}}return _0x4d74fc['join']('');}function maskNestedQueries(_0x724cb1){const _0x891cfb=a233_0x3833,_0x181798=Array['from'](_0x724cb1);for(let _0x6a8781=0x0;_0x6a8781<_0x181798['length'];_0x6a8781+=0x1){if(_0x181798[_0x6a8781]!=='(')continue;const _0x3c9372=_0x724cb1[_0x891cfb(0x1d9)](_0x6a8781+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x891cfb(0x1ce)](_0x3c9372))continue;let _0x942897=0x1,_0x427d5=_0x6a8781+0x1;for(;_0x427d5<_0x181798[_0x891cfb(0x1be)]&&_0x942897>0x0;_0x427d5+=0x1){if(_0x181798[_0x427d5]==='(')_0x942897+=0x1;if(_0x181798[_0x427d5]===')')_0x942897-=0x1;}if(_0x942897!==0x0)continue;for(let _0x55a36c=_0x6a8781;_0x55a36c<_0x427d5;_0x55a36c+=0x1){_0x181798[_0x55a36c]='\x20';}const _0x3a385a=_0x891cfb(0x1ca);for(let _0x1ec0ab=0x0;_0x1ec0ab<_0x3a385a[_0x891cfb(0x1be)]&&_0x6a8781+_0x1ec0ab<_0x427d5;_0x1ec0ab+=0x1){_0x181798[_0x6a8781+_0x1ec0ab]=_0x3a385a[_0x1ec0ab];}_0x6a8781=_0x427d5-0x1;}return _0x181798[_0x891cfb(0x1a7)]('');}function splitTopLevelAnd(_0x171ec8){const _0x4adecf=a233_0x3833,_0x3a355f=[];let _0x4cdf41=0x0,_0x26a4d3=0x0;for(let _0x4f27c8=0x0;_0x4f27c8<_0x171ec8[_0x4adecf(0x1be)];_0x4f27c8+=0x1){const _0x47eb10=_0x171ec8[_0x4f27c8];if(_0x47eb10==='(')_0x4cdf41+=0x1;if(_0x47eb10===')')_0x4cdf41=Math[_0x4adecf(0x1bb)](0x0,_0x4cdf41-0x1);_0x4cdf41===0x0&&_0x171ec8[_0x4adecf(0x1d9)](_0x4f27c8)[_0x4adecf(0x196)](/^AND\b/i)&&(_0x4f27c8===0x0||/\s/['test'](_0x171ec8[_0x4f27c8-0x1]??''))&&(_0x3a355f[_0x4adecf(0x1a6)](_0x171ec8['slice'](_0x26a4d3,_0x4f27c8)['trim']()),_0x4f27c8+=0x2,_0x26a4d3=_0x4f27c8+0x1);}const _0x1cdb91=_0x171ec8['slice'](_0x26a4d3)[_0x4adecf(0x1c0)]();if(_0x1cdb91)_0x3a355f[_0x4adecf(0x1a6)](_0x1cdb91);return _0x3a355f;}function a233_0x77ee(){const _0x3fc3ee=['search','tableName','3109105SLDLbM','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','indexOf','(?:^|[^\x5cw$])','using','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','add','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','slice','toLowerCase','JOIN_INDEX_MISSING','4933824YtdTpA','match','JOIN_INDEX_NOT_USABLE','some','table','940316PiQcDL','\x5c$&','index','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','right','toUpperCase','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','replaceAll','metadataAvailable','indexes','containsUnresolvedInclude','INNER','push','join','covered','split','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','min','74271NHuDIp','matchAll','790217SSevBI','matchedPrefix','11131920gNxxWD','columns','filter','warning','left','alias','from','where','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','6123024XbmSqN','max','exec','22JCorvE','length','full','trim','unsupportedPredicate','INDEX_METADATA_UNAVAILABLE','has','JOIN_PREDICATE_UNSUPPORTED','unsupportedReason','position','sql','map','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','__sq__','includes','unknown','inner','test'];a233_0x77ee=function(){return _0x3fc3ee;};return a233_0x77ee();}function hasTopLevelKeyword(_0x2b588c,_0x5ecbfd){const _0x3eb41b=a233_0x3833;let _0x444c2e=0x0;for(let _0x225453=0x0;_0x225453<_0x2b588c[_0x3eb41b(0x1be)];_0x225453+=0x1){const _0x25b38a=_0x2b588c[_0x225453];if(_0x25b38a==='(')_0x444c2e+=0x1;if(_0x25b38a===')')_0x444c2e=Math[_0x3eb41b(0x1bb)](0x0,_0x444c2e-0x1);if(_0x444c2e!==0x0)continue;const _0x57117f=_0x2b588c[_0x3eb41b(0x1d9)](_0x225453,_0x225453+_0x5ecbfd['length']),_0x316284=_0x2b588c[_0x225453-0x1]??'\x20',_0x4cf1d1=_0x2b588c[_0x225453+_0x5ecbfd[_0x3eb41b(0x1be)]]??'\x20';if(_0x57117f[_0x3eb41b(0x19f)]()===_0x5ecbfd['toUpperCase']()&&!/[\w$]/['test'](_0x316284)&&!/[\w$]/[_0x3eb41b(0x1ce)](_0x4cf1d1))return!![];}return![];}function splitEquality(_0x2b5846){const _0x30820e=a233_0x3833,_0x4c703c=stripOuterParentheses(_0x2b5846);let _0x4d8091=0x0,_0x3bdbed;for(let _0x1a474d=0x0;_0x1a474d<_0x4c703c[_0x30820e(0x1be)];_0x1a474d+=0x1){const _0x50d6df=_0x4c703c[_0x1a474d];if(_0x50d6df==='(')_0x4d8091+=0x1;if(_0x50d6df===')')_0x4d8091=Math[_0x30820e(0x1bb)](0x0,_0x4d8091-0x1);const _0x5dc428=_0x4c703c[_0x1a474d-0x1]??'',_0x19b008=_0x4c703c[_0x1a474d+0x1]??'';if(_0x50d6df==='='&&_0x4d8091===0x0&&!/[!<>=:]/[_0x30820e(0x1ce)](_0x5dc428)&&_0x19b008!=='='){if(_0x3bdbed!==undefined)return null;_0x3bdbed=_0x1a474d;}}return _0x3bdbed===undefined?null:[_0x4c703c[_0x30820e(0x1d9)](0x0,_0x3bdbed)[_0x30820e(0x1c0)](),_0x4c703c[_0x30820e(0x1d9)](_0x3bdbed+0x1)[_0x30820e(0x1c0)]()];}function a233_0x3833(_0xdd9908,_0x266004){_0xdd9908=_0xdd9908-0x194;const _0x77ee71=a233_0x77ee();let _0x3833ee=_0x77ee71[_0xdd9908];return _0x3833ee;}function parseDirectColumnReference(_0x2e9623,_0x2b5bf6){const _0x48deb4=a233_0x3833,_0x4099a1=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x48deb4(0x1bc)](stripOuterParentheses(_0x2e9623));if(!_0x4099a1)return null;if(normalizeIdentifier(_0x4099a1[0x1]??'')!==normalizeIdentifier(_0x2b5bf6))return null;return normalizeIdentifier(_0x4099a1[0x2]??'');}function containsColumnReference(_0x3936db,_0x291101){const _0x3d5ccf=a233_0x3833,_0x2fe683=_0x3936db['replace'](/[`"]/g,''),_0x5916ec=_0x291101['replace'](/[.*+?^${}()|[\]\\]/g,_0x3d5ccf(0x19b));return new RegExp(_0x3d5ccf(0x1d4)+_0x5916ec+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x3d5ccf(0x1ce)](_0x2fe683);}function findEqualityPrefix(_0x364e6f,_0x4887b7){const _0x3e235d=a233_0x3833,_0x2f604d=new Set(_0x4887b7[_0x3e235d(0x1c8)](normalizeIdentifier)),_0x50f656=[];for(const _0x40db74 of _0x364e6f){if(!_0x2f604d[_0x3e235d(0x1c3)](normalizeIdentifier(_0x40db74)))break;_0x50f656['push'](_0x40db74);}return _0x50f656;}function resolveTableMetadata(_0x7900d8,_0x40c8bc){const _0x52d011=a233_0x3833,_0xde0aaa=normalizeIdentifier(_0x40c8bc),_0x380091=_0x7900d8[_0x52d011(0x1b3)](_0x3ec3a9=>normalizeIdentifier(_0x3ec3a9[_0x52d011(0x1d0)])===_0xde0aaa);if(_0x380091[_0x52d011(0x1be)]===0x1)return _0x380091[0x0];const _0x200b1d=_0xde0aaa[_0x52d011(0x1cb)]('.'),_0x1e45a7=_0xde0aaa['split']('.')['at'](-0x1),_0x24382b=_0x7900d8[_0x52d011(0x1b3)](_0x14a54e=>{const _0x2ed2cf=_0x52d011,_0x40eb56=normalizeIdentifier(_0x14a54e[_0x2ed2cf(0x1d0)]);if(_0x200b1d&&_0x40eb56[_0x2ed2cf(0x1cb)]('.'))return![];return _0x40eb56['split']('.')['at'](-0x1)===_0x1e45a7;});return _0x24382b[_0x52d011(0x1be)]===0x1?_0x24382b[0x0]:undefined;}function columnNamesMatch(_0x2dd335,_0x2d7a76){return normalizeIdentifier(_0x2dd335)===normalizeIdentifier(_0x2d7a76);}function normalizeIdentifier(_0x2084d){const _0x732a1d=a233_0x3833;return _0x2084d['replace'](/[`"]/g,'')['trim']()[_0x732a1d(0x1da)]();}function isSqlClauseKeyword(_0x45f355){const _0x3afef1=a233_0x3833;return new Set(['on',_0x3afef1(0x1d5),_0x3afef1(0x1b8),_0x3afef1(0x1a7),_0x3afef1(0x1cd),_0x3afef1(0x1b5),'right',_0x3afef1(0x1bf),'cross','natural'])[_0x3afef1(0x1c3)](_0x45f355);}function stripOuterParentheses(_0x4e0e09){const _0x3e542a=a233_0x3833;let _0xf0d4f0=_0x4e0e09[_0x3e542a(0x1c0)]();while(_0xf0d4f0['startsWith']('(')&&_0xf0d4f0['endsWith'](')')){let _0x30ef9a=0x0,_0x3dbb9c=!![];for(let _0x55b901=0x0;_0x55b901<_0xf0d4f0[_0x3e542a(0x1be)];_0x55b901+=0x1){if(_0xf0d4f0[_0x55b901]==='(')_0x30ef9a+=0x1;if(_0xf0d4f0[_0x55b901]===')')_0x30ef9a-=0x1;if(_0x30ef9a===0x0&&_0x55b901<_0xf0d4f0[_0x3e542a(0x1be)]-0x1){_0x3dbb9c=![];break;}}if(!_0x3dbb9c||_0x30ef9a!==0x0)break;_0xf0d4f0=_0xf0d4f0[_0x3e542a(0x1d9)](0x1,-0x1)[_0x3e542a(0x1c0)]();}return _0xf0d4f0;}
|
|
1
|
+
(function(_0x5b4f57,_0x3823e0){const _0x456686=a233_0x16f7,_0x33b388=_0x5b4f57();while(!![]){try{const _0x4a84ad=-parseInt(_0x456686(0x17b))/0x1+parseInt(_0x456686(0x13d))/0x2*(parseInt(_0x456686(0x16c))/0x3)+parseInt(_0x456686(0x17e))/0x4*(parseInt(_0x456686(0x14f))/0x5)+parseInt(_0x456686(0x184))/0x6+-parseInt(_0x456686(0x180))/0x7+parseInt(_0x456686(0x148))/0x8+parseInt(_0x456686(0x177))/0x9*(parseInt(_0x456686(0x141))/0xa);if(_0x4a84ad===_0x3823e0)break;else _0x33b388['push'](_0x33b388['shift']());}catch(_0x37540e){_0x33b388['push'](_0x33b388['shift']());}}}(a233_0x4b93,0x3fae2));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1da526,_0x1d02cf){const _0x1ccea4=a233_0x16f7,_0x3da808=[],_0x1e2bf4=normalizeSqlForStaticAnalysis(_0x1da526),_0x3b33be=(_0x1e2bf4[_0x1ccea4(0x168)]?[]:extractJoinFacts(_0x1e2bf4[_0x1ccea4(0x14e)]))['map'](_0xddb5da=>{const _0x2c6681=_0x1ccea4;if(_0xddb5da['unsupportedPredicate']||_0xddb5da['columns'][_0x2c6681(0x16f)]===0x0)return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x174),'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0xddb5da[_0x2c6681(0x162)]??_0x2c6681(0x165)}),{'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'status':_0x2c6681(0x14d)};const _0xf01562=resolveTableMetadata(_0x1d02cf,_0xddb5da[_0x2c6681(0x160)]),_0x5a05d7=(_0xf01562?.[_0x2c6681(0x145)]??[])[_0x2c6681(0x144)](_0x21ff7b=>({'index':_0x21ff7b,'matchedPrefix':findEqualityPrefix(_0x21ff7b[_0x2c6681(0x172)],_0xddb5da['columns'])}))[_0x2c6681(0x149)](_0xc1112c=>_0xc1112c['matchedPrefix']['length']>0x0),_0x593142=_0x5a05d7['reduce']((_0x402793,_0x3ef68d)=>!_0x402793||_0x3ef68d['matchedPrefix'][_0x2c6681(0x16f)]>_0x402793['matchedPrefix']['length']?_0x3ef68d:_0x402793,_0x5a05d7[0x0]);if(_0x593142)return{'table':_0xddb5da['table'],'alias':_0xddb5da['alias'],'columns':_0xddb5da['columns'],'status':_0x2c6681(0x173),'matchedIndex':{..._0x593142[_0x2c6681(0x154)],'matchedPrefix':_0x593142['matchedPrefix']}};const _0x132cd8=_0xf01562?.[_0x2c6681(0x145)]['filter'](_0x25e24c=>_0x25e24c[_0x2c6681(0x172)][_0x2c6681(0x147)](_0x44e86d=>_0xddb5da[_0x2c6681(0x172)][_0x2c6681(0x147)](_0x530422=>columnNamesMatch(_0x44e86d,_0x530422))))??[];if(_0x132cd8[_0x2c6681(0x16f)]>0x0)return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x17a),'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0x2c6681(0x158)}),{'table':_0xddb5da['table'],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da['columns'],'status':_0x2c6681(0x16d),'candidateIndexes':_0x132cd8};if(_0xf01562&&_0xf01562[_0x2c6681(0x14b)]!==![]&&_0xf01562[_0x2c6681(0x145)]['length']>0x0&&_0xddb5da[_0x2c6681(0x172)][_0x2c6681(0x16f)]>0x0)return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x140),'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0x2c6681(0x163)}),{'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'status':_0x2c6681(0x16d)};return _0x3da808[_0x2c6681(0x17d)]({'code':_0x2c6681(0x16e),'table':_0xddb5da['table'],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'reason':_0xf01562?_0x2c6681(0x14c):_0x2c6681(0x161)}),{'table':_0xddb5da[_0x2c6681(0x160)],'alias':_0xddb5da[_0x2c6681(0x164)],'columns':_0xddb5da[_0x2c6681(0x172)],'status':_0x2c6681(0x14d)};});return{'checked':_0x3b33be['length']>0x0,'joins':_0x3b33be,'warnings':_0x3da808};}function extractJoinFacts(_0x44ac44){const _0xc6680f=a233_0x16f7,_0x48b56e=maskNestedQueries(stripSqlNoise(_0x44ac44)),_0x44a17a=maskQuotedIdentifiers(_0x48b56e),_0x187673=[],_0x2f5730=new Set(),_0x2f3679=/\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 _0x8e4880 of _0x48b56e[_0xc6680f(0x143)](_0x2f3679)){const _0x1be0c0=_0x8e4880[_0xc6680f(0x154)]??0x0,_0x3b7a85=_0x8e4880[0x0][_0xc6680f(0x17c)](/\bJOIN\b/i),_0x2b8635=_0x1be0c0+Math[_0xc6680f(0x13e)](0x0,_0x3b7a85);if(!/^JOIN\b/i[_0xc6680f(0x15f)](_0x44a17a[_0xc6680f(0x179)](_0x2b8635)))continue;_0x2f5730['add'](_0x2b8635);const _0xaa0e43=normalizeIdentifier(_0x8e4880[0x1]||'INNER'),_0x242b2d=normalizeIdentifier(_0x8e4880[0x2]??''),_0xa0f5b7=normalizeIdentifier(_0x8e4880[0x3]||_0x242b2d['split']('.')['at'](-0x1)||_0x242b2d),_0xbe8a39=[],_0x5dd866=_0x242b2d===_0xc6680f(0x142);let _0x3d5fa7=_0xaa0e43==='right'||_0xaa0e43===_0xc6680f(0x16b)||_0x5dd866,_0x3865d3=_0x3d5fa7?_0x5dd866?_0xc6680f(0x178):_0xaa0e43['toUpperCase']()+_0xc6680f(0x15a):undefined;const _0x3d4826=stripOuterParentheses(_0x8e4880[0x4]??''),_0xd95ab6=_0x3d4826[_0xc6680f(0x181)](MYBATIS_DYNAMIC_START_MARKER)||_0x3d4826[_0xc6680f(0x181)](MYBATIS_DYNAMIC_END_MARKER),_0x3baf82=_0x3d4826[_0xc6680f(0x181)](MYBATIS_INCLUDE_MARKER);_0xd95ab6&&(_0x3d5fa7=!![],_0x3865d3??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x3baf82&&(_0x3d5fa7=!![],_0x3865d3??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x16ecfe=_0x3d4826[_0xc6680f(0x151)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0xc6680f(0x151)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0xc6680f(0x151)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x16ecfe,'OR')&&(_0x3d5fa7=!![],_0x3865d3??=_0xc6680f(0x182));for(const _0x2d35d4 of splitTopLevelAnd(_0x16ecfe)){const _0x20d358=stripOuterParentheses(_0x2d35d4);if(hasTopLevelKeyword(_0x20d358,'OR')){_0x3d5fa7=!![],_0x3865d3??=_0xc6680f(0x182);continue;}const _0x145068=splitEquality(_0x20d358);if(!_0x145068){containsColumnReference(_0x2d35d4,_0xa0f5b7)&&(_0x3d5fa7=!![]);continue;}const _0x445743=parseDirectColumnReference(_0x145068[0x0],_0xa0f5b7),_0x412044=parseDirectColumnReference(_0x145068[0x1],_0xa0f5b7),_0x34fd3a=containsColumnReference(_0x145068[0x0],_0xa0f5b7),_0x2ac37e=containsColumnReference(_0x145068[0x1],_0xa0f5b7),_0x55f9be=_0x445743&&!_0x2ac37e?_0x445743:_0x412044&&!_0x34fd3a?_0x412044:null;if(_0x55f9be&&!_0xbe8a39[_0xc6680f(0x181)](_0x55f9be))_0xbe8a39[_0xc6680f(0x17d)](_0x55f9be);else!_0x55f9be&&containsColumnReference(_0x2d35d4,_0xa0f5b7)&&(_0x3d5fa7=!![]);}_0x187673['push']({'table':_0x242b2d,'alias':_0xa0f5b7,'columns':_0xbe8a39,'unsupportedPredicate':_0x3d5fa7,'unsupportedReason':_0x3865d3,'containsUnresolvedInclude':_0x3baf82,'position':_0x2b8635});}for(const _0x138b12 of _0x44a17a['matchAll'](/\bJOIN\b/gi)){const _0x4ddd3d=_0x138b12[_0xc6680f(0x154)]??0x0;if(_0x2f5730[_0xc6680f(0x167)](_0x4ddd3d))continue;const _0x33d96c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0xc6680f(0x14a)](_0x48b56e['slice'](_0x4ddd3d+_0x138b12[0x0][_0xc6680f(0x16f)])),_0x3ad1e9=normalizeIdentifier(_0x33d96c?.[0x1]||'unknown'),_0xf20fd=normalizeIdentifier(_0x33d96c?.[0x2]||''),_0x364483=isSqlClauseKeyword(_0xf20fd)?_0x3ad1e9[_0xc6680f(0x15e)]('.')['at'](-0x1)||_0x3ad1e9:_0xf20fd||_0x3ad1e9[_0xc6680f(0x15e)]('.')['at'](-0x1)||_0x3ad1e9;_0x187673[_0xc6680f(0x17d)]({'table':_0x3ad1e9,'alias':_0x364483,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0xc6680f(0x157),'position':_0x4ddd3d});}const _0x417801=_0x44a17a[_0xc6680f(0x16a)](MYBATIS_INCLUDE_MARKER);return _0x417801>=0x0&&!_0x187673[_0xc6680f(0x147)](_0x1de1a8=>_0x1de1a8[_0xc6680f(0x166)])&&_0x187673[_0xc6680f(0x17d)]({'table':_0xc6680f(0x15d),'alias':_0xc6680f(0x15d),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x417801}),_0x187673[_0xc6680f(0x13c)]((_0x375a0d,_0x165196)=>_0x375a0d[_0xc6680f(0x17f)]-_0x165196[_0xc6680f(0x17f)]);}function a233_0x16f7(_0x3a60a2,_0x34eead){_0x3a60a2=_0x3a60a2-0x13c;const _0x4b9319=a233_0x4b93();let _0x16f7c0=_0x4b9319[_0x3a60a2];return _0x16f7c0;}function stripSqlNoise(_0x452e6a){const _0x13618e=a233_0x16f7,_0x30d856=Array[_0x13618e(0x13f)](_0x452e6a),_0x297ad5=(_0x1dcb78,_0x5cb4dc)=>{for(let _0x18cc8a=_0x1dcb78;_0x18cc8a<_0x5cb4dc;_0x18cc8a+=0x1){_0x30d856[_0x18cc8a]!=='\x0a'&&_0x30d856[_0x18cc8a]!=='\x0d'&&(_0x30d856[_0x18cc8a]='\x20');}};for(let _0x3966b8=0x0;_0x3966b8<_0x30d856[_0x13618e(0x16f)];_0x3966b8+=0x1){const _0x3c0754=_0x30d856[_0x3966b8],_0x4554de=_0x30d856[_0x3966b8+0x1];if(_0x3c0754==='\x27'||_0x3c0754==='\x22'||_0x3c0754==='`'){const _0x51068f=_0x3c0754,_0x3666bd=_0x3966b8;_0x3966b8+=0x1;while(_0x3966b8<_0x30d856['length']){if(_0x30d856[_0x3966b8]==='\x5c'&&_0x3966b8+0x1<_0x30d856[_0x13618e(0x16f)]){_0x3966b8+=0x2;continue;}if(_0x30d856[_0x3966b8]!==_0x51068f){_0x3966b8+=0x1;continue;}if(_0x30d856[_0x3966b8+0x1]===_0x51068f){_0x3966b8+=0x2;continue;}break;}if(_0x51068f==='\x27')_0x297ad5(_0x3666bd,Math[_0x13618e(0x183)](_0x3966b8+0x1,_0x30d856['length']));continue;}if(_0x3c0754==='-'&&_0x4554de==='-'){const _0x31c0a6=_0x3966b8;while(_0x3966b8<_0x30d856['length']&&_0x30d856[_0x3966b8]!=='\x0a')_0x3966b8+=0x1;_0x297ad5(_0x31c0a6,_0x3966b8);continue;}if(_0x3c0754==='/'&&_0x4554de==='*'){const _0x38b4ff=_0x3966b8;_0x3966b8+=0x2;while(_0x3966b8<_0x30d856['length']&&!(_0x30d856[_0x3966b8]==='*'&&_0x30d856[_0x3966b8+0x1]==='/')){_0x3966b8+=0x1;}_0x3966b8=Math['min'](_0x3966b8+0x1,_0x30d856['length']-0x1),_0x297ad5(_0x38b4ff,_0x3966b8+0x1);continue;}if(_0x3c0754==='#'&&_0x4554de!=='{'){const _0x3059ff=_0x3966b8;while(_0x3966b8<_0x30d856[_0x13618e(0x16f)]&&_0x30d856[_0x3966b8]!=='\x0a')_0x3966b8+=0x1;_0x297ad5(_0x3059ff,_0x3966b8);continue;}if((_0x3c0754==='#'||_0x3c0754==='$')&&_0x4554de==='{'){const _0x5587a0=_0x3966b8;_0x3966b8+=0x2;while(_0x3966b8<_0x30d856[_0x13618e(0x16f)]&&_0x30d856[_0x3966b8]!=='}')_0x3966b8+=0x1;_0x297ad5(_0x5587a0,Math[_0x13618e(0x183)](_0x3966b8+0x1,_0x30d856[_0x13618e(0x16f)]));}}return _0x30d856[_0x13618e(0x150)]('');}function maskQuotedIdentifiers(_0x457096){const _0x31618e=a233_0x16f7,_0x1bdb02=Array[_0x31618e(0x13f)](_0x457096);for(let _0x2cc6aa=0x0;_0x2cc6aa<_0x1bdb02[_0x31618e(0x16f)];_0x2cc6aa+=0x1){const _0x6eff26=_0x1bdb02[_0x2cc6aa];if(_0x6eff26!=='\x22'&&_0x6eff26!=='`')continue;_0x2cc6aa+=0x1;while(_0x2cc6aa<_0x1bdb02['length']){if(_0x1bdb02[_0x2cc6aa]===_0x6eff26){if(_0x1bdb02[_0x2cc6aa+0x1]===_0x6eff26){_0x1bdb02[_0x2cc6aa]='\x20',_0x1bdb02[_0x2cc6aa+0x1]='\x20',_0x2cc6aa+=0x2;continue;}break;}_0x1bdb02[_0x2cc6aa]='\x20',_0x2cc6aa+=0x1;}}return _0x1bdb02[_0x31618e(0x150)]('');}function maskNestedQueries(_0xf4f564){const _0x41202d=a233_0x16f7,_0x47ddd5=Array[_0x41202d(0x13f)](_0xf4f564);for(let _0x20de3d=0x0;_0x20de3d<_0x47ddd5[_0x41202d(0x16f)];_0x20de3d+=0x1){if(_0x47ddd5[_0x20de3d]!=='(')continue;const _0x5b1697=_0xf4f564[_0x41202d(0x179)](_0x20de3d+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x41202d(0x15f)](_0x5b1697))continue;let _0xb2a20a=0x1,_0x254bea=_0x20de3d+0x1;for(;_0x254bea<_0x47ddd5['length']&&_0xb2a20a>0x0;_0x254bea+=0x1){if(_0x47ddd5[_0x254bea]==='(')_0xb2a20a+=0x1;if(_0x47ddd5[_0x254bea]===')')_0xb2a20a-=0x1;}if(_0xb2a20a!==0x0)continue;for(let _0x3927c8=_0x20de3d;_0x3927c8<_0x254bea;_0x3927c8+=0x1){_0x47ddd5[_0x3927c8]='\x20';}const _0x4b6b9f=_0x41202d(0x142);for(let _0x3b4710=0x0;_0x3b4710<_0x4b6b9f[_0x41202d(0x16f)]&&_0x20de3d+_0x3b4710<_0x254bea;_0x3b4710+=0x1){_0x47ddd5[_0x20de3d+_0x3b4710]=_0x4b6b9f[_0x3b4710];}_0x20de3d=_0x254bea-0x1;}return _0x47ddd5[_0x41202d(0x150)]('');}function splitTopLevelAnd(_0x32dc19){const _0x321c9b=a233_0x16f7,_0x547c68=[];let _0x4239ef=0x0,_0x5caec9=0x0;for(let _0x50e0c9=0x0;_0x50e0c9<_0x32dc19[_0x321c9b(0x16f)];_0x50e0c9+=0x1){const _0x19123a=_0x32dc19[_0x50e0c9];if(_0x19123a==='(')_0x4239ef+=0x1;if(_0x19123a===')')_0x4239ef=Math[_0x321c9b(0x13e)](0x0,_0x4239ef-0x1);_0x4239ef===0x0&&_0x32dc19['slice'](_0x50e0c9)['match'](/^AND\b/i)&&(_0x50e0c9===0x0||/\s/[_0x321c9b(0x15f)](_0x32dc19[_0x50e0c9-0x1]??''))&&(_0x547c68[_0x321c9b(0x17d)](_0x32dc19[_0x321c9b(0x179)](_0x5caec9,_0x50e0c9)['trim']()),_0x50e0c9+=0x2,_0x5caec9=_0x50e0c9+0x1);}const _0x5784a4=_0x32dc19['slice'](_0x5caec9)[_0x321c9b(0x171)]();if(_0x5784a4)_0x547c68['push'](_0x5784a4);return _0x547c68;}function hasTopLevelKeyword(_0x5c5fe9,_0x597ec4){const _0x1ad67c=a233_0x16f7;let _0xf744cf=0x0;for(let _0x5d3301=0x0;_0x5d3301<_0x5c5fe9[_0x1ad67c(0x16f)];_0x5d3301+=0x1){const _0x412f99=_0x5c5fe9[_0x5d3301];if(_0x412f99==='(')_0xf744cf+=0x1;if(_0x412f99===')')_0xf744cf=Math[_0x1ad67c(0x13e)](0x0,_0xf744cf-0x1);if(_0xf744cf!==0x0)continue;const _0x5161bf=_0x5c5fe9[_0x1ad67c(0x179)](_0x5d3301,_0x5d3301+_0x597ec4[_0x1ad67c(0x16f)]),_0x44b73b=_0x5c5fe9[_0x5d3301-0x1]??'\x20',_0x556f5f=_0x5c5fe9[_0x5d3301+_0x597ec4[_0x1ad67c(0x16f)]]??'\x20';if(_0x5161bf[_0x1ad67c(0x169)]()===_0x597ec4[_0x1ad67c(0x169)]()&&!/[\w$]/[_0x1ad67c(0x15f)](_0x44b73b)&&!/[\w$]/[_0x1ad67c(0x15f)](_0x556f5f))return!![];}return![];}function splitEquality(_0x77a357){const _0x2184a3=a233_0x16f7,_0x193e41=stripOuterParentheses(_0x77a357);let _0x522643=0x0,_0x1a1505;for(let _0x10a9f4=0x0;_0x10a9f4<_0x193e41[_0x2184a3(0x16f)];_0x10a9f4+=0x1){const _0x3ad622=_0x193e41[_0x10a9f4];if(_0x3ad622==='(')_0x522643+=0x1;if(_0x3ad622===')')_0x522643=Math[_0x2184a3(0x13e)](0x0,_0x522643-0x1);const _0x32005=_0x193e41[_0x10a9f4-0x1]??'',_0x183573=_0x193e41[_0x10a9f4+0x1]??'';if(_0x3ad622==='='&&_0x522643===0x0&&!/[!<>=:]/['test'](_0x32005)&&_0x183573!=='='){if(_0x1a1505!==undefined)return null;_0x1a1505=_0x10a9f4;}}return _0x1a1505===undefined?null:[_0x193e41['slice'](0x0,_0x1a1505)[_0x2184a3(0x171)](),_0x193e41[_0x2184a3(0x179)](_0x1a1505+0x1)[_0x2184a3(0x171)]()];}function parseDirectColumnReference(_0x237b1a,_0x2fb02c){const _0xa19ffc=a233_0x16f7,_0x138a99=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xa19ffc(0x14a)](stripOuterParentheses(_0x237b1a));if(!_0x138a99)return null;if(normalizeIdentifier(_0x138a99[0x1]??'')!==normalizeIdentifier(_0x2fb02c))return null;return normalizeIdentifier(_0x138a99[0x2]??'');}function containsColumnReference(_0x3fcfae,_0x273bcc){const _0x345bc8=a233_0x16f7,_0x3fefea=_0x3fcfae[_0x345bc8(0x146)](/[`"]/g,''),_0x1b3ea6=_0x273bcc[_0x345bc8(0x146)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x345bc8(0x159)+_0x1b3ea6+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x345bc8(0x15f)](_0x3fefea);}function findEqualityPrefix(_0x46923b,_0x5a77b3){const _0x3834f3=a233_0x16f7,_0x288023=new Set(_0x5a77b3[_0x3834f3(0x144)](normalizeIdentifier)),_0x5486f8=[];for(const _0x2b35e8 of _0x46923b){if(!_0x288023[_0x3834f3(0x167)](normalizeIdentifier(_0x2b35e8)))break;_0x5486f8[_0x3834f3(0x17d)](_0x2b35e8);}return _0x5486f8;}function resolveTableMetadata(_0x4592c0,_0x3b9255){const _0x920cbf=a233_0x16f7,_0x298d82=normalizeIdentifier(_0x3b9255),_0x2dcdf0=_0x4592c0[_0x920cbf(0x149)](_0x152556=>normalizeIdentifier(_0x152556[_0x920cbf(0x155)])===_0x298d82);if(_0x2dcdf0[_0x920cbf(0x16f)]===0x1)return _0x2dcdf0[0x0];const _0x61f7eb=_0x298d82[_0x920cbf(0x181)]('.'),_0x5af834=_0x298d82['split']('.')['at'](-0x1),_0x57c763=_0x4592c0[_0x920cbf(0x149)](_0x5b6d18=>{const _0x82d337=_0x920cbf,_0x7fcc5d=normalizeIdentifier(_0x5b6d18[_0x82d337(0x155)]);if(_0x61f7eb&&_0x7fcc5d[_0x82d337(0x181)]('.'))return![];return _0x7fcc5d[_0x82d337(0x15e)]('.')['at'](-0x1)===_0x5af834;});return _0x57c763[_0x920cbf(0x16f)]===0x1?_0x57c763[0x0]:undefined;}function columnNamesMatch(_0x476a0d,_0x44ad28){return normalizeIdentifier(_0x476a0d)===normalizeIdentifier(_0x44ad28);}function normalizeIdentifier(_0x19cd25){const _0x991270=a233_0x16f7;return _0x19cd25[_0x991270(0x146)](/[`"]/g,'')[_0x991270(0x171)]()[_0x991270(0x152)]();}function isSqlClauseKeyword(_0x260cfa){const _0x1631f4=a233_0x16f7;return new Set(['on',_0x1631f4(0x170),_0x1631f4(0x156),_0x1631f4(0x150),_0x1631f4(0x176),'left',_0x1631f4(0x175),'full','cross',_0x1631f4(0x15c)])[_0x1631f4(0x167)](_0x260cfa);}function a233_0x4b93(){const _0x57465d=['3UlCSXS','warning','INDEX_METADATA_UNAVAILABLE','length','using','trim','columns','covered','JOIN_PREDICATE_UNSUPPORTED','right','inner','234iofItX','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','slice','JOIN_INDEX_NOT_USABLE','509503jEYIDq','search','push','639880nSEIOW','position','2974825spbXwC','includes','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','min','619452DUJrfM','sort','80980UFGRfS','max','from','JOIN_INDEX_MISSING','98770fCfXGr','__sq__','matchAll','map','indexes','replace','some','2518944MChhGM','filter','exec','metadataAvailable','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','unavailable','sql','15bjGOrJ','join','replaceAll','toLowerCase','startsWith','index','tableName','where','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','(?:^|[^\x5cw$])','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','endsWith','natural','unknown','split','test','table','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','unsupportedReason','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','alias','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','containsUnresolvedInclude','has','error','toUpperCase','indexOf','full'];a233_0x4b93=function(){return _0x57465d;};return a233_0x4b93();}function stripOuterParentheses(_0x1f3ffd){const _0x167c57=a233_0x16f7;let _0x26b6f2=_0x1f3ffd[_0x167c57(0x171)]();while(_0x26b6f2[_0x167c57(0x153)]('(')&&_0x26b6f2[_0x167c57(0x15b)](')')){let _0x534f09=0x0,_0x16d6d7=!![];for(let _0x154b4f=0x0;_0x154b4f<_0x26b6f2[_0x167c57(0x16f)];_0x154b4f+=0x1){if(_0x26b6f2[_0x154b4f]==='(')_0x534f09+=0x1;if(_0x26b6f2[_0x154b4f]===')')_0x534f09-=0x1;if(_0x534f09===0x0&&_0x154b4f<_0x26b6f2[_0x167c57(0x16f)]-0x1){_0x16d6d7=![];break;}}if(!_0x16d6d7||_0x534f09!==0x0)break;_0x26b6f2=_0x26b6f2[_0x167c57(0x179)](0x1,-0x1)[_0x167c57(0x171)]();}return _0x26b6f2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a234_0x2d2d16=a234_0x32ae;(function(_0x18181b,_0x2d2079){const _0x2285f1=a234_0x32ae,_0x1f53bb=_0x18181b();while(!![]){try{const _0x20b497=-parseInt(_0x2285f1(0x1f6))/0x1+parseInt(_0x2285f1(0x1f5))/0x2+parseInt(_0x2285f1(0x1f4))/0x3+-parseInt(_0x2285f1(0x1fb))/0x4*(-parseInt(_0x2285f1(0x200))/0x5)+-parseInt(_0x2285f1(0x1fa))/0x6*(-parseInt(_0x2285f1(0x1ff))/0x7)+-parseInt(_0x2285f1(0x1fe))/0x8*(parseInt(_0x2285f1(0x1fc))/0x9)+parseInt(_0x2285f1(0x1f9))/0xa;if(_0x20b497===_0x2d2079)break;else _0x1f53bb['push'](_0x1f53bb['shift']());}catch(_0x1f9d77){_0x1f53bb['push'](_0x1f53bb['shift']());}}}(a234_0x2660,0x1a578));import{resolve}from'node:path';function a234_0x32ae(_0x3d8edd,_0x433948){_0x3d8edd=_0x3d8edd-0x1f4;const _0x2660c5=a234_0x2660();let _0x32aede=_0x2660c5[_0x3d8edd];return _0x32aede;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a234_0x2d2d16(0x1f8),TRASH_DIR_NAME=a234_0x2d2d16(0x201);export function loadSqlProjectConfig(_0x7d4ca4,_0xf2c561){const _0x2e5396=a234_0x2d2d16,_0x6df2ca=resolve(_0xf2c561??findProjectRootDirectory()),_0x34177a=DOT_DIR+_0x2e5396(0x1fd),_0x3dacec=_0x34177a+'/'+_0x7d4ca4;return{'projectRoot':_0x6df2ca,'appCode':_0x7d4ca4,'sqlWorkspaceRoot':_0x34177a,'sqlRoot':_0x3dacec,'sqlRootDir':resolve(_0x6df2ca,DOT_DIR,_0x2e5396(0x1f7),_0x7d4ca4),'lockFilePath':resolve(_0x6df2ca,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x6df2ca,DOT_DIR,TRASH_DIR_NAME)};}function a234_0x2660(){const _0x7dcaf2=['26716ckbvJS','9JNmmow','/sql','506008qlNZWT','63hzgMBC','50JHyuBh','sql-trash','32220QiEspw','145988YVfaMC','206148XGXQDW','sql','sql.lock.json','518740sMVIbe','116598oLWoUe'];a234_0x2660=function(){return _0x7dcaf2;};return a234_0x2660();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16d1dc,_0x13f5f9){const _0x756fe2=a235_0x37f5,_0x1d440a=_0x16d1dc();while(!![]){try{const _0x27ac75=parseInt(_0x756fe2(0x1bf))/0x1+parseInt(_0x756fe2(0x1a8))/0x2*(-parseInt(_0x756fe2(0x1b1))/0x3)+parseInt(_0x756fe2(0x1ad))/0x4*(parseInt(_0x756fe2(0x1b0))/0x5)+-parseInt(_0x756fe2(0x1be))/0x6*(parseInt(_0x756fe2(0x1a9))/0x7)+parseInt(_0x756fe2(0x1aa))/0x8+parseInt(_0x756fe2(0x1b4))/0x9*(-parseInt(_0x756fe2(0x1ab))/0xa)+-parseInt(_0x756fe2(0x1ac))/0xb;if(_0x27ac75===_0x13f5f9)break;else _0x1d440a['push'](_0x1d440a['shift']());}catch(_0x58ce12){_0x1d440a['push'](_0x1d440a['shift']());}}}(a235_0x14a0,0x947f7));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a235_0x14a0(){const _0x3790e8=['9BvJgsg','ENOENT','path','toLowerCase','slice','sqlName','mybatisXml','length','sqlCode','.sql','228ybGPZK','694572CFNBcj','name','filter','dbId','split','.xml','isDirectory','indexOf','dbName','sqlRootDir','mode','2798iRHFPE','62384SUAOeH','8390648EoAwXq','6768830XtGDVB','10740719Hkoddy','4137940XtIEpB','replace','sql','5btUAFt','381weAZtP','test','code'];a235_0x14a0=function(){return _0x3790e8;};return a235_0x14a0();}function extensionToMode(_0x43ae80){const _0x1e9031=a235_0x37f5;if(_0x43ae80===_0x1e9031(0x1bd))return'sql';if(_0x43ae80===_0x1e9031(0x1c4))return _0x1e9031(0x1ba);return undefined;}async function scanSqlFilesRecursively(_0x544f20,_0x32c42f){const _0x5c1e8c=a235_0x37f5,_0x7d9f47=[];try{const _0x349f12=await readdir(_0x544f20,{'withFileTypes':!![]});for(const _0x3afc87 of _0x349f12){const _0x47a5eb=join(_0x544f20,_0x3afc87[_0x5c1e8c(0x1c0)]);if(_0x3afc87[_0x5c1e8c(0x1c5)]()){_0x7d9f47['push'](...await scanSqlFilesRecursively(_0x47a5eb,_0x32c42f));continue;}if(!_0x3afc87['isFile']())continue;const _0x22fafb=extname(_0x3afc87[_0x5c1e8c(0x1c0)])[_0x5c1e8c(0x1b7)](),_0x305995=extensionToMode(_0x22fafb);if(!_0x305995)continue;const _0x284b6b=relative(_0x32c42f,_0x47a5eb)[_0x5c1e8c(0x1ae)](/\\/g,'/'),_0x5673d2=_0x284b6b[_0x5c1e8c(0x1c3)]('/')[_0x5c1e8c(0x1c1)](Boolean),_0x3df565=parseSqlPath(_0x5673d2,_0x3afc87[_0x5c1e8c(0x1c0)],_0x22fafb);if(!_0x3df565)continue;_0x7d9f47['push']({'sqlCode':_0x3df565[_0x5c1e8c(0x1bc)],'sqlName':_0x3df565[_0x5c1e8c(0x1b9)],'dbDirectory':_0x5673d2[0x0],'filePath':_0x47a5eb,'relativePath':_0x284b6b,'lockKey':_0x3df565[_0x5c1e8c(0x1bc)],'mode':_0x305995});}}catch(_0x2d4711){if(_0x2d4711[_0x5c1e8c(0x1b3)]!==_0x5c1e8c(0x1b5))throw _0x2d4711;}return _0x7d9f47;}export async function scanLocalSqlQueries(_0xd43231){const _0x396b50=a235_0x37f5;return scanSqlFilesRecursively(_0xd43231[_0x396b50(0x1a6)],_0xd43231['sqlRootDir']);}export function resolveLocalSqlFilePath(_0xbd8e69,_0x2270e3,_0x25d954){const _0x17f132=a235_0x37f5,_0x58498d=_0x25d954?.[_0x17f132(0x1b6)]||(_0x25d954?.[_0x17f132(0x1b9)]||_0x25d954?.['dbName']?buildSqlRelativePath(_0x2270e3,_0x25d954?.[_0x17f132(0x1b9)],_0x25d954?.[_0x17f132(0x1c7)],_0x25d954?.[_0x17f132(0x1a7)]||_0x17f132(0x1af),_0x25d954?.[_0x17f132(0x1c2)]):buildDefaultSqlFileName(_0x2270e3,_0x25d954?.[_0x17f132(0x1a7)]||_0x17f132(0x1af)));return join(_0xbd8e69[_0x17f132(0x1a6)],_0x58498d);}export async function directoryExists(_0x44474a){const _0x43a557=a235_0x37f5;try{const _0x422940=await stat(_0x44474a);return _0x422940[_0x43a557(0x1c5)]();}catch{return![];}}function a235_0x37f5(_0x33615d,_0x5bd907){_0x33615d=_0x33615d-0x1a6;const _0x14a0ac=a235_0x14a0();let _0x37f57f=_0x14a0ac[_0x33615d];return _0x37f57f;}function parseSqlPath(_0x5ec394,_0xf7652c,_0x2e38ac){const _0x425147=a235_0x37f5,_0x267a83=_0xf7652c[_0x425147(0x1b8)](0x0,-_0x2e38ac[_0x425147(0x1bb)]);if(_0x5ec394[_0x425147(0x1bb)]<0x2)return null;const _0xad9ce=_0x267a83[_0x425147(0x1c6)]('_');if(_0xad9ce<=0x0||_0xad9ce>=_0x267a83[_0x425147(0x1bb)]-0x1)return null;const _0x4dff9e=_0x267a83['slice'](0x0,_0xad9ce);if(!isLikelySqlCode(_0x4dff9e))return null;return{'sqlCode':_0x4dff9e,'sqlName':_0x267a83[_0x425147(0x1b8)](_0xad9ce+0x1)};}function isLikelySqlCode(_0x2164d5){const _0x1fa4ea=a235_0x37f5;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x1fa4ea(0x1b2)](_0x2164d5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b6bc9,_0xa40eb4){const _0x3c7d23=a236_0x30bf,_0x176916=_0x1b6bc9();while(!![]){try{const _0x545a45=parseInt(_0x3c7d23(0x1a4))/0x1*(parseInt(_0x3c7d23(0x19e))/0x2)+-parseInt(_0x3c7d23(0x1a2))/0x3*(parseInt(_0x3c7d23(0x19c))/0x4)+parseInt(_0x3c7d23(0x1a3))/0x5+-parseInt(_0x3c7d23(0x19b))/0x6+-parseInt(_0x3c7d23(0x1a1))/0x7+parseInt(_0x3c7d23(0x1a5))/0x8*(-parseInt(_0x3c7d23(0x1a0))/0x9)+-parseInt(_0x3c7d23(0x19d))/0xa*(-parseInt(_0x3c7d23(0x1a7))/0xb);if(_0x545a45===_0xa40eb4)break;else _0x176916['push'](_0x176916['shift']());}catch(_0x11fa1){_0x176916['push'](_0x176916['shift']());}}}(a236_0x965c,0x563d9));import{readFile}from'node:fs/promises';import a236_0x70f7c0 from'node:crypto';function a236_0x965c(){const _0x38fcc6=['1070lmCZyD','2ozEdnH','hex','4863087rjJhyC','2077999wWgOKZ','86613pAFHfo','2721360OuQJvN','324167XFHbkG','8FVRccb','update','104159BvaVPt','md5','3973860Foxzrx','4DreviH'];a236_0x965c=function(){return _0x38fcc6;};return a236_0x965c();}function a236_0x30bf(_0x1d25ac,_0x48b710){_0x1d25ac=_0x1d25ac-0x19a;const _0x965cf=a236_0x965c();let _0x30bfa0=_0x965cf[_0x1d25ac];return _0x30bfa0;}export function computeSqlContentHash(_0x381ba0){const _0x42d625=a236_0x30bf;return a236_0x70f7c0['createHash'](_0x42d625(0x19a))[_0x42d625(0x1a6)](_0x381ba0)['digest'](_0x42d625(0x19f));}export async function computeSqlFileHash(_0x3bd06f){const _0x4cd369=await readFile(_0x3bd06f,'utf8');return computeSqlContentHash(_0x4cd369);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x441d69,_0x4e608a){const _0xa86995=a237_0x3f8b,_0x264f18=_0x441d69();while(!![]){try{const _0x172307=parseInt(_0xa86995(0x168))/0x1*(-parseInt(_0xa86995(0x173))/0x2)+parseInt(_0xa86995(0x16c))/0x3+-parseInt(_0xa86995(0x175))/0x4*(-parseInt(_0xa86995(0x171))/0x5)+-parseInt(_0xa86995(0x16f))/0x6*(-parseInt(_0xa86995(0x166))/0x7)+-parseInt(_0xa86995(0x161))/0x8*(-parseInt(_0xa86995(0x172))/0x9)+-parseInt(_0xa86995(0x16a))/0xa+-parseInt(_0xa86995(0x170))/0xb;if(_0x172307===_0x4e608a)break;else _0x264f18['push'](_0x264f18['shift']());}catch(_0xa4addd){_0x264f18['push'](_0x264f18['shift']());}}}(a237_0x19e8,0x196b2));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a237_0x3f8b(_0x5ea71f,_0x369355){_0x5ea71f=_0x5ea71f-0x160;const _0x19e8ef=a237_0x19e8();let _0x3f8bb7=_0x19e8ef[_0x5ea71f];return _0x3f8bb7;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x595f86,_0x359e02,_0x1bbe8f,_0x146314){const _0xaa253e=a237_0x3f8b,_0x500e83=_0x595f86??createEmptySqlLock();let _0x1f2423=_0x500e83[_0xaa253e(0x167)][_0x359e02];if(!_0x1f2423)return _0x1f2423={'sqlRoot':_0x1bbe8f,'lastSync':'','sqls':{}},_0x500e83['apps'][_0x359e02]=_0x1f2423,{'lockData':_0x500e83,'appLock':_0x1f2423};if(!_0x1f2423['sqlRoot'])_0x1f2423[_0xaa253e(0x162)]=_0x1bbe8f;else{if(_0x1f2423[_0xaa253e(0x162)]!==_0x1bbe8f)throw new Error(_0x146314+_0xaa253e(0x16d)+_0x1bbe8f+_0xaa253e(0x16e)+_0x1f2423['sqlRoot']+'\x22.\x20'+_0xaa253e(0x16b));}return!_0x1f2423['sqls']&&(_0x1f2423[_0xaa253e(0x165)]={}),!_0x1f2423[_0xaa253e(0x164)]&&(_0x1f2423[_0xaa253e(0x164)]=''),{'lockData':_0x500e83,'appLock':_0x1f2423};}export async function readSqlLockFile(_0x120a36){const _0xa91680=a237_0x3f8b;try{const _0xff83e9=await readFile(_0x120a36,_0xa91680(0x163));return JSON[_0xa91680(0x174)](_0xff83e9);}catch(_0x11a068){if(_0x11a068[_0xa91680(0x160)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x11a068));}}export async function writeSqlLockFile(_0x398f5b,_0x1c61cb){const _0x126065=a237_0x3f8b;await mkdir(dirname(_0x398f5b),{'recursive':!![]}),await writeFile(_0x398f5b,JSON[_0x126065(0x169)](_0x1c61cb,null,0x2),'utf8');}function a237_0x19e8(){const _0x2dd171=['apps','1xsbsnc','stringify','1788730WczBql','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','487563YbpDHp',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22\x20vs\x20lock\x20\x22','945006hBsBxE','1118502ycdRgg','224530ZYXemT','18162ikEzQR','65454Pasbuf','parse','4BfOyqj','code','208oCDRzP','sqlRoot','utf8','lastSync','sqls','7UrKMVA'];a237_0x19e8=function(){return _0x2dd171;};return a237_0x19e8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a239_0x5c55(_0x58d24b,_0x1b1966){_0x58d24b=_0x58d24b-0xb8;const _0xd11bb0=a239_0xd11b();let _0x5c55ed=_0xd11bb0[_0x58d24b];return _0x5c55ed;}(function(_0x2a4e01,_0x1b8761){const _0x172821=a239_0x5c55,_0x1322a5=_0x2a4e01();while(!![]){try{const _0x450b74=-parseInt(_0x172821(0xb9))/0x1*(parseInt(_0x172821(0xc1))/0x2)+parseInt(_0x172821(0xbe))/0x3+-parseInt(_0x172821(0xbf))/0x4*(-parseInt(_0x172821(0xbb))/0x5)+parseInt(_0x172821(0xc7))/0x6+parseInt(_0x172821(0xc3))/0x7+-parseInt(_0x172821(0xb8))/0x8+-parseInt(_0x172821(0xc0))/0x9;if(_0x450b74===_0x1b8761)break;else _0x1322a5['push'](_0x1322a5['shift']());}catch(_0x1ad447){_0x1322a5['push'](_0x1322a5['shift']());}}}(a239_0xd11b,0xd6fb2));export function detectSqlMode(_0x5b85de){const _0x2ea857=a239_0x5c55,_0xd075af=_0x5b85de[_0x2ea857(0xc2)]();if(/^<(select|insert|update|delete)\b/i[_0x2ea857(0xc6)](_0xd075af))return _0x2ea857(0xbc);return _0x2ea857(0xba);}export function getSqlFileExtension(_0x2cffa8){const _0xe204ec=a239_0x5c55;return _0x2cffa8===_0xe204ec(0xbc)?_0xe204ec(0xc5):'.sql';}export function buildDefaultSqlFileName(_0x3ab03c,_0x397ab3){return''+_0x3ab03c+getSqlFileExtension(_0x397ab3);}export function sanitizeSqlPathSegment(_0x22a388,_0x137936){const _0x1a5ff0=a239_0x5c55,_0x6683a8=String(_0x22a388??'')[_0x1a5ff0(0xc4)](),_0xf198b1=_0x6683a8[_0x1a5ff0(0xc9)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x1a5ff0(0xc9)](/-+/g,'-')[_0x1a5ff0(0xc9)](/^\.+/,'')[_0x1a5ff0(0xc9)](/\.+$/,'')['replace'](/^-+/,'')[_0x1a5ff0(0xc9)](/-+$/,'');return _0xf198b1||_0x137936;}export function buildDbDirectoryName(_0x262078,_0x288926){const _0x4c1a7c=a239_0x5c55;return sanitizeSqlPathSegment(_0x262078,_0x288926!=null?_0x4c1a7c(0xbd)+_0x288926:'unknown-db');}export function buildSqlRelativePath(_0x48c5df,_0x519bdc,_0x3a59f9,_0x4ad357,_0x27132f){const _0x37a152=a239_0x5c55,_0x5f5034=buildDbDirectoryName(_0x3a59f9,_0x27132f),_0xdec514=sanitizeSqlPathSegment(_0x48c5df,_0x37a152(0xc8)),_0x211f51=sanitizeSqlPathSegment(_0x519bdc,_0xdec514);return _0x5f5034+'/'+_0xdec514+'_'+_0x211f51+getSqlFileExtension(_0x4ad357);}function a239_0xd11b(){const _0x5c43d2=['385057JGPkts','sql','5PcKkmt','mybatisXml','db-','3903813hVeBvF','5730972lRgaXW','23000220wrmbgb','2mkaxMo','trimStart','6669439zTVWdB','trim','.xml','test','5398260qkzFKe','unknown-sql','replace','6122416HDhGLl'];a239_0xd11b=function(){return _0x5c43d2;};return a239_0xd11b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a240_0x559f0d=a240_0x15ca;(function(_0x2d304f,_0x4f3b2e){const _0x4806f8=a240_0x15ca,_0xb2e4b5=_0x2d304f();while(!![]){try{const _0x50853d=-parseInt(_0x4806f8(0x1c1))/0x1*(parseInt(_0x4806f8(0x19e))/0x2)+-parseInt(_0x4806f8(0x1b2))/0x3*(-parseInt(_0x4806f8(0x1cc))/0x4)+parseInt(_0x4806f8(0x1ca))/0x5*(-parseInt(_0x4806f8(0x187))/0x6)+parseInt(_0x4806f8(0x171))/0x7+parseInt(_0x4806f8(0x17c))/0x8+-parseInt(_0x4806f8(0x183))/0x9+parseInt(_0x4806f8(0x176))/0xa*(parseInt(_0x4806f8(0x1a9))/0xb);if(_0x50853d===_0x4f3b2e)break;else _0xb2e4b5['push'](_0xb2e4b5['shift']());}catch(_0x5781e4){_0xb2e4b5['push'](_0xb2e4b5['shift']());}}}(a240_0x2f75,0xb40fb));const MYBATIS_OUTER_TAGS=new Map([[a240_0x559f0d(0x1b8),a240_0x559f0d(0x185)],[a240_0x559f0d(0x18e),'INSERT'],[a240_0x559f0d(0x17f),'UPDATE'],[a240_0x559f0d(0x192),'DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a240_0x559f0d(0x1af),'foreach','choose',a240_0x559f0d(0x18b),a240_0x559f0d(0x1be),a240_0x559f0d(0x1ab),a240_0x559f0d(0x1bc),a240_0x559f0d(0x1ae),a240_0x559f0d(0x1c4),a240_0x559f0d(0x1c8)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach','choose',a240_0x559f0d(0x18b),a240_0x559f0d(0x1be)]);export const MYBATIS_DYNAMIC_START_MARKER=a240_0x559f0d(0x1b7);export const MYBATIS_DYNAMIC_END_MARKER=a240_0x559f0d(0x1c0);export const MYBATIS_INCLUDE_MARKER=a240_0x559f0d(0x19d);function a240_0x2f75(){const _0x224b3a=['toLowerCase','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','sql','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','\x20SET\x20','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','2DFMDZB','-->','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','WITH','split','mybatisXml','push','unknown\x20table(s)','\x20WHERE\x20','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','rawName','27632SXNftm','replaceAll','trim','get','Unterminated\x20MyBatis\x20XML\x20tag.','bind','where','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','18EGYjfC','replace',''','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','parseInt','__RABETBASE_MYBATIS_DYNAMIC_START__','select','<!--','&','Unterminated\x20XML\x20comment.','set','test','otherwise','has','__RABETBASE_MYBATIS_DYNAMIC_END__','768148IZGEYr','startsWith','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','include','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','<![CDATA[','reason','property','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','5rbXLYB','UPDATE','64384pWxVif','3390597rIArly','type','includes','error','Invalid\x20XML\x20entity\x20reference.','6770aPGFNQ','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','outer','toUpperCase','statementType','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','7343704foqJar','DDL','Unterminated\x20XML\x20declaration.','update','DELETE','pop','INSERT','11453346PNGANC','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','SELECT','from','2527566BBwcMW','join','Unable\x20to\x20detect\x20SQL\x20type.\x20','tagName','when','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','UNKNOWN','insert','indexOf','length','^<\x5cs*(?:','delete','exec','slice','fromCodePoint','add'];a240_0x2f75=function(){return _0x224b3a;};return a240_0x2f75();}const UNRESOLVED_SQL_FRAGMENT=a240_0x559f0d(0x17b),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a240_0x559f0d(0x191)+[...MYBATIS_OUTER_TAGS['keys']()][a240_0x559f0d(0x188)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x54f324){const _0x25e471=a240_0x559f0d,_0x59aac4=typeof _0x54f324==='string'?_0x54f324:'';if(!startsWithMybatisStatementWrapper(_0x59aac4))return{'sql':_0x59aac4,'mode':'sql'};let _0x4ad9d3=0x0,_0x31f6d0='',_0x10cdb9,_0x2f22d2=![],_0x2a9415=![];const _0x25f2e0=[];while(_0x4ad9d3<_0x59aac4[_0x25e471(0x190)]){if(_0x59aac4[_0x25e471(0x1c2)](_0x25e471(0x1b9),_0x4ad9d3)){const _0x426d60=_0x59aac4[_0x25e471(0x18f)]('-->',_0x4ad9d3+0x4);if(_0x426d60<0x0)return invalidMybatisSource(_0x25e471(0x1bb));_0x31f6d0+='\x20',_0x4ad9d3=_0x426d60+0x3;continue;}if(_0x59aac4[_0x25e471(0x1c2)](_0x25e471(0x1c6),_0x4ad9d3)){if(!_0x2f22d2||_0x2a9415)return invalidMybatisSource('CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x4d224b=_0x59aac4[_0x25e471(0x18f)](']]>',_0x4ad9d3+0x9);if(_0x4d224b<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x31f6d0+=_0x59aac4[_0x25e471(0x194)](_0x4ad9d3+0x9,_0x4d224b),_0x4ad9d3=_0x4d224b+0x3;continue;}if(_0x59aac4['startsWith']('<?',_0x4ad9d3)){if(_0x2f22d2)return invalidMybatisSource('XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x253a5e=_0x59aac4[_0x25e471(0x18f)]('?>',_0x4ad9d3+0x2);if(_0x253a5e<0x0)return invalidMybatisSource(_0x25e471(0x17e));_0x31f6d0+='\x20',_0x4ad9d3=_0x253a5e+0x2;continue;}if(_0x59aac4[_0x4ad9d3]!=='<'){const _0x2ec387=_0x59aac4[_0x25e471(0x18f)]('<',_0x4ad9d3),_0x38e446=_0x2ec387<0x0?_0x59aac4['length']:_0x2ec387,_0x298e9f=_0x59aac4[_0x25e471(0x194)](_0x4ad9d3,_0x38e446);if((!_0x2f22d2||_0x2a9415)&&_0x298e9f['trim']())return invalidMybatisSource(_0x25e471(0x184));if(_0x2f22d2&&!_0x2a9415){const _0x5b4ec9=decodeXmlEntities(_0x298e9f);if(_0x5b4ec9===null)return invalidMybatisSource(_0x25e471(0x175));_0x31f6d0+=_0x5b4ec9;}else _0x31f6d0+='\x20';_0x4ad9d3=_0x38e446;continue;}const _0x3ed8e2=findXmlTagEnd(_0x59aac4,_0x4ad9d3);if(_0x3ed8e2<0x0)return invalidMybatisSource(_0x25e471(0x1ad));const _0x6c646f=_0x59aac4[_0x25e471(0x194)](_0x4ad9d3,_0x3ed8e2+0x1),_0x34f703=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x25e471(0x193)](_0x6c646f);if(!_0x34f703)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20tag.');const _0x27745c=_0x34f703[0x1]==='/',_0x4141a3=_0x34f703[0x2]??'',_0x4d7bc3=_0x4141a3[_0x25e471(0x197)](),_0x2acd88=_0x34f703[0x3]??'',_0x324805=_0x34f703[0x4]==='/',_0x59a4b9=MYBATIS_OUTER_TAGS[_0x25e471(0x1ac)](_0x4d7bc3);if(!_0x59a4b9&&!MYBATIS_DYNAMIC_TAGS[_0x25e471(0x1bf)](_0x4d7bc3))return invalidMybatisSource(_0x25e471(0x1c3)+_0x4d7bc3+'>.');if(!_0x59a4b9&&_0x4141a3!==_0x4d7bc3)return invalidMybatisSource(_0x25e471(0x18c)+_0x4141a3+'>.');if(_0x27745c){if(_0x2acd88['trim']()||_0x324805)return invalidMybatisSource(_0x25e471(0x177)+_0x4141a3+'>.');const _0x707d57=_0x25f2e0['at'](-0x1);if(!_0x707d57||(_0x707d57[_0x25e471(0x178)]?_0x707d57['tagName']!==_0x4d7bc3:_0x707d57['rawName']!==_0x4141a3))return invalidMybatisSource(_0x25e471(0x1a7)+_0x4141a3+'>.');_0x25f2e0[_0x25e471(0x181)]();if(_0x707d57[_0x25e471(0x178)])_0x2a9415=!![];_0x31f6d0+=MYBATIS_BRANCH_TAGS[_0x25e471(0x1bf)](_0x4d7bc3)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x2acd88))return invalidMybatisSource(_0x25e471(0x1b5)+_0x4141a3+'>.');if(_0x4d7bc3===_0x25e471(0x1c8)&&(!_0x324805||_0x25f2e0['at'](-0x1)?.[_0x25e471(0x18a)]!==_0x25e471(0x1c4)))return invalidMybatisSource(_0x25e471(0x1c5));if(_0x59a4b9){if(_0x2f22d2||_0x25f2e0[_0x25e471(0x190)]>0x0)return invalidMybatisSource(_0x25e471(0x1c9));_0x2f22d2=!![],_0x2a9415=_0x324805,_0x10cdb9=_0x59a4b9;}else{if(!_0x2f22d2||_0x2a9415)return invalidMybatisSource(_0x25e471(0x1b0)+_0x4141a3+'>.');}_0x31f6d0+=_0x4d7bc3===_0x25e471(0x1af)?_0x25e471(0x1a6):_0x4d7bc3==='set'?_0x25e471(0x19b):_0x4d7bc3==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0x4d7bc3)&&!_0x324805?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x324805&&_0x25f2e0[_0x25e471(0x1a4)]({'rawName':_0x4141a3,'tagName':_0x4d7bc3,'outer':!!_0x59a4b9});}_0x4ad9d3=_0x3ed8e2+0x1;}if(_0x25f2e0[_0x25e471(0x190)]>0x0)return invalidMybatisSource(_0x25e471(0x1b1)+_0x25f2e0['at'](-0x1)?.[_0x25e471(0x1a8)]+'>.');if(!_0x2f22d2||!_0x2a9415)return invalidMybatisSource(_0x25e471(0x1a0));return{'sql':_0x31f6d0[_0x25e471(0x1ab)](),'mode':'mybatisXml',..._0x10cdb9?{'statementType':_0x10cdb9}:{}};}function hasWellFormedXmlAttributes(_0x2a51f2){const _0x5b2eec=a240_0x559f0d;let _0x448c93=0x0;const _0x2a75a3=new Set();while(_0x448c93<_0x2a51f2['length']){while(_0x448c93<_0x2a51f2[_0x5b2eec(0x190)]&&/\s/[_0x5b2eec(0x1bd)](_0x2a51f2[_0x448c93]??''))_0x448c93+=0x1;if(_0x448c93>=_0x2a51f2[_0x5b2eec(0x190)])return!![];const _0x280a9e=/^[A-Za-z_:][\w:.-]*/['exec'](_0x2a51f2[_0x5b2eec(0x194)](_0x448c93)),_0x4a3d7c=_0x280a9e?.[0x0];if(!_0x4a3d7c||_0x2a75a3[_0x5b2eec(0x1bf)](_0x4a3d7c))return![];_0x2a75a3[_0x5b2eec(0x196)](_0x4a3d7c),_0x448c93+=_0x4a3d7c[_0x5b2eec(0x190)];while(_0x448c93<_0x2a51f2[_0x5b2eec(0x190)]&&/\s/[_0x5b2eec(0x1bd)](_0x2a51f2[_0x448c93]??''))_0x448c93+=0x1;if(_0x2a51f2[_0x448c93]!=='=')return![];_0x448c93+=0x1;while(_0x448c93<_0x2a51f2[_0x5b2eec(0x190)]&&/\s/[_0x5b2eec(0x1bd)](_0x2a51f2[_0x448c93]??''))_0x448c93+=0x1;const _0x440ff0=_0x2a51f2[_0x448c93];if(_0x440ff0!=='\x22'&&_0x440ff0!=='\x27')return![];_0x448c93+=0x1;const _0xa65e45=_0x2a51f2[_0x5b2eec(0x18f)](_0x440ff0,_0x448c93);if(_0xa65e45<0x0)return![];if(decodeXmlEntities(_0x2a51f2['slice'](_0x448c93,_0xa65e45))===null)return![];_0x448c93=_0xa65e45+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x40a2d5){const _0x1a46d7=a240_0x559f0d;let _0x49e113=0x0;const _0x191b04=()=>{const _0x56f474=a240_0x15ca;while(_0x49e113<_0x40a2d5[_0x56f474(0x190)]&&/\s/[_0x56f474(0x1bd)](_0x40a2d5[_0x49e113]??''))_0x49e113+=0x1;};_0x191b04();while(_0x49e113<_0x40a2d5[_0x1a46d7(0x190)]){if(_0x40a2d5['startsWith'](_0x1a46d7(0x1b9),_0x49e113)){const _0xa7244d=_0x40a2d5['indexOf'](_0x1a46d7(0x19f),_0x49e113+0x4);if(_0xa7244d<0x0)return!![];_0x49e113=_0xa7244d+0x3,_0x191b04();continue;}if(_0x40a2d5[_0x1a46d7(0x1c2)]('<?',_0x49e113)){const _0x353fdb=_0x40a2d5[_0x1a46d7(0x18f)]('?>',_0x49e113+0x2);if(_0x353fdb<0x0)return!![];_0x49e113=_0x353fdb+0x2,_0x191b04();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x1a46d7(0x1bd)](_0x40a2d5['slice'](_0x49e113));}function invalidMybatisSource(_0x507a78){const _0x51446a=a240_0x559f0d;return{'sql':'','mode':_0x51446a(0x1a3),'error':_0x507a78};}function findXmlTagEnd(_0x388e9e,_0x6f5acc){const _0x51e60a=a240_0x559f0d;let _0x220cbe;for(let _0x3858d9=_0x6f5acc+0x1;_0x3858d9<_0x388e9e[_0x51e60a(0x190)];_0x3858d9+=0x1){const _0x1b93b6=_0x388e9e[_0x3858d9];if(_0x220cbe){if(_0x1b93b6===_0x220cbe)_0x220cbe=undefined;continue;}if(_0x1b93b6==='\x22'||_0x1b93b6==='\x27'){_0x220cbe=_0x1b93b6;continue;}if(_0x1b93b6==='>')return _0x3858d9;}return-0x1;}function decodeXmlEntities(_0xff9d12){const _0x54842b=a240_0x559f0d;let _0x2b356b=![];const _0x45926b=_0xff9d12[_0x54842b(0x1b3)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x5f26fb=>{const _0x5a70b0=_0x54842b;if(_0x5f26fb==='<')return'<';if(_0x5f26fb==='>')return'>';if(_0x5f26fb==='"')return'\x22';if(_0x5f26fb===_0x5a70b0(0x1b4))return'\x27';if(_0x5f26fb===_0x5a70b0(0x1ba))return'&';const _0x2f1b90=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x5f26fb);if(_0x2f1b90){const _0x385257=_0x2f1b90[0x1],_0x14cf2d=_0x2f1b90[0x2],_0x5446f=Number[_0x5a70b0(0x1b6)](_0x385257??_0x14cf2d??'',_0x385257?0x10:0xa);if(isValidXmlCharacter(_0x5446f))return String[_0x5a70b0(0x195)](_0x5446f);}return _0x2b356b=!![],'';});return _0x2b356b?null:_0x45926b;}function isValidXmlCharacter(_0x489728){return _0x489728===0x9||_0x489728===0xa||_0x489728===0xd||_0x489728>=0x20&&_0x489728<=0xd7ff||_0x489728>=0xe000&&_0x489728<=0xfffd||_0x489728>=0x10000&&_0x489728<=0x10ffff;}export function detectSqlType(_0x5adc66){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x5adc66));}function detectNormalizedSqlType(_0x230f47){const _0x585d30=a240_0x559f0d;if(_0x230f47['error'])return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x230f47[_0x585d30(0x174)]};if(!_0x230f47[_0x585d30(0x199)][_0x585d30(0x1ab)]())return{'type':_0x585d30(0x18d),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x4e3781=stripStaticAnalysisMarkers(_0x230f47[_0x585d30(0x199)])[_0x585d30(0x1b3)](/#\{[^}]*\}/g,'?')[_0x585d30(0x1b3)](/\$\{[^}]*\}/g,'?')[_0x585d30(0x1b3)](/@[^(\s]+(\([^)]*\))?/g,'')['replace'](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x36a5f5=_0x4e3781[_0x585d30(0x1a2)]('\x0a');let _0xc7b881='';for(const _0x1508d8 of _0x36a5f5){const _0x277e00=_0x1508d8['trim']();if(!_0x277e00||_0x277e00['startsWith']('--')||_0x277e00[_0x585d30(0x1c2)]('/*'))continue;_0xc7b881=_0x277e00;break;}const _0x3cb48d=_0xc7b881[_0x585d30(0x179)](),_0x5b8fbb=_0x230f47[_0x585d30(0x17a)],_0x17b6b7=maskSqlTextForBlockedKeywordScan(_0x4e3781),_0x575cb0=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x585d30(0x1bd)](_0x17b6b7);if(_0x5b8fbb===_0x585d30(0x185)||!_0x5b8fbb&&(_0x3cb48d[_0x585d30(0x1c2)]('SELECT')||_0x3cb48d[_0x585d30(0x1c2)](_0x585d30(0x1a1)))){const _0x618734=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x585d30(0x1bd)](_0x4e3781);return{'type':_0x585d30(0x185),'isSelectOnly':!_0x618734,'isDangerous':_0x618734,'reason':_0x618734?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x5b8fbb===_0x585d30(0x182)||!_0x5b8fbb&&_0x3cb48d[_0x585d30(0x1c2)](_0x585d30(0x182)))return{'type':_0x585d30(0x182),'isSelectOnly':![],'isDangerous':_0x575cb0,'reason':_0x575cb0?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x5b8fbb==='UPDATE'||!_0x5b8fbb&&_0x3cb48d[_0x585d30(0x1c2)](_0x585d30(0x1cb)))return{'type':_0x585d30(0x1cb),'isSelectOnly':![],'isDangerous':_0x575cb0,'reason':_0x575cb0?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x5b8fbb===_0x585d30(0x180)||!_0x5b8fbb&&_0x3cb48d['startsWith']('DELETE'))return{'type':_0x585d30(0x180),'isSelectOnly':![],'isDangerous':!![],'reason':_0x585d30(0x19c)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x585d30(0x1bd)](_0x3cb48d))return{'type':_0x585d30(0x17d),'isSelectOnly':![],'isDangerous':!![],'reason':_0x585d30(0x198)};return{'type':_0x585d30(0x18d),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x1299e9){const _0x30149a=a240_0x559f0d;return _0x1299e9[_0x30149a(0x1aa)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x30149a(0x1aa)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function a240_0x15ca(_0x2c8df4,_0x4f9a38){_0x2c8df4=_0x2c8df4-0x171;const _0x2f75c9=a240_0x2f75();let _0x15cacb=_0x2f75c9[_0x2c8df4];return _0x15cacb;}function maskSqlTextForBlockedKeywordScan(_0x4f4895){const _0x49ed7a=a240_0x559f0d;return _0x4f4895[_0x49ed7a(0x1b3)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x49ed7a(0x1b3)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x49ed7a(0x1b3)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x49ed7a(0x1b3)](/--.*$/gm,'\x20')[_0x49ed7a(0x1b3)](/#.*$/gm,'\x20')[_0x49ed7a(0x1b3)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x4862d2){const _0x2cce32=a240_0x559f0d,_0x7a0cc5=_0x4862d2[_0x2cce32(0x1b3)](/#\{[^}]*\}/g,'?')[_0x2cce32(0x1b3)](/\$\{[^}]*\}/g,'?')[_0x2cce32(0x1b3)](/'[^']*'/g,'\x27\x27')[_0x2cce32(0x1b3)](/--.*$/gm,'')[_0x2cce32(0x1b3)](/\/\*[\s\S]*?\*\//g,''),_0x552fb0=[],_0x5d7e5a=_0x7a0cc5['match'](/FROM\s+([^\s,)(]+)/i);addTable(_0x552fb0,_0x5d7e5a?.[0x1]);for(const _0x9249e3 of _0x7a0cc5['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x552fb0,_0x9249e3[0x1]);}const _0x5eabdf=_0x7a0cc5['match'](/INTO\s+([^\s(]+)/i);addTable(_0x552fb0,_0x5eabdf?.[0x1]);const _0x43d2d5=_0x7a0cc5['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x552fb0,_0x43d2d5?.[0x1]),_0x552fb0;}function addTable(_0x582ce3,_0x355531){const _0x1e0ca4=a240_0x559f0d,_0x2b2c96=_0x355531?.[_0x1e0ca4(0x1b3)](/[`"]/g,'');_0x2b2c96&&_0x2b2c96!==UNRESOLVED_SQL_FRAGMENT&&!_0x582ce3[_0x1e0ca4(0x173)](_0x2b2c96)&&_0x582ce3[_0x1e0ca4(0x1a4)](_0x2b2c96);}function extractParameters(_0x5b07fc){const _0x384ab7=a240_0x559f0d,_0x1847b3=new Set();for(const _0x2e4140 of _0x5b07fc['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x2e4140[0x1])_0x1847b3[_0x384ab7(0x196)](_0x2e4140[0x1]);}return Array[_0x384ab7(0x186)](_0x1847b3);}export function validateSql(_0x56a023){const _0x1891e2=a240_0x559f0d,_0x49a2aa=normalizeSqlForStaticAnalysis(_0x56a023),_0x55fe82=detectNormalizedSqlType(_0x49a2aa),_0x30495a=stripStaticAnalysisMarkers(_0x49a2aa[_0x1891e2(0x199)]),_0x10eb20=_0x49a2aa['error']?[]:extractTables(_0x30495a),_0x5734a2=_0x49a2aa['error']?[]:extractParameters(_0x30495a);if(_0x55fe82['isDangerous'])return{'valid':![],'sqlType':_0x55fe82,'tables':_0x10eb20,'parameters':_0x5734a2,'message':_0x55fe82[_0x1891e2(0x1c7)]||_0x55fe82[_0x1891e2(0x172)]+_0x1891e2(0x19a)};if(_0x55fe82[_0x1891e2(0x172)]===_0x1891e2(0x18d))return{'valid':![],'sqlType':_0x55fe82,'tables':_0x10eb20,'parameters':_0x5734a2,'message':_0x49a2aa[_0x1891e2(0x174)]?_0x1891e2(0x189)+_0x49a2aa[_0x1891e2(0x174)]:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x55fe82,'tables':_0x10eb20,'parameters':_0x5734a2,'message':_0x55fe82['type']+'\x20query\x20targeting\x20'+(_0x10eb20['length']?_0x10eb20[_0x1891e2(0x188)](',\x20'):_0x1891e2(0x1a5))+(_0x5734a2[_0x1891e2(0x190)]?'\x20with\x20parameters:\x20'+_0x5734a2[_0x1891e2(0x188)](',\x20'):'')};}
|
|
1
|
+
const a240_0x417021=a240_0x132d;(function(_0x2c6ebe,_0x47ab6b){const _0x155c32=a240_0x132d,_0x51297d=_0x2c6ebe();while(!![]){try{const _0x545c7a=-parseInt(_0x155c32(0x209))/0x1*(-parseInt(_0x155c32(0x236))/0x2)+-parseInt(_0x155c32(0x237))/0x3+parseInt(_0x155c32(0x20a))/0x4*(parseInt(_0x155c32(0x22d))/0x5)+-parseInt(_0x155c32(0x231))/0x6*(-parseInt(_0x155c32(0x21d))/0x7)+parseInt(_0x155c32(0x202))/0x8+-parseInt(_0x155c32(0x1f5))/0x9+parseInt(_0x155c32(0x230))/0xa;if(_0x545c7a===_0x47ab6b)break;else _0x51297d['push'](_0x51297d['shift']());}catch(_0x398472){_0x51297d['push'](_0x51297d['shift']());}}}(a240_0x4956,0x706f0));const MYBATIS_OUTER_TAGS=new Map([[a240_0x417021(0x243),a240_0x417021(0x201)],[a240_0x417021(0x234),'INSERT'],[a240_0x417021(0x223),a240_0x417021(0x23c)],['delete',a240_0x417021(0x23a)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a240_0x417021(0x220),'choose','when','otherwise',a240_0x417021(0x20c),'set','bind','include',a240_0x417021(0x1fe)]),MYBATIS_BRANCH_TAGS=new Set(['if','foreach',a240_0x417021(0x1ee),a240_0x417021(0x232),'otherwise']);function a240_0x4956(){const _0x37b38c=['length','mybatisXml','from','string','select','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','SQL\x20content\x20is\x20empty','Invalid\x20XML\x20entity\x20reference.','startsWith','push','sql','has','choose','replace','get','pop','type','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','Invalid\x20MyBatis\x20XML\x20tag.','5980671PBwOEu','&','WITH','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','"',''','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','matchAll','match','property','exec',')\x5cb','SELECT','1769312YVnMaJ','-->','\x20with\x20parameters:\x20','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','slice','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','indexOf','351553RyYJuD','919120DhIXWC','<![CDATA[','trim','<!--','Unterminated\x20MyBatis\x20XML\x20tag.','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','^<\x5cs*(?:','toUpperCase','<','Unterminated\x20XML\x20comment.','error','isDangerous','outer','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','fromCodePoint','reason','UNKNOWN','rawName','Unterminated\x20XML\x20declaration.','7yMvvgB','split','>','foreach','parseInt','__RABETBASE_MYBATIS_DYNAMIC_START__','update','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','unknown\x20table(s)','\x20query\x20targeting\x20','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','tagName','includes','include','INSERT','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','5QoLTNg','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','Unable\x20to\x20detect\x20SQL\x20type.\x20','1796390XjuTrQ','3774204UDZFSD','when','test','insert','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','2DXiVhT','1458369OYttdx','add','__RABETBASE_MYBATIS_DYNAMIC_END__','DELETE','replaceAll','UPDATE','join','DDL'];a240_0x4956=function(){return _0x37b38c;};return a240_0x4956();}export const MYBATIS_DYNAMIC_START_MARKER=a240_0x417021(0x222);export const MYBATIS_DYNAMIC_END_MARKER=a240_0x417021(0x239);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT='__RABETBASE_UNRESOLVED_SQL_FRAGMENT__',MYBATIS_OUTER_TAG_PATTERN=new RegExp(a240_0x417021(0x210)+[...MYBATIS_OUTER_TAGS['keys']()][a240_0x417021(0x23d)]('|')+a240_0x417021(0x200),'i');export function normalizeSqlForStaticAnalysis(_0x498430){const _0x4595e0=a240_0x417021,_0x4d1536=typeof _0x498430===_0x4595e0(0x242)?_0x498430:'';if(!startsWithMybatisStatementWrapper(_0x4d1536))return{'sql':_0x4d1536,'mode':'sql'};let _0x333f37=0x0,_0x4df0e3='',_0x2b1612,_0x57484b=![],_0x427f72=![];const _0x489ce3=[];while(_0x333f37<_0x4d1536[_0x4595e0(0x23f)]){if(_0x4d1536[_0x4595e0(0x248)](_0x4595e0(0x20d),_0x333f37)){const _0x37bb92=_0x4d1536['indexOf']('-->',_0x333f37+0x4);if(_0x37bb92<0x0)return invalidMybatisSource(_0x4595e0(0x213));_0x4df0e3+='\x20',_0x333f37=_0x37bb92+0x3;continue;}if(_0x4d1536[_0x4595e0(0x248)](_0x4595e0(0x20b),_0x333f37)){if(!_0x57484b||_0x427f72)return invalidMybatisSource(_0x4595e0(0x20f));const _0x38425b=_0x4d1536[_0x4595e0(0x208)](']]>',_0x333f37+0x9);if(_0x38425b<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x4df0e3+=_0x4d1536[_0x4595e0(0x206)](_0x333f37+0x9,_0x38425b),_0x333f37=_0x38425b+0x3;continue;}if(_0x4d1536[_0x4595e0(0x248)]('<?',_0x333f37)){if(_0x57484b)return invalidMybatisSource(_0x4595e0(0x1fb));const _0xab7ec9=_0x4d1536['indexOf']('?>',_0x333f37+0x2);if(_0xab7ec9<0x0)return invalidMybatisSource(_0x4595e0(0x21c));_0x4df0e3+='\x20',_0x333f37=_0xab7ec9+0x2;continue;}if(_0x4d1536[_0x333f37]!=='<'){const _0x55e230=_0x4d1536[_0x4595e0(0x208)]('<',_0x333f37),_0x938ca2=_0x55e230<0x0?_0x4d1536[_0x4595e0(0x23f)]:_0x55e230,_0x58e303=_0x4d1536['slice'](_0x333f37,_0x938ca2);if((!_0x57484b||_0x427f72)&&_0x58e303['trim']())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x57484b&&!_0x427f72){const _0x39ae5d=decodeXmlEntities(_0x58e303);if(_0x39ae5d===null)return invalidMybatisSource(_0x4595e0(0x247));_0x4df0e3+=_0x39ae5d;}else _0x4df0e3+='\x20';_0x333f37=_0x938ca2;continue;}const _0xb556cd=findXmlTagEnd(_0x4d1536,_0x333f37);if(_0xb556cd<0x0)return invalidMybatisSource(_0x4595e0(0x20e));const _0x3cf42e=_0x4d1536[_0x4595e0(0x206)](_0x333f37,_0xb556cd+0x1),_0x5dade9=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x3cf42e);if(!_0x5dade9)return invalidMybatisSource(_0x4595e0(0x1f4));const _0x1d61fc=_0x5dade9[0x1]==='/',_0x2a6783=_0x5dade9[0x2]??'',_0x278bd6=_0x2a6783['toLowerCase'](),_0x63e5fd=_0x5dade9[0x3]??'',_0x2f8778=_0x5dade9[0x4]==='/',_0x108128=MYBATIS_OUTER_TAGS[_0x4595e0(0x1f0)](_0x278bd6);if(!_0x108128&&!MYBATIS_DYNAMIC_TAGS[_0x4595e0(0x1ed)](_0x278bd6))return invalidMybatisSource(_0x4595e0(0x245)+_0x278bd6+'>.');if(!_0x108128&&_0x2a6783!==_0x278bd6)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<'+_0x2a6783+'>.');if(_0x1d61fc){if(_0x63e5fd[_0x4595e0(0x20c)]()||_0x2f8778)return invalidMybatisSource(_0x4595e0(0x1f3)+_0x2a6783+'>.');const _0x2a770d=_0x489ce3['at'](-0x1);if(!_0x2a770d||(_0x2a770d[_0x4595e0(0x216)]?_0x2a770d[_0x4595e0(0x228)]!==_0x278bd6:_0x2a770d['rawName']!==_0x2a6783))return invalidMybatisSource(_0x4595e0(0x227)+_0x2a6783+'>.');_0x489ce3[_0x4595e0(0x1f1)]();if(_0x2a770d[_0x4595e0(0x216)])_0x427f72=!![];_0x4df0e3+=MYBATIS_BRANCH_TAGS[_0x4595e0(0x1ed)](_0x278bd6)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x63e5fd))return invalidMybatisSource(_0x4595e0(0x205)+_0x2a6783+'>.');if(_0x278bd6==='property'&&(!_0x2f8778||_0x489ce3['at'](-0x1)?.['tagName']!==_0x4595e0(0x22a)))return invalidMybatisSource('MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.');if(_0x108128){if(_0x57484b||_0x489ce3[_0x4595e0(0x23f)]>0x0)return invalidMybatisSource(_0x4595e0(0x235));_0x57484b=!![],_0x427f72=_0x2f8778,_0x2b1612=_0x108128;}else{if(!_0x57484b||_0x427f72)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x2a6783+'>.');}_0x4df0e3+=_0x278bd6==='where'?'\x20WHERE\x20':_0x278bd6==='set'?'\x20SET\x20':_0x278bd6===_0x4595e0(0x22a)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x4595e0(0x1ed)](_0x278bd6)&&!_0x2f8778?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x2f8778&&_0x489ce3[_0x4595e0(0x249)]({'rawName':_0x2a6783,'tagName':_0x278bd6,'outer':!!_0x108128});}_0x333f37=_0xb556cd+0x1;}if(_0x489ce3[_0x4595e0(0x23f)]>0x0)return invalidMybatisSource(_0x4595e0(0x244)+_0x489ce3['at'](-0x1)?.[_0x4595e0(0x21b)]+'>.');if(!_0x57484b||!_0x427f72)return invalidMybatisSource(_0x4595e0(0x207));return{'sql':_0x4df0e3[_0x4595e0(0x20c)](),'mode':'mybatisXml',..._0x2b1612?{'statementType':_0x2b1612}:{}};}function hasWellFormedXmlAttributes(_0x8d4196){const _0x5d45fc=a240_0x417021;let _0x456e84=0x0;const _0x435a3b=new Set();while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]){while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]&&/\s/[_0x5d45fc(0x233)](_0x8d4196[_0x456e84]??''))_0x456e84+=0x1;if(_0x456e84>=_0x8d4196[_0x5d45fc(0x23f)])return!![];const _0x29d297=/^[A-Za-z_:][\w:.-]*/['exec'](_0x8d4196['slice'](_0x456e84)),_0x207adf=_0x29d297?.[0x0];if(!_0x207adf||_0x435a3b[_0x5d45fc(0x1ed)](_0x207adf))return![];_0x435a3b['add'](_0x207adf),_0x456e84+=_0x207adf[_0x5d45fc(0x23f)];while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]&&/\s/[_0x5d45fc(0x233)](_0x8d4196[_0x456e84]??''))_0x456e84+=0x1;if(_0x8d4196[_0x456e84]!=='=')return![];_0x456e84+=0x1;while(_0x456e84<_0x8d4196[_0x5d45fc(0x23f)]&&/\s/[_0x5d45fc(0x233)](_0x8d4196[_0x456e84]??''))_0x456e84+=0x1;const _0x52a610=_0x8d4196[_0x456e84];if(_0x52a610!=='\x22'&&_0x52a610!=='\x27')return![];_0x456e84+=0x1;const _0x4e90b5=_0x8d4196[_0x5d45fc(0x208)](_0x52a610,_0x456e84);if(_0x4e90b5<0x0)return![];if(decodeXmlEntities(_0x8d4196['slice'](_0x456e84,_0x4e90b5))===null)return![];_0x456e84=_0x4e90b5+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x2390b8){const _0x6fe5dc=a240_0x417021;let _0x1acb46=0x0;const _0x168fe6=()=>{const _0x535c14=a240_0x132d;while(_0x1acb46<_0x2390b8['length']&&/\s/[_0x535c14(0x233)](_0x2390b8[_0x1acb46]??''))_0x1acb46+=0x1;};_0x168fe6();while(_0x1acb46<_0x2390b8['length']){if(_0x2390b8[_0x6fe5dc(0x248)](_0x6fe5dc(0x20d),_0x1acb46)){const _0x2490c5=_0x2390b8[_0x6fe5dc(0x208)](_0x6fe5dc(0x203),_0x1acb46+0x4);if(_0x2490c5<0x0)return!![];_0x1acb46=_0x2490c5+0x3,_0x168fe6();continue;}if(_0x2390b8[_0x6fe5dc(0x248)]('<?',_0x1acb46)){const _0x6f7c58=_0x2390b8[_0x6fe5dc(0x208)]('?>',_0x1acb46+0x2);if(_0x6f7c58<0x0)return!![];_0x1acb46=_0x6f7c58+0x2,_0x168fe6();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x6fe5dc(0x233)](_0x2390b8[_0x6fe5dc(0x206)](_0x1acb46));}function invalidMybatisSource(_0x81a4e5){const _0x4a68e5=a240_0x417021;return{'sql':'','mode':_0x4a68e5(0x240),'error':_0x81a4e5};}function findXmlTagEnd(_0x1c160b,_0x2e8f43){const _0x3e3684=a240_0x417021;let _0x51600f;for(let _0x4bd3e4=_0x2e8f43+0x1;_0x4bd3e4<_0x1c160b[_0x3e3684(0x23f)];_0x4bd3e4+=0x1){const _0x43787d=_0x1c160b[_0x4bd3e4];if(_0x51600f){if(_0x43787d===_0x51600f)_0x51600f=undefined;continue;}if(_0x43787d==='\x22'||_0x43787d==='\x27'){_0x51600f=_0x43787d;continue;}if(_0x43787d==='>')return _0x4bd3e4;}return-0x1;}function a240_0x132d(_0x15f0bc,_0x5d77c3){_0x15f0bc=_0x15f0bc-0x1ec;const _0x4956dc=a240_0x4956();let _0x132d5c=_0x4956dc[_0x15f0bc];return _0x132d5c;}function decodeXmlEntities(_0x44c20d){const _0x5e62e1=a240_0x417021;let _0x18a851=![];const _0x20db1e=_0x44c20d[_0x5e62e1(0x1ef)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x1f05db=>{const _0x593213=_0x5e62e1;if(_0x1f05db===_0x593213(0x212))return'<';if(_0x1f05db===_0x593213(0x21f))return'>';if(_0x1f05db===_0x593213(0x1f9))return'\x22';if(_0x1f05db===_0x593213(0x1fa))return'\x27';if(_0x1f05db===_0x593213(0x1f6))return'&';const _0x191303=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x593213(0x1ff)](_0x1f05db);if(_0x191303){const _0x36ff8b=_0x191303[0x1],_0x500c7e=_0x191303[0x2],_0x5110c0=Number[_0x593213(0x221)](_0x36ff8b??_0x500c7e??'',_0x36ff8b?0x10:0xa);if(isValidXmlCharacter(_0x5110c0))return String[_0x593213(0x218)](_0x5110c0);}return _0x18a851=!![],'';});return _0x18a851?null:_0x20db1e;}function isValidXmlCharacter(_0x2b2177){return _0x2b2177===0x9||_0x2b2177===0xa||_0x2b2177===0xd||_0x2b2177>=0x20&&_0x2b2177<=0xd7ff||_0x2b2177>=0xe000&&_0x2b2177<=0xfffd||_0x2b2177>=0x10000&&_0x2b2177<=0x10ffff;}export function detectSqlType(_0x233cff){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x233cff));}function detectNormalizedSqlType(_0x4c8393){const _0x2af8d5=a240_0x417021;if(_0x4c8393[_0x2af8d5(0x214)])return{'type':_0x2af8d5(0x21a),'isSelectOnly':![],'isDangerous':![],'reason':_0x4c8393[_0x2af8d5(0x214)]};if(!_0x4c8393['sql'][_0x2af8d5(0x20c)]())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x2af8d5(0x246)};const _0x57cbfd=stripStaticAnalysisMarkers(_0x4c8393[_0x2af8d5(0x1ec)])[_0x2af8d5(0x1ef)](/#\{[^}]*\}/g,'?')[_0x2af8d5(0x1ef)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x2af8d5(0x1ef)](/\/\*[\s\S]*?\*\//g,'')[_0x2af8d5(0x20c)](),_0xbbd47b=_0x57cbfd[_0x2af8d5(0x21e)]('\x0a');let _0xda1a2='';for(const _0xf3c479 of _0xbbd47b){const _0x4b77dd=_0xf3c479[_0x2af8d5(0x20c)]();if(!_0x4b77dd||_0x4b77dd[_0x2af8d5(0x248)]('--')||_0x4b77dd['startsWith']('/*'))continue;_0xda1a2=_0x4b77dd;break;}const _0x46c37f=_0xda1a2[_0x2af8d5(0x211)](),_0x1672fc=_0x4c8393['statementType'],_0x2d781b=maskSqlTextForBlockedKeywordScan(_0x57cbfd),_0x2b0a4a=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2af8d5(0x233)](_0x2d781b);if(_0x1672fc===_0x2af8d5(0x201)||!_0x1672fc&&(_0x46c37f['startsWith'](_0x2af8d5(0x201))||_0x46c37f[_0x2af8d5(0x248)](_0x2af8d5(0x1f7)))){const _0x27b8c3=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x2af8d5(0x233)](_0x57cbfd);return{'type':_0x2af8d5(0x201),'isSelectOnly':!_0x27b8c3,'isDangerous':_0x27b8c3,'reason':_0x27b8c3?_0x2af8d5(0x1f8):undefined};}if(_0x1672fc===_0x2af8d5(0x22b)||!_0x1672fc&&_0x46c37f[_0x2af8d5(0x248)]('INSERT'))return{'type':_0x2af8d5(0x22b),'isSelectOnly':![],'isDangerous':_0x2b0a4a,'reason':_0x2b0a4a?_0x2af8d5(0x22c):undefined};if(_0x1672fc===_0x2af8d5(0x23c)||!_0x1672fc&&_0x46c37f[_0x2af8d5(0x248)](_0x2af8d5(0x23c)))return{'type':_0x2af8d5(0x23c),'isSelectOnly':![],'isDangerous':_0x2b0a4a,'reason':_0x2b0a4a?_0x2af8d5(0x22c):undefined};if(_0x1672fc==='DELETE'||!_0x1672fc&&_0x46c37f['startsWith'](_0x2af8d5(0x23a)))return{'type':_0x2af8d5(0x23a),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2af8d5(0x224)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x2af8d5(0x233)](_0x46c37f))return{'type':_0x2af8d5(0x23e),'isSelectOnly':![],'isDangerous':!![],'reason':_0x2af8d5(0x217)};return{'type':_0x2af8d5(0x21a),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x2a9c7b){const _0x20c9c4=a240_0x417021;return _0x2a9c7b[_0x20c9c4(0x23b)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x20c9c4(0x23b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x20c9c4(0x23b)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x213eea){const _0xd7aa67=a240_0x417021;return _0x213eea[_0xd7aa67(0x1ef)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0xd7aa67(0x1ef)](/"(?:""|\\.|[^"])*"/g,'\x20')[_0xd7aa67(0x1ef)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0xd7aa67(0x1ef)](/--.*$/gm,'\x20')[_0xd7aa67(0x1ef)](/#.*$/gm,'\x20')[_0xd7aa67(0x1ef)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x10085d){const _0x54b9a5=a240_0x417021,_0x54fa02=_0x10085d[_0x54b9a5(0x1ef)](/#\{[^}]*\}/g,'?')[_0x54b9a5(0x1ef)](/\$\{[^}]*\}/g,'?')[_0x54b9a5(0x1ef)](/'[^']*'/g,'\x27\x27')[_0x54b9a5(0x1ef)](/--.*$/gm,'')[_0x54b9a5(0x1ef)](/\/\*[\s\S]*?\*\//g,''),_0x3b57d6=[],_0x1b4ac4=_0x54fa02[_0x54b9a5(0x1fd)](/FROM\s+([^\s,)(]+)/i);addTable(_0x3b57d6,_0x1b4ac4?.[0x1]);for(const _0x5534b1 of _0x54fa02[_0x54b9a5(0x1fc)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x3b57d6,_0x5534b1[0x1]);}const _0x1f2c1c=_0x54fa02['match'](/INTO\s+([^\s(]+)/i);addTable(_0x3b57d6,_0x1f2c1c?.[0x1]);const _0x42c5c8=_0x54fa02[_0x54b9a5(0x1fd)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x3b57d6,_0x42c5c8?.[0x1]),_0x3b57d6;}function addTable(_0x5ea236,_0x182cd2){const _0x4bc8db=a240_0x417021,_0x38c5ca=_0x182cd2?.[_0x4bc8db(0x1ef)](/[`"]/g,'');_0x38c5ca&&_0x38c5ca!==UNRESOLVED_SQL_FRAGMENT&&!_0x5ea236[_0x4bc8db(0x229)](_0x38c5ca)&&_0x5ea236[_0x4bc8db(0x249)](_0x38c5ca);}function extractParameters(_0x4f32cd){const _0x4fb04f=a240_0x417021,_0x542d74=new Set();for(const _0x4dc8ad of _0x4f32cd['matchAll'](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x4dc8ad[0x1])_0x542d74[_0x4fb04f(0x238)](_0x4dc8ad[0x1]);}return Array[_0x4fb04f(0x241)](_0x542d74);}export function validateSql(_0x3cab73){const _0x55102c=a240_0x417021,_0x3973f6=normalizeSqlForStaticAnalysis(_0x3cab73),_0x4f62a2=detectNormalizedSqlType(_0x3973f6),_0x2e4a66=stripStaticAnalysisMarkers(_0x3973f6['sql']),_0x4081c5=_0x3973f6[_0x55102c(0x214)]?[]:extractTables(_0x2e4a66),_0x31656f=_0x3973f6[_0x55102c(0x214)]?[]:extractParameters(_0x2e4a66);if(_0x4f62a2[_0x55102c(0x215)])return{'valid':![],'sqlType':_0x4f62a2,'tables':_0x4081c5,'parameters':_0x31656f,'message':_0x4f62a2[_0x55102c(0x219)]||_0x4f62a2[_0x55102c(0x1f2)]+'\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.'};if(_0x4f62a2[_0x55102c(0x1f2)]===_0x55102c(0x21a))return{'valid':![],'sqlType':_0x4f62a2,'tables':_0x4081c5,'parameters':_0x31656f,'message':_0x3973f6[_0x55102c(0x214)]?_0x55102c(0x22f)+_0x3973f6['error']:_0x55102c(0x22e)};return{'valid':!![],'sqlType':_0x4f62a2,'tables':_0x4081c5,'parameters':_0x31656f,'message':_0x4f62a2[_0x55102c(0x1f2)]+_0x55102c(0x226)+(_0x4081c5[_0x55102c(0x23f)]?_0x4081c5[_0x55102c(0x23d)](',\x20'):_0x55102c(0x225))+(_0x31656f[_0x55102c(0x23f)]?_0x55102c(0x204)+_0x31656f['join'](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a241_0x465abb=a241_0x3af2;(function(_0x33f0dd,_0x187369){const _0x475730=a241_0x3af2,_0x54c5ed=_0x33f0dd();while(!![]){try{const _0x2fde5a=parseInt(_0x475730(0xd6))/0x1*(parseInt(_0x475730(0xec))/0x2)+-parseInt(_0x475730(0xea))/0x3*(parseInt(_0x475730(0xe9))/0x4)+parseInt(_0x475730(0xe3))/0x5+parseInt(_0x475730(0xe1))/0x6+parseInt(_0x475730(0xe6))/0x7*(parseInt(_0x475730(0xda))/0x8)+-parseInt(_0x475730(0xe5))/0x9+parseInt(_0x475730(0xdd))/0xa*(-parseInt(_0x475730(0xd4))/0xb);if(_0x2fde5a===_0x187369)break;else _0x54c5ed['push'](_0x54c5ed['shift']());}catch(_0x64c8e){_0x54c5ed['push'](_0x54c5ed['shift']());}}}(a241_0x256f,0xd97ba));import{CliError,createCliErrors}from'@lovrabet/cli-framework';function a241_0x256f(){const _0x5be927=['11BXvaym','Set\x20appcode\x20via\x20`','961cqsPxr','Missing\x20required\x20flag:\x20--','\x20--help`\x20to\x20see\x20available\x20commands.','Authentication\x20required','832176AkNSnX','\x20auth`\x20to\x20login\x20first.','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.','27001710IZaYBp','network_error','auth_required','Configuration\x20file\x20not\x20found','9713328bdOcrV','Operation\x20cancelled.','5496630MeszwV','apiError','441126hkqDvS','119CdMPQz','Run\x20`','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','6407756xvfsmD','3GqCSEi','flag_missing','1572MBQiUV','cancelled'];a241_0x256f=function(){return _0x5be927;};return a241_0x256f();}import{CLI_BIN_NAME}from'./constant/cli.js';function a241_0x3af2(_0x52a370,_0x3d7ef2){_0x52a370=_0x52a370-0xd4;const _0x256f76=a241_0x256f();let _0x3af220=_0x256f76[_0x52a370];return _0x3af220;}export{CliError};const baseCliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a241_0x465abb(0xe7)+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':a241_0x465abb(0xd5)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`'+CLI_BIN_NAME+a241_0x465abb(0xdc),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});export const CliErrors={'authRequired'(_0x552392){const _0x44986d=a241_0x465abb;return new CliError(_0x44986d(0xdf),0x1,_0x44986d(0xd9),_0x552392??'Run\x20`'+CLI_BIN_NAME+_0x44986d(0xdb));},'configMissing'(_0x4cfb4f){const _0x311155=a241_0x465abb;return new CliError('config_missing',0x1,_0x311155(0xe0),_0x4cfb4f??_0x311155(0xd5)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.\x0a\x20\x20\x20\x20\x20\x20\x20Tip:\x20`'+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20<code>\x20--global`\x20registers\x20a\x20reusable\x20global\x20app\x20profile.');},'notInProject'(){const _0x5242a9=a241_0x465abb;return new CliError('not_in_project',0x1,'Not\x20in\x20a\x20'+CLI_BIN_NAME+'\x20project\x20directory',_0x5242a9(0xe8));},'apiError'(_0x302746,_0xd692c4){const _0x4d8b9f=a241_0x465abb;return baseCliErrors[_0x4d8b9f(0xe4)](_0x302746,_0xd692c4);},'networkError'(_0x12afd6){const _0xc4712=a241_0x465abb;return new CliError(_0xc4712(0xde),0x2,'Network\x20error:\x20'+_0x12afd6,'Check\x20your\x20internet\x20connection\x20and\x20try\x20again.');},'unknownCommand'(_0x48d02b){const _0x10318c=a241_0x465abb;return new CliError('unknown_command',0x1,'Unknown\x20command:\x20'+_0x48d02b,'Run\x20`'+CLI_BIN_NAME+_0x10318c(0xd8));},'flagMissing'(_0x2ff1b0,_0x12fc29){const _0x44e40b=a241_0x465abb;return new CliError(_0x44e40b(0xeb),0x1,_0x44e40b(0xd7)+_0x2ff1b0,_0x12fc29);},'validation'(_0x400d48,_0x2c7fbf){return baseCliErrors['validation'](_0x400d48,_0x2c7fbf);},'cancelled'(_0x1783e4){const _0xe5f646=a241_0x465abb;return new CliError(_0xe5f646(0xed),0x0,_0x1783e4??_0xe5f646(0xe2));}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a242_0x4acc(_0x25f563,_0x329a51){_0x25f563=_0x25f563-0x1b0;const _0x35163f=a242_0x3516();let _0x4acca9=_0x35163f[_0x25f563];return _0x4acca9;}(function(_0x35f59d,_0xf18fa){const _0x7f7159=a242_0x4acc,_0x4b838e=_0x35f59d();while(!![]){try{const _0x109b19=-parseInt(_0x7f7159(0x1b0))/0x1+-parseInt(_0x7f7159(0x1bc))/0x2*(parseInt(_0x7f7159(0x1b1))/0x3)+parseInt(_0x7f7159(0x1b8))/0x4*(-parseInt(_0x7f7159(0x1bb))/0x5)+parseInt(_0x7f7159(0x1b7))/0x6*(parseInt(_0x7f7159(0x1b3))/0x7)+-parseInt(_0x7f7159(0x1b9))/0x8+parseInt(_0x7f7159(0x1b2))/0x9+parseInt(_0x7f7159(0x1b5))/0xa;if(_0x109b19===_0xf18fa)break;else _0x4b838e['push'](_0x4b838e['shift']());}catch(_0x3827b1){_0x4b838e['push'](_0x4b838e['shift']());}}}(a242_0x3516,0x45f02));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a242_0x59342a}from'@lovrabet/cli-framework';function a242_0x3516(){const _0x333e36=['yes','9787050FPZfbo','map','1307994bvjKAp','956IvxjzN','4456768rCVPWt','name','3555XsFmop','7170DgHOKt','238892SavciW','9CAcRJn','597906DCohPr','7YGHNVV'];a242_0x3516=function(){return _0x333e36;};return a242_0x3516();}import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x36b857){const _0x496fe2=a242_0x4acc,_0x35af50=a242_0x59342a(_0x36b857,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x36b857))return _0x35af50;return _0x35af50[_0x496fe2(0x1b6)](_0x5f4ac3=>_0x5f4ac3[_0x496fe2(0x1ba)]===_0x496fe2(0x1b4)?{..._0x5f4ac3,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x5f4ac3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ea265,_0x3b548a){var _0x1f065f=a243_0x5ae4,_0x260b07=_0x4ea265();while(!![]){try{var _0xe3f52c=parseInt(_0x1f065f(0xc0))/0x1*(parseInt(_0x1f065f(0xba))/0x2)+parseInt(_0x1f065f(0xbe))/0x3+parseInt(_0x1f065f(0xc1))/0x4+-parseInt(_0x1f065f(0xbc))/0x5+-parseInt(_0x1f065f(0xb9))/0x6*(parseInt(_0x1f065f(0xb7))/0x7)+parseInt(_0x1f065f(0xc2))/0x8+-parseInt(_0x1f065f(0xb5))/0x9*(parseInt(_0x1f065f(0xbf))/0xa);if(_0xe3f52c===_0x3b548a)break;else _0x260b07['push'](_0x260b07['shift']());}catch(_0x1529af){_0x260b07['push'](_0x260b07['shift']());}}}(a243_0x1e87,0xf1ba1));function a243_0x1e87(){var _0x5b6024=['1709680rrYHCQ','compress','def','45cCRfuv','defaultFormat','1453739JPxvKk','structuredErrors','6ypPpvG','514pknZOG','flags','4561130tooBgp','format','1986030ujpERF','2184790TJVmKD','3598gksruT','5608020MGtqNs'];a243_0x1e87=function(){return _0x5b6024;};return a243_0x1e87();}function a243_0x5ae4(_0x364dc1,_0x5c5328){_0x364dc1=_0x364dc1-0xb4;var _0x1e8751=a243_0x1e87();var _0x5ae464=_0x1e8751[_0x364dc1];return _0x5ae464;}import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x1dc82b){var _0x141e55=a243_0x5ae4;return _0x1dc82b?.[_0x141e55(0xb8)]===!![];}export function resolveErrorOutputFormat(_0x8ecf58){var _0x10422d=a243_0x5ae4;if(!_0x8ecf58[_0x10422d(0xb4)])return _0x8ecf58[_0x10422d(0xb6)]??_0x10422d(0xc3);return resolveOutputConfig({'flags':_0x8ecf58[_0x10422d(0xbb)]??{},'def':_0x8ecf58['def'],'configDefault':_0x8ecf58['defaultFormat']})[_0x10422d(0xbd)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a244_0x4d9b(_0x4ecdf8,_0x25725f){_0x4ecdf8=_0x4ecdf8-0x19c;const _0xb759c5=a244_0xb759();let _0x4d9b72=_0xb759c5[_0x4ecdf8];return _0x4d9b72;}const a244_0x596a04=a244_0x4d9b;(function(_0xed96c2,_0x2d9ff0){const _0xde4386=a244_0x4d9b,_0x2180c8=_0xed96c2();while(!![]){try{const _0x1f466c=-parseInt(_0xde4386(0x1ac))/0x1*(parseInt(_0xde4386(0x1aa))/0x2)+parseInt(_0xde4386(0x19d))/0x3*(parseInt(_0xde4386(0x1a2))/0x4)+parseInt(_0xde4386(0x19f))/0x5*(-parseInt(_0xde4386(0x1a7))/0x6)+parseInt(_0xde4386(0x1a4))/0x7+-parseInt(_0xde4386(0x1a8))/0x8*(-parseInt(_0xde4386(0x1a0))/0x9)+-parseInt(_0xde4386(0x1ab))/0xa+parseInt(_0xde4386(0x1a5))/0xb;if(_0x1f466c===_0x2d9ff0)break;else _0x2180c8['push'](_0x2180c8['shift']());}catch(_0x3a5d4f){_0x2180c8['push'](_0x2180c8['shift']());}}}(a244_0xb759,0xaad71));const EXPLICIT_YES_COMMANDS=new Set([a244_0x596a04(0x19e),a244_0x596a04(0x19c),'notification\x20config-update',a244_0x596a04(0x1a9)]);export const EXPLICIT_YES_FLAG_DESCRIPTION=a244_0x596a04(0x1a6);function a244_0xb759(){const _0x18c98e=['8030050JRWBEa','898438zdplVN','service','kb\x20delete','924582hHuNbi','menu\x20delete','35RHFKaZ','19962XYMwVT','has','4RIVnGl','command','3452148XDFyFN','20299411DqvUJB','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','413898SDVfGU','856HLWsEb','notification\x20config-delete','2WTGUKB'];a244_0xb759=function(){return _0x18c98e;};return a244_0xb759();}export function requiresExplicitYes(_0x2532e2){const _0xdf5c6b=a244_0x596a04;return EXPLICIT_YES_COMMANDS[_0xdf5c6b(0x1a1)](_0x2532e2[_0xdf5c6b(0x1ad)]+'\x20'+_0x2532e2[_0xdf5c6b(0x1a3)]);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x4da517=a245_0x4358;(function(_0x31381e,_0x2b8427){const _0x4414ef=a245_0x4358,_0x4f516b=_0x31381e();while(!![]){try{const _0x343a87=-parseInt(_0x4414ef(0xa5))/0x1+parseInt(_0x4414ef(0xaf))/0x2+-parseInt(_0x4414ef(0xa7))/0x3*(parseInt(_0x4414ef(0xad))/0x4)+parseInt(_0x4414ef(0xa9))/0x5*(parseInt(_0x4414ef(0xab))/0x6)+parseInt(_0x4414ef(0xa8))/0x7*(-parseInt(_0x4414ef(0xa6))/0x8)+-parseInt(_0x4414ef(0xac))/0x9+parseInt(_0x4414ef(0xae))/0xa;if(_0x343a87===_0x2b8427)break;else _0x4f516b['push'](_0x4f516b['shift']());}catch(_0x2eca9b){_0x4f516b['push'](_0x4f516b['shift']());}}}(a245_0x69bd,0x917c2));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a245_0x4358(_0x103fab,_0x3a6b52){_0x103fab=_0x103fab-0xa5;const _0x69bda0=a245_0x69bd();let _0x43585f=_0x69bda0[_0x103fab];return _0x43585f;}const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers['parseFlags'];export const validateFlags=helpers[a245_0x4da517(0xaa)];function a245_0x69bd(){const _0x1db03e=['374932MJibRe','16451110rmPwBs','149820NYElsL','184289UBaYzv','592JAMOyI','6YfsTpx','89516waZCsw','1395XKHkLU','validateFlags','10314ugsoqz','2570841sipuiO'];a245_0x69bd=function(){return _0x1db03e;};return a245_0x69bd();}
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5470de,_0x537c07){const _0x21c4d5=a246_0x3359,_0xfcb11a=_0x5470de();while(!![]){try{const _0x3a10c2=-parseInt(_0x21c4d5(0xbc))/0x1+-parseInt(_0x21c4d5(0xb7))/0x2+parseInt(_0x21c4d5(0xb8))/0x3*(-parseInt(_0x21c4d5(0xb5))/0x4)+-parseInt(_0x21c4d5(0xba))/0x5*(-parseInt(_0x21c4d5(0xb0))/0x6)+parseInt(_0x21c4d5(0xb4))/0x7+-parseInt(_0x21c4d5(0xad))/0x8*(-parseInt(_0x21c4d5(0xb6))/0x9)+parseInt(_0x21c4d5(0xb2))/0xa;if(_0x3a10c2===_0x537c07)break;else _0xfcb11a['push'](_0xfcb11a['shift']());}catch(_0xc89a5c){_0xfcb11a['push'](_0xfcb11a['shift']());}}}(a246_0x3293,0x47d6c));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';function a246_0x3359(_0x4f0848,_0x272c5a){_0x4f0848=_0x4f0848-0xad;const _0x3293c6=a246_0x3293();let _0x335959=_0x3293c6[_0x4f0848];return _0x335959;}import{requiresExplicitYes}from'../framework/explicit-yes.js';function createGenerators(){const _0x1c4bfa=a246_0x3359;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x2e25f0=>serviceGroups['get'](_0x2e25f0),'buildAllFlags':buildAllFlags,'appPrerequisiteText':'Requires\x20appcode\x20(set\x20via\x20`'+CLI_BIN_NAME+'\x20workspace\x20init`\x20or\x20--appcode).','serviceUsageSuffix':_0x1c4bfa(0xbb)});}export function generateCommandHelp(_0x4b8a3a){const _0x3cf8bf=a246_0x3359,_0x5d037a=createGenerators()['generateCommandHelp'](_0x4b8a3a);if(!requiresExplicitYes(_0x4b8a3a))return _0x5d037a;return _0x5d037a[_0x3cf8bf(0xb3)](_0x3cf8bf(0xb1),_0x3cf8bf(0xaf));}function a246_0x3293(){const _0x5a5782=['8ckqJjY','213831KxcsMR','1060852rcxMNL','520824ieHBlu','generateServiceHelp','29355qesAHe','\x20[args]\x20[flags]','173219NZgbDs','56rnjFui','generateFullHelp','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','270nIffRp','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','5418540iKiNWp','replace','2609257SpUsqs'];a246_0x3293=function(){return _0x5a5782;};return a246_0x3293();}export function generateServiceHelp(_0x1c55bb){const _0x1e2d7b=a246_0x3359;return createGenerators()[_0x1e2d7b(0xb9)](_0x1c55bb);}export function generateFullHelp(){const _0x2f04ce=a246_0x3359;return createGenerators()[_0x2f04ce(0xae)]();}
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4681d4,_0x22af3b){var _0x517bc6=a247_0x1ad5,_0xc1b17e=_0x4681d4();while(!![]){try{var _0x2a7caa=parseInt(_0x517bc6(0x1dd))/0x1*(-parseInt(_0x517bc6(0x1d6))/0x2)+parseInt(_0x517bc6(0x1df))/0x3+-parseInt(_0x517bc6(0x1d8))/0x4*(-parseInt(_0x517bc6(0x1d5))/0x5)+-parseInt(_0x517bc6(0x1da))/0x6*(-parseInt(_0x517bc6(0x1dc))/0x7)+parseInt(_0x517bc6(0x1de))/0x8+-parseInt(_0x517bc6(0x1d7))/0x9+parseInt(_0x517bc6(0x1db))/0xa*(parseInt(_0x517bc6(0x1d9))/0xb);if(_0x2a7caa===_0x22af3b)break;else _0xc1b17e['push'](_0xc1b17e['shift']());}catch(_0x57b0da){_0xc1b17e['push'](_0xc1b17e['shift']());}}}(a247_0x2db5,0x4f1c4));function a247_0x1ad5(_0x3a81ff,_0x36f7d8){_0x3a81ff=_0x3a81ff-0x1d5;var _0x2db552=a247_0x2db5();var _0x1ad559=_0x2db552[_0x3a81ff];return _0x1ad559;}export{runCommand}from'../framework/runner.js';function a247_0x2db5(){var _0x218b9e=['4914891WMOeeg','3532YZNCTX','11chtcNI','154086uahFPn','8738060RGMnfr','49rZUCmX','161555IQjSSQ','869824WXWVZf','185343mLxKQp','1655WkMgVJ','8bZKQmJ'];a247_0x2db5=function(){return _0x218b9e;};return a247_0x2db5();}export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|