@lovrabet/rabetbase-cli 2.4.2 → 2.4.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/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/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/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/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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.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/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/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/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.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/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +8 -4
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1faa75,_0x31b902){const _0x492644=a225_0x559c,_0xbc038d=_0x1faa75();while(!![]){try{const _0x45473a=-parseInt(_0x492644(0x1c9))/0x1*(parseInt(_0x492644(0x1bf))/0x2)+-parseInt(_0x492644(0x1ce))/0x3*(parseInt(_0x492644(0x1c3))/0x4)+parseInt(_0x492644(0x1cd))/0x5+parseInt(_0x492644(0x1c6))/0x6+-parseInt(_0x492644(0x1c2))/0x7+parseInt(_0x492644(0x1bb))/0x8*(-parseInt(_0x492644(0x1ba))/0x9)+parseInt(_0x492644(0x1d2))/0xa;if(_0x45473a===_0x31b902)break;else _0xbc038d['push'](_0xbc038d['shift']());}catch(_0x5bf4a0){_0xbc038d['push'](_0xbc038d['shift']());}}}(a225_0x5cfa,0xe6cea));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2859ff){const _0x4daf3d=a225_0x559c;if(cache[_0x4daf3d(0x1c5)](_0x2859ff))return cache[_0x4daf3d(0x1b9)](_0x2859ff);const _0x11a17c=await listDatasets(_0x2859ff),_0x2d5bc1=new Map();for(const _0x3a89d5 of _0x11a17c){const _0x1eeac0=_0x3a89d5[_0x4daf3d(0x1c1)];_0x1eeac0?.[_0x4daf3d(0x1cf)]!=null&&_0x2d5bc1[_0x4daf3d(0x1b6)](_0x1eeac0[_0x4daf3d(0x1cf)],_0x1eeac0['dbName']??_0x4daf3d(0x1b4)+_0x1eeac0['dbId']);}const _0x2709ea=[..._0x2d5bc1['entries']()][_0x4daf3d(0x1ca)](([_0x590c21,_0xb6902c])=>({'dbId':_0x590c21,'dbName':_0xb6902c}));return cache[_0x4daf3d(0x1b6)](_0x2859ff,_0x2709ea),_0x2709ea;}export async function resolveDb(_0x5effbd,_0x168388){const _0x6efaef=a225_0x559c,_0x1e6ae6=await listDatabases(_0x5effbd);if(_0x1e6ae6[_0x6efaef(0x1b7)]===0x0)return{'resolved':[],'error':_0x6efaef(0x1b5)+_0x5effbd+_0x6efaef(0x1d0)};if(!_0x168388)return{'resolved':_0x1e6ae6};const _0x136b59=Number(_0x168388);if(!Number['isNaN'](_0x136b59)){const _0x4c46f1=_0x1e6ae6[_0x6efaef(0x1c8)](_0x21f71a=>_0x21f71a[_0x6efaef(0x1cf)]===_0x136b59);if(_0x4c46f1)return{'resolved':[_0x4c46f1]};}const _0x562e94=_0x168388[_0x6efaef(0x1c7)](),_0x53c915=_0x1e6ae6[_0x6efaef(0x1cc)](_0x7f0008=>_0x7f0008[_0x6efaef(0x1c4)][_0x6efaef(0x1c7)]()[_0x6efaef(0x1cb)](_0x562e94));if(_0x53c915[_0x6efaef(0x1b7)]>0x0)return{'resolved':_0x53c915};const _0x26a52f=_0x1e6ae6[_0x6efaef(0x1ca)](_0x58de5e=>_0x58de5e[_0x6efaef(0x1c4)]+'\x20('+_0x58de5e[_0x6efaef(0x1cf)]+')')[_0x6efaef(0x1bc)](',\x20');return{'resolved':[],'error':_0x6efaef(0x1bd)+_0x168388+_0x6efaef(0x1c0)+_0x5effbd+_0x6efaef(0x1be)+_0x26a52f+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}export async function resolveOneDb(_0x24c9b2,_0x1b6712){const _0xcb4d97=a225_0x559c,{resolved:_0x1ec26a,error:_0x2a760a}=await resolveDb(_0x24c9b2,_0x1b6712);if(_0x2a760a)return{'db':null,'error':_0x2a760a};if(_0x1ec26a[_0xcb4d97(0x1b7)]===0x1)return{'db':_0x1ec26a[0x0]};if(!_0x1b6712){const _0x53ca19=_0x1ec26a[_0xcb4d97(0x1ca)](_0x32392f=>_0x32392f[_0xcb4d97(0x1c4)]+'\x20('+_0x32392f['dbId']+')')[_0xcb4d97(0x1bc)](',\x20');return{'db':null,'error':_0xcb4d97(0x1d1)+_0x53ca19};}const _0x546cc0=_0x1ec26a[_0xcb4d97(0x1ca)](_0x5e90d3=>_0x5e90d3['dbName']+'\x20('+_0x5e90d3[_0xcb4d97(0x1cf)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x1b6712+_0xcb4d97(0x1b8)+_0x546cc0+'.\x20Be\x20more\x20specific.'};}function a225_0x559c(_0x53dd38,_0x4dee05){_0x53dd38=_0x53dd38-0x1b4;const _0x5cfa48=a225_0x5cfa();let _0x559c69=_0x5cfa48[_0x53dd38];return _0x559c69;}export async function getDbName(_0x4f0f74,_0x5164fa){const _0x5dce47=a225_0x559c,_0x5eb76c=await listDatabases(_0x4f0f74);return _0x5eb76c[_0x5dce47(0x1c8)](_0x4dd9b4=>_0x4dd9b4[_0x5dce47(0x1cf)]===_0x5164fa)?.[_0x5dce47(0x1c4)];}function a225_0x5cfa(){const _0x46e2e4=['621848JkYKjR','map','includes','filter','5742345Wsadod','75KWSGKH','dbId','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','38283790TGfHsM','db-','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','set','length','\x22\x20matches\x20multiple\x20databases:\x20','get','95859tERvPG','1312dblgpa','join','No\x20database\x20matching\x20\x22','\x22.\x20Available:\x20','2TLjSMa','\x22\x20under\x20app\x20\x22','dbtableConfig','13002892XZrwcM','93836xGWOLs','dbName','has','4687086GQKBMw','toLowerCase','find'];a225_0x5cfa=function(){return _0x46e2e4;};return a225_0x5cfa();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x98b6e,_0x3ea448){const _0x42a12d=a226_0x559f,_0x459582=_0x98b6e();while(!![]){try{const _0x408ab3=-parseInt(_0x42a12d(0x1e7))/0x1*(-parseInt(_0x42a12d(0x1f1))/0x2)+-parseInt(_0x42a12d(0x1e6))/0x3*(parseInt(_0x42a12d(0x1ec))/0x4)+-parseInt(_0x42a12d(0x1f0))/0x5*(parseInt(_0x42a12d(0x1e0))/0x6)+-parseInt(_0x42a12d(0x1e8))/0x7*(-parseInt(_0x42a12d(0x1e4))/0x8)+parseInt(_0x42a12d(0x1e5))/0x9*(parseInt(_0x42a12d(0x1e9))/0xa)+parseInt(_0x42a12d(0x1e3))/0xb*(-parseInt(_0x42a12d(0x1eb))/0xc)+parseInt(_0x42a12d(0x1ea))/0xd;if(_0x408ab3===_0x3ea448)break;else _0x459582['push'](_0x459582['shift']());}catch(_0x3c708f){_0x459582['push'](_0x459582['shift']());}}}(a226_0x43eb,0xb4763));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x42dcb6,_0x5f1c26=process['cwd']()){const _0x2ef3e1=a226_0x559f,_0x952b5e=resolve(_0x5f1c26),_0x29c44d=join(_0x952b5e,_0x2ef3e1(0x1ee),_0x2ef3e1(0x1e1));return{'projectRoot':_0x952b5e,'pagesBaseDir':_0x29c44d,'appPagesDir':join(_0x29c44d,_0x42dcb6),'lockFilePath':join(_0x952b5e,_0x2ef3e1(0x1ee),_0x2ef3e1(0x1e2))};}export function buildPageFileName(_0x32819b,_0x57711e){const _0x4312e3=a226_0x559f;return _0x32819b+'-'+String(_0x57711e)['toUpperCase']()+_0x4312e3(0x1ef);}function a226_0x559f(_0x11d87f,_0x8a5e85){_0x11d87f=_0x11d87f-0x1e0;const _0x43ebdb=a226_0x43eb();let _0x559f68=_0x43ebdb[_0x11d87f];return _0x559f68;}export function resolvePageFilePath(_0xc7a381,_0x10d085,_0x88b5af){const _0x552921=a226_0x559f;return join(_0xc7a381[_0x552921(0x1ed)],buildPageFileName(_0x10d085,_0x88b5af));}export async function ensureParentDirectory(_0x1c7188){await mkdir(dirname(_0x1c7188),{'recursive':!![]});}function a226_0x43eb(){const _0x1fe0f2=['page.lock.json','539cZmKqM','127704cAYAsG','8513118BpJyIv','219IdBqFW','36029JpXNyM','63KNjLra','10zHoSgj','11698141KLXYhY','40260ORyYBt','64060WcPhyE','appPagesDir','.rabetbase','.json','1385275kMOnnA','20zoWcOQ','6axDtij','page'];a226_0x43eb=function(){return _0x1fe0f2;};return a226_0x43eb();}export async function fileExists(_0x4a01f6){try{return await access(_0x4a01f6,constants['F_OK']),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2228e8,_0xf7ea1){const _0xf5d494=a227_0x55bd,_0x182e7a=_0x2228e8();while(!![]){try{const _0x1b4d32=parseInt(_0xf5d494(0x10a))/0x1*(parseInt(_0xf5d494(0x10f))/0x2)+-parseInt(_0xf5d494(0x114))/0x3*(parseInt(_0xf5d494(0x111))/0x4)+parseInt(_0xf5d494(0x118))/0x5+parseInt(_0xf5d494(0x113))/0x6+parseInt(_0xf5d494(0x10c))/0x7+-parseInt(_0xf5d494(0x110))/0x8*(-parseInt(_0xf5d494(0x10b))/0x9)+-parseInt(_0xf5d494(0x115))/0xa;if(_0x1b4d32===_0xf7ea1)break;else _0x182e7a['push'](_0x182e7a['shift']());}catch(_0x2861b6){_0x182e7a['push'](_0x182e7a['shift']());}}}(a227_0x433f,0x6ab08));function a227_0x433f(){const _0x1e0d16=['utf8','1995258CpFbMj','11796wEgxoZ','4182420nrnTPh','update','digest','170345TRrcqq','parse','md5','1AVTjFy','36vblSmS','5368230xQmYVM','stringify','createHash','561424frbYrB','360488JDhmvi','752SAiNgE'];a227_0x433f=function(){return _0x1e0d16;};return a227_0x433f();}import a227_0x14c3fc from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x466f07){const _0x21c369=a227_0x55bd;return JSON[_0x21c369(0x10d)](JSON[_0x21c369(0x119)](_0x466f07),null,0x2)+'\x0a';}export function computePageContentHash(_0x56e4ef){const _0x450f6b=a227_0x55bd;return a227_0x14c3fc[_0x450f6b(0x10e)](_0x450f6b(0x109))[_0x450f6b(0x116)](_0x56e4ef)[_0x450f6b(0x117)]('hex');}export function computeSerializedSchemaHash(_0x4fc2ec){return computePageContentHash(serializePageSchemaForFile(_0x4fc2ec));}function a227_0x55bd(_0x32037f,_0x16ffae){_0x32037f=_0x32037f-0x109;const _0x433fca=a227_0x433f();let _0x55bd64=_0x433fca[_0x32037f];return _0x55bd64;}export async function computePageFileHash(_0x566211){const _0x3d3d11=a227_0x55bd,_0xbe4b90=await readFile(_0x566211,_0x3d3d11(0x112));return computePageContentHash(_0xbe4b90);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2d8c7c,_0x537638){const _0x273a0a=a228_0x5bd4,_0x2dc39b=_0x2d8c7c();while(!![]){try{const _0x329ebc=parseInt(_0x273a0a(0x192))/0x1+parseInt(_0x273a0a(0x19b))/0x2*(parseInt(_0x273a0a(0x19d))/0x3)+-parseInt(_0x273a0a(0x19a))/0x4+parseInt(_0x273a0a(0x199))/0x5+parseInt(_0x273a0a(0x1a1))/0x6+-parseInt(_0x273a0a(0x197))/0x7*(-parseInt(_0x273a0a(0x195))/0x8)+-parseInt(_0x273a0a(0x190))/0x9;if(_0x329ebc===_0x537638)break;else _0x2dc39b['push'](_0x2dc39b['shift']());}catch(_0xaebc62){_0x2dc39b['push'](_0x2dc39b['shift']());}}}(a228_0x5eb2,0x58e38));function a228_0x5bd4(_0x1ff476,_0x15a114){_0x1ff476=_0x1ff476-0x190;const _0x5eb222=a228_0x5eb2();let _0x5bd4c5=_0x5eb222[_0x1ff476];return _0x5bd4c5;}import{mkdir,readFile,writeFile}from'node:fs/promises';function a228_0x5eb2(){const _0x47aead=['3169926alVOlX','apps','17031042ymfWPl','code','211561CSSXOe','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','parse','5976LjiPvX','ENOENT','6265dmredS','pages','3469205SkloNR','1322432zKXtVl','2076xAWjDn','lastSync','1401OfRgoR','stringify','utf8','object'];a228_0x5eb2=function(){return _0x47aead;};return a228_0x5eb2();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x5f247e,_0x208b64){const _0x5bd0c3=a228_0x5bd4,_0x3d9176={'apps':_0x5f247e[_0x5bd0c3(0x1a2)]&&typeof _0x5f247e[_0x5bd0c3(0x1a2)]===_0x5bd0c3(0x1a0)?_0x5f247e[_0x5bd0c3(0x1a2)]:{}};let _0x52b465=_0x3d9176[_0x5bd0c3(0x1a2)][_0x208b64];if(!_0x52b465)return _0x52b465={'lastSync':'','pages':{}},_0x3d9176['apps'][_0x208b64]=_0x52b465,{'lockData':_0x3d9176,'appLock':_0x52b465};return!_0x52b465['lastSync']&&(_0x52b465[_0x5bd0c3(0x19c)]=''),(!_0x52b465[_0x5bd0c3(0x198)]||typeof _0x52b465[_0x5bd0c3(0x198)]!==_0x5bd0c3(0x1a0))&&(_0x52b465['pages']={}),{'lockData':_0x3d9176,'appLock':_0x52b465};}export async function readPageLockFile(_0xde4cc8){const _0x41b24=a228_0x5bd4;try{const _0x411d3d=await readFile(_0xde4cc8,_0x41b24(0x19f)),_0x2e0e97=JSON[_0x41b24(0x194)](_0x411d3d);return{'apps':_0x2e0e97[_0x41b24(0x1a2)]&&typeof _0x2e0e97['apps']==='object'?_0x2e0e97[_0x41b24(0x1a2)]:{}};}catch(_0x132b14){if(_0x132b14[_0x41b24(0x191)]===_0x41b24(0x196))return null;throw new Error(_0x41b24(0x193)+String(_0x132b14));}}export async function writePageLockFile(_0x49b850,_0x38a975){const _0x12b32e=a228_0x5bd4;await mkdir(dirname(_0x49b850),{'recursive':!![]}),await writeFile(_0x49b850,JSON[_0x12b32e(0x19e)](_0x38a975,null,0x2),_0x12b32e(0x19f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x226b8a,_0x575ba2){const _0x57294b=a230_0xe357,_0x4674e9=_0x226b8a();while(!![]){try{const _0x216d91=parseInt(_0x57294b(0x1aa))/0x1*(-parseInt(_0x57294b(0x1a7))/0x2)+parseInt(_0x57294b(0x19b))/0x3*(parseInt(_0x57294b(0x189))/0x4)+-parseInt(_0x57294b(0x1c1))/0x5*(parseInt(_0x57294b(0x1b5))/0x6)+-parseInt(_0x57294b(0x193))/0x7*(parseInt(_0x57294b(0x199))/0x8)+-parseInt(_0x57294b(0x1b9))/0x9+-parseInt(_0x57294b(0x1a4))/0xa+-parseInt(_0x57294b(0x1bd))/0xb*(-parseInt(_0x57294b(0x1a9))/0xc);if(_0x216d91===_0x575ba2)break;else _0x4674e9['push'](_0x4674e9['shift']());}catch(_0x3fc3a4){_0x4674e9['push'](_0x4674e9['shift']());}}}(a230_0x515f,0xf0abf));function a230_0x515f(){const _0x5c8fac=['split','where','slice','152RjUwSe','matchAll','219qAePiy','covered','join','toUpperCase','sql','toLowerCase','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','JOIN_INDEX_NOT_USABLE','match','14858340rzAzDO','metadataAvailable','position','7068cQswSW','index','5077032LdRYgW','227ElQJhV','natural','unknown','unavailable','columns','map','containsUnresolvedInclude','sort','some','includes','reduce','162dEsWXW','unsupportedReason','replace','test','13098393ibNtVs','add','INNER','right','143fdPmKn','replaceAll','inner','indexes','300470VhWjmE','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','__sq__','endsWith','\x5c$&','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','warning','trim','table','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','unsupportedPredicate','max','filter','cross','exec','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','matchedPrefix','91196AKQLdw','from','alias','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','push','INDEX_METADATA_UNAVAILABLE','tableName','JOIN_INDEX_MISSING','length','has','299411AszImq','full','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.'];a230_0x515f=function(){return _0x5c8fac;};return a230_0x515f();}function a230_0xe357(_0x504e70,_0x45a50a){_0x504e70=_0x504e70-0x178;const _0x515fae=a230_0x515f();let _0xe35701=_0x515fae[_0x504e70];return _0xe35701;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x58b8b3,_0x58a921){const _0x18d6f2=a230_0xe357,_0x1b51f2=[],_0x4bff6c=normalizeSqlForStaticAnalysis(_0x58b8b3),_0x3198f8=(_0x4bff6c['error']?[]:extractJoinFacts(_0x4bff6c[_0x18d6f2(0x19f)]))[_0x18d6f2(0x1af)](_0x349ff2=>{const _0x4d89c9=_0x18d6f2;if(_0x349ff2[_0x4d89c9(0x182)]||_0x349ff2[_0x4d89c9(0x1ae)][_0x4d89c9(0x191)]===0x0)return _0x1b51f2[_0x4d89c9(0x18d)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'reason':_0x349ff2[_0x4d89c9(0x1b6)]??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2['alias'],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':_0x4d89c9(0x1ad)};const _0x5bc181=resolveTableMetadata(_0x58a921,_0x349ff2[_0x4d89c9(0x17f)]),_0x98a7c8=(_0x5bc181?.['indexes']??[])['map'](_0x34fc54=>({'index':_0x34fc54,'matchedPrefix':findEqualityPrefix(_0x34fc54[_0x4d89c9(0x1ae)],_0x349ff2[_0x4d89c9(0x1ae)])}))[_0x4d89c9(0x184)](_0x2029e9=>_0x2029e9[_0x4d89c9(0x188)]['length']>0x0),_0x37b63f=_0x98a7c8[_0x4d89c9(0x1b4)]((_0x410e85,_0x3ff86a)=>!_0x410e85||_0x3ff86a['matchedPrefix'][_0x4d89c9(0x191)]>_0x410e85['matchedPrefix']['length']?_0x3ff86a:_0x410e85,_0x98a7c8[0x0]);if(_0x37b63f)return{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':_0x4d89c9(0x19c),'matchedIndex':{..._0x37b63f[_0x4d89c9(0x1a8)],'matchedPrefix':_0x37b63f[_0x4d89c9(0x188)]}};const _0x50218c=_0x5bc181?.[_0x4d89c9(0x1c0)]['filter'](_0x3e34f1=>_0x3e34f1[_0x4d89c9(0x1ae)][_0x4d89c9(0x1b2)](_0x252365=>_0x349ff2['columns'][_0x4d89c9(0x1b2)](_0x481d70=>columnNamesMatch(_0x252365,_0x481d70))))??[];if(_0x50218c[_0x4d89c9(0x191)]>0x0)return _0x1b51f2[_0x4d89c9(0x18d)]({'code':_0x4d89c9(0x1a2),'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'reason':_0x4d89c9(0x17c)}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2['alias'],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':_0x4d89c9(0x17d),'candidateIndexes':_0x50218c};if(_0x5bc181&&_0x5bc181[_0x4d89c9(0x1a5)]!==![]&&_0x5bc181[_0x4d89c9(0x1c0)][_0x4d89c9(0x191)]>0x0&&_0x349ff2[_0x4d89c9(0x1ae)][_0x4d89c9(0x191)]>0x0)return _0x1b51f2[_0x4d89c9(0x18d)]({'code':_0x4d89c9(0x190),'table':_0x349ff2['table'],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2['columns'],'reason':_0x4d89c9(0x1a1)}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':'warning'};return _0x1b51f2[_0x4d89c9(0x18d)]({'code':_0x4d89c9(0x18e),'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'reason':_0x5bc181?_0x4d89c9(0x1c2):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x349ff2[_0x4d89c9(0x17f)],'alias':_0x349ff2[_0x4d89c9(0x18b)],'columns':_0x349ff2[_0x4d89c9(0x1ae)],'status':'unavailable'};});return{'checked':_0x3198f8[_0x18d6f2(0x191)]>0x0,'joins':_0x3198f8,'warnings':_0x1b51f2};}function extractJoinFacts(_0x4f316f){const _0x1eea6c=a230_0xe357,_0x514032=maskNestedQueries(stripSqlNoise(_0x4f316f)),_0x4ee043=maskQuotedIdentifiers(_0x514032),_0xe4bcb1=[],_0x1a4b9e=new Set(),_0x55800b=/\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 _0x3b4868 of _0x514032[_0x1eea6c(0x19a)](_0x55800b)){const _0x57bb82=_0x3b4868[_0x1eea6c(0x1a8)]??0x0,_0x3a38b4=_0x3b4868[0x0]['search'](/\bJOIN\b/i),_0x5472aa=_0x57bb82+Math[_0x1eea6c(0x183)](0x0,_0x3a38b4);if(!/^JOIN\b/i['test'](_0x4ee043['slice'](_0x5472aa)))continue;_0x1a4b9e[_0x1eea6c(0x1ba)](_0x5472aa);const _0x46da82=normalizeIdentifier(_0x3b4868[0x1]||_0x1eea6c(0x1bb)),_0x478d57=normalizeIdentifier(_0x3b4868[0x2]??''),_0x835d40=normalizeIdentifier(_0x3b4868[0x3]||_0x478d57[_0x1eea6c(0x196)]('.')['at'](-0x1)||_0x478d57),_0x21832a=[],_0x155e13=_0x478d57==='__sq__';let _0x5512a2=_0x46da82==='right'||_0x46da82===_0x1eea6c(0x194)||_0x155e13,_0x3ccbd7=_0x5512a2?_0x155e13?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x46da82['toUpperCase']()+_0x1eea6c(0x180):undefined;const _0x19c4e2=stripOuterParentheses(_0x3b4868[0x4]??''),_0x1ceda7=_0x19c4e2[_0x1eea6c(0x1b3)](MYBATIS_DYNAMIC_START_MARKER)||_0x19c4e2['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x159b87=_0x19c4e2[_0x1eea6c(0x1b3)](MYBATIS_INCLUDE_MARKER);_0x1ceda7&&(_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x181));_0x159b87&&(_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x18c));const _0xfce330=_0x19c4e2[_0x1eea6c(0x1be)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1eea6c(0x1be)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0xfce330,'OR')&&(_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x195));for(const _0x32a33e of splitTopLevelAnd(_0xfce330)){const _0x2b81a4=stripOuterParentheses(_0x32a33e);if(hasTopLevelKeyword(_0x2b81a4,'OR')){_0x5512a2=!![],_0x3ccbd7??=_0x1eea6c(0x195);continue;}const _0x475ceb=splitEquality(_0x2b81a4);if(!_0x475ceb){containsColumnReference(_0x32a33e,_0x835d40)&&(_0x5512a2=!![]);continue;}const _0x5ee2d9=parseDirectColumnReference(_0x475ceb[0x0],_0x835d40),_0x262ca2=parseDirectColumnReference(_0x475ceb[0x1],_0x835d40),_0x2808ad=containsColumnReference(_0x475ceb[0x0],_0x835d40),_0x3d0638=containsColumnReference(_0x475ceb[0x1],_0x835d40),_0x2bbfab=_0x5ee2d9&&!_0x3d0638?_0x5ee2d9:_0x262ca2&&!_0x2808ad?_0x262ca2:null;if(_0x2bbfab&&!_0x21832a[_0x1eea6c(0x1b3)](_0x2bbfab))_0x21832a[_0x1eea6c(0x18d)](_0x2bbfab);else!_0x2bbfab&&containsColumnReference(_0x32a33e,_0x835d40)&&(_0x5512a2=!![]);}_0xe4bcb1['push']({'table':_0x478d57,'alias':_0x835d40,'columns':_0x21832a,'unsupportedPredicate':_0x5512a2,'unsupportedReason':_0x3ccbd7,'containsUnresolvedInclude':_0x159b87,'position':_0x5472aa});}for(const _0x142523 of _0x4ee043[_0x1eea6c(0x19a)](/\bJOIN\b/gi)){const _0x1a9672=_0x142523[_0x1eea6c(0x1a8)]??0x0;if(_0x1a4b9e[_0x1eea6c(0x192)](_0x1a9672))continue;const _0x4fceea=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1eea6c(0x186)](_0x514032['slice'](_0x1a9672+_0x142523[0x0][_0x1eea6c(0x191)])),_0x10bdfe=normalizeIdentifier(_0x4fceea?.[0x1]||_0x1eea6c(0x1ac)),_0x263b93=normalizeIdentifier(_0x4fceea?.[0x2]||''),_0x36bf8f=isSqlClauseKeyword(_0x263b93)?_0x10bdfe[_0x1eea6c(0x196)]('.')['at'](-0x1)||_0x10bdfe:_0x263b93||_0x10bdfe[_0x1eea6c(0x196)]('.')['at'](-0x1)||_0x10bdfe;_0xe4bcb1['push']({'table':_0x10bdfe,'alias':_0x36bf8f,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1a9672});}const _0x4867a0=_0x4ee043['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x4867a0>=0x0&&!_0xe4bcb1['some'](_0x4aa2ca=>_0x4aa2ca[_0x1eea6c(0x1b0)])&&_0xe4bcb1[_0x1eea6c(0x18d)]({'table':_0x1eea6c(0x1ac),'alias':_0x1eea6c(0x1ac),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1eea6c(0x187),'containsUnresolvedInclude':!![],'position':_0x4867a0}),_0xe4bcb1[_0x1eea6c(0x1b1)]((_0x4f4992,_0x2faf47)=>_0x4f4992[_0x1eea6c(0x1a6)]-_0x2faf47[_0x1eea6c(0x1a6)]);}function stripSqlNoise(_0x11a700){const _0x116af9=a230_0xe357,_0xfc3b4d=Array[_0x116af9(0x18a)](_0x11a700),_0x1cfb96=(_0x1d4cb8,_0x1e9923)=>{for(let _0x4af386=_0x1d4cb8;_0x4af386<_0x1e9923;_0x4af386+=0x1){_0xfc3b4d[_0x4af386]!=='\x0a'&&_0xfc3b4d[_0x4af386]!=='\x0d'&&(_0xfc3b4d[_0x4af386]='\x20');}};for(let _0x4be2ca=0x0;_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)];_0x4be2ca+=0x1){const _0x4e4841=_0xfc3b4d[_0x4be2ca],_0x204f6c=_0xfc3b4d[_0x4be2ca+0x1];if(_0x4e4841==='\x27'||_0x4e4841==='\x22'||_0x4e4841==='`'){const _0x1641ac=_0x4e4841,_0x72b674=_0x4be2ca;_0x4be2ca+=0x1;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]){if(_0xfc3b4d[_0x4be2ca]==='\x5c'&&_0x4be2ca+0x1<_0xfc3b4d['length']){_0x4be2ca+=0x2;continue;}if(_0xfc3b4d[_0x4be2ca]!==_0x1641ac){_0x4be2ca+=0x1;continue;}if(_0xfc3b4d[_0x4be2ca+0x1]===_0x1641ac){_0x4be2ca+=0x2;continue;}break;}if(_0x1641ac==='\x27')_0x1cfb96(_0x72b674,Math[_0x116af9(0x17b)](_0x4be2ca+0x1,_0xfc3b4d[_0x116af9(0x191)]));continue;}if(_0x4e4841==='-'&&_0x204f6c==='-'){const _0x796a3b=_0x4be2ca;while(_0x4be2ca<_0xfc3b4d['length']&&_0xfc3b4d[_0x4be2ca]!=='\x0a')_0x4be2ca+=0x1;_0x1cfb96(_0x796a3b,_0x4be2ca);continue;}if(_0x4e4841==='/'&&_0x204f6c==='*'){const _0xa8dc12=_0x4be2ca;_0x4be2ca+=0x2;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]&&!(_0xfc3b4d[_0x4be2ca]==='*'&&_0xfc3b4d[_0x4be2ca+0x1]==='/')){_0x4be2ca+=0x1;}_0x4be2ca=Math[_0x116af9(0x17b)](_0x4be2ca+0x1,_0xfc3b4d[_0x116af9(0x191)]-0x1),_0x1cfb96(_0xa8dc12,_0x4be2ca+0x1);continue;}if(_0x4e4841==='#'&&_0x204f6c!=='{'){const _0x16e731=_0x4be2ca;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]&&_0xfc3b4d[_0x4be2ca]!=='\x0a')_0x4be2ca+=0x1;_0x1cfb96(_0x16e731,_0x4be2ca);continue;}if((_0x4e4841==='#'||_0x4e4841==='$')&&_0x204f6c==='{'){const _0xf8bac7=_0x4be2ca;_0x4be2ca+=0x2;while(_0x4be2ca<_0xfc3b4d[_0x116af9(0x191)]&&_0xfc3b4d[_0x4be2ca]!=='}')_0x4be2ca+=0x1;_0x1cfb96(_0xf8bac7,Math[_0x116af9(0x17b)](_0x4be2ca+0x1,_0xfc3b4d['length']));}}return _0xfc3b4d[_0x116af9(0x19d)]('');}function maskQuotedIdentifiers(_0x8a945c){const _0x2eb65a=a230_0xe357,_0x216470=Array[_0x2eb65a(0x18a)](_0x8a945c);for(let _0x3e546f=0x0;_0x3e546f<_0x216470[_0x2eb65a(0x191)];_0x3e546f+=0x1){const _0x28d31e=_0x216470[_0x3e546f];if(_0x28d31e!=='\x22'&&_0x28d31e!=='`')continue;_0x3e546f+=0x1;while(_0x3e546f<_0x216470[_0x2eb65a(0x191)]){if(_0x216470[_0x3e546f]===_0x28d31e){if(_0x216470[_0x3e546f+0x1]===_0x28d31e){_0x216470[_0x3e546f]='\x20',_0x216470[_0x3e546f+0x1]='\x20',_0x3e546f+=0x2;continue;}break;}_0x216470[_0x3e546f]='\x20',_0x3e546f+=0x1;}}return _0x216470[_0x2eb65a(0x19d)]('');}function maskNestedQueries(_0x4a0a37){const _0x3a64e2=a230_0xe357,_0x1f4dba=Array['from'](_0x4a0a37);for(let _0x1334ba=0x0;_0x1334ba<_0x1f4dba[_0x3a64e2(0x191)];_0x1334ba+=0x1){if(_0x1f4dba[_0x1334ba]!=='(')continue;const _0x219b24=_0x4a0a37[_0x3a64e2(0x198)](_0x1334ba+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x3a64e2(0x1b8)](_0x219b24))continue;let _0x35e321=0x1,_0x554708=_0x1334ba+0x1;for(;_0x554708<_0x1f4dba[_0x3a64e2(0x191)]&&_0x35e321>0x0;_0x554708+=0x1){if(_0x1f4dba[_0x554708]==='(')_0x35e321+=0x1;if(_0x1f4dba[_0x554708]===')')_0x35e321-=0x1;}if(_0x35e321!==0x0)continue;for(let _0x4f39a8=_0x1334ba;_0x4f39a8<_0x554708;_0x4f39a8+=0x1){_0x1f4dba[_0x4f39a8]='\x20';}const _0x17f8b5=_0x3a64e2(0x178);for(let _0x117803=0x0;_0x117803<_0x17f8b5[_0x3a64e2(0x191)]&&_0x1334ba+_0x117803<_0x554708;_0x117803+=0x1){_0x1f4dba[_0x1334ba+_0x117803]=_0x17f8b5[_0x117803];}_0x1334ba=_0x554708-0x1;}return _0x1f4dba[_0x3a64e2(0x19d)]('');}function splitTopLevelAnd(_0x2850bc){const _0x55191c=a230_0xe357,_0x454ac6=[];let _0x516b64=0x0,_0x539a6f=0x0;for(let _0x5ba9a5=0x0;_0x5ba9a5<_0x2850bc[_0x55191c(0x191)];_0x5ba9a5+=0x1){const _0x3ce731=_0x2850bc[_0x5ba9a5];if(_0x3ce731==='(')_0x516b64+=0x1;if(_0x3ce731===')')_0x516b64=Math[_0x55191c(0x183)](0x0,_0x516b64-0x1);_0x516b64===0x0&&_0x2850bc[_0x55191c(0x198)](_0x5ba9a5)[_0x55191c(0x1a3)](/^AND\b/i)&&(_0x5ba9a5===0x0||/\s/[_0x55191c(0x1b8)](_0x2850bc[_0x5ba9a5-0x1]??''))&&(_0x454ac6[_0x55191c(0x18d)](_0x2850bc[_0x55191c(0x198)](_0x539a6f,_0x5ba9a5)['trim']()),_0x5ba9a5+=0x2,_0x539a6f=_0x5ba9a5+0x1);}const _0xa0c69a=_0x2850bc[_0x55191c(0x198)](_0x539a6f)[_0x55191c(0x17e)]();if(_0xa0c69a)_0x454ac6['push'](_0xa0c69a);return _0x454ac6;}function hasTopLevelKeyword(_0x566a52,_0x5b339e){const _0x3778f8=a230_0xe357;let _0x2774d5=0x0;for(let _0x20a8f7=0x0;_0x20a8f7<_0x566a52[_0x3778f8(0x191)];_0x20a8f7+=0x1){const _0x52b114=_0x566a52[_0x20a8f7];if(_0x52b114==='(')_0x2774d5+=0x1;if(_0x52b114===')')_0x2774d5=Math[_0x3778f8(0x183)](0x0,_0x2774d5-0x1);if(_0x2774d5!==0x0)continue;const _0x4cb50c=_0x566a52[_0x3778f8(0x198)](_0x20a8f7,_0x20a8f7+_0x5b339e['length']),_0x55f3b3=_0x566a52[_0x20a8f7-0x1]??'\x20',_0x4193ff=_0x566a52[_0x20a8f7+_0x5b339e['length']]??'\x20';if(_0x4cb50c[_0x3778f8(0x19e)]()===_0x5b339e[_0x3778f8(0x19e)]()&&!/[\w$]/['test'](_0x55f3b3)&&!/[\w$]/['test'](_0x4193ff))return!![];}return![];}function splitEquality(_0x1a5197){const _0x22f4d4=a230_0xe357,_0x4226d9=stripOuterParentheses(_0x1a5197);let _0x1d641b=0x0,_0x17d889;for(let _0x354f37=0x0;_0x354f37<_0x4226d9[_0x22f4d4(0x191)];_0x354f37+=0x1){const _0x4641cc=_0x4226d9[_0x354f37];if(_0x4641cc==='(')_0x1d641b+=0x1;if(_0x4641cc===')')_0x1d641b=Math[_0x22f4d4(0x183)](0x0,_0x1d641b-0x1);const _0x2e5a88=_0x4226d9[_0x354f37-0x1]??'',_0x2cd8b5=_0x4226d9[_0x354f37+0x1]??'';if(_0x4641cc==='='&&_0x1d641b===0x0&&!/[!<>=:]/[_0x22f4d4(0x1b8)](_0x2e5a88)&&_0x2cd8b5!=='='){if(_0x17d889!==undefined)return null;_0x17d889=_0x354f37;}}return _0x17d889===undefined?null:[_0x4226d9['slice'](0x0,_0x17d889)[_0x22f4d4(0x17e)](),_0x4226d9['slice'](_0x17d889+0x1)[_0x22f4d4(0x17e)]()];}function parseDirectColumnReference(_0x2f402d,_0x2dd1e0){const _0x112391=a230_0xe357,_0x4fe1db=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x112391(0x186)](stripOuterParentheses(_0x2f402d));if(!_0x4fe1db)return null;if(normalizeIdentifier(_0x4fe1db[0x1]??'')!==normalizeIdentifier(_0x2dd1e0))return null;return normalizeIdentifier(_0x4fe1db[0x2]??'');}function containsColumnReference(_0x5c3691,_0x28faae){const _0x156cb5=a230_0xe357,_0x103d2c=_0x5c3691['replace'](/[`"]/g,''),_0x5a8829=_0x28faae[_0x156cb5(0x1b7)](/[.*+?^${}()|[\]\\]/g,_0x156cb5(0x17a));return new RegExp('(?:^|[^\x5cw$])'+_0x5a8829+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')['test'](_0x103d2c);}function findEqualityPrefix(_0x423db2,_0xfa019e){const _0x598a3a=a230_0xe357,_0xeaec40=new Set(_0xfa019e[_0x598a3a(0x1af)](normalizeIdentifier)),_0xd761d8=[];for(const _0x3c0644 of _0x423db2){if(!_0xeaec40[_0x598a3a(0x192)](normalizeIdentifier(_0x3c0644)))break;_0xd761d8[_0x598a3a(0x18d)](_0x3c0644);}return _0xd761d8;}function resolveTableMetadata(_0x5ee4df,_0xf2adc1){const _0x5ee82b=a230_0xe357,_0x286901=normalizeIdentifier(_0xf2adc1),_0x24810a=_0x5ee4df['filter'](_0x474814=>normalizeIdentifier(_0x474814[_0x5ee82b(0x18f)])===_0x286901);if(_0x24810a[_0x5ee82b(0x191)]===0x1)return _0x24810a[0x0];const _0xe621b5=_0x286901['includes']('.'),_0xa41b4=_0x286901[_0x5ee82b(0x196)]('.')['at'](-0x1),_0x3344c4=_0x5ee4df[_0x5ee82b(0x184)](_0x52c1b1=>{const _0x5e1aeb=_0x5ee82b,_0x34553f=normalizeIdentifier(_0x52c1b1[_0x5e1aeb(0x18f)]);if(_0xe621b5&&_0x34553f[_0x5e1aeb(0x1b3)]('.'))return![];return _0x34553f[_0x5e1aeb(0x196)]('.')['at'](-0x1)===_0xa41b4;});return _0x3344c4[_0x5ee82b(0x191)]===0x1?_0x3344c4[0x0]:undefined;}function columnNamesMatch(_0x6e575a,_0x99a4ac){return normalizeIdentifier(_0x6e575a)===normalizeIdentifier(_0x99a4ac);}function normalizeIdentifier(_0x1e96ee){const _0x5268f8=a230_0xe357;return _0x1e96ee[_0x5268f8(0x1b7)](/[`"]/g,'')[_0x5268f8(0x17e)]()[_0x5268f8(0x1a0)]();}function isSqlClauseKeyword(_0x21bddb){const _0x3faaa8=a230_0xe357;return new Set(['on','using',_0x3faaa8(0x197),_0x3faaa8(0x19d),_0x3faaa8(0x1bf),'left',_0x3faaa8(0x1bc),_0x3faaa8(0x194),_0x3faaa8(0x185),_0x3faaa8(0x1ab)])[_0x3faaa8(0x192)](_0x21bddb);}function stripOuterParentheses(_0x39d677){const _0x511b28=a230_0xe357;let _0x2402e6=_0x39d677[_0x511b28(0x17e)]();while(_0x2402e6['startsWith']('(')&&_0x2402e6[_0x511b28(0x179)](')')){let _0x4cb748=0x0,_0x52f6e8=!![];for(let _0x1eeb78=0x0;_0x1eeb78<_0x2402e6[_0x511b28(0x191)];_0x1eeb78+=0x1){if(_0x2402e6[_0x1eeb78]==='(')_0x4cb748+=0x1;if(_0x2402e6[_0x1eeb78]===')')_0x4cb748-=0x1;if(_0x4cb748===0x0&&_0x1eeb78<_0x2402e6[_0x511b28(0x191)]-0x1){_0x52f6e8=![];break;}}if(!_0x52f6e8||_0x4cb748!==0x0)break;_0x2402e6=_0x2402e6[_0x511b28(0x198)](0x1,-0x1)[_0x511b28(0x17e)]();}return _0x2402e6;}
|
|
1
|
+
function a230_0xdee6(_0x350d35,_0x5ae046){_0x350d35=_0x350d35-0x7b;const _0x57b072=a230_0x57b0();let _0xdee61=_0x57b072[_0x350d35];return _0xdee61;}(function(_0x37335a,_0x2de8c6){const _0x37787b=a230_0xdee6,_0x5534bf=_0x37335a();while(!![]){try{const _0x3a9063=-parseInt(_0x37787b(0x84))/0x1+parseInt(_0x37787b(0xa7))/0x2*(parseInt(_0x37787b(0x7d))/0x3)+-parseInt(_0x37787b(0x7f))/0x4*(-parseInt(_0x37787b(0xa5))/0x5)+parseInt(_0x37787b(0x81))/0x6+-parseInt(_0x37787b(0xc0))/0x7+parseInt(_0x37787b(0xb2))/0x8+-parseInt(_0x37787b(0x93))/0x9*(parseInt(_0x37787b(0x86))/0xa);if(_0x3a9063===_0x2de8c6)break;else _0x5534bf['push'](_0x5534bf['shift']());}catch(_0x32ed9c){_0x5534bf['push'](_0x5534bf['shift']());}}}(a230_0x57b0,0x2906c));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x11b0ce,_0x1c0c81){const _0x3d543e=a230_0xdee6,_0x7dfba1=[],_0x1eef44=normalizeSqlForStaticAnalysis(_0x11b0ce),_0x2fbc8e=(_0x1eef44['error']?[]:extractJoinFacts(_0x1eef44[_0x3d543e(0xb6)]))['map'](_0x430bf4=>{const _0x388292=_0x3d543e;if(_0x430bf4[_0x388292(0xb5)]||_0x430bf4[_0x388292(0x83)][_0x388292(0x89)]===0x0)return _0x7dfba1[_0x388292(0xc7)]({'code':_0x388292(0x9d),'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'reason':_0x430bf4['unsupportedReason']??_0x388292(0xc8)}),{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':'unavailable'};const _0x36feea=resolveTableMetadata(_0x1c0c81,_0x430bf4['table']),_0x349587=(_0x36feea?.[_0x388292(0xb8)]??[])[_0x388292(0xbf)](_0x49f324=>({'index':_0x49f324,'matchedPrefix':findEqualityPrefix(_0x49f324[_0x388292(0x83)],_0x430bf4[_0x388292(0x83)])}))[_0x388292(0xa3)](_0xf76818=>_0xf76818['matchedPrefix'][_0x388292(0x89)]>0x0),_0x1b4e5f=_0x349587['reduce']((_0x1ef49a,_0xd1c2cd)=>!_0x1ef49a||_0xd1c2cd[_0x388292(0xbd)]['length']>_0x1ef49a['matchedPrefix']['length']?_0xd1c2cd:_0x1ef49a,_0x349587[0x0]);if(_0x1b4e5f)return{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':_0x388292(0x91),'matchedIndex':{..._0x1b4e5f[_0x388292(0xbe)],'matchedPrefix':_0x1b4e5f[_0x388292(0xbd)]}};const _0x538f28=_0x36feea?.[_0x388292(0xb8)][_0x388292(0xa3)](_0x453964=>_0x453964[_0x388292(0x83)][_0x388292(0xc9)](_0x36cec9=>_0x430bf4[_0x388292(0x83)][_0x388292(0xc9)](_0x435c4a=>columnNamesMatch(_0x36cec9,_0x435c4a))))??[];if(_0x538f28[_0x388292(0x89)]>0x0)return _0x7dfba1[_0x388292(0xc7)]({'code':_0x388292(0x82),'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4['alias'],'columns':_0x430bf4[_0x388292(0x83)],'reason':_0x388292(0xa0)}),{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':'warning','candidateIndexes':_0x538f28};if(_0x36feea&&_0x36feea[_0x388292(0xbc)]!==![]&&_0x36feea['indexes'][_0x388292(0x89)]>0x0&&_0x430bf4[_0x388292(0x83)][_0x388292(0x89)]>0x0)return _0x7dfba1[_0x388292(0xc7)]({'code':_0x388292(0xa8),'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4['alias'],'columns':_0x430bf4['columns'],'reason':_0x388292(0xb9)}),{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4['columns'],'status':_0x388292(0xc1)};return _0x7dfba1[_0x388292(0xc7)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'reason':_0x36feea?_0x388292(0xab):_0x388292(0xa9)}),{'table':_0x430bf4['table'],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':_0x388292(0x9c)};});return{'checked':_0x2fbc8e[_0x3d543e(0x89)]>0x0,'joins':_0x2fbc8e,'warnings':_0x7dfba1};}function extractJoinFacts(_0x1c6ce4){const _0x17b197=a230_0xdee6,_0x42d3a3=maskNestedQueries(stripSqlNoise(_0x1c6ce4)),_0x17ff4a=maskQuotedIdentifiers(_0x42d3a3),_0x4ebe78=[],_0x1a5f21=new Set(),_0x5952e1=/\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 _0x3236e2 of _0x42d3a3[_0x17b197(0xa2)](_0x5952e1)){const _0x4afd01=_0x3236e2[_0x17b197(0xbe)]??0x0,_0x1932b0=_0x3236e2[0x0][_0x17b197(0x96)](/\bJOIN\b/i),_0x2fb38b=_0x4afd01+Math[_0x17b197(0x8d)](0x0,_0x1932b0);if(!/^JOIN\b/i[_0x17b197(0xc5)](_0x17ff4a[_0x17b197(0xb1)](_0x2fb38b)))continue;_0x1a5f21[_0x17b197(0x80)](_0x2fb38b);const _0x37a75a=normalizeIdentifier(_0x3236e2[0x1]||_0x17b197(0x9a)),_0x289a8a=normalizeIdentifier(_0x3236e2[0x2]??''),_0x39d7db=normalizeIdentifier(_0x3236e2[0x3]||_0x289a8a[_0x17b197(0xba)]('.')['at'](-0x1)||_0x289a8a),_0x45ab31=[],_0x6ac16f=_0x289a8a===_0x17b197(0x9e);let _0x20fc92=_0x37a75a===_0x17b197(0xbb)||_0x37a75a===_0x17b197(0x7e)||_0x6ac16f,_0x5e0eb1=_0x20fc92?_0x6ac16f?_0x17b197(0x85):_0x37a75a[_0x17b197(0xb7)]()+_0x17b197(0x8b):undefined;const _0xb59d2c=stripOuterParentheses(_0x3236e2[0x4]??''),_0x5df194=_0xb59d2c['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0xb59d2c[_0x17b197(0x95)](MYBATIS_DYNAMIC_END_MARKER),_0x229f88=_0xb59d2c[_0x17b197(0x95)](MYBATIS_INCLUDE_MARKER);_0x5df194&&(_0x20fc92=!![],_0x5e0eb1??=_0x17b197(0xc3));_0x229f88&&(_0x20fc92=!![],_0x5e0eb1??=_0x17b197(0x98));const _0x205156=_0xb59d2c[_0x17b197(0x87)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x17b197(0x87)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x205156,'OR')&&(_0x20fc92=!![],_0x5e0eb1??=_0x17b197(0x88));for(const _0x11477f of splitTopLevelAnd(_0x205156)){const _0x1ddf3c=stripOuterParentheses(_0x11477f);if(hasTopLevelKeyword(_0x1ddf3c,'OR')){_0x20fc92=!![],_0x5e0eb1??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0xd1bc5c=splitEquality(_0x1ddf3c);if(!_0xd1bc5c){containsColumnReference(_0x11477f,_0x39d7db)&&(_0x20fc92=!![]);continue;}const _0x5c3fc7=parseDirectColumnReference(_0xd1bc5c[0x0],_0x39d7db),_0x1ef7c8=parseDirectColumnReference(_0xd1bc5c[0x1],_0x39d7db),_0x587276=containsColumnReference(_0xd1bc5c[0x0],_0x39d7db),_0x336ede=containsColumnReference(_0xd1bc5c[0x1],_0x39d7db),_0x2818c5=_0x5c3fc7&&!_0x336ede?_0x5c3fc7:_0x1ef7c8&&!_0x587276?_0x1ef7c8:null;if(_0x2818c5&&!_0x45ab31[_0x17b197(0x95)](_0x2818c5))_0x45ab31['push'](_0x2818c5);else!_0x2818c5&&containsColumnReference(_0x11477f,_0x39d7db)&&(_0x20fc92=!![]);}_0x4ebe78[_0x17b197(0xc7)]({'table':_0x289a8a,'alias':_0x39d7db,'columns':_0x45ab31,'unsupportedPredicate':_0x20fc92,'unsupportedReason':_0x5e0eb1,'containsUnresolvedInclude':_0x229f88,'position':_0x2fb38b});}for(const _0x271efb of _0x17ff4a['matchAll'](/\bJOIN\b/gi)){const _0xc9a1b=_0x271efb[_0x17b197(0xbe)]??0x0;if(_0x1a5f21['has'](_0xc9a1b))continue;const _0x105d62=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x17b197(0xa1)](_0x42d3a3[_0x17b197(0xb1)](_0xc9a1b+_0x271efb[0x0]['length'])),_0x5642a0=normalizeIdentifier(_0x105d62?.[0x1]||'unknown'),_0x36fc03=normalizeIdentifier(_0x105d62?.[0x2]||''),_0x37d417=isSqlClauseKeyword(_0x36fc03)?_0x5642a0['split']('.')['at'](-0x1)||_0x5642a0:_0x36fc03||_0x5642a0[_0x17b197(0xba)]('.')['at'](-0x1)||_0x5642a0;_0x4ebe78['push']({'table':_0x5642a0,'alias':_0x37d417,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x17b197(0x7b),'position':_0xc9a1b});}const _0x4772bd=_0x17ff4a[_0x17b197(0xc2)](MYBATIS_INCLUDE_MARKER);return _0x4772bd>=0x0&&!_0x4ebe78[_0x17b197(0xc9)](_0x17d7b9=>_0x17d7b9[_0x17b197(0x8f)])&&_0x4ebe78[_0x17b197(0xc7)]({'table':_0x17b197(0xb4),'alias':_0x17b197(0xb4),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x17b197(0x8a),'containsUnresolvedInclude':!![],'position':_0x4772bd}),_0x4ebe78[_0x17b197(0x99)]((_0x39740c,_0x31f6e2)=>_0x39740c[_0x17b197(0xa4)]-_0x31f6e2[_0x17b197(0xa4)]);}function stripSqlNoise(_0x19f46c){const _0x378f20=a230_0xdee6,_0x20054b=Array[_0x378f20(0x9f)](_0x19f46c),_0x2c44df=(_0x262853,_0x527a32)=>{for(let _0x55fb51=_0x262853;_0x55fb51<_0x527a32;_0x55fb51+=0x1){_0x20054b[_0x55fb51]!=='\x0a'&&_0x20054b[_0x55fb51]!=='\x0d'&&(_0x20054b[_0x55fb51]='\x20');}};for(let _0x402f81=0x0;_0x402f81<_0x20054b[_0x378f20(0x89)];_0x402f81+=0x1){const _0x2d8d92=_0x20054b[_0x402f81],_0x24a7bd=_0x20054b[_0x402f81+0x1];if(_0x2d8d92==='\x27'||_0x2d8d92==='\x22'||_0x2d8d92==='`'){const _0xa21c1e=_0x2d8d92,_0x56ae6c=_0x402f81;_0x402f81+=0x1;while(_0x402f81<_0x20054b[_0x378f20(0x89)]){if(_0x20054b[_0x402f81]==='\x5c'&&_0x402f81+0x1<_0x20054b['length']){_0x402f81+=0x2;continue;}if(_0x20054b[_0x402f81]!==_0xa21c1e){_0x402f81+=0x1;continue;}if(_0x20054b[_0x402f81+0x1]===_0xa21c1e){_0x402f81+=0x2;continue;}break;}if(_0xa21c1e==='\x27')_0x2c44df(_0x56ae6c,Math[_0x378f20(0xc4)](_0x402f81+0x1,_0x20054b[_0x378f20(0x89)]));continue;}if(_0x2d8d92==='-'&&_0x24a7bd==='-'){const _0x680021=_0x402f81;while(_0x402f81<_0x20054b['length']&&_0x20054b[_0x402f81]!=='\x0a')_0x402f81+=0x1;_0x2c44df(_0x680021,_0x402f81);continue;}if(_0x2d8d92==='/'&&_0x24a7bd==='*'){const _0x3e7bfe=_0x402f81;_0x402f81+=0x2;while(_0x402f81<_0x20054b[_0x378f20(0x89)]&&!(_0x20054b[_0x402f81]==='*'&&_0x20054b[_0x402f81+0x1]==='/')){_0x402f81+=0x1;}_0x402f81=Math[_0x378f20(0xc4)](_0x402f81+0x1,_0x20054b[_0x378f20(0x89)]-0x1),_0x2c44df(_0x3e7bfe,_0x402f81+0x1);continue;}if(_0x2d8d92==='#'&&_0x24a7bd!=='{'){const _0x3c97f5=_0x402f81;while(_0x402f81<_0x20054b[_0x378f20(0x89)]&&_0x20054b[_0x402f81]!=='\x0a')_0x402f81+=0x1;_0x2c44df(_0x3c97f5,_0x402f81);continue;}if((_0x2d8d92==='#'||_0x2d8d92==='$')&&_0x24a7bd==='{'){const _0x36049b=_0x402f81;_0x402f81+=0x2;while(_0x402f81<_0x20054b[_0x378f20(0x89)]&&_0x20054b[_0x402f81]!=='}')_0x402f81+=0x1;_0x2c44df(_0x36049b,Math[_0x378f20(0xc4)](_0x402f81+0x1,_0x20054b['length']));}}return _0x20054b['join']('');}function maskQuotedIdentifiers(_0x19e478){const _0x5156eb=a230_0xdee6,_0x1f6b80=Array[_0x5156eb(0x9f)](_0x19e478);for(let _0x57e2e5=0x0;_0x57e2e5<_0x1f6b80['length'];_0x57e2e5+=0x1){const _0x21b37c=_0x1f6b80[_0x57e2e5];if(_0x21b37c!=='\x22'&&_0x21b37c!=='`')continue;_0x57e2e5+=0x1;while(_0x57e2e5<_0x1f6b80[_0x5156eb(0x89)]){if(_0x1f6b80[_0x57e2e5]===_0x21b37c){if(_0x1f6b80[_0x57e2e5+0x1]===_0x21b37c){_0x1f6b80[_0x57e2e5]='\x20',_0x1f6b80[_0x57e2e5+0x1]='\x20',_0x57e2e5+=0x2;continue;}break;}_0x1f6b80[_0x57e2e5]='\x20',_0x57e2e5+=0x1;}}return _0x1f6b80['join']('');}function maskNestedQueries(_0x3b02e6){const _0x1d733f=a230_0xdee6,_0x594b2c=Array[_0x1d733f(0x9f)](_0x3b02e6);for(let _0x239398=0x0;_0x239398<_0x594b2c[_0x1d733f(0x89)];_0x239398+=0x1){if(_0x594b2c[_0x239398]!=='(')continue;const _0x283dcd=_0x3b02e6[_0x1d733f(0xb1)](_0x239398+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x1d733f(0xc5)](_0x283dcd))continue;let _0x454c59=0x1,_0x19a196=_0x239398+0x1;for(;_0x19a196<_0x594b2c[_0x1d733f(0x89)]&&_0x454c59>0x0;_0x19a196+=0x1){if(_0x594b2c[_0x19a196]==='(')_0x454c59+=0x1;if(_0x594b2c[_0x19a196]===')')_0x454c59-=0x1;}if(_0x454c59!==0x0)continue;for(let _0x8b8415=_0x239398;_0x8b8415<_0x19a196;_0x8b8415+=0x1){_0x594b2c[_0x8b8415]='\x20';}const _0x4608d4=_0x1d733f(0x9e);for(let _0x1e1037=0x0;_0x1e1037<_0x4608d4['length']&&_0x239398+_0x1e1037<_0x19a196;_0x1e1037+=0x1){_0x594b2c[_0x239398+_0x1e1037]=_0x4608d4[_0x1e1037];}_0x239398=_0x19a196-0x1;}return _0x594b2c['join']('');}function splitTopLevelAnd(_0x16ab7c){const _0x21ff02=a230_0xdee6,_0x5d8125=[];let _0x49e225=0x0,_0x501df3=0x0;for(let _0x56d5b9=0x0;_0x56d5b9<_0x16ab7c['length'];_0x56d5b9+=0x1){const _0x160701=_0x16ab7c[_0x56d5b9];if(_0x160701==='(')_0x49e225+=0x1;if(_0x160701===')')_0x49e225=Math[_0x21ff02(0x8d)](0x0,_0x49e225-0x1);_0x49e225===0x0&&_0x16ab7c['slice'](_0x56d5b9)[_0x21ff02(0xaf)](/^AND\b/i)&&(_0x56d5b9===0x0||/\s/[_0x21ff02(0xc5)](_0x16ab7c[_0x56d5b9-0x1]??''))&&(_0x5d8125[_0x21ff02(0xc7)](_0x16ab7c['slice'](_0x501df3,_0x56d5b9)[_0x21ff02(0xaa)]()),_0x56d5b9+=0x2,_0x501df3=_0x56d5b9+0x1);}const _0x3c7d49=_0x16ab7c[_0x21ff02(0xb1)](_0x501df3)[_0x21ff02(0xaa)]();if(_0x3c7d49)_0x5d8125[_0x21ff02(0xc7)](_0x3c7d49);return _0x5d8125;}function hasTopLevelKeyword(_0x485e82,_0x1c654e){const _0x3bb115=a230_0xdee6;let _0x4d642e=0x0;for(let _0x56dfd8=0x0;_0x56dfd8<_0x485e82[_0x3bb115(0x89)];_0x56dfd8+=0x1){const _0x4d85ea=_0x485e82[_0x56dfd8];if(_0x4d85ea==='(')_0x4d642e+=0x1;if(_0x4d85ea===')')_0x4d642e=Math['max'](0x0,_0x4d642e-0x1);if(_0x4d642e!==0x0)continue;const _0x6ce8ec=_0x485e82[_0x3bb115(0xb1)](_0x56dfd8,_0x56dfd8+_0x1c654e[_0x3bb115(0x89)]),_0x5016a8=_0x485e82[_0x56dfd8-0x1]??'\x20',_0x5ea524=_0x485e82[_0x56dfd8+_0x1c654e['length']]??'\x20';if(_0x6ce8ec[_0x3bb115(0xb7)]()===_0x1c654e['toUpperCase']()&&!/[\w$]/[_0x3bb115(0xc5)](_0x5016a8)&&!/[\w$]/['test'](_0x5ea524))return!![];}return![];}function a230_0x57b0(){const _0x30ba0b=['686322hJWklh','warning','indexOf','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','min','test','endsWith','push','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','some','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','where','12bCeAau','full','4EzCNlH','add','1489020xSpQVo','JOIN_INDEX_NOT_USABLE','columns','142550qgfqGI','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','460110pujbnt','replaceAll','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','length','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','has','max','replace','containsUnresolvedInclude','natural','covered','inner','36MsYPyl','(?:^|[^\x5cw$])','includes','search','\x5cs*\x5c.\x5cs*[\x5cw$]+','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','sort','INNER','using','unavailable','JOIN_PREDICATE_UNSUPPORTED','__sq__','from','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','exec','matchAll','filter','position','953620stzjFc','table','62630NJgZHl','JOIN_INDEX_MISSING','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','trim','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','\x5c$&','left','cross','match','startsWith','slice','228240iXdDFH','alias','unknown','unsupportedPredicate','sql','toUpperCase','indexes','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','split','right','metadataAvailable','matchedPrefix','index','map'];a230_0x57b0=function(){return _0x30ba0b;};return a230_0x57b0();}function splitEquality(_0x499d2a){const _0x530604=a230_0xdee6,_0x64bf90=stripOuterParentheses(_0x499d2a);let _0x628ada=0x0,_0x5ec9b3;for(let _0x5a0b13=0x0;_0x5a0b13<_0x64bf90['length'];_0x5a0b13+=0x1){const _0x2aec83=_0x64bf90[_0x5a0b13];if(_0x2aec83==='(')_0x628ada+=0x1;if(_0x2aec83===')')_0x628ada=Math[_0x530604(0x8d)](0x0,_0x628ada-0x1);const _0x45feb3=_0x64bf90[_0x5a0b13-0x1]??'',_0x13dc9a=_0x64bf90[_0x5a0b13+0x1]??'';if(_0x2aec83==='='&&_0x628ada===0x0&&!/[!<>=:]/[_0x530604(0xc5)](_0x45feb3)&&_0x13dc9a!=='='){if(_0x5ec9b3!==undefined)return null;_0x5ec9b3=_0x5a0b13;}}return _0x5ec9b3===undefined?null:[_0x64bf90[_0x530604(0xb1)](0x0,_0x5ec9b3)['trim'](),_0x64bf90[_0x530604(0xb1)](_0x5ec9b3+0x1)['trim']()];}function parseDirectColumnReference(_0xf65649,_0x38eecc){const _0xc926a=a230_0xdee6,_0x150068=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xc926a(0xa1)](stripOuterParentheses(_0xf65649));if(!_0x150068)return null;if(normalizeIdentifier(_0x150068[0x1]??'')!==normalizeIdentifier(_0x38eecc))return null;return normalizeIdentifier(_0x150068[0x2]??'');}function containsColumnReference(_0x55ad94,_0x4b4dc){const _0x135edf=a230_0xdee6,_0x1af779=_0x55ad94[_0x135edf(0x8e)](/[`"]/g,''),_0x5e4c18=_0x4b4dc[_0x135edf(0x8e)](/[.*+?^${}()|[\]\\]/g,_0x135edf(0xac));return new RegExp(_0x135edf(0x94)+_0x5e4c18+_0x135edf(0x97),'i')[_0x135edf(0xc5)](_0x1af779);}function findEqualityPrefix(_0x44d5f3,_0x8314b7){const _0x406425=a230_0xdee6,_0x32a25d=new Set(_0x8314b7[_0x406425(0xbf)](normalizeIdentifier)),_0x495ac0=[];for(const _0x4e00b0 of _0x44d5f3){if(!_0x32a25d[_0x406425(0x8c)](normalizeIdentifier(_0x4e00b0)))break;_0x495ac0[_0x406425(0xc7)](_0x4e00b0);}return _0x495ac0;}function resolveTableMetadata(_0x488c4e,_0x27848b){const _0x245f31=a230_0xdee6,_0x30a728=normalizeIdentifier(_0x27848b),_0x462612=_0x488c4e[_0x245f31(0xa3)](_0x32a9a9=>normalizeIdentifier(_0x32a9a9['tableName'])===_0x30a728);if(_0x462612[_0x245f31(0x89)]===0x1)return _0x462612[0x0];const _0x42a7ad=_0x30a728[_0x245f31(0x95)]('.'),_0xcd747d=_0x30a728[_0x245f31(0xba)]('.')['at'](-0x1),_0x34529b=_0x488c4e[_0x245f31(0xa3)](_0x377288=>{const _0x4c139c=_0x245f31,_0x318530=normalizeIdentifier(_0x377288['tableName']);if(_0x42a7ad&&_0x318530[_0x4c139c(0x95)]('.'))return![];return _0x318530[_0x4c139c(0xba)]('.')['at'](-0x1)===_0xcd747d;});return _0x34529b['length']===0x1?_0x34529b[0x0]:undefined;}function columnNamesMatch(_0x3c6fbe,_0x1f5a26){return normalizeIdentifier(_0x3c6fbe)===normalizeIdentifier(_0x1f5a26);}function normalizeIdentifier(_0x1582dd){const _0x4782eb=a230_0xdee6;return _0x1582dd[_0x4782eb(0x8e)](/[`"]/g,'')[_0x4782eb(0xaa)]()['toLowerCase']();}function isSqlClauseKeyword(_0x265553){const _0xe6fd77=a230_0xdee6;return new Set(['on',_0xe6fd77(0x9b),_0xe6fd77(0x7c),'join',_0xe6fd77(0x92),_0xe6fd77(0xad),'right','full',_0xe6fd77(0xae),_0xe6fd77(0x90)])[_0xe6fd77(0x8c)](_0x265553);}function stripOuterParentheses(_0x1afe78){const _0x22e23a=a230_0xdee6;let _0xf2d271=_0x1afe78[_0x22e23a(0xaa)]();while(_0xf2d271[_0x22e23a(0xb0)]('(')&&_0xf2d271[_0x22e23a(0xc6)](')')){let _0x413eaa=0x0,_0x599788=!![];for(let _0x3167fd=0x0;_0x3167fd<_0xf2d271['length'];_0x3167fd+=0x1){if(_0xf2d271[_0x3167fd]==='(')_0x413eaa+=0x1;if(_0xf2d271[_0x3167fd]===')')_0x413eaa-=0x1;if(_0x413eaa===0x0&&_0x3167fd<_0xf2d271['length']-0x1){_0x599788=![];break;}}if(!_0x599788||_0x413eaa!==0x0)break;_0xf2d271=_0xf2d271['slice'](0x1,-0x1)[_0x22e23a(0xaa)]();}return _0xf2d271;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a231_0x570c(_0x32e708,_0x470b06){_0x32e708=_0x32e708-0x14a;const _0x368798=a231_0x3687();let _0x570cd5=_0x368798[_0x32e708];return _0x570cd5;}const a231_0x3ee3ab=a231_0x570c;(function(_0xb53a7c,_0x4e5f68){const _0x2e5f15=a231_0x570c,_0x754eb8=_0xb53a7c();while(!![]){try{const _0x19ca05=parseInt(_0x2e5f15(0x153))/0x1*(-parseInt(_0x2e5f15(0x14c))/0x2)+parseInt(_0x2e5f15(0x14b))/0x3+parseInt(_0x2e5f15(0x158))/0x4*(parseInt(_0x2e5f15(0x151))/0x5)+parseInt(_0x2e5f15(0x156))/0x6*(-parseInt(_0x2e5f15(0x154))/0x7)+-parseInt(_0x2e5f15(0x155))/0x8*(parseInt(_0x2e5f15(0x14d))/0x9)+-parseInt(_0x2e5f15(0x157))/0xa+parseInt(_0x2e5f15(0x150))/0xb;if(_0x19ca05===_0x4e5f68)break;else _0x754eb8['push'](_0x754eb8['shift']());}catch(_0x52e16c){_0x754eb8['push'](_0x754eb8['shift']());}}}(a231_0x3687,0x3fc6d));function a231_0x3687(){const _0x3c4ce1=['/sql','7807624jyFsgL','505DcFYZt','sql.lock.json','557XyeQph','7868EJowUW','44504PDufAn','168KOkkNI','3405360JGWoQl','12564vajmoj','sql-trash','sql','1387248VtSuoN','1756rYzlqp','594zsBEhG','.rabetbase'];a231_0x3687=function(){return _0x3c4ce1;};return a231_0x3687();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a231_0x3ee3ab(0x14e),LOCK_FILE_NAME=a231_0x3ee3ab(0x152),TRASH_DIR_NAME=a231_0x3ee3ab(0x159);export function loadSqlProjectConfig(_0x507197,_0x378dc1){const _0x18092a=a231_0x3ee3ab,_0x34228c=resolve(_0x378dc1??findProjectRootDirectory()),_0x4f8241=DOT_DIR+_0x18092a(0x14f),_0x263cfb=_0x4f8241+'/'+_0x507197;return{'projectRoot':_0x34228c,'appCode':_0x507197,'sqlWorkspaceRoot':_0x4f8241,'sqlRoot':_0x263cfb,'sqlRootDir':resolve(_0x34228c,DOT_DIR,_0x18092a(0x14a),_0x507197),'lockFilePath':resolve(_0x34228c,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x34228c,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13463b,_0x2b1e16){const _0x468603=a232_0x46d8,_0x1a69cf=_0x13463b();while(!![]){try{const _0xa5d2d5=parseInt(_0x468603(0x15a))/0x1+parseInt(_0x468603(0x162))/0x2+-parseInt(_0x468603(0x166))/0x3+parseInt(_0x468603(0x164))/0x4+-parseInt(_0x468603(0x15e))/0x5+-parseInt(_0x468603(0x14b))/0x6*(parseInt(_0x468603(0x158))/0x7)+parseInt(_0x468603(0x151))/0x8*(-parseInt(_0x468603(0x15f))/0x9);if(_0xa5d2d5===_0x2b1e16)break;else _0x1a69cf['push'](_0x1a69cf['shift']());}catch(_0x406d65){_0x1a69cf['push'](_0x1a69cf['shift']());}}}(a232_0x1eb2,0x65512));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';function a232_0x1eb2(){const _0x5f1fa2=['sqlCode','199815ftpneq','isFile','403455mNWaTD','sqlName','name','sqlRootDir','1880830VKYxkw','162wdOfAD','slice','test','787554WHlvGr','dbId','1818880MzQqSN','indexOf','997761XiqXBA','dbName','18fXilDx','ENOENT','.xml','.sql','length','toLowerCase','18920OPQyZW','split','isDirectory','mode','sql','mybatisXml'];a232_0x1eb2=function(){return _0x5f1fa2;};return a232_0x1eb2();}import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x1cb83){const _0x305cb0=a232_0x46d8;if(_0x1cb83===_0x305cb0(0x14e))return _0x305cb0(0x155);if(_0x1cb83===_0x305cb0(0x14d))return _0x305cb0(0x156);return undefined;}async function scanSqlFilesRecursively(_0x26b682,_0x3c3d08){const _0x29228e=a232_0x46d8,_0x343fd8=[];try{const _0x345751=await readdir(_0x26b682,{'withFileTypes':!![]});for(const _0x54b112 of _0x345751){const _0x3ca39d=join(_0x26b682,_0x54b112[_0x29228e(0x15c)]);if(_0x54b112[_0x29228e(0x153)]()){_0x343fd8['push'](...await scanSqlFilesRecursively(_0x3ca39d,_0x3c3d08));continue;}if(!_0x54b112[_0x29228e(0x159)]())continue;const _0x47d1fd=extname(_0x54b112[_0x29228e(0x15c)])[_0x29228e(0x150)](),_0x574553=extensionToMode(_0x47d1fd);if(!_0x574553)continue;const _0x36e2b4=relative(_0x3c3d08,_0x3ca39d)['replace'](/\\/g,'/'),_0x4a743f=_0x36e2b4[_0x29228e(0x152)]('/')['filter'](Boolean),_0xa4abd5=parseSqlPath(_0x4a743f,_0x54b112[_0x29228e(0x15c)],_0x47d1fd);if(!_0xa4abd5)continue;_0x343fd8['push']({'sqlCode':_0xa4abd5[_0x29228e(0x157)],'sqlName':_0xa4abd5[_0x29228e(0x15b)],'dbDirectory':_0x4a743f[0x0],'filePath':_0x3ca39d,'relativePath':_0x36e2b4,'lockKey':_0xa4abd5[_0x29228e(0x157)],'mode':_0x574553});}}catch(_0x57f8ee){if(_0x57f8ee['code']!==_0x29228e(0x14c))throw _0x57f8ee;}return _0x343fd8;}export async function scanLocalSqlQueries(_0x249b36){const _0x40a203=a232_0x46d8;return scanSqlFilesRecursively(_0x249b36[_0x40a203(0x15d)],_0x249b36[_0x40a203(0x15d)]);}function a232_0x46d8(_0x4a5451,_0x153132){_0x4a5451=_0x4a5451-0x14a;const _0x1eb26a=a232_0x1eb2();let _0x46d8ad=_0x1eb26a[_0x4a5451];return _0x46d8ad;}export function resolveLocalSqlFilePath(_0x1e5524,_0x11875c,_0x2ef05e){const _0x3f66b1=a232_0x46d8,_0x253680=_0x2ef05e?.['path']||(_0x2ef05e?.['sqlName']||_0x2ef05e?.[_0x3f66b1(0x14a)]?buildSqlRelativePath(_0x11875c,_0x2ef05e?.[_0x3f66b1(0x15b)],_0x2ef05e?.[_0x3f66b1(0x14a)],_0x2ef05e?.[_0x3f66b1(0x154)]||_0x3f66b1(0x155),_0x2ef05e?.[_0x3f66b1(0x163)]):buildDefaultSqlFileName(_0x11875c,_0x2ef05e?.[_0x3f66b1(0x154)]||'sql'));return join(_0x1e5524['sqlRootDir'],_0x253680);}export async function directoryExists(_0x44b5fb){const _0x25b072=a232_0x46d8;try{const _0x4662ee=await stat(_0x44b5fb);return _0x4662ee[_0x25b072(0x153)]();}catch{return![];}}function parseSqlPath(_0x6390d,_0x474d8f,_0x3d6d1b){const _0x5e2702=a232_0x46d8,_0x1c21c0=_0x474d8f['slice'](0x0,-_0x3d6d1b[_0x5e2702(0x14f)]);if(_0x6390d[_0x5e2702(0x14f)]<0x2)return null;const _0x2c971f=_0x1c21c0[_0x5e2702(0x165)]('_');if(_0x2c971f<=0x0||_0x2c971f>=_0x1c21c0[_0x5e2702(0x14f)]-0x1)return null;const _0x51847b=_0x1c21c0[_0x5e2702(0x160)](0x0,_0x2c971f);if(!isLikelySqlCode(_0x51847b))return null;return{'sqlCode':_0x51847b,'sqlName':_0x1c21c0[_0x5e2702(0x160)](_0x2c971f+0x1)};}function isLikelySqlCode(_0x3a0cda){const _0x54dd0f=a232_0x46d8;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x54dd0f(0x161)](_0x3a0cda);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x201db5,_0x147a30){const _0x53fa41=a233_0x4d1f,_0x22ad43=_0x201db5();while(!![]){try{const _0x53a232=parseInt(_0x53fa41(0x1a1))/0x1*(parseInt(_0x53fa41(0x1a8))/0x2)+-parseInt(_0x53fa41(0x1a3))/0x3*(parseInt(_0x53fa41(0x19b))/0x4)+parseInt(_0x53fa41(0x1a5))/0x5*(-parseInt(_0x53fa41(0x1ac))/0x6)+-parseInt(_0x53fa41(0x1a2))/0x7+parseInt(_0x53fa41(0x19f))/0x8*(parseInt(_0x53fa41(0x1a7))/0x9)+-parseInt(_0x53fa41(0x1a6))/0xa*(-parseInt(_0x53fa41(0x1a4))/0xb)+-parseInt(_0x53fa41(0x19c))/0xc;if(_0x53a232===_0x147a30)break;else _0x22ad43['push'](_0x22ad43['shift']());}catch(_0x4cc099){_0x22ad43['push'](_0x22ad43['shift']());}}}(a233_0x3c8e,0x54873));function a233_0x3c8e(){const _0x550218=['2869566LZAdFK','5952KQTNGT','7066444Hwlrhl','71165ExBjca','10CFggcZ','27JnZPDP','5114UziZNh','createHash','md5','utf8','90LFJUOu','632DExZBU','2995476giwEWB','digest','hex','805976uDUELc','update','230uvTUYH'];a233_0x3c8e=function(){return _0x550218;};return a233_0x3c8e();}function a233_0x4d1f(_0x5240bc,_0x1bca05){_0x5240bc=_0x5240bc-0x19b;const _0x3c8ef1=a233_0x3c8e();let _0x4d1f83=_0x3c8ef1[_0x5240bc];return _0x4d1f83;}import{readFile}from'node:fs/promises';import a233_0x45c968 from'node:crypto';export function computeSqlContentHash(_0x542d1b){const _0x52b5bb=a233_0x4d1f;return a233_0x45c968[_0x52b5bb(0x1a9)](_0x52b5bb(0x1aa))[_0x52b5bb(0x1a0)](_0x542d1b)[_0x52b5bb(0x19d)](_0x52b5bb(0x19e));}export async function computeSqlFileHash(_0x1908fb){const _0x4d4998=a233_0x4d1f,_0x201906=await readFile(_0x1908fb,_0x4d4998(0x1ab));return computeSqlContentHash(_0x201906);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2ecfc6,_0x5454fe){const _0xdd5366=a234_0x5715,_0x8c8b92=_0x2ecfc6();while(!![]){try{const _0x5b5292=parseInt(_0xdd5366(0x1ae))/0x1+parseInt(_0xdd5366(0x1be))/0x2*(parseInt(_0xdd5366(0x1bd))/0x3)+parseInt(_0xdd5366(0x1c0))/0x4+-parseInt(_0xdd5366(0x1bc))/0x5*(-parseInt(_0xdd5366(0x1b5))/0x6)+parseInt(_0xdd5366(0x1bb))/0x7+-parseInt(_0xdd5366(0x1b7))/0x8*(-parseInt(_0xdd5366(0x1c2))/0x9)+parseInt(_0xdd5366(0x1b3))/0xa*(-parseInt(_0xdd5366(0x1c4))/0xb);if(_0x5b5292===_0x5454fe)break;else _0x8c8b92['push'](_0x8c8b92['shift']());}catch(_0x3ceb3a){_0x8c8b92['push'](_0x8c8b92['shift']());}}}(a234_0x1d12,0xb4a98));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x10506f,_0x2c0ac8,_0x424876,_0x62f1bb){const _0x7fcfd2=a234_0x5715,_0x3387d4=_0x10506f??createEmptySqlLock();let _0x3a01a5=_0x3387d4[_0x7fcfd2(0x1b8)][_0x2c0ac8];if(!_0x3a01a5)return _0x3a01a5={'sqlRoot':_0x424876,'lastSync':'','sqls':{}},_0x3387d4[_0x7fcfd2(0x1b8)][_0x2c0ac8]=_0x3a01a5,{'lockData':_0x3387d4,'appLock':_0x3a01a5};if(!_0x3a01a5['sqlRoot'])_0x3a01a5[_0x7fcfd2(0x1b4)]=_0x424876;else{if(_0x3a01a5[_0x7fcfd2(0x1b4)]!==_0x424876)throw new Error(_0x62f1bb+_0x7fcfd2(0x1ba)+_0x424876+_0x7fcfd2(0x1bf)+_0x3a01a5[_0x7fcfd2(0x1b4)]+_0x7fcfd2(0x1b9)+_0x7fcfd2(0x1c1));}return!_0x3a01a5[_0x7fcfd2(0x1b6)]&&(_0x3a01a5[_0x7fcfd2(0x1b6)]={}),!_0x3a01a5[_0x7fcfd2(0x1c3)]&&(_0x3a01a5[_0x7fcfd2(0x1c3)]=''),{'lockData':_0x3387d4,'appLock':_0x3a01a5};}export async function readSqlLockFile(_0x5b5604){const _0x254a67=a234_0x5715;try{const _0x211ad8=await readFile(_0x5b5604,_0x254a67(0x1b0));return JSON[_0x254a67(0x1af)](_0x211ad8);}catch(_0x440ff0){if(_0x440ff0[_0x254a67(0x1b1)]===_0x254a67(0x1ac))return null;throw new Error(_0x254a67(0x1b2)+String(_0x440ff0));}}export async function writeSqlLockFile(_0x3e54fd,_0x18e4fa){const _0x246a99=a234_0x5715;await mkdir(dirname(_0x3e54fd),{'recursive':!![]}),await writeFile(_0x3e54fd,JSON[_0x246a99(0x1ad)](_0x18e4fa,null,0x2),'utf8');}function a234_0x5715(_0x243ca3,_0x3323b0){_0x243ca3=_0x243ca3-0x1ac;const _0x1d1235=a234_0x1d12();let _0x5715e6=_0x1d1235[_0x243ca3];return _0x5715e6;}function a234_0x1d12(){const _0x20dd96=['Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','9IHdPFx','lastSync','38778949yNqUrY','ENOENT','stringify','959417ZxLQpB','parse','utf8','code','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','10nZEXHf','sqlRoot','1167678Vovuuf','sqls','6639688HATtsB','apps','\x22.\x20',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','851620PKiEtL','5mtROQM','3fHGlAY','1615310sBhjSU','\x22\x20vs\x20lock\x20\x22','5408180stSIET'];a234_0x1d12=function(){return _0x20dd96;};return a234_0x1d12();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x390248,_0xd8dba6){const _0x35d388=a236_0x15e0,_0x158bb9=_0x390248();while(!![]){try{const _0x3fe883=parseInt(_0x35d388(0x1ec))/0x1+-parseInt(_0x35d388(0x1ed))/0x2+-parseInt(_0x35d388(0x1e7))/0x3+parseInt(_0x35d388(0x1e2))/0x4*(parseInt(_0x35d388(0x1eb))/0x5)+-parseInt(_0x35d388(0x1e0))/0x6+-parseInt(_0x35d388(0x1ea))/0x7+parseInt(_0x35d388(0x1e9))/0x8;if(_0x3fe883===_0xd8dba6)break;else _0x158bb9['push'](_0x158bb9['shift']());}catch(_0x52b69d){_0x158bb9['push'](_0x158bb9['shift']());}}}(a236_0x129e,0x8de8b));export function detectSqlMode(_0x23d08f){const _0x381b96=a236_0x15e0,_0x3129c1=_0x23d08f[_0x381b96(0x1e8)]();if(/^<(select|insert|update|delete)\b/i[_0x381b96(0x1e6)](_0x3129c1))return _0x381b96(0x1e3);return _0x381b96(0x1f1);}export function getSqlFileExtension(_0x4eaf11){const _0x38988d=a236_0x15e0;return _0x4eaf11==='mybatisXml'?'.xml':_0x38988d(0x1f0);}function a236_0x15e0(_0x585f1,_0x261cb0){_0x585f1=_0x585f1-0x1e0;const _0x129eac=a236_0x129e();let _0x15e037=_0x129eac[_0x585f1];return _0x15e037;}export function buildDefaultSqlFileName(_0x3bfc15,_0x58ab19){return''+_0x3bfc15+getSqlFileExtension(_0x58ab19);}export function sanitizeSqlPathSegment(_0x46269e,_0x5bfdde){const _0x364f44=a236_0x15e0,_0x2aedcf=String(_0x46269e??'')[_0x364f44(0x1e5)](),_0x5c9f11=_0x2aedcf['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x364f44(0x1e4)](/\s+/g,'-')[_0x364f44(0x1e4)](/-+/g,'-')[_0x364f44(0x1e4)](/^\.+/,'')['replace'](/\.+$/,'')[_0x364f44(0x1e4)](/^-+/,'')['replace'](/-+$/,'');return _0x5c9f11||_0x5bfdde;}export function buildDbDirectoryName(_0x145529,_0x11c4ba){const _0xff4a9e=a236_0x15e0;return sanitizeSqlPathSegment(_0x145529,_0x11c4ba!=null?_0xff4a9e(0x1ef)+_0x11c4ba:_0xff4a9e(0x1ee));}export function buildSqlRelativePath(_0x3b1647,_0x4c37e3,_0x3e0b17,_0x3b486d,_0x140e9c){const _0x3d5068=a236_0x15e0,_0x49c02f=buildDbDirectoryName(_0x3e0b17,_0x140e9c),_0x2f8db3=sanitizeSqlPathSegment(_0x3b1647,_0x3d5068(0x1e1)),_0x5065e3=sanitizeSqlPathSegment(_0x4c37e3,_0x2f8db3);return _0x49c02f+'/'+_0x2f8db3+'_'+_0x5065e3+getSqlFileExtension(_0x3b486d);}function a236_0x129e(){const _0x1e7315=['sql','4087428kJVnBf','unknown-sql','230896DiDCJD','mybatisXml','replace','trim','test','1104111BIxbUP','trimStart','10147376LVCuxO','1756069LGesRe','15QYpZWr','1138559oNyuXD','1397504AfIMmv','unknown-db','db-','.sql'];a236_0x129e=function(){return _0x1e7315;};return a236_0x129e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a237_0x3127(){const _0x30e087=['outer','tagName','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','length','property','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','join',''','include','startsWith','\x20query\x20targeting\x20','mybatisXml','choose','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','rawName','INSERT','\x20WHERE\x20','fromCodePoint','3794628gUzpsV','MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.','type','slice','statementType','match','13904865wjWvcL','<','WITH','add','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','^<\x5cs*(?:','toLowerCase','SELECT','9665NGQium','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','parseInt','replace','bind',')\x5cb','UNKNOWN','from','UPDATE','SQL\x20content\x20is\x20empty','__RABETBASE_MYBATIS_DYNAMIC_END__','set','includes','Unable\x20to\x20detect\x20SQL\x20type.\x20','matchAll','insert','Invalid\x20MyBatis\x20XML\x20tag.','Unterminated\x20MyBatis\x20XML\x20tag.','10284280LzCXxX','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','4818ABzWvn','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','test','indexOf','<!--','97454BuWKeg','push','foreach','"','error','exec','DELETE','2648436gxEBbX','DDL','when','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','split','otherwise','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','sql','unknown\x20table(s)','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','reason','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','Unterminated\x20XML\x20comment.','-->','trim','354504BXkMWW','get','pop','string','704BoSIfZ','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','\x20SET\x20','replaceAll','>','__RABETBASE_MYBATIS_DYNAMIC_START__','keys','8TLAUji','has','Unterminated\x20CDATA\x20section.','\x20with\x20parameters:\x20'];a237_0x3127=function(){return _0x30e087;};return a237_0x3127();}const a237_0x41c7e3=a237_0x320f;(function(_0x53a3db,_0x194e6e){const _0x385932=a237_0x320f,_0x4e7ab8=_0x53a3db();while(!![]){try{const _0x29b063=parseInt(_0x385932(0xde))/0x1*(-parseInt(_0x385932(0xea))/0x2)+parseInt(_0x385932(0xcf))/0x3+-parseInt(_0x385932(0x100))/0x4+-parseInt(_0x385932(0xae))/0x5*(-parseInt(_0x385932(0xc3))/0x6)+-parseInt(_0x385932(0xc8))/0x7*(-parseInt(_0x385932(0xe2))/0x8)+-parseInt(_0x385932(0xa6))/0x9+parseInt(_0x385932(0xc0))/0xa;if(_0x29b063===_0x194e6e)break;else _0x4e7ab8['push'](_0x4e7ab8['shift']());}catch(_0x53ad04){_0x4e7ab8['push'](_0x4e7ab8['shift']());}}}(a237_0x3127,0xbdad5));const MYBATIS_OUTER_TAGS=new Map([['select',a237_0x41c7e3(0xad)],[a237_0x41c7e3(0xbd),a237_0x41c7e3(0xfd)],['update',a237_0x41c7e3(0xb6)],['delete','DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a237_0x41c7e3(0xca),a237_0x41c7e3(0xfa),a237_0x41c7e3(0xd1),a237_0x41c7e3(0xd4),'trim',a237_0x41c7e3(0xb9),a237_0x41c7e3(0xb2),a237_0x41c7e3(0xf6),a237_0x41c7e3(0xf2)]),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x41c7e3(0xca),a237_0x41c7e3(0xfa),a237_0x41c7e3(0xd1),a237_0x41c7e3(0xd4)]);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x41c7e3(0xe8);export const MYBATIS_DYNAMIC_END_MARKER=a237_0x41c7e3(0xb8);export const MYBATIS_INCLUDE_MARKER=a237_0x41c7e3(0xf3);const UNRESOLVED_SQL_FRAGMENT=a237_0x41c7e3(0xaf),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x41c7e3(0xab)+[...MYBATIS_OUTER_TAGS[a237_0x41c7e3(0xe9)]()][a237_0x41c7e3(0xf4)]('|')+a237_0x41c7e3(0xb3),'i');export function normalizeSqlForStaticAnalysis(_0x4b1cbb){const _0x20e2c0=a237_0x41c7e3,_0x869938=typeof _0x4b1cbb===_0x20e2c0(0xe1)?_0x4b1cbb:'';if(!startsWithMybatisStatementWrapper(_0x869938))return{'sql':_0x869938,'mode':_0x20e2c0(0xd6)};let _0x5cd9f8=0x0,_0xb9137b='',_0x2447a1,_0x2f891b=![],_0x3d23b0=![];const _0x4fa39c=[];while(_0x5cd9f8<_0x869938['length']){if(_0x869938[_0x20e2c0(0xf7)](_0x20e2c0(0xc7),_0x5cd9f8)){const _0x1a37c1=_0x869938['indexOf'](_0x20e2c0(0xdc),_0x5cd9f8+0x4);if(_0x1a37c1<0x0)return invalidMybatisSource(_0x20e2c0(0xdb));_0xb9137b+='\x20',_0x5cd9f8=_0x1a37c1+0x3;continue;}if(_0x869938[_0x20e2c0(0xf7)]('<;if(_0x1befc0<0x0)return invalidMybatisSource(_0x20e2c0(0xec));_0xb9137b+=_0x869938[_0x20e2c0(0x103)](_0x5cd9f8+0x9,_0x1befc0),_0x5cd9f8=_0x1befc0+0x3;continue;}if(_0x869938[_0x20e2c0(0xf7)]('<?',_0x5cd9f8)){if(_0x2f891b)return invalidMybatisSource(_0x20e2c0(0xf0));const _0x376ead=_0x869938[_0x20e2c0(0xc6)]('?>',_0x5cd9f8+0x2);if(_0x376ead<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0xb9137b+='\x20',_0x5cd9f8=_0x376ead+0x2;continue;}if(_0x869938[_0x5cd9f8]!=='<'){const _0x3bbf7b=_0x869938[_0x20e2c0(0xc6)]('<',_0x5cd9f8),_0x2d8bfc=_0x3bbf7b<0x0?_0x869938[_0x20e2c0(0xf1)]:_0x3bbf7b,_0x2becb9=_0x869938['slice'](_0x5cd9f8,_0x2d8bfc);if((!_0x2f891b||_0x3d23b0)&&_0x2becb9[_0x20e2c0(0xdd)]())return invalidMybatisSource(_0x20e2c0(0xd8));if(_0x2f891b&&!_0x3d23b0){const _0x5856b8=decodeXmlEntities(_0x2becb9);if(_0x5856b8===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0xb9137b+=_0x5856b8;}else _0xb9137b+='\x20';_0x5cd9f8=_0x2d8bfc;continue;}const _0x2fae81=findXmlTagEnd(_0x869938,_0x5cd9f8);if(_0x2fae81<0x0)return invalidMybatisSource(_0x20e2c0(0xbf));const _0x90b68e=_0x869938[_0x20e2c0(0x103)](_0x5cd9f8,_0x2fae81+0x1),_0x2f1777=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x20e2c0(0xcd)](_0x90b68e);if(!_0x2f1777)return invalidMybatisSource(_0x20e2c0(0xbe));const _0x3bfe89=_0x2f1777[0x1]==='/',_0x521abd=_0x2f1777[0x2]??'',_0xe4264b=_0x521abd[_0x20e2c0(0xac)](),_0x28c5e1=_0x2f1777[0x3]??'',_0x457770=_0x2f1777[0x4]==='/',_0x57a40d=MYBATIS_OUTER_TAGS[_0x20e2c0(0xdf)](_0xe4264b);if(!_0x57a40d&&!MYBATIS_DYNAMIC_TAGS['has'](_0xe4264b))return invalidMybatisSource('Unsupported\x20MyBatis\x20XML\x20tag:\x20<'+_0xe4264b+'>.');if(!_0x57a40d&&_0x521abd!==_0xe4264b)return invalidMybatisSource(_0x20e2c0(0xc4)+_0x521abd+'>.');if(_0x3bfe89){if(_0x28c5e1[_0x20e2c0(0xdd)]()||_0x457770)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x521abd+'>.');const _0x229bea=_0x4fa39c['at'](-0x1);if(!_0x229bea||(_0x229bea['outer']?_0x229bea[_0x20e2c0(0xef)]!==_0xe4264b:_0x229bea[_0x20e2c0(0xfc)]!==_0x521abd))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x521abd+'>.');_0x4fa39c[_0x20e2c0(0xe0)]();if(_0x229bea[_0x20e2c0(0xee)])_0x3d23b0=!![];_0xb9137b+=MYBATIS_BRANCH_TAGS[_0x20e2c0(0xeb)](_0xe4264b)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x28c5e1))return invalidMybatisSource('Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<'+_0x521abd+'>.');if(_0xe4264b===_0x20e2c0(0xf2)&&(!_0x457770||_0x4fa39c['at'](-0x1)?.['tagName']!==_0x20e2c0(0xf6)))return invalidMybatisSource(_0x20e2c0(0xe4));if(_0x57a40d){if(_0x2f891b||_0x4fa39c[_0x20e2c0(0xf1)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x2f891b=!![],_0x3d23b0=_0x457770,_0x2447a1=_0x57a40d;}else{if(!_0x2f891b||_0x3d23b0)return invalidMybatisSource(_0x20e2c0(0xfb)+_0x521abd+'>.');}_0xb9137b+=_0xe4264b==='where'?_0x20e2c0(0xfe):_0xe4264b==='set'?_0x20e2c0(0xe5):_0xe4264b===_0x20e2c0(0xf6)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x20e2c0(0xeb)](_0xe4264b)&&!_0x457770?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x457770&&_0x4fa39c[_0x20e2c0(0xc9)]({'rawName':_0x521abd,'tagName':_0xe4264b,'outer':!!_0x57a40d});}_0x5cd9f8=_0x2fae81+0x1;}if(_0x4fa39c[_0x20e2c0(0xf1)]>0x0)return invalidMybatisSource(_0x20e2c0(0xd5)+_0x4fa39c['at'](-0x1)?.['rawName']+'>.');if(!_0x2f891b||!_0x3d23b0)return invalidMybatisSource(_0x20e2c0(0x101));return{'sql':_0xb9137b[_0x20e2c0(0xdd)](),'mode':_0x20e2c0(0xf9),..._0x2447a1?{'statementType':_0x2447a1}:{}};}function hasWellFormedXmlAttributes(_0x4ea958){const _0x56f95f=a237_0x41c7e3;let _0x3a206b=0x0;const _0x14151f=new Set();while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]){while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]&&/\s/['test'](_0x4ea958[_0x3a206b]??''))_0x3a206b+=0x1;if(_0x3a206b>=_0x4ea958[_0x56f95f(0xf1)])return!![];const _0x2ab7d8=/^[A-Za-z_:][\w:.-]*/[_0x56f95f(0xcd)](_0x4ea958[_0x56f95f(0x103)](_0x3a206b)),_0x172b63=_0x2ab7d8?.[0x0];if(!_0x172b63||_0x14151f[_0x56f95f(0xeb)](_0x172b63))return![];_0x14151f[_0x56f95f(0xa9)](_0x172b63),_0x3a206b+=_0x172b63[_0x56f95f(0xf1)];while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]&&/\s/[_0x56f95f(0xc5)](_0x4ea958[_0x3a206b]??''))_0x3a206b+=0x1;if(_0x4ea958[_0x3a206b]!=='=')return![];_0x3a206b+=0x1;while(_0x3a206b<_0x4ea958[_0x56f95f(0xf1)]&&/\s/[_0x56f95f(0xc5)](_0x4ea958[_0x3a206b]??''))_0x3a206b+=0x1;const _0x4bc903=_0x4ea958[_0x3a206b];if(_0x4bc903!=='\x22'&&_0x4bc903!=='\x27')return![];_0x3a206b+=0x1;const _0x4a3961=_0x4ea958['indexOf'](_0x4bc903,_0x3a206b);if(_0x4a3961<0x0)return![];if(decodeXmlEntities(_0x4ea958['slice'](_0x3a206b,_0x4a3961))===null)return![];_0x3a206b=_0x4a3961+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x1df8d5){const _0xe7b1cf=a237_0x41c7e3;let _0x231827=0x0;const _0x54d4e0=()=>{const _0x1ec83a=a237_0x320f;while(_0x231827<_0x1df8d5[_0x1ec83a(0xf1)]&&/\s/[_0x1ec83a(0xc5)](_0x1df8d5[_0x231827]??''))_0x231827+=0x1;};_0x54d4e0();while(_0x231827<_0x1df8d5[_0xe7b1cf(0xf1)]){if(_0x1df8d5['startsWith'](_0xe7b1cf(0xc7),_0x231827)){const _0x44a09b=_0x1df8d5[_0xe7b1cf(0xc6)](_0xe7b1cf(0xdc),_0x231827+0x4);if(_0x44a09b<0x0)return!![];_0x231827=_0x44a09b+0x3,_0x54d4e0();continue;}if(_0x1df8d5[_0xe7b1cf(0xf7)]('<?',_0x231827)){const _0x36602f=_0x1df8d5[_0xe7b1cf(0xc6)]('?>',_0x231827+0x2);if(_0x36602f<0x0)return!![];_0x231827=_0x36602f+0x2,_0x54d4e0();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x1df8d5[_0xe7b1cf(0x103)](_0x231827));}function invalidMybatisSource(_0x4063a9){const _0x372144=a237_0x41c7e3;return{'sql':'','mode':_0x372144(0xf9),'error':_0x4063a9};}function findXmlTagEnd(_0x1e77e5,_0x269429){const _0x29cb08=a237_0x41c7e3;let _0x5e21c7;for(let _0x1a375b=_0x269429+0x1;_0x1a375b<_0x1e77e5[_0x29cb08(0xf1)];_0x1a375b+=0x1){const _0x167a20=_0x1e77e5[_0x1a375b];if(_0x5e21c7){if(_0x167a20===_0x5e21c7)_0x5e21c7=undefined;continue;}if(_0x167a20==='\x22'||_0x167a20==='\x27'){_0x5e21c7=_0x167a20;continue;}if(_0x167a20==='>')return _0x1a375b;}return-0x1;}function decodeXmlEntities(_0x5d5902){const _0x3d6434=a237_0x41c7e3;let _0x479987=![];const _0x32975f=_0x5d5902[_0x3d6434(0xb1)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0xa72bc6=>{const _0x3e2d96=_0x3d6434;if(_0xa72bc6===_0x3e2d96(0xa7))return'<';if(_0xa72bc6===_0x3e2d96(0xe7))return'>';if(_0xa72bc6===_0x3e2d96(0xcb))return'\x22';if(_0xa72bc6===_0x3e2d96(0xf5))return'\x27';if(_0xa72bc6==='&')return'&';const _0x515319=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x3e2d96(0xcd)](_0xa72bc6);if(_0x515319){const _0xdc5e8e=_0x515319[0x1],_0x3e8147=_0x515319[0x2],_0x57f21a=Number[_0x3e2d96(0xb0)](_0xdc5e8e??_0x3e8147??'',_0xdc5e8e?0x10:0xa);if(isValidXmlCharacter(_0x57f21a))return String[_0x3e2d96(0xff)](_0x57f21a);}return _0x479987=!![],'';});return _0x479987?null:_0x32975f;}function isValidXmlCharacter(_0x9dd215){return _0x9dd215===0x9||_0x9dd215===0xa||_0x9dd215===0xd||_0x9dd215>=0x20&&_0x9dd215<=0xd7ff||_0x9dd215>=0xe000&&_0x9dd215<=0xfffd||_0x9dd215>=0x10000&&_0x9dd215<=0x10ffff;}export function detectSqlType(_0x967483){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x967483));}function a237_0x320f(_0x30e044,_0x4fc0ac){_0x30e044=_0x30e044-0xa4;const _0x31279f=a237_0x3127();let _0x320fe5=_0x31279f[_0x30e044];return _0x320fe5;}function detectNormalizedSqlType(_0x5d2bd8){const _0x5e50ba=a237_0x41c7e3;if(_0x5d2bd8[_0x5e50ba(0xcc)])return{'type':_0x5e50ba(0xb4),'isSelectOnly':![],'isDangerous':![],'reason':_0x5d2bd8[_0x5e50ba(0xcc)]};if(!_0x5d2bd8['sql'][_0x5e50ba(0xdd)]())return{'type':_0x5e50ba(0xb4),'isSelectOnly':![],'isDangerous':![],'reason':_0x5e50ba(0xb7)};const _0x232999=stripStaticAnalysisMarkers(_0x5d2bd8[_0x5e50ba(0xd6)])[_0x5e50ba(0xb1)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x5e50ba(0xb1)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x5e50ba(0xb1)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x42f0c4=_0x232999[_0x5e50ba(0xd3)]('\x0a');let _0x526274='';for(const _0x2f0c31 of _0x42f0c4){const _0x29c24b=_0x2f0c31[_0x5e50ba(0xdd)]();if(!_0x29c24b||_0x29c24b[_0x5e50ba(0xf7)]('--')||_0x29c24b[_0x5e50ba(0xf7)]('/*'))continue;_0x526274=_0x29c24b;break;}const _0x51a231=_0x526274['toUpperCase'](),_0x4090c0=_0x5d2bd8[_0x5e50ba(0xa4)],_0x90b8d5=maskSqlTextForBlockedKeywordScan(_0x232999),_0x501ee9=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x5e50ba(0xc5)](_0x90b8d5);if(_0x4090c0===_0x5e50ba(0xad)||!_0x4090c0&&(_0x51a231['startsWith'](_0x5e50ba(0xad))||_0x51a231[_0x5e50ba(0xf7)](_0x5e50ba(0xa8)))){const _0x12ba71=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x232999);return{'type':'SELECT','isSelectOnly':!_0x12ba71,'isDangerous':_0x12ba71,'reason':_0x12ba71?_0x5e50ba(0xaa):undefined};}if(_0x4090c0==='INSERT'||!_0x4090c0&&_0x51a231[_0x5e50ba(0xf7)]('INSERT'))return{'type':_0x5e50ba(0xfd),'isSelectOnly':![],'isDangerous':_0x501ee9,'reason':_0x501ee9?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4090c0===_0x5e50ba(0xb6)||!_0x4090c0&&_0x51a231[_0x5e50ba(0xf7)](_0x5e50ba(0xb6)))return{'type':_0x5e50ba(0xb6),'isSelectOnly':![],'isDangerous':_0x501ee9,'reason':_0x501ee9?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x4090c0===_0x5e50ba(0xce)||!_0x4090c0&&_0x51a231[_0x5e50ba(0xf7)](_0x5e50ba(0xce)))return{'type':_0x5e50ba(0xce),'isSelectOnly':![],'isDangerous':!![],'reason':_0x5e50ba(0xc2)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x5e50ba(0xc5)](_0x51a231))return{'type':_0x5e50ba(0xd0),'isSelectOnly':![],'isDangerous':!![],'reason':_0x5e50ba(0xda)};return{'type':_0x5e50ba(0xb4),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x425fae){const _0x43acc1=a237_0x41c7e3;return _0x425fae[_0x43acc1(0xe6)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x43acc1(0xe6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x43acc1(0xe6)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x2607fa){const _0x57fb26=a237_0x41c7e3;return _0x2607fa[_0x57fb26(0xb1)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x57fb26(0xb1)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')[_0x57fb26(0xb1)](/#.*$/gm,'\x20')[_0x57fb26(0xb1)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x4a794d){const _0x69c024=a237_0x41c7e3,_0x52c1f8=_0x4a794d[_0x69c024(0xb1)](/#\{[^}]*\}/g,'?')[_0x69c024(0xb1)](/\$\{[^}]*\}/g,'?')[_0x69c024(0xb1)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x69c024(0xb1)](/\/\*[\s\S]*?\*\//g,''),_0x40f8b8=[],_0x473b0f=_0x52c1f8[_0x69c024(0xa5)](/FROM\s+([^\s,)(]+)/i);addTable(_0x40f8b8,_0x473b0f?.[0x1]);for(const _0x4583f2 of _0x52c1f8[_0x69c024(0xbc)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x40f8b8,_0x4583f2[0x1]);}const _0x8538=_0x52c1f8[_0x69c024(0xa5)](/INTO\s+([^\s(]+)/i);addTable(_0x40f8b8,_0x8538?.[0x1]);const _0x2277e8=_0x52c1f8[_0x69c024(0xa5)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x40f8b8,_0x2277e8?.[0x1]),_0x40f8b8;}function addTable(_0x13d4f8,_0x4d7a99){const _0x2f27d7=a237_0x41c7e3,_0x3bb37c=_0x4d7a99?.[_0x2f27d7(0xb1)](/[`"]/g,'');_0x3bb37c&&_0x3bb37c!==UNRESOLVED_SQL_FRAGMENT&&!_0x13d4f8[_0x2f27d7(0xba)](_0x3bb37c)&&_0x13d4f8[_0x2f27d7(0xc9)](_0x3bb37c);}function extractParameters(_0xf8531b){const _0x5e5a66=a237_0x41c7e3,_0x194223=new Set();for(const _0x343968 of _0xf8531b[_0x5e5a66(0xbc)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x343968[0x1])_0x194223['add'](_0x343968[0x1]);}return Array[_0x5e5a66(0xb5)](_0x194223);}export function validateSql(_0x572605){const _0x4b2084=a237_0x41c7e3,_0x474665=normalizeSqlForStaticAnalysis(_0x572605),_0x1dee39=detectNormalizedSqlType(_0x474665),_0x50550f=stripStaticAnalysisMarkers(_0x474665[_0x4b2084(0xd6)]),_0x5513a9=_0x474665['error']?[]:extractTables(_0x50550f),_0x50bf8f=_0x474665[_0x4b2084(0xcc)]?[]:extractParameters(_0x50550f);if(_0x1dee39['isDangerous'])return{'valid':![],'sqlType':_0x1dee39,'tables':_0x5513a9,'parameters':_0x50bf8f,'message':_0x1dee39[_0x4b2084(0xd9)]||_0x1dee39[_0x4b2084(0x102)]+_0x4b2084(0xe3)};if(_0x1dee39['type']===_0x4b2084(0xb4))return{'valid':![],'sqlType':_0x1dee39,'tables':_0x5513a9,'parameters':_0x50bf8f,'message':_0x474665['error']?_0x4b2084(0xbb)+_0x474665[_0x4b2084(0xcc)]:_0x4b2084(0xc1)};return{'valid':!![],'sqlType':_0x1dee39,'tables':_0x5513a9,'parameters':_0x50bf8f,'message':_0x1dee39['type']+_0x4b2084(0xf8)+(_0x5513a9[_0x4b2084(0xf1)]?_0x5513a9[_0x4b2084(0xf4)](',\x20'):_0x4b2084(0xd7))+(_0x50bf8f[_0x4b2084(0xf1)]?_0x4b2084(0xed)+_0x50bf8f[_0x4b2084(0xf4)](',\x20'):'')};}
|
|
1
|
+
const a237_0x3faed6=a237_0x9d54;(function(_0x5e1797,_0x205018){const _0x5b046d=a237_0x9d54,_0x5f2aaf=_0x5e1797();while(!![]){try{const _0xe72b5d=parseInt(_0x5b046d(0xea))/0x1*(-parseInt(_0x5b046d(0x125))/0x2)+-parseInt(_0x5b046d(0x115))/0x3+parseInt(_0x5b046d(0xfc))/0x4+-parseInt(_0x5b046d(0xef))/0x5*(-parseInt(_0x5b046d(0x109))/0x6)+-parseInt(_0x5b046d(0x104))/0x7+-parseInt(_0x5b046d(0xf3))/0x8*(-parseInt(_0x5b046d(0xde))/0x9)+-parseInt(_0x5b046d(0xd0))/0xa;if(_0xe72b5d===_0x205018)break;else _0x5f2aaf['push'](_0x5f2aaf['shift']());}catch(_0x4e1832){_0x5f2aaf['push'](_0x5f2aaf['shift']());}}}(a237_0x45e8,0xd14b9));const MYBATIS_OUTER_TAGS=new Map([[a237_0x3faed6(0x10b),a237_0x3faed6(0x117)],['insert',a237_0x3faed6(0xd7)],['update',a237_0x3faed6(0x10e)],['delete','DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a237_0x3faed6(0xfa),'foreach','choose',a237_0x3faed6(0x11b),a237_0x3faed6(0x10d),'trim',a237_0x3faed6(0x120),a237_0x3faed6(0x11e),'include',a237_0x3faed6(0xd3)]),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x3faed6(0x10f),a237_0x3faed6(0xf6),a237_0x3faed6(0x11b),'otherwise']);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x3faed6(0xe2);function a237_0x9d54(_0x2747fa,_0x10a335){_0x2747fa=_0x2747fa-0xd0;const _0x45e86a=a237_0x45e8();let _0x9d54c1=_0x45e86a[_0x2747fa];return _0x9d54c1;}export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';function a237_0x45e8(){const _0x30f45b=['exec','join','DELETE','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','1248564LkzdWY','WITH','SELECT','Unterminated\x20CDATA\x20section.','&','Unterminated\x20XML\x20declaration.','when','error','from','bind','^<\x5cs*(?:','set','replace','type','UNKNOWN','pop','8DKrVFo','mybatisXml','\x20query\x20targeting\x20','SQL\x20content\x20is\x20empty','outer','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','trim','indexOf','match','test','add','4896760jSDDTj','get','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','property','tagName','<![CDATA[','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','INSERT','matchAll','push','reason','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','<!--',''','225XtLnmd','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','Unable\x20to\x20detect\x20SQL\x20type.\x20','startsWith','__RABETBASE_MYBATIS_DYNAMIC_START__','\x20SET\x20','>','isDangerous','slice','has','rawName','replaceAll','336481SPRPNk','Unterminated\x20XML\x20comment.','<','include','length','635WMDxke','DDL','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','-->','319528XhxskX','\x20WHERE\x20','"','choose','toUpperCase','sql','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','where','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','2125180qzRucs','\x20with\x20parameters:\x20','statementType','parseInt','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','Unterminated\x20MyBatis\x20XML\x20tag.','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','31143cNXIMH','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','split','keys','includes','74820SnNuUP','Invalid\x20MyBatis\x20XML\x20tag.','select','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','otherwise','UPDATE','foreach',']]>'];a237_0x45e8=function(){return _0x30f45b;};return a237_0x45e8();}export const MYBATIS_INCLUDE_MARKER=a237_0x3faed6(0xf1);const UNRESOLVED_SQL_FRAGMENT=a237_0x3faed6(0x105),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x3faed6(0x11f)+[...MYBATIS_OUTER_TAGS[a237_0x3faed6(0x107)]()][a237_0x3faed6(0x112)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x5f325d){const _0x2caa2a=a237_0x3faed6,_0x5b56ab=typeof _0x5f325d==='string'?_0x5f325d:'';if(!startsWithMybatisStatementWrapper(_0x5b56ab))return{'sql':_0x5b56ab,'mode':_0x2caa2a(0xf8)};let _0xdaafd7=0x0,_0x573d25='',_0x3278de,_0x5b6490=![],_0x2eb5ce=![];const _0x4a22a9=[];while(_0xdaafd7<_0x5b56ab[_0x2caa2a(0xee)]){if(_0x5b56ab[_0x2caa2a(0xe1)](_0x2caa2a(0xdc),_0xdaafd7)){const _0x39ae69=_0x5b56ab[_0x2caa2a(0x12c)]('-->',_0xdaafd7+0x4);if(_0x39ae69<0x0)return invalidMybatisSource(_0x2caa2a(0xeb));_0x573d25+='\x20',_0xdaafd7=_0x39ae69+0x3;continue;}if(_0x5b56ab[_0x2caa2a(0xe1)](_0x2caa2a(0xd5),_0xdaafd7)){if(!_0x5b6490||_0x2eb5ce)return invalidMybatisSource(_0x2caa2a(0xdb));const _0x4719a8=_0x5b56ab['indexOf'](_0x2caa2a(0x110),_0xdaafd7+0x9);if(_0x4719a8<0x0)return invalidMybatisSource(_0x2caa2a(0x118));_0x573d25+=_0x5b56ab[_0x2caa2a(0xe6)](_0xdaafd7+0x9,_0x4719a8),_0xdaafd7=_0x4719a8+0x3;continue;}if(_0x5b56ab['startsWith']('<?',_0xdaafd7)){if(_0x5b6490)return invalidMybatisSource(_0x2caa2a(0x114));const _0x1b6df9=_0x5b56ab[_0x2caa2a(0x12c)]('?>',_0xdaafd7+0x2);if(_0x1b6df9<0x0)return invalidMybatisSource(_0x2caa2a(0x11a));_0x573d25+='\x20',_0xdaafd7=_0x1b6df9+0x2;continue;}if(_0x5b56ab[_0xdaafd7]!=='<'){const _0x30d0c7=_0x5b56ab[_0x2caa2a(0x12c)]('<',_0xdaafd7),_0x3fa8e3=_0x30d0c7<0x0?_0x5b56ab['length']:_0x30d0c7,_0x75d35a=_0x5b56ab['slice'](_0xdaafd7,_0x3fa8e3);if((!_0x5b6490||_0x2eb5ce)&&_0x75d35a[_0x2caa2a(0x12b)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x5b6490&&!_0x2eb5ce){const _0x5355af=decodeXmlEntities(_0x75d35a);if(_0x5355af===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0x573d25+=_0x5355af;}else _0x573d25+='\x20';_0xdaafd7=_0x3fa8e3;continue;}const _0x2df4a1=findXmlTagEnd(_0x5b56ab,_0xdaafd7);if(_0x2df4a1<0x0)return invalidMybatisSource(_0x2caa2a(0x102));const _0x3f170a=_0x5b56ab[_0x2caa2a(0xe6)](_0xdaafd7,_0x2df4a1+0x1),_0x131ead=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x2caa2a(0x111)](_0x3f170a);if(!_0x131ead)return invalidMybatisSource(_0x2caa2a(0x10a));const _0x509ea2=_0x131ead[0x1]==='/',_0x469480=_0x131ead[0x2]??'',_0xc25916=_0x469480['toLowerCase'](),_0x44ee40=_0x131ead[0x3]??'',_0x431c97=_0x131ead[0x4]==='/',_0x4ae4ef=MYBATIS_OUTER_TAGS[_0x2caa2a(0xd1)](_0xc25916);if(!_0x4ae4ef&&!MYBATIS_DYNAMIC_TAGS[_0x2caa2a(0xe7)](_0xc25916))return invalidMybatisSource(_0x2caa2a(0x100)+_0xc25916+'>.');if(!_0x4ae4ef&&_0x469480!==_0xc25916)return invalidMybatisSource(_0x2caa2a(0xdf)+_0x469480+'>.');if(_0x509ea2){if(_0x44ee40[_0x2caa2a(0x12b)]()||_0x431c97)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x469480+'>.');const _0x3bd58a=_0x4a22a9['at'](-0x1);if(!_0x3bd58a||(_0x3bd58a[_0x2caa2a(0x129)]?_0x3bd58a[_0x2caa2a(0xd4)]!==_0xc25916:_0x3bd58a[_0x2caa2a(0xe8)]!==_0x469480))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x469480+'>.');_0x4a22a9[_0x2caa2a(0x124)]();if(_0x3bd58a[_0x2caa2a(0x129)])_0x2eb5ce=!![];_0x573d25+=MYBATIS_BRANCH_TAGS['has'](_0xc25916)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x44ee40))return invalidMybatisSource(_0x2caa2a(0xd2)+_0x469480+'>.');if(_0xc25916===_0x2caa2a(0xd3)&&(!_0x431c97||_0x4a22a9['at'](-0x1)?.[_0x2caa2a(0xd4)]!=='include'))return invalidMybatisSource(_0x2caa2a(0xf9));if(_0x4ae4ef){if(_0x5b6490||_0x4a22a9[_0x2caa2a(0xee)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x5b6490=!![],_0x2eb5ce=_0x431c97,_0x3278de=_0x4ae4ef;}else{if(!_0x5b6490||_0x2eb5ce)return invalidMybatisSource(_0x2caa2a(0x103)+_0x469480+'>.');}_0x573d25+=_0xc25916===_0x2caa2a(0xfa)?_0x2caa2a(0xf4):_0xc25916===_0x2caa2a(0x120)?_0x2caa2a(0xe3):_0xc25916===_0x2caa2a(0xed)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0xc25916)&&!_0x431c97?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x431c97&&_0x4a22a9[_0x2caa2a(0xd9)]({'rawName':_0x469480,'tagName':_0xc25916,'outer':!!_0x4ae4ef});}_0xdaafd7=_0x2df4a1+0x1;}if(_0x4a22a9[_0x2caa2a(0xee)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x4a22a9['at'](-0x1)?.[_0x2caa2a(0xe8)]+'>.');if(!_0x5b6490||!_0x2eb5ce)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x573d25[_0x2caa2a(0x12b)](),'mode':_0x2caa2a(0x126),..._0x3278de?{'statementType':_0x3278de}:{}};}function hasWellFormedXmlAttributes(_0xf8b3e1){const _0xf47652=a237_0x3faed6;let _0x401fb3=0x0;const _0x1b6fed=new Set();while(_0x401fb3<_0xf8b3e1[_0xf47652(0xee)]){while(_0x401fb3<_0xf8b3e1[_0xf47652(0xee)]&&/\s/[_0xf47652(0x12e)](_0xf8b3e1[_0x401fb3]??''))_0x401fb3+=0x1;if(_0x401fb3>=_0xf8b3e1[_0xf47652(0xee)])return!![];const _0x56afaa=/^[A-Za-z_:][\w:.-]*/[_0xf47652(0x111)](_0xf8b3e1[_0xf47652(0xe6)](_0x401fb3)),_0x28d774=_0x56afaa?.[0x0];if(!_0x28d774||_0x1b6fed[_0xf47652(0xe7)](_0x28d774))return![];_0x1b6fed[_0xf47652(0x12f)](_0x28d774),_0x401fb3+=_0x28d774[_0xf47652(0xee)];while(_0x401fb3<_0xf8b3e1[_0xf47652(0xee)]&&/\s/[_0xf47652(0x12e)](_0xf8b3e1[_0x401fb3]??''))_0x401fb3+=0x1;if(_0xf8b3e1[_0x401fb3]!=='=')return![];_0x401fb3+=0x1;while(_0x401fb3<_0xf8b3e1['length']&&/\s/['test'](_0xf8b3e1[_0x401fb3]??''))_0x401fb3+=0x1;const _0x11c2c=_0xf8b3e1[_0x401fb3];if(_0x11c2c!=='\x22'&&_0x11c2c!=='\x27')return![];_0x401fb3+=0x1;const _0x17d3c9=_0xf8b3e1[_0xf47652(0x12c)](_0x11c2c,_0x401fb3);if(_0x17d3c9<0x0)return![];if(decodeXmlEntities(_0xf8b3e1['slice'](_0x401fb3,_0x17d3c9))===null)return![];_0x401fb3=_0x17d3c9+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0xa4148b){const _0x26c66f=a237_0x3faed6;let _0x599f5c=0x0;const _0x17dfa2=()=>{const _0xa08af=a237_0x9d54;while(_0x599f5c<_0xa4148b['length']&&/\s/[_0xa08af(0x12e)](_0xa4148b[_0x599f5c]??''))_0x599f5c+=0x1;};_0x17dfa2();while(_0x599f5c<_0xa4148b['length']){if(_0xa4148b['startsWith'](_0x26c66f(0xdc),_0x599f5c)){const _0x518673=_0xa4148b[_0x26c66f(0x12c)](_0x26c66f(0xf2),_0x599f5c+0x4);if(_0x518673<0x0)return!![];_0x599f5c=_0x518673+0x3,_0x17dfa2();continue;}if(_0xa4148b[_0x26c66f(0xe1)]('<?',_0x599f5c)){const _0xd88480=_0xa4148b[_0x26c66f(0x12c)]('?>',_0x599f5c+0x2);if(_0xd88480<0x0)return!![];_0x599f5c=_0xd88480+0x2,_0x17dfa2();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x26c66f(0x12e)](_0xa4148b[_0x26c66f(0xe6)](_0x599f5c));}function invalidMybatisSource(_0xad1339){return{'sql':'','mode':'mybatisXml','error':_0xad1339};}function findXmlTagEnd(_0x2603f6,_0x33abb8){const _0x1aeab8=a237_0x3faed6;let _0x359830;for(let _0x52a4c6=_0x33abb8+0x1;_0x52a4c6<_0x2603f6[_0x1aeab8(0xee)];_0x52a4c6+=0x1){const _0x52ff60=_0x2603f6[_0x52a4c6];if(_0x359830){if(_0x52ff60===_0x359830)_0x359830=undefined;continue;}if(_0x52ff60==='\x22'||_0x52ff60==='\x27'){_0x359830=_0x52ff60;continue;}if(_0x52ff60==='>')return _0x52a4c6;}return-0x1;}function decodeXmlEntities(_0x2782a9){const _0x35ca74=a237_0x3faed6;let _0x2ccf4b=![];const _0x2b4fa7=_0x2782a9[_0x35ca74(0x121)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x5ee4b5=>{const _0x31b739=_0x35ca74;if(_0x5ee4b5===_0x31b739(0xec))return'<';if(_0x5ee4b5===_0x31b739(0xe4))return'>';if(_0x5ee4b5===_0x31b739(0xf5))return'\x22';if(_0x5ee4b5===_0x31b739(0xdd))return'\x27';if(_0x5ee4b5===_0x31b739(0x119))return'&';const _0xfc8b80=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x31b739(0x111)](_0x5ee4b5);if(_0xfc8b80){const _0x24be0e=_0xfc8b80[0x1],_0x3ce003=_0xfc8b80[0x2],_0x553e21=Number[_0x31b739(0xff)](_0x24be0e??_0x3ce003??'',_0x24be0e?0x10:0xa);if(isValidXmlCharacter(_0x553e21))return String['fromCodePoint'](_0x553e21);}return _0x2ccf4b=!![],'';});return _0x2ccf4b?null:_0x2b4fa7;}function isValidXmlCharacter(_0xc650dd){return _0xc650dd===0x9||_0xc650dd===0xa||_0xc650dd===0xd||_0xc650dd>=0x20&&_0xc650dd<=0xd7ff||_0xc650dd>=0xe000&&_0xc650dd<=0xfffd||_0xc650dd>=0x10000&&_0xc650dd<=0x10ffff;}export function detectSqlType(_0x239465){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x239465));}function detectNormalizedSqlType(_0x46d5a8){const _0x198e1c=a237_0x3faed6;if(_0x46d5a8[_0x198e1c(0x11c)])return{'type':_0x198e1c(0x123),'isSelectOnly':![],'isDangerous':![],'reason':_0x46d5a8['error']};if(!_0x46d5a8['sql']['trim']())return{'type':_0x198e1c(0x123),'isSelectOnly':![],'isDangerous':![],'reason':_0x198e1c(0x128)};const _0x6edf48=stripStaticAnalysisMarkers(_0x46d5a8[_0x198e1c(0xf8)])['replace'](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x198e1c(0x121)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x198e1c(0x121)](/\/\*[\s\S]*?\*\//g,'')[_0x198e1c(0x12b)](),_0x1770ce=_0x6edf48[_0x198e1c(0x106)]('\x0a');let _0x11187e='';for(const _0x5eeb63 of _0x1770ce){const _0x5d0be7=_0x5eeb63[_0x198e1c(0x12b)]();if(!_0x5d0be7||_0x5d0be7[_0x198e1c(0xe1)]('--')||_0x5d0be7[_0x198e1c(0xe1)]('/*'))continue;_0x11187e=_0x5d0be7;break;}const _0x544bcc=_0x11187e[_0x198e1c(0xf7)](),_0x5f43e6=_0x46d5a8[_0x198e1c(0xfe)],_0x986262=maskSqlTextForBlockedKeywordScan(_0x6edf48),_0x392b18=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x198e1c(0x12e)](_0x986262);if(_0x5f43e6==='SELECT'||!_0x5f43e6&&(_0x544bcc[_0x198e1c(0xe1)]('SELECT')||_0x544bcc[_0x198e1c(0xe1)](_0x198e1c(0x116)))){const _0x14235b=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x198e1c(0x12e)](_0x6edf48);return{'type':'SELECT','isSelectOnly':!_0x14235b,'isDangerous':_0x14235b,'reason':_0x14235b?_0x198e1c(0xfb):undefined};}if(_0x5f43e6===_0x198e1c(0xd7)||!_0x5f43e6&&_0x544bcc['startsWith']('INSERT'))return{'type':_0x198e1c(0xd7),'isSelectOnly':![],'isDangerous':_0x392b18,'reason':_0x392b18?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x5f43e6==='UPDATE'||!_0x5f43e6&&_0x544bcc['startsWith'](_0x198e1c(0x10e)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x392b18,'reason':_0x392b18?_0x198e1c(0x12a):undefined};if(_0x5f43e6===_0x198e1c(0x113)||!_0x5f43e6&&_0x544bcc[_0x198e1c(0xe1)]('DELETE'))return{'type':_0x198e1c(0x113),'isSelectOnly':![],'isDangerous':!![],'reason':_0x198e1c(0xd6)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x198e1c(0x12e)](_0x544bcc))return{'type':_0x198e1c(0xf0),'isSelectOnly':![],'isDangerous':!![],'reason':_0x198e1c(0x101)};return{'type':_0x198e1c(0x123),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3602f4){const _0xf81707=a237_0x3faed6;return _0x3602f4[_0xf81707(0xe9)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0xf81707(0xe9)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0xf81707(0xe9)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x5646b7){const _0x2a09f0=a237_0x3faed6;return _0x5646b7[_0x2a09f0(0x121)](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x2a09f0(0x121)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x2a09f0(0x121)](/--.*$/gm,'\x20')[_0x2a09f0(0x121)](/#.*$/gm,'\x20')[_0x2a09f0(0x121)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x458c45){const _0x5a371a=a237_0x3faed6,_0x22159c=_0x458c45['replace'](/#\{[^}]*\}/g,'?')[_0x5a371a(0x121)](/\$\{[^}]*\}/g,'?')[_0x5a371a(0x121)](/'[^']*'/g,'\x27\x27')[_0x5a371a(0x121)](/--.*$/gm,'')[_0x5a371a(0x121)](/\/\*[\s\S]*?\*\//g,''),_0x56e419=[],_0x558faf=_0x22159c[_0x5a371a(0x12d)](/FROM\s+([^\s,)(]+)/i);addTable(_0x56e419,_0x558faf?.[0x1]);for(const _0xd75507 of _0x22159c['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x56e419,_0xd75507[0x1]);}const _0x9f7e9=_0x22159c[_0x5a371a(0x12d)](/INTO\s+([^\s(]+)/i);addTable(_0x56e419,_0x9f7e9?.[0x1]);const _0x8a7c3a=_0x22159c['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x56e419,_0x8a7c3a?.[0x1]),_0x56e419;}function addTable(_0x4b3bea,_0x460dca){const _0x5a692a=a237_0x3faed6,_0x76c710=_0x460dca?.['replace'](/[`"]/g,'');_0x76c710&&_0x76c710!==UNRESOLVED_SQL_FRAGMENT&&!_0x4b3bea[_0x5a692a(0x108)](_0x76c710)&&_0x4b3bea[_0x5a692a(0xd9)](_0x76c710);}function extractParameters(_0x47b408){const _0x3b631b=a237_0x3faed6,_0x4c3e4d=new Set();for(const _0x2dc6af of _0x47b408[_0x3b631b(0xd8)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x2dc6af[0x1])_0x4c3e4d[_0x3b631b(0x12f)](_0x2dc6af[0x1]);}return Array[_0x3b631b(0x11d)](_0x4c3e4d);}export function validateSql(_0x47a5da){const _0x3c6788=a237_0x3faed6,_0x518b61=normalizeSqlForStaticAnalysis(_0x47a5da),_0x1b301c=detectNormalizedSqlType(_0x518b61),_0x3fd582=stripStaticAnalysisMarkers(_0x518b61[_0x3c6788(0xf8)]),_0x470a8e=_0x518b61['error']?[]:extractTables(_0x3fd582),_0x1be424=_0x518b61[_0x3c6788(0x11c)]?[]:extractParameters(_0x3fd582);if(_0x1b301c[_0x3c6788(0xe5)])return{'valid':![],'sqlType':_0x1b301c,'tables':_0x470a8e,'parameters':_0x1be424,'message':_0x1b301c[_0x3c6788(0xda)]||_0x1b301c[_0x3c6788(0x122)]+_0x3c6788(0x10c)};if(_0x1b301c[_0x3c6788(0x122)]===_0x3c6788(0x123))return{'valid':![],'sqlType':_0x1b301c,'tables':_0x470a8e,'parameters':_0x1be424,'message':_0x518b61['error']?_0x3c6788(0xe0)+_0x518b61['error']:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x1b301c,'tables':_0x470a8e,'parameters':_0x1be424,'message':_0x1b301c[_0x3c6788(0x122)]+_0x3c6788(0x127)+(_0x470a8e[_0x3c6788(0xee)]?_0x470a8e[_0x3c6788(0x112)](',\x20'):'unknown\x20table(s)')+(_0x1be424[_0x3c6788(0xee)]?_0x3c6788(0xfd)+_0x1be424[_0x3c6788(0x112)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a238_0x3cc05b=a238_0x2581;(function(_0x274748,_0x4a4437){const _0xac2b42=a238_0x2581,_0x3d8c90=_0x274748();while(!![]){try{const _0x232ecd=-parseInt(_0xac2b42(0x178))/0x1*(-parseInt(_0xac2b42(0x175))/0x2)+-parseInt(_0xac2b42(0x169))/0x3+-parseInt(_0xac2b42(0x170))/0x4*(parseInt(_0xac2b42(0x16e))/0x5)+parseInt(_0xac2b42(0x16b))/0x6*(-parseInt(_0xac2b42(0x172))/0x7)+-parseInt(_0xac2b42(0x176))/0x8*(-parseInt(_0xac2b42(0x171))/0x9)+-parseInt(_0xac2b42(0x167))/0xa*(-parseInt(_0xac2b42(0x173))/0xb)+parseInt(_0xac2b42(0x16f))/0xc;if(_0x232ecd===_0x4a4437)break;else _0x3d8c90['push'](_0x3d8c90['shift']());}catch(_0x5b5a9b){_0x3d8c90['push'](_0x3d8c90['shift']());}}}(a238_0x1345,0x6bcc7));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';function a238_0x2581(_0x2ac384,_0x3c3319){_0x2ac384=_0x2ac384-0x167;const _0x1345a9=a238_0x1345();let _0x2581fa=_0x1345a9[_0x2ac384];return _0x2581fa;}export{CliError};function a238_0x1345(){const _0x133518=['2145219ZWQNbh','\x20auth`\x20to\x20login\x20first.','6tLybgV','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','Run\x20`','951115DvyGrL','3052524WKuuGs','4qjzCJJ','2151HUyGuG','1408386LLbOyq','506aqaozg','\x0a\x20\x20\x20\x20\x20\x20\x20','363332yIhhul','16816rUZcMT','Tip:\x20`','3rwLoPM','53540fIejAj','Set\x20appcode\x20via\x20`'];a238_0x1345=function(){return _0x133518;};return a238_0x1345();}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a238_0x3cc05b(0x16d)+CLI_BIN_NAME+a238_0x3cc05b(0x16a),'configMissingHint':[a238_0x3cc05b(0x168)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.',a238_0x3cc05b(0x177)+CLI_BIN_NAME+a238_0x3cc05b(0x16c)]['join'](a238_0x3cc05b(0x174)),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a239_0x6732(_0x12f7bd,_0xca6a7f){_0x12f7bd=_0x12f7bd-0x1bc;const _0x247b74=a239_0x247b();let _0x6732bc=_0x247b74[_0x12f7bd];return _0x6732bc;}(function(_0x50b3e3,_0x61276a){const _0x4e0419=a239_0x6732,_0x394ec6=_0x50b3e3();while(!![]){try{const _0x78a8a7=parseInt(_0x4e0419(0x1c3))/0x1*(parseInt(_0x4e0419(0x1c9))/0x2)+-parseInt(_0x4e0419(0x1bc))/0x3*(parseInt(_0x4e0419(0x1be))/0x4)+-parseInt(_0x4e0419(0x1c8))/0x5*(-parseInt(_0x4e0419(0x1c7))/0x6)+parseInt(_0x4e0419(0x1bf))/0x7+-parseInt(_0x4e0419(0x1c0))/0x8+parseInt(_0x4e0419(0x1bd))/0x9*(-parseInt(_0x4e0419(0x1c6))/0xa)+-parseInt(_0x4e0419(0x1c5))/0xb;if(_0x78a8a7===_0x61276a)break;else _0x394ec6['push'](_0x394ec6['shift']());}catch(_0x483b96){_0x394ec6['push'](_0x394ec6['shift']());}}}(a239_0x247b,0xbbe58));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a239_0x23154e}from'@lovrabet/cli-framework';import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';function a239_0x247b(){const _0x144c9c=['5931504LKbGsz','name','map','2737oYwyCS','yes','19385135kCBgTh','665620iAnpdX','4513356GljpUn','10XtOxyE','1032KOWyId','10068npYXRs','18MmusOd','524kJArmv','6505541qemvum'];a239_0x247b=function(){return _0x144c9c;};return a239_0x247b();}export function buildAllFlags(_0x3da6a1){const _0x35f228=a239_0x6732,_0x2e9892=a239_0x23154e(_0x3da6a1,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x3da6a1))return _0x2e9892;return _0x2e9892[_0x35f228(0x1c2)](_0x2a341e=>_0x2a341e[_0x35f228(0x1c1)]===_0x35f228(0x1c4)?{..._0x2a341e,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x2a341e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x159f4d,_0x3049ee){var _0x23380a=a240_0x4f08,_0x2df56a=_0x159f4d();while(!![]){try{var _0xe5b13f=-parseInt(_0x23380a(0x1bc))/0x1+-parseInt(_0x23380a(0x1be))/0x2+parseInt(_0x23380a(0x1af))/0x3*(parseInt(_0x23380a(0x1b2))/0x4)+-parseInt(_0x23380a(0x1b0))/0x5*(-parseInt(_0x23380a(0x1b4))/0x6)+parseInt(_0x23380a(0x1ae))/0x7*(parseInt(_0x23380a(0x1b9))/0x8)+parseInt(_0x23380a(0x1bb))/0x9+-parseInt(_0x23380a(0x1b7))/0xa*(-parseInt(_0x23380a(0x1ba))/0xb);if(_0xe5b13f===_0x3049ee)break;else _0x2df56a['push'](_0x2df56a['shift']());}catch(_0x328ff3){_0x2df56a['push'](_0x2df56a['shift']());}}}(a240_0x411c,0x50c79));function a240_0x4f08(_0x3dd73e,_0x388a91){_0x3dd73e=_0x3dd73e-0x1ae;var _0x411c78=a240_0x411c();var _0x4f08fd=_0x411c78[_0x3dd73e];return _0x4f08fd;}import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x291468){var _0x29029d=a240_0x4f08;return _0x291468?.[_0x29029d(0x1b3)]===!![];}function a240_0x411c(){var _0x1ed4ff=['2563NfZwrI','210069JrPKJC','597826ourJJU','flags','676340IXllRy','2992892uOjEAi','9yAZeyA','44315KKJTSe','def','585016cjhZNM','structuredErrors','144hWuojm','compress','defaultFormat','7060FcKfHz','format','8zpTBPK'];a240_0x411c=function(){return _0x1ed4ff;};return a240_0x411c();}export function resolveErrorOutputFormat(_0x5c1153){var _0x10d55b=a240_0x4f08;if(!_0x5c1153[_0x10d55b(0x1b1)])return _0x5c1153[_0x10d55b(0x1b6)]??_0x10d55b(0x1b5);return resolveOutputConfig({'flags':_0x5c1153[_0x10d55b(0x1bd)]??{},'def':_0x5c1153['def'],'configDefault':_0x5c1153[_0x10d55b(0x1b6)]})[_0x10d55b(0x1b8)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a241_0x4b7a82=a241_0x48f2;(function(_0x305e95,_0x32fe02){const _0xfc5e99=a241_0x48f2,_0x33674a=_0x305e95();while(!![]){try{const _0xc17705=-parseInt(_0xfc5e99(0xf3))/0x1*(-parseInt(_0xfc5e99(0xed))/0x2)+parseInt(_0xfc5e99(0xf5))/0x3+parseInt(_0xfc5e99(0xe9))/0x4*(parseInt(_0xfc5e99(0xee))/0x5)+-parseInt(_0xfc5e99(0xef))/0x6+-parseInt(_0xfc5e99(0xe7))/0x7*(parseInt(_0xfc5e99(0xf2))/0x8)+-parseInt(_0xfc5e99(0xe6))/0x9*(-parseInt(_0xfc5e99(0xe8))/0xa)+parseInt(_0xfc5e99(0xec))/0xb;if(_0xc17705===_0x32fe02)break;else _0x33674a['push'](_0x33674a['shift']());}catch(_0x3456c5){_0x33674a['push'](_0x33674a['shift']());}}}(a241_0x1f9b,0x1b4fb));const EXPLICIT_YES_COMMANDS=new Set([a241_0x4b7a82(0xea),a241_0x4b7a82(0xf4),'menu\x20regroup-start','kb\x20create',a241_0x4b7a82(0xf1),'kb\x20delete']);export const EXPLICIT_YES_FLAG_DESCRIPTION=a241_0x4b7a82(0xeb);function a241_0x1f9b(){const _0x17bd58=['10CUZMTm','32OGyRBw','menu\x20external-link-update','Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan','177771NOWFUb','82jqVIuA','121210wXqcTa','634080KysoiT','has','kb\x20update','104AnvkcW','731kcomLB','menu\x20delete','197856RdVuED','service','316530tmfSPT','66577IEnESP'];a241_0x1f9b=function(){return _0x17bd58;};return a241_0x1f9b();}function a241_0x48f2(_0x33561e,_0x5234eb){_0x33561e=_0x33561e-0xe5;const _0x1f9b88=a241_0x1f9b();let _0x48f2da=_0x1f9b88[_0x33561e];return _0x48f2da;}export function requiresExplicitYes(_0xd60161){const _0x123b55=a241_0x4b7a82;return EXPLICIT_YES_COMMANDS[_0x123b55(0xf0)](_0xd60161[_0x123b55(0xe5)]+'\x20'+_0xd60161['command']);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a242_0x4349(_0x313380,_0x487537){_0x313380=_0x313380-0x17e;const _0x746aef=a242_0x746a();let _0x43498e=_0x746aef[_0x313380];return _0x43498e;}const a242_0x5402d2=a242_0x4349;(function(_0x10f5dc,_0x56943a){const _0x119ae1=a242_0x4349,_0xe67a6c=_0x10f5dc();while(!![]){try{const _0x29fa28=-parseInt(_0x119ae1(0x180))/0x1+parseInt(_0x119ae1(0x184))/0x2+parseInt(_0x119ae1(0x186))/0x3+parseInt(_0x119ae1(0x187))/0x4+-parseInt(_0x119ae1(0x182))/0x5*(parseInt(_0x119ae1(0x181))/0x6)+-parseInt(_0x119ae1(0x185))/0x7+-parseInt(_0x119ae1(0x17f))/0x8*(-parseInt(_0x119ae1(0x188))/0x9);if(_0x29fa28===_0x56943a)break;else _0xe67a6c['push'](_0xe67a6c['shift']());}catch(_0x466cbd){_0xe67a6c['push'](_0xe67a6c['shift']());}}}(a242_0x746a,0xaa919));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a242_0x746a(){const _0x2c566b=['6986165KPhJEX','validateFlags','2424766tMKyiw','7135548mwxNtE','297906MJGfnk','4523508IuMgCn','13034862bHBbVo','parseFlags','8KkMpaC','775634ukyULA','6sUMSxW'];a242_0x746a=function(){return _0x2c566b;};return a242_0x746a();}const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a242_0x5402d2(0x17e)];export const validateFlags=helpers[a242_0x5402d2(0x183)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a243_0x165ac5=a243_0x5aec;(function(_0x3e927c,_0x404a63){const _0x3c6a85=a243_0x5aec,_0x172847=_0x3e927c();while(!![]){try{const _0x3e6dda=-parseInt(_0x3c6a85(0x116))/0x1+-parseInt(_0x3c6a85(0x108))/0x2+-parseInt(_0x3c6a85(0x109))/0x3*(parseInt(_0x3c6a85(0x113))/0x4)+-parseInt(_0x3c6a85(0x119))/0x5*(-parseInt(_0x3c6a85(0x11b))/0x6)+parseInt(_0x3c6a85(0x10a))/0x7*(parseInt(_0x3c6a85(0x118))/0x8)+parseInt(_0x3c6a85(0x10f))/0x9+parseInt(_0x3c6a85(0x112))/0xa*(parseInt(_0x3c6a85(0x111))/0xb);if(_0x3e6dda===_0x404a63)break;else _0x172847['push'](_0x172847['shift']());}catch(_0x1adfdb){_0x172847['push'](_0x172847['shift']());}}}(a243_0x28d3,0xcc2d3));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';function a243_0x5aec(_0x316392,_0x55ed40){_0x316392=_0x316392-0x108;const _0x28d3ad=a243_0x28d3();let _0x5aec82=_0x28d3ad[_0x316392];return _0x5aec82;}import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{requiresExplicitYes}from'../framework/explicit-yes.js';const generators=createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x3a57c7=>serviceGroups['get'](_0x3a57c7),'buildAllFlags':buildAllFlags,'appPrerequisiteText':a243_0x165ac5(0x114)+CLI_BIN_NAME+a243_0x165ac5(0x117),'serviceUsageSuffix':a243_0x165ac5(0x10e)});function a243_0x28d3(){const _0x57b8d8=['6nrTukI','11291ZTQdcV','replace','generateFullHelp','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','\x20[args]\x20[flags]','11027637lLUCOk','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','11HGxDzW','11616910VcNSfg','2133688CPHCKt','Requires\x20appcode\x20(set\x20via\x20`','generateCommandHelp','13037TftBRf','\x20workspace\x20init`\x20or\x20--appcode).','952QmZMZN','10rxZMxp','generateServiceHelp','2606628NQXZtx','3063238vBRxTw'];a243_0x28d3=function(){return _0x57b8d8;};return a243_0x28d3();}export function generateCommandHelp(_0x1ced82){const _0x24a8a3=a243_0x165ac5,_0x226503=generators[_0x24a8a3(0x115)](_0x1ced82);if(!requiresExplicitYes(_0x1ced82))return _0x226503;return _0x226503[_0x24a8a3(0x10b)](_0x24a8a3(0x110),_0x24a8a3(0x10d));}export const generateServiceHelp=generators[a243_0x165ac5(0x11a)];export const generateFullHelp=generators[a243_0x165ac5(0x10c)];
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5b0b6a,_0x4f985c){var _0x9eff6c=a244_0x1759,_0x2181fb=_0x5b0b6a();while(!![]){try{var _0x117e51=parseInt(_0x9eff6c(0x1f9))/0x1+parseInt(_0x9eff6c(0x1f2))/0x2+parseInt(_0x9eff6c(0x1f3))/0x3+parseInt(_0x9eff6c(0x1f6))/0x4*(parseInt(_0x9eff6c(0x1f8))/0x5)+-parseInt(_0x9eff6c(0x1fa))/0x6*(parseInt(_0x9eff6c(0x1f7))/0x7)+parseInt(_0x9eff6c(0x1f4))/0x8+-parseInt(_0x9eff6c(0x1f5))/0x9*(parseInt(_0x9eff6c(0x1f1))/0xa);if(_0x117e51===_0x4f985c)break;else _0x2181fb['push'](_0x2181fb['shift']());}catch(_0x579bbf){_0x2181fb['push'](_0x2181fb['shift']());}}}(a244_0x4efc,0x3fe9f));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';function a244_0x1759(_0x24154c,_0x1aefe2){_0x24154c=_0x24154c-0x1f1;var _0x4efcd2=a244_0x4efc();var _0x1759c1=_0x4efcd2[_0x24154c];return _0x1759c1;}export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';function a244_0x4efc(){var _0x23aa30=['582buyoKP','2104710nZXHAy','979808RvAfPM','885795DcawNh','3200600VqmIvp','45UYZEQB','48baOoTT','28693oNPiLO','39905BHuKHm','430733vAozkY'];a244_0x4efc=function(){return _0x23aa30;};return a244_0x4efc();}export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a379a,_0xb2659){const _0x37a05e=a245_0x2910,_0x270dd8=_0x2a379a();while(!![]){try{const _0x547c71=parseInt(_0x37a05e(0xaa))/0x1*(parseInt(_0x37a05e(0xa5))/0x2)+parseInt(_0x37a05e(0xb1))/0x3*(-parseInt(_0x37a05e(0xae))/0x4)+parseInt(_0x37a05e(0xa1))/0x5+parseInt(_0x37a05e(0xab))/0x6+parseInt(_0x37a05e(0x9d))/0x7*(parseInt(_0x37a05e(0xb3))/0x8)+-parseInt(_0x37a05e(0x9e))/0x9*(-parseInt(_0x37a05e(0x9b))/0xa)+-parseInt(_0x37a05e(0x9c))/0xb;if(_0x547c71===_0xb2659)break;else _0x270dd8['push'](_0x270dd8['shift']());}catch(_0x46961c){_0x270dd8['push'](_0x270dd8['shift']());}}}(a245_0x37be,0x3645b));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';function a245_0x37be(){const _0x2b4730=['6874qmXWfF','369RkaIZN','_notice','stringify','1374900mzTaqc','message','update','write','176270gfgPjP','pretty','format','jqFilter','code','5hnMfhY','122346yRJLPN','trim','validation','184204aUeCOD','error','risk','9oZAHpn','hint','1992XLSEHe','105050elHxkH','11558987RBueKe'];a245_0x37be=function(){return _0x2b4730;};return a245_0x37be();}const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x51277c,_0x5927b1){const _0x23c570=a245_0x2910,_0x390761=_0x51277c[_0x23c570(0x9f)],{_notice:_0x267bbb,..._0x3a5c8c}=_0x51277c;void _0x267bbb,baseFormatOutput(_0x3a5c8c,_0x5927b1),_0x5927b1[_0x23c570(0xa7)]===_0x23c570(0xa6)&&printPrettyNotice(_0x390761);}function a245_0x2910(_0x3ba3f6,_0x3f3cc4){_0x3ba3f6=_0x3ba3f6-0x9b;const _0x37be63=a245_0x37be();let _0x2910a6=_0x37be63[_0x3ba3f6];return _0x2910a6;}export function formatCliError(_0x42c728,_0x348c9a){const _0x269ea0=a245_0x2910;if(_0x348c9a[_0x269ea0(0xa7)]===_0x269ea0(0xa6))return![];const _0x2e471b=_0x42c728['data'],_0x2403df={'ok':![],'command':_0x348c9a['command'],'risk':_0x348c9a[_0x269ea0(0xb0)],'data':_0x2e471b??null,'error':{'code':_0x42c728[_0x269ea0(0xa9)],'message':_0x42c728[_0x269ea0(0xa2)],..._0x42c728[_0x269ea0(0xb2)]?{'hint':_0x42c728['hint']}:{}}},_0x4ddebe=_0x348c9a['format']==='json'?JSON['stringify'](_0x2403df,null,0x2):JSON[_0x269ea0(0xa0)](_0x2403df);let _0x4c2524=_0x4ddebe;if(_0x348c9a['jqFilter']?.[_0x269ea0(0xac)]())try{_0x4c2524=applyJqFilter(_0x4ddebe,_0x348c9a[_0x269ea0(0xa8)]);}catch(_0x2b2e2f){const _0x21f3a4=_0x2b2e2f instanceof CliError?_0x2b2e2f:CliErrors[_0x269ea0(0xad)]('jq:\x20'+(_0x2b2e2f instanceof Error?_0x2b2e2f[_0x269ea0(0xa2)]:String(_0x2b2e2f))),_0x32641a={..._0x2403df,'error':{'code':_0x21f3a4[_0x269ea0(0xa9)],'message':_0x21f3a4[_0x269ea0(0xa2)],..._0x21f3a4[_0x269ea0(0xb2)]?{'hint':_0x21f3a4['hint']}:{},'cause':_0x2403df['error']}};_0x4c2524=_0x348c9a[_0x269ea0(0xa7)]==='json'?JSON['stringify'](_0x32641a,null,0x2):JSON['stringify'](_0x32641a);}return process['stdout'][_0x269ea0(0xa4)](_0x4c2524['endsWith']('\x0a')?_0x4c2524:_0x4c2524+'\x0a'),!![];}function printPrettyNotice(_0x1e721d){const _0x2798c4=a245_0x2910;if(!_0x1e721d?.['update'])return;console[_0x2798c4(0xaf)](_0x1e721d[_0x2798c4(0xa3)][_0x2798c4(0xa2)]+'\x20('+_0x1e721d[_0x2798c4(0xa3)]['url']+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a246_0xfe0e(){var _0x54befa=['23984257qHmFxF','574191pGdAzf','6373190yNiMKT','63SSggqS','14055SKztSz','4705jjfZpa','18nrtGlH','52ZuVzkE','793807okPEYc','701704IObYEO','1036ouzOFK'];a246_0xfe0e=function(){return _0x54befa;};return a246_0xfe0e();}function a246_0x2587(_0x48fda8,_0x47eb37){_0x48fda8=_0x48fda8-0x130;var _0xfe0eaf=a246_0xfe0e();var _0x258711=_0xfe0eaf[_0x48fda8];return _0x258711;}(function(_0x1891ee,_0x1d785b){var _0x37fc6d=a246_0x2587,_0x28aeb5=_0x1891ee();while(!![]){try{var _0x38cb71=parseInt(_0x37fc6d(0x139))/0x1+parseInt(_0x37fc6d(0x134))/0x2*(parseInt(_0x37fc6d(0x131))/0x3)+-parseInt(_0x37fc6d(0x137))/0x4*(-parseInt(_0x37fc6d(0x132))/0x5)+parseInt(_0x37fc6d(0x133))/0x6*(parseInt(_0x37fc6d(0x135))/0x7)+parseInt(_0x37fc6d(0x136))/0x8*(parseInt(_0x37fc6d(0x130))/0x9)+parseInt(_0x37fc6d(0x13a))/0xa+-parseInt(_0x37fc6d(0x138))/0xb;if(_0x38cb71===_0x1d785b)break;else _0x28aeb5['push'](_0x28aeb5['shift']());}catch(_0x28e057){_0x28aeb5['push'](_0x28aeb5['shift']());}}}(a246_0xfe0e,0x55a7e));export{extractList,extractPaging}from'@lovrabet/cli-framework';
|