@lovrabet/rabetbase-cli 2.5.2 → 2.5.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +2 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.d.ts +23 -0
- package/lib/config/region-config.js +1 -0
- package/lib/config/schema.d.ts +15 -0
- 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.d.ts +6 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +13 -0
- 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/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.d.ts +6 -0
- package/lib/core/page/lr-smart-jsx.js +1 -0
- 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/types/index.d.ts +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.d.ts +2 -8
- 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.d.ts +2 -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 +6 -5
- package/skills/rabetbase/guides/page-development-workflow.md +3 -0
- package/skills/rabetbase/guides/sdk-client-generation.md +5 -5
- package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
- package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
- package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
- package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-pull.md +2 -0
- package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
- package/skills/rabetbase/references/rabetbase-config.md +10 -9
- package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
- package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/generate-api/client.ts.tpl +1 -1
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c6b2d,_0x3f6f30){const _0x45926e=a253_0x3bcd,_0x348294=_0x2c6b2d();while(!![]){try{const _0x1f6567=parseInt(_0x45926e(0x12f))/0x1*(parseInt(_0x45926e(0x11b))/0x2)+parseInt(_0x45926e(0x131))/0x3*(-parseInt(_0x45926e(0x13b))/0x4)+-parseInt(_0x45926e(0x127))/0x5*(parseInt(_0x45926e(0x12b))/0x6)+parseInt(_0x45926e(0x123))/0x7*(parseInt(_0x45926e(0x11c))/0x8)+-parseInt(_0x45926e(0x126))/0x9+-parseInt(_0x45926e(0x122))/0xa+parseInt(_0x45926e(0x135))/0xb;if(_0x1f6567===_0x3f6f30)break;else _0x348294['push'](_0x348294['shift']());}catch(_0x412d16){_0x348294['push'](_0x348294['shift']());}}}(a253_0x18b5,0x8511f));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x20901b){const _0x3290ef=a253_0x3bcd;if(cache[_0x3290ef(0x124)](_0x20901b))return cache['get'](_0x20901b);const _0x3e70ac=await listDatasets(_0x20901b),_0x49d175=new Map();for(const _0xfb78f5 of _0x3e70ac){const _0x338318=_0xfb78f5[_0x3290ef(0x13a)];_0x338318?.[_0x3290ef(0x136)]!=null&&_0x49d175[_0x3290ef(0x130)](_0x338318[_0x3290ef(0x136)],_0x338318[_0x3290ef(0x128)]??_0x3290ef(0x121)+_0x338318['dbId']);}const _0x4cacbb=[..._0x49d175[_0x3290ef(0x120)]()][_0x3290ef(0x11d)](([_0x38cd71,_0x1a1808])=>({'dbId':_0x38cd71,'dbName':_0x1a1808}));return cache[_0x3290ef(0x130)](_0x20901b,_0x4cacbb),_0x4cacbb;}export async function resolveDb(_0x1d8429,_0xb5438f){const _0x4218d0=a253_0x3bcd,_0x1c1a44=await listDatabases(_0x1d8429);if(_0x1c1a44['length']===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x1d8429+_0x4218d0(0x11f)};if(!_0xb5438f)return{'resolved':_0x1c1a44};const _0x6556f4=Number(_0xb5438f);if(!Number[_0x4218d0(0x12e)](_0x6556f4)){const _0x3f35df=_0x1c1a44[_0x4218d0(0x137)](_0xbba03a=>_0xbba03a[_0x4218d0(0x136)]===_0x6556f4);if(_0x3f35df)return{'resolved':[_0x3f35df]};}const _0x536340=_0xb5438f[_0x4218d0(0x125)](),_0x38ab91=_0x1c1a44[_0x4218d0(0x134)](_0x4ab77d=>_0x4ab77d[_0x4218d0(0x128)][_0x4218d0(0x125)]()[_0x4218d0(0x139)](_0x536340));if(_0x38ab91['length']>0x0)return{'resolved':_0x38ab91};const _0x12493f=_0x1c1a44[_0x4218d0(0x11d)](_0x55c707=>_0x55c707[_0x4218d0(0x128)]+'\x20('+_0x55c707[_0x4218d0(0x136)]+')')[_0x4218d0(0x11e)](',\x20');return{'resolved':[],'error':_0x4218d0(0x12d)+_0xb5438f+_0x4218d0(0x133)+_0x1d8429+_0x4218d0(0x129)+_0x12493f+_0x4218d0(0x132)};}function a253_0x3bcd(_0x2cdab7,_0x4f3c0b){_0x2cdab7=_0x2cdab7-0x11b;const _0x18b5e3=a253_0x18b5();let _0x3bcd82=_0x18b5e3[_0x2cdab7];return _0x3bcd82;}function a253_0x18b5(){const _0x3fa6af=['543TqWOHT','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','\x22\x20under\x20app\x20\x22','filter','24832929VLUfdV','dbId','find','length','includes','dbtableConfig','23516PFXqeR','2996sMicnX','8AsOelF','map','join','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','entries','db-','6491890TEdfmd','3217438NULxpG','has','toLowerCase','8203140KcJcYq','60QrPQlv','dbName','\x22.\x20Available:\x20','\x22\x20matches\x20multiple\x20databases:\x20','15612ApIOjd','.\x20Be\x20more\x20specific.','No\x20database\x20matching\x20\x22','isNaN','323NvoFhL','set'];a253_0x18b5=function(){return _0x3fa6af;};return a253_0x18b5();}export async function resolveOneDb(_0x487275,_0x365c10){const _0xdab84e=a253_0x3bcd,{resolved:_0x24f0d3,error:_0x3ec64b}=await resolveDb(_0x487275,_0x365c10);if(_0x3ec64b)return{'db':null,'error':_0x3ec64b};if(_0x24f0d3[_0xdab84e(0x138)]===0x1)return{'db':_0x24f0d3[0x0]};if(!_0x365c10){const _0x4b98bf=_0x24f0d3[_0xdab84e(0x11d)](_0x4c0141=>_0x4c0141[_0xdab84e(0x128)]+'\x20('+_0x4c0141[_0xdab84e(0x136)]+')')[_0xdab84e(0x11e)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x4b98bf};}const _0x5edf78=_0x24f0d3[_0xdab84e(0x11d)](_0x36758e=>_0x36758e[_0xdab84e(0x128)]+'\x20('+_0x36758e[_0xdab84e(0x136)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x365c10+_0xdab84e(0x12a)+_0x5edf78+_0xdab84e(0x12c)};}export async function getDbName(_0x363965,_0x4367f2){const _0x403d2d=a253_0x3bcd,_0x11b9cb=await listDatabases(_0x363965);return _0x11b9cb[_0x403d2d(0x137)](_0x432125=>_0x432125[_0x403d2d(0x136)]===_0x4367f2)?.[_0x403d2d(0x128)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a254_0x5b85ae=a254_0x1120;(function(_0x3c5483,_0x14be46){const _0x1e44b0=a254_0x1120,_0x2d7204=_0x3c5483();while(!![]){try{const _0x2c380c=parseInt(_0x1e44b0(0x1bb))/0x1*(-parseInt(_0x1e44b0(0x1de))/0x2)+-parseInt(_0x1e44b0(0x19f))/0x3+-parseInt(_0x1e44b0(0x1c1))/0x4+-parseInt(_0x1e44b0(0x1d7))/0x5+parseInt(_0x1e44b0(0x1ad))/0x6+-parseInt(_0x1e44b0(0x1cf))/0x7+-parseInt(_0x1e44b0(0x1c0))/0x8*(-parseInt(_0x1e44b0(0x1db))/0x9);if(_0x2c380c===_0x14be46)break;else _0x2d7204['push'](_0x2d7204['shift']());}catch(_0x3d5598){_0x2d7204['push'](_0x2d7204['shift']());}}}(a254_0x1473,0xf20e6));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=a254_0x5b85ae(0x1ce);export const INSTANT_API_POLICY_FILE_NAME=a254_0x5b85ae(0x1d5);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x24d3cb,_0x2226b5,_0x381ea6){return new CliError(_0x24d3cb,0x1,_0x2226b5,_0x381ea6);}export function loadInstantApiPolicyLocalConfig(_0x267704,_0x239797){assertSafeAppCode(_0x267704);const _0x429125=resolve(_0x239797??findProjectRootDirectory()),_0x28b86d=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x267704+'/'+INSTANT_API_POLICY_FILE_NAME,_0x4afd3f=resolve(_0x429125,INSTANT_API_POLICY_RELATIVE_ROOT,_0x267704),_0x4cab04=resolve(_0x4afd3f,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x429125,'appCode':_0x267704,'policyRoot':_0x4afd3f,'policyFilePath':_0x4cab04,'policyRelativePath':_0x28b86d};}export function createDefaultInstantApiPolicyConfig(_0x3bcd29,_0x456243='allow'){return assertSafeAppCode(_0x3bcd29),{'version':'1','appCode':_0x3bcd29,'defaults':{'instantApi':_0x456243},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x572ee6){const _0x2e2e29=a254_0x5b85ae;let _0x381b1e;try{_0x381b1e=await stat(_0x572ee6['policyFilePath']);}catch(_0xa47215){throw instantApiPolicyError(_0x2e2e29(0x1b5),_0x2e2e29(0x1cd)+_0x572ee6[_0x2e2e29(0x1b9)],_0x2e2e29(0x1b2));}if(!_0x381b1e[_0x2e2e29(0x1c5)]())throw instantApiPolicyError(_0x2e2e29(0x19e),_0x2e2e29(0x1a0)+_0x572ee6['policyFilePath']);if(_0x381b1e[_0x2e2e29(0x1ab)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x2e2e29(0x1a1),_0x2e2e29(0x1b4));let _0x49988f;try{_0x49988f=await readFile(_0x572ee6[_0x2e2e29(0x1b9)]);}catch{throw instantApiPolicyError('instant_api_policy_file_unreadable','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'+_0x572ee6[_0x2e2e29(0x1b9)]);}if(_0x49988f[_0x2e2e29(0x1b8)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2e2e29(0x1b4));let _0x3a798f;try{_0x3a798f=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x2e2e29(0x1d4)](_0x49988f);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x2e2e29(0x1ac)+_0x572ee6['policyFilePath']);}let _0x2adddd;try{_0x2adddd=JSON[_0x2e2e29(0x1b6)](_0x3a798f);}catch{throw instantApiPolicyError(_0x2e2e29(0x1c2),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x572ee6[_0x2e2e29(0x1b9)]);}return assertLocalPolicyContract(_0x2adddd,_0x572ee6[_0x2e2e29(0x1d8)]);}function a254_0x1120(_0x48a1af,_0x19d38a){_0x48a1af=_0x48a1af-0x19e;const _0x147323=a254_0x1473();let _0x112004=_0x147323[_0x48a1af];return _0x112004;}export async function writeInstantApiPolicyConfigFile(_0x54ce82,_0x55b4fa,_0x502dfb={}){const _0x5d684b=a254_0x5b85ae,_0x2938e6=assertLocalPolicyContract(_0x55b4fa,_0x54ce82[_0x5d684b(0x1d8)]),_0x343d7c=JSON['stringify'](_0x2938e6,null,0x2)+'\x0a';if(Buffer['byteLength'](_0x343d7c,_0x5d684b(0x1dc))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x5d684b(0x1b4));await mkdir(_0x54ce82[_0x5d684b(0x1a6)],{'recursive':!![]});let _0x57dd79;try{_0x57dd79=await readFile(_0x54ce82[_0x5d684b(0x1b9)],_0x5d684b(0x1dc));}catch(_0x12aaa1){if(!isMissingFile(_0x12aaa1))throw instantApiPolicyError(_0x5d684b(0x1cb),_0x5d684b(0x1a8)+_0x54ce82[_0x5d684b(0x1b9)]);}if(_0x57dd79===_0x343d7c)return{'action':_0x5d684b(0x1a2),'filePath':_0x54ce82[_0x5d684b(0x1b9)]};if(_0x57dd79!==undefined&&!_0x502dfb['force'])throw instantApiPolicyError('instant_api_policy_file_exists',_0x5d684b(0x1bf)+_0x54ce82['policyFilePath'],_0x5d684b(0x1cc));if(_0x57dd79===undefined)try{return await writeFile(_0x54ce82[_0x5d684b(0x1b9)],_0x343d7c,{'encoding':_0x5d684b(0x1dc),'flag':'wx'}),{'action':_0x5d684b(0x1c8),'filePath':_0x54ce82[_0x5d684b(0x1b9)]};}catch(_0x549a53){if(!isAlreadyExists(_0x549a53))throw instantApiPolicyError('instant_api_policy_file_unwritable','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x54ce82['policyFilePath']);if(!_0x502dfb[_0x5d684b(0x1ae)])throw instantApiPolicyError(_0x5d684b(0x1c6),_0x5d684b(0x1d9)+_0x54ce82[_0x5d684b(0x1b9)],_0x5d684b(0x1b1));}const _0x58efa2=resolve(dirname(_0x54ce82[_0x5d684b(0x1b9)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x5d684b(0x1c9)]+'.'+randomUUID()+_0x5d684b(0x1a3));try{await writeFile(_0x58efa2,_0x343d7c,{'encoding':_0x5d684b(0x1dc),'flag':'wx'}),await rename(_0x58efa2,_0x54ce82[_0x5d684b(0x1b9)]);}catch{await unlink(_0x58efa2)[_0x5d684b(0x1d1)](()=>undefined);throw instantApiPolicyError(_0x5d684b(0x1d0),_0x5d684b(0x1a7)+_0x54ce82[_0x5d684b(0x1b9)]);}return{'action':_0x5d684b(0x1b0),'filePath':_0x54ce82[_0x5d684b(0x1b9)]};}function assertSafeAppCode(_0x5ba928){const _0x58047a=a254_0x5b85ae,_0x1539a6=_0x5ba928[_0x58047a(0x1b3)]();if(!_0x1539a6||_0x1539a6!==_0x5ba928||_0x1539a6['length']>0x64||_0x1539a6==='.'||_0x1539a6==='..'||_0x1539a6[_0x58047a(0x1b7)]('/')||_0x1539a6[_0x58047a(0x1b7)]('\x5c')||_0x1539a6[_0x58047a(0x1b7)]('\x00'))throw instantApiPolicyError(_0x58047a(0x1dd),'appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.');}function a254_0x1473(){const _0x4ba127=['instant_api_policy_file_too_large','unchanged','.tmp','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_version_invalid','policyRoot','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','instantApi','code','size','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','7695558UAPFux','force','defaults','overwritten','Review\x20the\x20file\x20before\x20retrying.','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','trim','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_missing','parse','includes','byteLength','policyFilePath','instant_api_policy_rules_invalid','6150ZVSRic','rules','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','instant_api_policy_defaults_invalid','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','5448uvHcSp','6846804mIGFTC','instant_api_policy_json_invalid','isArray','string','isFile','instant_api_policy_file_exists','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','created','pid','object','instant_api_policy_file_unreadable','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','.rabetbase/instant-api-policy','10657983fPBOmc','instant_api_policy_file_unwritable','catch','version','ENOENT','decode','policy.json','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22.','3773165SeCJNM','appCode','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','73323aSRoMD','utf8','instant_api_policy_app_code_invalid','486LMbepI','instant_api_policy_file_invalid','1067655ujcrvS','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'];a254_0x1473=function(){return _0x4ba127;};return a254_0x1473();}function assertLocalPolicyContract(_0x263db8,_0x4c5f65){const _0x1abc3b=a254_0x5b85ae;if(!isObject(_0x263db8))throw instantApiPolicyError(_0x1abc3b(0x1c2),_0x1abc3b(0x1da));if(_0x263db8[_0x1abc3b(0x1d2)]!=='1')throw instantApiPolicyError(_0x1abc3b(0x1a5),_0x1abc3b(0x1d6),_0x1abc3b(0x1bd));if(_0x263db8[_0x1abc3b(0x1d8)]!==_0x4c5f65)throw instantApiPolicyError('instant_api_policy_app_code_mismatch',_0x1abc3b(0x1c7)+_0x4c5f65+'.');if(!isObject(_0x263db8[_0x1abc3b(0x1af)])||typeof _0x263db8[_0x1abc3b(0x1af)][_0x1abc3b(0x1a9)]!==_0x1abc3b(0x1c4))throw instantApiPolicyError(_0x1abc3b(0x1be),_0x1abc3b(0x1a4));if(_0x263db8[_0x1abc3b(0x1bc)]!==undefined&&_0x263db8[_0x1abc3b(0x1bc)]!==null&&!Array['isArray'](_0x263db8[_0x1abc3b(0x1bc)]))throw instantApiPolicyError(_0x1abc3b(0x1ba),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x263db8;}function isObject(_0x366dbe){const _0x1c91e3=a254_0x5b85ae;return _0x366dbe!==null&&typeof _0x366dbe==='object'&&!Array[_0x1c91e3(0x1c3)](_0x366dbe);}function isMissingFile(_0x9afe74){const _0x6d7aea=a254_0x5b85ae;return Boolean(_0x9afe74&&typeof _0x9afe74===_0x6d7aea(0x1ca)&&_0x9afe74[_0x6d7aea(0x1aa)]===_0x6d7aea(0x1d3));}function isAlreadyExists(_0xaaee9e){const _0x3227b2=a254_0x5b85ae;return Boolean(_0xaaee9e&&typeof _0xaaee9e===_0x3227b2(0x1ca)&&_0xaaee9e[_0x3227b2(0x1aa)]==='EEXIST');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a255_0x40ba7e=a255_0x4819;(function(_0x379f18,_0x3d34a3){const _0x3253b3=a255_0x4819,_0xc7edde=_0x379f18();while(!![]){try{const _0x2d9198=-parseInt(_0x3253b3(0xd0))/0x1*(parseInt(_0x3253b3(0xe6))/0x2)+-parseInt(_0x3253b3(0xde))/0x3*(parseInt(_0x3253b3(0xf4))/0x4)+-parseInt(_0x3253b3(0xcf))/0x5+parseInt(_0x3253b3(0xe5))/0x6+-parseInt(_0x3253b3(0xf9))/0x7*(parseInt(_0x3253b3(0xf6))/0x8)+-parseInt(_0x3253b3(0xea))/0x9*(parseInt(_0x3253b3(0xc3))/0xa)+-parseInt(_0x3253b3(0xb7))/0xb*(-parseInt(_0x3253b3(0x102))/0xc);if(_0x2d9198===_0x3d34a3)break;else _0xc7edde['push'](_0xc7edde['shift']());}catch(_0x31bcd6){_0xc7edde['push'](_0xc7edde['shift']());}}}(a255_0x47a5,0x9dcd5));import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a255_0x40ba7e(0xcd),a255_0x40ba7e(0xcb),a255_0x40ba7e(0xda),a255_0x40ba7e(0xfd),a255_0x40ba7e(0xe8)],HIT_KEYS=[a255_0x40ba7e(0xb6),a255_0x40ba7e(0xeb),a255_0x40ba7e(0xe4),'scope',a255_0x40ba7e(0xc8),a255_0x40ba7e(0xdb),a255_0x40ba7e(0xf1),a255_0x40ba7e(0xbc),a255_0x40ba7e(0xc0),'finalScore',a255_0x40ba7e(0xec)];function a255_0x4819(_0x40214d,_0x55bbe4){_0x40214d=_0x40214d-0xb6;const _0x47a504=a255_0x47a5();let _0x4819e2=_0x47a504[_0x40214d];return _0x4819e2;}export async function searchDevelopmentKnowledge(_0x59737c){const _0x333f1d=a255_0x40ba7e,_0x37a00e=_0x59737c[_0x333f1d(0xf0)]['trim'](),_0x4127d0=_0x59737c['query'][_0x333f1d(0xca)]();if(!_0x37a00e)throw CliErrors[_0x333f1d(0xfb)](_0x333f1d(0xe3));if(!_0x59737c[_0x333f1d(0xf3)][_0x333f1d(0xca)]())throw CliErrors[_0x333f1d(0xfc)]();if(!_0x4127d0)throw CliErrors[_0x333f1d(0xfb)](_0x333f1d(0xe7));validateTopK(_0x59737c['topK']);const _0x56997a=getKbDomain()+_0x333f1d(0xee);let _0x51f326;try{_0x51f326=await fetch(_0x56997a,{'method':_0x333f1d(0xbe),'headers':{'Content-Type':'application/json','Cookie':_0x59737c[_0x333f1d(0xf3)],'X-Invoke-Source':_0x333f1d(0xd6)},'body':JSON['stringify']({'appCode':_0x37a00e,'query':_0x4127d0,..._0x59737c['topK']!==undefined?{'topK':_0x59737c['topK']}:{}}),'signal':_0x59737c['signal']});}catch(_0x79ba1a){if(_0x79ba1a instanceof CliError)throw _0x79ba1a;if(_0x79ba1a instanceof Error&&_0x79ba1a['name']==='AbortError')throw _0x79ba1a;throw CliErrors[_0x333f1d(0xcc)]('SmartCode\x20knowledge\x20search\x20request\x20failed.');}if(!hasNoStore(_0x51f326['headers']))throw CliErrors[_0x333f1d(0xbd)](_0x333f1d(0xd9));if(_0x51f326[_0x333f1d(0xd3)]===0x191)throw CliErrors[_0x333f1d(0xfc)]();if(!_0x51f326['ok'])throw CliErrors['apiError'](_0x333f1d(0xc2)+_0x51f326[_0x333f1d(0xd3)]+').');if(!(_0x51f326[_0x333f1d(0xe2)][_0x333f1d(0xf7)](_0x333f1d(0x101))??'')[_0x333f1d(0xc6)]()[_0x333f1d(0xb8)](_0x333f1d(0x100)))throw CliErrors[_0x333f1d(0xbd)](_0x333f1d(0xfa));let _0x3acc99;try{_0x3acc99=await _0x51f326[_0x333f1d(0xdf)]();}catch{throw CliErrors[_0x333f1d(0xbd)](_0x333f1d(0xff));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x3acc99),_0x59737c[_0x333f1d(0xe0)]);}function readEnvelopeData(_0x321e34){const _0x466c7c=a255_0x40ba7e,_0x1e3b39=requireRecord(_0x321e34,'response\x20envelope');if(_0x1e3b39[_0x466c7c(0xd2)]===![])throw CliErrors[_0x466c7c(0xbd)]('SmartCode\x20knowledge\x20search\x20failed.');if(!('data'in _0x1e3b39))throw invalidContract(_0x466c7c(0xf5));return _0x1e3b39[_0x466c7c(0xd1)];}function validateTopK(_0x4e0874){const _0x3f4ef4=a255_0x40ba7e;if(_0x4e0874!==undefined&&(!Number[_0x3f4ef4(0xe1)](_0x4e0874)||_0x4e0874<0x1||_0x4e0874>0x32))throw CliErrors[_0x3f4ef4(0xfb)]('Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');}function hasNoStore(_0x21dce9){const _0x19b625=a255_0x40ba7e;return(_0x21dce9[_0x19b625(0xf7)](_0x19b625(0xc1))??'')[_0x19b625(0xfe)](',')[_0x19b625(0xed)](_0x300947=>_0x300947['trim']()[_0x19b625(0xc6)]()===_0x19b625(0xba));}function parseDevelopmentSearchResponse(_0x1d3d7f,_0x10e10a){const _0x25a09d=a255_0x40ba7e,_0x4c38d1=requireExactRecord(_0x1d3d7f,RESPONSE_KEYS,'response');if(_0x4c38d1[_0x25a09d(0xc5)]!==0x2||_0x4c38d1['profile']!==_0x25a09d(0xb9))throw invalidContract(_0x25a09d(0xcd));if(!Array['isArray'](_0x4c38d1[_0x25a09d(0xda)])||_0x4c38d1[_0x25a09d(0xda)][_0x25a09d(0xef)]>(_0x10e10a??0x32))throw invalidContract(_0x25a09d(0xda));if(typeof _0x4c38d1[_0x25a09d(0xfd)]!==_0x25a09d(0xd8)||!/^sha256:[0-9a-f]{64}$/[_0x25a09d(0xd4)](_0x4c38d1['strategyFingerprint']))throw invalidContract(_0x25a09d(0xfd));const _0x389468=requireRecord(_0x4c38d1['timingsMs'],_0x25a09d(0xe8)),_0x57cbec={};for(const [_0x15a955,_0x1bf322]of Object['entries'](_0x389468)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x25a09d(0xd4)](_0x15a955)||typeof _0x1bf322!==_0x25a09d(0xdc)||!Number[_0x25a09d(0xce)](_0x1bf322)||_0x1bf322<0x0)throw invalidContract('timingsMs');_0x57cbec[_0x15a955]=_0x1bf322;}const _0x54c18d=_0x4c38d1['hits'][_0x25a09d(0xc4)]((_0x85641f,_0x25082c)=>parseHit(_0x85641f,_0x25082c));if(!Number[_0x25a09d(0xe1)](_0x4c38d1[_0x25a09d(0xcb)])||_0x4c38d1[_0x25a09d(0xcb)]!==_0x54c18d[_0x25a09d(0xef)])throw invalidContract(_0x25a09d(0xcb));return{'schemaVersion':_0x4c38d1['schemaVersion'],'profile':_0x4c38d1[_0x25a09d(0xcd)],'total':_0x4c38d1[_0x25a09d(0xcb)],'strategyFingerprint':_0x4c38d1['strategyFingerprint'],'timingsMs':_0x57cbec,'hits':_0x54c18d};}function parseHit(_0x4948d4,_0x60f1f8){const _0x1c5335=a255_0x40ba7e,_0x341d4a=requireExactRecord(_0x4948d4,HIT_KEYS,_0x1c5335(0xc7)+_0x60f1f8+']'),_0x24b051=_0x123b89=>{const _0x160922=_0x1c5335,_0x5782bb=_0x341d4a[_0x123b89];if(typeof _0x5782bb!==_0x160922(0xd8)||!_0x5782bb)throw invalidContract(_0x123b89);return _0x5782bb;};if(!Number[_0x1c5335(0xe1)](_0x341d4a[_0x1c5335(0xeb)])||_0x341d4a[_0x1c5335(0xeb)]<0x1)throw invalidContract(_0x1c5335(0xeb));if(_0x341d4a[_0x1c5335(0xd5)]!==_0x1c5335(0xe9)&&_0x341d4a[_0x1c5335(0xd5)]!=='company')throw invalidContract('scope');if(typeof _0x341d4a[_0x1c5335(0xc8)]!==_0x1c5335(0xd8)||typeof _0x341d4a[_0x1c5335(0xdb)]!==_0x1c5335(0xd8))throw invalidContract('text');if(!Array[_0x1c5335(0xf8)](_0x341d4a['tags'])||_0x341d4a[_0x1c5335(0xf1)][_0x1c5335(0xed)](_0x46b42b=>typeof _0x46b42b!==_0x1c5335(0xd8)))throw invalidContract(_0x1c5335(0xf1));if(!Number['isSafeInteger'](_0x341d4a[_0x1c5335(0xbc)])||_0x341d4a[_0x1c5335(0xbc)]!==_0x60f1f8+0x1)throw invalidContract(_0x1c5335(0xbc));if(!isFiniteNumber(_0x341d4a[_0x1c5335(0xc0)])||!isFiniteNumber(_0x341d4a[_0x1c5335(0xbb)]))throw invalidContract(_0x1c5335(0xd7));return{'documentId':_0x24b051('documentId'),'revision':_0x341d4a[_0x1c5335(0xeb)],'chunkId':_0x24b051(_0x1c5335(0xe4)),'scope':_0x341d4a[_0x1c5335(0xd5)],'title':_0x341d4a[_0x1c5335(0xc8)],'text':_0x341d4a['text'],'tags':[..._0x341d4a[_0x1c5335(0xf1)]],'rank':_0x341d4a['rank'],'rawScore':_0x341d4a[_0x1c5335(0xc0)],'finalScore':_0x341d4a['finalScore'],'scoreKind':_0x24b051(_0x1c5335(0xec))};}function requireExactRecord(_0x390b16,_0x5c6681,_0x4b05f7){const _0x1b357c=a255_0x40ba7e,_0x4cd2d7=requireRecord(_0x390b16,_0x4b05f7),_0x7688eb=Object[_0x1b357c(0xdd)](_0x4cd2d7)[_0x1b357c(0xf2)](),_0x43edaa=[..._0x5c6681]['sort']();if(_0x7688eb[_0x1b357c(0xef)]!==_0x43edaa['length']||_0x7688eb[_0x1b357c(0xed)]((_0x3e9ce7,_0x1a80e)=>_0x3e9ce7!==_0x43edaa[_0x1a80e]))throw invalidContract(_0x4b05f7);return _0x4cd2d7;}function a255_0x47a5(){const _0x4f12f8=['data','success','status','test','scope','cli:rabetbase','score','string','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','hits','text','number','keys','8646WNkKie','json','topK','isSafeInteger','headers','Knowledge\x20search\x20appCode\x20is\x20required.','chunkId','2893956gDPzsH','94MtHkmx','Knowledge\x20search\x20query\x20is\x20required.','timingsMs','public','978381rVavaq','revision','scoreKind','some','/smartapi/knowledge/company-public/search','length','appCode','tags','sort','cookie','716rEWBZd','response\x20envelope','30376fTkSna','get','isArray','1421OoddZn','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','validation','authRequired','strategyFingerprint','split','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','application/json','content-type','1392bDcIQf','documentId','329087clUGlJ','includes','development','no-store','finalScore','rank','apiError','POST','object','rawScore','cache-control','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','20kVNVsm','map','schemaVersion','toLowerCase','hits[','title','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','trim','total','networkError','profile','isFinite','3928455nYvXlm','21629vTxrEE'];a255_0x47a5=function(){return _0x4f12f8;};return a255_0x47a5();}function requireRecord(_0x311020,_0x21fa08){const _0x534b7e=a255_0x40ba7e;if(!_0x311020||typeof _0x311020!==_0x534b7e(0xbf)||Array[_0x534b7e(0xf8)](_0x311020))throw invalidContract(_0x21fa08);return _0x311020;}function isFiniteNumber(_0x15cd66){return typeof _0x15cd66==='number'&&Number['isFinite'](_0x15cd66);}function invalidContract(_0x5b2d29){const _0x453254=a255_0x40ba7e;return CliErrors['apiError'](_0x453254(0xc9)+_0x5b2d29+'\x20contract.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5e80cc,_0x587906){const _0x52aaa1=a256_0x674d,_0x26f203=_0x5e80cc();while(!![]){try{const _0x60dff1=parseInt(_0x52aaa1(0x1c1))/0x1*(parseInt(_0x52aaa1(0x1c0))/0x2)+parseInt(_0x52aaa1(0x1c7))/0x3+parseInt(_0x52aaa1(0x1c8))/0x4+parseInt(_0x52aaa1(0x1bd))/0x5*(parseInt(_0x52aaa1(0x1b3))/0x6)+parseInt(_0x52aaa1(0x1be))/0x7+-parseInt(_0x52aaa1(0x1cc))/0x8*(parseInt(_0x52aaa1(0x1b1))/0x9)+-parseInt(_0x52aaa1(0x1ba))/0xa*(parseInt(_0x52aaa1(0x1b2))/0xb);if(_0x60dff1===_0x587906)break;else _0x26f203['push'](_0x26f203['shift']());}catch(_0x25ea78){_0x26f203['push'](_0x26f203['shift']());}}}(a256_0x1fc0,0x476a3));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';function a256_0x674d(_0x284766,_0x4a7851){_0x284766=_0x284766-0x1af;const _0x1fc028=a256_0x1fc0();let _0x674dc9=_0x1fc028[_0x284766];return _0x674dc9;}import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x123abc,_0x5463f8=process['cwd']()){const _0x5b5936=a256_0x674d,_0x59da6f=resolve(_0x5463f8),_0x256e33=join(_0x59da6f,_0x5b5936(0x1cb),_0x5b5936(0x1b8));return{'projectRoot':_0x59da6f,'pagesBaseDir':_0x256e33,'appPagesDir':join(_0x256e33,_0x123abc),'lockFilePath':join(_0x59da6f,'.rabetbase',_0x5b5936(0x1b9))};}export function buildPageFileName(_0x4fed3e,_0xf3ab91){const _0x42e1aa=a256_0x674d;return _0x4fed3e+'-'+_0xf3ab91[_0x42e1aa(0x1c2)]()+'.json';}export function resolvePageFilePath(_0x5b7e93,_0x3ffe9e,_0x3fff63){return join(_0x5b7e93['appPagesDir'],buildPageFileName(_0x3ffe9e,_0x3fff63));}export async function ensureParentDirectory(_0x1a37d8){await mkdir(dirname(_0x1a37d8),{'recursive':!![]});}function a256_0x1fc0(){const _0x36018f=['isFile','Page\x20directory\x20not\x20found:\x20','join','page','page.lock.json','40QEEtsV','utf8','name','7360OVvcsR','565306ETCSSk','flagMissing','1012oaiLNV','238oxOphy','toUpperCase','F_OK','localeCompare','isDirectory','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','536601pLoYcw','116448SZoaXf','sort','page-dir','.rabetbase','1106096wpihyI','Unsupported\x20file\x20in\x20page\x20directory:\x20','split','9Xolpuc','1090199YuVgIA','1704UsiMRS','validation'];a256_0x1fc0=function(){return _0x36018f;};return a256_0x1fc0();}export async function fileExists(_0xba6c28){const _0x8c255c=a256_0x674d;try{return await access(_0xba6c28,constants[_0x8c255c(0x1c3)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x1730d9){const _0x2ca1b3=a256_0x674d,_0x3ce97d=_0x1730d9['trim']();if(!_0x3ce97d)throw CliErrors[_0x2ca1b3(0x1bf)](_0x2ca1b3(0x1ca));const _0x13aec9=resolve(_0x3ce97d);let _0x18b7ba;try{_0x18b7ba=await lstat(_0x13aec9);}catch{throw CliErrors['validation'](_0x2ca1b3(0x1b6)+_0x3ce97d);}if(!_0x18b7ba[_0x2ca1b3(0x1c5)]())throw CliErrors[_0x2ca1b3(0x1b4)](_0x2ca1b3(0x1c6)+_0x3ce97d);const _0x5c7fe6={};return await readDirectory(_0x13aec9,_0x13aec9,_0x5c7fe6),_0x5c7fe6;}async function readDirectory(_0x2d0220,_0x4fbde5,_0x4df43d){const _0x3aea07=a256_0x674d,_0x5e7fa0=await readdir(_0x4fbde5,{'withFileTypes':!![]});for(const _0x38b02c of _0x5e7fa0[_0x3aea07(0x1c9)]((_0x30e86e,_0x54583a)=>_0x30e86e[_0x3aea07(0x1bc)][_0x3aea07(0x1c4)](_0x54583a[_0x3aea07(0x1bc)]))){const _0x471f3b=join(_0x4fbde5,_0x38b02c[_0x3aea07(0x1bc)]);if(_0x38b02c[_0x3aea07(0x1c5)]()){await readDirectory(_0x2d0220,_0x471f3b,_0x4df43d);continue;}if(!_0x38b02c[_0x3aea07(0x1b5)]())throw CliErrors[_0x3aea07(0x1b4)](_0x3aea07(0x1af)+_0x471f3b);_0x4df43d[relative(_0x2d0220,_0x471f3b)[_0x3aea07(0x1b0)](sep)[_0x3aea07(0x1b7)]('/')]=await readFile(_0x471f3b,_0x3aea07(0x1bb));}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a257_0x4c0c(){const _0x3d6a06=['205212TFloIm','11MlWkXT','digest','123006nZAkTY','stringify','2435288QRLNDl','3705612IOvUKy','md5','7FiYCwB','createHash','hex','24ICiKqE','3526uCLSkx','update','219390GyUPsW','664296TvCwOZ','60vrOoaq','18nAVPKG'];a257_0x4c0c=function(){return _0x3d6a06;};return a257_0x4c0c();}(function(_0x27d4d0,_0x15adab){const _0x2da92d=a257_0x1ade,_0x5ec1e9=_0x27d4d0();while(!![]){try{const _0x22e839=-parseInt(_0x2da92d(0x12d))/0x1+parseInt(_0x2da92d(0x124))/0x2*(-parseInt(_0x2da92d(0x123))/0x3)+-parseInt(_0x2da92d(0x12a))/0x4*(-parseInt(_0x2da92d(0x128))/0x5)+-parseInt(_0x2da92d(0x127))/0x6+-parseInt(_0x2da92d(0x120))/0x7*(-parseInt(_0x2da92d(0x11d))/0x8)+parseInt(_0x2da92d(0x129))/0x9*(-parseInt(_0x2da92d(0x126))/0xa)+parseInt(_0x2da92d(0x12b))/0xb*(-parseInt(_0x2da92d(0x11e))/0xc);if(_0x22e839===_0x15adab)break;else _0x5ec1e9['push'](_0x5ec1e9['shift']());}catch(_0x135109){_0x5ec1e9['push'](_0x5ec1e9['shift']());}}}(a257_0x4c0c,0x4e036));import a257_0x36f72c from'node:crypto';function a257_0x1ade(_0x2c8000,_0x5b0771){_0x2c8000=_0x2c8000-0x11d;const _0x4c0c70=a257_0x4c0c();let _0x1adef8=_0x4c0c70[_0x2c8000];return _0x1adef8;}import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x291abf){const _0xafbf27=a257_0x1ade;return JSON[_0xafbf27(0x12e)](JSON['parse'](_0x291abf),null,0x2)+'\x0a';}export function computePageContentHash(_0x542d4e){const _0x4bfef3=a257_0x1ade;return a257_0x36f72c[_0x4bfef3(0x121)](_0x4bfef3(0x11f))[_0x4bfef3(0x125)](_0x542d4e)[_0x4bfef3(0x12c)](_0x4bfef3(0x122));}export function computeSerializedSchemaHash(_0x203664){return computePageContentHash(serializePageSchemaForFile(_0x203664));}export async function computePageFileHash(_0x1d48e7){const _0x5d74ca=await readFile(_0x1d48e7,'utf8');return computePageContentHash(_0x5d74ca);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5dbb97,_0x5524a8){const _0x164f49=a258_0x4bb7,_0x272e62=_0x5dbb97();while(!![]){try{const _0x29cddb=parseInt(_0x164f49(0x1d0))/0x1*(parseInt(_0x164f49(0x1cc))/0x2)+parseInt(_0x164f49(0x1cb))/0x3+parseInt(_0x164f49(0x1d3))/0x4+-parseInt(_0x164f49(0x1ca))/0x5+parseInt(_0x164f49(0x1cd))/0x6+parseInt(_0x164f49(0x1c5))/0x7+parseInt(_0x164f49(0x1d1))/0x8*(-parseInt(_0x164f49(0x1cf))/0x9);if(_0x29cddb===_0x5524a8)break;else _0x272e62['push'](_0x272e62['shift']());}catch(_0x1d978c){_0x272e62['push'](_0x272e62['shift']());}}}(a258_0x2055,0xdcd4a));import{mkdir,readFile,writeFile}from'node:fs/promises';function a258_0x4bb7(_0x594334,_0x383df4){_0x594334=_0x594334-0x1c3;const _0x20554a=a258_0x2055();let _0x4bb7b6=_0x20554a[_0x594334];return _0x4bb7b6;}function a258_0x2055(){const _0x1bf8d5=['1907364ITnPjr','pages','object','2831717qTWxdP','lastSync','apps','utf8','stringify','4709285cJpUAB','3402942wYImwM','952274RgROeF','7221450ZsHVzQ','parse','147267plUVeg','1ldiEqZ','904agVLyl','code'];a258_0x2055=function(){return _0x1bf8d5;};return a258_0x2055();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0xba0af,_0x51ba7d){const _0x537626=a258_0x4bb7,_0x2fccdf={'apps':_0xba0af[_0x537626(0x1c7)]&&typeof _0xba0af[_0x537626(0x1c7)]===_0x537626(0x1c4)?_0xba0af[_0x537626(0x1c7)]:{}};let _0x1d729a=_0x2fccdf[_0x537626(0x1c7)][_0x51ba7d];if(!_0x1d729a)return _0x1d729a={'lastSync':'','pages':{}},_0x2fccdf['apps'][_0x51ba7d]=_0x1d729a,{'lockData':_0x2fccdf,'appLock':_0x1d729a};return!_0x1d729a[_0x537626(0x1c6)]&&(_0x1d729a[_0x537626(0x1c6)]=''),(!_0x1d729a[_0x537626(0x1c3)]||typeof _0x1d729a['pages']!==_0x537626(0x1c4))&&(_0x1d729a[_0x537626(0x1c3)]={}),{'lockData':_0x2fccdf,'appLock':_0x1d729a};}export async function readPageLockFile(_0xff0d3a){const _0x247467=a258_0x4bb7;try{const _0x3caa7f=await readFile(_0xff0d3a,_0x247467(0x1c8)),_0x2f4c9a=JSON[_0x247467(0x1ce)](_0x3caa7f);return{'apps':_0x2f4c9a[_0x247467(0x1c7)]&&typeof _0x2f4c9a[_0x247467(0x1c7)]===_0x247467(0x1c4)?_0x2f4c9a['apps']:{}};}catch(_0xf9ce97){if(_0xf9ce97[_0x247467(0x1d2)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0xf9ce97));}}export async function writePageLockFile(_0x2c3fdd,_0x423f73){const _0x171cac=a258_0x4bb7;await mkdir(dirname(_0x2c3fdd),{'recursive':!![]}),await writeFile(_0x2c3fdd,JSON[_0x171cac(0x1c9)](_0x423f73,null,0x2),_0x171cac(0x1c8));}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface PrepareLrSmartJsxResult {
|
|
2
|
+
content: string;
|
|
3
|
+
compiledNodes: number;
|
|
4
|
+
normalizedNodes: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function prepareLrSmartJsxForPush(localContent: string, remoteContent: string, transpile: (source: string) => Promise<string>): Promise<PrepareLrSmartJsxResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x183644,_0x2e5d5f){const _0x3f8595=a259_0x62a6,_0x3f28d6=_0x183644();while(!![]){try{const _0x158883=parseInt(_0x3f8595(0xb8))/0x1+-parseInt(_0x3f8595(0xb5))/0x2*(-parseInt(_0x3f8595(0xc5))/0x3)+parseInt(_0x3f8595(0xd9))/0x4+parseInt(_0x3f8595(0xcc))/0x5+parseInt(_0x3f8595(0xd5))/0x6*(parseInt(_0x3f8595(0xd8))/0x7)+parseInt(_0x3f8595(0xd7))/0x8+-parseInt(_0x3f8595(0xb2))/0x9*(parseInt(_0x3f8595(0xc7))/0xa);if(_0x158883===_0x2e5d5f)break;else _0x3f28d6['push'](_0x3f28d6['shift']());}catch(_0x3eb23f){_0x3f28d6['push'](_0x3f28d6['shift']());}}}(a259_0x5639,0xc0eee));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x222c24,_0x1df2ae,_0x4801d5){const _0x405b5a=a259_0x62a6,_0x48cc98=parseSchema(_0x222c24,_0x405b5a(0xb1)),_0x2f903b=parseSchema(_0x1df2ae,'remote'),_0xcd1068=collectLrSmartJsx(_0x48cc98,!![]);if(_0xcd1068[_0x405b5a(0xc9)]===0x0)return{'content':_0x222c24,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x3ae052=new Map(collectLrSmartJsx(_0x2f903b)[_0x405b5a(0xba)](_0x482694=>[_0x482694[_0x405b5a(0xd3)],_0x482694]));let _0x223347=0x0,_0x58fdc8=0x0;for(const _0x3a9400 of _0xcd1068){const _0x393c66=readNonEmptyString(_0x3a9400['render'][_0x405b5a(0xb3)]),_0xc3a508=readNonEmptyString(_0x3a9400[_0x405b5a(0xd6)]['value']),_0x2eb277=_0x3ae052[_0x405b5a(0xcb)](_0x3a9400['key']),_0x276506=readNonEmptyString(_0x2eb277?.[_0x405b5a(0xd6)]['source']),_0x300610=readNonEmptyString(_0x2eb277?.[_0x405b5a(0xd6)][_0x405b5a(0xb0)]);let _0x404332=![];_0x3a9400['render'][_0x405b5a(0xc6)]!==_0x405b5a(0xb7)&&(_0x3a9400[_0x405b5a(0xd6)][_0x405b5a(0xc6)]='JSFunction',_0x404332=!![]);!isPageContextExpression(_0x3a9400[_0x405b5a(0xbf)][_0x405b5a(0xce)])&&(_0x3a9400[_0x405b5a(0xbf)][_0x405b5a(0xce)]={'type':_0x405b5a(0xbe),'value':'this'},_0x404332=!![]);if(!_0x393c66){if(!_0xc3a508)throw CliErrors[_0x405b5a(0xd2)]('LrSmartJsx\x20node\x20\x22'+_0x3a9400['label']+'\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.',_0x405b5a(0xc1));if(_0x404332)_0x58fdc8+=0x1;continue;}const _0x2c66e6=!_0x2eb277||_0x393c66!==_0x276506,_0x377025=!_0xc3a508;if(!_0x2c66e6&&_0xc3a508&&_0x300610&&_0xc3a508!==_0x300610)throw CliErrors[_0x405b5a(0xd2)](_0x405b5a(0xd0)+_0x3a9400[_0x405b5a(0xdc)]+_0x405b5a(0xb4),_0x405b5a(0xbb));if(_0x2c66e6||_0x377025||!_0x300610){const _0x66338=readNonEmptyString(await _0x4801d5(_0x393c66));if(!_0x66338)throw CliErrors['apiError'](_0x405b5a(0xbc)+_0x3a9400['label']+'\x22.');_0x3a9400['render'][_0x405b5a(0xb0)]=_0x66338,_0x223347+=0x1,_0x404332=!![];}if(_0x404332)_0x58fdc8+=0x1;}if(_0x58fdc8===0x0)return{'content':_0x222c24,'compiledNodes':_0x223347,'normalizedNodes':_0x58fdc8};return{'content':JSON[_0x405b5a(0xc3)](_0x48cc98),'compiledNodes':_0x223347,'normalizedNodes':_0x58fdc8};}function parseSchema(_0x10d034,_0x4fe8d1){const _0x560e7e=a259_0x62a6;try{return JSON[_0x560e7e(0xc2)](_0x10d034);}catch{throw CliErrors[_0x560e7e(0xd2)](_0x560e7e(0xbd)+_0x4fe8d1+_0x560e7e(0xcf));}}function collectLrSmartJsx(_0x2e4eb3,_0x5480dd=![]){const _0xe6bde1=[],_0x22d5d3=(_0x145385,_0x42bb76)=>{const _0x4b97c1=a259_0x62a6;if(Array[_0x4b97c1(0xc0)](_0x145385)){_0x145385[_0x4b97c1(0xca)]((_0x3af341,_0x2f6079)=>_0x22d5d3(_0x3af341,_0x42bb76+'['+_0x2f6079+']'));return;}if(!isObject(_0x145385))return;if(_0x145385['componentName']==='LrSmartJsx'){const _0x259bd=readNonEmptyString(_0x145385['id']),_0xfe061a=_0x259bd||_0x42bb76,_0x57f096=isObject(_0x145385[_0x4b97c1(0xbf)])?_0x145385[_0x4b97c1(0xbf)]:undefined;if(!_0x57f096){if(_0x5480dd)throw CliErrors[_0x4b97c1(0xd2)]('LrSmartJsx\x20node\x20\x22'+_0xfe061a+_0x4b97c1(0xb6),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x345fa7=isObject(_0x57f096[_0x4b97c1(0xd6)])?_0x57f096[_0x4b97c1(0xd6)]:undefined;if(!_0x345fa7){if(_0x5480dd)throw CliErrors['validation'](_0x4b97c1(0xd0)+_0xfe061a+_0x4b97c1(0xda),_0x4b97c1(0xcd));return;}_0xe6bde1['push']({'key':_0x259bd?'id:'+_0x259bd:_0x4b97c1(0xd4)+_0x42bb76,'label':_0xfe061a,'props':_0x57f096,'render':_0x345fa7});}for(const [_0x540bff,_0x36112d]of Object[_0x4b97c1(0xd1)](_0x145385)){if(_0x540bff==='props'&&_0x145385[_0x4b97c1(0xc4)]==='LrSmartJsx')continue;_0x22d5d3(_0x36112d,_0x42bb76+'.'+_0x540bff);}};return _0x22d5d3(_0x2e4eb3,'$'),_0xe6bde1;}function isObject(_0xb3b5a5){const _0x5762d3=a259_0x62a6;return Boolean(_0xb3b5a5)&&typeof _0xb3b5a5==='object'&&!Array[_0x5762d3(0xc0)](_0xb3b5a5);}function a259_0x5639(){const _0x3edb68=['parse','stringify','componentName','15CqCCIv','type','5630KkwcJd','string','length','forEach','get','7763130LnaOnF','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','_context','\x20page\x20schema.','LrSmartJsx\x20node\x20\x22','entries','validation','key','path:','1227504CBXlxu','render','2650392lwbwqc','21QdYrFQ','391120vMcdCG','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','trim','label','value','local','69651wCxyZZ','source','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','551674pMKeRf','\x22\x20has\x20missing\x20or\x20invalid\x20props.','JSFunction','1172669PpwBtN','this','map','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','Invalid\x20JSON\x20in\x20','JSExpression','props','isArray','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.'];a259_0x5639=function(){return _0x3edb68;};return a259_0x5639();}function readNonEmptyString(_0x295539){const _0x5aa797=a259_0x62a6;return typeof _0x295539===_0x5aa797(0xc8)&&_0x295539[_0x5aa797(0xdb)]()?_0x295539:undefined;}function a259_0x62a6(_0x2fda90,_0x9bde6){_0x2fda90=_0x2fda90-0xb0;const _0x5639d2=a259_0x5639();let _0x62a66f=_0x5639d2[_0x2fda90];return _0x62a66f;}function isPageContextExpression(_0x234f58){const _0x3c41a5=a259_0x62a6;return isObject(_0x234f58)&&_0x234f58[_0x3c41a5(0xc6)]==='JSExpression'&&_0x234f58[_0x3c41a5(0xb0)]===_0x3c41a5(0xb9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13ec86,_0x14f77a){const _0xb9d34a=a259_0x1e48,_0xf4fb0d=_0x13ec86();while(!![]){try{const _0x26db69=-parseInt(_0xb9d34a(0x101))/0x1*(-parseInt(_0xb9d34a(0x118))/0x2)+-parseInt(_0xb9d34a(0x137))/0x3*(parseInt(_0xb9d34a(0x124))/0x4)+parseInt(_0xb9d34a(0xf8))/0x5+parseInt(_0xb9d34a(0x11a))/0x6+-parseInt(_0xb9d34a(0x130))/0x7*(-parseInt(_0xb9d34a(0x138))/0x8)+-parseInt(_0xb9d34a(0x10b))/0x9*(-parseInt(_0xb9d34a(0x117))/0xa)+-parseInt(_0xb9d34a(0x12a))/0xb;if(_0x26db69===_0x14f77a)break;else _0xf4fb0d['push'](_0xf4fb0d['shift']());}catch(_0x2229f9){_0xf4fb0d['push'](_0xf4fb0d['shift']());}}}(a259_0x5caa,0xa68e3));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5b857d,_0x1e390d){const _0x29216e=a259_0x1e48,_0x4cd640=[],_0x122f1b=normalizeSqlForStaticAnalysis(_0x5b857d),_0x558ba0=(_0x122f1b[_0x29216e(0xff)]?[]:extractJoinFacts(_0x122f1b[_0x29216e(0x10a)]))[_0x29216e(0x11d)](_0x7d9bb7=>{const _0x20a260=_0x29216e;if(_0x7d9bb7['unsupportedPredicate']||_0x7d9bb7['columns'][_0x20a260(0xfd)]===0x0)return _0x4cd640[_0x20a260(0x104)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x7d9bb7[_0x20a260(0x112)]??_0x20a260(0xf7)}),{'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x126)};const _0x3055a0=resolveTableMetadata(_0x1e390d,_0x7d9bb7[_0x20a260(0xf3)]),_0x5c3de9=(_0x3055a0?.['indexes']??[])[_0x20a260(0x11d)](_0x4a226f=>({'index':_0x4a226f,'matchedPrefix':findEqualityPrefix(_0x4a226f[_0x20a260(0x111)],_0x7d9bb7['columns'])}))['filter'](_0x24a682=>_0x24a682['matchedPrefix'][_0x20a260(0xfd)]>0x0),_0x230d00=_0x5c3de9['reduce']((_0x4dc502,_0x323d80)=>!_0x4dc502||_0x323d80[_0x20a260(0xf4)][_0x20a260(0xfd)]>_0x4dc502[_0x20a260(0xf4)][_0x20a260(0xfd)]?_0x323d80:_0x4dc502,_0x5c3de9[0x0]);if(_0x230d00)return{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x123),'matchedIndex':{..._0x230d00[_0x20a260(0xfc)],'matchedPrefix':_0x230d00[_0x20a260(0xf4)]}};const _0x2b8883=_0x3055a0?.[_0x20a260(0xf9)][_0x20a260(0x129)](_0xfcdc62=>_0xfcdc62['columns'][_0x20a260(0x12d)](_0x18ac08=>_0x7d9bb7[_0x20a260(0x111)][_0x20a260(0x12d)](_0x355cd3=>columnNamesMatch(_0x18ac08,_0x355cd3))))??[];if(_0x2b8883[_0x20a260(0xfd)]>0x0)return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0x109),'table':_0x7d9bb7['table'],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x20a260(0x133)}),{'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x114),'candidateIndexes':_0x2b8883};if(_0x3055a0&&_0x3055a0['metadataAvailable']!==![]&&_0x3055a0[_0x20a260(0xf9)][_0x20a260(0xfd)]>0x0&&_0x7d9bb7[_0x20a260(0x111)][_0x20a260(0xfd)]>0x0)return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0x12b),'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'reason':_0x20a260(0xef)}),{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x114)};return _0x4cd640[_0x20a260(0x104)]({'code':_0x20a260(0xfa),'table':_0x7d9bb7[_0x20a260(0xf3)],'alias':_0x7d9bb7['alias'],'columns':_0x7d9bb7['columns'],'reason':_0x3055a0?_0x20a260(0xf2):_0x20a260(0x103)}),{'table':_0x7d9bb7['table'],'alias':_0x7d9bb7[_0x20a260(0x105)],'columns':_0x7d9bb7[_0x20a260(0x111)],'status':_0x20a260(0x126)};});return{'checked':_0x558ba0[_0x29216e(0xfd)]>0x0,'joins':_0x558ba0,'warnings':_0x4cd640};}function extractJoinFacts(_0x35b29b){const _0x378eec=a259_0x1e48,_0x412979=maskNestedQueries(stripSqlNoise(_0x35b29b)),_0x2f5192=maskQuotedIdentifiers(_0x412979),_0x4aec17=[],_0x195614=new Set(),_0x3d09dc=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x3f1781 of _0x412979[_0x378eec(0xec)](_0x3d09dc)){const _0x2ffa36=_0x3f1781[_0x378eec(0xfc)]??0x0,_0x5f5217=_0x3f1781[0x0][_0x378eec(0x10c)](/\bJOIN\b/i),_0x286708=_0x2ffa36+Math[_0x378eec(0x121)](0x0,_0x5f5217);if(!/^JOIN\b/i[_0x378eec(0xf6)](_0x2f5192['slice'](_0x286708)))continue;_0x195614[_0x378eec(0xf0)](_0x286708);const _0x92733c=normalizeIdentifier(_0x3f1781[0x1]||_0x378eec(0x10e)),_0x47429c=normalizeIdentifier(_0x3f1781[0x2]??''),_0x104ae8=normalizeIdentifier(_0x3f1781[0x3]||_0x47429c['split']('.')['at'](-0x1)||_0x47429c),_0x34697e=[],_0xc6ded8=_0x47429c===_0x378eec(0x136);let _0x147a5d=_0x92733c===_0x378eec(0x10f)||_0x92733c===_0x378eec(0xeb)||_0xc6ded8,_0x5ad6e0=_0x147a5d?_0xc6ded8?_0x378eec(0xed):_0x92733c[_0x378eec(0x119)]()+_0x378eec(0x12e):undefined;const _0xeef860=stripOuterParentheses(_0x3f1781[0x4]??''),_0x4194e1=_0xeef860[_0x378eec(0x12c)](MYBATIS_DYNAMIC_START_MARKER)||_0xeef860[_0x378eec(0x12c)](MYBATIS_DYNAMIC_END_MARKER),_0x3c0060=_0xeef860['includes'](MYBATIS_INCLUDE_MARKER);_0x4194e1&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0xf1));_0x3c0060&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x132));const _0x3d94e2=_0xeef860['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x378eec(0x11b)](MYBATIS_DYNAMIC_END_MARKER,'\x20')['replaceAll'](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x3d94e2,'OR')&&(_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x134));for(const _0x1562d4 of splitTopLevelAnd(_0x3d94e2)){const _0x43357f=stripOuterParentheses(_0x1562d4);if(hasTopLevelKeyword(_0x43357f,'OR')){_0x147a5d=!![],_0x5ad6e0??=_0x378eec(0x134);continue;}const _0x485d19=splitEquality(_0x43357f);if(!_0x485d19){containsColumnReference(_0x1562d4,_0x104ae8)&&(_0x147a5d=!![]);continue;}const _0x2e9195=parseDirectColumnReference(_0x485d19[0x0],_0x104ae8),_0x88303=parseDirectColumnReference(_0x485d19[0x1],_0x104ae8),_0x308e11=containsColumnReference(_0x485d19[0x0],_0x104ae8),_0x138090=containsColumnReference(_0x485d19[0x1],_0x104ae8),_0x3588b7=_0x2e9195&&!_0x138090?_0x2e9195:_0x88303&&!_0x308e11?_0x88303:null;if(_0x3588b7&&!_0x34697e[_0x378eec(0x12c)](_0x3588b7))_0x34697e[_0x378eec(0x104)](_0x3588b7);else!_0x3588b7&&containsColumnReference(_0x1562d4,_0x104ae8)&&(_0x147a5d=!![]);}_0x4aec17[_0x378eec(0x104)]({'table':_0x47429c,'alias':_0x104ae8,'columns':_0x34697e,'unsupportedPredicate':_0x147a5d,'unsupportedReason':_0x5ad6e0,'containsUnresolvedInclude':_0x3c0060,'position':_0x286708});}for(const _0x49e1ff of _0x2f5192[_0x378eec(0xec)](/\bJOIN\b/gi)){const _0x254876=_0x49e1ff[_0x378eec(0xfc)]??0x0;if(_0x195614[_0x378eec(0x108)](_0x254876))continue;const _0x4ad92e=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0x412979[_0x378eec(0x102)](_0x254876+_0x49e1ff[0x0][_0x378eec(0xfd)])),_0x54ff34=normalizeIdentifier(_0x4ad92e?.[0x1]||_0x378eec(0x11e)),_0xec05fe=normalizeIdentifier(_0x4ad92e?.[0x2]||''),_0x123ee6=isSqlClauseKeyword(_0xec05fe)?_0x54ff34[_0x378eec(0x125)]('.')['at'](-0x1)||_0x54ff34:_0xec05fe||_0x54ff34[_0x378eec(0x125)]('.')['at'](-0x1)||_0x54ff34;_0x4aec17[_0x378eec(0x104)]({'table':_0x54ff34,'alias':_0x123ee6,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x254876});}const _0x20767f=_0x2f5192[_0x378eec(0x115)](MYBATIS_INCLUDE_MARKER);return _0x20767f>=0x0&&!_0x4aec17[_0x378eec(0x12d)](_0x2bb28e=>_0x2bb28e[_0x378eec(0x106)])&&_0x4aec17[_0x378eec(0x104)]({'table':_0x378eec(0x11e),'alias':_0x378eec(0x11e),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x378eec(0x131),'containsUnresolvedInclude':!![],'position':_0x20767f}),_0x4aec17['sort']((_0x42bdba,_0xdcdba6)=>_0x42bdba[_0x378eec(0x11c)]-_0xdcdba6[_0x378eec(0x11c)]);}function a259_0x1e48(_0x2471fe,_0x6636fc){_0x2471fe=_0x2471fe-0xea;const _0x5caa56=a259_0x5caa();let _0x1e4815=_0x5caa56[_0x2471fe];return _0x1e4815;}function stripSqlNoise(_0x51e47f){const _0x1eabdf=a259_0x1e48,_0x43a383=Array[_0x1eabdf(0x135)](_0x51e47f),_0x2dea8a=(_0x459e11,_0x4e483b)=>{for(let _0x6deb0d=_0x459e11;_0x6deb0d<_0x4e483b;_0x6deb0d+=0x1){_0x43a383[_0x6deb0d]!=='\x0a'&&_0x43a383[_0x6deb0d]!=='\x0d'&&(_0x43a383[_0x6deb0d]='\x20');}};for(let _0x44b55e=0x0;_0x44b55e<_0x43a383[_0x1eabdf(0xfd)];_0x44b55e+=0x1){const _0x55292e=_0x43a383[_0x44b55e],_0x294872=_0x43a383[_0x44b55e+0x1];if(_0x55292e==='\x27'||_0x55292e==='\x22'||_0x55292e==='`'){const _0x12efb1=_0x55292e,_0x45c561=_0x44b55e;_0x44b55e+=0x1;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]){if(_0x43a383[_0x44b55e]==='\x5c'&&_0x44b55e+0x1<_0x43a383[_0x1eabdf(0xfd)]){_0x44b55e+=0x2;continue;}if(_0x43a383[_0x44b55e]!==_0x12efb1){_0x44b55e+=0x1;continue;}if(_0x43a383[_0x44b55e+0x1]===_0x12efb1){_0x44b55e+=0x2;continue;}break;}if(_0x12efb1==='\x27')_0x2dea8a(_0x45c561,Math['min'](_0x44b55e+0x1,_0x43a383['length']));continue;}if(_0x55292e==='-'&&_0x294872==='-'){const _0x3d3e42=_0x44b55e;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='\x0a')_0x44b55e+=0x1;_0x2dea8a(_0x3d3e42,_0x44b55e);continue;}if(_0x55292e==='/'&&_0x294872==='*'){const _0x533771=_0x44b55e;_0x44b55e+=0x2;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&!(_0x43a383[_0x44b55e]==='*'&&_0x43a383[_0x44b55e+0x1]==='/')){_0x44b55e+=0x1;}_0x44b55e=Math[_0x1eabdf(0x12f)](_0x44b55e+0x1,_0x43a383[_0x1eabdf(0xfd)]-0x1),_0x2dea8a(_0x533771,_0x44b55e+0x1);continue;}if(_0x55292e==='#'&&_0x294872!=='{'){const _0xa03199=_0x44b55e;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='\x0a')_0x44b55e+=0x1;_0x2dea8a(_0xa03199,_0x44b55e);continue;}if((_0x55292e==='#'||_0x55292e==='$')&&_0x294872==='{'){const _0x5e1750=_0x44b55e;_0x44b55e+=0x2;while(_0x44b55e<_0x43a383[_0x1eabdf(0xfd)]&&_0x43a383[_0x44b55e]!=='}')_0x44b55e+=0x1;_0x2dea8a(_0x5e1750,Math[_0x1eabdf(0x12f)](_0x44b55e+0x1,_0x43a383[_0x1eabdf(0xfd)]));}}return _0x43a383[_0x1eabdf(0xfb)]('');}function maskQuotedIdentifiers(_0x2d1349){const _0x320195=a259_0x1e48,_0x3a67fc=Array[_0x320195(0x135)](_0x2d1349);for(let _0x5cc49c=0x0;_0x5cc49c<_0x3a67fc[_0x320195(0xfd)];_0x5cc49c+=0x1){const _0x370491=_0x3a67fc[_0x5cc49c];if(_0x370491!=='\x22'&&_0x370491!=='`')continue;_0x5cc49c+=0x1;while(_0x5cc49c<_0x3a67fc[_0x320195(0xfd)]){if(_0x3a67fc[_0x5cc49c]===_0x370491){if(_0x3a67fc[_0x5cc49c+0x1]===_0x370491){_0x3a67fc[_0x5cc49c]='\x20',_0x3a67fc[_0x5cc49c+0x1]='\x20',_0x5cc49c+=0x2;continue;}break;}_0x3a67fc[_0x5cc49c]='\x20',_0x5cc49c+=0x1;}}return _0x3a67fc[_0x320195(0xfb)]('');}function maskNestedQueries(_0xb62fc4){const _0x534b39=a259_0x1e48,_0xb90153=Array[_0x534b39(0x135)](_0xb62fc4);for(let _0x2bcaca=0x0;_0x2bcaca<_0xb90153[_0x534b39(0xfd)];_0x2bcaca+=0x1){if(_0xb90153[_0x2bcaca]!=='(')continue;const _0xb1225b=_0xb62fc4[_0x534b39(0x102)](_0x2bcaca+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x534b39(0xf6)](_0xb1225b))continue;let _0x33b36f=0x1,_0x314a6b=_0x2bcaca+0x1;for(;_0x314a6b<_0xb90153['length']&&_0x33b36f>0x0;_0x314a6b+=0x1){if(_0xb90153[_0x314a6b]==='(')_0x33b36f+=0x1;if(_0xb90153[_0x314a6b]===')')_0x33b36f-=0x1;}if(_0x33b36f!==0x0)continue;for(let _0x49f619=_0x2bcaca;_0x49f619<_0x314a6b;_0x49f619+=0x1){_0xb90153[_0x49f619]='\x20';}const _0x5b84ac=_0x534b39(0x136);for(let _0x4483d0=0x0;_0x4483d0<_0x5b84ac['length']&&_0x2bcaca+_0x4483d0<_0x314a6b;_0x4483d0+=0x1){_0xb90153[_0x2bcaca+_0x4483d0]=_0x5b84ac[_0x4483d0];}_0x2bcaca=_0x314a6b-0x1;}return _0xb90153['join']('');}function splitTopLevelAnd(_0x21d8ef){const _0x1dfeb5=a259_0x1e48,_0x20104b=[];let _0x1500e1=0x0,_0x3b6fe2=0x0;for(let _0x5ab60c=0x0;_0x5ab60c<_0x21d8ef[_0x1dfeb5(0xfd)];_0x5ab60c+=0x1){const _0x1b016c=_0x21d8ef[_0x5ab60c];if(_0x1b016c==='(')_0x1500e1+=0x1;if(_0x1b016c===')')_0x1500e1=Math[_0x1dfeb5(0x121)](0x0,_0x1500e1-0x1);_0x1500e1===0x0&&_0x21d8ef[_0x1dfeb5(0x102)](_0x5ab60c)[_0x1dfeb5(0x116)](/^AND\b/i)&&(_0x5ab60c===0x0||/\s/[_0x1dfeb5(0xf6)](_0x21d8ef[_0x5ab60c-0x1]??''))&&(_0x20104b[_0x1dfeb5(0x104)](_0x21d8ef[_0x1dfeb5(0x102)](_0x3b6fe2,_0x5ab60c)[_0x1dfeb5(0x100)]()),_0x5ab60c+=0x2,_0x3b6fe2=_0x5ab60c+0x1);}const _0x5a247e=_0x21d8ef[_0x1dfeb5(0x102)](_0x3b6fe2)[_0x1dfeb5(0x100)]();if(_0x5a247e)_0x20104b[_0x1dfeb5(0x104)](_0x5a247e);return _0x20104b;}function hasTopLevelKeyword(_0x3927b9,_0x4492e3){const _0xbafcd3=a259_0x1e48;let _0x114ac5=0x0;for(let _0x504718=0x0;_0x504718<_0x3927b9['length'];_0x504718+=0x1){const _0x4d934c=_0x3927b9[_0x504718];if(_0x4d934c==='(')_0x114ac5+=0x1;if(_0x4d934c===')')_0x114ac5=Math['max'](0x0,_0x114ac5-0x1);if(_0x114ac5!==0x0)continue;const _0x38ae8f=_0x3927b9['slice'](_0x504718,_0x504718+_0x4492e3['length']),_0x15d142=_0x3927b9[_0x504718-0x1]??'\x20',_0x1bc0e1=_0x3927b9[_0x504718+_0x4492e3[_0xbafcd3(0xfd)]]??'\x20';if(_0x38ae8f['toUpperCase']()===_0x4492e3['toUpperCase']()&&!/[\w$]/['test'](_0x15d142)&&!/[\w$]/[_0xbafcd3(0xf6)](_0x1bc0e1))return!![];}return![];}function splitEquality(_0xce940e){const _0x2fbb88=a259_0x1e48,_0x494859=stripOuterParentheses(_0xce940e);let _0x5a726a=0x0,_0x1f12dd;for(let _0xa38059=0x0;_0xa38059<_0x494859[_0x2fbb88(0xfd)];_0xa38059+=0x1){const _0x42a6d7=_0x494859[_0xa38059];if(_0x42a6d7==='(')_0x5a726a+=0x1;if(_0x42a6d7===')')_0x5a726a=Math['max'](0x0,_0x5a726a-0x1);const _0x4c9c92=_0x494859[_0xa38059-0x1]??'',_0x80aedc=_0x494859[_0xa38059+0x1]??'';if(_0x42a6d7==='='&&_0x5a726a===0x0&&!/[!<>=:]/[_0x2fbb88(0xf6)](_0x4c9c92)&&_0x80aedc!=='='){if(_0x1f12dd!==undefined)return null;_0x1f12dd=_0xa38059;}}return _0x1f12dd===undefined?null:[_0x494859[_0x2fbb88(0x102)](0x0,_0x1f12dd)[_0x2fbb88(0x100)](),_0x494859[_0x2fbb88(0x102)](_0x1f12dd+0x1)[_0x2fbb88(0x100)]()];}function parseDirectColumnReference(_0x15cf57,_0x48b6d0){const _0x495a0a=a259_0x1e48,_0x2bcc4f=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x495a0a(0x11f)](stripOuterParentheses(_0x15cf57));if(!_0x2bcc4f)return null;if(normalizeIdentifier(_0x2bcc4f[0x1]??'')!==normalizeIdentifier(_0x48b6d0))return null;return normalizeIdentifier(_0x2bcc4f[0x2]??'');}function a259_0x5caa(){const _0x5af95c=['1AJaONB','slice','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','push','alias','containsUnresolvedInclude','(?:^|[^\x5cw$])','has','JOIN_INDEX_NOT_USABLE','sql','26559SdJHKI','search','where','INNER','right','cross','columns','unsupportedReason','using','warning','indexOf','match','830efskbl','465346VuGyVD','toUpperCase','2009130uvJifL','replaceAll','position','map','unknown','exec','toLowerCase','max','left','covered','68bfNymA','split','unavailable','natural','tableName','filter','6430237GMAoSK','JOIN_INDEX_MISSING','includes','some','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','min','14bSyEIq','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','from','__sq__','141438ksqZHr','4323216vyNaZH','startsWith','full','matchAll','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','replace','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','add','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','table','matchedPrefix','endsWith','test','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','874975iqZAZJ','indexes','INDEX_METADATA_UNAVAILABLE','join','index','length','\x5cs*\x5c.\x5cs*[\x5cw$]+','error','trim'];a259_0x5caa=function(){return _0x5af95c;};return a259_0x5caa();}function containsColumnReference(_0x19ddd0,_0x45f269){const _0x13dbdd=a259_0x1e48,_0x5415cf=_0x19ddd0[_0x13dbdd(0xee)](/[`"]/g,''),_0x34cbe2=_0x45f269[_0x13dbdd(0xee)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x13dbdd(0x107)+_0x34cbe2+_0x13dbdd(0xfe),'i')[_0x13dbdd(0xf6)](_0x5415cf);}function findEqualityPrefix(_0x1ae108,_0x18b2c5){const _0x17baad=a259_0x1e48,_0x31e1e4=new Set(_0x18b2c5[_0x17baad(0x11d)](normalizeIdentifier)),_0xabb20d=[];for(const _0x13574c of _0x1ae108){if(!_0x31e1e4['has'](normalizeIdentifier(_0x13574c)))break;_0xabb20d['push'](_0x13574c);}return _0xabb20d;}function resolveTableMetadata(_0x2ed4ab,_0x2f6dbf){const _0x4b240a=a259_0x1e48,_0x39cb41=normalizeIdentifier(_0x2f6dbf),_0x408f02=_0x2ed4ab[_0x4b240a(0x129)](_0x972bde=>normalizeIdentifier(_0x972bde[_0x4b240a(0x128)])===_0x39cb41);if(_0x408f02[_0x4b240a(0xfd)]===0x1)return _0x408f02[0x0];const _0x47908d=_0x39cb41[_0x4b240a(0x12c)]('.'),_0x1fb51a=_0x39cb41['split']('.')['at'](-0x1),_0x39bbc4=_0x2ed4ab[_0x4b240a(0x129)](_0x39c7e1=>{const _0x4dc33d=_0x4b240a,_0x404acf=normalizeIdentifier(_0x39c7e1['tableName']);if(_0x47908d&&_0x404acf[_0x4dc33d(0x12c)]('.'))return![];return _0x404acf['split']('.')['at'](-0x1)===_0x1fb51a;});return _0x39bbc4[_0x4b240a(0xfd)]===0x1?_0x39bbc4[0x0]:undefined;}function columnNamesMatch(_0x35e7c9,_0x1c9f4b){return normalizeIdentifier(_0x35e7c9)===normalizeIdentifier(_0x1c9f4b);}function normalizeIdentifier(_0xf828f1){const _0xa848c1=a259_0x1e48;return _0xf828f1[_0xa848c1(0xee)](/[`"]/g,'')['trim']()[_0xa848c1(0x120)]();}function isSqlClauseKeyword(_0x1e77b8){const _0x108dee=a259_0x1e48;return new Set(['on',_0x108dee(0x113),_0x108dee(0x10d),_0x108dee(0xfb),'inner',_0x108dee(0x122),_0x108dee(0x10f),_0x108dee(0xeb),_0x108dee(0x110),_0x108dee(0x127)])[_0x108dee(0x108)](_0x1e77b8);}function stripOuterParentheses(_0xe949c1){const _0x1d874e=a259_0x1e48;let _0xf98686=_0xe949c1[_0x1d874e(0x100)]();while(_0xf98686[_0x1d874e(0xea)]('(')&&_0xf98686[_0x1d874e(0xf5)](')')){let _0x8f180b=0x0,_0x4a35ae=!![];for(let _0x5282d1=0x0;_0x5282d1<_0xf98686[_0x1d874e(0xfd)];_0x5282d1+=0x1){if(_0xf98686[_0x5282d1]==='(')_0x8f180b+=0x1;if(_0xf98686[_0x5282d1]===')')_0x8f180b-=0x1;if(_0x8f180b===0x0&&_0x5282d1<_0xf98686['length']-0x1){_0x4a35ae=![];break;}}if(!_0x4a35ae||_0x8f180b!==0x0)break;_0xf98686=_0xf98686[_0x1d874e(0x102)](0x1,-0x1)[_0x1d874e(0x100)]();}return _0xf98686;}
|
|
1
|
+
(function(_0x2960e3,_0x33511b){const _0x899893=a261_0x440a,_0x46517d=_0x2960e3();while(!![]){try{const _0x45827e=-parseInt(_0x899893(0x1aa))/0x1+-parseInt(_0x899893(0x170))/0x2*(-parseInt(_0x899893(0x1b4))/0x3)+parseInt(_0x899893(0x197))/0x4+-parseInt(_0x899893(0x199))/0x5*(-parseInt(_0x899893(0x18f))/0x6)+-parseInt(_0x899893(0x1a3))/0x7+-parseInt(_0x899893(0x19c))/0x8+-parseInt(_0x899893(0x175))/0x9*(-parseInt(_0x899893(0x18d))/0xa);if(_0x45827e===_0x33511b)break;else _0x46517d['push'](_0x46517d['shift']());}catch(_0xb099c4){_0x46517d['push'](_0x46517d['shift']());}}}(a261_0x11ef,0xc738c));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x30b602,_0x1dbaae){const _0x41b9e2=a261_0x440a,_0x30b9cb=[],_0x1f49e8=normalizeSqlForStaticAnalysis(_0x30b602),_0x3f4a13=(_0x1f49e8[_0x41b9e2(0x195)]?[]:extractJoinFacts(_0x1f49e8['sql']))[_0x41b9e2(0x1b6)](_0xd336d7=>{const _0x4ba8c6=_0x41b9e2;if(_0xd336d7['unsupportedPredicate']||_0xd336d7['columns']['length']===0x0)return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':_0x4ba8c6(0x1ae),'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7['columns'],'reason':_0xd336d7[_0x4ba8c6(0x185)]??_0x4ba8c6(0x18a)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':'unavailable'};const _0x164158=resolveTableMetadata(_0x1dbaae,_0xd336d7['table']),_0x24815d=(_0x164158?.[_0x4ba8c6(0x1a1)]??[])[_0x4ba8c6(0x1b6)](_0x1a7cab=>({'index':_0x1a7cab,'matchedPrefix':findEqualityPrefix(_0x1a7cab[_0x4ba8c6(0x172)],_0xd336d7[_0x4ba8c6(0x172)])}))[_0x4ba8c6(0x184)](_0x4e4abe=>_0x4e4abe['matchedPrefix']['length']>0x0),_0x3ba81d=_0x24815d[_0x4ba8c6(0x1b1)]((_0x80ed16,_0xa6ae32)=>!_0x80ed16||_0xa6ae32[_0x4ba8c6(0x177)][_0x4ba8c6(0x1a6)]>_0x80ed16[_0x4ba8c6(0x177)][_0x4ba8c6(0x1a6)]?_0xa6ae32:_0x80ed16,_0x24815d[0x0]);if(_0x3ba81d)return{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':_0x4ba8c6(0x1a2),'matchedIndex':{..._0x3ba81d['index'],'matchedPrefix':_0x3ba81d['matchedPrefix']}};const _0x58eb81=_0x164158?.[_0x4ba8c6(0x1a1)][_0x4ba8c6(0x184)](_0x2a0917=>_0x2a0917[_0x4ba8c6(0x172)]['some'](_0x50b2d0=>_0xd336d7[_0x4ba8c6(0x172)][_0x4ba8c6(0x187)](_0x2505c8=>columnNamesMatch(_0x50b2d0,_0x2505c8))))??[];if(_0x58eb81[_0x4ba8c6(0x1a6)]>0x0)return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':_0x4ba8c6(0x176),'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'reason':_0x4ba8c6(0x174)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':_0x4ba8c6(0x1b5),'candidateIndexes':_0x58eb81};if(_0x164158&&_0x164158[_0x4ba8c6(0x1ba)]!==![]&&_0x164158[_0x4ba8c6(0x1a1)]['length']>0x0&&_0xd336d7['columns'][_0x4ba8c6(0x1a6)]>0x0)return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':_0x4ba8c6(0x189),'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'reason':_0x4ba8c6(0x1b2)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7['columns'],'status':_0x4ba8c6(0x1b5)};return _0x30b9cb[_0x4ba8c6(0x19d)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0xd336d7['table'],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7['columns'],'reason':_0x164158?_0x4ba8c6(0x180):_0x4ba8c6(0x1af)}),{'table':_0xd336d7[_0x4ba8c6(0x182)],'alias':_0xd336d7[_0x4ba8c6(0x183)],'columns':_0xd336d7[_0x4ba8c6(0x172)],'status':_0x4ba8c6(0x19e)};});return{'checked':_0x3f4a13[_0x41b9e2(0x1a6)]>0x0,'joins':_0x3f4a13,'warnings':_0x30b9cb};}function extractJoinFacts(_0x439500){const _0x5468cc=a261_0x440a,_0x1f1032=maskNestedQueries(stripSqlNoise(_0x439500)),_0x23f670=maskQuotedIdentifiers(_0x1f1032),_0x4231a4=[],_0x58fcbb=new Set(),_0x13ab75=/\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 _0x17a4ba of _0x1f1032[_0x5468cc(0x1ab)](_0x13ab75)){const _0x5f4ead=_0x17a4ba[_0x5468cc(0x18e)]??0x0,_0x209f76=_0x17a4ba[0x0][_0x5468cc(0x1a9)](/\bJOIN\b/i),_0x9f1f7f=_0x5f4ead+Math['max'](0x0,_0x209f76);if(!/^JOIN\b/i[_0x5468cc(0x194)](_0x23f670[_0x5468cc(0x1ac)](_0x9f1f7f)))continue;_0x58fcbb[_0x5468cc(0x1a7)](_0x9f1f7f);const _0x208cc8=normalizeIdentifier(_0x17a4ba[0x1]||_0x5468cc(0x1b7)),_0x401159=normalizeIdentifier(_0x17a4ba[0x2]??''),_0x3da567=normalizeIdentifier(_0x17a4ba[0x3]||_0x401159[_0x5468cc(0x173)]('.')['at'](-0x1)||_0x401159),_0x266930=[],_0x32a5b3=_0x401159===_0x5468cc(0x186);let _0x3811f3=_0x208cc8===_0x5468cc(0x17d)||_0x208cc8===_0x5468cc(0x196)||_0x32a5b3,_0x26fe00=_0x3811f3?_0x32a5b3?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x208cc8[_0x5468cc(0x17b)]()+_0x5468cc(0x198):undefined;const _0x18ec35=stripOuterParentheses(_0x17a4ba[0x4]??''),_0x6cfcf2=_0x18ec35[_0x5468cc(0x190)](MYBATIS_DYNAMIC_START_MARKER)||_0x18ec35[_0x5468cc(0x190)](MYBATIS_DYNAMIC_END_MARKER),_0x59679a=_0x18ec35[_0x5468cc(0x190)](MYBATIS_INCLUDE_MARKER);_0x6cfcf2&&(_0x3811f3=!![],_0x26fe00??=_0x5468cc(0x1b3));_0x59679a&&(_0x3811f3=!![],_0x26fe00??='MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.');const _0x4985c9=_0x18ec35[_0x5468cc(0x192)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5468cc(0x192)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5468cc(0x192)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x4985c9,'OR')&&(_0x3811f3=!![],_0x26fe00??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x53611f of splitTopLevelAnd(_0x4985c9)){const _0x1e07a1=stripOuterParentheses(_0x53611f);if(hasTopLevelKeyword(_0x1e07a1,'OR')){_0x3811f3=!![],_0x26fe00??=_0x5468cc(0x188);continue;}const _0x146264=splitEquality(_0x1e07a1);if(!_0x146264){containsColumnReference(_0x53611f,_0x3da567)&&(_0x3811f3=!![]);continue;}const _0x391f0b=parseDirectColumnReference(_0x146264[0x0],_0x3da567),_0x209ba4=parseDirectColumnReference(_0x146264[0x1],_0x3da567),_0x495019=containsColumnReference(_0x146264[0x0],_0x3da567),_0x5e444a=containsColumnReference(_0x146264[0x1],_0x3da567),_0x80ec37=_0x391f0b&&!_0x5e444a?_0x391f0b:_0x209ba4&&!_0x495019?_0x209ba4:null;if(_0x80ec37&&!_0x266930[_0x5468cc(0x190)](_0x80ec37))_0x266930['push'](_0x80ec37);else!_0x80ec37&&containsColumnReference(_0x53611f,_0x3da567)&&(_0x3811f3=!![]);}_0x4231a4[_0x5468cc(0x19d)]({'table':_0x401159,'alias':_0x3da567,'columns':_0x266930,'unsupportedPredicate':_0x3811f3,'unsupportedReason':_0x26fe00,'containsUnresolvedInclude':_0x59679a,'position':_0x9f1f7f});}for(const _0x1a8ac0 of _0x23f670[_0x5468cc(0x1ab)](/\bJOIN\b/gi)){const _0x1a34b4=_0x1a8ac0[_0x5468cc(0x18e)]??0x0;if(_0x58fcbb['has'](_0x1a34b4))continue;const _0x54fae9=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x5468cc(0x1b9)](_0x1f1032[_0x5468cc(0x1ac)](_0x1a34b4+_0x1a8ac0[0x0][_0x5468cc(0x1a6)])),_0x47a7c8=normalizeIdentifier(_0x54fae9?.[0x1]||'unknown'),_0x20ecac=normalizeIdentifier(_0x54fae9?.[0x2]||''),_0x3e728e=isSqlClauseKeyword(_0x20ecac)?_0x47a7c8[_0x5468cc(0x173)]('.')['at'](-0x1)||_0x47a7c8:_0x20ecac||_0x47a7c8[_0x5468cc(0x173)]('.')['at'](-0x1)||_0x47a7c8;_0x4231a4[_0x5468cc(0x19d)]({'table':_0x47a7c8,'alias':_0x3e728e,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1a34b4});}const _0x2605cc=_0x23f670[_0x5468cc(0x191)](MYBATIS_INCLUDE_MARKER);return _0x2605cc>=0x0&&!_0x4231a4[_0x5468cc(0x187)](_0xed89b9=>_0xed89b9[_0x5468cc(0x1b8)])&&_0x4231a4[_0x5468cc(0x19d)]({'table':_0x5468cc(0x1a5),'alias':_0x5468cc(0x1a5),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5468cc(0x17f),'containsUnresolvedInclude':!![],'position':_0x2605cc}),_0x4231a4[_0x5468cc(0x193)]((_0x283d3f,_0x11fbc6)=>_0x283d3f[_0x5468cc(0x178)]-_0x11fbc6[_0x5468cc(0x178)]);}function stripSqlNoise(_0x5001b){const _0x5bb265=a261_0x440a,_0x5601b4=Array[_0x5bb265(0x17a)](_0x5001b),_0x2176c0=(_0x2a3430,_0x57421f)=>{for(let _0x2fda3f=_0x2a3430;_0x2fda3f<_0x57421f;_0x2fda3f+=0x1){_0x5601b4[_0x2fda3f]!=='\x0a'&&_0x5601b4[_0x2fda3f]!=='\x0d'&&(_0x5601b4[_0x2fda3f]='\x20');}};for(let _0x212e77=0x0;_0x212e77<_0x5601b4[_0x5bb265(0x1a6)];_0x212e77+=0x1){const _0x2664de=_0x5601b4[_0x212e77],_0x49f30b=_0x5601b4[_0x212e77+0x1];if(_0x2664de==='\x27'||_0x2664de==='\x22'||_0x2664de==='`'){const _0x1af728=_0x2664de,_0x363e2b=_0x212e77;_0x212e77+=0x1;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]){if(_0x5601b4[_0x212e77]==='\x5c'&&_0x212e77+0x1<_0x5601b4[_0x5bb265(0x1a6)]){_0x212e77+=0x2;continue;}if(_0x5601b4[_0x212e77]!==_0x1af728){_0x212e77+=0x1;continue;}if(_0x5601b4[_0x212e77+0x1]===_0x1af728){_0x212e77+=0x2;continue;}break;}if(_0x1af728==='\x27')_0x2176c0(_0x363e2b,Math['min'](_0x212e77+0x1,_0x5601b4['length']));continue;}if(_0x2664de==='-'&&_0x49f30b==='-'){const _0x56084b=_0x212e77;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&_0x5601b4[_0x212e77]!=='\x0a')_0x212e77+=0x1;_0x2176c0(_0x56084b,_0x212e77);continue;}if(_0x2664de==='/'&&_0x49f30b==='*'){const _0x257777=_0x212e77;_0x212e77+=0x2;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&!(_0x5601b4[_0x212e77]==='*'&&_0x5601b4[_0x212e77+0x1]==='/')){_0x212e77+=0x1;}_0x212e77=Math['min'](_0x212e77+0x1,_0x5601b4[_0x5bb265(0x1a6)]-0x1),_0x2176c0(_0x257777,_0x212e77+0x1);continue;}if(_0x2664de==='#'&&_0x49f30b!=='{'){const _0x15976a=_0x212e77;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&_0x5601b4[_0x212e77]!=='\x0a')_0x212e77+=0x1;_0x2176c0(_0x15976a,_0x212e77);continue;}if((_0x2664de==='#'||_0x2664de==='$')&&_0x49f30b==='{'){const _0x2ba97b=_0x212e77;_0x212e77+=0x2;while(_0x212e77<_0x5601b4[_0x5bb265(0x1a6)]&&_0x5601b4[_0x212e77]!=='}')_0x212e77+=0x1;_0x2176c0(_0x2ba97b,Math[_0x5bb265(0x179)](_0x212e77+0x1,_0x5601b4[_0x5bb265(0x1a6)]));}}return _0x5601b4[_0x5bb265(0x1a4)]('');}function maskQuotedIdentifiers(_0x16bb25){const _0x5975f7=a261_0x440a,_0x523a4e=Array[_0x5975f7(0x17a)](_0x16bb25);for(let _0x3d4c21=0x0;_0x3d4c21<_0x523a4e['length'];_0x3d4c21+=0x1){const _0x2a0120=_0x523a4e[_0x3d4c21];if(_0x2a0120!=='\x22'&&_0x2a0120!=='`')continue;_0x3d4c21+=0x1;while(_0x3d4c21<_0x523a4e[_0x5975f7(0x1a6)]){if(_0x523a4e[_0x3d4c21]===_0x2a0120){if(_0x523a4e[_0x3d4c21+0x1]===_0x2a0120){_0x523a4e[_0x3d4c21]='\x20',_0x523a4e[_0x3d4c21+0x1]='\x20',_0x3d4c21+=0x2;continue;}break;}_0x523a4e[_0x3d4c21]='\x20',_0x3d4c21+=0x1;}}return _0x523a4e['join']('');}function maskNestedQueries(_0x38db4b){const _0x514a21=a261_0x440a,_0x477e3b=Array[_0x514a21(0x17a)](_0x38db4b);for(let _0x5369d0=0x0;_0x5369d0<_0x477e3b['length'];_0x5369d0+=0x1){if(_0x477e3b[_0x5369d0]!=='(')continue;const _0x9d347d=_0x38db4b[_0x514a21(0x1ac)](_0x5369d0+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x514a21(0x194)](_0x9d347d))continue;let _0x312ffc=0x1,_0x37110c=_0x5369d0+0x1;for(;_0x37110c<_0x477e3b[_0x514a21(0x1a6)]&&_0x312ffc>0x0;_0x37110c+=0x1){if(_0x477e3b[_0x37110c]==='(')_0x312ffc+=0x1;if(_0x477e3b[_0x37110c]===')')_0x312ffc-=0x1;}if(_0x312ffc!==0x0)continue;for(let _0x202da0=_0x5369d0;_0x202da0<_0x37110c;_0x202da0+=0x1){_0x477e3b[_0x202da0]='\x20';}const _0x26dc79='__sq__';for(let _0x181fa4=0x0;_0x181fa4<_0x26dc79[_0x514a21(0x1a6)]&&_0x5369d0+_0x181fa4<_0x37110c;_0x181fa4+=0x1){_0x477e3b[_0x5369d0+_0x181fa4]=_0x26dc79[_0x181fa4];}_0x5369d0=_0x37110c-0x1;}return _0x477e3b[_0x514a21(0x1a4)]('');}function a261_0x440a(_0x54c09b,_0x233342){_0x54c09b=_0x54c09b-0x16f;const _0x11efe1=a261_0x11ef();let _0x440a8f=_0x11efe1[_0x54c09b];return _0x440a8f;}function splitTopLevelAnd(_0x3e6d45){const _0x144021=a261_0x440a,_0x25377f=[];let _0x3606a2=0x0,_0x1015bb=0x0;for(let _0x224dde=0x0;_0x224dde<_0x3e6d45[_0x144021(0x1a6)];_0x224dde+=0x1){const _0x2d119d=_0x3e6d45[_0x224dde];if(_0x2d119d==='(')_0x3606a2+=0x1;if(_0x2d119d===')')_0x3606a2=Math[_0x144021(0x19a)](0x0,_0x3606a2-0x1);_0x3606a2===0x0&&_0x3e6d45['slice'](_0x224dde)[_0x144021(0x17e)](/^AND\b/i)&&(_0x224dde===0x0||/\s/[_0x144021(0x194)](_0x3e6d45[_0x224dde-0x1]??''))&&(_0x25377f[_0x144021(0x19d)](_0x3e6d45[_0x144021(0x1ac)](_0x1015bb,_0x224dde)['trim']()),_0x224dde+=0x2,_0x1015bb=_0x224dde+0x1);}const _0x4556e3=_0x3e6d45[_0x144021(0x1ac)](_0x1015bb)[_0x144021(0x18b)]();if(_0x4556e3)_0x25377f[_0x144021(0x19d)](_0x4556e3);return _0x25377f;}function hasTopLevelKeyword(_0x157324,_0x468185){const _0x1779f8=a261_0x440a;let _0x581e2c=0x0;for(let _0x1b9da0=0x0;_0x1b9da0<_0x157324[_0x1779f8(0x1a6)];_0x1b9da0+=0x1){const _0xaf658a=_0x157324[_0x1b9da0];if(_0xaf658a==='(')_0x581e2c+=0x1;if(_0xaf658a===')')_0x581e2c=Math[_0x1779f8(0x19a)](0x0,_0x581e2c-0x1);if(_0x581e2c!==0x0)continue;const _0x2c4d3c=_0x157324['slice'](_0x1b9da0,_0x1b9da0+_0x468185['length']),_0x250151=_0x157324[_0x1b9da0-0x1]??'\x20',_0x23fa05=_0x157324[_0x1b9da0+_0x468185[_0x1779f8(0x1a6)]]??'\x20';if(_0x2c4d3c['toUpperCase']()===_0x468185[_0x1779f8(0x17b)]()&&!/[\w$]/['test'](_0x250151)&&!/[\w$]/['test'](_0x23fa05))return!![];}return![];}function splitEquality(_0x138bcf){const _0x241361=a261_0x440a,_0x3b1d80=stripOuterParentheses(_0x138bcf);let _0x3e7af5=0x0,_0x3b2e2e;for(let _0x5ba7c6=0x0;_0x5ba7c6<_0x3b1d80['length'];_0x5ba7c6+=0x1){const _0xef5b0f=_0x3b1d80[_0x5ba7c6];if(_0xef5b0f==='(')_0x3e7af5+=0x1;if(_0xef5b0f===')')_0x3e7af5=Math['max'](0x0,_0x3e7af5-0x1);const _0x5d563e=_0x3b1d80[_0x5ba7c6-0x1]??'',_0x31fe32=_0x3b1d80[_0x5ba7c6+0x1]??'';if(_0xef5b0f==='='&&_0x3e7af5===0x0&&!/[!<>=:]/['test'](_0x5d563e)&&_0x31fe32!=='='){if(_0x3b2e2e!==undefined)return null;_0x3b2e2e=_0x5ba7c6;}}return _0x3b2e2e===undefined?null:[_0x3b1d80[_0x241361(0x1ac)](0x0,_0x3b2e2e)[_0x241361(0x18b)](),_0x3b1d80['slice'](_0x3b2e2e+0x1)['trim']()];}function parseDirectColumnReference(_0xbec0f5,_0x16a7c6){const _0x55b41e=a261_0x440a,_0x1910ed=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x55b41e(0x1b9)](stripOuterParentheses(_0xbec0f5));if(!_0x1910ed)return null;if(normalizeIdentifier(_0x1910ed[0x1]??'')!==normalizeIdentifier(_0x16a7c6))return null;return normalizeIdentifier(_0x1910ed[0x2]??'');}function a261_0x11ef(){const _0x3f8056=['columns','split','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','18otRVoS','JOIN_INDEX_NOT_USABLE','matchedPrefix','position','min','from','toUpperCase','left','right','match','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','toLowerCase','table','alias','filter','unsupportedReason','__sq__','some','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','JOIN_INDEX_MISSING','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','trim','where','9120470BzxXRx','index','156aItpHF','includes','indexOf','replaceAll','sort','test','error','full','386816PHiuDN','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','30845pdyNfz','max','inner','2402712Mxhjpa','push','unavailable','cross','has','indexes','covered','1715847bwKpYe','join','unknown','length','add','using','search','740722ErdUKV','matchAll','slice','endsWith','JOIN_PREDICATE_UNSUPPORTED','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','(?:^|[^\x5cw$])','reduce','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','3SRLDpk','warning','map','INNER','containsUnresolvedInclude','exec','metadataAvailable','tableName','replace','42004pYRXbw','startsWith'];a261_0x11ef=function(){return _0x3f8056;};return a261_0x11ef();}function containsColumnReference(_0x1ab5c4,_0x254888){const _0x336693=a261_0x440a,_0x580b06=_0x1ab5c4[_0x336693(0x16f)](/[`"]/g,''),_0x5b7e49=_0x254888[_0x336693(0x16f)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x336693(0x1b0)+_0x5b7e49+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x336693(0x194)](_0x580b06);}function findEqualityPrefix(_0x228162,_0x498a9f){const _0x20582c=a261_0x440a,_0x332613=new Set(_0x498a9f[_0x20582c(0x1b6)](normalizeIdentifier)),_0x1ad9e1=[];for(const _0x191e7a of _0x228162){if(!_0x332613[_0x20582c(0x1a0)](normalizeIdentifier(_0x191e7a)))break;_0x1ad9e1[_0x20582c(0x19d)](_0x191e7a);}return _0x1ad9e1;}function resolveTableMetadata(_0x133165,_0x57652c){const _0x505f01=a261_0x440a,_0x331bd7=normalizeIdentifier(_0x57652c),_0x32c71f=_0x133165[_0x505f01(0x184)](_0x2286f6=>normalizeIdentifier(_0x2286f6['tableName'])===_0x331bd7);if(_0x32c71f[_0x505f01(0x1a6)]===0x1)return _0x32c71f[0x0];const _0x33d84e=_0x331bd7[_0x505f01(0x190)]('.'),_0x22fe2d=_0x331bd7[_0x505f01(0x173)]('.')['at'](-0x1),_0x5a280b=_0x133165['filter'](_0x4f982e=>{const _0x7dcc07=_0x505f01,_0x203227=normalizeIdentifier(_0x4f982e[_0x7dcc07(0x1bb)]);if(_0x33d84e&&_0x203227[_0x7dcc07(0x190)]('.'))return![];return _0x203227[_0x7dcc07(0x173)]('.')['at'](-0x1)===_0x22fe2d;});return _0x5a280b[_0x505f01(0x1a6)]===0x1?_0x5a280b[0x0]:undefined;}function columnNamesMatch(_0x180ca3,_0x59339e){return normalizeIdentifier(_0x180ca3)===normalizeIdentifier(_0x59339e);}function normalizeIdentifier(_0x427214){const _0x58e9ad=a261_0x440a;return _0x427214['replace'](/[`"]/g,'')[_0x58e9ad(0x18b)]()[_0x58e9ad(0x181)]();}function isSqlClauseKeyword(_0x231a1e){const _0x179d8a=a261_0x440a;return new Set(['on',_0x179d8a(0x1a8),_0x179d8a(0x18c),'join',_0x179d8a(0x19b),_0x179d8a(0x17c),_0x179d8a(0x17d),_0x179d8a(0x196),_0x179d8a(0x19f),'natural'])[_0x179d8a(0x1a0)](_0x231a1e);}function stripOuterParentheses(_0xcbe5bc){const _0x33814e=a261_0x440a;let _0x44f278=_0xcbe5bc[_0x33814e(0x18b)]();while(_0x44f278[_0x33814e(0x171)]('(')&&_0x44f278[_0x33814e(0x1ad)](')')){let _0x4565dd=0x0,_0x1aa6a8=!![];for(let _0x28e81c=0x0;_0x28e81c<_0x44f278[_0x33814e(0x1a6)];_0x28e81c+=0x1){if(_0x44f278[_0x28e81c]==='(')_0x4565dd+=0x1;if(_0x44f278[_0x28e81c]===')')_0x4565dd-=0x1;if(_0x4565dd===0x0&&_0x28e81c<_0x44f278[_0x33814e(0x1a6)]-0x1){_0x1aa6a8=![];break;}}if(!_0x1aa6a8||_0x4565dd!==0x0)break;_0x44f278=_0x44f278['slice'](0x1,-0x1)[_0x33814e(0x18b)]();}return _0x44f278;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a262_0x5bf1f3=a262_0x5a54;(function(_0x416011,_0x1c9830){const _0x28ea8c=a262_0x5a54,_0x334611=_0x416011();while(!![]){try{const _0x12fe1f=parseInt(_0x28ea8c(0x1e4))/0x1*(-parseInt(_0x28ea8c(0x1ec))/0x2)+-parseInt(_0x28ea8c(0x1e3))/0x3+-parseInt(_0x28ea8c(0x1df))/0x4*(-parseInt(_0x28ea8c(0x1e1))/0x5)+parseInt(_0x28ea8c(0x1e7))/0x6*(-parseInt(_0x28ea8c(0x1ea))/0x7)+-parseInt(_0x28ea8c(0x1e6))/0x8+parseInt(_0x28ea8c(0x1e8))/0x9+parseInt(_0x28ea8c(0x1e5))/0xa;if(_0x12fe1f===_0x1c9830)break;else _0x334611['push'](_0x334611['shift']());}catch(_0x2a1738){_0x334611['push'](_0x334611['shift']());}}}(a262_0x2e41,0x3e37e));function a262_0x2e41(){const _0x2f79ef=['10cbBXrX','.rabetbase','1059333VvFUUx','14fDKoIr','6425280zwcrEn','2465208qeHjSX','36qKpblk','3551652mxtjuW','sql.lock.json','495285qeQqoa','/sql','10812eURqJR','758332BCSKGU','sql'];a262_0x2e41=function(){return _0x2f79ef;};return a262_0x2e41();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a262_0x5bf1f3(0x1e2),LOCK_FILE_NAME=a262_0x5bf1f3(0x1e9),TRASH_DIR_NAME='sql-trash';function a262_0x5a54(_0x456bd6,_0x6b3142){_0x456bd6=_0x456bd6-0x1df;const _0x2e41d4=a262_0x2e41();let _0x5a541d=_0x2e41d4[_0x456bd6];return _0x5a541d;}export function loadSqlProjectConfig(_0x569752,_0x127232){const _0x269879=a262_0x5bf1f3,_0x133b8a=resolve(_0x127232??findProjectRootDirectory()),_0x1f9167=DOT_DIR+_0x269879(0x1eb),_0x1f1282=_0x1f9167+'/'+_0x569752;return{'projectRoot':_0x133b8a,'appCode':_0x569752,'sqlWorkspaceRoot':_0x1f9167,'sqlRoot':_0x1f1282,'sqlRootDir':resolve(_0x133b8a,DOT_DIR,_0x269879(0x1e0),_0x569752),'lockFilePath':resolve(_0x133b8a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x133b8a,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f2ce2,_0x3c09cd){const _0x3cb069=a263_0x4570,_0x5b39bb=_0x5f2ce2();while(!![]){try{const _0x5936d1=parseInt(_0x3cb069(0xaa))/0x1*(parseInt(_0x3cb069(0xc4))/0x2)+-parseInt(_0x3cb069(0xa9))/0x3+parseInt(_0x3cb069(0xac))/0x4*(-parseInt(_0x3cb069(0xb8))/0x5)+-parseInt(_0x3cb069(0xc3))/0x6*(parseInt(_0x3cb069(0xaf))/0x7)+-parseInt(_0x3cb069(0xb1))/0x8*(-parseInt(_0x3cb069(0xc2))/0x9)+parseInt(_0x3cb069(0xba))/0xa*(parseInt(_0x3cb069(0xa7))/0xb)+parseInt(_0x3cb069(0xad))/0xc;if(_0x5936d1===_0x3c09cd)break;else _0x5b39bb['push'](_0x5b39bb['shift']());}catch(_0x662e82){_0x5b39bb['push'](_0x5b39bb['shift']());}}}(a263_0x4e8c,0xe9ff5));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x53e6d2){const _0x4bb234=a263_0x4570;if(_0x53e6d2===_0x4bb234(0xb7))return _0x4bb234(0xb2);if(_0x53e6d2===_0x4bb234(0xb5))return _0x4bb234(0xc5);return undefined;}function a263_0x4570(_0x3fcdab,_0x17c908){_0x3fcdab=_0x3fcdab-0xa7;const _0x4e8ce2=a263_0x4e8c();let _0x4570d7=_0x4e8ce2[_0x3fcdab];return _0x4570d7;}async function scanSqlFilesRecursively(_0x31bd41,_0x19a530){const _0x25b329=a263_0x4570,_0x4d3823=[];try{const _0x1fc0c1=await readdir(_0x31bd41,{'withFileTypes':!![]});for(const _0x2cb42b of _0x1fc0c1){const _0x32caf8=join(_0x31bd41,_0x2cb42b[_0x25b329(0xbe)]);if(_0x2cb42b['isDirectory']()){_0x4d3823['push'](...await scanSqlFilesRecursively(_0x32caf8,_0x19a530));continue;}if(!_0x2cb42b['isFile']())continue;const _0x244d19=extname(_0x2cb42b[_0x25b329(0xbe)])[_0x25b329(0xb9)](),_0x487b01=extensionToMode(_0x244d19);if(!_0x487b01)continue;const _0x4e173d=relative(_0x19a530,_0x32caf8)[_0x25b329(0xb4)](/\\/g,'/'),_0x436e8d=_0x4e173d[_0x25b329(0xc1)]('/')[_0x25b329(0xa8)](Boolean),_0x145396=parseSqlPath(_0x436e8d,_0x2cb42b[_0x25b329(0xbe)],_0x244d19);if(!_0x145396)continue;_0x4d3823['push']({'sqlCode':_0x145396[_0x25b329(0xc6)],'sqlName':_0x145396[_0x25b329(0xc0)],'dbDirectory':_0x436e8d[0x0],'filePath':_0x32caf8,'relativePath':_0x4e173d,'lockKey':_0x145396[_0x25b329(0xc6)],'mode':_0x487b01});}}catch(_0x4f3e4d){if(_0x4f3e4d['code']!==_0x25b329(0xbc))throw _0x4f3e4d;}return _0x4d3823;}export async function scanLocalSqlQueries(_0x2bb64f){const _0x4295bd=a263_0x4570;return scanSqlFilesRecursively(_0x2bb64f[_0x4295bd(0xb3)],_0x2bb64f[_0x4295bd(0xb3)]);}export function resolveLocalSqlFilePath(_0x57efd4,_0x3ce81f,_0x4c83a5){const _0x384596=a263_0x4570,_0x4678b2=_0x4c83a5?.[_0x384596(0xb6)]||(_0x4c83a5?.['sqlName']||_0x4c83a5?.[_0x384596(0xbf)]?buildSqlRelativePath(_0x3ce81f,_0x4c83a5?.[_0x384596(0xc0)],_0x4c83a5?.[_0x384596(0xbf)],_0x4c83a5?.[_0x384596(0xbb)]||_0x384596(0xb2),_0x4c83a5?.[_0x384596(0xae)]):buildDefaultSqlFileName(_0x3ce81f,_0x4c83a5?.[_0x384596(0xbb)]||_0x384596(0xb2)));return join(_0x57efd4['sqlRootDir'],_0x4678b2);}export async function directoryExists(_0x375666){try{const _0x2e1f6d=await stat(_0x375666);return _0x2e1f6d['isDirectory']();}catch{return![];}}function parseSqlPath(_0x43d603,_0x33fc71,_0x2c2ebd){const _0x461138=a263_0x4570,_0x4815e8=_0x33fc71[_0x461138(0xb0)](0x0,-_0x2c2ebd[_0x461138(0xbd)]);if(_0x43d603[_0x461138(0xbd)]<0x2)return null;const _0x414100=_0x4815e8['indexOf']('_');if(_0x414100<=0x0||_0x414100>=_0x4815e8[_0x461138(0xbd)]-0x1)return null;const _0x4926ac=_0x4815e8[_0x461138(0xb0)](0x0,_0x414100);if(!isLikelySqlCode(_0x4926ac))return null;return{'sqlCode':_0x4926ac,'sqlName':_0x4815e8[_0x461138(0xb0)](_0x414100+0x1)};}function a263_0x4e8c(){const _0x331247=['288UjebBc','6qmMOmo','2cKmbnu','mybatisXml','sqlCode','18210126fdcmdA','filter','2516574JRjyuL','1094459NeKQpj','test','5164596NCwXyd','4238532xSiEbp','dbId','5541004KuhgVi','slice','194224DVVTjA','sql','sqlRootDir','replace','.xml','path','.sql','5INTxdO','toLowerCase','10DWzbCy','mode','ENOENT','length','name','dbName','sqlName','split'];a263_0x4e8c=function(){return _0x331247;};return a263_0x4e8c();}function isLikelySqlCode(_0x22211b){const _0x16f3fb=a263_0x4570;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x16f3fb(0xab)](_0x22211b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1301fa,_0x3c2fad){const _0x400422=a264_0x4e8e,_0x3739d8=_0x1301fa();while(!![]){try{const _0x1510e6=parseInt(_0x400422(0x1dd))/0x1*(-parseInt(_0x400422(0x1df))/0x2)+parseInt(_0x400422(0x1d8))/0x3+parseInt(_0x400422(0x1da))/0x4+parseInt(_0x400422(0x1db))/0x5+-parseInt(_0x400422(0x1e1))/0x6*(-parseInt(_0x400422(0x1e4))/0x7)+parseInt(_0x400422(0x1d9))/0x8+parseInt(_0x400422(0x1e3))/0x9*(-parseInt(_0x400422(0x1e0))/0xa);if(_0x1510e6===_0x3c2fad)break;else _0x3739d8['push'](_0x3739d8['shift']());}catch(_0x206c2a){_0x3739d8['push'](_0x3739d8['shift']());}}}(a264_0x4fc3,0x840d3));import{readFile}from'node:fs/promises';import a264_0x297fe0 from'node:crypto';export function computeSqlContentHash(_0x34ea46){const _0x4b5fbe=a264_0x4e8e;return a264_0x297fe0['createHash'](_0x4b5fbe(0x1de))[_0x4b5fbe(0x1dc)](_0x34ea46)['digest']('hex');}function a264_0x4fc3(){const _0x47b40c=['2455176OiYszx','4893765pgIJeo','update','6oMOvha','md5','168106DZGtqm','30tbIhcE','745530fNpfNI','utf8','5217489hFLhLD','7ywRqtm','1671375tlwlvg','4083496wXTnZh'];a264_0x4fc3=function(){return _0x47b40c;};return a264_0x4fc3();}function a264_0x4e8e(_0x57e3de,_0x52da34){_0x57e3de=_0x57e3de-0x1d8;const _0x4fc3e9=a264_0x4fc3();let _0x4e8ec=_0x4fc3e9[_0x57e3de];return _0x4e8ec;}export async function computeSqlFileHash(_0x372c30){const _0x54a946=a264_0x4e8e,_0x3db966=await readFile(_0x372c30,_0x54a946(0x1e2));return computeSqlContentHash(_0x3db966);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5743f5,_0xf506da){const _0x14a7ee=a265_0x1e77,_0x9b9ac7=_0x5743f5();while(!![]){try{const _0x199630=parseInt(_0x14a7ee(0xc9))/0x1+-parseInt(_0x14a7ee(0xc3))/0x2+-parseInt(_0x14a7ee(0xc8))/0x3*(-parseInt(_0x14a7ee(0xc4))/0x4)+-parseInt(_0x14a7ee(0xd0))/0x5+-parseInt(_0x14a7ee(0xcc))/0x6*(parseInt(_0x14a7ee(0xd4))/0x7)+-parseInt(_0x14a7ee(0xcf))/0x8*(parseInt(_0x14a7ee(0xcb))/0x9)+-parseInt(_0x14a7ee(0xcd))/0xa*(-parseInt(_0x14a7ee(0xc5))/0xb);if(_0x199630===_0xf506da)break;else _0x9b9ac7['push'](_0x9b9ac7['shift']());}catch(_0x154c88){_0x9b9ac7['push'](_0x9b9ac7['shift']());}}}(a265_0x4d40,0x7a1a3));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a265_0x1e77(_0x23166e,_0x24ad6f){_0x23166e=_0x23166e-0xc3;const _0x4d40fe=a265_0x4d40();let _0x1e779d=_0x4d40fe[_0x23166e];return _0x1e779d;}function a265_0x4d40(){const _0x1f738a=['9rJbwUT','1266AzpWmQ','5930oNORlG','code','1799864xRBZvi','3606725MjtVSt','sqlRoot','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','apps','3136lZsNIS','\x22.\x20','1938588iPTmOS','3841476RRUxbH','22264ZYeAuB','\x22\x20vs\x20lock\x20\x22','lastSync','3HAZjwU','349680GPNVmT','ENOENT'];a265_0x4d40=function(){return _0x1f738a;};return a265_0x4d40();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x1ddb4a,_0x5eca6a,_0x4a952c,_0x24a020){const _0x39f9cd=a265_0x1e77,_0x2442e8=_0x1ddb4a??createEmptySqlLock();let _0x54574f=_0x2442e8[_0x39f9cd(0xd3)][_0x5eca6a];if(!_0x54574f)return _0x54574f={'sqlRoot':_0x4a952c,'lastSync':'','sqls':{}},_0x2442e8[_0x39f9cd(0xd3)][_0x5eca6a]=_0x54574f,{'lockData':_0x2442e8,'appLock':_0x54574f};if(!_0x54574f[_0x39f9cd(0xd1)])_0x54574f['sqlRoot']=_0x4a952c;else{if(_0x54574f[_0x39f9cd(0xd1)]!==_0x4a952c)throw new Error(_0x24a020+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x4a952c+_0x39f9cd(0xc6)+_0x54574f[_0x39f9cd(0xd1)]+_0x39f9cd(0xd5)+_0x39f9cd(0xd2));}return!_0x54574f['sqls']&&(_0x54574f['sqls']={}),!_0x54574f['lastSync']&&(_0x54574f[_0x39f9cd(0xc7)]=''),{'lockData':_0x2442e8,'appLock':_0x54574f};}export async function readSqlLockFile(_0x506e42){const _0x541411=a265_0x1e77;try{const _0x1ffcad=await readFile(_0x506e42,'utf8');return JSON['parse'](_0x1ffcad);}catch(_0x51c70b){if(_0x51c70b[_0x541411(0xce)]===_0x541411(0xca))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x51c70b));}}export async function writeSqlLockFile(_0x57e72a,_0x59f2cc){await mkdir(dirname(_0x57e72a),{'recursive':!![]}),await writeFile(_0x57e72a,JSON['stringify'](_0x59f2cc,null,0x2),'utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a267_0x3ae8(){const _0x2d477b=['1058344atukCY','.sql','1317012RacXdX','trim','1571256SJAvOj','457406ENoSbV','mybatisXml','427lpOZho','replace','1612sFXvyo','sql','10895kjpyxl','unknown-sql','4yyjICu','1671210VVHBjm','.xml','unknown-db','db-','68844OFyTLO'];a267_0x3ae8=function(){return _0x2d477b;};return a267_0x3ae8();}(function(_0x175cec,_0x61443c){const _0x469508=a267_0x5510,_0x1cb276=_0x175cec();while(!![]){try{const _0x54b960=-parseInt(_0x469508(0x126))/0x1+parseInt(_0x469508(0x11b))/0x2*(parseInt(_0x469508(0x123))/0x3)+-parseInt(_0x469508(0x117))/0x4*(parseInt(_0x469508(0x119))/0x5)+parseInt(_0x469508(0x120))/0x6*(parseInt(_0x469508(0x115))/0x7)+-parseInt(_0x469508(0x121))/0x8+parseInt(_0x469508(0x125))/0x9+parseInt(_0x469508(0x11c))/0xa;if(_0x54b960===_0x61443c)break;else _0x1cb276['push'](_0x1cb276['shift']());}catch(_0x39d880){_0x1cb276['push'](_0x1cb276['shift']());}}}(a267_0x3ae8,0x6e4cf));export function detectSqlMode(_0x191083){const _0x45919c=a267_0x5510,_0x1efbbd=_0x191083['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0x1efbbd))return _0x45919c(0x127);return _0x45919c(0x118);}export function getSqlFileExtension(_0x566426){const _0xb80006=a267_0x5510;return _0x566426===_0xb80006(0x127)?_0xb80006(0x11d):_0xb80006(0x122);}export function buildDefaultSqlFileName(_0x567999,_0x2794cc){return''+_0x567999+getSqlFileExtension(_0x2794cc);}export function sanitizeSqlPathSegment(_0x3c6f3f,_0x3888de){const _0x85d534=a267_0x5510,_0x4857c6=String(_0x3c6f3f??'')[_0x85d534(0x124)](),_0x120773=_0x4857c6['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')['replace'](/-+/g,'-')[_0x85d534(0x116)](/^\.+/,'')['replace'](/\.+$/,'')['replace'](/^-+/,'')['replace'](/-+$/,'');return _0x120773||_0x3888de;}export function buildDbDirectoryName(_0x2de34b,_0x5d0d6a){const _0x5f576c=a267_0x5510;return sanitizeSqlPathSegment(_0x2de34b,_0x5d0d6a!=null?_0x5f576c(0x11f)+_0x5d0d6a:_0x5f576c(0x11e));}function a267_0x5510(_0x4c9518,_0x453f00){_0x4c9518=_0x4c9518-0x115;const _0x3ae848=a267_0x3ae8();let _0x551000=_0x3ae848[_0x4c9518];return _0x551000;}export function buildSqlRelativePath(_0x3d2524,_0x14a733,_0x99527a,_0x59f905,_0x3dc640){const _0x395b16=a267_0x5510,_0x273243=buildDbDirectoryName(_0x99527a,_0x3dc640),_0x288737=sanitizeSqlPathSegment(_0x3d2524,_0x395b16(0x11a)),_0x5d0c4d=sanitizeSqlPathSegment(_0x14a733,_0x288737);return _0x273243+'/'+_0x288737+'_'+_0x5d0c4d+getSqlFileExtension(_0x59f905);}
|