@lovrabet/rabetbase-cli 2.5.12-beta.1 → 2.5.12
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-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a254_0x397be5=a254_0x324e;(function(_0x256453,_0x55b6ab){const _0x41529f=a254_0x324e,_0x1666d2=_0x256453();while(!![]){try{const _0x5d6dd2=parseInt(_0x41529f(0xf5))/0x1+parseInt(_0x41529f(0xe1))/0x2*(-parseInt(_0x41529f(0xcc))/0x3)+parseInt(_0x41529f(0xe4))/0x4*(-parseInt(_0x41529f(0xd5))/0x5)+-parseInt(_0x41529f(0xf6))/0x6*(-parseInt(_0x41529f(0xd9))/0x7)+parseInt(_0x41529f(0xd7))/0x8*(-parseInt(_0x41529f(0xdd))/0x9)+parseInt(_0x41529f(0xeb))/0xa*(-parseInt(_0x41529f(0xc3))/0xb)+parseInt(_0x41529f(0xc7))/0xc;if(_0x5d6dd2===_0x55b6ab)break;else _0x1666d2['push'](_0x1666d2['shift']());}catch(_0x5059e2){_0x1666d2['push'](_0x1666d2['shift']());}}}(a254_0x5257,0xe20d0));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';function a254_0x324e(_0x208192,_0x2c362e){_0x208192=_0x208192-0xc2;const _0x52571e=a254_0x5257();let _0x324eac=_0x52571e[_0x208192];return _0x324eac;}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(_0x38df17){const _0x418a82=a254_0x324e,_0x405a83=stripLocalSqlMetadata(await readFile(_0x38df17['filePath'],'utf8'),_0x38df17[_0x418a82(0xe5)]);if(!_0x405a83['trim']())throw CliErrors[_0x418a82(0xf9)](_0x38df17[_0x418a82(0xf7)]+':\x20SQL\x20content\x20is\x20empty.');return _0x405a83;}async function getTargetSqlQueries(_0x2415db,_0x16d2a9,_0x1dd92c){const _0x12dae1=a254_0x324e,_0xeaf20e=await scanLocalSqlQueries(_0x2415db),_0x11242e=new Map();for(const _0x39e70c of _0xeaf20e){if(_0x1dd92c&&_0x39e70c[_0x12dae1(0xf7)]!==_0x1dd92c)continue;const _0x311dae=_0x11242e[_0x12dae1(0xdc)](_0x39e70c[_0x12dae1(0xf7)])??[];_0x311dae[_0x12dae1(0xde)](_0x39e70c),_0x11242e[_0x12dae1(0xf2)](_0x39e70c[_0x12dae1(0xf7)],_0x311dae);}if(_0x1dd92c&&!_0x11242e[_0x12dae1(0xf4)](_0x1dd92c))throw CliErrors[_0x12dae1(0xf9)](_0x12dae1(0x107)+_0x1dd92c);const _0x5c98d2=[];for(const [_0x3037d4,_0x196298]of _0x11242e[_0x12dae1(0xee)]()){if(_0x196298['length']===0x1){_0x5c98d2[_0x12dae1(0xde)](_0x196298[0x0]);continue;}const _0x1fd89d=_0x16d2a9['sqls'][_0x3037d4],_0x13d015=_0x1fd89d?.['path'],_0x15e226=_0x13d015?_0x196298[_0x12dae1(0xdf)](_0x5abcbe=>_0x5abcbe[_0x12dae1(0xc4)]!==_0x13d015):_0x196298;if(_0x1fd89d&&_0x15e226['length']===0x1){_0x5c98d2[_0x12dae1(0xde)](_0x15e226[0x0]);continue;}throw CliErrors[_0x12dae1(0xf9)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x3037d4+_0x12dae1(0xcf));}return _0x5c98d2;}export const sqlPush={'service':'sql','command':a254_0x397be5(0xde),'description':a254_0x397be5(0xc8),'risk':a254_0x397be5(0xe2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a254_0x397be5(0xdb),'type':a254_0x397be5(0xec),'description':a254_0x397be5(0xda)}],async 'dryRun'(_0x500d82){const _0x222608=a254_0x397be5,_0x1a3e5e=loadSqlProjectConfig(_0x500d82['appCode']),_0x266835=await readSqlLockFile(_0x1a3e5e['lockFilePath']),{appLock:_0x12c1a7}=ensureSqlLockScope(_0x266835??createEmptySqlLock(),_0x500d82['appCode'],_0x1a3e5e[_0x222608(0xe7)],'push'),_0x42ab67=await getTargetSqlQueries(_0x1a3e5e,_0x12c1a7,_0x500d82[_0x222608(0xe3)](_0x222608(0xc5))||undefined),_0x1a228e=[];for(const _0x199812 of _0x42ab67){const _0x5e850c=await computeSqlFileHash(_0x199812[_0x222608(0xc2)]),_0x39a7db=_0x12c1a7[_0x222608(0xc9)][_0x199812[_0x222608(0xf7)]],_0x506eba=!!_0x39a7db&&(_0x39a7db[_0x222608(0x102)]!==_0x199812['relativePath']||!!_0x199812[_0x222608(0xff)]&&_0x39a7db[_0x222608(0xff)]!==_0x199812['sqlName']||_0x39a7db[_0x222608(0xe5)]!==_0x199812[_0x222608(0xe5)]);if(!_0x500d82[_0x222608(0xd2)](_0x222608(0xdb))&&_0x39a7db&&_0x39a7db['hash']===_0x5e850c&&!_0x506eba)continue;if(!_0x39a7db)throw CliErrors[_0x222608(0xf9)](_0x199812[_0x222608(0xf7)]+_0x222608(0xd4));if(_0x39a7db[_0x222608(0xef)]==null)throw CliErrors[_0x222608(0xf9)](_0x199812[_0x222608(0xf7)]+_0x222608(0xca));await resolveTargetDbBinding(_0x500d82[_0x222608(0xf0)],_0x199812,_0x39a7db),await readSqlUploadContent(_0x199812),_0x1a228e[_0x222608(0xde)](_0x199812[_0x222608(0xf7)]);}return{'method':_0x222608(0xea),'url':_0x222608(0xfd),'body':{'sqlCodes':_0x1a228e,'appCode':_0x500d82[_0x222608(0xf0)]},'description':'Would\x20push\x20'+_0x1a228e[_0x222608(0xd6)]+_0x222608(0xfa)};},async 'execute'(_0xd06323){const _0x558d5c=a254_0x397be5,_0x5de37f=loadSqlProjectConfig(_0xd06323[_0x558d5c(0xf0)]),_0x3a3b01=await readSqlLockFile(_0x5de37f[_0x558d5c(0xed)]),{lockData:_0x176e71,appLock:_0x1a4b06}=ensureSqlLockScope(_0x3a3b01??createEmptySqlLock(),_0xd06323[_0x558d5c(0xf0)],_0x5de37f[_0x558d5c(0xe7)],_0x558d5c(0xde)),_0x194bc6=await getTargetSqlQueries(_0x5de37f,_0x1a4b06,_0xd06323[_0x558d5c(0xe3)](_0x558d5c(0xc5))||undefined);if(_0x194bc6['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x558d5c(0xd0)};const _0x221e84=[],_0x224846=[],_0x23b2e1=[];let _0x55e97d=![];for(const _0x4bef79 of _0x194bc6){const _0x166992=_0x1a4b06[_0x558d5c(0xc9)][_0x4bef79[_0x558d5c(0xf7)]];if(!_0x166992){_0x23b2e1[_0x558d5c(0xde)]({'sqlCode':_0x4bef79['sqlCode'],'error':_0x558d5c(0xe6)});continue;}try{const _0x109f43=await computeSqlFileHash(_0x4bef79['filePath']),_0x4d1a9d=_0x166992['path']!==_0x4bef79[_0x558d5c(0xc4)]||!!_0x4bef79['sqlName']&&_0x166992[_0x558d5c(0xff)]!==_0x4bef79[_0x558d5c(0xff)]||_0x166992[_0x558d5c(0xe5)]!==_0x4bef79[_0x558d5c(0xe5)];if(!_0xd06323[_0x558d5c(0xd2)](_0x558d5c(0xdb))&&_0x166992['hash']===_0x109f43&&!_0x4d1a9d){_0x224846['push']({'sqlCode':_0x4bef79[_0x558d5c(0xf7)],'reason':_0x558d5c(0xc6)});continue;}if(_0x166992['version']==null){_0x23b2e1[_0x558d5c(0xde)]({'sqlCode':_0x4bef79[_0x558d5c(0xf7)],'error':_0x558d5c(0xe8)});continue;}const _0x59c3ac=_0x4bef79[_0x558d5c(0xff)]||_0x166992['sqlName'],_0x43fba4=await resolveTargetDbBinding(_0xd06323[_0x558d5c(0xf0)],_0x4bef79,_0x166992),_0x2895d9=await readSqlUploadContent(_0x4bef79),_0x2e1a79=await updateSqlQuery({'id':_0x166992[_0x558d5c(0x101)],'appCode':_0xd06323[_0x558d5c(0xf0)],'sqlCode':_0x4bef79['sqlCode'],'sqlName':_0x59c3ac,'dbId':_0x43fba4[_0x558d5c(0xce)],'version':_0x166992[_0x558d5c(0xef)],'sqlContent':_0x2895d9,'sqlConfig':_0x166992[_0x558d5c(0xd3)]??undefined}),_0x20fda0=_0x2e1a79['dbId']?await getDbName(_0xd06323[_0x558d5c(0xf0)],Number(_0x2e1a79['dbId']))[_0x558d5c(0x106)](()=>_0x43fba4[_0x558d5c(0xf3)]):_0x43fba4['dbName'];_0x1a4b06[_0x558d5c(0xc9)][_0x4bef79[_0x558d5c(0xf7)]]={...buildSqlLockEntry(_0x2e1a79,_0x2895d9,_0x109f43,{'dbName':_0x20fda0}),'path':_0x4bef79['relativePath'],'mode':_0x4bef79[_0x558d5c(0xe5)]},_0x55e97d=!![],await archivePreviousSqlFileIfNeeded(_0x5de37f,_0x166992['path'],_0x4bef79['relativePath']),_0x221e84['push']({'sqlCode':_0x4bef79['sqlCode'],'remoteId':_0x166992[_0x558d5c(0x101)]});}catch(_0x1c6f57){_0x23b2e1[_0x558d5c(0xde)]({'sqlCode':_0x4bef79[_0x558d5c(0xf7)],'error':_0x1c6f57 instanceof Error?_0x1c6f57[_0x558d5c(0xd8)]:String(_0x1c6f57)});}}(_0x55e97d||_0x23b2e1[_0x558d5c(0xd6)]===0x0)&&(_0x1a4b06[_0x558d5c(0xf1)]=new Date()[_0x558d5c(0xcd)](),await writeSqlLockFile(_0x5de37f[_0x558d5c(0xed)],_0x176e71));const _0x46b1a1=_0x23b2e1['length']===0x0;return{'ok':_0x46b1a1,'data':{'pushed':_0x221e84,'skipped':_0x224846,'failed':_0x23b2e1},'message':_0x558d5c(0x100)+_0x221e84[_0x558d5c(0xd6)]+_0x558d5c(0x105)+_0x224846[_0x558d5c(0xd6)]+_0x558d5c(0xd1)+_0x23b2e1['length']+_0x558d5c(0xfe)};}};async function archivePreviousSqlFileIfNeeded(_0xe99575,_0x37d2b4,_0x366e09){const _0x31dabc=a254_0x397be5;if(!_0x37d2b4||_0x37d2b4===_0x366e09)return;const _0x4d59f9=join(_0xe99575[_0x31dabc(0x103)],_0x37d2b4);if(!await fileExists(_0x4d59f9))return;const _0x32ec60=await moveToTrash(_0xe99575[_0x31dabc(0xe0)],_0xe99575['trashDir'],_0x4d59f9);await cleanupEmptyDirectories(dirname(_0x4d59f9),_0xe99575[_0x31dabc(0x103)]),void _0x32ec60;}async function moveToTrash(_0x423a0e,_0x154abd,_0xe05996){const _0x4b8083=a254_0x397be5,_0x2f51fd=new Date()['toISOString']()[_0x4b8083(0xe9)](/[:.]/g,'-'),_0x1e0217=relative(_0x423a0e,_0xe05996),_0x33105c=join(_0x154abd,_0x2f51fd,_0x1e0217);return await mkdir(dirname(_0x33105c),{'recursive':!![]}),await rename(_0xe05996,_0x33105c),_0x33105c;}function a254_0x5257(){const _0x26a1f3=[':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','1190990GrntzU','length','4422520rgaViF','message','6223ClcqRh','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','force','get','18BCLRIL','push','filter','projectRoot','58QeaubT','write','str','8NvYxzD','mode','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlRoot','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','replace','POST','340HiZjze','boolean','lockFilePath','entries','version','appCode','lastSync','set','dbName','has','828681XultFw','4014CFwKZm','sqlCode','isFinite','validation','\x20SQL\x20file(s)','startsWith','dbDirectory','/smartapi/custom/updateUserCustomSql','\x20failed','sqlName','Push\x20complete:\x20','remoteId','path','sqlRootDir','Local\x20directory\x20\x22','\x20pushed,\x20','catch','Local\x20SQL\x20not\x20found:\x20','filePath','54307gOqaaM','relativePath','sqlcode','unchanged','18873096BHORLq','Push\x20local\x20SQL\x20files\x20to\x20remote','sqls',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','exec','33144KnFqgs','toISOString','dbId','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','No\x20local\x20SQL\x20files\x20found.','\x20skipped,\x20','bool','sqlConfig'];a254_0x5257=function(){return _0x26a1f3;};return a254_0x5257();}async function cleanupEmptyDirectories(_0x176373,_0x17c29b){const _0x30f039=a254_0x397be5;let _0x544580=resolve(_0x176373);const _0x15c020=resolve(_0x17c29b);while(_0x544580[_0x30f039(0xfb)](''+_0x15c020+sep)||_0x544580===_0x15c020){if(_0x544580===_0x15c020)return;try{const _0x2611c9=await readdir(_0x544580);if(_0x2611c9['length']>0x0)return;await rmdir(_0x544580);}catch{return;}_0x544580=dirname(_0x544580);}}async function resolveTargetDbBinding(_0x417592,_0x3315d7,_0x272295){const _0x159b54=a254_0x397be5,_0x497f75=_0x3315d7[_0x159b54(0xfc)];if(!_0x497f75)return{'dbId':_0x272295[_0x159b54(0xce)],'dbName':_0x272295[_0x159b54(0xf3)]};const _0x24d3e1=buildDbDirectoryName(_0x272295['dbName'],_0x272295[_0x159b54(0xce)]);if(_0x497f75===_0x24d3e1)return{'dbId':_0x272295['dbId'],'dbName':_0x272295[_0x159b54(0xf3)]};const _0x401833=parseExplicitDbDirectory(_0x497f75);if(_0x401833!=null)return{'dbId':_0x401833,'dbName':await getDbName(_0x417592,_0x401833)[_0x159b54(0x106)](()=>undefined)};const _0x543d3e=await listDatabases(_0x417592),_0x302c3e=_0x543d3e['filter'](_0x5432a1=>buildDbDirectoryName(_0x5432a1['dbName'],_0x5432a1[_0x159b54(0xce)])===_0x497f75);if(_0x302c3e['length']===0x1)return{'dbId':_0x302c3e[0x0][_0x159b54(0xce)],'dbName':_0x302c3e[0x0]['dbName']};if(_0x302c3e[_0x159b54(0xd6)]===0x0)throw CliErrors[_0x159b54(0xf9)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x497f75+'\x22\x20for\x20sqlCode\x20'+_0x3315d7[_0x159b54(0xf7)]+'.');const _0x17f060=_0x302c3e['map'](_0x1cb22b=>_0x1cb22b[_0x159b54(0xf3)]+'\x20('+_0x1cb22b['dbId']+')')['join'](',\x20');throw CliErrors[_0x159b54(0xf9)](_0x159b54(0x104)+_0x497f75+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x3315d7['sqlCode']+':\x20'+_0x17f060);}function parseExplicitDbDirectory(_0x15caa4){const _0xfece3a=a254_0x397be5,_0x292137=/^db-(\d+)$/[_0xfece3a(0xcb)](_0x15caa4);if(!_0x292137)return null;const _0x247f78=Number(_0x292137[0x1]);return Number[_0xfece3a(0xf8)](_0x247f78)&&_0x247f78>0x0?_0x247f78:null;}
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a255_0x30bfa7=a255_0x27b5;(function(_0x39d186,_0x2c8a6c){const _0x495964=a255_0x27b5,_0x46468d=_0x39d186();while(!![]){try{const _0x1cc8d2=-parseInt(_0x495964(0x1ce))/0x1+-parseInt(_0x495964(0x1dd))/0x2+-parseInt(_0x495964(0x1cd))/0x3*(-parseInt(_0x495964(0x1be))/0x4)+-parseInt(_0x495964(0x1d4))/0x5+parseInt(_0x495964(0x1ba))/0x6*(parseInt(_0x495964(0x1b9))/0x7)+-parseInt(_0x495964(0x1db))/0x8*(parseInt(_0x495964(0x1d9))/0x9)+parseInt(_0x495964(0x1cc))/0xa;if(_0x1cc8d2===_0x2c8a6c)break;else _0x46468d['push'](_0x46468d['shift']());}catch(_0x2a13dc){_0x46468d['push'](_0x46468d['shift']());}}}(a255_0x53dc,0xb0acb));import{createInterface}from'node:readline';function a255_0x27b5(_0x49cc54,_0x48d8d2){_0x49cc54=_0x49cc54-0x1b0;const _0x53dc5d=a255_0x53dc();let _0x27b54c=_0x53dc5d[_0x49cc54];return _0x27b54c;}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a255_0x30bfa7(0x1b8);export function buildSqlLockEntry(_0x1cbb99,_0x1e765e,_0x84cb43,_0x62e382){const _0x5e48e4=a255_0x30bfa7,_0x1135c0=detectSqlMode(_0x1e765e);return{'path':buildSqlRelativePath(_0x1cbb99[_0x5e48e4(0x1b1)],_0x1cbb99['sqlName'],_0x62e382?.[_0x5e48e4(0x1d6)],_0x1135c0,_0x1cbb99[_0x5e48e4(0x1c1)]),'hash':_0x84cb43,'remoteId':_0x1cbb99['id'],'version':_0x1cbb99['version'],'dbId':Number(_0x1cbb99[_0x5e48e4(0x1c1)]),'dbName':_0x62e382?.[_0x5e48e4(0x1d6)],'sqlName':_0x1cbb99[_0x5e48e4(0x1d8)],'sqlConfig':_0x1cbb99[_0x5e48e4(0x1c8)]??undefined,'mode':_0x1135c0};}export function cloneSqlLockData(_0x5b9a10){const _0x2c0580=a255_0x30bfa7;return{'apps':Object[_0x2c0580(0x1cf)](Object[_0x2c0580(0x1bc)](_0x5b9a10[_0x2c0580(0x1cb)])['map'](([_0x44297e,_0x57e005])=>[_0x44297e,{'sqlRoot':_0x57e005[_0x2c0580(0x1d5)],'lastSync':_0x57e005[_0x2c0580(0x1c5)],'sqls':{..._0x57e005[_0x2c0580(0x1b2)]}}]))};}export function ensureRemoteSqlContent(_0x5c83df){const _0x122322=a255_0x30bfa7;return _0x5c83df[_0x122322(0x1ca)]??'';}export function buildLocalSqlFileContent(_0x27b942,_0x5bdd30,_0x403287){const _0x1e9d73=a255_0x30bfa7,_0x519e39=_0x403287?.[_0x1e9d73(0x1b7)]??detectSqlMode(_0x5bdd30),_0x1e4fbb=stripLocalSqlMetadata(_0x5bdd30,_0x519e39)[_0x1e9d73(0x1de)](),_0x23ace7=buildMetadataHeaderLines({'sqlCode':_0x27b942['sqlCode'],'sqlName':_0x27b942[_0x1e9d73(0x1d8)],'dbId':_0x27b942[_0x1e9d73(0x1c1)],'dbName':_0x403287?.[_0x1e9d73(0x1d6)],'mode':_0x519e39,'syncedAt':_0x403287?.[_0x1e9d73(0x1da)],'description':_0x403287?.[_0x1e9d73(0x1bf)]},_0x519e39),_0x48df22=_0x519e39===_0x1e9d73(0x1b0)?splitXmlDeclaration(_0x1e4fbb):{'body':_0x1e4fbb},_0x18ae27=[..._0x48df22[_0x1e9d73(0x1b5)]?[_0x48df22[_0x1e9d73(0x1b5)]]:[],..._0x23ace7,'',_0x48df22[_0x1e9d73(0x1c0)]['trimStart']()],_0x53a661=_0x18ae27[_0x1e9d73(0x1b4)]('\x0a');return _0x53a661[_0x1e9d73(0x1b6)]('\x0a')?_0x53a661:_0x53a661+'\x0a';}export function stripLocalSqlMetadata(_0x52ec9e,_0xa93fa9){const _0x5cbfc3=a255_0x30bfa7;if(_0xa93fa9===_0x5cbfc3(0x1b0)){const {declaration:_0x58004b,body:_0x3f5dda}=splitXmlDeclaration(_0x52ec9e[_0x5cbfc3(0x1c4)](/\r\n/g,'\x0a')),_0x58d745=stripLeadingMetadataLines(_0x3f5dda,/^\s*<!--\s*@lovrabet\./);return _0x58004b?''+_0x58004b+(_0x58d745?'\x0a'+_0x58d745:''):_0x58d745;}return stripLeadingMetadataLines(_0x52ec9e[_0x5cbfc3(0x1c4)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x1535f7,_0x748b65){const _0x3b2017=a255_0x30bfa7;if(_0x748b65?.[_0x3b2017(0x1b7)])return _0x748b65[_0x3b2017(0x1b7)];return detectSqlMode(_0x1535f7);}export function resolveSqlFileName(_0x2c71a7,_0x3b39a6,_0x16ec0b){const _0x22a4b3=a255_0x30bfa7;if(_0x16ec0b?.[_0x22a4b3(0x1bb)])return _0x16ec0b[_0x22a4b3(0x1bb)];if(_0x16ec0b?.[_0x22a4b3(0x1d8)]||_0x16ec0b?.[_0x22a4b3(0x1d6)])return buildSqlRelativePath(_0x2c71a7,_0x16ec0b?.[_0x22a4b3(0x1d8)],_0x16ec0b?.['dbName'],resolveSqlMode(_0x3b39a6,_0x16ec0b),_0x16ec0b?.['dbId']);return buildDefaultSqlFileName(_0x2c71a7,resolveSqlMode(_0x3b39a6,_0x16ec0b));}export function resolveSqlLocalDir(_0x5089ca,_0xcd0927){return join(_0x5089ca,SQL_LOCAL_REL_DIR,_0xcd0927);}function a255_0x53dc(){const _0x30e67b=['sqlName','63npXGNg','syncedAt','1441576SrUXPZ','slice','1382532jKmzUe','trim','\x20-->','mybatisXml','sqlCode','sqls','stderr','join','declaration','endsWith','mode','.rabetbase/sql','7rgsXQP','5781654tUQIVj','path','entries','map','24HJEIFh','description','body','dbId','test','length','replace','lastSync','close','question','sqlConfig','<!--\x20@lovrabet.','sqlContent','apps','22968000CDHVos','389967lKmwar','1274794NxHgMR','fromEntries','filter','\x20[y/N]\x20','trimStart','--\x20@lovrabet.','446225sMlJWv','sqlRoot','dbName','includes'];a255_0x53dc=function(){return _0x30e67b;};return a255_0x53dc();}export async function confirmForceOverwrite(_0x71da54){const _0x2fdfb9=a255_0x30bfa7,_0x367e2c=createInterface({'input':process['stdin'],'output':process[_0x2fdfb9(0x1b3)]}),_0x52598d=await new Promise(_0x5715ca=>{const _0x5cb4cf=_0x2fdfb9;_0x367e2c[_0x5cb4cf(0x1c7)](_0x71da54+_0x5cb4cf(0x1d1),_0x5715ca);});return _0x367e2c[_0x2fdfb9(0x1c6)](),['y','yes'][_0x2fdfb9(0x1d7)](_0x52598d[_0x2fdfb9(0x1de)]()['toLowerCase']());}export function findSqlLockScope(_0x370a91,_0x21fb85){const _0x4c5e37=a255_0x30bfa7;return _0x370a91[_0x4c5e37(0x1cb)][_0x21fb85];}function buildMetadataHeaderLines(_0x382eb0,_0x217b38){const _0x4c32d5=a255_0x30bfa7,_0x1f49b9=[[_0x4c32d5(0x1b1),_0x382eb0[_0x4c32d5(0x1b1)]],[_0x4c32d5(0x1d8),_0x382eb0[_0x4c32d5(0x1d8)]],['dbId',_0x382eb0[_0x4c32d5(0x1c1)]],['dbName',_0x382eb0['dbName']],[_0x4c32d5(0x1b7),_0x382eb0[_0x4c32d5(0x1b7)]],[_0x4c32d5(0x1da),_0x382eb0[_0x4c32d5(0x1da)]],[_0x4c32d5(0x1bf),_0x382eb0[_0x4c32d5(0x1bf)]]];if(_0x217b38===_0x4c32d5(0x1b0))return _0x1f49b9[_0x4c32d5(0x1d0)](([,_0x346872])=>_0x346872!==undefined&&_0x346872!==null&&String(_0x346872)[_0x4c32d5(0x1de)]()!=='')['map'](([_0x21df65,_0x53e155])=>_0x4c32d5(0x1c9)+_0x21df65+':\x20'+String(_0x53e155)+_0x4c32d5(0x1df));return _0x1f49b9['filter'](([,_0xee9434])=>_0xee9434!==undefined&&_0xee9434!==null&&String(_0xee9434)['trim']()!=='')[_0x4c32d5(0x1bd)](([_0x79de75,_0x5be35d])=>_0x4c32d5(0x1d3)+_0x79de75+':\x20'+String(_0x5be35d));}function splitXmlDeclaration(_0x317e82){const _0x5bf9b6=a255_0x30bfa7,_0x4b44f3=_0x317e82[_0x5bf9b6(0x1d2)](),_0x2829c5=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i['exec'](_0x4b44f3);if(!_0x2829c5)return{'body':_0x317e82};return{'declaration':_0x2829c5[0x0],'body':_0x4b44f3[_0x5bf9b6(0x1dc)](_0x2829c5[0x0][_0x5bf9b6(0x1c3)])};}function stripLeadingMetadataLines(_0xf8f4df,_0x44b924){const _0x3813ec=a255_0x30bfa7,_0x45a319=_0xf8f4df['split']('\x0a');let _0x142af6=0x0;while(_0x142af6<_0x45a319[_0x3813ec(0x1c3)]){const _0x7b76e9=_0x45a319[_0x142af6]??'';if(_0x44b924[_0x3813ec(0x1c2)](_0x7b76e9)||_0x7b76e9[_0x3813ec(0x1de)]()===''){_0x142af6++;continue;}break;}return _0x45a319[_0x3813ec(0x1dc)](_0x142af6)[_0x3813ec(0x1b4)]('\x0a')[_0x3813ec(0x1d2)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a256_0x268df8=a256_0x3e62;(function(_0x48ce4d,_0x5775d3){const _0x17c310=a256_0x3e62,_0x2aa83b=_0x48ce4d();while(!![]){try{const _0x13fd93=parseInt(_0x17c310(0x128))/0x1+parseInt(_0x17c310(0x119))/0x2*(parseInt(_0x17c310(0x124))/0x3)+-parseInt(_0x17c310(0x130))/0x4*(parseInt(_0x17c310(0x125))/0x5)+-parseInt(_0x17c310(0x117))/0x6+parseInt(_0x17c310(0x12e))/0x7+parseInt(_0x17c310(0x114))/0x8+-parseInt(_0x17c310(0x122))/0x9;if(_0x13fd93===_0x5775d3)break;else _0x2aa83b['push'](_0x2aa83b['shift']());}catch(_0x222603){_0x2aa83b['push'](_0x2aa83b['shift']());}}}(a256_0x1777,0xb1019));import{listSqlQueries}from'../../core/api-client.js';function a256_0x3e62(_0x223ffb,_0x535147){_0x223ffb=_0x223ffb-0x112;const _0x17775d=a256_0x1777();let _0x3e62ce=_0x17775d[_0x223ffb];return _0x3e62ce;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a256_0x1777(){const _0x37f05e=['1046735ejFFvL','path','length','111234KldrjS','remote','appCode','sqlRoot','paging','lockKey','2882607szCrzB','tableData','4VANsfI','All\x20SQL\x20queries\x20are\x20in\x20sync.','bool','sqlCode','10290336udjNdE','sqlName','relativePath','6240222uylyPI','push','2NVaSOt','sql','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','totalCount','keys','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','read','has','filePath','11277585LZnOLb','sqls','4254417ShFcvN'];a256_0x1777=function(){return _0x37f05e;};return a256_0x1777();}async function fetchAllSqlCodes(_0xa0a38b){const _0x2d45be=a256_0x3e62,_0x4db0a5=[];let _0x4806da=0x1;while(!![]){const _0x2c1c20=await listSqlQueries(_0xa0a38b,{'currentPage':_0x4806da,'pageSize':PAGE_SIZE}),_0x341e37=_0x2c1c20[_0x2d45be(0x12f)]??[];_0x4db0a5[_0x2d45be(0x118)](..._0x341e37['map'](_0x5d1516=>_0x5d1516[_0x2d45be(0x113)]));if(_0x341e37[_0x2d45be(0x127)]===0x0)break;const _0x2e7be8=_0x2c1c20[_0x2d45be(0x12c)]?.[_0x2d45be(0x11c)];if(_0x2e7be8!=null?_0x4db0a5[_0x2d45be(0x127)]>=_0x2e7be8:_0x341e37['length']<PAGE_SIZE)break;_0x4806da++;}return _0x4db0a5;}export const sqlStatus={'service':a256_0x268df8(0x11a),'command':'status','description':a256_0x268df8(0x11e),'risk':a256_0x268df8(0x11f),'flags':[{'name':'remote','type':'boolean','description':a256_0x268df8(0x11b)}],async 'execute'(_0xb25f62){const _0x4e6577=a256_0x268df8,_0x9e1369=loadSqlProjectConfig(_0xb25f62[_0x4e6577(0x12a)]),_0x4afa33=await readSqlLockFile(_0x9e1369['lockFilePath']),{appLock:_0x288c00}=ensureSqlLockScope(_0x4afa33??createEmptySqlLock(),_0x9e1369['appCode'],_0x9e1369[_0x4e6577(0x12b)],'status'),_0x456440=await scanLocalSqlQueries(_0x9e1369),_0x3e188e=[],_0xff25c2=[],_0x5896fd=[],_0x4beb96=[],_0xe1dad9=new Set(_0x456440['map'](_0x3b514d=>_0x3b514d['lockKey']));for(const _0xd1b2fb of _0x456440){const _0x33bb3b=await computeSqlFileHash(_0xd1b2fb[_0x4e6577(0x121)]),_0x528db8=_0x288c00[_0x4e6577(0x123)][_0xd1b2fb['lockKey']],_0x468027=!!_0x528db8&&_0x528db8[_0x4e6577(0x126)]!==_0xd1b2fb[_0x4e6577(0x116)],_0x2bbaaa=!!_0x528db8&&!!_0xd1b2fb['sqlName']&&_0x528db8[_0x4e6577(0x115)]!==_0xd1b2fb[_0x4e6577(0x115)];if(!_0x528db8)_0x3e188e[_0x4e6577(0x118)](_0xd1b2fb[_0x4e6577(0x12d)]);else _0x528db8['hash']!==_0x33bb3b||_0x468027||_0x2bbaaa?_0xff25c2[_0x4e6577(0x118)](_0xd1b2fb[_0x4e6577(0x12d)]):_0x5896fd[_0x4e6577(0x118)](_0xd1b2fb[_0x4e6577(0x12d)]);}for(const _0x4dbe58 of Object[_0x4e6577(0x11d)](_0x288c00['sqls'])){!_0xe1dad9[_0x4e6577(0x120)](_0x4dbe58)&&_0x4beb96[_0x4e6577(0x118)](_0x4dbe58);}const _0x362918=[];if(_0xb25f62[_0x4e6577(0x112)](_0x4e6577(0x129))){const _0xb14373=await fetchAllSqlCodes(_0xb25f62[_0x4e6577(0x12a)]);for(const _0x38659b of _0xb14373){!_0xe1dad9[_0x4e6577(0x120)](_0x38659b)&&!_0x288c00[_0x4e6577(0x123)][_0x38659b]&&_0x362918[_0x4e6577(0x118)](_0x38659b);}}const _0x23df04=_0x3e188e[_0x4e6577(0x127)]===0x0&&_0xff25c2[_0x4e6577(0x127)]===0x0&&_0x4beb96[_0x4e6577(0x127)]===0x0&&_0x362918[_0x4e6577(0x127)]===0x0;return{'ok':!![],'data':{'added':_0x3e188e,'modified':_0xff25c2,'missing':_0x4beb96,'unchanged':_0x5896fd,'remoteOnly':_0x362918},'message':_0x23df04?_0x4e6577(0x131):_0x3e188e[_0x4e6577(0x127)]+'\x20added,\x20'+_0xff25c2[_0x4e6577(0x127)]+'\x20modified,\x20'+_0x4beb96[_0x4e6577(0x127)]+'\x20missing,\x20'+_0x5896fd[_0x4e6577(0x127)]+'\x20unchanged'+(_0x362918['length']>0x0?',\x20'+_0x362918[_0x4e6577(0x127)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a257_0x19f917=a257_0x4ed8;(function(_0x51f46a,_0x417e7d){const _0x4023e1=a257_0x4ed8,_0x50a986=_0x51f46a();while(!![]){try{const _0x19cbdf=-parseInt(_0x4023e1(0x15c))/0x1+-parseInt(_0x4023e1(0x123))/0x2+-parseInt(_0x4023e1(0x163))/0x3*(-parseInt(_0x4023e1(0x14b))/0x4)+parseInt(_0x4023e1(0x147))/0x5*(parseInt(_0x4023e1(0x149))/0x6)+parseInt(_0x4023e1(0x125))/0x7+parseInt(_0x4023e1(0x139))/0x8*(-parseInt(_0x4023e1(0x159))/0x9)+parseInt(_0x4023e1(0x14c))/0xa;if(_0x19cbdf===_0x417e7d)break;else _0x50a986['push'](_0x50a986['shift']());}catch(_0x3f9f1f){_0x50a986['push'](_0x50a986['shift']());}}}(a257_0x5bb2,0xc5691));import{readFileSync,existsSync}from'node:fs';function a257_0x4ed8(_0x4f104a,_0x3de7d7){_0x4f104a=_0x4f104a-0x122;const _0x5bb237=a257_0x5bb2();let _0x4ed8ab=_0x5bb237[_0x4f104a];return _0x4ed8ab;}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';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a257_0x19f917(0x14d),'command':'validate','description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a257_0x19f917(0x140),'flags':[{'name':a257_0x19f917(0x13d),'type':a257_0x19f917(0x143),'description':a257_0x19f917(0x151)},{'name':a257_0x19f917(0x14d),'type':a257_0x19f917(0x143),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a257_0x19f917(0x136),'type':a257_0x19f917(0x143),'description':a257_0x19f917(0x13e)},{'name':'check-indexes','type':a257_0x19f917(0x14e),'description':a257_0x19f917(0x122)}],async 'execute'(_0xc8c824){const _0xd6b805=a257_0x19f917,_0x53ba80=_0xc8c824[_0xd6b805(0x153)](_0xd6b805(0x13d)),_0x56bcbf=_0xc8c824['str']('sql'),_0x568a70=_0xc8c824[_0xd6b805(0x153)]('schemas'),_0x448c3b=_0xc8c824[_0xd6b805(0x15a)](_0xd6b805(0x142));if(!_0x53ba80&&!_0x56bcbf)throw CliErrors['flagMissing'](_0xd6b805(0x13d),_0xd6b805(0x150));if(_0x448c3b&&!_0x568a70)throw CliErrors[_0xd6b805(0x155)](_0xd6b805(0x12c));let _0x156545;if(_0x53ba80){const _0x464a55=resolve(process[_0xd6b805(0x164)](),_0x53ba80);if(!existsSync(_0x464a55))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x464a55);_0x156545=readFileSync(_0x464a55,_0xd6b805(0x13c));}else _0x156545=_0x56bcbf;const _0x1539d2=validateSql(_0x156545),_0x4cf445={'valid':_0x1539d2['valid'],'sqlType':_0x1539d2[_0xd6b805(0x134)]['type'],'isSelectOnly':_0x1539d2[_0xd6b805(0x134)]['isSelectOnly'],'isLockingRead':_0x1539d2[_0xd6b805(0x134)][_0xd6b805(0x124)]??![],'isDangerous':_0x1539d2[_0xd6b805(0x134)][_0xd6b805(0x127)],'tables':_0x1539d2[_0xd6b805(0x12f)],'parameters':_0x1539d2[_0xd6b805(0x15b)],'message':_0x1539d2[_0xd6b805(0x15d)]};_0x1539d2[_0xd6b805(0x134)][_0xd6b805(0x132)]&&(_0x4cf445[_0xd6b805(0x132)]=_0x1539d2[_0xd6b805(0x134)]['reason']);if(_0x568a70&&_0x1539d2[_0xd6b805(0x137)]){const _0x45089c=_0x568a70[_0xd6b805(0x148)](',')['map'](_0x277322=>_0x277322[_0xd6b805(0x13a)]())[_0xd6b805(0x141)](Boolean),_0x1e919f=[],_0x38ad7b=[],_0x4238b6=filterDbTableBackedDatasets(await listDatasets(_0xc8c824[_0xd6b805(0x12a)])),_0x4cfe03=new Map(_0x4238b6['map'](_0x465978=>[_0x465978[_0xd6b805(0x133)]?.[_0xd6b805(0x157)]?.['toLowerCase'](),_0x465978]));for(const _0x361e1d of _0x1539d2[_0xd6b805(0x12f)]){const _0x2e5d23=_0x4cfe03[_0xd6b805(0x138)](_0x361e1d[_0xd6b805(0x161)]());!_0x2e5d23&&_0x1e919f['push']('Table\x20\x22'+_0x361e1d+_0xd6b805(0x131));}for(const _0x379b08 of _0x45089c){let _0x1deccd;try{_0x1deccd=await getDatasetDetail(_0x379b08);}catch{_0x1e919f[_0xd6b805(0x146)](_0xd6b805(0x162)+_0x379b08+_0xd6b805(0x12e));continue;}assertDatasetIsDbTableBacked(_0x1deccd,_0xd6b805(0x129));const _0x2db4ae=Array[_0xd6b805(0x144)](_0x1deccd[_0xd6b805(0x14f)])?_0x1deccd[_0xd6b805(0x14f)]:[],_0x19f4c3=new Set(_0x2db4ae[_0xd6b805(0x13f)](_0x3fd46a=>_0x3fd46a[_0xd6b805(0x158)]?.[_0xd6b805(0x161)]())),_0x142aa5=_0x1deccd[_0xd6b805(0x133)]?.[_0xd6b805(0x157)]||_0x1deccd[_0xd6b805(0x157)]||_0x379b08;_0x4cf445[_0xd6b805(0x12b)+_0x142aa5]={'code':_0x379b08,'tableName':_0x142aa5,'fieldCount':_0x19f4c3[_0xd6b805(0x128)],'fields':Array[_0xd6b805(0x126)](_0x19f4c3)};if(_0x448c3b){const _0x13d44f=normalizeDatasetIndexes(_0x1deccd);_0x38ad7b[_0xd6b805(0x146)]({'tableName':_0x142aa5,..._0x13d44f});}}_0x1e919f[_0xd6b805(0x145)]>0x0&&(_0x4cf445['schemaWarnings']=_0x1e919f),_0x448c3b&&(_0x4cf445[_0xd6b805(0x13b)]=auditSqlJoinIndexes(_0x156545,_0x38ad7b));}return{'ok':_0x1539d2['valid'],'data':_0x4cf445,'message':_0x1539d2['message']};}};function a257_0x5bb2(){const _0x3f027d=['index_type','schemas','valid','get','2641576rHscnv','trim','joinAudit','utf-8','file','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','map','read','filter','check-indexes','string','isArray','length','push','20ZyPgnS','split','28878NBUsqW','columns','116Wccvym','17004020FVbDYY','sql','boolean','fields','Provide\x20--file\x20or\x20--sql','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','find','str','columnNames','validation','type','tableName','name','27RPmaEA','bool','parameters','36967hIBODI','message','index_columns','dataset','indexName','toLowerCase','Dataset\x20\x22','31821ZULvdW','cwd','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','2836726laKbdn','isLockingRead','8590799CUKxAB','from','isDangerous','size','SQL\x20schema\x20validation','appCode','schema:','--check-indexes\x20requires\x20--schemas.','indexes','\x22\x20not\x20found\x20or\x20not\x20accessible','tables','pkField','\x22\x20not\x20found\x20in\x20any\x20dataset','reason','dbtableConfig','sqlType'];a257_0x5bb2=function(){return _0x3f027d;};return a257_0x5bb2();}function normalizeDatasetIndexes(_0x5c46f4){const _0xe93bb4=a257_0x19f917,_0xd325bb=Array[_0xe93bb4(0x144)](_0x5c46f4?.[_0xe93bb4(0x15f)]?.['indexes'])?_0x5c46f4[_0xe93bb4(0x15f)][_0xe93bb4(0x12d)]:Array[_0xe93bb4(0x144)](_0x5c46f4?.['indexes'])?_0x5c46f4[_0xe93bb4(0x12d)]:[],_0x133c4f=_0xd325bb['flatMap'](_0x772ca0=>{const _0x4af7ad=_0xe93bb4,_0x44624b=Array[_0x4af7ad(0x144)](_0x772ca0?.[_0x4af7ad(0x15e)])?_0x772ca0['index_columns']:Array[_0x4af7ad(0x144)](_0x772ca0?.[_0x4af7ad(0x154)])?_0x772ca0[_0x4af7ad(0x154)]:Array[_0x4af7ad(0x144)](_0x772ca0?.[_0x4af7ad(0x14a)])?_0x772ca0[_0x4af7ad(0x14a)]:[],_0x135580=_0x44624b[_0x4af7ad(0x141)](_0x2ebab9=>typeof _0x2ebab9==='string')[_0x4af7ad(0x13f)](_0x3115ff=>_0x3115ff[_0x4af7ad(0x13a)]())[_0x4af7ad(0x141)](Boolean);if(_0x135580[_0x4af7ad(0x145)]===0x0)return[];const _0x481225=[_0x772ca0?.[_0x4af7ad(0x160)],_0x772ca0?.['index_name'],_0x772ca0?.[_0x4af7ad(0x158)]][_0x4af7ad(0x152)](_0x21343f=>typeof _0x21343f==='string'&&_0x21343f[_0x4af7ad(0x13a)]()),_0x458568=[_0x772ca0?.[_0x4af7ad(0x135)],_0x772ca0?.[_0x4af7ad(0x156)]][_0x4af7ad(0x152)](_0x56cd8b=>typeof _0x56cd8b===_0x4af7ad(0x143)&&_0x56cd8b[_0x4af7ad(0x13a)]());return[{..._0x481225?{'name':_0x481225[_0x4af7ad(0x13a)]()}:{},..._0x458568?{'type':_0x458568['trim']()}:{},'columns':_0x135580}];}),_0x401cee=[..._0x133c4f],_0x24ecb2=typeof _0x5c46f4?.['dbtableConfig']?.['pkField']===_0xe93bb4(0x143)?_0x5c46f4[_0xe93bb4(0x133)][_0xe93bb4(0x130)][_0xe93bb4(0x148)](',')[_0xe93bb4(0x13f)](_0x2f27fb=>_0x2f27fb[_0xe93bb4(0x13a)]())[_0xe93bb4(0x141)](Boolean):[];return _0x24ecb2[_0xe93bb4(0x145)]>0x0&&_0x401cee['unshift']({'type':'primary','columns':_0x24ecb2}),{'indexes':_0x401cee,'metadataAvailable':_0x133c4f[_0xe93bb4(0x145)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5adce5,_0x20bfd8){const _0x42664f=a258_0x4291,_0x41c2db=_0x5adce5();while(!![]){try{const _0x4a7435=parseInt(_0x42664f(0xf3))/0x1*(parseInt(_0x42664f(0xf5))/0x2)+parseInt(_0x42664f(0xf0))/0x3+-parseInt(_0x42664f(0xf9))/0x4+-parseInt(_0x42664f(0xf7))/0x5+-parseInt(_0x42664f(0xf6))/0x6*(-parseInt(_0x42664f(0xf8))/0x7)+parseInt(_0x42664f(0xf4))/0x8*(-parseInt(_0x42664f(0xf2))/0x9)+parseInt(_0x42664f(0xf1))/0xa;if(_0x4a7435===_0x20bfd8)break;else _0x41c2db['push'](_0x41c2db['shift']());}catch(_0x2ae192){_0x41c2db['push'](_0x41c2db['shift']());}}}(a258_0x36cb,0x609c3));function a258_0x4291(_0x33b561,_0x2aacca){_0x33b561=_0x33b561-0xf0;const _0x36cbb2=a258_0x36cb();let _0x42913f=_0x36cbb2[_0x33b561];return _0x42913f;}import{taskStatus}from'../../commands/task/status.js';function a258_0x36cb(){const _0x3f2ebe=['653890pbJjxp','10052wIVwdH','969540AZOIRN','1160313CNaRbg','3562410JxsKWn','5492646bPwNxR','1090widStm','8naUVca','996daPRji','390dytQmm'];a258_0x36cb=function(){return _0x3f2ebe;};return a258_0x36cb();}export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a259_0x4d8f(_0x41a411,_0x2e807c){_0x41a411=_0x41a411-0x183;const _0x61e19b=a259_0x61e1();let _0x4d8fb2=_0x61e19b[_0x41a411];return _0x4d8fb2;}function a259_0x61e1(){const _0x14dcb5=['isTerminal',',\x20received\x20','flagMissing','cookie','2607600gMxfNh','203495ePHHkH','appCode','7MrfYKf','task-id','string','task','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','compress','status','3647274jGzFXX','1297344IpGaCr','3617332mdErxG','trim','9HpuIbp','28971MgqWPP','read','str','9480424fDwyew','taskId'];a259_0x61e1=function(){return _0x14dcb5;};return a259_0x61e1();}const a259_0x42ebeb=a259_0x4d8f;(function(_0x5ae71b,_0x5f47bc){const _0x24d403=a259_0x4d8f,_0x436dd4=_0x5ae71b();while(!![]){try{const _0x536fbc=-parseInt(_0x24d403(0x193))/0x1+-parseInt(_0x24d403(0x18f))/0x2+parseInt(_0x24d403(0x19c))/0x3+parseInt(_0x24d403(0x190))/0x4+-parseInt(_0x24d403(0x183))/0x5+parseInt(_0x24d403(0x18e))/0x6*(parseInt(_0x24d403(0x185))/0x7)+parseInt(_0x24d403(0x196))/0x8*(-parseInt(_0x24d403(0x192))/0x9);if(_0x536fbc===_0x5f47bc)break;else _0x436dd4['push'](_0x436dd4['shift']());}catch(_0x3c96a7){_0x436dd4['push'](_0x436dd4['shift']());}}}(a259_0x61e1,0x74b41));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';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a259_0x42ebeb(0x188),'command':a259_0x42ebeb(0x18d),'description':a259_0x42ebeb(0x18a),'risk':a259_0x42ebeb(0x194),'defaultOutputFormat':a259_0x42ebeb(0x18c),'structuredErrors':!![],'flags':[{'name':a259_0x42ebeb(0x186),'type':a259_0x42ebeb(0x187),'required':!![],'description':a259_0x42ebeb(0x189)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5187ba){const _0x434cb7=a259_0x42ebeb;if(!_0x5187ba[_0x434cb7(0x195)](_0x434cb7(0x186))['trim']())throw CliErrors[_0x434cb7(0x19a)](_0x434cb7(0x186));},async 'execute'(_0x2eed7c){const _0x4c4cd4=a259_0x42ebeb,_0x1172a9=_0x2eed7c['str'](_0x4c4cd4(0x186))[_0x4c4cd4(0x191)](),_0x1b5a90=normalizeAsyncTask(await getAsyncTaskStatus(_0x1172a9,_0x2eed7c[_0x4c4cd4(0x184)],_0x2eed7c[_0x4c4cd4(0x19b)]));if(_0x1b5a90['taskId']!==_0x1172a9)throw CliErrors['apiError'](_0x4c4cd4(0x18b)+_0x1172a9+_0x4c4cd4(0x199)+_0x1b5a90[_0x4c4cd4(0x197)]+'.');const _0x111cc9=buildAsyncTaskStatusCommand(_0x1b5a90[_0x4c4cd4(0x197)],_0x2eed7c[_0x4c4cd4(0x184)]);return{'ok':!![],'message':asyncTaskMessage(_0x1b5a90),'data':{'appCode':_0x2eed7c['appCode'],..._0x1b5a90,'query':_0x1b5a90[_0x4c4cd4(0x198)]?null:{'command':_0x111cc9}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a260_0x5ba3(_0x530839,_0x383ef7){_0x530839=_0x530839-0x1e6;const _0x5bebf4=a260_0x5beb();let _0x5ba3c3=_0x5bebf4[_0x530839];return _0x5ba3c3;}(function(_0xfbcd5e,_0x4d7e9e){const _0x40a4f2=a260_0x5ba3,_0x1a316c=_0xfbcd5e();while(!![]){try{const _0x291bcf=parseInt(_0x40a4f2(0x1ee))/0x1*(-parseInt(_0x40a4f2(0x1e7))/0x2)+parseInt(_0x40a4f2(0x1e9))/0x3+-parseInt(_0x40a4f2(0x1ef))/0x4*(parseInt(_0x40a4f2(0x1e6))/0x5)+parseInt(_0x40a4f2(0x1ec))/0x6+-parseInt(_0x40a4f2(0x1ea))/0x7+-parseInt(_0x40a4f2(0x1eb))/0x8*(-parseInt(_0x40a4f2(0x1ed))/0x9)+parseInt(_0x40a4f2(0x1e8))/0xa;if(_0x291bcf===_0x4d7e9e)break;else _0x1a316c['push'](_0x1a316c['shift']());}catch(_0x545ae0){_0x1a316c['push'](_0x1a316c['shift']());}}}(a260_0x5beb,0x19707));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a260_0x5beb(){const _0x4eea39=['4SxqdhQ','262835FtekkG','4fWZQJV','1620600fmujKA','200253jrmwzG','1254106ztHnLj','132832wcAcaE','149382cZhsDm','63JXLTBG','17006IHzTXg'];a260_0x5beb=function(){return _0x4eea39;};return a260_0x5beb();}export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a261_0xd56f49=a261_0x2233;function a261_0x2233(_0x1bd6b4,_0x32028a){_0x1bd6b4=_0x1bd6b4-0x15e;const _0xf82a92=a261_0xf82a();let _0x223380=_0xf82a92[_0x1bd6b4];return _0x223380;}(function(_0x15bb25,_0x130546){const _0x100e72=a261_0x2233,_0x5cd4dd=_0x15bb25();while(!![]){try{const _0x3e7098=-parseInt(_0x100e72(0x160))/0x1+parseInt(_0x100e72(0x16c))/0x2+-parseInt(_0x100e72(0x15f))/0x3+parseInt(_0x100e72(0x15e))/0x4+parseInt(_0x100e72(0x168))/0x5+parseInt(_0x100e72(0x169))/0x6+parseInt(_0x100e72(0x162))/0x7;if(_0x3e7098===_0x130546)break;else _0x5cd4dd['push'](_0x5cd4dd['shift']());}catch(_0x3923db){_0x5cd4dd['push'](_0x5cd4dd['shift']());}}}(a261_0xf82a,0xa9eb1));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a261_0xf82a(){const _0x47316b=['Pass\x20--tenant-code\x20<code>.','members-list','str','tenant-code','4572100hJLylF','188340rtlupe','trim','flagMissing','1325746oJzrho','length','string','\x20tenant\x20member(s)','read','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','Exact\x20tenant\x20code','1417444jtZKTq','3751671bEunnf','67559qVzqVS','Found\x20','357399stThcd','tenant'];a261_0xf82a=function(){return _0x47316b;};return a261_0xf82a();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a261_0xd56f49(0x163),'command':a261_0xd56f49(0x165),'description':a261_0xd56f49(0x171),'risk':a261_0xd56f49(0x170),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a261_0xd56f49(0x167),'type':a261_0xd56f49(0x16e),'required':!![],'description':a261_0xd56f49(0x172)}],async 'validate'(_0x497587){const _0x4e9115=a261_0xd56f49;if(!_0x497587[_0x4e9115(0x166)](_0x4e9115(0x167))['trim']())throw CliErrors[_0x4e9115(0x16b)](_0x4e9115(0x167),_0x4e9115(0x164));},async 'execute'(_0x49b512){const _0x47138c=a261_0xd56f49,_0x3e2bfc=_0x49b512[_0x47138c(0x166)](_0x47138c(0x167))[_0x47138c(0x16a)](),_0x22fe10=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x3e2bfc,_0x22fe10);const _0x31a94b=projectTenantMembers(await listTenantDirectoryMembers(_0x3e2bfc));return{'ok':!![],'data':{'tenantCode':_0x3e2bfc,'items':_0x31a94b,'totalCount':_0x31a94b[_0x47138c(0x16d)]},'message':_0x47138c(0x161)+_0x31a94b[_0x47138c(0x16d)]+_0x47138c(0x16f)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e90b5,_0x4a37ea){const _0xdf3d6e=a262_0xf194,_0x2b50ad=_0x3e90b5();while(!![]){try{const _0x251876=-parseInt(_0xdf3d6e(0x175))/0x1*(-parseInt(_0xdf3d6e(0x17c))/0x2)+-parseInt(_0xdf3d6e(0x181))/0x3*(parseInt(_0xdf3d6e(0x178))/0x4)+parseInt(_0xdf3d6e(0x186))/0x5+-parseInt(_0xdf3d6e(0x182))/0x6+-parseInt(_0xdf3d6e(0x174))/0x7*(-parseInt(_0xdf3d6e(0x179))/0x8)+-parseInt(_0xdf3d6e(0x17e))/0x9*(-parseInt(_0xdf3d6e(0x18a))/0xa)+parseInt(_0xdf3d6e(0x16e))/0xb*(parseInt(_0xdf3d6e(0x16f))/0xc);if(_0x251876===_0x4a37ea)break;else _0x2b50ad['push'](_0x2b50ad['shift']());}catch(_0x3d368){_0x2b50ad['push'](_0x2b50ad['shift']());}}}(a262_0x31fc,0x31012));function a262_0xf194(_0x54cf06,_0x4f79a9){_0x54cf06=_0x54cf06-0x16c;const _0x31fcf9=a262_0x31fc();let _0xf194c3=_0x31fcf9[_0x54cf06];return _0xf194c3;}import{CliErrors}from'../../errors.js';function textOrNull(_0x14fd66){const _0x2bea17=a262_0xf194,_0x28266f=_0x14fd66?.[_0x2bea17(0x17f)]();return _0x28266f?_0x28266f:null;}export function projectTenantMembers(_0x3c75d8){const _0x3cd3a4=a262_0xf194,_0x2ef963=new Map();for(const _0x3570d7 of _0x3c75d8){const _0x2ac457=Number(_0x3570d7['userId']);if(!Number[_0x3cd3a4(0x170)](_0x2ac457)||_0x2ac457<=0x0)continue;const _0x4d4864={'userId':_0x2ac457,'username':textOrNull(_0x3570d7[_0x3cd3a4(0x177)]),'displayName':textOrNull(_0x3570d7[_0x3cd3a4(0x16c)]),'role':_0x3570d7[_0x3cd3a4(0x183)]===!![]?'ADMIN':_0x3cd3a4(0x188),'status':textOrNull(_0x3570d7['status'])},_0x5f5db3=_0x2ef963['get'](_0x2ac457);if(!_0x5f5db3){_0x2ef963[_0x3cd3a4(0x173)](_0x2ac457,_0x4d4864);continue;}_0x5f5db3[_0x3cd3a4(0x177)]??=_0x4d4864[_0x3cd3a4(0x177)],_0x5f5db3[_0x3cd3a4(0x184)]??=_0x4d4864[_0x3cd3a4(0x184)],_0x5f5db3[_0x3cd3a4(0x17b)]??=_0x4d4864[_0x3cd3a4(0x17b)];if(_0x4d4864['role']===_0x3cd3a4(0x17d))_0x5f5db3[_0x3cd3a4(0x171)]='ADMIN';}return[..._0x2ef963[_0x3cd3a4(0x176)]()][_0x3cd3a4(0x189)]((_0x394be3,_0x5c707c)=>_0x394be3[_0x3cd3a4(0x180)]-_0x5c707c['userId']);}function a262_0x31fc(){const _0xd5fe29=['1862311SJlybR','12ySAujy','isFinite','role','tenantCode','set','581BLMrhi','82913ABAouo','values','username','4PzSLCJ','7016yADpbD','Tenant\x20\x22','status','2CvefTH','ADMIN','2621790makoiU','trim','userId','1149468PcfAPY','1611834uFSRWb','adminFlag','displayName','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','1181010IXYQSi','validation','MEMBER','sort','10zVfpbU','nickname','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.'];a262_0x31fc=function(){return _0xd5fe29;};return a262_0x31fc();}export function assertTenantAccessible(_0x104734,_0xc67b06){const _0x5284c8=a262_0xf194;if(_0xc67b06['some'](_0x2a5241=>_0x2a5241[_0x5284c8(0x172)]===_0x104734))return;throw CliErrors[_0x5284c8(0x187)](_0x5284c8(0x17a)+_0x104734+_0x5284c8(0x185),_0x5284c8(0x16d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a263_0x4bfaa0=a263_0x3e11;(function(_0x95b419,_0x4a1754){const _0x51e5e3=a263_0x3e11,_0x586a64=_0x95b419();while(!![]){try{const _0x22ce77=parseInt(_0x51e5e3(0x15b))/0x1+parseInt(_0x51e5e3(0x15c))/0x2*(parseInt(_0x51e5e3(0x155))/0x3)+-parseInt(_0x51e5e3(0x151))/0x4+parseInt(_0x51e5e3(0x157))/0x5*(parseInt(_0x51e5e3(0x145))/0x6)+-parseInt(_0x51e5e3(0x14a))/0x7*(-parseInt(_0x51e5e3(0x159))/0x8)+-parseInt(_0x51e5e3(0x149))/0x9+parseInt(_0x51e5e3(0x144))/0xa*(-parseInt(_0x51e5e3(0x14e))/0xb);if(_0x22ce77===_0x4a1754)break;else _0x586a64['push'](_0x586a64['shift']());}catch(_0x2cd395){_0x586a64['push'](_0x586a64['shift']());}}}(a263_0x1cb0,0x24960));function a263_0x3e11(_0x2929b9,_0x3fce27){_0x2929b9=_0x2929b9-0x143;const _0x1cb0cf=a263_0x1cb0();let _0x3e117a=_0x1cb0cf[_0x2929b9];return _0x3e117a;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a263_0x1cb0(){const _0x300377=['ding-talk-user-id','750352scJEhR','bind','apiError','trim','708mFCnug','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','15QBoCpq','POST','48dIThkn','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','133891PsjupE','624seSXHx','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','str','--ding-talk-user-id\x20cannot\x20be\x20empty.','write','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','140UvkMDK','561276ZTmESj','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','dingtalk','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','544059jilJjG','156268SQqriP','dingding-sandbox-bind','user-account','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','176165vuUTsX','string'];a263_0x1cb0=function(){return _0x300377;};return a263_0x1cb0();}import{CliErrors}from'../../errors.js';const PROVIDER_ID=a263_0x4bfaa0(0x147),CURRENT_BINDING_WARNING=a263_0x4bfaa0(0x143);function readDingTalkUserId(_0xe1b897){const _0x522232=a263_0x4bfaa0,_0x5ea5e6=_0xe1b897[_0x522232(0x15e)](_0x522232(0x150))[_0x522232(0x154)]();if(!_0x5ea5e6)throw CliErrors['validation'](_0x522232(0x15f),_0x522232(0x15d));return _0x5ea5e6;}function buildBindingData(_0x2a87b3,_0x47a424){const _0x280ba7=a263_0x4bfaa0;return{'operation':_0x280ba7(0x152),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2a87b3},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2a87b3,'bound':!![]},'dryRun':_0x47a424,'backend':{'method':_0x280ba7(0x158),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a263_0x4bfaa0(0x14c),'command':a263_0x4bfaa0(0x14b),'description':a263_0x4bfaa0(0x156),'risk':a263_0x4bfaa0(0x160),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a263_0x4bfaa0(0x150),'type':a263_0x4bfaa0(0x14f),'required':!![],'description':a263_0x4bfaa0(0x146)}],async 'validate'(_0x34c888){readDingTalkUserId(_0x34c888);},async 'dryRun'(_0x585667){const _0x498287=readDingTalkUserId(_0x585667);return asDryRunResult(buildBindingData(_0x498287,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x42a1bc){const _0x58bb77=a263_0x4bfaa0,_0x2ce635=readDingTalkUserId(_0x42a1bc),_0x16bfac=await bindDingTalkSandboxAccount(_0x2ce635);if(_0x16bfac!==!![])throw CliErrors[_0x58bb77(0x153)](_0x58bb77(0x14d),_0x58bb77(0x15a));return{'ok':!![],'data':buildBindingData(_0x2ce635,![]),'message':_0x58bb77(0x148)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a264_0x3b92ff=a264_0x184e;function a264_0x2757(){const _0x182009=['Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer','925960uRiWyp','feishu','2603184oLXAZM','Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.','user-account','Bound\x20current\x20user\x20to\x20Feishu\x20account.','2438988YNPPKf','apiError','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','union-id','string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','test','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','trim','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','1233140CrGVlq','validation','write','724157woIbee','feishu-bind','1922844VokTJn','5284660SrhcRQ','16aFiICc','POST'];a264_0x2757=function(){return _0x182009;};return a264_0x2757();}(function(_0x649d41,_0x1a2470){const _0x4d9359=a264_0x184e,_0x3e6c7a=_0x649d41();while(!![]){try{const _0x3b65b=parseInt(_0x4d9359(0x80))/0x1+-parseInt(_0x4d9359(0x7b))/0x2+-parseInt(_0x4d9359(0x82))/0x3+parseInt(_0x4d9359(0x76))/0x4+parseInt(_0x4d9359(0x7c))/0x5+parseInt(_0x4d9359(0x87))/0x6+-parseInt(_0x4d9359(0x79))/0x7*(parseInt(_0x4d9359(0x7d))/0x8);if(_0x3b65b===_0x1a2470)break;else _0x3e6c7a['push'](_0x3e6c7a['shift']());}catch(_0x19057b){_0x3e6c7a['push'](_0x3e6c7a['shift']());}}}(a264_0x2757,0xa1877));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';function a264_0x184e(_0x3e3df9,_0x2955a4){_0x3e3df9=_0x3e3df9-0x70;const _0x2757c2=a264_0x2757();let _0x184e00=_0x2757c2[_0x3e3df9];return _0x184e00;}import{CliErrors}from'../../errors.js';const PROVIDER_ID=a264_0x3b92ff(0x81),CURRENT_BINDING_WARNING=a264_0x3b92ff(0x89);function readUnionId(_0x185210){const _0x271eb3=a264_0x3b92ff,_0x41843e=_0x185210['str'](_0x271eb3(0x8a))[_0x271eb3(0x74)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x271eb3(0x72)](_0x41843e))throw CliErrors[_0x271eb3(0x77)](_0x271eb3(0x75),_0x271eb3(0x83));return _0x41843e;}function buildBindingData(_0x29375a,_0xb4e879){const _0x56a1be=a264_0x3b92ff;return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'unionId':_0x29375a},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x29375a,'bound':!![]},'dryRun':_0xb4e879,'backend':{'method':_0x56a1be(0x7e),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a264_0x3b92ff(0x85),'command':a264_0x3b92ff(0x7a),'description':a264_0x3b92ff(0x71),'risk':a264_0x3b92ff(0x78),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a264_0x3b92ff(0x8a),'type':a264_0x3b92ff(0x70),'required':!![],'description':a264_0x3b92ff(0x7f)}],async 'validate'(_0x4b3ef0){readUnionId(_0x4b3ef0);},async 'dryRun'(_0x4fa1c1){const _0x2b9320=readUnionId(_0x4fa1c1);return asDryRunResult(buildBindingData(_0x2b9320,!![]),{'method':'POST','url':FEISHU_BIND_PATH});},async 'execute'(_0x430880){const _0x5e3030=a264_0x3b92ff,_0x391cb5=readUnionId(_0x430880),_0x45e3d2=await bindFeishuAccount(_0x391cb5);if(_0x45e3d2!==!![])throw CliErrors[_0x5e3030(0x88)](_0x5e3030(0x84),_0x5e3030(0x73));return{'ok':!![],'data':buildBindingData(_0x391cb5,![]),'message':_0x5e3030(0x86)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a265_0x1cb7(_0x32f92c,_0x116527){_0x32f92c=_0x32f92c-0x105;const _0x29fa7e=a265_0x29fa();let _0x1cb73e=_0x29fa7e[_0x32f92c];return _0x1cb73e;}(function(_0x37757c,_0x1a152b){const _0x37faaf=a265_0x1cb7,_0x1ff6f3=_0x37757c();while(!![]){try{const _0x41a13b=-parseInt(_0x37faaf(0x10a))/0x1+parseInt(_0x37faaf(0x10c))/0x2+-parseInt(_0x37faaf(0x106))/0x3+parseInt(_0x37faaf(0x107))/0x4*(-parseInt(_0x37faaf(0x105))/0x5)+parseInt(_0x37faaf(0x10b))/0x6*(parseInt(_0x37faaf(0x108))/0x7)+parseInt(_0x37faaf(0x10d))/0x8+parseInt(_0x37faaf(0x109))/0x9*(parseInt(_0x37faaf(0x10e))/0xa);if(_0x41a13b===_0x1a152b)break;else _0x1ff6f3['push'](_0x1ff6f3['shift']());}catch(_0x356a80){_0x1ff6f3['push'](_0x1ff6f3['shift']());}}}(a265_0x29fa,0x63eb7));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a265_0x29fa(){const _0x9dbab8=['1474707FYsGuA','887324NIqetR','1526917xLikzq','119079DMyGXK','239098DLSQVM','12smOqtO','816754FyJuuy','5805840xMiqVa','10QCVUPj','10xrGSeO'];a265_0x29fa=function(){return _0x9dbab8;};return a265_0x29fa();}import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a266_0x96078f=a266_0x5061;(function(_0x1e62be,_0x351ad2){const _0x2982a3=a266_0x5061,_0xd2ce3d=_0x1e62be();while(!![]){try{const _0x316894=-parseInt(_0x2982a3(0x8f))/0x1*(parseInt(_0x2982a3(0x8a))/0x2)+-parseInt(_0x2982a3(0x93))/0x3+-parseInt(_0x2982a3(0x9a))/0x4*(-parseInt(_0x2982a3(0x92))/0x5)+parseInt(_0x2982a3(0x8b))/0x6*(parseInt(_0x2982a3(0x99))/0x7)+parseInt(_0x2982a3(0x8d))/0x8+parseInt(_0x2982a3(0x94))/0x9+parseInt(_0x2982a3(0x98))/0xa*(-parseInt(_0x2982a3(0x90))/0xb);if(_0x316894===_0x351ad2)break;else _0xd2ce3d['push'](_0xd2ce3d['shift']());}catch(_0x453bcd){_0xd2ce3d['push'](_0xd2ce3d['shift']());}}}(a266_0x2eb9,0x354c3));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a266_0x5061(_0x38c60f,_0x26112a){_0x38c60f=_0x38c60f-0x8a;const _0x2eb940=a266_0x2eb9();let _0x5061b8=_0x2eb940[_0x38c60f];return _0x5061b8;}function a266_0x2eb9(){const _0xf0f9c1=['5836ZuJROI','App\x20profile\x20name','4rqrHci','78UXkdqA','name','746584nESoiH','workspace','45517cmCuaj','8371MOFzxe','workspace\x20add','425YUIrJf','779277QXugfe','1434276ZxHnJk','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','write','1990vaspqx','185143scHMJt'];a266_0x2eb9=function(){return _0xf0f9c1;};return a266_0x2eb9();}export const workspaceAddDefinition={'service':a266_0x96078f(0x8e),'command':a266_0x96078f(0x96),'description':a266_0x96078f(0x95),'risk':a266_0x96078f(0x97),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a266_0x96078f(0x8c),'description':a266_0x96078f(0x9b),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1ca15b=>validateAppName(_0x1ca15b,a266_0x96078f(0x91)),'execute':_0x34d069=>runAppAdd(_0x34d069,a266_0x96078f(0x91))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a267_0x4700d9=a267_0x2409;(function(_0x4b065b,_0x20cdd5){const _0x3c76f=a267_0x2409,_0x37a1c5=_0x4b065b();while(!![]){try{const _0x520f48=parseInt(_0x3c76f(0x1e8))/0x1*(-parseInt(_0x3c76f(0x202))/0x2)+parseInt(_0x3c76f(0x1e4))/0x3*(parseInt(_0x3c76f(0x1fc))/0x4)+-parseInt(_0x3c76f(0x1da))/0x5*(-parseInt(_0x3c76f(0x1ee))/0x6)+-parseInt(_0x3c76f(0x205))/0x7+-parseInt(_0x3c76f(0x1de))/0x8+-parseInt(_0x3c76f(0x20d))/0x9+parseInt(_0x3c76f(0x1e7))/0xa;if(_0x520f48===_0x20cdd5)break;else _0x37a1c5['push'](_0x37a1c5['shift']());}catch(_0x4247da){_0x37a1c5['push'](_0x37a1c5['shift']());}}}(a267_0x4eb1,0xe0dab));import{CliErrors}from'../../errors.js';function a267_0x2409(_0x5e56cd,_0x31c321){_0x5e56cd=_0x5e56cd-0x1d6;const _0x4eb1ca=a267_0x4eb1();let _0x2409a6=_0x4eb1ca[_0x5e56cd];return _0x2409a6;}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_0x4700d9(0x203),SAFE_PROFILE_KEYS=[a267_0x4700d9(0x1dc),'apiGroup',a267_0x4700d9(0x1ed),a267_0x4700d9(0x1ea),a267_0x4700d9(0x212),a267_0x4700d9(0x1d8),'pageSize',a267_0x4700d9(0x1f5),'locale'],workspaceFlags=[{'name':'app','type':a267_0x4700d9(0x20f),'description':a267_0x4700d9(0x1f6)},{'name':'appcode','type':a267_0x4700d9(0x20f),'description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a267_0x4700d9(0x1dd),'type':a267_0x4700d9(0x20f),'description':a267_0x4700d9(0x1fa)},{'name':'region','type':a267_0x4700d9(0x20f),'description':a267_0x4700d9(0x207),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':a267_0x4700d9(0x1ea),'type':a267_0x4700d9(0x20f),'description':a267_0x4700d9(0x20a),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':a267_0x4700d9(0x20f),'description':a267_0x4700d9(0x210)},{'name':a267_0x4700d9(0x1db),'type':'string','description':a267_0x4700d9(0x1f7),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a267_0x4700d9(0x1d9),'type':a267_0x4700d9(0x1fb),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a267_0x4700d9(0x1f5),'type':a267_0x4700d9(0x20f),'description':a267_0x4700d9(0x1e9),'enum':[...RISK_LEVEL_VALUES]},{'name':a267_0x4700d9(0x1ff),'type':'string','description':a267_0x4700d9(0x20b)}];function isRecord(_0x1cec66){const _0x5e2ac7=a267_0x4700d9;return!!_0x1cec66&&typeof _0x1cec66===_0x5e2ac7(0x1d6)&&!Array[_0x5e2ac7(0x1e1)](_0x1cec66);}function assertValidAppcode(_0x4b5722){const _0x4df404=a267_0x4700d9,{valid:_0x4ec7f5,message:_0x3e15b0}=validateAppcode(_0x4b5722);if(!_0x4ec7f5)throw CliErrors[_0x4df404(0x1e3)]('Invalid\x20appcode:\x20'+_0x4b5722,_0x3e15b0);}function sanitizeProfile(_0x210c1a){if(!isRecord(_0x210c1a))return{};const _0x1a2167={};for(const _0xb5db84 of SAFE_PROFILE_KEYS){if(_0x210c1a[_0xb5db84]!==undefined)_0x1a2167[_0xb5db84]=_0x210c1a[_0xb5db84];}return _0x1a2167;}function a267_0x4eb1(){const _0x3cb3eb=['defaultFormat','appcode','apiGroup','6663168WpUqCp','updated','\x20workspace\x20','isArray','workspace.','validation','3LUVclT','Missing\x20workspace\x20app\x20selector.','init','18288410oVmxze','7311fVGKLk','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','env','App\x20\x22','initialized','region','1398ZtwNwN','\x20workspace\x20use\x20--app\x20<name>`.','Workspace\x20','apps','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Use\x20`','write','riskLevel','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','.\x20Credentials:\x20not\x20written.','str','Join\x20key\x20for\x20app\x20profiles\x20that\x20share\x20one\x20generated\x20API\x20model\x20registry','number','4732192CrYYVL','\x20--appcode\x20<code>`.','Switch\x20the\x20current\x20workspace\x20app\x20binding','locale','trim','\x20(appcode:\x20','2aeNjvg','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','length','11343507VypCxN','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','Country/region\x20for\x20this\x20workspace\x20app\x20profile','globalConfig','use','Target\x20environment','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','workspace','9765270IkAFjG','keys','string','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','app','apiDir',').\x20Config:\x20','flag','object','\x22\x20not\x20found.','format','pageSize','31220NfWxZp'];a267_0x4eb1=function(){return _0x3cb3eb;};return a267_0x4eb1();}function cloneProfile(_0x2b94c1){return isRecord(_0x2b94c1)?{..._0x2b94c1}:{};}function collectWorkspaceProfileOverrides(_0x58698f){const _0x5801be=a267_0x4700d9,_0x2f9a4c={},_0x3055ac=_0x58698f['str'](_0x5801be(0x1dd)),_0xddf250=_0x58698f[_0x5801be(0x1f9)]('region'),_0x5a6920=_0x58698f['str'](_0x5801be(0x1ea)),_0x3e7c29=_0x58698f[_0x5801be(0x1f9)](_0x5801be(0x212)),_0x4debc0=_0x58698f[_0x5801be(0x1f9)](_0x5801be(0x1db)),_0x2860f1=_0x58698f[_0x5801be(0x214)](_0x5801be(0x1d9)),_0xc7ba02=_0x58698f['str'](_0x5801be(0x1f5)),_0x376bb4=_0x58698f['str'](_0x5801be(0x1ff));if(_0x3055ac)_0x2f9a4c[_0x5801be(0x1dd)]=_0x3055ac;if(_0xddf250)_0x2f9a4c[_0x5801be(0x1ed)]=_0xddf250;if(_0x5a6920)_0x2f9a4c['env']=_0x5a6920;if(_0x3e7c29)_0x2f9a4c['apiDir']=_0x3e7c29;if(_0x4debc0)_0x2f9a4c['format']=_0x4debc0;if(_0x2860f1!==undefined&&_0x2860f1!=='')_0x2f9a4c[_0x5801be(0x1d9)]=Number(_0x2860f1);if(_0xc7ba02)_0x2f9a4c['riskLevel']=_0xc7ba02;if(_0x376bb4)_0x2f9a4c[_0x5801be(0x1ff)]=_0x376bb4;return _0x2f9a4c;}async function validateWorkspaceArgs(_0x30ba85){const _0x5b4902=a267_0x4700d9,_0x1c72d7=_0x30ba85[_0x5b4902(0x1f9)](_0x5b4902(0x211))[_0x5b4902(0x200)](),_0x3e1710=_0x30ba85[_0x5b4902(0x1f9)](_0x5b4902(0x1dc))[_0x5b4902(0x200)]();if(!_0x1c72d7&&!_0x3e1710)throw CliErrors[_0x5b4902(0x1e3)](_0x5b4902(0x1e5),_0x5b4902(0x1f3)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x5b4902(0x1ef));if(_0x3e1710)assertValidAppcode(_0x3e1710);}function resolveKnownApps(){const _0x123926=a267_0x4700d9,{config:_0x2e5738,layers:_0x529bae}=readRawConfigWithLayers(),_0x208c77=isRecord(_0x2e5738[_0x123926(0x1f1)])?_0x2e5738[_0x123926(0x1f1)]:{},_0x71c81b=isRecord(_0x529bae[_0x123926(0x208)][_0x123926(0x1f1)])?_0x529bae[_0x123926(0x208)][_0x123926(0x1f1)]:{};return{..._0x71c81b,..._0x208c77};}async function configureWorkspace(_0x49e322,_0x5e466c){const _0x46e610=a267_0x4700d9,_0x541ed1=_0x49e322['str'](_0x46e610(0x211))[_0x46e610(0x200)](),_0x2e8a3e=_0x49e322[_0x46e610(0x1f9)](_0x46e610(0x1dc))[_0x46e610(0x200)](),_0x17ee70=_0x541ed1||_0x2e8a3e;if(!_0x17ee70)throw CliErrors[_0x46e610(0x1e3)]('Missing\x20workspace\x20app\x20selector.','Use\x20`'+CLI_BIN_NAME+_0x46e610(0x1f2)+CLI_BIN_NAME+_0x46e610(0x1ef));if(_0x2e8a3e)assertValidAppcode(_0x2e8a3e);const _0x3a9296=resolveWriteConfigPath('project'),_0x3d1b75=readConfigFile(_0x3a9296),_0x402b7e=resolveKnownApps(),_0x375c16=isRecord(_0x3d1b75[_0x46e610(0x1f1)])?{..._0x3d1b75[_0x46e610(0x1f1)]}:{},_0x3f4b6b=cloneProfile(_0x375c16[_0x17ee70]),_0x260ce0=sanitizeProfile(_0x402b7e[_0x17ee70]),_0x2bac62=_0x2e8a3e?{}:_0x260ce0,_0x71230a=_0x2e8a3e||_0x2bac62[_0x46e610(0x1dc)];if(!_0x71230a){const _0x3e90e5=Object[_0x46e610(0x20e)](_0x402b7e),_0x534f49=_0x3e90e5[_0x46e610(0x204)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x46e610(0x1e0)+_0x5e466c+'\x20--app\x20'+_0x17ee70+_0x46e610(0x1fd):_0x46e610(0x206)+_0x3e90e5['join'](',\x20');throw CliErrors['validation'](_0x46e610(0x1eb)+_0x17ee70+_0x46e610(0x1d7),_0x534f49);}assertValidAppcode(String(_0x71230a));const _0x236268={..._0x2bac62,..._0x3f4b6b,'appcode':String(_0x71230a),...collectWorkspaceProfileOverrides(_0x49e322)};return _0x375c16[_0x17ee70]=_0x236268,_0x3d1b75[_0x46e610(0x1f1)]=_0x375c16,normalizeStoredDefaultApp(_0x3d1b75,_0x17ee70),delete _0x3d1b75[_0x46e610(0x1dc)],delete _0x3d1b75[_0x46e610(0x211)],_0x236268[_0x46e610(0x1ea)]&&(_0x3d1b75[_0x46e610(0x1ea)]=_0x236268[_0x46e610(0x1ea)]),writeConfigFile(_0x3a9296,_0x3d1b75),{'ok':!![],'message':_0x46e610(0x1f0)+(_0x5e466c===_0x46e610(0x1e6)?_0x46e610(0x1ec):_0x46e610(0x1df))+':\x20'+_0x17ee70+_0x46e610(0x201)+_0x236268[_0x46e610(0x1dc)]+_0x46e610(0x213)+_0x3a9296+_0x46e610(0x1f8),'data':{'operation':_0x46e610(0x1e2)+_0x5e466c,'configPath':_0x3a9296,'app':_0x17ee70,'appcode':_0x236268[_0x46e610(0x1dc)],'apiGroup':_0x236268[_0x46e610(0x1dd)]??null,'region':_0x236268[_0x46e610(0x1ed)]??null,'env':_0x236268[_0x46e610(0x1ea)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a267_0x4700d9(0x20c),'command':a267_0x4700d9(0x1e6),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':a267_0x4700d9(0x1f4),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x343799=>configureWorkspace(_0x343799,a267_0x4700d9(0x1e6))},workspaceUseDefinition={'service':a267_0x4700d9(0x20c),'command':a267_0x4700d9(0x209),'description':a267_0x4700d9(0x1fe),'risk':a267_0x4700d9(0x1f4),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xc2f7bb=>configureWorkspace(_0xc2f7bb,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a268_0x5c9a(){const _0xb0abb3=['remove','68DcupCk','3873ZBtZZm','431914tCwBBZ','9AiISwL','42456XZKPPu','5930iDwmXc','workspace','App\x20profile\x20name\x20to\x20remove','122jazOdM','6SORXqM','31343280rFqMtm','7164472AnziHH','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','name','4513820NaJRnU','17809UGhfod'];a268_0x5c9a=function(){return _0xb0abb3;};return a268_0x5c9a();}const a268_0x26a011=a268_0x1e86;(function(_0x28d16d,_0x309f87){const _0x529a78=a268_0x1e86,_0x597b18=_0x28d16d();while(!![]){try{const _0x5994ef=-parseInt(_0x529a78(0xee))/0x1*(-parseInt(_0x529a78(0xe4))/0x2)+parseInt(_0x529a78(0xe0))/0x3*(parseInt(_0x529a78(0xed))/0x4)+parseInt(_0x529a78(0xea))/0x5*(parseInt(_0x529a78(0xe5))/0x6)+parseInt(_0x529a78(0xef))/0x7+parseInt(_0x529a78(0xe7))/0x8*(parseInt(_0x529a78(0xf0))/0x9)+parseInt(_0x529a78(0xe1))/0xa*(parseInt(_0x529a78(0xeb))/0xb)+-parseInt(_0x529a78(0xe6))/0xc;if(_0x5994ef===_0x309f87)break;else _0x597b18['push'](_0x597b18['shift']());}catch(_0x3c3dbc){_0x597b18['push'](_0x597b18['shift']());}}}(a268_0x5c9a,0xa73bd));function a268_0x1e86(_0x34c03b,_0x1522a5){_0x34c03b=_0x34c03b-0xe0;const _0x5c9a85=a268_0x5c9a();let _0x1e863d=_0x5c9a85[_0x34c03b];return _0x1e863d;}import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a268_0x26a011(0xe2),'command':a268_0x26a011(0xec),'description':a268_0x26a011(0xe8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a268_0x26a011(0xe9),'description':a268_0x26a011(0xe3),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x2ba7e7=>validateAppName(_0x2ba7e7,'workspace\x20remove'),'execute':_0x30a20c=>runAppRemove(_0x30a20c,'workspace\x20remove')};
|