@lovrabet/rabetbase-cli 2.4.3-beta.1 → 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 +1 -1
- 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
|
-
(function(
|
|
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
|
-
(function(
|
|
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 a230_0xdee6(_0x350d35,_0x5ae046){_0x350d35=_0x350d35-0x7b;const _0x57b072=a230_0x57b0();let _0xdee61=_0x57b072[_0x350d35];return _0xdee61;}(function(_0x37335a,_0x2de8c6){const _0x37787b=a230_0xdee6,_0x5534bf=_0x37335a();while(!![]){try{const _0x3a9063=-parseInt(_0x37787b(0x84))/0x1+parseInt(_0x37787b(0xa7))/0x2*(parseInt(_0x37787b(0x7d))/0x3)+-parseInt(_0x37787b(0x7f))/0x4*(-parseInt(_0x37787b(0xa5))/0x5)+parseInt(_0x37787b(0x81))/0x6+-parseInt(_0x37787b(0xc0))/0x7+parseInt(_0x37787b(0xb2))/0x8+-parseInt(_0x37787b(0x93))/0x9*(parseInt(_0x37787b(0x86))/0xa);if(_0x3a9063===_0x2de8c6)break;else _0x5534bf['push'](_0x5534bf['shift']());}catch(_0x32ed9c){_0x5534bf['push'](_0x5534bf['shift']());}}}(a230_0x57b0,0x2906c));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x11b0ce,_0x1c0c81){const _0x3d543e=a230_0xdee6,_0x7dfba1=[],_0x1eef44=normalizeSqlForStaticAnalysis(_0x11b0ce),_0x2fbc8e=(_0x1eef44['error']?[]:extractJoinFacts(_0x1eef44[_0x3d543e(0xb6)]))['map'](_0x430bf4=>{const _0x388292=_0x3d543e;if(_0x430bf4[_0x388292(0xb5)]||_0x430bf4[_0x388292(0x83)][_0x388292(0x89)]===0x0)return _0x7dfba1[_0x388292(0xc7)]({'code':_0x388292(0x9d),'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'reason':_0x430bf4['unsupportedReason']??_0x388292(0xc8)}),{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':'unavailable'};const _0x36feea=resolveTableMetadata(_0x1c0c81,_0x430bf4['table']),_0x349587=(_0x36feea?.[_0x388292(0xb8)]??[])[_0x388292(0xbf)](_0x49f324=>({'index':_0x49f324,'matchedPrefix':findEqualityPrefix(_0x49f324[_0x388292(0x83)],_0x430bf4[_0x388292(0x83)])}))[_0x388292(0xa3)](_0xf76818=>_0xf76818['matchedPrefix'][_0x388292(0x89)]>0x0),_0x1b4e5f=_0x349587['reduce']((_0x1ef49a,_0xd1c2cd)=>!_0x1ef49a||_0xd1c2cd[_0x388292(0xbd)]['length']>_0x1ef49a['matchedPrefix']['length']?_0xd1c2cd:_0x1ef49a,_0x349587[0x0]);if(_0x1b4e5f)return{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':_0x388292(0x91),'matchedIndex':{..._0x1b4e5f[_0x388292(0xbe)],'matchedPrefix':_0x1b4e5f[_0x388292(0xbd)]}};const _0x538f28=_0x36feea?.[_0x388292(0xb8)][_0x388292(0xa3)](_0x453964=>_0x453964[_0x388292(0x83)][_0x388292(0xc9)](_0x36cec9=>_0x430bf4[_0x388292(0x83)][_0x388292(0xc9)](_0x435c4a=>columnNamesMatch(_0x36cec9,_0x435c4a))))??[];if(_0x538f28[_0x388292(0x89)]>0x0)return _0x7dfba1[_0x388292(0xc7)]({'code':_0x388292(0x82),'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4['alias'],'columns':_0x430bf4[_0x388292(0x83)],'reason':_0x388292(0xa0)}),{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':'warning','candidateIndexes':_0x538f28};if(_0x36feea&&_0x36feea[_0x388292(0xbc)]!==![]&&_0x36feea['indexes'][_0x388292(0x89)]>0x0&&_0x430bf4[_0x388292(0x83)][_0x388292(0x89)]>0x0)return _0x7dfba1[_0x388292(0xc7)]({'code':_0x388292(0xa8),'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4['alias'],'columns':_0x430bf4['columns'],'reason':_0x388292(0xb9)}),{'table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4['columns'],'status':_0x388292(0xc1)};return _0x7dfba1[_0x388292(0xc7)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x430bf4[_0x388292(0xa6)],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'reason':_0x36feea?_0x388292(0xab):_0x388292(0xa9)}),{'table':_0x430bf4['table'],'alias':_0x430bf4[_0x388292(0xb3)],'columns':_0x430bf4[_0x388292(0x83)],'status':_0x388292(0x9c)};});return{'checked':_0x2fbc8e[_0x3d543e(0x89)]>0x0,'joins':_0x2fbc8e,'warnings':_0x7dfba1};}function extractJoinFacts(_0x1c6ce4){const _0x17b197=a230_0xdee6,_0x42d3a3=maskNestedQueries(stripSqlNoise(_0x1c6ce4)),_0x17ff4a=maskQuotedIdentifiers(_0x42d3a3),_0x4ebe78=[],_0x1a5f21=new Set(),_0x5952e1=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x3236e2 of _0x42d3a3[_0x17b197(0xa2)](_0x5952e1)){const _0x4afd01=_0x3236e2[_0x17b197(0xbe)]??0x0,_0x1932b0=_0x3236e2[0x0][_0x17b197(0x96)](/\bJOIN\b/i),_0x2fb38b=_0x4afd01+Math[_0x17b197(0x8d)](0x0,_0x1932b0);if(!/^JOIN\b/i[_0x17b197(0xc5)](_0x17ff4a[_0x17b197(0xb1)](_0x2fb38b)))continue;_0x1a5f21[_0x17b197(0x80)](_0x2fb38b);const _0x37a75a=normalizeIdentifier(_0x3236e2[0x1]||_0x17b197(0x9a)),_0x289a8a=normalizeIdentifier(_0x3236e2[0x2]??''),_0x39d7db=normalizeIdentifier(_0x3236e2[0x3]||_0x289a8a[_0x17b197(0xba)]('.')['at'](-0x1)||_0x289a8a),_0x45ab31=[],_0x6ac16f=_0x289a8a===_0x17b197(0x9e);let _0x20fc92=_0x37a75a===_0x17b197(0xbb)||_0x37a75a===_0x17b197(0x7e)||_0x6ac16f,_0x5e0eb1=_0x20fc92?_0x6ac16f?_0x17b197(0x85):_0x37a75a[_0x17b197(0xb7)]()+_0x17b197(0x8b):undefined;const _0xb59d2c=stripOuterParentheses(_0x3236e2[0x4]??''),_0x5df194=_0xb59d2c['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0xb59d2c[_0x17b197(0x95)](MYBATIS_DYNAMIC_END_MARKER),_0x229f88=_0xb59d2c[_0x17b197(0x95)](MYBATIS_INCLUDE_MARKER);_0x5df194&&(_0x20fc92=!![],_0x5e0eb1??=_0x17b197(0xc3));_0x229f88&&(_0x20fc92=!![],_0x5e0eb1??=_0x17b197(0x98));const _0x205156=_0xb59d2c[_0x17b197(0x87)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x17b197(0x87)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x205156,'OR')&&(_0x20fc92=!![],_0x5e0eb1??=_0x17b197(0x88));for(const _0x11477f of splitTopLevelAnd(_0x205156)){const _0x1ddf3c=stripOuterParentheses(_0x11477f);if(hasTopLevelKeyword(_0x1ddf3c,'OR')){_0x20fc92=!![],_0x5e0eb1??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0xd1bc5c=splitEquality(_0x1ddf3c);if(!_0xd1bc5c){containsColumnReference(_0x11477f,_0x39d7db)&&(_0x20fc92=!![]);continue;}const _0x5c3fc7=parseDirectColumnReference(_0xd1bc5c[0x0],_0x39d7db),_0x1ef7c8=parseDirectColumnReference(_0xd1bc5c[0x1],_0x39d7db),_0x587276=containsColumnReference(_0xd1bc5c[0x0],_0x39d7db),_0x336ede=containsColumnReference(_0xd1bc5c[0x1],_0x39d7db),_0x2818c5=_0x5c3fc7&&!_0x336ede?_0x5c3fc7:_0x1ef7c8&&!_0x587276?_0x1ef7c8:null;if(_0x2818c5&&!_0x45ab31[_0x17b197(0x95)](_0x2818c5))_0x45ab31['push'](_0x2818c5);else!_0x2818c5&&containsColumnReference(_0x11477f,_0x39d7db)&&(_0x20fc92=!![]);}_0x4ebe78[_0x17b197(0xc7)]({'table':_0x289a8a,'alias':_0x39d7db,'columns':_0x45ab31,'unsupportedPredicate':_0x20fc92,'unsupportedReason':_0x5e0eb1,'containsUnresolvedInclude':_0x229f88,'position':_0x2fb38b});}for(const _0x271efb of _0x17ff4a['matchAll'](/\bJOIN\b/gi)){const _0xc9a1b=_0x271efb[_0x17b197(0xbe)]??0x0;if(_0x1a5f21['has'](_0xc9a1b))continue;const _0x105d62=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x17b197(0xa1)](_0x42d3a3[_0x17b197(0xb1)](_0xc9a1b+_0x271efb[0x0]['length'])),_0x5642a0=normalizeIdentifier(_0x105d62?.[0x1]||'unknown'),_0x36fc03=normalizeIdentifier(_0x105d62?.[0x2]||''),_0x37d417=isSqlClauseKeyword(_0x36fc03)?_0x5642a0['split']('.')['at'](-0x1)||_0x5642a0:_0x36fc03||_0x5642a0[_0x17b197(0xba)]('.')['at'](-0x1)||_0x5642a0;_0x4ebe78['push']({'table':_0x5642a0,'alias':_0x37d417,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x17b197(0x7b),'position':_0xc9a1b});}const _0x4772bd=_0x17ff4a[_0x17b197(0xc2)](MYBATIS_INCLUDE_MARKER);return _0x4772bd>=0x0&&!_0x4ebe78[_0x17b197(0xc9)](_0x17d7b9=>_0x17d7b9[_0x17b197(0x8f)])&&_0x4ebe78[_0x17b197(0xc7)]({'table':_0x17b197(0xb4),'alias':_0x17b197(0xb4),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x17b197(0x8a),'containsUnresolvedInclude':!![],'position':_0x4772bd}),_0x4ebe78[_0x17b197(0x99)]((_0x39740c,_0x31f6e2)=>_0x39740c[_0x17b197(0xa4)]-_0x31f6e2[_0x17b197(0xa4)]);}function stripSqlNoise(_0x19f46c){const _0x378f20=a230_0xdee6,_0x20054b=Array[_0x378f20(0x9f)](_0x19f46c),_0x2c44df=(_0x262853,_0x527a32)=>{for(let _0x55fb51=_0x262853;_0x55fb51<_0x527a32;_0x55fb51+=0x1){_0x20054b[_0x55fb51]!=='\x0a'&&_0x20054b[_0x55fb51]!=='\x0d'&&(_0x20054b[_0x55fb51]='\x20');}};for(let _0x402f81=0x0;_0x402f81<_0x20054b[_0x378f20(0x89)];_0x402f81+=0x1){const _0x2d8d92=_0x20054b[_0x402f81],_0x24a7bd=_0x20054b[_0x402f81+0x1];if(_0x2d8d92==='\x27'||_0x2d8d92==='\x22'||_0x2d8d92==='`'){const _0xa21c1e=_0x2d8d92,_0x56ae6c=_0x402f81;_0x402f81+=0x1;while(_0x402f81<_0x20054b[_0x378f20(0x89)]){if(_0x20054b[_0x402f81]==='\x5c'&&_0x402f81+0x1<_0x20054b['length']){_0x402f81+=0x2;continue;}if(_0x20054b[_0x402f81]!==_0xa21c1e){_0x402f81+=0x1;continue;}if(_0x20054b[_0x402f81+0x1]===_0xa21c1e){_0x402f81+=0x2;continue;}break;}if(_0xa21c1e==='\x27')_0x2c44df(_0x56ae6c,Math[_0x378f20(0xc4)](_0x402f81+0x1,_0x20054b[_0x378f20(0x89)]));continue;}if(_0x2d8d92==='-'&&_0x24a7bd==='-'){const _0x680021=_0x402f81;while(_0x402f81<_0x20054b['length']&&_0x20054b[_0x402f81]!=='\x0a')_0x402f81+=0x1;_0x2c44df(_0x680021,_0x402f81);continue;}if(_0x2d8d92==='/'&&_0x24a7bd==='*'){const _0x3e7bfe=_0x402f81;_0x402f81+=0x2;while(_0x402f81<_0x20054b[_0x378f20(0x89)]&&!(_0x20054b[_0x402f81]==='*'&&_0x20054b[_0x402f81+0x1]==='/')){_0x402f81+=0x1;}_0x402f81=Math[_0x378f20(0xc4)](_0x402f81+0x1,_0x20054b[_0x378f20(0x89)]-0x1),_0x2c44df(_0x3e7bfe,_0x402f81+0x1);continue;}if(_0x2d8d92==='#'&&_0x24a7bd!=='{'){const _0x3c97f5=_0x402f81;while(_0x402f81<_0x20054b[_0x378f20(0x89)]&&_0x20054b[_0x402f81]!=='\x0a')_0x402f81+=0x1;_0x2c44df(_0x3c97f5,_0x402f81);continue;}if((_0x2d8d92==='#'||_0x2d8d92==='$')&&_0x24a7bd==='{'){const _0x36049b=_0x402f81;_0x402f81+=0x2;while(_0x402f81<_0x20054b[_0x378f20(0x89)]&&_0x20054b[_0x402f81]!=='}')_0x402f81+=0x1;_0x2c44df(_0x36049b,Math[_0x378f20(0xc4)](_0x402f81+0x1,_0x20054b['length']));}}return _0x20054b['join']('');}function maskQuotedIdentifiers(_0x19e478){const _0x5156eb=a230_0xdee6,_0x1f6b80=Array[_0x5156eb(0x9f)](_0x19e478);for(let _0x57e2e5=0x0;_0x57e2e5<_0x1f6b80['length'];_0x57e2e5+=0x1){const _0x21b37c=_0x1f6b80[_0x57e2e5];if(_0x21b37c!=='\x22'&&_0x21b37c!=='`')continue;_0x57e2e5+=0x1;while(_0x57e2e5<_0x1f6b80[_0x5156eb(0x89)]){if(_0x1f6b80[_0x57e2e5]===_0x21b37c){if(_0x1f6b80[_0x57e2e5+0x1]===_0x21b37c){_0x1f6b80[_0x57e2e5]='\x20',_0x1f6b80[_0x57e2e5+0x1]='\x20',_0x57e2e5+=0x2;continue;}break;}_0x1f6b80[_0x57e2e5]='\x20',_0x57e2e5+=0x1;}}return _0x1f6b80['join']('');}function maskNestedQueries(_0x3b02e6){const _0x1d733f=a230_0xdee6,_0x594b2c=Array[_0x1d733f(0x9f)](_0x3b02e6);for(let _0x239398=0x0;_0x239398<_0x594b2c[_0x1d733f(0x89)];_0x239398+=0x1){if(_0x594b2c[_0x239398]!=='(')continue;const _0x283dcd=_0x3b02e6[_0x1d733f(0xb1)](_0x239398+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x1d733f(0xc5)](_0x283dcd))continue;let _0x454c59=0x1,_0x19a196=_0x239398+0x1;for(;_0x19a196<_0x594b2c[_0x1d733f(0x89)]&&_0x454c59>0x0;_0x19a196+=0x1){if(_0x594b2c[_0x19a196]==='(')_0x454c59+=0x1;if(_0x594b2c[_0x19a196]===')')_0x454c59-=0x1;}if(_0x454c59!==0x0)continue;for(let _0x8b8415=_0x239398;_0x8b8415<_0x19a196;_0x8b8415+=0x1){_0x594b2c[_0x8b8415]='\x20';}const _0x4608d4=_0x1d733f(0x9e);for(let _0x1e1037=0x0;_0x1e1037<_0x4608d4['length']&&_0x239398+_0x1e1037<_0x19a196;_0x1e1037+=0x1){_0x594b2c[_0x239398+_0x1e1037]=_0x4608d4[_0x1e1037];}_0x239398=_0x19a196-0x1;}return _0x594b2c['join']('');}function splitTopLevelAnd(_0x16ab7c){const _0x21ff02=a230_0xdee6,_0x5d8125=[];let _0x49e225=0x0,_0x501df3=0x0;for(let _0x56d5b9=0x0;_0x56d5b9<_0x16ab7c['length'];_0x56d5b9+=0x1){const _0x160701=_0x16ab7c[_0x56d5b9];if(_0x160701==='(')_0x49e225+=0x1;if(_0x160701===')')_0x49e225=Math[_0x21ff02(0x8d)](0x0,_0x49e225-0x1);_0x49e225===0x0&&_0x16ab7c['slice'](_0x56d5b9)[_0x21ff02(0xaf)](/^AND\b/i)&&(_0x56d5b9===0x0||/\s/[_0x21ff02(0xc5)](_0x16ab7c[_0x56d5b9-0x1]??''))&&(_0x5d8125[_0x21ff02(0xc7)](_0x16ab7c['slice'](_0x501df3,_0x56d5b9)[_0x21ff02(0xaa)]()),_0x56d5b9+=0x2,_0x501df3=_0x56d5b9+0x1);}const _0x3c7d49=_0x16ab7c[_0x21ff02(0xb1)](_0x501df3)[_0x21ff02(0xaa)]();if(_0x3c7d49)_0x5d8125[_0x21ff02(0xc7)](_0x3c7d49);return _0x5d8125;}function hasTopLevelKeyword(_0x485e82,_0x1c654e){const _0x3bb115=a230_0xdee6;let _0x4d642e=0x0;for(let _0x56dfd8=0x0;_0x56dfd8<_0x485e82[_0x3bb115(0x89)];_0x56dfd8+=0x1){const _0x4d85ea=_0x485e82[_0x56dfd8];if(_0x4d85ea==='(')_0x4d642e+=0x1;if(_0x4d85ea===')')_0x4d642e=Math['max'](0x0,_0x4d642e-0x1);if(_0x4d642e!==0x0)continue;const _0x6ce8ec=_0x485e82[_0x3bb115(0xb1)](_0x56dfd8,_0x56dfd8+_0x1c654e[_0x3bb115(0x89)]),_0x5016a8=_0x485e82[_0x56dfd8-0x1]??'\x20',_0x5ea524=_0x485e82[_0x56dfd8+_0x1c654e['length']]??'\x20';if(_0x6ce8ec[_0x3bb115(0xb7)]()===_0x1c654e['toUpperCase']()&&!/[\w$]/[_0x3bb115(0xc5)](_0x5016a8)&&!/[\w$]/['test'](_0x5ea524))return!![];}return![];}function a230_0x57b0(){const _0x30ba0b=['686322hJWklh','warning','indexOf','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','min','test','endsWith','push','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','some','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','where','12bCeAau','full','4EzCNlH','add','1489020xSpQVo','JOIN_INDEX_NOT_USABLE','columns','142550qgfqGI','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','460110pujbnt','replaceAll','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','length','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','has','max','replace','containsUnresolvedInclude','natural','covered','inner','36MsYPyl','(?:^|[^\x5cw$])','includes','search','\x5cs*\x5c.\x5cs*[\x5cw$]+','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','sort','INNER','using','unavailable','JOIN_PREDICATE_UNSUPPORTED','__sq__','from','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','exec','matchAll','filter','position','953620stzjFc','table','62630NJgZHl','JOIN_INDEX_MISSING','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','trim','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','\x5c$&','left','cross','match','startsWith','slice','228240iXdDFH','alias','unknown','unsupportedPredicate','sql','toUpperCase','indexes','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','split','right','metadataAvailable','matchedPrefix','index','map'];a230_0x57b0=function(){return _0x30ba0b;};return a230_0x57b0();}function splitEquality(_0x499d2a){const _0x530604=a230_0xdee6,_0x64bf90=stripOuterParentheses(_0x499d2a);let _0x628ada=0x0,_0x5ec9b3;for(let _0x5a0b13=0x0;_0x5a0b13<_0x64bf90['length'];_0x5a0b13+=0x1){const _0x2aec83=_0x64bf90[_0x5a0b13];if(_0x2aec83==='(')_0x628ada+=0x1;if(_0x2aec83===')')_0x628ada=Math[_0x530604(0x8d)](0x0,_0x628ada-0x1);const _0x45feb3=_0x64bf90[_0x5a0b13-0x1]??'',_0x13dc9a=_0x64bf90[_0x5a0b13+0x1]??'';if(_0x2aec83==='='&&_0x628ada===0x0&&!/[!<>=:]/[_0x530604(0xc5)](_0x45feb3)&&_0x13dc9a!=='='){if(_0x5ec9b3!==undefined)return null;_0x5ec9b3=_0x5a0b13;}}return _0x5ec9b3===undefined?null:[_0x64bf90[_0x530604(0xb1)](0x0,_0x5ec9b3)['trim'](),_0x64bf90[_0x530604(0xb1)](_0x5ec9b3+0x1)['trim']()];}function parseDirectColumnReference(_0xf65649,_0x38eecc){const _0xc926a=a230_0xdee6,_0x150068=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xc926a(0xa1)](stripOuterParentheses(_0xf65649));if(!_0x150068)return null;if(normalizeIdentifier(_0x150068[0x1]??'')!==normalizeIdentifier(_0x38eecc))return null;return normalizeIdentifier(_0x150068[0x2]??'');}function containsColumnReference(_0x55ad94,_0x4b4dc){const _0x135edf=a230_0xdee6,_0x1af779=_0x55ad94[_0x135edf(0x8e)](/[`"]/g,''),_0x5e4c18=_0x4b4dc[_0x135edf(0x8e)](/[.*+?^${}()|[\]\\]/g,_0x135edf(0xac));return new RegExp(_0x135edf(0x94)+_0x5e4c18+_0x135edf(0x97),'i')[_0x135edf(0xc5)](_0x1af779);}function findEqualityPrefix(_0x44d5f3,_0x8314b7){const _0x406425=a230_0xdee6,_0x32a25d=new Set(_0x8314b7[_0x406425(0xbf)](normalizeIdentifier)),_0x495ac0=[];for(const _0x4e00b0 of _0x44d5f3){if(!_0x32a25d[_0x406425(0x8c)](normalizeIdentifier(_0x4e00b0)))break;_0x495ac0[_0x406425(0xc7)](_0x4e00b0);}return _0x495ac0;}function resolveTableMetadata(_0x488c4e,_0x27848b){const _0x245f31=a230_0xdee6,_0x30a728=normalizeIdentifier(_0x27848b),_0x462612=_0x488c4e[_0x245f31(0xa3)](_0x32a9a9=>normalizeIdentifier(_0x32a9a9['tableName'])===_0x30a728);if(_0x462612[_0x245f31(0x89)]===0x1)return _0x462612[0x0];const _0x42a7ad=_0x30a728[_0x245f31(0x95)]('.'),_0xcd747d=_0x30a728[_0x245f31(0xba)]('.')['at'](-0x1),_0x34529b=_0x488c4e[_0x245f31(0xa3)](_0x377288=>{const _0x4c139c=_0x245f31,_0x318530=normalizeIdentifier(_0x377288['tableName']);if(_0x42a7ad&&_0x318530[_0x4c139c(0x95)]('.'))return![];return _0x318530[_0x4c139c(0xba)]('.')['at'](-0x1)===_0xcd747d;});return _0x34529b['length']===0x1?_0x34529b[0x0]:undefined;}function columnNamesMatch(_0x3c6fbe,_0x1f5a26){return normalizeIdentifier(_0x3c6fbe)===normalizeIdentifier(_0x1f5a26);}function normalizeIdentifier(_0x1582dd){const _0x4782eb=a230_0xdee6;return _0x1582dd[_0x4782eb(0x8e)](/[`"]/g,'')[_0x4782eb(0xaa)]()['toLowerCase']();}function isSqlClauseKeyword(_0x265553){const _0xe6fd77=a230_0xdee6;return new Set(['on',_0xe6fd77(0x9b),_0xe6fd77(0x7c),'join',_0xe6fd77(0x92),_0xe6fd77(0xad),'right','full',_0xe6fd77(0xae),_0xe6fd77(0x90)])[_0xe6fd77(0x8c)](_0x265553);}function stripOuterParentheses(_0x1afe78){const _0x22e23a=a230_0xdee6;let _0xf2d271=_0x1afe78[_0x22e23a(0xaa)]();while(_0xf2d271[_0x22e23a(0xb0)]('(')&&_0xf2d271[_0x22e23a(0xc6)](')')){let _0x413eaa=0x0,_0x599788=!![];for(let _0x3167fd=0x0;_0x3167fd<_0xf2d271['length'];_0x3167fd+=0x1){if(_0xf2d271[_0x3167fd]==='(')_0x413eaa+=0x1;if(_0xf2d271[_0x3167fd]===')')_0x413eaa-=0x1;if(_0x413eaa===0x0&&_0x3167fd<_0xf2d271['length']-0x1){_0x599788=![];break;}}if(!_0x599788||_0x413eaa!==0x0)break;_0xf2d271=_0xf2d271['slice'](0x1,-0x1)[_0x22e23a(0xaa)]();}return _0xf2d271;}
|
|
1
|
+
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
|
-
|
|
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
|
-
(function(
|
|
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
|
-
(function(
|
|
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
|
-
const a237_0x3faed6=a237_0x9d54;(function(_0x5e1797,_0x205018){const _0x5b046d=a237_0x9d54,_0x5f2aaf=_0x5e1797();while(!![]){try{const _0xe72b5d=parseInt(_0x5b046d(0xea))/0x1*(-parseInt(_0x5b046d(0x125))/0x2)+-parseInt(_0x5b046d(0x115))/0x3+parseInt(_0x5b046d(0xfc))/0x4+-parseInt(_0x5b046d(0xef))/0x5*(-parseInt(_0x5b046d(0x109))/0x6)+-parseInt(_0x5b046d(0x104))/0x7+-parseInt(_0x5b046d(0xf3))/0x8*(-parseInt(_0x5b046d(0xde))/0x9)+-parseInt(_0x5b046d(0xd0))/0xa;if(_0xe72b5d===_0x205018)break;else _0x5f2aaf['push'](_0x5f2aaf['shift']());}catch(_0x4e1832){_0x5f2aaf['push'](_0x5f2aaf['shift']());}}}(a237_0x45e8,0xd14b9));const MYBATIS_OUTER_TAGS=new Map([[a237_0x3faed6(0x10b),a237_0x3faed6(0x117)],['insert',a237_0x3faed6(0xd7)],['update',a237_0x3faed6(0x10e)],['delete','DELETE']]),MYBATIS_DYNAMIC_TAGS=new Set(['if',a237_0x3faed6(0xfa),'foreach','choose',a237_0x3faed6(0x11b),a237_0x3faed6(0x10d),'trim',a237_0x3faed6(0x120),a237_0x3faed6(0x11e),'include',a237_0x3faed6(0xd3)]),MYBATIS_BRANCH_TAGS=new Set(['if',a237_0x3faed6(0x10f),a237_0x3faed6(0xf6),a237_0x3faed6(0x11b),'otherwise']);export const MYBATIS_DYNAMIC_START_MARKER=a237_0x3faed6(0xe2);function a237_0x9d54(_0x2747fa,_0x10a335){_0x2747fa=_0x2747fa-0xd0;const _0x45e86a=a237_0x45e8();let _0x9d54c1=_0x45e86a[_0x2747fa];return _0x9d54c1;}export const MYBATIS_DYNAMIC_END_MARKER='__RABETBASE_MYBATIS_DYNAMIC_END__';function a237_0x45e8(){const _0x30f45b=['exec','join','DELETE','XML\x20declarations\x20must\x20precede\x20the\x20MyBatis\x20statement\x20wrapper.','1248564LkzdWY','WITH','SELECT','Unterminated\x20CDATA\x20section.','&','Unterminated\x20XML\x20declaration.','when','error','from','bind','^<\x5cs*(?:','set','replace','type','UNKNOWN','pop','8DKrVFo','mybatisXml','\x20query\x20targeting\x20','SQL\x20content\x20is\x20empty','outer','SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements','trim','indexOf','match','test','add','4896760jSDDTj','get','Invalid\x20attributes\x20on\x20MyBatis\x20XML\x20tag:\x20<','property','tagName','<![CDATA[','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','INSERT','matchAll','push','reason','CDATA\x20sections\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.','<!--',''','225XtLnmd','MyBatis\x20dynamic\x20tag\x20names\x20must\x20be\x20lowercase:\x20<','Unable\x20to\x20detect\x20SQL\x20type.\x20','startsWith','__RABETBASE_MYBATIS_DYNAMIC_START__','\x20SET\x20','>','isDangerous','slice','has','rawName','replaceAll','336481SPRPNk','Unterminated\x20XML\x20comment.','<','include','length','635WMDxke','DDL','__RABETBASE_MYBATIS_INCLUDE_UNRESOLVED__','-->','319528XhxskX','\x20WHERE\x20','"','choose','toUpperCase','sql','MyBatis\x20<property>\x20must\x20be\x20a\x20self-closing\x20direct\x20child\x20of\x20<include>.','where','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','2125180qzRucs','\x20with\x20parameters:\x20','statementType','parseInt','Unsupported\x20MyBatis\x20XML\x20tag:\x20<','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','Unterminated\x20MyBatis\x20XML\x20tag.','MyBatis\x20dynamic\x20tag\x20must\x20be\x20inside\x20the\x20statement\x20wrapper:\x20<','31143cNXIMH','__RABETBASE_UNRESOLVED_SQL_FRAGMENT__','split','keys','includes','74820SnNuUP','Invalid\x20MyBatis\x20XML\x20tag.','select','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','otherwise','UPDATE','foreach',']]>'];a237_0x45e8=function(){return _0x30f45b;};return a237_0x45e8();}export const MYBATIS_INCLUDE_MARKER=a237_0x3faed6(0xf1);const UNRESOLVED_SQL_FRAGMENT=a237_0x3faed6(0x105),MYBATIS_OUTER_TAG_PATTERN=new RegExp(a237_0x3faed6(0x11f)+[...MYBATIS_OUTER_TAGS[a237_0x3faed6(0x107)]()][a237_0x3faed6(0x112)]('|')+')\x5cb','i');export function normalizeSqlForStaticAnalysis(_0x5f325d){const _0x2caa2a=a237_0x3faed6,_0x5b56ab=typeof _0x5f325d==='string'?_0x5f325d:'';if(!startsWithMybatisStatementWrapper(_0x5b56ab))return{'sql':_0x5b56ab,'mode':_0x2caa2a(0xf8)};let _0xdaafd7=0x0,_0x573d25='',_0x3278de,_0x5b6490=![],_0x2eb5ce=![];const _0x4a22a9=[];while(_0xdaafd7<_0x5b56ab[_0x2caa2a(0xee)]){if(_0x5b56ab[_0x2caa2a(0xe1)](_0x2caa2a(0xdc),_0xdaafd7)){const _0x39ae69=_0x5b56ab[_0x2caa2a(0x12c)]('-->',_0xdaafd7+0x4);if(_0x39ae69<0x0)return invalidMybatisSource(_0x2caa2a(0xeb));_0x573d25+='\x20',_0xdaafd7=_0x39ae69+0x3;continue;}if(_0x5b56ab[_0x2caa2a(0xe1)](_0x2caa2a(0xd5),_0xdaafd7)){if(!_0x5b6490||_0x2eb5ce)return invalidMybatisSource(_0x2caa2a(0xdb));const _0x4719a8=_0x5b56ab['indexOf'](_0x2caa2a(0x110),_0xdaafd7+0x9);if(_0x4719a8<0x0)return invalidMybatisSource(_0x2caa2a(0x118));_0x573d25+=_0x5b56ab[_0x2caa2a(0xe6)](_0xdaafd7+0x9,_0x4719a8),_0xdaafd7=_0x4719a8+0x3;continue;}if(_0x5b56ab['startsWith']('<?',_0xdaafd7)){if(_0x5b6490)return invalidMybatisSource(_0x2caa2a(0x114));const _0x1b6df9=_0x5b56ab[_0x2caa2a(0x12c)]('?>',_0xdaafd7+0x2);if(_0x1b6df9<0x0)return invalidMybatisSource(_0x2caa2a(0x11a));_0x573d25+='\x20',_0xdaafd7=_0x1b6df9+0x2;continue;}if(_0x5b56ab[_0xdaafd7]!=='<'){const _0x30d0c7=_0x5b56ab[_0x2caa2a(0x12c)]('<',_0xdaafd7),_0x3fa8e3=_0x30d0c7<0x0?_0x5b56ab['length']:_0x30d0c7,_0x75d35a=_0x5b56ab['slice'](_0xdaafd7,_0x3fa8e3);if((!_0x5b6490||_0x2eb5ce)&&_0x75d35a[_0x2caa2a(0x12b)]())return invalidMybatisSource('SQL\x20text\x20must\x20be\x20inside\x20the\x20MyBatis\x20statement\x20wrapper.');if(_0x5b6490&&!_0x2eb5ce){const _0x5355af=decodeXmlEntities(_0x75d35a);if(_0x5355af===null)return invalidMybatisSource('Invalid\x20XML\x20entity\x20reference.');_0x573d25+=_0x5355af;}else _0x573d25+='\x20';_0xdaafd7=_0x3fa8e3;continue;}const _0x2df4a1=findXmlTagEnd(_0x5b56ab,_0xdaafd7);if(_0x2df4a1<0x0)return invalidMybatisSource(_0x2caa2a(0x102));const _0x3f170a=_0x5b56ab[_0x2caa2a(0xe6)](_0xdaafd7,_0x2df4a1+0x1),_0x131ead=/^<\s*(\/?)\s*([A-Za-z][\w:-]*)([\s\S]*?)(\/?)\s*>$/[_0x2caa2a(0x111)](_0x3f170a);if(!_0x131ead)return invalidMybatisSource(_0x2caa2a(0x10a));const _0x509ea2=_0x131ead[0x1]==='/',_0x469480=_0x131ead[0x2]??'',_0xc25916=_0x469480['toLowerCase'](),_0x44ee40=_0x131ead[0x3]??'',_0x431c97=_0x131ead[0x4]==='/',_0x4ae4ef=MYBATIS_OUTER_TAGS[_0x2caa2a(0xd1)](_0xc25916);if(!_0x4ae4ef&&!MYBATIS_DYNAMIC_TAGS[_0x2caa2a(0xe7)](_0xc25916))return invalidMybatisSource(_0x2caa2a(0x100)+_0xc25916+'>.');if(!_0x4ae4ef&&_0x469480!==_0xc25916)return invalidMybatisSource(_0x2caa2a(0xdf)+_0x469480+'>.');if(_0x509ea2){if(_0x44ee40[_0x2caa2a(0x12b)]()||_0x431c97)return invalidMybatisSource('Invalid\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x469480+'>.');const _0x3bd58a=_0x4a22a9['at'](-0x1);if(!_0x3bd58a||(_0x3bd58a[_0x2caa2a(0x129)]?_0x3bd58a[_0x2caa2a(0xd4)]!==_0xc25916:_0x3bd58a[_0x2caa2a(0xe8)]!==_0x469480))return invalidMybatisSource('Mismatched\x20MyBatis\x20XML\x20closing\x20tag:\x20</'+_0x469480+'>.');_0x4a22a9[_0x2caa2a(0x124)]();if(_0x3bd58a[_0x2caa2a(0x129)])_0x2eb5ce=!![];_0x573d25+=MYBATIS_BRANCH_TAGS['has'](_0xc25916)?'\x20'+MYBATIS_DYNAMIC_END_MARKER+'\x20':'\x20';}else{if(!hasWellFormedXmlAttributes(_0x44ee40))return invalidMybatisSource(_0x2caa2a(0xd2)+_0x469480+'>.');if(_0xc25916===_0x2caa2a(0xd3)&&(!_0x431c97||_0x4a22a9['at'](-0x1)?.[_0x2caa2a(0xd4)]!=='include'))return invalidMybatisSource(_0x2caa2a(0xf9));if(_0x4ae4ef){if(_0x5b6490||_0x4a22a9[_0x2caa2a(0xee)]>0x0)return invalidMybatisSource('Multiple\x20MyBatis\x20statement\x20wrappers\x20are\x20not\x20supported.');_0x5b6490=!![],_0x2eb5ce=_0x431c97,_0x3278de=_0x4ae4ef;}else{if(!_0x5b6490||_0x2eb5ce)return invalidMybatisSource(_0x2caa2a(0x103)+_0x469480+'>.');}_0x573d25+=_0xc25916===_0x2caa2a(0xfa)?_0x2caa2a(0xf4):_0xc25916===_0x2caa2a(0x120)?_0x2caa2a(0xe3):_0xc25916===_0x2caa2a(0xed)?'\x20'+MYBATIS_INCLUDE_MARKER+'\x20':MYBATIS_BRANCH_TAGS['has'](_0xc25916)&&!_0x431c97?'\x20'+MYBATIS_DYNAMIC_START_MARKER+'\x20':'\x20',!_0x431c97&&_0x4a22a9[_0x2caa2a(0xd9)]({'rawName':_0x469480,'tagName':_0xc25916,'outer':!!_0x4ae4ef});}_0xdaafd7=_0x2df4a1+0x1;}if(_0x4a22a9[_0x2caa2a(0xee)]>0x0)return invalidMybatisSource('Unclosed\x20MyBatis\x20XML\x20tag:\x20<'+_0x4a22a9['at'](-0x1)?.[_0x2caa2a(0xe8)]+'>.');if(!_0x5b6490||!_0x2eb5ce)return invalidMybatisSource('MyBatis\x20XML\x20must\x20contain\x20exactly\x20one\x20complete\x20statement\x20wrapper.');return{'sql':_0x573d25[_0x2caa2a(0x12b)](),'mode':_0x2caa2a(0x126),..._0x3278de?{'statementType':_0x3278de}:{}};}function hasWellFormedXmlAttributes(_0xf8b3e1){const _0xf47652=a237_0x3faed6;let _0x401fb3=0x0;const _0x1b6fed=new Set();while(_0x401fb3<_0xf8b3e1[_0xf47652(0xee)]){while(_0x401fb3<_0xf8b3e1[_0xf47652(0xee)]&&/\s/[_0xf47652(0x12e)](_0xf8b3e1[_0x401fb3]??''))_0x401fb3+=0x1;if(_0x401fb3>=_0xf8b3e1[_0xf47652(0xee)])return!![];const _0x56afaa=/^[A-Za-z_:][\w:.-]*/[_0xf47652(0x111)](_0xf8b3e1[_0xf47652(0xe6)](_0x401fb3)),_0x28d774=_0x56afaa?.[0x0];if(!_0x28d774||_0x1b6fed[_0xf47652(0xe7)](_0x28d774))return![];_0x1b6fed[_0xf47652(0x12f)](_0x28d774),_0x401fb3+=_0x28d774[_0xf47652(0xee)];while(_0x401fb3<_0xf8b3e1[_0xf47652(0xee)]&&/\s/[_0xf47652(0x12e)](_0xf8b3e1[_0x401fb3]??''))_0x401fb3+=0x1;if(_0xf8b3e1[_0x401fb3]!=='=')return![];_0x401fb3+=0x1;while(_0x401fb3<_0xf8b3e1['length']&&/\s/['test'](_0xf8b3e1[_0x401fb3]??''))_0x401fb3+=0x1;const _0x11c2c=_0xf8b3e1[_0x401fb3];if(_0x11c2c!=='\x22'&&_0x11c2c!=='\x27')return![];_0x401fb3+=0x1;const _0x17d3c9=_0xf8b3e1[_0xf47652(0x12c)](_0x11c2c,_0x401fb3);if(_0x17d3c9<0x0)return![];if(decodeXmlEntities(_0xf8b3e1['slice'](_0x401fb3,_0x17d3c9))===null)return![];_0x401fb3=_0x17d3c9+0x1;}return!![];}function startsWithMybatisStatementWrapper(_0xa4148b){const _0x26c66f=a237_0x3faed6;let _0x599f5c=0x0;const _0x17dfa2=()=>{const _0xa08af=a237_0x9d54;while(_0x599f5c<_0xa4148b['length']&&/\s/[_0xa08af(0x12e)](_0xa4148b[_0x599f5c]??''))_0x599f5c+=0x1;};_0x17dfa2();while(_0x599f5c<_0xa4148b['length']){if(_0xa4148b['startsWith'](_0x26c66f(0xdc),_0x599f5c)){const _0x518673=_0xa4148b[_0x26c66f(0x12c)](_0x26c66f(0xf2),_0x599f5c+0x4);if(_0x518673<0x0)return!![];_0x599f5c=_0x518673+0x3,_0x17dfa2();continue;}if(_0xa4148b[_0x26c66f(0xe1)]('<?',_0x599f5c)){const _0xd88480=_0xa4148b[_0x26c66f(0x12c)]('?>',_0x599f5c+0x2);if(_0xd88480<0x0)return!![];_0x599f5c=_0xd88480+0x2,_0x17dfa2();continue;}break;}return MYBATIS_OUTER_TAG_PATTERN[_0x26c66f(0x12e)](_0xa4148b[_0x26c66f(0xe6)](_0x599f5c));}function invalidMybatisSource(_0xad1339){return{'sql':'','mode':'mybatisXml','error':_0xad1339};}function findXmlTagEnd(_0x2603f6,_0x33abb8){const _0x1aeab8=a237_0x3faed6;let _0x359830;for(let _0x52a4c6=_0x33abb8+0x1;_0x52a4c6<_0x2603f6[_0x1aeab8(0xee)];_0x52a4c6+=0x1){const _0x52ff60=_0x2603f6[_0x52a4c6];if(_0x359830){if(_0x52ff60===_0x359830)_0x359830=undefined;continue;}if(_0x52ff60==='\x22'||_0x52ff60==='\x27'){_0x359830=_0x52ff60;continue;}if(_0x52ff60==='>')return _0x52a4c6;}return-0x1;}function decodeXmlEntities(_0x2782a9){const _0x35ca74=a237_0x3faed6;let _0x2ccf4b=![];const _0x2b4fa7=_0x2782a9[_0x35ca74(0x121)](/&(?:#x[0-9a-f]+;|#[0-9]+;|[A-Za-z_:][\w:.-]*;)?/g,_0x5ee4b5=>{const _0x31b739=_0x35ca74;if(_0x5ee4b5===_0x31b739(0xec))return'<';if(_0x5ee4b5===_0x31b739(0xe4))return'>';if(_0x5ee4b5===_0x31b739(0xf5))return'\x22';if(_0x5ee4b5===_0x31b739(0xdd))return'\x27';if(_0x5ee4b5===_0x31b739(0x119))return'&';const _0xfc8b80=/^&#(?:x([0-9a-f]+)|([0-9]+));$/[_0x31b739(0x111)](_0x5ee4b5);if(_0xfc8b80){const _0x24be0e=_0xfc8b80[0x1],_0x3ce003=_0xfc8b80[0x2],_0x553e21=Number[_0x31b739(0xff)](_0x24be0e??_0x3ce003??'',_0x24be0e?0x10:0xa);if(isValidXmlCharacter(_0x553e21))return String['fromCodePoint'](_0x553e21);}return _0x2ccf4b=!![],'';});return _0x2ccf4b?null:_0x2b4fa7;}function isValidXmlCharacter(_0xc650dd){return _0xc650dd===0x9||_0xc650dd===0xa||_0xc650dd===0xd||_0xc650dd>=0x20&&_0xc650dd<=0xd7ff||_0xc650dd>=0xe000&&_0xc650dd<=0xfffd||_0xc650dd>=0x10000&&_0xc650dd<=0x10ffff;}export function detectSqlType(_0x239465){return detectNormalizedSqlType(normalizeSqlForStaticAnalysis(_0x239465));}function detectNormalizedSqlType(_0x46d5a8){const _0x198e1c=a237_0x3faed6;if(_0x46d5a8[_0x198e1c(0x11c)])return{'type':_0x198e1c(0x123),'isSelectOnly':![],'isDangerous':![],'reason':_0x46d5a8['error']};if(!_0x46d5a8['sql']['trim']())return{'type':_0x198e1c(0x123),'isSelectOnly':![],'isDangerous':![],'reason':_0x198e1c(0x128)};const _0x6edf48=stripStaticAnalysisMarkers(_0x46d5a8[_0x198e1c(0xf8)])['replace'](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x198e1c(0x121)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x198e1c(0x121)](/\/\*[\s\S]*?\*\//g,'')[_0x198e1c(0x12b)](),_0x1770ce=_0x6edf48[_0x198e1c(0x106)]('\x0a');let _0x11187e='';for(const _0x5eeb63 of _0x1770ce){const _0x5d0be7=_0x5eeb63[_0x198e1c(0x12b)]();if(!_0x5d0be7||_0x5d0be7[_0x198e1c(0xe1)]('--')||_0x5d0be7[_0x198e1c(0xe1)]('/*'))continue;_0x11187e=_0x5d0be7;break;}const _0x544bcc=_0x11187e[_0x198e1c(0xf7)](),_0x5f43e6=_0x46d5a8[_0x198e1c(0xfe)],_0x986262=maskSqlTextForBlockedKeywordScan(_0x6edf48),_0x392b18=/\b(DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x198e1c(0x12e)](_0x986262);if(_0x5f43e6==='SELECT'||!_0x5f43e6&&(_0x544bcc[_0x198e1c(0xe1)]('SELECT')||_0x544bcc[_0x198e1c(0xe1)](_0x198e1c(0x116)))){const _0x14235b=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x198e1c(0x12e)](_0x6edf48);return{'type':'SELECT','isSelectOnly':!_0x14235b,'isDangerous':_0x14235b,'reason':_0x14235b?_0x198e1c(0xfb):undefined};}if(_0x5f43e6===_0x198e1c(0xd7)||!_0x5f43e6&&_0x544bcc['startsWith']('INSERT'))return{'type':_0x198e1c(0xd7),'isSelectOnly':![],'isDangerous':_0x392b18,'reason':_0x392b18?'SQL\x20contains\x20blocked\x20DELETE\x20or\x20DDL\x20statements':undefined};if(_0x5f43e6==='UPDATE'||!_0x5f43e6&&_0x544bcc['startsWith'](_0x198e1c(0x10e)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':_0x392b18,'reason':_0x392b18?_0x198e1c(0x12a):undefined};if(_0x5f43e6===_0x198e1c(0x113)||!_0x5f43e6&&_0x544bcc[_0x198e1c(0xe1)]('DELETE'))return{'type':_0x198e1c(0x113),'isSelectOnly':![],'isDangerous':!![],'reason':_0x198e1c(0xd6)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x198e1c(0x12e)](_0x544bcc))return{'type':_0x198e1c(0xf0),'isSelectOnly':![],'isDangerous':!![],'reason':_0x198e1c(0x101)};return{'type':_0x198e1c(0x123),'isSelectOnly':![],'isDangerous':![]};}function stripStaticAnalysisMarkers(_0x3602f4){const _0xf81707=a237_0x3faed6;return _0x3602f4[_0xf81707(0xe9)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0xf81707(0xe9)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0xf81707(0xe9)](MYBATIS_INCLUDE_MARKER,'\x20'+UNRESOLVED_SQL_FRAGMENT+'\x20');}function maskSqlTextForBlockedKeywordScan(_0x5646b7){const _0x2a09f0=a237_0x3faed6;return _0x5646b7[_0x2a09f0(0x121)](/'(?:''|\\.|[^'])*'/g,'\x20')['replace'](/"(?:""|\\.|[^"])*"/g,'\x20')[_0x2a09f0(0x121)](/`(?:``|\\.|[^`])*`/g,'\x20')[_0x2a09f0(0x121)](/--.*$/gm,'\x20')[_0x2a09f0(0x121)](/#.*$/gm,'\x20')[_0x2a09f0(0x121)](/\/\*[\s\S]*?\*\//g,'\x20');}function extractTables(_0x458c45){const _0x5a371a=a237_0x3faed6,_0x22159c=_0x458c45['replace'](/#\{[^}]*\}/g,'?')[_0x5a371a(0x121)](/\$\{[^}]*\}/g,'?')[_0x5a371a(0x121)](/'[^']*'/g,'\x27\x27')[_0x5a371a(0x121)](/--.*$/gm,'')[_0x5a371a(0x121)](/\/\*[\s\S]*?\*\//g,''),_0x56e419=[],_0x558faf=_0x22159c[_0x5a371a(0x12d)](/FROM\s+([^\s,)(]+)/i);addTable(_0x56e419,_0x558faf?.[0x1]);for(const _0xd75507 of _0x22159c['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){addTable(_0x56e419,_0xd75507[0x1]);}const _0x9f7e9=_0x22159c[_0x5a371a(0x12d)](/INTO\s+([^\s(]+)/i);addTable(_0x56e419,_0x9f7e9?.[0x1]);const _0x8a7c3a=_0x22159c['match'](/UPDATE\s+([^\s,)(]+)/i);return addTable(_0x56e419,_0x8a7c3a?.[0x1]),_0x56e419;}function addTable(_0x4b3bea,_0x460dca){const _0x5a692a=a237_0x3faed6,_0x76c710=_0x460dca?.['replace'](/[`"]/g,'');_0x76c710&&_0x76c710!==UNRESOLVED_SQL_FRAGMENT&&!_0x4b3bea[_0x5a692a(0x108)](_0x76c710)&&_0x4b3bea[_0x5a692a(0xd9)](_0x76c710);}function extractParameters(_0x47b408){const _0x3b631b=a237_0x3faed6,_0x4c3e4d=new Set();for(const _0x2dc6af of _0x47b408[_0x3b631b(0xd8)](/[#$]\{\s*([A-Za-z_][\w.]*)\s*(?=[,}])/g)){if(_0x2dc6af[0x1])_0x4c3e4d[_0x3b631b(0x12f)](_0x2dc6af[0x1]);}return Array[_0x3b631b(0x11d)](_0x4c3e4d);}export function validateSql(_0x47a5da){const _0x3c6788=a237_0x3faed6,_0x518b61=normalizeSqlForStaticAnalysis(_0x47a5da),_0x1b301c=detectNormalizedSqlType(_0x518b61),_0x3fd582=stripStaticAnalysisMarkers(_0x518b61[_0x3c6788(0xf8)]),_0x470a8e=_0x518b61['error']?[]:extractTables(_0x3fd582),_0x1be424=_0x518b61[_0x3c6788(0x11c)]?[]:extractParameters(_0x3fd582);if(_0x1b301c[_0x3c6788(0xe5)])return{'valid':![],'sqlType':_0x1b301c,'tables':_0x470a8e,'parameters':_0x1be424,'message':_0x1b301c[_0x3c6788(0xda)]||_0x1b301c[_0x3c6788(0x122)]+_0x3c6788(0x10c)};if(_0x1b301c[_0x3c6788(0x122)]===_0x3c6788(0x123))return{'valid':![],'sqlType':_0x1b301c,'tables':_0x470a8e,'parameters':_0x1be424,'message':_0x518b61['error']?_0x3c6788(0xe0)+_0x518b61['error']:'Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'};return{'valid':!![],'sqlType':_0x1b301c,'tables':_0x470a8e,'parameters':_0x1be424,'message':_0x1b301c[_0x3c6788(0x122)]+_0x3c6788(0x127)+(_0x470a8e[_0x3c6788(0xee)]?_0x470a8e[_0x3c6788(0x112)](',\x20'):'unknown\x20table(s)')+(_0x1be424[_0x3c6788(0xee)]?_0x3c6788(0xfd)+_0x1be424[_0x3c6788(0x112)](',\x20'):'')};}
|
|
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
|
-
|
|
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
|
-
const
|
|
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
|
-
|
|
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
|
-
const
|
|
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';
|