@lovrabet/rabetbase-cli 2.5.12 → 2.5.13
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/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.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/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.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/page-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/context.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/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-analysis.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/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.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/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.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/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/guides/custom-page-workflow.md +32 -2
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +106 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/custom-pages/blank.json +1 -1
- package/templates/custom-pages/dashboard.json +1 -1
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a254_0x218b82=a254_0x2ddb;(function(_0x4b183b,_0x26b0c9){const _0x9ed73c=a254_0x2ddb,_0x59c153=_0x4b183b();while(!![]){try{const _0x96f0ec=-parseInt(_0x9ed73c(0xae))/0x1*(-parseInt(_0x9ed73c(0xca))/0x2)+-parseInt(_0x9ed73c(0xf0))/0x3+-parseInt(_0x9ed73c(0xc0))/0x4+parseInt(_0x9ed73c(0xc9))/0x5+-parseInt(_0x9ed73c(0xc2))/0x6+-parseInt(_0x9ed73c(0xb1))/0x7*(-parseInt(_0x9ed73c(0xce))/0x8)+parseInt(_0x9ed73c(0xc6))/0x9;if(_0x96f0ec===_0x26b0c9)break;else _0x59c153['push'](_0x59c153['shift']());}catch(_0x375674){_0x59c153['push'](_0x59c153['shift']());}}}(a254_0xbab3,0xbe834));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';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(_0x5bf35f){const _0x25b355=a254_0x2ddb,_0x260531=stripLocalSqlMetadata(await readFile(_0x5bf35f['filePath'],_0x25b355(0xcd)),_0x5bf35f[_0x25b355(0xba)]);if(!_0x260531[_0x25b355(0xe9)]())throw CliErrors['validation'](_0x5bf35f['sqlCode']+_0x25b355(0xc7));return _0x260531;}async function getTargetSqlQueries(_0x49bbfd,_0x1d637e,_0x44e72d){const _0x2a3cda=a254_0x2ddb,_0x499916=await scanLocalSqlQueries(_0x49bbfd),_0x6b57c=new Map();for(const _0x54e9f3 of _0x499916){if(_0x44e72d&&_0x54e9f3[_0x2a3cda(0xc3)]!==_0x44e72d)continue;const _0x320d59=_0x6b57c[_0x2a3cda(0xbd)](_0x54e9f3[_0x2a3cda(0xc3)])??[];_0x320d59[_0x2a3cda(0xdf)](_0x54e9f3),_0x6b57c['set'](_0x54e9f3['sqlCode'],_0x320d59);}if(_0x44e72d&&!_0x6b57c[_0x2a3cda(0xb3)](_0x44e72d))throw CliErrors[_0x2a3cda(0xdc)]('Local\x20SQL\x20not\x20found:\x20'+_0x44e72d);const _0x56350b=[];for(const [_0x3e28e3,_0x33fb74]of _0x6b57c[_0x2a3cda(0xb4)]()){if(_0x33fb74['length']===0x1){_0x56350b['push'](_0x33fb74[0x0]);continue;}const _0x12195a=_0x1d637e[_0x2a3cda(0xb2)][_0x3e28e3],_0x3f6ff0=_0x12195a?.[_0x2a3cda(0xd8)],_0x29ba90=_0x3f6ff0?_0x33fb74['filter'](_0x5540d3=>_0x5540d3[_0x2a3cda(0xdb)]!==_0x3f6ff0):_0x33fb74;if(_0x12195a&&_0x29ba90[_0x2a3cda(0xc8)]===0x1){_0x56350b['push'](_0x29ba90[0x0]);continue;}throw CliErrors['validation']('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x3e28e3+_0x2a3cda(0xe2));}return _0x56350b;}export const sqlPush={'service':a254_0x218b82(0xbe),'command':'push','description':a254_0x218b82(0xbc),'risk':a254_0x218b82(0xd9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x218b82(0xe5),'type':a254_0x218b82(0xe3),'description':a254_0x218b82(0xc4)}],async 'dryRun'(_0x10a3c5){const _0x32df8d=a254_0x218b82,_0x3b1807=loadSqlProjectConfig(_0x10a3c5[_0x32df8d(0xd7)]),_0x1587ef=await readSqlLockFile(_0x3b1807['lockFilePath']),{appLock:_0x5c38fa}=ensureSqlLockScope(_0x1587ef??createEmptySqlLock(),_0x10a3c5['appCode'],_0x3b1807['sqlRoot'],'push'),_0x316b6e=await getTargetSqlQueries(_0x3b1807,_0x5c38fa,_0x10a3c5['str'](_0x32df8d(0xd0))||undefined),_0x126804=[];for(const _0x439574 of _0x316b6e){const _0x56efcb=await computeSqlFileHash(_0x439574[_0x32df8d(0xe0)]),_0x1a244d=_0x5c38fa[_0x32df8d(0xb2)][_0x439574[_0x32df8d(0xc3)]],_0x3da325=!!_0x1a244d&&(_0x1a244d[_0x32df8d(0xd8)]!==_0x439574[_0x32df8d(0xdb)]||!!_0x439574['sqlName']&&_0x1a244d[_0x32df8d(0xec)]!==_0x439574[_0x32df8d(0xec)]||_0x1a244d[_0x32df8d(0xba)]!==_0x439574[_0x32df8d(0xba)]);if(!_0x10a3c5['bool'](_0x32df8d(0xe5))&&_0x1a244d&&_0x1a244d['hash']===_0x56efcb&&!_0x3da325)continue;if(!_0x1a244d)throw CliErrors['validation'](_0x439574[_0x32df8d(0xc3)]+_0x32df8d(0xb5));if(_0x1a244d[_0x32df8d(0xad)]==null)throw CliErrors['validation'](_0x439574[_0x32df8d(0xc3)]+':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.');await resolveTargetDbBinding(_0x10a3c5['appCode'],_0x439574,_0x1a244d),await readSqlUploadContent(_0x439574),_0x126804[_0x32df8d(0xdf)](_0x439574[_0x32df8d(0xc3)]);}return{'method':_0x32df8d(0xdd),'url':_0x32df8d(0xb9),'body':{'sqlCodes':_0x126804,'appCode':_0x10a3c5[_0x32df8d(0xd7)]},'description':_0x32df8d(0xb7)+_0x126804[_0x32df8d(0xc8)]+_0x32df8d(0xd4)};},async 'execute'(_0x5e82c0){const _0x47c327=a254_0x218b82,_0x488ac0=loadSqlProjectConfig(_0x5e82c0[_0x47c327(0xd7)]),_0x19bf8d=await readSqlLockFile(_0x488ac0['lockFilePath']),{lockData:_0x38c7ad,appLock:_0x357122}=ensureSqlLockScope(_0x19bf8d??createEmptySqlLock(),_0x5e82c0[_0x47c327(0xd7)],_0x488ac0[_0x47c327(0xda)],_0x47c327(0xdf)),_0x3a421a=await getTargetSqlQueries(_0x488ac0,_0x357122,_0x5e82c0['str'](_0x47c327(0xd0))||undefined);if(_0x3a421a[_0x47c327(0xc8)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x5a02e2=[],_0x17ac74=[],_0x3261bb=[];let _0xf03af8=![];for(const _0x3a7a09 of _0x3a421a){const _0x3d56f8=_0x357122[_0x47c327(0xb2)][_0x3a7a09['sqlCode']];if(!_0x3d56f8){_0x3261bb[_0x47c327(0xdf)]({'sqlCode':_0x3a7a09[_0x47c327(0xc3)],'error':_0x47c327(0xaf)});continue;}try{const _0xf5b8d9=await computeSqlFileHash(_0x3a7a09['filePath']),_0x1020f7=_0x3d56f8[_0x47c327(0xd8)]!==_0x3a7a09[_0x47c327(0xdb)]||!!_0x3a7a09[_0x47c327(0xec)]&&_0x3d56f8[_0x47c327(0xec)]!==_0x3a7a09[_0x47c327(0xec)]||_0x3d56f8[_0x47c327(0xba)]!==_0x3a7a09[_0x47c327(0xba)];if(!_0x5e82c0[_0x47c327(0xd2)](_0x47c327(0xe5))&&_0x3d56f8[_0x47c327(0xe1)]===_0xf5b8d9&&!_0x1020f7){_0x17ac74[_0x47c327(0xdf)]({'sqlCode':_0x3a7a09[_0x47c327(0xc3)],'reason':_0x47c327(0xc1)});continue;}if(_0x3d56f8[_0x47c327(0xad)]==null){_0x3261bb[_0x47c327(0xdf)]({'sqlCode':_0x3a7a09[_0x47c327(0xc3)],'error':_0x47c327(0xcb)});continue;}const _0x3aba31=_0x3a7a09[_0x47c327(0xec)]||_0x3d56f8['sqlName'],_0xbc3f17=await resolveTargetDbBinding(_0x5e82c0['appCode'],_0x3a7a09,_0x3d56f8),_0x50ef6a=await readSqlUploadContent(_0x3a7a09),_0x5b4dac=await updateSqlQuery({'id':_0x3d56f8[_0x47c327(0xc5)],'appCode':_0x5e82c0[_0x47c327(0xd7)],'sqlCode':_0x3a7a09[_0x47c327(0xc3)],'sqlName':_0x3aba31,'dbId':_0xbc3f17[_0x47c327(0xd5)],'version':_0x3d56f8[_0x47c327(0xad)],'sqlContent':_0x50ef6a,'sqlConfig':_0x3d56f8[_0x47c327(0xe8)]??undefined}),_0x2f2d00=_0x5b4dac[_0x47c327(0xd5)]?await getDbName(_0x5e82c0['appCode'],Number(_0x5b4dac[_0x47c327(0xd5)]))[_0x47c327(0xb6)](()=>_0xbc3f17[_0x47c327(0xd6)]):_0xbc3f17['dbName'];_0x357122[_0x47c327(0xb2)][_0x3a7a09[_0x47c327(0xc3)]]={...buildSqlLockEntry(_0x5b4dac,_0x50ef6a,_0xf5b8d9,{'dbName':_0x2f2d00}),'path':_0x3a7a09[_0x47c327(0xdb)],'mode':_0x3a7a09[_0x47c327(0xba)]},_0xf03af8=!![],await archivePreviousSqlFileIfNeeded(_0x488ac0,_0x3d56f8[_0x47c327(0xd8)],_0x3a7a09[_0x47c327(0xdb)]),_0x5a02e2[_0x47c327(0xdf)]({'sqlCode':_0x3a7a09[_0x47c327(0xc3)],'remoteId':_0x3d56f8[_0x47c327(0xc5)]});}catch(_0x2d6631){_0x3261bb[_0x47c327(0xdf)]({'sqlCode':_0x3a7a09[_0x47c327(0xc3)],'error':_0x2d6631 instanceof Error?_0x2d6631[_0x47c327(0xef)]:String(_0x2d6631)});}}(_0xf03af8||_0x3261bb[_0x47c327(0xc8)]===0x0)&&(_0x357122[_0x47c327(0xcc)]=new Date()[_0x47c327(0xeb)](),await writeSqlLockFile(_0x488ac0[_0x47c327(0xed)],_0x38c7ad));const _0x23e95e=_0x3261bb[_0x47c327(0xc8)]===0x0;return{'ok':_0x23e95e,'data':{'pushed':_0x5a02e2,'skipped':_0x17ac74,'failed':_0x3261bb},'message':_0x47c327(0xe6)+_0x5a02e2[_0x47c327(0xc8)]+'\x20pushed,\x20'+_0x17ac74[_0x47c327(0xc8)]+'\x20skipped,\x20'+_0x3261bb[_0x47c327(0xc8)]+_0x47c327(0xbb)};}};async function archivePreviousSqlFileIfNeeded(_0x5c05e7,_0x2ac78f,_0x49bb62){const _0x5b696c=a254_0x218b82;if(!_0x2ac78f||_0x2ac78f===_0x49bb62)return;const _0x591c2e=join(_0x5c05e7[_0x5b696c(0xe7)],_0x2ac78f);if(!await fileExists(_0x591c2e))return;const _0x25a27a=await moveToTrash(_0x5c05e7[_0x5b696c(0xea)],_0x5c05e7['trashDir'],_0x591c2e);await cleanupEmptyDirectories(dirname(_0x591c2e),_0x5c05e7[_0x5b696c(0xe7)]),void _0x25a27a;}function a254_0xbab3(){const _0x29adf3=['get','sql','startsWith','376484IDWeMo','unchanged','7170828wgGEFO','sqlCode','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','remoteId','13651092fzQAoh',':\x20SQL\x20content\x20is\x20empty.','length','1163655fHJOlK','43470pGNIbn','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','lastSync','utf8','16ZGEscw','join','sqlcode','\x22\x20for\x20sqlCode\x20','bool','dbDirectory','\x20SQL\x20file(s)','dbId','dbName','appCode','path','write','sqlRoot','relativePath','validation','POST','isFinite','push','filePath','hash','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','boolean','Local\x20directory\x20\x22','force','Push\x20complete:\x20','sqlRootDir','sqlConfig','trim','projectRoot','toISOString','sqlName','lockFilePath','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','message','45819yaMmMH','version','1XRrynW','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','exec','1097663cpOhEP','sqls','has','entries',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','catch','Would\x20push\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','mode','\x20failed','Push\x20local\x20SQL\x20files\x20to\x20remote'];a254_0xbab3=function(){return _0x29adf3;};return a254_0xbab3();}function a254_0x2ddb(_0x38bdfb,_0x8abaf0){_0x38bdfb=_0x38bdfb-0xad;const _0xbab3a0=a254_0xbab3();let _0x2ddb6d=_0xbab3a0[_0x38bdfb];return _0x2ddb6d;}async function moveToTrash(_0x3ff591,_0x588b06,_0xba6f21){const _0x1e03e9=a254_0x218b82,_0x49d48e=new Date()[_0x1e03e9(0xeb)]()['replace'](/[:.]/g,'-'),_0x2600b1=relative(_0x3ff591,_0xba6f21),_0x418a14=join(_0x588b06,_0x49d48e,_0x2600b1);return await mkdir(dirname(_0x418a14),{'recursive':!![]}),await rename(_0xba6f21,_0x418a14),_0x418a14;}async function cleanupEmptyDirectories(_0xf97d4a,_0x2f83d5){const _0x278e6a=a254_0x218b82;let _0x392822=resolve(_0xf97d4a);const _0xa7ea9f=resolve(_0x2f83d5);while(_0x392822[_0x278e6a(0xbf)](''+_0xa7ea9f+sep)||_0x392822===_0xa7ea9f){if(_0x392822===_0xa7ea9f)return;try{const _0x3687e1=await readdir(_0x392822);if(_0x3687e1[_0x278e6a(0xc8)]>0x0)return;await rmdir(_0x392822);}catch{return;}_0x392822=dirname(_0x392822);}}async function resolveTargetDbBinding(_0x2646d6,_0x1e3931,_0x3e1e9e){const _0xb68fae=a254_0x218b82,_0x78a6a1=_0x1e3931[_0xb68fae(0xd3)];if(!_0x78a6a1)return{'dbId':_0x3e1e9e['dbId'],'dbName':_0x3e1e9e[_0xb68fae(0xd6)]};const _0x245dff=buildDbDirectoryName(_0x3e1e9e[_0xb68fae(0xd6)],_0x3e1e9e[_0xb68fae(0xd5)]);if(_0x78a6a1===_0x245dff)return{'dbId':_0x3e1e9e[_0xb68fae(0xd5)],'dbName':_0x3e1e9e[_0xb68fae(0xd6)]};const _0x2a7609=parseExplicitDbDirectory(_0x78a6a1);if(_0x2a7609!=null)return{'dbId':_0x2a7609,'dbName':await getDbName(_0x2646d6,_0x2a7609)['catch'](()=>undefined)};const _0x1136e7=await listDatabases(_0x2646d6),_0x486728=_0x1136e7['filter'](_0x334677=>buildDbDirectoryName(_0x334677[_0xb68fae(0xd6)],_0x334677['dbId'])===_0x78a6a1);if(_0x486728['length']===0x1)return{'dbId':_0x486728[0x0][_0xb68fae(0xd5)],'dbName':_0x486728[0x0][_0xb68fae(0xd6)]};if(_0x486728[_0xb68fae(0xc8)]===0x0)throw CliErrors[_0xb68fae(0xdc)](_0xb68fae(0xb8)+_0x78a6a1+_0xb68fae(0xd1)+_0x1e3931['sqlCode']+'.');const _0x4c4bdf=_0x486728['map'](_0x49e328=>_0x49e328[_0xb68fae(0xd6)]+'\x20('+_0x49e328[_0xb68fae(0xd5)]+')')[_0xb68fae(0xcf)](',\x20');throw CliErrors[_0xb68fae(0xdc)](_0xb68fae(0xe4)+_0x78a6a1+_0xb68fae(0xee)+_0x1e3931[_0xb68fae(0xc3)]+':\x20'+_0x4c4bdf);}function parseExplicitDbDirectory(_0x1dc8df){const _0x4de367=a254_0x218b82,_0x365625=/^db-(\d+)$/[_0x4de367(0xb0)](_0x1dc8df);if(!_0x365625)return null;const _0x33a852=Number(_0x365625[0x1]);return Number[_0x4de367(0xde)](_0x33a852)&&_0x33a852>0x0?_0x33a852:null;}
|
|
1
|
+
const a254_0x14e39b=a254_0x249c;(function(_0xae2333,_0x3cd2e3){const _0x34970d=a254_0x249c,_0x6fa34b=_0xae2333();while(!![]){try{const _0x7e6028=-parseInt(_0x34970d(0x149))/0x1+parseInt(_0x34970d(0x17c))/0x2*(parseInt(_0x34970d(0x154))/0x3)+parseInt(_0x34970d(0x15d))/0x4+parseInt(_0x34970d(0x145))/0x5+-parseInt(_0x34970d(0x17a))/0x6+parseInt(_0x34970d(0x172))/0x7+parseInt(_0x34970d(0x148))/0x8;if(_0x7e6028===_0x3cd2e3)break;else _0x6fa34b['push'](_0x6fa34b['shift']());}catch(_0x2b2846){_0x6fa34b['push'](_0x6fa34b['shift']());}}}(a254_0x3340,0x26210));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';function a254_0x249c(_0x5ad75e,_0x247f77){_0x5ad75e=_0x5ad75e-0x145;const _0x3340ab=a254_0x3340();let _0x249ccb=_0x3340ab[_0x5ad75e];return _0x249ccb;}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';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x3638c2){const _0x4eb9e4=a254_0x249c,_0x5c03bc=stripLocalSqlMetadata(await readFile(_0x3638c2[_0x4eb9e4(0x16f)],'utf8'),_0x3638c2['mode']);if(!_0x5c03bc[_0x4eb9e4(0x14e)]())throw CliErrors['validation'](_0x3638c2[_0x4eb9e4(0x17b)]+':\x20SQL\x20content\x20is\x20empty.');return _0x5c03bc;}function a254_0x3340(){const _0x5c8c20=['toISOString','1384885HwfqWU','lockFilePath','sqls','431512TdzrgM','179354nhnnTa','bool','replace','/smartapi/custom/updateUserCustomSql','Local\x20directory\x20\x22','trim',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','force','dbName','message','Local\x20SQL\x20not\x20found:\x20','12FLIdya','sqlConfig',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','Would\x20push\x20','push','write','mode','str','remoteId','440552YnDveO','path','No\x20local\x20SQL\x20files\x20found.','version','boolean','sql','Push\x20complete:\x20','validation','entries','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','exec','length','has','sqlRootDir','Push\x20local\x20SQL\x20files\x20to\x20remote','\x20SQL\x20file(s)','POST','appCode','filePath','hash','sqlName','221298xlzxbL','\x20pushed,\x20','join','sqlcode','filter','startsWith','relativePath','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','1241532uXYiTK','sqlCode','34892vhfUQy','lastSync','isFinite','catch','No\x20database\x20matches\x20local\x20directory\x20\x22','dbDirectory','\x20failed','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','\x20skipped,\x20','sqlRoot','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbId'];a254_0x3340=function(){return _0x5c8c20;};return a254_0x3340();}async function getTargetSqlQueries(_0x1b61c0,_0x3f1df0,_0x22e0ff){const _0x635b2c=a254_0x249c,_0x6b5dfa=await scanLocalSqlQueries(_0x1b61c0),_0x5e8409=new Map();for(const _0x261d1f of _0x6b5dfa){if(_0x22e0ff&&_0x261d1f[_0x635b2c(0x17b)]!==_0x22e0ff)continue;const _0xe628a1=_0x5e8409['get'](_0x261d1f[_0x635b2c(0x17b)])??[];_0xe628a1[_0x635b2c(0x158)](_0x261d1f),_0x5e8409['set'](_0x261d1f[_0x635b2c(0x17b)],_0xe628a1);}if(_0x22e0ff&&!_0x5e8409[_0x635b2c(0x169)](_0x22e0ff))throw CliErrors['validation'](_0x635b2c(0x153)+_0x22e0ff);const _0x455ec4=[];for(const [_0x85d91b,_0x5b78e7]of _0x5e8409[_0x635b2c(0x165)]()){if(_0x5b78e7[_0x635b2c(0x168)]===0x1){_0x455ec4[_0x635b2c(0x158)](_0x5b78e7[0x0]);continue;}const _0x48282b=_0x3f1df0[_0x635b2c(0x147)][_0x85d91b],_0x12303c=_0x48282b?.[_0x635b2c(0x15e)],_0x3421f5=_0x12303c?_0x5b78e7['filter'](_0x4a2535=>_0x4a2535[_0x635b2c(0x178)]!==_0x12303c):_0x5b78e7;if(_0x48282b&&_0x3421f5[_0x635b2c(0x168)]===0x1){_0x455ec4[_0x635b2c(0x158)](_0x3421f5[0x0]);continue;}throw CliErrors['validation']('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x85d91b+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x455ec4;}export const sqlPush={'service':a254_0x14e39b(0x162),'command':a254_0x14e39b(0x158),'description':a254_0x14e39b(0x16b),'risk':a254_0x14e39b(0x159),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a254_0x14e39b(0x161),'description':a254_0x14e39b(0x186)}],async 'dryRun'(_0x1bde62){const _0x40416d=a254_0x14e39b,_0x2e8693=loadSqlProjectConfig(_0x1bde62[_0x40416d(0x16e)]),_0x590a89=await readSqlLockFile(_0x2e8693['lockFilePath']),{appLock:_0x42faf0}=ensureSqlLockScope(_0x590a89??createEmptySqlLock(),_0x1bde62[_0x40416d(0x16e)],_0x2e8693[_0x40416d(0x185)],_0x40416d(0x158)),_0x41d794=await getTargetSqlQueries(_0x2e8693,_0x42faf0,_0x1bde62[_0x40416d(0x15b)](_0x40416d(0x175))||undefined),_0x58926d=[];for(const _0x27b998 of _0x41d794){const _0x4954df=await computeSqlFileHash(_0x27b998[_0x40416d(0x16f)]),_0x1cbeac=_0x42faf0[_0x40416d(0x147)][_0x27b998[_0x40416d(0x17b)]],_0x186b5c=!!_0x1cbeac&&(_0x1cbeac['path']!==_0x27b998[_0x40416d(0x178)]||!!_0x27b998[_0x40416d(0x171)]&&_0x1cbeac[_0x40416d(0x171)]!==_0x27b998[_0x40416d(0x171)]||_0x1cbeac[_0x40416d(0x15a)]!==_0x27b998['mode']);if(!_0x1bde62[_0x40416d(0x14a)]('force')&&_0x1cbeac&&_0x1cbeac[_0x40416d(0x170)]===_0x4954df&&!_0x186b5c)continue;if(!_0x1cbeac)throw CliErrors['validation'](_0x27b998[_0x40416d(0x17b)]+_0x40416d(0x14f));if(_0x1cbeac[_0x40416d(0x160)]==null)throw CliErrors[_0x40416d(0x164)](_0x27b998[_0x40416d(0x17b)]+_0x40416d(0x156));await resolveTargetDbBinding(_0x1bde62[_0x40416d(0x16e)],_0x27b998,_0x1cbeac),await readSqlUploadContent(_0x27b998),_0x58926d[_0x40416d(0x158)](_0x27b998['sqlCode']);}return{'method':_0x40416d(0x16d),'url':_0x40416d(0x14c),'body':{'sqlCodes':_0x58926d,'appCode':_0x1bde62[_0x40416d(0x16e)]},'description':_0x40416d(0x157)+_0x58926d[_0x40416d(0x168)]+_0x40416d(0x16c)};},async 'execute'(_0x561f0c){const _0x5af172=a254_0x14e39b,_0x3cafed=loadSqlProjectConfig(_0x561f0c[_0x5af172(0x16e)]),_0x45b7b9=await readSqlLockFile(_0x3cafed[_0x5af172(0x146)]),{lockData:_0x8adeff,appLock:_0x3e88ee}=ensureSqlLockScope(_0x45b7b9??createEmptySqlLock(),_0x561f0c[_0x5af172(0x16e)],_0x3cafed[_0x5af172(0x185)],_0x5af172(0x158)),_0x146a08=await getTargetSqlQueries(_0x3cafed,_0x3e88ee,_0x561f0c[_0x5af172(0x15b)](_0x5af172(0x175))||undefined);if(_0x146a08[_0x5af172(0x168)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5af172(0x15f)};const _0x186ebc=[],_0x12e87d=[],_0x94aa0f=[];let _0x302bbe=![];for(const _0x436c13 of _0x146a08){const _0x5db529=_0x3e88ee[_0x5af172(0x147)][_0x436c13[_0x5af172(0x17b)]];if(!_0x5db529){_0x94aa0f[_0x5af172(0x158)]({'sqlCode':_0x436c13[_0x5af172(0x17b)],'error':_0x5af172(0x183)});continue;}try{const _0x56a99b=await computeSqlFileHash(_0x436c13[_0x5af172(0x16f)]),_0x1ae60a=_0x5db529[_0x5af172(0x15e)]!==_0x436c13[_0x5af172(0x178)]||!!_0x436c13['sqlName']&&_0x5db529[_0x5af172(0x171)]!==_0x436c13[_0x5af172(0x171)]||_0x5db529[_0x5af172(0x15a)]!==_0x436c13[_0x5af172(0x15a)];if(!_0x561f0c[_0x5af172(0x14a)](_0x5af172(0x150))&&_0x5db529['hash']===_0x56a99b&&!_0x1ae60a){_0x12e87d['push']({'sqlCode':_0x436c13[_0x5af172(0x17b)],'reason':'unchanged'});continue;}if(_0x5db529[_0x5af172(0x160)]==null){_0x94aa0f[_0x5af172(0x158)]({'sqlCode':_0x436c13['sqlCode'],'error':_0x5af172(0x166)});continue;}const _0x12c4f7=_0x436c13['sqlName']||_0x5db529[_0x5af172(0x171)],_0x147067=await resolveTargetDbBinding(_0x561f0c[_0x5af172(0x16e)],_0x436c13,_0x5db529),_0x49e4b8=await readSqlUploadContent(_0x436c13),_0x581ffc=await updateSqlQuery({'id':_0x5db529[_0x5af172(0x15c)],'appCode':_0x561f0c[_0x5af172(0x16e)],'sqlCode':_0x436c13[_0x5af172(0x17b)],'sqlName':_0x12c4f7,'dbId':_0x147067['dbId'],'version':_0x5db529[_0x5af172(0x160)],'sqlContent':_0x49e4b8,'sqlConfig':_0x5db529[_0x5af172(0x155)]??undefined}),_0x40ffaf=_0x581ffc[_0x5af172(0x187)]?await getDbName(_0x561f0c['appCode'],Number(_0x581ffc[_0x5af172(0x187)]))[_0x5af172(0x17f)](()=>_0x147067[_0x5af172(0x151)]):_0x147067[_0x5af172(0x151)];_0x3e88ee[_0x5af172(0x147)][_0x436c13[_0x5af172(0x17b)]]={...buildSqlLockEntry(_0x581ffc,_0x49e4b8,_0x56a99b,{'dbName':_0x40ffaf}),'path':_0x436c13[_0x5af172(0x178)],'mode':_0x436c13[_0x5af172(0x15a)]},_0x302bbe=!![],await archivePreviousSqlFileIfNeeded(_0x3cafed,_0x5db529[_0x5af172(0x15e)],_0x436c13[_0x5af172(0x178)]),_0x186ebc['push']({'sqlCode':_0x436c13[_0x5af172(0x17b)],'remoteId':_0x5db529[_0x5af172(0x15c)]});}catch(_0x57caf9){_0x94aa0f[_0x5af172(0x158)]({'sqlCode':_0x436c13[_0x5af172(0x17b)],'error':_0x57caf9 instanceof Error?_0x57caf9[_0x5af172(0x152)]:String(_0x57caf9)});}}(_0x302bbe||_0x94aa0f['length']===0x0)&&(_0x3e88ee[_0x5af172(0x17d)]=new Date()[_0x5af172(0x188)](),await writeSqlLockFile(_0x3cafed['lockFilePath'],_0x8adeff));const _0x30aaf2=_0x94aa0f['length']===0x0;return{'ok':_0x30aaf2,'data':{'pushed':_0x186ebc,'skipped':_0x12e87d,'failed':_0x94aa0f},'message':_0x5af172(0x163)+_0x186ebc[_0x5af172(0x168)]+_0x5af172(0x173)+_0x12e87d[_0x5af172(0x168)]+_0x5af172(0x184)+_0x94aa0f[_0x5af172(0x168)]+_0x5af172(0x182)};}};async function archivePreviousSqlFileIfNeeded(_0xb93eb6,_0x708de8,_0x29c13a){const _0x35b90b=a254_0x14e39b;if(!_0x708de8||_0x708de8===_0x29c13a)return;const _0x1e1fb6=join(_0xb93eb6[_0x35b90b(0x16a)],_0x708de8);if(!await fileExists(_0x1e1fb6))return;const _0x3d2184=await moveToTrash(_0xb93eb6['projectRoot'],_0xb93eb6['trashDir'],_0x1e1fb6);await cleanupEmptyDirectories(dirname(_0x1e1fb6),_0xb93eb6[_0x35b90b(0x16a)]),void _0x3d2184;}async function moveToTrash(_0xdc87a6,_0x531214,_0x271d1e){const _0x2efe6d=a254_0x14e39b,_0x492450=new Date()['toISOString']()[_0x2efe6d(0x14b)](/[:.]/g,'-'),_0x2e3269=relative(_0xdc87a6,_0x271d1e),_0x81d8f9=join(_0x531214,_0x492450,_0x2e3269);return await mkdir(dirname(_0x81d8f9),{'recursive':!![]}),await rename(_0x271d1e,_0x81d8f9),_0x81d8f9;}async function cleanupEmptyDirectories(_0x97369b,_0x45addc){const _0x3033e7=a254_0x14e39b;let _0x40281d=resolve(_0x97369b);const _0x56af14=resolve(_0x45addc);while(_0x40281d[_0x3033e7(0x177)](''+_0x56af14+sep)||_0x40281d===_0x56af14){if(_0x40281d===_0x56af14)return;try{const _0x5dc1a7=await readdir(_0x40281d);if(_0x5dc1a7[_0x3033e7(0x168)]>0x0)return;await rmdir(_0x40281d);}catch{return;}_0x40281d=dirname(_0x40281d);}}async function resolveTargetDbBinding(_0x1bc678,_0x437395,_0x23da0b){const _0xc826a0=a254_0x14e39b,_0x23797f=_0x437395[_0xc826a0(0x181)];if(!_0x23797f)return{'dbId':_0x23da0b['dbId'],'dbName':_0x23da0b[_0xc826a0(0x151)]};const _0x17a075=buildDbDirectoryName(_0x23da0b[_0xc826a0(0x151)],_0x23da0b['dbId']);if(_0x23797f===_0x17a075)return{'dbId':_0x23da0b[_0xc826a0(0x187)],'dbName':_0x23da0b[_0xc826a0(0x151)]};const _0x421ba8=parseExplicitDbDirectory(_0x23797f);if(_0x421ba8!=null)return{'dbId':_0x421ba8,'dbName':await getDbName(_0x1bc678,_0x421ba8)[_0xc826a0(0x17f)](()=>undefined)};const _0x2d70f6=await listDatabases(_0x1bc678),_0x20d2b5=_0x2d70f6[_0xc826a0(0x176)](_0x1af4f9=>buildDbDirectoryName(_0x1af4f9[_0xc826a0(0x151)],_0x1af4f9[_0xc826a0(0x187)])===_0x23797f);if(_0x20d2b5[_0xc826a0(0x168)]===0x1)return{'dbId':_0x20d2b5[0x0][_0xc826a0(0x187)],'dbName':_0x20d2b5[0x0][_0xc826a0(0x151)]};if(_0x20d2b5[_0xc826a0(0x168)]===0x0)throw CliErrors[_0xc826a0(0x164)](_0xc826a0(0x180)+_0x23797f+'\x22\x20for\x20sqlCode\x20'+_0x437395['sqlCode']+'.');const _0x1a15a5=_0x20d2b5['map'](_0x4d0474=>_0x4d0474[_0xc826a0(0x151)]+'\x20('+_0x4d0474['dbId']+')')[_0xc826a0(0x174)](',\x20');throw CliErrors[_0xc826a0(0x164)](_0xc826a0(0x14d)+_0x23797f+_0xc826a0(0x179)+_0x437395[_0xc826a0(0x17b)]+':\x20'+_0x1a15a5);}function parseExplicitDbDirectory(_0x30d0b9){const _0x3fa99c=a254_0x14e39b,_0x37db0c=/^db-(\d+)$/[_0x3fa99c(0x167)](_0x30d0b9);if(!_0x37db0c)return null;const _0x3162a6=Number(_0x37db0c[0x1]);return Number[_0x3fa99c(0x17e)](_0x3162a6)&&_0x3162a6>0x0?_0x3162a6:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a255_0x5d9677=a255_0x208f;(function(_0x24729a,_0x4a773c){const _0x9f7bfd=a255_0x208f,_0x47efb8=_0x24729a();while(!![]){try{const _0x4334a5=parseInt(_0x9f7bfd(0xb9))/0x1+parseInt(_0x9f7bfd(0xbf))/0x2*(-parseInt(_0x9f7bfd(0xaa))/0x3)+parseInt(_0x9f7bfd(0xc0))/0x4*(-parseInt(_0x9f7bfd(0xa7))/0x5)+-parseInt(_0x9f7bfd(0x9c))/0x6*(-parseInt(_0x9f7bfd(0xb0))/0x7)+-parseInt(_0x9f7bfd(0x98))/0x8*(parseInt(_0x9f7bfd(0xa9))/0x9)+parseInt(_0x9f7bfd(0xa4))/0xa+-parseInt(_0x9f7bfd(0xc6))/0xb*(-parseInt(_0x9f7bfd(0xae))/0xc);if(_0x4334a5===_0x4a773c)break;else _0x47efb8['push'](_0x47efb8['shift']());}catch(_0xaeb3b9){_0x47efb8['push'](_0x47efb8['shift']());}}}(a255_0x1e45,0x5a1dd));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=a255_0x5d9677(0xb2);export function buildSqlLockEntry(_0x35b6d7,_0x20b397,_0x5048b5,_0xeea1c0){const _0x567ec3=a255_0x5d9677,_0x2302f7=detectSqlMode(_0x20b397);return{'path':buildSqlRelativePath(_0x35b6d7['sqlCode'],_0x35b6d7[_0x567ec3(0xbc)],_0xeea1c0?.[_0x567ec3(0xaf)],_0x2302f7,_0x35b6d7['dbId']),'hash':_0x5048b5,'remoteId':_0x35b6d7['id'],'version':_0x35b6d7[_0x567ec3(0xbb)],'dbId':Number(_0x35b6d7[_0x567ec3(0x9b)]),'dbName':_0xeea1c0?.['dbName'],'sqlName':_0x35b6d7[_0x567ec3(0xbc)],'sqlConfig':_0x35b6d7['sqlConfig']??undefined,'mode':_0x2302f7};}export function cloneSqlLockData(_0x3d0591){const _0xa33fed=a255_0x5d9677;return{'apps':Object['fromEntries'](Object[_0xa33fed(0xb1)](_0x3d0591[_0xa33fed(0xc2)])[_0xa33fed(0xc3)](([_0x427d8f,_0x37d561])=>[_0x427d8f,{'sqlRoot':_0x37d561[_0xa33fed(0xc5)],'lastSync':_0x37d561[_0xa33fed(0xac)],'sqls':{..._0x37d561['sqls']}}]))};}export function ensureRemoteSqlContent(_0x2d4e49){const _0x5e167c=a255_0x5d9677;return _0x2d4e49[_0x5e167c(0x9a)]??'';}export function buildLocalSqlFileContent(_0x516f33,_0x4c0ec7,_0x1d3389){const _0x7de567=a255_0x5d9677,_0x2d97f3=_0x1d3389?.[_0x7de567(0x9f)]??detectSqlMode(_0x4c0ec7),_0x3aa4c1=stripLocalSqlMetadata(_0x4c0ec7,_0x2d97f3)['trim'](),_0x13c447=buildMetadataHeaderLines({'sqlCode':_0x516f33[_0x7de567(0x99)],'sqlName':_0x516f33['sqlName'],'dbId':_0x516f33[_0x7de567(0x9b)],'dbName':_0x1d3389?.[_0x7de567(0xaf)],'mode':_0x2d97f3,'syncedAt':_0x1d3389?.[_0x7de567(0xba)],'description':_0x1d3389?.[_0x7de567(0xbe)]},_0x2d97f3),_0x56647d=_0x2d97f3===_0x7de567(0x9d)?splitXmlDeclaration(_0x3aa4c1):{'body':_0x3aa4c1},_0x1d6c9d=[..._0x56647d['declaration']?[_0x56647d['declaration']]:[],..._0x13c447,'',_0x56647d[_0x7de567(0xa1)][_0x7de567(0xb8)]()],_0x2969b0=_0x1d6c9d[_0x7de567(0xa8)]('\x0a');return _0x2969b0[_0x7de567(0xa3)]('\x0a')?_0x2969b0:_0x2969b0+'\x0a';}export function stripLocalSqlMetadata(_0x1cb01e,_0x21391f){const _0x51d227=a255_0x5d9677;if(_0x21391f===_0x51d227(0x9d)){const {declaration:_0x876ce9,body:_0x316d3a}=splitXmlDeclaration(_0x1cb01e[_0x51d227(0xa2)](/\r\n/g,'\x0a')),_0x50b0df=stripLeadingMetadataLines(_0x316d3a,/^\s*<!--\s*@lovrabet\./);return _0x876ce9?''+_0x876ce9+(_0x50b0df?'\x0a'+_0x50b0df:''):_0x50b0df;}return stripLeadingMetadataLines(_0x1cb01e[_0x51d227(0xa2)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0xd1b125,_0x2c3983){const _0x51188e=a255_0x5d9677;if(_0x2c3983?.[_0x51188e(0x9f)])return _0x2c3983[_0x51188e(0x9f)];return detectSqlMode(_0xd1b125);}function a255_0x208f(_0x320b94,_0x501872){_0x320b94=_0x320b94-0x98;const _0x1e4531=a255_0x1e45();let _0x208f7b=_0x1e4531[_0x320b94];return _0x208f7b;}function a255_0x1e45(){const _0x3b1b26=['filter','sqlRoot','5093imVEMF','608BGBXyI','sqlCode','sqlContent','dbId','6SLAKpI','mybatisXml','yes','mode','toLowerCase','body','replace','endsWith','6799810pZyVJx','--\x20@lovrabet.','slice','2499845wpXOtn','join','83484ZiItBP','537AZOyrY','close','lastSync','test','24060nOCsyM','dbName','1930124zScDmx','entries','.rabetbase/sql','length','trim','question','path','\x20[y/N]\x20','trimStart','199468twDcwc','syncedAt','version','sqlName','\x20-->','description','5692BlWEhI','4HdikZG','stderr','apps','map'];a255_0x1e45=function(){return _0x3b1b26;};return a255_0x1e45();}export function resolveSqlFileName(_0x130595,_0x26571f,_0x5e8a2f){const _0x4039ac=a255_0x5d9677;if(_0x5e8a2f?.[_0x4039ac(0xb6)])return _0x5e8a2f[_0x4039ac(0xb6)];if(_0x5e8a2f?.['sqlName']||_0x5e8a2f?.[_0x4039ac(0xaf)])return buildSqlRelativePath(_0x130595,_0x5e8a2f?.[_0x4039ac(0xbc)],_0x5e8a2f?.[_0x4039ac(0xaf)],resolveSqlMode(_0x26571f,_0x5e8a2f),_0x5e8a2f?.[_0x4039ac(0x9b)]);return buildDefaultSqlFileName(_0x130595,resolveSqlMode(_0x26571f,_0x5e8a2f));}export function resolveSqlLocalDir(_0x27f5af,_0x259f8c){return join(_0x27f5af,SQL_LOCAL_REL_DIR,_0x259f8c);}export async function confirmForceOverwrite(_0x5dc969){const _0x155b4=a255_0x5d9677,_0x2dfd35=createInterface({'input':process['stdin'],'output':process[_0x155b4(0xc1)]}),_0x51bcd2=await new Promise(_0xe2cceb=>{const _0x190c7a=_0x155b4;_0x2dfd35[_0x190c7a(0xb5)](_0x5dc969+_0x190c7a(0xb7),_0xe2cceb);});return _0x2dfd35[_0x155b4(0xab)](),['y',_0x155b4(0x9e)]['includes'](_0x51bcd2[_0x155b4(0xb4)]()[_0x155b4(0xa0)]());}export function findSqlLockScope(_0x56f621,_0x4382f9){const _0x2f179c=a255_0x5d9677;return _0x56f621[_0x2f179c(0xc2)][_0x4382f9];}function buildMetadataHeaderLines(_0x19c234,_0x1862bf){const _0x4f0a1b=a255_0x5d9677,_0xe63a02=[['sqlCode',_0x19c234[_0x4f0a1b(0x99)]],['sqlName',_0x19c234['sqlName']],[_0x4f0a1b(0x9b),_0x19c234[_0x4f0a1b(0x9b)]],['dbName',_0x19c234[_0x4f0a1b(0xaf)]],[_0x4f0a1b(0x9f),_0x19c234[_0x4f0a1b(0x9f)]],[_0x4f0a1b(0xba),_0x19c234['syncedAt']],['description',_0x19c234['description']]];if(_0x1862bf===_0x4f0a1b(0x9d))return _0xe63a02[_0x4f0a1b(0xc4)](([,_0x4c1c62])=>_0x4c1c62!==undefined&&_0x4c1c62!==null&&String(_0x4c1c62)['trim']()!=='')[_0x4f0a1b(0xc3)](([_0x1c539c,_0x5548bf])=>'<!--\x20@lovrabet.'+_0x1c539c+':\x20'+String(_0x5548bf)+_0x4f0a1b(0xbd));return _0xe63a02[_0x4f0a1b(0xc4)](([,_0x4e698d])=>_0x4e698d!==undefined&&_0x4e698d!==null&&String(_0x4e698d)[_0x4f0a1b(0xb4)]()!=='')[_0x4f0a1b(0xc3)](([_0x4e7679,_0x7a2870])=>_0x4f0a1b(0xa5)+_0x4e7679+':\x20'+String(_0x7a2870));}function splitXmlDeclaration(_0x392306){const _0x295169=a255_0x5d9677,_0x25cef3=_0x392306[_0x295169(0xb8)](),_0x5b4a95=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i['exec'](_0x25cef3);if(!_0x5b4a95)return{'body':_0x392306};return{'declaration':_0x5b4a95[0x0],'body':_0x25cef3[_0x295169(0xa6)](_0x5b4a95[0x0][_0x295169(0xb3)])};}function stripLeadingMetadataLines(_0x3e47c8,_0x280d8f){const _0x2ef212=a255_0x5d9677,_0x471ef5=_0x3e47c8['split']('\x0a');let _0x200ed1=0x0;while(_0x200ed1<_0x471ef5[_0x2ef212(0xb3)]){const _0x2f18f2=_0x471ef5[_0x200ed1]??'';if(_0x280d8f[_0x2ef212(0xad)](_0x2f18f2)||_0x2f18f2[_0x2ef212(0xb4)]()===''){_0x200ed1++;continue;}break;}return _0x471ef5[_0x2ef212(0xa6)](_0x200ed1)['join']('\x0a')['trimStart']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a256_0x4aee54=a256_0x56f6;(function(_0x32aac1,_0xb3a3b7){const _0x4af9b2=a256_0x56f6,_0x282437=_0x32aac1();while(!![]){try{const _0x20e33c=parseInt(_0x4af9b2(0x1b8))/0x1*(parseInt(_0x4af9b2(0x1be))/0x2)+parseInt(_0x4af9b2(0x1c4))/0x3*(-parseInt(_0x4af9b2(0x1bd))/0x4)+parseInt(_0x4af9b2(0x1c2))/0x5+parseInt(_0x4af9b2(0x1ca))/0x6+parseInt(_0x4af9b2(0x1dc))/0x7*(-parseInt(_0x4af9b2(0x1c9))/0x8)+parseInt(_0x4af9b2(0x1dd))/0x9+-parseInt(_0x4af9b2(0x1b9))/0xa*(parseInt(_0x4af9b2(0x1cc))/0xb);if(_0x20e33c===_0xb3a3b7)break;else _0x282437['push'](_0x282437['shift']());}catch(_0x30a258){_0x282437['push'](_0x282437['shift']());}}}(a256_0x2699,0x4c36d));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a256_0x2699(){const _0x6b6cd6=['50GNiEtH','tableData','bool','relativePath','32zrAgMa','28OkvReM','\x20unchanged','status','paging','849425WGopDy','totalCount','14187gMoyHC','lockKey','read','\x20missing,\x20','push','5912fVTpLO','767106xrBbYB','\x20added,\x20','1535039zmyyka','filePath','sqlRoot','sqlName','appCode','length','remote','sqls','path','sql','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','lockFilePath','map','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','\x20remote-only','has','1162WyGjKw','4526280baFDJX','26412nzSnXM'];a256_0x2699=function(){return _0x6b6cd6;};return a256_0x2699();}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a256_0x56f6(_0x5cf8e7,_0x39ebb9){_0x5cf8e7=_0x5cf8e7-0x1b8;const _0x269949=a256_0x2699();let _0x56f696=_0x269949[_0x5cf8e7];return _0x56f696;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x54bfdb){const _0x266e2b=a256_0x56f6,_0x4e50a2=[];let _0x431667=0x1;while(!![]){const _0x1059f5=await listSqlQueries(_0x54bfdb,{'currentPage':_0x431667,'pageSize':PAGE_SIZE}),_0x143c78=_0x1059f5[_0x266e2b(0x1ba)]??[];_0x4e50a2[_0x266e2b(0x1c8)](..._0x143c78[_0x266e2b(0x1d8)](_0x3fce10=>_0x3fce10['sqlCode']));if(_0x143c78[_0x266e2b(0x1d1)]===0x0)break;const _0x39fac=_0x1059f5[_0x266e2b(0x1c1)]?.[_0x266e2b(0x1c3)];if(_0x39fac!=null?_0x4e50a2['length']>=_0x39fac:_0x143c78['length']<PAGE_SIZE)break;_0x431667++;}return _0x4e50a2;}export const sqlStatus={'service':a256_0x4aee54(0x1d5),'command':a256_0x4aee54(0x1c0),'description':a256_0x4aee54(0x1d6),'risk':a256_0x4aee54(0x1c6),'flags':[{'name':a256_0x4aee54(0x1d2),'type':'boolean','description':a256_0x4aee54(0x1d9)}],async 'execute'(_0x54215f){const _0x3b080f=a256_0x4aee54,_0x5f0952=loadSqlProjectConfig(_0x54215f[_0x3b080f(0x1d0)]),_0x2e0639=await readSqlLockFile(_0x5f0952[_0x3b080f(0x1d7)]),{appLock:_0x5de9ab}=ensureSqlLockScope(_0x2e0639??createEmptySqlLock(),_0x5f0952['appCode'],_0x5f0952[_0x3b080f(0x1ce)],_0x3b080f(0x1c0)),_0x1527ae=await scanLocalSqlQueries(_0x5f0952),_0x3248db=[],_0x41fae1=[],_0x4d7acd=[],_0x409936=[],_0x2d27e9=new Set(_0x1527ae['map'](_0x2ac13c=>_0x2ac13c[_0x3b080f(0x1c5)]));for(const _0x33cafe of _0x1527ae){const _0x36e38d=await computeSqlFileHash(_0x33cafe[_0x3b080f(0x1cd)]),_0x4aec96=_0x5de9ab[_0x3b080f(0x1d3)][_0x33cafe[_0x3b080f(0x1c5)]],_0x3f2eb3=!!_0x4aec96&&_0x4aec96[_0x3b080f(0x1d4)]!==_0x33cafe[_0x3b080f(0x1bc)],_0x413ce4=!!_0x4aec96&&!!_0x33cafe['sqlName']&&_0x4aec96[_0x3b080f(0x1cf)]!==_0x33cafe[_0x3b080f(0x1cf)];if(!_0x4aec96)_0x3248db[_0x3b080f(0x1c8)](_0x33cafe[_0x3b080f(0x1c5)]);else _0x4aec96['hash']!==_0x36e38d||_0x3f2eb3||_0x413ce4?_0x41fae1[_0x3b080f(0x1c8)](_0x33cafe[_0x3b080f(0x1c5)]):_0x4d7acd[_0x3b080f(0x1c8)](_0x33cafe['lockKey']);}for(const _0x17a964 of Object['keys'](_0x5de9ab[_0x3b080f(0x1d3)])){!_0x2d27e9[_0x3b080f(0x1db)](_0x17a964)&&_0x409936[_0x3b080f(0x1c8)](_0x17a964);}const _0x3ff592=[];if(_0x54215f[_0x3b080f(0x1bb)](_0x3b080f(0x1d2))){const _0x321e46=await fetchAllSqlCodes(_0x54215f[_0x3b080f(0x1d0)]);for(const _0x189bb5 of _0x321e46){!_0x2d27e9['has'](_0x189bb5)&&!_0x5de9ab[_0x3b080f(0x1d3)][_0x189bb5]&&_0x3ff592[_0x3b080f(0x1c8)](_0x189bb5);}}const _0x29a4ae=_0x3248db[_0x3b080f(0x1d1)]===0x0&&_0x41fae1[_0x3b080f(0x1d1)]===0x0&&_0x409936[_0x3b080f(0x1d1)]===0x0&&_0x3ff592[_0x3b080f(0x1d1)]===0x0;return{'ok':!![],'data':{'added':_0x3248db,'modified':_0x41fae1,'missing':_0x409936,'unchanged':_0x4d7acd,'remoteOnly':_0x3ff592},'message':_0x29a4ae?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x3248db[_0x3b080f(0x1d1)]+_0x3b080f(0x1cb)+_0x41fae1['length']+'\x20modified,\x20'+_0x409936['length']+_0x3b080f(0x1c7)+_0x4d7acd[_0x3b080f(0x1d1)]+_0x3b080f(0x1bf)+(_0x3ff592[_0x3b080f(0x1d1)]>0x0?',\x20'+_0x3ff592[_0x3b080f(0x1d1)]+_0x3b080f(0x1da):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a257_0x3f8810=a257_0x15b6;(function(_0x1bcfdf,_0x583dc5){const _0x132e2f=a257_0x15b6,_0x2bee9b=_0x1bcfdf();while(!![]){try{const _0x22b909=-parseInt(_0x132e2f(0x91))/0x1+parseInt(_0x132e2f(0x88))/0x2*(-parseInt(_0x132e2f(0x7c))/0x3)+parseInt(_0x132e2f(0x9b))/0x4+parseInt(_0x132e2f(0x8e))/0x5+parseInt(_0x132e2f(0x92))/0x6*(-parseInt(_0x132e2f(0x8a))/0x7)+parseInt(_0x132e2f(0x90))/0x8*(-parseInt(_0x132e2f(0xb2))/0x9)+parseInt(_0x132e2f(0x95))/0xa;if(_0x22b909===_0x583dc5)break;else _0x2bee9b['push'](_0x2bee9b['shift']());}catch(_0x1c5cae){_0x2bee9b['push'](_0x2bee9b['shift']());}}}(a257_0x4327,0x78397));import{readFileSync,existsSync}from'node:fs';function a257_0x4327(){const _0x111688=['filter','utf-8','20814270CIHjGR','index_name','--check-indexes\x20requires\x20--schemas.','schema:','trim','columns','1380844cCsBaR','isLockingRead','str','fields','bool','file','Table\x20\x22','dataset','indexName','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','columnNames','sqlType','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','Provide\x20--file\x20or\x20--sql','push','SQL\x20schema\x20validation','Dataset\x20\x22','isArray','isDangerous','schemas','string','\x22\x20not\x20found\x20in\x20any\x20dataset','File\x20not\x20found:\x20','9UsHSNT','toLowerCase','tableName','pkField','name','index_type','split','type','validation','3pbtdFE','boolean','sql','map','parameters','length','indexes','unshift','get','check-indexes','index_columns','valid','1788842tVZHaf','schemaWarnings','217BAwnZI','cwd','from','dbtableConfig','3143810WyZEhx','message','5175472wqDmQB','719573iXYGSf','58458gMTYfK'];a257_0x4327=function(){return _0x111688;};return a257_0x4327();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a257_0x15b6(_0x2f3798,_0x547e56){_0x2f3798=_0x2f3798-0x75;const _0x43279d=a257_0x4327();let _0x15b6b0=_0x43279d[_0x2f3798];return _0x15b6b0;}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a257_0x3f8810(0x7e),'command':'validate','description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':'read','flags':[{'name':'file','type':a257_0x3f8810(0xaf),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a257_0x3f8810(0x7e),'type':'string','description':a257_0x3f8810(0xa7)},{'name':a257_0x3f8810(0xae),'type':a257_0x3f8810(0xaf),'description':a257_0x3f8810(0xa4)},{'name':a257_0x3f8810(0x85),'type':a257_0x3f8810(0x7d),'description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x5d8ac1){const _0x544029=a257_0x3f8810,_0x48d5e4=_0x5d8ac1[_0x544029(0x9d)](_0x544029(0xa0)),_0x26d17a=_0x5d8ac1[_0x544029(0x9d)](_0x544029(0x7e)),_0x4b261a=_0x5d8ac1[_0x544029(0x9d)](_0x544029(0xae)),_0x15293e=_0x5d8ac1[_0x544029(0x9f)](_0x544029(0x85));if(!_0x48d5e4&&!_0x26d17a)throw CliErrors['flagMissing'](_0x544029(0xa0),_0x544029(0xa8));if(_0x15293e&&!_0x4b261a)throw CliErrors[_0x544029(0x7b)](_0x544029(0x97));let _0x5eb1a8;if(_0x48d5e4){const _0x2b08d5=resolve(process[_0x544029(0x8b)](),_0x48d5e4);if(!existsSync(_0x2b08d5))throw CliErrors['validation'](_0x544029(0xb1)+_0x2b08d5);_0x5eb1a8=readFileSync(_0x2b08d5,_0x544029(0x94));}else _0x5eb1a8=_0x26d17a;const _0x25d8c2=validateSql(_0x5eb1a8),_0x5d0846={'valid':_0x25d8c2['valid'],'sqlType':_0x25d8c2['sqlType'][_0x544029(0x7a)],'isSelectOnly':_0x25d8c2[_0x544029(0xa6)]['isSelectOnly'],'isLockingRead':_0x25d8c2['sqlType'][_0x544029(0x9c)]??![],'isDangerous':_0x25d8c2[_0x544029(0xa6)][_0x544029(0xad)],'tables':_0x25d8c2['tables'],'parameters':_0x25d8c2[_0x544029(0x80)],'message':_0x25d8c2[_0x544029(0x8f)]};_0x25d8c2['sqlType']['reason']&&(_0x5d0846['reason']=_0x25d8c2[_0x544029(0xa6)]['reason']);if(_0x4b261a&&_0x25d8c2[_0x544029(0x87)]){const _0x225b68=_0x4b261a[_0x544029(0x79)](',')['map'](_0x14b064=>_0x14b064[_0x544029(0x99)]())[_0x544029(0x93)](Boolean),_0x341e9c=[],_0x55422a=[],_0x40beb8=filterDbTableBackedDatasets(await listDatasets(_0x5d8ac1['appCode'])),_0x1d85ba=new Map(_0x40beb8['map'](_0x4d6c8b=>[_0x4d6c8b[_0x544029(0x8d)]?.['tableName']?.[_0x544029(0xb3)](),_0x4d6c8b]));for(const _0x53e4b5 of _0x25d8c2['tables']){const _0x3ec713=_0x1d85ba[_0x544029(0x84)](_0x53e4b5[_0x544029(0xb3)]());!_0x3ec713&&_0x341e9c[_0x544029(0xa9)](_0x544029(0xa1)+_0x53e4b5+_0x544029(0xb0));}for(const _0x49e327 of _0x225b68){let _0x2398a7;try{_0x2398a7=await getDatasetDetail(_0x49e327);}catch{_0x341e9c[_0x544029(0xa9)](_0x544029(0xab)+_0x49e327+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x2398a7,_0x544029(0xaa));const _0x2e3310=Array[_0x544029(0xac)](_0x2398a7[_0x544029(0x9e)])?_0x2398a7[_0x544029(0x9e)]:[],_0x1f5ab7=new Set(_0x2e3310[_0x544029(0x7f)](_0x420f34=>_0x420f34[_0x544029(0x77)]?.[_0x544029(0xb3)]())),_0x1cdaea=_0x2398a7[_0x544029(0x8d)]?.[_0x544029(0x75)]||_0x2398a7[_0x544029(0x75)]||_0x49e327;_0x5d0846[_0x544029(0x98)+_0x1cdaea]={'code':_0x49e327,'tableName':_0x1cdaea,'fieldCount':_0x1f5ab7['size'],'fields':Array[_0x544029(0x8c)](_0x1f5ab7)};if(_0x15293e){const _0x18a3db=normalizeDatasetIndexes(_0x2398a7);_0x55422a[_0x544029(0xa9)]({'tableName':_0x1cdaea,..._0x18a3db});}}_0x341e9c[_0x544029(0x81)]>0x0&&(_0x5d0846[_0x544029(0x89)]=_0x341e9c),_0x15293e&&(_0x5d0846['joinAudit']=auditSqlJoinIndexes(_0x5eb1a8,_0x55422a));}return{'ok':_0x25d8c2[_0x544029(0x87)],'data':_0x5d0846,'message':_0x25d8c2[_0x544029(0x8f)]};}};function normalizeDatasetIndexes(_0x356dc9){const _0x402a7f=a257_0x3f8810,_0x81e96c=Array[_0x402a7f(0xac)](_0x356dc9?.[_0x402a7f(0xa2)]?.[_0x402a7f(0x82)])?_0x356dc9[_0x402a7f(0xa2)][_0x402a7f(0x82)]:Array[_0x402a7f(0xac)](_0x356dc9?.[_0x402a7f(0x82)])?_0x356dc9[_0x402a7f(0x82)]:[],_0x2abf09=_0x81e96c['flatMap'](_0x5ac596=>{const _0x5d1400=_0x402a7f,_0x2c6a88=Array[_0x5d1400(0xac)](_0x5ac596?.[_0x5d1400(0x86)])?_0x5ac596[_0x5d1400(0x86)]:Array[_0x5d1400(0xac)](_0x5ac596?.['columnNames'])?_0x5ac596[_0x5d1400(0xa5)]:Array[_0x5d1400(0xac)](_0x5ac596?.[_0x5d1400(0x9a)])?_0x5ac596[_0x5d1400(0x9a)]:[],_0x3de440=_0x2c6a88[_0x5d1400(0x93)](_0x176347=>typeof _0x176347==='string')[_0x5d1400(0x7f)](_0x3ff760=>_0x3ff760[_0x5d1400(0x99)]())[_0x5d1400(0x93)](Boolean);if(_0x3de440[_0x5d1400(0x81)]===0x0)return[];const _0x5dba45=[_0x5ac596?.[_0x5d1400(0xa3)],_0x5ac596?.[_0x5d1400(0x96)],_0x5ac596?.['name']]['find'](_0x558c3b=>typeof _0x558c3b===_0x5d1400(0xaf)&&_0x558c3b['trim']()),_0x4730f3=[_0x5ac596?.[_0x5d1400(0x78)],_0x5ac596?.[_0x5d1400(0x7a)]]['find'](_0x48f427=>typeof _0x48f427===_0x5d1400(0xaf)&&_0x48f427[_0x5d1400(0x99)]());return[{..._0x5dba45?{'name':_0x5dba45[_0x5d1400(0x99)]()}:{},..._0x4730f3?{'type':_0x4730f3[_0x5d1400(0x99)]()}:{},'columns':_0x3de440}];}),_0xf5b4=[..._0x2abf09],_0x132466=typeof _0x356dc9?.[_0x402a7f(0x8d)]?.[_0x402a7f(0x76)]==='string'?_0x356dc9[_0x402a7f(0x8d)][_0x402a7f(0x76)][_0x402a7f(0x79)](',')[_0x402a7f(0x7f)](_0x55f0aa=>_0x55f0aa['trim']())[_0x402a7f(0x93)](Boolean):[];return _0x132466[_0x402a7f(0x81)]>0x0&&_0xf5b4[_0x402a7f(0x83)]({'type':'primary','columns':_0x132466}),{'indexes':_0xf5b4,'metadataAvailable':_0x2abf09[_0x402a7f(0x81)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38c4de,_0x2494e0){const _0x1e423d=a258_0x60aa,_0x38ae64=_0x38c4de();while(!![]){try{const _0x29a473=parseInt(_0x1e423d(0x121))/0x1+parseInt(_0x1e423d(0x120))/0x2*(parseInt(_0x1e423d(0x124))/0x3)+parseInt(_0x1e423d(0x125))/0x4*(parseInt(_0x1e423d(0x127))/0x5)+parseInt(_0x1e423d(0x11f))/0x6+parseInt(_0x1e423d(0x122))/0x7+parseInt(_0x1e423d(0x11e))/0x8+-parseInt(_0x1e423d(0x123))/0x9*(parseInt(_0x1e423d(0x126))/0xa);if(_0x29a473===_0x2494e0)break;else _0x38ae64['push'](_0x38ae64['shift']());}catch(_0x54aa5f){_0x38ae64['push'](_0x38ae64['shift']());}}}(a258_0x23a9,0x5bd58));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];function a258_0x60aa(_0x227801,_0x42e894){_0x227801=_0x227801-0x11e;const _0x23a988=a258_0x23a9();let _0x60aa2e=_0x23a988[_0x227801];return _0x60aa2e;}function a258_0x23a9(){const _0x34c102=['1539537bHVYAz','76892dyxDLq','4814380nrxtyU','10ZXnTVB','199144rKnMdP','3138138ozdSln','2uEPUXP','310157LkJoCD','2875376WwCACY','27ZPSSCM'];a258_0x23a9=function(){return _0x34c102;};return a258_0x23a9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a259_0x27dcff=a259_0x882b;(function(_0x2e89a7,_0x55e77c){const _0x256439=a259_0x882b,_0x1e5b32=_0x2e89a7();while(!![]){try{const _0x2fdfc7=-parseInt(_0x256439(0x1d4))/0x1*(parseInt(_0x256439(0x1d3))/0x2)+-parseInt(_0x256439(0x1db))/0x3+-parseInt(_0x256439(0x1cf))/0x4*(-parseInt(_0x256439(0x1e7))/0x5)+-parseInt(_0x256439(0x1d5))/0x6+-parseInt(_0x256439(0x1df))/0x7*(parseInt(_0x256439(0x1d7))/0x8)+-parseInt(_0x256439(0x1e6))/0x9+-parseInt(_0x256439(0x1e3))/0xa*(-parseInt(_0x256439(0x1d6))/0xb);if(_0x2fdfc7===_0x55e77c)break;else _0x1e5b32['push'](_0x1e5b32['shift']());}catch(_0xe56910){_0x1e5b32['push'](_0x1e5b32['shift']());}}}(a259_0x13ed,0x2084c));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a259_0x13ed(){const _0x4d828d=['49JmOswR','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','appCode','trim','10fgEMiD','isTerminal','task','772029PRrZYN','105QTUFvX','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','31932xIPzGt','apiError','cookie','taskId','16858PynYGK','31sOMRsL','781110CDCYqu','9982291zxmZzw','266032rIOnfW','string','flagMissing','task-id','695655Xeyozm','compress','status','read'];a259_0x13ed=function(){return _0x4d828d;};return a259_0x13ed();}function a259_0x882b(_0x35c2ff,_0xcfbf9c){_0x35c2ff=_0x35c2ff-0x1cf;const _0x13ed71=a259_0x13ed();let _0x882b9f=_0x13ed71[_0x35c2ff];return _0x882b9f;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a259_0x27dcff(0x1e5),'command':a259_0x27dcff(0x1dd),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a259_0x27dcff(0x1de),'defaultOutputFormat':a259_0x27dcff(0x1dc),'structuredErrors':!![],'flags':[{'name':a259_0x27dcff(0x1da),'type':a259_0x27dcff(0x1d8),'required':!![],'description':a259_0x27dcff(0x1e0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2807e6){const _0x404ff4=a259_0x27dcff;if(!_0x2807e6['str'](_0x404ff4(0x1da))[_0x404ff4(0x1e2)]())throw CliErrors[_0x404ff4(0x1d9)](_0x404ff4(0x1da));},async 'execute'(_0x2a46f8){const _0x3cc95b=a259_0x27dcff,_0x5c25b6=_0x2a46f8['str']('task-id')[_0x3cc95b(0x1e2)](),_0x5739b7=normalizeAsyncTask(await getAsyncTaskStatus(_0x5c25b6,_0x2a46f8[_0x3cc95b(0x1e1)],_0x2a46f8[_0x3cc95b(0x1d1)]));if(_0x5739b7[_0x3cc95b(0x1d2)]!==_0x5c25b6)throw CliErrors[_0x3cc95b(0x1d0)](_0x3cc95b(0x1e8)+_0x5c25b6+',\x20received\x20'+_0x5739b7[_0x3cc95b(0x1d2)]+'.');const _0x3430aa=buildAsyncTaskStatusCommand(_0x5739b7[_0x3cc95b(0x1d2)],_0x2a46f8[_0x3cc95b(0x1e1)]);return{'ok':!![],'message':asyncTaskMessage(_0x5739b7),'data':{'appCode':_0x2a46f8[_0x3cc95b(0x1e1)],..._0x5739b7,'query':_0x5739b7[_0x3cc95b(0x1e4)]?null:{'command':_0x3430aa}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a260_0x5239(_0x1a02e7,_0x4ecfe5){_0x1a02e7=_0x1a02e7-0x1c3;const _0x13867e=a260_0x1386();let _0x523955=_0x13867e[_0x1a02e7];return _0x523955;}(function(_0x7be67f,_0x56f74d){const _0x259497=a260_0x5239,_0x11ea87=_0x7be67f();while(!![]){try{const _0x23d252=parseInt(_0x259497(0x1c7))/0x1+parseInt(_0x259497(0x1c4))/0x2+-parseInt(_0x259497(0x1cc))/0x3+parseInt(_0x259497(0x1c8))/0x4*(-parseInt(_0x259497(0x1c5))/0x5)+-parseInt(_0x259497(0x1ca))/0x6*(parseInt(_0x259497(0x1c3))/0x7)+-parseInt(_0x259497(0x1c6))/0x8*(parseInt(_0x259497(0x1cd))/0x9)+parseInt(_0x259497(0x1c9))/0xa*(parseInt(_0x259497(0x1cb))/0xb);if(_0x23d252===_0x56f74d)break;else _0x11ea87['push'](_0x11ea87['shift']());}catch(_0x7f8cfd){_0x11ea87['push'](_0x11ea87['shift']());}}}(a260_0x1386,0x83bf7));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a260_0x1386(){const _0x3aeb9f=['2390264XJgNMk','635206aPILOf','8OIcjhw','4090UcGLZu','3225666ZiUQvu','35409fMTKXX','291894XmppmJ','27xABDpx','7hhPWoA','1130580MxXSus','1115425LfSduV'];a260_0x1386=function(){return _0x3aeb9f;};return a260_0x1386();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a261_0xd766f1=a261_0x76a5;(function(_0x28170b,_0x55d527){const _0x1486ef=a261_0x76a5,_0x66e0f0=_0x28170b();while(!![]){try{const _0xfc697a=parseInt(_0x1486ef(0x164))/0x1*(-parseInt(_0x1486ef(0x170))/0x2)+parseInt(_0x1486ef(0x175))/0x3+-parseInt(_0x1486ef(0x16a))/0x4+parseInt(_0x1486ef(0x168))/0x5+parseInt(_0x1486ef(0x16c))/0x6*(-parseInt(_0x1486ef(0x166))/0x7)+parseInt(_0x1486ef(0x177))/0x8+parseInt(_0x1486ef(0x16b))/0x9;if(_0xfc697a===_0x55d527)break;else _0x66e0f0['push'](_0x66e0f0['shift']());}catch(_0x5c09d9){_0x66e0f0['push'](_0x66e0f0['shift']());}}}(a261_0x12cc,0x2db86));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a261_0x12cc(){const _0xd71c11=['trim','Exact\x20tenant\x20code','43466wRTvjG','length','\x20tenant\x20member(s)','Found\x20','tenant-code','39366auUZIT','read','2757640MOJhiz','17pEcULN','string','7cDyxaX','flagMissing','411145UIgbVj','Pass\x20--tenant-code\x20<code>.','145840Brwfim','3655080YwByQY','1517910hfPwMo','str'];a261_0x12cc=function(){return _0xd71c11;};return a261_0x12cc();}function a261_0x76a5(_0x4a45af,_0x1aad71){_0x4a45af=_0x4a45af-0x164;const _0x12ccf7=a261_0x12cc();let _0x76a55=_0x12ccf7[_0x4a45af];return _0x76a55;}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a261_0xd766f1(0x176),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0xd766f1(0x174),'type':a261_0xd766f1(0x165),'required':!![],'description':a261_0xd766f1(0x16f)}],async 'validate'(_0x2cf34e){const _0x202517=a261_0xd766f1;if(!_0x2cf34e[_0x202517(0x16d)]('tenant-code')[_0x202517(0x16e)]())throw CliErrors[_0x202517(0x167)](_0x202517(0x174),_0x202517(0x169));},async 'execute'(_0x5223a0){const _0x2efc0a=a261_0xd766f1,_0x5e3e92=_0x5223a0['str'](_0x2efc0a(0x174))['trim'](),_0x500d7a=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x5e3e92,_0x500d7a);const _0x1cadad=projectTenantMembers(await listTenantDirectoryMembers(_0x5e3e92));return{'ok':!![],'data':{'tenantCode':_0x5e3e92,'items':_0x1cadad,'totalCount':_0x1cadad[_0x2efc0a(0x171)]},'message':_0x2efc0a(0x173)+_0x1cadad['length']+_0x2efc0a(0x172)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27b769,_0x3f15e3){const _0x55108f=a262_0x3e59,_0x32bb78=_0x27b769();while(!![]){try{const _0x4cca38=parseInt(_0x55108f(0x7d))/0x1+-parseInt(_0x55108f(0x89))/0x2*(parseInt(_0x55108f(0x96))/0x3)+-parseInt(_0x55108f(0x7f))/0x4+-parseInt(_0x55108f(0x85))/0x5+-parseInt(_0x55108f(0x7b))/0x6*(parseInt(_0x55108f(0x8c))/0x7)+parseInt(_0x55108f(0x8d))/0x8+parseInt(_0x55108f(0x7c))/0x9*(parseInt(_0x55108f(0x91))/0xa);if(_0x4cca38===_0x3f15e3)break;else _0x32bb78['push'](_0x32bb78['shift']());}catch(_0x249766){_0x32bb78['push'](_0x32bb78['shift']());}}}(a262_0x1704,0x52559));import{CliErrors}from'../../errors.js';function textOrNull(_0x2e0273){const _0x44dbd3=a262_0x3e59,_0x4b28a0=_0x2e0273?.[_0x44dbd3(0x81)]();return _0x4b28a0?_0x4b28a0:null;}function a262_0x3e59(_0x18e616,_0x3f8e13){_0x18e616=_0x18e616-0x7b;const _0x17046b=a262_0x1704();let _0x3e5922=_0x17046b[_0x18e616];return _0x3e5922;}export function projectTenantMembers(_0x134a9d){const _0x3e2aa2=a262_0x3e59,_0x5822ec=new Map();for(const _0x5d771a of _0x134a9d){const _0x5d30ae=Number(_0x5d771a[_0x3e2aa2(0x90)]);if(!Number[_0x3e2aa2(0x82)](_0x5d30ae)||_0x5d30ae<=0x0)continue;const _0x54507e={'userId':_0x5d30ae,'username':textOrNull(_0x5d771a['username']),'displayName':textOrNull(_0x5d771a[_0x3e2aa2(0x92)]),'role':_0x5d771a[_0x3e2aa2(0x83)]===!![]?_0x3e2aa2(0x86):_0x3e2aa2(0x95),'status':textOrNull(_0x5d771a[_0x3e2aa2(0x93)])},_0x4b415b=_0x5822ec[_0x3e2aa2(0x88)](_0x5d30ae);if(!_0x4b415b){_0x5822ec[_0x3e2aa2(0x84)](_0x5d30ae,_0x54507e);continue;}_0x4b415b[_0x3e2aa2(0x87)]??=_0x54507e[_0x3e2aa2(0x87)],_0x4b415b[_0x3e2aa2(0x80)]??=_0x54507e[_0x3e2aa2(0x80)],_0x4b415b[_0x3e2aa2(0x93)]??=_0x54507e[_0x3e2aa2(0x93)];if(_0x54507e[_0x3e2aa2(0x7e)]===_0x3e2aa2(0x86))_0x4b415b[_0x3e2aa2(0x7e)]=_0x3e2aa2(0x86);}return[..._0x5822ec[_0x3e2aa2(0x8e)]()]['sort']((_0xe7be95,_0x2e6f75)=>_0xe7be95['userId']-_0x2e6f75[_0x3e2aa2(0x90)]);}export function assertTenantAccessible(_0x154b7c,_0x18634f){const _0x3e2861=a262_0x3e59;if(_0x18634f[_0x3e2861(0x8f)](_0x84cdd=>_0x84cdd[_0x3e2861(0x94)]===_0x154b7c))return;throw CliErrors[_0x3e2861(0x8a)]('Tenant\x20\x22'+_0x154b7c+_0x3e2861(0x8b),'Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}function a262_0x1704(){const _0x39549f=['some','userId','302470HrkwfQ','nickname','status','tenantCode','MEMBER','532902zwrBhH','12HwUeAG','297GZsfVK','167767wIacTs','role','1199696GMYNMQ','displayName','trim','isFinite','adminFlag','set','1767215yxJZuq','ADMIN','username','get','4TJmXiI','validation','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','522011uDWtgl','2632832CNgnyZ','values'];a262_0x1704=function(){return _0x39549f;};return a262_0x1704();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a263_0x1526eb=a263_0x4e2a;(function(_0x2d2c53,_0x4c0d79){const _0x1508fc=a263_0x4e2a,_0x527799=_0x2d2c53();while(!![]){try{const _0x2cc280=-parseInt(_0x1508fc(0x121))/0x1+-parseInt(_0x1508fc(0x10c))/0x2+-parseInt(_0x1508fc(0x11d))/0x3*(parseInt(_0x1508fc(0x120))/0x4)+parseInt(_0x1508fc(0x111))/0x5+-parseInt(_0x1508fc(0x115))/0x6*(parseInt(_0x1508fc(0x11a))/0x7)+-parseInt(_0x1508fc(0x116))/0x8+parseInt(_0x1508fc(0x11b))/0x9;if(_0x2cc280===_0x4c0d79)break;else _0x527799['push'](_0x527799['shift']());}catch(_0x3b03ae){_0x527799['push'](_0x527799['shift']());}}}(a263_0x19d8,0xcfcd8));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a263_0x1526eb(0x10f),CURRENT_BINDING_WARNING=a263_0x1526eb(0x10d);function readDingTalkUserId(_0x3b9dca){const _0x477f7f=a263_0x1526eb,_0x2701e4=_0x3b9dca[_0x477f7f(0x10e)](_0x477f7f(0x110))[_0x477f7f(0x11f)]();if(!_0x2701e4)throw CliErrors[_0x477f7f(0x10b)](_0x477f7f(0x11c),_0x477f7f(0x113));return _0x2701e4;}function a263_0x4e2a(_0x5d0eab,_0x5e4f89){_0x5d0eab=_0x5d0eab-0x10b;const _0x19d8f9=a263_0x19d8();let _0x4e2a65=_0x19d8f9[_0x5d0eab];return _0x4e2a65;}function buildBindingData(_0x4c57d9,_0x4375c7){return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x4c57d9},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x4c57d9,'bound':!![]},'dryRun':_0x4375c7,'backend':{'method':'POST','path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a263_0x1526eb(0x117),'command':'dingding-sandbox-bind','description':a263_0x1526eb(0x114),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a263_0x1526eb(0x110),'type':'string','required':!![],'description':a263_0x1526eb(0x112)}],async 'validate'(_0x1d1e98){readDingTalkUserId(_0x1d1e98);},async 'dryRun'(_0x360458){const _0x176a76=readDingTalkUserId(_0x360458);return asDryRunResult(buildBindingData(_0x176a76,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x1c7834){const _0x17ce11=a263_0x1526eb,_0xa2b72a=readDingTalkUserId(_0x1c7834),_0x308230=await bindDingTalkSandboxAccount(_0xa2b72a);if(_0x308230!==!![])throw CliErrors[_0x17ce11(0x11e)](_0x17ce11(0x118),_0x17ce11(0x119));return{'ok':!![],'data':buildBindingData(_0xa2b72a,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};function a263_0x19d8(){const _0x439fa4=['DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','532854XqnGnH','30415509tOgVua','--ding-talk-user-id\x20cannot\x20be\x20empty.','3rfonyl','apiError','trim','1717404BMvsGR','588144pRFLhN','validation','1496102wSoQAC','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','str','dingtalk','ding-talk-user-id','4666325vTEhLn','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','54GOaGtt','8087696zhCIQu','user-account'];a263_0x19d8=function(){return _0x439fa4;};return a263_0x19d8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a264_0x3b4644=a264_0x3ee8;(function(_0x50755c,_0x149e6b){const _0xd01c03=a264_0x3ee8,_0x211668=_0x50755c();while(!![]){try{const _0xd79281=-parseInt(_0xd01c03(0xde))/0x1*(-parseInt(_0xd01c03(0xe8))/0x2)+-parseInt(_0xd01c03(0xea))/0x3*(parseInt(_0xd01c03(0xe1))/0x4)+-parseInt(_0xd01c03(0xef))/0x5*(-parseInt(_0xd01c03(0xdc))/0x6)+parseInt(_0xd01c03(0xe9))/0x7*(-parseInt(_0xd01c03(0xee))/0x8)+parseInt(_0xd01c03(0xec))/0x9+parseInt(_0xd01c03(0xd7))/0xa+-parseInt(_0xd01c03(0xeb))/0xb;if(_0xd79281===_0x149e6b)break;else _0x211668['push'](_0x211668['shift']());}catch(_0x3509aa){_0x211668['push'](_0x211668['shift']());}}}(a264_0x2e13,0x5f5ac));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=a264_0x3b4644(0xd6),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function a264_0x2e13(){const _0x5284db=['test','feishu','4804470ktyoQg','apiError','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','trim','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','6NeMwXr','bind','3mstRZH','union-id','write','168676tgaENb','POST','str','validation','user-account','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','string','145190sIWXen','7VovxAt','39tXIfFo','4948031eViWsF','5810904GTVQbO','Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer','4889176zWodco','3279245jOSQid','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.'];a264_0x2e13=function(){return _0x5284db;};return a264_0x2e13();}function a264_0x3ee8(_0x26d931,_0x49b214){_0x26d931=_0x26d931-0xd6;const _0x2e1395=a264_0x2e13();let _0x3ee85d=_0x2e1395[_0x26d931];return _0x3ee85d;}function readUnionId(_0x3db11b){const _0x1c9011=a264_0x3b4644,_0x26e15b=_0x3db11b[_0x1c9011(0xe3)](_0x1c9011(0xdf))[_0x1c9011(0xda)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x1c9011(0xf1)](_0x26e15b))throw CliErrors[_0x1c9011(0xe4)](_0x1c9011(0xe6),'Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.');return _0x26e15b;}function buildBindingData(_0x17982d,_0x1fda9a){const _0x1dd90d=a264_0x3b4644;return{'operation':_0x1dd90d(0xdd),'selector':{'providerId':PROVIDER_ID,'unionId':_0x17982d},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x17982d,'bound':!![]},'dryRun':_0x1fda9a,'backend':{'method':'POST','path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a264_0x3b4644(0xe5),'command':'feishu-bind','description':a264_0x3b4644(0xd9),'risk':a264_0x3b4644(0xe0),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a264_0x3b4644(0xdf),'type':a264_0x3b4644(0xe7),'required':!![],'description':a264_0x3b4644(0xed)}],async 'validate'(_0x14ded7){readUnionId(_0x14ded7);},async 'dryRun'(_0x1a61af){const _0x10ff13=a264_0x3b4644,_0x19d887=readUnionId(_0x1a61af);return asDryRunResult(buildBindingData(_0x19d887,!![]),{'method':_0x10ff13(0xe2),'url':FEISHU_BIND_PATH});},async 'execute'(_0x25508d){const _0x511fc6=a264_0x3b4644,_0x2fae36=readUnionId(_0x25508d),_0x437ff7=await bindFeishuAccount(_0x2fae36);if(_0x437ff7!==!![])throw CliErrors[_0x511fc6(0xd8)](_0x511fc6(0xf0),_0x511fc6(0xdb));return{'ok':!![],'data':buildBindingData(_0x2fae36,![]),'message':'Bound\x20current\x20user\x20to\x20Feishu\x20account.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4c4269,_0x35a3d5){const _0x5b29a6=a265_0x2178,_0x477740=_0x4c4269();while(!![]){try{const _0x268e20=-parseInt(_0x5b29a6(0x92))/0x1+-parseInt(_0x5b29a6(0x8b))/0x2+-parseInt(_0x5b29a6(0x8e))/0x3*(-parseInt(_0x5b29a6(0x90))/0x4)+parseInt(_0x5b29a6(0x88))/0x5*(-parseInt(_0x5b29a6(0x87))/0x6)+-parseInt(_0x5b29a6(0x8f))/0x7*(parseInt(_0x5b29a6(0x8a))/0x8)+parseInt(_0x5b29a6(0x8c))/0x9*(parseInt(_0x5b29a6(0x89))/0xa)+parseInt(_0x5b29a6(0x91))/0xb*(parseInt(_0x5b29a6(0x8d))/0xc);if(_0x268e20===_0x35a3d5)break;else _0x477740['push'](_0x477740['shift']());}catch(_0x385154){_0x477740['push'](_0x477740['shift']());}}}(a265_0x3905,0x6c2c9));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];function a265_0x2178(_0x34b2fa,_0xaf2a26){_0x34b2fa=_0x34b2fa-0x87;const _0x390500=a265_0x3905();let _0x217832=_0x390500[_0x34b2fa];return _0x217832;}function a265_0x3905(){const _0x2e3156=['496752yFZUHW','11MXiade','833508AqfkRo','1069416sDyLwM','10mwZyko','10qBLbBu','16lZJtDE','71318fDnJUb','4855581kbmjHB','16805004Ykcpkd','3awVvul','1383879dDisOa'];a265_0x3905=function(){return _0x2e3156;};return a265_0x3905();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a266_0x22858a=a266_0x18e6;function a266_0x18e6(_0x4222b2,_0x5aa996){_0x4222b2=_0x4222b2-0x8d;const _0x5b7291=a266_0x5b72();let _0x18e6f8=_0x5b7291[_0x4222b2];return _0x18e6f8;}(function(_0x497c0a,_0x27bb5b){const _0x5aa2c3=a266_0x18e6,_0x32e96b=_0x497c0a();while(!![]){try{const _0x2f5a52=-parseInt(_0x5aa2c3(0x90))/0x1+-parseInt(_0x5aa2c3(0x9a))/0x2+-parseInt(_0x5aa2c3(0x8f))/0x3+parseInt(_0x5aa2c3(0x99))/0x4*(-parseInt(_0x5aa2c3(0x8e))/0x5)+parseInt(_0x5aa2c3(0x91))/0x6*(-parseInt(_0x5aa2c3(0x95))/0x7)+parseInt(_0x5aa2c3(0x97))/0x8*(parseInt(_0x5aa2c3(0x92))/0x9)+parseInt(_0x5aa2c3(0x98))/0xa;if(_0x2f5a52===_0x27bb5b)break;else _0x32e96b['push'](_0x32e96b['shift']());}catch(_0x53e774){_0x32e96b['push'](_0x32e96b['shift']());}}}(a266_0x5b72,0xbb56a));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':'add','description':'Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a266_0x22858a(0x93),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a266_0x22858a(0x8d),'description':a266_0x22858a(0x96),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x4f2420=>validateAppName(_0x4f2420,a266_0x22858a(0x94)),'execute':_0x533b58=>runAppAdd(_0x533b58,a266_0x22858a(0x94))};function a266_0x5b72(){const _0x609150=['1168344hgdVxk','705598qRdDOJ','7253502TdTZsr','45GZjiHz','write','workspace\x20add','7jOKetE','App\x20profile\x20name','475336eNFxGE','40227740CDXNBW','4pAFpNz','1348098VEqcpq','name','2872545zwSiNp'];a266_0x5b72=function(){return _0x609150;};return a266_0x5b72();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a267_0x19c9c9=a267_0x3f6b;(function(_0x38eddc,_0x29a651){const _0x1206b6=a267_0x3f6b,_0x42f622=_0x38eddc();while(!![]){try{const _0x36ea69=parseInt(_0x1206b6(0x14d))/0x1*(parseInt(_0x1206b6(0x142))/0x2)+-parseInt(_0x1206b6(0x154))/0x3*(parseInt(_0x1206b6(0x123))/0x4)+-parseInt(_0x1206b6(0x134))/0x5*(parseInt(_0x1206b6(0x12f))/0x6)+parseInt(_0x1206b6(0x139))/0x7*(parseInt(_0x1206b6(0x12a))/0x8)+parseInt(_0x1206b6(0x125))/0x9+-parseInt(_0x1206b6(0x153))/0xa*(parseInt(_0x1206b6(0x149))/0xb)+-parseInt(_0x1206b6(0x120))/0xc*(-parseInt(_0x1206b6(0x13b))/0xd);if(_0x36ea69===_0x29a651)break;else _0x42f622['push'](_0x42f622['shift']());}catch(_0x24821e){_0x42f622['push'](_0x42f622['shift']());}}}(a267_0x4fa8,0x2fac1));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{ENABLED_LOVRABET_REGION_VALUES}from'../../constant/region.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a267_0x19c9c9(0x148),SAFE_PROFILE_KEYS=['appcode',a267_0x19c9c9(0x152),a267_0x19c9c9(0x13e),a267_0x19c9c9(0x144),a267_0x19c9c9(0x124),a267_0x19c9c9(0x127),'pageSize','riskLevel','locale'],workspaceFlags=[{'name':a267_0x19c9c9(0x11a),'type':a267_0x19c9c9(0x133),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a267_0x19c9c9(0x143),'type':a267_0x19c9c9(0x133),'description':a267_0x19c9c9(0x12e)},{'name':'apiGroup','type':'string','description':a267_0x19c9c9(0x13f)},{'name':a267_0x19c9c9(0x13e),'type':'string','description':a267_0x19c9c9(0x145),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':a267_0x19c9c9(0x144),'type':'string','description':a267_0x19c9c9(0x131),'enum':[...RABETBASE_ENV_VALUES]},{'name':a267_0x19c9c9(0x124),'type':a267_0x19c9c9(0x133),'description':a267_0x19c9c9(0x14c)},{'name':a267_0x19c9c9(0x13a),'type':a267_0x19c9c9(0x133),'description':a267_0x19c9c9(0x13d),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a267_0x19c9c9(0x14a),'type':a267_0x19c9c9(0x12d),'description':a267_0x19c9c9(0x146)},{'name':a267_0x19c9c9(0x132),'type':a267_0x19c9c9(0x133),'description':a267_0x19c9c9(0x11b),'enum':[...RISK_LEVEL_VALUES]},{'name':a267_0x19c9c9(0x11f),'type':'string','description':'App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)'}];function isRecord(_0x360858){const _0x2ad098=a267_0x19c9c9;return!!_0x360858&&typeof _0x360858==='object'&&!Array[_0x2ad098(0x14b)](_0x360858);}function assertValidAppcode(_0x39a371){const _0x1234b4=a267_0x19c9c9,{valid:_0x4d5fcf,message:_0x2369b6}=validateAppcode(_0x39a371);if(!_0x4d5fcf)throw CliErrors[_0x1234b4(0x129)](_0x1234b4(0x147)+_0x39a371,_0x2369b6);}function a267_0x3f6b(_0x21e39a,_0x2a7fbc){_0x21e39a=_0x21e39a-0x118;const _0x4fa824=a267_0x4fa8();let _0x3f6b46=_0x4fa824[_0x21e39a];return _0x3f6b46;}function sanitizeProfile(_0x57fff9){if(!isRecord(_0x57fff9))return{};const _0x527ef6={};for(const _0x58c500 of SAFE_PROFILE_KEYS){if(_0x57fff9[_0x58c500]!==undefined)_0x527ef6[_0x58c500]=_0x57fff9[_0x58c500];}return _0x527ef6;}function cloneProfile(_0x55b62c){return isRecord(_0x55b62c)?{..._0x55b62c}:{};}function a267_0x4fa8(){const _0x1a4fa6=['28325uHsSrg','flag','apps','workspace','initialized','5845zPzFlf','defaultFormat','1465061wZYWKP','\x20--app\x20','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','region','Join\x20key\x20for\x20app\x20profiles\x20that\x20share\x20one\x20generated\x20API\x20model\x20registry','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','use','681140MkxFhR','appcode','env','Country/region\x20for\x20this\x20workspace\x20app\x20profile','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','Invalid\x20appcode:\x20','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','373615jhZTtG','pageSize','isArray','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','1yZxfKm','globalConfig','Missing\x20workspace\x20app\x20selector.','keys','str','apiGroup','30BmnJer','808218edoDYd','Use\x20`','Initialize\x20the\x20current\x20workspace\x20app\x20binding','\x22\x20not\x20found.','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','app','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20use\x20--app\x20<name>`.','length','init','locale','36mOGoxy','trim','\x20workspace\x20','4UgNEcK','apiDir','1126485ftIwbI','\x20(appcode:\x20','format','Workspace\x20','validation','712VJhUze',').\x20Config:\x20','write','number','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','330DhdDlj','.\x20Credentials:\x20not\x20written.','Target\x20environment','riskLevel','string'];a267_0x4fa8=function(){return _0x1a4fa6;};return a267_0x4fa8();}function collectWorkspaceProfileOverrides(_0x272267){const _0x341cb2=a267_0x19c9c9,_0x499791={},_0x15c627=_0x272267['str'](_0x341cb2(0x152)),_0x43e08f=_0x272267[_0x341cb2(0x151)]('region'),_0x47ecea=_0x272267[_0x341cb2(0x151)](_0x341cb2(0x144)),_0x2b5680=_0x272267[_0x341cb2(0x151)](_0x341cb2(0x124)),_0x540964=_0x272267[_0x341cb2(0x151)](_0x341cb2(0x13a)),_0x8da70a=_0x272267[_0x341cb2(0x135)](_0x341cb2(0x14a)),_0x4ddde5=_0x272267[_0x341cb2(0x151)](_0x341cb2(0x132)),_0x4497c7=_0x272267[_0x341cb2(0x151)](_0x341cb2(0x11f));if(_0x15c627)_0x499791[_0x341cb2(0x152)]=_0x15c627;if(_0x43e08f)_0x499791['region']=_0x43e08f;if(_0x47ecea)_0x499791['env']=_0x47ecea;if(_0x2b5680)_0x499791[_0x341cb2(0x124)]=_0x2b5680;if(_0x540964)_0x499791[_0x341cb2(0x127)]=_0x540964;if(_0x8da70a!==undefined&&_0x8da70a!=='')_0x499791['pageSize']=Number(_0x8da70a);if(_0x4ddde5)_0x499791[_0x341cb2(0x132)]=_0x4ddde5;if(_0x4497c7)_0x499791['locale']=_0x4497c7;return _0x499791;}async function validateWorkspaceArgs(_0x458f26){const _0x349ec0=a267_0x19c9c9,_0x3cdc48=_0x458f26[_0x349ec0(0x151)]('app')[_0x349ec0(0x121)](),_0x4ff74b=_0x458f26['str']('appcode')[_0x349ec0(0x121)]();if(!_0x3cdc48&&!_0x4ff74b)throw CliErrors['validation'](_0x349ec0(0x14f),_0x349ec0(0x155)+CLI_BIN_NAME+_0x349ec0(0x140)+CLI_BIN_NAME+_0x349ec0(0x11c));if(_0x4ff74b)assertValidAppcode(_0x4ff74b);}function resolveKnownApps(){const _0x64fb3b=a267_0x19c9c9,{config:_0x12796c,layers:_0x57ca5f}=readRawConfigWithLayers(),_0x434772=isRecord(_0x12796c[_0x64fb3b(0x136)])?_0x12796c[_0x64fb3b(0x136)]:{},_0x22d7a5=isRecord(_0x57ca5f[_0x64fb3b(0x14e)][_0x64fb3b(0x136)])?_0x57ca5f['globalConfig'][_0x64fb3b(0x136)]:{};return{..._0x22d7a5,..._0x434772};}async function configureWorkspace(_0x31f99e,_0x405120){const _0x49c4b4=a267_0x19c9c9,_0x23d146=_0x31f99e[_0x49c4b4(0x151)]('app')[_0x49c4b4(0x121)](),_0x546e29=_0x31f99e[_0x49c4b4(0x151)](_0x49c4b4(0x143))[_0x49c4b4(0x121)](),_0xe0fd17=_0x23d146||_0x546e29;if(!_0xe0fd17)throw CliErrors[_0x49c4b4(0x129)](_0x49c4b4(0x14f),_0x49c4b4(0x155)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x49c4b4(0x11c));if(_0x546e29)assertValidAppcode(_0x546e29);const _0x10f86a=resolveWriteConfigPath('project'),_0x2c2161=readConfigFile(_0x10f86a),_0xda8260=resolveKnownApps(),_0x296086=isRecord(_0x2c2161[_0x49c4b4(0x136)])?{..._0x2c2161[_0x49c4b4(0x136)]}:{},_0xae9468=cloneProfile(_0x296086[_0xe0fd17]),_0x4e57c9=sanitizeProfile(_0xda8260[_0xe0fd17]),_0x4311c0=_0x546e29?{}:_0x4e57c9,_0x1ab50b=_0x546e29||_0x4311c0[_0x49c4b4(0x143)];if(!_0x1ab50b){const _0x388f85=Object[_0x49c4b4(0x150)](_0xda8260),_0x23ca3f=_0x388f85[_0x49c4b4(0x11d)]===0x0?_0x49c4b4(0x155)+CLI_BIN_NAME+_0x49c4b4(0x122)+_0x405120+_0x49c4b4(0x13c)+_0xe0fd17+'\x20--appcode\x20<code>`.':_0x49c4b4(0x119)+_0x388f85['join'](',\x20');throw CliErrors[_0x49c4b4(0x129)]('App\x20\x22'+_0xe0fd17+_0x49c4b4(0x118),_0x23ca3f);}assertValidAppcode(String(_0x1ab50b));const _0xe97009={..._0x4311c0,..._0xae9468,'appcode':String(_0x1ab50b),...collectWorkspaceProfileOverrides(_0x31f99e)};return _0x296086[_0xe0fd17]=_0xe97009,_0x2c2161[_0x49c4b4(0x136)]=_0x296086,normalizeStoredDefaultApp(_0x2c2161,_0xe0fd17),delete _0x2c2161[_0x49c4b4(0x143)],delete _0x2c2161[_0x49c4b4(0x11a)],_0xe97009[_0x49c4b4(0x144)]&&(_0x2c2161[_0x49c4b4(0x144)]=_0xe97009[_0x49c4b4(0x144)]),writeConfigFile(_0x10f86a,_0x2c2161),{'ok':!![],'message':_0x49c4b4(0x128)+(_0x405120===_0x49c4b4(0x11e)?_0x49c4b4(0x138):'updated')+':\x20'+_0xe0fd17+_0x49c4b4(0x126)+_0xe97009[_0x49c4b4(0x143)]+_0x49c4b4(0x12b)+_0x10f86a+_0x49c4b4(0x130),'data':{'operation':'workspace.'+_0x405120,'configPath':_0x10f86a,'app':_0xe0fd17,'appcode':_0xe97009[_0x49c4b4(0x143)],'apiGroup':_0xe97009['apiGroup']??null,'region':_0xe97009['region']??null,'env':_0xe97009[_0x49c4b4(0x144)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a267_0x19c9c9(0x137),'command':'init','description':a267_0x19c9c9(0x156),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x17f2f9=>configureWorkspace(_0x17f2f9,a267_0x19c9c9(0x11e))},workspaceUseDefinition={'service':a267_0x19c9c9(0x137),'command':a267_0x19c9c9(0x141),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a267_0x19c9c9(0x12c),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2b9f75=>configureWorkspace(_0x2b9f75,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a268_0x5cc432=a268_0x17bf;function a268_0x3458(){const _0xbdfc2b=['name','1375297LylpRI','495420CVaEQp','45412qeYssP','874864vJAUSr','1112472VZtvwJ','write','workspace\x20remove','942216blqLKZ','16315hNTVft','204sJEhUa','workspace','App\x20profile\x20name\x20to\x20remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','5xtMMJk'];a268_0x3458=function(){return _0xbdfc2b;};return a268_0x3458();}function a268_0x17bf(_0x15976f,_0x4ce436){_0x15976f=_0x15976f-0x157;const _0x34588f=a268_0x3458();let _0x17bff8=_0x34588f[_0x15976f];return _0x17bff8;}(function(_0x2875dd,_0x2c0da6){const _0x163ca4=a268_0x17bf,_0x2a0471=_0x2875dd();while(!![]){try{const _0x343e33=parseInt(_0x163ca4(0x164))/0x1*(-parseInt(_0x163ca4(0x159))/0x2)+-parseInt(_0x163ca4(0x158))/0x3+-parseInt(_0x163ca4(0x160))/0x4*(parseInt(_0x163ca4(0x15f))/0x5)+parseInt(_0x163ca4(0x15e))/0x6+parseInt(_0x163ca4(0x157))/0x7+parseInt(_0x163ca4(0x15a))/0x8+parseInt(_0x163ca4(0x15b))/0x9;if(_0x343e33===_0x2c0da6)break;else _0x2a0471['push'](_0x2a0471['shift']());}catch(_0x3a6906){_0x2a0471['push'](_0x2a0471['shift']());}}}(a268_0x3458,0x2284e));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a268_0x5cc432(0x161),'command':'remove','description':a268_0x5cc432(0x163),'risk':a268_0x5cc432(0x15c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a268_0x5cc432(0x165),'description':a268_0x5cc432(0x162),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x5b3cbb=>validateAppName(_0x5b3cbb,'workspace\x20remove'),'execute':_0x44875b=>runAppRemove(_0x44875b,a268_0x5cc432(0x15d))};
|