@lovrabet/rabetbase-cli 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/guides/react-custom-page-workflow.md +9 -3
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +13 -2
- package/skills/rabetbase.manifest.json +3 -3
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a225_0x5a44(_0x43f59c,_0x5e1dcc){_0x43f59c=_0x43f59c-0x9a;const _0x3dcbf5=a225_0x3dcb();let _0x5a447e=_0x3dcbf5[_0x43f59c];return _0x5a447e;}(function(_0x4fd6a5,_0x30b9e9){const _0x1bea04=a225_0x5a44,_0x26f6e9=_0x4fd6a5();while(!![]){try{const _0x10bb77=parseInt(_0x1bea04(0xb7))/0x1+-parseInt(_0x1bea04(0xa4))/0x2*(-parseInt(_0x1bea04(0xb0))/0x3)+-parseInt(_0x1bea04(0x9d))/0x4+parseInt(_0x1bea04(0xa0))/0x5+parseInt(_0x1bea04(0x9b))/0x6*(-parseInt(_0x1bea04(0xaf))/0x7)+parseInt(_0x1bea04(0xa2))/0x8+-parseInt(_0x1bea04(0xb5))/0x9;if(_0x10bb77===_0x30b9e9)break;else _0x26f6e9['push'](_0x26f6e9['shift']());}catch(_0x600153){_0x26f6e9['push'](_0x26f6e9['shift']());}}}(a225_0x3dcb,0xecd98));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x2cea55){const _0x283308=a225_0x5a44;if(cache[_0x283308(0xa7)](_0x2cea55))return cache[_0x283308(0x9e)](_0x2cea55);const _0x78bac2=await listDatasets(_0x2cea55),_0x4a95f2=new Map();for(const _0xfb0435 of _0x78bac2){const _0x50c1be=_0xfb0435[_0x283308(0xa9)];_0x50c1be?.['dbId']!=null&&_0x4a95f2['set'](_0x50c1be[_0x283308(0xa8)],_0x50c1be[_0x283308(0x9c)]??_0x283308(0xb1)+_0x50c1be[_0x283308(0xa8)]);}const _0xca0a25=[..._0x4a95f2['entries']()]['map'](([_0x3d2e5e,_0x37ab72])=>({'dbId':_0x3d2e5e,'dbName':_0x37ab72}));return cache['set'](_0x2cea55,_0xca0a25),_0xca0a25;}export async function resolveDb(_0x1b7442,_0x3f6c8a){const _0x4aa4b1=a225_0x5a44,_0x2c9fdf=await listDatabases(_0x1b7442);if(_0x2c9fdf[_0x4aa4b1(0xb2)]===0x0)return{'resolved':[],'error':_0x4aa4b1(0xa6)+_0x1b7442+_0x4aa4b1(0xab)};if(!_0x3f6c8a)return{'resolved':_0x2c9fdf};const _0x187292=Number(_0x3f6c8a);if(!Number[_0x4aa4b1(0xb6)](_0x187292)){const _0x2a7d99=_0x2c9fdf[_0x4aa4b1(0xaa)](_0x340e65=>_0x340e65['dbId']===_0x187292);if(_0x2a7d99)return{'resolved':[_0x2a7d99]};}const _0x5c4568=_0x3f6c8a[_0x4aa4b1(0x9f)](),_0x47309b=_0x2c9fdf['filter'](_0x477a3f=>_0x477a3f[_0x4aa4b1(0x9c)][_0x4aa4b1(0x9f)]()['includes'](_0x5c4568));if(_0x47309b[_0x4aa4b1(0xb2)]>0x0)return{'resolved':_0x47309b};const _0x5056a4=_0x2c9fdf[_0x4aa4b1(0xa3)](_0x273552=>_0x273552[_0x4aa4b1(0x9c)]+'\x20('+_0x273552['dbId']+')')[_0x4aa4b1(0xa1)](',\x20');return{'resolved':[],'error':_0x4aa4b1(0xa5)+_0x3f6c8a+_0x4aa4b1(0xac)+_0x1b7442+_0x4aa4b1(0xb3)+_0x5056a4+_0x4aa4b1(0x9a)};}export async function resolveOneDb(_0x41228f,_0x59365f){const _0x1f2b27=a225_0x5a44,{resolved:_0x4d572f,error:_0x46994a}=await resolveDb(_0x41228f,_0x59365f);if(_0x46994a)return{'db':null,'error':_0x46994a};if(_0x4d572f[_0x1f2b27(0xb2)]===0x1)return{'db':_0x4d572f[0x0]};if(!_0x59365f){const _0x5baff1=_0x4d572f['map'](_0xf7f7ad=>_0xf7f7ad[_0x1f2b27(0x9c)]+'\x20('+_0xf7f7ad[_0x1f2b27(0xa8)]+')')[_0x1f2b27(0xa1)](',\x20');return{'db':null,'error':_0x1f2b27(0xae)+_0x5baff1};}const _0x18802f=_0x4d572f[_0x1f2b27(0xa3)](_0x1034ff=>_0x1034ff[_0x1f2b27(0x9c)]+'\x20('+_0x1034ff[_0x1f2b27(0xa8)]+')')[_0x1f2b27(0xa1)](',\x20');return{'db':null,'error':'\x22'+_0x59365f+_0x1f2b27(0xb4)+_0x18802f+_0x1f2b27(0xad)};}export async function getDbName(_0x470231,_0x2bad8d){const _0x4778b1=a225_0x5a44,_0x573d9b=await listDatabases(_0x470231);return _0x573d9b[_0x4778b1(0xaa)](_0x15bad0=>_0x15bad0[_0x4778b1(0xa8)]===_0x2bad8d)?.['dbName'];}function a225_0x3dcb(){const _0x6cf7df=['has','dbId','dbtableConfig','find','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20under\x20app\x20\x22','.\x20Be\x20more\x20specific.','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','30499UUqXLx','3642BzGdmn','db-','length','\x22.\x20Available:\x20','\x22\x20matches\x20multiple\x20databases:\x20','24584292MmvtyE','isNaN','1403834wWlpYQ','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','1230udWAaE','dbName','7624788yIOFIu','get','toLowerCase','8912575gCmsks','join','11600424fRHiPF','map','3072JIKMJL','No\x20database\x20matching\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'];a225_0x3dcb=function(){return _0x6cf7df;};return a225_0x3dcb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5763ac,_0x1f12a9){const _0x1609fc=a226_0x7d40,_0x13c498=_0x5763ac();while(!![]){try{const _0x4fa370=parseInt(_0x1609fc(0x187))/0x1+parseInt(_0x1609fc(0x182))/0x2+-parseInt(_0x1609fc(0x17e))/0x3*(parseInt(_0x1609fc(0x181))/0x4)+-parseInt(_0x1609fc(0x180))/0x5+-parseInt(_0x1609fc(0x188))/0x6*(-parseInt(_0x1609fc(0x184))/0x7)+parseInt(_0x1609fc(0x17d))/0x8*(-parseInt(_0x1609fc(0x17c))/0x9)+parseInt(_0x1609fc(0x18b))/0xa;if(_0x4fa370===_0x1f12a9)break;else _0x13c498['push'](_0x13c498['shift']());}catch(_0x3aefa1){_0x13c498['push'](_0x13c498['shift']());}}}(a226_0x1d0a,0xe20a6));function a226_0x1d0a(){const _0x112382=['13073336VjNFEq','3000999ldJMMl','toUpperCase','443760kZDtmQ','4sRCeTa','904720wirZvM','appPagesDir','2471ILWYos','.rabetbase','F_OK','1682523NpRAvl','474WovLBG','.json','page.lock.json','14863440KGQTnS','9UWzUjV'];a226_0x1d0a=function(){return _0x112382;};return a226_0x1d0a();}import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a226_0x7d40(_0xf706b2,_0x34c681){_0xf706b2=_0xf706b2-0x17c;const _0x1d0a53=a226_0x1d0a();let _0x7d40bd=_0x1d0a53[_0xf706b2];return _0x7d40bd;}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1748d3,_0x5b8cef=process['cwd']()){const _0x56a7a7=a226_0x7d40,_0x1709a6=resolve(_0x5b8cef),_0x52b898=join(_0x1709a6,_0x56a7a7(0x185),'page');return{'projectRoot':_0x1709a6,'pagesBaseDir':_0x52b898,'appPagesDir':join(_0x52b898,_0x1748d3),'lockFilePath':join(_0x1709a6,'.rabetbase',_0x56a7a7(0x18a))};}export function buildPageFileName(_0x358556,_0x56a728){const _0x528dec=a226_0x7d40;return _0x358556+'-'+String(_0x56a728)[_0x528dec(0x17f)]()+_0x528dec(0x189);}export function resolvePageFilePath(_0x197ee0,_0x4681de,_0x119752){const _0x2952d0=a226_0x7d40;return join(_0x197ee0[_0x2952d0(0x183)],buildPageFileName(_0x4681de,_0x119752));}export async function ensureParentDirectory(_0x3772a6){await mkdir(dirname(_0x3772a6),{'recursive':!![]});}export async function fileExists(_0xbdaf8){const _0x37977d=a226_0x7d40;try{return await access(_0xbdaf8,constants[_0x37977d(0x186)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x467d2a,_0xfef3cb){const _0x1c02c2=a227_0x10c7,_0x15b478=_0x467d2a();while(!![]){try{const _0x1ccdfd=-parseInt(_0x1c02c2(0x14b))/0x1*(parseInt(_0x1c02c2(0x154))/0x2)+-parseInt(_0x1c02c2(0x152))/0x3+parseInt(_0x1c02c2(0x155))/0x4*(parseInt(_0x1c02c2(0x146))/0x5)+-parseInt(_0x1c02c2(0x14f))/0x6+-parseInt(_0x1c02c2(0x14e))/0x7*(-parseInt(_0x1c02c2(0x153))/0x8)+parseInt(_0x1c02c2(0x149))/0x9*(parseInt(_0x1c02c2(0x14d))/0xa)+parseInt(_0x1c02c2(0x145))/0xb;if(_0x1ccdfd===_0xfef3cb)break;else _0x15b478['push'](_0x15b478['shift']());}catch(_0x2c91ee){_0x15b478['push'](_0x15b478['shift']());}}}(a227_0x301c,0x95982));import a227_0x342e50 from'node:crypto';import{readFile}from'node:fs/promises';function a227_0x10c7(_0x184e39,_0x4bf603){_0x184e39=_0x184e39-0x145;const _0x301ca8=a227_0x301c();let _0x10c7fc=_0x301ca8[_0x184e39];return _0x10c7fc;}export function serializePageSchemaForFile(_0x28e993){const _0x13b641=a227_0x10c7;return JSON[_0x13b641(0x14a)](JSON['parse'](_0x28e993),null,0x2)+'\x0a';}function a227_0x301c(){const _0x377ca5=['40ehAydb','36110LHMEfu','1624144KAqqkq','16557277BbVDff','5KpUPxF','hex','update','23094HBfQAw','stringify','23OdxzRw','createHash','500UdfTPL','225631rCDRTl','1910586NoeINW','digest','utf8','2562822mRklDS'];a227_0x301c=function(){return _0x377ca5;};return a227_0x301c();}export function computePageContentHash(_0x3e40d4){const _0x123240=a227_0x10c7;return a227_0x342e50[_0x123240(0x14c)]('md5')[_0x123240(0x148)](_0x3e40d4)[_0x123240(0x150)](_0x123240(0x147));}export function computeSerializedSchemaHash(_0x2c4104){return computePageContentHash(serializePageSchemaForFile(_0x2c4104));}export async function computePageFileHash(_0xe25573){const _0x10c3e6=a227_0x10c7,_0x2d2ed9=await readFile(_0xe25573,_0x10c3e6(0x151));return computePageContentHash(_0x2d2ed9);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x34e4c2,_0x4fd529){const _0x5aa9ac=a228_0x55f6,_0x48a975=_0x34e4c2();while(!![]){try{const _0x221cfa=-parseInt(_0x5aa9ac(0x12b))/0x1+parseInt(_0x5aa9ac(0x132))/0x2+parseInt(_0x5aa9ac(0x137))/0x3+-parseInt(_0x5aa9ac(0x131))/0x4+parseInt(_0x5aa9ac(0x12c))/0x5+parseInt(_0x5aa9ac(0x135))/0x6+-parseInt(_0x5aa9ac(0x12d))/0x7;if(_0x221cfa===_0x4fd529)break;else _0x48a975['push'](_0x48a975['shift']());}catch(_0x4002ad){_0x48a975['push'](_0x48a975['shift']());}}}(a228_0x2804,0xb063d));import{mkdir,readFile,writeFile}from'node:fs/promises';function a228_0x55f6(_0x3c24cc,_0x3100e5){_0x3c24cc=_0x3c24cc-0x127;const _0x280402=a228_0x2804();let _0x55f602=_0x280402[_0x3c24cc];return _0x55f602;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x15344b,_0x178ea0){const _0x453dc9=a228_0x55f6,_0x50866f={'apps':_0x15344b[_0x453dc9(0x128)]&&typeof _0x15344b[_0x453dc9(0x128)]==='object'?_0x15344b[_0x453dc9(0x128)]:{}};let _0x3889a0=_0x50866f[_0x453dc9(0x128)][_0x178ea0];if(!_0x3889a0)return _0x3889a0={'lastSync':'','pages':{}},_0x50866f[_0x453dc9(0x128)][_0x178ea0]=_0x3889a0,{'lockData':_0x50866f,'appLock':_0x3889a0};return!_0x3889a0[_0x453dc9(0x127)]&&(_0x3889a0[_0x453dc9(0x127)]=''),(!_0x3889a0['pages']||typeof _0x3889a0[_0x453dc9(0x134)]!=='object')&&(_0x3889a0[_0x453dc9(0x134)]={}),{'lockData':_0x50866f,'appLock':_0x3889a0};}export async function readPageLockFile(_0x7314c1){const _0x451fcf=a228_0x55f6;try{const _0x436133=await readFile(_0x7314c1,'utf8'),_0x5da39a=JSON[_0x451fcf(0x12f)](_0x436133);return{'apps':_0x5da39a[_0x451fcf(0x128)]&&typeof _0x5da39a['apps']===_0x451fcf(0x130)?_0x5da39a[_0x451fcf(0x128)]:{}};}catch(_0x2dd49b){if(_0x2dd49b[_0x451fcf(0x136)]===_0x451fcf(0x12a))return null;throw new Error(_0x451fcf(0x12e)+String(_0x2dd49b));}}function a228_0x2804(){const _0x4d2d74=['2125062ToQQSu','utf8','pages','5772288jKhMff','code','2405736ktveSY','lastSync','apps','stringify','ENOENT','153195PWkNni','6560500WheegU','21240303CYnocd','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','parse','object','914296ZswnTP'];a228_0x2804=function(){return _0x4d2d74;};return a228_0x2804();}export async function writePageLockFile(_0x355c79,_0x2e4ea1){const _0x1afe02=a228_0x55f6;await mkdir(dirname(_0x355c79),{'recursive':!![]}),await writeFile(_0x355c79,JSON[_0x1afe02(0x129)](_0x2e4ea1,null,0x2),_0x1afe02(0x133));}
|
|
@@ -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_0x36d5(){const _0x139b59=['5173405NKnFTY','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','2143984BnyisK','JOIN_PREDICATE_UNSUPPORTED','48dAYDaR','INNER','max','3583953pcGdau','containsUnresolvedInclude','unsupportedReason','indexes','includes','trim','indexOf','matchedPrefix','__sq__','where','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','exec','some','slice','split','sql','toUpperCase','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','natural','reduce','1768062SfuefK','unknown','error','tableName','add','replace','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','startsWith','from','right','30XBBtcr','\x5cs*\x5c.\x5cs*[\x5cw$]+','warning','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','columns','push','cross','21ExMTzB','124lxSvkB','left','position','replaceAll','endsWith','min','table','JOIN_INDEX_NOT_USABLE','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','length','\x5c$&','141720WKPjBJ','test','16138859JQkkfy','map','filter','unavailable','alias','matchAll','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','inner','join','10531daMvUk','INDEX_METADATA_UNAVAILABLE','index','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','search','full','has','metadataAvailable','using'];a230_0x36d5=function(){return _0x139b59;};return a230_0x36d5();}(function(_0x52cf5e,_0x4bda8c){const _0x33a7b8=a230_0x1319,_0x240c4e=_0x52cf5e();while(!![]){try{const _0x25bf58=parseInt(_0x33a7b8(0x193))/0x1*(parseInt(_0x33a7b8(0x1ca))/0x2)+-parseInt(_0x33a7b8(0x1a1))/0x3*(parseInt(_0x33a7b8(0x187))/0x4)+-parseInt(_0x33a7b8(0x19d))/0x5+-parseInt(_0x33a7b8(0x1b8))/0x6+parseInt(_0x33a7b8(0x1c9))/0x7*(-parseInt(_0x33a7b8(0x19f))/0x8)+parseInt(_0x33a7b8(0x1a4))/0x9*(parseInt(_0x33a7b8(0x1c2))/0xa)+parseInt(_0x33a7b8(0x189))/0xb;if(_0x25bf58===_0x4bda8c)break;else _0x240c4e['push'](_0x240c4e['shift']());}catch(_0xf91c1f){_0x240c4e['push'](_0x240c4e['shift']());}}}(a230_0x36d5,0x9606e));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x398caf,_0x7db7b7){const _0x365b7c=a230_0x1319,_0x28448e=[],_0x1b4973=normalizeSqlForStaticAnalysis(_0x398caf),_0x144ae2=(_0x1b4973[_0x365b7c(0x1ba)]?[]:extractJoinFacts(_0x1b4973[_0x365b7c(0x1b3)]))[_0x365b7c(0x18a)](_0x4c8bee=>{const _0x35463c=_0x365b7c;if(_0x4c8bee['unsupportedPredicate']||_0x4c8bee[_0x35463c(0x1c6)]['length']===0x0)return _0x28448e[_0x35463c(0x1c7)]({'code':_0x35463c(0x1a0),'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'reason':_0x4c8bee[_0x35463c(0x1a6)]??_0x35463c(0x196)}),{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee['alias'],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':'unavailable'};const _0xf4ab4d=resolveTableMetadata(_0x7db7b7,_0x4c8bee['table']),_0x3fa8eb=(_0xf4ab4d?.['indexes']??[])[_0x35463c(0x18a)](_0x77ac08=>({'index':_0x77ac08,'matchedPrefix':findEqualityPrefix(_0x77ac08[_0x35463c(0x1c6)],_0x4c8bee[_0x35463c(0x1c6)])}))[_0x35463c(0x18b)](_0x379f1a=>_0x379f1a['matchedPrefix'][_0x35463c(0x1d4)]>0x0),_0x4d12bb=_0x3fa8eb[_0x35463c(0x1b7)]((_0x16a03d,_0xf7b7ce)=>!_0x16a03d||_0xf7b7ce[_0x35463c(0x1ab)][_0x35463c(0x1d4)]>_0x16a03d[_0x35463c(0x1ab)][_0x35463c(0x1d4)]?_0xf7b7ce:_0x16a03d,_0x3fa8eb[0x0]);if(_0x4d12bb)return{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':'covered','matchedIndex':{..._0x4d12bb[_0x35463c(0x195)],'matchedPrefix':_0x4d12bb[_0x35463c(0x1ab)]}};const _0x47fc1e=_0xf4ab4d?.[_0x35463c(0x1a7)]['filter'](_0x598d48=>_0x598d48[_0x35463c(0x1c6)][_0x35463c(0x1b0)](_0x426f41=>_0x4c8bee[_0x35463c(0x1c6)][_0x35463c(0x1b0)](_0x14f557=>columnNamesMatch(_0x426f41,_0x14f557))))??[];if(_0x47fc1e[_0x35463c(0x1d4)]>0x0)return _0x28448e[_0x35463c(0x1c7)]({'code':_0x35463c(0x1d1),'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'reason':_0x35463c(0x19e)}),{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':_0x35463c(0x1c4),'candidateIndexes':_0x47fc1e};if(_0xf4ab4d&&_0xf4ab4d[_0x35463c(0x19b)]!==![]&&_0xf4ab4d[_0x35463c(0x1a7)][_0x35463c(0x1d4)]>0x0&&_0x4c8bee[_0x35463c(0x1c6)][_0x35463c(0x1d4)]>0x0)return _0x28448e[_0x35463c(0x1c7)]({'code':'JOIN_INDEX_MISSING','table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee['alias'],'columns':_0x4c8bee['columns'],'reason':_0x35463c(0x190)}),{'table':_0x4c8bee['table'],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':_0x35463c(0x1c4)};return _0x28448e[_0x35463c(0x1c7)]({'code':_0x35463c(0x194),'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee['alias'],'columns':_0x4c8bee[_0x35463c(0x1c6)],'reason':_0xf4ab4d?_0x35463c(0x1ae):_0x35463c(0x197)}),{'table':_0x4c8bee[_0x35463c(0x1d0)],'alias':_0x4c8bee[_0x35463c(0x18d)],'columns':_0x4c8bee[_0x35463c(0x1c6)],'status':_0x35463c(0x18c)};});return{'checked':_0x144ae2[_0x365b7c(0x1d4)]>0x0,'joins':_0x144ae2,'warnings':_0x28448e};}function extractJoinFacts(_0x47f7cb){const _0x37aa8a=a230_0x1319,_0x2dd0a4=maskNestedQueries(stripSqlNoise(_0x47f7cb)),_0x14cd43=maskQuotedIdentifiers(_0x2dd0a4),_0x3828bd=[],_0x2fb3af=new Set(),_0x2998ba=/\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 _0x3b04d5 of _0x2dd0a4[_0x37aa8a(0x18e)](_0x2998ba)){const _0x3f77b7=_0x3b04d5[_0x37aa8a(0x195)]??0x0,_0x15d986=_0x3b04d5[0x0][_0x37aa8a(0x198)](/\bJOIN\b/i),_0x2674ce=_0x3f77b7+Math['max'](0x0,_0x15d986);if(!/^JOIN\b/i[_0x37aa8a(0x188)](_0x14cd43[_0x37aa8a(0x1b1)](_0x2674ce)))continue;_0x2fb3af[_0x37aa8a(0x1bc)](_0x2674ce);const _0x274729=normalizeIdentifier(_0x3b04d5[0x1]||_0x37aa8a(0x1a2)),_0x317192=normalizeIdentifier(_0x3b04d5[0x2]??''),_0x371b84=normalizeIdentifier(_0x3b04d5[0x3]||_0x317192[_0x37aa8a(0x1b2)]('.')['at'](-0x1)||_0x317192),_0x36f263=[],_0x57a292=_0x317192===_0x37aa8a(0x1ac);let _0x152b10=_0x274729===_0x37aa8a(0x1c1)||_0x274729==='full'||_0x57a292,_0x34d1bb=_0x152b10?_0x57a292?_0x37aa8a(0x1d3):_0x274729[_0x37aa8a(0x1b4)]()+_0x37aa8a(0x1b5):undefined;const _0x3c25e7=stripOuterParentheses(_0x3b04d5[0x4]??''),_0x2a84d8=_0x3c25e7[_0x37aa8a(0x1a8)](MYBATIS_DYNAMIC_START_MARKER)||_0x3c25e7[_0x37aa8a(0x1a8)](MYBATIS_DYNAMIC_END_MARKER),_0x1eeee4=_0x3c25e7['includes'](MYBATIS_INCLUDE_MARKER);_0x2a84d8&&(_0x152b10=!![],_0x34d1bb??=_0x37aa8a(0x1c5));_0x1eeee4&&(_0x152b10=!![],_0x34d1bb??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x4f0e64=_0x3c25e7[_0x37aa8a(0x1cd)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x37aa8a(0x1cd)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x37aa8a(0x1cd)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4f0e64,'OR')&&(_0x152b10=!![],_0x34d1bb??=_0x37aa8a(0x1be));for(const _0x59c09c of splitTopLevelAnd(_0x4f0e64)){const _0xe622cd=stripOuterParentheses(_0x59c09c);if(hasTopLevelKeyword(_0xe622cd,'OR')){_0x152b10=!![],_0x34d1bb??=_0x37aa8a(0x1be);continue;}const _0x1cd227=splitEquality(_0xe622cd);if(!_0x1cd227){containsColumnReference(_0x59c09c,_0x371b84)&&(_0x152b10=!![]);continue;}const _0x2fcc92=parseDirectColumnReference(_0x1cd227[0x0],_0x371b84),_0x4942b7=parseDirectColumnReference(_0x1cd227[0x1],_0x371b84),_0x2eab0f=containsColumnReference(_0x1cd227[0x0],_0x371b84),_0x3fe752=containsColumnReference(_0x1cd227[0x1],_0x371b84),_0x224d1a=_0x2fcc92&&!_0x3fe752?_0x2fcc92:_0x4942b7&&!_0x2eab0f?_0x4942b7:null;if(_0x224d1a&&!_0x36f263[_0x37aa8a(0x1a8)](_0x224d1a))_0x36f263[_0x37aa8a(0x1c7)](_0x224d1a);else!_0x224d1a&&containsColumnReference(_0x59c09c,_0x371b84)&&(_0x152b10=!![]);}_0x3828bd[_0x37aa8a(0x1c7)]({'table':_0x317192,'alias':_0x371b84,'columns':_0x36f263,'unsupportedPredicate':_0x152b10,'unsupportedReason':_0x34d1bb,'containsUnresolvedInclude':_0x1eeee4,'position':_0x2674ce});}for(const _0x1d0fec of _0x14cd43['matchAll'](/\bJOIN\b/gi)){const _0x1496c0=_0x1d0fec[_0x37aa8a(0x195)]??0x0;if(_0x2fb3af[_0x37aa8a(0x19a)](_0x1496c0))continue;const _0xe071e2=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x37aa8a(0x1af)](_0x2dd0a4[_0x37aa8a(0x1b1)](_0x1496c0+_0x1d0fec[0x0][_0x37aa8a(0x1d4)])),_0x55ba61=normalizeIdentifier(_0xe071e2?.[0x1]||_0x37aa8a(0x1b9)),_0x208312=normalizeIdentifier(_0xe071e2?.[0x2]||''),_0xda7885=isSqlClauseKeyword(_0x208312)?_0x55ba61['split']('.')['at'](-0x1)||_0x55ba61:_0x208312||_0x55ba61[_0x37aa8a(0x1b2)]('.')['at'](-0x1)||_0x55ba61;_0x3828bd[_0x37aa8a(0x1c7)]({'table':_0x55ba61,'alias':_0xda7885,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x37aa8a(0x18f),'position':_0x1496c0});}const _0x471c4a=_0x14cd43[_0x37aa8a(0x1aa)](MYBATIS_INCLUDE_MARKER);return _0x471c4a>=0x0&&!_0x3828bd['some'](_0x1cd6ab=>_0x1cd6ab[_0x37aa8a(0x1a5)])&&_0x3828bd[_0x37aa8a(0x1c7)]({'table':'unknown','alias':_0x37aa8a(0x1b9),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x37aa8a(0x1d2),'containsUnresolvedInclude':!![],'position':_0x471c4a}),_0x3828bd['sort']((_0x26fe29,_0x2b5bbd)=>_0x26fe29[_0x37aa8a(0x1cc)]-_0x2b5bbd[_0x37aa8a(0x1cc)]);}function stripSqlNoise(_0x357f08){const _0x5e7bbf=a230_0x1319,_0x3cbc9b=Array[_0x5e7bbf(0x1c0)](_0x357f08),_0x3c6dd1=(_0x5778c9,_0x12a938)=>{for(let _0x3f2fc3=_0x5778c9;_0x3f2fc3<_0x12a938;_0x3f2fc3+=0x1){_0x3cbc9b[_0x3f2fc3]!=='\x0a'&&_0x3cbc9b[_0x3f2fc3]!=='\x0d'&&(_0x3cbc9b[_0x3f2fc3]='\x20');}};for(let _0xc15429=0x0;_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)];_0xc15429+=0x1){const _0x5722e1=_0x3cbc9b[_0xc15429],_0x2842f1=_0x3cbc9b[_0xc15429+0x1];if(_0x5722e1==='\x27'||_0x5722e1==='\x22'||_0x5722e1==='`'){const _0x13cf15=_0x5722e1,_0x5a73cf=_0xc15429;_0xc15429+=0x1;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]){if(_0x3cbc9b[_0xc15429]==='\x5c'&&_0xc15429+0x1<_0x3cbc9b[_0x5e7bbf(0x1d4)]){_0xc15429+=0x2;continue;}if(_0x3cbc9b[_0xc15429]!==_0x13cf15){_0xc15429+=0x1;continue;}if(_0x3cbc9b[_0xc15429+0x1]===_0x13cf15){_0xc15429+=0x2;continue;}break;}if(_0x13cf15==='\x27')_0x3c6dd1(_0x5a73cf,Math['min'](_0xc15429+0x1,_0x3cbc9b['length']));continue;}if(_0x5722e1==='-'&&_0x2842f1==='-'){const _0xfbbb1f=_0xc15429;while(_0xc15429<_0x3cbc9b['length']&&_0x3cbc9b[_0xc15429]!=='\x0a')_0xc15429+=0x1;_0x3c6dd1(_0xfbbb1f,_0xc15429);continue;}if(_0x5722e1==='/'&&_0x2842f1==='*'){const _0x99b05a=_0xc15429;_0xc15429+=0x2;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]&&!(_0x3cbc9b[_0xc15429]==='*'&&_0x3cbc9b[_0xc15429+0x1]==='/')){_0xc15429+=0x1;}_0xc15429=Math['min'](_0xc15429+0x1,_0x3cbc9b[_0x5e7bbf(0x1d4)]-0x1),_0x3c6dd1(_0x99b05a,_0xc15429+0x1);continue;}if(_0x5722e1==='#'&&_0x2842f1!=='{'){const _0x430ca0=_0xc15429;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]&&_0x3cbc9b[_0xc15429]!=='\x0a')_0xc15429+=0x1;_0x3c6dd1(_0x430ca0,_0xc15429);continue;}if((_0x5722e1==='#'||_0x5722e1==='$')&&_0x2842f1==='{'){const _0x10927b=_0xc15429;_0xc15429+=0x2;while(_0xc15429<_0x3cbc9b[_0x5e7bbf(0x1d4)]&&_0x3cbc9b[_0xc15429]!=='}')_0xc15429+=0x1;_0x3c6dd1(_0x10927b,Math[_0x5e7bbf(0x1cf)](_0xc15429+0x1,_0x3cbc9b['length']));}}return _0x3cbc9b[_0x5e7bbf(0x192)]('');}function maskQuotedIdentifiers(_0x1786ba){const _0x4107ff=a230_0x1319,_0x57964b=Array['from'](_0x1786ba);for(let _0x434ea3=0x0;_0x434ea3<_0x57964b['length'];_0x434ea3+=0x1){const _0x3b0351=_0x57964b[_0x434ea3];if(_0x3b0351!=='\x22'&&_0x3b0351!=='`')continue;_0x434ea3+=0x1;while(_0x434ea3<_0x57964b[_0x4107ff(0x1d4)]){if(_0x57964b[_0x434ea3]===_0x3b0351){if(_0x57964b[_0x434ea3+0x1]===_0x3b0351){_0x57964b[_0x434ea3]='\x20',_0x57964b[_0x434ea3+0x1]='\x20',_0x434ea3+=0x2;continue;}break;}_0x57964b[_0x434ea3]='\x20',_0x434ea3+=0x1;}}return _0x57964b[_0x4107ff(0x192)]('');}function maskNestedQueries(_0x341f41){const _0x39d427=a230_0x1319,_0xcf0dd5=Array['from'](_0x341f41);for(let _0x44b8f5=0x0;_0x44b8f5<_0xcf0dd5[_0x39d427(0x1d4)];_0x44b8f5+=0x1){if(_0xcf0dd5[_0x44b8f5]!=='(')continue;const _0x194fb2=_0x341f41[_0x39d427(0x1b1)](_0x44b8f5+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x39d427(0x188)](_0x194fb2))continue;let _0x2e1aec=0x1,_0x2f04f0=_0x44b8f5+0x1;for(;_0x2f04f0<_0xcf0dd5[_0x39d427(0x1d4)]&&_0x2e1aec>0x0;_0x2f04f0+=0x1){if(_0xcf0dd5[_0x2f04f0]==='(')_0x2e1aec+=0x1;if(_0xcf0dd5[_0x2f04f0]===')')_0x2e1aec-=0x1;}if(_0x2e1aec!==0x0)continue;for(let _0x3880ea=_0x44b8f5;_0x3880ea<_0x2f04f0;_0x3880ea+=0x1){_0xcf0dd5[_0x3880ea]='\x20';}const _0x30ff74=_0x39d427(0x1ac);for(let _0x438eb9=0x0;_0x438eb9<_0x30ff74[_0x39d427(0x1d4)]&&_0x44b8f5+_0x438eb9<_0x2f04f0;_0x438eb9+=0x1){_0xcf0dd5[_0x44b8f5+_0x438eb9]=_0x30ff74[_0x438eb9];}_0x44b8f5=_0x2f04f0-0x1;}return _0xcf0dd5[_0x39d427(0x192)]('');}function splitTopLevelAnd(_0x11e31e){const _0x36bd53=a230_0x1319,_0x42cc41=[];let _0x5f2a2f=0x0,_0x51ff7d=0x0;for(let _0x7586f=0x0;_0x7586f<_0x11e31e[_0x36bd53(0x1d4)];_0x7586f+=0x1){const _0x5231ab=_0x11e31e[_0x7586f];if(_0x5231ab==='(')_0x5f2a2f+=0x1;if(_0x5231ab===')')_0x5f2a2f=Math[_0x36bd53(0x1a3)](0x0,_0x5f2a2f-0x1);_0x5f2a2f===0x0&&_0x11e31e[_0x36bd53(0x1b1)](_0x7586f)['match'](/^AND\b/i)&&(_0x7586f===0x0||/\s/[_0x36bd53(0x188)](_0x11e31e[_0x7586f-0x1]??''))&&(_0x42cc41[_0x36bd53(0x1c7)](_0x11e31e[_0x36bd53(0x1b1)](_0x51ff7d,_0x7586f)[_0x36bd53(0x1a9)]()),_0x7586f+=0x2,_0x51ff7d=_0x7586f+0x1);}const _0x4dc861=_0x11e31e[_0x36bd53(0x1b1)](_0x51ff7d)[_0x36bd53(0x1a9)]();if(_0x4dc861)_0x42cc41[_0x36bd53(0x1c7)](_0x4dc861);return _0x42cc41;}function hasTopLevelKeyword(_0x516ed5,_0x23187a){const _0x10dc51=a230_0x1319;let _0x2dbd24=0x0;for(let _0x8038f1=0x0;_0x8038f1<_0x516ed5[_0x10dc51(0x1d4)];_0x8038f1+=0x1){const _0x5f07c3=_0x516ed5[_0x8038f1];if(_0x5f07c3==='(')_0x2dbd24+=0x1;if(_0x5f07c3===')')_0x2dbd24=Math[_0x10dc51(0x1a3)](0x0,_0x2dbd24-0x1);if(_0x2dbd24!==0x0)continue;const _0x599bb4=_0x516ed5[_0x10dc51(0x1b1)](_0x8038f1,_0x8038f1+_0x23187a[_0x10dc51(0x1d4)]),_0x463cd0=_0x516ed5[_0x8038f1-0x1]??'\x20',_0x3672b2=_0x516ed5[_0x8038f1+_0x23187a[_0x10dc51(0x1d4)]]??'\x20';if(_0x599bb4[_0x10dc51(0x1b4)]()===_0x23187a['toUpperCase']()&&!/[\w$]/['test'](_0x463cd0)&&!/[\w$]/[_0x10dc51(0x188)](_0x3672b2))return!![];}return![];}function splitEquality(_0x257e4b){const _0x3f8d0b=a230_0x1319,_0x5950b4=stripOuterParentheses(_0x257e4b);let _0x560d2e=0x0,_0x23777d;for(let _0xe2af50=0x0;_0xe2af50<_0x5950b4['length'];_0xe2af50+=0x1){const _0x449a5a=_0x5950b4[_0xe2af50];if(_0x449a5a==='(')_0x560d2e+=0x1;if(_0x449a5a===')')_0x560d2e=Math['max'](0x0,_0x560d2e-0x1);const _0x3e248c=_0x5950b4[_0xe2af50-0x1]??'',_0x35ae3c=_0x5950b4[_0xe2af50+0x1]??'';if(_0x449a5a==='='&&_0x560d2e===0x0&&!/[!<>=:]/[_0x3f8d0b(0x188)](_0x3e248c)&&_0x35ae3c!=='='){if(_0x23777d!==undefined)return null;_0x23777d=_0xe2af50;}}return _0x23777d===undefined?null:[_0x5950b4[_0x3f8d0b(0x1b1)](0x0,_0x23777d)[_0x3f8d0b(0x1a9)](),_0x5950b4['slice'](_0x23777d+0x1)[_0x3f8d0b(0x1a9)]()];}function parseDirectColumnReference(_0x324a58,_0x5aa107){const _0x4998b6=a230_0x1319,_0x6168e3=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x4998b6(0x1af)](stripOuterParentheses(_0x324a58));if(!_0x6168e3)return null;if(normalizeIdentifier(_0x6168e3[0x1]??'')!==normalizeIdentifier(_0x5aa107))return null;return normalizeIdentifier(_0x6168e3[0x2]??'');}function containsColumnReference(_0x3ce9c1,_0x3e2efd){const _0x95d0eb=a230_0x1319,_0x2386f9=_0x3ce9c1[_0x95d0eb(0x1bd)](/[`"]/g,''),_0x5c733e=_0x3e2efd[_0x95d0eb(0x1bd)](/[.*+?^${}()|[\]\\]/g,_0x95d0eb(0x1d5));return new RegExp('(?:^|[^\x5cw$])'+_0x5c733e+_0x95d0eb(0x1c3),'i')[_0x95d0eb(0x188)](_0x2386f9);}function findEqualityPrefix(_0x2f18ca,_0x7c8ee1){const _0x2f0914=a230_0x1319,_0x158d72=new Set(_0x7c8ee1[_0x2f0914(0x18a)](normalizeIdentifier)),_0x2abec5=[];for(const _0x5899e1 of _0x2f18ca){if(!_0x158d72[_0x2f0914(0x19a)](normalizeIdentifier(_0x5899e1)))break;_0x2abec5['push'](_0x5899e1);}return _0x2abec5;}function a230_0x1319(_0x211f83,_0x3ba531){_0x211f83=_0x211f83-0x187;const _0x36d5cc=a230_0x36d5();let _0x1319ab=_0x36d5cc[_0x211f83];return _0x1319ab;}function resolveTableMetadata(_0x53fadd,_0x2fc9){const _0x4fe61b=a230_0x1319,_0x31618f=normalizeIdentifier(_0x2fc9),_0x1d92d4=_0x53fadd[_0x4fe61b(0x18b)](_0x577ac5=>normalizeIdentifier(_0x577ac5[_0x4fe61b(0x1bb)])===_0x31618f);if(_0x1d92d4['length']===0x1)return _0x1d92d4[0x0];const _0x3522e6=_0x31618f[_0x4fe61b(0x1a8)]('.'),_0x5d7c02=_0x31618f['split']('.')['at'](-0x1),_0x4db1de=_0x53fadd[_0x4fe61b(0x18b)](_0x258eeb=>{const _0x1bf7d9=_0x4fe61b,_0x4466a2=normalizeIdentifier(_0x258eeb['tableName']);if(_0x3522e6&&_0x4466a2[_0x1bf7d9(0x1a8)]('.'))return![];return _0x4466a2[_0x1bf7d9(0x1b2)]('.')['at'](-0x1)===_0x5d7c02;});return _0x4db1de[_0x4fe61b(0x1d4)]===0x1?_0x4db1de[0x0]:undefined;}function columnNamesMatch(_0x370d7b,_0x5c576f){return normalizeIdentifier(_0x370d7b)===normalizeIdentifier(_0x5c576f);}function normalizeIdentifier(_0x1c0829){const _0x433af1=a230_0x1319;return _0x1c0829['replace'](/[`"]/g,'')[_0x433af1(0x1a9)]()['toLowerCase']();}function isSqlClauseKeyword(_0x411fa5){const _0xaeb426=a230_0x1319;return new Set(['on',_0xaeb426(0x19c),_0xaeb426(0x1ad),'join',_0xaeb426(0x191),_0xaeb426(0x1cb),_0xaeb426(0x1c1),_0xaeb426(0x199),_0xaeb426(0x1c8),_0xaeb426(0x1b6)])[_0xaeb426(0x19a)](_0x411fa5);}function stripOuterParentheses(_0x4a1a7c){const _0x155bad=a230_0x1319;let _0x996e1f=_0x4a1a7c['trim']();while(_0x996e1f[_0x155bad(0x1bf)]('(')&&_0x996e1f[_0x155bad(0x1ce)](')')){let _0x5712fc=0x0,_0x30385d=!![];for(let _0x2d2236=0x0;_0x2d2236<_0x996e1f[_0x155bad(0x1d4)];_0x2d2236+=0x1){if(_0x996e1f[_0x2d2236]==='(')_0x5712fc+=0x1;if(_0x996e1f[_0x2d2236]===')')_0x5712fc-=0x1;if(_0x5712fc===0x0&&_0x2d2236<_0x996e1f[_0x155bad(0x1d4)]-0x1){_0x30385d=![];break;}}if(!_0x30385d||_0x5712fc!==0x0)break;_0x996e1f=_0x996e1f[_0x155bad(0x1b1)](0x1,-0x1)[_0x155bad(0x1a9)]();}return _0x996e1f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a231_0x889da=a231_0x52b1;(function(_0x28738f,_0x18fa1f){const _0x56db16=a231_0x52b1,_0xeccded=_0x28738f();while(!![]){try{const _0x2efef2=-parseInt(_0x56db16(0x1c2))/0x1+-parseInt(_0x56db16(0x1b9))/0x2*(-parseInt(_0x56db16(0x1c0))/0x3)+-parseInt(_0x56db16(0x1c4))/0x4*(-parseInt(_0x56db16(0x1be))/0x5)+-parseInt(_0x56db16(0x1c3))/0x6*(-parseInt(_0x56db16(0x1b8))/0x7)+-parseInt(_0x56db16(0x1c1))/0x8*(-parseInt(_0x56db16(0x1ba))/0x9)+parseInt(_0x56db16(0x1bc))/0xa*(parseInt(_0x56db16(0x1bf))/0xb)+parseInt(_0x56db16(0x1bd))/0xc*(-parseInt(_0x56db16(0x1bb))/0xd);if(_0x2efef2===_0x18fa1f)break;else _0xeccded['push'](_0xeccded['shift']());}catch(_0x464ff8){_0xeccded['push'](_0xeccded['shift']());}}}(a231_0x2f83,0x215a5));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a231_0x52b1(_0x40bc71,_0x5147a2){_0x40bc71=_0x40bc71-0x1b7;const _0x2f83ab=a231_0x2f83();let _0x52b1a8=_0x2f83ab[_0x40bc71];return _0x52b1a8;}const DOT_DIR=a231_0x889da(0x1b7),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x194dfb,_0x52396f){const _0x152ade=a231_0x889da,_0x2d28bc=resolve(_0x52396f??findProjectRootDirectory()),_0x95dccf=DOT_DIR+_0x152ade(0x1c6),_0x4243f0=_0x95dccf+'/'+_0x194dfb;return{'projectRoot':_0x2d28bc,'appCode':_0x194dfb,'sqlWorkspaceRoot':_0x95dccf,'sqlRoot':_0x4243f0,'sqlRootDir':resolve(_0x2d28bc,DOT_DIR,_0x152ade(0x1c5),_0x194dfb),'lockFilePath':resolve(_0x2d28bc,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2d28bc,DOT_DIR,TRASH_DIR_NAME)};}function a231_0x2f83(){const _0x423616=['12kFvnmp','sql','/sql','.rabetbase','364EcJOnp','50614jRdrVp','488601BurdUN','5287230XtrBln','20JfSRNJ','12VNlBfN','424745wuaQKv','605209HlMlMr','6VFJSWI','8LKuTDn','33637kLuvey','12366wOpCuC'];a231_0x2f83=function(){return _0x423616;};return a231_0x2f83();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9c390e,_0x346a42){const _0x212a2b=a232_0x172b,_0x47bb2d=_0x9c390e();while(!![]){try{const _0x526141=-parseInt(_0x212a2b(0x101))/0x1+parseInt(_0x212a2b(0x104))/0x2+-parseInt(_0x212a2b(0x10a))/0x3*(-parseInt(_0x212a2b(0x100))/0x4)+parseInt(_0x212a2b(0x10e))/0x5+-parseInt(_0x212a2b(0x113))/0x6*(-parseInt(_0x212a2b(0x109))/0x7)+-parseInt(_0x212a2b(0x119))/0x8*(parseInt(_0x212a2b(0x114))/0x9)+-parseInt(_0x212a2b(0x102))/0xa*(-parseInt(_0x212a2b(0x11a))/0xb);if(_0x526141===_0x346a42)break;else _0x47bb2d['push'](_0x47bb2d['shift']());}catch(_0x5be8c5){_0x47bb2d['push'](_0x47bb2d['shift']());}}}(a232_0x32c0,0x49804));import{readdir,stat}from'node:fs/promises';function a232_0x172b(_0x178b1e,_0x311076){_0x178b1e=_0x178b1e-0x100;const _0x32c0ae=a232_0x32c0();let _0x172be0=_0x32c0ae[_0x178b1e];return _0x172be0;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x2bb8bd){const _0x5eba7d=a232_0x172b;if(_0x2bb8bd===_0x5eba7d(0x108))return _0x5eba7d(0x111);if(_0x2bb8bd===_0x5eba7d(0x11b))return _0x5eba7d(0x117);return undefined;}async function scanSqlFilesRecursively(_0x1be275,_0x1d2e96){const _0x5146f9=a232_0x172b,_0x59fda7=[];try{const _0x1a68a8=await readdir(_0x1be275,{'withFileTypes':!![]});for(const _0x4be38f of _0x1a68a8){const _0x21cf19=join(_0x1be275,_0x4be38f[_0x5146f9(0x11e)]);if(_0x4be38f[_0x5146f9(0x10b)]()){_0x59fda7['push'](...await scanSqlFilesRecursively(_0x21cf19,_0x1d2e96));continue;}if(!_0x4be38f[_0x5146f9(0x106)]())continue;const _0x3adc1c=extname(_0x4be38f[_0x5146f9(0x11e)])['toLowerCase'](),_0x3986b5=extensionToMode(_0x3adc1c);if(!_0x3986b5)continue;const _0x3f991d=relative(_0x1d2e96,_0x21cf19)[_0x5146f9(0x10c)](/\\/g,'/'),_0x569c84=_0x3f991d[_0x5146f9(0x116)]('/')[_0x5146f9(0x105)](Boolean),_0x50e4e7=parseSqlPath(_0x569c84,_0x4be38f[_0x5146f9(0x11e)],_0x3adc1c);if(!_0x50e4e7)continue;_0x59fda7['push']({'sqlCode':_0x50e4e7[_0x5146f9(0x107)],'sqlName':_0x50e4e7[_0x5146f9(0x11f)],'dbDirectory':_0x569c84[0x0],'filePath':_0x21cf19,'relativePath':_0x3f991d,'lockKey':_0x50e4e7['sqlCode'],'mode':_0x3986b5});}}catch(_0x1efea6){if(_0x1efea6[_0x5146f9(0x110)]!==_0x5146f9(0x112))throw _0x1efea6;}return _0x59fda7;}export async function scanLocalSqlQueries(_0x1428aa){const _0x34c499=a232_0x172b;return scanSqlFilesRecursively(_0x1428aa[_0x34c499(0x115)],_0x1428aa['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x2b9f81,_0x226162,_0x1bdbf2){const _0x13d8b7=a232_0x172b,_0xe4e019=_0x1bdbf2?.[_0x13d8b7(0x120)]||(_0x1bdbf2?.['sqlName']||_0x1bdbf2?.[_0x13d8b7(0x118)]?buildSqlRelativePath(_0x226162,_0x1bdbf2?.[_0x13d8b7(0x11f)],_0x1bdbf2?.[_0x13d8b7(0x118)],_0x1bdbf2?.[_0x13d8b7(0x10f)]||'sql',_0x1bdbf2?.[_0x13d8b7(0x11d)]):buildDefaultSqlFileName(_0x226162,_0x1bdbf2?.[_0x13d8b7(0x10f)]||_0x13d8b7(0x111)));return join(_0x2b9f81[_0x13d8b7(0x115)],_0xe4e019);}export async function directoryExists(_0x443b3f){try{const _0x2698ca=await stat(_0x443b3f);return _0x2698ca['isDirectory']();}catch{return![];}}function parseSqlPath(_0x28c992,_0xaf2c0d,_0xfb7ef){const _0x5f3a78=a232_0x172b,_0x3e6709=_0xaf2c0d[_0x5f3a78(0x103)](0x0,-_0xfb7ef['length']);if(_0x28c992[_0x5f3a78(0x11c)]<0x2)return null;const _0x1d7f3f=_0x3e6709['indexOf']('_');if(_0x1d7f3f<=0x0||_0x1d7f3f>=_0x3e6709[_0x5f3a78(0x11c)]-0x1)return null;const _0x4b03bc=_0x3e6709[_0x5f3a78(0x103)](0x0,_0x1d7f3f);if(!isLikelySqlCode(_0x4b03bc))return null;return{'sqlCode':_0x4b03bc,'sqlName':_0x3e6709[_0x5f3a78(0x103)](_0x1d7f3f+0x1)};}function isLikelySqlCode(_0x45c447){const _0x3209f4=a232_0x172b;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x3209f4(0x10d)](_0x45c447);}function a232_0x32c0(){const _0x613fbe=['246708MqtHvI','88620iffrsf','isDirectory','replace','test','783540uAILBR','mode','code','sql','ENOENT','6FVISdg','9xgwFNG','sqlRootDir','split','mybatisXml','dbName','2032616QtqruI','451CLhZfj','.xml','length','dbId','name','sqlName','path','44vLnvyz','262111BqVmgh','47410ZBOktw','slice','211950NnBOfD','filter','isFile','sqlCode','.sql'];a232_0x32c0=function(){return _0x613fbe;};return a232_0x32c0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2194b4,_0x1d27d8){const _0x1bc41d=a233_0x59f7,_0xc05ca8=_0x2194b4();while(!![]){try{const _0x2f4ad4=parseInt(_0x1bc41d(0x1cc))/0x1*(parseInt(_0x1bc41d(0x1cb))/0x2)+parseInt(_0x1bc41d(0x1d6))/0x3*(-parseInt(_0x1bc41d(0x1d2))/0x4)+parseInt(_0x1bc41d(0x1d4))/0x5+parseInt(_0x1bc41d(0x1d3))/0x6*(-parseInt(_0x1bc41d(0x1d1))/0x7)+-parseInt(_0x1bc41d(0x1cf))/0x8+-parseInt(_0x1bc41d(0x1d7))/0x9*(parseInt(_0x1bc41d(0x1c9))/0xa)+parseInt(_0x1bc41d(0x1cd))/0xb;if(_0x2f4ad4===_0x1d27d8)break;else _0xc05ca8['push'](_0xc05ca8['shift']());}catch(_0x2675b2){_0xc05ca8['push'](_0xc05ca8['shift']());}}}(a233_0xbf0a,0x84332));import{readFile}from'node:fs/promises';import a233_0x40edd8 from'node:crypto';function a233_0x59f7(_0x1c1814,_0x2640f5){_0x1c1814=_0x1c1814-0x1c9;const _0xbf0a=a233_0xbf0a();let _0x59f7eb=_0xbf0a[_0x1c1814];return _0x59f7eb;}export function computeSqlContentHash(_0x3e4ecf){const _0x19020a=a233_0x59f7;return a233_0x40edd8['createHash'](_0x19020a(0x1ca))[_0x19020a(0x1ce)](_0x3e4ecf)[_0x19020a(0x1d5)](_0x19020a(0x1d0));}function a233_0xbf0a(){const _0x4b363c=['36lfqKcs','646790RYbwBP','md5','136130yFzPyG','3Olsqdy','12183985ciDkXD','update','1417992wedCRR','hex','873964moikGg','1312FISgNI','42tABGhs','4349425kHnZUQ','digest','3021AiVFsS'];a233_0xbf0a=function(){return _0x4b363c;};return a233_0xbf0a();}export async function computeSqlFileHash(_0x2701e0){const _0x232ba2=await readFile(_0x2701e0,'utf8');return computeSqlContentHash(_0x232ba2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x442ab4,_0x2a46fc){const _0x1693b6=a234_0x35c4,_0x24ede4=_0x442ab4();while(!![]){try{const _0x193270=-parseInt(_0x1693b6(0x104))/0x1*(-parseInt(_0x1693b6(0x10c))/0x2)+-parseInt(_0x1693b6(0x105))/0x3*(-parseInt(_0x1693b6(0xf9))/0x4)+-parseInt(_0x1693b6(0x102))/0x5*(-parseInt(_0x1693b6(0xff))/0x6)+parseInt(_0x1693b6(0x10e))/0x7*(-parseInt(_0x1693b6(0x10b))/0x8)+parseInt(_0x1693b6(0x103))/0x9+-parseInt(_0x1693b6(0x109))/0xa*(parseInt(_0x1693b6(0x10f))/0xb)+-parseInt(_0x1693b6(0xfa))/0xc*(-parseInt(_0x1693b6(0x100))/0xd);if(_0x193270===_0x2a46fc)break;else _0x24ede4['push'](_0x24ede4['shift']());}catch(_0x2f004c){_0x24ede4['push'](_0x24ede4['shift']());}}}(a234_0x1136,0x2ab0d));function a234_0x35c4(_0x2201e9,_0x40e95f){_0x2201e9=_0x2201e9-0xf6;const _0x1136bf=a234_0x1136();let _0x35c47f=_0x1136bf[_0x2201e9];return _0x35c47f;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a234_0x1136(){const _0x3d31cf=['20YvNwCc','890037Aarciq','10771awzrvW','1917awgALw','\x22\x20vs\x20lock\x20\x22','sqlRoot','stringify','2260020QTbTDT','\x22.\x20','2824pSTIGF','14DxzEQy','apps','5313bMgtMC','11qxXrOk','utf8','sqls','ENOENT','44xXwyiY','2818164TCLUEC','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','parse','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','lastSync','378936FOtwzA','13JjUHNm',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'];a234_0x1136=function(){return _0x3d31cf;};return a234_0x1136();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x2fbb17,_0x4ae151,_0x473d89,_0x406e9a){const _0xea7f42=a234_0x35c4,_0xf3d862=_0x2fbb17??createEmptySqlLock();let _0x5711ec=_0xf3d862[_0xea7f42(0x10d)][_0x4ae151];if(!_0x5711ec)return _0x5711ec={'sqlRoot':_0x473d89,'lastSync':'','sqls':{}},_0xf3d862['apps'][_0x4ae151]=_0x5711ec,{'lockData':_0xf3d862,'appLock':_0x5711ec};if(!_0x5711ec['sqlRoot'])_0x5711ec[_0xea7f42(0x107)]=_0x473d89;else{if(_0x5711ec[_0xea7f42(0x107)]!==_0x473d89)throw new Error(_0x406e9a+_0xea7f42(0x101)+_0x473d89+_0xea7f42(0x106)+_0x5711ec['sqlRoot']+_0xea7f42(0x10a)+_0xea7f42(0xfb));}return!_0x5711ec['sqls']&&(_0x5711ec[_0xea7f42(0xf7)]={}),!_0x5711ec['lastSync']&&(_0x5711ec[_0xea7f42(0xfe)]=''),{'lockData':_0xf3d862,'appLock':_0x5711ec};}export async function readSqlLockFile(_0x4af6d7){const _0x814529=a234_0x35c4;try{const _0x5b1f38=await readFile(_0x4af6d7,_0x814529(0xf6));return JSON[_0x814529(0xfc)](_0x5b1f38);}catch(_0xbf9202){if(_0xbf9202['code']===_0x814529(0xf8))return null;throw new Error(_0x814529(0xfd)+String(_0xbf9202));}}export async function writeSqlLockFile(_0x2b0af9,_0x2d1365){const _0x56766e=a234_0x35c4;await mkdir(dirname(_0x2b0af9),{'recursive':!![]}),await writeFile(_0x2b0af9,JSON[_0x56766e(0x108)](_0x2d1365,null,0x2),_0x56766e(0xf6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46459,_0x4488fe){const _0x32248f=a236_0x1620,_0x160695=_0x46459();while(!![]){try{const _0x3a1899=-parseInt(_0x32248f(0x141))/0x1+-parseInt(_0x32248f(0x13f))/0x2*(parseInt(_0x32248f(0x13e))/0x3)+parseInt(_0x32248f(0x13c))/0x4*(parseInt(_0x32248f(0x134))/0x5)+-parseInt(_0x32248f(0x13b))/0x6+-parseInt(_0x32248f(0x133))/0x7+-parseInt(_0x32248f(0x138))/0x8*(parseInt(_0x32248f(0x137))/0x9)+parseInt(_0x32248f(0x13a))/0xa;if(_0x3a1899===_0x4488fe)break;else _0x160695['push'](_0x160695['shift']());}catch(_0x23a3a0){_0x160695['push'](_0x160695['shift']());}}}(a236_0xbb83,0xd81e6));export function detectSqlMode(_0x1ec450){const _0x53ccff=a236_0x1620,_0x3c0c4d=_0x1ec450['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x53ccff(0x132)](_0x3c0c4d))return _0x53ccff(0x13d);return'sql';}export function getSqlFileExtension(_0x5f5be8){const _0x1a7995=a236_0x1620;return _0x5f5be8===_0x1a7995(0x13d)?'.xml':_0x1a7995(0x139);}function a236_0x1620(_0x46ed93,_0x3d45cb){_0x46ed93=_0x46ed93-0x130;const _0xbb83da=a236_0xbb83();let _0x1620c4=_0xbb83da[_0x46ed93];return _0x1620c4;}function a236_0xbb83(){const _0x1a1fe5=['4HLdIUH','mybatisXml','3jZzyWj','1768846rCCSEt','db-','950204zyxGqs','unknown-db','replace','test','8933855RqnOLF','6617790OzGESQ','trim','unknown-sql','783JsfFsC','106456UQrfNU','.sql','44214510dpTJjv','3547116SsfKgg'];a236_0xbb83=function(){return _0x1a1fe5;};return a236_0xbb83();}export function buildDefaultSqlFileName(_0x37d4a4,_0x1b269a){return''+_0x37d4a4+getSqlFileExtension(_0x1b269a);}export function sanitizeSqlPathSegment(_0x471a9d,_0x4057fe){const _0x38a0f8=a236_0x1620,_0x25c3f8=String(_0x471a9d??'')[_0x38a0f8(0x135)](),_0x3f1914=_0x25c3f8[_0x38a0f8(0x131)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x38a0f8(0x131)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x38a0f8(0x131)](/^\.+/,'')[_0x38a0f8(0x131)](/\.+$/,'')[_0x38a0f8(0x131)](/^-+/,'')[_0x38a0f8(0x131)](/-+$/,'');return _0x3f1914||_0x4057fe;}export function buildDbDirectoryName(_0x1e8a30,_0x1c2a0b){const _0x452857=a236_0x1620;return sanitizeSqlPathSegment(_0x1e8a30,_0x1c2a0b!=null?_0x452857(0x140)+_0x1c2a0b:_0x452857(0x130));}export function buildSqlRelativePath(_0x3a4120,_0x46724e,_0x59c33f,_0x508f08,_0x1ab9d1){const _0x488e43=a236_0x1620,_0x41cb36=buildDbDirectoryName(_0x59c33f,_0x1ab9d1),_0x56daab=sanitizeSqlPathSegment(_0x3a4120,_0x488e43(0x136)),_0x1e0819=sanitizeSqlPathSegment(_0x46724e,_0x56daab);return _0x41cb36+'/'+_0x56daab+'_'+_0x1e0819+getSqlFileExtension(_0x508f08);}
|
|
@@ -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_0x4bf4a2=a237_0x516e;(function(_0x1d0741,_0x5260cc){const _0x14624f=a237_0x516e,_0x1ba4fe=_0x1d0741();while(!![]){try{const _0x16c4b5=-parseInt(_0x14624f(0x102))/0x1+parseInt(_0x14624f(0xeb))/0x2+-parseInt(_0x14624f(0x11e))/0x3*(parseInt(_0x14624f(0xd8))/0x4)+parseInt(_0x14624f(0x100))/0x5+-parseInt(_0x14624f(0x109))/0x6*(parseInt(_0x14624f(0x10f))/0x7)+-parseInt(_0x14624f(0xfb))/0x8+parseInt(_0x14624f(0x10e))/0x9;if(_0x16c4b5===_0x5260cc)break;else _0x1ba4fe['push'](_0x1ba4fe['shift']());}catch(_0x34b9ef){_0x1ba4fe['push'](_0x1ba4fe['shift']());}}}(a237_0x1c29,0xe23b5));const MYBATIS_OUTER_TAGS=new Map([[a237_0x4bf4a2(0x103),a237_0x4bf4a2(0xcb)],[a237_0x4bf4a2(0xef),a237_0x4bf4a2(0xca)],[a237_0x4bf4a2(0xfa),a237_0x4bf4a2(0xfc)],[a237_0x4bf4a2(0x107),a237_0x4bf4a2(0xfd)]]),MYBATIS_DYNAMIC_TAGS=new Set(['if','where',a237_0x4bf4a2(0x108),a237_0x4bf4a2(0xc5),a237_0x4bf4a2(0xfe),'otherwise',a237_0x4bf4a2(0xd5),a237_0x4bf4a2(0x10a),'bind','include','property']),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x4bf4a2(0x108),a237_0x4bf4a2(0xc5),a237_0x4bf4a2(0xfe),a237_0x4bf4a2(0x10d)]);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x4bf4a2(0xf7);export const MYBATIS_DYNAMIC_END_MARKER=a237_0x4bf4a2(0x101);export const MYBATIS_INCLUDE_MARKER='__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__';const UNRESOLVED_SQL_FRAGMENT=a237_0x4bf4a2(0xf5),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x4bf4a2(0xdd)+[...MYBATIS_OUTER_TAGS[a237_0x4bf4a2(0xf9)]()][a237_0x4bf4a2(0xce)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x4f6fb8){const _0x3e1847=a237_0x4bf4a2,_0x501678=typeof _0x4f6fb8===_0x3e1847(0xc9)?_0x4f6fb8:'';if(!startsWithMybatisStatementWrapper(_0x501678))return{'sql':_0x501678,'mode':_0x3e1847(0xf2)};let _0x49582b=0x0,_0x419d08='',_0x30e271,_0x4a2a8a=![],_0xa6567d=![];const _0x3a193b=[];while(_0x49582b<_0x501678[_0x3e1847(0x105)]){if(_0x501678[_0x3e1847(0xf4)](_0x3e1847(0x113),_0x49582b)){const _0x503ea3=_0x501678[_0x3e1847(0xcc)](_0x3e1847(0x118),_0x49582b+0x4);if(_0x503ea3<0x0)return invalidMybatisSource('Unterminated\x20XML\x20comment.');_0x419d08+='\x20',_0x49582b=_0x503ea3+0x3;continue;}if(_0x501678[_0x3e1847(0xf4)](_0x3e1847(0x11d),_0x49582b)){if(!_0x4a2a8a||_0xa6567d)return invalidMybatisSource('CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x2f9303=_0x501678[_0x3e1847(0xcc)](_0x3e1847(0xf0),_0x49582b+0x9);if(_0x2f9303<0x0)return invalidMybatisSource('Unterminated\x20CDATA\x20section.');_0x419d08+=_0x501678[_0x3e1847(0x11b)](_0x49582b+0x9,_0x2f9303),_0x49582b=_0x2f9303+0x3;continue;}if(_0x501678[_0x3e1847(0xf4)]('<?',_0x49582b)){if(_0x4a2a8a)return invalidMybatisSource('XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.');const _0x3df472=_0x501678[_0x3e1847(0xcc)]('?>',_0x49582b+0x2);if(_0x3df472<0x0)return invalidMybatisSource('Unterminated\x20XML\x20declaration.');_0x419d08+='\x20',_0x49582b=_0x3df472+0x2;continue;}if(_0x501678[_0x49582b]!=='<'){const _0x474827=_0x501678['indexOf']('<',_0x49582b),_0xe6f4cc=_0x474827<0x0?_0x501678[_0x3e1847(0x105)]:_0x474827,_0x5f1d31=_0x501678['slice'](_0x49582b,_0xe6f4cc);if((!_0x4a2a8a||_0xa6567d)&&_0x5f1d31[_0x3e1847(0xd5)]())return invalidMybatisSource(_0x3e1847(0xe1));if(_0x4a2a8a&&!_0xa6567d){const _0x5c26b0=decodeXmlEntities(_0x5f1d31);if(_0x5c26b0===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0x419d08+=_0x5c26b0;}else _0x419d08+='\x20';_0x49582b=_0xe6f4cc;continue;}const _0x413b46=findXmlTagEnd(_0x501678,_0x49582b);if(_0x413b46<0x0)return invalidMybatisSource(_0x3e1847(0xda));const _0x9d4cf4=_0x501678['slice'](_0x49582b,_0x413b46+0x1),_0xc078e9=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/['exec'](_0x9d4cf4);if(!_0xc078e9)return invalidMybatisSource(_0x3e1847(0xdb));const _0x518244=_0xc078e9[0x1]==='/',_0x415625=_0xc078e9[0x2]??'',_0x6ef606=_0x415625['toLowerCase'](),_0x1bcbae=_0xc078e9[0x3]??'',_0x2b432d=_0xc078e9[0x4]==='/',_0x45ead7=MYBATIS_OUTER_TAGS[_0x3e1847(0xf6)](_0x6ef606);if(!_0x45ead7&&!MYBATIS_DYNAMIC_TAGS[_0x3e1847(0xff)](_0x6ef606))return invalidMybatisSource(_0x3e1847(0x115)+_0x6ef606+'>.');if(!_0x45ead7&&_0x415625!==_0x6ef606)return invalidMybatisSource(_0x3e1847(0xcd)+_0x415625+'>.');if(_0x518244){if(_0x1bcbae[_0x3e1847(0xd5)]()||_0x2b432d)return invalidMybatisSource(_0x3e1847(0xf3)+_0x415625+'>.');const _0x11d6e4=_0x3a193b['at'](-0x1);if(!_0x11d6e4||(_0x11d6e4[_0x3e1847(0xd3)]?_0x11d6e4['tagName']!==_0x6ef606:_0x11d6e4[_0x3e1847(0xd2)]!==_0x415625))return invalidMybatisSource(_0x3e1847(0x11a)+_0x415625+'>.');_0x3a193b[_0x3e1847(0xe5)]();if(_0x11d6e4[_0x3e1847(0xd3)])_0xa6567d=!![];_0x419d08+=MYBATIS_BRANCH_TAGS[_0x3e1847(0xff)](_0x6ef606)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x1bcbae))return invalidMybatisSource(_0x3e1847(0x104)+_0x415625+'>.');if(_0x6ef606===_0x3e1847(0xd4)&&(!_0x2b432d||_0x3a193b['at'](-0x1)?.[_0x3e1847(0xd1)]!==_0x3e1847(0xe6)))return invalidMybatisSource(_0x3e1847(0xc7));if(_0x45ead7){if(_0x4a2a8a||_0x3a193b[_0x3e1847(0x105)]>0x0)return invalidMybatisSource(_0x3e1847(0xde));_0x4a2a8a=!![],_0xa6567d=_0x2b432d,_0x30e271=_0x45ead7;}else{if(!_0x4a2a8a||_0xa6567d)return invalidMybatisSource('MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<'+_0x415625+'>.');}_0x419d08+=_0x6ef606===_0x3e1847(0xd9)?_0x3e1847(0xc6):_0x6ef606===_0x3e1847(0x10a)?_0x3e1847(0x106):_0x6ef606==='include'?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS[_0x3e1847(0xff)](_0x6ef606)&&!_0x2b432d?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x2b432d&&_0x3a193b[_0x3e1847(0x114)]({'rawName':_0x415625,'tagName':_0x6ef606,'outer':!!_0x45ead7});}_0x49582b=_0x413b46+0x1;}if(_0x3a193b[_0x3e1847(0x105)]>0x0)return invalidMybatisSource(_0x3e1847(0x119)+_0x3a193b['at'](-0x1)?.['rawName']+'>.');if(!_0x4a2a8a||!_0xa6567d)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x419d08[_0x3e1847(0xd5)](),'mode':'mybatisXml',..._0x30e271?{'statementType':_0x30e271}:{}};}function hasWellFormedXmlAttributes(_0xec673a){const _0x48f774=a237_0x4bf4a2;let _0x561b0c=0x0;const _0x3eba4f=new Set();while(_0x561b0c<_0xec673a[_0x48f774(0x105)]){while(_0x561b0c<_0xec673a[_0x48f774(0x105)]&&/\s/['test'](_0xec673a[_0x561b0c]??''))_0x561b0c+=0x1;if(_0x561b0c>=_0xec673a[_0x48f774(0x105)])return!![];const _0x2aef2b=/^[A-Za-z_:][\w:.-]*/[_0x48f774(0xc4)](_0xec673a[_0x48f774(0x11b)](_0x561b0c)),_0x11886d=_0x2aef2b?.[0x0];if(!_0x11886d||_0x3eba4f[_0x48f774(0xff)](_0x11886d))return![];_0x3eba4f[_0x48f774(0xe3)](_0x11886d),_0x561b0c+=_0x11886d['length'];while(_0x561b0c<_0xec673a['length']&&/\s/[_0x48f774(0xd6)](_0xec673a[_0x561b0c]??''))_0x561b0c+=0x1;if(_0xec673a[_0x561b0c]!=='=')return![];_0x561b0c+=0x1;while(_0x561b0c<_0xec673a[_0x48f774(0x105)]&&/\s/[_0x48f774(0xd6)](_0xec673a[_0x561b0c]??''))_0x561b0c+=0x1;const _0x232924=_0xec673a[_0x561b0c];if(_0x232924!=='\x22'&&_0x232924!=='\x27')return![];_0x561b0c+=0x1;const _0x1daaf7=_0xec673a[_0x48f774(0xcc)](_0x232924,_0x561b0c);if(_0x1daaf7<0x0)return![];if(decodeXmlEntities(_0xec673a['slice'](_0x561b0c,_0x1daaf7))===null)return![];_0x561b0c=_0x1daaf7+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0x347b00){const _0x46386e=a237_0x4bf4a2;let _0x29cbd6=0x0;const _0x52ef8e=()=>{const _0x2b9ae2=a237_0x516e;while(_0x29cbd6<_0x347b00[_0x2b9ae2(0x105)]&&/\s/['test'](_0x347b00[_0x29cbd6]??''))_0x29cbd6+=0x1;};_0x52ef8e();while(_0x29cbd6<_0x347b00[_0x46386e(0x105)]){if(_0x347b00[_0x46386e(0xf4)](_0x46386e(0x113),_0x29cbd6)){const _0x53937b=_0x347b00[_0x46386e(0xcc)](_0x46386e(0x118),_0x29cbd6+0x4);if(_0x53937b<0x0)return!![];_0x29cbd6=_0x53937b+0x3,_0x52ef8e();continue;}if(_0x347b00[_0x46386e(0xf4)]('<?',_0x29cbd6)){const _0x42b380=_0x347b00[_0x46386e(0xcc)]('?>',_0x29cbd6+0x2);if(_0x42b380<0x0)return!![];_0x29cbd6=_0x42b380+0x2,_0x52ef8e();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN['test'](_0x347b00[_0x46386e(0x11b)](_0x29cbd6));}function invalidMybatisSource(_0x4372f4){const _0x2529b5=a237_0x4bf4a2;return{'sql':'','mode':_0x2529b5(0xc8),'error':_0x4372f4};}function findXmlTagEnd(_0x366b29,_0x16b53f){const _0x44b077=a237_0x4bf4a2;let _0x5e27d7;for(let _0x3bca66=_0x16b53f+0x1;_0x3bca66<_0x366b29[_0x44b077(0x105)];_0x3bca66+=0x1){const _0x10799b=_0x366b29[_0x3bca66];if(_0x5e27d7){if(_0x10799b===_0x5e27d7)_0x5e27d7=undefined;continue;}if(_0x10799b==='\x22'||_0x10799b==='\x27'){_0x5e27d7=_0x10799b;continue;}if(_0x10799b==='>')return _0x3bca66;}return-0x1;}function decodeXmlEntities(_0x5c2fea){const _0x43257e=a237_0x4bf4a2;let _0x40c317=![];const _0x30287a=_0x5c2fea[_0x43257e(0xe0)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x4b43e0=>{const _0x5f4423=_0x43257e;if(_0x4b43e0==='<')return'<';if(_0x4b43e0===_0x5f4423(0x11c))return'>';if(_0x4b43e0===_0x5f4423(0x10c))return'\x22';if(_0x4b43e0===_0x5f4423(0xc3))return'\x27';if(_0x4b43e0===_0x5f4423(0xdf))return'&';const _0x2c3d5d=/^&#(?:x([0-9a-f]+)|([0-9]+));$/['exec'](_0x4b43e0);if(_0x2c3d5d){const _0x40661f=_0x2c3d5d[0x1],_0x33a1d0=_0x2c3d5d[0x2],_0x400d48=Number['parseInt'](_0x40661f??_0x33a1d0??'',_0x40661f?0x10:0xa);if(isValidXmlCharacter(_0x400d48))return String['fromCodePoint'](_0x400d48);}return _0x40c317=!![],'';});return _0x40c317?null:_0x30287a;}function isValidXmlCharacter(_0x527ad5){return _0x527ad5===0x9||_0x527ad5===0xa||_0x527ad5===0xd||_0x527ad5>=0x20&&_0x527ad5<=0xd7ff||_0x527ad5>=0xe000&&_0x527ad5<=0xfffd||_0x527ad5>=0x10000&&_0x527ad5<=0x10ffff;}export function detectSqlType(_0x3636fe){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x3636fe));}function detectNormalizedSqlType(_0x3aee3a){const _0x32c730=a237_0x4bf4a2;if(_0x3aee3a[_0x32c730(0x11f)])return{'type':_0x32c730(0xd7),'isSelectOnly':![],'isDangerous':![],'reason':_0x3aee3a[_0x32c730(0x11f)]};if(!_0x3aee3a[_0x32c730(0xf2)][_0x32c730(0xd5)]())return{'type':_0x32c730(0xd7),'isSelectOnly':![],'isDangerous':![],'reason':'SQL\x20content\x20is\x20empty'};const _0x5bbc91=stripStaticAnalysisMarkers(_0x3aee3a[_0x32c730(0xf2)])['replace'](/#\{[^}]*\}/g,'?')[_0x32c730(0xe0)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x32c730(0xe0)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x53e1f3=_0x5bbc91[_0x32c730(0xe2)]('\x0a');let _0xa3106a='';for(const _0xe6816d of _0x53e1f3){const _0x1b93f7=_0xe6816d[_0x32c730(0xd5)]();if(!_0x1b93f7||_0x1b93f7['startsWith']('--')||_0x1b93f7['startsWith']('/*'))continue;_0xa3106a=_0x1b93f7;break;}const _0x5f13ae=_0xa3106a[_0x32c730(0xe4)](),_0x47f3a9=_0x3aee3a['statementType'],_0x29afea=maskSqlTextForBlockedKeywordScan(_0x5bbc91),_0x1d3fce=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x32c730(0xd6)](_0x29afea);if(_0x47f3a9===_0x32c730(0xcb)||!_0x47f3a9&&(_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xcb))||_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xe9)))){const _0x13719e=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x32c730(0xd6)](_0x5bbc91);return{'type':_0x32c730(0xcb),'isSelectOnly':!_0x13719e,'isDangerous':_0x13719e,'reason':_0x13719e?_0x32c730(0xd0):undefined};}if(_0x47f3a9===_0x32c730(0xca)||!_0x47f3a9&&_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xca)))return{'type':'INSERT','isSelectOnly':![],'isDangerous':_0x1d3fce,'reason':_0x1d3fce?_0x32c730(0xf8):undefined};if(_0x47f3a9===_0x32c730(0xfc)||!_0x47f3a9&&_0x5f13ae[_0x32c730(0xf4)](_0x32c730(0xfc)))return{'type':_0x32c730(0xfc),'isSelectOnly':![],'isDangerous':_0x1d3fce,'reason':_0x1d3fce?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x47f3a9==='DELETE'||!_0x47f3a9&&_0x5f13ae['startsWith'](_0x32c730(0xfd)))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x32c730(0x112)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x32c730(0xd6)](_0x5f13ae))return{'type':_0x32c730(0x10b),'isSelectOnly':![],'isDangerous':!![],'reason':_0x32c730(0xf1)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x5a3c86){const _0x5ad04a=a237_0x4bf4a2;return _0x5a3c86['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5ad04a(0xe7)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x5e623c){const _0x140586=a237_0x4bf4a2;return _0x5e623c[_0x140586(0xe0)](/'(?:''|\\.|[^'])*'/g,'\x20')[_0x140586(0xe0)](/"(?:""|\\.|[^"])*"/g,'\x20')['replace'](/`(?:``|\\.|[^`])*`/g,'\x20')['replace'](/--.*$/gm,'\x20')[_0x140586(0xe0)](/#.*$/gm,'\x20')[_0x140586(0xe0)](/\/\*[\s\S]*?\*\//g,'\x20');}function a237_0x1c29(){const _0x291d7d=['match','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','<!--','push','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','unknown\x20table(s)','\x20with\x20parameters:\x20','-->','Unclosed\x20MyBatis\x20XML\x20tag:\x20<','Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</','slice','>','<![CDATA[','686373qFqLoS','error',''','exec','choose','\x20WHERE\x20','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','mybatisXml','string','INSERT','SELECT','indexOf','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','join','type','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','tagName','rawName','outer','property','trim','test','UNKNOWN','8oWquDq','where','Unterminated\x20MyBatis\x20XML\x20tag.','Invalid\x20MyBatis\x20XML\x20tag.','from','^<\x5cs*(?:','Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.','&','replace','SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','split','add','toUpperCase','pop','include','replaceAll','matchAll','WITH','Unable\x20to\x20detect\x20SQL\x20type.\x20','264652BCSpjJ','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','reason','isDangerous','insert',']]>','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','sql','Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</','startsWith','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','get','__RABETBASE_MYBATIS_DYNAMIC_START__','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','keys','update','11417616VRoSNm','UPDATE','DELETE','when','has','7224750LOzPqG','__RABETBASE_MYBATIS_DYNAMIC_END__','1648023VRREuy','select','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','length','\x20SET\x20','delete','foreach','114eOwNcF','set','DDL','"','otherwise','31465620cZPtTd','226212tDjGKx','includes'];a237_0x1c29=function(){return _0x291d7d;};return a237_0x1c29();}function extractTables(_0x2bd71f){const _0x113df2=a237_0x4bf4a2,_0x1c9c1a=_0x2bd71f[_0x113df2(0xe0)](/#\{[^}]*\}/g,'?')[_0x113df2(0xe0)](/\$\{[^}]*\}/g,'?')[_0x113df2(0xe0)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x113df2(0xe0)](/\/\*[\s\S]*?\*\//g,''),_0x27b5b6=[],_0x3552a9=_0x1c9c1a[_0x113df2(0x111)](/FROM\s+([^\s,)(]+)/i);addTable(_0x27b5b6,_0x3552a9?.[0x1]);for(const _0xbc22a8 of _0x1c9c1a[_0x113df2(0xe8)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x27b5b6,_0xbc22a8[0x1]);}const _0x50c1a6=_0x1c9c1a[_0x113df2(0x111)](/INTO\s+([^\s(]+)/i);addTable(_0x27b5b6,_0x50c1a6?.[0x1]);const _0x5b1c4e=_0x1c9c1a[_0x113df2(0x111)](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x27b5b6,_0x5b1c4e?.[0x1]),_0x27b5b6;}function a237_0x516e(_0x9aeeda,_0x1bcf8e){_0x9aeeda=_0x9aeeda-0xc3;const _0x1c2954=a237_0x1c29();let _0x516e19=_0x1c2954[_0x9aeeda];return _0x516e19;}function addTable(_0x369d12,_0x5d7302){const _0x115c71=a237_0x4bf4a2,_0x5ec1a2=_0x5d7302?.[_0x115c71(0xe0)](/[`"]/g,'');_0x5ec1a2&&_0x5ec1a2!==UNRESOLVED_SQL_FRAGMENT&&!_0x369d12[_0x115c71(0x110)](_0x5ec1a2)&&_0x369d12[_0x115c71(0x114)](_0x5ec1a2);}function extractParameters(_0x51c861){const _0x8eff03=a237_0x4bf4a2,_0x470ce0=new Set();for(const _0x568674 of _0x51c861[_0x8eff03(0xe8)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x568674[0x1])_0x470ce0['add'](_0x568674[0x1]);}return Array[_0x8eff03(0xdc)](_0x470ce0);}export function validateSql(_0x47f224){const _0x5bbf3d=a237_0x4bf4a2,_0x5cd3d0=normalizeSqlForStaticAnalysis(_0x47f224),_0x34f4bd=detectNormalizedSqlType(_0x5cd3d0),_0x21b6cf=stripStaticAnalysisMarkers(_0x5cd3d0[_0x5bbf3d(0xf2)]),_0x3f54cc=_0x5cd3d0['error']?[]:extractTables(_0x21b6cf),_0x4220eb=_0x5cd3d0[_0x5bbf3d(0x11f)]?[]:extractParameters(_0x21b6cf);if(_0x34f4bd[_0x5bbf3d(0xee)])return{'valid':![],'sqlType':_0x34f4bd,'tables':_0x3f54cc,'parameters':_0x4220eb,'message':_0x34f4bd[_0x5bbf3d(0xed)]||_0x34f4bd['type']+_0x5bbf3d(0xec)};if(_0x34f4bd['type']===_0x5bbf3d(0xd7))return{'valid':![],'sqlType':_0x34f4bd,'tables':_0x3f54cc,'parameters':_0x4220eb,'message':_0x5cd3d0['error']?_0x5bbf3d(0xea)+_0x5cd3d0[_0x5bbf3d(0x11f)]:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x34f4bd,'tables':_0x3f54cc,'parameters':_0x4220eb,'message':_0x34f4bd[_0x5bbf3d(0xcf)]+'\x20query\x20targeting\x20'+(_0x3f54cc[_0x5bbf3d(0x105)]?_0x3f54cc[_0x5bbf3d(0xce)](',\x20'):_0x5bbf3d(0x116))+(_0x4220eb['length']?_0x5bbf3d(0x117)+_0x4220eb[_0x5bbf3d(0xce)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a238_0x19d8(_0x161055,_0x2d4d7c){_0x161055=_0x161055-0x1b0;const _0x30e524=a238_0x30e5();let _0x19d84a=_0x30e524[_0x161055];return _0x19d84a;}const a238_0x21e061=a238_0x19d8;(function(_0x29c237,_0x622ea7){const _0x20f0fa=a238_0x19d8,_0x4dfecc=_0x29c237();while(!![]){try{const _0x29b930=-parseInt(_0x20f0fa(0x1bf))/0x1+-parseInt(_0x20f0fa(0x1b0))/0x2*(-parseInt(_0x20f0fa(0x1bc))/0x3)+-parseInt(_0x20f0fa(0x1b2))/0x4+parseInt(_0x20f0fa(0x1b7))/0x5*(parseInt(_0x20f0fa(0x1b4))/0x6)+-parseInt(_0x20f0fa(0x1bb))/0x7*(parseInt(_0x20f0fa(0x1b9))/0x8)+parseInt(_0x20f0fa(0x1b1))/0x9+parseInt(_0x20f0fa(0x1b5))/0xa;if(_0x29b930===_0x622ea7)break;else _0x4dfecc['push'](_0x4dfecc['shift']());}catch(_0x5c8008){_0x4dfecc['push'](_0x4dfecc['shift']());}}}(a238_0x30e5,0x241e8));function a238_0x30e5(){const _0x4a67e3=['4844230qXExjX','Tip:\x20`','25ZMFWsc','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','8TXvwbD','\x20auth`\x20to\x20login\x20first.','1937593VwCpWD','45iLqtXo','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','251399DzdUdC','26434SXnRZp','1911546PSkXcb','1056780HdfcHe','\x0a\x20\x20\x20\x20\x20\x20\x20','54318tTqBeM'];a238_0x30e5=function(){return _0x4a67e3;};return a238_0x30e5();}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Run\x20`'+CLI_BIN_NAME+a238_0x21e061(0x1ba),'configMissingHint':['Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a238_0x21e061(0x1be),a238_0x21e061(0x1b6)+CLI_BIN_NAME+a238_0x21e061(0x1b8)]['join'](a238_0x21e061(0x1b3)),'notInProjectHint':a238_0x21e061(0x1bd)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40dbd5,_0x3268c6){const _0x13b3ab=a239_0xfb35,_0x20d910=_0x40dbd5();while(!![]){try{const _0x562f86=parseInt(_0x13b3ab(0x1b5))/0x1+-parseInt(_0x13b3ab(0x1ba))/0x2+parseInt(_0x13b3ab(0x1b9))/0x3*(-parseInt(_0x13b3ab(0x1b8))/0x4)+-parseInt(_0x13b3ab(0x1b6))/0x5*(parseInt(_0x13b3ab(0x1bd))/0x6)+parseInt(_0x13b3ab(0x1b4))/0x7+-parseInt(_0x13b3ab(0x1b7))/0x8+-parseInt(_0x13b3ab(0x1b3))/0x9*(-parseInt(_0x13b3ab(0x1bc))/0xa);if(_0x562f86===_0x3268c6)break;else _0x20d910['push'](_0x20d910['shift']());}catch(_0x3f31c2){_0x20d910['push'](_0x20d910['shift']());}}}(a239_0x1d2d,0xdd6df));function a239_0x1d2d(){const _0x403777=['18nkVLKk','9cSqLSy','8745926YEShlX','779229jzZfdm','371695rxvKCC','10353016TjgHlY','4jKbeiW','1975965tpwNkm','1743210wkNkxX','map','19257320UyeTBs'];a239_0x1d2d=function(){return _0x403777;};return a239_0x1d2d();}function a239_0xfb35(_0x258eec,_0x4d6044){_0x258eec=_0x258eec-0x1b3;const _0x1d2d6c=a239_0x1d2d();let _0xfb35e7=_0x1d2d6c[_0x258eec];return _0xfb35e7;}import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a239_0xf54895}from'@lovrabet/cli-framework';import{EXPLICIT_YES_FLAG_DESCRIPTION,requiresExplicitYes}from'../framework/explicit-yes.js';export function buildAllFlags(_0x488db6){const _0x59a6f9=a239_0xfb35,_0x2c80b8=a239_0xf54895(_0x488db6,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});if(!requiresExplicitYes(_0x488db6))return _0x2c80b8;return _0x2c80b8[_0x59a6f9(0x1bb)](_0x2a325e=>_0x2a325e['name']==='yes'?{..._0x2a325e,'description':EXPLICIT_YES_FLAG_DESCRIPTION}:_0x2a325e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a240_0x555a(){var _0x248363=['compress','8230635lJxVct','906868hFfsiK','3xKoWSO','1174429GzYpdV','format','def','defaultFormat','7PuRqwM','4201275pDuMRP','2999658auVmqK','3038096AyBPCB','6631616IAImIb','flags'];a240_0x555a=function(){return _0x248363;};return a240_0x555a();}(function(_0x4708fa,_0x1fca38){var _0x573afd=a240_0x18d5,_0x2f3607=_0x4708fa();while(!![]){try{var _0x1e97ad=parseInt(_0x573afd(0x1ce))/0x1+parseInt(_0x573afd(0x1d5))/0x2+parseInt(_0x573afd(0x1cd))/0x3*(parseInt(_0x573afd(0x1cc))/0x4)+-parseInt(_0x573afd(0x1d3))/0x5+-parseInt(_0x573afd(0x1d4))/0x6*(-parseInt(_0x573afd(0x1d2))/0x7)+-parseInt(_0x573afd(0x1d6))/0x8+-parseInt(_0x573afd(0x1d9))/0x9;if(_0x1e97ad===_0x1fca38)break;else _0x2f3607['push'](_0x2f3607['shift']());}catch(_0x5b04a2){_0x2f3607['push'](_0x2f3607['shift']());}}}(a240_0x555a,0xcc33f));import{resolveOutputConfig}from'@lovrabet/cli-framework';export function usesStructuredErrorOutput(_0x41e604){return _0x41e604?.['structuredErrors']===!![];}function a240_0x18d5(_0x19476f,_0x3bd9fd){_0x19476f=_0x19476f-0x1cc;var _0x555a34=a240_0x555a();var _0x18d575=_0x555a34[_0x19476f];return _0x18d575;}export function resolveErrorOutputFormat(_0x4b58cc){var _0x4baa68=a240_0x18d5;if(!_0x4b58cc[_0x4baa68(0x1d0)])return _0x4b58cc[_0x4baa68(0x1d1)]??_0x4baa68(0x1d8);return resolveOutputConfig({'flags':_0x4b58cc[_0x4baa68(0x1d7)]??{},'def':_0x4b58cc['def'],'configDefault':_0x4b58cc['defaultFormat']})[_0x4baa68(0x1cf)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a241_0xa298(_0x70527b,_0x5b0474){_0x70527b=_0x70527b-0x1bd;const _0x2c819d=a241_0x2c81();let _0xa29804=_0x2c819d[_0x70527b];return _0xa29804;}const a241_0x15b74a=a241_0xa298;(function(_0x758e4e,_0x54cf3c){const _0x5afdd4=a241_0xa298,_0x51e705=_0x758e4e();while(!![]){try{const _0x3f2c6e=parseInt(_0x5afdd4(0x1c1))/0x1+-parseInt(_0x5afdd4(0x1c0))/0x2+-parseInt(_0x5afdd4(0x1ca))/0x3+parseInt(_0x5afdd4(0x1c6))/0x4+-parseInt(_0x5afdd4(0x1bf))/0x5+-parseInt(_0x5afdd4(0x1c5))/0x6+parseInt(_0x5afdd4(0x1c4))/0x7;if(_0x3f2c6e===_0x54cf3c)break;else _0x51e705['push'](_0x51e705['shift']());}catch(_0x4456e0){_0x51e705['push'](_0x51e705['shift']());}}}(a241_0x2c81,0x7ffff));const EXPLICIT_YES_COMMANDS=new Set([a241_0x15b74a(0x1c2),a241_0x15b74a(0x1be),a241_0x15b74a(0x1c9),a241_0x15b74a(0x1c3),a241_0x15b74a(0x1c7),a241_0x15b74a(0x1bd)]);export const EXPLICIT_YES_FLAG_DESCRIPTION='Required\x20for\x20execution\x20after\x20reviewing\x20the\x20--dry-run\x20plan';function a241_0x2c81(){const _0x2c358f=['5064595gRJnmo','167794nmUQXT','779144YCcuQT','menu\x20external-link-update','kb\x20create','3890446tYhCgm','2028600vKLWoV','3373272sjryxA','kb\x20update','command','menu\x20regroup-start','657111fUTYgd','has','kb\x20delete','menu\x20delete'];a241_0x2c81=function(){return _0x2c358f;};return a241_0x2c81();}export function requiresExplicitYes(_0x2c420f){const _0x4d2904=a241_0x15b74a;return EXPLICIT_YES_COMMANDS[_0x4d2904(0x1cb)](_0x2c420f['service']+'\x20'+_0x2c420f[_0x4d2904(0x1c8)]);}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a242_0x3402cb=a242_0x51a7;(function(_0x49e957,_0x3c9277){const _0x2bcb2c=a242_0x51a7,_0x2f9a92=_0x49e957();while(!![]){try{const _0x2cb365=-parseInt(_0x2bcb2c(0xbd))/0x1+-parseInt(_0x2bcb2c(0xc0))/0x2+-parseInt(_0x2bcb2c(0xc3))/0x3*(parseInt(_0x2bcb2c(0xc2))/0x4)+parseInt(_0x2bcb2c(0xc7))/0x5+parseInt(_0x2bcb2c(0xbf))/0x6+parseInt(_0x2bcb2c(0xc4))/0x7+-parseInt(_0x2bcb2c(0xbe))/0x8*(parseInt(_0x2bcb2c(0xc5))/0x9);if(_0x2cb365===_0x3c9277)break;else _0x2f9a92['push'](_0x2f9a92['shift']());}catch(_0x25848c){_0x2f9a92['push'](_0x2f9a92['shift']());}}}(a242_0x5182,0xb6f41));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a242_0x51a7(_0x38df81,_0x3f8a3a){_0x38df81=_0x38df81-0xbd;const _0x518237=a242_0x5182();let _0x51a788=_0x518237[_0x38df81];return _0x51a788;}const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a242_0x3402cb(0xc6)];function a242_0x5182(){const _0x358680=['3295266DTVzjX','1684598UOTSgq','validateFlags','4BeSQUv','746139ANcyfP','9770446pvwrlK','85014llptaS','parseFlags','6740445lMLWix','1207093INnQkc','208FedfzX'];a242_0x5182=function(){return _0x358680;};return a242_0x5182();}export const validateFlags=helpers[a242_0x3402cb(0xc1)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a243_0x28ad80=a243_0x330c;(function(_0x5823a8,_0x50435c){const _0x45fc98=a243_0x330c,_0x49b1af=_0x5823a8();while(!![]){try{const _0x4128b4=parseInt(_0x45fc98(0x98))/0x1+parseInt(_0x45fc98(0x95))/0x2+parseInt(_0x45fc98(0x8d))/0x3*(parseInt(_0x45fc98(0x91))/0x4)+parseInt(_0x45fc98(0x8e))/0x5*(-parseInt(_0x45fc98(0x92))/0x6)+-parseInt(_0x45fc98(0x9a))/0x7+parseInt(_0x45fc98(0x90))/0x8+-parseInt(_0x45fc98(0x8c))/0x9;if(_0x4128b4===_0x50435c)break;else _0x49b1af['push'](_0x49b1af['shift']());}catch(_0x2ef810){_0x49b1af['push'](_0x49b1af['shift']());}}}(a243_0x54d0,0xd4464));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';function a243_0x54d0(){const _0x4c8f93=['generateServiceHelp','replace','979793UQoAgl','\x20[args]\x20[flags]','3742858UJDzlu','generateCommandHelp','11910960YgtWuJ','141YAqJWQ','145sYJdjk','generateFullHelp','1869592zyYIcT','56996hOiRag','172206kOwsZG','Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','Requires\x20explicit\x20--yes\x20for\x20execution;\x20use\x20--dry-run\x20to\x20preview.','3353488SmYErc'];a243_0x54d0=function(){return _0x4c8f93;};return a243_0x54d0();}import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';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':_0x5054e6=>serviceGroups['get'](_0x5054e6),'buildAllFlags':buildAllFlags,'appPrerequisiteText':'Requires\x20appcode\x20(set\x20via\x20`'+CLI_BIN_NAME+'\x20workspace\x20init`\x20or\x20--appcode).','serviceUsageSuffix':a243_0x28ad80(0x99)});export function generateCommandHelp(_0x303d77){const _0x572b19=a243_0x28ad80,_0x27e9f6=generators[_0x572b19(0x9b)](_0x303d77);if(!requiresExplicitYes(_0x303d77))return _0x27e9f6;return _0x27e9f6[_0x572b19(0x97)](_0x572b19(0x93),_0x572b19(0x94));}function a243_0x330c(_0x3d47af,_0x539119){_0x3d47af=_0x3d47af-0x8c;const _0x54d074=a243_0x54d0();let _0x330c75=_0x54d074[_0x3d47af];return _0x330c75;}export const generateServiceHelp=generators[a243_0x28ad80(0x96)];export const generateFullHelp=generators[a243_0x28ad80(0x8f)];
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cb9ed,_0x248695){var _0x4415d3=a244_0x739a,_0x5dfe4c=_0x1cb9ed();while(!![]){try{var _0x3e44b8=-parseInt(_0x4415d3(0x19a))/0x1+parseInt(_0x4415d3(0x19f))/0x2+-parseInt(_0x4415d3(0x199))/0x3*(-parseInt(_0x4415d3(0x19b))/0x4)+parseInt(_0x4415d3(0x19c))/0x5*(parseInt(_0x4415d3(0x1a1))/0x6)+parseInt(_0x4415d3(0x19e))/0x7+-parseInt(_0x4415d3(0x1a0))/0x8+-parseInt(_0x4415d3(0x19d))/0x9;if(_0x3e44b8===_0x248695)break;else _0x5dfe4c['push'](_0x5dfe4c['shift']());}catch(_0x3b236d){_0x5dfe4c['push'](_0x5dfe4c['shift']());}}}(a244_0x1841,0xda03d));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';function a244_0x1841(){var _0x1e4ba1=['4746854NZLXZH','3063012knZFEt','5214832uyeJIp','392286PBsPZv','162EdHvYQ','138463MtouGS','2948suUOsz','50PWSCZx','10979370xgclYS'];a244_0x1841=function(){return _0x1e4ba1;};return a244_0x1841();}function a244_0x739a(_0x4665a5,_0x13e823){_0x4665a5=_0x4665a5-0x199;var _0x1841b6=a244_0x1841();var _0x739ac7=_0x1841b6[_0x4665a5];return _0x739ac7;}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(_0xb9b266,_0x21f8d7){const _0x71b59d=a245_0x2285,_0x313db1=_0xb9b266();while(!![]){try{const _0x31e12c=parseInt(_0x71b59d(0x1d6))/0x1*(parseInt(_0x71b59d(0x1e4))/0x2)+parseInt(_0x71b59d(0x1e2))/0x3*(-parseInt(_0x71b59d(0x1de))/0x4)+-parseInt(_0x71b59d(0x1d8))/0x5*(-parseInt(_0x71b59d(0x1d7))/0x6)+-parseInt(_0x71b59d(0x1d5))/0x7*(-parseInt(_0x71b59d(0x1d3))/0x8)+parseInt(_0x71b59d(0x1ce))/0x9+-parseInt(_0x71b59d(0x1cd))/0xa+-parseInt(_0x71b59d(0x1e3))/0xb*(parseInt(_0x71b59d(0x1e8))/0xc);if(_0x31e12c===_0x21f8d7)break;else _0x313db1['push'](_0x313db1['shift']());}catch(_0x54750a){_0x313db1['push'](_0x313db1['shift']());}}}(a245_0x2903,0x61553));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a245_0x2285(_0x56f7ca,_0x1cbac2){_0x56f7ca=_0x56f7ca-0x1cc;const _0x2903f2=a245_0x2903();let _0x2285c8=_0x2903f2[_0x56f7ca];return _0x2285c8;}import{CliError,CliErrors}from'../errors.js';import{applyJqFilter}from'../utils/apply-jq-filter.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});export function formatOutput(_0x56baad,_0x2ede1c){const _0xe221d8=a245_0x2285,_0x2538ca=_0x56baad[_0xe221d8(0x1e6)],{_notice:_0x168895,..._0x56f3b2}=_0x56baad;void _0x168895,baseFormatOutput(_0x56f3b2,_0x2ede1c),_0x2ede1c['format']===_0xe221d8(0x1e0)&&printPrettyNotice(_0x2538ca);}function a245_0x2903(){const _0x1cf67d=['command','message','format','154132bSGVqG','error','pretty','json','36lBmjer','5225aafNEV','1360846oFTkSi','update','_notice','endsWith','13380DJIHuF','validation','jqFilter','6660500bhvGmy','3125781hwlNLU','write','hint','data','trim','4256iiyPbW','stringify','3199dAaABE','1iHfnSS','1236vhsjDY','19075ozKKCm','code','jq:\x20'];a245_0x2903=function(){return _0x1cf67d;};return a245_0x2903();}export function formatCliError(_0x28fb13,_0x2bea9a){const _0x406ed2=a245_0x2285;if(_0x2bea9a[_0x406ed2(0x1dd)]===_0x406ed2(0x1e0))return![];const _0x52a08e=_0x28fb13[_0x406ed2(0x1d1)],_0x1fc678={'ok':![],'command':_0x2bea9a[_0x406ed2(0x1db)],'risk':_0x2bea9a['risk'],'data':_0x52a08e??null,'error':{'code':_0x28fb13['code'],'message':_0x28fb13[_0x406ed2(0x1dc)],..._0x28fb13['hint']?{'hint':_0x28fb13[_0x406ed2(0x1d0)]}:{}}},_0x41ed34=_0x2bea9a['format']===_0x406ed2(0x1e1)?JSON[_0x406ed2(0x1d4)](_0x1fc678,null,0x2):JSON[_0x406ed2(0x1d4)](_0x1fc678);let _0x2b874c=_0x41ed34;if(_0x2bea9a[_0x406ed2(0x1cc)]?.[_0x406ed2(0x1d2)]())try{_0x2b874c=applyJqFilter(_0x41ed34,_0x2bea9a[_0x406ed2(0x1cc)]);}catch(_0x4b630f){const _0xf91ded=_0x4b630f instanceof CliError?_0x4b630f:CliErrors[_0x406ed2(0x1e9)](_0x406ed2(0x1da)+(_0x4b630f instanceof Error?_0x4b630f['message']:String(_0x4b630f))),_0x5d9ed3={..._0x1fc678,'error':{'code':_0xf91ded[_0x406ed2(0x1d9)],'message':_0xf91ded[_0x406ed2(0x1dc)],..._0xf91ded[_0x406ed2(0x1d0)]?{'hint':_0xf91ded[_0x406ed2(0x1d0)]}:{},'cause':_0x1fc678[_0x406ed2(0x1df)]}};_0x2b874c=_0x2bea9a[_0x406ed2(0x1dd)]===_0x406ed2(0x1e1)?JSON[_0x406ed2(0x1d4)](_0x5d9ed3,null,0x2):JSON[_0x406ed2(0x1d4)](_0x5d9ed3);}return process['stdout'][_0x406ed2(0x1cf)](_0x2b874c[_0x406ed2(0x1e7)]('\x0a')?_0x2b874c:_0x2b874c+'\x0a'),!![];}function printPrettyNotice(_0x58176c){const _0x29acbc=a245_0x2285;if(!_0x58176c?.[_0x29acbc(0x1e5)])return;console[_0x29acbc(0x1df)](_0x58176c['update'][_0x29acbc(0x1dc)]+'\x20('+_0x58176c['update']['url']+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x199498,_0x2854e4){var _0xecfc8c=a246_0x2463,_0x40af0e=_0x199498();while(!![]){try{var _0x314af7=-parseInt(_0xecfc8c(0x168))/0x1*(parseInt(_0xecfc8c(0x15e))/0x2)+parseInt(_0xecfc8c(0x15f))/0x3*(-parseInt(_0xecfc8c(0x162))/0x4)+parseInt(_0xecfc8c(0x164))/0x5*(parseInt(_0xecfc8c(0x160))/0x6)+-parseInt(_0xecfc8c(0x163))/0x7*(-parseInt(_0xecfc8c(0x166))/0x8)+-parseInt(_0xecfc8c(0x161))/0x9+parseInt(_0xecfc8c(0x167))/0xa+parseInt(_0xecfc8c(0x165))/0xb;if(_0x314af7===_0x2854e4)break;else _0x40af0e['push'](_0x40af0e['shift']());}catch(_0x286b14){_0x40af0e['push'](_0x40af0e['shift']());}}}(a246_0x16f4,0x204f9));function a246_0x16f4(){var _0x5df6ab=['1792900qbDQLe','51614JLWIRT','6qjIABz','282JmPZUY','136362iHPFVK','2209644sgvGdj','8116OSAzMM','749VFxtPV','20sTHIbs','2788082lcRdyG','14936mcxKBv'];a246_0x16f4=function(){return _0x5df6ab;};return a246_0x16f4();}function a246_0x2463(_0x4fbb77,_0x17259a){_0x4fbb77=_0x4fbb77-0x15e;var _0x16f49b=a246_0x16f4();var _0x246370=_0x16f49b[_0x4fbb77];return _0x246370;}export{extractList,extractPaging}from'@lovrabet/cli-framework';
|