@lovrabet/rabetbase-cli 2.5.5-beta.1 → 2.5.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/detail.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/logs.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/page/lr-smart-jsx.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +13 -9
- package/skills/rabetbase-page-generation/references/component-baseline.md +2 -2
- package/skills/rabetbase-page-generation/references/generation.md +64 -15
- package/skills/rabetbase-page-generation/templates/onepage/build.mjs +39 -54
- package/skills/rabetbase-page-generation/templates/onepage/list/index.jsx +6 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a238_0x10cf(_0x2378c8,_0x5982cd){_0x2378c8=_0x2378c8-0xc3;const _0x528d78=a238_0x528d();let _0x10cf52=_0x528d78[_0x2378c8];return _0x10cf52;}const a238_0xaec629=a238_0x10cf;(function(_0x30ba6a,_0x1ed356){const _0xd51dd4=a238_0x10cf,_0x3c1187=_0x30ba6a();while(!![]){try{const _0x15f48e=parseInt(_0xd51dd4(0xd8))/0x1*(parseInt(_0xd51dd4(0xc6))/0x2)+-parseInt(_0xd51dd4(0xd0))/0x3*(-parseInt(_0xd51dd4(0xcd))/0x4)+parseInt(_0xd51dd4(0xcc))/0x5*(-parseInt(_0xd51dd4(0xc9))/0x6)+-parseInt(_0xd51dd4(0xd7))/0x7+parseInt(_0xd51dd4(0xc8))/0x8+parseInt(_0xd51dd4(0xc3))/0x9*(-parseInt(_0xd51dd4(0xd5))/0xa)+parseInt(_0xd51dd4(0xc5))/0xb;if(_0x15f48e===_0x1ed356)break;else _0x3c1187['push'](_0x3c1187['shift']());}catch(_0x165294){_0x3c1187['push'](_0x3c1187['shift']());}}}(a238_0x528d,0x6e8a0));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a238_0xaec629(0xd2),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a238_0xaec629(0xd4),'flags':[SQLCODE_FLAG,{'name':a238_0xaec629(0xda),'type':a238_0xaec629(0xc7),'description':a238_0xaec629(0xd1)}],async 'execute'(_0x5a684d){const _0x50d613=a238_0xaec629,_0x5bec76=await getSqlQueryInfo(_0x5a684d['appCode'],_0x5a684d[_0x50d613(0xd9)](_0x50d613(0xdb))),_0x427b0e=_0x5a684d[_0x50d613(0xd6)]('verbose');if(_0x427b0e)return{'ok':!![],'data':_0x5bec76};const _0x3edc61=_0x5bec76[_0x50d613(0xd3)]?await getDbName(_0x5a684d[_0x50d613(0xca)],_0x5bec76[_0x50d613(0xd3)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x5bec76[_0x50d613(0xcf)],'sqlName':_0x5bec76[_0x50d613(0xc4)],'db':_0x3edc61?_0x3edc61+'\x20('+_0x5bec76[_0x50d613(0xd3)]+')':_0x5bec76[_0x50d613(0xd3)]??'','description':_0x5bec76[_0x50d613(0xce)]??'','sqlContent':_0x5bec76[_0x50d613(0xcb)]??''}};}};function a238_0x528d(){const _0x4b9639=['5702iXUMYo','boolean','7061488SnvYSL','3618ZVPkih','appCode','sqlContent','7015npyYbu','748GSBkSZ','description','sqlCode','8121zSwYlU','Return\x20full\x20raw\x20SQL\x20query\x20object','detail','dbId','read','70kUEMCv','bool','3613918MiQNOW','293xUlWQE','str','verbose','sqlcode','1015425fGxoNP','sqlName','4186468wkSpqt'];a238_0x528d=function(){return _0x4b9639;};return a238_0x528d();}
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a239_0x2f97(_0x3b6a5c,_0x5994e9){_0x3b6a5c=_0x3b6a5c-0x1c2;const _0x235f0f=a239_0x235f();let _0x2f9788=_0x235f0f[_0x3b6a5c];return _0x2f9788;}const a239_0x371c86=a239_0x2f97;(function(_0x4075f7,_0x50d431){const _0x7c2caf=a239_0x2f97,_0x445a42=_0x4075f7();while(!![]){try{const _0x1e9972=parseInt(_0x7c2caf(0x1dd))/0x1+-parseInt(_0x7c2caf(0x1d0))/0x2*(parseInt(_0x7c2caf(0x1c6))/0x3)+-parseInt(_0x7c2caf(0x1c4))/0x4+-parseInt(_0x7c2caf(0x1c9))/0x5*(parseInt(_0x7c2caf(0x1cc))/0x6)+parseInt(_0x7c2caf(0x1d6))/0x7*(-parseInt(_0x7c2caf(0x1d9))/0x8)+-parseInt(_0x7c2caf(0x1d8))/0x9*(parseInt(_0x7c2caf(0x1d3))/0xa)+parseInt(_0x7c2caf(0x1ca))/0xb;if(_0x1e9972===_0x50d431)break;else _0x445a42['push'](_0x445a42['shift']());}catch(_0x251a64){_0x445a42['push'](_0x445a42['shift']());}}}(a239_0x235f,0xac4c0));function a239_0x235f(){const _0x27e2fa=['132410tnejbf','isArray','exec','2952635kXEDTU','execError','576NohWBc','16GoJjYW','sqlcode','read','string','89058uaPPRx','str','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','2563976hkMPOo','params','2904891mtskoL','execSuccess','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','17245tbfsny','52154366OmYOyB','length','1434AwNeAh','appCode','Returned\x20','execResult','2TpWEYX','sql','\x20row(s)\x20in\x20'];a239_0x235f=function(){return _0x27e2fa;};return a239_0x235f();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a239_0x371c86(0x1d1),'command':a239_0x371c86(0x1d5),'description':a239_0x371c86(0x1c3),'risk':a239_0x371c86(0x1db),'flags':[SQLCODE_FLAG,{'name':a239_0x371c86(0x1c5),'type':a239_0x371c86(0x1dc),'description':a239_0x371c86(0x1c8)}],async 'execute'(_0x13db9d){const _0x11b735=a239_0x371c86,_0x549add=parseJsonParams(_0x13db9d[_0x11b735(0x1c2)](_0x11b735(0x1c5))),_0x4667ac=Date['now'](),_0x457fb7=await executeSql(_0x13db9d[_0x11b735(0x1cd)],_0x13db9d['str'](_0x11b735(0x1da)),_0x549add),_0x58aee7=Date['now']()-_0x4667ac,_0x3bb29b=_0x457fb7?.[_0x11b735(0x1cf)]??_0x457fb7,_0x583d7a=_0x457fb7?.[_0x11b735(0x1c7)]??!![];if(!_0x583d7a)return{'ok':![],'data':{'error':_0x457fb7?.[_0x11b735(0x1d7)]||'SQL\x20execution\x20failed','elapsed':_0x58aee7},'message':'SQL\x20execution\x20failed'};const _0x37df85=Array[_0x11b735(0x1d4)](_0x3bb29b)?_0x3bb29b:[];return{'ok':!![],'data':{'rows':_0x37df85,'rowCount':_0x37df85['length'],'elapsed':_0x58aee7},'message':_0x11b735(0x1ce)+_0x37df85[_0x11b735(0x1cb)]+_0x11b735(0x1d2)+_0x58aee7+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e5966,_0x4ff187){const _0x159feb=a240_0x5650,_0x5ebc99=_0x2e5966();while(!![]){try{const _0x792910=parseInt(_0x159feb(0x146))/0x1+-parseInt(_0x159feb(0x14a))/0x2+-parseInt(_0x159feb(0x144))/0x3*(-parseInt(_0x159feb(0x148))/0x4)+parseInt(_0x159feb(0x145))/0x5+parseInt(_0x159feb(0x147))/0x6+parseInt(_0x159feb(0x149))/0x7*(-parseInt(_0x159feb(0x142))/0x8)+parseInt(_0x159feb(0x143))/0x9;if(_0x792910===_0x4ff187)break;else _0x5ebc99['push'](_0x5ebc99['shift']());}catch(_0xf62533){_0x5ebc99['push'](_0x5ebc99['shift']());}}}(a240_0x37d2,0x58342));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';function a240_0x5650(_0x58547e,_0x1cda18){_0x58547e=_0x58547e-0x142;const _0x37d2d5=a240_0x37d2();let _0x565037=_0x37d2d5[_0x58547e];return _0x565037;}import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a240_0x37d2(){const _0x356e68=['103051etrHgL','1894266KGprZP','12PTukGi','1673uvtVAO','683712OZXppJ','18336OXmdOp','4832352Mffrdi','318XevgVa','1474590fRxaSW'];a240_0x37d2=function(){return _0x356e68;};return a240_0x37d2();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a241_0x56bc(){const _0x2226ca=['\x20SQL\x20queries\x20(total:\x20','dbId','verbose','read','No\x20custom\x20SQL\x20queries\x20found.','5503736fgCirs','List\x20custom\x20SQL\x20queries','134681zPKvDG','Filter\x20by\x20SQL\x20name','Page\x20size','212aCRvyt','str','6263170CAzStj','15383896ysFLxF','756HEIcan','13116wScDgR','9nCjSmT','map','totalCount','name','sqlcode','36jFzlNo','tableData','sql','12cbtwqg','string','Page\x20number','634045pKAcWV','page','all','bool','appCode','num','length','sqlName','pagesize','number'];a241_0x56bc=function(){return _0x2226ca;};return a241_0x56bc();}const a241_0x18c4fe=a241_0x55ce;(function(_0x101e52,_0x54d763){const _0x5ea0a9=a241_0x55ce,_0x252423=_0x101e52();while(!![]){try{const _0x2794f2=-parseInt(_0x5ea0a9(0x156))/0x1*(parseInt(_0x5ea0a9(0x167))/0x2)+-parseInt(_0x5ea0a9(0x15e))/0x3*(parseInt(_0x5ea0a9(0x159))/0x4)+parseInt(_0x5ea0a9(0x16a))/0x5+parseInt(_0x5ea0a9(0x164))/0x6*(parseInt(_0x5ea0a9(0x15d))/0x7)+parseInt(_0x5ea0a9(0x154))/0x8+parseInt(_0x5ea0a9(0x15f))/0x9*(-parseInt(_0x5ea0a9(0x15b))/0xa)+parseInt(_0x5ea0a9(0x15c))/0xb;if(_0x2794f2===_0x54d763)break;else _0x252423['push'](_0x252423['shift']());}catch(_0x24c8bb){_0x252423['push'](_0x252423['shift']());}}}(a241_0x56bc,0x85c01));function a241_0x55ce(_0x4512ec,_0x63db15){_0x4512ec=_0x4512ec-0x14d;const _0x56bc71=a241_0x56bc();let _0x55ce9c=_0x56bc71[_0x4512ec];return _0x55ce9c;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a241_0x18c4fe(0x166),'command':'list','description':a241_0x18c4fe(0x155),'risk':a241_0x18c4fe(0x152),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a241_0x18c4fe(0x168),'description':a241_0x18c4fe(0x157)},{'name':a241_0x18c4fe(0x16b),'type':a241_0x18c4fe(0x14e),'description':a241_0x18c4fe(0x169),'default':0x1},{'name':a241_0x18c4fe(0x14d),'type':a241_0x18c4fe(0x14e),'description':a241_0x18c4fe(0x158)},{'name':a241_0x18c4fe(0x151),'type':'boolean','description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x221991){const _0x4b8f8a=a241_0x18c4fe,_0x26e231=await listSqlQueries(_0x221991[_0x4b8f8a(0x16e)],{'sqlCode':_0x221991[_0x4b8f8a(0x15a)](_0x4b8f8a(0x163))||undefined,'sqlName':_0x221991[_0x4b8f8a(0x15a)](_0x4b8f8a(0x162))||undefined,'currentPage':_0x221991['num'](_0x4b8f8a(0x16b)),'pageSize':_0x221991[_0x4b8f8a(0x16f)]('pagesize',0x32)}),_0x18ceb2=_0x221991[_0x4b8f8a(0x16d)](_0x4b8f8a(0x151)),_0x4ebcad=_0x26e231[_0x4b8f8a(0x165)]??[],_0x480b9a=_0x26e231['paging']?.[_0x4b8f8a(0x161)]??_0x4ebcad['length'];let _0x3820c7;return _0x18ceb2?_0x3820c7=_0x4ebcad:_0x3820c7=await Promise[_0x4b8f8a(0x16c)](_0x4ebcad[_0x4b8f8a(0x160)](async _0x59fe01=>{const _0x4b8dbd=_0x4b8f8a;let _0x4c4eaf;try{_0x4c4eaf=_0x59fe01['dbId']?await getDbName(_0x221991[_0x4b8dbd(0x16e)],_0x59fe01[_0x4b8dbd(0x150)]):undefined;}catch{}return{'sqlCode':_0x59fe01['sqlCode'],'sqlName':_0x59fe01[_0x4b8dbd(0x171)],'description':_0x59fe01['description']??'','db':_0x4c4eaf?_0x4c4eaf+'\x20('+_0x59fe01[_0x4b8dbd(0x150)]+')':_0x59fe01[_0x4b8dbd(0x150)]??''};})),{'ok':!![],'data':_0x3820c7,'message':_0x4ebcad[_0x4b8f8a(0x170)]===0x0?_0x4b8f8a(0x153):'Found\x20'+_0x4ebcad[_0x4b8f8a(0x170)]+_0x4b8f8a(0x14f)+_0x480b9a+').'};}};
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a242_0x1a79b6=a242_0x4e2f;function a242_0x5ba8(){const _0x91fafc=['equivalent','sqlContent','POST','7GrDNdJ','sqlcode','trim','.xml','No\x20remote\x20SQL\x20queries\x20matched.','\x20SQL\x20file(s)\x20into\x20','totalCount','lockFilePath','push','mode','test','toLowerCase','Pull\x20complete:\x20','12RJVNEC','map','read','str','catch','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqls','569022trfgdP','force','content','\x20skipped,\x20','569560zmxpRh','233637pgHfYk','path','description','replace','name','Filter\x20by\x20SQL\x20display\x20name','message','length','dbId','sqlName','\x20failed','\x20written,\x20','some','isCanonical','sqlRootDir','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','hash','filter','boolean','tableData','mybatisXml','split','lastSync','55058bnscKe','2651930UrTrgl','file','sqlRoot','3279108AEUkTv','all','sqlCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','cancelled','pull','string','4Joomtw','9GPTVYV','5WqpBtY','Would\x20pull\x20','toISOString','appCode','join','skipped','utf8','Force\x20pull\x20cancelled.','1423455RWcmuD','sql','8IHdRzi','local\x20differs\x20from\x20remote','nonInteractive','39yfIuRd','filePath'];a242_0x5ba8=function(){return _0x91fafc;};return a242_0x5ba8();}(function(_0x42f00e,_0x4d5b2f){const _0xe48ca8=a242_0x4e2f,_0x1eb8c4=_0x42f00e();while(!![]){try{const _0x19d924=-parseInt(_0xe48ca8(0x1a1))/0x1*(parseInt(_0xe48ca8(0x18a))/0x2)+-parseInt(_0xe48ca8(0x1c2))/0x3*(-parseInt(_0xe48ca8(0x195))/0x4)+parseInt(_0xe48ca8(0x197))/0x5*(-parseInt(_0xe48ca8(0x1bd))/0x6)+-parseInt(_0xe48ca8(0x1a9))/0x7*(-parseInt(_0xe48ca8(0x1c1))/0x8)+parseInt(_0xe48ca8(0x196))/0x9*(-parseInt(_0xe48ca8(0x18b))/0xa)+parseInt(_0xe48ca8(0x19f))/0xb*(-parseInt(_0xe48ca8(0x1b6))/0xc)+parseInt(_0xe48ca8(0x1a4))/0xd*(parseInt(_0xe48ca8(0x18e))/0xe);if(_0x19d924===_0x4d5b2f)break;else _0x1eb8c4['push'](_0x1eb8c4['shift']());}catch(_0x5e52e4){_0x1eb8c4['push'](_0x1eb8c4['shift']());}}}(a242_0x5ba8,0x22af9));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;function a242_0x4e2f(_0x13f456,_0x20899f){_0x13f456=_0x13f456-0x179;const _0x5ba83c=a242_0x5ba8();let _0x4e2f62=_0x5ba83c[_0x13f456];return _0x4e2f62;}async function fetchAllSqlQueries(_0x430491,_0x15fab4){const _0x5b30fa=a242_0x4e2f,_0x53f3ab=[];let _0x278621=0x1;while(!![]){const _0x102f9b=await listSqlQueries(_0x430491,{'currentPage':_0x278621,'pageSize':PAGE_SIZE,'sqlCode':_0x15fab4[_0x5b30fa(0x190)],'sqlName':_0x15fab4[_0x5b30fa(0x17c)]}),_0x580a12=_0x102f9b[_0x5b30fa(0x186)]??[];_0x53f3ab[_0x5b30fa(0x1b1)](..._0x580a12);if(_0x580a12[_0x5b30fa(0x17a)]===0x0)break;const _0x2ba950=_0x102f9b['paging']?.[_0x5b30fa(0x1af)];if(_0x2ba950!=null?_0x53f3ab['length']>=_0x2ba950:_0x580a12[_0x5b30fa(0x17a)]<PAGE_SIZE)break;_0x278621++;}return _0x53f3ab;}async function ensureSqlContent(_0x1a3476){const _0x240d7d=a242_0x4e2f;if(_0x1a3476['sqlContent']!=null&&String(_0x1a3476[_0x240d7d(0x1a7)])['length']>0x0)return _0x1a3476;return getSqlQueryDetail(_0x1a3476[_0x240d7d(0x190)]);}export const sqlPull={'service':a242_0x1a79b6(0x1a0),'command':a242_0x1a79b6(0x193),'description':a242_0x1a79b6(0x1bb),'risk':a242_0x1a79b6(0x1b8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a242_0x1a79b6(0x1c6),'type':a242_0x1a79b6(0x194),'description':a242_0x1a79b6(0x1c7)},{'name':a242_0x1a79b6(0x1be),'type':a242_0x1a79b6(0x185),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x3ca7a3){const _0x350986=a242_0x1a79b6,_0x2b89fe=loadSqlProjectConfig(_0x3ca7a3[_0x350986(0x19a)]),_0x2fe5b1=await readSqlLockFile(_0x2b89fe['lockFilePath']),{appLock:_0x424bc7}=ensureSqlLockScope(_0x2fe5b1??createEmptySqlLock(),_0x2b89fe['appCode'],_0x2b89fe[_0x350986(0x18d)],_0x350986(0x193)),_0x3d9534=await fetchAllSqlQueries(_0x3ca7a3['appCode'],{'sqlCode':_0x3ca7a3[_0x350986(0x1b9)](_0x350986(0x1aa))||undefined,'sqlName':_0x3ca7a3['str']('name')||undefined}),_0x32310d=[];for(const _0xff2a18 of _0x3d9534){const _0x3d8b85=await ensureSqlContent(_0xff2a18),_0x2725b2=ensureRemoteSqlContent(_0x3d8b85),_0x224d53=detectSqlMode(_0x2725b2),_0x21c1a2=_0x3d8b85[_0x350986(0x17b)]?await getDbName(_0x3ca7a3[_0x350986(0x19a)],Number(_0x3d8b85[_0x350986(0x17b)]))[_0x350986(0x1ba)](()=>undefined):undefined,_0x10aabf=buildLocalSqlFileContent({'sqlCode':_0x3d8b85[_0x350986(0x190)],'sqlName':_0x3d8b85[_0x350986(0x17c)],'dbId':_0x3d8b85['dbId']},_0x2725b2,{'dbName':_0x21c1a2,'mode':_0x224d53,'syncedAt':new Date()['toISOString'](),'description':_0x3d8b85[_0x350986(0x1c4)]}),_0x316ff5=buildSqlLockEntry(_0x3d8b85,_0x2725b2,'',{'dbName':_0x21c1a2}),_0x177c3f=resolveLocalSqlFilePath(_0x2b89fe,_0x3d8b85[_0x350986(0x190)],_0x316ff5);let _0x16d0d4='would_pull',_0xdd6414;const _0x41cbdc=await findExistingSqlFiles(_0x2b89fe,_0x177c3f,_0x224d53,_0x424bc7[_0x350986(0x1bc)][_0x3d8b85['sqlCode']]);if(_0x41cbdc[_0x350986(0x17a)]>0x0){const _0xb89f3b=await compareExistingSqlFiles(_0x41cbdc,_0x10aabf,_0x224d53);if(_0xb89f3b[_0x350986(0x17f)](({equivalent:_0x4432aa})=>!_0x4432aa))_0x16d0d4='conflict',_0xdd6414=_0x350986(0x191);else _0xb89f3b[_0x350986(0x17a)]===0x1&&_0xb89f3b[0x0]?.[_0x350986(0x18c)][_0x350986(0x180)]&&(_0x16d0d4=_0x350986(0x19c),_0xdd6414='unchanged');}_0x32310d[_0x350986(0x1b1)]({'sqlCode':_0x3d8b85[_0x350986(0x190)],'sqlName':_0x3d8b85['sqlName'],'filePath':_0x177c3f,'status':_0x16d0d4,'reason':_0xdd6414});}return{'method':_0x350986(0x1a8),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x3ca7a3[_0x350986(0x19a)],'sqlCode':_0x3ca7a3[_0x350986(0x1b9)]('sqlcode')||null,'sqlName':_0x3ca7a3[_0x350986(0x1b9)]('name')||null,'files':_0x32310d},'description':_0x350986(0x198)+_0x32310d['length']+_0x350986(0x1ae)+_0x2b89fe[_0x350986(0x181)]};},async 'execute'(_0xc8a5b0){const _0x4049c2=a242_0x1a79b6,_0x21716a=loadSqlProjectConfig(_0xc8a5b0['appCode']),_0x5e5fd9=await readSqlLockFile(_0x21716a[_0x4049c2(0x1b0)]),{lockData:_0x2da450,appLock:_0x3972fc}=ensureSqlLockScope(_0x5e5fd9??createEmptySqlLock(),_0x21716a[_0x4049c2(0x19a)],_0x21716a[_0x4049c2(0x18d)],'pull'),_0x138fac=_0xc8a5b0['bool'](_0x4049c2(0x1be)),_0x535535=await fetchAllSqlQueries(_0xc8a5b0[_0x4049c2(0x19a)],{'sqlCode':_0xc8a5b0[_0x4049c2(0x1b9)](_0x4049c2(0x1aa))||undefined,'sqlName':_0xc8a5b0[_0x4049c2(0x1b9)](_0x4049c2(0x1c6))||undefined});if(_0x535535[_0x4049c2(0x17a)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4049c2(0x1ad)};const _0x58d809=[],_0x31b666=[];for(const _0x1aaf21 of _0x535535){try{_0x58d809['push'](await ensureSqlContent(_0x1aaf21));}catch(_0x6778ec){_0x31b666['push']({'sqlCode':_0x1aaf21['sqlCode'],'error':_0x6778ec instanceof Error?_0x6778ec[_0x4049c2(0x179)]:String(_0x6778ec)});}}if(_0x138fac&&!_0xc8a5b0[_0x4049c2(0x1a3)]){let _0x244d66=![];for(const _0x172b79 of _0x58d809){const _0x3a348c=detectSqlMode(ensureRemoteSqlContent(_0x172b79)),_0x375394=_0x172b79[_0x4049c2(0x17b)]?await getDbName(_0xc8a5b0[_0x4049c2(0x19a)],Number(_0x172b79['dbId']))[_0x4049c2(0x1ba)](()=>undefined):undefined,_0x2e7141=buildLocalSqlFileContent({'sqlCode':_0x172b79[_0x4049c2(0x190)],'sqlName':_0x172b79[_0x4049c2(0x17c)],'dbId':_0x172b79[_0x4049c2(0x17b)]},ensureRemoteSqlContent(_0x172b79),{'dbName':_0x375394,'mode':_0x3a348c,'syncedAt':new Date()[_0x4049c2(0x199)](),'description':_0x172b79['description']}),_0x4ee573=resolveLocalSqlFilePath(_0x21716a,_0x172b79[_0x4049c2(0x190)],buildSqlLockEntry(_0x172b79,ensureRemoteSqlContent(_0x172b79),'',{'dbName':_0x375394})),_0x1dae7d=await findExistingSqlFiles(_0x21716a,_0x4ee573,_0x3a348c,_0x3972fc[_0x4049c2(0x1bc)][_0x172b79[_0x4049c2(0x190)]]),_0x319e99=await compareExistingSqlFiles(_0x1dae7d,_0x2e7141,_0x3a348c);if(_0x319e99[_0x4049c2(0x17f)](({equivalent:_0x449a86})=>!_0x449a86)){_0x244d66=!![];break;}}if(_0x244d66){const _0x2610a4=await confirmForceOverwrite(_0x4049c2(0x182));if(!_0x2610a4)throw CliErrors[_0x4049c2(0x192)](_0x4049c2(0x19e));}}const _0x1faed8=cloneSqlLockData(_0x2da450),_0x1b7462=_0x1faed8['apps'][_0x21716a[_0x4049c2(0x19a)]],_0x26bb1d=[],_0x2f6ed2=[];for(const _0x5421fe of _0x58d809){const _0x3bc206=_0x1b7462[_0x4049c2(0x1bc)][_0x5421fe[_0x4049c2(0x190)]],_0x3e08f5=ensureRemoteSqlContent(_0x5421fe),_0x54bf70=detectSqlMode(_0x3e08f5),_0x31cc1b=_0x5421fe[_0x4049c2(0x17b)]?await getDbName(_0xc8a5b0['appCode'],Number(_0x5421fe[_0x4049c2(0x17b)]))['catch'](()=>undefined):undefined,_0x350747=buildLocalSqlFileContent({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'sqlName':_0x5421fe[_0x4049c2(0x17c)],'dbId':_0x5421fe[_0x4049c2(0x17b)]},_0x3e08f5,{'dbName':_0x31cc1b,'mode':_0x54bf70,'syncedAt':new Date()['toISOString'](),'description':_0x5421fe[_0x4049c2(0x1c4)]}),_0x231af4=buildSqlLockEntry(_0x5421fe,_0x3e08f5,computeSqlContentHash(_0x350747),{'dbName':_0x31cc1b}),_0x572339=_0x231af4[_0x4049c2(0x1c3)],_0x476da7=join(_0x21716a[_0x4049c2(0x181)],_0x572339);try{const _0x535c49=await findExistingSqlFiles(_0x21716a,_0x476da7,_0x54bf70,_0x3bc206),_0x560786=await compareExistingSqlFiles(_0x535c49,_0x350747,_0x54bf70);if(!_0x138fac&&_0x560786[_0x4049c2(0x17f)](({equivalent:_0x2e18cb})=>!_0x2e18cb)){_0x2f6ed2[_0x4049c2(0x1b1)]({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'reason':_0x4049c2(0x1a2)});continue;}const _0x5e6229=_0x560786['find'](({file:_0x4a9f38})=>_0x4a9f38[_0x4049c2(0x180)]),_0x514b55=_0x560786['find'](({file:_0x197b7f})=>!_0x197b7f['isCanonical']);if(_0x5e6229?.[_0x4049c2(0x1a6)]&&!_0x514b55){_0x2f6ed2['push']({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'reason':'unchanged'}),_0x1b7462[_0x4049c2(0x1bc)][_0x5421fe['sqlCode']]={..._0x231af4,'hash':computeSqlContentHash(_0x5e6229[_0x4049c2(0x1bf)]),'path':_0x572339};continue;}!_0x5e6229?.[_0x4049c2(0x1a6)]&&(await ensureParentDirectory(_0x476da7),await writeFile(_0x476da7,_0x350747,'utf8')),_0x514b55&&await rm(_0x514b55[_0x4049c2(0x18c)][_0x4049c2(0x1a5)],{'force':!![]}),_0x1b7462[_0x4049c2(0x1bc)][_0x5421fe[_0x4049c2(0x190)]]={..._0x231af4,'hash':_0x5e6229?.[_0x4049c2(0x1a6)]?computeSqlContentHash(_0x5e6229[_0x4049c2(0x1bf)]):_0x231af4[_0x4049c2(0x183)],'path':_0x572339},_0x26bb1d[_0x4049c2(0x1b1)]({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'filePath':_0x476da7});}catch(_0x1922c2){_0x31b666[_0x4049c2(0x1b1)]({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'error':_0x1922c2 instanceof Error?_0x1922c2[_0x4049c2(0x179)]:String(_0x1922c2)});}}return _0x1b7462[_0x4049c2(0x189)]=new Date()[_0x4049c2(0x199)](),await writeSqlLockFile(_0x21716a['lockFilePath'],_0x1faed8),{'ok':_0x31b666[_0x4049c2(0x17a)]===0x0,'data':{'pulled':_0x26bb1d,'skipped':_0x2f6ed2,'failed':_0x31b666},'message':_0x4049c2(0x1b5)+_0x26bb1d[_0x4049c2(0x17a)]+_0x4049c2(0x17e)+_0x2f6ed2[_0x4049c2(0x17a)]+_0x4049c2(0x1c0)+_0x31b666[_0x4049c2(0x17a)]+_0x4049c2(0x17d)};}};function isEquivalentPulledSqlFile(_0x4edb39,_0x27cd99,_0x1abf3b,_0x15a4e4){if(_0x1abf3b!==_0x15a4e4)return normalizePulledSqlBody(_0x4edb39,_0x1abf3b)===normalizePulledSqlBody(_0x27cd99,_0x15a4e4);return normalizePullComparableContent(_0x4edb39,_0x1abf3b)===normalizePullComparableContent(_0x27cd99,_0x15a4e4);}async function findExistingSqlFiles(_0xa3397a,_0x279a4a,_0x525dce,_0x2ee989){const _0x42424c=a242_0x1a79b6,_0x276df9=[];await fileExists(_0x279a4a)&&_0x276df9['push']({'filePath':_0x279a4a,'mode':_0x525dce,'isCanonical':!![]});if(!_0x2ee989?.[_0x42424c(0x1c3)])return _0x276df9;const _0x305131=join(_0xa3397a[_0x42424c(0x181)],_0x2ee989[_0x42424c(0x1c3)]);if(_0x305131===_0x279a4a)return _0x276df9;return await fileExists(_0x305131)&&_0x276df9[_0x42424c(0x1b1)]({'filePath':_0x305131,'mode':_0x2ee989[_0x42424c(0x1b2)]??modeFromFilePath(_0x305131),'isCanonical':![]}),_0x276df9;}async function compareExistingSqlFiles(_0x464681,_0x319bc8,_0x2b5d89){const _0x2f1311=a242_0x1a79b6;return Promise[_0x2f1311(0x18f)](_0x464681[_0x2f1311(0x1b7)](async _0x4325e7=>{const _0x4ed08c=_0x2f1311,_0x4db559=await readFile(_0x4325e7[_0x4ed08c(0x1a5)],_0x4ed08c(0x19d));return{'file':_0x4325e7,'content':_0x4db559,'equivalent':isEquivalentPulledSqlFile(_0x4db559,_0x319bc8,_0x4325e7[_0x4ed08c(0x1b2)],_0x2b5d89)};}));}function modeFromFilePath(_0x186058){const _0x1a5d45=a242_0x1a79b6;return _0x186058[_0x1a5d45(0x1b4)]()['endsWith'](_0x1a5d45(0x1ac))?_0x1a5d45(0x187):_0x1a5d45(0x1a0);}function normalizePulledSqlBody(_0x5a02a5,_0x1509c4){const _0x3a363c=a242_0x1a79b6;return stripLocalSqlMetadata(_0x5a02a5,_0x1509c4)[_0x3a363c(0x1c5)](/\r\n/g,'\x0a')[_0x3a363c(0x1ab)]();}function normalizePullComparableContent(_0x5ac4fb,_0x4e1161){const _0x175c40=a242_0x1a79b6,_0x400f24=_0x5ac4fb[_0x175c40(0x1c5)](/\r\n/g,'\x0a')[_0x175c40(0x188)]('\x0a'),_0x4f8ed6=_0x400f24[_0x175c40(0x184)](_0x599afc=>!isSyncedAtMetadataLine(_0x599afc,_0x4e1161));return _0x4f8ed6[_0x175c40(0x19b)]('\x0a');}function isSyncedAtMetadataLine(_0x1c9871,_0xd3fac5){const _0x227b95=a242_0x1a79b6;if(_0xd3fac5===_0x227b95(0x187))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x1c9871);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x227b95(0x1b3)](_0x1c9871);}
|
|
1
|
+
const a242_0x3c64f9=a242_0x3cd6;(function(_0x24f0d2,_0x37eb4a){const _0x17dda5=a242_0x3cd6,_0x734318=_0x24f0d2();while(!![]){try{const _0x4a3e16=-parseInt(_0x17dda5(0x136))/0x1*(parseInt(_0x17dda5(0x16b))/0x2)+parseInt(_0x17dda5(0x15c))/0x3+parseInt(_0x17dda5(0x131))/0x4+parseInt(_0x17dda5(0x172))/0x5*(-parseInt(_0x17dda5(0x154))/0x6)+parseInt(_0x17dda5(0x139))/0x7+-parseInt(_0x17dda5(0x16e))/0x8+parseInt(_0x17dda5(0x178))/0x9;if(_0x4a3e16===_0x37eb4a)break;else _0x734318['push'](_0x734318['shift']());}catch(_0x37ea8f){_0x734318['push'](_0x734318['shift']());}}}(a242_0x34a5,0x562bf));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1ebc2a,_0x410cab){const _0x3a02ea=a242_0x3cd6,_0x3facf9=[];let _0x5786c5=0x1;while(!![]){const _0x4004bd=await listSqlQueries(_0x1ebc2a,{'currentPage':_0x5786c5,'pageSize':PAGE_SIZE,'sqlCode':_0x410cab[_0x3a02ea(0x153)],'sqlName':_0x410cab[_0x3a02ea(0x143)]}),_0x58a0b2=_0x4004bd[_0x3a02ea(0x145)]??[];_0x3facf9['push'](..._0x58a0b2);if(_0x58a0b2['length']===0x0)break;const _0x491e47=_0x4004bd['paging']?.[_0x3a02ea(0x15d)];if(_0x491e47!=null?_0x3facf9[_0x3a02ea(0x140)]>=_0x491e47:_0x58a0b2[_0x3a02ea(0x140)]<PAGE_SIZE)break;_0x5786c5++;}return _0x3facf9;}async function ensureSqlContent(_0x44f976){const _0x49c512=a242_0x3cd6;if(_0x44f976[_0x49c512(0x13b)]!=null&&String(_0x44f976[_0x49c512(0x13b)])[_0x49c512(0x140)]>0x0)return _0x44f976;return getSqlQueryDetail(_0x44f976['sqlCode']);}export const sqlPull={'service':'sql','command':a242_0x3c64f9(0x160),'description':a242_0x3c64f9(0x159),'risk':a242_0x3c64f9(0x16d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':'string','description':a242_0x3c64f9(0x166)},{'name':a242_0x3c64f9(0x13c),'type':'boolean','description':a242_0x3c64f9(0x15a)}],async 'dryRun'(_0x2d8de5){const _0x98ceb2=a242_0x3c64f9,_0x90fd88=loadSqlProjectConfig(_0x2d8de5['appCode']),_0x4e49c0=await readSqlLockFile(_0x90fd88[_0x98ceb2(0x16f)]),{appLock:_0x7513db}=ensureSqlLockScope(_0x4e49c0??createEmptySqlLock(),_0x90fd88['appCode'],_0x90fd88[_0x98ceb2(0x144)],_0x98ceb2(0x160)),_0x5ed35f=await fetchAllSqlQueries(_0x2d8de5[_0x98ceb2(0x176)],{'sqlCode':_0x2d8de5[_0x98ceb2(0x164)](_0x98ceb2(0x161))||undefined,'sqlName':_0x2d8de5[_0x98ceb2(0x164)](_0x98ceb2(0x137))||undefined}),_0x5d15ed=[];for(const _0x4589b3 of _0x5ed35f){const _0x536249=await ensureSqlContent(_0x4589b3),_0x1efde2=ensureRemoteSqlContent(_0x536249),_0xfcbb3b=detectSqlMode(_0x1efde2),_0x1ec50d=_0x536249[_0x98ceb2(0x163)]?await getDbName(_0x2d8de5[_0x98ceb2(0x176)],Number(_0x536249['dbId']))['catch'](()=>undefined):undefined,_0xa76e51=buildLocalSqlFileContent({'sqlCode':_0x536249['sqlCode'],'sqlName':_0x536249[_0x98ceb2(0x143)],'dbId':_0x536249[_0x98ceb2(0x163)]},_0x1efde2,{'dbName':_0x1ec50d,'mode':_0xfcbb3b,'syncedAt':new Date()['toISOString'](),'description':_0x536249[_0x98ceb2(0x13f)]}),_0x2c129e=buildSqlLockEntry(_0x536249,_0x1efde2,'',{'dbName':_0x1ec50d}),_0x1f3ab7=resolveLocalSqlFilePath(_0x90fd88,_0x536249['sqlCode'],_0x2c129e);let _0x959266=_0x98ceb2(0x169),_0x497926;const _0x9ed55e=await findExistingSqlFiles(_0x90fd88,_0x1f3ab7,_0xfcbb3b,_0x7513db[_0x98ceb2(0x17a)][_0x536249[_0x98ceb2(0x153)]]);if(_0x9ed55e[_0x98ceb2(0x140)]>0x0){const _0x3cc953=await compareExistingSqlFiles(_0x9ed55e,_0xa76e51,_0xfcbb3b);if(_0x3cc953[_0x98ceb2(0x141)](({equivalent:_0x4a0b42})=>!_0x4a0b42))_0x959266=_0x98ceb2(0x14b),_0x497926=_0x98ceb2(0x16c);else _0x3cc953[_0x98ceb2(0x140)]===0x1&&_0x3cc953[0x0]?.[_0x98ceb2(0x156)][_0x98ceb2(0x14c)]&&(_0x959266=_0x98ceb2(0x167),_0x497926=_0x98ceb2(0x135));}_0x5d15ed['push']({'sqlCode':_0x536249[_0x98ceb2(0x153)],'sqlName':_0x536249[_0x98ceb2(0x143)],'filePath':_0x1f3ab7,'status':_0x959266,'reason':_0x497926});}return{'method':_0x98ceb2(0x170),'url':_0x98ceb2(0x13a),'body':{'appCode':_0x2d8de5[_0x98ceb2(0x176)],'sqlCode':_0x2d8de5['str'](_0x98ceb2(0x161))||null,'sqlName':_0x2d8de5['str']('name')||null,'files':_0x5d15ed},'description':_0x98ceb2(0x165)+_0x5d15ed[_0x98ceb2(0x140)]+_0x98ceb2(0x158)+_0x90fd88[_0x98ceb2(0x171)]};},async 'execute'(_0x58ffe5){const _0x56cf04=a242_0x3c64f9,_0x3bc10c=loadSqlProjectConfig(_0x58ffe5['appCode']),_0x14b7c9=await readSqlLockFile(_0x3bc10c[_0x56cf04(0x16f)]),{lockData:_0x2ab674,appLock:_0x4549a8}=ensureSqlLockScope(_0x14b7c9??createEmptySqlLock(),_0x3bc10c[_0x56cf04(0x176)],_0x3bc10c[_0x56cf04(0x144)],'pull'),_0x5156a6=_0x58ffe5[_0x56cf04(0x14d)](_0x56cf04(0x13c)),_0x375bba=await fetchAllSqlQueries(_0x58ffe5[_0x56cf04(0x176)],{'sqlCode':_0x58ffe5[_0x56cf04(0x164)]('sqlcode')||undefined,'sqlName':_0x58ffe5[_0x56cf04(0x164)]('name')||undefined});if(_0x375bba['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x56cf04(0x16a)};const _0x4dffc1=[],_0x2b10ad=[];for(const _0xc8a777 of _0x375bba){try{_0x4dffc1[_0x56cf04(0x13d)](await ensureSqlContent(_0xc8a777));}catch(_0x5078f9){_0x2b10ad[_0x56cf04(0x13d)]({'sqlCode':_0xc8a777[_0x56cf04(0x153)],'error':_0x5078f9 instanceof Error?_0x5078f9['message']:String(_0x5078f9)});}}if(_0x5156a6&&!_0x58ffe5[_0x56cf04(0x142)]){let _0x15c1a0=![];for(const _0x796168 of _0x4dffc1){const _0x2e3f34=detectSqlMode(ensureRemoteSqlContent(_0x796168)),_0x1570d0=_0x796168[_0x56cf04(0x163)]?await getDbName(_0x58ffe5['appCode'],Number(_0x796168[_0x56cf04(0x163)]))[_0x56cf04(0x15e)](()=>undefined):undefined,_0xe54abb=buildLocalSqlFileContent({'sqlCode':_0x796168['sqlCode'],'sqlName':_0x796168[_0x56cf04(0x143)],'dbId':_0x796168[_0x56cf04(0x163)]},ensureRemoteSqlContent(_0x796168),{'dbName':_0x1570d0,'mode':_0x2e3f34,'syncedAt':new Date()[_0x56cf04(0x175)](),'description':_0x796168[_0x56cf04(0x13f)]}),_0x461c40=resolveLocalSqlFilePath(_0x3bc10c,_0x796168[_0x56cf04(0x153)],buildSqlLockEntry(_0x796168,ensureRemoteSqlContent(_0x796168),'',{'dbName':_0x1570d0})),_0x542de7=await findExistingSqlFiles(_0x3bc10c,_0x461c40,_0x2e3f34,_0x4549a8[_0x56cf04(0x17a)][_0x796168[_0x56cf04(0x153)]]),_0x4d5eec=await compareExistingSqlFiles(_0x542de7,_0xe54abb,_0x2e3f34);if(_0x4d5eec['some'](({equivalent:_0xd51251})=>!_0xd51251)){_0x15c1a0=!![];break;}}if(_0x15c1a0){const _0x1fa696=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x1fa696)throw CliErrors[_0x56cf04(0x147)]('Force\x20pull\x20cancelled.');}}const _0x2be726=cloneSqlLockData(_0x2ab674),_0x1b6975=_0x2be726[_0x56cf04(0x177)][_0x3bc10c[_0x56cf04(0x176)]],_0x423717=[],_0x33d1d7=[];for(const _0x4ad30b of _0x4dffc1){const _0x53e1b1=_0x1b6975['sqls'][_0x4ad30b[_0x56cf04(0x153)]],_0x5352a4=ensureRemoteSqlContent(_0x4ad30b),_0x47b78f=detectSqlMode(_0x5352a4),_0xdece23=_0x4ad30b['dbId']?await getDbName(_0x58ffe5[_0x56cf04(0x176)],Number(_0x4ad30b['dbId']))[_0x56cf04(0x15e)](()=>undefined):undefined,_0x4430b6=buildLocalSqlFileContent({'sqlCode':_0x4ad30b[_0x56cf04(0x153)],'sqlName':_0x4ad30b[_0x56cf04(0x143)],'dbId':_0x4ad30b[_0x56cf04(0x163)]},_0x5352a4,{'dbName':_0xdece23,'mode':_0x47b78f,'syncedAt':new Date()[_0x56cf04(0x175)](),'description':_0x4ad30b[_0x56cf04(0x13f)]}),_0x7085b8=buildSqlLockEntry(_0x4ad30b,_0x5352a4,computeSqlContentHash(_0x4430b6),{'dbName':_0xdece23}),_0x477fc4=_0x7085b8['path'],_0xaf5106=join(_0x3bc10c[_0x56cf04(0x171)],_0x477fc4);try{const _0x1dd8ad=await findExistingSqlFiles(_0x3bc10c,_0xaf5106,_0x47b78f,_0x53e1b1),_0x4988d5=await compareExistingSqlFiles(_0x1dd8ad,_0x4430b6,_0x47b78f);if(!_0x5156a6&&_0x4988d5[_0x56cf04(0x141)](({equivalent:_0x58a72a})=>!_0x58a72a)){_0x33d1d7[_0x56cf04(0x13d)]({'sqlCode':_0x4ad30b[_0x56cf04(0x153)],'reason':_0x56cf04(0x152)});continue;}const _0x8f0264=_0x4988d5[_0x56cf04(0x14f)](({file:_0x24cfdd})=>_0x24cfdd[_0x56cf04(0x14c)]),_0x3a35d8=_0x4988d5[_0x56cf04(0x14f)](({file:_0x55abef})=>!_0x55abef[_0x56cf04(0x14c)]);if(_0x8f0264?.['equivalent']&&!_0x3a35d8){_0x33d1d7[_0x56cf04(0x13d)]({'sqlCode':_0x4ad30b[_0x56cf04(0x153)],'reason':_0x56cf04(0x135)}),_0x1b6975[_0x56cf04(0x17a)][_0x4ad30b[_0x56cf04(0x153)]]={..._0x7085b8,'hash':computeSqlContentHash(_0x8f0264[_0x56cf04(0x15f)]),'path':_0x477fc4};continue;}!_0x8f0264?.[_0x56cf04(0x15b)]&&(await ensureParentDirectory(_0xaf5106),await writeFile(_0xaf5106,_0x4430b6,_0x56cf04(0x150))),_0x3a35d8&&await rm(_0x3a35d8[_0x56cf04(0x156)][_0x56cf04(0x162)],{'force':!![]}),_0x1b6975[_0x56cf04(0x17a)][_0x4ad30b[_0x56cf04(0x153)]]={..._0x7085b8,'hash':_0x8f0264?.[_0x56cf04(0x15b)]?computeSqlContentHash(_0x8f0264[_0x56cf04(0x15f)]):_0x7085b8[_0x56cf04(0x179)],'path':_0x477fc4},_0x423717['push']({'sqlCode':_0x4ad30b[_0x56cf04(0x153)],'filePath':_0xaf5106});}catch(_0x521365){_0x2b10ad[_0x56cf04(0x13d)]({'sqlCode':_0x4ad30b['sqlCode'],'error':_0x521365 instanceof Error?_0x521365['message']:String(_0x521365)});}}return _0x1b6975['lastSync']=new Date()[_0x56cf04(0x175)](),await writeSqlLockFile(_0x3bc10c[_0x56cf04(0x16f)],_0x2be726),{'ok':_0x2b10ad[_0x56cf04(0x140)]===0x0,'data':{'pulled':_0x423717,'skipped':_0x33d1d7,'failed':_0x2b10ad},'message':_0x56cf04(0x157)+_0x423717[_0x56cf04(0x140)]+_0x56cf04(0x146)+_0x33d1d7[_0x56cf04(0x140)]+'\x20skipped,\x20'+_0x2b10ad[_0x56cf04(0x140)]+_0x56cf04(0x132)};}};function a242_0x3cd6(_0x5b2da3,_0x2ec156){_0x5b2da3=_0x5b2da3-0x131;const _0x34a574=a242_0x34a5();let _0x3cd609=_0x34a574[_0x5b2da3];return _0x3cd609;}function isEquivalentPulledSqlFile(_0x4cf9f4,_0x463552,_0x563d7f,_0x1970b2){if(_0x563d7f!==_0x1970b2)return normalizePulledSqlBody(_0x4cf9f4,_0x563d7f)===normalizePulledSqlBody(_0x463552,_0x1970b2);return normalizePullComparableContent(_0x4cf9f4,_0x563d7f)===normalizePullComparableContent(_0x463552,_0x1970b2);}async function findExistingSqlFiles(_0x4966a8,_0x16ec5f,_0x5cf000,_0x47c114){const _0x19eb23=a242_0x3c64f9,_0x21be94=[];await fileExists(_0x16ec5f)&&_0x21be94[_0x19eb23(0x13d)]({'filePath':_0x16ec5f,'mode':_0x5cf000,'isCanonical':!![]});if(!_0x47c114?.[_0x19eb23(0x138)])return _0x21be94;const _0x2c639d=join(_0x4966a8[_0x19eb23(0x171)],_0x47c114[_0x19eb23(0x138)]);if(_0x2c639d===_0x16ec5f)return _0x21be94;return await fileExists(_0x2c639d)&&_0x21be94[_0x19eb23(0x13d)]({'filePath':_0x2c639d,'mode':_0x47c114[_0x19eb23(0x149)]??modeFromFilePath(_0x2c639d),'isCanonical':![]}),_0x21be94;}async function compareExistingSqlFiles(_0x184c49,_0x16f560,_0x5569b9){const _0x1398a8=a242_0x3c64f9;return Promise[_0x1398a8(0x155)](_0x184c49[_0x1398a8(0x14e)](async _0x454eb9=>{const _0x556be0=_0x1398a8,_0x5ab412=await readFile(_0x454eb9[_0x556be0(0x162)],_0x556be0(0x150));return{'file':_0x454eb9,'content':_0x5ab412,'equivalent':isEquivalentPulledSqlFile(_0x5ab412,_0x16f560,_0x454eb9[_0x556be0(0x149)],_0x5569b9)};}));}function modeFromFilePath(_0x289385){const _0x8c8258=a242_0x3c64f9;return _0x289385[_0x8c8258(0x134)]()[_0x8c8258(0x13e)]('.xml')?_0x8c8258(0x174):_0x8c8258(0x151);}function normalizePulledSqlBody(_0x221404,_0x388222){const _0x5bae1d=a242_0x3c64f9;return stripLocalSqlMetadata(_0x221404,_0x388222)[_0x5bae1d(0x173)](/\r\n/g,'\x0a')[_0x5bae1d(0x168)]();}function normalizePullComparableContent(_0x3a1c16,_0x11a129){const _0x43bf0f=a242_0x3c64f9,_0xfe6272=_0x3a1c16[_0x43bf0f(0x173)](/\r\n/g,'\x0a')[_0x43bf0f(0x14a)]('\x0a'),_0x3defce=_0xfe6272['filter'](_0x331de0=>!isSyncedAtMetadataLine(_0x331de0,_0x11a129));return _0x3defce[_0x43bf0f(0x148)]('\x0a');}function isSyncedAtMetadataLine(_0x29e009,_0x2d73b5){const _0x4b5e3d=a242_0x3c64f9;if(_0x2d73b5==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x4b5e3d(0x133)](_0x29e009);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4b5e3d(0x133)](_0x29e009);}function a242_0x34a5(){const _0x2ef46a=['some','nonInteractive','sqlName','sqlRoot','tableData','\x20written,\x20','cancelled','join','mode','split','conflict','isCanonical','bool','map','find','utf8','sql','local\x20differs\x20from\x20remote','sqlCode','6Ijyued','all','file','Pull\x20complete:\x20','\x20SQL\x20file(s)\x20into\x20','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Force\x20overwrite\x20local\x20unsynced\x20changes','equivalent','336354mwBzXK','totalCount','catch','content','pull','sqlcode','filePath','dbId','str','Would\x20pull\x20','Filter\x20by\x20SQL\x20display\x20name','skipped','trim','would_pull','No\x20remote\x20SQL\x20queries\x20matched.','26028PDCfMY','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','read','3406880JkgpPr','lockFilePath','POST','sqlRootDir','1685270NyMPBU','replace','mybatisXml','toISOString','appCode','apps','7755696MCjQcc','hash','sqls','1095876GNdiZY','\x20failed','test','toLowerCase','unchanged','47hjUZRq','name','path','3357900wkadLE','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlContent','force','push','endsWith','description','length'];a242_0x34a5=function(){return _0x2ef46a;};return a242_0x34a5();}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a243_0x4ed571=a243_0x1ecd;(function(_0x56caea,_0x365f46){const _0x2549fc=a243_0x1ecd,_0x1c9229=_0x56caea();while(!![]){try{const _0x2a7f5f=-parseInt(_0x2549fc(0x1dd))/0x1*(-parseInt(_0x2549fc(0x1b1))/0x2)+parseInt(_0x2549fc(0x1de))/0x3+-parseInt(_0x2549fc(0x1bf))/0x4*(parseInt(_0x2549fc(0x1b6))/0x5)+-parseInt(_0x2549fc(0x1eb))/0x6+parseInt(_0x2549fc(0x1d2))/0x7*(parseInt(_0x2549fc(0x1c3))/0x8)+parseInt(_0x2549fc(0x1ca))/0x9+-parseInt(_0x2549fc(0x1f5))/0xa*(parseInt(_0x2549fc(0x1c6))/0xb);if(_0x2a7f5f===_0x365f46)break;else _0x1c9229['push'](_0x1c9229['shift']());}catch(_0x24029e){_0x1c9229['push'](_0x1c9229['shift']());}}}(a243_0x2e8b,0x7de3a));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a243_0x1ecd(_0x5cd800,_0x214e3f){_0x5cd800=_0x5cd800-0x1ae;const _0x2e8bc2=a243_0x2e8b();let _0x1ecd98=_0x2e8bc2[_0x5cd800];return _0x1ecd98;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x6ac5bc){const _0x1e34f6=a243_0x1ecd,_0x4bbf71=stripLocalSqlMetadata(await readFile(_0x6ac5bc[_0x1e34f6(0x1b5)],_0x1e34f6(0x1d5)),_0x6ac5bc['mode']);if(!_0x4bbf71[_0x1e34f6(0x1b9)]())throw CliErrors[_0x1e34f6(0x1ef)](_0x6ac5bc[_0x1e34f6(0x1d8)]+_0x1e34f6(0x1c7));return _0x4bbf71;}async function getTargetSqlQueries(_0x2ad85d,_0x578bc2,_0x2db995){const _0x3c1e10=a243_0x1ecd,_0x2c35b3=await scanLocalSqlQueries(_0x2ad85d),_0x31833c=new Map();for(const _0x58c353 of _0x2c35b3){if(_0x2db995&&_0x58c353['sqlCode']!==_0x2db995)continue;const _0x289d21=_0x31833c[_0x3c1e10(0x1d7)](_0x58c353[_0x3c1e10(0x1d8)])??[];_0x289d21[_0x3c1e10(0x1df)](_0x58c353),_0x31833c['set'](_0x58c353[_0x3c1e10(0x1d8)],_0x289d21);}if(_0x2db995&&!_0x31833c[_0x3c1e10(0x1f3)](_0x2db995))throw CliErrors['validation'](_0x3c1e10(0x1bd)+_0x2db995);const _0x27efd1=[];for(const [_0x14fa8e,_0x2fb0ce]of _0x31833c[_0x3c1e10(0x1f4)]()){if(_0x2fb0ce[_0x3c1e10(0x1e9)]===0x1){_0x27efd1[_0x3c1e10(0x1df)](_0x2fb0ce[0x0]);continue;}const _0x20b346=_0x578bc2[_0x3c1e10(0x1d6)][_0x14fa8e],_0x19f0e3=_0x20b346?.[_0x3c1e10(0x1d4)],_0x1a3a65=_0x19f0e3?_0x2fb0ce[_0x3c1e10(0x1e3)](_0x53b7de=>_0x53b7de[_0x3c1e10(0x1c2)]!==_0x19f0e3):_0x2fb0ce;if(_0x20b346&&_0x1a3a65['length']===0x1){_0x27efd1[_0x3c1e10(0x1df)](_0x1a3a65[0x0]);continue;}throw CliErrors['validation'](_0x3c1e10(0x1cd)+_0x14fa8e+_0x3c1e10(0x1c4));}return _0x27efd1;}export const sqlPush={'service':a243_0x4ed571(0x1b0),'command':a243_0x4ed571(0x1df),'description':a243_0x4ed571(0x1cf),'risk':a243_0x4ed571(0x1ba),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a243_0x4ed571(0x1e7),'type':'boolean','description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x4bae18){const _0x153f23=a243_0x4ed571,_0x2ca4e8=loadSqlProjectConfig(_0x4bae18[_0x153f23(0x1cc)]),_0x184997=await readSqlLockFile(_0x2ca4e8['lockFilePath']),{appLock:_0x40b77c}=ensureSqlLockScope(_0x184997??createEmptySqlLock(),_0x4bae18[_0x153f23(0x1cc)],_0x2ca4e8['sqlRoot'],_0x153f23(0x1df)),_0x174ad1=await getTargetSqlQueries(_0x2ca4e8,_0x40b77c,_0x4bae18[_0x153f23(0x1b4)](_0x153f23(0x1b7))||undefined),_0x228805=[];for(const _0x2d6e05 of _0x174ad1){const _0x5dbae7=await computeSqlFileHash(_0x2d6e05[_0x153f23(0x1b5)]),_0x54e2e1=_0x40b77c[_0x153f23(0x1d6)][_0x2d6e05[_0x153f23(0x1d8)]],_0x27cd3c=!!_0x54e2e1&&(_0x54e2e1[_0x153f23(0x1d4)]!==_0x2d6e05['relativePath']||!!_0x2d6e05[_0x153f23(0x1be)]&&_0x54e2e1[_0x153f23(0x1be)]!==_0x2d6e05['sqlName']||_0x54e2e1[_0x153f23(0x1e8)]!==_0x2d6e05[_0x153f23(0x1e8)]);if(!_0x4bae18[_0x153f23(0x1d1)](_0x153f23(0x1e7))&&_0x54e2e1&&_0x54e2e1[_0x153f23(0x1ce)]===_0x5dbae7&&!_0x27cd3c)continue;if(!_0x54e2e1)throw CliErrors[_0x153f23(0x1ef)](_0x2d6e05[_0x153f23(0x1d8)]+':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.');if(_0x54e2e1[_0x153f23(0x1e2)]==null)throw CliErrors['validation'](_0x2d6e05['sqlCode']+_0x153f23(0x1d0));await resolveTargetDbBinding(_0x4bae18[_0x153f23(0x1cc)],_0x2d6e05,_0x54e2e1),await readSqlUploadContent(_0x2d6e05),_0x228805[_0x153f23(0x1df)](_0x2d6e05[_0x153f23(0x1d8)]);}return{'method':_0x153f23(0x1bc),'url':_0x153f23(0x1e6),'body':{'sqlCodes':_0x228805,'appCode':_0x4bae18[_0x153f23(0x1cc)]},'description':_0x153f23(0x1d9)+_0x228805[_0x153f23(0x1e9)]+_0x153f23(0x1ee)};},async 'execute'(_0xd007e6){const _0x176b2a=a243_0x4ed571,_0xd570b8=loadSqlProjectConfig(_0xd007e6[_0x176b2a(0x1cc)]),_0x33c599=await readSqlLockFile(_0xd570b8[_0x176b2a(0x1e4)]),{lockData:_0x42ce63,appLock:_0x3cdcff}=ensureSqlLockScope(_0x33c599??createEmptySqlLock(),_0xd007e6[_0x176b2a(0x1cc)],_0xd570b8[_0x176b2a(0x1c0)],_0x176b2a(0x1df)),_0x31ea87=await getTargetSqlQueries(_0xd570b8,_0x3cdcff,_0xd007e6[_0x176b2a(0x1b4)](_0x176b2a(0x1b7))||undefined);if(_0x31ea87[_0x176b2a(0x1e9)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x176b2a(0x1f0)};const _0xcf14a4=[],_0x32852b=[],_0x13ea07=[];let _0x45df9f=![];for(const _0x5a307c of _0x31ea87){const _0x51eb94=_0x3cdcff['sqls'][_0x5a307c['sqlCode']];if(!_0x51eb94){_0x13ea07[_0x176b2a(0x1df)]({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'error':_0x176b2a(0x1ed)});continue;}try{const _0x10f435=await computeSqlFileHash(_0x5a307c[_0x176b2a(0x1b5)]),_0x583bcd=_0x51eb94[_0x176b2a(0x1d4)]!==_0x5a307c[_0x176b2a(0x1c2)]||!!_0x5a307c['sqlName']&&_0x51eb94[_0x176b2a(0x1be)]!==_0x5a307c[_0x176b2a(0x1be)]||_0x51eb94[_0x176b2a(0x1e8)]!==_0x5a307c['mode'];if(!_0xd007e6[_0x176b2a(0x1d1)](_0x176b2a(0x1e7))&&_0x51eb94[_0x176b2a(0x1ce)]===_0x10f435&&!_0x583bcd){_0x32852b['push']({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'reason':_0x176b2a(0x1f1)});continue;}if(_0x51eb94[_0x176b2a(0x1e2)]==null){_0x13ea07['push']({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'error':_0x176b2a(0x1b8)});continue;}const _0x369bef=_0x5a307c[_0x176b2a(0x1be)]||_0x51eb94[_0x176b2a(0x1be)],_0x51f257=await resolveTargetDbBinding(_0xd007e6[_0x176b2a(0x1cc)],_0x5a307c,_0x51eb94),_0x142370=await readSqlUploadContent(_0x5a307c),_0x27da56=await updateSqlQuery({'id':_0x51eb94[_0x176b2a(0x1da)],'appCode':_0xd007e6[_0x176b2a(0x1cc)],'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'sqlName':_0x369bef,'dbId':_0x51f257[_0x176b2a(0x1c9)],'version':_0x51eb94[_0x176b2a(0x1e2)],'sqlContent':_0x142370,'sqlConfig':_0x51eb94['sqlConfig']??undefined}),_0x37f7cf=_0x27da56[_0x176b2a(0x1c9)]?await getDbName(_0xd007e6['appCode'],Number(_0x27da56[_0x176b2a(0x1c9)]))[_0x176b2a(0x1cb)](()=>_0x51f257[_0x176b2a(0x1dc)]):_0x51f257[_0x176b2a(0x1dc)];_0x3cdcff[_0x176b2a(0x1d6)][_0x5a307c[_0x176b2a(0x1d8)]]={...buildSqlLockEntry(_0x27da56,_0x142370,_0x10f435,{'dbName':_0x37f7cf}),'path':_0x5a307c[_0x176b2a(0x1c2)],'mode':_0x5a307c[_0x176b2a(0x1e8)]},_0x45df9f=!![],await archivePreviousSqlFileIfNeeded(_0xd570b8,_0x51eb94[_0x176b2a(0x1d4)],_0x5a307c['relativePath']),_0xcf14a4[_0x176b2a(0x1df)]({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'remoteId':_0x51eb94[_0x176b2a(0x1da)]});}catch(_0x4f6203){_0x13ea07[_0x176b2a(0x1df)]({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'error':_0x4f6203 instanceof Error?_0x4f6203[_0x176b2a(0x1c8)]:String(_0x4f6203)});}}(_0x45df9f||_0x13ea07[_0x176b2a(0x1e9)]===0x0)&&(_0x3cdcff[_0x176b2a(0x1ec)]=new Date()[_0x176b2a(0x1e1)](),await writeSqlLockFile(_0xd570b8[_0x176b2a(0x1e4)],_0x42ce63));const _0x2ae82d=_0x13ea07[_0x176b2a(0x1e9)]===0x0;return{'ok':_0x2ae82d,'data':{'pushed':_0xcf14a4,'skipped':_0x32852b,'failed':_0x13ea07},'message':'Push\x20complete:\x20'+_0xcf14a4[_0x176b2a(0x1e9)]+_0x176b2a(0x1ae)+_0x32852b[_0x176b2a(0x1e9)]+_0x176b2a(0x1b2)+_0x13ea07['length']+_0x176b2a(0x1b3)};}};async function archivePreviousSqlFileIfNeeded(_0x1b6624,_0x5b4494,_0x4782b2){const _0x20f406=a243_0x4ed571;if(!_0x5b4494||_0x5b4494===_0x4782b2)return;const _0x37f8a5=join(_0x1b6624[_0x20f406(0x1db)],_0x5b4494);if(!await fileExists(_0x37f8a5))return;const _0x242ee6=await moveToTrash(_0x1b6624[_0x20f406(0x1ea)],_0x1b6624['trashDir'],_0x37f8a5);await cleanupEmptyDirectories(dirname(_0x37f8a5),_0x1b6624[_0x20f406(0x1db)]),void _0x242ee6;}async function moveToTrash(_0x3d2da4,_0x27498f,_0x32e7ca){const _0x2c0051=a243_0x4ed571,_0x332940=new Date()[_0x2c0051(0x1e1)]()[_0x2c0051(0x1f2)](/[:.]/g,'-'),_0x4918f9=relative(_0x3d2da4,_0x32e7ca),_0x332741=join(_0x27498f,_0x332940,_0x4918f9);return await mkdir(dirname(_0x332741),{'recursive':!![]}),await rename(_0x32e7ca,_0x332741),_0x332741;}async function cleanupEmptyDirectories(_0x14c627,_0x1d7dba){const _0x1a9d32=a243_0x4ed571;let _0x10db40=resolve(_0x14c627);const _0x1643df=resolve(_0x1d7dba);while(_0x10db40[_0x1a9d32(0x1bb)](''+_0x1643df+sep)||_0x10db40===_0x1643df){if(_0x10db40===_0x1643df)return;try{const _0x346f03=await readdir(_0x10db40);if(_0x346f03[_0x1a9d32(0x1e9)]>0x0)return;await rmdir(_0x10db40);}catch{return;}_0x10db40=dirname(_0x10db40);}}function a243_0x2e8b(){const _0x29d654=['push','map','toISOString','version','filter','lockFilePath','Local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','force','mode','length','projectRoot','4983114lmmHZo','lastSync','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','\x20SQL\x20file(s)','validation','No\x20local\x20SQL\x20files\x20found.','unchanged','replace','has','entries','22150zsjpTu','\x20pushed,\x20','exec','sql','2YrnncK','\x20skipped,\x20','\x20failed','str','filePath','356795mFYFrb','sqlcode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','trim','write','startsWith','POST','Local\x20SQL\x20not\x20found:\x20','sqlName','52zctxHd','sqlRoot','No\x20database\x20matches\x20local\x20directory\x20\x22','relativePath','184rrXdmh','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','198uZIHwU',':\x20SQL\x20content\x20is\x20empty.','message','dbId','5359599SVBDMD','catch','appCode','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','hash','Push\x20local\x20SQL\x20files\x20to\x20remote',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','bool','29477jXIXYe','join','path','utf8','sqls','get','sqlCode','Would\x20push\x20','remoteId','sqlRootDir','dbName','607741kBaGYD','3040779ynrZaJ'];a243_0x2e8b=function(){return _0x29d654;};return a243_0x2e8b();}async function resolveTargetDbBinding(_0x4636f7,_0x202a91,_0x1bf78e){const _0x22f24d=a243_0x4ed571,_0x47b2c7=_0x202a91['dbDirectory'];if(!_0x47b2c7)return{'dbId':_0x1bf78e[_0x22f24d(0x1c9)],'dbName':_0x1bf78e[_0x22f24d(0x1dc)]};const _0x7a2302=buildDbDirectoryName(_0x1bf78e[_0x22f24d(0x1dc)],_0x1bf78e[_0x22f24d(0x1c9)]);if(_0x47b2c7===_0x7a2302)return{'dbId':_0x1bf78e[_0x22f24d(0x1c9)],'dbName':_0x1bf78e[_0x22f24d(0x1dc)]};const _0x282dcc=parseExplicitDbDirectory(_0x47b2c7);if(_0x282dcc!=null)return{'dbId':_0x282dcc,'dbName':await getDbName(_0x4636f7,_0x282dcc)['catch'](()=>undefined)};const _0x432e0f=await listDatabases(_0x4636f7),_0x5d1910=_0x432e0f[_0x22f24d(0x1e3)](_0x8d4e77=>buildDbDirectoryName(_0x8d4e77[_0x22f24d(0x1dc)],_0x8d4e77[_0x22f24d(0x1c9)])===_0x47b2c7);if(_0x5d1910[_0x22f24d(0x1e9)]===0x1)return{'dbId':_0x5d1910[0x0]['dbId'],'dbName':_0x5d1910[0x0][_0x22f24d(0x1dc)]};if(_0x5d1910[_0x22f24d(0x1e9)]===0x0)throw CliErrors[_0x22f24d(0x1ef)](_0x22f24d(0x1c1)+_0x47b2c7+'\x22\x20for\x20sqlCode\x20'+_0x202a91['sqlCode']+'.');const _0x4449bf=_0x5d1910[_0x22f24d(0x1e0)](_0x380bc4=>_0x380bc4[_0x22f24d(0x1dc)]+'\x20('+_0x380bc4[_0x22f24d(0x1c9)]+')')[_0x22f24d(0x1d3)](',\x20');throw CliErrors['validation'](_0x22f24d(0x1e5)+_0x47b2c7+_0x22f24d(0x1c5)+_0x202a91['sqlCode']+':\x20'+_0x4449bf);}function parseExplicitDbDirectory(_0x4db1f6){const _0x1137d2=a243_0x4ed571,_0x1b1060=/^db-(\d+)$/[_0x1137d2(0x1af)](_0x4db1f6);if(!_0x1b1060)return null;const _0xe90e49=Number(_0x1b1060[0x1]);return Number['isFinite'](_0xe90e49)&&_0xe90e49>0x0?_0xe90e49:null;}
|
|
1
|
+
const a243_0x47bbb9=a243_0x4fe3;(function(_0x48f744,_0x26684d){const _0x32cba0=a243_0x4fe3,_0x149f3f=_0x48f744();while(!![]){try{const _0x9346e3=parseInt(_0x32cba0(0x1a8))/0x1*(-parseInt(_0x32cba0(0x1aa))/0x2)+parseInt(_0x32cba0(0x195))/0x3*(-parseInt(_0x32cba0(0x191))/0x4)+-parseInt(_0x32cba0(0x1b4))/0x5+parseInt(_0x32cba0(0x1b8))/0x6+-parseInt(_0x32cba0(0x181))/0x7*(-parseInt(_0x32cba0(0x1b7))/0x8)+-parseInt(_0x32cba0(0x1b5))/0x9+parseInt(_0x32cba0(0x1b6))/0xa*(parseInt(_0x32cba0(0x196))/0xb);if(_0x9346e3===_0x26684d)break;else _0x149f3f['push'](_0x149f3f['shift']());}catch(_0x277a28){_0x149f3f['push'](_0x149f3f['shift']());}}}(a243_0x87e4,0xa4180));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a243_0x4fe3(_0x494806,_0x5cf0e2){_0x494806=_0x494806-0x17d;const _0x87e412=a243_0x87e4();let _0x4fe3c2=_0x87e412[_0x494806];return _0x4fe3c2;}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a243_0x87e4(){const _0x7bbfc8=['get','replace','version','length','appCode','filePath','startsWith','bool','sqlCode','boolean','sql','path','52OYAVQd','dbId','No\x20local\x20SQL\x20files\x20found.','toISOString','6465vxnafO','8503vEzAxw','lockFilePath','Would\x20push\x20','remoteId','Local\x20directory\x20\x22','unchanged','exec','force','sqlRootDir','/smartapi/custom/updateUserCustomSql','\x22\x20for\x20sqlCode\x20','\x20SQL\x20file(s)','str','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Local\x20SQL\x20not\x20found:\x20','has','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','entries','9859twlEYp','Push\x20local\x20SQL\x20files\x20to\x20remote','218LFMVgi','sqlName','POST','hash','catch','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','isFinite','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlcode','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','3032875CuewxG','6278157fiivDk','31670bpaxBy','3843408sPqOyv','902430EbVrRD','dbDirectory','sqlRoot','push','filter','sqlConfig','write','mode','validation','\x20skipped,\x20','dbName','projectRoot','map','sqls','Push\x20complete:\x20','7THHEpy','relativePath','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','join'];a243_0x87e4=function(){return _0x7bbfc8;};return a243_0x87e4();}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x28832f){const _0x4f8a57=a243_0x4fe3,_0x44d5a1=stripLocalSqlMetadata(await readFile(_0x28832f['filePath'],'utf8'),_0x28832f[_0x4f8a57(0x1bf)]);if(!_0x44d5a1['trim']())throw CliErrors['validation'](_0x28832f['sqlCode']+':\x20SQL\x20content\x20is\x20empty.');return _0x44d5a1;}async function getTargetSqlQueries(_0x46ac54,_0x39def8,_0x15834d){const _0x4272e1=a243_0x4fe3,_0x3e3eae=await scanLocalSqlQueries(_0x46ac54),_0xa5d92d=new Map();for(const _0x463c9a of _0x3e3eae){if(_0x15834d&&_0x463c9a[_0x4272e1(0x18d)]!==_0x15834d)continue;const _0x410d4d=_0xa5d92d[_0x4272e1(0x185)](_0x463c9a['sqlCode'])??[];_0x410d4d[_0x4272e1(0x1bb)](_0x463c9a),_0xa5d92d['set'](_0x463c9a[_0x4272e1(0x18d)],_0x410d4d);}if(_0x15834d&&!_0xa5d92d[_0x4272e1(0x1a5)](_0x15834d))throw CliErrors[_0x4272e1(0x1c0)](_0x4272e1(0x1a4)+_0x15834d);const _0x4419fc=[];for(const [_0x1c5017,_0x49a033]of _0xa5d92d[_0x4272e1(0x1a7)]()){if(_0x49a033[_0x4272e1(0x188)]===0x1){_0x4419fc['push'](_0x49a033[0x0]);continue;}const _0x420791=_0x39def8[_0x4272e1(0x17f)][_0x1c5017],_0x769e98=_0x420791?.[_0x4272e1(0x190)],_0x5db6a7=_0x769e98?_0x49a033[_0x4272e1(0x1bc)](_0x3b403f=>_0x3b403f[_0x4272e1(0x182)]!==_0x769e98):_0x49a033;if(_0x420791&&_0x5db6a7['length']===0x1){_0x4419fc[_0x4272e1(0x1bb)](_0x5db6a7[0x0]);continue;}throw CliErrors[_0x4272e1(0x1c0)](_0x4272e1(0x183)+_0x1c5017+_0x4272e1(0x1a3));}return _0x4419fc;}export const sqlPush={'service':a243_0x47bbb9(0x18f),'command':a243_0x47bbb9(0x1bb),'description':a243_0x47bbb9(0x1a9),'risk':a243_0x47bbb9(0x1be),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a243_0x47bbb9(0x19d),'type':a243_0x47bbb9(0x18e),'description':a243_0x47bbb9(0x1af)}],async 'dryRun'(_0x2d3c88){const _0x442c38=a243_0x47bbb9,_0x3ffdf0=loadSqlProjectConfig(_0x2d3c88[_0x442c38(0x189)]),_0x1d1905=await readSqlLockFile(_0x3ffdf0[_0x442c38(0x197)]),{appLock:_0x42aea8}=ensureSqlLockScope(_0x1d1905??createEmptySqlLock(),_0x2d3c88['appCode'],_0x3ffdf0[_0x442c38(0x1ba)],'push'),_0x5035fd=await getTargetSqlQueries(_0x3ffdf0,_0x42aea8,_0x2d3c88['str']('sqlcode')||undefined),_0x4e679e=[];for(const _0x1e6125 of _0x5035fd){const _0x48e1b1=await computeSqlFileHash(_0x1e6125[_0x442c38(0x18a)]),_0xf927fe=_0x42aea8[_0x442c38(0x17f)][_0x1e6125['sqlCode']],_0x3f4f50=!!_0xf927fe&&(_0xf927fe[_0x442c38(0x190)]!==_0x1e6125[_0x442c38(0x182)]||!!_0x1e6125[_0x442c38(0x1ab)]&&_0xf927fe['sqlName']!==_0x1e6125[_0x442c38(0x1ab)]||_0xf927fe[_0x442c38(0x1bf)]!==_0x1e6125[_0x442c38(0x1bf)]);if(!_0x2d3c88[_0x442c38(0x18c)](_0x442c38(0x19d))&&_0xf927fe&&_0xf927fe['hash']===_0x48e1b1&&!_0x3f4f50)continue;if(!_0xf927fe)throw CliErrors['validation'](_0x1e6125[_0x442c38(0x18d)]+':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.');if(_0xf927fe[_0x442c38(0x187)]==null)throw CliErrors[_0x442c38(0x1c0)](_0x1e6125[_0x442c38(0x18d)]+':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.');await resolveTargetDbBinding(_0x2d3c88['appCode'],_0x1e6125,_0xf927fe),await readSqlUploadContent(_0x1e6125),_0x4e679e[_0x442c38(0x1bb)](_0x1e6125[_0x442c38(0x18d)]);}return{'method':_0x442c38(0x1ac),'url':_0x442c38(0x19f),'body':{'sqlCodes':_0x4e679e,'appCode':_0x2d3c88[_0x442c38(0x189)]},'description':_0x442c38(0x198)+_0x4e679e[_0x442c38(0x188)]+_0x442c38(0x1a1)};},async 'execute'(_0x65cee9){const _0x535e48=a243_0x47bbb9,_0x32a928=loadSqlProjectConfig(_0x65cee9['appCode']),_0x47913c=await readSqlLockFile(_0x32a928['lockFilePath']),{lockData:_0x290472,appLock:_0x143f30}=ensureSqlLockScope(_0x47913c??createEmptySqlLock(),_0x65cee9[_0x535e48(0x189)],_0x32a928['sqlRoot'],_0x535e48(0x1bb)),_0x593987=await getTargetSqlQueries(_0x32a928,_0x143f30,_0x65cee9[_0x535e48(0x1a2)](_0x535e48(0x1b2))||undefined);if(_0x593987[_0x535e48(0x188)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x535e48(0x193)};const _0x29a609=[],_0x319f31=[],_0x369245=[];let _0x311f59=![];for(const _0x458cb5 of _0x593987){const _0x3ccb69=_0x143f30['sqls'][_0x458cb5[_0x535e48(0x18d)]];if(!_0x3ccb69){_0x369245[_0x535e48(0x1bb)]({'sqlCode':_0x458cb5[_0x535e48(0x18d)],'error':_0x535e48(0x1a6)});continue;}try{const _0x2cba9d=await computeSqlFileHash(_0x458cb5[_0x535e48(0x18a)]),_0x537724=_0x3ccb69[_0x535e48(0x190)]!==_0x458cb5['relativePath']||!!_0x458cb5[_0x535e48(0x1ab)]&&_0x3ccb69[_0x535e48(0x1ab)]!==_0x458cb5[_0x535e48(0x1ab)]||_0x3ccb69[_0x535e48(0x1bf)]!==_0x458cb5[_0x535e48(0x1bf)];if(!_0x65cee9['bool'](_0x535e48(0x19d))&&_0x3ccb69[_0x535e48(0x1ad)]===_0x2cba9d&&!_0x537724){_0x319f31[_0x535e48(0x1bb)]({'sqlCode':_0x458cb5[_0x535e48(0x18d)],'reason':_0x535e48(0x19b)});continue;}if(_0x3ccb69[_0x535e48(0x187)]==null){_0x369245[_0x535e48(0x1bb)]({'sqlCode':_0x458cb5['sqlCode'],'error':_0x535e48(0x1b1)});continue;}const _0x4f19e5=_0x458cb5[_0x535e48(0x1ab)]||_0x3ccb69[_0x535e48(0x1ab)],_0x289d67=await resolveTargetDbBinding(_0x65cee9[_0x535e48(0x189)],_0x458cb5,_0x3ccb69),_0x303a0c=await readSqlUploadContent(_0x458cb5),_0x388337=await updateSqlQuery({'id':_0x3ccb69[_0x535e48(0x199)],'appCode':_0x65cee9[_0x535e48(0x189)],'sqlCode':_0x458cb5[_0x535e48(0x18d)],'sqlName':_0x4f19e5,'dbId':_0x289d67[_0x535e48(0x192)],'version':_0x3ccb69['version'],'sqlContent':_0x303a0c,'sqlConfig':_0x3ccb69[_0x535e48(0x1bd)]??undefined}),_0x9a3dde=_0x388337[_0x535e48(0x192)]?await getDbName(_0x65cee9[_0x535e48(0x189)],Number(_0x388337[_0x535e48(0x192)]))[_0x535e48(0x1ae)](()=>_0x289d67['dbName']):_0x289d67[_0x535e48(0x1c2)];_0x143f30[_0x535e48(0x17f)][_0x458cb5['sqlCode']]={...buildSqlLockEntry(_0x388337,_0x303a0c,_0x2cba9d,{'dbName':_0x9a3dde}),'path':_0x458cb5[_0x535e48(0x182)],'mode':_0x458cb5[_0x535e48(0x1bf)]},_0x311f59=!![],await archivePreviousSqlFileIfNeeded(_0x32a928,_0x3ccb69['path'],_0x458cb5[_0x535e48(0x182)]),_0x29a609['push']({'sqlCode':_0x458cb5[_0x535e48(0x18d)],'remoteId':_0x3ccb69[_0x535e48(0x199)]});}catch(_0x23debf){_0x369245[_0x535e48(0x1bb)]({'sqlCode':_0x458cb5[_0x535e48(0x18d)],'error':_0x23debf instanceof Error?_0x23debf['message']:String(_0x23debf)});}}(_0x311f59||_0x369245[_0x535e48(0x188)]===0x0)&&(_0x143f30['lastSync']=new Date()[_0x535e48(0x194)](),await writeSqlLockFile(_0x32a928[_0x535e48(0x197)],_0x290472));const _0x32b53e=_0x369245['length']===0x0;return{'ok':_0x32b53e,'data':{'pushed':_0x29a609,'skipped':_0x319f31,'failed':_0x369245},'message':_0x535e48(0x180)+_0x29a609['length']+'\x20pushed,\x20'+_0x319f31[_0x535e48(0x188)]+_0x535e48(0x1c1)+_0x369245[_0x535e48(0x188)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x430bd2,_0x4ef46b,_0x2d1673){const _0x1e7ea3=a243_0x47bbb9;if(!_0x4ef46b||_0x4ef46b===_0x2d1673)return;const _0x1223fa=join(_0x430bd2[_0x1e7ea3(0x19e)],_0x4ef46b);if(!await fileExists(_0x1223fa))return;const _0x17284a=await moveToTrash(_0x430bd2[_0x1e7ea3(0x17d)],_0x430bd2['trashDir'],_0x1223fa);await cleanupEmptyDirectories(dirname(_0x1223fa),_0x430bd2[_0x1e7ea3(0x19e)]),void _0x17284a;}async function moveToTrash(_0x5821b1,_0xf4e6f9,_0x183ff3){const _0x390b29=a243_0x47bbb9,_0x2b042a=new Date()['toISOString']()[_0x390b29(0x186)](/[:.]/g,'-'),_0x333614=relative(_0x5821b1,_0x183ff3),_0x22e566=join(_0xf4e6f9,_0x2b042a,_0x333614);return await mkdir(dirname(_0x22e566),{'recursive':!![]}),await rename(_0x183ff3,_0x22e566),_0x22e566;}async function cleanupEmptyDirectories(_0x20f02a,_0x3c4d85){const _0x5138bb=a243_0x47bbb9;let _0x2156b6=resolve(_0x20f02a);const _0x2e8f22=resolve(_0x3c4d85);while(_0x2156b6[_0x5138bb(0x18b)](''+_0x2e8f22+sep)||_0x2156b6===_0x2e8f22){if(_0x2156b6===_0x2e8f22)return;try{const _0x292d44=await readdir(_0x2156b6);if(_0x292d44[_0x5138bb(0x188)]>0x0)return;await rmdir(_0x2156b6);}catch{return;}_0x2156b6=dirname(_0x2156b6);}}async function resolveTargetDbBinding(_0x2cce8e,_0x14de15,_0x176a12){const _0x3bbf4d=a243_0x47bbb9,_0x3b7fdd=_0x14de15[_0x3bbf4d(0x1b9)];if(!_0x3b7fdd)return{'dbId':_0x176a12['dbId'],'dbName':_0x176a12[_0x3bbf4d(0x1c2)]};const _0x40313d=buildDbDirectoryName(_0x176a12[_0x3bbf4d(0x1c2)],_0x176a12[_0x3bbf4d(0x192)]);if(_0x3b7fdd===_0x40313d)return{'dbId':_0x176a12[_0x3bbf4d(0x192)],'dbName':_0x176a12[_0x3bbf4d(0x1c2)]};const _0x4a4f01=parseExplicitDbDirectory(_0x3b7fdd);if(_0x4a4f01!=null)return{'dbId':_0x4a4f01,'dbName':await getDbName(_0x2cce8e,_0x4a4f01)['catch'](()=>undefined)};const _0x2f5c28=await listDatabases(_0x2cce8e),_0x333b36=_0x2f5c28[_0x3bbf4d(0x1bc)](_0x4e7f1c=>buildDbDirectoryName(_0x4e7f1c[_0x3bbf4d(0x1c2)],_0x4e7f1c[_0x3bbf4d(0x192)])===_0x3b7fdd);if(_0x333b36[_0x3bbf4d(0x188)]===0x1)return{'dbId':_0x333b36[0x0][_0x3bbf4d(0x192)],'dbName':_0x333b36[0x0][_0x3bbf4d(0x1c2)]};if(_0x333b36[_0x3bbf4d(0x188)]===0x0)throw CliErrors[_0x3bbf4d(0x1c0)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x3b7fdd+_0x3bbf4d(0x1a0)+_0x14de15['sqlCode']+'.');const _0x6b8a03=_0x333b36[_0x3bbf4d(0x17e)](_0x38abfb=>_0x38abfb['dbName']+'\x20('+_0x38abfb[_0x3bbf4d(0x192)]+')')[_0x3bbf4d(0x184)](',\x20');throw CliErrors[_0x3bbf4d(0x1c0)](_0x3bbf4d(0x19a)+_0x3b7fdd+_0x3bbf4d(0x1b3)+_0x14de15[_0x3bbf4d(0x18d)]+':\x20'+_0x6b8a03);}function parseExplicitDbDirectory(_0x526945){const _0x4c8aac=a243_0x47bbb9,_0x39eec3=/^db-(\d+)$/[_0x4c8aac(0x19c)](_0x526945);if(!_0x39eec3)return null;const _0x97fcda=Number(_0x39eec3[0x1]);return Number[_0x4c8aac(0x1b0)](_0x97fcda)&&_0x97fcda>0x0?_0x97fcda:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a244_0x1a677b=a244_0x8d83;(function(_0x4416f6,_0x49d486){const _0x28cc35=a244_0x8d83,_0x274c87=_0x4416f6();while(!![]){try{const _0x20abdc=-parseInt(_0x28cc35(0x1c4))/0x1+-parseInt(_0x28cc35(0x1bf))/0x2*(parseInt(_0x28cc35(0x1b6))/0x3)+-parseInt(_0x28cc35(0x19c))/0x4*(parseInt(_0x28cc35(0x1c8))/0x5)+-parseInt(_0x28cc35(0x1af))/0x6*(parseInt(_0x28cc35(0x1c2))/0x7)+-parseInt(_0x28cc35(0x19a))/0x8*(parseInt(_0x28cc35(0x1ae))/0x9)+parseInt(_0x28cc35(0x1ba))/0xa*(parseInt(_0x28cc35(0x19b))/0xb)+parseInt(_0x28cc35(0x1b9))/0xc*(parseInt(_0x28cc35(0x1b4))/0xd);if(_0x20abdc===_0x49d486)break;else _0x274c87['push'](_0x274c87['shift']());}catch(_0x5d2f65){_0x274c87['push'](_0x274c87['shift']());}}}(a244_0x39e1,0xf161f));function a244_0x8d83(_0x11b6dd,_0x414702){_0x11b6dd=_0x11b6dd-0x198;const _0x39e1d3=a244_0x39e1();let _0x8d83ca=_0x39e1d3[_0x11b6dd];return _0x8d83ca;}import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a244_0x1a677b(0x1a9);export function buildSqlLockEntry(_0x3f5e6c,_0xe1a1f3,_0x51559a,_0x494e40){const _0x27bc7c=a244_0x1a677b,_0x1a508a=detectSqlMode(_0xe1a1f3);return{'path':buildSqlRelativePath(_0x3f5e6c[_0x27bc7c(0x1aa)],_0x3f5e6c[_0x27bc7c(0x1a4)],_0x494e40?.[_0x27bc7c(0x1bb)],_0x1a508a,_0x3f5e6c['dbId']),'hash':_0x51559a,'remoteId':_0x3f5e6c['id'],'version':_0x3f5e6c[_0x27bc7c(0x1c5)],'dbId':Number(_0x3f5e6c[_0x27bc7c(0x1be)]),'dbName':_0x494e40?.[_0x27bc7c(0x1bb)],'sqlName':_0x3f5e6c[_0x27bc7c(0x1a4)],'sqlConfig':_0x3f5e6c[_0x27bc7c(0x1b3)]??undefined,'mode':_0x1a508a};}export function cloneSqlLockData(_0x311d86){const _0x2b4e60=a244_0x1a677b;return{'apps':Object['fromEntries'](Object[_0x2b4e60(0x1a7)](_0x311d86['apps'])[_0x2b4e60(0x19d)](([_0x3bc3ad,_0x504e9c])=>[_0x3bc3ad,{'sqlRoot':_0x504e9c['sqlRoot'],'lastSync':_0x504e9c[_0x2b4e60(0x1a6)],'sqls':{..._0x504e9c[_0x2b4e60(0x1a1)]}}]))};}function a244_0x39e1(){const _0x4f1964=['toLowerCase','<!--\x20@lovrabet.','16649901jyEDzb','5486568KcYeyR','trimStart','mode','mybatisXml','sqlConfig','1056679YjZlOH','endsWith','2615565aAmNwJ','replace','exec','876DkwEck','3880guWHtb','dbName','join','stdin','dbId','4IAGCIV','length','apps','7upNkcO','split','1823504HOUqPf','version','syncedAt','trim','37045WmdiGI','declaration','sqlContent','question','8aQGois','39523RagzrF','4uvnyYa','map','\x20-->','filter','description','sqls','path','includes','sqlName','yes','lastSync','entries','\x20[y/N]\x20','.rabetbase/sql','sqlCode','slice'];a244_0x39e1=function(){return _0x4f1964;};return a244_0x39e1();}export function ensureRemoteSqlContent(_0x1fc4be){const _0x59d485=a244_0x1a677b;return _0x1fc4be[_0x59d485(0x198)]??'';}export function buildLocalSqlFileContent(_0xc8c397,_0x24f3c0,_0x1957a7){const _0x3c16df=a244_0x1a677b,_0x2f8427=_0x1957a7?.[_0x3c16df(0x1b1)]??detectSqlMode(_0x24f3c0),_0x3ea05f=stripLocalSqlMetadata(_0x24f3c0,_0x2f8427)[_0x3c16df(0x1c7)](),_0x1250a6=buildMetadataHeaderLines({'sqlCode':_0xc8c397[_0x3c16df(0x1aa)],'sqlName':_0xc8c397[_0x3c16df(0x1a4)],'dbId':_0xc8c397[_0x3c16df(0x1be)],'dbName':_0x1957a7?.['dbName'],'mode':_0x2f8427,'syncedAt':_0x1957a7?.[_0x3c16df(0x1c6)],'description':_0x1957a7?.[_0x3c16df(0x1a0)]},_0x2f8427),_0x393092=_0x2f8427==='mybatisXml'?splitXmlDeclaration(_0x3ea05f):{'body':_0x3ea05f},_0x120853=[..._0x393092[_0x3c16df(0x1c9)]?[_0x393092[_0x3c16df(0x1c9)]]:[],..._0x1250a6,'',_0x393092['body'][_0x3c16df(0x1b0)]()],_0x1eba4d=_0x120853[_0x3c16df(0x1bc)]('\x0a');return _0x1eba4d[_0x3c16df(0x1b5)]('\x0a')?_0x1eba4d:_0x1eba4d+'\x0a';}export function stripLocalSqlMetadata(_0x417672,_0x4a3871){const _0x466c12=a244_0x1a677b;if(_0x4a3871===_0x466c12(0x1b2)){const {declaration:_0x56af51,body:_0x6598d}=splitXmlDeclaration(_0x417672[_0x466c12(0x1b7)](/\r\n/g,'\x0a')),_0x20322c=stripLeadingMetadataLines(_0x6598d,/^\s*<!--\s*@lovrabet\./);return _0x56af51?''+_0x56af51+(_0x20322c?'\x0a'+_0x20322c:''):_0x20322c;}return stripLeadingMetadataLines(_0x417672['replace'](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x2c4395,_0x17fab9){if(_0x17fab9?.['mode'])return _0x17fab9['mode'];return detectSqlMode(_0x2c4395);}export function resolveSqlFileName(_0x15915e,_0x589143,_0x48a817){const _0x1d8b87=a244_0x1a677b;if(_0x48a817?.[_0x1d8b87(0x1a2)])return _0x48a817['path'];if(_0x48a817?.[_0x1d8b87(0x1a4)]||_0x48a817?.[_0x1d8b87(0x1bb)])return buildSqlRelativePath(_0x15915e,_0x48a817?.[_0x1d8b87(0x1a4)],_0x48a817?.[_0x1d8b87(0x1bb)],resolveSqlMode(_0x589143,_0x48a817),_0x48a817?.[_0x1d8b87(0x1be)]);return buildDefaultSqlFileName(_0x15915e,resolveSqlMode(_0x589143,_0x48a817));}export function resolveSqlLocalDir(_0x38f63d,_0x110df1){return join(_0x38f63d,SQL_LOCAL_REL_DIR,_0x110df1);}export async function confirmForceOverwrite(_0x2faf9d){const _0x265283=a244_0x1a677b,_0xb3d1a0=createInterface({'input':process[_0x265283(0x1bd)],'output':process['stderr']}),_0x42a2e8=await new Promise(_0x457723=>{const _0x568feb=_0x265283;_0xb3d1a0[_0x568feb(0x199)](_0x2faf9d+_0x568feb(0x1a8),_0x457723);});return _0xb3d1a0['close'](),['y',_0x265283(0x1a5)][_0x265283(0x1a3)](_0x42a2e8[_0x265283(0x1c7)]()[_0x265283(0x1ac)]());}export function findSqlLockScope(_0x2844a5,_0x21f31c){const _0x1d9d7d=a244_0x1a677b;return _0x2844a5[_0x1d9d7d(0x1c1)][_0x21f31c];}function buildMetadataHeaderLines(_0x2be8a5,_0xf72285){const _0x42db86=a244_0x1a677b,_0x55a6f8=[[_0x42db86(0x1aa),_0x2be8a5['sqlCode']],['sqlName',_0x2be8a5['sqlName']],['dbId',_0x2be8a5[_0x42db86(0x1be)]],['dbName',_0x2be8a5['dbName']],[_0x42db86(0x1b1),_0x2be8a5[_0x42db86(0x1b1)]],[_0x42db86(0x1c6),_0x2be8a5[_0x42db86(0x1c6)]],[_0x42db86(0x1a0),_0x2be8a5[_0x42db86(0x1a0)]]];if(_0xf72285==='mybatisXml')return _0x55a6f8[_0x42db86(0x19f)](([,_0x3c33c2])=>_0x3c33c2!==undefined&&_0x3c33c2!==null&&String(_0x3c33c2)[_0x42db86(0x1c7)]()!=='')[_0x42db86(0x19d)](([_0x13d8b4,_0x554d53])=>_0x42db86(0x1ad)+_0x13d8b4+':\x20'+String(_0x554d53)+_0x42db86(0x19e));return _0x55a6f8[_0x42db86(0x19f)](([,_0x1053de])=>_0x1053de!==undefined&&_0x1053de!==null&&String(_0x1053de)['trim']()!=='')['map'](([_0x195633,_0x40b084])=>'--\x20@lovrabet.'+_0x195633+':\x20'+String(_0x40b084));}function splitXmlDeclaration(_0x5c0915){const _0x3973e8=a244_0x1a677b,_0x5226ba=_0x5c0915[_0x3973e8(0x1b0)](),_0x30bb06=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x3973e8(0x1b8)](_0x5226ba);if(!_0x30bb06)return{'body':_0x5c0915};return{'declaration':_0x30bb06[0x0],'body':_0x5226ba[_0x3973e8(0x1ab)](_0x30bb06[0x0][_0x3973e8(0x1c0)])};}function stripLeadingMetadataLines(_0x2e4177,_0x1eef1a){const _0x189679=a244_0x1a677b,_0x3860ce=_0x2e4177[_0x189679(0x1c3)]('\x0a');let _0x33d5ab=0x0;while(_0x33d5ab<_0x3860ce[_0x189679(0x1c0)]){const _0x25bd1e=_0x3860ce[_0x33d5ab]??'';if(_0x1eef1a['test'](_0x25bd1e)||_0x25bd1e[_0x189679(0x1c7)]()===''){_0x33d5ab++;continue;}break;}return _0x3860ce[_0x189679(0x1ab)](_0x33d5ab)['join']('\x0a')[_0x189679(0x1b0)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a245_0x3fb24d=a245_0x5e22;(function(_0x2d08b7,_0x508f73){const _0x514654=a245_0x5e22,_0x1c14e3=_0x2d08b7();while(!![]){try{const _0x28442d=parseInt(_0x514654(0x180))/0x1+-parseInt(_0x514654(0x181))/0x2*(-parseInt(_0x514654(0x176))/0x3)+parseInt(_0x514654(0x16f))/0x4*(-parseInt(_0x514654(0x17d))/0x5)+-parseInt(_0x514654(0x16d))/0x6*(parseInt(_0x514654(0x187))/0x7)+-parseInt(_0x514654(0x170))/0x8*(parseInt(_0x514654(0x184))/0x9)+parseInt(_0x514654(0x17e))/0xa+-parseInt(_0x514654(0x182))/0xb*(parseInt(_0x514654(0x16e))/0xc);if(_0x28442d===_0x508f73)break;else _0x1c14e3['push'](_0x1c14e3['shift']());}catch(_0xabd34a){_0x1c14e3['push'](_0x1c14e3['shift']());}}}(a245_0x3fe1,0xb21b6));import{listSqlQueries}from'../../core/api-client.js';function a245_0x5e22(_0x10946a,_0xf862da){_0x10946a=_0x10946a-0x169;const _0x3fe177=a245_0x3fe1();let _0x5e22ed=_0x3fe177[_0x10946a];return _0x5e22ed;}function a245_0x3fe1(){const _0x21cfe3=['push','hash','appCode','filePath','3elazPT','lockFilePath','\x20added,\x20','map','\x20modified,\x20','remote','relativePath','573985DzKmxy','8456020hlBPSy','path','1409494PUmYhH','2583134vmWSCa','9797887RlmTtr','totalCount','11952774TVYTke','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20remote-only','623InqHwv','\x20unchanged','sqlRoot','sqlName','length','tableData','status','has','\x20missing,\x20','sqls','32598nvSjqu','12AjfpSw','4JYTFUc','8ARjtEu','lockKey'];a245_0x3fe1=function(){return _0x21cfe3;};return a245_0x3fe1();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x2ea40a){const _0x42624f=a245_0x5e22,_0xdfef12=[];let _0x2e9c97=0x1;while(!![]){const _0x23e6fe=await listSqlQueries(_0x2ea40a,{'currentPage':_0x2e9c97,'pageSize':PAGE_SIZE}),_0x225d4e=_0x23e6fe[_0x42624f(0x18c)]??[];_0xdfef12[_0x42624f(0x172)](..._0x225d4e[_0x42624f(0x179)](_0x201a95=>_0x201a95['sqlCode']));if(_0x225d4e[_0x42624f(0x18b)]===0x0)break;const _0x4e11bc=_0x23e6fe['paging']?.[_0x42624f(0x183)];if(_0x4e11bc!=null?_0xdfef12['length']>=_0x4e11bc:_0x225d4e['length']<PAGE_SIZE)break;_0x2e9c97++;}return _0xdfef12;}export const sqlStatus={'service':'sql','command':a245_0x3fb24d(0x169),'description':a245_0x3fb24d(0x185),'risk':'read','flags':[{'name':a245_0x3fb24d(0x17b),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x24fa0d){const _0x94f222=a245_0x3fb24d,_0x24f528=loadSqlProjectConfig(_0x24fa0d[_0x94f222(0x174)]),_0x3c8edb=await readSqlLockFile(_0x24f528[_0x94f222(0x177)]),{appLock:_0x1da043}=ensureSqlLockScope(_0x3c8edb??createEmptySqlLock(),_0x24f528[_0x94f222(0x174)],_0x24f528[_0x94f222(0x189)],_0x94f222(0x169)),_0x550d94=await scanLocalSqlQueries(_0x24f528),_0x5da2f6=[],_0x4af51e=[],_0x591629=[],_0x5f56ad=[],_0x4db074=new Set(_0x550d94['map'](_0x4099e2=>_0x4099e2['lockKey']));for(const _0x58db30 of _0x550d94){const _0x14d05d=await computeSqlFileHash(_0x58db30[_0x94f222(0x175)]),_0x2bc069=_0x1da043[_0x94f222(0x16c)][_0x58db30[_0x94f222(0x171)]],_0x1dfa80=!!_0x2bc069&&_0x2bc069[_0x94f222(0x17f)]!==_0x58db30[_0x94f222(0x17c)],_0x49db65=!!_0x2bc069&&!!_0x58db30[_0x94f222(0x18a)]&&_0x2bc069[_0x94f222(0x18a)]!==_0x58db30[_0x94f222(0x18a)];if(!_0x2bc069)_0x5da2f6['push'](_0x58db30[_0x94f222(0x171)]);else _0x2bc069[_0x94f222(0x173)]!==_0x14d05d||_0x1dfa80||_0x49db65?_0x4af51e['push'](_0x58db30[_0x94f222(0x171)]):_0x591629[_0x94f222(0x172)](_0x58db30[_0x94f222(0x171)]);}for(const _0x54c858 of Object['keys'](_0x1da043[_0x94f222(0x16c)])){!_0x4db074[_0x94f222(0x16a)](_0x54c858)&&_0x5f56ad['push'](_0x54c858);}const _0x557641=[];if(_0x24fa0d['bool'](_0x94f222(0x17b))){const _0x1dc62e=await fetchAllSqlCodes(_0x24fa0d['appCode']);for(const _0x3dd8ec of _0x1dc62e){!_0x4db074[_0x94f222(0x16a)](_0x3dd8ec)&&!_0x1da043[_0x94f222(0x16c)][_0x3dd8ec]&&_0x557641[_0x94f222(0x172)](_0x3dd8ec);}}const _0x3c3bd7=_0x5da2f6[_0x94f222(0x18b)]===0x0&&_0x4af51e[_0x94f222(0x18b)]===0x0&&_0x5f56ad['length']===0x0&&_0x557641[_0x94f222(0x18b)]===0x0;return{'ok':!![],'data':{'added':_0x5da2f6,'modified':_0x4af51e,'missing':_0x5f56ad,'unchanged':_0x591629,'remoteOnly':_0x557641},'message':_0x3c3bd7?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x5da2f6['length']+_0x94f222(0x178)+_0x4af51e[_0x94f222(0x18b)]+_0x94f222(0x17a)+_0x5f56ad[_0x94f222(0x18b)]+_0x94f222(0x16b)+_0x591629['length']+_0x94f222(0x188)+(_0x557641['length']>0x0?',\x20'+_0x557641[_0x94f222(0x18b)]+_0x94f222(0x186):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a246_0x5a9c6d=a246_0x1dc6;(function(_0x1d1ab4,_0x247a34){const _0x5831a5=a246_0x1dc6,_0x447274=_0x1d1ab4();while(!![]){try{const _0x26e629=parseInt(_0x5831a5(0x1d7))/0x1*(parseInt(_0x5831a5(0x1e7))/0x2)+-parseInt(_0x5831a5(0x1d4))/0x3+-parseInt(_0x5831a5(0x1b6))/0x4+-parseInt(_0x5831a5(0x1ca))/0x5*(parseInt(_0x5831a5(0x1a2))/0x6)+-parseInt(_0x5831a5(0x1b8))/0x7+-parseInt(_0x5831a5(0x1c8))/0x8*(parseInt(_0x5831a5(0x1e3))/0x9)+parseInt(_0x5831a5(0x1a1))/0xa*(parseInt(_0x5831a5(0x1e6))/0xb);if(_0x26e629===_0x247a34)break;else _0x447274['push'](_0x447274['shift']());}catch(_0x139be8){_0x447274['push'](_0x447274['shift']());}}}(a246_0x1ebe,0x47548));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a246_0x1ebe(){const _0x58d9b8=['toLowerCase','primary','trim','2271519VuAmGA','string','split','11TBXWuf','6MRHHVG','push','11631890cSGrDy','72bmpRZk','validate','File\x20not\x20found:\x20','schema:','sql','boolean','filter','get','\x22\x20not\x20found\x20in\x20any\x20dataset','check-indexes','index_columns','SQL\x20schema\x20validation','length','fields','dataset','joinAudit','message','sqlType','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','schemas','1549760XVtLOk','validation','1462643VABTCj','isSelectOnly','parameters','pkField','isDangerous','tableName','file','indexName','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','appCode','utf-8','find','name','isArray','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','index_type','8CJBpkn','Table\x20\x22','4905TAbgWW','dbtableConfig','str','isLockingRead','map','size','Provide\x20--file\x20or\x20--sql','index_name','valid','columns','911328FrsTuc','read','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','97769BXCQdt','\x22\x20not\x20found\x20or\x20not\x20accessible','type','flagMissing','from','indexes','flatMap','reason','columnNames'];a246_0x1ebe=function(){return _0x58d9b8;};return a246_0x1ebe();}import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a246_0x1dc6(_0x86afda,_0x47ffc2){_0x86afda=_0x86afda-0x1a0;const _0x1ebe4c=a246_0x1ebe();let _0x1dc6e5=_0x1ebe4c[_0x86afda];return _0x1dc6e5;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a246_0x5a9c6d(0x1a6),'command':a246_0x5a9c6d(0x1a3),'description':a246_0x5a9c6d(0x1c6),'risk':a246_0x5a9c6d(0x1d5),'flags':[{'name':a246_0x5a9c6d(0x1be),'type':a246_0x5a9c6d(0x1e4),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a246_0x5a9c6d(0x1a6),'type':a246_0x5a9c6d(0x1e4),'description':a246_0x5a9c6d(0x1c0)},{'name':a246_0x5a9c6d(0x1b5),'type':a246_0x5a9c6d(0x1e4),'description':a246_0x5a9c6d(0x1b4)},{'name':'check-indexes','type':a246_0x5a9c6d(0x1a7),'description':a246_0x5a9c6d(0x1d6)}],async 'execute'(_0x659106){const _0x2d129d=a246_0x5a9c6d,_0x679d5b=_0x659106[_0x2d129d(0x1cc)]('file'),_0x2c2f75=_0x659106[_0x2d129d(0x1cc)]('sql'),_0x397bb8=_0x659106['str'](_0x2d129d(0x1b5)),_0x2cbcf0=_0x659106['bool'](_0x2d129d(0x1ab));if(!_0x679d5b&&!_0x2c2f75)throw CliErrors[_0x2d129d(0x1da)](_0x2d129d(0x1be),_0x2d129d(0x1d0));if(_0x2cbcf0&&!_0x397bb8)throw CliErrors[_0x2d129d(0x1b7)]('--check-indexes\x20requires\x20--schemas.');let _0x4c1b50;if(_0x679d5b){const _0x135754=resolve(process['cwd'](),_0x679d5b);if(!existsSync(_0x135754))throw CliErrors[_0x2d129d(0x1b7)](_0x2d129d(0x1a4)+_0x135754);_0x4c1b50=readFileSync(_0x135754,_0x2d129d(0x1c2));}else _0x4c1b50=_0x2c2f75;const _0x12b4c7=validateSql(_0x4c1b50),_0x4d57e5={'valid':_0x12b4c7[_0x2d129d(0x1d2)],'sqlType':_0x12b4c7[_0x2d129d(0x1b3)][_0x2d129d(0x1d9)],'isSelectOnly':_0x12b4c7[_0x2d129d(0x1b3)][_0x2d129d(0x1b9)],'isLockingRead':_0x12b4c7[_0x2d129d(0x1b3)][_0x2d129d(0x1cd)]??![],'isDangerous':_0x12b4c7[_0x2d129d(0x1b3)][_0x2d129d(0x1bc)],'tables':_0x12b4c7['tables'],'parameters':_0x12b4c7[_0x2d129d(0x1ba)],'message':_0x12b4c7[_0x2d129d(0x1b2)]};_0x12b4c7['sqlType'][_0x2d129d(0x1de)]&&(_0x4d57e5[_0x2d129d(0x1de)]=_0x12b4c7['sqlType']['reason']);if(_0x397bb8&&_0x12b4c7[_0x2d129d(0x1d2)]){const _0x543dbb=_0x397bb8['split'](',')[_0x2d129d(0x1ce)](_0x2d8258=>_0x2d8258[_0x2d129d(0x1e2)]())[_0x2d129d(0x1a8)](Boolean),_0x1d8b1a=[],_0x11ccce=[],_0x36368a=filterDbTableBackedDatasets(await listDatasets(_0x659106[_0x2d129d(0x1c1)])),_0x54bc3d=new Map(_0x36368a[_0x2d129d(0x1ce)](_0x4aed2d=>[_0x4aed2d['dbtableConfig']?.[_0x2d129d(0x1bd)]?.[_0x2d129d(0x1e0)](),_0x4aed2d]));for(const _0x2476da of _0x12b4c7['tables']){const _0xc15163=_0x54bc3d[_0x2d129d(0x1a9)](_0x2476da[_0x2d129d(0x1e0)]());!_0xc15163&&_0x1d8b1a[_0x2d129d(0x1a0)](_0x2d129d(0x1c9)+_0x2476da+_0x2d129d(0x1aa));}for(const _0x16fff6 of _0x543dbb){let _0x177a5a;try{_0x177a5a=await getDatasetDetail(_0x16fff6);}catch{_0x1d8b1a[_0x2d129d(0x1a0)]('Dataset\x20\x22'+_0x16fff6+_0x2d129d(0x1d8));continue;}assertDatasetIsDbTableBacked(_0x177a5a,_0x2d129d(0x1ad));const _0xb835a1=Array[_0x2d129d(0x1c5)](_0x177a5a[_0x2d129d(0x1af)])?_0x177a5a['fields']:[],_0x4768fe=new Set(_0xb835a1['map'](_0x4d2c0c=>_0x4d2c0c[_0x2d129d(0x1c4)]?.[_0x2d129d(0x1e0)]())),_0x4695b3=_0x177a5a[_0x2d129d(0x1cb)]?.[_0x2d129d(0x1bd)]||_0x177a5a['tableName']||_0x16fff6;_0x4d57e5[_0x2d129d(0x1a5)+_0x4695b3]={'code':_0x16fff6,'tableName':_0x4695b3,'fieldCount':_0x4768fe[_0x2d129d(0x1cf)],'fields':Array[_0x2d129d(0x1db)](_0x4768fe)};if(_0x2cbcf0){const _0x4910b7=normalizeDatasetIndexes(_0x177a5a);_0x11ccce['push']({'tableName':_0x4695b3,..._0x4910b7});}}_0x1d8b1a[_0x2d129d(0x1ae)]>0x0&&(_0x4d57e5['schemaWarnings']=_0x1d8b1a),_0x2cbcf0&&(_0x4d57e5[_0x2d129d(0x1b1)]=auditSqlJoinIndexes(_0x4c1b50,_0x11ccce));}return{'ok':_0x12b4c7['valid'],'data':_0x4d57e5,'message':_0x12b4c7['message']};}};function normalizeDatasetIndexes(_0x16a41a){const _0x34d2c3=a246_0x5a9c6d,_0x3f0a12=Array[_0x34d2c3(0x1c5)](_0x16a41a?.[_0x34d2c3(0x1b0)]?.[_0x34d2c3(0x1dc)])?_0x16a41a['dataset']['indexes']:Array[_0x34d2c3(0x1c5)](_0x16a41a?.['indexes'])?_0x16a41a['indexes']:[],_0x22a858=_0x3f0a12[_0x34d2c3(0x1dd)](_0x32c216=>{const _0x36d72e=_0x34d2c3,_0x844741=Array[_0x36d72e(0x1c5)](_0x32c216?.['index_columns'])?_0x32c216[_0x36d72e(0x1ac)]:Array[_0x36d72e(0x1c5)](_0x32c216?.[_0x36d72e(0x1df)])?_0x32c216['columnNames']:Array[_0x36d72e(0x1c5)](_0x32c216?.[_0x36d72e(0x1d3)])?_0x32c216[_0x36d72e(0x1d3)]:[],_0x24c0de=_0x844741[_0x36d72e(0x1a8)](_0x16388c=>typeof _0x16388c===_0x36d72e(0x1e4))[_0x36d72e(0x1ce)](_0x1b5d5b=>_0x1b5d5b['trim']())[_0x36d72e(0x1a8)](Boolean);if(_0x24c0de[_0x36d72e(0x1ae)]===0x0)return[];const _0x35f9d2=[_0x32c216?.[_0x36d72e(0x1bf)],_0x32c216?.[_0x36d72e(0x1d1)],_0x32c216?.[_0x36d72e(0x1c4)]]['find'](_0x2bb094=>typeof _0x2bb094===_0x36d72e(0x1e4)&&_0x2bb094[_0x36d72e(0x1e2)]()),_0x5a3e56=[_0x32c216?.[_0x36d72e(0x1c7)],_0x32c216?.[_0x36d72e(0x1d9)]][_0x36d72e(0x1c3)](_0x4354bf=>typeof _0x4354bf===_0x36d72e(0x1e4)&&_0x4354bf['trim']());return[{..._0x35f9d2?{'name':_0x35f9d2['trim']()}:{},..._0x5a3e56?{'type':_0x5a3e56[_0x36d72e(0x1e2)]()}:{},'columns':_0x24c0de}];}),_0x338781=[..._0x22a858],_0xb67f2=typeof _0x16a41a?.['dbtableConfig']?.[_0x34d2c3(0x1bb)]===_0x34d2c3(0x1e4)?_0x16a41a[_0x34d2c3(0x1cb)][_0x34d2c3(0x1bb)][_0x34d2c3(0x1e5)](',')[_0x34d2c3(0x1ce)](_0x738717=>_0x738717[_0x34d2c3(0x1e2)]())[_0x34d2c3(0x1a8)](Boolean):[];return _0xb67f2[_0x34d2c3(0x1ae)]>0x0&&_0x338781['unshift']({'type':_0x34d2c3(0x1e1),'columns':_0xb67f2}),{'indexes':_0x338781,'metadataAvailable':_0x22a858['length']>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d66e7,_0x2c5ea1){const _0xc40d21=a247_0x59c1,_0xab6af0=_0x1d66e7();while(!![]){try{const _0x286580=parseInt(_0xc40d21(0x90))/0x1+-parseInt(_0xc40d21(0x94))/0x2*(parseInt(_0xc40d21(0x95))/0x3)+parseInt(_0xc40d21(0x92))/0x4*(parseInt(_0xc40d21(0x8d))/0x5)+-parseInt(_0xc40d21(0x8f))/0x6+parseInt(_0xc40d21(0x8c))/0x7+-parseInt(_0xc40d21(0x91))/0x8+-parseInt(_0xc40d21(0x93))/0x9*(-parseInt(_0xc40d21(0x8e))/0xa);if(_0x286580===_0x2c5ea1)break;else _0xab6af0['push'](_0xab6af0['shift']());}catch(_0x10929d){_0xab6af0['push'](_0xab6af0['shift']());}}}(a247_0x422b,0x3b37e));import{taskStatus}from'../../commands/task/status.js';function a247_0x422b(){const _0x39e12e=['447316DvUfHX','625203DbGyaQ','2IvRalu','528396BhGnEQ','1627766zbwzPc','5ePCJGq','70DMnMUv','715770WpQvTk','72700PjIuia','2922808JoEYXF'];a247_0x422b=function(){return _0x39e12e;};return a247_0x422b();}function a247_0x59c1(_0x10a4c1,_0x570a0d){_0x10a4c1=_0x10a4c1-0x8c;const _0x422bbe=a247_0x422b();let _0x59c163=_0x422bbe[_0x10a4c1];return _0x59c163;}export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a248_0xabbf6e=a248_0x3947;(function(_0x5a5334,_0x5383ed){const _0xd76eb8=a248_0x3947,_0x58db82=_0x5a5334();while(!![]){try{const _0x5f0ffb=-parseInt(_0xd76eb8(0x80))/0x1+-parseInt(_0xd76eb8(0x78))/0x2*(-parseInt(_0xd76eb8(0x86))/0x3)+-parseInt(_0xd76eb8(0x82))/0x4*(-parseInt(_0xd76eb8(0x79))/0x5)+-parseInt(_0xd76eb8(0x73))/0x6+parseInt(_0xd76eb8(0x7c))/0x7+parseInt(_0xd76eb8(0x7d))/0x8+parseInt(_0xd76eb8(0x77))/0x9*(-parseInt(_0xd76eb8(0x88))/0xa);if(_0x5f0ffb===_0x5383ed)break;else _0x58db82['push'](_0x58db82['shift']());}catch(_0x403ba2){_0x58db82['push'](_0x58db82['shift']());}}}(a248_0xb34f,0x5b323));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a248_0x3947(_0x316273,_0x488aaa){_0x316273=_0x316273-0x73;const _0xb34f4e=a248_0xb34f();let _0x3947d3=_0xb34f4e[_0x316273];return _0x3947d3;}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a248_0xb34f(){const _0x35791f=['253827JLEDeF','flagMissing','1977852ueRdvd','compress','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','1227ctelcq','isTerminal','10CIuvYY',',\x20received\x20','4167624smNzva','task','trim','string','3170655ngQvqQ','562RCJLcG','5UYkADk','taskId','appCode','3970764PDNxIn','3980968ulEoUF','apiError','task-id'];a248_0xb34f=function(){return _0x35791f;};return a248_0xb34f();}export const taskStatus={'service':a248_0xabbf6e(0x74),'command':'status','description':a248_0xabbf6e(0x84),'risk':'read','defaultOutputFormat':a248_0xabbf6e(0x83),'structuredErrors':!![],'flags':[{'name':a248_0xabbf6e(0x7f),'type':a248_0xabbf6e(0x76),'required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x33c179){const _0x17737d=a248_0xabbf6e;if(!_0x33c179['str'](_0x17737d(0x7f))['trim']())throw CliErrors[_0x17737d(0x81)](_0x17737d(0x7f));},async 'execute'(_0x5efc24){const _0x455b05=a248_0xabbf6e,_0x4564fa=_0x5efc24['str'](_0x455b05(0x7f))[_0x455b05(0x75)](),_0x248d23=normalizeAsyncTask(await getAsyncTaskStatus(_0x4564fa,_0x5efc24[_0x455b05(0x7b)],_0x5efc24['cookie']));if(_0x248d23[_0x455b05(0x7a)]!==_0x4564fa)throw CliErrors[_0x455b05(0x7e)](_0x455b05(0x85)+_0x4564fa+_0x455b05(0x89)+_0x248d23[_0x455b05(0x7a)]+'.');const _0x4ecf60=buildAsyncTaskStatusCommand(_0x248d23[_0x455b05(0x7a)],_0x5efc24[_0x455b05(0x7b)]);return{'ok':!![],'message':asyncTaskMessage(_0x248d23),'data':{'appCode':_0x5efc24[_0x455b05(0x7b)],..._0x248d23,'query':_0x248d23[_0x455b05(0x87)]?null:{'command':_0x4ecf60}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a249_0x301c(_0x34ec1c,_0x114c70){_0x34ec1c=_0x34ec1c-0x1ee;const _0xc3b1d3=a249_0xc3b1();let _0x301cc3=_0xc3b1d3[_0x34ec1c];return _0x301cc3;}function a249_0xc3b1(){const _0x29eb03=['227559VPNrQE','3IsFwVY','550842ebXspG','5947808lEojPc','35wUstDr','11460537isQjWv','1166252HxrtUT','953448derjCQ','831485hAxNCZ'];a249_0xc3b1=function(){return _0x29eb03;};return a249_0xc3b1();}(function(_0x1bf087,_0x4b3afe){const _0x3416d7=a249_0x301c,_0xaf7e13=_0x1bf087();while(!![]){try{const _0x4c12db=-parseInt(_0x3416d7(0x1f4))/0x1+-parseInt(_0x3416d7(0x1f2))/0x2+parseInt(_0x3416d7(0x1f5))/0x3*(-parseInt(_0x3416d7(0x1f1))/0x4)+-parseInt(_0x3416d7(0x1f3))/0x5+parseInt(_0x3416d7(0x1f6))/0x6*(-parseInt(_0x3416d7(0x1ef))/0x7)+parseInt(_0x3416d7(0x1ee))/0x8+parseInt(_0x3416d7(0x1f0))/0x9;if(_0x4c12db===_0x4b3afe)break;else _0xaf7e13['push'](_0xaf7e13['shift']());}catch(_0x4dc1cb){_0xaf7e13['push'](_0xaf7e13['shift']());}}}(a249_0xc3b1,0x609ab));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a250_0x580ad2=a250_0x3ad0;(function(_0x46ba87,_0xd359c8){const _0x4d6ddd=a250_0x3ad0,_0x2389f9=_0x46ba87();while(!![]){try{const _0x213c6a=-parseInt(_0x4d6ddd(0x126))/0x1+-parseInt(_0x4d6ddd(0x129))/0x2+-parseInt(_0x4d6ddd(0x118))/0x3*(parseInt(_0x4d6ddd(0x122))/0x4)+parseInt(_0x4d6ddd(0x123))/0x5+parseInt(_0x4d6ddd(0x11b))/0x6*(-parseInt(_0x4d6ddd(0x125))/0x7)+parseInt(_0x4d6ddd(0x119))/0x8*(-parseInt(_0x4d6ddd(0x11f))/0x9)+-parseInt(_0x4d6ddd(0x128))/0xa*(-parseInt(_0x4d6ddd(0x127))/0xb);if(_0x213c6a===_0xd359c8)break;else _0x2389f9['push'](_0x2389f9['shift']());}catch(_0x7acff5){_0x2389f9['push'](_0x2389f9['shift']());}}}(a250_0x398f,0x6ee2b));function a250_0x3ad0(_0x2f964b,_0xd863c0){_0x2f964b=_0x2f964b-0x113;const _0x398fc4=a250_0x398f();let _0x3ad0b4=_0x398fc4[_0x2f964b];return _0x3ad0b4;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a250_0x398f(){const _0x368326=['members-list','Exact\x20tenant\x20code','45PNOuSX','string','trim','44iUyGMc','2530085LAzpAW','tenant-code','7XXJyeb','243419BQeDKX','1798731eZzVlz','110XZclye','557310fYAyKk','Found\x20','length','Pass\x20--tenant-code\x20<code>.','str','read','150438pOQpnh','86024SNgSwu','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','4338696laTijB','flagMissing'];a250_0x398f=function(){return _0x368326;};return a250_0x398f();}export const tenantMembersListDefinition={'service':'tenant','command':a250_0x580ad2(0x11d),'description':a250_0x580ad2(0x11a),'risk':a250_0x580ad2(0x117),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':a250_0x580ad2(0x120),'required':!![],'description':a250_0x580ad2(0x11e)}],async 'validate'(_0xf310d5){const _0x720b39=a250_0x580ad2;if(!_0xf310d5[_0x720b39(0x116)]('tenant-code')['trim']())throw CliErrors[_0x720b39(0x11c)]('tenant-code',_0x720b39(0x115));},async 'execute'(_0x58f886){const _0x3f5cbf=a250_0x580ad2,_0x2979fc=_0x58f886[_0x3f5cbf(0x116)](_0x3f5cbf(0x124))[_0x3f5cbf(0x121)](),_0x37f510=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x2979fc,_0x37f510);const _0x1c3c2c=projectTenantMembers(await listTenantDirectoryMembers(_0x2979fc));return{'ok':!![],'data':{'tenantCode':_0x2979fc,'items':_0x1c3c2c,'totalCount':_0x1c3c2c['length']},'message':_0x3f5cbf(0x113)+_0x1c3c2c[_0x3f5cbf(0x114)]+'\x20tenant\x20member(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5838ea,_0xe26ca4){const _0x3c70bd=a251_0x1916,_0x1c67ef=_0x5838ea();while(!![]){try{const _0x46031b=-parseInt(_0x3c70bd(0xc3))/0x1*(parseInt(_0x3c70bd(0xb8))/0x2)+-parseInt(_0x3c70bd(0xb7))/0x3+parseInt(_0x3c70bd(0xc2))/0x4*(-parseInt(_0x3c70bd(0xc0))/0x5)+parseInt(_0x3c70bd(0xc5))/0x6*(parseInt(_0x3c70bd(0xbb))/0x7)+parseInt(_0x3c70bd(0xbf))/0x8+parseInt(_0x3c70bd(0xbe))/0x9*(parseInt(_0x3c70bd(0xc6))/0xa)+parseInt(_0x3c70bd(0xb5))/0xb*(-parseInt(_0x3c70bd(0xbc))/0xc);if(_0x46031b===_0xe26ca4)break;else _0x1c67ef['push'](_0x1c67ef['shift']());}catch(_0xf37c0a){_0x1c67ef['push'](_0x1c67ef['shift']());}}}(a251_0x2c09,0xc6f14));import{CliErrors}from'../../errors.js';function a251_0x1916(_0x43970f,_0x420cc1){_0x43970f=_0x43970f-0xab;const _0x2c09c0=a251_0x2c09();let _0x191613=_0x2c09c0[_0x43970f];return _0x191613;}function textOrNull(_0x7caa6a){const _0x5a59af=a251_0x1916,_0x3e9b86=_0x7caa6a?.[_0x5a59af(0xb3)]();return _0x3e9b86?_0x3e9b86:null;}export function projectTenantMembers(_0x4cfab7){const _0x33e871=a251_0x1916,_0x3fef87=new Map();for(const _0x12105b of _0x4cfab7){const _0x4b6e48=Number(_0x12105b[_0x33e871(0xae)]);if(!Number['isFinite'](_0x4b6e48)||_0x4b6e48<=0x0)continue;const _0x5f140c={'userId':_0x4b6e48,'username':textOrNull(_0x12105b[_0x33e871(0xc4)]),'displayName':textOrNull(_0x12105b['nickname']),'role':_0x12105b[_0x33e871(0xbd)]===!![]?_0x33e871(0xc1):_0x33e871(0xb6),'status':textOrNull(_0x12105b[_0x33e871(0xaf)])},_0x464f29=_0x3fef87['get'](_0x4b6e48);if(!_0x464f29){_0x3fef87[_0x33e871(0xb4)](_0x4b6e48,_0x5f140c);continue;}_0x464f29['username']??=_0x5f140c[_0x33e871(0xc4)],_0x464f29[_0x33e871(0xb2)]??=_0x5f140c[_0x33e871(0xb2)],_0x464f29['status']??=_0x5f140c[_0x33e871(0xaf)];if(_0x5f140c[_0x33e871(0xad)]===_0x33e871(0xc1))_0x464f29[_0x33e871(0xad)]=_0x33e871(0xc1);}return[..._0x3fef87['values']()]['sort']((_0x48ef12,_0x27cd72)=>_0x48ef12['userId']-_0x27cd72[_0x33e871(0xae)]);}function a251_0x2c09(){const _0x1c7fd2=['\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','some','role','userId','status','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','tenantCode','displayName','trim','set','3575YudFlW','MEMBER','3532293JoseuO','38yJdxvV','validation','Tenant\x20\x22','2161495zbbOBo','1404zeZQJB','adminFlag','1017657tIKFfH','10133872vXpXmL','44515tGEezr','ADMIN','548NKpNeC','21737xAqpBM','username','18VQnQTe','130iHYgLv'];a251_0x2c09=function(){return _0x1c7fd2;};return a251_0x2c09();}export function assertTenantAccessible(_0x35e34d,_0x3b238b){const _0x39b68c=a251_0x1916;if(_0x3b238b[_0x39b68c(0xac)](_0x3b1fcb=>_0x3b1fcb[_0x39b68c(0xb1)]===_0x35e34d))return;throw CliErrors[_0x39b68c(0xb9)](_0x39b68c(0xba)+_0x35e34d+_0x39b68c(0xab),_0x39b68c(0xb0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a252_0x6cca9a=a252_0x2d30;(function(_0xba2c7e,_0x2e1602){const _0x1a29f5=a252_0x2d30,_0xe75111=_0xba2c7e();while(!![]){try{const _0x3354ab=-parseInt(_0x1a29f5(0x1ac))/0x1*(-parseInt(_0x1a29f5(0x1b0))/0x2)+parseInt(_0x1a29f5(0x1c1))/0x3+-parseInt(_0x1a29f5(0x1b8))/0x4+-parseInt(_0x1a29f5(0x1aa))/0x5*(-parseInt(_0x1a29f5(0x1b7))/0x6)+-parseInt(_0x1a29f5(0x1be))/0x7+-parseInt(_0x1a29f5(0x1b6))/0x8+-parseInt(_0x1a29f5(0x1c0))/0x9;if(_0x3354ab===_0x2e1602)break;else _0xe75111['push'](_0xe75111['shift']());}catch(_0x5b9e75){_0xe75111['push'](_0xe75111['shift']());}}}(a252_0x55e7,0xd3b42));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a252_0x2d30(_0x5104ba,_0x2d6f79){_0x5104ba=_0x5104ba-0x1aa;const _0x55e70e=a252_0x55e7();let _0x2d30b0=_0x55e70e[_0x5104ba];return _0x2d30b0;}import{CliErrors}from'../../errors.js';function a252_0x55e7(){const _0x331d8e=['3420585GtDxqD','string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','13085CCTGZK','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','2OYgPNS','user-account','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','dingtalk','1595128USjIqj','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','ding-talk-user-id','validation','dingding-sandbox-bind','str','12517672YHlken','654yZlIId','1216856YGBbgV','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','write','bind','POST','apiError','323715EuCzhA','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','2144430UgMEkb'];a252_0x55e7=function(){return _0x331d8e;};return a252_0x55e7();}const PROVIDER_ID=a252_0x6cca9a(0x1af),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function readDingTalkUserId(_0x3bb9bf){const _0x4ecb14=a252_0x6cca9a,_0x3087b3=_0x3bb9bf[_0x4ecb14(0x1b5)](_0x4ecb14(0x1b2))['trim']();if(!_0x3087b3)throw CliErrors[_0x4ecb14(0x1b3)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x4ecb14(0x1b9));return _0x3087b3;}function buildBindingData(_0x1f75fd,_0x1becb4){const _0x17a108=a252_0x6cca9a;return{'operation':_0x17a108(0x1bb),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x1f75fd},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x1f75fd,'bound':!![]},'dryRun':_0x1becb4,'backend':{'method':'POST','path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a252_0x6cca9a(0x1ad),'command':a252_0x6cca9a(0x1b4),'description':a252_0x6cca9a(0x1c3),'risk':a252_0x6cca9a(0x1ba),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a252_0x6cca9a(0x1b2),'type':a252_0x6cca9a(0x1c2),'required':!![],'description':a252_0x6cca9a(0x1bf)}],async 'validate'(_0x4a5d39){readDingTalkUserId(_0x4a5d39);},async 'dryRun'(_0x57172e){const _0x23a94f=a252_0x6cca9a,_0x6b4f47=readDingTalkUserId(_0x57172e);return asDryRunResult(buildBindingData(_0x6b4f47,!![]),{'method':_0x23a94f(0x1bc),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x4d3fbf){const _0x1eeeb7=a252_0x6cca9a,_0x51e93a=readDingTalkUserId(_0x4d3fbf),_0x18db88=await bindDingTalkSandboxAccount(_0x51e93a);if(_0x18db88!==!![])throw CliErrors[_0x1eeeb7(0x1bd)](_0x1eeeb7(0x1ae),_0x1eeeb7(0x1b1));return{'ok':!![],'data':buildBindingData(_0x51e93a,![]),'message':_0x1eeeb7(0x1ab)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a253_0x2e9fdc=a253_0x1f77;(function(_0x573f46,_0x4c8b92){const _0x12216d=a253_0x1f77,_0x47e5df=_0x573f46();while(!![]){try{const _0x52d034=parseInt(_0x12216d(0xe4))/0x1+-parseInt(_0x12216d(0xe8))/0x2+parseInt(_0x12216d(0xed))/0x3+-parseInt(_0x12216d(0xdb))/0x4+-parseInt(_0x12216d(0xea))/0x5*(parseInt(_0x12216d(0xeb))/0x6)+parseInt(_0x12216d(0xdf))/0x7+parseInt(_0x12216d(0xe0))/0x8;if(_0x52d034===_0x4c8b92)break;else _0x47e5df['push'](_0x47e5df['shift']());}catch(_0x41d39e){_0x47e5df['push'](_0x47e5df['shift']());}}}(a253_0x2899,0x2c94f));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a253_0x2e9fdc(0xef),CURRENT_BINDING_WARNING=a253_0x2e9fdc(0xe7);function readUnionId(_0x261742){const _0x2581e8=a253_0x2e9fdc,_0x2d8116=_0x261742[_0x2581e8(0xde)]('union-id')[_0x2581e8(0xf2)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x2581e8(0xdc)](_0x2d8116))throw CliErrors[_0x2581e8(0xe2)](_0x2581e8(0xf3),_0x2581e8(0xf1));return _0x2d8116;}function buildBindingData(_0x3c6549,_0x5660a1){const _0x53a4ef=a253_0x2e9fdc;return{'operation':_0x53a4ef(0xe5),'selector':{'providerId':PROVIDER_ID,'unionId':_0x3c6549},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x3c6549,'bound':!![]},'dryRun':_0x5660a1,'backend':{'method':_0x53a4ef(0xe3),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a253_0x1f77(_0x81ef8e,_0x158852){_0x81ef8e=_0x81ef8e-0xdb;const _0x2899c7=a253_0x2899();let _0x1f7744=_0x2899c7[_0x81ef8e];return _0x1f7744;}function a253_0x2899(){const _0x38dff1=['trim','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','string','1310428VQKayD','test','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','str','2187059qqzWpP','1328280xLRnCo','union-id','validation','POST','208094eISpWk','bind','Bound\x20current\x20user\x20to\x20Feishu\x20account.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','374322hJeXll','feishu-bind','105lqAmUi','73896YmDkLy','apiError','808335yuOmAe','user-account','feishu','Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.'];a253_0x2899=function(){return _0x38dff1;};return a253_0x2899();}export const feishuBind={'service':a253_0x2e9fdc(0xee),'command':a253_0x2e9fdc(0xe9),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a253_0x2e9fdc(0xe1),'type':a253_0x2e9fdc(0xf4),'required':!![],'description':a253_0x2e9fdc(0xf0)}],async 'validate'(_0x200340){readUnionId(_0x200340);},async 'dryRun'(_0x21c39f){const _0x21f99a=a253_0x2e9fdc,_0x554c3a=readUnionId(_0x21c39f);return asDryRunResult(buildBindingData(_0x554c3a,!![]),{'method':_0x21f99a(0xe3),'url':FEISHU_BIND_PATH});},async 'execute'(_0x2b11bd){const _0x2730bb=a253_0x2e9fdc,_0x4ed084=readUnionId(_0x2b11bd),_0x26f6eb=await bindFeishuAccount(_0x4ed084);if(_0x26f6eb!==!![])throw CliErrors[_0x2730bb(0xec)]('Feishu\x20account\x20binding\x20was\x20not\x20confirmed.',_0x2730bb(0xdd));return{'ok':!![],'data':buildBindingData(_0x4ed084,![]),'message':_0x2730bb(0xe6)};}};
|