@lovrabet/rabetbase-cli 2.5.4-beta.2 → 2.5.4-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/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/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.d.ts +2 -0
- package/lib/commands/user-account/feishu-bind.js +1 -0
- 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.d.ts +2 -0
- 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 -2
- package/skills/rabetbase/references/rabetbase-user-account.md +20 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a283_0x21af2d=a283_0xe959;function a283_0x4bb4(){const _0x1525b2=['instant_api_policy_app_code_mismatch','policyFilePath','instant_api_policy_app_code_invalid','instant_api_policy_file_missing','.tmp','454569yLTKGN','byteLength','object','instant_api_policy_json_invalid','4DVQvHz','instant_api_policy_file_exists','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','rules','catch','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','length','trim','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','allow','15666yXYmgu','instant_api_policy_file_invalid','isArray','72170IgsdKg','policyRoot','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','instant_api_policy_file_unwritable','instant_api_policy_version_invalid','445DqnsRH','defaults','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','instant_api_policy_file_unreadable','pid','instant_api_policy_defaults_invalid','utf8','Review\x20the\x20file\x20before\x20retrying.','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','480990qBcDWz','instant_api_policy_file_too_large','force','1030683YzekLO','EEXIST','.rabetbase/instant-api-policy','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','code','183176zojCEm','policy.json','instantApi','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','includes','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','appCode','version','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','stringify','2301784JLvbUN','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','ENOENT','18nErAnZ'];a283_0x4bb4=function(){return _0x1525b2;};return a283_0x4bb4();}(function(_0x5c06ed,_0xe9b595){const _0x531431=a283_0xe959,_0x18b9b5=_0x5c06ed();while(!![]){try{const _0x34582d=parseInt(_0x531431(0x1b4))/0x1+parseInt(_0x531431(0x1d4))/0x2+parseInt(_0x531431(0x1d7))/0x3*(-parseInt(_0x531431(0x1b8))/0x4)+-parseInt(_0x531431(0x1cb))/0x5*(-parseInt(_0x531431(0x1c2))/0x6)+-parseInt(_0x531431(0x1dd))/0x7+-parseInt(_0x531431(0x1ab))/0x8+parseInt(_0x531431(0x1ae))/0x9*(-parseInt(_0x531431(0x1c5))/0xa);if(_0x34582d===_0xe9b595)break;else _0x18b9b5['push'](_0x18b9b5['shift']());}catch(_0x444cee){_0x18b9b5['push'](_0x18b9b5['shift']());}}}(a283_0x4bb4,0x3e645));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a283_0x21af2d(0x1d9);export const INSTANT_API_POLICY_FILE_NAME=a283_0x21af2d(0x1a0);function a283_0xe959(_0x2882f9,_0x285a60){_0x2882f9=_0x2882f9-0x1a0;const _0x4bb418=a283_0x4bb4();let _0xe9596=_0x4bb418[_0x2882f9];return _0xe9596;}export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x10b9da,_0x571e24,_0x578b60){return new CliError(_0x10b9da,0x1,_0x571e24,_0x578b60);}export function loadInstantApiPolicyLocalConfig(_0x5d77a2,_0x3bf5c7){assertSafeAppCode(_0x5d77a2);const _0xacd10f=resolve(_0x3bf5c7??findProjectRootDirectory()),_0x4f1026=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x5d77a2+'/'+INSTANT_API_POLICY_FILE_NAME,_0x36521a=resolve(_0xacd10f,INSTANT_API_POLICY_RELATIVE_ROOT,_0x5d77a2),_0x470f36=resolve(_0x36521a,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0xacd10f,'appCode':_0x5d77a2,'policyRoot':_0x36521a,'policyFilePath':_0x470f36,'policyRelativePath':_0x4f1026};}export function createDefaultInstantApiPolicyConfig(_0x3e983b,_0x371920=a283_0x21af2d(0x1c1)){return assertSafeAppCode(_0x3e983b),{'version':'2','appCode':_0x3e983b,'defaults':{'instantApi':_0x371920},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x130ee6){const _0x2f9547=a283_0x21af2d;let _0x1d8688;try{_0x1d8688=await stat(_0x130ee6[_0x2f9547(0x1b0)]);}catch(_0x58b064){throw instantApiPolicyError(_0x2f9547(0x1b2),_0x2f9547(0x1a3)+_0x130ee6[_0x2f9547(0x1b0)],_0x2f9547(0x1a5));}if(!_0x1d8688['isFile']())throw instantApiPolicyError(_0x2f9547(0x1c3),_0x2f9547(0x1db)+_0x130ee6[_0x2f9547(0x1b0)]);if(_0x1d8688['size']>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2f9547(0x1d5),_0x2f9547(0x1c0));let _0x28e6ac;try{_0x28e6ac=await readFile(_0x130ee6['policyFilePath']);}catch{throw instantApiPolicyError('instant_api_policy_file_unreadable',_0x2f9547(0x1a8)+_0x130ee6[_0x2f9547(0x1b0)]);}if(_0x28e6ac[_0x2f9547(0x1b5)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2f9547(0x1c0));let _0x4ea3b4;try{_0x4ea3b4=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x28e6ac);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x2f9547(0x1d3)+_0x130ee6['policyFilePath']);}let _0x191417;try{_0x191417=JSON['parse'](_0x4ea3b4);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid',_0x2f9547(0x1da)+_0x130ee6['policyFilePath']);}return assertLocalPolicyContract(_0x191417,_0x130ee6[_0x2f9547(0x1a6)]);}export async function writeInstantApiPolicyConfigFile(_0x1268d1,_0x223622,_0xf5bfe4={}){const _0x56f494=a283_0x21af2d,_0x358a93=assertLocalPolicyContract(_0x223622,_0x1268d1['appCode']),_0xa8e02=JSON[_0x56f494(0x1aa)](_0x358a93,null,0x2)+'\x0a';if(Buffer['byteLength'](_0xa8e02,_0x56f494(0x1d1))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x56f494(0x1d5),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');await mkdir(_0x1268d1[_0x56f494(0x1c6)],{'recursive':!![]});let _0x352627;try{_0x352627=await readFile(_0x1268d1[_0x56f494(0x1b0)],'utf8');}catch(_0x421406){if(!isMissingFile(_0x421406))throw instantApiPolicyError(_0x56f494(0x1ce),'Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0x1268d1['policyFilePath']);}if(_0x352627===_0xa8e02)return{'action':'unchanged','filePath':_0x1268d1[_0x56f494(0x1b0)]};if(_0x352627!==undefined&&!_0xf5bfe4[_0x56f494(0x1d6)])throw instantApiPolicyError('instant_api_policy_file_exists',_0x56f494(0x1cd)+_0x1268d1[_0x56f494(0x1b0)],_0x56f494(0x1a9));if(_0x352627===undefined)try{return await writeFile(_0x1268d1[_0x56f494(0x1b0)],_0xa8e02,{'encoding':_0x56f494(0x1d1),'flag':'wx'}),{'action':'created','filePath':_0x1268d1['policyFilePath']};}catch(_0x4e0011){if(!isAlreadyExists(_0x4e0011))throw instantApiPolicyError(_0x56f494(0x1c9),'Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x1268d1['policyFilePath']);if(!_0xf5bfe4[_0x56f494(0x1d6)])throw instantApiPolicyError(_0x56f494(0x1b9),_0x56f494(0x1c7)+_0x1268d1[_0x56f494(0x1b0)],_0x56f494(0x1d2));}const _0x298fec=resolve(dirname(_0x1268d1['policyFilePath']),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x56f494(0x1cf)]+'.'+randomUUID()+_0x56f494(0x1b3));try{await writeFile(_0x298fec,_0xa8e02,{'encoding':_0x56f494(0x1d1),'flag':'wx'}),await rename(_0x298fec,_0x1268d1['policyFilePath']);}catch{await unlink(_0x298fec)[_0x56f494(0x1bc)](()=>undefined);throw instantApiPolicyError(_0x56f494(0x1c9),_0x56f494(0x1a2)+_0x1268d1['policyFilePath']);}return{'action':'overwritten','filePath':_0x1268d1[_0x56f494(0x1b0)]};}function assertSafeAppCode(_0x3477ed){const _0xa7084e=a283_0x21af2d,_0x5cf81b=_0x3477ed[_0xa7084e(0x1bf)]();if(!_0x5cf81b||_0x5cf81b!==_0x3477ed||_0x5cf81b[_0xa7084e(0x1be)]>0x64||_0x5cf81b==='.'||_0x5cf81b==='..'||_0x5cf81b[_0xa7084e(0x1a4)]('/')||_0x5cf81b[_0xa7084e(0x1a4)]('\x5c')||_0x5cf81b[_0xa7084e(0x1a4)]('\x00'))throw instantApiPolicyError(_0xa7084e(0x1b1),_0xa7084e(0x1ba));}function assertLocalPolicyContract(_0x9ef1e2,_0x27d8e9){const _0x3a33c5=a283_0x21af2d;if(!isObject(_0x9ef1e2))throw instantApiPolicyError(_0x3a33c5(0x1b7),'Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.');if(_0x9ef1e2['version']!=='1'&&_0x9ef1e2[_0x3a33c5(0x1a7)]!=='2')throw instantApiPolicyError(_0x3a33c5(0x1ca),_0x3a33c5(0x1bd),'version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.');if(_0x9ef1e2[_0x3a33c5(0x1a6)]!==_0x27d8e9)throw instantApiPolicyError(_0x3a33c5(0x1af),_0x3a33c5(0x1c8)+_0x27d8e9+'.');if(!isObject(_0x9ef1e2[_0x3a33c5(0x1cc)])||typeof _0x9ef1e2[_0x3a33c5(0x1cc)][_0x3a33c5(0x1a1)]!=='string')throw instantApiPolicyError(_0x3a33c5(0x1d0),'Policy\x20defaults.instantApi\x20is\x20required.');if(_0x9ef1e2[_0x3a33c5(0x1bb)]!==undefined&&_0x9ef1e2[_0x3a33c5(0x1bb)]!==null&&!Array[_0x3a33c5(0x1c4)](_0x9ef1e2[_0x3a33c5(0x1bb)]))throw instantApiPolicyError('instant_api_policy_rules_invalid',_0x3a33c5(0x1ac));return _0x9ef1e2;}function isObject(_0x3ef4e8){const _0x2ac13b=a283_0x21af2d;return _0x3ef4e8!==null&&typeof _0x3ef4e8===_0x2ac13b(0x1b6)&&!Array['isArray'](_0x3ef4e8);}function isMissingFile(_0x34871f){const _0x5e297c=a283_0x21af2d;return Boolean(_0x34871f&&typeof _0x34871f===_0x5e297c(0x1b6)&&_0x34871f['code']===_0x5e297c(0x1ad));}function isAlreadyExists(_0x575c81){const _0x5bed22=a283_0x21af2d;return Boolean(_0x575c81&&typeof _0x575c81===_0x5bed22(0x1b6)&&_0x575c81[_0x5bed22(0x1dc)]===_0x5bed22(0x1d8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a283_0x2f5a00=a283_0x51f0;(function(_0x3da0e2,_0x5ccd8d){const _0x51009b=a283_0x51f0,_0x26830f=_0x3da0e2();while(!![]){try{const _0x4dc969=parseInt(_0x51009b(0x1cc))/0x1+-parseInt(_0x51009b(0x1a4))/0x2+parseInt(_0x51009b(0x1ca))/0x3*(parseInt(_0x51009b(0x1b9))/0x4)+-parseInt(_0x51009b(0x1d0))/0x5*(-parseInt(_0x51009b(0x18d))/0x6)+parseInt(_0x51009b(0x1aa))/0x7*(-parseInt(_0x51009b(0x1ce))/0x8)+parseInt(_0x51009b(0x1cd))/0x9*(-parseInt(_0x51009b(0x1a2))/0xa)+-parseInt(_0x51009b(0x188))/0xb*(parseInt(_0x51009b(0x1c9))/0xc);if(_0x4dc969===_0x5ccd8d)break;else _0x26830f['push'](_0x26830f['shift']());}catch(_0x228e19){_0x26830f['push'](_0x26830f['shift']());}}}(a283_0x4235,0x9b4af));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x2f5a00(0x1c5),a283_0x2f5a00(0x196),'total','hits',a283_0x2f5a00(0x1d4),'timingsMs'],HIT_KEYS=['documentId',a283_0x2f5a00(0x1bf),'chunkId',a283_0x2f5a00(0x1b4),a283_0x2f5a00(0x1bd),'text',a283_0x2f5a00(0x195),'rank','rawScore',a283_0x2f5a00(0x1c6),a283_0x2f5a00(0x18e)];export function normalizeKbServiceOrigin(_0x17248b){const _0x38efc1=a283_0x2f5a00,_0x58f522=()=>CliErrors[_0x38efc1(0x1d3)]('Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.'),_0x4d845a=_0x17248b?.[_0x38efc1(0x197)]();if(!_0x4d845a||/[\u0000-\u0020\u007f]/[_0x38efc1(0x1be)](_0x4d845a)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x38efc1(0x1be)](_0x4d845a))throw _0x58f522();let _0x2bf1f2;try{_0x2bf1f2=new URL(_0x4d845a);}catch{throw _0x58f522();}if(_0x2bf1f2[_0x38efc1(0x1ac)]!=='https:'||!_0x2bf1f2[_0x38efc1(0x192)]||_0x2bf1f2[_0x38efc1(0x199)]||_0x2bf1f2[_0x38efc1(0x198)]||_0x2bf1f2[_0x38efc1(0x19f)]!=='/'||_0x2bf1f2[_0x38efc1(0x1cf)]||_0x2bf1f2['hash'])throw _0x58f522();return _0x2bf1f2['origin'];}function a283_0x4235(){const _0x318451=['hits','response','company','text','Knowledge\x20search\x20appCode\x20is\x20required.','KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','scope','toLowerCase','name','\x20contract.','serviceUrl','4327436jvWlSc','string','isSafeInteger','apiError','title','test','revision','status','query','application/json','documentId','error','schemaVersion','finalScore','POST','timingsMs','12FpoOQg','3aHUGHR','signal','794385XIbtzZ','63XrQZfa','14704uyKYZw','search','4076210sldxal','object','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','validation','strategyFingerprint','public','TimeoutError','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','number','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','aborted','stringify','isArray','headers','keys','Knowledge\x20search\x20cancelled.','rank','total','map','isFinite','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','length','5602124aHAIGx','entries','rawScore','development','hits[','6BkzQdk','scoreKind','/v2/development/apps/','some','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','hostname','appCode','topK','tags','profile','trim','password','username','score','no-store','any','sort','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','pathname','get','content-type','900130FBLuyI','cookie','644716oQFanO','includes','chunkId','cli:rabetbase','cache-control','AbortError','2261mbAyZV','networkError','protocol','authRequired'];a283_0x4235=function(){return _0x318451;};return a283_0x4235();}export async function searchDirectKnowledge(_0x59abe7){const _0x2855c9=a283_0x2f5a00,_0x5a7818=_0x59abe7[_0x2855c9(0x193)][_0x2855c9(0x197)](),_0x156fdf=_0x59abe7[_0x2855c9(0x1c1)][_0x2855c9(0x197)]();if(!_0x5a7818)throw CliErrors['validation'](_0x2855c9(0x1b2));if(!_0x59abe7[_0x2855c9(0x1a3)][_0x2855c9(0x197)]())throw CliErrors[_0x2855c9(0x1ad)]();if(!_0x156fdf)throw CliErrors[_0x2855c9(0x1d3)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x59abe7['topK']);const _0xbf2a5b=normalizeKbServiceOrigin(_0x59abe7[_0x2855c9(0x1b8)]),_0x13f450=AbortSignal['timeout'](0xea60),_0xe5f1f1=_0x59abe7[_0x2855c9(0x1cb)]?AbortSignal[_0x2855c9(0x19c)]([_0x59abe7[_0x2855c9(0x1cb)],_0x13f450]):_0x13f450;let _0x4bf794;try{_0x4bf794=await fetch(_0xbf2a5b+_0x2855c9(0x18f)+encodeURIComponent(_0x5a7818)+'/knowledge/search',{'method':_0x2855c9(0x1c7),'redirect':_0x2855c9(0x1c4),'headers':{'Content-Type':_0x2855c9(0x1c2),'Cookie':_0x59abe7[_0x2855c9(0x1a3)],'X-Invoke-Source':_0x2855c9(0x1a7)},'body':JSON[_0x2855c9(0x1db)]({'query':_0x156fdf,..._0x59abe7[_0x2855c9(0x194)]!==undefined?{'topK':_0x59abe7[_0x2855c9(0x194)]}:{}}),'signal':_0xe5f1f1});}catch(_0x1842b1){if(_0x59abe7[_0x2855c9(0x1cb)]?.[_0x2855c9(0x1da)])throw new DOMException(_0x2855c9(0x181),'AbortError');if(_0x1842b1 instanceof Error&&_0x1842b1[_0x2855c9(0x1b6)]===_0x2855c9(0x1d6))throw CliErrors[_0x2855c9(0x1ab)](_0x2855c9(0x191));throw CliErrors['networkError']('KB\x20Service\x20knowledge\x20search\x20request\x20failed.');}if(_0x4bf794[_0x2855c9(0x1c0)]===0x191)throw CliErrors[_0x2855c9(0x1ad)]();if(_0x4bf794[_0x2855c9(0x1c0)]===0x1ad)throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x19e));if(!_0x4bf794['ok'])throw CliErrors[_0x2855c9(0x1bc)]('KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20'+_0x4bf794[_0x2855c9(0x1c0)]+').');if(!hasNoStore(_0x4bf794[_0x2855c9(0x17f)]))throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x1b3));if(!(_0x4bf794[_0x2855c9(0x17f)][_0x2855c9(0x1a0)](_0x2855c9(0x1a1))??'')[_0x2855c9(0x1b5)]()[_0x2855c9(0x1a5)](_0x2855c9(0x1c2)))throw CliErrors['apiError']('KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.');let _0xd1d367;try{_0xd1d367=await _0x4bf794['json']();}catch(_0x3437c0){if(_0x59abe7[_0x2855c9(0x1cb)]?.[_0x2855c9(0x1da)])throw new DOMException('Knowledge\x20search\x20cancelled.',_0x2855c9(0x1a9));if(_0x13f450['aborted']||_0x3437c0 instanceof Error&&_0x3437c0['name']===_0x2855c9(0x1d6))throw CliErrors[_0x2855c9(0x1ab)](_0x2855c9(0x191));throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x1d7));}try{const _0xb19465=requireExactRecord(_0xd1d367,[_0x2855c9(0x1ae),_0x2855c9(0x1d4),_0x2855c9(0x1c8)],_0x2855c9(0x1af));if(!Array[_0x2855c9(0x17e)](_0xb19465['hits']))throw invalidContract('hits');return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x2855c9(0x18b),'total':_0xb19465['hits'][_0x2855c9(0x187)],'hits':_0xb19465[_0x2855c9(0x1ae)],'strategyFingerprint':_0xb19465[_0x2855c9(0x1d4)],'timingsMs':_0xb19465[_0x2855c9(0x1c8)]},_0x59abe7[_0x2855c9(0x194)]??0xa);}catch(_0x5b9053){if(_0x5b9053 instanceof CliError)throw CliErrors[_0x2855c9(0x1bc)](_0x2855c9(0x1d2));throw _0x5b9053;}}function validateTopK(_0x4cb33e){const _0x4e030d=a283_0x2f5a00;if(_0x4cb33e!==undefined&&(!Number[_0x4e030d(0x1bb)](_0x4cb33e)||_0x4cb33e<0x1||_0x4cb33e>0x32))throw CliErrors['validation'](_0x4e030d(0x1d9));}function a283_0x51f0(_0x394298,_0x4be45c){_0x394298=_0x394298-0x17e;const _0x423543=a283_0x4235();let _0x51f0d8=_0x423543[_0x394298];return _0x51f0d8;}function hasNoStore(_0x5c8c30){const _0x1a7575=a283_0x2f5a00;return(_0x5c8c30[_0x1a7575(0x1a0)](_0x1a7575(0x1a8))??'')['split'](',')[_0x1a7575(0x190)](_0xb2c5b5=>_0xb2c5b5['trim']()[_0x1a7575(0x1b5)]()===_0x1a7575(0x19b));}function parseDevelopmentSearchResponse(_0x2d6aaf,_0x3b0188){const _0x3a3ddb=a283_0x2f5a00,_0x52a685=requireExactRecord(_0x2d6aaf,RESPONSE_KEYS,_0x3a3ddb(0x1af));if(_0x52a685[_0x3a3ddb(0x1c5)]!==0x2||_0x52a685[_0x3a3ddb(0x196)]!==_0x3a3ddb(0x18b))throw invalidContract(_0x3a3ddb(0x196));if(!Array[_0x3a3ddb(0x17e)](_0x52a685[_0x3a3ddb(0x1ae)])||_0x52a685['hits']['length']>(_0x3b0188??0x32))throw invalidContract(_0x3a3ddb(0x1ae));if(typeof _0x52a685[_0x3a3ddb(0x1d4)]!==_0x3a3ddb(0x1ba)||!/^sha256:[0-9a-f]{64}$/['test'](_0x52a685[_0x3a3ddb(0x1d4)]))throw invalidContract(_0x3a3ddb(0x1d4));const _0x5280ac=requireRecord(_0x52a685[_0x3a3ddb(0x1c8)],_0x3a3ddb(0x1c8)),_0x2f7ab8={};for(const [_0x413d41,_0x99567b]of Object[_0x3a3ddb(0x189)](_0x5280ac)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x3a3ddb(0x1be)](_0x413d41)||typeof _0x99567b!==_0x3a3ddb(0x1d8)||!Number[_0x3a3ddb(0x185)](_0x99567b)||_0x99567b<0x0)throw invalidContract(_0x3a3ddb(0x1c8));_0x2f7ab8[_0x413d41]=_0x99567b;}const _0x244444=_0x52a685['hits'][_0x3a3ddb(0x184)]((_0x3f3196,_0x4c5f8e)=>parseHit(_0x3f3196,_0x4c5f8e));if(!Number[_0x3a3ddb(0x1bb)](_0x52a685[_0x3a3ddb(0x183)])||_0x52a685[_0x3a3ddb(0x183)]!==_0x244444[_0x3a3ddb(0x187)])throw invalidContract(_0x3a3ddb(0x183));return{'schemaVersion':_0x52a685['schemaVersion'],'profile':_0x52a685['profile'],'total':_0x52a685[_0x3a3ddb(0x183)],'strategyFingerprint':_0x52a685[_0x3a3ddb(0x1d4)],'timingsMs':_0x2f7ab8,'hits':_0x244444};}function parseHit(_0x107f44,_0x73cad1){const _0x5912cc=a283_0x2f5a00,_0x119b8a=requireExactRecord(_0x107f44,HIT_KEYS,_0x5912cc(0x18c)+_0x73cad1+']'),_0x41fc02=_0x56feb2=>{const _0x45603c=_0x5912cc,_0xf88c47=_0x119b8a[_0x56feb2];if(typeof _0xf88c47!==_0x45603c(0x1ba)||!_0xf88c47)throw invalidContract(_0x56feb2);return _0xf88c47;};if(!Number[_0x5912cc(0x1bb)](_0x119b8a[_0x5912cc(0x1bf)])||_0x119b8a[_0x5912cc(0x1bf)]<0x1)throw invalidContract('revision');if(_0x119b8a[_0x5912cc(0x1b4)]!==_0x5912cc(0x1d5)&&_0x119b8a[_0x5912cc(0x1b4)]!==_0x5912cc(0x1b0))throw invalidContract(_0x5912cc(0x1b4));if(typeof _0x119b8a[_0x5912cc(0x1bd)]!=='string'||typeof _0x119b8a['text']!==_0x5912cc(0x1ba))throw invalidContract(_0x5912cc(0x1b1));if(!Array[_0x5912cc(0x17e)](_0x119b8a[_0x5912cc(0x195)])||_0x119b8a[_0x5912cc(0x195)][_0x5912cc(0x190)](_0x50da87=>typeof _0x50da87!==_0x5912cc(0x1ba)))throw invalidContract('tags');if(!Number[_0x5912cc(0x1bb)](_0x119b8a[_0x5912cc(0x182)])||_0x119b8a[_0x5912cc(0x182)]!==_0x73cad1+0x1)throw invalidContract(_0x5912cc(0x182));if(!isFiniteNumber(_0x119b8a[_0x5912cc(0x18a)])||!isFiniteNumber(_0x119b8a[_0x5912cc(0x1c6)]))throw invalidContract(_0x5912cc(0x19a));return{'documentId':_0x41fc02(_0x5912cc(0x1c3)),'revision':_0x119b8a['revision'],'chunkId':_0x41fc02(_0x5912cc(0x1a6)),'scope':_0x119b8a[_0x5912cc(0x1b4)],'title':_0x119b8a[_0x5912cc(0x1bd)],'text':_0x119b8a[_0x5912cc(0x1b1)],'tags':[..._0x119b8a[_0x5912cc(0x195)]],'rank':_0x119b8a[_0x5912cc(0x182)],'rawScore':_0x119b8a[_0x5912cc(0x18a)],'finalScore':_0x119b8a[_0x5912cc(0x1c6)],'scoreKind':_0x41fc02(_0x5912cc(0x18e))};}function requireExactRecord(_0x471d28,_0xc70032,_0x4c0457){const _0x91cfce=a283_0x2f5a00,_0x20dcae=requireRecord(_0x471d28,_0x4c0457),_0x2cec8d=Object[_0x91cfce(0x180)](_0x20dcae)[_0x91cfce(0x19d)](),_0x4a81c5=[..._0xc70032][_0x91cfce(0x19d)]();if(_0x2cec8d['length']!==_0x4a81c5['length']||_0x2cec8d[_0x91cfce(0x190)]((_0x362a4c,_0x14d891)=>_0x362a4c!==_0x4a81c5[_0x14d891]))throw invalidContract(_0x4c0457);return _0x20dcae;}function requireRecord(_0x52fe1f,_0x5376f8){const _0x3b52e3=a283_0x2f5a00;if(!_0x52fe1f||typeof _0x52fe1f!==_0x3b52e3(0x1d1)||Array[_0x3b52e3(0x17e)](_0x52fe1f))throw invalidContract(_0x5376f8);return _0x52fe1f;}function isFiniteNumber(_0x32000d){const _0x4343ba=a283_0x2f5a00;return typeof _0x32000d===_0x4343ba(0x1d8)&&Number[_0x4343ba(0x185)](_0x32000d);}function invalidContract(_0x1cfc76){const _0xcf29ea=a283_0x2f5a00;return CliErrors[_0xcf29ea(0x1bc)](_0xcf29ea(0x186)+_0x1cfc76+_0xcf29ea(0x1b7));}
|
|
1
|
+
const a284_0x14a355=a284_0x338d;(function(_0x4eed81,_0x126f67){const _0xfdd0db=a284_0x338d,_0x3e0597=_0x4eed81();while(!![]){try{const _0x2643aa=parseInt(_0xfdd0db(0x158))/0x1*(-parseInt(_0xfdd0db(0x16c))/0x2)+parseInt(_0xfdd0db(0x18b))/0x3+parseInt(_0xfdd0db(0x14c))/0x4+parseInt(_0xfdd0db(0x163))/0x5+-parseInt(_0xfdd0db(0x194))/0x6*(-parseInt(_0xfdd0db(0x17c))/0x7)+-parseInt(_0xfdd0db(0x159))/0x8+-parseInt(_0xfdd0db(0x14e))/0x9*(-parseInt(_0xfdd0db(0x18f))/0xa);if(_0x2643aa===_0x126f67)break;else _0x3e0597['push'](_0x3e0597['shift']());}catch(_0xf3c66e){_0x3e0597['push'](_0x3e0597['shift']());}}}(a284_0x3bdf,0x56712));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a284_0x14a355(0x197),a284_0x14a355(0x16b),a284_0x14a355(0x15e),a284_0x14a355(0x190),a284_0x14a355(0x19b),a284_0x14a355(0x18d)],HIT_KEYS=[a284_0x14a355(0x145),a284_0x14a355(0x18c),a284_0x14a355(0x184),a284_0x14a355(0x18a),a284_0x14a355(0x164),a284_0x14a355(0x189),a284_0x14a355(0x161),a284_0x14a355(0x154),'rawScore',a284_0x14a355(0x17d),a284_0x14a355(0x17e)];export function normalizeKbServiceOrigin(_0x2ab3e9){const _0x2573ba=a284_0x14a355,_0x565f77=()=>CliErrors[_0x2573ba(0x153)](_0x2573ba(0x176)),_0x31ac8e=_0x2ab3e9?.[_0x2573ba(0x14f)]();if(!_0x31ac8e||/[\u0000-\u0020\u007f]/[_0x2573ba(0x193)](_0x31ac8e)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x2573ba(0x193)](_0x31ac8e))throw _0x565f77();let _0x4c6c7e;try{_0x4c6c7e=new URL(_0x31ac8e);}catch{throw _0x565f77();}if(_0x4c6c7e[_0x2573ba(0x192)]!==_0x2573ba(0x178)||!_0x4c6c7e[_0x2573ba(0x172)]||_0x4c6c7e[_0x2573ba(0x18e)]||_0x4c6c7e[_0x2573ba(0x173)]||_0x4c6c7e[_0x2573ba(0x170)]!=='/'||_0x4c6c7e[_0x2573ba(0x19c)]||_0x4c6c7e[_0x2573ba(0x182)])throw _0x565f77();return _0x4c6c7e[_0x2573ba(0x15c)];}export async function searchDirectKnowledge(_0x1638a2){const _0x22bfc8=a284_0x14a355,_0x24044c=_0x1638a2[_0x22bfc8(0x15d)]['trim'](),_0x3ab6c5=_0x1638a2[_0x22bfc8(0x14b)][_0x22bfc8(0x14f)]();if(!_0x24044c)throw CliErrors[_0x22bfc8(0x153)](_0x22bfc8(0x17b));if(!_0x1638a2[_0x22bfc8(0x14a)][_0x22bfc8(0x14f)]())throw CliErrors[_0x22bfc8(0x162)]();if(!_0x3ab6c5)throw CliErrors[_0x22bfc8(0x153)](_0x22bfc8(0x171));validateTopK(_0x1638a2['topK']);const _0x565980=normalizeKbServiceOrigin(_0x1638a2[_0x22bfc8(0x169)]),_0x34e0b6=AbortSignal[_0x22bfc8(0x148)](0xea60),_0x2751ea=_0x1638a2[_0x22bfc8(0x147)]?AbortSignal['any']([_0x1638a2[_0x22bfc8(0x147)],_0x34e0b6]):_0x34e0b6;let _0x597a27;try{_0x597a27=await fetch(_0x565980+_0x22bfc8(0x181)+encodeURIComponent(_0x24044c)+'/knowledge/search',{'method':_0x22bfc8(0x160),'redirect':'error','headers':{'Content-Type':'application/json','Cookie':_0x1638a2[_0x22bfc8(0x14a)],'X-Invoke-Source':_0x22bfc8(0x174)},'body':JSON[_0x22bfc8(0x188)]({'query':_0x3ab6c5,..._0x1638a2['topK']!==undefined?{'topK':_0x1638a2[_0x22bfc8(0x157)]}:{}}),'signal':_0x2751ea});}catch(_0x4d44af){if(_0x1638a2[_0x22bfc8(0x147)]?.[_0x22bfc8(0x14d)])throw new DOMException(_0x22bfc8(0x191),_0x22bfc8(0x151));if(_0x4d44af instanceof Error&&_0x4d44af['name']==='TimeoutError')throw CliErrors['networkError'](_0x22bfc8(0x15b));throw CliErrors['networkError']('KB\x20Service\x20knowledge\x20search\x20request\x20failed.');}if(_0x597a27[_0x22bfc8(0x180)]===0x191)throw CliErrors['authRequired']();if(_0x597a27['status']===0x1ad)throw CliErrors[_0x22bfc8(0x17f)]('KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).');if(!_0x597a27['ok'])throw CliErrors[_0x22bfc8(0x17f)]('KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20'+_0x597a27['status']+').');if(!hasNoStore(_0x597a27['headers']))throw CliErrors[_0x22bfc8(0x17f)]('KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(!(_0x597a27[_0x22bfc8(0x19a)][_0x22bfc8(0x16a)](_0x22bfc8(0x199))??'')[_0x22bfc8(0x156)]()[_0x22bfc8(0x19e)](_0x22bfc8(0x168)))throw CliErrors['apiError'](_0x22bfc8(0x187));let _0x3328a3;try{_0x3328a3=await _0x597a27[_0x22bfc8(0x155)]();}catch(_0x3b0587){if(_0x1638a2[_0x22bfc8(0x147)]?.[_0x22bfc8(0x14d)])throw new DOMException(_0x22bfc8(0x191),_0x22bfc8(0x151));if(_0x34e0b6[_0x22bfc8(0x14d)]||_0x3b0587 instanceof Error&&_0x3b0587['name']===_0x22bfc8(0x152))throw CliErrors[_0x22bfc8(0x198)](_0x22bfc8(0x15b));throw CliErrors['apiError'](_0x22bfc8(0x16e));}try{const _0x3fbff3=requireExactRecord(_0x3328a3,[_0x22bfc8(0x190),_0x22bfc8(0x19b),_0x22bfc8(0x18d)],'response');if(!Array['isArray'](_0x3fbff3[_0x22bfc8(0x190)]))throw invalidContract(_0x22bfc8(0x190));return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x22bfc8(0x167),'total':_0x3fbff3[_0x22bfc8(0x190)]['length'],'hits':_0x3fbff3[_0x22bfc8(0x190)],'strategyFingerprint':_0x3fbff3[_0x22bfc8(0x19b)],'timingsMs':_0x3fbff3['timingsMs']},_0x1638a2[_0x22bfc8(0x157)]??0xa);}catch(_0x5e5748){if(_0x5e5748 instanceof CliError)throw CliErrors[_0x22bfc8(0x17f)](_0x22bfc8(0x149));throw _0x5e5748;}}function validateTopK(_0x1a06b0){const _0x5e5270=a284_0x14a355;if(_0x1a06b0!==undefined&&(!Number[_0x5e5270(0x195)](_0x1a06b0)||_0x1a06b0<0x1||_0x1a06b0>0x32))throw CliErrors[_0x5e5270(0x153)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function a284_0x338d(_0x1930ef,_0x3f70c8){_0x1930ef=_0x1930ef-0x145;const _0x3bdffc=a284_0x3bdf();let _0x338d63=_0x3bdffc[_0x1930ef];return _0x338d63;}function hasNoStore(_0x5ad713){const _0x4a54f6=a284_0x14a355;return(_0x5ad713[_0x4a54f6(0x16a)](_0x4a54f6(0x16f))??'')[_0x4a54f6(0x15f)](',')[_0x4a54f6(0x186)](_0xd0825a=>_0xd0825a[_0x4a54f6(0x14f)]()[_0x4a54f6(0x156)]()==='no-store');}function parseDevelopmentSearchResponse(_0x2c4f52,_0x37598c){const _0xbbd0e6=a284_0x14a355,_0x2da629=requireExactRecord(_0x2c4f52,RESPONSE_KEYS,_0xbbd0e6(0x17a));if(_0x2da629['schemaVersion']!==0x2||_0x2da629[_0xbbd0e6(0x16b)]!==_0xbbd0e6(0x167))throw invalidContract('profile');if(!Array[_0xbbd0e6(0x16d)](_0x2da629[_0xbbd0e6(0x190)])||_0x2da629[_0xbbd0e6(0x190)][_0xbbd0e6(0x165)]>(_0x37598c??0x32))throw invalidContract(_0xbbd0e6(0x190));if(typeof _0x2da629[_0xbbd0e6(0x19b)]!==_0xbbd0e6(0x185)||!/^sha256:[0-9a-f]{64}$/['test'](_0x2da629[_0xbbd0e6(0x19b)]))throw invalidContract(_0xbbd0e6(0x19b));const _0x1622b2=requireRecord(_0x2da629[_0xbbd0e6(0x18d)],'timingsMs'),_0x4eefdd={};for(const [_0x4ae7df,_0x17bebb]of Object['entries'](_0x1622b2)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0xbbd0e6(0x193)](_0x4ae7df)||typeof _0x17bebb!==_0xbbd0e6(0x177)||!Number['isFinite'](_0x17bebb)||_0x17bebb<0x0)throw invalidContract(_0xbbd0e6(0x18d));_0x4eefdd[_0x4ae7df]=_0x17bebb;}const _0xfd002c=_0x2da629[_0xbbd0e6(0x190)]['map']((_0xfbb4f4,_0x571076)=>parseHit(_0xfbb4f4,_0x571076));if(!Number[_0xbbd0e6(0x195)](_0x2da629[_0xbbd0e6(0x15e)])||_0x2da629['total']!==_0xfd002c[_0xbbd0e6(0x165)])throw invalidContract(_0xbbd0e6(0x15e));return{'schemaVersion':_0x2da629[_0xbbd0e6(0x197)],'profile':_0x2da629[_0xbbd0e6(0x16b)],'total':_0x2da629[_0xbbd0e6(0x15e)],'strategyFingerprint':_0x2da629[_0xbbd0e6(0x19b)],'timingsMs':_0x4eefdd,'hits':_0xfd002c};}function parseHit(_0x34434d,_0x213286){const _0x54c29c=a284_0x14a355,_0x4e939b=requireExactRecord(_0x34434d,HIT_KEYS,'hits['+_0x213286+']'),_0x450c3d=_0x3c2f5d=>{const _0x3616ac=a284_0x338d,_0xb93a6a=_0x4e939b[_0x3c2f5d];if(typeof _0xb93a6a!==_0x3616ac(0x185)||!_0xb93a6a)throw invalidContract(_0x3c2f5d);return _0xb93a6a;};if(!Number[_0x54c29c(0x195)](_0x4e939b['revision'])||_0x4e939b[_0x54c29c(0x18c)]<0x1)throw invalidContract(_0x54c29c(0x18c));if(_0x4e939b[_0x54c29c(0x18a)]!==_0x54c29c(0x196)&&_0x4e939b[_0x54c29c(0x18a)]!==_0x54c29c(0x183))throw invalidContract(_0x54c29c(0x18a));if(typeof _0x4e939b[_0x54c29c(0x164)]!==_0x54c29c(0x185)||typeof _0x4e939b[_0x54c29c(0x189)]!==_0x54c29c(0x185))throw invalidContract(_0x54c29c(0x189));if(!Array['isArray'](_0x4e939b[_0x54c29c(0x161)])||_0x4e939b[_0x54c29c(0x161)][_0x54c29c(0x186)](_0x48f18a=>typeof _0x48f18a!=='string'))throw invalidContract(_0x54c29c(0x161));if(!Number[_0x54c29c(0x195)](_0x4e939b[_0x54c29c(0x154)])||_0x4e939b[_0x54c29c(0x154)]!==_0x213286+0x1)throw invalidContract(_0x54c29c(0x154));if(!isFiniteNumber(_0x4e939b['rawScore'])||!isFiniteNumber(_0x4e939b[_0x54c29c(0x17d)]))throw invalidContract(_0x54c29c(0x166));return{'documentId':_0x450c3d(_0x54c29c(0x145)),'revision':_0x4e939b[_0x54c29c(0x18c)],'chunkId':_0x450c3d(_0x54c29c(0x184)),'scope':_0x4e939b[_0x54c29c(0x18a)],'title':_0x4e939b['title'],'text':_0x4e939b[_0x54c29c(0x189)],'tags':[..._0x4e939b[_0x54c29c(0x161)]],'rank':_0x4e939b[_0x54c29c(0x154)],'rawScore':_0x4e939b['rawScore'],'finalScore':_0x4e939b[_0x54c29c(0x17d)],'scoreKind':_0x450c3d(_0x54c29c(0x17e))};}function requireExactRecord(_0x59a549,_0x40614d,_0x2c5c88){const _0x2f1205=a284_0x14a355,_0x25473d=requireRecord(_0x59a549,_0x2c5c88),_0x6ca0a3=Object[_0x2f1205(0x15a)](_0x25473d)[_0x2f1205(0x175)](),_0x101c31=[..._0x40614d][_0x2f1205(0x175)]();if(_0x6ca0a3['length']!==_0x101c31[_0x2f1205(0x165)]||_0x6ca0a3[_0x2f1205(0x186)]((_0xa6ff0e,_0x57e9b9)=>_0xa6ff0e!==_0x101c31[_0x57e9b9]))throw invalidContract(_0x2c5c88);return _0x25473d;}function a284_0x3bdf(){const _0x32fb75=['username','30gVcFXA','hits','Knowledge\x20search\x20cancelled.','protocol','test','6hoTFWT','isSafeInteger','public','schemaVersion','networkError','content-type','headers','strategyFingerprint','search','\x20contract.','includes','documentId','object','signal','timeout','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','cookie','query','1285068mlvOeg','aborted','224244HclZUM','trim','isFinite','AbortError','TimeoutError','validation','rank','json','toLowerCase','topK','65383sudCfH','2764520ZfauYG','keys','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','origin','appCode','total','split','POST','tags','authRequired','1766175kenspX','title','length','score','development','application/json','serviceUrl','get','profile','8LeIYCb','isArray','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','cache-control','pathname','Knowledge\x20search\x20query\x20is\x20required.','hostname','password','cli:rabetbase','sort','Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','number','https:','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','response','Knowledge\x20search\x20appCode\x20is\x20required.','1440782YHbcIj','finalScore','scoreKind','apiError','status','/v2/development/apps/','hash','company','chunkId','string','some','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','stringify','text','scope','18261EZKZXI','revision','timingsMs'];a284_0x3bdf=function(){return _0x32fb75;};return a284_0x3bdf();}function requireRecord(_0x3f39c8,_0x126e7d){const _0x3e5a69=a284_0x14a355;if(!_0x3f39c8||typeof _0x3f39c8!==_0x3e5a69(0x146)||Array[_0x3e5a69(0x16d)](_0x3f39c8))throw invalidContract(_0x126e7d);return _0x3f39c8;}function isFiniteNumber(_0x599285){const _0x4f45c3=a284_0x14a355;return typeof _0x599285==='number'&&Number[_0x4f45c3(0x150)](_0x599285);}function invalidContract(_0x5ec168){const _0x11f1e7=a284_0x14a355;return CliErrors[_0x11f1e7(0x17f)](_0x11f1e7(0x179)+_0x5ec168+_0x11f1e7(0x19d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a285_0x2d86d7=a285_0x3aab;(function(_0x461ee2,_0x93e6eb){const _0x158251=a285_0x3aab,_0x3a34c5=_0x461ee2();while(!![]){try{const _0x4ffa28=parseInt(_0x158251(0xa2))/0x1*(-parseInt(_0x158251(0x97))/0x2)+parseInt(_0x158251(0x93))/0x3+-parseInt(_0x158251(0x9c))/0x4+parseInt(_0x158251(0x95))/0x5+-parseInt(_0x158251(0x98))/0x6*(parseInt(_0x158251(0x9d))/0x7)+-parseInt(_0x158251(0xa8))/0x8*(-parseInt(_0x158251(0xa7))/0x9)+-parseInt(_0x158251(0xa5))/0xa*(-parseInt(_0x158251(0xab))/0xb);if(_0x4ffa28===_0x93e6eb)break;else _0x3a34c5['push'](_0x3a34c5['shift']());}catch(_0xd10757){_0x3a34c5['push'](_0x3a34c5['shift']());}}}(a285_0x1c36,0xab97a));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';function a285_0x1c36(){const _0x46ab73=['page','name','utf8','1yWbMHE','localeCompare','page.lock.json','9240570VLlzQE','join','1702836mAbdJd','24ZxlCDy','Unsupported\x20file\x20in\x20page\x20directory:\x20','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','11TvQIzm','cwd','isFile','920823lIhuTa','appPagesDir','1952860PpqTkb','validation','712954ILUCpj','6zPkULR','trim','isDirectory','.json','3874088jDaTpK','1129387byhYCP','F_OK'];a285_0x1c36=function(){return _0x46ab73;};return a285_0x1c36();}export function loadPageProjectConfig(_0x2db17a,_0x341dd0=process[a285_0x2d86d7(0xac)]()){const _0x21cb72=a285_0x2d86d7,_0xbc1196=resolve(_0x341dd0),_0x210a7c=join(_0xbc1196,'.rabetbase',_0x21cb72(0x9f));return{'projectRoot':_0xbc1196,'pagesBaseDir':_0x210a7c,'appPagesDir':join(_0x210a7c,_0x2db17a),'lockFilePath':join(_0xbc1196,'.rabetbase',_0x21cb72(0xa4))};}export function buildPageFileName(_0x590844,_0x518454){const _0x4a6f34=a285_0x2d86d7;return _0x590844+'-'+_0x518454['toUpperCase']()+_0x4a6f34(0x9b);}export function resolvePageFilePath(_0x268b15,_0x4bcd0b,_0x3f3b83){const _0x246cdc=a285_0x2d86d7;return join(_0x268b15[_0x246cdc(0x94)],buildPageFileName(_0x4bcd0b,_0x3f3b83));}export async function ensureParentDirectory(_0x3d67e3){await mkdir(dirname(_0x3d67e3),{'recursive':!![]});}export async function fileExists(_0x1f9d76){const _0x205bf8=a285_0x2d86d7;try{return await access(_0x1f9d76,constants[_0x205bf8(0x9e)]),!![];}catch{return![];}}function a285_0x3aab(_0x394cb2,_0x4a6d08){_0x394cb2=_0x394cb2-0x92;const _0x1c3693=a285_0x1c36();let _0x3aab91=_0x1c3693[_0x394cb2];return _0x3aab91;}export async function readCustomPageDirectory(_0x5942ea){const _0x5cca4d=a285_0x2d86d7,_0x418b76=_0x5942ea[_0x5cca4d(0x99)]();if(!_0x418b76)throw CliErrors['flagMissing']('page-dir');const _0x4dc091=resolve(_0x418b76);let _0x3d9446;try{_0x3d9446=await lstat(_0x4dc091);}catch{throw CliErrors[_0x5cca4d(0x96)]('Page\x20directory\x20not\x20found:\x20'+_0x418b76);}if(!_0x3d9446[_0x5cca4d(0x9a)]())throw CliErrors[_0x5cca4d(0x96)](_0x5cca4d(0xaa)+_0x418b76);const _0x1d52d2={};return await readDirectory(_0x4dc091,_0x4dc091,_0x1d52d2),_0x1d52d2;}async function readDirectory(_0x46650b,_0x50949e,_0x301783){const _0x147881=a285_0x2d86d7,_0x36b294=await readdir(_0x50949e,{'withFileTypes':!![]});for(const _0x2a1ecc of _0x36b294['sort']((_0x1137f5,_0x66947d)=>_0x1137f5[_0x147881(0xa0)][_0x147881(0xa3)](_0x66947d['name']))){const _0x3ce617=join(_0x50949e,_0x2a1ecc[_0x147881(0xa0)]);if(_0x2a1ecc[_0x147881(0x9a)]()){await readDirectory(_0x46650b,_0x3ce617,_0x301783);continue;}if(!_0x2a1ecc[_0x147881(0x92)]())throw CliErrors[_0x147881(0x96)](_0x147881(0xa9)+_0x3ce617);_0x301783[relative(_0x46650b,_0x3ce617)['split'](sep)[_0x147881(0xa6)]('/')]=await readFile(_0x3ce617,_0x147881(0xa1));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a286_0x53f1(_0x1311f8,_0x3dff6a){_0x1311f8=_0x1311f8-0x183;const _0x37bac0=a286_0x37ba();let _0x53f1fd=_0x37bac0[_0x1311f8];return _0x53f1fd;}(function(_0x2f098c,_0x27e2e9){const _0x1c1a94=a286_0x53f1,_0x2a0d61=_0x2f098c();while(!![]){try{const _0x19da21=parseInt(_0x1c1a94(0x183))/0x1+-parseInt(_0x1c1a94(0x18b))/0x2+-parseInt(_0x1c1a94(0x188))/0x3+parseInt(_0x1c1a94(0x18e))/0x4*(parseInt(_0x1c1a94(0x193))/0x5)+-parseInt(_0x1c1a94(0x189))/0x6*(-parseInt(_0x1c1a94(0x186))/0x7)+parseInt(_0x1c1a94(0x18c))/0x8*(parseInt(_0x1c1a94(0x18f))/0x9)+-parseInt(_0x1c1a94(0x187))/0xa;if(_0x19da21===_0x27e2e9)break;else _0x2a0d61['push'](_0x2a0d61['shift']());}catch(_0x3ef124){_0x2a0d61['push'](_0x2a0d61['shift']());}}}(a286_0x37ba,0x75c4b));import a286_0xa60a19 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x55a712){const _0x4f0fc2=a286_0x53f1;return JSON[_0x4f0fc2(0x185)](JSON[_0x4f0fc2(0x191)](_0x55a712),null,0x2)+'\x0a';}export function computePageContentHash(_0x4a0828){const _0x487062=a286_0x53f1;return a286_0xa60a19[_0x487062(0x18d)](_0x487062(0x192))[_0x487062(0x190)](_0x4a0828)[_0x487062(0x18a)]('hex');}function a286_0x37ba(){const _0x3e54a2=['37470mengFh','318933ZRfYqy','utf8','stringify','7EvddbT','6558530DOoiOJ','1664604ZWXNhq','4419534nfDSSu','digest','542950cbVYMF','8bQLqcI','createHash','180WymIJG','5146407DePnRe','update','parse','md5'];a286_0x37ba=function(){return _0x3e54a2;};return a286_0x37ba();}export function computeSerializedSchemaHash(_0x3b95a2){return computePageContentHash(serializePageSchemaForFile(_0x3b95a2));}export async function computePageFileHash(_0x38d708){const _0x39dc1b=a286_0x53f1,_0x2bf56a=await readFile(_0x38d708,_0x39dc1b(0x184));return computePageContentHash(_0x2bf56a);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1daa8a,_0x18bcc0){const _0x407295=a287_0x5b46,_0x147618=_0x1daa8a();while(!![]){try{const _0x59e1c1=parseInt(_0x407295(0x1ab))/0x1+parseInt(_0x407295(0x1a9))/0x2+parseInt(_0x407295(0x1ae))/0x3*(-parseInt(_0x407295(0x1a4))/0x4)+parseInt(_0x407295(0x1a0))/0x5*(-parseInt(_0x407295(0x1ac))/0x6)+-parseInt(_0x407295(0x1a8))/0x7*(-parseInt(_0x407295(0x1aa))/0x8)+-parseInt(_0x407295(0x19e))/0x9+-parseInt(_0x407295(0x1a1))/0xa;if(_0x59e1c1===_0x18bcc0)break;else _0x147618['push'](_0x147618['shift']());}catch(_0x4e1579){_0x147618['push'](_0x147618['shift']());}}}(a287_0x4b06,0x6b84e));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a287_0x5b46(_0x197393,_0x15da0c){_0x197393=_0x197393-0x19d;const _0x4b06c7=a287_0x4b06();let _0x5b46a7=_0x4b06c7[_0x197393];return _0x5b46a7;}function a287_0x4b06(){const _0x2ef995=['2960OszJKo','114470aQkfsx','parse','stringify','591504sCVfUO','object','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','apps','103803lKkUGx','348762anGiLL','424lVWJVN','483851pfaeXG','186ThVnYk','ENOENT','9pOfvha','utf8','4773096zvddvO','pages'];a287_0x4b06=function(){return _0x2ef995;};return a287_0x4b06();}export function ensurePageLockScope(_0x3f3e89,_0x5ca19c){const _0x20401e=a287_0x5b46,_0x21f313={'apps':_0x3f3e89[_0x20401e(0x1a7)]&&typeof _0x3f3e89[_0x20401e(0x1a7)]===_0x20401e(0x1a5)?_0x3f3e89[_0x20401e(0x1a7)]:{}};let _0x2a6824=_0x21f313[_0x20401e(0x1a7)][_0x5ca19c];if(!_0x2a6824)return _0x2a6824={'lastSync':'','pages':{}},_0x21f313[_0x20401e(0x1a7)][_0x5ca19c]=_0x2a6824,{'lockData':_0x21f313,'appLock':_0x2a6824};return!_0x2a6824['lastSync']&&(_0x2a6824['lastSync']=''),(!_0x2a6824['pages']||typeof _0x2a6824[_0x20401e(0x19f)]!==_0x20401e(0x1a5))&&(_0x2a6824['pages']={}),{'lockData':_0x21f313,'appLock':_0x2a6824};}export async function readPageLockFile(_0x2ef50c){const _0x4a2bf3=a287_0x5b46;try{const _0x185991=await readFile(_0x2ef50c,_0x4a2bf3(0x19d)),_0x3c9c8c=JSON[_0x4a2bf3(0x1a2)](_0x185991);return{'apps':_0x3c9c8c[_0x4a2bf3(0x1a7)]&&typeof _0x3c9c8c[_0x4a2bf3(0x1a7)]===_0x4a2bf3(0x1a5)?_0x3c9c8c['apps']:{}};}catch(_0x3e3d63){if(_0x3e3d63['code']===_0x4a2bf3(0x1ad))return null;throw new Error(_0x4a2bf3(0x1a6)+String(_0x3e3d63));}}export async function writePageLockFile(_0x47b4c4,_0x15270a){const _0x5713b4=a287_0x5b46;await mkdir(dirname(_0x47b4c4),{'recursive':!![]}),await writeFile(_0x47b4c4,JSON[_0x5713b4(0x1a3)](_0x15270a,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x43827e,_0x461c77){const _0x155bd8=a288_0x14ee,_0x5428cf=_0x43827e();while(!![]){try{const _0x3d9b54=-parseInt(_0x155bd8(0xae))/0x1*(parseInt(_0x155bd8(0x9d))/0x2)+-parseInt(_0x155bd8(0x95))/0x3*(-parseInt(_0x155bd8(0x97))/0x4)+parseInt(_0x155bd8(0xa0))/0x5+parseInt(_0x155bd8(0xac))/0x6+-parseInt(_0x155bd8(0xa7))/0x7+-parseInt(_0x155bd8(0x9c))/0x8*(-parseInt(_0x155bd8(0xa2))/0x9)+-parseInt(_0x155bd8(0x8c))/0xa;if(_0x3d9b54===_0x461c77)break;else _0x5428cf['push'](_0x5428cf['shift']());}catch(_0xcd89c4){_0x5428cf['push'](_0x5428cf['shift']());}}}(a288_0x30fe,0xe599f));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x3ce9dd,_0x4e96e9,_0x376df2){const _0x2ed630=a288_0x14ee,_0x3812af=parseSchema(_0x3ce9dd,'local'),_0x4f0510=parseSchema(_0x4e96e9,'remote'),_0x482a86=collectLrSmartJsx(_0x3812af,!![]);if(_0x482a86[_0x2ed630(0x8b)]===0x0)return{'content':_0x3ce9dd,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x31b750=new Map(collectLrSmartJsx(_0x4f0510)[_0x2ed630(0x98)](_0x5e2a9e=>[_0x5e2a9e[_0x2ed630(0x88)],_0x5e2a9e]));let _0xb01d36=0x0,_0x4dc5de=0x0;for(const _0x48b71e of _0x482a86){const _0x5e80d4=readNonEmptyString(_0x48b71e[_0x2ed630(0x93)][_0x2ed630(0xa9)]),_0x42ebb4=readNonEmptyString(_0x48b71e[_0x2ed630(0x93)][_0x2ed630(0x9f)]),_0x74b6cb=_0x31b750['get'](_0x48b71e['key']),_0x16c89c=readNonEmptyString(_0x74b6cb?.[_0x2ed630(0x93)][_0x2ed630(0xa9)]),_0x16bc86=readNonEmptyString(_0x74b6cb?.[_0x2ed630(0x93)][_0x2ed630(0x9f)]);let _0x28310f=![];_0x48b71e['render'][_0x2ed630(0x8f)]!==_0x2ed630(0x94)&&(_0x48b71e[_0x2ed630(0x93)][_0x2ed630(0x8f)]='JSFunction',_0x28310f=!![]);!isPageContextExpression(_0x48b71e[_0x2ed630(0x90)][_0x2ed630(0x86)])&&(_0x48b71e[_0x2ed630(0x90)][_0x2ed630(0x86)]={'type':_0x2ed630(0xb4),'value':_0x2ed630(0x8d)},_0x28310f=!![]);if(!_0x5e80d4){if(!_0x42ebb4)throw CliErrors[_0x2ed630(0x96)](_0x2ed630(0x99)+_0x48b71e[_0x2ed630(0x92)]+_0x2ed630(0x91),_0x2ed630(0xb0));if(_0x28310f)_0x4dc5de+=0x1;continue;}const _0x56a0a6=!_0x74b6cb||_0x5e80d4!==_0x16c89c,_0x1e29d4=!_0x42ebb4;if(!_0x56a0a6&&_0x42ebb4&&_0x16bc86&&_0x42ebb4!==_0x16bc86)throw CliErrors['validation'](_0x2ed630(0x99)+_0x48b71e[_0x2ed630(0x92)]+_0x2ed630(0x8e),_0x2ed630(0x9b));if(_0x56a0a6||_0x1e29d4||!_0x16bc86){const _0x1aae05=readNonEmptyString(await _0x376df2(_0x5e80d4));if(!_0x1aae05)throw CliErrors[_0x2ed630(0x84)](_0x2ed630(0xa6)+_0x48b71e['label']+'\x22.');_0x48b71e['render']['value']=_0x1aae05,_0xb01d36+=0x1,_0x28310f=!![];}if(_0x28310f)_0x4dc5de+=0x1;}if(_0x4dc5de===0x0)return{'content':_0x3ce9dd,'compiledNodes':_0xb01d36,'normalizedNodes':_0x4dc5de};return{'content':JSON[_0x2ed630(0x87)](_0x3812af),'compiledNodes':_0xb01d36,'normalizedNodes':_0x4dc5de};}function parseSchema(_0x5d7764,_0x550a12){const _0x1a5490=a288_0x14ee;try{return JSON[_0x1a5490(0x9a)](_0x5d7764);}catch{throw CliErrors[_0x1a5490(0x96)](_0x1a5490(0xb1)+_0x550a12+_0x1a5490(0x9e));}}function a288_0x14ee(_0x4664d7,_0x28086b){_0x4664d7=_0x4664d7-0x84;const _0x30fe68=a288_0x30fe();let _0x14eea9=_0x30fe68[_0x4664d7];return _0x14eea9;}function collectLrSmartJsx(_0x4cd630,_0x30bfea=![]){const _0x47f3fc=[],_0x2ed3a5=(_0x5aee60,_0x180444)=>{const _0x443ca1=a288_0x14ee;if(Array[_0x443ca1(0xa1)](_0x5aee60)){_0x5aee60[_0x443ca1(0xad)]((_0x3ef75d,_0x3a6cff)=>_0x2ed3a5(_0x3ef75d,_0x180444+'['+_0x3a6cff+']'));return;}if(!isObject(_0x5aee60))return;if(_0x5aee60[_0x443ca1(0xb3)]===_0x443ca1(0xb2)){const _0x3eb104=readNonEmptyString(_0x5aee60['id']),_0x21749e=_0x3eb104||_0x180444,_0x4f0bbb=isObject(_0x5aee60['props'])?_0x5aee60[_0x443ca1(0x90)]:undefined;if(!_0x4f0bbb){if(_0x30bfea)throw CliErrors[_0x443ca1(0x96)](_0x443ca1(0x99)+_0x21749e+_0x443ca1(0xa5),_0x443ca1(0x8a));return;}const _0x1d0ea=isObject(_0x4f0bbb[_0x443ca1(0x93)])?_0x4f0bbb['render']:undefined;if(!_0x1d0ea){if(_0x30bfea)throw CliErrors[_0x443ca1(0x96)]('LrSmartJsx\x20node\x20\x22'+_0x21749e+_0x443ca1(0xaf),_0x443ca1(0xaa));return;}_0x47f3fc[_0x443ca1(0x89)]({'key':_0x3eb104?_0x443ca1(0xa4)+_0x3eb104:_0x443ca1(0xa8)+_0x180444,'label':_0x21749e,'props':_0x4f0bbb,'render':_0x1d0ea});}for(const [_0x1df82f,_0x4d073c]of Object[_0x443ca1(0xab)](_0x5aee60)){if(_0x1df82f===_0x443ca1(0x90)&&_0x5aee60[_0x443ca1(0xb3)]==='LrSmartJsx')continue;_0x2ed3a5(_0x4d073c,_0x180444+'.'+_0x1df82f);}};return _0x2ed3a5(_0x4cd630,'$'),_0x47f3fc;}function isObject(_0x17da5d){const _0x3d826f=a288_0x14ee;return Boolean(_0x17da5d)&&typeof _0x17da5d===_0x3d826f(0xa3)&&!Array['isArray'](_0x17da5d);}function a288_0x30fe(){const _0x5a690e=['push','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','length','9398650cEfylH','this','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','type','props','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','label','render','JSFunction','9SfPXHq','validation','1077520FbNABa','map','LrSmartJsx\x20node\x20\x22','parse','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','177208abrznC','194HsXiud','\x20page\x20schema.','value','7508920HivSnj','isArray','207yekJTW','object','id:','\x22\x20has\x20missing\x20or\x20invalid\x20props.','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','8004234HuwXWu','path:','source','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','entries','10311282TFtGBu','forEach','15610vcdrGR','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','Invalid\x20JSON\x20in\x20','LrSmartJsx','componentName','JSExpression','apiError','string','_context','stringify','key'];a288_0x30fe=function(){return _0x5a690e;};return a288_0x30fe();}function readNonEmptyString(_0x20f2e2){const _0x4b8901=a288_0x14ee;return typeof _0x20f2e2===_0x4b8901(0x85)&&_0x20f2e2['trim']()?_0x20f2e2:undefined;}function isPageContextExpression(_0x32875d){const _0x464103=a288_0x14ee;return isObject(_0x32875d)&&_0x32875d[_0x464103(0x8f)]===_0x464103(0xb4)&&_0x32875d[_0x464103(0x9f)]===_0x464103(0x8d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x25a497,_0x42f90d){const _0x4b226c=a289_0x468b,_0x334df9=_0x25a497();while(!![]){try{const _0x44f2e3=-parseInt(_0x4b226c(0xd2))/0x1+-parseInt(_0x4b226c(0x106))/0x2+-parseInt(_0x4b226c(0xfe))/0x3+-parseInt(_0x4b226c(0xe3))/0x4*(parseInt(_0x4b226c(0xf0))/0x5)+-parseInt(_0x4b226c(0x102))/0x6+parseInt(_0x4b226c(0xd6))/0x7+parseInt(_0x4b226c(0xdd))/0x8*(parseInt(_0x4b226c(0xd9))/0x9);if(_0x44f2e3===_0x42f90d)break;else _0x334df9['push'](_0x334df9['shift']());}catch(_0x47cf5d){_0x334df9['push'](_0x334df9['shift']());}}}(a289_0x4a61,0x337aa));function a289_0x468b(_0x589a66,_0x4e9437){_0x589a66=_0x589a66-0xc7;const _0x4a6135=a289_0x4a61();let _0x468b4d=_0x4a6135[_0x589a66];return _0x468b4d;}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x390ffc,_0x4d2583){const _0x9e17e=a289_0x468b,_0x403bec=[],_0x7bc4f=normalizeSqlForStaticAnalysis(_0x390ffc),_0x70c320=(_0x7bc4f[_0x9e17e(0xe2)]?[]:extractJoinFacts(_0x7bc4f[_0x9e17e(0xee)]))[_0x9e17e(0xd8)](_0x25c30a=>{const _0x1cc34b=_0x9e17e;if(_0x25c30a['unsupportedPredicate']||_0x25c30a['columns'][_0x1cc34b(0xd0)]===0x0)return _0x403bec[_0x1cc34b(0xd3)]({'code':_0x1cc34b(0xf2),'table':_0x25c30a['table'],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x25c30a[_0x1cc34b(0x105)]??_0x1cc34b(0x10b)}),{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xeb)};const _0x442fe5=resolveTableMetadata(_0x4d2583,_0x25c30a[_0x1cc34b(0xed)]),_0x29b384=(_0x442fe5?.[_0x1cc34b(0x104)]??[])[_0x1cc34b(0xd8)](_0x9696f1=>({'index':_0x9696f1,'matchedPrefix':findEqualityPrefix(_0x9696f1['columns'],_0x25c30a[_0x1cc34b(0xc9)])}))[_0x1cc34b(0xcb)](_0x2f1d2f=>_0x2f1d2f['matchedPrefix'][_0x1cc34b(0xd0)]>0x0),_0x4c78c8=_0x29b384['reduce']((_0x2ada90,_0x3b6bce)=>!_0x2ada90||_0x3b6bce[_0x1cc34b(0x110)][_0x1cc34b(0xd0)]>_0x2ada90[_0x1cc34b(0x110)][_0x1cc34b(0xd0)]?_0x3b6bce:_0x2ada90,_0x29b384[0x0]);if(_0x4c78c8)return{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xde),'matchedIndex':{..._0x4c78c8[_0x1cc34b(0xf8)],'matchedPrefix':_0x4c78c8[_0x1cc34b(0x110)]}};const _0x48fb89=_0x442fe5?.['indexes'][_0x1cc34b(0xcb)](_0x5dbb41=>_0x5dbb41[_0x1cc34b(0xc9)][_0x1cc34b(0xd7)](_0x430229=>_0x25c30a[_0x1cc34b(0xc9)][_0x1cc34b(0xd7)](_0x5e5fb6=>columnNamesMatch(_0x430229,_0x5e5fb6))))??[];if(_0x48fb89[_0x1cc34b(0xd0)]>0x0)return _0x403bec['push']({'code':_0x1cc34b(0xf9),'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x1cc34b(0x108)}),{'table':_0x25c30a['table'],'alias':_0x25c30a['alias'],'columns':_0x25c30a[_0x1cc34b(0xc9)],'status':_0x1cc34b(0xf4),'candidateIndexes':_0x48fb89};if(_0x442fe5&&_0x442fe5[_0x1cc34b(0xef)]!==![]&&_0x442fe5['indexes']['length']>0x0&&_0x25c30a[_0x1cc34b(0xc9)]['length']>0x0)return _0x403bec[_0x1cc34b(0xd3)]({'code':'JOIN_INDEX_MISSING','table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a['columns'],'status':_0x1cc34b(0xf4)};return _0x403bec['push']({'code':_0x1cc34b(0xfb),'table':_0x25c30a[_0x1cc34b(0xed)],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a[_0x1cc34b(0xc9)],'reason':_0x442fe5?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':_0x1cc34b(0x10d)}),{'table':_0x25c30a['table'],'alias':_0x25c30a[_0x1cc34b(0xd4)],'columns':_0x25c30a['columns'],'status':'unavailable'};});return{'checked':_0x70c320[_0x9e17e(0xd0)]>0x0,'joins':_0x70c320,'warnings':_0x403bec};}function extractJoinFacts(_0x326508){const _0x396448=a289_0x468b,_0x12f2f5=maskNestedQueries(stripSqlNoise(_0x326508)),_0x3f3669=maskQuotedIdentifiers(_0x12f2f5),_0xe57fa7=[],_0x533560=new Set(),_0x2ab49f=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x41f5eb of _0x12f2f5['matchAll'](_0x2ab49f)){const _0x1458e5=_0x41f5eb[_0x396448(0xf8)]??0x0,_0x21c406=_0x41f5eb[0x0]['search'](/\bJOIN\b/i),_0xf36fe4=_0x1458e5+Math['max'](0x0,_0x21c406);if(!/^JOIN\b/i[_0x396448(0xe1)](_0x3f3669['slice'](_0xf36fe4)))continue;_0x533560[_0x396448(0x109)](_0xf36fe4);const _0x2a889a=normalizeIdentifier(_0x41f5eb[0x1]||'INNER'),_0x72e674=normalizeIdentifier(_0x41f5eb[0x2]??''),_0x37193c=normalizeIdentifier(_0x41f5eb[0x3]||_0x72e674[_0x396448(0xfa)]('.')['at'](-0x1)||_0x72e674),_0x330e91=[],_0x49a42d=_0x72e674===_0x396448(0xe8);let _0x2f9071=_0x2a889a===_0x396448(0xdc)||_0x2a889a===_0x396448(0xe5)||_0x49a42d,_0x5d3d12=_0x2f9071?_0x49a42d?_0x396448(0xcc):_0x2a889a['toUpperCase']()+_0x396448(0xc7):undefined;const _0x5bc63e=stripOuterParentheses(_0x41f5eb[0x4]??''),_0x155260=_0x5bc63e['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x5bc63e[_0x396448(0xf5)](MYBATIS_DYNAMIC_END_MARKER),_0xf9d466=_0x5bc63e[_0x396448(0xf5)](MYBATIS_INCLUDE_MARKER);_0x155260&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0x103));_0xf9d466&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0xd5));const _0x374960=_0x5bc63e[_0x396448(0xe6)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x396448(0xe6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x396448(0xe6)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x374960,'OR')&&(_0x2f9071=!![],_0x5d3d12??=_0x396448(0x10e));for(const _0x2a2982 of splitTopLevelAnd(_0x374960)){const _0x24644c=stripOuterParentheses(_0x2a2982);if(hasTopLevelKeyword(_0x24644c,'OR')){_0x2f9071=!![],_0x5d3d12??=_0x396448(0x10e);continue;}const _0x1b48b0=splitEquality(_0x24644c);if(!_0x1b48b0){containsColumnReference(_0x2a2982,_0x37193c)&&(_0x2f9071=!![]);continue;}const _0x41bf0c=parseDirectColumnReference(_0x1b48b0[0x0],_0x37193c),_0x36e8ff=parseDirectColumnReference(_0x1b48b0[0x1],_0x37193c),_0x13f510=containsColumnReference(_0x1b48b0[0x0],_0x37193c),_0x5636e8=containsColumnReference(_0x1b48b0[0x1],_0x37193c),_0x459024=_0x41bf0c&&!_0x5636e8?_0x41bf0c:_0x36e8ff&&!_0x13f510?_0x36e8ff:null;if(_0x459024&&!_0x330e91[_0x396448(0xf5)](_0x459024))_0x330e91[_0x396448(0xd3)](_0x459024);else!_0x459024&&containsColumnReference(_0x2a2982,_0x37193c)&&(_0x2f9071=!![]);}_0xe57fa7[_0x396448(0xd3)]({'table':_0x72e674,'alias':_0x37193c,'columns':_0x330e91,'unsupportedPredicate':_0x2f9071,'unsupportedReason':_0x5d3d12,'containsUnresolvedInclude':_0xf9d466,'position':_0xf36fe4});}for(const _0x4de30f of _0x3f3669[_0x396448(0xf3)](/\bJOIN\b/gi)){const _0x1c64ed=_0x4de30f[_0x396448(0xf8)]??0x0;if(_0x533560[_0x396448(0xff)](_0x1c64ed))continue;const _0x200c5b=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x12f2f5['slice'](_0x1c64ed+_0x4de30f[0x0][_0x396448(0xd0)])),_0x44248f=normalizeIdentifier(_0x200c5b?.[0x1]||_0x396448(0x101)),_0x24afdf=normalizeIdentifier(_0x200c5b?.[0x2]||''),_0xc30c8b=isSqlClauseKeyword(_0x24afdf)?_0x44248f['split']('.')['at'](-0x1)||_0x44248f:_0x24afdf||_0x44248f[_0x396448(0xfa)]('.')['at'](-0x1)||_0x44248f;_0xe57fa7['push']({'table':_0x44248f,'alias':_0xc30c8b,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1c64ed});}const _0x5ce0c6=_0x3f3669[_0x396448(0xf1)](MYBATIS_INCLUDE_MARKER);return _0x5ce0c6>=0x0&&!_0xe57fa7['some'](_0x5ad496=>_0x5ad496[_0x396448(0xec)])&&_0xe57fa7['push']({'table':_0x396448(0x101),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x396448(0xe9),'containsUnresolvedInclude':!![],'position':_0x5ce0c6}),_0xe57fa7[_0x396448(0xfc)]((_0x91cb53,_0x12d194)=>_0x91cb53[_0x396448(0xdb)]-_0x12d194[_0x396448(0xdb)]);}function stripSqlNoise(_0x3afd56){const _0x4b7cc1=a289_0x468b,_0x5a27bc=Array[_0x4b7cc1(0xfd)](_0x3afd56),_0x54de5b=(_0x21c4ca,_0x20d675)=>{for(let _0x2ed689=_0x21c4ca;_0x2ed689<_0x20d675;_0x2ed689+=0x1){_0x5a27bc[_0x2ed689]!=='\x0a'&&_0x5a27bc[_0x2ed689]!=='\x0d'&&(_0x5a27bc[_0x2ed689]='\x20');}};for(let _0x1852d5=0x0;_0x1852d5<_0x5a27bc[_0x4b7cc1(0xd0)];_0x1852d5+=0x1){const _0x34062f=_0x5a27bc[_0x1852d5],_0x199283=_0x5a27bc[_0x1852d5+0x1];if(_0x34062f==='\x27'||_0x34062f==='\x22'||_0x34062f==='`'){const _0x4e6638=_0x34062f,_0x2b2299=_0x1852d5;_0x1852d5+=0x1;while(_0x1852d5<_0x5a27bc['length']){if(_0x5a27bc[_0x1852d5]==='\x5c'&&_0x1852d5+0x1<_0x5a27bc[_0x4b7cc1(0xd0)]){_0x1852d5+=0x2;continue;}if(_0x5a27bc[_0x1852d5]!==_0x4e6638){_0x1852d5+=0x1;continue;}if(_0x5a27bc[_0x1852d5+0x1]===_0x4e6638){_0x1852d5+=0x2;continue;}break;}if(_0x4e6638==='\x27')_0x54de5b(_0x2b2299,Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]));continue;}if(_0x34062f==='-'&&_0x199283==='-'){const _0x1be631=_0x1852d5;while(_0x1852d5<_0x5a27bc[_0x4b7cc1(0xd0)]&&_0x5a27bc[_0x1852d5]!=='\x0a')_0x1852d5+=0x1;_0x54de5b(_0x1be631,_0x1852d5);continue;}if(_0x34062f==='/'&&_0x199283==='*'){const _0x13e6ea=_0x1852d5;_0x1852d5+=0x2;while(_0x1852d5<_0x5a27bc['length']&&!(_0x5a27bc[_0x1852d5]==='*'&&_0x5a27bc[_0x1852d5+0x1]==='/')){_0x1852d5+=0x1;}_0x1852d5=Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]-0x1),_0x54de5b(_0x13e6ea,_0x1852d5+0x1);continue;}if(_0x34062f==='#'&&_0x199283!=='{'){const _0x5e6a71=_0x1852d5;while(_0x1852d5<_0x5a27bc['length']&&_0x5a27bc[_0x1852d5]!=='\x0a')_0x1852d5+=0x1;_0x54de5b(_0x5e6a71,_0x1852d5);continue;}if((_0x34062f==='#'||_0x34062f==='$')&&_0x199283==='{'){const _0x227382=_0x1852d5;_0x1852d5+=0x2;while(_0x1852d5<_0x5a27bc['length']&&_0x5a27bc[_0x1852d5]!=='}')_0x1852d5+=0x1;_0x54de5b(_0x227382,Math[_0x4b7cc1(0xcf)](_0x1852d5+0x1,_0x5a27bc[_0x4b7cc1(0xd0)]));}}return _0x5a27bc['join']('');}function maskQuotedIdentifiers(_0x365518){const _0x41834d=a289_0x468b,_0x1c4f88=Array[_0x41834d(0xfd)](_0x365518);for(let _0x2ae777=0x0;_0x2ae777<_0x1c4f88[_0x41834d(0xd0)];_0x2ae777+=0x1){const _0x5057c5=_0x1c4f88[_0x2ae777];if(_0x5057c5!=='\x22'&&_0x5057c5!=='`')continue;_0x2ae777+=0x1;while(_0x2ae777<_0x1c4f88['length']){if(_0x1c4f88[_0x2ae777]===_0x5057c5){if(_0x1c4f88[_0x2ae777+0x1]===_0x5057c5){_0x1c4f88[_0x2ae777]='\x20',_0x1c4f88[_0x2ae777+0x1]='\x20',_0x2ae777+=0x2;continue;}break;}_0x1c4f88[_0x2ae777]='\x20',_0x2ae777+=0x1;}}return _0x1c4f88[_0x41834d(0xf7)]('');}function maskNestedQueries(_0x220449){const _0x5ee8c8=a289_0x468b,_0xaf21d2=Array[_0x5ee8c8(0xfd)](_0x220449);for(let _0x415043=0x0;_0x415043<_0xaf21d2[_0x5ee8c8(0xd0)];_0x415043+=0x1){if(_0xaf21d2[_0x415043]!=='(')continue;const _0x3818b4=_0x220449[_0x5ee8c8(0xca)](_0x415043+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x5ee8c8(0xe1)](_0x3818b4))continue;let _0x4ad856=0x1,_0x382b1c=_0x415043+0x1;for(;_0x382b1c<_0xaf21d2[_0x5ee8c8(0xd0)]&&_0x4ad856>0x0;_0x382b1c+=0x1){if(_0xaf21d2[_0x382b1c]==='(')_0x4ad856+=0x1;if(_0xaf21d2[_0x382b1c]===')')_0x4ad856-=0x1;}if(_0x4ad856!==0x0)continue;for(let _0x595ed5=_0x415043;_0x595ed5<_0x382b1c;_0x595ed5+=0x1){_0xaf21d2[_0x595ed5]='\x20';}const _0x1cee27=_0x5ee8c8(0xe8);for(let _0x4a833a=0x0;_0x4a833a<_0x1cee27[_0x5ee8c8(0xd0)]&&_0x415043+_0x4a833a<_0x382b1c;_0x4a833a+=0x1){_0xaf21d2[_0x415043+_0x4a833a]=_0x1cee27[_0x4a833a];}_0x415043=_0x382b1c-0x1;}return _0xaf21d2[_0x5ee8c8(0xf7)]('');}function a289_0x4a61(){const _0x5c101d=['min','length','toLowerCase','68530LOdEgi','push','alias','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','1149771eUUcWh','some','map','36441UnlsfY','where','position','right','2776jpCLaN','covered','trim','cross','test','error','19000eBsAVW','max','full','replaceAll','replace','__sq__','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','(?:^|[^\x5cw$])','unavailable','containsUnresolvedInclude','table','sql','metadataAvailable','410wFmvIP','indexOf','JOIN_PREDICATE_UNSUPPORTED','matchAll','warning','includes','left','join','index','JOIN_INDEX_NOT_USABLE','split','INDEX_METADATA_UNAVAILABLE','sort','from','359223zYAJfv','has','natural','unknown','2528856PwnVYs','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','indexes','unsupportedReason','718302gtpmDs','\x5cs*\x5c.\x5cs*[\x5cw$]+','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','add','exec','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x5c$&','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','tableName','matchedPrefix','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','inner','columns','slice','filter','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','toUpperCase','endsWith'];a289_0x4a61=function(){return _0x5c101d;};return a289_0x4a61();}function splitTopLevelAnd(_0x880013){const _0x1033db=a289_0x468b,_0x40645b=[];let _0x5876bf=0x0,_0x5cba2b=0x0;for(let _0x156b07=0x0;_0x156b07<_0x880013[_0x1033db(0xd0)];_0x156b07+=0x1){const _0x5c5508=_0x880013[_0x156b07];if(_0x5c5508==='(')_0x5876bf+=0x1;if(_0x5c5508===')')_0x5876bf=Math['max'](0x0,_0x5876bf-0x1);_0x5876bf===0x0&&_0x880013[_0x1033db(0xca)](_0x156b07)['match'](/^AND\b/i)&&(_0x156b07===0x0||/\s/['test'](_0x880013[_0x156b07-0x1]??''))&&(_0x40645b[_0x1033db(0xd3)](_0x880013['slice'](_0x5cba2b,_0x156b07)[_0x1033db(0xdf)]()),_0x156b07+=0x2,_0x5cba2b=_0x156b07+0x1);}const _0x223d13=_0x880013[_0x1033db(0xca)](_0x5cba2b)['trim']();if(_0x223d13)_0x40645b[_0x1033db(0xd3)](_0x223d13);return _0x40645b;}function hasTopLevelKeyword(_0x32960f,_0x3fd956){const _0x4903c7=a289_0x468b;let _0x32d006=0x0;for(let _0x49c5ac=0x0;_0x49c5ac<_0x32960f[_0x4903c7(0xd0)];_0x49c5ac+=0x1){const _0x589ef0=_0x32960f[_0x49c5ac];if(_0x589ef0==='(')_0x32d006+=0x1;if(_0x589ef0===')')_0x32d006=Math[_0x4903c7(0xe4)](0x0,_0x32d006-0x1);if(_0x32d006!==0x0)continue;const _0x589e13=_0x32960f[_0x4903c7(0xca)](_0x49c5ac,_0x49c5ac+_0x3fd956['length']),_0x19a220=_0x32960f[_0x49c5ac-0x1]??'\x20',_0x487ed8=_0x32960f[_0x49c5ac+_0x3fd956['length']]??'\x20';if(_0x589e13[_0x4903c7(0xcd)]()===_0x3fd956[_0x4903c7(0xcd)]()&&!/[\w$]/[_0x4903c7(0xe1)](_0x19a220)&&!/[\w$]/[_0x4903c7(0xe1)](_0x487ed8))return!![];}return![];}function splitEquality(_0x344fe4){const _0x4eab2e=a289_0x468b,_0x891963=stripOuterParentheses(_0x344fe4);let _0x35963b=0x0,_0x544b6b;for(let _0x1fe6d9=0x0;_0x1fe6d9<_0x891963[_0x4eab2e(0xd0)];_0x1fe6d9+=0x1){const _0x5df85a=_0x891963[_0x1fe6d9];if(_0x5df85a==='(')_0x35963b+=0x1;if(_0x5df85a===')')_0x35963b=Math[_0x4eab2e(0xe4)](0x0,_0x35963b-0x1);const _0x4b43de=_0x891963[_0x1fe6d9-0x1]??'',_0x1e04d3=_0x891963[_0x1fe6d9+0x1]??'';if(_0x5df85a==='='&&_0x35963b===0x0&&!/[!<>=:]/[_0x4eab2e(0xe1)](_0x4b43de)&&_0x1e04d3!=='='){if(_0x544b6b!==undefined)return null;_0x544b6b=_0x1fe6d9;}}return _0x544b6b===undefined?null:[_0x891963['slice'](0x0,_0x544b6b)[_0x4eab2e(0xdf)](),_0x891963[_0x4eab2e(0xca)](_0x544b6b+0x1)[_0x4eab2e(0xdf)]()];}function parseDirectColumnReference(_0x7d65cd,_0x33b103){const _0xeea628=a289_0x468b,_0x3a15ca=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0xeea628(0x10a)](stripOuterParentheses(_0x7d65cd));if(!_0x3a15ca)return null;if(normalizeIdentifier(_0x3a15ca[0x1]??'')!==normalizeIdentifier(_0x33b103))return null;return normalizeIdentifier(_0x3a15ca[0x2]??'');}function containsColumnReference(_0x5d9df5,_0x2d451e){const _0x1af310=a289_0x468b,_0x3ae670=_0x5d9df5[_0x1af310(0xe7)](/[`"]/g,''),_0x3b083a=_0x2d451e[_0x1af310(0xe7)](/[.*+?^${}()|[\]\\]/g,_0x1af310(0x10c));return new RegExp(_0x1af310(0xea)+_0x3b083a+_0x1af310(0x107),'i')[_0x1af310(0xe1)](_0x3ae670);}function findEqualityPrefix(_0x49a02f,_0x4a0a9b){const _0x20c867=new Set(_0x4a0a9b['map'](normalizeIdentifier)),_0xce6f0=[];for(const _0x48b2e9 of _0x49a02f){if(!_0x20c867['has'](normalizeIdentifier(_0x48b2e9)))break;_0xce6f0['push'](_0x48b2e9);}return _0xce6f0;}function resolveTableMetadata(_0x32939c,_0x4256d8){const _0x385214=a289_0x468b,_0x3c7505=normalizeIdentifier(_0x4256d8),_0xf6dc0e=_0x32939c['filter'](_0x3cd3af=>normalizeIdentifier(_0x3cd3af[_0x385214(0x10f)])===_0x3c7505);if(_0xf6dc0e[_0x385214(0xd0)]===0x1)return _0xf6dc0e[0x0];const _0x29da74=_0x3c7505[_0x385214(0xf5)]('.'),_0x409efb=_0x3c7505[_0x385214(0xfa)]('.')['at'](-0x1),_0x3e25d7=_0x32939c[_0x385214(0xcb)](_0x1f011b=>{const _0x3e1db5=_0x385214,_0x456978=normalizeIdentifier(_0x1f011b[_0x3e1db5(0x10f)]);if(_0x29da74&&_0x456978['includes']('.'))return![];return _0x456978[_0x3e1db5(0xfa)]('.')['at'](-0x1)===_0x409efb;});return _0x3e25d7[_0x385214(0xd0)]===0x1?_0x3e25d7[0x0]:undefined;}function columnNamesMatch(_0x40adaf,_0x47f27b){return normalizeIdentifier(_0x40adaf)===normalizeIdentifier(_0x47f27b);}function normalizeIdentifier(_0x4d3aea){const _0x4697b8=a289_0x468b;return _0x4d3aea[_0x4697b8(0xe7)](/[`"]/g,'')[_0x4697b8(0xdf)]()[_0x4697b8(0xd1)]();}function isSqlClauseKeyword(_0x2f1ef7){const _0x2cd4e2=a289_0x468b;return new Set(['on','using',_0x2cd4e2(0xda),_0x2cd4e2(0xf7),_0x2cd4e2(0xc8),_0x2cd4e2(0xf6),_0x2cd4e2(0xdc),_0x2cd4e2(0xe5),_0x2cd4e2(0xe0),_0x2cd4e2(0x100)])[_0x2cd4e2(0xff)](_0x2f1ef7);}function stripOuterParentheses(_0x387440){const _0x12b830=a289_0x468b;let _0x12ee9d=_0x387440['trim']();while(_0x12ee9d['startsWith']('(')&&_0x12ee9d[_0x12b830(0xce)](')')){let _0x692cb=0x0,_0x176c75=!![];for(let _0x55ef67=0x0;_0x55ef67<_0x12ee9d['length'];_0x55ef67+=0x1){if(_0x12ee9d[_0x55ef67]==='(')_0x692cb+=0x1;if(_0x12ee9d[_0x55ef67]===')')_0x692cb-=0x1;if(_0x692cb===0x0&&_0x55ef67<_0x12ee9d[_0x12b830(0xd0)]-0x1){_0x176c75=![];break;}}if(!_0x176c75||_0x692cb!==0x0)break;_0x12ee9d=_0x12ee9d[_0x12b830(0xca)](0x1,-0x1)['trim']();}return _0x12ee9d;}
|
|
1
|
+
(function(_0x12ec32,_0x15a61e){const _0x10c510=a290_0x2eb9,_0x393626=_0x12ec32();while(!![]){try{const _0x4cc0f1=parseInt(_0x10c510(0xe7))/0x1*(-parseInt(_0x10c510(0xe4))/0x2)+-parseInt(_0x10c510(0xd6))/0x3+parseInt(_0x10c510(0xc2))/0x4*(-parseInt(_0x10c510(0xd5))/0x5)+parseInt(_0x10c510(0xc4))/0x6+parseInt(_0x10c510(0xde))/0x7+-parseInt(_0x10c510(0xb8))/0x8*(-parseInt(_0x10c510(0xbd))/0x9)+parseInt(_0x10c510(0xdb))/0xa;if(_0x4cc0f1===_0x15a61e)break;else _0x393626['push'](_0x393626['shift']());}catch(_0x5086a4){_0x393626['push'](_0x393626['shift']());}}}(a290_0x5c70,0x478ba));function a290_0x5c70(){const _0x2d6824=['No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','full','columns','unsupportedPredicate','917703BIXVGR','\x5c$&','includes','JOIN_PREDICATE_UNSUPPORTED','join','944708ZGbHMx','search','425712pTMXdz','\x5cs*\x5c.\x5cs*[\x5cw$]+','add','split','max','toUpperCase','test','min','replace','from','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','slice','covered','matchAll','where','trim','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','5qUkidw','1313991LUnZng','inner','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','unavailable','toLowerCase','9436930FUPKdk','metadataAvailable','indexes','2026577sOhlFm','__sq__','INDEX_METADATA_UNAVAILABLE','right','sort','unsupportedReason','2UqlcLN','warning','match','438899TukcFU','(?:^|[^\x5cw$])','INNER','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','containsUnresolvedInclude','filter','endsWith','push','length','error','some','index','unknown','table','has','map','reduce','exec','replaceAll','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','position','alias','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','matchedPrefix','JOIN_INDEX_NOT_USABLE','tableName','using','8bXAPWz'];a290_0x5c70=function(){return _0x2d6824;};return a290_0x5c70();}import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x2c9861,_0x5c3a4a){const _0x1e2d3e=a290_0x2eb9,_0x48706f=[],_0x3d2fc8=normalizeSqlForStaticAnalysis(_0x2c9861),_0x113d16=(_0x3d2fc8[_0x1e2d3e(0xf0)]?[]:extractJoinFacts(_0x3d2fc8['sql']))[_0x1e2d3e(0xf6)](_0xe73750=>{const _0x3b7425=_0x1e2d3e;if(_0xe73750[_0x3b7425(0xbc)]||_0xe73750[_0x3b7425(0xbb)]['length']===0x0)return _0x48706f['push']({'code':_0x3b7425(0xc0),'table':_0xe73750['table'],'alias':_0xe73750[_0x3b7425(0xb1)],'columns':_0xe73750[_0x3b7425(0xbb)],'reason':_0xe73750[_0x3b7425(0xe3)]??_0x3b7425(0xea)}),{'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750[_0x3b7425(0xb1)],'columns':_0xe73750['columns'],'status':'unavailable'};const _0x220154=resolveTableMetadata(_0x5c3a4a,_0xe73750[_0x3b7425(0xf4)]),_0x5ee0c8=(_0x220154?.[_0x3b7425(0xdd)]??[])[_0x3b7425(0xf6)](_0x1b528e=>({'index':_0x1b528e,'matchedPrefix':findEqualityPrefix(_0x1b528e[_0x3b7425(0xbb)],_0xe73750['columns'])}))[_0x3b7425(0xec)](_0x5c35d5=>_0x5c35d5['matchedPrefix']['length']>0x0),_0x28d756=_0x5ee0c8[_0x3b7425(0xf7)]((_0x2e9ceb,_0x1d0daa)=>!_0x2e9ceb||_0x1d0daa[_0x3b7425(0xb4)][_0x3b7425(0xef)]>_0x2e9ceb[_0x3b7425(0xb4)][_0x3b7425(0xef)]?_0x1d0daa:_0x2e9ceb,_0x5ee0c8[0x0]);if(_0x28d756)return{'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750[_0x3b7425(0xb1)],'columns':_0xe73750['columns'],'status':_0x3b7425(0xd0),'matchedIndex':{..._0x28d756[_0x3b7425(0xf2)],'matchedPrefix':_0x28d756['matchedPrefix']}};const _0x226ca9=_0x220154?.[_0x3b7425(0xdd)]['filter'](_0x5c7ad4=>_0x5c7ad4['columns'][_0x3b7425(0xf1)](_0x2c9b15=>_0xe73750['columns'][_0x3b7425(0xf1)](_0x4053aa=>columnNamesMatch(_0x2c9b15,_0x4053aa))))??[];if(_0x226ca9['length']>0x0)return _0x48706f[_0x3b7425(0xee)]({'code':_0x3b7425(0xb5),'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750[_0x3b7425(0xb1)],'columns':_0xe73750['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750['alias'],'columns':_0xe73750[_0x3b7425(0xbb)],'status':_0x3b7425(0xe5),'candidateIndexes':_0x226ca9};if(_0x220154&&_0x220154[_0x3b7425(0xdc)]!==![]&&_0x220154[_0x3b7425(0xdd)][_0x3b7425(0xef)]>0x0&&_0xe73750['columns'][_0x3b7425(0xef)]>0x0)return _0x48706f[_0x3b7425(0xee)]({'code':'JOIN_INDEX_MISSING','table':_0xe73750['table'],'alias':_0xe73750[_0x3b7425(0xb1)],'columns':_0xe73750[_0x3b7425(0xbb)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750['alias'],'columns':_0xe73750['columns'],'status':'warning'};return _0x48706f[_0x3b7425(0xee)]({'code':_0x3b7425(0xe0),'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750[_0x3b7425(0xb1)],'columns':_0xe73750[_0x3b7425(0xbb)],'reason':_0x220154?_0x3b7425(0xce):_0x3b7425(0xb9)}),{'table':_0xe73750[_0x3b7425(0xf4)],'alias':_0xe73750['alias'],'columns':_0xe73750[_0x3b7425(0xbb)],'status':_0x3b7425(0xd9)};});return{'checked':_0x113d16[_0x1e2d3e(0xef)]>0x0,'joins':_0x113d16,'warnings':_0x48706f};}function extractJoinFacts(_0x35b6fd){const _0x2804a3=a290_0x2eb9,_0xed2455=maskNestedQueries(stripSqlNoise(_0x35b6fd)),_0xf30c77=maskQuotedIdentifiers(_0xed2455),_0x51c59e=[],_0x219675=new Set(),_0x1c148b=/\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 _0x37f882 of _0xed2455[_0x2804a3(0xd1)](_0x1c148b)){const _0x5df9cd=_0x37f882[_0x2804a3(0xf2)]??0x0,_0x47d1c0=_0x37f882[0x0][_0x2804a3(0xc3)](/\bJOIN\b/i),_0x320fd9=_0x5df9cd+Math[_0x2804a3(0xc8)](0x0,_0x47d1c0);if(!/^JOIN\b/i[_0x2804a3(0xca)](_0xf30c77[_0x2804a3(0xcf)](_0x320fd9)))continue;_0x219675[_0x2804a3(0xc6)](_0x320fd9);const _0x86d10f=normalizeIdentifier(_0x37f882[0x1]||_0x2804a3(0xe9)),_0xaa57c6=normalizeIdentifier(_0x37f882[0x2]??''),_0x485cf2=normalizeIdentifier(_0x37f882[0x3]||_0xaa57c6[_0x2804a3(0xc7)]('.')['at'](-0x1)||_0xaa57c6),_0x45b73c=[],_0x2713e8=_0xaa57c6===_0x2804a3(0xdf);let _0x207e2d=_0x86d10f===_0x2804a3(0xe1)||_0x86d10f==='full'||_0x2713e8,_0x497a19=_0x207e2d?_0x2713e8?_0x2804a3(0xb2):_0x86d10f[_0x2804a3(0xc9)]()+_0x2804a3(0xd8):undefined;const _0x2c6d0d=stripOuterParentheses(_0x37f882[0x4]??''),_0x25d54f=_0x2c6d0d[_0x2804a3(0xbf)](MYBATIS_DYNAMIC_START_MARKER)||_0x2c6d0d['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x56bdb8=_0x2c6d0d[_0x2804a3(0xbf)](MYBATIS_INCLUDE_MARKER);_0x25d54f&&(_0x207e2d=!![],_0x497a19??=_0x2804a3(0xd4));_0x56bdb8&&(_0x207e2d=!![],_0x497a19??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x26ed09=_0x2c6d0d[_0x2804a3(0xae)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x2804a3(0xae)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x2804a3(0xae)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x26ed09,'OR')&&(_0x207e2d=!![],_0x497a19??=_0x2804a3(0xb3));for(const _0x5c78e1 of splitTopLevelAnd(_0x26ed09)){const _0x307598=stripOuterParentheses(_0x5c78e1);if(hasTopLevelKeyword(_0x307598,'OR')){_0x207e2d=!![],_0x497a19??=_0x2804a3(0xb3);continue;}const _0x52fbd2=splitEquality(_0x307598);if(!_0x52fbd2){containsColumnReference(_0x5c78e1,_0x485cf2)&&(_0x207e2d=!![]);continue;}const _0x4f5d19=parseDirectColumnReference(_0x52fbd2[0x0],_0x485cf2),_0x42d22b=parseDirectColumnReference(_0x52fbd2[0x1],_0x485cf2),_0x116d12=containsColumnReference(_0x52fbd2[0x0],_0x485cf2),_0x12042f=containsColumnReference(_0x52fbd2[0x1],_0x485cf2),_0x22cfce=_0x4f5d19&&!_0x12042f?_0x4f5d19:_0x42d22b&&!_0x116d12?_0x42d22b:null;if(_0x22cfce&&!_0x45b73c[_0x2804a3(0xbf)](_0x22cfce))_0x45b73c[_0x2804a3(0xee)](_0x22cfce);else!_0x22cfce&&containsColumnReference(_0x5c78e1,_0x485cf2)&&(_0x207e2d=!![]);}_0x51c59e[_0x2804a3(0xee)]({'table':_0xaa57c6,'alias':_0x485cf2,'columns':_0x45b73c,'unsupportedPredicate':_0x207e2d,'unsupportedReason':_0x497a19,'containsUnresolvedInclude':_0x56bdb8,'position':_0x320fd9});}for(const _0x4b3dd2 of _0xf30c77[_0x2804a3(0xd1)](/\bJOIN\b/gi)){const _0x7db8d0=_0x4b3dd2['index']??0x0;if(_0x219675[_0x2804a3(0xf5)](_0x7db8d0))continue;const _0x5731b6=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x2804a3(0xad)](_0xed2455[_0x2804a3(0xcf)](_0x7db8d0+_0x4b3dd2[0x0][_0x2804a3(0xef)])),_0x38c731=normalizeIdentifier(_0x5731b6?.[0x1]||'unknown'),_0x351c61=normalizeIdentifier(_0x5731b6?.[0x2]||''),_0xdaccc1=isSqlClauseKeyword(_0x351c61)?_0x38c731[_0x2804a3(0xc7)]('.')['at'](-0x1)||_0x38c731:_0x351c61||_0x38c731[_0x2804a3(0xc7)]('.')['at'](-0x1)||_0x38c731;_0x51c59e[_0x2804a3(0xee)]({'table':_0x38c731,'alias':_0xdaccc1,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x7db8d0});}const _0x3bdb1c=_0xf30c77['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x3bdb1c>=0x0&&!_0x51c59e['some'](_0x2536d3=>_0x2536d3[_0x2804a3(0xeb)])&&_0x51c59e[_0x2804a3(0xee)]({'table':_0x2804a3(0xf3),'alias':_0x2804a3(0xf3),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x2804a3(0xaf),'containsUnresolvedInclude':!![],'position':_0x3bdb1c}),_0x51c59e[_0x2804a3(0xe2)]((_0x230840,_0x28c3c2)=>_0x230840[_0x2804a3(0xb0)]-_0x28c3c2[_0x2804a3(0xb0)]);}function stripSqlNoise(_0x594359){const _0x42579a=a290_0x2eb9,_0x7e405b=Array[_0x42579a(0xcd)](_0x594359),_0x39d8f9=(_0x1f6146,_0x5e5684)=>{for(let _0x5f2bec=_0x1f6146;_0x5f2bec<_0x5e5684;_0x5f2bec+=0x1){_0x7e405b[_0x5f2bec]!=='\x0a'&&_0x7e405b[_0x5f2bec]!=='\x0d'&&(_0x7e405b[_0x5f2bec]='\x20');}};for(let _0x32bd9c=0x0;_0x32bd9c<_0x7e405b[_0x42579a(0xef)];_0x32bd9c+=0x1){const _0x182c11=_0x7e405b[_0x32bd9c],_0xe24f0d=_0x7e405b[_0x32bd9c+0x1];if(_0x182c11==='\x27'||_0x182c11==='\x22'||_0x182c11==='`'){const _0x5bf275=_0x182c11,_0x256acb=_0x32bd9c;_0x32bd9c+=0x1;while(_0x32bd9c<_0x7e405b['length']){if(_0x7e405b[_0x32bd9c]==='\x5c'&&_0x32bd9c+0x1<_0x7e405b['length']){_0x32bd9c+=0x2;continue;}if(_0x7e405b[_0x32bd9c]!==_0x5bf275){_0x32bd9c+=0x1;continue;}if(_0x7e405b[_0x32bd9c+0x1]===_0x5bf275){_0x32bd9c+=0x2;continue;}break;}if(_0x5bf275==='\x27')_0x39d8f9(_0x256acb,Math[_0x42579a(0xcb)](_0x32bd9c+0x1,_0x7e405b['length']));continue;}if(_0x182c11==='-'&&_0xe24f0d==='-'){const _0x566dcd=_0x32bd9c;while(_0x32bd9c<_0x7e405b['length']&&_0x7e405b[_0x32bd9c]!=='\x0a')_0x32bd9c+=0x1;_0x39d8f9(_0x566dcd,_0x32bd9c);continue;}if(_0x182c11==='/'&&_0xe24f0d==='*'){const _0x19034b=_0x32bd9c;_0x32bd9c+=0x2;while(_0x32bd9c<_0x7e405b['length']&&!(_0x7e405b[_0x32bd9c]==='*'&&_0x7e405b[_0x32bd9c+0x1]==='/')){_0x32bd9c+=0x1;}_0x32bd9c=Math[_0x42579a(0xcb)](_0x32bd9c+0x1,_0x7e405b[_0x42579a(0xef)]-0x1),_0x39d8f9(_0x19034b,_0x32bd9c+0x1);continue;}if(_0x182c11==='#'&&_0xe24f0d!=='{'){const _0x1b0e3d=_0x32bd9c;while(_0x32bd9c<_0x7e405b[_0x42579a(0xef)]&&_0x7e405b[_0x32bd9c]!=='\x0a')_0x32bd9c+=0x1;_0x39d8f9(_0x1b0e3d,_0x32bd9c);continue;}if((_0x182c11==='#'||_0x182c11==='$')&&_0xe24f0d==='{'){const _0x1a7aee=_0x32bd9c;_0x32bd9c+=0x2;while(_0x32bd9c<_0x7e405b[_0x42579a(0xef)]&&_0x7e405b[_0x32bd9c]!=='}')_0x32bd9c+=0x1;_0x39d8f9(_0x1a7aee,Math[_0x42579a(0xcb)](_0x32bd9c+0x1,_0x7e405b['length']));}}return _0x7e405b['join']('');}function a290_0x2eb9(_0x509719,_0x4667e1){_0x509719=_0x509719-0xad;const _0x5c70c4=a290_0x5c70();let _0x2eb9fe=_0x5c70c4[_0x509719];return _0x2eb9fe;}function maskQuotedIdentifiers(_0xf22e21){const _0x4265a8=a290_0x2eb9,_0x36978a=Array[_0x4265a8(0xcd)](_0xf22e21);for(let _0x5eab0f=0x0;_0x5eab0f<_0x36978a['length'];_0x5eab0f+=0x1){const _0x8eeadb=_0x36978a[_0x5eab0f];if(_0x8eeadb!=='\x22'&&_0x8eeadb!=='`')continue;_0x5eab0f+=0x1;while(_0x5eab0f<_0x36978a[_0x4265a8(0xef)]){if(_0x36978a[_0x5eab0f]===_0x8eeadb){if(_0x36978a[_0x5eab0f+0x1]===_0x8eeadb){_0x36978a[_0x5eab0f]='\x20',_0x36978a[_0x5eab0f+0x1]='\x20',_0x5eab0f+=0x2;continue;}break;}_0x36978a[_0x5eab0f]='\x20',_0x5eab0f+=0x1;}}return _0x36978a[_0x4265a8(0xc1)]('');}function maskNestedQueries(_0x20490a){const _0x5e72ce=a290_0x2eb9,_0x265b4e=Array[_0x5e72ce(0xcd)](_0x20490a);for(let _0x960f3f=0x0;_0x960f3f<_0x265b4e['length'];_0x960f3f+=0x1){if(_0x265b4e[_0x960f3f]!=='(')continue;const _0x506d2c=_0x20490a['slice'](_0x960f3f+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x506d2c))continue;let _0x3facc7=0x1,_0x40e958=_0x960f3f+0x1;for(;_0x40e958<_0x265b4e['length']&&_0x3facc7>0x0;_0x40e958+=0x1){if(_0x265b4e[_0x40e958]==='(')_0x3facc7+=0x1;if(_0x265b4e[_0x40e958]===')')_0x3facc7-=0x1;}if(_0x3facc7!==0x0)continue;for(let _0x3ea920=_0x960f3f;_0x3ea920<_0x40e958;_0x3ea920+=0x1){_0x265b4e[_0x3ea920]='\x20';}const _0xab6c86=_0x5e72ce(0xdf);for(let _0x3c6ea8=0x0;_0x3c6ea8<_0xab6c86[_0x5e72ce(0xef)]&&_0x960f3f+_0x3c6ea8<_0x40e958;_0x3c6ea8+=0x1){_0x265b4e[_0x960f3f+_0x3c6ea8]=_0xab6c86[_0x3c6ea8];}_0x960f3f=_0x40e958-0x1;}return _0x265b4e[_0x5e72ce(0xc1)]('');}function splitTopLevelAnd(_0x6851c){const _0x404fc6=a290_0x2eb9,_0x353dd0=[];let _0x52d80d=0x0,_0x72c9d8=0x0;for(let _0x5d12ad=0x0;_0x5d12ad<_0x6851c[_0x404fc6(0xef)];_0x5d12ad+=0x1){const _0x423605=_0x6851c[_0x5d12ad];if(_0x423605==='(')_0x52d80d+=0x1;if(_0x423605===')')_0x52d80d=Math['max'](0x0,_0x52d80d-0x1);_0x52d80d===0x0&&_0x6851c[_0x404fc6(0xcf)](_0x5d12ad)[_0x404fc6(0xe6)](/^AND\b/i)&&(_0x5d12ad===0x0||/\s/[_0x404fc6(0xca)](_0x6851c[_0x5d12ad-0x1]??''))&&(_0x353dd0[_0x404fc6(0xee)](_0x6851c['slice'](_0x72c9d8,_0x5d12ad)['trim']()),_0x5d12ad+=0x2,_0x72c9d8=_0x5d12ad+0x1);}const _0xf83828=_0x6851c['slice'](_0x72c9d8)['trim']();if(_0xf83828)_0x353dd0['push'](_0xf83828);return _0x353dd0;}function hasTopLevelKeyword(_0x36b3a4,_0x339d9b){const _0x4f896b=a290_0x2eb9;let _0x3a1a57=0x0;for(let _0x3c8384=0x0;_0x3c8384<_0x36b3a4[_0x4f896b(0xef)];_0x3c8384+=0x1){const _0x9df949=_0x36b3a4[_0x3c8384];if(_0x9df949==='(')_0x3a1a57+=0x1;if(_0x9df949===')')_0x3a1a57=Math[_0x4f896b(0xc8)](0x0,_0x3a1a57-0x1);if(_0x3a1a57!==0x0)continue;const _0x435d8a=_0x36b3a4[_0x4f896b(0xcf)](_0x3c8384,_0x3c8384+_0x339d9b['length']),_0x5c918f=_0x36b3a4[_0x3c8384-0x1]??'\x20',_0x46768a=_0x36b3a4[_0x3c8384+_0x339d9b['length']]??'\x20';if(_0x435d8a['toUpperCase']()===_0x339d9b[_0x4f896b(0xc9)]()&&!/[\w$]/[_0x4f896b(0xca)](_0x5c918f)&&!/[\w$]/[_0x4f896b(0xca)](_0x46768a))return!![];}return![];}function splitEquality(_0x58180d){const _0x837efd=a290_0x2eb9,_0x49b860=stripOuterParentheses(_0x58180d);let _0x228b59=0x0,_0x340f63;for(let _0x381109=0x0;_0x381109<_0x49b860[_0x837efd(0xef)];_0x381109+=0x1){const _0x98aa66=_0x49b860[_0x381109];if(_0x98aa66==='(')_0x228b59+=0x1;if(_0x98aa66===')')_0x228b59=Math[_0x837efd(0xc8)](0x0,_0x228b59-0x1);const _0x4514bc=_0x49b860[_0x381109-0x1]??'',_0xaeb3bb=_0x49b860[_0x381109+0x1]??'';if(_0x98aa66==='='&&_0x228b59===0x0&&!/[!<>=:]/[_0x837efd(0xca)](_0x4514bc)&&_0xaeb3bb!=='='){if(_0x340f63!==undefined)return null;_0x340f63=_0x381109;}}return _0x340f63===undefined?null:[_0x49b860[_0x837efd(0xcf)](0x0,_0x340f63)[_0x837efd(0xd3)](),_0x49b860[_0x837efd(0xcf)](_0x340f63+0x1)[_0x837efd(0xd3)]()];}function parseDirectColumnReference(_0x28820c,_0x5d5bef){const _0x54b258=a290_0x2eb9,_0x5ed86c=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x54b258(0xad)](stripOuterParentheses(_0x28820c));if(!_0x5ed86c)return null;if(normalizeIdentifier(_0x5ed86c[0x1]??'')!==normalizeIdentifier(_0x5d5bef))return null;return normalizeIdentifier(_0x5ed86c[0x2]??'');}function containsColumnReference(_0x2b7bfe,_0x51c06b){const _0x2a64c5=a290_0x2eb9,_0x4f25d4=_0x2b7bfe['replace'](/[`"]/g,''),_0x188d3d=_0x51c06b[_0x2a64c5(0xcc)](/[.*+?^${}()|[\]\\]/g,_0x2a64c5(0xbe));return new RegExp(_0x2a64c5(0xe8)+_0x188d3d+_0x2a64c5(0xc5),'i')[_0x2a64c5(0xca)](_0x4f25d4);}function findEqualityPrefix(_0x1c5ea0,_0x367d4d){const _0x18601c=a290_0x2eb9,_0x5bf3ca=new Set(_0x367d4d[_0x18601c(0xf6)](normalizeIdentifier)),_0x3545b3=[];for(const _0x5ee159 of _0x1c5ea0){if(!_0x5bf3ca['has'](normalizeIdentifier(_0x5ee159)))break;_0x3545b3[_0x18601c(0xee)](_0x5ee159);}return _0x3545b3;}function resolveTableMetadata(_0x5d5e7d,_0x8fe0d0){const _0x3976d6=a290_0x2eb9,_0xfe4411=normalizeIdentifier(_0x8fe0d0),_0x2b4106=_0x5d5e7d['filter'](_0x56a51c=>normalizeIdentifier(_0x56a51c[_0x3976d6(0xb6)])===_0xfe4411);if(_0x2b4106[_0x3976d6(0xef)]===0x1)return _0x2b4106[0x0];const _0x242c3c=_0xfe4411[_0x3976d6(0xbf)]('.'),_0xf20f6b=_0xfe4411[_0x3976d6(0xc7)]('.')['at'](-0x1),_0x1a677b=_0x5d5e7d[_0x3976d6(0xec)](_0x490a70=>{const _0x116422=_0x3976d6,_0x4b4a60=normalizeIdentifier(_0x490a70[_0x116422(0xb6)]);if(_0x242c3c&&_0x4b4a60[_0x116422(0xbf)]('.'))return![];return _0x4b4a60[_0x116422(0xc7)]('.')['at'](-0x1)===_0xf20f6b;});return _0x1a677b[_0x3976d6(0xef)]===0x1?_0x1a677b[0x0]:undefined;}function columnNamesMatch(_0x4331b1,_0x5a490e){return normalizeIdentifier(_0x4331b1)===normalizeIdentifier(_0x5a490e);}function normalizeIdentifier(_0x3051ce){const _0x2f2e54=a290_0x2eb9;return _0x3051ce['replace'](/[`"]/g,'')[_0x2f2e54(0xd3)]()[_0x2f2e54(0xda)]();}function isSqlClauseKeyword(_0x847d4){const _0x2e8902=a290_0x2eb9;return new Set(['on',_0x2e8902(0xb7),_0x2e8902(0xd2),_0x2e8902(0xc1),_0x2e8902(0xd7),'left',_0x2e8902(0xe1),_0x2e8902(0xba),'cross','natural'])[_0x2e8902(0xf5)](_0x847d4);}function stripOuterParentheses(_0x1234d8){const _0x27e916=a290_0x2eb9;let _0x2fd468=_0x1234d8[_0x27e916(0xd3)]();while(_0x2fd468['startsWith']('(')&&_0x2fd468[_0x27e916(0xed)](')')){let _0x32cd36=0x0,_0x307875=!![];for(let _0x1ac9b1=0x0;_0x1ac9b1<_0x2fd468[_0x27e916(0xef)];_0x1ac9b1+=0x1){if(_0x2fd468[_0x1ac9b1]==='(')_0x32cd36+=0x1;if(_0x2fd468[_0x1ac9b1]===')')_0x32cd36-=0x1;if(_0x32cd36===0x0&&_0x1ac9b1<_0x2fd468[_0x27e916(0xef)]-0x1){_0x307875=![];break;}}if(!_0x307875||_0x32cd36!==0x0)break;_0x2fd468=_0x2fd468[_0x27e916(0xcf)](0x1,-0x1)[_0x27e916(0xd3)]();}return _0x2fd468;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a291_0x1f9108=a291_0x3747;function a291_0x3747(_0x1ea3d4,_0x50529a){_0x1ea3d4=_0x1ea3d4-0x170;const _0x4ae239=a291_0x4ae2();let _0x37473b=_0x4ae239[_0x1ea3d4];return _0x37473b;}(function(_0x1ab554,_0x4c8833){const _0x3eba73=a291_0x3747,_0x58a4de=_0x1ab554();while(!![]){try{const _0x29058d=-parseInt(_0x3eba73(0x170))/0x1*(parseInt(_0x3eba73(0x176))/0x2)+-parseInt(_0x3eba73(0x173))/0x3*(-parseInt(_0x3eba73(0x172))/0x4)+-parseInt(_0x3eba73(0x171))/0x5*(parseInt(_0x3eba73(0x17b))/0x6)+parseInt(_0x3eba73(0x17a))/0x7+parseInt(_0x3eba73(0x174))/0x8*(-parseInt(_0x3eba73(0x17e))/0x9)+parseInt(_0x3eba73(0x178))/0xa+parseInt(_0x3eba73(0x179))/0xb;if(_0x29058d===_0x4c8833)break;else _0x58a4de['push'](_0x58a4de['shift']());}catch(_0x21c513){_0x58a4de['push'](_0x58a4de['shift']());}}}(a291_0x4ae2,0x5e1c6));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a291_0x4ae2(){const _0x4c4736=['4PSpknd','.rabetbase','2055660kAVxjh','11751872OOPLOM','4927573mawxyG','1068918rhJysK','sql-trash','sql.lock.json','9kdcIMe','267510mCaJkA','10nhvdJR','56gyNYLz','3801jtyWsR','5750328XEBijX','/sql'];a291_0x4ae2=function(){return _0x4c4736;};return a291_0x4ae2();}const DOT_DIR=a291_0x1f9108(0x177),LOCK_FILE_NAME=a291_0x1f9108(0x17d),TRASH_DIR_NAME=a291_0x1f9108(0x17c);export function loadSqlProjectConfig(_0x13da16,_0x470d50){const _0x1ac1d1=a291_0x1f9108,_0x1fb0ee=resolve(_0x470d50??findProjectRootDirectory()),_0x2b31a2=DOT_DIR+_0x1ac1d1(0x175),_0x24373d=_0x2b31a2+'/'+_0x13da16;return{'projectRoot':_0x1fb0ee,'appCode':_0x13da16,'sqlWorkspaceRoot':_0x2b31a2,'sqlRoot':_0x24373d,'sqlRootDir':resolve(_0x1fb0ee,DOT_DIR,'sql',_0x13da16),'lockFilePath':resolve(_0x1fb0ee,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x1fb0ee,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58dd4a,_0xe695da){const _0x3cb97b=a292_0x1908,_0x56241d=_0x58dd4a();while(!![]){try{const _0x1bce10=parseInt(_0x3cb97b(0xce))/0x1*(parseInt(_0x3cb97b(0xd7))/0x2)+parseInt(_0x3cb97b(0xcb))/0x3+-parseInt(_0x3cb97b(0xcc))/0x4+-parseInt(_0x3cb97b(0xde))/0x5*(parseInt(_0x3cb97b(0xd4))/0x6)+parseInt(_0x3cb97b(0xd5))/0x7*(parseInt(_0x3cb97b(0xc5))/0x8)+parseInt(_0x3cb97b(0xd6))/0x9*(parseInt(_0x3cb97b(0xca))/0xa)+-parseInt(_0x3cb97b(0xdf))/0xb;if(_0x1bce10===_0xe695da)break;else _0x56241d['push'](_0x56241d['shift']());}catch(_0x20c35a){_0x56241d['push'](_0x56241d['shift']());}}}(a292_0x106f,0x9b93a));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';function a292_0x106f(){const _0xa04535=['indexOf','sql','push','2158554fycjnZ','1806966wXDNsD','1085319vyfHFB','114398wjgyZT','code','sqlRootDir','length','path','test','name','5LePmEe','19292460tqbZqI','filter','isFile','ENOENT','dbId','toLowerCase','24wJFloC','dbName','mode','slice','.sql','30mcEFJj','3336111JLKbna','1421392alRBaZ','sqlName','15cxpzpU','isDirectory','split'];a292_0x106f=function(){return _0xa04535;};return a292_0x106f();}function a292_0x1908(_0x1c400d,_0x4165e4){_0x1c400d=_0x1c400d-0xc3;const _0x106ff7=a292_0x106f();let _0x190892=_0x106ff7[_0x1c400d];return _0x190892;}import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x1aa342){const _0x5886ed=a292_0x1908;if(_0x1aa342===_0x5886ed(0xc9))return _0x5886ed(0xd2);if(_0x1aa342==='.xml')return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x561832,_0x4748d8){const _0x3c83aa=a292_0x1908,_0x260b52=[];try{const _0x592863=await readdir(_0x561832,{'withFileTypes':!![]});for(const _0x107c7a of _0x592863){const _0x142116=join(_0x561832,_0x107c7a[_0x3c83aa(0xdd)]);if(_0x107c7a[_0x3c83aa(0xcf)]()){_0x260b52[_0x3c83aa(0xd3)](...await scanSqlFilesRecursively(_0x142116,_0x4748d8));continue;}if(!_0x107c7a[_0x3c83aa(0xe1)]())continue;const _0x33852b=extname(_0x107c7a[_0x3c83aa(0xdd)])[_0x3c83aa(0xc4)](),_0x4bc77d=extensionToMode(_0x33852b);if(!_0x4bc77d)continue;const _0x523553=relative(_0x4748d8,_0x142116)['replace'](/\\/g,'/'),_0x3ea6b2=_0x523553[_0x3c83aa(0xd0)]('/')[_0x3c83aa(0xe0)](Boolean),_0x180248=parseSqlPath(_0x3ea6b2,_0x107c7a[_0x3c83aa(0xdd)],_0x33852b);if(!_0x180248)continue;_0x260b52[_0x3c83aa(0xd3)]({'sqlCode':_0x180248['sqlCode'],'sqlName':_0x180248['sqlName'],'dbDirectory':_0x3ea6b2[0x0],'filePath':_0x142116,'relativePath':_0x523553,'lockKey':_0x180248['sqlCode'],'mode':_0x4bc77d});}}catch(_0x43cde7){if(_0x43cde7[_0x3c83aa(0xd8)]!==_0x3c83aa(0xe2))throw _0x43cde7;}return _0x260b52;}export async function scanLocalSqlQueries(_0x5eab00){const _0x208a3e=a292_0x1908;return scanSqlFilesRecursively(_0x5eab00[_0x208a3e(0xd9)],_0x5eab00[_0x208a3e(0xd9)]);}export function resolveLocalSqlFilePath(_0x463241,_0x2c2248,_0x2ebab4){const _0x743343=a292_0x1908,_0x1ecc0a=_0x2ebab4?.[_0x743343(0xdb)]||(_0x2ebab4?.[_0x743343(0xcd)]||_0x2ebab4?.[_0x743343(0xc6)]?buildSqlRelativePath(_0x2c2248,_0x2ebab4?.[_0x743343(0xcd)],_0x2ebab4?.[_0x743343(0xc6)],_0x2ebab4?.[_0x743343(0xc7)]||'sql',_0x2ebab4?.[_0x743343(0xc3)]):buildDefaultSqlFileName(_0x2c2248,_0x2ebab4?.[_0x743343(0xc7)]||_0x743343(0xd2)));return join(_0x463241[_0x743343(0xd9)],_0x1ecc0a);}export async function directoryExists(_0x33076d){const _0x3d1d69=a292_0x1908;try{const _0x45d4a0=await stat(_0x33076d);return _0x45d4a0[_0x3d1d69(0xcf)]();}catch{return![];}}function parseSqlPath(_0x3b9915,_0x53fd27,_0x490e4b){const _0x4e393b=a292_0x1908,_0x4b18a2=_0x53fd27['slice'](0x0,-_0x490e4b[_0x4e393b(0xda)]);if(_0x3b9915[_0x4e393b(0xda)]<0x2)return null;const _0x40a0df=_0x4b18a2[_0x4e393b(0xd1)]('_');if(_0x40a0df<=0x0||_0x40a0df>=_0x4b18a2['length']-0x1)return null;const _0x554500=_0x4b18a2[_0x4e393b(0xc8)](0x0,_0x40a0df);if(!isLikelySqlCode(_0x554500))return null;return{'sqlCode':_0x554500,'sqlName':_0x4b18a2[_0x4e393b(0xc8)](_0x40a0df+0x1)};}function isLikelySqlCode(_0x96bfda){const _0x42ede6=a292_0x1908;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x42ede6(0xdc)](_0x96bfda);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3d28f6,_0x1620d9){const _0x51a279=a293_0x50af,_0x4a4913=_0x3d28f6();while(!![]){try{const _0x22ec5e=-parseInt(_0x51a279(0x1aa))/0x1*(-parseInt(_0x51a279(0x1b0))/0x2)+parseInt(_0x51a279(0x1b6))/0x3*(parseInt(_0x51a279(0x1a9))/0x4)+-parseInt(_0x51a279(0x1ab))/0x5+parseInt(_0x51a279(0x1af))/0x6*(-parseInt(_0x51a279(0x1b5))/0x7)+-parseInt(_0x51a279(0x1b1))/0x8*(-parseInt(_0x51a279(0x1b9))/0x9)+parseInt(_0x51a279(0x1ae))/0xa*(parseInt(_0x51a279(0x1b3))/0xb)+parseInt(_0x51a279(0x1b2))/0xc*(-parseInt(_0x51a279(0x1ac))/0xd);if(_0x22ec5e===_0x1620d9)break;else _0x4a4913['push'](_0x4a4913['shift']());}catch(_0x565195){_0x4a4913['push'](_0x4a4913['shift']());}}}(a293_0x4d8c,0x94d28));import{readFile}from'node:fs/promises';import a293_0x344cbe from'node:crypto';function a293_0x50af(_0x2b4460,_0x304eba){_0x2b4460=_0x2b4460-0x1a9;const _0x4d8cfe=a293_0x4d8c();let _0x50afc7=_0x4d8cfe[_0x2b4460];return _0x50afc7;}function a293_0x4d8c(){const _0x2ac694=['digest','createHash','2120067zdODCx','952fAGakM','173981Xtyjnq','56820YXyGhP','2882932lQkecg','md5','11290XvCeSQ','6wKauuE','4OzKfVj','16DCmvYw','24myBspU','2827LlJJvK','utf8','1186395uzYIxm','1572Ermkyf'];a293_0x4d8c=function(){return _0x2ac694;};return a293_0x4d8c();}export function computeSqlContentHash(_0x11a3a1){const _0x155941=a293_0x50af;return a293_0x344cbe[_0x155941(0x1b8)](_0x155941(0x1ad))['update'](_0x11a3a1)[_0x155941(0x1b7)]('hex');}export async function computeSqlFileHash(_0x3b4caa){const _0x2318cc=a293_0x50af,_0x1db646=await readFile(_0x3b4caa,_0x2318cc(0x1b4));return computeSqlContentHash(_0x1db646);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d38e3,_0xe35c6a){const _0x570a1a=a294_0x20f4,_0x4a196d=_0x4d38e3();while(!![]){try{const _0x34ed53=parseInt(_0x570a1a(0x76))/0x1*(-parseInt(_0x570a1a(0x7a))/0x2)+parseInt(_0x570a1a(0x7f))/0x3*(parseInt(_0x570a1a(0x89))/0x4)+parseInt(_0x570a1a(0x87))/0x5*(parseInt(_0x570a1a(0x88))/0x6)+parseInt(_0x570a1a(0x79))/0x7+parseInt(_0x570a1a(0x83))/0x8+parseInt(_0x570a1a(0x77))/0x9+-parseInt(_0x570a1a(0x7e))/0xa;if(_0x34ed53===_0xe35c6a)break;else _0x4a196d['push'](_0x4a196d['shift']());}catch(_0x5e763b){_0x4a196d['push'](_0x4a196d['shift']());}}}(a294_0x2834,0x25988));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a294_0x20f4(_0x2f64ce,_0x18ad90){_0x2f64ce=_0x2f64ce-0x75;const _0x283422=a294_0x2834();let _0x20f46a=_0x283422[_0x2f64ce];return _0x20f46a;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x16979e,_0x1e5319,_0xff8bb4,_0x2b4dd8){const _0x5dcfda=a294_0x20f4,_0x15f922=_0x16979e??createEmptySqlLock();let _0x12aab1=_0x15f922['apps'][_0x1e5319];if(!_0x12aab1)return _0x12aab1={'sqlRoot':_0xff8bb4,'lastSync':'','sqls':{}},_0x15f922[_0x5dcfda(0x7d)][_0x1e5319]=_0x12aab1,{'lockData':_0x15f922,'appLock':_0x12aab1};if(!_0x12aab1[_0x5dcfda(0x85)])_0x12aab1[_0x5dcfda(0x85)]=_0xff8bb4;else{if(_0x12aab1['sqlRoot']!==_0xff8bb4)throw new Error(_0x2b4dd8+_0x5dcfda(0x80)+_0xff8bb4+_0x5dcfda(0x75)+_0x12aab1[_0x5dcfda(0x85)]+_0x5dcfda(0x86)+_0x5dcfda(0x8b));}return!_0x12aab1['sqls']&&(_0x12aab1[_0x5dcfda(0x78)]={}),!_0x12aab1[_0x5dcfda(0x81)]&&(_0x12aab1[_0x5dcfda(0x81)]=''),{'lockData':_0x15f922,'appLock':_0x12aab1};}function a294_0x2834(){const _0x14ab76=['2340040udlXfs','code','sqlRoot','\x22.\x20','149115csbNXo','18Chvsvt','4036BOCNda','stringify','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','\x22\x20vs\x20lock\x20\x22','127703uBkPcs','571968kGuZbU','sqls','504854jkfPZy','4Jpkxkd','utf8','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','apps','3050050HLVkdk','585nGWgXZ',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','lastSync','ENOENT'];a294_0x2834=function(){return _0x14ab76;};return a294_0x2834();}export async function readSqlLockFile(_0x3846a0){const _0x1cc7bb=a294_0x20f4;try{const _0x4e5d62=await readFile(_0x3846a0,'utf8');return JSON['parse'](_0x4e5d62);}catch(_0x1a9bb5){if(_0x1a9bb5[_0x1cc7bb(0x84)]===_0x1cc7bb(0x82))return null;throw new Error(_0x1cc7bb(0x7c)+String(_0x1a9bb5));}}export async function writeSqlLockFile(_0x562e99,_0x28a6e2){const _0x5200ac=a294_0x20f4;await mkdir(dirname(_0x562e99),{'recursive':!![]}),await writeFile(_0x562e99,JSON[_0x5200ac(0x8a)](_0x28a6e2,null,0x2),_0x5200ac(0x7b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x371dbb,_0x17568b){const _0x2ba1f4=a296_0x2ca3,_0x456e24=_0x371dbb();while(!![]){try{const _0x456bda=parseInt(_0x2ba1f4(0x13a))/0x1*(-parseInt(_0x2ba1f4(0x13d))/0x2)+parseInt(_0x2ba1f4(0x13b))/0x3+-parseInt(_0x2ba1f4(0x13e))/0x4+-parseInt(_0x2ba1f4(0x138))/0x5+parseInt(_0x2ba1f4(0x143))/0x6+parseInt(_0x2ba1f4(0x13c))/0x7*(-parseInt(_0x2ba1f4(0x13f))/0x8)+parseInt(_0x2ba1f4(0x140))/0x9;if(_0x456bda===_0x17568b)break;else _0x456e24['push'](_0x456e24['shift']());}catch(_0x5a0ac0){_0x456e24['push'](_0x456e24['shift']());}}}(a296_0xbd96,0xb9602));function a296_0x2ca3(_0x4315d1,_0x5cd3fd){_0x4315d1=_0x4315d1-0x136;const _0xbd9666=a296_0xbd96();let _0x2ca3e6=_0xbd9666[_0x4315d1];return _0x2ca3e6;}import{detectSqlSourceMode}from'../../core/sql-validator.js';export function detectSqlMode(_0x1984e9){return detectSqlSourceMode(_0x1984e9);}export function getSqlFileExtension(_0x71c9be){const _0x277c44=a296_0x2ca3;return _0x71c9be===_0x277c44(0x139)?_0x277c44(0x142):'.sql';}function a296_0xbd96(){const _0x1aad3a=['2155640IUcgRt','81368TPaQdA','2425248goIOcF','replace','.xml','7575666QfMdPm','trim','db-','2818545aJXMga','mybatisXml','11iBGsSb','4207350yZVXJT','721dxcsgB','4546KNFoBz'];a296_0xbd96=function(){return _0x1aad3a;};return a296_0xbd96();}export function buildDefaultSqlFileName(_0x4f9dc0,_0x1c85d6){return''+_0x4f9dc0+getSqlFileExtension(_0x1c85d6);}export function sanitizeSqlPathSegment(_0x29d0fe,_0x1292cd){const _0xf062ed=a296_0x2ca3,_0x5de15e=String(_0x29d0fe??'')[_0xf062ed(0x136)](),_0x20e926=_0x5de15e[_0xf062ed(0x141)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0xf062ed(0x141)](/\s+/g,'-')['replace'](/-+/g,'-')[_0xf062ed(0x141)](/^\.+/,'')['replace'](/\.+$/,'')[_0xf062ed(0x141)](/^-+/,'')[_0xf062ed(0x141)](/-+$/,'');return _0x20e926||_0x1292cd;}export function buildDbDirectoryName(_0x4db8dc,_0x45e6b8){const _0x12ab7c=a296_0x2ca3;return sanitizeSqlPathSegment(_0x4db8dc,_0x45e6b8!=null?_0x12ab7c(0x137)+_0x45e6b8:'unknown-db');}export function buildSqlRelativePath(_0xfd6917,_0x96561f,_0x58eb52,_0x54b6a8,_0x4e0748){const _0x3b4713=buildDbDirectoryName(_0x58eb52,_0x4e0748),_0x28e974=sanitizeSqlPathSegment(_0xfd6917,'unknown-sql'),_0x34c918=sanitizeSqlPathSegment(_0x96561f,_0x28e974);return _0x3b4713+'/'+_0x28e974+'_'+_0x34c918+getSqlFileExtension(_0x54b6a8);}
|