@lovrabet/rabetbase-cli 2.5.5-beta.2 → 2.5.5-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/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/detail.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.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/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.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/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/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.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +3 -3
- package/skills/rabetbase/guides/independent-deployment.md +11 -1
- package/skills/rabetbase/references/rabetbase-config.md +16 -19
- package/skills/rabetbase/references/rabetbase-menu-visibility-update.md +5 -4
- package/skills/rabetbase/references/rabetbase-workspace.md +3 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a288_0x543aa7=a288_0x3984;(function(_0x5cb20a,_0x28237c){const _0x554177=a288_0x3984,_0x2ee434=_0x5cb20a();while(!![]){try{const _0x1a3161=-parseInt(_0x554177(0x185))/0x1*(-parseInt(_0x554177(0x176))/0x2)+-parseInt(_0x554177(0x18c))/0x3+-parseInt(_0x554177(0x175))/0x4*(parseInt(_0x554177(0x192))/0x5)+parseInt(_0x554177(0x1a6))/0x6*(parseInt(_0x554177(0x195))/0x7)+parseInt(_0x554177(0x174))/0x8+-parseInt(_0x554177(0x173))/0x9+parseInt(_0x554177(0x177))/0xa;if(_0x1a3161===_0x28237c)break;else _0x2ee434['push'](_0x2ee434['shift']());}catch(_0x42ac45){_0x2ee434['push'](_0x2ee434['shift']());}}}(a288_0x1268,0xb3fd3));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';function a288_0x3984(_0x5c606e,_0x513486){_0x5c606e=_0x5c606e-0x171;const _0x12686c=a288_0x1268();let _0x3984d5=_0x12686c[_0x5c606e];return _0x3984d5;}import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a288_0x543aa7(0x1a2);export const INSTANT_API_POLICY_FILE_NAME=a288_0x543aa7(0x182);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x42ed75,_0x53b88b,_0x1f2aaa){return new CliError(_0x42ed75,0x1,_0x53b88b,_0x1f2aaa);}export function loadInstantApiPolicyLocalConfig(_0x57323d,_0x13ac93){assertSafeAppCode(_0x57323d);const _0xbe227e=resolve(_0x13ac93??findProjectRootDirectory()),_0x3a13a0=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x57323d+'/'+INSTANT_API_POLICY_FILE_NAME,_0x5e67e9=resolve(_0xbe227e,INSTANT_API_POLICY_RELATIVE_ROOT,_0x57323d),_0xa5de7a=resolve(_0x5e67e9,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0xbe227e,'appCode':_0x57323d,'policyRoot':_0x5e67e9,'policyFilePath':_0xa5de7a,'policyRelativePath':_0x3a13a0};}export function createDefaultInstantApiPolicyConfig(_0x2d0dba,_0x55e0c5=a288_0x543aa7(0x172)){return assertSafeAppCode(_0x2d0dba),{'version':'2','appCode':_0x2d0dba,'defaults':{'instantApi':_0x55e0c5},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x974e69){const _0xd81090=a288_0x543aa7;let _0x589b26;try{_0x589b26=await stat(_0x974e69[_0xd81090(0x1a5)]);}catch(_0x3bd556){throw instantApiPolicyError(_0xd81090(0x194),_0xd81090(0x17a)+_0x974e69[_0xd81090(0x1a5)],'Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.');}if(!_0x589b26[_0xd81090(0x19f)]())throw instantApiPolicyError(_0xd81090(0x180),_0xd81090(0x19d)+_0x974e69[_0xd81090(0x1a5)]);if(_0x589b26[_0xd81090(0x1a3)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0xd81090(0x17f));let _0x403dd1;try{_0x403dd1=await readFile(_0x974e69[_0xd81090(0x1a5)]);}catch{throw instantApiPolicyError(_0xd81090(0x19c),_0xd81090(0x17b)+_0x974e69[_0xd81090(0x1a5)]);}if(_0x403dd1[_0xd81090(0x184)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0xd81090(0x1a7),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0xac2811;try{_0xac2811=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0xd81090(0x199)](_0x403dd1);}catch{throw instantApiPolicyError(_0xd81090(0x180),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x974e69[_0xd81090(0x1a5)]);}let _0x425731;try{_0x425731=JSON[_0xd81090(0x19a)](_0xac2811);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x974e69[_0xd81090(0x1a5)]);}return assertLocalPolicyContract(_0x425731,_0x974e69[_0xd81090(0x18a)]);}export async function writeInstantApiPolicyConfigFile(_0x17f035,_0x344d58,_0x1ec3cd={}){const _0x4aaf7b=a288_0x543aa7,_0x3a3aae=assertLocalPolicyContract(_0x344d58,_0x17f035[_0x4aaf7b(0x18a)]),_0x2b2a2d=JSON[_0x4aaf7b(0x1a1)](_0x3a3aae,null,0x2)+'\x0a';if(Buffer[_0x4aaf7b(0x184)](_0x2b2a2d,_0x4aaf7b(0x17c))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x4aaf7b(0x1a7),_0x4aaf7b(0x17f));await mkdir(_0x17f035['policyRoot'],{'recursive':!![]});let _0x34b16d;try{_0x34b16d=await readFile(_0x17f035[_0x4aaf7b(0x1a5)],_0x4aaf7b(0x17c));}catch(_0x35cd09){if(!isMissingFile(_0x35cd09))throw instantApiPolicyError('instant_api_policy_file_unreadable',_0x4aaf7b(0x179)+_0x17f035[_0x4aaf7b(0x1a5)]);}if(_0x34b16d===_0x2b2a2d)return{'action':'unchanged','filePath':_0x17f035[_0x4aaf7b(0x1a5)]};if(_0x34b16d!==undefined&&!_0x1ec3cd[_0x4aaf7b(0x181)])throw instantApiPolicyError('instant_api_policy_file_exists','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20'+_0x17f035[_0x4aaf7b(0x1a5)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x34b16d===undefined)try{return await writeFile(_0x17f035[_0x4aaf7b(0x1a5)],_0x2b2a2d,{'encoding':_0x4aaf7b(0x17c),'flag':'wx'}),{'action':_0x4aaf7b(0x17e),'filePath':_0x17f035[_0x4aaf7b(0x1a5)]};}catch(_0x362ddf){if(!isAlreadyExists(_0x362ddf))throw instantApiPolicyError(_0x4aaf7b(0x18d),_0x4aaf7b(0x17d)+_0x17f035[_0x4aaf7b(0x1a5)]);if(!_0x1ec3cd['force'])throw instantApiPolicyError(_0x4aaf7b(0x1a8),_0x4aaf7b(0x1a0)+_0x17f035[_0x4aaf7b(0x1a5)],'Review\x20the\x20file\x20before\x20retrying.');}const _0xb0bfa7=resolve(dirname(_0x17f035[_0x4aaf7b(0x1a5)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process['pid']+'.'+randomUUID()+_0x4aaf7b(0x191));try{await writeFile(_0xb0bfa7,_0x2b2a2d,{'encoding':_0x4aaf7b(0x17c),'flag':'wx'}),await rename(_0xb0bfa7,_0x17f035['policyFilePath']);}catch{await unlink(_0xb0bfa7)[_0x4aaf7b(0x187)](()=>undefined);throw instantApiPolicyError(_0x4aaf7b(0x18d),_0x4aaf7b(0x197)+_0x17f035['policyFilePath']);}return{'action':_0x4aaf7b(0x19b),'filePath':_0x17f035[_0x4aaf7b(0x1a5)]};}function assertSafeAppCode(_0x1e6552){const _0x58e801=_0x1e6552['trim']();if(!_0x58e801||_0x58e801!==_0x1e6552||_0x58e801['length']>0x64||_0x58e801==='.'||_0x58e801==='..'||_0x58e801['includes']('/')||_0x58e801['includes']('\x5c')||_0x58e801['includes']('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.');}function a288_0x1268(){const _0x224ea1=['62nGtOfS','rules','catch','instant_api_policy_defaults_invalid','instant_api_policy_json_invalid','appCode','version','336807vpcxrN','instant_api_policy_file_unwritable','EEXIST','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','instant_api_policy_version_invalid','.tmp','263990eYDZfr','ENOENT','instant_api_policy_file_missing','7QFbMJF','instantApi','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','isArray','decode','parse','overwritten','instant_api_policy_file_unreadable','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','isFile','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','stringify','.rabetbase/instant-api-policy','size','code','policyFilePath','7984554jgOeRe','instant_api_policy_file_too_large','instant_api_policy_file_exists','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','object','instant_api_policy_rules_invalid','allow','12972123VxwZBp','5127776zINWKm','68Licqzn','7926JGWtXT','9709800hWDRcS','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','utf8','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','created','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_invalid','force','policy.json','defaults','byteLength'];a288_0x1268=function(){return _0x224ea1;};return a288_0x1268();}function assertLocalPolicyContract(_0x4de99f,_0x4f81af){const _0x456091=a288_0x543aa7;if(!isObject(_0x4de99f))throw instantApiPolicyError(_0x456091(0x189),_0x456091(0x178));if(_0x4de99f[_0x456091(0x18b)]!=='1'&&_0x4de99f[_0x456091(0x18b)]!=='2')throw instantApiPolicyError(_0x456091(0x190),_0x456091(0x1a9),_0x456091(0x18f));if(_0x4de99f[_0x456091(0x18a)]!==_0x4f81af)throw instantApiPolicyError('instant_api_policy_app_code_mismatch',_0x456091(0x19e)+_0x4f81af+'.');if(!isObject(_0x4de99f[_0x456091(0x183)])||typeof _0x4de99f[_0x456091(0x183)][_0x456091(0x196)]!=='string')throw instantApiPolicyError(_0x456091(0x188),'Policy\x20defaults.instantApi\x20is\x20required.');if(_0x4de99f[_0x456091(0x186)]!==undefined&&_0x4de99f[_0x456091(0x186)]!==null&&!Array['isArray'](_0x4de99f[_0x456091(0x186)]))throw instantApiPolicyError(_0x456091(0x171),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x4de99f;}function isObject(_0x15ef10){const _0x3acf26=a288_0x543aa7;return _0x15ef10!==null&&typeof _0x15ef10===_0x3acf26(0x1aa)&&!Array[_0x3acf26(0x198)](_0x15ef10);}function isMissingFile(_0x15771e){const _0x4d444c=a288_0x543aa7;return Boolean(_0x15771e&&typeof _0x15771e==='object'&&_0x15771e[_0x4d444c(0x1a4)]===_0x4d444c(0x193));}function isAlreadyExists(_0x364b01){const _0x3bb5c6=a288_0x543aa7;return Boolean(_0x364b01&&typeof _0x364b01===_0x3bb5c6(0x1aa)&&_0x364b01[_0x3bb5c6(0x1a4)]===_0x3bb5c6(0x18e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a289_0x1ac01b=a289_0x470b;(function(_0x155e97,_0x9c50a0){const _0x5d7f0e=a289_0x470b,_0x23419b=_0x155e97();while(!![]){try{const _0x2004cf=-parseInt(_0x5d7f0e(0x1e2))/0x1*(-parseInt(_0x5d7f0e(0x1de))/0x2)+-parseInt(_0x5d7f0e(0x19d))/0x3*(-parseInt(_0x5d7f0e(0x1c7))/0x4)+parseInt(_0x5d7f0e(0x1b2))/0x5+-parseInt(_0x5d7f0e(0x19e))/0x6+parseInt(_0x5d7f0e(0x1d1))/0x7+-parseInt(_0x5d7f0e(0x1df))/0x8+parseInt(_0x5d7f0e(0x1a4))/0x9*(-parseInt(_0x5d7f0e(0x1ab))/0xa);if(_0x2004cf===_0x9c50a0)break;else _0x23419b['push'](_0x23419b['shift']());}catch(_0x468d6e){_0x23419b['push'](_0x23419b['shift']());}}}(a289_0x209a,0x93e01));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a289_0x1ac01b(0x1b0),a289_0x1ac01b(0x1d5),a289_0x1ac01b(0x1ad),a289_0x1ac01b(0x1d2),a289_0x1ac01b(0x197),a289_0x1ac01b(0x1b9)],HIT_KEYS=[a289_0x1ac01b(0x1c6),a289_0x1ac01b(0x1bf),a289_0x1ac01b(0x1e0),a289_0x1ac01b(0x198),a289_0x1ac01b(0x1a0),a289_0x1ac01b(0x1a8),'tags',a289_0x1ac01b(0x199),a289_0x1ac01b(0x1e7),a289_0x1ac01b(0x1c1),a289_0x1ac01b(0x1a1)];export function normalizeKbServiceOrigin(_0x310127){const _0x398a23=a289_0x1ac01b,_0x57b1fe=()=>CliErrors[_0x398a23(0x1bc)]('Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.'),_0x2361d6=_0x310127?.['trim']();if(!_0x2361d6||/[\u0000-\u0020\u007f]/[_0x398a23(0x1ae)](_0x2361d6)||!/^https:\/\/[^/?#@\\]+\/?$/i['test'](_0x2361d6))throw _0x57b1fe();let _0x548519;try{_0x548519=new URL(_0x2361d6);}catch{throw _0x57b1fe();}if(_0x548519[_0x398a23(0x1c4)]!==_0x398a23(0x1da)||!_0x548519['hostname']||_0x548519[_0x398a23(0x1a7)]||_0x548519[_0x398a23(0x19f)]||_0x548519[_0x398a23(0x1bd)]!=='/'||_0x548519['search']||_0x548519[_0x398a23(0x1af)])throw _0x57b1fe();return _0x548519[_0x398a23(0x1dd)];}function a289_0x470b(_0x55e773,_0xbe1f31){_0x55e773=_0x55e773-0x193;const _0x209ac4=a289_0x209a();let _0x470bcd=_0x209ac4[_0x55e773];return _0x470bcd;}export async function searchDirectKnowledge(_0xb90f7a){const _0x33b42d=a289_0x1ac01b,_0x11382a=_0xb90f7a[_0x33b42d(0x1d9)][_0x33b42d(0x1ac)](),_0x549750=_0xb90f7a[_0x33b42d(0x19b)][_0x33b42d(0x1ac)]();if(!_0x11382a)throw CliErrors[_0x33b42d(0x1bc)]('Knowledge\x20search\x20appCode\x20is\x20required.');if(!_0xb90f7a[_0x33b42d(0x1c3)][_0x33b42d(0x1ac)]())throw CliErrors[_0x33b42d(0x1e9)]();if(!_0x549750)throw CliErrors[_0x33b42d(0x1bc)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0xb90f7a['topK']);const _0x116b9d=normalizeKbServiceOrigin(_0xb90f7a[_0x33b42d(0x1ca)]),_0xbe211=AbortSignal['timeout'](0xea60),_0x32a556=_0xb90f7a[_0x33b42d(0x1e4)]?AbortSignal[_0x33b42d(0x19c)]([_0xb90f7a['signal'],_0xbe211]):_0xbe211;let _0x165624;try{_0x165624=await fetch(_0x116b9d+_0x33b42d(0x1cd)+encodeURIComponent(_0x11382a)+_0x33b42d(0x195),{'method':_0x33b42d(0x1d4),'redirect':_0x33b42d(0x1c5),'headers':{'Content-Type':'application/json','Cookie':_0xb90f7a['cookie'],'X-Invoke-Source':_0x33b42d(0x1b4)},'body':JSON['stringify']({'query':_0x549750,..._0xb90f7a[_0x33b42d(0x1b1)]!==undefined?{'topK':_0xb90f7a[_0x33b42d(0x1b1)]}:{}}),'signal':_0x32a556});}catch(_0x2d2005){if(_0xb90f7a['signal']?.[_0x33b42d(0x19a)])throw new DOMException(_0x33b42d(0x196),_0x33b42d(0x1b3));if(_0x2d2005 instanceof Error&&_0x2d2005[_0x33b42d(0x1d0)]===_0x33b42d(0x1c9))throw CliErrors['networkError'](_0x33b42d(0x1aa));throw CliErrors[_0x33b42d(0x1e8)](_0x33b42d(0x1dc));}if(_0x165624['status']===0x191)throw CliErrors['authRequired']();if(_0x165624[_0x33b42d(0x1c2)]===0x1ad)throw CliErrors[_0x33b42d(0x1cb)](_0x33b42d(0x1e3));if(!_0x165624['ok'])throw CliErrors[_0x33b42d(0x1cb)](_0x33b42d(0x1ce)+_0x165624[_0x33b42d(0x1c2)]+').');if(!hasNoStore(_0x165624[_0x33b42d(0x1bb)]))throw CliErrors[_0x33b42d(0x1cb)]('KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(!(_0x165624[_0x33b42d(0x1bb)][_0x33b42d(0x193)]('content-type')??'')[_0x33b42d(0x1b6)]()[_0x33b42d(0x1b8)](_0x33b42d(0x1a5)))throw CliErrors[_0x33b42d(0x1cb)](_0x33b42d(0x1cf));let _0x4aaa22;try{_0x4aaa22=await _0x165624[_0x33b42d(0x1a6)]();}catch(_0x5e958c){if(_0xb90f7a[_0x33b42d(0x1e4)]?.[_0x33b42d(0x19a)])throw new DOMException('Knowledge\x20search\x20cancelled.',_0x33b42d(0x1b3));if(_0xbe211[_0x33b42d(0x19a)]||_0x5e958c instanceof Error&&_0x5e958c[_0x33b42d(0x1d0)]===_0x33b42d(0x1c9))throw CliErrors[_0x33b42d(0x1e8)](_0x33b42d(0x1aa));throw CliErrors[_0x33b42d(0x1cb)](_0x33b42d(0x1b5));}try{const _0x538d40=requireExactRecord(_0x4aaa22,[_0x33b42d(0x1d2),_0x33b42d(0x197),_0x33b42d(0x1b9)],_0x33b42d(0x1e6));if(!Array['isArray'](_0x538d40[_0x33b42d(0x1d2)]))throw invalidContract(_0x33b42d(0x1d2));return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x33b42d(0x1c8),'total':_0x538d40[_0x33b42d(0x1d2)][_0x33b42d(0x1be)],'hits':_0x538d40[_0x33b42d(0x1d2)],'strategyFingerprint':_0x538d40[_0x33b42d(0x197)],'timingsMs':_0x538d40[_0x33b42d(0x1b9)]},_0xb90f7a[_0x33b42d(0x1b1)]??0xa);}catch(_0x5bceed){if(_0x5bceed instanceof CliError)throw CliErrors['apiError']('KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.');throw _0x5bceed;}}function validateTopK(_0x4ac2e1){const _0x413b3f=a289_0x1ac01b;if(_0x4ac2e1!==undefined&&(!Number[_0x413b3f(0x194)](_0x4ac2e1)||_0x4ac2e1<0x1||_0x4ac2e1>0x32))throw CliErrors[_0x413b3f(0x1bc)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x28d9d5){const _0x4e7219=a289_0x1ac01b;return(_0x28d9d5[_0x4e7219(0x193)](_0x4e7219(0x1a9))??'')['split'](',')['some'](_0x36514d=>_0x36514d[_0x4e7219(0x1ac)]()['toLowerCase']()===_0x4e7219(0x1d3));}function parseDevelopmentSearchResponse(_0x5b30aa,_0x1bbe41){const _0x2a269e=a289_0x1ac01b,_0x2352b5=requireExactRecord(_0x5b30aa,RESPONSE_KEYS,_0x2a269e(0x1e6));if(_0x2352b5['schemaVersion']!==0x2||_0x2352b5[_0x2a269e(0x1d5)]!==_0x2a269e(0x1c8))throw invalidContract(_0x2a269e(0x1d5));if(!Array[_0x2a269e(0x1b7)](_0x2352b5[_0x2a269e(0x1d2)])||_0x2352b5[_0x2a269e(0x1d2)][_0x2a269e(0x1be)]>(_0x1bbe41??0x32))throw invalidContract(_0x2a269e(0x1d2));if(typeof _0x2352b5[_0x2a269e(0x197)]!=='string'||!/^sha256:[0-9a-f]{64}$/[_0x2a269e(0x1ae)](_0x2352b5[_0x2a269e(0x197)]))throw invalidContract(_0x2a269e(0x197));const _0x200415=requireRecord(_0x2352b5[_0x2a269e(0x1b9)],'timingsMs'),_0x424abe={};for(const [_0x16c4f3,_0x1603a1]of Object[_0x2a269e(0x1d7)](_0x200415)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x2a269e(0x1ae)](_0x16c4f3)||typeof _0x1603a1!=='number'||!Number[_0x2a269e(0x1ba)](_0x1603a1)||_0x1603a1<0x0)throw invalidContract(_0x2a269e(0x1b9));_0x424abe[_0x16c4f3]=_0x1603a1;}const _0xa88997=_0x2352b5['hits'][_0x2a269e(0x1a2)]((_0x541d4d,_0x194d57)=>parseHit(_0x541d4d,_0x194d57));if(!Number['isSafeInteger'](_0x2352b5[_0x2a269e(0x1ad)])||_0x2352b5[_0x2a269e(0x1ad)]!==_0xa88997[_0x2a269e(0x1be)])throw invalidContract(_0x2a269e(0x1ad));return{'schemaVersion':_0x2352b5[_0x2a269e(0x1b0)],'profile':_0x2352b5[_0x2a269e(0x1d5)],'total':_0x2352b5[_0x2a269e(0x1ad)],'strategyFingerprint':_0x2352b5[_0x2a269e(0x197)],'timingsMs':_0x424abe,'hits':_0xa88997};}function parseHit(_0x59b983,_0x3a3e5f){const _0x3c9dfa=a289_0x1ac01b,_0x4146c3=requireExactRecord(_0x59b983,HIT_KEYS,'hits['+_0x3a3e5f+']'),_0x26cc57=_0x3ec9cd=>{const _0x30781c=_0x4146c3[_0x3ec9cd];if(typeof _0x30781c!=='string'||!_0x30781c)throw invalidContract(_0x3ec9cd);return _0x30781c;};if(!Number[_0x3c9dfa(0x194)](_0x4146c3[_0x3c9dfa(0x1bf)])||_0x4146c3[_0x3c9dfa(0x1bf)]<0x1)throw invalidContract(_0x3c9dfa(0x1bf));if(_0x4146c3[_0x3c9dfa(0x198)]!==_0x3c9dfa(0x1e5)&&_0x4146c3['scope']!=='company')throw invalidContract('scope');if(typeof _0x4146c3[_0x3c9dfa(0x1a0)]!==_0x3c9dfa(0x1d6)||typeof _0x4146c3[_0x3c9dfa(0x1a8)]!=='string')throw invalidContract('text');if(!Array[_0x3c9dfa(0x1b7)](_0x4146c3[_0x3c9dfa(0x1ea)])||_0x4146c3[_0x3c9dfa(0x1ea)]['some'](_0x18b554=>typeof _0x18b554!=='string'))throw invalidContract(_0x3c9dfa(0x1ea));if(!Number[_0x3c9dfa(0x194)](_0x4146c3['rank'])||_0x4146c3[_0x3c9dfa(0x199)]!==_0x3a3e5f+0x1)throw invalidContract(_0x3c9dfa(0x199));if(!isFiniteNumber(_0x4146c3[_0x3c9dfa(0x1e7)])||!isFiniteNumber(_0x4146c3[_0x3c9dfa(0x1c1)]))throw invalidContract('score');return{'documentId':_0x26cc57(_0x3c9dfa(0x1c6)),'revision':_0x4146c3[_0x3c9dfa(0x1bf)],'chunkId':_0x26cc57(_0x3c9dfa(0x1e0)),'scope':_0x4146c3[_0x3c9dfa(0x198)],'title':_0x4146c3['title'],'text':_0x4146c3[_0x3c9dfa(0x1a8)],'tags':[..._0x4146c3[_0x3c9dfa(0x1ea)]],'rank':_0x4146c3[_0x3c9dfa(0x199)],'rawScore':_0x4146c3[_0x3c9dfa(0x1e7)],'finalScore':_0x4146c3[_0x3c9dfa(0x1c1)],'scoreKind':_0x26cc57(_0x3c9dfa(0x1a1))};}function requireExactRecord(_0x23e6c6,_0x5bd4a0,_0x4d78a3){const _0x3145ae=a289_0x1ac01b,_0x40c2c2=requireRecord(_0x23e6c6,_0x4d78a3),_0x3dc715=Object['keys'](_0x40c2c2)[_0x3145ae(0x1db)](),_0x48a5a8=[..._0x5bd4a0][_0x3145ae(0x1db)]();if(_0x3dc715[_0x3145ae(0x1be)]!==_0x48a5a8[_0x3145ae(0x1be)]||_0x3dc715[_0x3145ae(0x1e1)]((_0x1262b7,_0x2fae0b)=>_0x1262b7!==_0x48a5a8[_0x2fae0b]))throw invalidContract(_0x4d78a3);return _0x40c2c2;}function a289_0x209a(){const _0x5c438e=['chunkId','some','15797ScszvI','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','signal','public','response','rawScore','networkError','authRequired','tags','get','isSafeInteger','/knowledge/search','Knowledge\x20search\x20cancelled.','strategyFingerprint','scope','rank','aborted','query','any','2991dNFwUf','4759878TQKndF','password','title','scoreKind','map','\x20contract.','1415331jMQHkH','application/json','json','username','text','cache-control','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','70NsoIFo','trim','total','test','hash','schemaVersion','topK','4813825cioprg','AbortError','cli:rabetbase','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','toLowerCase','isArray','includes','timingsMs','isFinite','headers','validation','pathname','length','revision','object','finalScore','status','cookie','protocol','error','documentId','4612DPJcMG','development','TimeoutError','serviceUrl','apiError','number','/v2/development/apps/','KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','name','3594213Bdqzry','hits','no-store','POST','profile','string','entries','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','appCode','https:','sort','KB\x20Service\x20knowledge\x20search\x20request\x20failed.','origin','128yGkZfG','9095600avBadq'];a289_0x209a=function(){return _0x5c438e;};return a289_0x209a();}function requireRecord(_0x3060ce,_0x8cbdb){const _0x1569e8=a289_0x1ac01b;if(!_0x3060ce||typeof _0x3060ce!==_0x1569e8(0x1c0)||Array[_0x1569e8(0x1b7)](_0x3060ce))throw invalidContract(_0x8cbdb);return _0x3060ce;}function isFiniteNumber(_0x470026){const _0x4f0afe=a289_0x1ac01b;return typeof _0x470026===_0x4f0afe(0x1cc)&&Number[_0x4f0afe(0x1ba)](_0x470026);}function invalidContract(_0x53b165){const _0x23f0a9=a289_0x1ac01b;return CliErrors['apiError'](_0x23f0a9(0x1d8)+_0x53b165+_0x23f0a9(0x1a3));}
|
|
1
|
+
function a289_0xbf06(_0x1cfe20,_0x28316f){_0x1cfe20=_0x1cfe20-0x160;const _0x559a38=a289_0x559a();let _0xbf0608=_0x559a38[_0x1cfe20];return _0xbf0608;}const a289_0x2288cb=a289_0xbf06;function a289_0x559a(){const _0x5d67c6=['total','toLowerCase','status','name','pathname','networkError','apiError','KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','get','keys','rank','headers','stringify','cli:rabetbase','finalScore','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','some','any','105hllaPR','split','KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20','/knowledge/search','documentId','Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','Knowledge\x20search\x20appCode\x20is\x20required.','error','aborted','sort','hits','authRequired','4985376Tryxsu','no-store','entries','password','signal','number','4pGeVDT','scope','2240mMwMbw','isArray','topK','text','includes','isSafeInteger','TimeoutError','cache-control','KB\x20Service\x20knowledge\x20search\x20request\x20failed.','profile','5212592pllShw','string','Knowledge\x20search\x20cancelled.','AbortError','timingsMs','public','map','timeout','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','strategyFingerprint','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','username','score','https:','json','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','16578pbrFpt','POST','scoreKind','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','hostname','response','serviceUrl','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','appCode','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','tags','trim','hits[','2899400GHmdZE','365983pgkUzD','chunkId','hash','cookie','length','revision','protocol','287244toGvmN','title','validation','isFinite','418047hHdZEA','development','schemaVersion','origin','test'];a289_0x559a=function(){return _0x5d67c6;};return a289_0x559a();}(function(_0x294fde,_0x253fb2){const _0x250f72=a289_0xbf06,_0x5072d8=_0x294fde();while(!![]){try{const _0x2b2801=parseInt(_0x250f72(0x168))/0x1*(-parseInt(_0x250f72(0x19c))/0x2)+parseInt(_0x250f72(0x173))/0x3+-parseInt(_0x250f72(0x16f))/0x4*(-parseInt(_0x250f72(0x18a))/0x5)+-parseInt(_0x250f72(0x196))/0x6+parseInt(_0x250f72(0x1a8))/0x7+parseInt(_0x250f72(0x167))/0x8+parseInt(_0x250f72(0x1b8))/0x9*(-parseInt(_0x250f72(0x19e))/0xa);if(_0x2b2801===_0x253fb2)break;else _0x5072d8['push'](_0x5072d8['shift']());}catch(_0x29858f){_0x5072d8['push'](_0x5072d8['shift']());}}}(a289_0x559a,0xbe2ef));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a289_0x2288cb(0x1a7),a289_0x2288cb(0x178),a289_0x2288cb(0x194),'strategyFingerprint',a289_0x2288cb(0x1ac)],HIT_KEYS=['documentId','revision',a289_0x2288cb(0x169),a289_0x2288cb(0x19d),a289_0x2288cb(0x170),'text',a289_0x2288cb(0x164),'rank','rawScore',a289_0x2288cb(0x186),a289_0x2288cb(0x1ba)];export function normalizeKbServiceOrigin(_0x41e7e3){const _0x30697c=a289_0x2288cb,_0x303782=()=>CliErrors['validation'](_0x30697c(0x18f)),_0x2df655=_0x41e7e3?.[_0x30697c(0x165)]();if(!_0x2df655||/[\u0000-\u0020\u007f]/['test'](_0x2df655)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x30697c(0x177)](_0x2df655))throw _0x303782();let _0x2de09a;try{_0x2de09a=new URL(_0x2df655);}catch{throw _0x303782();}if(_0x2de09a[_0x30697c(0x16e)]!==_0x30697c(0x1b5)||!_0x2de09a[_0x30697c(0x1bc)]||_0x2de09a[_0x30697c(0x1b3)]||_0x2de09a[_0x30697c(0x199)]||_0x2de09a[_0x30697c(0x17c)]!=='/'||_0x2de09a['search']||_0x2de09a[_0x30697c(0x16a)])throw _0x303782();return _0x2de09a[_0x30697c(0x176)];}export async function searchDirectKnowledge(_0x5c7357){const _0x4a9d70=a289_0x2288cb,_0x461006=_0x5c7357[_0x4a9d70(0x162)][_0x4a9d70(0x165)](),_0x4da22a=_0x5c7357['query'][_0x4a9d70(0x165)]();if(!_0x461006)throw CliErrors['validation'](_0x4a9d70(0x190));if(!_0x5c7357[_0x4a9d70(0x16b)][_0x4a9d70(0x165)]())throw CliErrors[_0x4a9d70(0x195)]();if(!_0x4da22a)throw CliErrors[_0x4a9d70(0x171)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x5c7357[_0x4a9d70(0x1a0)]);const _0x59e2b6=normalizeKbServiceOrigin(_0x5c7357[_0x4a9d70(0x160)]),_0xa8a941=AbortSignal[_0x4a9d70(0x1af)](0xea60),_0x5070af=_0x5c7357['signal']?AbortSignal[_0x4a9d70(0x189)]([_0x5c7357[_0x4a9d70(0x19a)],_0xa8a941]):_0xa8a941;let _0x5b4581;try{_0x5b4581=await fetch(_0x59e2b6+'/v2/development/apps/'+encodeURIComponent(_0x461006)+_0x4a9d70(0x18d),{'method':_0x4a9d70(0x1b9),'redirect':_0x4a9d70(0x191),'headers':{'Content-Type':'application/json','Cookie':_0x5c7357['cookie'],'X-Invoke-Source':_0x4a9d70(0x185)},'body':JSON[_0x4a9d70(0x184)]({'query':_0x4da22a,..._0x5c7357[_0x4a9d70(0x1a0)]!==undefined?{'topK':_0x5c7357[_0x4a9d70(0x1a0)]}:{}}),'signal':_0x5070af});}catch(_0x4e93fb){if(_0x5c7357['signal']?.[_0x4a9d70(0x192)])throw new DOMException(_0x4a9d70(0x1aa),_0x4a9d70(0x1ab));if(_0x4e93fb instanceof Error&&_0x4e93fb['name']===_0x4a9d70(0x1a4))throw CliErrors['networkError']('KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.');throw CliErrors[_0x4a9d70(0x17d)](_0x4a9d70(0x1a6));}if(_0x5b4581[_0x4a9d70(0x17a)]===0x191)throw CliErrors['authRequired']();if(_0x5b4581[_0x4a9d70(0x17a)]===0x1ad)throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x163));if(!_0x5b4581['ok'])throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x18c)+_0x5b4581[_0x4a9d70(0x17a)]+').');if(!hasNoStore(_0x5b4581[_0x4a9d70(0x183)]))throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x17f));if(!(_0x5b4581[_0x4a9d70(0x183)][_0x4a9d70(0x180)]('content-type')??'')[_0x4a9d70(0x179)]()[_0x4a9d70(0x1a2)]('application/json'))throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x1b0));let _0x5834bd;try{_0x5834bd=await _0x5b4581[_0x4a9d70(0x1b6)]();}catch(_0x49f820){if(_0x5c7357[_0x4a9d70(0x19a)]?.['aborted'])throw new DOMException(_0x4a9d70(0x1aa),_0x4a9d70(0x1ab));if(_0xa8a941[_0x4a9d70(0x192)]||_0x49f820 instanceof Error&&_0x49f820[_0x4a9d70(0x17b)]===_0x4a9d70(0x1a4))throw CliErrors['networkError'](_0x4a9d70(0x1b2));throw CliErrors['apiError'](_0x4a9d70(0x187));}try{const _0x58c928=requireExactRecord(_0x5834bd,[_0x4a9d70(0x194),_0x4a9d70(0x1b1),_0x4a9d70(0x1ac)],_0x4a9d70(0x1bd));if(!Array['isArray'](_0x58c928[_0x4a9d70(0x194)]))throw invalidContract(_0x4a9d70(0x194));return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x4a9d70(0x174),'total':_0x58c928[_0x4a9d70(0x194)][_0x4a9d70(0x16c)],'hits':_0x58c928['hits'],'strategyFingerprint':_0x58c928[_0x4a9d70(0x1b1)],'timingsMs':_0x58c928[_0x4a9d70(0x1ac)]},_0x5c7357[_0x4a9d70(0x1a0)]??0xa);}catch(_0x1200c5){if(_0x1200c5 instanceof CliError)throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x161));throw _0x1200c5;}}function validateTopK(_0x18b362){const _0x8918d5=a289_0x2288cb;if(_0x18b362!==undefined&&(!Number[_0x8918d5(0x1a3)](_0x18b362)||_0x18b362<0x1||_0x18b362>0x32))throw CliErrors['validation'](_0x8918d5(0x1bb));}function hasNoStore(_0x1900ed){const _0x1083dd=a289_0x2288cb;return(_0x1900ed[_0x1083dd(0x180)](_0x1083dd(0x1a5))??'')[_0x1083dd(0x18b)](',')[_0x1083dd(0x188)](_0x29e081=>_0x29e081[_0x1083dd(0x165)]()['toLowerCase']()===_0x1083dd(0x197));}function parseDevelopmentSearchResponse(_0x7e8618,_0xbde6e4){const _0x1ec029=a289_0x2288cb,_0x26a8bd=requireExactRecord(_0x7e8618,RESPONSE_KEYS,_0x1ec029(0x1bd));if(_0x26a8bd[_0x1ec029(0x175)]!==0x2||_0x26a8bd[_0x1ec029(0x1a7)]!==_0x1ec029(0x174))throw invalidContract(_0x1ec029(0x1a7));if(!Array[_0x1ec029(0x19f)](_0x26a8bd[_0x1ec029(0x194)])||_0x26a8bd['hits'][_0x1ec029(0x16c)]>(_0xbde6e4??0x32))throw invalidContract(_0x1ec029(0x194));if(typeof _0x26a8bd[_0x1ec029(0x1b1)]!=='string'||!/^sha256:[0-9a-f]{64}$/['test'](_0x26a8bd['strategyFingerprint']))throw invalidContract(_0x1ec029(0x1b1));const _0x59f3b9=requireRecord(_0x26a8bd[_0x1ec029(0x1ac)],'timingsMs'),_0x553045={};for(const [_0x83d38d,_0x527555]of Object[_0x1ec029(0x198)](_0x59f3b9)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x1ec029(0x177)](_0x83d38d)||typeof _0x527555!==_0x1ec029(0x19b)||!Number[_0x1ec029(0x172)](_0x527555)||_0x527555<0x0)throw invalidContract(_0x1ec029(0x1ac));_0x553045[_0x83d38d]=_0x527555;}const _0x383492=_0x26a8bd[_0x1ec029(0x194)][_0x1ec029(0x1ae)]((_0x1a5bfe,_0x4ebd6c)=>parseHit(_0x1a5bfe,_0x4ebd6c));if(!Number['isSafeInteger'](_0x26a8bd['total'])||_0x26a8bd[_0x1ec029(0x178)]!==_0x383492[_0x1ec029(0x16c)])throw invalidContract('total');return{'schemaVersion':_0x26a8bd[_0x1ec029(0x175)],'profile':_0x26a8bd[_0x1ec029(0x1a7)],'total':_0x26a8bd[_0x1ec029(0x178)],'strategyFingerprint':_0x26a8bd[_0x1ec029(0x1b1)],'timingsMs':_0x553045,'hits':_0x383492};}function parseHit(_0x5b1bc1,_0xd6028d){const _0x4b66c9=a289_0x2288cb,_0x41b871=requireExactRecord(_0x5b1bc1,HIT_KEYS,_0x4b66c9(0x166)+_0xd6028d+']'),_0x3543fb=_0x45d025=>{const _0x16736a=_0x4b66c9,_0x308976=_0x41b871[_0x45d025];if(typeof _0x308976!==_0x16736a(0x1a9)||!_0x308976)throw invalidContract(_0x45d025);return _0x308976;};if(!Number[_0x4b66c9(0x1a3)](_0x41b871[_0x4b66c9(0x16d)])||_0x41b871[_0x4b66c9(0x16d)]<0x1)throw invalidContract('revision');if(_0x41b871[_0x4b66c9(0x19d)]!==_0x4b66c9(0x1ad)&&_0x41b871[_0x4b66c9(0x19d)]!=='company')throw invalidContract('scope');if(typeof _0x41b871[_0x4b66c9(0x170)]!==_0x4b66c9(0x1a9)||typeof _0x41b871[_0x4b66c9(0x1a1)]!==_0x4b66c9(0x1a9))throw invalidContract(_0x4b66c9(0x1a1));if(!Array['isArray'](_0x41b871['tags'])||_0x41b871[_0x4b66c9(0x164)][_0x4b66c9(0x188)](_0x230742=>typeof _0x230742!==_0x4b66c9(0x1a9)))throw invalidContract(_0x4b66c9(0x164));if(!Number['isSafeInteger'](_0x41b871['rank'])||_0x41b871[_0x4b66c9(0x182)]!==_0xd6028d+0x1)throw invalidContract(_0x4b66c9(0x182));if(!isFiniteNumber(_0x41b871['rawScore'])||!isFiniteNumber(_0x41b871['finalScore']))throw invalidContract(_0x4b66c9(0x1b4));return{'documentId':_0x3543fb(_0x4b66c9(0x18e)),'revision':_0x41b871[_0x4b66c9(0x16d)],'chunkId':_0x3543fb(_0x4b66c9(0x169)),'scope':_0x41b871[_0x4b66c9(0x19d)],'title':_0x41b871[_0x4b66c9(0x170)],'text':_0x41b871[_0x4b66c9(0x1a1)],'tags':[..._0x41b871['tags']],'rank':_0x41b871[_0x4b66c9(0x182)],'rawScore':_0x41b871['rawScore'],'finalScore':_0x41b871[_0x4b66c9(0x186)],'scoreKind':_0x3543fb(_0x4b66c9(0x1ba))};}function requireExactRecord(_0x5f4856,_0x1dccb9,_0xbb005){const _0x2dfd2d=a289_0x2288cb,_0xc1699b=requireRecord(_0x5f4856,_0xbb005),_0x436229=Object[_0x2dfd2d(0x181)](_0xc1699b)[_0x2dfd2d(0x193)](),_0x1cde76=[..._0x1dccb9][_0x2dfd2d(0x193)]();if(_0x436229['length']!==_0x1cde76[_0x2dfd2d(0x16c)]||_0x436229['some']((_0x1f96a0,_0xee474f)=>_0x1f96a0!==_0x1cde76[_0xee474f]))throw invalidContract(_0xbb005);return _0xc1699b;}function requireRecord(_0xcdbda8,_0x5ceaae){const _0xdaa76b=a289_0x2288cb;if(!_0xcdbda8||typeof _0xcdbda8!=='object'||Array[_0xdaa76b(0x19f)](_0xcdbda8))throw invalidContract(_0x5ceaae);return _0xcdbda8;}function isFiniteNumber(_0x36ec3d){const _0x56b0cb=a289_0x2288cb;return typeof _0x36ec3d===_0x56b0cb(0x19b)&&Number[_0x56b0cb(0x172)](_0x36ec3d);}function invalidContract(_0x5ee77e){const _0x5c0945=a289_0x2288cb;return CliErrors[_0x5c0945(0x17e)](_0x5c0945(0x1b7)+_0x5ee77e+'\x20contract.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a290_0x597056=a290_0x88cc;function a290_0x2cc4(){const _0xf10d04=['toUpperCase','2065512LAiXnp','7209990eLHwLi','appPagesDir','.json','validation','Unsupported\x20file\x20in\x20page\x20directory:\x20','Page\x20directory\x20not\x20found:\x20','412334XWQUJd','4osmgpo','isDirectory','localeCompare','24498180GxhZZJ','cwd','utf8','1531461DmnNyz','split','F_OK','.rabetbase','flagMissing','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','459925Qjdijt','1144801DEHXwz','name','4Jhkipu','isFile','page','36ruJvZb'];a290_0x2cc4=function(){return _0xf10d04;};return a290_0x2cc4();}(function(_0x5e668e,_0x63bc54){const _0x5063bd=a290_0x88cc,_0x19b17c=_0x5e668e();while(!![]){try{const _0x28029d=-parseInt(_0x5063bd(0x1fa))/0x1*(parseInt(_0x5063bd(0x1f9))/0x2)+-parseInt(_0x5063bd(0x1e4))/0x3*(-parseInt(_0x5063bd(0x1ed))/0x4)+-parseInt(_0x5063bd(0x1ea))/0x5+parseInt(_0x5063bd(0x1f0))/0x6*(-parseInt(_0x5063bd(0x1eb))/0x7)+parseInt(_0x5063bd(0x1f2))/0x8+-parseInt(_0x5063bd(0x1f3))/0x9+parseInt(_0x5063bd(0x1e1))/0xa;if(_0x28029d===_0x63bc54)break;else _0x19b17c['push'](_0x19b17c['shift']());}catch(_0x11b83d){_0x19b17c['push'](_0x19b17c['shift']());}}}(a290_0x2cc4,0x7ed31));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x4a6c41,_0x216c78=process[a290_0x597056(0x1e2)]()){const _0x16d37f=a290_0x597056,_0x358434=resolve(_0x216c78),_0x34870d=join(_0x358434,_0x16d37f(0x1e7),_0x16d37f(0x1ef));return{'projectRoot':_0x358434,'pagesBaseDir':_0x34870d,'appPagesDir':join(_0x34870d,_0x4a6c41),'lockFilePath':join(_0x358434,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0xbd3ca3,_0x58a4aa){const _0x351cce=a290_0x597056;return _0xbd3ca3+'-'+_0x58a4aa[_0x351cce(0x1f1)]()+_0x351cce(0x1f5);}export function resolvePageFilePath(_0x4a7d60,_0x58f9bf,_0x436cf4){const _0x2a927e=a290_0x597056;return join(_0x4a7d60[_0x2a927e(0x1f4)],buildPageFileName(_0x58f9bf,_0x436cf4));}function a290_0x88cc(_0x29f45c,_0x4f5c8e){_0x29f45c=_0x29f45c-0x1df;const _0x2cc4eb=a290_0x2cc4();let _0x88cc0c=_0x2cc4eb[_0x29f45c];return _0x88cc0c;}export async function ensureParentDirectory(_0x55c763){await mkdir(dirname(_0x55c763),{'recursive':!![]});}export async function fileExists(_0x4893ff){const _0x4a0001=a290_0x597056;try{return await access(_0x4893ff,constants[_0x4a0001(0x1e6)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x13766f){const _0x599c98=a290_0x597056,_0x121a43=_0x13766f['trim']();if(!_0x121a43)throw CliErrors[_0x599c98(0x1e8)]('page-dir');const _0x413447=resolve(_0x121a43);let _0x4c65f5;try{_0x4c65f5=await lstat(_0x413447);}catch{throw CliErrors['validation'](_0x599c98(0x1f8)+_0x121a43);}if(!_0x4c65f5[_0x599c98(0x1df)]())throw CliErrors[_0x599c98(0x1f6)](_0x599c98(0x1e9)+_0x121a43);const _0x4a904c={};return await readDirectory(_0x413447,_0x413447,_0x4a904c),_0x4a904c;}async function readDirectory(_0x30f442,_0x4a2ef6,_0x3829c3){const _0x270e0a=a290_0x597056,_0x2b00cf=await readdir(_0x4a2ef6,{'withFileTypes':!![]});for(const _0x43d7e8 of _0x2b00cf['sort']((_0x23aa3a,_0x24bc3f)=>_0x23aa3a[_0x270e0a(0x1ec)][_0x270e0a(0x1e0)](_0x24bc3f[_0x270e0a(0x1ec)]))){const _0x2e62b5=join(_0x4a2ef6,_0x43d7e8[_0x270e0a(0x1ec)]);if(_0x43d7e8[_0x270e0a(0x1df)]()){await readDirectory(_0x30f442,_0x2e62b5,_0x3829c3);continue;}if(!_0x43d7e8[_0x270e0a(0x1ee)]())throw CliErrors['validation'](_0x270e0a(0x1f7)+_0x2e62b5);_0x3829c3[relative(_0x30f442,_0x2e62b5)[_0x270e0a(0x1e5)](sep)['join']('/')]=await readFile(_0x2e62b5,_0x270e0a(0x1e3));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xd3353d,_0x134a62){const _0x2b6d5a=a291_0x67c0,_0x368013=_0xd3353d();while(!![]){try{const _0x14493e=parseInt(_0x2b6d5a(0x132))/0x1+parseInt(_0x2b6d5a(0x136))/0x2*(-parseInt(_0x2b6d5a(0x131))/0x3)+parseInt(_0x2b6d5a(0x135))/0x4+-parseInt(_0x2b6d5a(0x139))/0x5+parseInt(_0x2b6d5a(0x137))/0x6*(parseInt(_0x2b6d5a(0x13b))/0x7)+-parseInt(_0x2b6d5a(0x133))/0x8+parseInt(_0x2b6d5a(0x130))/0x9;if(_0x14493e===_0x134a62)break;else _0x368013['push'](_0x368013['shift']());}catch(_0x207938){_0x368013['push'](_0x368013['shift']());}}}(a291_0x2a58,0xd39b7));import a291_0x4ba37c from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x53d228){const _0x59f1d9=a291_0x67c0;return JSON[_0x59f1d9(0x12e)](JSON[_0x59f1d9(0x134)](_0x53d228),null,0x2)+'\x0a';}function a291_0x67c0(_0x290d79,_0x269c9d){_0x290d79=_0x290d79-0x12d;const _0x2a58c9=a291_0x2a58();let _0x67c039=_0x2a58c9[_0x290d79];return _0x67c039;}export function computePageContentHash(_0x59f742){const _0x151e7f=a291_0x67c0;return a291_0x4ba37c[_0x151e7f(0x13a)]('md5')[_0x151e7f(0x12f)](_0x59f742)[_0x151e7f(0x138)](_0x151e7f(0x12d));}function a291_0x2a58(){const _0x42809d=['4865336bNROvE','parse','1377320YnIjxJ','699306JxzeCt','9422922OSaTay','digest','7499280wshFHF','createHash','7hbQVlr','utf8','hex','stringify','update','1450998ZmHfnz','3KKFhMW','1248380ItHtcV'];a291_0x2a58=function(){return _0x42809d;};return a291_0x2a58();}export function computeSerializedSchemaHash(_0x5814a0){return computePageContentHash(serializePageSchemaForFile(_0x5814a0));}export async function computePageFileHash(_0x7aa59a){const _0x2b2d78=a291_0x67c0,_0x41658e=await readFile(_0x7aa59a,_0x2b2d78(0x13c));return computePageContentHash(_0x41658e);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a292_0x5d61(_0x14024d,_0xed4004){_0x14024d=_0x14024d-0x87;const _0x23a5c7=a292_0x23a5();let _0x5d6135=_0x23a5c7[_0x14024d];return _0x5d6135;}(function(_0x158313,_0x416121){const _0x4d818=a292_0x5d61,_0x174133=_0x158313();while(!![]){try{const _0x8d6791=-parseInt(_0x4d818(0x88))/0x1+-parseInt(_0x4d818(0x92))/0x2*(parseInt(_0x4d818(0x8f))/0x3)+parseInt(_0x4d818(0x8b))/0x4*(parseInt(_0x4d818(0x95))/0x5)+-parseInt(_0x4d818(0x93))/0x6+-parseInt(_0x4d818(0x90))/0x7*(-parseInt(_0x4d818(0x94))/0x8)+-parseInt(_0x4d818(0x8e))/0x9+parseInt(_0x4d818(0x8c))/0xa;if(_0x8d6791===_0x416121)break;else _0x174133['push'](_0x174133['shift']());}catch(_0x344c68){_0x174133['push'](_0x174133['shift']());}}}(a292_0x23a5,0xbf3fd));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a292_0x23a5(){const _0x460256=['6937965QRZkJW','1651062DsAedt','14yvGlbI','code','4srDuwC','5696790FVpNdX','3753616phetxg','470385BvYZfT','utf8','stringify','parse','pages','769039kNZvuW','lastSync','apps','4SZZQep','33409730qwpOGw','object'];a292_0x23a5=function(){return _0x460256;};return a292_0x23a5();}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x4a0dc7,_0x5868ee){const _0x3c796a=a292_0x5d61,_0x474da8={'apps':_0x4a0dc7[_0x3c796a(0x8a)]&&typeof _0x4a0dc7[_0x3c796a(0x8a)]===_0x3c796a(0x8d)?_0x4a0dc7[_0x3c796a(0x8a)]:{}};let _0x3f71cd=_0x474da8['apps'][_0x5868ee];if(!_0x3f71cd)return _0x3f71cd={'lastSync':'','pages':{}},_0x474da8[_0x3c796a(0x8a)][_0x5868ee]=_0x3f71cd,{'lockData':_0x474da8,'appLock':_0x3f71cd};return!_0x3f71cd['lastSync']&&(_0x3f71cd[_0x3c796a(0x89)]=''),(!_0x3f71cd[_0x3c796a(0x87)]||typeof _0x3f71cd[_0x3c796a(0x87)]!==_0x3c796a(0x8d))&&(_0x3f71cd['pages']={}),{'lockData':_0x474da8,'appLock':_0x3f71cd};}export async function readPageLockFile(_0x1b3ad8){const _0x324faa=a292_0x5d61;try{const _0x1cfd33=await readFile(_0x1b3ad8,_0x324faa(0x96)),_0x281162=JSON[_0x324faa(0x98)](_0x1cfd33);return{'apps':_0x281162[_0x324faa(0x8a)]&&typeof _0x281162[_0x324faa(0x8a)]==='object'?_0x281162[_0x324faa(0x8a)]:{}};}catch(_0x4c64de){if(_0x4c64de[_0x324faa(0x91)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x4c64de));}}export async function writePageLockFile(_0x2d96d3,_0x17a2be){const _0x124627=a292_0x5d61;await mkdir(dirname(_0x2d96d3),{'recursive':!![]}),await writeFile(_0x2d96d3,JSON[_0x124627(0x97)](_0x17a2be,null,0x2),_0x124627(0x96));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc71438,_0x50927d){const _0x5415fc=a293_0x18dc,_0x4c9138=_0xc71438();while(!![]){try{const _0x477b70=-parseInt(_0x5415fc(0xec))/0x1*(-parseInt(_0x5415fc(0xf5))/0x2)+-parseInt(_0x5415fc(0x103))/0x3+parseInt(_0x5415fc(0xfc))/0x4*(-parseInt(_0x5415fc(0xf6))/0x5)+parseInt(_0x5415fc(0x105))/0x6*(-parseInt(_0x5415fc(0xe5))/0x7)+-parseInt(_0x5415fc(0xea))/0x8*(parseInt(_0x5415fc(0xe4))/0x9)+parseInt(_0x5415fc(0xe2))/0xa*(-parseInt(_0x5415fc(0xfe))/0xb)+parseInt(_0x5415fc(0xfd))/0xc;if(_0x477b70===_0x50927d)break;else _0x4c9138['push'](_0x4c9138['shift']());}catch(_0xfe6744){_0x4c9138['push'](_0x4c9138['shift']());}}}(a293_0x166d,0x6ec4a));function a293_0x18dc(_0x47bf5e,_0x507f8c){_0x47bf5e=_0x47bf5e-0xde;const _0x166da1=a293_0x166d();let _0x18dc38=_0x166da1[_0x47bf5e];return _0x18dc38;}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0xfbcde3,_0x52357a,_0x26a691){const _0x614f2f=a293_0x18dc,_0x1992ba=parseSchema(_0xfbcde3,_0x614f2f(0xef)),_0xf5dd05=parseSchema(_0x52357a,'remote'),_0x2959e3=collectLrSmartJsx(_0x1992ba,!![]);if(_0x2959e3['length']===0x0)return{'content':_0xfbcde3,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x2cc364=new Map(collectLrSmartJsx(_0xf5dd05)[_0x614f2f(0x109)](_0x33f89c=>[_0x33f89c[_0x614f2f(0xe0)],_0x33f89c]));let _0xb43913=0x0,_0x339227=0x0;for(const _0x2ec093 of _0x2959e3){const _0x5db538=readNonEmptyString(_0x2ec093['render'][_0x614f2f(0xf9)]),_0x1e02c9=readNonEmptyString(_0x2ec093['render'][_0x614f2f(0xde)]),_0x15a80e=_0x2cc364['get'](_0x2ec093['key']),_0x173624=readNonEmptyString(_0x15a80e?.['render'][_0x614f2f(0xf9)]),_0x236cbd=readNonEmptyString(_0x15a80e?.['render'][_0x614f2f(0xde)]);let _0x27dbfb=![];_0x2ec093['render']['type']!=='JSFunction'&&(_0x2ec093['render'][_0x614f2f(0xe7)]='JSFunction',_0x27dbfb=!![]);!isPageContextExpression(_0x2ec093[_0x614f2f(0xf1)][_0x614f2f(0x100)])&&(_0x2ec093['props']['_context']={'type':_0x614f2f(0xf0),'value':_0x614f2f(0x106)},_0x27dbfb=!![]);if(!_0x5db538){if(!_0x1e02c9)throw CliErrors[_0x614f2f(0x101)](_0x614f2f(0xf8)+_0x2ec093[_0x614f2f(0xe6)]+_0x614f2f(0xf2),'Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.');if(_0x27dbfb)_0x339227+=0x1;continue;}const _0x5cdc50=!_0x15a80e||_0x5db538!==_0x173624,_0x320f04=!_0x1e02c9;if(!_0x5cdc50&&_0x1e02c9&&_0x236cbd&&_0x1e02c9!==_0x236cbd)throw CliErrors[_0x614f2f(0x101)](_0x614f2f(0xf8)+_0x2ec093['label']+_0x614f2f(0xe8),_0x614f2f(0x102));if(_0x5cdc50||_0x320f04||!_0x236cbd){const _0x227708=readNonEmptyString(await _0x26a691(_0x5db538));if(!_0x227708)throw CliErrors['apiError']('LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22'+_0x2ec093['label']+'\x22.');_0x2ec093[_0x614f2f(0xed)]['value']=_0x227708,_0xb43913+=0x1,_0x27dbfb=!![];}if(_0x27dbfb)_0x339227+=0x1;}if(_0x339227===0x0)return{'content':_0xfbcde3,'compiledNodes':_0xb43913,'normalizedNodes':_0x339227};return{'content':JSON[_0x614f2f(0xee)](_0x1992ba),'compiledNodes':_0xb43913,'normalizedNodes':_0x339227};}function a293_0x166d(){const _0x2a1745=['\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','152183uXyDRK','render','stringify','local','JSExpression','props','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','object','8DpPZMG','5XqWgwh','LrSmartJsx','LrSmartJsx\x20node\x20\x22','source','entries','string','2343108xcesEv','12259488QaFsGV','209gfBbQi','Invalid\x20JSON\x20in\x20','_context','validation','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','915969VRybeB','path:','17958kDkjYT','this','\x20page\x20schema.','\x22\x20has\x20missing\x20or\x20invalid\x20props.','map','value','forEach','key','componentName','63490FFLvnW','isArray','9BlWVtT','56SDNsyU','label','type','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','trim','1127800jYnyZl'];a293_0x166d=function(){return _0x2a1745;};return a293_0x166d();}function parseSchema(_0x53d6cb,_0x3e69f9){const _0x189b03=a293_0x18dc;try{return JSON['parse'](_0x53d6cb);}catch{throw CliErrors[_0x189b03(0x101)](_0x189b03(0xff)+_0x3e69f9+_0x189b03(0x107));}}function collectLrSmartJsx(_0x4586d3,_0x6b41e8=![]){const _0x3b7fa2=[],_0x1d131d=(_0x28d5e8,_0x3da570)=>{const _0x3cf65c=a293_0x18dc;if(Array[_0x3cf65c(0xe3)](_0x28d5e8)){_0x28d5e8[_0x3cf65c(0xdf)]((_0x5d536b,_0x3e87cd)=>_0x1d131d(_0x5d536b,_0x3da570+'['+_0x3e87cd+']'));return;}if(!isObject(_0x28d5e8))return;if(_0x28d5e8['componentName']===_0x3cf65c(0xf7)){const _0x148d7b=readNonEmptyString(_0x28d5e8['id']),_0x4157f4=_0x148d7b||_0x3da570,_0x37fadc=isObject(_0x28d5e8[_0x3cf65c(0xf1)])?_0x28d5e8[_0x3cf65c(0xf1)]:undefined;if(!_0x37fadc){if(_0x6b41e8)throw CliErrors[_0x3cf65c(0x101)](_0x3cf65c(0xf8)+_0x4157f4+_0x3cf65c(0x108),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x2eee0c=isObject(_0x37fadc[_0x3cf65c(0xed)])?_0x37fadc['render']:undefined;if(!_0x2eee0c){if(_0x6b41e8)throw CliErrors[_0x3cf65c(0x101)](_0x3cf65c(0xf8)+_0x4157f4+_0x3cf65c(0xeb),_0x3cf65c(0xf3));return;}_0x3b7fa2['push']({'key':_0x148d7b?'id:'+_0x148d7b:_0x3cf65c(0x104)+_0x3da570,'label':_0x4157f4,'props':_0x37fadc,'render':_0x2eee0c});}for(const [_0x130623,_0x3d06a8]of Object[_0x3cf65c(0xfa)](_0x28d5e8)){if(_0x130623===_0x3cf65c(0xf1)&&_0x28d5e8[_0x3cf65c(0xe1)]===_0x3cf65c(0xf7))continue;_0x1d131d(_0x3d06a8,_0x3da570+'.'+_0x130623);}};return _0x1d131d(_0x4586d3,'$'),_0x3b7fa2;}function isObject(_0x240088){const _0x27c015=a293_0x18dc;return Boolean(_0x240088)&&typeof _0x240088===_0x27c015(0xf4)&&!Array[_0x27c015(0xe3)](_0x240088);}function readNonEmptyString(_0x3bc8ce){const _0x47a959=a293_0x18dc;return typeof _0x3bc8ce===_0x47a959(0xfb)&&_0x3bc8ce[_0x47a959(0xe9)]()?_0x3bc8ce:undefined;}function isPageContextExpression(_0xbcee38){const _0x37d777=a293_0x18dc;return isObject(_0xbcee38)&&_0xbcee38[_0x37d777(0xe7)]===_0x37d777(0xf0)&&_0xbcee38['value']==='this';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x95a7d,_0x4fbba7){const _0x580459=a295_0x3052,_0x48bfdd=_0x95a7d();while(!![]){try{const _0x5e4a6e=parseInt(_0x580459(0x1c5))/0x1*(parseInt(_0x580459(0x1ea))/0x2)+-parseInt(_0x580459(0x210))/0x3*(parseInt(_0x580459(0x1fb))/0x4)+-parseInt(_0x580459(0x1e9))/0x5+-parseInt(_0x580459(0x20e))/0x6+parseInt(_0x580459(0x1c7))/0x7+-parseInt(_0x580459(0x1de))/0x8+-parseInt(_0x580459(0x1df))/0x9*(-parseInt(_0x580459(0x1f6))/0xa);if(_0x5e4a6e===_0x4fbba7)break;else _0x48bfdd['push'](_0x48bfdd['shift']());}catch(_0x3e6291){_0x48bfdd['push'](_0x48bfdd['shift']());}}}(a295_0x47b7,0xc66f2));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x564c4f,_0x95d81a){const _0xdf4b82=a295_0x3052,_0x54c3f5=[],_0x14eb72=normalizeSqlForStaticAnalysis(_0x564c4f),_0x30927f=(_0x14eb72['error']?[]:extractJoinFacts(_0x14eb72[_0xdf4b82(0x202)]))[_0xdf4b82(0x1d4)](_0x8b5e23=>{const _0x275018=_0xdf4b82;if(_0x8b5e23[_0x275018(0x1e4)]||_0x8b5e23[_0x275018(0x1cb)][_0x275018(0x1f8)]===0x0)return _0x54c3f5[_0x275018(0x1e3)]({'code':_0x275018(0x204),'table':_0x8b5e23[_0x275018(0x1f1)],'alias':_0x8b5e23['alias'],'columns':_0x8b5e23[_0x275018(0x1cb)],'reason':_0x8b5e23['unsupportedReason']??_0x275018(0x1d3)}),{'table':_0x8b5e23['table'],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23[_0x275018(0x1cb)],'status':_0x275018(0x208)};const _0x3479b4=resolveTableMetadata(_0x95d81a,_0x8b5e23['table']),_0xe1f5e=(_0x3479b4?.['indexes']??[])['map'](_0x4aa281=>({'index':_0x4aa281,'matchedPrefix':findEqualityPrefix(_0x4aa281[_0x275018(0x1cb)],_0x8b5e23[_0x275018(0x1cb)])}))[_0x275018(0x1e7)](_0x1985fe=>_0x1985fe['matchedPrefix'][_0x275018(0x1f8)]>0x0),_0x22e363=_0xe1f5e['reduce']((_0x42ffa5,_0x1315b4)=>!_0x42ffa5||_0x1315b4[_0x275018(0x1ec)][_0x275018(0x1f8)]>_0x42ffa5[_0x275018(0x1ec)]['length']?_0x1315b4:_0x42ffa5,_0xe1f5e[0x0]);if(_0x22e363)return{'table':_0x8b5e23[_0x275018(0x1f1)],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23['columns'],'status':_0x275018(0x1ff),'matchedIndex':{..._0x22e363[_0x275018(0x1ef)],'matchedPrefix':_0x22e363[_0x275018(0x1ec)]}};const _0x371d7b=_0x3479b4?.[_0x275018(0x1d1)][_0x275018(0x1e7)](_0x2a3f28=>_0x2a3f28[_0x275018(0x1cb)]['some'](_0x50826a=>_0x8b5e23['columns']['some'](_0x97b264=>columnNamesMatch(_0x50826a,_0x97b264))))??[];if(_0x371d7b[_0x275018(0x1f8)]>0x0)return _0x54c3f5[_0x275018(0x1e3)]({'code':_0x275018(0x20a),'table':_0x8b5e23[_0x275018(0x1f1)],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23['columns'],'reason':_0x275018(0x1e8)}),{'table':_0x8b5e23['table'],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23['columns'],'status':'warning','candidateIndexes':_0x371d7b};if(_0x3479b4&&_0x3479b4[_0x275018(0x1f3)]!==![]&&_0x3479b4[_0x275018(0x1d1)][_0x275018(0x1f8)]>0x0&&_0x8b5e23[_0x275018(0x1cb)][_0x275018(0x1f8)]>0x0)return _0x54c3f5['push']({'code':_0x275018(0x1d7),'table':_0x8b5e23[_0x275018(0x1f1)],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23[_0x275018(0x1cb)],'reason':_0x275018(0x20c)}),{'table':_0x8b5e23[_0x275018(0x1f1)],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23[_0x275018(0x1cb)],'status':_0x275018(0x1c6)};return _0x54c3f5[_0x275018(0x1e3)]({'code':_0x275018(0x1db),'table':_0x8b5e23[_0x275018(0x1f1)],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23[_0x275018(0x1cb)],'reason':_0x3479b4?_0x275018(0x212):_0x275018(0x206)}),{'table':_0x8b5e23['table'],'alias':_0x8b5e23[_0x275018(0x20f)],'columns':_0x8b5e23[_0x275018(0x1cb)],'status':_0x275018(0x208)};});return{'checked':_0x30927f['length']>0x0,'joins':_0x30927f,'warnings':_0x54c3f5};}function extractJoinFacts(_0x5186b4){const _0x208ddc=a295_0x3052,_0x1c767f=maskNestedQueries(stripSqlNoise(_0x5186b4)),_0x379db2=maskQuotedIdentifiers(_0x1c767f),_0x5a8aa3=[],_0xe08130=new Set(),_0x5c1684=/\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 _0x3c2de8 of _0x1c767f[_0x208ddc(0x20d)](_0x5c1684)){const _0x5fba63=_0x3c2de8[_0x208ddc(0x1ef)]??0x0,_0x52d13f=_0x3c2de8[0x0][_0x208ddc(0x1f7)](/\bJOIN\b/i),_0x35b548=_0x5fba63+Math['max'](0x0,_0x52d13f);if(!/^JOIN\b/i[_0x208ddc(0x203)](_0x379db2['slice'](_0x35b548)))continue;_0xe08130['add'](_0x35b548);const _0x46bcce=normalizeIdentifier(_0x3c2de8[0x1]||_0x208ddc(0x1fc)),_0xf1851b=normalizeIdentifier(_0x3c2de8[0x2]??''),_0x25bc38=normalizeIdentifier(_0x3c2de8[0x3]||_0xf1851b[_0x208ddc(0x1fd)]('.')['at'](-0x1)||_0xf1851b),_0x420077=[],_0x341d03=_0xf1851b===_0x208ddc(0x1cf);let _0x44e384=_0x46bcce===_0x208ddc(0x1e0)||_0x46bcce===_0x208ddc(0x1dd)||_0x341d03,_0x48c089=_0x44e384?_0x341d03?_0x208ddc(0x1fe):_0x46bcce[_0x208ddc(0x1f2)]()+_0x208ddc(0x1d0):undefined;const _0x301aec=stripOuterParentheses(_0x3c2de8[0x4]??''),_0x2ba56b=_0x301aec['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x301aec[_0x208ddc(0x1eb)](MYBATIS_DYNAMIC_END_MARKER),_0x571a06=_0x301aec['includes'](MYBATIS_INCLUDE_MARKER);_0x2ba56b&&(_0x44e384=!![],_0x48c089??=_0x208ddc(0x1d2));_0x571a06&&(_0x44e384=!![],_0x48c089??=_0x208ddc(0x1cd));const _0x49303f=_0x301aec[_0x208ddc(0x1f4)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x208ddc(0x1f4)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x49303f,'OR')&&(_0x44e384=!![],_0x48c089??=_0x208ddc(0x1e2));for(const _0xd2dfb of splitTopLevelAnd(_0x49303f)){const _0x34bd5c=stripOuterParentheses(_0xd2dfb);if(hasTopLevelKeyword(_0x34bd5c,'OR')){_0x44e384=!![],_0x48c089??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x5ba7a1=splitEquality(_0x34bd5c);if(!_0x5ba7a1){containsColumnReference(_0xd2dfb,_0x25bc38)&&(_0x44e384=!![]);continue;}const _0x13b5b5=parseDirectColumnReference(_0x5ba7a1[0x0],_0x25bc38),_0x35475d=parseDirectColumnReference(_0x5ba7a1[0x1],_0x25bc38),_0x25eb51=containsColumnReference(_0x5ba7a1[0x0],_0x25bc38),_0x2c33cd=containsColumnReference(_0x5ba7a1[0x1],_0x25bc38),_0x1f0cc3=_0x13b5b5&&!_0x2c33cd?_0x13b5b5:_0x35475d&&!_0x25eb51?_0x35475d:null;if(_0x1f0cc3&&!_0x420077['includes'](_0x1f0cc3))_0x420077['push'](_0x1f0cc3);else!_0x1f0cc3&&containsColumnReference(_0xd2dfb,_0x25bc38)&&(_0x44e384=!![]);}_0x5a8aa3['push']({'table':_0xf1851b,'alias':_0x25bc38,'columns':_0x420077,'unsupportedPredicate':_0x44e384,'unsupportedReason':_0x48c089,'containsUnresolvedInclude':_0x571a06,'position':_0x35b548});}for(const _0xbd21dd of _0x379db2['matchAll'](/\bJOIN\b/gi)){const _0x3361ba=_0xbd21dd[_0x208ddc(0x1ef)]??0x0;if(_0xe08130[_0x208ddc(0x1fa)](_0x3361ba))continue;const _0xe2f598=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x208ddc(0x1e6)](_0x1c767f['slice'](_0x3361ba+_0xbd21dd[0x0][_0x208ddc(0x1f8)])),_0x1f35c8=normalizeIdentifier(_0xe2f598?.[0x1]||'unknown'),_0x2ad0c9=normalizeIdentifier(_0xe2f598?.[0x2]||''),_0x2dacbd=isSqlClauseKeyword(_0x2ad0c9)?_0x1f35c8[_0x208ddc(0x1fd)]('.')['at'](-0x1)||_0x1f35c8:_0x2ad0c9||_0x1f35c8[_0x208ddc(0x1fd)]('.')['at'](-0x1)||_0x1f35c8;_0x5a8aa3['push']({'table':_0x1f35c8,'alias':_0x2dacbd,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x208ddc(0x1c9),'position':_0x3361ba});}const _0x10e978=_0x379db2['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x10e978>=0x0&&!_0x5a8aa3[_0x208ddc(0x200)](_0x4710b7=>_0x4710b7[_0x208ddc(0x1d5)])&&_0x5a8aa3[_0x208ddc(0x1e3)]({'table':_0x208ddc(0x20b),'alias':_0x208ddc(0x20b),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x208ddc(0x1c8),'containsUnresolvedInclude':!![],'position':_0x10e978}),_0x5a8aa3['sort']((_0x35cd2e,_0x36d32d)=>_0x35cd2e[_0x208ddc(0x205)]-_0x36d32d[_0x208ddc(0x205)]);}function stripSqlNoise(_0x4838d6){const _0x499909=a295_0x3052,_0x3031ee=Array['from'](_0x4838d6),_0x505bf8=(_0x4b19a7,_0x14d86f)=>{for(let _0x2b29db=_0x4b19a7;_0x2b29db<_0x14d86f;_0x2b29db+=0x1){_0x3031ee[_0x2b29db]!=='\x0a'&&_0x3031ee[_0x2b29db]!=='\x0d'&&(_0x3031ee[_0x2b29db]='\x20');}};for(let _0xe65b1b=0x0;_0xe65b1b<_0x3031ee[_0x499909(0x1f8)];_0xe65b1b+=0x1){const _0xdffd53=_0x3031ee[_0xe65b1b],_0x533107=_0x3031ee[_0xe65b1b+0x1];if(_0xdffd53==='\x27'||_0xdffd53==='\x22'||_0xdffd53==='`'){const _0x26dfd6=_0xdffd53,_0x5974a0=_0xe65b1b;_0xe65b1b+=0x1;while(_0xe65b1b<_0x3031ee['length']){if(_0x3031ee[_0xe65b1b]==='\x5c'&&_0xe65b1b+0x1<_0x3031ee[_0x499909(0x1f8)]){_0xe65b1b+=0x2;continue;}if(_0x3031ee[_0xe65b1b]!==_0x26dfd6){_0xe65b1b+=0x1;continue;}if(_0x3031ee[_0xe65b1b+0x1]===_0x26dfd6){_0xe65b1b+=0x2;continue;}break;}if(_0x26dfd6==='\x27')_0x505bf8(_0x5974a0,Math[_0x499909(0x1d6)](_0xe65b1b+0x1,_0x3031ee['length']));continue;}if(_0xdffd53==='-'&&_0x533107==='-'){const _0xdf462e=_0xe65b1b;while(_0xe65b1b<_0x3031ee[_0x499909(0x1f8)]&&_0x3031ee[_0xe65b1b]!=='\x0a')_0xe65b1b+=0x1;_0x505bf8(_0xdf462e,_0xe65b1b);continue;}if(_0xdffd53==='/'&&_0x533107==='*'){const _0x5b7c24=_0xe65b1b;_0xe65b1b+=0x2;while(_0xe65b1b<_0x3031ee['length']&&!(_0x3031ee[_0xe65b1b]==='*'&&_0x3031ee[_0xe65b1b+0x1]==='/')){_0xe65b1b+=0x1;}_0xe65b1b=Math['min'](_0xe65b1b+0x1,_0x3031ee[_0x499909(0x1f8)]-0x1),_0x505bf8(_0x5b7c24,_0xe65b1b+0x1);continue;}if(_0xdffd53==='#'&&_0x533107!=='{'){const _0x481349=_0xe65b1b;while(_0xe65b1b<_0x3031ee[_0x499909(0x1f8)]&&_0x3031ee[_0xe65b1b]!=='\x0a')_0xe65b1b+=0x1;_0x505bf8(_0x481349,_0xe65b1b);continue;}if((_0xdffd53==='#'||_0xdffd53==='$')&&_0x533107==='{'){const _0x181572=_0xe65b1b;_0xe65b1b+=0x2;while(_0xe65b1b<_0x3031ee['length']&&_0x3031ee[_0xe65b1b]!=='}')_0xe65b1b+=0x1;_0x505bf8(_0x181572,Math['min'](_0xe65b1b+0x1,_0x3031ee[_0x499909(0x1f8)]));}}return _0x3031ee[_0x499909(0x1e1)]('');}function maskQuotedIdentifiers(_0x2ce868){const _0x404652=a295_0x3052,_0x27be75=Array['from'](_0x2ce868);for(let _0x29b794=0x0;_0x29b794<_0x27be75[_0x404652(0x1f8)];_0x29b794+=0x1){const _0x2a5692=_0x27be75[_0x29b794];if(_0x2a5692!=='\x22'&&_0x2a5692!=='`')continue;_0x29b794+=0x1;while(_0x29b794<_0x27be75[_0x404652(0x1f8)]){if(_0x27be75[_0x29b794]===_0x2a5692){if(_0x27be75[_0x29b794+0x1]===_0x2a5692){_0x27be75[_0x29b794]='\x20',_0x27be75[_0x29b794+0x1]='\x20',_0x29b794+=0x2;continue;}break;}_0x27be75[_0x29b794]='\x20',_0x29b794+=0x1;}}return _0x27be75['join']('');}function maskNestedQueries(_0x4730da){const _0x3c0c1f=a295_0x3052,_0x2c39bf=Array[_0x3c0c1f(0x1f0)](_0x4730da);for(let _0x3faa5a=0x0;_0x3faa5a<_0x2c39bf[_0x3c0c1f(0x1f8)];_0x3faa5a+=0x1){if(_0x2c39bf[_0x3faa5a]!=='(')continue;const _0x365642=_0x4730da[_0x3c0c1f(0x1e5)](_0x3faa5a+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x3c0c1f(0x203)](_0x365642))continue;let _0x5904b5=0x1,_0x30ae67=_0x3faa5a+0x1;for(;_0x30ae67<_0x2c39bf[_0x3c0c1f(0x1f8)]&&_0x5904b5>0x0;_0x30ae67+=0x1){if(_0x2c39bf[_0x30ae67]==='(')_0x5904b5+=0x1;if(_0x2c39bf[_0x30ae67]===')')_0x5904b5-=0x1;}if(_0x5904b5!==0x0)continue;for(let _0x32d125=_0x3faa5a;_0x32d125<_0x30ae67;_0x32d125+=0x1){_0x2c39bf[_0x32d125]='\x20';}const _0x12fb8e=_0x3c0c1f(0x1cf);for(let _0x410559=0x0;_0x410559<_0x12fb8e['length']&&_0x3faa5a+_0x410559<_0x30ae67;_0x410559+=0x1){_0x2c39bf[_0x3faa5a+_0x410559]=_0x12fb8e[_0x410559];}_0x3faa5a=_0x30ae67-0x1;}return _0x2c39bf[_0x3c0c1f(0x1e1)]('');}function splitTopLevelAnd(_0xa98603){const _0x323969=a295_0x3052,_0x2e7a72=[];let _0x1be3da=0x0,_0x5dde73=0x0;for(let _0x52bf23=0x0;_0x52bf23<_0xa98603[_0x323969(0x1f8)];_0x52bf23+=0x1){const _0x333ef0=_0xa98603[_0x52bf23];if(_0x333ef0==='(')_0x1be3da+=0x1;if(_0x333ef0===')')_0x1be3da=Math[_0x323969(0x1d9)](0x0,_0x1be3da-0x1);_0x1be3da===0x0&&_0xa98603[_0x323969(0x1e5)](_0x52bf23)[_0x323969(0x1cc)](/^AND\b/i)&&(_0x52bf23===0x0||/\s/[_0x323969(0x203)](_0xa98603[_0x52bf23-0x1]??''))&&(_0x2e7a72['push'](_0xa98603[_0x323969(0x1e5)](_0x5dde73,_0x52bf23)[_0x323969(0x201)]()),_0x52bf23+=0x2,_0x5dde73=_0x52bf23+0x1);}const _0x32fa53=_0xa98603['slice'](_0x5dde73)[_0x323969(0x201)]();if(_0x32fa53)_0x2e7a72[_0x323969(0x1e3)](_0x32fa53);return _0x2e7a72;}function hasTopLevelKeyword(_0x211b31,_0x428578){const _0x597c34=a295_0x3052;let _0x4b163c=0x0;for(let _0x3d8e23=0x0;_0x3d8e23<_0x211b31['length'];_0x3d8e23+=0x1){const _0x2e0667=_0x211b31[_0x3d8e23];if(_0x2e0667==='(')_0x4b163c+=0x1;if(_0x2e0667===')')_0x4b163c=Math[_0x597c34(0x1d9)](0x0,_0x4b163c-0x1);if(_0x4b163c!==0x0)continue;const _0x1d1074=_0x211b31[_0x597c34(0x1e5)](_0x3d8e23,_0x3d8e23+_0x428578[_0x597c34(0x1f8)]),_0x4dc4f0=_0x211b31[_0x3d8e23-0x1]??'\x20',_0x4b7e59=_0x211b31[_0x3d8e23+_0x428578[_0x597c34(0x1f8)]]??'\x20';if(_0x1d1074['toUpperCase']()===_0x428578['toUpperCase']()&&!/[\w$]/['test'](_0x4dc4f0)&&!/[\w$]/[_0x597c34(0x203)](_0x4b7e59))return!![];}return![];}function splitEquality(_0x23f0ae){const _0x2265b1=a295_0x3052,_0x483fe9=stripOuterParentheses(_0x23f0ae);let _0x2e91e1=0x0,_0x266f84;for(let _0x21250e=0x0;_0x21250e<_0x483fe9[_0x2265b1(0x1f8)];_0x21250e+=0x1){const _0x561b1f=_0x483fe9[_0x21250e];if(_0x561b1f==='(')_0x2e91e1+=0x1;if(_0x561b1f===')')_0x2e91e1=Math[_0x2265b1(0x1d9)](0x0,_0x2e91e1-0x1);const _0xff779a=_0x483fe9[_0x21250e-0x1]??'',_0x471fe0=_0x483fe9[_0x21250e+0x1]??'';if(_0x561b1f==='='&&_0x2e91e1===0x0&&!/[!<>=:]/[_0x2265b1(0x203)](_0xff779a)&&_0x471fe0!=='='){if(_0x266f84!==undefined)return null;_0x266f84=_0x21250e;}}return _0x266f84===undefined?null:[_0x483fe9[_0x2265b1(0x1e5)](0x0,_0x266f84)['trim'](),_0x483fe9[_0x2265b1(0x1e5)](_0x266f84+0x1)[_0x2265b1(0x201)]()];}function a295_0x47b7(){const _0x1d593e=['\x5c$&','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','2FkrqWq','warning','2615081GdCHik','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','toLowerCase','columns','match','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','cross','__sq__','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','indexes','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','map','containsUnresolvedInclude','min','JOIN_INDEX_MISSING','inner','max','\x5cs*\x5c.\x5cs*[\x5cw$]+','INDEX_METADATA_UNAVAILABLE','where','full','1701592orLacp','7551ZkaCKF','right','join','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','push','unsupportedPredicate','slice','exec','filter','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','7344070zeRthz','765192XJeDZp','includes','matchedPrefix','replace','(?:^|[^\x5cw$])','index','from','table','toUpperCase','metadataAvailable','replaceAll','natural','19810ymsLCD','search','length','tableName','has','7892wdzRPx','INNER','split','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','covered','some','trim','sql','test','JOIN_PREDICATE_UNSUPPORTED','position','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','left','unavailable','startsWith','JOIN_INDEX_NOT_USABLE','unknown','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','matchAll','1791858ymTyCj','alias','12QqJCJi'];a295_0x47b7=function(){return _0x1d593e;};return a295_0x47b7();}function parseDirectColumnReference(_0x4290b1,_0xf38026){const _0x420fae=a295_0x3052,_0x2b888b=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x420fae(0x1e6)](stripOuterParentheses(_0x4290b1));if(!_0x2b888b)return null;if(normalizeIdentifier(_0x2b888b[0x1]??'')!==normalizeIdentifier(_0xf38026))return null;return normalizeIdentifier(_0x2b888b[0x2]??'');}function containsColumnReference(_0x240f76,_0x2a8c27){const _0x1ed16b=a295_0x3052,_0x2100ed=_0x240f76[_0x1ed16b(0x1ed)](/[`"]/g,''),_0x3798fb=_0x2a8c27[_0x1ed16b(0x1ed)](/[.*+?^${}()|[\]\\]/g,_0x1ed16b(0x211));return new RegExp(_0x1ed16b(0x1ee)+_0x3798fb+_0x1ed16b(0x1da),'i')[_0x1ed16b(0x203)](_0x2100ed);}function findEqualityPrefix(_0x16b676,_0x4e164d){const _0x3e67c5=a295_0x3052,_0x436b50=new Set(_0x4e164d['map'](normalizeIdentifier)),_0x2f1c54=[];for(const _0x1b4fbb of _0x16b676){if(!_0x436b50[_0x3e67c5(0x1fa)](normalizeIdentifier(_0x1b4fbb)))break;_0x2f1c54[_0x3e67c5(0x1e3)](_0x1b4fbb);}return _0x2f1c54;}function resolveTableMetadata(_0x2515f9,_0x414226){const _0x5735a7=a295_0x3052,_0x236047=normalizeIdentifier(_0x414226),_0x189b5d=_0x2515f9[_0x5735a7(0x1e7)](_0x5a6420=>normalizeIdentifier(_0x5a6420[_0x5735a7(0x1f9)])===_0x236047);if(_0x189b5d[_0x5735a7(0x1f8)]===0x1)return _0x189b5d[0x0];const _0x1580f7=_0x236047[_0x5735a7(0x1eb)]('.'),_0x463aaa=_0x236047['split']('.')['at'](-0x1),_0x5c9437=_0x2515f9[_0x5735a7(0x1e7)](_0x278220=>{const _0x4adcaf=_0x5735a7,_0xd83921=normalizeIdentifier(_0x278220['tableName']);if(_0x1580f7&&_0xd83921[_0x4adcaf(0x1eb)]('.'))return![];return _0xd83921['split']('.')['at'](-0x1)===_0x463aaa;});return _0x5c9437[_0x5735a7(0x1f8)]===0x1?_0x5c9437[0x0]:undefined;}function columnNamesMatch(_0x5a0178,_0x2d824d){return normalizeIdentifier(_0x5a0178)===normalizeIdentifier(_0x2d824d);}function normalizeIdentifier(_0x33e017){const _0x32fee9=a295_0x3052;return _0x33e017[_0x32fee9(0x1ed)](/[`"]/g,'')['trim']()[_0x32fee9(0x1ca)]();}function isSqlClauseKeyword(_0x34dfd8){const _0x5e8a03=a295_0x3052;return new Set(['on','using',_0x5e8a03(0x1dc),_0x5e8a03(0x1e1),_0x5e8a03(0x1d8),_0x5e8a03(0x207),_0x5e8a03(0x1e0),_0x5e8a03(0x1dd),_0x5e8a03(0x1ce),_0x5e8a03(0x1f5)])[_0x5e8a03(0x1fa)](_0x34dfd8);}function a295_0x3052(_0x38846b,_0x42123e){_0x38846b=_0x38846b-0x1c5;const _0x47b7a8=a295_0x47b7();let _0x305265=_0x47b7a8[_0x38846b];return _0x305265;}function stripOuterParentheses(_0x563c9d){const _0x53e1a0=a295_0x3052;let _0x444076=_0x563c9d[_0x53e1a0(0x201)]();while(_0x444076[_0x53e1a0(0x209)]('(')&&_0x444076['endsWith'](')')){let _0x20bfb8=0x0,_0x798cbb=!![];for(let _0x18ffed=0x0;_0x18ffed<_0x444076[_0x53e1a0(0x1f8)];_0x18ffed+=0x1){if(_0x444076[_0x18ffed]==='(')_0x20bfb8+=0x1;if(_0x444076[_0x18ffed]===')')_0x20bfb8-=0x1;if(_0x20bfb8===0x0&&_0x18ffed<_0x444076[_0x53e1a0(0x1f8)]-0x1){_0x798cbb=![];break;}}if(!_0x798cbb||_0x20bfb8!==0x0)break;_0x444076=_0x444076[_0x53e1a0(0x1e5)](0x1,-0x1)[_0x53e1a0(0x201)]();}return _0x444076;}
|
|
1
|
+
(function(_0x537cbb,_0x3c23fd){const _0x16bdb1=a295_0x348c,_0x36f4b2=_0x537cbb();while(!![]){try{const _0x3ad0df=parseInt(_0x16bdb1(0xdb))/0x1+-parseInt(_0x16bdb1(0x109))/0x2+-parseInt(_0x16bdb1(0x105))/0x3+parseInt(_0x16bdb1(0x106))/0x4*(parseInt(_0x16bdb1(0xfa))/0x5)+parseInt(_0x16bdb1(0xe5))/0x6+parseInt(_0x16bdb1(0x102))/0x7+-parseInt(_0x16bdb1(0xca))/0x8;if(_0x3ad0df===_0x3c23fd)break;else _0x36f4b2['push'](_0x36f4b2['shift']());}catch(_0x5e9cef){_0x36f4b2['push'](_0x36f4b2['shift']());}}}(a295_0x5753,0x9504e));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5662c0,_0x3d6858){const _0x5edda2=a295_0x348c,_0x363329=[],_0x3a6abe=normalizeSqlForStaticAnalysis(_0x5662c0),_0x566e7b=(_0x3a6abe[_0x5edda2(0x104)]?[]:extractJoinFacts(_0x3a6abe[_0x5edda2(0x103)]))['map'](_0x1e3145=>{const _0x17eed1=_0x5edda2;if(_0x1e3145[_0x17eed1(0xde)]||_0x1e3145['columns'][_0x17eed1(0xe0)]===0x0)return _0x363329[_0x17eed1(0x10e)]({'code':_0x17eed1(0xe3),'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':_0x1e3145[_0x17eed1(0x108)]??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xe4)};const _0x9fc04=resolveTableMetadata(_0x3d6858,_0x1e3145[_0x17eed1(0xf1)]),_0x416275=(_0x9fc04?.[_0x17eed1(0xcc)]??[])[_0x17eed1(0xcb)](_0x34d1b1=>({'index':_0x34d1b1,'matchedPrefix':findEqualityPrefix(_0x34d1b1[_0x17eed1(0xd9)],_0x1e3145['columns'])}))[_0x17eed1(0xdc)](_0x3e6014=>_0x3e6014[_0x17eed1(0xf9)][_0x17eed1(0xe0)]>0x0),_0x58ce06=_0x416275[_0x17eed1(0xce)]((_0x54c1d3,_0x5f5cbd)=>!_0x54c1d3||_0x5f5cbd['matchedPrefix'][_0x17eed1(0xe0)]>_0x54c1d3[_0x17eed1(0xf9)][_0x17eed1(0xe0)]?_0x5f5cbd:_0x54c1d3,_0x416275[0x0]);if(_0x58ce06)return{'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xd4),'matchedIndex':{..._0x58ce06['index'],'matchedPrefix':_0x58ce06['matchedPrefix']}};const _0xec2b50=_0x9fc04?.[_0x17eed1(0xcc)][_0x17eed1(0xdc)](_0x4f15a7=>_0x4f15a7[_0x17eed1(0xd9)]['some'](_0x4f3add=>_0x1e3145[_0x17eed1(0xd9)]['some'](_0x17006b=>columnNamesMatch(_0x4f3add,_0x17006b))))??[];if(_0xec2b50[_0x17eed1(0xe0)]>0x0)return _0x363329[_0x17eed1(0x10e)]({'code':_0x17eed1(0xd2),'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':_0x17eed1(0xfd)}),{'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xd3),'candidateIndexes':_0xec2b50};if(_0x9fc04&&_0x9fc04[_0x17eed1(0xf3)]!==![]&&_0x9fc04[_0x17eed1(0xcc)]['length']>0x0&&_0x1e3145['columns'][_0x17eed1(0xe0)]>0x0)return _0x363329[_0x17eed1(0x10e)]({'code':_0x17eed1(0x101),'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':'warning'};return _0x363329[_0x17eed1(0x10e)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':_0x9fc04?_0x17eed1(0xf4):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xe4)};});return{'checked':_0x566e7b['length']>0x0,'joins':_0x566e7b,'warnings':_0x363329};}function extractJoinFacts(_0x7bae15){const _0x44813a=a295_0x348c,_0x45e34d=maskNestedQueries(stripSqlNoise(_0x7bae15)),_0x44688e=maskQuotedIdentifiers(_0x45e34d),_0x41fda7=[],_0x410a09=new Set(),_0x10d2b5=/\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 _0x70dd10 of _0x45e34d[_0x44813a(0x10d)](_0x10d2b5)){const _0x41e29c=_0x70dd10[_0x44813a(0xf7)]??0x0,_0x1fe550=_0x70dd10[0x0][_0x44813a(0xfe)](/\bJOIN\b/i),_0x1abf7c=_0x41e29c+Math['max'](0x0,_0x1fe550);if(!/^JOIN\b/i[_0x44813a(0xf2)](_0x44688e[_0x44813a(0xe6)](_0x1abf7c)))continue;_0x410a09[_0x44813a(0xd7)](_0x1abf7c);const _0x11453e=normalizeIdentifier(_0x70dd10[0x1]||_0x44813a(0xf6)),_0x45db72=normalizeIdentifier(_0x70dd10[0x2]??''),_0x456767=normalizeIdentifier(_0x70dd10[0x3]||_0x45db72[_0x44813a(0xee)]('.')['at'](-0x1)||_0x45db72),_0x1e7ab0=[],_0x41838c=_0x45db72===_0x44813a(0x10f);let _0x2a3cd3=_0x11453e===_0x44813a(0xd5)||_0x11453e===_0x44813a(0xda)||_0x41838c,_0x5c9d1f=_0x2a3cd3?_0x41838c?_0x44813a(0xff):_0x11453e[_0x44813a(0xe7)]()+_0x44813a(0xd8):undefined;const _0x2c0022=stripOuterParentheses(_0x70dd10[0x4]??''),_0x253cbe=_0x2c0022['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x2c0022[_0x44813a(0x10c)](MYBATIS_DYNAMIC_END_MARKER),_0x1531c1=_0x2c0022['includes'](MYBATIS_INCLUDE_MARKER);_0x253cbe&&(_0x2a3cd3=!![],_0x5c9d1f??=_0x44813a(0x110));_0x1531c1&&(_0x2a3cd3=!![],_0x5c9d1f??=_0x44813a(0xc8));const _0x2228ad=_0x2c0022['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x44813a(0xd6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x44813a(0xd6)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x2228ad,'OR')&&(_0x2a3cd3=!![],_0x5c9d1f??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x4f7574 of splitTopLevelAnd(_0x2228ad)){const _0x1ed77c=stripOuterParentheses(_0x4f7574);if(hasTopLevelKeyword(_0x1ed77c,'OR')){_0x2a3cd3=!![],_0x5c9d1f??=_0x44813a(0xcd);continue;}const _0x3f2ee2=splitEquality(_0x1ed77c);if(!_0x3f2ee2){containsColumnReference(_0x4f7574,_0x456767)&&(_0x2a3cd3=!![]);continue;}const _0x2778a8=parseDirectColumnReference(_0x3f2ee2[0x0],_0x456767),_0x4e0f6a=parseDirectColumnReference(_0x3f2ee2[0x1],_0x456767),_0x35fce8=containsColumnReference(_0x3f2ee2[0x0],_0x456767),_0x3be2d8=containsColumnReference(_0x3f2ee2[0x1],_0x456767),_0x150552=_0x2778a8&&!_0x3be2d8?_0x2778a8:_0x4e0f6a&&!_0x35fce8?_0x4e0f6a:null;if(_0x150552&&!_0x1e7ab0[_0x44813a(0x10c)](_0x150552))_0x1e7ab0['push'](_0x150552);else!_0x150552&&containsColumnReference(_0x4f7574,_0x456767)&&(_0x2a3cd3=!![]);}_0x41fda7[_0x44813a(0x10e)]({'table':_0x45db72,'alias':_0x456767,'columns':_0x1e7ab0,'unsupportedPredicate':_0x2a3cd3,'unsupportedReason':_0x5c9d1f,'containsUnresolvedInclude':_0x1531c1,'position':_0x1abf7c});}for(const _0x1b4390 of _0x44688e[_0x44813a(0x10d)](/\bJOIN\b/gi)){const _0x1932c1=_0x1b4390[_0x44813a(0xf7)]??0x0;if(_0x410a09[_0x44813a(0xcf)](_0x1932c1))continue;const _0x13404c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x44813a(0xd0)](_0x45e34d[_0x44813a(0xe6)](_0x1932c1+_0x1b4390[0x0][_0x44813a(0xe0)])),_0x3514bd=normalizeIdentifier(_0x13404c?.[0x1]||_0x44813a(0xec)),_0x32ad77=normalizeIdentifier(_0x13404c?.[0x2]||''),_0x4c0e9c=isSqlClauseKeyword(_0x32ad77)?_0x3514bd[_0x44813a(0xee)]('.')['at'](-0x1)||_0x3514bd:_0x32ad77||_0x3514bd[_0x44813a(0xee)]('.')['at'](-0x1)||_0x3514bd;_0x41fda7['push']({'table':_0x3514bd,'alias':_0x4c0e9c,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1932c1});}const _0x364425=_0x44688e[_0x44813a(0xdf)](MYBATIS_INCLUDE_MARKER);return _0x364425>=0x0&&!_0x41fda7[_0x44813a(0xea)](_0x2f8a43=>_0x2f8a43[_0x44813a(0xf5)])&&_0x41fda7[_0x44813a(0x10e)]({'table':'unknown','alias':_0x44813a(0xec),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x364425}),_0x41fda7['sort']((_0x2c6dd9,_0x203d8d)=>_0x2c6dd9['position']-_0x203d8d[_0x44813a(0xd1)]);}function stripSqlNoise(_0x5dabc8){const _0x57d3f7=a295_0x348c,_0xe6f91f=Array[_0x57d3f7(0x107)](_0x5dabc8),_0x3dbb40=(_0x4c10e8,_0x2137be)=>{for(let _0x50c7f0=_0x4c10e8;_0x50c7f0<_0x2137be;_0x50c7f0+=0x1){_0xe6f91f[_0x50c7f0]!=='\x0a'&&_0xe6f91f[_0x50c7f0]!=='\x0d'&&(_0xe6f91f[_0x50c7f0]='\x20');}};for(let _0x4b31d3=0x0;_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)];_0x4b31d3+=0x1){const _0x189e1b=_0xe6f91f[_0x4b31d3],_0x375aaa=_0xe6f91f[_0x4b31d3+0x1];if(_0x189e1b==='\x27'||_0x189e1b==='\x22'||_0x189e1b==='`'){const _0x308737=_0x189e1b,_0x13b59f=_0x4b31d3;_0x4b31d3+=0x1;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]){if(_0xe6f91f[_0x4b31d3]==='\x5c'&&_0x4b31d3+0x1<_0xe6f91f[_0x57d3f7(0xe0)]){_0x4b31d3+=0x2;continue;}if(_0xe6f91f[_0x4b31d3]!==_0x308737){_0x4b31d3+=0x1;continue;}if(_0xe6f91f[_0x4b31d3+0x1]===_0x308737){_0x4b31d3+=0x2;continue;}break;}if(_0x308737==='\x27')_0x3dbb40(_0x13b59f,Math[_0x57d3f7(0xeb)](_0x4b31d3+0x1,_0xe6f91f[_0x57d3f7(0xe0)]));continue;}if(_0x189e1b==='-'&&_0x375aaa==='-'){const _0x89ed2c=_0x4b31d3;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]&&_0xe6f91f[_0x4b31d3]!=='\x0a')_0x4b31d3+=0x1;_0x3dbb40(_0x89ed2c,_0x4b31d3);continue;}if(_0x189e1b==='/'&&_0x375aaa==='*'){const _0xe3c474=_0x4b31d3;_0x4b31d3+=0x2;while(_0x4b31d3<_0xe6f91f['length']&&!(_0xe6f91f[_0x4b31d3]==='*'&&_0xe6f91f[_0x4b31d3+0x1]==='/')){_0x4b31d3+=0x1;}_0x4b31d3=Math[_0x57d3f7(0xeb)](_0x4b31d3+0x1,_0xe6f91f[_0x57d3f7(0xe0)]-0x1),_0x3dbb40(_0xe3c474,_0x4b31d3+0x1);continue;}if(_0x189e1b==='#'&&_0x375aaa!=='{'){const _0x118717=_0x4b31d3;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]&&_0xe6f91f[_0x4b31d3]!=='\x0a')_0x4b31d3+=0x1;_0x3dbb40(_0x118717,_0x4b31d3);continue;}if((_0x189e1b==='#'||_0x189e1b==='$')&&_0x375aaa==='{'){const _0x3e965f=_0x4b31d3;_0x4b31d3+=0x2;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]&&_0xe6f91f[_0x4b31d3]!=='}')_0x4b31d3+=0x1;_0x3dbb40(_0x3e965f,Math[_0x57d3f7(0xeb)](_0x4b31d3+0x1,_0xe6f91f[_0x57d3f7(0xe0)]));}}return _0xe6f91f[_0x57d3f7(0xdd)]('');}function maskQuotedIdentifiers(_0x54ed90){const _0x59d2af=a295_0x348c,_0x2bfb8c=Array[_0x59d2af(0x107)](_0x54ed90);for(let _0x1c3dae=0x0;_0x1c3dae<_0x2bfb8c[_0x59d2af(0xe0)];_0x1c3dae+=0x1){const _0x333774=_0x2bfb8c[_0x1c3dae];if(_0x333774!=='\x22'&&_0x333774!=='`')continue;_0x1c3dae+=0x1;while(_0x1c3dae<_0x2bfb8c['length']){if(_0x2bfb8c[_0x1c3dae]===_0x333774){if(_0x2bfb8c[_0x1c3dae+0x1]===_0x333774){_0x2bfb8c[_0x1c3dae]='\x20',_0x2bfb8c[_0x1c3dae+0x1]='\x20',_0x1c3dae+=0x2;continue;}break;}_0x2bfb8c[_0x1c3dae]='\x20',_0x1c3dae+=0x1;}}return _0x2bfb8c[_0x59d2af(0xdd)]('');}function maskNestedQueries(_0x3a6289){const _0x483646=a295_0x348c,_0x4f75b8=Array[_0x483646(0x107)](_0x3a6289);for(let _0x36a3be=0x0;_0x36a3be<_0x4f75b8[_0x483646(0xe0)];_0x36a3be+=0x1){if(_0x4f75b8[_0x36a3be]!=='(')continue;const _0x461ab4=_0x3a6289['slice'](_0x36a3be+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x483646(0xf2)](_0x461ab4))continue;let _0x51be92=0x1,_0xb41cfc=_0x36a3be+0x1;for(;_0xb41cfc<_0x4f75b8['length']&&_0x51be92>0x0;_0xb41cfc+=0x1){if(_0x4f75b8[_0xb41cfc]==='(')_0x51be92+=0x1;if(_0x4f75b8[_0xb41cfc]===')')_0x51be92-=0x1;}if(_0x51be92!==0x0)continue;for(let _0x35d734=_0x36a3be;_0x35d734<_0xb41cfc;_0x35d734+=0x1){_0x4f75b8[_0x35d734]='\x20';}const _0x3d8ca8=_0x483646(0x10f);for(let _0x394c4b=0x0;_0x394c4b<_0x3d8ca8['length']&&_0x36a3be+_0x394c4b<_0xb41cfc;_0x394c4b+=0x1){_0x4f75b8[_0x36a3be+_0x394c4b]=_0x3d8ca8[_0x394c4b];}_0x36a3be=_0xb41cfc-0x1;}return _0x4f75b8[_0x483646(0xdd)]('');}function splitTopLevelAnd(_0xeca8c2){const _0x5b9615=a295_0x348c,_0x45f64a=[];let _0x461d32=0x0,_0x1c57aa=0x0;for(let _0x3d3e54=0x0;_0x3d3e54<_0xeca8c2[_0x5b9615(0xe0)];_0x3d3e54+=0x1){const _0x360263=_0xeca8c2[_0x3d3e54];if(_0x360263==='(')_0x461d32+=0x1;if(_0x360263===')')_0x461d32=Math['max'](0x0,_0x461d32-0x1);_0x461d32===0x0&&_0xeca8c2[_0x5b9615(0xe6)](_0x3d3e54)['match'](/^AND\b/i)&&(_0x3d3e54===0x0||/\s/['test'](_0xeca8c2[_0x3d3e54-0x1]??''))&&(_0x45f64a[_0x5b9615(0x10e)](_0xeca8c2[_0x5b9615(0xe6)](_0x1c57aa,_0x3d3e54)[_0x5b9615(0xe2)]()),_0x3d3e54+=0x2,_0x1c57aa=_0x3d3e54+0x1);}const _0x11d51e=_0xeca8c2['slice'](_0x1c57aa)[_0x5b9615(0xe2)]();if(_0x11d51e)_0x45f64a['push'](_0x11d51e);return _0x45f64a;}function hasTopLevelKeyword(_0x50ec5b,_0xfb457a){const _0x7884c3=a295_0x348c;let _0x4c0daf=0x0;for(let _0x5b303e=0x0;_0x5b303e<_0x50ec5b[_0x7884c3(0xe0)];_0x5b303e+=0x1){const _0x3bf717=_0x50ec5b[_0x5b303e];if(_0x3bf717==='(')_0x4c0daf+=0x1;if(_0x3bf717===')')_0x4c0daf=Math['max'](0x0,_0x4c0daf-0x1);if(_0x4c0daf!==0x0)continue;const _0x2ef32f=_0x50ec5b[_0x7884c3(0xe6)](_0x5b303e,_0x5b303e+_0xfb457a[_0x7884c3(0xe0)]),_0x956a39=_0x50ec5b[_0x5b303e-0x1]??'\x20',_0xa3860d=_0x50ec5b[_0x5b303e+_0xfb457a[_0x7884c3(0xe0)]]??'\x20';if(_0x2ef32f[_0x7884c3(0xe7)]()===_0xfb457a['toUpperCase']()&&!/[\w$]/['test'](_0x956a39)&&!/[\w$]/[_0x7884c3(0xf2)](_0xa3860d))return!![];}return![];}function splitEquality(_0x24ff52){const _0x14e79e=a295_0x348c,_0x1c6e6b=stripOuterParentheses(_0x24ff52);let _0xbaed31=0x0,_0xc197ea;for(let _0x3057a9=0x0;_0x3057a9<_0x1c6e6b[_0x14e79e(0xe0)];_0x3057a9+=0x1){const _0x32c1d7=_0x1c6e6b[_0x3057a9];if(_0x32c1d7==='(')_0xbaed31+=0x1;if(_0x32c1d7===')')_0xbaed31=Math[_0x14e79e(0xed)](0x0,_0xbaed31-0x1);const _0x50c11d=_0x1c6e6b[_0x3057a9-0x1]??'',_0x38bdda=_0x1c6e6b[_0x3057a9+0x1]??'';if(_0x32c1d7==='='&&_0xbaed31===0x0&&!/[!<>=:]/[_0x14e79e(0xf2)](_0x50c11d)&&_0x38bdda!=='='){if(_0xc197ea!==undefined)return null;_0xc197ea=_0x3057a9;}}return _0xc197ea===undefined?null:[_0x1c6e6b[_0x14e79e(0xe6)](0x0,_0xc197ea)[_0x14e79e(0xe2)](),_0x1c6e6b[_0x14e79e(0xe6)](_0xc197ea+0x1)['trim']()];}function parseDirectColumnReference(_0x48fe5d,_0x30b29c){const _0x17d745=a295_0x348c,_0x119935=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x17d745(0xd0)](stripOuterParentheses(_0x48fe5d));if(!_0x119935)return null;if(normalizeIdentifier(_0x119935[0x1]??'')!==normalizeIdentifier(_0x30b29c))return null;return normalizeIdentifier(_0x119935[0x2]??'');}function containsColumnReference(_0x3ff5b7,_0x35e562){const _0x34c294=a295_0x348c,_0x60d34d=_0x3ff5b7[_0x34c294(0xef)](/[`"]/g,''),_0x464d4b=_0x35e562[_0x34c294(0xef)](/[.*+?^${}()|[\]\\]/g,_0x34c294(0xc9));return new RegExp(_0x34c294(0xe1)+_0x464d4b+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x34c294(0xf2)](_0x60d34d);}function a295_0x348c(_0x744a47,_0x40a1e0){_0x744a47=_0x744a47-0xc8;const _0x5753a4=a295_0x5753();let _0x348cb6=_0x5753a4[_0x744a47];return _0x348cb6;}function findEqualityPrefix(_0x18e367,_0x5e19b3){const _0x4fe8ea=a295_0x348c,_0x1f7d30=new Set(_0x5e19b3[_0x4fe8ea(0xcb)](normalizeIdentifier)),_0x44e697=[];for(const _0x1eb101 of _0x18e367){if(!_0x1f7d30[_0x4fe8ea(0xcf)](normalizeIdentifier(_0x1eb101)))break;_0x44e697[_0x4fe8ea(0x10e)](_0x1eb101);}return _0x44e697;}function resolveTableMetadata(_0x5c86c3,_0x3d08f2){const _0x3eee05=a295_0x348c,_0x1e11b4=normalizeIdentifier(_0x3d08f2),_0x4c4270=_0x5c86c3[_0x3eee05(0xdc)](_0x1625cc=>normalizeIdentifier(_0x1625cc[_0x3eee05(0xe9)])===_0x1e11b4);if(_0x4c4270[_0x3eee05(0xe0)]===0x1)return _0x4c4270[0x0];const _0x3be6b7=_0x1e11b4[_0x3eee05(0x10c)]('.'),_0x12f20e=_0x1e11b4['split']('.')['at'](-0x1),_0x368e58=_0x5c86c3['filter'](_0x2f24e8=>{const _0x3bfcef=_0x3eee05,_0x1bd649=normalizeIdentifier(_0x2f24e8['tableName']);if(_0x3be6b7&&_0x1bd649['includes']('.'))return![];return _0x1bd649[_0x3bfcef(0xee)]('.')['at'](-0x1)===_0x12f20e;});return _0x368e58[_0x3eee05(0xe0)]===0x1?_0x368e58[0x0]:undefined;}function columnNamesMatch(_0x4a6cc8,_0x4ae774){return normalizeIdentifier(_0x4a6cc8)===normalizeIdentifier(_0x4ae774);}function normalizeIdentifier(_0xb9319c){const _0x25ec24=a295_0x348c;return _0xb9319c[_0x25ec24(0xef)](/[`"]/g,'')[_0x25ec24(0xe2)]()[_0x25ec24(0xe8)]();}function a295_0x5753(){const _0x37579a=['sql','error','1103574Txqbnf','1456628QADBsb','from','unsupportedReason','447084jynwnE','left','natural','includes','matchAll','push','__sq__','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','\x5c$&','12175960VTVGss','map','indexes','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','reduce','has','exec','position','JOIN_INDEX_NOT_USABLE','warning','covered','right','replaceAll','add','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','columns','full','1097446tdaazb','filter','join','unsupportedPredicate','indexOf','length','(?:^|[^\x5cw$])','trim','JOIN_PREDICATE_UNSUPPORTED','unavailable','7055340hwPRes','slice','toUpperCase','toLowerCase','tableName','some','min','unknown','max','split','replace','cross','table','test','metadataAvailable','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','containsUnresolvedInclude','INNER','index','using','matchedPrefix','5pqdrrE','endsWith','inner','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','search','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','alias','JOIN_INDEX_MISSING','603988vCbEbh'];a295_0x5753=function(){return _0x37579a;};return a295_0x5753();}function isSqlClauseKeyword(_0x1be93c){const _0x2638cd=a295_0x348c;return new Set(['on',_0x2638cd(0xf8),'where',_0x2638cd(0xdd),_0x2638cd(0xfc),_0x2638cd(0x10a),_0x2638cd(0xd5),_0x2638cd(0xda),_0x2638cd(0xf0),_0x2638cd(0x10b)])[_0x2638cd(0xcf)](_0x1be93c);}function stripOuterParentheses(_0x437e1e){const _0x64947b=a295_0x348c;let _0x9fc295=_0x437e1e[_0x64947b(0xe2)]();while(_0x9fc295['startsWith']('(')&&_0x9fc295[_0x64947b(0xfb)](')')){let _0x42b473=0x0,_0x56532c=!![];for(let _0x5f2e2c=0x0;_0x5f2e2c<_0x9fc295['length'];_0x5f2e2c+=0x1){if(_0x9fc295[_0x5f2e2c]==='(')_0x42b473+=0x1;if(_0x9fc295[_0x5f2e2c]===')')_0x42b473-=0x1;if(_0x42b473===0x0&&_0x5f2e2c<_0x9fc295[_0x64947b(0xe0)]-0x1){_0x56532c=![];break;}}if(!_0x56532c||_0x42b473!==0x0)break;_0x9fc295=_0x9fc295[_0x64947b(0xe6)](0x1,-0x1)[_0x64947b(0xe2)]();}return _0x9fc295;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a296_0x10f063=a296_0x5f48;function a296_0x5f48(_0x4d7aa0,_0x140da6){_0x4d7aa0=_0x4d7aa0-0x1d8;const _0x5dcba4=a296_0x5dcb();let _0x5f4802=_0x5dcba4[_0x4d7aa0];return _0x5f4802;}(function(_0x36a226,_0x45212d){const _0x45301b=a296_0x5f48,_0x49fae6=_0x36a226();while(!![]){try{const _0x39b9cc=-parseInt(_0x45301b(0x1df))/0x1*(parseInt(_0x45301b(0x1e4))/0x2)+-parseInt(_0x45301b(0x1e5))/0x3*(parseInt(_0x45301b(0x1d9))/0x4)+-parseInt(_0x45301b(0x1dc))/0x5*(parseInt(_0x45301b(0x1e1))/0x6)+-parseInt(_0x45301b(0x1e0))/0x7*(parseInt(_0x45301b(0x1de))/0x8)+parseInt(_0x45301b(0x1e3))/0x9+-parseInt(_0x45301b(0x1dd))/0xa+-parseInt(_0x45301b(0x1e2))/0xb*(-parseInt(_0x45301b(0x1da))/0xc);if(_0x39b9cc===_0x45212d)break;else _0x49fae6['push'](_0x49fae6['shift']());}catch(_0x456731){_0x49fae6['push'](_0x49fae6['shift']());}}}(a296_0x5dcb,0x46332));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a296_0x10f063(0x1e6),LOCK_FILE_NAME=a296_0x10f063(0x1d8),TRASH_DIR_NAME='sql-trash';function a296_0x5dcb(){const _0x2baf3e=['14pTmivx','1770lRQpyG','.rabetbase','sql.lock.json','2952TikbYD','1764ekWhBP','sql','2352290zkdEVO','3251610PFCoPG','968firtar','82018SNpgNg','28819HPgCNZ','6SZGPnN','162745aplnss','3743955OuRPXM'];a296_0x5dcb=function(){return _0x2baf3e;};return a296_0x5dcb();}export function loadSqlProjectConfig(_0x3a9553,_0x15c321){const _0x28388e=a296_0x10f063,_0x2f4c5b=resolve(_0x15c321??findProjectRootDirectory()),_0x2bbfa1=DOT_DIR+'/sql',_0x3505b5=_0x2bbfa1+'/'+_0x3a9553;return{'projectRoot':_0x2f4c5b,'appCode':_0x3a9553,'sqlWorkspaceRoot':_0x2bbfa1,'sqlRoot':_0x3505b5,'sqlRootDir':resolve(_0x2f4c5b,DOT_DIR,_0x28388e(0x1db),_0x3a9553),'lockFilePath':resolve(_0x2f4c5b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2f4c5b,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x21e18a,_0x3bda8b){const _0x3373a4=a297_0x358e,_0x16df5e=_0x21e18a();while(!![]){try{const _0x442f0a=parseInt(_0x3373a4(0x157))/0x1*(parseInt(_0x3373a4(0x15c))/0x2)+parseInt(_0x3373a4(0x15b))/0x3+parseInt(_0x3373a4(0x158))/0x4+-parseInt(_0x3373a4(0x154))/0x5+-parseInt(_0x3373a4(0x15e))/0x6+parseInt(_0x3373a4(0x161))/0x7+-parseInt(_0x3373a4(0x14b))/0x8;if(_0x442f0a===_0x3bda8b)break;else _0x16df5e['push'](_0x16df5e['shift']());}catch(_0x293222){_0x16df5e['push'](_0x16df5e['shift']());}}}(a297_0x2350,0x230c4));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x4e70a5){const _0x5e7676=a297_0x358e;if(_0x4e70a5===_0x5e7676(0x159))return _0x5e7676(0x155);if(_0x4e70a5===_0x5e7676(0x162))return _0x5e7676(0x14a);return undefined;}async function scanSqlFilesRecursively(_0x22afe5,_0x2e8fbe){const _0xe8be02=a297_0x358e,_0x410440=[];try{const _0x3cc9d9=await readdir(_0x22afe5,{'withFileTypes':!![]});for(const _0x1ba23a of _0x3cc9d9){const _0x402959=join(_0x22afe5,_0x1ba23a[_0xe8be02(0x160)]);if(_0x1ba23a[_0xe8be02(0x14f)]()){_0x410440[_0xe8be02(0x150)](...await scanSqlFilesRecursively(_0x402959,_0x2e8fbe));continue;}if(!_0x1ba23a[_0xe8be02(0x14c)]())continue;const _0x49e8c6=extname(_0x1ba23a['name'])['toLowerCase'](),_0xaf66f6=extensionToMode(_0x49e8c6);if(!_0xaf66f6)continue;const _0x3f1aa=relative(_0x2e8fbe,_0x402959)[_0xe8be02(0x149)](/\\/g,'/'),_0x1f2252=_0x3f1aa[_0xe8be02(0x156)]('/')[_0xe8be02(0x152)](Boolean),_0x287a1b=parseSqlPath(_0x1f2252,_0x1ba23a[_0xe8be02(0x160)],_0x49e8c6);if(!_0x287a1b)continue;_0x410440[_0xe8be02(0x150)]({'sqlCode':_0x287a1b[_0xe8be02(0x15d)],'sqlName':_0x287a1b[_0xe8be02(0x145)],'dbDirectory':_0x1f2252[0x0],'filePath':_0x402959,'relativePath':_0x3f1aa,'lockKey':_0x287a1b[_0xe8be02(0x15d)],'mode':_0xaf66f6});}}catch(_0x34d9da){if(_0x34d9da['code']!==_0xe8be02(0x15a))throw _0x34d9da;}return _0x410440;}function a297_0x2350(){const _0x2c6a2d=['640752EjXVdW','dbId','name','1319402rUywal','.xml','test','sqlName','sqlRootDir','dbName','slice','replace','mybatisXml','1748200QdMvhK','isFile','indexOf','path','isDirectory','push','length','filter','mode','963280vQHrsR','sql','split','22JYPbKj','507024BqEyPd','.sql','ENOENT','635931ELkmbN','12210bWDzJL','sqlCode'];a297_0x2350=function(){return _0x2c6a2d;};return a297_0x2350();}export async function scanLocalSqlQueries(_0x584d03){const _0x21f33b=a297_0x358e;return scanSqlFilesRecursively(_0x584d03[_0x21f33b(0x146)],_0x584d03[_0x21f33b(0x146)]);}function a297_0x358e(_0x589fb5,_0x27764e){_0x589fb5=_0x589fb5-0x145;const _0x235075=a297_0x2350();let _0x358ece=_0x235075[_0x589fb5];return _0x358ece;}export function resolveLocalSqlFilePath(_0x30f6ab,_0xeb52bb,_0x5e84e7){const _0x10690e=a297_0x358e,_0x4e9e21=_0x5e84e7?.[_0x10690e(0x14e)]||(_0x5e84e7?.[_0x10690e(0x145)]||_0x5e84e7?.[_0x10690e(0x147)]?buildSqlRelativePath(_0xeb52bb,_0x5e84e7?.['sqlName'],_0x5e84e7?.['dbName'],_0x5e84e7?.[_0x10690e(0x153)]||'sql',_0x5e84e7?.[_0x10690e(0x15f)]):buildDefaultSqlFileName(_0xeb52bb,_0x5e84e7?.[_0x10690e(0x153)]||'sql'));return join(_0x30f6ab[_0x10690e(0x146)],_0x4e9e21);}export async function directoryExists(_0x3dd6b4){const _0xf5b5d8=a297_0x358e;try{const _0x46b2a1=await stat(_0x3dd6b4);return _0x46b2a1[_0xf5b5d8(0x14f)]();}catch{return![];}}function parseSqlPath(_0x488d60,_0x2e12d7,_0x2bc40a){const _0x860e32=a297_0x358e,_0x123e21=_0x2e12d7['slice'](0x0,-_0x2bc40a['length']);if(_0x488d60['length']<0x2)return null;const _0x27f120=_0x123e21[_0x860e32(0x14d)]('_');if(_0x27f120<=0x0||_0x27f120>=_0x123e21[_0x860e32(0x151)]-0x1)return null;const _0x52b506=_0x123e21[_0x860e32(0x148)](0x0,_0x27f120);if(!isLikelySqlCode(_0x52b506))return null;return{'sqlCode':_0x52b506,'sqlName':_0x123e21['slice'](_0x27f120+0x1)};}function isLikelySqlCode(_0x49a8c5){const _0x41368b=a297_0x358e;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x41368b(0x163)](_0x49a8c5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1baf76,_0x2cb2c9){const _0x5141e=a298_0x3734,_0x3531c8=_0x1baf76();while(!![]){try{const _0x5bf35b=-parseInt(_0x5141e(0x7c))/0x1+-parseInt(_0x5141e(0x7d))/0x2+parseInt(_0x5141e(0x7a))/0x3*(-parseInt(_0x5141e(0x7b))/0x4)+-parseInt(_0x5141e(0x75))/0x5*(-parseInt(_0x5141e(0x81))/0x6)+parseInt(_0x5141e(0x7f))/0x7+-parseInt(_0x5141e(0x80))/0x8+parseInt(_0x5141e(0x77))/0x9;if(_0x5bf35b===_0x2cb2c9)break;else _0x3531c8['push'](_0x3531c8['shift']());}catch(_0x4e1506){_0x3531c8['push'](_0x3531c8['shift']());}}}(a298_0x2243,0x21d11));import{readFile}from'node:fs/promises';import a298_0x253f94 from'node:crypto';function a298_0x2243(){const _0x2c842d=['update','150NAJtNA','11944GijmXn','161313JrUYBR','542660Eyrajj','utf8','277851QkYBHO','1432120frxJpc','10242vYunZw','10yNHfcu','createHash','7707276wmtnUB','hex'];a298_0x2243=function(){return _0x2c842d;};return a298_0x2243();}export function computeSqlContentHash(_0x47b9d9){const _0x426cd0=a298_0x3734;return a298_0x253f94[_0x426cd0(0x76)]('md5')[_0x426cd0(0x79)](_0x47b9d9)['digest'](_0x426cd0(0x78));}function a298_0x3734(_0x35631a,_0x4a7ebf){_0x35631a=_0x35631a-0x75;const _0x224386=a298_0x2243();let _0x373491=_0x224386[_0x35631a];return _0x373491;}export async function computeSqlFileHash(_0x4b16f2){const _0x4e7834=a298_0x3734,_0x1ce6df=await readFile(_0x4b16f2,_0x4e7834(0x7e));return computeSqlContentHash(_0x1ce6df);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a299_0x1f84(_0x5ad801,_0x5e9e41){_0x5ad801=_0x5ad801-0x16c;const _0x47bfb9=a299_0x47bf();let _0x1f8487=_0x47bfb9[_0x5ad801];return _0x1f8487;}(function(_0x8101dc,_0x33be45){const _0x17be5c=a299_0x1f84,_0x31d815=_0x8101dc();while(!![]){try{const _0x41027e=parseInt(_0x17be5c(0x17f))/0x1+parseInt(_0x17be5c(0x171))/0x2*(-parseInt(_0x17be5c(0x176))/0x3)+-parseInt(_0x17be5c(0x17a))/0x4+parseInt(_0x17be5c(0x16f))/0x5*(parseInt(_0x17be5c(0x16d))/0x6)+parseInt(_0x17be5c(0x181))/0x7*(parseInt(_0x17be5c(0x175))/0x8)+-parseInt(_0x17be5c(0x177))/0x9+-parseInt(_0x17be5c(0x173))/0xa*(-parseInt(_0x17be5c(0x174))/0xb);if(_0x41027e===_0x33be45)break;else _0x31d815['push'](_0x31d815['shift']());}catch(_0x28a4f5){_0x31d815['push'](_0x31d815['shift']());}}}(a299_0x47bf,0x9ec50));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x11a957,_0x3ae406,_0x41469f,_0x5f5991){const _0x51a78a=a299_0x1f84,_0x1a142d=_0x11a957??createEmptySqlLock();let _0x2e18ea=_0x1a142d[_0x51a78a(0x17c)][_0x3ae406];if(!_0x2e18ea)return _0x2e18ea={'sqlRoot':_0x41469f,'lastSync':'','sqls':{}},_0x1a142d['apps'][_0x3ae406]=_0x2e18ea,{'lockData':_0x1a142d,'appLock':_0x2e18ea};if(!_0x2e18ea[_0x51a78a(0x178)])_0x2e18ea[_0x51a78a(0x178)]=_0x41469f;else{if(_0x2e18ea[_0x51a78a(0x178)]!==_0x41469f)throw new Error(_0x5f5991+_0x51a78a(0x16c)+_0x41469f+_0x51a78a(0x17d)+_0x2e18ea[_0x51a78a(0x178)]+'\x22.\x20'+_0x51a78a(0x172));}return!_0x2e18ea[_0x51a78a(0x16e)]&&(_0x2e18ea[_0x51a78a(0x16e)]={}),!_0x2e18ea[_0x51a78a(0x179)]&&(_0x2e18ea['lastSync']=''),{'lockData':_0x1a142d,'appLock':_0x2e18ea};}export async function readSqlLockFile(_0x2f4f43){const _0xbdb6ab=a299_0x1f84;try{const _0x5303e8=await readFile(_0x2f4f43,_0xbdb6ab(0x17b));return JSON[_0xbdb6ab(0x17e)](_0x5303e8);}catch(_0x76c580){if(_0x76c580[_0xbdb6ab(0x182)]===_0xbdb6ab(0x170))return null;throw new Error(_0xbdb6ab(0x180)+String(_0x76c580));}}export async function writeSqlLockFile(_0x4e7b71,_0x320733){const _0x53be07=a299_0x1f84;await mkdir(dirname(_0x4e7b71),{'recursive':!![]}),await writeFile(_0x4e7b71,JSON['stringify'](_0x320733,null,0x2),_0x53be07(0x17b));}function a299_0x47bf(){const _0x306883=['804EovTvg','sqls','9895wVQque','ENOENT','2519304RWzppj','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','56590lvfvMJ','6611rRctDf','17192lGezGI','3fDKDLQ','8636688FGaoUR','sqlRoot','lastSync','4164196gJOhcJ','utf8','apps','\x22\x20vs\x20lock\x20\x22','parse','102574PGYxxx','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','462uktasF','code',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'];a299_0x47bf=function(){return _0x306883;};return a299_0x47bf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4b1591,_0x1d479e){const _0x3a4e18=a301_0x490b,_0x31f58f=_0x4b1591();while(!![]){try{const _0x1d9e6d=parseInt(_0x3a4e18(0xd4))/0x1+-parseInt(_0x3a4e18(0xcd))/0x2*(parseInt(_0x3a4e18(0xd1))/0x3)+-parseInt(_0x3a4e18(0xcb))/0x4*(-parseInt(_0x3a4e18(0xca))/0x5)+-parseInt(_0x3a4e18(0xcf))/0x6*(-parseInt(_0x3a4e18(0xd0))/0x7)+parseInt(_0x3a4e18(0xcc))/0x8+-parseInt(_0x3a4e18(0xd7))/0x9+-parseInt(_0x3a4e18(0xce))/0xa*(parseInt(_0x3a4e18(0xd5))/0xb);if(_0x1d9e6d===_0x1d479e)break;else _0x31f58f['push'](_0x31f58f['shift']());}catch(_0x4bf766){_0x31f58f['push'](_0x31f58f['shift']());}}}(a301_0x2e26,0x98a5b));import{detectSqlSourceMode}from'../../core/sql-validator.js';export function detectSqlMode(_0x5b303e){return detectSqlSourceMode(_0x5b303e);}export function getSqlFileExtension(_0x37d52e){const _0x25213b=a301_0x490b;return _0x37d52e==='mybatisXml'?'.xml':_0x25213b(0xd8);}function a301_0x490b(_0x4c9971,_0x5e9d65){_0x4c9971=_0x4c9971-0xca;const _0x2e2654=a301_0x2e26();let _0x490b51=_0x2e2654[_0x4c9971];return _0x490b51;}export function buildDefaultSqlFileName(_0x3a331a,_0x466747){return''+_0x3a331a+getSqlFileExtension(_0x466747);}export function sanitizeSqlPathSegment(_0x2abadd,_0x480dae){const _0x53fbc9=a301_0x490b,_0x2c05d4=String(_0x2abadd??'')[_0x53fbc9(0xd3)](),_0x149d97=_0x2c05d4[_0x53fbc9(0xd6)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x53fbc9(0xd6)](/\s+/g,'-')[_0x53fbc9(0xd6)](/-+/g,'-')['replace'](/^\.+/,'')[_0x53fbc9(0xd6)](/\.+$/,'')[_0x53fbc9(0xd6)](/^-+/,'')[_0x53fbc9(0xd6)](/-+$/,'');return _0x149d97||_0x480dae;}function a301_0x2e26(){const _0x178715=['2484444xlSCqI','8702304KpszGU','4gUrtzX','186740jfDSoh','6018XZzmNa','623sLhFZG','1470441ecdcGs','unknown-sql','trim','554276RejxoP','693wpXfMo','replace','1723986jGxOUk','.sql','10QVWTyt'];a301_0x2e26=function(){return _0x178715;};return a301_0x2e26();}export function buildDbDirectoryName(_0x51997a,_0x583090){return sanitizeSqlPathSegment(_0x51997a,_0x583090!=null?'db-'+_0x583090:'unknown-db');}export function buildSqlRelativePath(_0xfaac06,_0x588e3f,_0xb9c180,_0x5b6370,_0x355afa){const _0x5addcb=a301_0x490b,_0x1d9aeb=buildDbDirectoryName(_0xb9c180,_0x355afa),_0x213480=sanitizeSqlPathSegment(_0xfaac06,_0x5addcb(0xd2)),_0x26431e=sanitizeSqlPathSegment(_0x588e3f,_0x213480);return _0x1d9aeb+'/'+_0x213480+'_'+_0x26431e+getSqlFileExtension(_0x5b6370);}
|