@lovrabet/rabetbase-cli 2.5.2-beta.7 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x21924e,_0x1c793a){const _0x3c6f70=a252_0x25ae,_0x4f996b=_0x21924e();while(!![]){try{const _0x9ebfd4=parseInt(_0x3c6f70(0xa2))/0x1+-parseInt(_0x3c6f70(0xb4))/0x2*(-parseInt(_0x3c6f70(0xa6))/0x3)+-parseInt(_0x3c6f70(0xb9))/0x4+parseInt(_0x3c6f70(0xa0))/0x5+-parseInt(_0x3c6f70(0xa3))/0x6+parseInt(_0x3c6f70(0xba))/0x7+-parseInt(_0x3c6f70(0xad))/0x8;if(_0x9ebfd4===_0x1c793a)break;else _0x4f996b['push'](_0x4f996b['shift']());}catch(_0x4dd7d8){_0x4f996b['push'](_0x4f996b['shift']());}}}(a252_0x5c0a,0x2e80b));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x19b5bb){const _0x5e99b3=a252_0x25ae;if(cache[_0x5e99b3(0x9e)](_0x19b5bb))return cache[_0x5e99b3(0xab)](_0x19b5bb);const _0x1b3392=await listDatasets(_0x19b5bb),_0xcce4b5=new Map();for(const _0x18a5f8 of _0x1b3392){const _0x3017a4=_0x18a5f8[_0x5e99b3(0xb5)];_0x3017a4?.[_0x5e99b3(0xa8)]!=null&&_0xcce4b5[_0x5e99b3(0xaa)](_0x3017a4[_0x5e99b3(0xa8)],_0x3017a4[_0x5e99b3(0xb7)]??'db-'+_0x3017a4[_0x5e99b3(0xa8)]);}const _0xa7c4ab=[..._0xcce4b5[_0x5e99b3(0xb1)]()]['map'](([_0x1244b4,_0x4cdc18])=>({'dbId':_0x1244b4,'dbName':_0x4cdc18}));return cache[_0x5e99b3(0xaa)](_0x19b5bb,_0xa7c4ab),_0xa7c4ab;}function a252_0x25ae(_0x157f87,_0x56fdbf){_0x157f87=_0x157f87-0x9e;const _0x5c0af1=a252_0x5c0a();let _0x25aef1=_0x5c0af1[_0x157f87];return _0x25aef1;}export async function resolveDb(_0x35b4ed,_0xf91bf1){const _0x31fe1d=a252_0x25ae,_0x596693=await listDatabases(_0x35b4ed);if(_0x596693[_0x31fe1d(0xa4)]===0x0)return{'resolved':[],'error':_0x31fe1d(0xb3)+_0x35b4ed+_0x31fe1d(0xa9)};if(!_0xf91bf1)return{'resolved':_0x596693};const _0x231d15=Number(_0xf91bf1);if(!Number[_0x31fe1d(0xaf)](_0x231d15)){const _0x28f2bb=_0x596693['find'](_0x281d6a=>_0x281d6a[_0x31fe1d(0xa8)]===_0x231d15);if(_0x28f2bb)return{'resolved':[_0x28f2bb]};}const _0x1ba19c=_0xf91bf1[_0x31fe1d(0xb0)](),_0x54ffda=_0x596693['filter'](_0x3e1c2a=>_0x3e1c2a['dbName'][_0x31fe1d(0xb0)]()['includes'](_0x1ba19c));if(_0x54ffda[_0x31fe1d(0xa4)]>0x0)return{'resolved':_0x54ffda};const _0x2011f0=_0x596693[_0x31fe1d(0xac)](_0x1e170e=>_0x1e170e[_0x31fe1d(0xb7)]+'\x20('+_0x1e170e[_0x31fe1d(0xa8)]+')')[_0x31fe1d(0x9f)](',\x20');return{'resolved':[],'error':_0x31fe1d(0xb2)+_0xf91bf1+_0x31fe1d(0xb8)+_0x35b4ed+_0x31fe1d(0xb6)+_0x2011f0+_0x31fe1d(0xa5)};}export async function resolveOneDb(_0x13161f,_0x2c0df0){const _0xd0161f=a252_0x25ae,{resolved:_0xa7d0ee,error:_0x49db51}=await resolveDb(_0x13161f,_0x2c0df0);if(_0x49db51)return{'db':null,'error':_0x49db51};if(_0xa7d0ee['length']===0x1)return{'db':_0xa7d0ee[0x0]};if(!_0x2c0df0){const _0xf100c3=_0xa7d0ee[_0xd0161f(0xac)](_0x17d04d=>_0x17d04d[_0xd0161f(0xb7)]+'\x20('+_0x17d04d[_0xd0161f(0xa8)]+')')['join'](',\x20');return{'db':null,'error':_0xd0161f(0xa1)+_0xf100c3};}const _0xa5b385=_0xa7d0ee[_0xd0161f(0xac)](_0x37bd23=>_0x37bd23[_0xd0161f(0xb7)]+'\x20('+_0x37bd23[_0xd0161f(0xa8)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x2c0df0+_0xd0161f(0xae)+_0xa5b385+'.\x20Be\x20more\x20specific.'};}function a252_0x5c0a(){const _0x2e6ac0=['Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','81501XQhRZP','655416FsPpdq','length','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','23463ufmTYN','find','dbId','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','set','get','map','3519064TmUmyH','\x22\x20matches\x20multiple\x20databases:\x20','isNaN','toLowerCase','entries','No\x20database\x20matching\x20\x22','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','58zNtRYe','dbtableConfig','\x22.\x20Available:\x20','dbName','\x22\x20under\x20app\x20\x22','710788qgviVx','2409190hfHtkA','has','join','1324055DKoxTG'];a252_0x5c0a=function(){return _0x2e6ac0;};return a252_0x5c0a();}export async function getDbName(_0x3651ae,_0x2d10ac){const _0x369d4c=a252_0x25ae,_0xe2c362=await listDatabases(_0x3651ae);return _0xe2c362[_0x369d4c(0xa7)](_0x3b32c4=>_0x3b32c4[_0x369d4c(0xa8)]===_0x2d10ac)?.[_0x369d4c(0xb7)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a253_0x5d8649=a253_0x4dc7;(function(_0xac65d1,_0x34bce3){const _0x2a2ac9=a253_0x4dc7,_0xc16f7e=_0xac65d1();while(!![]){try{const _0x391d67=parseInt(_0x2a2ac9(0x13e))/0x1*(-parseInt(_0x2a2ac9(0x137))/0x2)+parseInt(_0x2a2ac9(0x11b))/0x3*(parseInt(_0x2a2ac9(0x130))/0x4)+-parseInt(_0x2a2ac9(0x11e))/0x5+-parseInt(_0x2a2ac9(0x139))/0x6+parseInt(_0x2a2ac9(0x14d))/0x7*(-parseInt(_0x2a2ac9(0x13a))/0x8)+parseInt(_0x2a2ac9(0x138))/0x9*(parseInt(_0x2a2ac9(0x133))/0xa)+parseInt(_0x2a2ac9(0x12e))/0xb*(parseInt(_0x2a2ac9(0x123))/0xc);if(_0x391d67===_0x34bce3)break;else _0xc16f7e['push'](_0xc16f7e['shift']());}catch(_0x20cf9e){_0xc16f7e['push'](_0xc16f7e['shift']());}}}(a253_0x17ab,0x3870b));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';function a253_0x4dc7(_0x4a5a39,_0x39a26d){_0x4a5a39=_0x4a5a39-0x117;const _0x17aba6=a253_0x17ab();let _0x4dc795=_0x17aba6[_0x4a5a39];return _0x4dc795;}import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a253_0x5d8649(0x153);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x3dbd02,_0x4be922,_0x3500bc){return new CliError(_0x3dbd02,0x1,_0x4be922,_0x3500bc);}export function loadInstantApiPolicyLocalConfig(_0x1ce84d,_0x31e2e8){assertSafeAppCode(_0x1ce84d);const _0x3baf8a=resolve(_0x31e2e8??findProjectRootDirectory()),_0x43b301=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x1ce84d+'/'+INSTANT_API_POLICY_FILE_NAME,_0x56e430=resolve(_0x3baf8a,INSTANT_API_POLICY_RELATIVE_ROOT,_0x1ce84d),_0x1d6c2d=resolve(_0x56e430,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x3baf8a,'appCode':_0x1ce84d,'policyRoot':_0x56e430,'policyFilePath':_0x1d6c2d,'policyRelativePath':_0x43b301};}export function createDefaultInstantApiPolicyConfig(_0x499f49,_0x1ce112=a253_0x5d8649(0x11a)){return assertSafeAppCode(_0x499f49),{'version':'1','appCode':_0x499f49,'defaults':{'instantApi':_0x1ce112},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x438dd7){const _0x1aac65=a253_0x5d8649;let _0x905cc5;try{_0x905cc5=await stat(_0x438dd7[_0x1aac65(0x140)]);}catch(_0xe335b3){throw instantApiPolicyError(_0x1aac65(0x11c),_0x1aac65(0x14a)+_0x438dd7[_0x1aac65(0x140)],_0x1aac65(0x12d));}if(!_0x905cc5[_0x1aac65(0x136)]())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x1aac65(0x128)+_0x438dd7[_0x1aac65(0x140)]);if(_0x905cc5[_0x1aac65(0x117)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1aac65(0x132),_0x1aac65(0x121));let _0xfa3123;try{_0xfa3123=await readFile(_0x438dd7[_0x1aac65(0x140)]);}catch{throw instantApiPolicyError(_0x1aac65(0x146),'Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x438dd7['policyFilePath']);}if(_0xfa3123[_0x1aac65(0x122)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1aac65(0x132),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x4c514a;try{_0x4c514a=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x1aac65(0x150)](_0xfa3123);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x1aac65(0x12b)+_0x438dd7[_0x1aac65(0x140)]);}let _0x16de38;try{_0x16de38=JSON[_0x1aac65(0x12c)](_0x4c514a);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x438dd7[_0x1aac65(0x140)]);}return assertLocalPolicyContract(_0x16de38,_0x438dd7[_0x1aac65(0x120)]);}export async function writeInstantApiPolicyConfigFile(_0x1b0070,_0xf639e8,_0x1350c0={}){const _0x53ce02=a253_0x5d8649,_0x180dbe=assertLocalPolicyContract(_0xf639e8,_0x1b0070['appCode']),_0x278126=JSON['stringify'](_0x180dbe,null,0x2)+'\x0a';if(Buffer['byteLength'](_0x278126,_0x53ce02(0x154))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x53ce02(0x132),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x1b0070['policyRoot'],{'recursive':!![]});let _0x5ab5bc;try{_0x5ab5bc=await readFile(_0x1b0070[_0x53ce02(0x140)],_0x53ce02(0x154));}catch(_0x1fce60){if(!isMissingFile(_0x1fce60))throw instantApiPolicyError(_0x53ce02(0x146),'Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0x1b0070[_0x53ce02(0x140)]);}if(_0x5ab5bc===_0x278126)return{'action':'unchanged','filePath':_0x1b0070[_0x53ce02(0x140)]};if(_0x5ab5bc!==undefined&&!_0x1350c0[_0x53ce02(0x12a)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x53ce02(0x11f)+_0x1b0070[_0x53ce02(0x140)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x5ab5bc===undefined)try{return await writeFile(_0x1b0070[_0x53ce02(0x140)],_0x278126,{'encoding':_0x53ce02(0x154),'flag':'wx'}),{'action':_0x53ce02(0x14c),'filePath':_0x1b0070[_0x53ce02(0x140)]};}catch(_0xc5f1d3){if(!isAlreadyExists(_0xc5f1d3))throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x53ce02(0x13b)+_0x1b0070[_0x53ce02(0x140)]);if(!_0x1350c0[_0x53ce02(0x12a)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x53ce02(0x131)+_0x1b0070['policyFilePath'],_0x53ce02(0x129));}const _0x3f41d=resolve(dirname(_0x1b0070[_0x53ce02(0x140)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process['pid']+'.'+randomUUID()+_0x53ce02(0x134));try{await writeFile(_0x3f41d,_0x278126,{'encoding':'utf8','flag':'wx'}),await rename(_0x3f41d,_0x1b0070['policyFilePath']);}catch{await unlink(_0x3f41d)[_0x53ce02(0x135)](()=>undefined);throw instantApiPolicyError(_0x53ce02(0x149),_0x53ce02(0x151)+_0x1b0070['policyFilePath']);}return{'action':'overwritten','filePath':_0x1b0070['policyFilePath']};}function assertSafeAppCode(_0x40e103){const _0x14a54d=a253_0x5d8649,_0x108f53=_0x40e103['trim']();if(!_0x108f53||_0x108f53!==_0x40e103||_0x108f53[_0x14a54d(0x11d)]>0x64||_0x108f53==='.'||_0x108f53==='..'||_0x108f53[_0x14a54d(0x127)]('/')||_0x108f53[_0x14a54d(0x127)]('\x5c')||_0x108f53['includes']('\x00'))throw instantApiPolicyError(_0x14a54d(0x119),_0x14a54d(0x143));}function a253_0x17ab(){const _0x1d8377=['4124373BXNWqx','instant_api_policy_rules_invalid','1604aFIkqu','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','instant_api_policy_file_too_large','3160370ugJUil','.tmp','catch','isFile','4456WHQhJY','9rKihPe','1196928zzLQFB','8IvtwMv','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','code','1akipYa','rules','policyFilePath','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_app_code_mismatch','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','isArray','instant_api_policy_defaults_invalid','instant_api_policy_file_unreadable','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','instant_api_policy_json_invalid','instant_api_policy_file_unwritable','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','created','2352119YKpxlp','ENOENT','object','decode','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','.rabetbase/instant-api-policy','utf8','size','string','instant_api_policy_app_code_invalid','allow','1983qQrqSz','instant_api_policy_file_missing','length','935645LZpCWa','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','appCode','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','byteLength','12gRSFFt','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','instant_api_policy_version_invalid','defaults','includes','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Review\x20the\x20file\x20before\x20retrying.','force','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','parse','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.'];a253_0x17ab=function(){return _0x1d8377;};return a253_0x17ab();}function assertLocalPolicyContract(_0x201b4a,_0x4e09ee){const _0x493c35=a253_0x5d8649;if(!isObject(_0x201b4a))throw instantApiPolicyError(_0x493c35(0x148),_0x493c35(0x147));if(_0x201b4a['version']!=='1')throw instantApiPolicyError(_0x493c35(0x125),_0x493c35(0x152),_0x493c35(0x13c));if(_0x201b4a[_0x493c35(0x120)]!==_0x4e09ee)throw instantApiPolicyError(_0x493c35(0x142),_0x493c35(0x124)+_0x4e09ee+'.');if(!isObject(_0x201b4a[_0x493c35(0x126)])||typeof _0x201b4a['defaults']['instantApi']!==_0x493c35(0x118))throw instantApiPolicyError(_0x493c35(0x145),_0x493c35(0x141));if(_0x201b4a[_0x493c35(0x13f)]!==undefined&&_0x201b4a[_0x493c35(0x13f)]!==null&&!Array[_0x493c35(0x144)](_0x201b4a[_0x493c35(0x13f)]))throw instantApiPolicyError(_0x493c35(0x12f),_0x493c35(0x14b));return _0x201b4a;}function isObject(_0x3aa192){const _0x689611=a253_0x5d8649;return _0x3aa192!==null&&typeof _0x3aa192===_0x689611(0x14f)&&!Array['isArray'](_0x3aa192);}function isMissingFile(_0x4ec301){const _0x1e4300=a253_0x5d8649;return Boolean(_0x4ec301&&typeof _0x4ec301===_0x1e4300(0x14f)&&_0x4ec301[_0x1e4300(0x13d)]===_0x1e4300(0x14e));}function isAlreadyExists(_0xfdff4){const _0x3e341f=a253_0x5d8649;return Boolean(_0xfdff4&&typeof _0xfdff4===_0x3e341f(0x14f)&&_0xfdff4['code']==='EEXIST');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a254_0xb1c3(_0x5d51ab,_0x26c5b){_0x5d51ab=_0x5d51ab-0xa6;const _0xeb923d=a254_0xeb92();let _0xb1c34e=_0xeb923d[_0x5d51ab];return _0xb1c34e;}const a254_0x5eb1fd=a254_0xb1c3;(function(_0x5e4b24,_0x2d942c){const _0x3214e9=a254_0xb1c3,_0x34b017=_0x5e4b24();while(!![]){try{const _0x292764=-parseInt(_0x3214e9(0xed))/0x1+-parseInt(_0x3214e9(0xec))/0x2+parseInt(_0x3214e9(0xc2))/0x3+parseInt(_0x3214e9(0xa8))/0x4+-parseInt(_0x3214e9(0xbe))/0x5*(-parseInt(_0x3214e9(0xb2))/0x6)+-parseInt(_0x3214e9(0xb6))/0x7+parseInt(_0x3214e9(0xcc))/0x8;if(_0x292764===_0x2d942c)break;else _0x34b017['push'](_0x34b017['shift']());}catch(_0x3942d8){_0x34b017['push'](_0x34b017['shift']());}}}(a254_0xeb92,0x54fa7));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a254_0x5eb1fd(0xd9),'total',a254_0x5eb1fd(0xb4),a254_0x5eb1fd(0xd0),a254_0x5eb1fd(0xe6)],HIT_KEYS=['documentId',a254_0x5eb1fd(0xb7),a254_0x5eb1fd(0xc7),'scope',a254_0x5eb1fd(0xea),a254_0x5eb1fd(0xb1),a254_0x5eb1fd(0xaf),a254_0x5eb1fd(0xeb),a254_0x5eb1fd(0xe0),a254_0x5eb1fd(0xe3),'scoreKind'];export async function searchDevelopmentKnowledge(_0x340976){const _0x9b25e0=a254_0x5eb1fd,_0x1b69f6=_0x340976[_0x9b25e0(0xba)][_0x9b25e0(0xde)](),_0xf8e602=_0x340976[_0x9b25e0(0xda)][_0x9b25e0(0xde)]();if(!_0x1b69f6)throw CliErrors[_0x9b25e0(0xc3)](_0x9b25e0(0xe4));if(!_0x340976[_0x9b25e0(0xc9)]['trim']())throw CliErrors[_0x9b25e0(0xa9)]();if(!_0xf8e602)throw CliErrors[_0x9b25e0(0xc3)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x340976[_0x9b25e0(0xaa)]);const _0x596c20=getKbDomain()+_0x9b25e0(0xd3);let _0x52deb9;try{_0x52deb9=await fetch(_0x596c20,{'method':_0x9b25e0(0xe1),'headers':{'Content-Type':_0x9b25e0(0xe2),'Cookie':_0x340976['cookie'],'X-Invoke-Source':_0x9b25e0(0xd1)},'body':JSON[_0x9b25e0(0xad)]({'appCode':_0x1b69f6,'query':_0xf8e602,..._0x340976[_0x9b25e0(0xaa)]!==undefined?{'topK':_0x340976[_0x9b25e0(0xaa)]}:{}}),'signal':_0x340976['signal']});}catch(_0x3a34c9){if(_0x3a34c9 instanceof CliError)throw _0x3a34c9;if(_0x3a34c9 instanceof Error&&_0x3a34c9[_0x9b25e0(0xb9)]===_0x9b25e0(0xe8))throw _0x3a34c9;throw CliErrors['networkError'](_0x9b25e0(0xce));}if(!hasNoStore(_0x52deb9[_0x9b25e0(0xf0)]))throw CliErrors[_0x9b25e0(0xe7)](_0x9b25e0(0xef));if(_0x52deb9[_0x9b25e0(0xb0)]===0x191)throw CliErrors[_0x9b25e0(0xa9)]();if(!_0x52deb9['ok'])throw CliErrors[_0x9b25e0(0xe7)](_0x9b25e0(0xe5)+_0x52deb9[_0x9b25e0(0xb0)]+').');if(!(_0x52deb9[_0x9b25e0(0xf0)][_0x9b25e0(0xcb)]('content-type')??'')['toLowerCase']()[_0x9b25e0(0xcd)](_0x9b25e0(0xe2)))throw CliErrors[_0x9b25e0(0xe7)](_0x9b25e0(0xb8));let _0x1888a6;try{_0x1888a6=await _0x52deb9[_0x9b25e0(0xe9)]();}catch{throw CliErrors['apiError'](_0x9b25e0(0xae));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x1888a6),_0x340976[_0x9b25e0(0xaa)]);}function readEnvelopeData(_0x7bbaea){const _0x1143f6=a254_0x5eb1fd,_0x3387e2=requireRecord(_0x7bbaea,_0x1143f6(0xc0));if(_0x3387e2[_0x1143f6(0xbf)]===![])throw CliErrors[_0x1143f6(0xe7)]('SmartCode\x20knowledge\x20search\x20failed.');if(!(_0x1143f6(0xc4)in _0x3387e2))throw invalidContract('response\x20envelope');return _0x3387e2[_0x1143f6(0xc4)];}function validateTopK(_0x4255e7){const _0x4b222a=a254_0x5eb1fd;if(_0x4255e7!==undefined&&(!Number['isSafeInteger'](_0x4255e7)||_0x4255e7<0x1||_0x4255e7>0x32))throw CliErrors[_0x4b222a(0xc3)](_0x4b222a(0xa7));}function hasNoStore(_0x55f4e9){const _0x2c900c=a254_0x5eb1fd;return(_0x55f4e9[_0x2c900c(0xcb)](_0x2c900c(0xc8))??'')[_0x2c900c(0xac)](',')['some'](_0x2c781e=>_0x2c781e[_0x2c900c(0xde)]()[_0x2c900c(0xd8)]()===_0x2c900c(0xf1));}function parseDevelopmentSearchResponse(_0x3e327b,_0x4db422){const _0xc46a0b=a254_0x5eb1fd,_0x3939b1=requireExactRecord(_0x3e327b,RESPONSE_KEYS,_0xc46a0b(0xca));if(_0x3939b1[_0xc46a0b(0xee)]!==0x2||_0x3939b1[_0xc46a0b(0xd9)]!==_0xc46a0b(0xa6))throw invalidContract(_0xc46a0b(0xd9));if(!Array[_0xc46a0b(0xbb)](_0x3939b1[_0xc46a0b(0xb4)])||_0x3939b1[_0xc46a0b(0xb4)][_0xc46a0b(0xb5)]>(_0x4db422??0x32))throw invalidContract(_0xc46a0b(0xb4));if(typeof _0x3939b1['strategyFingerprint']!==_0xc46a0b(0xc6)||!/^sha256:[0-9a-f]{64}$/[_0xc46a0b(0xdf)](_0x3939b1[_0xc46a0b(0xd0)]))throw invalidContract(_0xc46a0b(0xd0));const _0x5f30f3=requireRecord(_0x3939b1[_0xc46a0b(0xe6)],'timingsMs'),_0x4da28c={};for(const [_0x4f0be6,_0x4edf16]of Object[_0xc46a0b(0xdd)](_0x5f30f3)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x4f0be6)||typeof _0x4edf16!==_0xc46a0b(0xd7)||!Number[_0xc46a0b(0xdc)](_0x4edf16)||_0x4edf16<0x0)throw invalidContract(_0xc46a0b(0xe6));_0x4da28c[_0x4f0be6]=_0x4edf16;}const _0x1edbd1=_0x3939b1['hits'][_0xc46a0b(0xab)]((_0xe75fe7,_0x3b6c30)=>parseHit(_0xe75fe7,_0x3b6c30));if(!Number[_0xc46a0b(0xcf)](_0x3939b1['total'])||_0x3939b1[_0xc46a0b(0xd6)]!==_0x1edbd1[_0xc46a0b(0xb5)])throw invalidContract(_0xc46a0b(0xd6));return{'schemaVersion':_0x3939b1[_0xc46a0b(0xee)],'profile':_0x3939b1[_0xc46a0b(0xd9)],'total':_0x3939b1[_0xc46a0b(0xd6)],'strategyFingerprint':_0x3939b1[_0xc46a0b(0xd0)],'timingsMs':_0x4da28c,'hits':_0x1edbd1};}function parseHit(_0x4dfaa5,_0x18f501){const _0x3a6236=a254_0x5eb1fd,_0x22eecc=requireExactRecord(_0x4dfaa5,HIT_KEYS,'hits['+_0x18f501+']'),_0x58ba2b=_0x6984c=>{const _0x4d0070=_0x22eecc[_0x6984c];if(typeof _0x4d0070!=='string'||!_0x4d0070)throw invalidContract(_0x6984c);return _0x4d0070;};if(!Number[_0x3a6236(0xcf)](_0x22eecc[_0x3a6236(0xb7)])||_0x22eecc[_0x3a6236(0xb7)]<0x1)throw invalidContract(_0x3a6236(0xb7));if(_0x22eecc[_0x3a6236(0xbc)]!==_0x3a6236(0xc1)&&_0x22eecc[_0x3a6236(0xbc)]!=='company')throw invalidContract(_0x3a6236(0xbc));if(typeof _0x22eecc[_0x3a6236(0xea)]!=='string'||typeof _0x22eecc['text']!=='string')throw invalidContract(_0x3a6236(0xb1));if(!Array['isArray'](_0x22eecc[_0x3a6236(0xaf)])||_0x22eecc['tags'][_0x3a6236(0xbd)](_0x1fbd61=>typeof _0x1fbd61!==_0x3a6236(0xc6)))throw invalidContract(_0x3a6236(0xaf));if(!Number['isSafeInteger'](_0x22eecc[_0x3a6236(0xeb)])||_0x22eecc[_0x3a6236(0xeb)]!==_0x18f501+0x1)throw invalidContract(_0x3a6236(0xeb));if(!isFiniteNumber(_0x22eecc[_0x3a6236(0xe0)])||!isFiniteNumber(_0x22eecc[_0x3a6236(0xe3)]))throw invalidContract('score');return{'documentId':_0x58ba2b('documentId'),'revision':_0x22eecc[_0x3a6236(0xb7)],'chunkId':_0x58ba2b('chunkId'),'scope':_0x22eecc['scope'],'title':_0x22eecc[_0x3a6236(0xea)],'text':_0x22eecc[_0x3a6236(0xb1)],'tags':[..._0x22eecc[_0x3a6236(0xaf)]],'rank':_0x22eecc['rank'],'rawScore':_0x22eecc[_0x3a6236(0xe0)],'finalScore':_0x22eecc[_0x3a6236(0xe3)],'scoreKind':_0x58ba2b(_0x3a6236(0xd2))};}function requireExactRecord(_0x23851a,_0x1baf1f,_0x2ce77f){const _0xdd956e=a254_0x5eb1fd,_0x472a38=requireRecord(_0x23851a,_0x2ce77f),_0x9c4eaa=Object[_0xdd956e(0xd4)](_0x472a38)[_0xdd956e(0xb3)](),_0x183b5a=[..._0x1baf1f]['sort']();if(_0x9c4eaa[_0xdd956e(0xb5)]!==_0x183b5a[_0xdd956e(0xb5)]||_0x9c4eaa['some']((_0x4eb8f9,_0xd426b1)=>_0x4eb8f9!==_0x183b5a[_0xd426b1]))throw invalidContract(_0x2ce77f);return _0x472a38;}function a254_0xeb92(){const _0x241789=['get','3333952CFloqa','includes','SmartCode\x20knowledge\x20search\x20request\x20failed.','isSafeInteger','strategyFingerprint','cli:rabetbase','scoreKind','/smartapi/knowledge/company-public/search','keys','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','total','number','toLowerCase','profile','query','\x20contract.','isFinite','entries','trim','test','rawScore','POST','application/json','finalScore','Knowledge\x20search\x20appCode\x20is\x20required.','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','timingsMs','apiError','AbortError','json','title','rank','266318tLiDVl','251423tfgfSg','schemaVersion','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','headers','no-store','development','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','415608qshGbK','authRequired','topK','map','split','stringify','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','tags','status','text','18wLKQbr','sort','hits','length','2888886rdbKys','revision','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','name','appCode','isArray','scope','some','915490eWdEWx','success','response\x20envelope','public','226233AMYBGN','validation','data','object','string','chunkId','cache-control','cookie','response'];a254_0xeb92=function(){return _0x241789;};return a254_0xeb92();}function requireRecord(_0x10ab31,_0x4efdd4){const _0x2de11e=a254_0x5eb1fd;if(!_0x10ab31||typeof _0x10ab31!==_0x2de11e(0xc5)||Array['isArray'](_0x10ab31))throw invalidContract(_0x4efdd4);return _0x10ab31;}function isFiniteNumber(_0x287909){const _0x36f3ca=a254_0x5eb1fd;return typeof _0x287909===_0x36f3ca(0xd7)&&Number['isFinite'](_0x287909);}function invalidContract(_0x4e935a){const _0x245f42=a254_0x5eb1fd;return CliErrors['apiError'](_0x245f42(0xd5)+_0x4e935a+_0x245f42(0xdb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a255_0x4ae231=a255_0x4587;(function(_0x500f21,_0x27e011){const _0x8377c7=a255_0x4587,_0x2915cf=_0x500f21();while(!![]){try{const _0x543cea=-parseInt(_0x8377c7(0x113))/0x1+parseInt(_0x8377c7(0x116))/0x2*(parseInt(_0x8377c7(0x10f))/0x3)+parseInt(_0x8377c7(0x111))/0x4*(-parseInt(_0x8377c7(0xfd))/0x5)+-parseInt(_0x8377c7(0x105))/0x6*(-parseInt(_0x8377c7(0x110))/0x7)+parseInt(_0x8377c7(0x10a))/0x8*(parseInt(_0x8377c7(0x109))/0x9)+-parseInt(_0x8377c7(0xfc))/0xa*(parseInt(_0x8377c7(0xf9))/0xb)+-parseInt(_0x8377c7(0xff))/0xc*(-parseInt(_0x8377c7(0x112))/0xd);if(_0x543cea===_0x27e011)break;else _0x2915cf['push'](_0x2915cf['shift']());}catch(_0x856746){_0x2915cf['push'](_0x2915cf['shift']());}}}(a255_0x1ac1,0x94042));function a255_0x1ac1(){const _0x384829=['245968leFASi','name','page-dir','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','cwd','72qqhJwY','7wDoDxy','4Mxzzmv','23179MpsWvk','440933UIkQJV','flagMissing','F_OK','13738wkGsJa','11tLkEas','.json','Unsupported\x20file\x20in\x20page\x20directory:\x20','5126950XcyeRv','3284045LZyJCG','Page\x20directory\x20not\x20found:\x20','4044zMEZkW','trim','page','.rabetbase','validation','localeCompare','1880292XZFeZG','join','toUpperCase','utf8','333nHjWmJ'];a255_0x1ac1=function(){return _0x384829;};return a255_0x1ac1();}import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x3abf7b,_0x16ef85=process[a255_0x4ae231(0x10e)]()){const _0x257cdf=a255_0x4ae231,_0x21209e=resolve(_0x16ef85),_0x37842d=join(_0x21209e,'.rabetbase',_0x257cdf(0x101));return{'projectRoot':_0x21209e,'pagesBaseDir':_0x37842d,'appPagesDir':join(_0x37842d,_0x3abf7b),'lockFilePath':join(_0x21209e,_0x257cdf(0x102),'page.lock.json')};}export function buildPageFileName(_0x5855c4,_0x5d4c63){const _0xfca29d=a255_0x4ae231;return _0x5855c4+'-'+_0x5d4c63[_0xfca29d(0x107)]()+_0xfca29d(0xfa);}export function resolvePageFilePath(_0x131ff9,_0x40d7b8,_0xf82ecf){return join(_0x131ff9['appPagesDir'],buildPageFileName(_0x40d7b8,_0xf82ecf));}function a255_0x4587(_0x38fec4,_0x1aa462){_0x38fec4=_0x38fec4-0xf9;const _0x1ac14a=a255_0x1ac1();let _0x4587af=_0x1ac14a[_0x38fec4];return _0x4587af;}export async function ensureParentDirectory(_0x3fabd6){await mkdir(dirname(_0x3fabd6),{'recursive':!![]});}export async function fileExists(_0x1688b6){const _0x2c6b01=a255_0x4ae231;try{return await access(_0x1688b6,constants[_0x2c6b01(0x115)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x234abc){const _0x4cd5e2=a255_0x4ae231,_0xff2ba1=_0x234abc[_0x4cd5e2(0x100)]();if(!_0xff2ba1)throw CliErrors[_0x4cd5e2(0x114)](_0x4cd5e2(0x10c));const _0x256365=resolve(_0xff2ba1);let _0x12592d;try{_0x12592d=await lstat(_0x256365);}catch{throw CliErrors['validation'](_0x4cd5e2(0xfe)+_0xff2ba1);}if(!_0x12592d['isDirectory']())throw CliErrors['validation'](_0x4cd5e2(0x10d)+_0xff2ba1);const _0x35912c={};return await readDirectory(_0x256365,_0x256365,_0x35912c),_0x35912c;}async function readDirectory(_0x36b645,_0x33c363,_0x476db3){const _0x286479=a255_0x4ae231,_0x5d175f=await readdir(_0x33c363,{'withFileTypes':!![]});for(const _0x589e3f of _0x5d175f['sort']((_0x58a17c,_0x39d160)=>_0x58a17c[_0x286479(0x10b)][_0x286479(0x104)](_0x39d160[_0x286479(0x10b)]))){const _0x37a822=join(_0x33c363,_0x589e3f[_0x286479(0x10b)]);if(_0x589e3f['isDirectory']()){await readDirectory(_0x36b645,_0x37a822,_0x476db3);continue;}if(!_0x589e3f['isFile']())throw CliErrors[_0x286479(0x103)](_0x286479(0xfb)+_0x37a822);_0x476db3[relative(_0x36b645,_0x37a822)['split'](sep)[_0x286479(0x106)]('/')]=await readFile(_0x37a822,_0x286479(0x108));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a256_0x3d8f(_0x2c22ce,_0x870f0a){_0x2c22ce=_0x2c22ce-0xea;const _0x4f97a3=a256_0x4f97();let _0x3d8fc2=_0x4f97a3[_0x2c22ce];return _0x3d8fc2;}(function(_0x135aff,_0x330cd2){const _0x41043f=a256_0x3d8f,_0x4a188b=_0x135aff();while(!![]){try{const _0x2b2fff=parseInt(_0x41043f(0xf5))/0x1*(parseInt(_0x41043f(0xef))/0x2)+parseInt(_0x41043f(0xfb))/0x3+parseInt(_0x41043f(0xf9))/0x4+-parseInt(_0x41043f(0xf0))/0x5*(parseInt(_0x41043f(0xeb))/0x6)+parseInt(_0x41043f(0xed))/0x7+parseInt(_0x41043f(0xf2))/0x8*(parseInt(_0x41043f(0xf7))/0x9)+parseInt(_0x41043f(0xec))/0xa*(-parseInt(_0x41043f(0xee))/0xb);if(_0x2b2fff===_0x330cd2)break;else _0x4a188b['push'](_0x4a188b['shift']());}catch(_0x1cf166){_0x4a188b['push'](_0x4a188b['shift']());}}}(a256_0x4f97,0x320c0));import a256_0x48f909 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x1e5e57){const _0x5b7192=a256_0x3d8f;return JSON[_0x5b7192(0xf6)](JSON[_0x5b7192(0xf4)](_0x1e5e57),null,0x2)+'\x0a';}export function computePageContentHash(_0x5e0131){const _0x13b2a7=a256_0x3d8f;return a256_0x48f909['createHash'](_0x13b2a7(0xf1))[_0x13b2a7(0xea)](_0x5e0131)[_0x13b2a7(0xf3)](_0x13b2a7(0xfa));}export function computeSerializedSchemaHash(_0x4b4750){return computePageContentHash(serializePageSchemaForFile(_0x4b4750));}function a256_0x4f97(){const _0x3e7aaf=['828282ZgePnD','update','67302UhwoUp','4330dgvMMD','82369AxXgxD','8074deBPaB','8FXJHWH','155PXcnDk','md5','16oKvytt','digest','parse','32672ACRiPj','stringify','1096182THNrXQ','utf8','833584yKtbJg','hex'];a256_0x4f97=function(){return _0x3e7aaf;};return a256_0x4f97();}export async function computePageFileHash(_0x282ab4){const _0x4099d8=a256_0x3d8f,_0xb5f4e6=await readFile(_0x282ab4,_0x4099d8(0xf8));return computePageContentHash(_0xb5f4e6);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a257_0x73e3(_0x3756e4,_0x3879bc){_0x3756e4=_0x3756e4-0xca;const _0x29f319=a257_0x29f3();let _0x73e38a=_0x29f319[_0x3756e4];return _0x73e38a;}(function(_0x56e4fd,_0x27d6eb){const _0x208fa9=a257_0x73e3,_0x11a7a9=_0x56e4fd();while(!![]){try{const _0x338234=parseInt(_0x208fa9(0xce))/0x1+-parseInt(_0x208fa9(0xd3))/0x2+parseInt(_0x208fa9(0xd1))/0x3*(-parseInt(_0x208fa9(0xcc))/0x4)+parseInt(_0x208fa9(0xcb))/0x5+-parseInt(_0x208fa9(0xd8))/0x6+-parseInt(_0x208fa9(0xda))/0x7+parseInt(_0x208fa9(0xd6))/0x8*(parseInt(_0x208fa9(0xcd))/0x9);if(_0x338234===_0x27d6eb)break;else _0x11a7a9['push'](_0x11a7a9['shift']());}catch(_0x14f7e3){_0x11a7a9['push'](_0x11a7a9['shift']());}}}(a257_0x29f3,0x60c8b));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a257_0x29f3(){const _0x420b9b=['217929pxvRbX','utf8','object','24sPRtmn','apps','1273434UBolEg','code','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','1188760YEAgDg','lastSync','781608MAttmk','ENOENT','1137934XWGETH','stringify','pages','3541620RUZZUn','23032TXzNQd','27spnvDp'];a257_0x29f3=function(){return _0x420b9b;};return a257_0x29f3();}export function ensurePageLockScope(_0x11feba,_0x304f47){const _0x2f68fa=a257_0x73e3,_0x58cca3={'apps':_0x11feba['apps']&&typeof _0x11feba[_0x2f68fa(0xd2)]===_0x2f68fa(0xd0)?_0x11feba[_0x2f68fa(0xd2)]:{}};let _0x1b296d=_0x58cca3[_0x2f68fa(0xd2)][_0x304f47];if(!_0x1b296d)return _0x1b296d={'lastSync':'','pages':{}},_0x58cca3[_0x2f68fa(0xd2)][_0x304f47]=_0x1b296d,{'lockData':_0x58cca3,'appLock':_0x1b296d};return!_0x1b296d[_0x2f68fa(0xd7)]&&(_0x1b296d[_0x2f68fa(0xd7)]=''),(!_0x1b296d[_0x2f68fa(0xca)]||typeof _0x1b296d[_0x2f68fa(0xca)]!=='object')&&(_0x1b296d[_0x2f68fa(0xca)]={}),{'lockData':_0x58cca3,'appLock':_0x1b296d};}export async function readPageLockFile(_0x292d98){const _0x314665=a257_0x73e3;try{const _0x3d7ea4=await readFile(_0x292d98,'utf8'),_0x31b52=JSON['parse'](_0x3d7ea4);return{'apps':_0x31b52[_0x314665(0xd2)]&&typeof _0x31b52[_0x314665(0xd2)]===_0x314665(0xd0)?_0x31b52[_0x314665(0xd2)]:{}};}catch(_0x5d67b6){if(_0x5d67b6[_0x314665(0xd4)]===_0x314665(0xd9))return null;throw new Error(_0x314665(0xd5)+String(_0x5d67b6));}}export async function writePageLockFile(_0x1fa977,_0x4d95b5){const _0xc4358a=a257_0x73e3;await mkdir(dirname(_0x1fa977),{'recursive':!![]}),await writeFile(_0x1fa977,JSON[_0xc4358a(0xdb)](_0x4d95b5,null,0x2),_0xc4358a(0xcf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xba06f6,_0xe8da6e){const _0x23a0ec=a259_0x406a,_0x3d120a=_0xba06f6();while(!![]){try{const _0xd74145=parseInt(_0x23a0ec(0x1fd))/0x1*(-parseInt(_0x23a0ec(0x1e6))/0x2)+parseInt(_0x23a0ec(0x1e0))/0x3*(-parseInt(_0x23a0ec(0x1fc))/0x4)+parseInt(_0x23a0ec(0x20a))/0x5+parseInt(_0x23a0ec(0x1d5))/0x6*(parseInt(_0x23a0ec(0x219))/0x7)+parseInt(_0x23a0ec(0x212))/0x8+parseInt(_0x23a0ec(0x1ee))/0x9+-parseInt(_0x23a0ec(0x211))/0xa*(parseInt(_0x23a0ec(0x206))/0xb);if(_0xd74145===_0xe8da6e)break;else _0x3d120a['push'](_0x3d120a['shift']());}catch(_0x4fb2ab){_0x3d120a['push'](_0x3d120a['shift']());}}}(a259_0x492a,0xf0db6));function a259_0x406a(_0x4658b8,_0x367679){_0x4658b8=_0x4658b8-0x1ce;const _0x492aae=a259_0x492a();let _0x406a00=_0x492aae[_0x4658b8];return _0x406a00;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x52cca7,_0x3a049f){const _0x5b23f6=a259_0x406a,_0x1ad96e=[],_0x2e4b80=normalizeSqlForStaticAnalysis(_0x52cca7),_0x3e70e9=(_0x2e4b80[_0x5b23f6(0x20d)]?[]:extractJoinFacts(_0x2e4b80['sql']))[_0x5b23f6(0x21a)](_0x1f6751=>{const _0x517c14=_0x5b23f6;if(_0x1f6751[_0x517c14(0x1d4)]||_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x1d6)]===0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':_0x517c14(0x201),'table':_0x1f6751['table'],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x1f6751[_0x517c14(0x1e3)]??_0x517c14(0x1f1)}),{'table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':_0x517c14(0x1f4)};const _0x17fd35=resolveTableMetadata(_0x3a049f,_0x1f6751[_0x517c14(0x200)]),_0x212445=(_0x17fd35?.[_0x517c14(0x218)]??[])['map'](_0x206b6e=>({'index':_0x206b6e,'matchedPrefix':findEqualityPrefix(_0x206b6e[_0x517c14(0x1ff)],_0x1f6751['columns'])}))[_0x517c14(0x1ed)](_0x299ac1=>_0x299ac1[_0x517c14(0x1ef)][_0x517c14(0x1d6)]>0x0),_0x42513f=_0x212445[_0x517c14(0x202)]((_0x303dea,_0x47547d)=>!_0x303dea||_0x47547d[_0x517c14(0x1ef)]['length']>_0x303dea['matchedPrefix'][_0x517c14(0x1d6)]?_0x47547d:_0x303dea,_0x212445[0x0]);if(_0x42513f)return{'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':_0x517c14(0x1f8),'matchedIndex':{..._0x42513f['index'],'matchedPrefix':_0x42513f['matchedPrefix']}};const _0x1081bb=_0x17fd35?.[_0x517c14(0x218)]['filter'](_0x4d6af3=>_0x4d6af3['columns']['some'](_0x4a630f=>_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x208)](_0x20c3c7=>columnNamesMatch(_0x4a630f,_0x20c3c7))))??[];if(_0x1081bb[_0x517c14(0x1d6)]>0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':'JOIN_INDEX_NOT_USABLE','table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x517c14(0x1dd)}),{'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'status':'warning','candidateIndexes':_0x1081bb};if(_0x17fd35&&_0x17fd35[_0x517c14(0x20c)]!==![]&&_0x17fd35[_0x517c14(0x218)]['length']>0x0&&_0x1f6751[_0x517c14(0x1ff)][_0x517c14(0x1d6)]>0x0)return _0x1ad96e[_0x517c14(0x1ce)]({'code':'JOIN_INDEX_MISSING','table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751['columns'],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x1f6751['table'],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751['columns'],'status':'warning'};return _0x1ad96e['push']({'code':_0x517c14(0x1d3),'table':_0x1f6751[_0x517c14(0x200)],'alias':_0x1f6751[_0x517c14(0x1ec)],'columns':_0x1f6751[_0x517c14(0x1ff)],'reason':_0x17fd35?_0x517c14(0x1e4):_0x517c14(0x1f3)}),{'table':_0x1f6751['table'],'alias':_0x1f6751['alias'],'columns':_0x1f6751['columns'],'status':_0x517c14(0x1f4)};});return{'checked':_0x3e70e9[_0x5b23f6(0x1d6)]>0x0,'joins':_0x3e70e9,'warnings':_0x1ad96e};}function extractJoinFacts(_0x287eb3){const _0x5b737d=a259_0x406a,_0x39460b=maskNestedQueries(stripSqlNoise(_0x287eb3)),_0x2bd80e=maskQuotedIdentifiers(_0x39460b),_0x5f3848=[],_0x4500ee=new Set(),_0x2bcfd0=/\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 _0x385b50 of _0x39460b[_0x5b737d(0x20b)](_0x2bcfd0)){const _0x54e40f=_0x385b50[_0x5b737d(0x215)]??0x0,_0x171a79=_0x385b50[0x0][_0x5b737d(0x1f9)](/\bJOIN\b/i),_0x1c7a6f=_0x54e40f+Math[_0x5b737d(0x1d0)](0x0,_0x171a79);if(!/^JOIN\b/i[_0x5b737d(0x1d7)](_0x2bd80e['slice'](_0x1c7a6f)))continue;_0x4500ee[_0x5b737d(0x1f6)](_0x1c7a6f);const _0x57dafd=normalizeIdentifier(_0x385b50[0x1]||'INNER'),_0x1f9000=normalizeIdentifier(_0x385b50[0x2]??''),_0x85fa54=normalizeIdentifier(_0x385b50[0x3]||_0x1f9000['split']('.')['at'](-0x1)||_0x1f9000),_0x397090=[],_0x21749a=_0x1f9000===_0x5b737d(0x1d9);let _0x2cf847=_0x57dafd===_0x5b737d(0x217)||_0x57dafd===_0x5b737d(0x1e1)||_0x21749a,_0x3f8ae4=_0x2cf847?_0x21749a?_0x5b737d(0x1e9):_0x57dafd[_0x5b737d(0x1f0)]()+_0x5b737d(0x205):undefined;const _0x5a7ff9=stripOuterParentheses(_0x385b50[0x4]??''),_0x5663b4=_0x5a7ff9[_0x5b737d(0x1e2)](MYBATIS_DYNAMIC_START_MARKER)||_0x5a7ff9['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x21c7b4=_0x5a7ff9['includes'](MYBATIS_INCLUDE_MARKER);_0x5663b4&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x216));_0x21c7b4&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x1d2));const _0x3ad73a=_0x5a7ff9[_0x5b737d(0x1da)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5b737d(0x1da)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5b737d(0x1da)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3ad73a,'OR')&&(_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x20e));for(const _0x2f13ff of splitTopLevelAnd(_0x3ad73a)){const _0x18024e=stripOuterParentheses(_0x2f13ff);if(hasTopLevelKeyword(_0x18024e,'OR')){_0x2cf847=!![],_0x3f8ae4??=_0x5b737d(0x20e);continue;}const _0x468861=splitEquality(_0x18024e);if(!_0x468861){containsColumnReference(_0x2f13ff,_0x85fa54)&&(_0x2cf847=!![]);continue;}const _0x3a00bb=parseDirectColumnReference(_0x468861[0x0],_0x85fa54),_0x5c8060=parseDirectColumnReference(_0x468861[0x1],_0x85fa54),_0x3e9c6e=containsColumnReference(_0x468861[0x0],_0x85fa54),_0x9d9352=containsColumnReference(_0x468861[0x1],_0x85fa54),_0x4def59=_0x3a00bb&&!_0x9d9352?_0x3a00bb:_0x5c8060&&!_0x3e9c6e?_0x5c8060:null;if(_0x4def59&&!_0x397090['includes'](_0x4def59))_0x397090[_0x5b737d(0x1ce)](_0x4def59);else!_0x4def59&&containsColumnReference(_0x2f13ff,_0x85fa54)&&(_0x2cf847=!![]);}_0x5f3848['push']({'table':_0x1f9000,'alias':_0x85fa54,'columns':_0x397090,'unsupportedPredicate':_0x2cf847,'unsupportedReason':_0x3f8ae4,'containsUnresolvedInclude':_0x21c7b4,'position':_0x1c7a6f});}for(const _0x330a56 of _0x2bd80e[_0x5b737d(0x20b)](/\bJOIN\b/gi)){const _0x38b971=_0x330a56[_0x5b737d(0x215)]??0x0;if(_0x4500ee['has'](_0x38b971))continue;const _0x404d1b=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x5b737d(0x1de)](_0x39460b[_0x5b737d(0x1e8)](_0x38b971+_0x330a56[0x0][_0x5b737d(0x1d6)])),_0x40e2c0=normalizeIdentifier(_0x404d1b?.[0x1]||_0x5b737d(0x1e7)),_0x38d39f=normalizeIdentifier(_0x404d1b?.[0x2]||''),_0x57dfad=isSqlClauseKeyword(_0x38d39f)?_0x40e2c0['split']('.')['at'](-0x1)||_0x40e2c0:_0x38d39f||_0x40e2c0[_0x5b737d(0x203)]('.')['at'](-0x1)||_0x40e2c0;_0x5f3848[_0x5b737d(0x1ce)]({'table':_0x40e2c0,'alias':_0x57dfad,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5b737d(0x214),'position':_0x38b971});}const _0x5b9008=_0x2bd80e[_0x5b737d(0x1cf)](MYBATIS_INCLUDE_MARKER);return _0x5b9008>=0x0&&!_0x5f3848[_0x5b737d(0x208)](_0x570ce2=>_0x570ce2[_0x5b737d(0x1d8)])&&_0x5f3848[_0x5b737d(0x1ce)]({'table':_0x5b737d(0x1e7),'alias':_0x5b737d(0x1e7),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5b737d(0x1dc),'containsUnresolvedInclude':!![],'position':_0x5b9008}),_0x5f3848[_0x5b737d(0x210)]((_0x2d00ef,_0x3f44ce)=>_0x2d00ef[_0x5b737d(0x1fb)]-_0x3f44ce[_0x5b737d(0x1fb)]);}function stripSqlNoise(_0x34389a){const _0x4105d9=a259_0x406a,_0x1c150a=Array[_0x4105d9(0x1f2)](_0x34389a),_0x587598=(_0x4c49ce,_0x31a48e)=>{for(let _0x189a9a=_0x4c49ce;_0x189a9a<_0x31a48e;_0x189a9a+=0x1){_0x1c150a[_0x189a9a]!=='\x0a'&&_0x1c150a[_0x189a9a]!=='\x0d'&&(_0x1c150a[_0x189a9a]='\x20');}};for(let _0x42c1fe=0x0;_0x42c1fe<_0x1c150a['length'];_0x42c1fe+=0x1){const _0xc0b01=_0x1c150a[_0x42c1fe],_0x15b5a9=_0x1c150a[_0x42c1fe+0x1];if(_0xc0b01==='\x27'||_0xc0b01==='\x22'||_0xc0b01==='`'){const _0x502651=_0xc0b01,_0x4421b5=_0x42c1fe;_0x42c1fe+=0x1;while(_0x42c1fe<_0x1c150a['length']){if(_0x1c150a[_0x42c1fe]==='\x5c'&&_0x42c1fe+0x1<_0x1c150a['length']){_0x42c1fe+=0x2;continue;}if(_0x1c150a[_0x42c1fe]!==_0x502651){_0x42c1fe+=0x1;continue;}if(_0x1c150a[_0x42c1fe+0x1]===_0x502651){_0x42c1fe+=0x2;continue;}break;}if(_0x502651==='\x27')_0x587598(_0x4421b5,Math[_0x4105d9(0x1db)](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]));continue;}if(_0xc0b01==='-'&&_0x15b5a9==='-'){const _0x40b3aa=_0x42c1fe;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='\x0a')_0x42c1fe+=0x1;_0x587598(_0x40b3aa,_0x42c1fe);continue;}if(_0xc0b01==='/'&&_0x15b5a9==='*'){const _0x38efa1=_0x42c1fe;_0x42c1fe+=0x2;while(_0x42c1fe<_0x1c150a['length']&&!(_0x1c150a[_0x42c1fe]==='*'&&_0x1c150a[_0x42c1fe+0x1]==='/')){_0x42c1fe+=0x1;}_0x42c1fe=Math['min'](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]-0x1),_0x587598(_0x38efa1,_0x42c1fe+0x1);continue;}if(_0xc0b01==='#'&&_0x15b5a9!=='{'){const _0x2bdd2a=_0x42c1fe;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='\x0a')_0x42c1fe+=0x1;_0x587598(_0x2bdd2a,_0x42c1fe);continue;}if((_0xc0b01==='#'||_0xc0b01==='$')&&_0x15b5a9==='{'){const _0x4e8dd4=_0x42c1fe;_0x42c1fe+=0x2;while(_0x42c1fe<_0x1c150a[_0x4105d9(0x1d6)]&&_0x1c150a[_0x42c1fe]!=='}')_0x42c1fe+=0x1;_0x587598(_0x4e8dd4,Math['min'](_0x42c1fe+0x1,_0x1c150a[_0x4105d9(0x1d6)]));}}return _0x1c150a['join']('');}function maskQuotedIdentifiers(_0x202001){const _0x2e9447=a259_0x406a,_0x33d8ce=Array['from'](_0x202001);for(let _0x46e6d5=0x0;_0x46e6d5<_0x33d8ce[_0x2e9447(0x1d6)];_0x46e6d5+=0x1){const _0x140112=_0x33d8ce[_0x46e6d5];if(_0x140112!=='\x22'&&_0x140112!=='`')continue;_0x46e6d5+=0x1;while(_0x46e6d5<_0x33d8ce[_0x2e9447(0x1d6)]){if(_0x33d8ce[_0x46e6d5]===_0x140112){if(_0x33d8ce[_0x46e6d5+0x1]===_0x140112){_0x33d8ce[_0x46e6d5]='\x20',_0x33d8ce[_0x46e6d5+0x1]='\x20',_0x46e6d5+=0x2;continue;}break;}_0x33d8ce[_0x46e6d5]='\x20',_0x46e6d5+=0x1;}}return _0x33d8ce['join']('');}function maskNestedQueries(_0x34135a){const _0x380269=a259_0x406a,_0xefdaed=Array[_0x380269(0x1f2)](_0x34135a);for(let _0x57141a=0x0;_0x57141a<_0xefdaed['length'];_0x57141a+=0x1){if(_0xefdaed[_0x57141a]!=='(')continue;const _0x20d43f=_0x34135a[_0x380269(0x1e8)](_0x57141a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x380269(0x1d7)](_0x20d43f))continue;let _0x4be040=0x1,_0x5c56ae=_0x57141a+0x1;for(;_0x5c56ae<_0xefdaed[_0x380269(0x1d6)]&&_0x4be040>0x0;_0x5c56ae+=0x1){if(_0xefdaed[_0x5c56ae]==='(')_0x4be040+=0x1;if(_0xefdaed[_0x5c56ae]===')')_0x4be040-=0x1;}if(_0x4be040!==0x0)continue;for(let _0x493d86=_0x57141a;_0x493d86<_0x5c56ae;_0x493d86+=0x1){_0xefdaed[_0x493d86]='\x20';}const _0x3a9210=_0x380269(0x1d9);for(let _0x18d8b1=0x0;_0x18d8b1<_0x3a9210[_0x380269(0x1d6)]&&_0x57141a+_0x18d8b1<_0x5c56ae;_0x18d8b1+=0x1){_0xefdaed[_0x57141a+_0x18d8b1]=_0x3a9210[_0x18d8b1];}_0x57141a=_0x5c56ae-0x1;}return _0xefdaed[_0x380269(0x207)]('');}function splitTopLevelAnd(_0x51eb39){const _0x5de0e3=a259_0x406a,_0x21b1e6=[];let _0x3f7946=0x0,_0x47d8f7=0x0;for(let _0x533f2e=0x0;_0x533f2e<_0x51eb39['length'];_0x533f2e+=0x1){const _0x332c1c=_0x51eb39[_0x533f2e];if(_0x332c1c==='(')_0x3f7946+=0x1;if(_0x332c1c===')')_0x3f7946=Math[_0x5de0e3(0x1d0)](0x0,_0x3f7946-0x1);_0x3f7946===0x0&&_0x51eb39[_0x5de0e3(0x1e8)](_0x533f2e)['match'](/^AND\b/i)&&(_0x533f2e===0x0||/\s/[_0x5de0e3(0x1d7)](_0x51eb39[_0x533f2e-0x1]??''))&&(_0x21b1e6[_0x5de0e3(0x1ce)](_0x51eb39[_0x5de0e3(0x1e8)](_0x47d8f7,_0x533f2e)[_0x5de0e3(0x20f)]()),_0x533f2e+=0x2,_0x47d8f7=_0x533f2e+0x1);}const _0x3e7d0e=_0x51eb39['slice'](_0x47d8f7)['trim']();if(_0x3e7d0e)_0x21b1e6[_0x5de0e3(0x1ce)](_0x3e7d0e);return _0x21b1e6;}function hasTopLevelKeyword(_0x5bf8e6,_0x4a9c2e){const _0x35fdb6=a259_0x406a;let _0x3c6272=0x0;for(let _0x31662a=0x0;_0x31662a<_0x5bf8e6['length'];_0x31662a+=0x1){const _0x5d401c=_0x5bf8e6[_0x31662a];if(_0x5d401c==='(')_0x3c6272+=0x1;if(_0x5d401c===')')_0x3c6272=Math[_0x35fdb6(0x1d0)](0x0,_0x3c6272-0x1);if(_0x3c6272!==0x0)continue;const _0x4cc213=_0x5bf8e6['slice'](_0x31662a,_0x31662a+_0x4a9c2e['length']),_0x59abff=_0x5bf8e6[_0x31662a-0x1]??'\x20',_0x118e3b=_0x5bf8e6[_0x31662a+_0x4a9c2e[_0x35fdb6(0x1d6)]]??'\x20';if(_0x4cc213[_0x35fdb6(0x1f0)]()===_0x4a9c2e['toUpperCase']()&&!/[\w$]/[_0x35fdb6(0x1d7)](_0x59abff)&&!/[\w$]/[_0x35fdb6(0x1d7)](_0x118e3b))return!![];}return![];}function splitEquality(_0x3b22a2){const _0x291231=a259_0x406a,_0x3de43f=stripOuterParentheses(_0x3b22a2);let _0xe23c74=0x0,_0x4f6e99;for(let _0xf6c248=0x0;_0xf6c248<_0x3de43f[_0x291231(0x1d6)];_0xf6c248+=0x1){const _0x7098f7=_0x3de43f[_0xf6c248];if(_0x7098f7==='(')_0xe23c74+=0x1;if(_0x7098f7===')')_0xe23c74=Math[_0x291231(0x1d0)](0x0,_0xe23c74-0x1);const _0x276974=_0x3de43f[_0xf6c248-0x1]??'',_0x3e99ee=_0x3de43f[_0xf6c248+0x1]??'';if(_0x7098f7==='='&&_0xe23c74===0x0&&!/[!<>=:]/[_0x291231(0x1d7)](_0x276974)&&_0x3e99ee!=='='){if(_0x4f6e99!==undefined)return null;_0x4f6e99=_0xf6c248;}}return _0x4f6e99===undefined?null:[_0x3de43f['slice'](0x0,_0x4f6e99)[_0x291231(0x20f)](),_0x3de43f[_0x291231(0x1e8)](_0x4f6e99+0x1)[_0x291231(0x20f)]()];}function parseDirectColumnReference(_0x332a43,_0x51c940){const _0x53d892=a259_0x406a,_0x530575=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x53d892(0x1de)](stripOuterParentheses(_0x332a43));if(!_0x530575)return null;if(normalizeIdentifier(_0x530575[0x1]??'')!==normalizeIdentifier(_0x51c940))return null;return normalizeIdentifier(_0x530575[0x2]??'');}function containsColumnReference(_0x35208b,_0x3afecd){const _0x4435e5=a259_0x406a,_0x3b3a96=_0x35208b[_0x4435e5(0x1f5)](/[`"]/g,''),_0x594638=_0x3afecd[_0x4435e5(0x1f5)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x4435e5(0x1fe)+_0x594638+_0x4435e5(0x1ea),'i')[_0x4435e5(0x1d7)](_0x3b3a96);}function a259_0x492a(){const _0x11d3dc=['JOIN_PREDICATE_UNSUPPORTED','reduce','split','has','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','5933279jmLHtF','join','some','using','8318085kNUvjd','matchAll','metadataAvailable','error','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','trim','sort','20HupxBq','12303384FXYdls','natural','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','index','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','right','indexes','495019pmJtvg','map','push','indexOf','max','toLowerCase','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','INDEX_METADATA_UNAVAILABLE','unsupportedPredicate','18zcFUed','length','test','containsUnresolvedInclude','__sq__','replaceAll','min','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','exec','endsWith','5103xYRkmj','full','includes','unsupportedReason','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','inner','2cCIMXY','unknown','slice','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','\x5cs*\x5c.\x5cs*[\x5cw$]+','where','alias','filter','2510847DpqVyq','matchedPrefix','toUpperCase','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','from','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','unavailable','replace','add','tableName','covered','search','cross','position','1464iNCmqn','1004780wPaWfs','(?:^|[^\x5cw$])','columns','table'];a259_0x492a=function(){return _0x11d3dc;};return a259_0x492a();}function findEqualityPrefix(_0x4cac26,_0x4fcd1f){const _0x107bdb=a259_0x406a,_0x23f733=new Set(_0x4fcd1f[_0x107bdb(0x21a)](normalizeIdentifier)),_0x194722=[];for(const _0x2f40ed of _0x4cac26){if(!_0x23f733['has'](normalizeIdentifier(_0x2f40ed)))break;_0x194722[_0x107bdb(0x1ce)](_0x2f40ed);}return _0x194722;}function resolveTableMetadata(_0x25bbeb,_0x445e10){const _0x17ae48=a259_0x406a,_0x4f5e9e=normalizeIdentifier(_0x445e10),_0x2b7281=_0x25bbeb[_0x17ae48(0x1ed)](_0x1f7361=>normalizeIdentifier(_0x1f7361[_0x17ae48(0x1f7)])===_0x4f5e9e);if(_0x2b7281['length']===0x1)return _0x2b7281[0x0];const _0x35dbbe=_0x4f5e9e[_0x17ae48(0x1e2)]('.'),_0x1eef15=_0x4f5e9e[_0x17ae48(0x203)]('.')['at'](-0x1),_0x453a6c=_0x25bbeb[_0x17ae48(0x1ed)](_0x448fff=>{const _0x56bb66=_0x17ae48,_0x481dbf=normalizeIdentifier(_0x448fff[_0x56bb66(0x1f7)]);if(_0x35dbbe&&_0x481dbf[_0x56bb66(0x1e2)]('.'))return![];return _0x481dbf[_0x56bb66(0x203)]('.')['at'](-0x1)===_0x1eef15;});return _0x453a6c['length']===0x1?_0x453a6c[0x0]:undefined;}function columnNamesMatch(_0x2ad73a,_0x58f2e9){return normalizeIdentifier(_0x2ad73a)===normalizeIdentifier(_0x58f2e9);}function normalizeIdentifier(_0x1c79c6){const _0x209253=a259_0x406a;return _0x1c79c6[_0x209253(0x1f5)](/[`"]/g,'')[_0x209253(0x20f)]()[_0x209253(0x1d1)]();}function isSqlClauseKeyword(_0x1b7cbb){const _0x565bd0=a259_0x406a;return new Set(['on',_0x565bd0(0x209),_0x565bd0(0x1eb),_0x565bd0(0x207),_0x565bd0(0x1e5),'left',_0x565bd0(0x217),_0x565bd0(0x1e1),_0x565bd0(0x1fa),_0x565bd0(0x213)])[_0x565bd0(0x204)](_0x1b7cbb);}function stripOuterParentheses(_0x2efb6d){const _0x2370ac=a259_0x406a;let _0x2cb5fb=_0x2efb6d['trim']();while(_0x2cb5fb['startsWith']('(')&&_0x2cb5fb[_0x2370ac(0x1df)](')')){let _0x5a45ba=0x0,_0x54dbc7=!![];for(let _0x267486=0x0;_0x267486<_0x2cb5fb[_0x2370ac(0x1d6)];_0x267486+=0x1){if(_0x2cb5fb[_0x267486]==='(')_0x5a45ba+=0x1;if(_0x2cb5fb[_0x267486]===')')_0x5a45ba-=0x1;if(_0x5a45ba===0x0&&_0x267486<_0x2cb5fb['length']-0x1){_0x54dbc7=![];break;}}if(!_0x54dbc7||_0x5a45ba!==0x0)break;_0x2cb5fb=_0x2cb5fb[_0x2370ac(0x1e8)](0x1,-0x1)['trim']();}return _0x2cb5fb;}
|
|
1
|
+
(function(_0x13ec86,_0x14f77a){const _0xb9d34a=a259_0x1e48,_0xf4fb0d=_0x13ec86();while(!![]){try{const _0x26db69=-parseInt(_0xb9d34a(0x101))/0x1*(-parseInt(_0xb9d34a(0x118))/0x2)+-parseInt(_0xb9d34a(0x137))/0x3*(parseInt(_0xb9d34a(0x124))/0x4)+parseInt(_0xb9d34a(0xf8))/0x5+parseInt(_0xb9d34a(0x11a))/0x6+-parseInt(_0xb9d34a(0x130))/0x7*(-parseInt(_0xb9d34a(0x138))/0x8)+-parseInt(_0xb9d34a(0x10b))/0x9*(-parseInt(_0xb9d34a(0x117))/0xa)+-parseInt(_0xb9d34a(0x12a))/0xb;if(_0x26db69===_0x14f77a)break;else _0xf4fb0d['push'](_0xf4fb0d['shift']());}catch(_0x2229f9){_0xf4fb0d['push'](_0xf4fb0d['shift']());}}}(a259_0x5caa,0xa68e3));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5b857d,_0x1e390d){const _0x29216e=a259_0x1e48,_0x4cd640=[],_0x122f1b=normalizeSqlForStaticAnalysis(_0x5b857d),_0x558ba0=(_0x122f1b[_0x29216e(0xff)]?[]:extractJoinFacts(_0x122f1b[_0x29216e(0x10a)]))[_0x29216e(0x11d)](_0x7d9bb7=>{const _0x20a260=_0x29216e;if(_0x7d9bb7['unsupportedPredicate']||_0x7d9bb7['columns'][_0x20a260(0xfd)]===0x0)return _0x4cd640[_0x20a260(0x104)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x7d9bb7[_0x20a260(0x112)]??_0x20a260(0xf7)}),{'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x126)};const _0x3055a0=resolveTableMetadata(_0x1e390d,_0x7d9bb7[_0x20a260(0xf3)]),_0x5c3de9=(_0x3055a0?.['indexes']??[])[_0x20a260(0x11d)](_0x4a226f=>({'index':_0x4a226f,'matchedPrefix':findEqualityPrefix(_0x4a226f[_0x20a260(0x111)],_0x7d9bb7['columns'])}))['filter'](_0x24a682=>_0x24a682['matchedPrefix'][_0x20a260(0xfd)]>0x0),_0x230d00=_0x5c3de9['reduce']((_0x4dc502,_0x323d80)=>!_0x4dc502||_0x323d80[_0x20a260(0xf4)][_0x20a260(0xfd)]>_0x4dc502[_0x20a260(0xf4)][_0x20a260(0xfd)]?_0x323d80:_0x4dc502,_0x5c3de9[0x0]);if(_0x230d00)return{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x123),'matchedIndex':{..._0x230d00[_0x20a260(0xfc)],'matchedPrefix':_0x230d00[_0x20a260(0xf4)]}};const _0x2b8883=_0x3055a0?.[_0x20a260(0xf9)][_0x20a260(0x129)](_0xfcdc62=>_0xfcdc62['columns'][_0x20a260(0x12d)](_0x18ac08=>_0x7d9bb7[_0x20a260(0x111)][_0x20a260(0x12d)](_0x355cd3=>columnNamesMatch(_0x18ac08,_0x355cd3))))??[];if(_0x2b8883[_0x20a260(0xfd)]>0x0)return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0x109),'table':_0x7d9bb7['table'],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x20a260(0x133)}),{'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x114),'candidateIndexes':_0x2b8883};if(_0x3055a0&&_0x3055a0['metadataAvailable']!==![]&&_0x3055a0[_0x20a260(0xf9)][_0x20a260(0xfd)]>0x0&&_0x7d9bb7[_0x20a260(0x111)][_0x20a260(0xfd)]>0x0)return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0x12b),'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x20a260(0xef)}),{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x114)};return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0xfa),'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7['columns'],'reason':_0x3055a0?_0x20a260(0xf2):_0x20a260(0x103)}),{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x126)};});return{'checked':_0x558ba0[_0x29216e(0xfd)]>0x0,'joins':_0x558ba0,'warnings':_0x4cd640};}function extractJoinFacts(_0x35b29b){const _0x378eec=a259_0x1e48,_0x412979=maskNestedQueries(stripSqlNoise(_0x35b29b)),_0x2f5192=maskQuotedIdentifiers(_0x412979),_0x4aec17=[],_0x195614=new Set(),_0x3d09dc=/\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 _0x3f1781 of _0x412979[_0x378eec(0xec)](_0x3d09dc)){const _0x2ffa36=_0x3f1781[_0x378eec(0xfc)]??0x0,_0x5f5217=_0x3f1781[0x0][_0x378eec(0x10c)](/\bJOIN\b/i),_0x286708=_0x2ffa36+Math[_0x378eec(0x121)](0x0,_0x5f5217);if(!/^JOIN\b/i[_0x378eec(0xf6)](_0x2f5192['slice'](_0x286708)))continue;_0x195614[_0x378eec(0xf0)](_0x286708);const _0x92733c=normalizeIdentifier(_0x3f1781[0x1]||_0x378eec(0x10e)),_0x47429c=normalizeIdentifier(_0x3f1781[0x2]??''),_0x104ae8=normalizeIdentifier(_0x3f1781[0x3]||_0x47429c['split']('.')['at'](-0x1)||_0x47429c),_0x34697e=[],_0xc6ded8=_0x47429c===_0x378eec(0x136);let _0x147a5d=_0x92733c===_0x378eec(0x10f)||_0x92733c===_0x378eec(0xeb)||_0xc6ded8,_0x5ad6e0=_0x147a5d?_0xc6ded8?_0x378eec(0xed):_0x92733c[_0x378eec(0x119)]()+_0x378eec(0x12e):undefined;const _0xeef860=stripOuterParentheses(_0x3f1781[0x4]??''),_0x4194e1=_0xeef860[_0x378eec(0x12c)](MYBATIS_DYNAMIC_START_MARKER)||_0xeef860[_0x378eec(0x12c)](MYBATIS_DYNAMIC_END_MARKER),_0x3c0060=_0xeef860['includes'](MYBATIS_INCLUDE_MARKER);_0x4194e1&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0xf1));_0x3c0060&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x132));const _0x3d94e2=_0xeef860['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x378eec(0x11b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3d94e2,'OR')&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x134));for(const _0x1562d4 of splitTopLevelAnd(_0x3d94e2)){const _0x43357f=stripOuterParentheses(_0x1562d4);if(hasTopLevelKeyword(_0x43357f,'OR')){_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x134);continue;}const _0x485d19=splitEquality(_0x43357f);if(!_0x485d19){containsColumnReference(_0x1562d4,_0x104ae8)&&(_0x147a5d=!![]);continue;}const _0x2e9195=parseDirectColumnReference(_0x485d19[0x0],_0x104ae8),_0x88303=parseDirectColumnReference(_0x485d19[0x1],_0x104ae8),_0x308e11=containsColumnReference(_0x485d19[0x0],_0x104ae8),_0x138090=containsColumnReference(_0x485d19[0x1],_0x104ae8),_0x3588b7=_0x2e9195&&!_0x138090?_0x2e9195:_0x88303&&!_0x308e11?_0x88303:null;if(_0x3588b7&&!_0x34697e[_0x378eec(0x12c)](_0x3588b7))_0x34697e[_0x378eec(0x104)](_0x3588b7);else!_0x3588b7&&containsColumnReference(_0x1562d4,_0x104ae8)&&(_0x147a5d=!![]);}_0x4aec17[_0x378eec(0x104)]({'table':_0x47429c,'alias':_0x104ae8,'columns':_0x34697e,'unsupportedPredicate':_0x147a5d,'unsupportedReason':_0x5ad6e0,'containsUnresolvedInclude':_0x3c0060,'position':_0x286708});}for(const _0x49e1ff of _0x2f5192[_0x378eec(0xec)](/\bJOIN\b/gi)){const _0x254876=_0x49e1ff[_0x378eec(0xfc)]??0x0;if(_0x195614[_0x378eec(0x108)](_0x254876))continue;const _0x4ad92e=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x412979[_0x378eec(0x102)](_0x254876+_0x49e1ff[0x0][_0x378eec(0xfd)])),_0x54ff34=normalizeIdentifier(_0x4ad92e?.[0x1]||_0x378eec(0x11e)),_0xec05fe=normalizeIdentifier(_0x4ad92e?.[0x2]||''),_0x123ee6=isSqlClauseKeyword(_0xec05fe)?_0x54ff34[_0x378eec(0x125)]('.')['at'](-0x1)||_0x54ff34:_0xec05fe||_0x54ff34[_0x378eec(0x125)]('.')['at'](-0x1)||_0x54ff34;_0x4aec17[_0x378eec(0x104)]({'table':_0x54ff34,'alias':_0x123ee6,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x254876});}const _0x20767f=_0x2f5192[_0x378eec(0x115)](MYBATIS_INCLUDE_MARKER);return _0x20767f>=0x0&&!_0x4aec17[_0x378eec(0x12d)](_0x2bb28e=>_0x2bb28e[_0x378eec(0x106)])&&_0x4aec17[_0x378eec(0x104)]({'table':_0x378eec(0x11e),'alias':_0x378eec(0x11e),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x378eec(0x131),'containsUnresolvedInclude':!![],'position':_0x20767f}),_0x4aec17['sort']((_0x42bdba,_0xdcdba6)=>_0x42bdba[_0x378eec(0x11c)]-_0xdcdba6[_0x378eec(0x11c)]);}function a259_0x1e48(_0x2471fe,_0x6636fc){_0x2471fe=_0x2471fe-0xea;const _0x5caa56=a259_0x5caa();let _0x1e4815=_0x5caa56[_0x2471fe];return _0x1e4815;}function stripSqlNoise(_0x51e47f){const _0x1eabdf=a259_0x1e48,_0x43a383=Array[_0x1eabdf(0x135)](_0x51e47f),_0x2dea8a=(_0x459e11,_0x4e483b)=>{for(let _0x6deb0d=_0x459e11;_0x6deb0d<_0x4e483b;_0x6deb0d+=0x1){_0x43a383[_0x6deb0d]!=='\x0a'&&_0x43a383[_0x6deb0d]!=='\x0d'&&(_0x43a383[_0x6deb0d]='\x20');}};for(let _0x44b55e=0x0;_0x44b55e<_0x43a383[_0x1eabdf(0xfd)];_0x44b55e+=0x1){const _0x55292e=_0x43a383[_0x44b55e],_0x294872=_0x43a383[_0x44b55e+0x1];if(_0x55292e==='\x27'||_0x55292e==='\x22'||_0x55292e==='`'){const _0x12efb1=_0x55292e,_0x45c561=_0x44b55e;_0x44b55e+=0x1;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]){if(_0x43a383[_0x44b55e]==='\x5c'&&_0x44b55e+0x1<_0x43a383[_0x1eabdf(0xfd)]){_0x44b55e+=0x2;continue;}if(_0x43a383[_0x44b55e]!==_0x12efb1){_0x44b55e+=0x1;continue;}if(_0x43a383[_0x44b55e+0x1]===_0x12efb1){_0x44b55e+=0x2;continue;}break;}if(_0x12efb1==='\x27')_0x2dea8a(_0x45c561,Math['min'](_0x44b55e+0x1,_0x43a383['length']));continue;}if(_0x55292e==='-'&&_0x294872==='-'){const _0x3d3e42=_0x44b55e;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='\x0a')_0x44b55e+=0x1;_0x2dea8a(_0x3d3e42,_0x44b55e);continue;}if(_0x55292e==='/'&&_0x294872==='*'){const _0x533771=_0x44b55e;_0x44b55e+=0x2;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&!(_0x43a383[_0x44b55e]==='*'&&_0x43a383[_0x44b55e+0x1]==='/')){_0x44b55e+=0x1;}_0x44b55e=Math[_0x1eabdf(0x12f)](_0x44b55e+0x1,_0x43a383[_0x1eabdf(0xfd)]-0x1),_0x2dea8a(_0x533771,_0x44b55e+0x1);continue;}if(_0x55292e==='#'&&_0x294872!=='{'){const _0xa03199=_0x44b55e;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='\x0a')_0x44b55e+=0x1;_0x2dea8a(_0xa03199,_0x44b55e);continue;}if((_0x55292e==='#'||_0x55292e==='$')&&_0x294872==='{'){const _0x5e1750=_0x44b55e;_0x44b55e+=0x2;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='}')_0x44b55e+=0x1;_0x2dea8a(_0x5e1750,Math[_0x1eabdf(0x12f)](_0x44b55e+0x1,_0x43a383[_0x1eabdf(0xfd)]));}}return _0x43a383[_0x1eabdf(0xfb)]('');}function maskQuotedIdentifiers(_0x2d1349){const _0x320195=a259_0x1e48,_0x3a67fc=Array[_0x320195(0x135)](_0x2d1349);for(let _0x5cc49c=0x0;_0x5cc49c<_0x3a67fc[_0x320195(0xfd)];_0x5cc49c+=0x1){const _0x370491=_0x3a67fc[_0x5cc49c];if(_0x370491!=='\x22'&&_0x370491!=='`')continue;_0x5cc49c+=0x1;while(_0x5cc49c<_0x3a67fc[_0x320195(0xfd)]){if(_0x3a67fc[_0x5cc49c]===_0x370491){if(_0x3a67fc[_0x5cc49c+0x1]===_0x370491){_0x3a67fc[_0x5cc49c]='\x20',_0x3a67fc[_0x5cc49c+0x1]='\x20',_0x5cc49c+=0x2;continue;}break;}_0x3a67fc[_0x5cc49c]='\x20',_0x5cc49c+=0x1;}}return _0x3a67fc[_0x320195(0xfb)]('');}function maskNestedQueries(_0xb62fc4){const _0x534b39=a259_0x1e48,_0xb90153=Array[_0x534b39(0x135)](_0xb62fc4);for(let _0x2bcaca=0x0;_0x2bcaca<_0xb90153[_0x534b39(0xfd)];_0x2bcaca+=0x1){if(_0xb90153[_0x2bcaca]!=='(')continue;const _0xb1225b=_0xb62fc4[_0x534b39(0x102)](_0x2bcaca+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x534b39(0xf6)](_0xb1225b))continue;let _0x33b36f=0x1,_0x314a6b=_0x2bcaca+0x1;for(;_0x314a6b<_0xb90153['length']&&_0x33b36f>0x0;_0x314a6b+=0x1){if(_0xb90153[_0x314a6b]==='(')_0x33b36f+=0x1;if(_0xb90153[_0x314a6b]===')')_0x33b36f-=0x1;}if(_0x33b36f!==0x0)continue;for(let _0x49f619=_0x2bcaca;_0x49f619<_0x314a6b;_0x49f619+=0x1){_0xb90153[_0x49f619]='\x20';}const _0x5b84ac=_0x534b39(0x136);for(let _0x4483d0=0x0;_0x4483d0<_0x5b84ac['length']&&_0x2bcaca+_0x4483d0<_0x314a6b;_0x4483d0+=0x1){_0xb90153[_0x2bcaca+_0x4483d0]=_0x5b84ac[_0x4483d0];}_0x2bcaca=_0x314a6b-0x1;}return _0xb90153['join']('');}function splitTopLevelAnd(_0x21d8ef){const _0x1dfeb5=a259_0x1e48,_0x20104b=[];let _0x1500e1=0x0,_0x3b6fe2=0x0;for(let _0x5ab60c=0x0;_0x5ab60c<_0x21d8ef[_0x1dfeb5(0xfd)];_0x5ab60c+=0x1){const _0x1b016c=_0x21d8ef[_0x5ab60c];if(_0x1b016c==='(')_0x1500e1+=0x1;if(_0x1b016c===')')_0x1500e1=Math[_0x1dfeb5(0x121)](0x0,_0x1500e1-0x1);_0x1500e1===0x0&&_0x21d8ef[_0x1dfeb5(0x102)](_0x5ab60c)[_0x1dfeb5(0x116)](/^AND\b/i)&&(_0x5ab60c===0x0||/\s/[_0x1dfeb5(0xf6)](_0x21d8ef[_0x5ab60c-0x1]??''))&&(_0x20104b[_0x1dfeb5(0x104)](_0x21d8ef[_0x1dfeb5(0x102)](_0x3b6fe2,_0x5ab60c)[_0x1dfeb5(0x100)]()),_0x5ab60c+=0x2,_0x3b6fe2=_0x5ab60c+0x1);}const _0x5a247e=_0x21d8ef[_0x1dfeb5(0x102)](_0x3b6fe2)[_0x1dfeb5(0x100)]();if(_0x5a247e)_0x20104b[_0x1dfeb5(0x104)](_0x5a247e);return _0x20104b;}function hasTopLevelKeyword(_0x3927b9,_0x4492e3){const _0xbafcd3=a259_0x1e48;let _0x114ac5=0x0;for(let _0x504718=0x0;_0x504718<_0x3927b9['length'];_0x504718+=0x1){const _0x4d934c=_0x3927b9[_0x504718];if(_0x4d934c==='(')_0x114ac5+=0x1;if(_0x4d934c===')')_0x114ac5=Math['max'](0x0,_0x114ac5-0x1);if(_0x114ac5!==0x0)continue;const _0x38ae8f=_0x3927b9['slice'](_0x504718,_0x504718+_0x4492e3['length']),_0x15d142=_0x3927b9[_0x504718-0x1]??'\x20',_0x1bc0e1=_0x3927b9[_0x504718+_0x4492e3[_0xbafcd3(0xfd)]]??'\x20';if(_0x38ae8f['toUpperCase']()===_0x4492e3['toUpperCase']()&&!/[\w$]/['test'](_0x15d142)&&!/[\w$]/[_0xbafcd3(0xf6)](_0x1bc0e1))return!![];}return![];}function splitEquality(_0xce940e){const _0x2fbb88=a259_0x1e48,_0x494859=stripOuterParentheses(_0xce940e);let _0x5a726a=0x0,_0x1f12dd;for(let _0xa38059=0x0;_0xa38059<_0x494859[_0x2fbb88(0xfd)];_0xa38059+=0x1){const _0x42a6d7=_0x494859[_0xa38059];if(_0x42a6d7==='(')_0x5a726a+=0x1;if(_0x42a6d7===')')_0x5a726a=Math['max'](0x0,_0x5a726a-0x1);const _0x4c9c92=_0x494859[_0xa38059-0x1]??'',_0x80aedc=_0x494859[_0xa38059+0x1]??'';if(_0x42a6d7==='='&&_0x5a726a===0x0&&!/[!<>=:]/[_0x2fbb88(0xf6)](_0x4c9c92)&&_0x80aedc!=='='){if(_0x1f12dd!==undefined)return null;_0x1f12dd=_0xa38059;}}return _0x1f12dd===undefined?null:[_0x494859[_0x2fbb88(0x102)](0x0,_0x1f12dd)[_0x2fbb88(0x100)](),_0x494859[_0x2fbb88(0x102)](_0x1f12dd+0x1)[_0x2fbb88(0x100)]()];}function parseDirectColumnReference(_0x15cf57,_0x48b6d0){const _0x495a0a=a259_0x1e48,_0x2bcc4f=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x495a0a(0x11f)](stripOuterParentheses(_0x15cf57));if(!_0x2bcc4f)return null;if(normalizeIdentifier(_0x2bcc4f[0x1]??'')!==normalizeIdentifier(_0x48b6d0))return null;return normalizeIdentifier(_0x2bcc4f[0x2]??'');}function a259_0x5caa(){const _0x5af95c=['1AJaONB','slice','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','push','alias','containsUnresolvedInclude','(?:^|[^\x5cw$])','has','JOIN_INDEX_NOT_USABLE','sql','26559SdJHKI','search','where','INNER','right','cross','columns','unsupportedReason','using','warning','indexOf','match','830efskbl','465346VuGyVD','toUpperCase','2009130uvJifL','replaceAll','position','map','unknown','exec','toLowerCase','max','left','covered','68bfNymA','split','unavailable','natural','tableName','filter','6430237GMAoSK','JOIN_INDEX_MISSING','includes','some','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','min','14bSyEIq','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','from','__sq__','141438ksqZHr','4323216vyNaZH','startsWith','full','matchAll','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','replace','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','add','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','table','matchedPrefix','endsWith','test','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','874975iqZAZJ','indexes','INDEX_METADATA_UNAVAILABLE','join','index','length','\x5cs*\x5c.\x5cs*[\x5cw$]+','error','trim'];a259_0x5caa=function(){return _0x5af95c;};return a259_0x5caa();}function containsColumnReference(_0x19ddd0,_0x45f269){const _0x13dbdd=a259_0x1e48,_0x5415cf=_0x19ddd0[_0x13dbdd(0xee)](/[`"]/g,''),_0x34cbe2=_0x45f269[_0x13dbdd(0xee)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x13dbdd(0x107)+_0x34cbe2+_0x13dbdd(0xfe),'i')[_0x13dbdd(0xf6)](_0x5415cf);}function findEqualityPrefix(_0x1ae108,_0x18b2c5){const _0x17baad=a259_0x1e48,_0x31e1e4=new Set(_0x18b2c5[_0x17baad(0x11d)](normalizeIdentifier)),_0xabb20d=[];for(const _0x13574c of _0x1ae108){if(!_0x31e1e4['has'](normalizeIdentifier(_0x13574c)))break;_0xabb20d['push'](_0x13574c);}return _0xabb20d;}function resolveTableMetadata(_0x2ed4ab,_0x2f6dbf){const _0x4b240a=a259_0x1e48,_0x39cb41=normalizeIdentifier(_0x2f6dbf),_0x408f02=_0x2ed4ab[_0x4b240a(0x129)](_0x972bde=>normalizeIdentifier(_0x972bde[_0x4b240a(0x128)])===_0x39cb41);if(_0x408f02[_0x4b240a(0xfd)]===0x1)return _0x408f02[0x0];const _0x47908d=_0x39cb41[_0x4b240a(0x12c)]('.'),_0x1fb51a=_0x39cb41['split']('.')['at'](-0x1),_0x39bbc4=_0x2ed4ab[_0x4b240a(0x129)](_0x39c7e1=>{const _0x4dc33d=_0x4b240a,_0x404acf=normalizeIdentifier(_0x39c7e1['tableName']);if(_0x47908d&&_0x404acf[_0x4dc33d(0x12c)]('.'))return![];return _0x404acf['split']('.')['at'](-0x1)===_0x1fb51a;});return _0x39bbc4[_0x4b240a(0xfd)]===0x1?_0x39bbc4[0x0]:undefined;}function columnNamesMatch(_0x35e7c9,_0x1c9f4b){return normalizeIdentifier(_0x35e7c9)===normalizeIdentifier(_0x1c9f4b);}function normalizeIdentifier(_0xf828f1){const _0xa848c1=a259_0x1e48;return _0xf828f1[_0xa848c1(0xee)](/[`"]/g,'')['trim']()[_0xa848c1(0x120)]();}function isSqlClauseKeyword(_0x1e77b8){const _0x108dee=a259_0x1e48;return new Set(['on',_0x108dee(0x113),_0x108dee(0x10d),_0x108dee(0xfb),'inner',_0x108dee(0x122),_0x108dee(0x10f),_0x108dee(0xeb),_0x108dee(0x110),_0x108dee(0x127)])[_0x108dee(0x108)](_0x1e77b8);}function stripOuterParentheses(_0xe949c1){const _0x1d874e=a259_0x1e48;let _0xf98686=_0xe949c1[_0x1d874e(0x100)]();while(_0xf98686[_0x1d874e(0xea)]('(')&&_0xf98686[_0x1d874e(0xf5)](')')){let _0x8f180b=0x0,_0x4a35ae=!![];for(let _0x5282d1=0x0;_0x5282d1<_0xf98686[_0x1d874e(0xfd)];_0x5282d1+=0x1){if(_0xf98686[_0x5282d1]==='(')_0x8f180b+=0x1;if(_0xf98686[_0x5282d1]===')')_0x8f180b-=0x1;if(_0x8f180b===0x0&&_0x5282d1<_0xf98686['length']-0x1){_0x4a35ae=![];break;}}if(!_0x4a35ae||_0x8f180b!==0x0)break;_0xf98686=_0xf98686[_0x1d874e(0x102)](0x1,-0x1)[_0x1d874e(0x100)]();}return _0xf98686;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a260_0x163a26=a260_0x5cad;function a260_0x2e8a(){const _0x371a70=['6284nAiZWD','54xSSsKV','sql-trash','12727VYejFF','sql.lock.json','/sql','903BVbgEG','.rabetbase','662UWNwlt','84cmtfpY','535384lhkhgA','80460GRaiYt','10709244LvRAvs','2810ZTRTKC','2086400CjGJWA','1499oUlQDP'];a260_0x2e8a=function(){return _0x371a70;};return a260_0x2e8a();}(function(_0x4208af,_0x4c2603){const _0x26d2eb=a260_0x5cad,_0x4f343a=_0x4208af();while(!![]){try{const _0x29f767=parseInt(_0x26d2eb(0x9c))/0x1*(parseInt(_0x26d2eb(0x95))/0x2)+-parseInt(_0x26d2eb(0x93))/0x3*(-parseInt(_0x26d2eb(0x9d))/0x4)+parseInt(_0x26d2eb(0x9b))/0x5+parseInt(_0x26d2eb(0x98))/0x6*(-parseInt(_0x26d2eb(0x96))/0x7)+-parseInt(_0x26d2eb(0x97))/0x8*(parseInt(_0x26d2eb(0x9e))/0x9)+-parseInt(_0x26d2eb(0x9a))/0xa*(-parseInt(_0x26d2eb(0x90))/0xb)+-parseInt(_0x26d2eb(0x99))/0xc;if(_0x29f767===_0x4c2603)break;else _0x4f343a['push'](_0x4f343a['shift']());}catch(_0x31c06a){_0x4f343a['push'](_0x4f343a['shift']());}}}(a260_0x2e8a,0x3ea1e));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a260_0x5cad(_0x2817f6,_0x5ca7bd){_0x2817f6=_0x2817f6-0x8f;const _0x2e8ae=a260_0x2e8a();let _0x5cad2c=_0x2e8ae[_0x2817f6];return _0x5cad2c;}const DOT_DIR=a260_0x163a26(0x94),LOCK_FILE_NAME=a260_0x163a26(0x91),TRASH_DIR_NAME=a260_0x163a26(0x8f);export function loadSqlProjectConfig(_0x5ae87c,_0x4c9af4){const _0x2612b4=a260_0x163a26,_0x30f807=resolve(_0x4c9af4??findProjectRootDirectory()),_0x58b8af=DOT_DIR+_0x2612b4(0x92),_0x4a28bb=_0x58b8af+'/'+_0x5ae87c;return{'projectRoot':_0x30f807,'appCode':_0x5ae87c,'sqlWorkspaceRoot':_0x58b8af,'sqlRoot':_0x4a28bb,'sqlRootDir':resolve(_0x30f807,DOT_DIR,'sql',_0x5ae87c),'lockFilePath':resolve(_0x30f807,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x30f807,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b9305,_0x1be779){const _0x131b3f=a261_0x1390,_0x43b3de=_0x1b9305();while(!![]){try{const _0x258acf=parseInt(_0x131b3f(0xb6))/0x1+parseInt(_0x131b3f(0xb7))/0x2+-parseInt(_0x131b3f(0xa1))/0x3+parseInt(_0x131b3f(0xbc))/0x4+-parseInt(_0x131b3f(0xaa))/0x5*(parseInt(_0x131b3f(0xbb))/0x6)+-parseInt(_0x131b3f(0xb8))/0x7+parseInt(_0x131b3f(0xad))/0x8*(-parseInt(_0x131b3f(0xbd))/0x9);if(_0x258acf===_0x1be779)break;else _0x43b3de['push'](_0x43b3de['shift']());}catch(_0x599edc){_0x43b3de['push'](_0x43b3de['shift']());}}}(a261_0x1bd5,0x5c5f6));import{readdir,stat}from'node:fs/promises';function a261_0x1bd5(){const _0x2ccf36=['1012713bLokQR','test','code','mybatisXml','mode','length','dbName','push','split','183530WjdWjL','toLowerCase','name','25832RIUgQE','dbId','isDirectory','sqlName','isFile','indexOf','.sql','sqlCode','filter','583688jrOcDj','214718RskFfN','1696996RUxOds','sqlRootDir','slice','6NPbarI','2559328XeFdMd','936EHCqaP','sql'];a261_0x1bd5=function(){return _0x2ccf36;};return a261_0x1bd5();}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x1778fa){const _0x5e7370=a261_0x1390;if(_0x1778fa===_0x5e7370(0xb3))return _0x5e7370(0xbe);if(_0x1778fa==='.xml')return _0x5e7370(0xa4);return undefined;}async function scanSqlFilesRecursively(_0x5b544c,_0x1d521c){const _0x1cd9e2=a261_0x1390,_0x1a2575=[];try{const _0x5a1df9=await readdir(_0x5b544c,{'withFileTypes':!![]});for(const _0x3ee84c of _0x5a1df9){const _0x212702=join(_0x5b544c,_0x3ee84c[_0x1cd9e2(0xac)]);if(_0x3ee84c[_0x1cd9e2(0xaf)]()){_0x1a2575[_0x1cd9e2(0xa8)](...await scanSqlFilesRecursively(_0x212702,_0x1d521c));continue;}if(!_0x3ee84c[_0x1cd9e2(0xb1)]())continue;const _0x132a0c=extname(_0x3ee84c[_0x1cd9e2(0xac)])[_0x1cd9e2(0xab)](),_0x4f6a3c=extensionToMode(_0x132a0c);if(!_0x4f6a3c)continue;const _0x250c0e=relative(_0x1d521c,_0x212702)['replace'](/\\/g,'/'),_0x2036e3=_0x250c0e[_0x1cd9e2(0xa9)]('/')[_0x1cd9e2(0xb5)](Boolean),_0x4c5125=parseSqlPath(_0x2036e3,_0x3ee84c[_0x1cd9e2(0xac)],_0x132a0c);if(!_0x4c5125)continue;_0x1a2575['push']({'sqlCode':_0x4c5125[_0x1cd9e2(0xb4)],'sqlName':_0x4c5125[_0x1cd9e2(0xb0)],'dbDirectory':_0x2036e3[0x0],'filePath':_0x212702,'relativePath':_0x250c0e,'lockKey':_0x4c5125[_0x1cd9e2(0xb4)],'mode':_0x4f6a3c});}}catch(_0x1b40c7){if(_0x1b40c7[_0x1cd9e2(0xa3)]!=='ENOENT')throw _0x1b40c7;}return _0x1a2575;}function a261_0x1390(_0x56f97c,_0x13e3f4){_0x56f97c=_0x56f97c-0xa1;const _0x1bd5e8=a261_0x1bd5();let _0x139039=_0x1bd5e8[_0x56f97c];return _0x139039;}export async function scanLocalSqlQueries(_0x49560a){const _0xbea759=a261_0x1390;return scanSqlFilesRecursively(_0x49560a[_0xbea759(0xb9)],_0x49560a[_0xbea759(0xb9)]);}export function resolveLocalSqlFilePath(_0x1d802c,_0x25a029,_0x4dec36){const _0x2c3bc9=a261_0x1390,_0x99c495=_0x4dec36?.['path']||(_0x4dec36?.[_0x2c3bc9(0xb0)]||_0x4dec36?.[_0x2c3bc9(0xa7)]?buildSqlRelativePath(_0x25a029,_0x4dec36?.[_0x2c3bc9(0xb0)],_0x4dec36?.['dbName'],_0x4dec36?.[_0x2c3bc9(0xa5)]||'sql',_0x4dec36?.[_0x2c3bc9(0xae)]):buildDefaultSqlFileName(_0x25a029,_0x4dec36?.[_0x2c3bc9(0xa5)]||_0x2c3bc9(0xbe)));return join(_0x1d802c[_0x2c3bc9(0xb9)],_0x99c495);}export async function directoryExists(_0x3a3632){const _0x8003ee=a261_0x1390;try{const _0x411ab5=await stat(_0x3a3632);return _0x411ab5[_0x8003ee(0xaf)]();}catch{return![];}}function parseSqlPath(_0x3cce23,_0x2dabe6,_0xadf0b7){const _0x12b042=a261_0x1390,_0x5aabbd=_0x2dabe6['slice'](0x0,-_0xadf0b7[_0x12b042(0xa6)]);if(_0x3cce23[_0x12b042(0xa6)]<0x2)return null;const _0x1ac067=_0x5aabbd[_0x12b042(0xb2)]('_');if(_0x1ac067<=0x0||_0x1ac067>=_0x5aabbd[_0x12b042(0xa6)]-0x1)return null;const _0x10724d=_0x5aabbd['slice'](0x0,_0x1ac067);if(!isLikelySqlCode(_0x10724d))return null;return{'sqlCode':_0x10724d,'sqlName':_0x5aabbd[_0x12b042(0xba)](_0x1ac067+0x1)};}function isLikelySqlCode(_0x564b82){const _0x5a7582=a261_0x1390;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x5a7582(0xa2)](_0x564b82);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x20d21d,_0x1c6e2a){const _0xffd812=a262_0xa48f,_0x3e7911=_0x20d21d();while(!![]){try{const _0x7f9f21=parseInt(_0xffd812(0x122))/0x1+-parseInt(_0xffd812(0x11e))/0x2*(parseInt(_0xffd812(0x120))/0x3)+-parseInt(_0xffd812(0x124))/0x4+parseInt(_0xffd812(0x121))/0x5+-parseInt(_0xffd812(0x127))/0x6+parseInt(_0xffd812(0x11f))/0x7+parseInt(_0xffd812(0x125))/0x8;if(_0x7f9f21===_0x1c6e2a)break;else _0x3e7911['push'](_0x3e7911['shift']());}catch(_0x5acafb){_0x3e7911['push'](_0x3e7911['shift']());}}}(a262_0x4fbb,0xc0e0b));import{readFile}from'node:fs/promises';function a262_0xa48f(_0x4c0f7f,_0x18db7e){_0x4c0f7f=_0x4c0f7f-0x11d;const _0x4fbbb5=a262_0x4fbb();let _0xa48f27=_0x4fbbb5[_0x4c0f7f];return _0xa48f27;}import a262_0x84156d from'node:crypto';export function computeSqlContentHash(_0x2c5570){const _0xfe31ae=a262_0xa48f;return a262_0x84156d[_0xfe31ae(0x126)](_0xfe31ae(0x123))[_0xfe31ae(0x11d)](_0x2c5570)['digest']('hex');}function a262_0x4fbb(){const _0x2e8fab=['422352OSybYp','6812130cIzNcm','1504547HrKoBs','md5','2470164CsfkqD','2645832WGBMAz','createHash','9058722bQUUtk','utf8','update','16EZbuQw','5921475FnOyhQ'];a262_0x4fbb=function(){return _0x2e8fab;};return a262_0x4fbb();}export async function computeSqlFileHash(_0x24a2fa){const _0x57744c=a262_0xa48f,_0x3af6dc=await readFile(_0x24a2fa,_0x57744c(0x128));return computeSqlContentHash(_0x3af6dc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xf7440d,_0x19950e){const _0x399c49=a263_0x31f2,_0x493273=_0xf7440d();while(!![]){try{const _0x5de28b=parseInt(_0x399c49(0x180))/0x1*(-parseInt(_0x399c49(0x185))/0x2)+-parseInt(_0x399c49(0x189))/0x3+parseInt(_0x399c49(0x182))/0x4+parseInt(_0x399c49(0x183))/0x5+parseInt(_0x399c49(0x18f))/0x6*(parseInt(_0x399c49(0x186))/0x7)+parseInt(_0x399c49(0x17c))/0x8*(-parseInt(_0x399c49(0x190))/0x9)+-parseInt(_0x399c49(0x17f))/0xa*(-parseInt(_0x399c49(0x187))/0xb);if(_0x5de28b===_0x19950e)break;else _0x493273['push'](_0x493273['shift']());}catch(_0x226d89){_0x493273['push'](_0x493273['shift']());}}}(a263_0x180e,0x76da2));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a263_0x180e(){const _0x5cce45=['2640510BWSPuB','4LOWOlA',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','3617476EOfnJi','231685wDbZHW','ENOENT','164972ukXifK','62524HvPJnK','11GEQIvo','parse','1037049jQBsFq','apps','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','\x22.\x20','sqls','84kHZWyC','199530dLLaPS','sqlRoot','\x22\x20vs\x20lock\x20\x22','lastSync','64LQYGmH','stringify','utf8'];a263_0x180e=function(){return _0x5cce45;};return a263_0x180e();}function a263_0x31f2(_0x5578e6,_0xc1083d){_0x5578e6=_0x5578e6-0x17c;const _0x180ea0=a263_0x180e();let _0x31f22f=_0x180ea0[_0x5578e6];return _0x31f22f;}export function ensureSqlLockScope(_0x8a3e65,_0x16ea13,_0x163d1d,_0x502a96){const _0x4a45cb=a263_0x31f2,_0x375f49=_0x8a3e65??createEmptySqlLock();let _0x59571c=_0x375f49[_0x4a45cb(0x18a)][_0x16ea13];if(!_0x59571c)return _0x59571c={'sqlRoot':_0x163d1d,'lastSync':'','sqls':{}},_0x375f49[_0x4a45cb(0x18a)][_0x16ea13]=_0x59571c,{'lockData':_0x375f49,'appLock':_0x59571c};if(!_0x59571c[_0x4a45cb(0x191)])_0x59571c[_0x4a45cb(0x191)]=_0x163d1d;else{if(_0x59571c['sqlRoot']!==_0x163d1d)throw new Error(_0x502a96+_0x4a45cb(0x181)+_0x163d1d+_0x4a45cb(0x192)+_0x59571c[_0x4a45cb(0x191)]+_0x4a45cb(0x18d)+_0x4a45cb(0x18b));}return!_0x59571c['sqls']&&(_0x59571c[_0x4a45cb(0x18e)]={}),!_0x59571c[_0x4a45cb(0x193)]&&(_0x59571c[_0x4a45cb(0x193)]=''),{'lockData':_0x375f49,'appLock':_0x59571c};}export async function readSqlLockFile(_0x3aaad8){const _0x18e3b2=a263_0x31f2;try{const _0x361f71=await readFile(_0x3aaad8,'utf8');return JSON[_0x18e3b2(0x188)](_0x361f71);}catch(_0x3c168e){if(_0x3c168e['code']===_0x18e3b2(0x184))return null;throw new Error(_0x18e3b2(0x18c)+String(_0x3c168e));}}export async function writeSqlLockFile(_0xcf0803,_0x9f102f){const _0x7e7f62=a263_0x31f2;await mkdir(dirname(_0xcf0803),{'recursive':!![]}),await writeFile(_0xcf0803,JSON[_0x7e7f62(0x17d)](_0x9f102f,null,0x2),_0x7e7f62(0x17e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1d270e,_0x39d1d9){const _0x4e685a=a265_0x4805,_0x443336=_0x1d270e();while(!![]){try{const _0x583736=parseInt(_0x4e685a(0xd1))/0x1*(-parseInt(_0x4e685a(0xca))/0x2)+parseInt(_0x4e685a(0xda))/0x3*(parseInt(_0x4e685a(0xd5))/0x4)+parseInt(_0x4e685a(0xd8))/0x5+parseInt(_0x4e685a(0xd9))/0x6+parseInt(_0x4e685a(0xce))/0x7*(parseInt(_0x4e685a(0xd3))/0x8)+parseInt(_0x4e685a(0xcf))/0x9*(parseInt(_0x4e685a(0xd2))/0xa)+-parseInt(_0x4e685a(0xd6))/0xb;if(_0x583736===_0x39d1d9)break;else _0x443336['push'](_0x443336['shift']());}catch(_0x149c4e){_0x443336['push'](_0x443336['shift']());}}}(a265_0x1362,0x7f0fc));export function detectSqlMode(_0x42f2d0){const _0x5a4347=a265_0x4805,_0x1341f0=_0x42f2d0['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x1341f0))return _0x5a4347(0xdb);return _0x5a4347(0xd7);}function a265_0x4805(_0xd766a2,_0x5f0138){_0xd766a2=_0xd766a2-0xc9;const _0x136223=a265_0x1362();let _0x480535=_0x136223[_0xd766a2];return _0x480535;}export function getSqlFileExtension(_0x5e250a){const _0x32913a=a265_0x4805;return _0x5e250a===_0x32913a(0xdb)?_0x32913a(0xd0):'.sql';}export function buildDefaultSqlFileName(_0x5836e1,_0x417f69){return''+_0x5836e1+getSqlFileExtension(_0x417f69);}export function sanitizeSqlPathSegment(_0x5ffa2b,_0x5c1ba1){const _0x1e7917=a265_0x4805,_0x408574=String(_0x5ffa2b??'')[_0x1e7917(0xc9)](),_0xdc4f46=_0x408574[_0x1e7917(0xcc)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x1e7917(0xcc)](/\s+/g,'-')[_0x1e7917(0xcc)](/-+/g,'-')[_0x1e7917(0xcc)](/^\.+/,'')['replace'](/\.+$/,'')[_0x1e7917(0xcc)](/^-+/,'')[_0x1e7917(0xcc)](/-+$/,'');return _0xdc4f46||_0x5c1ba1;}export function buildDbDirectoryName(_0x3a02fe,_0x45e529){const _0x24f14a=a265_0x4805;return sanitizeSqlPathSegment(_0x3a02fe,_0x45e529!=null?_0x24f14a(0xcb)+_0x45e529:_0x24f14a(0xd4));}export function buildSqlRelativePath(_0x3e726b,_0x2d85fb,_0x16ba42,_0xf8b9a4,_0x177543){const _0x55c437=a265_0x4805,_0x37452c=buildDbDirectoryName(_0x16ba42,_0x177543),_0x2f7733=sanitizeSqlPathSegment(_0x3e726b,_0x55c437(0xcd)),_0x3c096e=sanitizeSqlPathSegment(_0x2d85fb,_0x2f7733);return _0x37452c+'/'+_0x2f7733+'_'+_0x3c096e+getSqlFileExtension(_0xf8b9a4);}function a265_0x1362(){const _0x572cda=['201oTiDOv','mybatisXml','trim','52oNvhab','db-','replace','unknown-sql','35VrQmUv','9VaSZUf','.xml','22453vvrxUB','5775430tovSIo','74080MFZeem','unknown-db','20936voKIfs','17574612IwufOq','sql','4740325WKstOZ','4675968juEAeH'];a265_0x1362=function(){return _0x572cda;};return a265_0x1362();}
|