@lovrabet/rabetbase-cli 2.5.4-beta.1 → 2.5.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.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/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.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/logs.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.d.ts +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/batch-design.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/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.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/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.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/api-architecture-upgrade.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.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.d.ts +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.d.ts +4 -0
- 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.d.ts +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +14 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +1 -0
- 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/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.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/page/lr-smart-jsx.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.d.ts +15 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- 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.d.ts +5 -0
- 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 +2 -2
- package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
- package/skills/rabetbase/guides/sql-mybatis.md +12 -8
- package/skills/rabetbase/references/rabetbase-config.md +6 -4
- package/skills/rabetbase/references/rabetbase-init.md +7 -5
- package/skills/rabetbase/references/rabetbase-kb.md +8 -6
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a282_0x225467=a282_0x5f4b;(function(_0xda442f,_0x5b38fa){const _0x4fc885=a282_0x5f4b,_0x25c661=_0xda442f();while(!![]){try{const _0x17d099=parseInt(_0x4fc885(0x1df))/0x1*(-parseInt(_0x4fc885(0x1cf))/0x2)+parseInt(_0x4fc885(0x1c0))/0x3+-parseInt(_0x4fc885(0x1c1))/0x4*(-parseInt(_0x4fc885(0x1d0))/0x5)+-parseInt(_0x4fc885(0x1b4))/0x6*(parseInt(_0x4fc885(0x1bb))/0x7)+-parseInt(_0x4fc885(0x1ca))/0x8+parseInt(_0x4fc885(0x1ac))/0x9+parseInt(_0x4fc885(0x1c2))/0xa*(parseInt(_0x4fc885(0x1a2))/0xb);if(_0x17d099===_0x5b38fa)break;else _0x25c661['push'](_0x25c661['shift']());}catch(_0x3a4a3e){_0x25c661['push'](_0x25c661['shift']());}}}(a282_0x57e0,0x85226));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';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a282_0x225467(0x1c3);export const INSTANT_API_POLICY_FILE_NAME=a282_0x225467(0x1cc);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x14027d,_0x21eb23,_0x278390){return new CliError(_0x14027d,0x1,_0x21eb23,_0x278390);}export function loadInstantApiPolicyLocalConfig(_0x27af35,_0x465110){assertSafeAppCode(_0x27af35);const _0x5e1f54=resolve(_0x465110??findProjectRootDirectory()),_0x4d9d39=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x27af35+'/'+INSTANT_API_POLICY_FILE_NAME,_0x4e7a9d=resolve(_0x5e1f54,INSTANT_API_POLICY_RELATIVE_ROOT,_0x27af35),_0x32e247=resolve(_0x4e7a9d,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5e1f54,'appCode':_0x27af35,'policyRoot':_0x4e7a9d,'policyFilePath':_0x32e247,'policyRelativePath':_0x4d9d39};}export function createDefaultInstantApiPolicyConfig(_0x5f5652,_0x27becb='allow'){return assertSafeAppCode(_0x5f5652),{'version':'2','appCode':_0x5f5652,'defaults':{'instantApi':_0x27becb},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x296d8d){const _0x2d2cb7=a282_0x225467;let _0x10d40b;try{_0x10d40b=await stat(_0x296d8d[_0x2d2cb7(0x1c8)]);}catch(_0x966322){throw instantApiPolicyError('instant_api_policy_file_missing',_0x2d2cb7(0x1b1)+_0x296d8d[_0x2d2cb7(0x1c8)],_0x2d2cb7(0x1b9));}if(!_0x10d40b[_0x2d2cb7(0x1b8)]())throw instantApiPolicyError(_0x2d2cb7(0x1bc),'Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x296d8d[_0x2d2cb7(0x1c8)]);if(_0x10d40b[_0x2d2cb7(0x1dd)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2d2cb7(0x1e0),_0x2d2cb7(0x1e1));let _0x233536;try{_0x233536=await readFile(_0x296d8d[_0x2d2cb7(0x1c8)]);}catch{throw instantApiPolicyError('instant_api_policy_file_unreadable','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x296d8d[_0x2d2cb7(0x1c8)]);}if(_0x233536[_0x2d2cb7(0x1d1)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2d2cb7(0x1e1));let _0x41bb88;try{_0x41bb88=new TextDecoder(_0x2d2cb7(0x1a8),{'fatal':!![],'ignoreBOM':!![]})[_0x2d2cb7(0x1bd)](_0x233536);}catch{throw instantApiPolicyError(_0x2d2cb7(0x1bc),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x296d8d[_0x2d2cb7(0x1c8)]);}let _0x192520;try{_0x192520=JSON[_0x2d2cb7(0x1ae)](_0x41bb88);}catch{throw instantApiPolicyError(_0x2d2cb7(0x1ce),_0x2d2cb7(0x1d7)+_0x296d8d[_0x2d2cb7(0x1c8)]);}return assertLocalPolicyContract(_0x192520,_0x296d8d[_0x2d2cb7(0x1ba)]);}export async function writeInstantApiPolicyConfigFile(_0x4eacc8,_0x25eb85,_0x4e6ce7={}){const _0x193f29=a282_0x225467,_0x450f3a=assertLocalPolicyContract(_0x25eb85,_0x4eacc8[_0x193f29(0x1ba)]),_0x179cad=JSON[_0x193f29(0x1ad)](_0x450f3a,null,0x2)+'\x0a';if(Buffer[_0x193f29(0x1d1)](_0x179cad,_0x193f29(0x1c4))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x4eacc8[_0x193f29(0x1c5)],{'recursive':!![]});let _0x37e3b2;try{_0x37e3b2=await readFile(_0x4eacc8['policyFilePath'],'utf8');}catch(_0xafb6c3){if(!isMissingFile(_0xafb6c3))throw instantApiPolicyError(_0x193f29(0x1e2),_0x193f29(0x1b0)+_0x4eacc8['policyFilePath']);}if(_0x37e3b2===_0x179cad)return{'action':_0x193f29(0x1cb),'filePath':_0x4eacc8[_0x193f29(0x1c8)]};if(_0x37e3b2!==undefined&&!_0x4e6ce7[_0x193f29(0x1d4)])throw instantApiPolicyError(_0x193f29(0x1cd),_0x193f29(0x1d3)+_0x4eacc8[_0x193f29(0x1c8)],_0x193f29(0x1b2));if(_0x37e3b2===undefined)try{return await writeFile(_0x4eacc8[_0x193f29(0x1c8)],_0x179cad,{'encoding':'utf8','flag':'wx'}),{'action':_0x193f29(0x1da),'filePath':_0x4eacc8[_0x193f29(0x1c8)]};}catch(_0x4dea87){if(!isAlreadyExists(_0x4dea87))throw instantApiPolicyError(_0x193f29(0x1e3),_0x193f29(0x1bf)+_0x4eacc8[_0x193f29(0x1c8)]);if(!_0x4e6ce7[_0x193f29(0x1d4)])throw instantApiPolicyError('instant_api_policy_file_exists','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20'+_0x4eacc8[_0x193f29(0x1c8)],'Review\x20the\x20file\x20before\x20retrying.');}const _0xe15054=resolve(dirname(_0x4eacc8['policyFilePath']),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x193f29(0x1c6)]+'.'+randomUUID()+_0x193f29(0x1a5));try{await writeFile(_0xe15054,_0x179cad,{'encoding':_0x193f29(0x1c4),'flag':'wx'}),await rename(_0xe15054,_0x4eacc8[_0x193f29(0x1c8)]);}catch{await unlink(_0xe15054)['catch'](()=>undefined);throw instantApiPolicyError(_0x193f29(0x1e3),_0x193f29(0x1ab)+_0x4eacc8[_0x193f29(0x1c8)]);}return{'action':_0x193f29(0x1a7),'filePath':_0x4eacc8['policyFilePath']};}function assertSafeAppCode(_0x24bc20){const _0x346522=a282_0x225467,_0x455fbb=_0x24bc20['trim']();if(!_0x455fbb||_0x455fbb!==_0x24bc20||_0x455fbb['length']>0x64||_0x455fbb==='.'||_0x455fbb==='..'||_0x455fbb['includes']('/')||_0x455fbb[_0x346522(0x1a3)]('\x5c')||_0x455fbb[_0x346522(0x1a3)]('\x00'))throw instantApiPolicyError(_0x346522(0x1a4),_0x346522(0x1b3));}function assertLocalPolicyContract(_0x3e874d,_0x503ac2){const _0x2a3291=a282_0x225467;if(!isObject(_0x3e874d))throw instantApiPolicyError(_0x2a3291(0x1ce),_0x2a3291(0x1c7));if(_0x3e874d[_0x2a3291(0x1de)]!=='1'&&_0x3e874d[_0x2a3291(0x1de)]!=='2')throw instantApiPolicyError(_0x2a3291(0x1d9),_0x2a3291(0x1af),_0x2a3291(0x1d8));if(_0x3e874d['appCode']!==_0x503ac2)throw instantApiPolicyError(_0x2a3291(0x1be),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x503ac2+'.');if(!isObject(_0x3e874d[_0x2a3291(0x1b6)])||typeof _0x3e874d[_0x2a3291(0x1b6)][_0x2a3291(0x1aa)]!==_0x2a3291(0x1b5))throw instantApiPolicyError(_0x2a3291(0x1c9),_0x2a3291(0x1d2));if(_0x3e874d[_0x2a3291(0x1a6)]!==undefined&&_0x3e874d[_0x2a3291(0x1a6)]!==null&&!Array[_0x2a3291(0x1a9)](_0x3e874d[_0x2a3291(0x1a6)]))throw instantApiPolicyError(_0x2a3291(0x1d6),_0x2a3291(0x1dc));return _0x3e874d;}function isObject(_0x39bfef){const _0x30109c=a282_0x225467;return _0x39bfef!==null&&typeof _0x39bfef===_0x30109c(0x1db)&&!Array['isArray'](_0x39bfef);}function isMissingFile(_0x8606aa){const _0x30978e=a282_0x225467;return Boolean(_0x8606aa&&typeof _0x8606aa===_0x30978e(0x1db)&&_0x8606aa['code']===_0x30978e(0x1b7));}function isAlreadyExists(_0x50ca0d){const _0x18548d=a282_0x225467;return Boolean(_0x50ca0d&&typeof _0x50ca0d==='object'&&_0x50ca0d['code']===_0x18548d(0x1d5));}function a282_0x5f4b(_0x5c50f2,_0x2965bc){_0x5c50f2=_0x5c50f2-0x1a2;const _0x57e052=a282_0x57e0();let _0x5f4bb5=_0x57e052[_0x5c50f2];return _0x5f4bb5;}function a282_0x57e0(){const _0x1d30a0=['Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','size','version','1ixgxJx','instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_unreadable','instant_api_policy_file_unwritable','22WySNbO','includes','instant_api_policy_app_code_invalid','.tmp','rules','overwritten','utf-8','isArray','instantApi','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','1063845Bitafk','stringify','parse','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','6uCuTpl','string','defaults','ENOENT','isFile','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','appCode','5468449ZgRohw','instant_api_policy_file_invalid','decode','instant_api_policy_app_code_mismatch','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','1531314vJaflg','176EQKfdi','6252350JFPpHw','.rabetbase/instant-api-policy','utf8','policyRoot','pid','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','policyFilePath','instant_api_policy_defaults_invalid','3785136CqBqIf','unchanged','policy.json','instant_api_policy_file_exists','instant_api_policy_json_invalid','172532fScUZD','775ZruivH','byteLength','Policy\x20defaults.instantApi\x20is\x20required.','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','force','EEXIST','instant_api_policy_rules_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','instant_api_policy_version_invalid','created','object'];a282_0x57e0=function(){return _0x1d30a0;};return a282_0x57e0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a283_0x6c96f2=a283_0xd8fb;(function(_0x1ab9a9,_0x1b1bcc){const _0x5ba2d1=a283_0xd8fb,_0xc1b94a=_0x1ab9a9();while(!![]){try{const _0x50940e=parseInt(_0x5ba2d1(0x185))/0x1*(-parseInt(_0x5ba2d1(0x190))/0x2)+-parseInt(_0x5ba2d1(0x178))/0x3*(-parseInt(_0x5ba2d1(0x1ac))/0x4)+-parseInt(_0x5ba2d1(0x1c4))/0x5+-parseInt(_0x5ba2d1(0x1b4))/0x6*(parseInt(_0x5ba2d1(0x1a5))/0x7)+-parseInt(_0x5ba2d1(0x191))/0x8*(-parseInt(_0x5ba2d1(0x1a6))/0x9)+parseInt(_0x5ba2d1(0x19a))/0xa*(-parseInt(_0x5ba2d1(0x180))/0xb)+parseInt(_0x5ba2d1(0x187))/0xc;if(_0x50940e===_0x1b1bcc)break;else _0xc1b94a['push'](_0xc1b94a['shift']());}catch(_0x59100d){_0xc1b94a['push'](_0xc1b94a['shift']());}}}(a283_0x303b,0x42aa7));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x6c96f2(0x193),a283_0x6c96f2(0x1bf),a283_0x6c96f2(0x1be),a283_0x6c96f2(0x176),a283_0x6c96f2(0x194),a283_0x6c96f2(0x1b0)],HIT_KEYS=[a283_0x6c96f2(0x1bd),a283_0x6c96f2(0x1b6),a283_0x6c96f2(0x18b),'scope','title',a283_0x6c96f2(0x18c),'tags',a283_0x6c96f2(0x1af),'rawScore',a283_0x6c96f2(0x183),a283_0x6c96f2(0x1b2)];export function normalizeKbServiceOrigin(_0x51e5d3){const _0x2f5900=a283_0x6c96f2,_0xd43841=()=>CliErrors['validation'](_0x2f5900(0x1a7)),_0x36bb66=_0x51e5d3?.[_0x2f5900(0x188)]();if(!_0x36bb66||/[\u0000-\u0020\u007f]/[_0x2f5900(0x1bb)](_0x36bb66)||!/^https:\/\/[^/?#@\\]+\/?$/i['test'](_0x36bb66))throw _0xd43841();let _0x20402d;try{_0x20402d=new URL(_0x36bb66);}catch{throw _0xd43841();}if(_0x20402d[_0x2f5900(0x1b3)]!==_0x2f5900(0x195)||!_0x20402d[_0x2f5900(0x1a1)]||_0x20402d['username']||_0x20402d[_0x2f5900(0x199)]||_0x20402d['pathname']!=='/'||_0x20402d[_0x2f5900(0x196)]||_0x20402d[_0x2f5900(0x1bc)])throw _0xd43841();return _0x20402d[_0x2f5900(0x1a8)];}export async function searchDirectKnowledge(_0x3e5fb9){const _0x1a4b62=a283_0x6c96f2,_0x5d87d6=_0x3e5fb9['appCode'][_0x1a4b62(0x188)](),_0x434a58=_0x3e5fb9[_0x1a4b62(0x198)][_0x1a4b62(0x188)]();if(!_0x5d87d6)throw CliErrors[_0x1a4b62(0x186)](_0x1a4b62(0x17c));if(!_0x3e5fb9[_0x1a4b62(0x1ab)][_0x1a4b62(0x188)]())throw CliErrors[_0x1a4b62(0x197)]();if(!_0x434a58)throw CliErrors[_0x1a4b62(0x186)](_0x1a4b62(0x17a));validateTopK(_0x3e5fb9['topK']);const _0x4a85c3=normalizeKbServiceOrigin(_0x3e5fb9['serviceUrl']),_0xf29e8e=AbortSignal[_0x1a4b62(0x1ae)](0xea60),_0xa98fd3=_0x3e5fb9['signal']?AbortSignal[_0x1a4b62(0x1c1)]([_0x3e5fb9[_0x1a4b62(0x1c6)],_0xf29e8e]):_0xf29e8e;let _0x1a390d;try{_0x1a390d=await fetch(_0x4a85c3+'/v2/development/apps/'+encodeURIComponent(_0x5d87d6)+'/knowledge/search',{'method':_0x1a4b62(0x1b1),'redirect':'error','headers':{'Content-Type':_0x1a4b62(0x182),'Cookie':_0x3e5fb9[_0x1a4b62(0x1ab)],'X-Invoke-Source':_0x1a4b62(0x1aa)},'body':JSON[_0x1a4b62(0x17d)]({'query':_0x434a58,..._0x3e5fb9[_0x1a4b62(0x18a)]!==undefined?{'topK':_0x3e5fb9[_0x1a4b62(0x18a)]}:{}}),'signal':_0xa98fd3});}catch(_0x1a6bf3){if(_0x3e5fb9['signal']?.[_0x1a4b62(0x1a9)])throw new DOMException(_0x1a4b62(0x18e),'AbortError');if(_0x1a6bf3 instanceof Error&&_0x1a6bf3[_0x1a4b62(0x1b9)]===_0x1a4b62(0x1c0))throw CliErrors[_0x1a4b62(0x18d)](_0x1a4b62(0x1ca));throw CliErrors['networkError'](_0x1a4b62(0x1ba));}if(_0x1a390d[_0x1a4b62(0x1b7)]===0x191)throw CliErrors[_0x1a4b62(0x197)]();if(_0x1a390d['status']===0x1ad)throw CliErrors['apiError'](_0x1a4b62(0x1ad));if(!_0x1a390d['ok'])throw CliErrors['apiError'](_0x1a4b62(0x189)+_0x1a390d[_0x1a4b62(0x1b7)]+').');if(!hasNoStore(_0x1a390d[_0x1a4b62(0x173)]))throw CliErrors['apiError'](_0x1a4b62(0x184));if(!(_0x1a390d[_0x1a4b62(0x173)][_0x1a4b62(0x1b5)]('content-type')??'')[_0x1a4b62(0x1a4)]()['includes']('application/json'))throw CliErrors[_0x1a4b62(0x17e)](_0x1a4b62(0x1c2));let _0x47ee2a;try{_0x47ee2a=await _0x1a390d[_0x1a4b62(0x1c8)]();}catch(_0x3e6c37){if(_0x3e5fb9[_0x1a4b62(0x1c6)]?.[_0x1a4b62(0x1a9)])throw new DOMException(_0x1a4b62(0x18e),_0x1a4b62(0x18f));if(_0xf29e8e[_0x1a4b62(0x1a9)]||_0x3e6c37 instanceof Error&&_0x3e6c37[_0x1a4b62(0x1b9)]===_0x1a4b62(0x1c0))throw CliErrors[_0x1a4b62(0x18d)]('KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.');throw CliErrors[_0x1a4b62(0x17e)](_0x1a4b62(0x1a2));}try{const _0x4dee15=requireExactRecord(_0x47ee2a,[_0x1a4b62(0x176),'strategyFingerprint',_0x1a4b62(0x1b0)],_0x1a4b62(0x19f));if(!Array[_0x1a4b62(0x19d)](_0x4dee15[_0x1a4b62(0x176)]))throw invalidContract(_0x1a4b62(0x176));return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x1a4b62(0x17b),'total':_0x4dee15[_0x1a4b62(0x176)][_0x1a4b62(0x17f)],'hits':_0x4dee15['hits'],'strategyFingerprint':_0x4dee15[_0x1a4b62(0x194)],'timingsMs':_0x4dee15[_0x1a4b62(0x1b0)]},_0x3e5fb9['topK']??0xa);}catch(_0x52ff56){if(_0x52ff56 instanceof CliError)throw CliErrors['apiError'](_0x1a4b62(0x19b));throw _0x52ff56;}}function validateTopK(_0x26f984){const _0x4ceb36=a283_0x6c96f2;if(_0x26f984!==undefined&&(!Number[_0x4ceb36(0x19e)](_0x26f984)||_0x26f984<0x1||_0x26f984>0x32))throw CliErrors['validation']('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0xfd00bc){const _0x4a5f40=a283_0x6c96f2;return(_0xfd00bc[_0x4a5f40(0x1b5)](_0x4a5f40(0x1a0))??'')[_0x4a5f40(0x174)](',')[_0x4a5f40(0x192)](_0x524724=>_0x524724[_0x4a5f40(0x188)]()[_0x4a5f40(0x1a4)]()==='no-store');}function parseDevelopmentSearchResponse(_0x169839,_0x1ab6f9){const _0x16b767=a283_0x6c96f2,_0x1476db=requireExactRecord(_0x169839,RESPONSE_KEYS,_0x16b767(0x19f));if(_0x1476db['schemaVersion']!==0x2||_0x1476db[_0x16b767(0x1bf)]!==_0x16b767(0x17b))throw invalidContract(_0x16b767(0x1bf));if(!Array[_0x16b767(0x19d)](_0x1476db[_0x16b767(0x176)])||_0x1476db['hits'][_0x16b767(0x17f)]>(_0x1ab6f9??0x32))throw invalidContract(_0x16b767(0x176));if(typeof _0x1476db['strategyFingerprint']!==_0x16b767(0x1c7)||!/^sha256:[0-9a-f]{64}$/[_0x16b767(0x1bb)](_0x1476db[_0x16b767(0x194)]))throw invalidContract(_0x16b767(0x194));const _0x34fcfe=requireRecord(_0x1476db[_0x16b767(0x1b0)],_0x16b767(0x1b0)),_0xc4f88a={};for(const [_0x4cf261,_0x5d570a]of Object[_0x16b767(0x1b8)](_0x34fcfe)){if(!/^[A-Za-z][A-Za-z0-9]*$/['test'](_0x4cf261)||typeof _0x5d570a!=='number'||!Number[_0x16b767(0x181)](_0x5d570a)||_0x5d570a<0x0)throw invalidContract(_0x16b767(0x1b0));_0xc4f88a[_0x4cf261]=_0x5d570a;}const _0x5464af=_0x1476db[_0x16b767(0x176)]['map']((_0xee6dad,_0x33f757)=>parseHit(_0xee6dad,_0x33f757));if(!Number[_0x16b767(0x19e)](_0x1476db[_0x16b767(0x1be)])||_0x1476db[_0x16b767(0x1be)]!==_0x5464af[_0x16b767(0x17f)])throw invalidContract('total');return{'schemaVersion':_0x1476db[_0x16b767(0x193)],'profile':_0x1476db[_0x16b767(0x1bf)],'total':_0x1476db[_0x16b767(0x1be)],'strategyFingerprint':_0x1476db[_0x16b767(0x194)],'timingsMs':_0xc4f88a,'hits':_0x5464af};}function a283_0x303b(){const _0x10b705=['string','json','\x20contract.','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','headers','split','tags','hits','object','45ncgtAU','company','Knowledge\x20search\x20query\x20is\x20required.','development','Knowledge\x20search\x20appCode\x20is\x20required.','stringify','apiError','length','7403bMwLAF','isFinite','application/json','finalScore','KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','103KwhHll','validation','11044932aytcMT','trim','KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20','topK','chunkId','text','networkError','Knowledge\x20search\x20cancelled.','AbortError','9392OyWJKb','785480LlexTJ','some','schemaVersion','strategyFingerprint','https:','search','authRequired','query','password','2560xcOqdW','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','sort','isArray','isSafeInteger','response','cache-control','hostname','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','rawScore','toLowerCase','3289741lVrmyW','45tNktki','Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','origin','aborted','cli:rabetbase','cookie','79892XQmngX','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','timeout','rank','timingsMs','POST','scoreKind','protocol','6rmkTXA','get','revision','status','entries','name','KB\x20Service\x20knowledge\x20search\x20request\x20failed.','test','hash','documentId','total','profile','TimeoutError','any','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','title','1559645gHnfCT','scope','signal'];a283_0x303b=function(){return _0x10b705;};return a283_0x303b();}function a283_0xd8fb(_0x12c0d0,_0x4bc815){_0x12c0d0=_0x12c0d0-0x173;const _0x303b8f=a283_0x303b();let _0xd8fbaf=_0x303b8f[_0x12c0d0];return _0xd8fbaf;}function parseHit(_0x4dfb57,_0x3af512){const _0x448b53=a283_0x6c96f2,_0x72b179=requireExactRecord(_0x4dfb57,HIT_KEYS,'hits['+_0x3af512+']'),_0x52df2b=_0x1f0390=>{const _0x1e4601=a283_0xd8fb,_0x3a20f3=_0x72b179[_0x1f0390];if(typeof _0x3a20f3!==_0x1e4601(0x1c7)||!_0x3a20f3)throw invalidContract(_0x1f0390);return _0x3a20f3;};if(!Number[_0x448b53(0x19e)](_0x72b179['revision'])||_0x72b179['revision']<0x1)throw invalidContract('revision');if(_0x72b179['scope']!=='public'&&_0x72b179[_0x448b53(0x1c5)]!==_0x448b53(0x179))throw invalidContract(_0x448b53(0x1c5));if(typeof _0x72b179[_0x448b53(0x1c3)]!==_0x448b53(0x1c7)||typeof _0x72b179[_0x448b53(0x18c)]!==_0x448b53(0x1c7))throw invalidContract(_0x448b53(0x18c));if(!Array['isArray'](_0x72b179[_0x448b53(0x175)])||_0x72b179[_0x448b53(0x175)][_0x448b53(0x192)](_0x2a2bfc=>typeof _0x2a2bfc!=='string'))throw invalidContract('tags');if(!Number[_0x448b53(0x19e)](_0x72b179[_0x448b53(0x1af)])||_0x72b179[_0x448b53(0x1af)]!==_0x3af512+0x1)throw invalidContract(_0x448b53(0x1af));if(!isFiniteNumber(_0x72b179[_0x448b53(0x1a3)])||!isFiniteNumber(_0x72b179[_0x448b53(0x183)]))throw invalidContract('score');return{'documentId':_0x52df2b(_0x448b53(0x1bd)),'revision':_0x72b179[_0x448b53(0x1b6)],'chunkId':_0x52df2b(_0x448b53(0x18b)),'scope':_0x72b179[_0x448b53(0x1c5)],'title':_0x72b179['title'],'text':_0x72b179[_0x448b53(0x18c)],'tags':[..._0x72b179[_0x448b53(0x175)]],'rank':_0x72b179[_0x448b53(0x1af)],'rawScore':_0x72b179[_0x448b53(0x1a3)],'finalScore':_0x72b179[_0x448b53(0x183)],'scoreKind':_0x52df2b('scoreKind')};}function requireExactRecord(_0x51dc45,_0x415822,_0x20e1d2){const _0x2ea9d6=a283_0x6c96f2,_0x3884c0=requireRecord(_0x51dc45,_0x20e1d2),_0x2bef60=Object['keys'](_0x3884c0)[_0x2ea9d6(0x19c)](),_0x7c07b7=[..._0x415822]['sort']();if(_0x2bef60[_0x2ea9d6(0x17f)]!==_0x7c07b7['length']||_0x2bef60[_0x2ea9d6(0x192)]((_0x451a0a,_0x3e9f37)=>_0x451a0a!==_0x7c07b7[_0x3e9f37]))throw invalidContract(_0x20e1d2);return _0x3884c0;}function requireRecord(_0x2f8c75,_0x40620c){const _0x47cfc0=a283_0x6c96f2;if(!_0x2f8c75||typeof _0x2f8c75!==_0x47cfc0(0x177)||Array['isArray'](_0x2f8c75))throw invalidContract(_0x40620c);return _0x2f8c75;}function isFiniteNumber(_0x1158c5){const _0x517915=a283_0x6c96f2;return typeof _0x1158c5==='number'&&Number[_0x517915(0x181)](_0x1158c5);}function invalidContract(_0x1acee6){const _0x4baff7=a283_0x6c96f2;return CliErrors['apiError']('SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20'+_0x1acee6+_0x4baff7(0x1c9));}
|
|
1
|
+
const a283_0x2f5a00=a283_0x51f0;(function(_0x3da0e2,_0x5ccd8d){const _0x51009b=a283_0x51f0,_0x26830f=_0x3da0e2();while(!![]){try{const _0x4dc969=parseInt(_0x51009b(0x1cc))/0x1+-parseInt(_0x51009b(0x1a4))/0x2+parseInt(_0x51009b(0x1ca))/0x3*(parseInt(_0x51009b(0x1b9))/0x4)+-parseInt(_0x51009b(0x1d0))/0x5*(-parseInt(_0x51009b(0x18d))/0x6)+parseInt(_0x51009b(0x1aa))/0x7*(-parseInt(_0x51009b(0x1ce))/0x8)+parseInt(_0x51009b(0x1cd))/0x9*(-parseInt(_0x51009b(0x1a2))/0xa)+-parseInt(_0x51009b(0x188))/0xb*(parseInt(_0x51009b(0x1c9))/0xc);if(_0x4dc969===_0x5ccd8d)break;else _0x26830f['push'](_0x26830f['shift']());}catch(_0x228e19){_0x26830f['push'](_0x26830f['shift']());}}}(a283_0x4235,0x9b4af));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x2f5a00(0x1c5),a283_0x2f5a00(0x196),'total','hits',a283_0x2f5a00(0x1d4),'timingsMs'],HIT_KEYS=['documentId',a283_0x2f5a00(0x1bf),'chunkId',a283_0x2f5a00(0x1b4),a283_0x2f5a00(0x1bd),'text',a283_0x2f5a00(0x195),'rank','rawScore',a283_0x2f5a00(0x1c6),a283_0x2f5a00(0x18e)];export function normalizeKbServiceOrigin(_0x17248b){const _0x38efc1=a283_0x2f5a00,_0x58f522=()=>CliErrors[_0x38efc1(0x1d3)]('Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.'),_0x4d845a=_0x17248b?.[_0x38efc1(0x197)]();if(!_0x4d845a||/[\u0000-\u0020\u007f]/[_0x38efc1(0x1be)](_0x4d845a)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x38efc1(0x1be)](_0x4d845a))throw _0x58f522();let _0x2bf1f2;try{_0x2bf1f2=new URL(_0x4d845a);}catch{throw _0x58f522();}if(_0x2bf1f2[_0x38efc1(0x1ac)]!=='https:'||!_0x2bf1f2[_0x38efc1(0x192)]||_0x2bf1f2[_0x38efc1(0x199)]||_0x2bf1f2[_0x38efc1(0x198)]||_0x2bf1f2[_0x38efc1(0x19f)]!=='/'||_0x2bf1f2[_0x38efc1(0x1cf)]||_0x2bf1f2['hash'])throw _0x58f522();return _0x2bf1f2['origin'];}function a283_0x4235(){const _0x318451=['hits','response','company','text','Knowledge\x20search\x20appCode\x20is\x20required.','KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','scope','toLowerCase','name','\x20contract.','serviceUrl','4327436jvWlSc','string','isSafeInteger','apiError','title','test','revision','status','query','application/json','documentId','error','schemaVersion','finalScore','POST','timingsMs','12FpoOQg','3aHUGHR','signal','794385XIbtzZ','63XrQZfa','14704uyKYZw','search','4076210sldxal','object','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','validation','strategyFingerprint','public','TimeoutError','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','number','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','aborted','stringify','isArray','headers','keys','Knowledge\x20search\x20cancelled.','rank','total','map','isFinite','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','length','5602124aHAIGx','entries','rawScore','development','hits[','6BkzQdk','scoreKind','/v2/development/apps/','some','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','hostname','appCode','topK','tags','profile','trim','password','username','score','no-store','any','sort','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','pathname','get','content-type','900130FBLuyI','cookie','644716oQFanO','includes','chunkId','cli:rabetbase','cache-control','AbortError','2261mbAyZV','networkError','protocol','authRequired'];a283_0x4235=function(){return _0x318451;};return a283_0x4235();}export async function searchDirectKnowledge(_0x59abe7){const _0x2855c9=a283_0x2f5a00,_0x5a7818=_0x59abe7[_0x2855c9(0x193)][_0x2855c9(0x197)](),_0x156fdf=_0x59abe7[_0x2855c9(0x1c1)][_0x2855c9(0x197)]();if(!_0x5a7818)throw CliErrors['validation'](_0x2855c9(0x1b2));if(!_0x59abe7[_0x2855c9(0x1a3)][_0x2855c9(0x197)]())throw CliErrors[_0x2855c9(0x1ad)]();if(!_0x156fdf)throw CliErrors[_0x2855c9(0x1d3)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x59abe7['topK']);const _0xbf2a5b=normalizeKbServiceOrigin(_0x59abe7[_0x2855c9(0x1b8)]),_0x13f450=AbortSignal['timeout'](0xea60),_0xe5f1f1=_0x59abe7[_0x2855c9(0x1cb)]?AbortSignal[_0x2855c9(0x19c)]([_0x59abe7[_0x2855c9(0x1cb)],_0x13f450]):_0x13f450;let _0x4bf794;try{_0x4bf794=await fetch(_0xbf2a5b+_0x2855c9(0x18f)+encodeURIComponent(_0x5a7818)+'/knowledge/search',{'method':_0x2855c9(0x1c7),'redirect':_0x2855c9(0x1c4),'headers':{'Content-Type':_0x2855c9(0x1c2),'Cookie':_0x59abe7[_0x2855c9(0x1a3)],'X-Invoke-Source':_0x2855c9(0x1a7)},'body':JSON[_0x2855c9(0x1db)]({'query':_0x156fdf,..._0x59abe7[_0x2855c9(0x194)]!==undefined?{'topK':_0x59abe7[_0x2855c9(0x194)]}:{}}),'signal':_0xe5f1f1});}catch(_0x1842b1){if(_0x59abe7[_0x2855c9(0x1cb)]?.[_0x2855c9(0x1da)])throw new DOMException(_0x2855c9(0x181),'AbortError');if(_0x1842b1 instanceof Error&&_0x1842b1[_0x2855c9(0x1b6)]===_0x2855c9(0x1d6))throw CliErrors[_0x2855c9(0x1ab)](_0x2855c9(0x191));throw CliErrors['networkError']('KB\x20Service\x20knowledge\x20search\x20request\x20failed.');}if(_0x4bf794[_0x2855c9(0x1c0)]===0x191)throw CliErrors[_0x2855c9(0x1ad)]();if(_0x4bf794[_0x2855c9(0x1c0)]===0x1ad)throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x19e));if(!_0x4bf794['ok'])throw CliErrors[_0x2855c9(0x1bc)]('KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20'+_0x4bf794[_0x2855c9(0x1c0)]+').');if(!hasNoStore(_0x4bf794[_0x2855c9(0x17f)]))throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x1b3));if(!(_0x4bf794[_0x2855c9(0x17f)][_0x2855c9(0x1a0)](_0x2855c9(0x1a1))??'')[_0x2855c9(0x1b5)]()[_0x2855c9(0x1a5)](_0x2855c9(0x1c2)))throw CliErrors['apiError']('KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.');let _0xd1d367;try{_0xd1d367=await _0x4bf794['json']();}catch(_0x3437c0){if(_0x59abe7[_0x2855c9(0x1cb)]?.[_0x2855c9(0x1da)])throw new DOMException('Knowledge\x20search\x20cancelled.',_0x2855c9(0x1a9));if(_0x13f450['aborted']||_0x3437c0 instanceof Error&&_0x3437c0['name']===_0x2855c9(0x1d6))throw CliErrors[_0x2855c9(0x1ab)](_0x2855c9(0x191));throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x1d7));}try{const _0xb19465=requireExactRecord(_0xd1d367,[_0x2855c9(0x1ae),_0x2855c9(0x1d4),_0x2855c9(0x1c8)],_0x2855c9(0x1af));if(!Array[_0x2855c9(0x17e)](_0xb19465['hits']))throw invalidContract('hits');return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x2855c9(0x18b),'total':_0xb19465['hits'][_0x2855c9(0x187)],'hits':_0xb19465[_0x2855c9(0x1ae)],'strategyFingerprint':_0xb19465[_0x2855c9(0x1d4)],'timingsMs':_0xb19465[_0x2855c9(0x1c8)]},_0x59abe7[_0x2855c9(0x194)]??0xa);}catch(_0x5b9053){if(_0x5b9053 instanceof CliError)throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x1d2));throw _0x5b9053;}}function validateTopK(_0x4cb33e){const _0x4e030d=a283_0x2f5a00;if(_0x4cb33e!==undefined&&(!Number[_0x4e030d(0x1bb)](_0x4cb33e)||_0x4cb33e<0x1||_0x4cb33e>0x32))throw CliErrors['validation'](_0x4e030d(0x1d9));}function a283_0x51f0(_0x394298,_0x4be45c){_0x394298=_0x394298-0x17e;const _0x423543=a283_0x4235();let _0x51f0d8=_0x423543[_0x394298];return _0x51f0d8;}function hasNoStore(_0x5c8c30){const _0x1a7575=a283_0x2f5a00;return(_0x5c8c30[_0x1a7575(0x1a0)](_0x1a7575(0x1a8))??'')['split'](',')[_0x1a7575(0x190)](_0xb2c5b5=>_0xb2c5b5['trim']()[_0x1a7575(0x1b5)]()===_0x1a7575(0x19b));}function parseDevelopmentSearchResponse(_0x2d6aaf,_0x3b0188){const _0x3a3ddb=a283_0x2f5a00,_0x52a685=requireExactRecord(_0x2d6aaf,RESPONSE_KEYS,_0x3a3ddb(0x1af));if(_0x52a685[_0x3a3ddb(0x1c5)]!==0x2||_0x52a685[_0x3a3ddb(0x196)]!==_0x3a3ddb(0x18b))throw invalidContract(_0x3a3ddb(0x196));if(!Array[_0x3a3ddb(0x17e)](_0x52a685[_0x3a3ddb(0x1ae)])||_0x52a685['hits']['length']>(_0x3b0188??0x32))throw invalidContract(_0x3a3ddb(0x1ae));if(typeof _0x52a685[_0x3a3ddb(0x1d4)]!==_0x3a3ddb(0x1ba)||!/^sha256:[0-9a-f]{64}$/['test'](_0x52a685[_0x3a3ddb(0x1d4)]))throw invalidContract(_0x3a3ddb(0x1d4));const _0x5280ac=requireRecord(_0x52a685[_0x3a3ddb(0x1c8)],_0x3a3ddb(0x1c8)),_0x2f7ab8={};for(const [_0x413d41,_0x99567b]of Object[_0x3a3ddb(0x189)](_0x5280ac)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x3a3ddb(0x1be)](_0x413d41)||typeof _0x99567b!==_0x3a3ddb(0x1d8)||!Number[_0x3a3ddb(0x185)](_0x99567b)||_0x99567b<0x0)throw invalidContract(_0x3a3ddb(0x1c8));_0x2f7ab8[_0x413d41]=_0x99567b;}const _0x244444=_0x52a685['hits'][_0x3a3ddb(0x184)]((_0x3f3196,_0x4c5f8e)=>parseHit(_0x3f3196,_0x4c5f8e));if(!Number[_0x3a3ddb(0x1bb)](_0x52a685[_0x3a3ddb(0x183)])||_0x52a685[_0x3a3ddb(0x183)]!==_0x244444[_0x3a3ddb(0x187)])throw invalidContract(_0x3a3ddb(0x183));return{'schemaVersion':_0x52a685['schemaVersion'],'profile':_0x52a685['profile'],'total':_0x52a685[_0x3a3ddb(0x183)],'strategyFingerprint':_0x52a685[_0x3a3ddb(0x1d4)],'timingsMs':_0x2f7ab8,'hits':_0x244444};}function parseHit(_0x107f44,_0x73cad1){const _0x5912cc=a283_0x2f5a00,_0x119b8a=requireExactRecord(_0x107f44,HIT_KEYS,_0x5912cc(0x18c)+_0x73cad1+']'),_0x41fc02=_0x56feb2=>{const _0x45603c=_0x5912cc,_0xf88c47=_0x119b8a[_0x56feb2];if(typeof _0xf88c47!==_0x45603c(0x1ba)||!_0xf88c47)throw invalidContract(_0x56feb2);return _0xf88c47;};if(!Number[_0x5912cc(0x1bb)](_0x119b8a[_0x5912cc(0x1bf)])||_0x119b8a[_0x5912cc(0x1bf)]<0x1)throw invalidContract('revision');if(_0x119b8a[_0x5912cc(0x1b4)]!==_0x5912cc(0x1d5)&&_0x119b8a[_0x5912cc(0x1b4)]!==_0x5912cc(0x1b0))throw invalidContract(_0x5912cc(0x1b4));if(typeof _0x119b8a[_0x5912cc(0x1bd)]!=='string'||typeof _0x119b8a['text']!==_0x5912cc(0x1ba))throw invalidContract(_0x5912cc(0x1b1));if(!Array[_0x5912cc(0x17e)](_0x119b8a[_0x5912cc(0x195)])||_0x119b8a[_0x5912cc(0x195)][_0x5912cc(0x190)](_0x50da87=>typeof _0x50da87!==_0x5912cc(0x1ba)))throw invalidContract('tags');if(!Number[_0x5912cc(0x1bb)](_0x119b8a[_0x5912cc(0x182)])||_0x119b8a[_0x5912cc(0x182)]!==_0x73cad1+0x1)throw invalidContract(_0x5912cc(0x182));if(!isFiniteNumber(_0x119b8a[_0x5912cc(0x18a)])||!isFiniteNumber(_0x119b8a[_0x5912cc(0x1c6)]))throw invalidContract(_0x5912cc(0x19a));return{'documentId':_0x41fc02(_0x5912cc(0x1c3)),'revision':_0x119b8a['revision'],'chunkId':_0x41fc02(_0x5912cc(0x1a6)),'scope':_0x119b8a[_0x5912cc(0x1b4)],'title':_0x119b8a[_0x5912cc(0x1bd)],'text':_0x119b8a[_0x5912cc(0x1b1)],'tags':[..._0x119b8a[_0x5912cc(0x195)]],'rank':_0x119b8a[_0x5912cc(0x182)],'rawScore':_0x119b8a[_0x5912cc(0x18a)],'finalScore':_0x119b8a[_0x5912cc(0x1c6)],'scoreKind':_0x41fc02(_0x5912cc(0x18e))};}function requireExactRecord(_0x471d28,_0xc70032,_0x4c0457){const _0x91cfce=a283_0x2f5a00,_0x20dcae=requireRecord(_0x471d28,_0x4c0457),_0x2cec8d=Object[_0x91cfce(0x180)](_0x20dcae)[_0x91cfce(0x19d)](),_0x4a81c5=[..._0xc70032][_0x91cfce(0x19d)]();if(_0x2cec8d['length']!==_0x4a81c5['length']||_0x2cec8d[_0x91cfce(0x190)]((_0x362a4c,_0x14d891)=>_0x362a4c!==_0x4a81c5[_0x14d891]))throw invalidContract(_0x4c0457);return _0x20dcae;}function requireRecord(_0x52fe1f,_0x5376f8){const _0x3b52e3=a283_0x2f5a00;if(!_0x52fe1f||typeof _0x52fe1f!==_0x3b52e3(0x1d1)||Array[_0x3b52e3(0x17e)](_0x52fe1f))throw invalidContract(_0x5376f8);return _0x52fe1f;}function isFiniteNumber(_0x32000d){const _0x4343ba=a283_0x2f5a00;return typeof _0x32000d===_0x4343ba(0x1d8)&&Number[_0x4343ba(0x185)](_0x32000d);}function invalidContract(_0x1cfc76){const _0xcf29ea=a283_0x2f5a00;return CliErrors[_0xcf29ea(0x1bc)](_0xcf29ea(0x186)+_0x1cfc76+_0xcf29ea(0x1b7));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x241411,_0x11afcf){const _0x3e2919=a284_0x1ac6,_0x550291=_0x241411();while(!![]){try{const _0x1847db=parseInt(_0x3e2919(0x96))/0x1+parseInt(_0x3e2919(0x92))/0x2+parseInt(_0x3e2919(0x97))/0x3+-parseInt(_0x3e2919(0x88))/0x4+-parseInt(_0x3e2919(0x87))/0x5+-parseInt(_0x3e2919(0x83))/0x6+parseInt(_0x3e2919(0x89))/0x7;if(_0x1847db===_0x11afcf)break;else _0x550291['push'](_0x550291['shift']());}catch(_0x1281a8){_0x550291['push'](_0x550291['shift']());}}}(a284_0x2e1f,0x550d7));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';function a284_0x1ac6(_0x16f6c4,_0x272433){_0x16f6c4=_0x16f6c4-0x7f;const _0x2e1f6c=a284_0x2e1f();let _0x1ac698=_0x2e1f6c[_0x16f6c4];return _0x1ac698;}export function loadPageProjectConfig(_0x2b7dde,_0x7cd1f3=process['cwd']()){const _0x441e69=a284_0x1ac6,_0x5ae6f8=resolve(_0x7cd1f3),_0x5d7952=join(_0x5ae6f8,'.rabetbase',_0x441e69(0x8b));return{'projectRoot':_0x5ae6f8,'pagesBaseDir':_0x5d7952,'appPagesDir':join(_0x5d7952,_0x2b7dde),'lockFilePath':join(_0x5ae6f8,_0x441e69(0x84),_0x441e69(0x8c))};}function a284_0x2e1f(){const _0x5529b7=['isFile','1269828dMRVCa','.rabetbase','trim','toUpperCase','1843825KqOEoq','819736AKpbCi','5620426fDloCv','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','page','page.lock.json','Unsupported\x20file\x20in\x20page\x20directory:\x20','appPagesDir','sort','.json','name','211308uSqIkI','utf8','Page\x20directory\x20not\x20found:\x20','split','142170cyKwrx','248910qaiwPl','page-dir','validation','F_OK','isDirectory'];a284_0x2e1f=function(){return _0x5529b7;};return a284_0x2e1f();}export function buildPageFileName(_0x2fd739,_0x461db6){const _0x4889b1=a284_0x1ac6;return _0x2fd739+'-'+_0x461db6[_0x4889b1(0x86)]()+_0x4889b1(0x90);}export function resolvePageFilePath(_0x3357b8,_0x24b6b4,_0x25ac6f){const _0x334d69=a284_0x1ac6;return join(_0x3357b8[_0x334d69(0x8e)],buildPageFileName(_0x24b6b4,_0x25ac6f));}export async function ensureParentDirectory(_0x2bdf7c){await mkdir(dirname(_0x2bdf7c),{'recursive':!![]});}export async function fileExists(_0xfd5255){const _0x1d4904=a284_0x1ac6;try{return await access(_0xfd5255,constants[_0x1d4904(0x80)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0xbcc5b9){const _0x215bd4=a284_0x1ac6,_0x55a86b=_0xbcc5b9[_0x215bd4(0x85)]();if(!_0x55a86b)throw CliErrors['flagMissing'](_0x215bd4(0x98));const _0x233b8a=resolve(_0x55a86b);let _0x2481c9;try{_0x2481c9=await lstat(_0x233b8a);}catch{throw CliErrors[_0x215bd4(0x7f)](_0x215bd4(0x94)+_0x55a86b);}if(!_0x2481c9[_0x215bd4(0x81)]())throw CliErrors[_0x215bd4(0x7f)](_0x215bd4(0x8a)+_0x55a86b);const _0x445dce={};return await readDirectory(_0x233b8a,_0x233b8a,_0x445dce),_0x445dce;}async function readDirectory(_0x57779f,_0x593675,_0x35061f){const _0x49d0af=a284_0x1ac6,_0xed7e3c=await readdir(_0x593675,{'withFileTypes':!![]});for(const _0x556e62 of _0xed7e3c[_0x49d0af(0x8f)]((_0x5628e4,_0x57e1ee)=>_0x5628e4[_0x49d0af(0x91)]['localeCompare'](_0x57e1ee['name']))){const _0x1831d2=join(_0x593675,_0x556e62[_0x49d0af(0x91)]);if(_0x556e62[_0x49d0af(0x81)]()){await readDirectory(_0x57779f,_0x1831d2,_0x35061f);continue;}if(!_0x556e62[_0x49d0af(0x82)]())throw CliErrors[_0x49d0af(0x7f)](_0x49d0af(0x8d)+_0x1831d2);_0x35061f[relative(_0x57779f,_0x1831d2)[_0x49d0af(0x95)](sep)['join']('/')]=await readFile(_0x1831d2,_0x49d0af(0x93));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28ff8d,_0x325ff3){const _0x29140b=a285_0x32ea,_0xb1f66b=_0x28ff8d();while(!![]){try{const _0x406e95=-parseInt(_0x29140b(0xac))/0x1*(parseInt(_0x29140b(0xb4))/0x2)+parseInt(_0x29140b(0xb9))/0x3+parseInt(_0x29140b(0xb7))/0x4*(parseInt(_0x29140b(0xb6))/0x5)+-parseInt(_0x29140b(0xb2))/0x6+-parseInt(_0x29140b(0xae))/0x7+-parseInt(_0x29140b(0xad))/0x8+-parseInt(_0x29140b(0xb5))/0x9*(-parseInt(_0x29140b(0xb8))/0xa);if(_0x406e95===_0x325ff3)break;else _0xb1f66b['push'](_0xb1f66b['shift']());}catch(_0x132852){_0xb1f66b['push'](_0xb1f66b['shift']());}}}(a285_0x3bc6,0xf3c46));function a285_0x3bc6(){const _0x13465a=['4755459ucbrMk','7KNHGZP','10558848VLgiLX','12783155XTWLmA','stringify','md5','hex','10796748EGPuqh','utf8','454186pLXgfa','776151TEdHvY','238985jzrgfp','72YONTRi','590eywbkU'];a285_0x3bc6=function(){return _0x13465a;};return a285_0x3bc6();}import a285_0x18242e from'node:crypto';function a285_0x32ea(_0x31b57c,_0x2b77ac){_0x31b57c=_0x31b57c-0xac;const _0x3bc698=a285_0x3bc6();let _0x32ea53=_0x3bc698[_0x31b57c];return _0x32ea53;}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x20eaed){const _0x53a636=a285_0x32ea;return JSON[_0x53a636(0xaf)](JSON['parse'](_0x20eaed),null,0x2)+'\x0a';}export function computePageContentHash(_0x602ea6){const _0x5bcb1a=a285_0x32ea;return a285_0x18242e['createHash'](_0x5bcb1a(0xb0))['update'](_0x602ea6)['digest'](_0x5bcb1a(0xb1));}export function computeSerializedSchemaHash(_0x1d2478){return computePageContentHash(serializePageSchemaForFile(_0x1d2478));}export async function computePageFileHash(_0x2e8ecd){const _0x48a037=a285_0x32ea,_0x332b37=await readFile(_0x2e8ecd,_0x48a037(0xb3));return computePageContentHash(_0x332b37);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2114cc,_0x4d626a){const _0xd1fce5=a286_0xc252,_0x15759c=_0x2114cc();while(!![]){try{const _0x32d9fb=parseInt(_0xd1fce5(0x1f2))/0x1*(parseInt(_0xd1fce5(0x1e9))/0x2)+parseInt(_0xd1fce5(0x1ee))/0x3*(-parseInt(_0xd1fce5(0x1f6))/0x4)+parseInt(_0xd1fce5(0x1f0))/0x5*(parseInt(_0xd1fce5(0x1f8))/0x6)+-parseInt(_0xd1fce5(0x1f9))/0x7+parseInt(_0xd1fce5(0x1e8))/0x8*(parseInt(_0xd1fce5(0x1f1))/0x9)+-parseInt(_0xd1fce5(0x1eb))/0xa*(parseInt(_0xd1fce5(0x1ed))/0xb)+parseInt(_0xd1fce5(0x1f3))/0xc*(parseInt(_0xd1fce5(0x1f7))/0xd);if(_0x32d9fb===_0x4d626a)break;else _0x15759c['push'](_0x15759c['shift']());}catch(_0x361cf4){_0x15759c['push'](_0x15759c['shift']());}}}(a286_0x4716,0xe6a74));import{mkdir,readFile,writeFile}from'node:fs/promises';function a286_0x4716(){const _0x24efc4=['12IMCmKm','lastSync','object','528952YBTXhH','5005481IzUWfV','6160254IbHFEd','11239158UyfisF','code','stringify','apps','8eVJJKF','24788jeduRa','pages','247330GCewDo','utf8','33OqvsGn','15vpcCPU','ENOENT','5MOdBDW','4149693OyQooR','114btcWdK'];a286_0x4716=function(){return _0x24efc4;};return a286_0x4716();}function a286_0xc252(_0x649774,_0x5b74b2){_0x649774=_0x649774-0x1e6;const _0x4716d9=a286_0x4716();let _0xc25208=_0x4716d9[_0x649774];return _0xc25208;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x1486b2,_0x551c8f){const _0x4d3025=a286_0xc252,_0x37c6b9={'apps':_0x1486b2['apps']&&typeof _0x1486b2[_0x4d3025(0x1e7)]===_0x4d3025(0x1f5)?_0x1486b2['apps']:{}};let _0x2c2843=_0x37c6b9['apps'][_0x551c8f];if(!_0x2c2843)return _0x2c2843={'lastSync':'','pages':{}},_0x37c6b9[_0x4d3025(0x1e7)][_0x551c8f]=_0x2c2843,{'lockData':_0x37c6b9,'appLock':_0x2c2843};return!_0x2c2843[_0x4d3025(0x1f4)]&&(_0x2c2843[_0x4d3025(0x1f4)]=''),(!_0x2c2843[_0x4d3025(0x1ea)]||typeof _0x2c2843['pages']!==_0x4d3025(0x1f5))&&(_0x2c2843[_0x4d3025(0x1ea)]={}),{'lockData':_0x37c6b9,'appLock':_0x2c2843};}export async function readPageLockFile(_0x4359a1){const _0x2c5cd2=a286_0xc252;try{const _0x344ce1=await readFile(_0x4359a1,_0x2c5cd2(0x1ec)),_0xb027f9=JSON['parse'](_0x344ce1);return{'apps':_0xb027f9[_0x2c5cd2(0x1e7)]&&typeof _0xb027f9[_0x2c5cd2(0x1e7)]===_0x2c5cd2(0x1f5)?_0xb027f9[_0x2c5cd2(0x1e7)]:{}};}catch(_0xad0b4d){if(_0xad0b4d[_0x2c5cd2(0x1fa)]===_0x2c5cd2(0x1ef))return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0xad0b4d));}}export async function writePageLockFile(_0x1c3bc8,_0x1274c7){const _0x26673c=a286_0xc252;await mkdir(dirname(_0x1c3bc8),{'recursive':!![]}),await writeFile(_0x1c3bc8,JSON[_0x26673c(0x1e6)](_0x1274c7,null,0x2),_0x26673c(0x1ec));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a287_0x576c(){const _0x13ec0e=['validation','39906mnwved','remote','stringify','LrSmartJsx\x20node\x20\x22','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','3ZQzxrR','entries','isArray','2710824qvgGYL','object','Invalid\x20JSON\x20in\x20','7486DGAfQj','parse','this','id:','JSExpression','921148euaEGB','get','1ePYcJS','570HJaRxK','render','type','length','label','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','906PhoYha','map','componentName','5711629sBcCgh','forEach','LrSmartJsx','1398901euvHBe','key','value','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','\x20page\x20schema.','6160xUoZRP','\x22\x20has\x20missing\x20or\x20invalid\x20props.','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','string','local','apiError','JSFunction','props'];a287_0x576c=function(){return _0x13ec0e;};return a287_0x576c();}(function(_0x38e32b,_0xa9f65c){const _0x435472=a287_0x5448,_0x3bfb50=_0x38e32b();while(!![]){try{const _0x288fbf=parseInt(_0x435472(0x18b))/0x1*(parseInt(_0x435472(0x184))/0x2)+parseInt(_0x435472(0x17e))/0x3*(parseInt(_0x435472(0x189))/0x4)+parseInt(_0x435472(0x19e))/0x5*(-parseInt(_0x435472(0x192))/0x6)+parseInt(_0x435472(0x198))/0x7+-parseInt(_0x435472(0x181))/0x8+-parseInt(_0x435472(0x178))/0x9*(parseInt(_0x435472(0x18c))/0xa)+parseInt(_0x435472(0x195))/0xb;if(_0x288fbf===_0xa9f65c)break;else _0x3bfb50['push'](_0x3bfb50['shift']());}catch(_0x5c83c5){_0x3bfb50['push'](_0x3bfb50['shift']());}}}(a287_0x576c,0x2ad81));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x12f166,_0x41bb47,_0x10b28e){const _0x34f616=a287_0x5448,_0x4d6b35=parseSchema(_0x12f166,_0x34f616(0x1a2)),_0x5122b7=parseSchema(_0x41bb47,_0x34f616(0x179)),_0x28ab4e=collectLrSmartJsx(_0x4d6b35,!![]);if(_0x28ab4e[_0x34f616(0x18f)]===0x0)return{'content':_0x12f166,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x24a568=new Map(collectLrSmartJsx(_0x5122b7)[_0x34f616(0x193)](_0xb4c46a=>[_0xb4c46a['key'],_0xb4c46a]));let _0x2db05e=0x0,_0x3378a2=0x0;for(const _0x25458a of _0x28ab4e){const _0x495cc0=readNonEmptyString(_0x25458a[_0x34f616(0x18d)]['source']),_0x146879=readNonEmptyString(_0x25458a[_0x34f616(0x18d)][_0x34f616(0x19a)]),_0x448a21=_0x24a568[_0x34f616(0x18a)](_0x25458a[_0x34f616(0x199)]),_0x1d66ce=readNonEmptyString(_0x448a21?.[_0x34f616(0x18d)]['source']),_0x2d5003=readNonEmptyString(_0x448a21?.[_0x34f616(0x18d)][_0x34f616(0x19a)]);let _0x3a4f96=![];_0x25458a[_0x34f616(0x18d)][_0x34f616(0x18e)]!==_0x34f616(0x1a4)&&(_0x25458a[_0x34f616(0x18d)][_0x34f616(0x18e)]='JSFunction',_0x3a4f96=!![]);!isPageContextExpression(_0x25458a[_0x34f616(0x1a5)]['_context'])&&(_0x25458a[_0x34f616(0x1a5)]['_context']={'type':_0x34f616(0x188),'value':_0x34f616(0x186)},_0x3a4f96=!![]);if(!_0x495cc0){if(!_0x146879)throw CliErrors[_0x34f616(0x1a6)](_0x34f616(0x17b)+_0x25458a[_0x34f616(0x190)]+_0x34f616(0x17d),'Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.');if(_0x3a4f96)_0x3378a2+=0x1;continue;}const _0x4a6809=!_0x448a21||_0x495cc0!==_0x1d66ce,_0x40cdb6=!_0x146879;if(!_0x4a6809&&_0x146879&&_0x2d5003&&_0x146879!==_0x2d5003)throw CliErrors['validation']('LrSmartJsx\x20node\x20\x22'+_0x25458a[_0x34f616(0x190)]+_0x34f616(0x19c),_0x34f616(0x191));if(_0x4a6809||_0x40cdb6||!_0x2d5003){const _0x4d032c=readNonEmptyString(await _0x10b28e(_0x495cc0));if(!_0x4d032c)throw CliErrors[_0x34f616(0x1a3)](_0x34f616(0x17c)+_0x25458a['label']+'\x22.');_0x25458a[_0x34f616(0x18d)]['value']=_0x4d032c,_0x2db05e+=0x1,_0x3a4f96=!![];}if(_0x3a4f96)_0x3378a2+=0x1;}if(_0x3378a2===0x0)return{'content':_0x12f166,'compiledNodes':_0x2db05e,'normalizedNodes':_0x3378a2};return{'content':JSON[_0x34f616(0x17a)](_0x4d6b35),'compiledNodes':_0x2db05e,'normalizedNodes':_0x3378a2};}function parseSchema(_0x219031,_0x16ccee){const _0xc0ad6=a287_0x5448;try{return JSON[_0xc0ad6(0x185)](_0x219031);}catch{throw CliErrors[_0xc0ad6(0x1a6)](_0xc0ad6(0x183)+_0x16ccee+_0xc0ad6(0x19d));}}function collectLrSmartJsx(_0x180549,_0x26acf7=![]){const _0x147cc3=[],_0x581b52=(_0x3755bc,_0x13953c)=>{const _0x564fb7=a287_0x5448;if(Array[_0x564fb7(0x180)](_0x3755bc)){_0x3755bc[_0x564fb7(0x196)]((_0x2bf998,_0xcc5012)=>_0x581b52(_0x2bf998,_0x13953c+'['+_0xcc5012+']'));return;}if(!isObject(_0x3755bc))return;if(_0x3755bc[_0x564fb7(0x194)]===_0x564fb7(0x197)){const _0x211168=readNonEmptyString(_0x3755bc['id']),_0x408cdf=_0x211168||_0x13953c,_0x370d31=isObject(_0x3755bc[_0x564fb7(0x1a5)])?_0x3755bc['props']:undefined;if(!_0x370d31){if(_0x26acf7)throw CliErrors[_0x564fb7(0x1a6)](_0x564fb7(0x17b)+_0x408cdf+_0x564fb7(0x19f),_0x564fb7(0x19b));return;}const _0x134d29=isObject(_0x370d31[_0x564fb7(0x18d)])?_0x370d31[_0x564fb7(0x18d)]:undefined;if(!_0x134d29){if(_0x26acf7)throw CliErrors[_0x564fb7(0x1a6)](_0x564fb7(0x17b)+_0x408cdf+'\x22\x20has\x20missing\x20or\x20invalid\x20props.render.',_0x564fb7(0x1a0));return;}_0x147cc3['push']({'key':_0x211168?_0x564fb7(0x187)+_0x211168:'path:'+_0x13953c,'label':_0x408cdf,'props':_0x370d31,'render':_0x134d29});}for(const [_0x1c3d07,_0x40eea8]of Object[_0x564fb7(0x17f)](_0x3755bc)){if(_0x1c3d07===_0x564fb7(0x1a5)&&_0x3755bc['componentName']===_0x564fb7(0x197))continue;_0x581b52(_0x40eea8,_0x13953c+'.'+_0x1c3d07);}};return _0x581b52(_0x180549,'$'),_0x147cc3;}function isObject(_0x448e32){const _0x41c10d=a287_0x5448;return Boolean(_0x448e32)&&typeof _0x448e32===_0x41c10d(0x182)&&!Array[_0x41c10d(0x180)](_0x448e32);}function a287_0x5448(_0xb4dc13,_0x5b6f68){_0xb4dc13=_0xb4dc13-0x178;const _0x576c70=a287_0x576c();let _0x544827=_0x576c70[_0xb4dc13];return _0x544827;}function readNonEmptyString(_0x1ce9c1){const _0xf5ca73=a287_0x5448;return typeof _0x1ce9c1===_0xf5ca73(0x1a1)&&_0x1ce9c1['trim']()?_0x1ce9c1:undefined;}function isPageContextExpression(_0x349dee){const _0x202b86=a287_0x5448;return isObject(_0x349dee)&&_0x349dee['type']===_0x202b86(0x188)&&_0x349dee[_0x202b86(0x19a)]==='this';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4735c3,_0x1aeabe){const _0x2c038f=a289_0x1af7,_0x42cf88=_0x4735c3();while(!![]){try{const _0x42bf24=parseInt(_0x2c038f(0x197))/0x1*(parseInt(_0x2c038f(0x19e))/0x2)+parseInt(_0x2c038f(0x189))/0x3*(-parseInt(_0x2c038f(0x1a8))/0x4)+parseInt(_0x2c038f(0x199))/0x5*(-parseInt(_0x2c038f(0x1a0))/0x6)+parseInt(_0x2c038f(0x1b6))/0x7*(parseInt(_0x2c038f(0x198))/0x8)+parseInt(_0x2c038f(0x1ca))/0x9+-parseInt(_0x2c038f(0x18b))/0xa*(parseInt(_0x2c038f(0x1a5))/0xb)+parseInt(_0x2c038f(0x19d))/0xc*(parseInt(_0x2c038f(0x1a4))/0xd);if(_0x42bf24===_0x1aeabe)break;else _0x42cf88['push'](_0x42cf88['shift']());}catch(_0xb32c0a){_0x42cf88['push'](_0x42cf88['shift']());}}}(a289_0x545e,0x90aa1));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x398277,_0x22cb8c){const _0x5cd633=a289_0x1af7,_0x4a7096=[],_0x3d8149=normalizeSqlForStaticAnalysis(_0x398277),_0x1beab0=(_0x3d8149[_0x5cd633(0x1bc)]?[]:extractJoinFacts(_0x3d8149[_0x5cd633(0x1cd)]))[_0x5cd633(0x192)](_0x3aeca1=>{const _0x4ac5fe=_0x5cd633;if(_0x3aeca1['unsupportedPredicate']||_0x3aeca1[_0x4ac5fe(0x1b9)][_0x4ac5fe(0x191)]===0x0)return _0x4a7096[_0x4ac5fe(0x1cf)]({'code':_0x4ac5fe(0x18a),'table':_0x3aeca1[_0x4ac5fe(0x195)],'alias':_0x3aeca1['alias'],'columns':_0x3aeca1[_0x4ac5fe(0x1b9)],'reason':_0x3aeca1[_0x4ac5fe(0x1af)]??_0x4ac5fe(0x19c)}),{'table':_0x3aeca1['table'],'alias':_0x3aeca1[_0x4ac5fe(0x1c4)],'columns':_0x3aeca1[_0x4ac5fe(0x1b9)],'status':_0x4ac5fe(0x18c)};const _0x56a7cc=resolveTableMetadata(_0x22cb8c,_0x3aeca1['table']),_0x1cd575=(_0x56a7cc?.[_0x4ac5fe(0x194)]??[])[_0x4ac5fe(0x192)](_0x1cf92b=>({'index':_0x1cf92b,'matchedPrefix':findEqualityPrefix(_0x1cf92b[_0x4ac5fe(0x1b9)],_0x3aeca1[_0x4ac5fe(0x1b9)])}))['filter'](_0x2a1fe7=>_0x2a1fe7[_0x4ac5fe(0x1b2)][_0x4ac5fe(0x191)]>0x0),_0x1d5a2c=_0x1cd575[_0x4ac5fe(0x1c2)]((_0x579cbe,_0x8fcd6f)=>!_0x579cbe||_0x8fcd6f[_0x4ac5fe(0x1b2)][_0x4ac5fe(0x191)]>_0x579cbe[_0x4ac5fe(0x1b2)]['length']?_0x8fcd6f:_0x579cbe,_0x1cd575[0x0]);if(_0x1d5a2c)return{'table':_0x3aeca1['table'],'alias':_0x3aeca1[_0x4ac5fe(0x1c4)],'columns':_0x3aeca1['columns'],'status':_0x4ac5fe(0x1ac),'matchedIndex':{..._0x1d5a2c['index'],'matchedPrefix':_0x1d5a2c['matchedPrefix']}};const _0x48059b=_0x56a7cc?.[_0x4ac5fe(0x194)][_0x4ac5fe(0x1bf)](_0x131ed0=>_0x131ed0[_0x4ac5fe(0x1b9)]['some'](_0x4de6fd=>_0x3aeca1[_0x4ac5fe(0x1b9)][_0x4ac5fe(0x1d1)](_0x34705b=>columnNamesMatch(_0x4de6fd,_0x34705b))))??[];if(_0x48059b['length']>0x0)return _0x4a7096[_0x4ac5fe(0x1cf)]({'code':_0x4ac5fe(0x18e),'table':_0x3aeca1['table'],'alias':_0x3aeca1['alias'],'columns':_0x3aeca1[_0x4ac5fe(0x1b9)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x3aeca1[_0x4ac5fe(0x195)],'alias':_0x3aeca1[_0x4ac5fe(0x1c4)],'columns':_0x3aeca1[_0x4ac5fe(0x1b9)],'status':_0x4ac5fe(0x1a6),'candidateIndexes':_0x48059b};if(_0x56a7cc&&_0x56a7cc[_0x4ac5fe(0x1bb)]!==![]&&_0x56a7cc[_0x4ac5fe(0x194)][_0x4ac5fe(0x191)]>0x0&&_0x3aeca1['columns'][_0x4ac5fe(0x191)]>0x0)return _0x4a7096[_0x4ac5fe(0x1cf)]({'code':'JOIN_INDEX_MISSING','table':_0x3aeca1[_0x4ac5fe(0x195)],'alias':_0x3aeca1[_0x4ac5fe(0x1c4)],'columns':_0x3aeca1[_0x4ac5fe(0x1b9)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x3aeca1[_0x4ac5fe(0x195)],'alias':_0x3aeca1[_0x4ac5fe(0x1c4)],'columns':_0x3aeca1['columns'],'status':_0x4ac5fe(0x1a6)};return _0x4a7096[_0x4ac5fe(0x1cf)]({'code':_0x4ac5fe(0x1d2),'table':_0x3aeca1['table'],'alias':_0x3aeca1[_0x4ac5fe(0x1c4)],'columns':_0x3aeca1['columns'],'reason':_0x56a7cc?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x4ac5fe(0x1be)}),{'table':_0x3aeca1[_0x4ac5fe(0x195)],'alias':_0x3aeca1['alias'],'columns':_0x3aeca1[_0x4ac5fe(0x1b9)],'status':'unavailable'};});return{'checked':_0x1beab0['length']>0x0,'joins':_0x1beab0,'warnings':_0x4a7096};}function extractJoinFacts(_0x5f33a3){const _0x4edcb6=a289_0x1af7,_0x392791=maskNestedQueries(stripSqlNoise(_0x5f33a3)),_0x333d2a=maskQuotedIdentifiers(_0x392791),_0x1d161d=[],_0x391d2f=new Set(),_0x1f552e=/\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 _0x4d2d71 of _0x392791['matchAll'](_0x1f552e)){const _0x89e880=_0x4d2d71[_0x4edcb6(0x1a7)]??0x0,_0x221aba=_0x4d2d71[0x0][_0x4edcb6(0x1c5)](/\bJOIN\b/i),_0x2dee80=_0x89e880+Math[_0x4edcb6(0x1c6)](0x0,_0x221aba);if(!/^JOIN\b/i[_0x4edcb6(0x190)](_0x333d2a['slice'](_0x2dee80)))continue;_0x391d2f[_0x4edcb6(0x1c7)](_0x2dee80);const _0x495e4d=normalizeIdentifier(_0x4d2d71[0x1]||'INNER'),_0xfc35bb=normalizeIdentifier(_0x4d2d71[0x2]??''),_0xcb39bf=normalizeIdentifier(_0x4d2d71[0x3]||_0xfc35bb[_0x4edcb6(0x1bd)]('.')['at'](-0x1)||_0xfc35bb),_0x451d8d=[],_0x1ddfc8=_0xfc35bb===_0x4edcb6(0x193);let _0xa0f4ec=_0x495e4d===_0x4edcb6(0x1c9)||_0x495e4d==='full'||_0x1ddfc8,_0x911961=_0xa0f4ec?_0x1ddfc8?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x495e4d['toUpperCase']()+_0x4edcb6(0x18f):undefined;const _0x1f0019=stripOuterParentheses(_0x4d2d71[0x4]??''),_0x50bd7d=_0x1f0019['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x1f0019['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x4b888e=_0x1f0019[_0x4edcb6(0x1ad)](MYBATIS_INCLUDE_MARKER);_0x50bd7d&&(_0xa0f4ec=!![],_0x911961??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x4b888e&&(_0xa0f4ec=!![],_0x911961??=_0x4edcb6(0x1a3));const _0x4f1b4c=_0x1f0019['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x4edcb6(0x1b8)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x4edcb6(0x1b8)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4f1b4c,'OR')&&(_0xa0f4ec=!![],_0x911961??=_0x4edcb6(0x1b5));for(const _0x2fdbd7 of splitTopLevelAnd(_0x4f1b4c)){const _0xa95b38=stripOuterParentheses(_0x2fdbd7);if(hasTopLevelKeyword(_0xa95b38,'OR')){_0xa0f4ec=!![],_0x911961??=_0x4edcb6(0x1b5);continue;}const _0x1351e3=splitEquality(_0xa95b38);if(!_0x1351e3){containsColumnReference(_0x2fdbd7,_0xcb39bf)&&(_0xa0f4ec=!![]);continue;}const _0x347a42=parseDirectColumnReference(_0x1351e3[0x0],_0xcb39bf),_0x4bb5a5=parseDirectColumnReference(_0x1351e3[0x1],_0xcb39bf),_0x479f84=containsColumnReference(_0x1351e3[0x0],_0xcb39bf),_0x4231e9=containsColumnReference(_0x1351e3[0x1],_0xcb39bf),_0x3daf9e=_0x347a42&&!_0x4231e9?_0x347a42:_0x4bb5a5&&!_0x479f84?_0x4bb5a5:null;if(_0x3daf9e&&!_0x451d8d[_0x4edcb6(0x1ad)](_0x3daf9e))_0x451d8d[_0x4edcb6(0x1cf)](_0x3daf9e);else!_0x3daf9e&&containsColumnReference(_0x2fdbd7,_0xcb39bf)&&(_0xa0f4ec=!![]);}_0x1d161d[_0x4edcb6(0x1cf)]({'table':_0xfc35bb,'alias':_0xcb39bf,'columns':_0x451d8d,'unsupportedPredicate':_0xa0f4ec,'unsupportedReason':_0x911961,'containsUnresolvedInclude':_0x4b888e,'position':_0x2dee80});}for(const _0x230b70 of _0x333d2a[_0x4edcb6(0x196)](/\bJOIN\b/gi)){const _0x4e562a=_0x230b70['index']??0x0;if(_0x391d2f['has'](_0x4e562a))continue;const _0x4914ae=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x392791[_0x4edcb6(0x1c0)](_0x4e562a+_0x230b70[0x0][_0x4edcb6(0x191)])),_0x52b7ae=normalizeIdentifier(_0x4914ae?.[0x1]||_0x4edcb6(0x1b3)),_0x954b38=normalizeIdentifier(_0x4914ae?.[0x2]||''),_0x559b03=isSqlClauseKeyword(_0x954b38)?_0x52b7ae[_0x4edcb6(0x1bd)]('.')['at'](-0x1)||_0x52b7ae:_0x954b38||_0x52b7ae['split']('.')['at'](-0x1)||_0x52b7ae;_0x1d161d[_0x4edcb6(0x1cf)]({'table':_0x52b7ae,'alias':_0x559b03,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x4edcb6(0x1a2),'position':_0x4e562a});}const _0x5e3f35=_0x333d2a[_0x4edcb6(0x1d0)](MYBATIS_INCLUDE_MARKER);return _0x5e3f35>=0x0&&!_0x1d161d[_0x4edcb6(0x1d1)](_0x5e9bde=>_0x5e9bde[_0x4edcb6(0x1c8)])&&_0x1d161d[_0x4edcb6(0x1cf)]({'table':'unknown','alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x4edcb6(0x1cb),'containsUnresolvedInclude':!![],'position':_0x5e3f35}),_0x1d161d[_0x4edcb6(0x1ae)]((_0x17ce3a,_0x3de3c1)=>_0x17ce3a['position']-_0x3de3c1[_0x4edcb6(0x1b0)]);}function stripSqlNoise(_0x9a5cb1){const _0x28fb2b=a289_0x1af7,_0x38d77d=Array[_0x28fb2b(0x19f)](_0x9a5cb1),_0x520fd2=(_0x1df065,_0x18da8e)=>{for(let _0xa84181=_0x1df065;_0xa84181<_0x18da8e;_0xa84181+=0x1){_0x38d77d[_0xa84181]!=='\x0a'&&_0x38d77d[_0xa84181]!=='\x0d'&&(_0x38d77d[_0xa84181]='\x20');}};for(let _0x13e19a=0x0;_0x13e19a<_0x38d77d[_0x28fb2b(0x191)];_0x13e19a+=0x1){const _0x410b38=_0x38d77d[_0x13e19a],_0x1418bb=_0x38d77d[_0x13e19a+0x1];if(_0x410b38==='\x27'||_0x410b38==='\x22'||_0x410b38==='`'){const _0x370212=_0x410b38,_0x2dbf8c=_0x13e19a;_0x13e19a+=0x1;while(_0x13e19a<_0x38d77d[_0x28fb2b(0x191)]){if(_0x38d77d[_0x13e19a]==='\x5c'&&_0x13e19a+0x1<_0x38d77d[_0x28fb2b(0x191)]){_0x13e19a+=0x2;continue;}if(_0x38d77d[_0x13e19a]!==_0x370212){_0x13e19a+=0x1;continue;}if(_0x38d77d[_0x13e19a+0x1]===_0x370212){_0x13e19a+=0x2;continue;}break;}if(_0x370212==='\x27')_0x520fd2(_0x2dbf8c,Math[_0x28fb2b(0x1ce)](_0x13e19a+0x1,_0x38d77d['length']));continue;}if(_0x410b38==='-'&&_0x1418bb==='-'){const _0x141b23=_0x13e19a;while(_0x13e19a<_0x38d77d[_0x28fb2b(0x191)]&&_0x38d77d[_0x13e19a]!=='\x0a')_0x13e19a+=0x1;_0x520fd2(_0x141b23,_0x13e19a);continue;}if(_0x410b38==='/'&&_0x1418bb==='*'){const _0x11efbf=_0x13e19a;_0x13e19a+=0x2;while(_0x13e19a<_0x38d77d[_0x28fb2b(0x191)]&&!(_0x38d77d[_0x13e19a]==='*'&&_0x38d77d[_0x13e19a+0x1]==='/')){_0x13e19a+=0x1;}_0x13e19a=Math[_0x28fb2b(0x1ce)](_0x13e19a+0x1,_0x38d77d[_0x28fb2b(0x191)]-0x1),_0x520fd2(_0x11efbf,_0x13e19a+0x1);continue;}if(_0x410b38==='#'&&_0x1418bb!=='{'){const _0x400383=_0x13e19a;while(_0x13e19a<_0x38d77d['length']&&_0x38d77d[_0x13e19a]!=='\x0a')_0x13e19a+=0x1;_0x520fd2(_0x400383,_0x13e19a);continue;}if((_0x410b38==='#'||_0x410b38==='$')&&_0x1418bb==='{'){const _0x38a3b0=_0x13e19a;_0x13e19a+=0x2;while(_0x13e19a<_0x38d77d[_0x28fb2b(0x191)]&&_0x38d77d[_0x13e19a]!=='}')_0x13e19a+=0x1;_0x520fd2(_0x38a3b0,Math[_0x28fb2b(0x1ce)](_0x13e19a+0x1,_0x38d77d[_0x28fb2b(0x191)]));}}return _0x38d77d[_0x28fb2b(0x188)]('');}function maskQuotedIdentifiers(_0x458ab6){const _0x2410ef=a289_0x1af7,_0x4cd94a=Array[_0x2410ef(0x19f)](_0x458ab6);for(let _0x1e78db=0x0;_0x1e78db<_0x4cd94a[_0x2410ef(0x191)];_0x1e78db+=0x1){const _0x3d846e=_0x4cd94a[_0x1e78db];if(_0x3d846e!=='\x22'&&_0x3d846e!=='`')continue;_0x1e78db+=0x1;while(_0x1e78db<_0x4cd94a[_0x2410ef(0x191)]){if(_0x4cd94a[_0x1e78db]===_0x3d846e){if(_0x4cd94a[_0x1e78db+0x1]===_0x3d846e){_0x4cd94a[_0x1e78db]='\x20',_0x4cd94a[_0x1e78db+0x1]='\x20',_0x1e78db+=0x2;continue;}break;}_0x4cd94a[_0x1e78db]='\x20',_0x1e78db+=0x1;}}return _0x4cd94a['join']('');}function maskNestedQueries(_0x298494){const _0x3b58fe=a289_0x1af7,_0xd13952=Array[_0x3b58fe(0x19f)](_0x298494);for(let _0x40f189=0x0;_0x40f189<_0xd13952[_0x3b58fe(0x191)];_0x40f189+=0x1){if(_0xd13952[_0x40f189]!=='(')continue;const _0x2ff7c3=_0x298494['slice'](_0x40f189+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x3b58fe(0x190)](_0x2ff7c3))continue;let _0x39637d=0x1,_0x296f91=_0x40f189+0x1;for(;_0x296f91<_0xd13952['length']&&_0x39637d>0x0;_0x296f91+=0x1){if(_0xd13952[_0x296f91]==='(')_0x39637d+=0x1;if(_0xd13952[_0x296f91]===')')_0x39637d-=0x1;}if(_0x39637d!==0x0)continue;for(let _0x339c5e=_0x40f189;_0x339c5e<_0x296f91;_0x339c5e+=0x1){_0xd13952[_0x339c5e]='\x20';}const _0x570a15=_0x3b58fe(0x193);for(let _0x2d4a7e=0x0;_0x2d4a7e<_0x570a15[_0x3b58fe(0x191)]&&_0x40f189+_0x2d4a7e<_0x296f91;_0x2d4a7e+=0x1){_0xd13952[_0x40f189+_0x2d4a7e]=_0x570a15[_0x2d4a7e];}_0x40f189=_0x296f91-0x1;}return _0xd13952[_0x3b58fe(0x188)]('');}function splitTopLevelAnd(_0x4f2edc){const _0x41734c=a289_0x1af7,_0x40a170=[];let _0x570cf5=0x0,_0x544220=0x0;for(let _0x440df9=0x0;_0x440df9<_0x4f2edc[_0x41734c(0x191)];_0x440df9+=0x1){const _0x4af71b=_0x4f2edc[_0x440df9];if(_0x4af71b==='(')_0x570cf5+=0x1;if(_0x4af71b===')')_0x570cf5=Math[_0x41734c(0x1c6)](0x0,_0x570cf5-0x1);_0x570cf5===0x0&&_0x4f2edc['slice'](_0x440df9)['match'](/^AND\b/i)&&(_0x440df9===0x0||/\s/[_0x41734c(0x190)](_0x4f2edc[_0x440df9-0x1]??''))&&(_0x40a170[_0x41734c(0x1cf)](_0x4f2edc[_0x41734c(0x1c0)](_0x544220,_0x440df9)[_0x41734c(0x1b7)]()),_0x440df9+=0x2,_0x544220=_0x440df9+0x1);}const _0x5bb24c=_0x4f2edc[_0x41734c(0x1c0)](_0x544220)['trim']();if(_0x5bb24c)_0x40a170[_0x41734c(0x1cf)](_0x5bb24c);return _0x40a170;}function hasTopLevelKeyword(_0xe6142a,_0x185aec){const _0x2b568a=a289_0x1af7;let _0x56ea64=0x0;for(let _0x4c4359=0x0;_0x4c4359<_0xe6142a[_0x2b568a(0x191)];_0x4c4359+=0x1){const _0xe2d5c8=_0xe6142a[_0x4c4359];if(_0xe2d5c8==='(')_0x56ea64+=0x1;if(_0xe2d5c8===')')_0x56ea64=Math[_0x2b568a(0x1c6)](0x0,_0x56ea64-0x1);if(_0x56ea64!==0x0)continue;const _0x99cd54=_0xe6142a['slice'](_0x4c4359,_0x4c4359+_0x185aec['length']),_0x4b5295=_0xe6142a[_0x4c4359-0x1]??'\x20',_0x43db85=_0xe6142a[_0x4c4359+_0x185aec[_0x2b568a(0x191)]]??'\x20';if(_0x99cd54['toUpperCase']()===_0x185aec[_0x2b568a(0x18d)]()&&!/[\w$]/['test'](_0x4b5295)&&!/[\w$]/[_0x2b568a(0x190)](_0x43db85))return!![];}return![];}function splitEquality(_0x3c3b15){const _0x1b9f41=a289_0x1af7,_0x491090=stripOuterParentheses(_0x3c3b15);let _0x9573eb=0x0,_0x144454;for(let _0x2f54b5=0x0;_0x2f54b5<_0x491090[_0x1b9f41(0x191)];_0x2f54b5+=0x1){const _0x51c514=_0x491090[_0x2f54b5];if(_0x51c514==='(')_0x9573eb+=0x1;if(_0x51c514===')')_0x9573eb=Math[_0x1b9f41(0x1c6)](0x0,_0x9573eb-0x1);const _0x2d797b=_0x491090[_0x2f54b5-0x1]??'',_0x5c6f5d=_0x491090[_0x2f54b5+0x1]??'';if(_0x51c514==='='&&_0x9573eb===0x0&&!/[!<>=:]/[_0x1b9f41(0x190)](_0x2d797b)&&_0x5c6f5d!=='='){if(_0x144454!==undefined)return null;_0x144454=_0x2f54b5;}}return _0x144454===undefined?null:[_0x491090[_0x1b9f41(0x1c0)](0x0,_0x144454)[_0x1b9f41(0x1b7)](),_0x491090[_0x1b9f41(0x1c0)](_0x144454+0x1)[_0x1b9f41(0x1b7)]()];}function parseDirectColumnReference(_0x33d7aa,_0x28bd01){const _0xcdc6fd=a289_0x1af7,_0x3032e7=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xcdc6fd(0x1aa)](stripOuterParentheses(_0x33d7aa));if(!_0x3032e7)return null;if(normalizeIdentifier(_0x3032e7[0x1]??'')!==normalizeIdentifier(_0x28bd01))return null;return normalizeIdentifier(_0x3032e7[0x2]??'');}function a289_0x545e(){const _0x283914=['alias','search','max','add','containsUnresolvedInclude','right','6592824GZQaEj','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','tableName','sql','min','push','indexOf','some','INDEX_METADATA_UNAVAILABLE','join','24MqoPuk','JOIN_PREDICATE_UNSUPPORTED','5336570sKVbPI','unavailable','toUpperCase','JOIN_INDEX_NOT_USABLE','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','test','length','map','__sq__','indexes','table','matchAll','1KBYhBi','88gbegQM','154085ZefcqN','has','natural','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','1639236ejcXBL','509662poePPD','from','18yXUMew','(?:^|[^\x5cw$])','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','13qPUKFn','11pOCODX','warning','index','62136hFPsWg','startsWith','exec','where','covered','includes','sort','unsupportedReason','position','endsWith','matchedPrefix','unknown','replace','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','139335lUhcLY','trim','replaceAll','columns','left','metadataAvailable','error','split','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','filter','slice','toLowerCase','reduce','\x5c$&'];a289_0x545e=function(){return _0x283914;};return a289_0x545e();}function containsColumnReference(_0x409d9c,_0x383e80){const _0x3cbf3b=a289_0x1af7,_0xe400fb=_0x409d9c[_0x3cbf3b(0x1b4)](/[`"]/g,''),_0x439278=_0x383e80['replace'](/[.*+?^${}()|[\]\\]/g,_0x3cbf3b(0x1c3));return new RegExp(_0x3cbf3b(0x1a1)+_0x439278+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x3cbf3b(0x190)](_0xe400fb);}function findEqualityPrefix(_0x2c46d8,_0x5cd390){const _0x2e0833=a289_0x1af7,_0x408e1b=new Set(_0x5cd390[_0x2e0833(0x192)](normalizeIdentifier)),_0x26f794=[];for(const _0x33d437 of _0x2c46d8){if(!_0x408e1b[_0x2e0833(0x19a)](normalizeIdentifier(_0x33d437)))break;_0x26f794[_0x2e0833(0x1cf)](_0x33d437);}return _0x26f794;}function resolveTableMetadata(_0x4e0af7,_0x50cc07){const _0x476c6c=a289_0x1af7,_0x2e8b21=normalizeIdentifier(_0x50cc07),_0x13d61a=_0x4e0af7[_0x476c6c(0x1bf)](_0xb08112=>normalizeIdentifier(_0xb08112[_0x476c6c(0x1cc)])===_0x2e8b21);if(_0x13d61a['length']===0x1)return _0x13d61a[0x0];const _0x48b2e4=_0x2e8b21['includes']('.'),_0x1a9b18=_0x2e8b21[_0x476c6c(0x1bd)]('.')['at'](-0x1),_0x2e1012=_0x4e0af7[_0x476c6c(0x1bf)](_0x3dc6a1=>{const _0x23b1cc=_0x476c6c,_0x16251e=normalizeIdentifier(_0x3dc6a1[_0x23b1cc(0x1cc)]);if(_0x48b2e4&&_0x16251e[_0x23b1cc(0x1ad)]('.'))return![];return _0x16251e[_0x23b1cc(0x1bd)]('.')['at'](-0x1)===_0x1a9b18;});return _0x2e1012['length']===0x1?_0x2e1012[0x0]:undefined;}function columnNamesMatch(_0x2e29f3,_0x33b428){return normalizeIdentifier(_0x2e29f3)===normalizeIdentifier(_0x33b428);}function normalizeIdentifier(_0x2b9ec1){const _0x2923d0=a289_0x1af7;return _0x2b9ec1['replace'](/[`"]/g,'')[_0x2923d0(0x1b7)]()[_0x2923d0(0x1c1)]();}function isSqlClauseKeyword(_0x18195c){const _0x3f189f=a289_0x1af7;return new Set(['on','using',_0x3f189f(0x1ab),_0x3f189f(0x188),'inner',_0x3f189f(0x1ba),_0x3f189f(0x1c9),'full','cross',_0x3f189f(0x19b)])[_0x3f189f(0x19a)](_0x18195c);}function a289_0x1af7(_0x1a2cba,_0x51b4cc){_0x1a2cba=_0x1a2cba-0x188;const _0x545e11=a289_0x545e();let _0x1af7be=_0x545e11[_0x1a2cba];return _0x1af7be;}function stripOuterParentheses(_0x112d77){const _0x14d079=a289_0x1af7;let _0x57f26d=_0x112d77[_0x14d079(0x1b7)]();while(_0x57f26d[_0x14d079(0x1a9)]('(')&&_0x57f26d[_0x14d079(0x1b1)](')')){let _0x278d5f=0x0,_0x34aa78=!![];for(let _0x2cba85=0x0;_0x2cba85<_0x57f26d[_0x14d079(0x191)];_0x2cba85+=0x1){if(_0x57f26d[_0x2cba85]==='(')_0x278d5f+=0x1;if(_0x57f26d[_0x2cba85]===')')_0x278d5f-=0x1;if(_0x278d5f===0x0&&_0x2cba85<_0x57f26d[_0x14d079(0x191)]-0x1){_0x34aa78=![];break;}}if(!_0x34aa78||_0x278d5f!==0x0)break;_0x57f26d=_0x57f26d[_0x14d079(0x1c0)](0x1,-0x1)['trim']();}return _0x57f26d;}
|
|
1
|
+
(function(_0x25a497,_0x42f90d){const _0x4b226c=a289_0x468b,_0x334df9=_0x25a497();while(!![]){try{const _0x44f2e3=-parseInt(_0x4b226c(0xd2))/0x1+-parseInt(_0x4b226c(0x106))/0x2+-parseInt(_0x4b226c(0xfe))/0x3+-parseInt(_0x4b226c(0xe3))/0x4*(parseInt(_0x4b226c(0xf0))/0x5)+-parseInt(_0x4b226c(0x102))/0x6+parseInt(_0x4b226c(0xd6))/0x7+parseInt(_0x4b226c(0xdd))/0x8*(parseInt(_0x4b226c(0xd9))/0x9);if(_0x44f2e3===_0x42f90d)break;else _0x334df9['push'](_0x334df9['shift']());}catch(_0x47cf5d){_0x334df9['push'](_0x334df9['shift']());}}}(a289_0x4a61,0x337aa));function a289_0x468b(_0x589a66,_0x4e9437){_0x589a66=_0x589a66-0xc7;const _0x4a6135=a289_0x4a61();let _0x468b4d=_0x4a6135[_0x589a66];return _0x468b4d;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x390ffc,_0x4d2583){const _0x9e17e=a289_0x468b,_0x403bec=[],_0x7bc4f=normalizeSqlForStaticAnalysis(_0x390ffc),_0x70c320=(_0x7bc4f[_0x9e17e(0xe2)]?[]:extractJoinFacts(_0x7bc4f[_0x9e17e(0xee)]))[_0x9e17e(0xd8)](_0x25c30a=>{const _0x1cc34b=_0x9e17e;if(_0x25c30a['unsupportedPredicate']||_0x25c30a['columns'][_0x1cc34b(0xd0)]===0x0)return _0x403bec[_0x1cc34b(0xd3)]({'code':_0x1cc34b(0xf2),'table':_0x25c30a['table'],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x25c30a[_0x1cc34b(0x105)]??_0x1cc34b(0x10b)}),{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xeb)};const _0x442fe5=resolveTableMetadata(_0x4d2583,_0x25c30a[_0x1cc34b(0xed)]),_0x29b384=(_0x442fe5?.[_0x1cc34b(0x104)]??[])[_0x1cc34b(0xd8)](_0x9696f1=>({'index':_0x9696f1,'matchedPrefix':findEqualityPrefix(_0x9696f1['columns'],_0x25c30a[_0x1cc34b(0xc9)])}))[_0x1cc34b(0xcb)](_0x2f1d2f=>_0x2f1d2f['matchedPrefix'][_0x1cc34b(0xd0)]>0x0),_0x4c78c8=_0x29b384['reduce']((_0x2ada90,_0x3b6bce)=>!_0x2ada90||_0x3b6bce[_0x1cc34b(0x110)][_0x1cc34b(0xd0)]>_0x2ada90[_0x1cc34b(0x110)][_0x1cc34b(0xd0)]?_0x3b6bce:_0x2ada90,_0x29b384[0x0]);if(_0x4c78c8)return{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xde),'matchedIndex':{..._0x4c78c8[_0x1cc34b(0xf8)],'matchedPrefix':_0x4c78c8[_0x1cc34b(0x110)]}};const _0x48fb89=_0x442fe5?.['indexes'][_0x1cc34b(0xcb)](_0x5dbb41=>_0x5dbb41[_0x1cc34b(0xc9)][_0x1cc34b(0xd7)](_0x430229=>_0x25c30a[_0x1cc34b(0xc9)][_0x1cc34b(0xd7)](_0x5e5fb6=>columnNamesMatch(_0x430229,_0x5e5fb6))))??[];if(_0x48fb89[_0x1cc34b(0xd0)]>0x0)return _0x403bec['push']({'code':_0x1cc34b(0xf9),'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x1cc34b(0x108)}),{'table':_0x25c30a['table'],'alias':_0x25c30a['alias'],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xf4),'candidateIndexes':_0x48fb89};if(_0x442fe5&&_0x442fe5[_0x1cc34b(0xef)]!==![]&&_0x442fe5['indexes']['length']>0x0&&_0x25c30a[_0x1cc34b(0xc9)]['length']>0x0)return _0x403bec[_0x1cc34b(0xd3)]({'code':'JOIN_INDEX_MISSING','table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a['columns'],'status':_0x1cc34b(0xf4)};return _0x403bec['push']({'code':_0x1cc34b(0xfb),'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x442fe5?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x1cc34b(0x10d)}),{'table':_0x25c30a['table'],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a['columns'],'status':'unavailable'};});return{'checked':_0x70c320[_0x9e17e(0xd0)]>0x0,'joins':_0x70c320,'warnings':_0x403bec};}function extractJoinFacts(_0x326508){const _0x396448=a289_0x468b,_0x12f2f5=maskNestedQueries(stripSqlNoise(_0x326508)),_0x3f3669=maskQuotedIdentifiers(_0x12f2f5),_0xe57fa7=[],_0x533560=new Set(),_0x2ab49f=/\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 _0x41f5eb of _0x12f2f5['matchAll'](_0x2ab49f)){const _0x1458e5=_0x41f5eb[_0x396448(0xf8)]??0x0,_0x21c406=_0x41f5eb[0x0]['search'](/\bJOIN\b/i),_0xf36fe4=_0x1458e5+Math['max'](0x0,_0x21c406);if(!/^JOIN\b/i[_0x396448(0xe1)](_0x3f3669['slice'](_0xf36fe4)))continue;_0x533560[_0x396448(0x109)](_0xf36fe4);const _0x2a889a=normalizeIdentifier(_0x41f5eb[0x1]||'INNER'),_0x72e674=normalizeIdentifier(_0x41f5eb[0x2]??''),_0x37193c=normalizeIdentifier(_0x41f5eb[0x3]||_0x72e674[_0x396448(0xfa)]('.')['at'](-0x1)||_0x72e674),_0x330e91=[],_0x49a42d=_0x72e674===_0x396448(0xe8);let _0x2f9071=_0x2a889a===_0x396448(0xdc)||_0x2a889a===_0x396448(0xe5)||_0x49a42d,_0x5d3d12=_0x2f9071?_0x49a42d?_0x396448(0xcc):_0x2a889a['toUpperCase']()+_0x396448(0xc7):undefined;const _0x5bc63e=stripOuterParentheses(_0x41f5eb[0x4]??''),_0x155260=_0x5bc63e['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x5bc63e[_0x396448(0xf5)](MYBATIS_DYNAMIC_END_MARKER),_0xf9d466=_0x5bc63e[_0x396448(0xf5)](MYBATIS_INCLUDE_MARKER);_0x155260&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0x103));_0xf9d466&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0xd5));const _0x374960=_0x5bc63e[_0x396448(0xe6)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x396448(0xe6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x396448(0xe6)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x374960,'OR')&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0x10e));for(const _0x2a2982 of splitTopLevelAnd(_0x374960)){const _0x24644c=stripOuterParentheses(_0x2a2982);if(hasTopLevelKeyword(_0x24644c,'OR')){_0x2f9071=!![],_0x5d3d12??=_0x396448(0x10e);continue;}const _0x1b48b0=splitEquality(_0x24644c);if(!_0x1b48b0){containsColumnReference(_0x2a2982,_0x37193c)&&(_0x2f9071=!![]);continue;}const _0x41bf0c=parseDirectColumnReference(_0x1b48b0[0x0],_0x37193c),_0x36e8ff=parseDirectColumnReference(_0x1b48b0[0x1],_0x37193c),_0x13f510=containsColumnReference(_0x1b48b0[0x0],_0x37193c),_0x5636e8=containsColumnReference(_0x1b48b0[0x1],_0x37193c),_0x459024=_0x41bf0c&&!_0x5636e8?_0x41bf0c:_0x36e8ff&&!_0x13f510?_0x36e8ff:null;if(_0x459024&&!_0x330e91[_0x396448(0xf5)](_0x459024))_0x330e91[_0x396448(0xd3)](_0x459024);else!_0x459024&&containsColumnReference(_0x2a2982,_0x37193c)&&(_0x2f9071=!![]);}_0xe57fa7[_0x396448(0xd3)]({'table':_0x72e674,'alias':_0x37193c,'columns':_0x330e91,'unsupportedPredicate':_0x2f9071,'unsupportedReason':_0x5d3d12,'containsUnresolvedInclude':_0xf9d466,'position':_0xf36fe4});}for(const _0x4de30f of _0x3f3669[_0x396448(0xf3)](/\bJOIN\b/gi)){const _0x1c64ed=_0x4de30f[_0x396448(0xf8)]??0x0;if(_0x533560[_0x396448(0xff)](_0x1c64ed))continue;const _0x200c5b=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x12f2f5['slice'](_0x1c64ed+_0x4de30f[0x0][_0x396448(0xd0)])),_0x44248f=normalizeIdentifier(_0x200c5b?.[0x1]||_0x396448(0x101)),_0x24afdf=normalizeIdentifier(_0x200c5b?.[0x2]||''),_0xc30c8b=isSqlClauseKeyword(_0x24afdf)?_0x44248f['split']('.')['at'](-0x1)||_0x44248f:_0x24afdf||_0x44248f[_0x396448(0xfa)]('.')['at'](-0x1)||_0x44248f;_0xe57fa7['push']({'table':_0x44248f,'alias':_0xc30c8b,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1c64ed});}const _0x5ce0c6=_0x3f3669[_0x396448(0xf1)](MYBATIS_INCLUDE_MARKER);return _0x5ce0c6>=0x0&&!_0xe57fa7['some'](_0x5ad496=>_0x5ad496[_0x396448(0xec)])&&_0xe57fa7['push']({'table':_0x396448(0x101),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x396448(0xe9),'containsUnresolvedInclude':!![],'position':_0x5ce0c6}),_0xe57fa7[_0x396448(0xfc)]((_0x91cb53,_0x12d194)=>_0x91cb53[_0x396448(0xdb)]-_0x12d194[_0x396448(0xdb)]);}function stripSqlNoise(_0x3afd56){const _0x4b7cc1=a289_0x468b,_0x5a27bc=Array[_0x4b7cc1(0xfd)](_0x3afd56),_0x54de5b=(_0x21c4ca,_0x20d675)=>{for(let _0x2ed689=_0x21c4ca;_0x2ed689<_0x20d675;_0x2ed689+=0x1){_0x5a27bc[_0x2ed689]!=='\x0a'&&_0x5a27bc[_0x2ed689]!=='\x0d'&&(_0x5a27bc[_0x2ed689]='\x20');}};for(let _0x1852d5=0x0;_0x1852d5<_0x5a27bc[_0x4b7cc1(0xd0)];_0x1852d5+=0x1){const _0x34062f=_0x5a27bc[_0x1852d5],_0x199283=_0x5a27bc[_0x1852d5+0x1];if(_0x34062f==='\x27'||_0x34062f==='\x22'||_0x34062f==='`'){const _0x4e6638=_0x34062f,_0x2b2299=_0x1852d5;_0x1852d5+=0x1;while(_0x1852d5<_0x5a27bc['length']){if(_0x5a27bc[_0x1852d5]==='\x5c'&&_0x1852d5+0x1<_0x5a27bc[_0x4b7cc1(0xd0)]){_0x1852d5+=0x2;continue;}if(_0x5a27bc[_0x1852d5]!==_0x4e6638){_0x1852d5+=0x1;continue;}if(_0x5a27bc[_0x1852d5+0x1]===_0x4e6638){_0x1852d5+=0x2;continue;}break;}if(_0x4e6638==='\x27')_0x54de5b(_0x2b2299,Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]));continue;}if(_0x34062f==='-'&&_0x199283==='-'){const _0x1be631=_0x1852d5;while(_0x1852d5<_0x5a27bc[_0x4b7cc1(0xd0)]&&_0x5a27bc[_0x1852d5]!=='\x0a')_0x1852d5+=0x1;_0x54de5b(_0x1be631,_0x1852d5);continue;}if(_0x34062f==='/'&&_0x199283==='*'){const _0x13e6ea=_0x1852d5;_0x1852d5+=0x2;while(_0x1852d5<_0x5a27bc['length']&&!(_0x5a27bc[_0x1852d5]==='*'&&_0x5a27bc[_0x1852d5+0x1]==='/')){_0x1852d5+=0x1;}_0x1852d5=Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]-0x1),_0x54de5b(_0x13e6ea,_0x1852d5+0x1);continue;}if(_0x34062f==='#'&&_0x199283!=='{'){const _0x5e6a71=_0x1852d5;while(_0x1852d5<_0x5a27bc['length']&&_0x5a27bc[_0x1852d5]!=='\x0a')_0x1852d5+=0x1;_0x54de5b(_0x5e6a71,_0x1852d5);continue;}if((_0x34062f==='#'||_0x34062f==='$')&&_0x199283==='{'){const _0x227382=_0x1852d5;_0x1852d5+=0x2;while(_0x1852d5<_0x5a27bc['length']&&_0x5a27bc[_0x1852d5]!=='}')_0x1852d5+=0x1;_0x54de5b(_0x227382,Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]));}}return _0x5a27bc['join']('');}function maskQuotedIdentifiers(_0x365518){const _0x41834d=a289_0x468b,_0x1c4f88=Array[_0x41834d(0xfd)](_0x365518);for(let _0x2ae777=0x0;_0x2ae777<_0x1c4f88[_0x41834d(0xd0)];_0x2ae777+=0x1){const _0x5057c5=_0x1c4f88[_0x2ae777];if(_0x5057c5!=='\x22'&&_0x5057c5!=='`')continue;_0x2ae777+=0x1;while(_0x2ae777<_0x1c4f88['length']){if(_0x1c4f88[_0x2ae777]===_0x5057c5){if(_0x1c4f88[_0x2ae777+0x1]===_0x5057c5){_0x1c4f88[_0x2ae777]='\x20',_0x1c4f88[_0x2ae777+0x1]='\x20',_0x2ae777+=0x2;continue;}break;}_0x1c4f88[_0x2ae777]='\x20',_0x2ae777+=0x1;}}return _0x1c4f88[_0x41834d(0xf7)]('');}function maskNestedQueries(_0x220449){const _0x5ee8c8=a289_0x468b,_0xaf21d2=Array[_0x5ee8c8(0xfd)](_0x220449);for(let _0x415043=0x0;_0x415043<_0xaf21d2[_0x5ee8c8(0xd0)];_0x415043+=0x1){if(_0xaf21d2[_0x415043]!=='(')continue;const _0x3818b4=_0x220449[_0x5ee8c8(0xca)](_0x415043+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x5ee8c8(0xe1)](_0x3818b4))continue;let _0x4ad856=0x1,_0x382b1c=_0x415043+0x1;for(;_0x382b1c<_0xaf21d2[_0x5ee8c8(0xd0)]&&_0x4ad856>0x0;_0x382b1c+=0x1){if(_0xaf21d2[_0x382b1c]==='(')_0x4ad856+=0x1;if(_0xaf21d2[_0x382b1c]===')')_0x4ad856-=0x1;}if(_0x4ad856!==0x0)continue;for(let _0x595ed5=_0x415043;_0x595ed5<_0x382b1c;_0x595ed5+=0x1){_0xaf21d2[_0x595ed5]='\x20';}const _0x1cee27=_0x5ee8c8(0xe8);for(let _0x4a833a=0x0;_0x4a833a<_0x1cee27[_0x5ee8c8(0xd0)]&&_0x415043+_0x4a833a<_0x382b1c;_0x4a833a+=0x1){_0xaf21d2[_0x415043+_0x4a833a]=_0x1cee27[_0x4a833a];}_0x415043=_0x382b1c-0x1;}return _0xaf21d2[_0x5ee8c8(0xf7)]('');}function a289_0x4a61(){const _0x5c101d=['min','length','toLowerCase','68530LOdEgi','push','alias','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','1149771eUUcWh','some','map','36441UnlsfY','where','position','right','2776jpCLaN','covered','trim','cross','test','error','19000eBsAVW','max','full','replaceAll','replace','__sq__','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','(?:^|[^\x5cw$])','unavailable','containsUnresolvedInclude','table','sql','metadataAvailable','410wFmvIP','indexOf','JOIN_PREDICATE_UNSUPPORTED','matchAll','warning','includes','left','join','index','JOIN_INDEX_NOT_USABLE','split','INDEX_METADATA_UNAVAILABLE','sort','from','359223zYAJfv','has','natural','unknown','2528856PwnVYs','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','indexes','unsupportedReason','718302gtpmDs','\x5cs*\x5c.\x5cs*[\x5cw$]+','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','add','exec','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x5c$&','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','tableName','matchedPrefix','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','inner','columns','slice','filter','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','toUpperCase','endsWith'];a289_0x4a61=function(){return _0x5c101d;};return a289_0x4a61();}function splitTopLevelAnd(_0x880013){const _0x1033db=a289_0x468b,_0x40645b=[];let _0x5876bf=0x0,_0x5cba2b=0x0;for(let _0x156b07=0x0;_0x156b07<_0x880013[_0x1033db(0xd0)];_0x156b07+=0x1){const _0x5c5508=_0x880013[_0x156b07];if(_0x5c5508==='(')_0x5876bf+=0x1;if(_0x5c5508===')')_0x5876bf=Math['max'](0x0,_0x5876bf-0x1);_0x5876bf===0x0&&_0x880013[_0x1033db(0xca)](_0x156b07)['match'](/^AND\b/i)&&(_0x156b07===0x0||/\s/['test'](_0x880013[_0x156b07-0x1]??''))&&(_0x40645b[_0x1033db(0xd3)](_0x880013['slice'](_0x5cba2b,_0x156b07)[_0x1033db(0xdf)]()),_0x156b07+=0x2,_0x5cba2b=_0x156b07+0x1);}const _0x223d13=_0x880013[_0x1033db(0xca)](_0x5cba2b)['trim']();if(_0x223d13)_0x40645b[_0x1033db(0xd3)](_0x223d13);return _0x40645b;}function hasTopLevelKeyword(_0x32960f,_0x3fd956){const _0x4903c7=a289_0x468b;let _0x32d006=0x0;for(let _0x49c5ac=0x0;_0x49c5ac<_0x32960f[_0x4903c7(0xd0)];_0x49c5ac+=0x1){const _0x589ef0=_0x32960f[_0x49c5ac];if(_0x589ef0==='(')_0x32d006+=0x1;if(_0x589ef0===')')_0x32d006=Math[_0x4903c7(0xe4)](0x0,_0x32d006-0x1);if(_0x32d006!==0x0)continue;const _0x589e13=_0x32960f[_0x4903c7(0xca)](_0x49c5ac,_0x49c5ac+_0x3fd956['length']),_0x19a220=_0x32960f[_0x49c5ac-0x1]??'\x20',_0x487ed8=_0x32960f[_0x49c5ac+_0x3fd956['length']]??'\x20';if(_0x589e13[_0x4903c7(0xcd)]()===_0x3fd956[_0x4903c7(0xcd)]()&&!/[\w$]/[_0x4903c7(0xe1)](_0x19a220)&&!/[\w$]/[_0x4903c7(0xe1)](_0x487ed8))return!![];}return![];}function splitEquality(_0x344fe4){const _0x4eab2e=a289_0x468b,_0x891963=stripOuterParentheses(_0x344fe4);let _0x35963b=0x0,_0x544b6b;for(let _0x1fe6d9=0x0;_0x1fe6d9<_0x891963[_0x4eab2e(0xd0)];_0x1fe6d9+=0x1){const _0x5df85a=_0x891963[_0x1fe6d9];if(_0x5df85a==='(')_0x35963b+=0x1;if(_0x5df85a===')')_0x35963b=Math[_0x4eab2e(0xe4)](0x0,_0x35963b-0x1);const _0x4b43de=_0x891963[_0x1fe6d9-0x1]??'',_0x1e04d3=_0x891963[_0x1fe6d9+0x1]??'';if(_0x5df85a==='='&&_0x35963b===0x0&&!/[!<>=:]/[_0x4eab2e(0xe1)](_0x4b43de)&&_0x1e04d3!=='='){if(_0x544b6b!==undefined)return null;_0x544b6b=_0x1fe6d9;}}return _0x544b6b===undefined?null:[_0x891963['slice'](0x0,_0x544b6b)[_0x4eab2e(0xdf)](),_0x891963[_0x4eab2e(0xca)](_0x544b6b+0x1)[_0x4eab2e(0xdf)]()];}function parseDirectColumnReference(_0x7d65cd,_0x33b103){const _0xeea628=a289_0x468b,_0x3a15ca=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xeea628(0x10a)](stripOuterParentheses(_0x7d65cd));if(!_0x3a15ca)return null;if(normalizeIdentifier(_0x3a15ca[0x1]??'')!==normalizeIdentifier(_0x33b103))return null;return normalizeIdentifier(_0x3a15ca[0x2]??'');}function containsColumnReference(_0x5d9df5,_0x2d451e){const _0x1af310=a289_0x468b,_0x3ae670=_0x5d9df5[_0x1af310(0xe7)](/[`"]/g,''),_0x3b083a=_0x2d451e[_0x1af310(0xe7)](/[.*+?^${}()|[\]\\]/g,_0x1af310(0x10c));return new RegExp(_0x1af310(0xea)+_0x3b083a+_0x1af310(0x107),'i')[_0x1af310(0xe1)](_0x3ae670);}function findEqualityPrefix(_0x49a02f,_0x4a0a9b){const _0x20c867=new Set(_0x4a0a9b['map'](normalizeIdentifier)),_0xce6f0=[];for(const _0x48b2e9 of _0x49a02f){if(!_0x20c867['has'](normalizeIdentifier(_0x48b2e9)))break;_0xce6f0['push'](_0x48b2e9);}return _0xce6f0;}function resolveTableMetadata(_0x32939c,_0x4256d8){const _0x385214=a289_0x468b,_0x3c7505=normalizeIdentifier(_0x4256d8),_0xf6dc0e=_0x32939c['filter'](_0x3cd3af=>normalizeIdentifier(_0x3cd3af[_0x385214(0x10f)])===_0x3c7505);if(_0xf6dc0e[_0x385214(0xd0)]===0x1)return _0xf6dc0e[0x0];const _0x29da74=_0x3c7505[_0x385214(0xf5)]('.'),_0x409efb=_0x3c7505[_0x385214(0xfa)]('.')['at'](-0x1),_0x3e25d7=_0x32939c[_0x385214(0xcb)](_0x1f011b=>{const _0x3e1db5=_0x385214,_0x456978=normalizeIdentifier(_0x1f011b[_0x3e1db5(0x10f)]);if(_0x29da74&&_0x456978['includes']('.'))return![];return _0x456978[_0x3e1db5(0xfa)]('.')['at'](-0x1)===_0x409efb;});return _0x3e25d7[_0x385214(0xd0)]===0x1?_0x3e25d7[0x0]:undefined;}function columnNamesMatch(_0x40adaf,_0x47f27b){return normalizeIdentifier(_0x40adaf)===normalizeIdentifier(_0x47f27b);}function normalizeIdentifier(_0x4d3aea){const _0x4697b8=a289_0x468b;return _0x4d3aea[_0x4697b8(0xe7)](/[`"]/g,'')[_0x4697b8(0xdf)]()[_0x4697b8(0xd1)]();}function isSqlClauseKeyword(_0x2f1ef7){const _0x2cd4e2=a289_0x468b;return new Set(['on','using',_0x2cd4e2(0xda),_0x2cd4e2(0xf7),_0x2cd4e2(0xc8),_0x2cd4e2(0xf6),_0x2cd4e2(0xdc),_0x2cd4e2(0xe5),_0x2cd4e2(0xe0),_0x2cd4e2(0x100)])[_0x2cd4e2(0xff)](_0x2f1ef7);}function stripOuterParentheses(_0x387440){const _0x12b830=a289_0x468b;let _0x12ee9d=_0x387440['trim']();while(_0x12ee9d['startsWith']('(')&&_0x12ee9d[_0x12b830(0xce)](')')){let _0x692cb=0x0,_0x176c75=!![];for(let _0x55ef67=0x0;_0x55ef67<_0x12ee9d['length'];_0x55ef67+=0x1){if(_0x12ee9d[_0x55ef67]==='(')_0x692cb+=0x1;if(_0x12ee9d[_0x55ef67]===')')_0x692cb-=0x1;if(_0x692cb===0x0&&_0x55ef67<_0x12ee9d[_0x12b830(0xd0)]-0x1){_0x176c75=![];break;}}if(!_0x176c75||_0x692cb!==0x0)break;_0x12ee9d=_0x12ee9d[_0x12b830(0xca)](0x1,-0x1)['trim']();}return _0x12ee9d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a290_0x2d1e23=a290_0x19f4;function a290_0x646a(){const _0x279131=['1972040CniNDS','2772702PeFRoX','/sql','sql-trash','5289759stgyYU','1446784iisWfe','3070034TdVmsC','299016davfnX','3wwcVRZ','sql.lock.json','5970712NxkwNN','7DlCasY'];a290_0x646a=function(){return _0x279131;};return a290_0x646a();}function a290_0x19f4(_0x435326,_0x46de44){_0x435326=_0x435326-0x198;const _0x646ab0=a290_0x646a();let _0x19f40b=_0x646ab0[_0x435326];return _0x19f40b;}(function(_0x29dd7f,_0x287601){const _0x176b46=a290_0x19f4,_0x5988cb=_0x29dd7f();while(!![]){try{const _0x540b1f=-parseInt(_0x176b46(0x19d))/0x1+parseInt(_0x176b46(0x19c))/0x2*(parseInt(_0x176b46(0x19e))/0x3)+parseInt(_0x176b46(0x19b))/0x4+-parseInt(_0x176b46(0x1a2))/0x5+-parseInt(_0x176b46(0x1a3))/0x6+parseInt(_0x176b46(0x1a1))/0x7*(parseInt(_0x176b46(0x1a0))/0x8)+-parseInt(_0x176b46(0x19a))/0x9;if(_0x540b1f===_0x287601)break;else _0x5988cb['push'](_0x5988cb['shift']());}catch(_0x2ef921){_0x5988cb['push'](_0x5988cb['shift']());}}}(a290_0x646a,0xdbab0));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a290_0x2d1e23(0x19f),TRASH_DIR_NAME=a290_0x2d1e23(0x199);export function loadSqlProjectConfig(_0x2a2175,_0x592d21){const _0x2a8868=a290_0x2d1e23,_0x1b1a50=resolve(_0x592d21??findProjectRootDirectory()),_0x1cc292=DOT_DIR+_0x2a8868(0x198),_0x16c59a=_0x1cc292+'/'+_0x2a2175;return{'projectRoot':_0x1b1a50,'appCode':_0x2a2175,'sqlWorkspaceRoot':_0x1cc292,'sqlRoot':_0x16c59a,'sqlRootDir':resolve(_0x1b1a50,DOT_DIR,'sql',_0x2a2175),'lockFilePath':resolve(_0x1b1a50,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1b1a50,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55d473,_0x749abe){const _0x40efcb=a291_0xec3d,_0x52107f=_0x55d473();while(!![]){try{const _0x599c81=parseInt(_0x40efcb(0xb9))/0x1+-parseInt(_0x40efcb(0xac))/0x2*(-parseInt(_0x40efcb(0xbc))/0x3)+-parseInt(_0x40efcb(0xc3))/0x4+parseInt(_0x40efcb(0xbe))/0x5+-parseInt(_0x40efcb(0xb8))/0x6+-parseInt(_0x40efcb(0xb3))/0x7*(parseInt(_0x40efcb(0xab))/0x8)+parseInt(_0x40efcb(0xb5))/0x9;if(_0x599c81===_0x749abe)break;else _0x52107f['push'](_0x52107f['shift']());}catch(_0x4c11ae){_0x52107f['push'](_0x52107f['shift']());}}}(a291_0x1cbd,0x2fe7b));function a291_0x1cbd(){const _0x26dcdf=['sqlName','dbName','push','1433816TmxYtj','name','8waWwdf','2SmkTEH','dbId','ENOENT','sqlRootDir','mode','split','slice','1342075theGlp','isDirectory','2768769hQRfXw','replace','mybatisXml','1070760hloeFW','108381SbPoJH','sql','sqlCode','813519pdBJWU','.xml','1188315WyomAz','length'];a291_0x1cbd=function(){return _0x26dcdf;};return a291_0x1cbd();}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x70da80){const _0x29d11b=a291_0xec3d;if(_0x70da80==='.sql')return _0x29d11b(0xba);if(_0x70da80===_0x29d11b(0xbd))return _0x29d11b(0xb7);return undefined;}async function scanSqlFilesRecursively(_0x576f39,_0x401077){const _0x375893=a291_0xec3d,_0x566552=[];try{const _0x26d2c9=await readdir(_0x576f39,{'withFileTypes':!![]});for(const _0x46af10 of _0x26d2c9){const _0x5158a5=join(_0x576f39,_0x46af10[_0x375893(0xaa)]);if(_0x46af10[_0x375893(0xb4)]()){_0x566552[_0x375893(0xc2)](...await scanSqlFilesRecursively(_0x5158a5,_0x401077));continue;}if(!_0x46af10['isFile']())continue;const _0x13b3ea=extname(_0x46af10[_0x375893(0xaa)])['toLowerCase'](),_0xbfc813=extensionToMode(_0x13b3ea);if(!_0xbfc813)continue;const _0x24bca0=relative(_0x401077,_0x5158a5)[_0x375893(0xb6)](/\\/g,'/'),_0x5eaedd=_0x24bca0[_0x375893(0xb1)]('/')['filter'](Boolean),_0xc64ec3=parseSqlPath(_0x5eaedd,_0x46af10[_0x375893(0xaa)],_0x13b3ea);if(!_0xc64ec3)continue;_0x566552[_0x375893(0xc2)]({'sqlCode':_0xc64ec3[_0x375893(0xbb)],'sqlName':_0xc64ec3[_0x375893(0xc0)],'dbDirectory':_0x5eaedd[0x0],'filePath':_0x5158a5,'relativePath':_0x24bca0,'lockKey':_0xc64ec3[_0x375893(0xbb)],'mode':_0xbfc813});}}catch(_0x42d2bc){if(_0x42d2bc['code']!==_0x375893(0xae))throw _0x42d2bc;}return _0x566552;}export async function scanLocalSqlQueries(_0x58c7d9){const _0x418b3c=a291_0xec3d;return scanSqlFilesRecursively(_0x58c7d9[_0x418b3c(0xaf)],_0x58c7d9['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x52f180,_0x4f14bd,_0x32afd0){const _0x4c6859=a291_0xec3d,_0xaee4c0=_0x32afd0?.['path']||(_0x32afd0?.[_0x4c6859(0xc0)]||_0x32afd0?.[_0x4c6859(0xc1)]?buildSqlRelativePath(_0x4f14bd,_0x32afd0?.[_0x4c6859(0xc0)],_0x32afd0?.[_0x4c6859(0xc1)],_0x32afd0?.[_0x4c6859(0xb0)]||_0x4c6859(0xba),_0x32afd0?.[_0x4c6859(0xad)]):buildDefaultSqlFileName(_0x4f14bd,_0x32afd0?.['mode']||_0x4c6859(0xba)));return join(_0x52f180[_0x4c6859(0xaf)],_0xaee4c0);}export async function directoryExists(_0x177c11){const _0x488b9f=a291_0xec3d;try{const _0x5e0fcb=await stat(_0x177c11);return _0x5e0fcb[_0x488b9f(0xb4)]();}catch{return![];}}function a291_0xec3d(_0x18bea8,_0x39c1e1){_0x18bea8=_0x18bea8-0xaa;const _0x1cbdba=a291_0x1cbd();let _0xec3d1c=_0x1cbdba[_0x18bea8];return _0xec3d1c;}function parseSqlPath(_0x8b3375,_0x2d6f27,_0x3b093e){const _0xc56afb=a291_0xec3d,_0xa46082=_0x2d6f27[_0xc56afb(0xb2)](0x0,-_0x3b093e[_0xc56afb(0xbf)]);if(_0x8b3375[_0xc56afb(0xbf)]<0x2)return null;const _0xee63b3=_0xa46082['indexOf']('_');if(_0xee63b3<=0x0||_0xee63b3>=_0xa46082['length']-0x1)return null;const _0x2a1de9=_0xa46082[_0xc56afb(0xb2)](0x0,_0xee63b3);if(!isLikelySqlCode(_0x2a1de9))return null;return{'sqlCode':_0x2a1de9,'sqlName':_0xa46082[_0xc56afb(0xb2)](_0xee63b3+0x1)};}function isLikelySqlCode(_0x706f5f){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x706f5f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a292_0x2f3b(_0x2f5124,_0x599aa5){_0x2f5124=_0x2f5124-0x107;const _0x92d56=a292_0x92d5();let _0x2f3b4d=_0x92d56[_0x2f5124];return _0x2f3b4d;}(function(_0x30cf28,_0x17cd54){const _0x2ee314=a292_0x2f3b,_0xf57b12=_0x30cf28();while(!![]){try{const _0x3dbbce=parseInt(_0x2ee314(0x10b))/0x1*(-parseInt(_0x2ee314(0x113))/0x2)+parseInt(_0x2ee314(0x107))/0x3*(-parseInt(_0x2ee314(0x10e))/0x4)+parseInt(_0x2ee314(0x112))/0x5*(parseInt(_0x2ee314(0x10f))/0x6)+-parseInt(_0x2ee314(0x109))/0x7+-parseInt(_0x2ee314(0x10d))/0x8+-parseInt(_0x2ee314(0x111))/0x9+parseInt(_0x2ee314(0x10a))/0xa*(parseInt(_0x2ee314(0x115))/0xb);if(_0x3dbbce===_0x17cd54)break;else _0xf57b12['push'](_0xf57b12['shift']());}catch(_0x2c2b8){_0xf57b12['push'](_0xf57b12['shift']());}}}(a292_0x92d5,0x4cad6));import{readFile}from'node:fs/promises';import a292_0x3d4fae from'node:crypto';export function computeSqlContentHash(_0x4d208b){const _0x32eb22=a292_0x2f3b;return a292_0x3d4fae[_0x32eb22(0x10c)]('md5')[_0x32eb22(0x114)](_0x4d208b)[_0x32eb22(0x108)](_0x32eb22(0x116));}export async function computeSqlFileHash(_0x49b40c){const _0x9db644=a292_0x2f3b,_0x38b444=await readFile(_0x49b40c,_0x9db644(0x110));return computeSqlContentHash(_0x38b444);}function a292_0x92d5(){const _0x2b9a08=['24TVvxnX','utf8','1664406zjVOkh','98390Qiaboo','7408fVMCwb','update','4873PLzyTR','hex','3SzHScx','digest','1406419wOVcSj','42290RjRGjx','136pplkkv','createHash','1027944oJRApv','2480004thxZlS'];a292_0x92d5=function(){return _0x2b9a08;};return a292_0x92d5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10a308,_0x445f7d){const _0x5b39ba=a293_0x572e,_0x2f31f0=_0x10a308();while(!![]){try{const _0x2c1576=parseInt(_0x5b39ba(0xef))/0x1*(-parseInt(_0x5b39ba(0xec))/0x2)+parseInt(_0x5b39ba(0xe4))/0x3+-parseInt(_0x5b39ba(0xe2))/0x4+parseInt(_0x5b39ba(0xe0))/0x5*(parseInt(_0x5b39ba(0xdd))/0x6)+parseInt(_0x5b39ba(0xea))/0x7*(parseInt(_0x5b39ba(0xe7))/0x8)+parseInt(_0x5b39ba(0xdc))/0x9+parseInt(_0x5b39ba(0xed))/0xa*(-parseInt(_0x5b39ba(0xe8))/0xb);if(_0x2c1576===_0x445f7d)break;else _0x2f31f0['push'](_0x2f31f0['shift']());}catch(_0x1c8317){_0x2f31f0['push'](_0x2f31f0['shift']());}}}(a293_0x442b,0xdf1a9));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a293_0x442b(){const _0x29663f=['\x22\x20vs\x20lock\x20\x22','utf8','7283885oksAkK','stringify','558060INCyvP','ENOENT','407217CYRGXG','sqlRoot','apps','2224cXnGoM','182677SHXIIL','lastSync','10129eoimSx','code','106KEapbM','830UHDrwU','\x22.\x20','7907SoNVKU',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','7704162vOBNkj','6ZcgGzw'];a293_0x442b=function(){return _0x29663f;};return a293_0x442b();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x1261e4,_0x43e01b,_0x2515a2,_0x3e32b8){const _0x430578=a293_0x572e,_0x1d0cce=_0x1261e4??createEmptySqlLock();let _0x2065ae=_0x1d0cce['apps'][_0x43e01b];if(!_0x2065ae)return _0x2065ae={'sqlRoot':_0x2515a2,'lastSync':'','sqls':{}},_0x1d0cce[_0x430578(0xe6)][_0x43e01b]=_0x2065ae,{'lockData':_0x1d0cce,'appLock':_0x2065ae};if(!_0x2065ae[_0x430578(0xe5)])_0x2065ae[_0x430578(0xe5)]=_0x2515a2;else{if(_0x2065ae[_0x430578(0xe5)]!==_0x2515a2)throw new Error(_0x3e32b8+_0x430578(0xdb)+_0x2515a2+_0x430578(0xde)+_0x2065ae[_0x430578(0xe5)]+_0x430578(0xee)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x2065ae['sqls']&&(_0x2065ae['sqls']={}),!_0x2065ae[_0x430578(0xe9)]&&(_0x2065ae[_0x430578(0xe9)]=''),{'lockData':_0x1d0cce,'appLock':_0x2065ae};}function a293_0x572e(_0x2ad66d,_0x5650e2){_0x2ad66d=_0x2ad66d-0xdb;const _0x442b36=a293_0x442b();let _0x572e18=_0x442b36[_0x2ad66d];return _0x572e18;}export async function readSqlLockFile(_0x56cdbf){const _0x107e6a=a293_0x572e;try{const _0x430ba3=await readFile(_0x56cdbf,_0x107e6a(0xdf));return JSON['parse'](_0x430ba3);}catch(_0x2ef28e){if(_0x2ef28e[_0x107e6a(0xeb)]===_0x107e6a(0xe3))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x2ef28e));}}export async function writeSqlLockFile(_0x4853c2,_0x38d8bb){const _0x4bbcbb=a293_0x572e;await mkdir(dirname(_0x4853c2),{'recursive':!![]}),await writeFile(_0x4853c2,JSON[_0x4bbcbb(0xe1)](_0x38d8bb,null,0x2),_0x4bbcbb(0xdf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38bab1,_0xba7efb){const _0x174ded=a295_0x5c31,_0x3bb649=_0x38bab1();while(!![]){try{const _0x4b4d52=parseInt(_0x174ded(0x1fa))/0x1+parseInt(_0x174ded(0x1f8))/0x2*(parseInt(_0x174ded(0x1fd))/0x3)+parseInt(_0x174ded(0x1f0))/0x4*(parseInt(_0x174ded(0x1f2))/0x5)+parseInt(_0x174ded(0x1ff))/0x6+parseInt(_0x174ded(0x1ee))/0x7*(parseInt(_0x174ded(0x1fc))/0x8)+-parseInt(_0x174ded(0x1f4))/0x9*(parseInt(_0x174ded(0x1f7))/0xa)+-parseInt(_0x174ded(0x1fb))/0xb;if(_0x4b4d52===_0xba7efb)break;else _0x3bb649['push'](_0x3bb649['shift']());}catch(_0x566a61){_0x3bb649['push'](_0x3bb649['shift']());}}}(a295_0x9601,0xd8145));import{detectSqlSourceMode}from'../../core/sql-validator.js';export function detectSqlMode(_0xfd1cfd){return detectSqlSourceMode(_0xfd1cfd);}export function getSqlFileExtension(_0x41d892){const _0x4ba686=a295_0x5c31;return _0x41d892===_0x4ba686(0x1f1)?_0x4ba686(0x1ef):_0x4ba686(0x1f5);}function a295_0x5c31(_0x1e2cf7,_0x510a4b){_0x1e2cf7=_0x1e2cf7-0x1ee;const _0x960169=a295_0x9601();let _0x5c31fc=_0x960169[_0x1e2cf7];return _0x5c31fc;}export function buildDefaultSqlFileName(_0x294d77,_0x4e2808){return''+_0x294d77+getSqlFileExtension(_0x4e2808);}export function sanitizeSqlPathSegment(_0x3d7a37,_0x3bd840){const _0x2cb773=a295_0x5c31,_0x36c037=String(_0x3d7a37??'')['trim'](),_0x4d6b56=_0x36c037['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2cb773(0x1f9)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x2cb773(0x1f9)](/^\.+/,'')[_0x2cb773(0x1f9)](/\.+$/,'')['replace'](/^-+/,'')[_0x2cb773(0x1f9)](/-+$/,'');return _0x4d6b56||_0x3bd840;}function a295_0x9601(){const _0x3d815e=['unknown-db','15116814oFjkol','.sql','db-','10RJLbNr','1658662yWLbzC','replace','874880KFteZI','29338045wFmXkb','12057160UaaWVG','3UJVnEj','unknown-sql','5438130rCoTbO','7fxzTLP','.xml','4456364nVrICR','mybatisXml','5Bjuyvi'];a295_0x9601=function(){return _0x3d815e;};return a295_0x9601();}export function buildDbDirectoryName(_0x17b27c,_0x4a5c54){const _0x4e102e=a295_0x5c31;return sanitizeSqlPathSegment(_0x17b27c,_0x4a5c54!=null?_0x4e102e(0x1f6)+_0x4a5c54:_0x4e102e(0x1f3));}export function buildSqlRelativePath(_0x2d3756,_0x50a917,_0x41e544,_0x150837,_0x419d3d){const _0x2e842a=a295_0x5c31,_0x54724c=buildDbDirectoryName(_0x41e544,_0x419d3d),_0x5a3967=sanitizeSqlPathSegment(_0x2d3756,_0x2e842a(0x1fe)),_0x328324=sanitizeSqlPathSegment(_0x50a917,_0x5a3967);return _0x54724c+'/'+_0x5a3967+'_'+_0x328324+getSqlFileExtension(_0x150837);}
|