@lovrabet/rabetbase-cli 2.5.1-beta.3 → 2.5.1-beta.5
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/README.md +75 -1
- package/lib/api/api-doc.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.d.ts +0 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.d.ts +2 -0
- 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.d.ts +3 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- 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.d.ts +2 -0
- package/lib/commands/project/domain-routing-sync.js +1 -0
- 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.d.ts +2 -0
- package/lib/commands/rule/get.js +1 -0
- package/lib/commands/rule/index.d.ts +2 -0
- package/lib/commands/rule/index.js +1 -0
- package/lib/commands/rule/list.d.ts +2 -0
- package/lib/commands/rule/list.js +1 -0
- package/lib/commands/rule/set.d.ts +2 -0
- package/lib/commands/rule/set.js +1 -0
- package/lib/commands/rule/shared.d.ts +43 -0
- package/lib/commands/rule/shared.js +1 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/deployment-sync.js +1 -1
- package/lib/config/domain-config.d.ts +38 -2
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +27 -0
- package/lib/config/project-domain-routing.js +1 -0
- package/lib/config/schema.d.ts +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.d.ts +10 -6
- 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.d.ts +4 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +43 -49
- 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.d.ts +2 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +37 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/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/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/types.d.ts +0 -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.d.ts +83 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +0 -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 +2 -1
- package/skills/rabetbase/SKILL.md +16 -13
- package/skills/rabetbase/guides/sdk-client-generation.md +10 -8
- package/skills/rabetbase/references/rabetbase-api-pull.md +16 -11
- package/skills/rabetbase/references/rabetbase-config.md +3 -6
- package/skills/rabetbase/references/rabetbase-doctor.md +2 -1
- package/skills/rabetbase/references/rabetbase-init.md +32 -10
- package/skills/rabetbase/references/rabetbase-kb.md +7 -7
- package/skills/rabetbase/references/rabetbase-project-create.md +33 -8
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +28 -0
- package/skills/rabetbase/references/rabetbase-rule.md +49 -0
- package/skills/rabetbase.manifest.json +5 -3
- package/lib/config/project-routing.d.ts +0 -30
- package/lib/config/project-routing.js +0 -1
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a197_0x218fea=a197_0x12eb;(function(_0x1d920b,_0x4bfa13){const _0x1ec733=a197_0x12eb,_0x49d24c=_0x1d920b();while(!![]){try{const _0x1a5505=parseInt(_0x1ec733(0x1fa))/0x1*(parseInt(_0x1ec733(0x1f7))/0x2)+parseInt(_0x1ec733(0x1ea))/0x3+parseInt(_0x1ec733(0x208))/0x4*(parseInt(_0x1ec733(0x218))/0x5)+-parseInt(_0x1ec733(0x1f4))/0x6*(parseInt(_0x1ec733(0x1ff))/0x7)+-parseInt(_0x1ec733(0x21d))/0x8*(-parseInt(_0x1ec733(0x20d))/0x9)+parseInt(_0x1ec733(0x217))/0xa+parseInt(_0x1ec733(0x1f2))/0xb*(-parseInt(_0x1ec733(0x1f9))/0xc);if(_0x1a5505===_0x4bfa13)break;else _0x49d24c['push'](_0x49d24c['shift']());}catch(_0x5c3990){_0x49d24c['push'](_0x49d24c['shift']());}}}(a197_0x39f5,0x82ed1));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';function a197_0x12eb(_0x457d37,_0xfb6a1a){_0x457d37=_0x457d37-0x1e3;const _0x39f5b5=a197_0x39f5();let _0x12eb7a=_0x39f5b5[_0x457d37];return _0x12eb7a;}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';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';async function getTargetSqlQueries(_0x437961,_0x529357,_0x3d664f){const _0x5b1251=a197_0x12eb,_0xe138c7=await scanLocalSqlQueries(_0x437961),_0x2b2aa7=new Map();for(const _0x1e4587 of _0xe138c7){if(_0x3d664f&&_0x1e4587[_0x5b1251(0x22a)]!==_0x3d664f)continue;const _0x543e38=_0x2b2aa7[_0x5b1251(0x20f)](_0x1e4587[_0x5b1251(0x22a)])??[];_0x543e38['push'](_0x1e4587),_0x2b2aa7[_0x5b1251(0x211)](_0x1e4587[_0x5b1251(0x22a)],_0x543e38);}if(_0x3d664f&&!_0x2b2aa7[_0x5b1251(0x1e5)](_0x3d664f))throw CliErrors[_0x5b1251(0x210)](_0x5b1251(0x226)+_0x3d664f);const _0x47eeae=[];for(const [_0x251b51,_0x14f781]of _0x2b2aa7[_0x5b1251(0x21c)]()){if(_0x14f781[_0x5b1251(0x228)]===0x1){_0x47eeae[_0x5b1251(0x1fd)](_0x14f781[0x0]);continue;}const _0x4df72b=_0x529357[_0x5b1251(0x1eb)][_0x251b51],_0x128da4=_0x4df72b?.[_0x5b1251(0x1e6)],_0xb3faea=_0x128da4?_0x14f781['filter'](_0x4523eb=>_0x4523eb['relativePath']!==_0x128da4):_0x14f781;if(_0x4df72b&&_0xb3faea[_0x5b1251(0x228)]===0x1){_0x47eeae[_0x5b1251(0x1fd)](_0xb3faea[0x0]);continue;}throw CliErrors[_0x5b1251(0x210)](_0x5b1251(0x1f8)+_0x251b51+_0x5b1251(0x207));}return _0x47eeae;}export const sqlPush={'service':a197_0x218fea(0x203),'command':a197_0x218fea(0x1fd),'description':a197_0x218fea(0x223),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a197_0x218fea(0x221),'type':a197_0x218fea(0x20c),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'validate'(_0x167abc){validateAutomaticDeploymentSync(_0x167abc);},async 'dryRun'(_0x42c486){const _0x26dff5=a197_0x218fea,_0x14de50=loadSqlProjectConfig(_0x42c486[_0x26dff5(0x213)]),_0x15e649=await readSqlLockFile(_0x14de50[_0x26dff5(0x20b)]),{appLock:_0x506f38}=ensureSqlLockScope(_0x15e649??createEmptySqlLock(),_0x42c486[_0x26dff5(0x213)],_0x14de50['sqlRoot'],_0x26dff5(0x1fd)),_0x5872da=await getTargetSqlQueries(_0x14de50,_0x506f38,_0x42c486[_0x26dff5(0x204)](_0x26dff5(0x219))||undefined),_0x4ef504=[];for(const _0xc4426a of _0x5872da){const _0x1ff7d1=await computeSqlFileHash(_0xc4426a[_0x26dff5(0x216)]),_0x3ac69f=_0x506f38[_0x26dff5(0x1eb)][_0xc4426a[_0x26dff5(0x22a)]],_0x482878=!!_0x3ac69f&&(_0x3ac69f[_0x26dff5(0x1e6)]!==_0xc4426a[_0x26dff5(0x212)]||!!_0xc4426a['sqlName']&&_0x3ac69f[_0x26dff5(0x1f3)]!==_0xc4426a[_0x26dff5(0x1f3)]);if(!_0x42c486['bool'](_0x26dff5(0x221))&&_0x3ac69f&&_0x3ac69f['hash']===_0x1ff7d1&&!_0x482878)continue;_0x4ef504[_0x26dff5(0x1fd)](_0xc4426a[_0x26dff5(0x22a)]);}return{'method':'POST','url':_0x26dff5(0x227),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x42c486,_0x26dff5(0x203),_0x4ef504),'body':{'sqlCodes':_0x4ef504,'appCode':_0x42c486[_0x26dff5(0x213)]},'description':_0x26dff5(0x1ed)+_0x4ef504[_0x26dff5(0x228)]+_0x26dff5(0x20e)};},async 'execute'(_0x489975){const _0x281b5e=a197_0x218fea,_0x56bc2d=loadSqlProjectConfig(_0x489975[_0x281b5e(0x213)]),_0x3657e5=await readSqlLockFile(_0x56bc2d[_0x281b5e(0x20b)]),{lockData:_0x379930,appLock:_0x497e35}=ensureSqlLockScope(_0x3657e5??createEmptySqlLock(),_0x489975[_0x281b5e(0x213)],_0x56bc2d[_0x281b5e(0x200)],_0x281b5e(0x1fd)),_0x2c58bd=await getTargetSqlQueries(_0x56bc2d,_0x497e35,_0x489975[_0x281b5e(0x204)](_0x281b5e(0x219))||undefined);if(_0x2c58bd[_0x281b5e(0x228)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x281b5e(0x215)};const _0x53aa9c=[],_0x3e7842=[],_0x33b768=[];for(const _0x211623 of _0x2c58bd){const _0x2aa292=_0x497e35['sqls'][_0x211623[_0x281b5e(0x22a)]];if(!_0x2aa292){_0x33b768[_0x281b5e(0x1fd)]({'sqlCode':_0x211623['sqlCode'],'error':_0x281b5e(0x21e)});continue;}try{const _0x3d7be1=await computeSqlFileHash(_0x211623['filePath']),_0x2d7a83=_0x2aa292[_0x281b5e(0x1e6)]!==_0x211623[_0x281b5e(0x212)]||!!_0x211623[_0x281b5e(0x1f3)]&&_0x2aa292[_0x281b5e(0x1f3)]!==_0x211623[_0x281b5e(0x1f3)];if(!_0x489975[_0x281b5e(0x1fe)]('force')&&_0x2aa292[_0x281b5e(0x220)]===_0x3d7be1&&!_0x2d7a83){_0x3e7842[_0x281b5e(0x1fd)]({'sqlCode':_0x211623['sqlCode'],'reason':_0x281b5e(0x214)});continue;}if(_0x2aa292[_0x281b5e(0x1fc)]==null){_0x33b768[_0x281b5e(0x1fd)]({'sqlCode':_0x211623['sqlCode'],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x4cd890=await readFile(_0x211623[_0x281b5e(0x216)],_0x281b5e(0x1e9)),_0x239945=stripLocalSqlMetadata(_0x4cd890,_0x211623[_0x281b5e(0x202)]),_0x4fb51f=_0x211623[_0x281b5e(0x1f3)]||_0x2aa292[_0x281b5e(0x1f3)],_0x4fe1f1=await resolveTargetDbBinding(_0x489975[_0x281b5e(0x213)],_0x211623,_0x2aa292),_0x1cd52e=await updateSqlQuery({'id':_0x2aa292['remoteId'],'appCode':_0x489975[_0x281b5e(0x213)],'sqlCode':_0x211623['sqlCode'],'sqlName':_0x4fb51f,'dbId':_0x4fe1f1['dbId'],'version':_0x2aa292[_0x281b5e(0x1fc)],'sqlContent':_0x239945,'sqlConfig':_0x2aa292[_0x281b5e(0x20a)]??undefined}),_0x37df69=_0x1cd52e[_0x281b5e(0x21a)]?await getDbName(_0x489975[_0x281b5e(0x213)],Number(_0x1cd52e[_0x281b5e(0x21a)]))[_0x281b5e(0x1ee)](()=>_0x4fe1f1[_0x281b5e(0x1e4)]):_0x4fe1f1[_0x281b5e(0x1e4)];_0x497e35[_0x281b5e(0x1eb)][_0x211623['sqlCode']]={...buildSqlLockEntry(_0x1cd52e,_0x239945,_0x3d7be1,{'dbName':_0x37df69}),'path':_0x211623[_0x281b5e(0x212)],'mode':_0x2aa292['mode']},await archivePreviousSqlFileIfNeeded(_0x56bc2d,_0x2aa292[_0x281b5e(0x1e6)],_0x211623[_0x281b5e(0x212)]),_0x53aa9c['push']({'sqlCode':_0x211623['sqlCode'],'remoteId':_0x2aa292[_0x281b5e(0x1f5)]});}catch(_0x952a99){_0x33b768[_0x281b5e(0x1fd)]({'sqlCode':_0x211623[_0x281b5e(0x22a)],'error':_0x952a99 instanceof Error?_0x952a99['message']:String(_0x952a99)});}}_0x497e35['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x56bc2d[_0x281b5e(0x20b)],_0x379930);const _0x286b8a=_0x33b768[_0x281b5e(0x228)]===0x0,_0x3eb34d=await runAutomaticDeploymentSync(_0x489975,_0x281b5e(0x203),_0x53aa9c['map'](_0x2947ab=>_0x2947ab[_0x281b5e(0x22a)]),_0x286b8a),_0x59b5d7=_0x286b8a&&automaticDeploymentSyncSucceeded(_0x3eb34d),_0x2bae0=_0x3eb34d[_0x281b5e(0x21f)]?_0x281b5e(0x222)+_0x3eb34d[_0x281b5e(0x201)]:'';return{'ok':_0x59b5d7,'data':{'pushed':_0x53aa9c,'skipped':_0x3e7842,'failed':_0x33b768,'deploymentSync':_0x3eb34d},'message':_0x281b5e(0x1e3)+_0x53aa9c[_0x281b5e(0x228)]+_0x281b5e(0x1ec)+_0x3e7842['length']+_0x281b5e(0x209)+_0x33b768[_0x281b5e(0x228)]+'\x20failed'+_0x2bae0};}};async function archivePreviousSqlFileIfNeeded(_0xcf343b,_0x37d667,_0x547b70){const _0x3adc4a=a197_0x218fea;if(!_0x37d667||_0x37d667===_0x547b70)return;const _0x1e8150=join(_0xcf343b['sqlRootDir'],_0x37d667);if(!await fileExists(_0x1e8150))return;const _0x42f6c9=await moveToTrash(_0xcf343b[_0x3adc4a(0x225)],_0xcf343b[_0x3adc4a(0x21b)],_0x1e8150);await cleanupEmptyDirectories(dirname(_0x1e8150),_0xcf343b[_0x3adc4a(0x1fb)]),void _0x42f6c9;}async function moveToTrash(_0xfa1770,_0x4f7664,_0x36fe67){const _0x405a67=a197_0x218fea,_0xa47bf4=new Date()['toISOString']()[_0x405a67(0x205)](/[:.]/g,'-'),_0x5cd74b=relative(_0xfa1770,_0x36fe67),_0xd940c9=join(_0x4f7664,_0xa47bf4,_0x5cd74b);return await mkdir(dirname(_0xd940c9),{'recursive':!![]}),await rename(_0x36fe67,_0xd940c9),_0xd940c9;}async function cleanupEmptyDirectories(_0x20e399,_0x529449){const _0x48ec98=a197_0x218fea;let _0x51192e=resolve(_0x20e399);const _0x46bf18=resolve(_0x529449);while(_0x51192e[_0x48ec98(0x206)](''+_0x46bf18+sep)||_0x51192e===_0x46bf18){if(_0x51192e===_0x46bf18)return;try{const _0x262651=await readdir(_0x51192e);if(_0x262651[_0x48ec98(0x228)]>0x0)return;await rmdir(_0x51192e);}catch{return;}_0x51192e=dirname(_0x51192e);}}async function resolveTargetDbBinding(_0x34e4dd,_0x1eb64c,_0x149a0c){const _0x23151b=a197_0x218fea,_0x559c66=_0x1eb64c['dbDirectory'];if(!_0x559c66)return{'dbId':_0x149a0c['dbId'],'dbName':_0x149a0c[_0x23151b(0x1e4)]};const _0x8cfe61=buildDbDirectoryName(_0x149a0c[_0x23151b(0x1e4)],_0x149a0c['dbId']);if(_0x559c66===_0x8cfe61)return{'dbId':_0x149a0c[_0x23151b(0x21a)],'dbName':_0x149a0c[_0x23151b(0x1e4)]};const _0x29ef08=parseExplicitDbDirectory(_0x559c66);if(_0x29ef08!=null)return{'dbId':_0x29ef08,'dbName':await getDbName(_0x34e4dd,_0x29ef08)[_0x23151b(0x1ee)](()=>undefined)};const _0x4afc99=await listDatabases(_0x34e4dd),_0xc7486a=_0x4afc99[_0x23151b(0x1f6)](_0x1b8028=>buildDbDirectoryName(_0x1b8028['dbName'],_0x1b8028[_0x23151b(0x21a)])===_0x559c66);if(_0xc7486a['length']===0x1)return{'dbId':_0xc7486a[0x0][_0x23151b(0x21a)],'dbName':_0xc7486a[0x0]['dbName']};if(_0xc7486a[_0x23151b(0x228)]===0x0)throw CliErrors[_0x23151b(0x210)](_0x23151b(0x1ef)+_0x559c66+_0x23151b(0x1e7)+_0x1eb64c['sqlCode']+'.');const _0x11af72=_0xc7486a[_0x23151b(0x229)](_0x1eaa16=>_0x1eaa16[_0x23151b(0x1e4)]+'\x20('+_0x1eaa16[_0x23151b(0x21a)]+')')[_0x23151b(0x224)](',\x20');throw CliErrors[_0x23151b(0x210)](_0x23151b(0x1f0)+_0x559c66+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x1eb64c[_0x23151b(0x22a)]+':\x20'+_0x11af72);}function a197_0x39f5(){const _0x6ea6b0=['72DEXAPr','\x20SQL\x20file(s)','get','validation','set','relativePath','appCode','unchanged','No\x20local\x20SQL\x20files\x20found.','filePath','6208940pIhNBZ','244230nPUbus','sqlcode','dbId','trashDir','entries','1015064mJvRjI','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','configured','hash','force',',\x20deployment\x20sync\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','join','projectRoot','Local\x20SQL\x20not\x20found:\x20','/smartapi/custom/updateUserCustomSql','length','map','sqlCode','Push\x20complete:\x20','dbName','has','path','\x22\x20for\x20sqlCode\x20','exec','utf8','90543FAFqfx','sqls','\x20pushed,\x20','Would\x20push\x20','catch','No\x20database\x20matches\x20local\x20directory\x20\x22','Local\x20directory\x20\x22','isFinite','14984717urrmaO','sqlName','5252658OjcfFB','remoteId','filter','2mhhSpf','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','12NkiXeA','668210ntAehn','sqlRootDir','version','push','bool','7lOPylU','sqlRoot','status','mode','sql','str','replace','startsWith','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','36qpbGqu','\x20skipped,\x20','sqlConfig','lockFilePath','boolean'];a197_0x39f5=function(){return _0x6ea6b0;};return a197_0x39f5();}function parseExplicitDbDirectory(_0x9aa7e4){const _0x34c1a0=a197_0x218fea,_0x3e337c=/^db-(\d+)$/[_0x34c1a0(0x1e8)](_0x9aa7e4);if(!_0x3e337c)return null;const _0xf6f0a0=Number(_0x3e337c[0x1]);return Number[_0x34c1a0(0x1f1)](_0xf6f0a0)&&_0xf6f0a0>0x0?_0xf6f0a0:null;}
|
|
1
|
+
const a203_0x430d9f=a203_0x54b5;(function(_0x3e4705,_0x1c0f85){const _0x71dd6e=a203_0x54b5,_0x18c812=_0x3e4705();while(!![]){try{const _0x34502c=parseInt(_0x71dd6e(0xeb))/0x1*(-parseInt(_0x71dd6e(0xe6))/0x2)+-parseInt(_0x71dd6e(0xb6))/0x3*(-parseInt(_0x71dd6e(0xbc))/0x4)+parseInt(_0x71dd6e(0xdf))/0x5+parseInt(_0x71dd6e(0xe5))/0x6*(parseInt(_0x71dd6e(0xc0))/0x7)+parseInt(_0x71dd6e(0xc3))/0x8+parseInt(_0x71dd6e(0xdc))/0x9*(parseInt(_0x71dd6e(0xd6))/0xa)+-parseInt(_0x71dd6e(0xe8))/0xb;if(_0x34502c===_0x1c0f85)break;else _0x18c812['push'](_0x18c812['shift']());}catch(_0x42567f){_0x18c812['push'](_0x18c812['shift']());}}}(a203_0x504b,0xb285b));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a203_0x54b5(_0x847a93,_0x56b475){_0x847a93=_0x847a93-0xa9;const _0x504bba=a203_0x504b();let _0x54b5c3=_0x504bba[_0x847a93];return _0x54b5c3;}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 a203_0x504b(){const _0x277c38=['No\x20local\x20SQL\x20files\x20found.','3BhaXyx','toISOString','sql','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','path','message','bool','sqlCode','catch','replace','write','dbDirectory','exec','sqlConfig','sqlName','sqls','boolean','6zhQkoO','relativePath','\x22\x20for\x20sqlCode\x20','force','POST','mode','2472184OJzSjm','unchanged','Would\x20push\x20','get','464709StGKNd','lockFilePath','sqlRoot','8614944BJHyYM','No\x20database\x20matches\x20local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','validation','sqlcode','\x20failed','appCode','status','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','Push\x20local\x20SQL\x20files\x20to\x20remote','dbName','sqlRootDir','join','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','\x20skipped,\x20','isFinite','filePath','Local\x20directory\x20\x22','length','14690scZCit','set','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','lastSync','filter','remoteId','3744Obekpo','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','has','2503695qGBdqr','push','\x20pushed,\x20','map','entries','str','12gxQDte','181294kGbFel','version','28098499hrAwwG','dbId'];a203_0x504b=function(){return _0x277c38;};return a203_0x504b();}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';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';async function getTargetSqlQueries(_0x380576,_0x6110b,_0x381f44){const _0x52710b=a203_0x54b5,_0x387214=await scanLocalSqlQueries(_0x380576),_0x302bdc=new Map();for(const _0x5edade of _0x387214){if(_0x381f44&&_0x5edade[_0x52710b(0xac)]!==_0x381f44)continue;const _0x4aea67=_0x302bdc[_0x52710b(0xbf)](_0x5edade[_0x52710b(0xac)])??[];_0x4aea67[_0x52710b(0xe0)](_0x5edade),_0x302bdc[_0x52710b(0xd7)](_0x5edade['sqlCode'],_0x4aea67);}if(_0x381f44&&!_0x302bdc[_0x52710b(0xde)](_0x381f44))throw CliErrors[_0x52710b(0xc6)]('Local\x20SQL\x20not\x20found:\x20'+_0x381f44);const _0xbcc388=[];for(const [_0x2840ba,_0x11ff92]of _0x302bdc[_0x52710b(0xe3)]()){if(_0x11ff92[_0x52710b(0xd5)]===0x1){_0xbcc388[_0x52710b(0xe0)](_0x11ff92[0x0]);continue;}const _0x35b810=_0x6110b['sqls'][_0x2840ba],_0x1cfa27=_0x35b810?.['path'],_0x5328b7=_0x1cfa27?_0x11ff92[_0x52710b(0xda)](_0x4e3110=>_0x4e3110[_0x52710b(0xb7)]!==_0x1cfa27):_0x11ff92;if(_0x35b810&&_0x5328b7['length']===0x1){_0xbcc388[_0x52710b(0xe0)](_0x5328b7[0x0]);continue;}throw CliErrors[_0x52710b(0xc6)](_0x52710b(0xdd)+_0x2840ba+_0x52710b(0xcb));}return _0xbcc388;}export const sqlPush={'service':a203_0x430d9f(0xed),'command':a203_0x430d9f(0xe0),'description':a203_0x430d9f(0xcc),'risk':a203_0x430d9f(0xaf),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a203_0x430d9f(0xb5),'description':a203_0x430d9f(0xd8)}],async 'validate'(_0x4c407a){validateAutomaticDeploymentSync(_0x4c407a);},async 'dryRun'(_0x48e6da){const _0x376cf5=a203_0x430d9f,_0x3e2889=loadSqlProjectConfig(_0x48e6da[_0x376cf5(0xc9)]),_0x410875=await readSqlLockFile(_0x3e2889[_0x376cf5(0xc1)]),{appLock:_0x33ab00}=ensureSqlLockScope(_0x410875??createEmptySqlLock(),_0x48e6da[_0x376cf5(0xc9)],_0x3e2889[_0x376cf5(0xc2)],_0x376cf5(0xe0)),_0x26a645=await getTargetSqlQueries(_0x3e2889,_0x33ab00,_0x48e6da[_0x376cf5(0xe4)]('sqlcode')||undefined),_0x256a66=[];for(const _0x4c6faa of _0x26a645){const _0xd50a3a=await computeSqlFileHash(_0x4c6faa[_0x376cf5(0xd3)]),_0x224387=_0x33ab00[_0x376cf5(0xb4)][_0x4c6faa[_0x376cf5(0xac)]],_0x4502bf=!!_0x224387&&(_0x224387[_0x376cf5(0xa9)]!==_0x4c6faa[_0x376cf5(0xb7)]||!!_0x4c6faa[_0x376cf5(0xb3)]&&_0x224387[_0x376cf5(0xb3)]!==_0x4c6faa['sqlName']);if(!_0x48e6da[_0x376cf5(0xab)]('force')&&_0x224387&&_0x224387['hash']===_0xd50a3a&&!_0x4502bf)continue;_0x256a66[_0x376cf5(0xe0)](_0x4c6faa[_0x376cf5(0xac)]);}return{'method':_0x376cf5(0xba),'url':_0x376cf5(0xc5),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x48e6da,_0x376cf5(0xed),_0x256a66),'body':{'sqlCodes':_0x256a66,'appCode':_0x48e6da[_0x376cf5(0xc9)]},'description':_0x376cf5(0xbe)+_0x256a66[_0x376cf5(0xd5)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x5bef55){const _0xdecf27=a203_0x430d9f,_0x5293f6=loadSqlProjectConfig(_0x5bef55[_0xdecf27(0xc9)]),_0x454f57=await readSqlLockFile(_0x5293f6[_0xdecf27(0xc1)]),{lockData:_0x2dda38,appLock:_0x1098c0}=ensureSqlLockScope(_0x454f57??createEmptySqlLock(),_0x5bef55[_0xdecf27(0xc9)],_0x5293f6[_0xdecf27(0xc2)],_0xdecf27(0xe0)),_0xcce273=await getTargetSqlQueries(_0x5293f6,_0x1098c0,_0x5bef55['str'](_0xdecf27(0xc7))||undefined);if(_0xcce273[_0xdecf27(0xd5)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xdecf27(0xea)};const _0x30eecc=[],_0x2006f7=[],_0x59172f=[];for(const _0xcf1650 of _0xcce273){const _0x18c196=_0x1098c0['sqls'][_0xcf1650['sqlCode']];if(!_0x18c196){_0x59172f[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x676dba=await computeSqlFileHash(_0xcf1650[_0xdecf27(0xd3)]),_0xd1d4d9=_0x18c196[_0xdecf27(0xa9)]!==_0xcf1650['relativePath']||!!_0xcf1650['sqlName']&&_0x18c196[_0xdecf27(0xb3)]!==_0xcf1650[_0xdecf27(0xb3)];if(!_0x5bef55[_0xdecf27(0xab)](_0xdecf27(0xb9))&&_0x18c196['hash']===_0x676dba&&!_0xd1d4d9){_0x2006f7[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'reason':_0xdecf27(0xbd)});continue;}if(_0x18c196['version']==null){_0x59172f['push']({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'error':_0xdecf27(0xee)});continue;}const _0x463259=await readFile(_0xcf1650[_0xdecf27(0xd3)],'utf8'),_0x3ad01e=stripLocalSqlMetadata(_0x463259,_0xcf1650[_0xdecf27(0xbb)]),_0x3d1c4f=_0xcf1650['sqlName']||_0x18c196['sqlName'],_0x1725fd=await resolveTargetDbBinding(_0x5bef55[_0xdecf27(0xc9)],_0xcf1650,_0x18c196),_0x3263fa=await updateSqlQuery({'id':_0x18c196[_0xdecf27(0xdb)],'appCode':_0x5bef55[_0xdecf27(0xc9)],'sqlCode':_0xcf1650[_0xdecf27(0xac)],'sqlName':_0x3d1c4f,'dbId':_0x1725fd[_0xdecf27(0xe9)],'version':_0x18c196[_0xdecf27(0xe7)],'sqlContent':_0x3ad01e,'sqlConfig':_0x18c196[_0xdecf27(0xb2)]??undefined}),_0x284daf=_0x3263fa[_0xdecf27(0xe9)]?await getDbName(_0x5bef55[_0xdecf27(0xc9)],Number(_0x3263fa['dbId']))[_0xdecf27(0xad)](()=>_0x1725fd[_0xdecf27(0xcd)]):_0x1725fd['dbName'];_0x1098c0[_0xdecf27(0xb4)][_0xcf1650[_0xdecf27(0xac)]]={...buildSqlLockEntry(_0x3263fa,_0x3ad01e,_0x676dba,{'dbName':_0x284daf}),'path':_0xcf1650[_0xdecf27(0xb7)],'mode':_0x18c196[_0xdecf27(0xbb)]},await archivePreviousSqlFileIfNeeded(_0x5293f6,_0x18c196[_0xdecf27(0xa9)],_0xcf1650[_0xdecf27(0xb7)]),_0x30eecc[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650[_0xdecf27(0xac)],'remoteId':_0x18c196[_0xdecf27(0xdb)]});}catch(_0x2ddef5){_0x59172f[_0xdecf27(0xe0)]({'sqlCode':_0xcf1650['sqlCode'],'error':_0x2ddef5 instanceof Error?_0x2ddef5[_0xdecf27(0xaa)]:String(_0x2ddef5)});}}_0x1098c0[_0xdecf27(0xd9)]=new Date()[_0xdecf27(0xec)](),await writeSqlLockFile(_0x5293f6[_0xdecf27(0xc1)],_0x2dda38);const _0x42d49c=_0x59172f[_0xdecf27(0xd5)]===0x0,_0x254c21=await runAutomaticDeploymentSync(_0x5bef55,'sql',_0x30eecc[_0xdecf27(0xe2)](_0x2ffc5b=>_0x2ffc5b['sqlCode']),_0x42d49c),_0x3bbdf5=_0x42d49c&&automaticDeploymentSyncSucceeded(_0x254c21),_0x312c69=_0x254c21['configured']?',\x20deployment\x20sync\x20'+_0x254c21[_0xdecf27(0xca)]:'';return{'ok':_0x3bbdf5,'data':{'pushed':_0x30eecc,'skipped':_0x2006f7,'failed':_0x59172f,'deploymentSync':_0x254c21},'message':'Push\x20complete:\x20'+_0x30eecc[_0xdecf27(0xd5)]+_0xdecf27(0xe1)+_0x2006f7[_0xdecf27(0xd5)]+_0xdecf27(0xd1)+_0x59172f[_0xdecf27(0xd5)]+_0xdecf27(0xc8)+_0x312c69};}};async function archivePreviousSqlFileIfNeeded(_0x518632,_0x15d08c,_0xffbdb2){const _0x498f45=a203_0x430d9f;if(!_0x15d08c||_0x15d08c===_0xffbdb2)return;const _0x5f36e1=join(_0x518632[_0x498f45(0xce)],_0x15d08c);if(!await fileExists(_0x5f36e1))return;const _0x192dbd=await moveToTrash(_0x518632['projectRoot'],_0x518632['trashDir'],_0x5f36e1);await cleanupEmptyDirectories(dirname(_0x5f36e1),_0x518632['sqlRootDir']),void _0x192dbd;}async function moveToTrash(_0x321507,_0x143b11,_0x340429){const _0x1966ec=a203_0x430d9f,_0x537eec=new Date()['toISOString']()[_0x1966ec(0xae)](/[:.]/g,'-'),_0xc1a0be=relative(_0x321507,_0x340429),_0x3b5a73=join(_0x143b11,_0x537eec,_0xc1a0be);return await mkdir(dirname(_0x3b5a73),{'recursive':!![]}),await rename(_0x340429,_0x3b5a73),_0x3b5a73;}async function cleanupEmptyDirectories(_0x7b5bdb,_0x4343b7){const _0x5b3595=a203_0x430d9f;let _0x5daad2=resolve(_0x7b5bdb);const _0xfd18b1=resolve(_0x4343b7);while(_0x5daad2['startsWith'](''+_0xfd18b1+sep)||_0x5daad2===_0xfd18b1){if(_0x5daad2===_0xfd18b1)return;try{const _0x71fac8=await readdir(_0x5daad2);if(_0x71fac8[_0x5b3595(0xd5)]>0x0)return;await rmdir(_0x5daad2);}catch{return;}_0x5daad2=dirname(_0x5daad2);}}async function resolveTargetDbBinding(_0xe2eea6,_0x4f6ba6,_0x458e85){const _0xe7bead=a203_0x430d9f,_0x35e7aa=_0x4f6ba6[_0xe7bead(0xb0)];if(!_0x35e7aa)return{'dbId':_0x458e85['dbId'],'dbName':_0x458e85[_0xe7bead(0xcd)]};const _0x20c85b=buildDbDirectoryName(_0x458e85[_0xe7bead(0xcd)],_0x458e85[_0xe7bead(0xe9)]);if(_0x35e7aa===_0x20c85b)return{'dbId':_0x458e85[_0xe7bead(0xe9)],'dbName':_0x458e85[_0xe7bead(0xcd)]};const _0x339294=parseExplicitDbDirectory(_0x35e7aa);if(_0x339294!=null)return{'dbId':_0x339294,'dbName':await getDbName(_0xe2eea6,_0x339294)[_0xe7bead(0xad)](()=>undefined)};const _0x562b71=await listDatabases(_0xe2eea6),_0x342aa7=_0x562b71[_0xe7bead(0xda)](_0x3f6178=>buildDbDirectoryName(_0x3f6178[_0xe7bead(0xcd)],_0x3f6178[_0xe7bead(0xe9)])===_0x35e7aa);if(_0x342aa7[_0xe7bead(0xd5)]===0x1)return{'dbId':_0x342aa7[0x0][_0xe7bead(0xe9)],'dbName':_0x342aa7[0x0][_0xe7bead(0xcd)]};if(_0x342aa7[_0xe7bead(0xd5)]===0x0)throw CliErrors['validation'](_0xe7bead(0xc4)+_0x35e7aa+_0xe7bead(0xb8)+_0x4f6ba6[_0xe7bead(0xac)]+'.');const _0x27db1a=_0x342aa7['map'](_0x4f8255=>_0x4f8255['dbName']+'\x20('+_0x4f8255['dbId']+')')[_0xe7bead(0xcf)](',\x20');throw CliErrors[_0xe7bead(0xc6)](_0xe7bead(0xd4)+_0x35e7aa+_0xe7bead(0xd0)+_0x4f6ba6[_0xe7bead(0xac)]+':\x20'+_0x27db1a);}function parseExplicitDbDirectory(_0x5041b8){const _0x20fc7b=a203_0x430d9f,_0x3c1baf=/^db-(\d+)$/[_0x20fc7b(0xb1)](_0x5041b8);if(!_0x3c1baf)return null;const _0x4a6f5b=Number(_0x3c1baf[0x1]);return Number[_0x20fc7b(0xd2)](_0x4a6f5b)&&_0x4a6f5b>0x0?_0x4a6f5b:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a204_0x23ecdd=a204_0x2321;function a204_0x2321(_0x2e3367,_0x6db48a){_0x2e3367=_0x2e3367-0xfc;const _0xe020d7=a204_0xe020();let _0x2321c1=_0xe020d7[_0x2e3367];return _0x2321c1;}(function(_0x3f43e0,_0x265645){const _0x2486b3=a204_0x2321,_0x3d7043=_0x3f43e0();while(!![]){try{const _0x1db213=-parseInt(_0x2486b3(0x105))/0x1*(-parseInt(_0x2486b3(0x11a))/0x2)+parseInt(_0x2486b3(0x10d))/0x3*(-parseInt(_0x2486b3(0xfd))/0x4)+-parseInt(_0x2486b3(0x104))/0x5+parseInt(_0x2486b3(0x10e))/0x6*(-parseInt(_0x2486b3(0x109))/0x7)+parseInt(_0x2486b3(0x11c))/0x8*(parseInt(_0x2486b3(0x120))/0x9)+-parseInt(_0x2486b3(0x10b))/0xa*(-parseInt(_0x2486b3(0x106))/0xb)+parseInt(_0x2486b3(0x129))/0xc;if(_0x1db213===_0x265645)break;else _0x3d7043['push'](_0x3d7043['shift']());}catch(_0x2de9c1){_0x3d7043['push'](_0x3d7043['shift']());}}}(a204_0xe020,0xdc5a2));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a204_0x23ecdd(0x100);export function buildSqlLockEntry(_0x153fad,_0xb23d73,_0x2a8189,_0x587106){const _0x24e24a=a204_0x23ecdd,_0x51114f=detectSqlMode(_0xb23d73);return{'path':buildSqlRelativePath(_0x153fad[_0x24e24a(0xfe)],_0x153fad['sqlName'],_0x587106?.[_0x24e24a(0x117)],_0x51114f,_0x153fad[_0x24e24a(0x124)]),'hash':_0x2a8189,'remoteId':_0x153fad['id'],'version':_0x153fad[_0x24e24a(0x103)],'dbId':Number(_0x153fad[_0x24e24a(0x124)]),'dbName':_0x587106?.[_0x24e24a(0x117)],'sqlName':_0x153fad[_0x24e24a(0x11f)],'sqlConfig':_0x153fad['sqlConfig']??undefined,'mode':_0x51114f};}export function cloneSqlLockData(_0x57a992){const _0x567832=a204_0x23ecdd;return{'apps':Object[_0x567832(0x111)](Object[_0x567832(0x110)](_0x57a992[_0x567832(0x102)])[_0x567832(0x11b)](([_0x32abea,_0x578461])=>[_0x32abea,{'sqlRoot':_0x578461[_0x567832(0x128)],'lastSync':_0x578461[_0x567832(0x118)],'sqls':{..._0x578461[_0x567832(0x113)]}}]))};}export function ensureRemoteSqlContent(_0x1f5cc9){return _0x1f5cc9['sqlContent']??'';}export function buildLocalSqlFileContent(_0x23f57d,_0x180245,_0xfcc808){const _0x537eb3=a204_0x23ecdd,_0x2410d4=_0xfcc808?.[_0x537eb3(0x114)]??detectSqlMode(_0x180245),_0x1de802=stripLocalSqlMetadata(_0x180245,_0x2410d4)[_0x537eb3(0x115)](),_0x440ab9=[...buildMetadataHeaderLines({'sqlCode':_0x23f57d['sqlCode'],'sqlName':_0x23f57d[_0x537eb3(0x11f)],'dbId':_0x23f57d[_0x537eb3(0x124)],'dbName':_0xfcc808?.['dbName'],'mode':_0x2410d4,'syncedAt':_0xfcc808?.[_0x537eb3(0xfc)],'description':_0xfcc808?.[_0x537eb3(0x116)]},_0x2410d4),'',_0x1de802],_0x105daf=_0x440ab9[_0x537eb3(0x126)]('\x0a');return _0x105daf['endsWith']('\x0a')?_0x105daf:_0x105daf+'\x0a';}export function stripLocalSqlMetadata(_0xb284b2,_0x30c804){const _0x4a3f30=a204_0x23ecdd,_0x6caa68=_0xb284b2[_0x4a3f30(0x101)](/\r\n/g,'\x0a')[_0x4a3f30(0x108)]('\x0a'),_0x190084=[];let _0x45bd5b=0x0;if(_0x30c804===_0x4a3f30(0x122))while(_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)]){const _0x26ac2a=_0x6caa68[_0x45bd5b]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4a3f30(0x127)](_0x26ac2a)){_0x45bd5b++;continue;}if(_0x26ac2a[_0x4a3f30(0x115)]()===''&&_0x45bd5b>0x0){_0x45bd5b++;continue;}break;}else while(_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)]){const _0xd7e206=_0x6caa68[_0x45bd5b]??'';if(/^\s*--\s*@lovrabet\./[_0x4a3f30(0x127)](_0xd7e206)){_0x45bd5b++;continue;}if(_0xd7e206[_0x4a3f30(0x115)]()===''&&_0x45bd5b>0x0){_0x45bd5b++;continue;}break;}for(;_0x45bd5b<_0x6caa68[_0x4a3f30(0x11d)];_0x45bd5b++){_0x190084[_0x4a3f30(0x107)](_0x6caa68[_0x45bd5b]);}return _0x190084[_0x4a3f30(0x126)]('\x0a')[_0x4a3f30(0xff)]();}export function resolveSqlMode(_0x37a50b,_0x483331){const _0x1ca1ee=a204_0x23ecdd;if(_0x483331?.[_0x1ca1ee(0x114)])return _0x483331[_0x1ca1ee(0x114)];return detectSqlMode(_0x37a50b);}export function resolveSqlFileName(_0x105242,_0x5c741b,_0x1b6ad8){const _0x1cffad=a204_0x23ecdd;if(_0x1b6ad8?.[_0x1cffad(0x10a)])return _0x1b6ad8[_0x1cffad(0x10a)];if(_0x1b6ad8?.[_0x1cffad(0x11f)]||_0x1b6ad8?.[_0x1cffad(0x117)])return buildSqlRelativePath(_0x105242,_0x1b6ad8?.[_0x1cffad(0x11f)],_0x1b6ad8?.[_0x1cffad(0x117)],resolveSqlMode(_0x5c741b,_0x1b6ad8),_0x1b6ad8?.[_0x1cffad(0x124)]);return buildDefaultSqlFileName(_0x105242,resolveSqlMode(_0x5c741b,_0x1b6ad8));}function a204_0xe020(){const _0x4606ce=['map','2221160BtSLIX','length','stderr','sqlName','18nDHgsM','toLowerCase','mybatisXml','includes','dbId','filter','join','test','sqlRoot','33132168InmYkF','syncedAt','5836228XRjVji','sqlCode','trimStart','.rabetbase/sql','replace','apps','version','8926035icGoTz','1iyEYcZ','11JHLPrf','push','split','28toWLjs','path','8659430jgmeai','\x20[y/N]\x20','3VdTmfM','185118RIxxKg','close','entries','fromEntries','<!--\x20@lovrabet.','sqls','mode','trim','description','dbName','lastSync','stdin','175982JGmeHa'];a204_0xe020=function(){return _0x4606ce;};return a204_0xe020();}export function resolveSqlLocalDir(_0x2fbd13,_0x46f7cf){return join(_0x2fbd13,SQL_LOCAL_REL_DIR,_0x46f7cf);}export async function confirmForceOverwrite(_0x33b6eb){const _0x23fbef=a204_0x23ecdd,_0xe730cb=createInterface({'input':process[_0x23fbef(0x119)],'output':process[_0x23fbef(0x11e)]}),_0x56915f=await new Promise(_0x245c52=>{const _0x8263ed=_0x23fbef;_0xe730cb['question'](_0x33b6eb+_0x8263ed(0x10c),_0x245c52);});return _0xe730cb[_0x23fbef(0x10f)](),['y','yes'][_0x23fbef(0x123)](_0x56915f['trim']()[_0x23fbef(0x121)]());}export function findSqlLockScope(_0x21602c,_0x585ef3){const _0x546eca=a204_0x23ecdd;return _0x21602c[_0x546eca(0x102)][_0x585ef3];}function buildMetadataHeaderLines(_0x17da0c,_0x5832c9){const _0x42715f=a204_0x23ecdd,_0x3ca6d1=[[_0x42715f(0xfe),_0x17da0c[_0x42715f(0xfe)]],[_0x42715f(0x11f),_0x17da0c['sqlName']],[_0x42715f(0x124),_0x17da0c['dbId']],['dbName',_0x17da0c['dbName']],[_0x42715f(0x114),_0x17da0c['mode']],[_0x42715f(0xfc),_0x17da0c[_0x42715f(0xfc)]],[_0x42715f(0x116),_0x17da0c[_0x42715f(0x116)]]];if(_0x5832c9===_0x42715f(0x122))return _0x3ca6d1[_0x42715f(0x125)](([,_0x36e9a1])=>_0x36e9a1!==undefined&&_0x36e9a1!==null&&String(_0x36e9a1)['trim']()!=='')[_0x42715f(0x11b)](([_0x2c84ac,_0x1e9064])=>_0x42715f(0x112)+_0x2c84ac+':\x20'+String(_0x1e9064)+'\x20-->');return _0x3ca6d1[_0x42715f(0x125)](([,_0x1f3398])=>_0x1f3398!==undefined&&_0x1f3398!==null&&String(_0x1f3398)['trim']()!=='')[_0x42715f(0x11b)](([_0x459ba9,_0x5a0036])=>'--\x20@lovrabet.'+_0x459ba9+':\x20'+String(_0x5a0036));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a205_0x35064e=a205_0x3899;(function(_0x3b69dd,_0x583310){const _0x1026a5=a205_0x3899,_0xd58bd4=_0x3b69dd();while(!![]){try{const _0x1ac0d9=-parseInt(_0x1026a5(0x1a3))/0x1+-parseInt(_0x1026a5(0x184))/0x2*(-parseInt(_0x1026a5(0x17e))/0x3)+parseInt(_0x1026a5(0x19d))/0x4*(-parseInt(_0x1026a5(0x17d))/0x5)+-parseInt(_0x1026a5(0x185))/0x6*(parseInt(_0x1026a5(0x194))/0x7)+parseInt(_0x1026a5(0x183))/0x8*(parseInt(_0x1026a5(0x190))/0x9)+parseInt(_0x1026a5(0x18e))/0xa*(-parseInt(_0x1026a5(0x1a2))/0xb)+parseInt(_0x1026a5(0x192))/0xc*(parseInt(_0x1026a5(0x191))/0xd);if(_0x1ac0d9===_0x583310)break;else _0xd58bd4['push'](_0xd58bd4['shift']());}catch(_0x565af3){_0xd58bd4['push'](_0xd58bd4['shift']());}}}(a205_0x423e,0x9b789));import{listSqlQueries}from'../../core/api-client.js';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';function a205_0x3899(_0x5b75ee,_0x3a6497){_0x5b75ee=_0x5b75ee-0x17d;const _0x423e45=a205_0x423e();let _0x3899dc=_0x423e45[_0x5b75ee];return _0x3899dc;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x365d3c){const _0x1e2da7=a205_0x3899,_0x29e393=[];let _0x140f88=0x1;while(!![]){const _0x3636ca=await listSqlQueries(_0x365d3c,{'currentPage':_0x140f88,'pageSize':PAGE_SIZE}),_0x18b880=_0x3636ca['tableData']??[];_0x29e393[_0x1e2da7(0x18d)](..._0x18b880['map'](_0x45ff22=>_0x45ff22['sqlCode']));if(_0x18b880[_0x1e2da7(0x17f)]===0x0)break;const _0x3aca3a=_0x3636ca['paging']?.[_0x1e2da7(0x18a)];if(_0x3aca3a!=null?_0x29e393['length']>=_0x3aca3a:_0x18b880[_0x1e2da7(0x17f)]<PAGE_SIZE)break;_0x140f88++;}return _0x29e393;}export const sqlStatus={'service':a205_0x35064e(0x186),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a205_0x35064e(0x198),'flags':[{'name':a205_0x35064e(0x180),'type':a205_0x35064e(0x19e),'description':a205_0x35064e(0x18f)}],async 'execute'(_0x189c34){const _0x27266b=a205_0x35064e,_0x4283e0=loadSqlProjectConfig(_0x189c34[_0x27266b(0x188)]),_0x29d140=await readSqlLockFile(_0x4283e0[_0x27266b(0x181)]),{appLock:_0x18cb1f}=ensureSqlLockScope(_0x29d140??createEmptySqlLock(),_0x4283e0[_0x27266b(0x188)],_0x4283e0[_0x27266b(0x19b)],'status'),_0x5516b5=await scanLocalSqlQueries(_0x4283e0),_0x179182=[],_0x55bdc4=[],_0x586e4e=[],_0x323a76=[],_0x305e3e=new Set(_0x5516b5[_0x27266b(0x197)](_0x1fd48e=>_0x1fd48e[_0x27266b(0x182)]));for(const _0x43f54b of _0x5516b5){const _0x172011=await computeSqlFileHash(_0x43f54b[_0x27266b(0x195)]),_0x131c03=_0x18cb1f[_0x27266b(0x1a0)][_0x43f54b[_0x27266b(0x182)]],_0x4fe937=!!_0x131c03&&_0x131c03['path']!==_0x43f54b[_0x27266b(0x19a)],_0x5ac6a8=!!_0x131c03&&!!_0x43f54b['sqlName']&&_0x131c03['sqlName']!==_0x43f54b[_0x27266b(0x1a1)];if(!_0x131c03)_0x179182['push'](_0x43f54b['lockKey']);else _0x131c03[_0x27266b(0x18c)]!==_0x172011||_0x4fe937||_0x5ac6a8?_0x55bdc4[_0x27266b(0x18d)](_0x43f54b[_0x27266b(0x182)]):_0x586e4e[_0x27266b(0x18d)](_0x43f54b['lockKey']);}for(const _0x4b58d8 of Object[_0x27266b(0x189)](_0x18cb1f[_0x27266b(0x1a0)])){!_0x305e3e['has'](_0x4b58d8)&&_0x323a76['push'](_0x4b58d8);}const _0x417793=[];if(_0x189c34[_0x27266b(0x19f)](_0x27266b(0x180))){const _0x221c03=await fetchAllSqlCodes(_0x189c34['appCode']);for(const _0x488e2b of _0x221c03){!_0x305e3e[_0x27266b(0x196)](_0x488e2b)&&!_0x18cb1f[_0x27266b(0x1a0)][_0x488e2b]&&_0x417793['push'](_0x488e2b);}}const _0x3f0354=_0x179182[_0x27266b(0x17f)]===0x0&&_0x55bdc4[_0x27266b(0x17f)]===0x0&&_0x323a76[_0x27266b(0x17f)]===0x0&&_0x417793[_0x27266b(0x17f)]===0x0;return{'ok':!![],'data':{'added':_0x179182,'modified':_0x55bdc4,'missing':_0x323a76,'unchanged':_0x586e4e,'remoteOnly':_0x417793},'message':_0x3f0354?_0x27266b(0x193):_0x179182[_0x27266b(0x17f)]+_0x27266b(0x19c)+_0x55bdc4['length']+_0x27266b(0x18b)+_0x323a76[_0x27266b(0x17f)]+_0x27266b(0x187)+_0x586e4e[_0x27266b(0x17f)]+_0x27266b(0x199)+(_0x417793[_0x27266b(0x17f)]>0x0?',\x20'+_0x417793[_0x27266b(0x17f)]+'\x20remote-only':'')};}};function a205_0x423e(){const _0x41858e=['13OsJIrf','487164JcqgTi','All\x20SQL\x20queries\x20are\x20in\x20sync.','25809yjLoCb','filePath','has','map','read','\x20unchanged','relativePath','sqlRoot','\x20added,\x20','4168wqfPTj','boolean','bool','sqls','sqlName','2412091hOvRfA','402117nnHPaB','70vBBKSO','3OOlwIg','length','remote','lockFilePath','lockKey','152qpNBUL','2033398awCZBI','186MDajOA','sql','\x20missing,\x20','appCode','keys','totalCount','\x20modified,\x20','hash','push','40tMMKzm','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','467829lqsdwA'];a205_0x423e=function(){return _0x41858e;};return a205_0x423e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a206_0x1e95(){const _0x21267e=['flagMissing','Dataset\x20\x22','\x22\x20not\x20found\x20or\x20not\x20accessible','index_type','588087qewYPY','10bYrXnB','528610zccPTa','bool','valid','map','name','index_name','message','trim','820308Bvstbu','isSelectOnly','192782UDmTBX','columnNames','schemas','12RyYFMt','fields','51732Bltycc','sqlType','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','SQL\x20schema\x20validation','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','dbtableConfig','1239892XKaCWJ','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','type','parameters','split','isDangerous','filter','size','unshift','File\x20not\x20found:\x20','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','validation','66nbfRAM','schema:','526112AakifH','columns','tables','utf-8','toLowerCase','Table\x20\x22','pkField','primary','14dKbjgR','isArray','push','\x22\x20not\x20found\x20in\x20any\x20dataset','string','find','dataset','tableName','Provide\x20--file\x20or\x20--sql','index_columns','file','flatMap','indexes','str','indexName','sql','cwd','length','reason','schemaWarnings','--check-indexes\x20requires\x20--schemas.','117IhJVvQ','read'];a206_0x1e95=function(){return _0x21267e;};return a206_0x1e95();}const a206_0x5e6cdc=a206_0x2f49;(function(_0x579e7b,_0x1e3e16){const _0x3ac189=a206_0x2f49,_0x554965=_0x579e7b();while(!![]){try{const _0xa976c9=parseInt(_0x3ac189(0xd8))/0x1+parseInt(_0x3ac189(0xe4))/0x2*(parseInt(_0x3ac189(0xe7))/0x3)+-parseInt(_0x3ac189(0xef))/0x4+parseInt(_0x3ac189(0xd9))/0x5*(parseInt(_0x3ac189(0xe9))/0x6)+parseInt(_0x3ac189(0xbd))/0x7*(parseInt(_0x3ac189(0xb5))/0x8)+-parseInt(_0x3ac189(0xd2))/0x9*(parseInt(_0x3ac189(0xda))/0xa)+-parseInt(_0x3ac189(0xb3))/0xb*(-parseInt(_0x3ac189(0xe2))/0xc);if(_0xa976c9===_0x1e3e16)break;else _0x554965['push'](_0x554965['shift']());}catch(_0xc5c79e){_0x554965['push'](_0x554965['shift']());}}}(a206_0x1e95,0x82b73));import{readFileSync,existsSync}from'node:fs';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';function a206_0x2f49(_0x10db58,_0x5a3ef5){_0x10db58=_0x10db58-0xb2;const _0x1e95a9=a206_0x1e95();let _0x2f49ab=_0x1e95a9[_0x10db58];return _0x2f49ab;}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':'sql','command':'validate','description':a206_0x5e6cdc(0xed),'risk':a206_0x5e6cdc(0xd3),'flags':[{'name':a206_0x5e6cdc(0xc7),'type':a206_0x5e6cdc(0xc1),'description':a206_0x5e6cdc(0xf0)},{'name':a206_0x5e6cdc(0xcc),'type':a206_0x5e6cdc(0xc1),'description':a206_0x5e6cdc(0xf9)},{'name':'schemas','type':a206_0x5e6cdc(0xc1),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':'check-indexes','type':'boolean','description':a206_0x5e6cdc(0xeb)}],async 'execute'(_0x24c65f){const _0x4e808c=a206_0x5e6cdc,_0x1d209d=_0x24c65f[_0x4e808c(0xca)]('file'),_0x38fdee=_0x24c65f[_0x4e808c(0xca)]('sql'),_0x5e8fa5=_0x24c65f[_0x4e808c(0xca)](_0x4e808c(0xe6)),_0x246cab=_0x24c65f[_0x4e808c(0xdb)]('check-indexes');if(!_0x1d209d&&!_0x38fdee)throw CliErrors[_0x4e808c(0xd4)](_0x4e808c(0xc7),_0x4e808c(0xc5));if(_0x246cab&&!_0x5e8fa5)throw CliErrors[_0x4e808c(0xb2)](_0x4e808c(0xd1));let _0x4e9897;if(_0x1d209d){const _0x2daa47=resolve(process[_0x4e808c(0xcd)](),_0x1d209d);if(!existsSync(_0x2daa47))throw CliErrors[_0x4e808c(0xb2)](_0x4e808c(0xf8)+_0x2daa47);_0x4e9897=readFileSync(_0x2daa47,_0x4e808c(0xb8));}else _0x4e9897=_0x38fdee;const _0x2733b4=validateSql(_0x4e9897),_0x26671d={'valid':_0x2733b4['valid'],'sqlType':_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xf1)],'isSelectOnly':_0x2733b4['sqlType'][_0x4e808c(0xe3)],'isDangerous':_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xf4)],'tables':_0x2733b4[_0x4e808c(0xb7)],'parameters':_0x2733b4[_0x4e808c(0xf2)],'message':_0x2733b4[_0x4e808c(0xe0)]};_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xcf)]&&(_0x26671d[_0x4e808c(0xcf)]=_0x2733b4[_0x4e808c(0xea)][_0x4e808c(0xcf)]);if(_0x5e8fa5&&_0x2733b4[_0x4e808c(0xdc)]){const _0x557a64=_0x5e8fa5['split'](',')[_0x4e808c(0xdd)](_0x44ed5e=>_0x44ed5e['trim']())[_0x4e808c(0xf5)](Boolean),_0x18d5ed=[],_0x2867ba=[],_0x3fb6df=filterDbTableBackedDatasets(await listDatasets(_0x24c65f['appCode'])),_0x1f2fa2=new Map(_0x3fb6df['map'](_0x1d1eb6=>[_0x1d1eb6[_0x4e808c(0xee)]?.[_0x4e808c(0xc4)]?.[_0x4e808c(0xb9)](),_0x1d1eb6]));for(const _0x54faab of _0x2733b4['tables']){const _0x5e8cf1=_0x1f2fa2['get'](_0x54faab[_0x4e808c(0xb9)]());!_0x5e8cf1&&_0x18d5ed['push'](_0x4e808c(0xba)+_0x54faab+_0x4e808c(0xc0));}for(const _0xa27d19 of _0x557a64){let _0x310c0c;try{_0x310c0c=await getDatasetDetail(_0xa27d19);}catch{_0x18d5ed[_0x4e808c(0xbf)](_0x4e808c(0xd5)+_0xa27d19+_0x4e808c(0xd6));continue;}assertDatasetIsDbTableBacked(_0x310c0c,_0x4e808c(0xec));const _0x171439=Array[_0x4e808c(0xbe)](_0x310c0c[_0x4e808c(0xe8)])?_0x310c0c[_0x4e808c(0xe8)]:[],_0x550f78=new Set(_0x171439[_0x4e808c(0xdd)](_0x1f3da1=>_0x1f3da1[_0x4e808c(0xde)]?.['toLowerCase']())),_0x48618e=_0x310c0c[_0x4e808c(0xee)]?.[_0x4e808c(0xc4)]||_0x310c0c[_0x4e808c(0xc4)]||_0xa27d19;_0x26671d[_0x4e808c(0xb4)+_0x48618e]={'code':_0xa27d19,'tableName':_0x48618e,'fieldCount':_0x550f78[_0x4e808c(0xf6)],'fields':Array['from'](_0x550f78)};if(_0x246cab){const _0x34ab1c=normalizeDatasetIndexes(_0x310c0c);_0x2867ba['push']({'tableName':_0x48618e,..._0x34ab1c});}}_0x18d5ed['length']>0x0&&(_0x26671d[_0x4e808c(0xd0)]=_0x18d5ed),_0x246cab&&(_0x26671d['joinAudit']=auditSqlJoinIndexes(_0x4e9897,_0x2867ba));}return{'ok':_0x2733b4[_0x4e808c(0xdc)],'data':_0x26671d,'message':_0x2733b4[_0x4e808c(0xe0)]};}};function normalizeDatasetIndexes(_0x37d6c5){const _0x8f71c7=a206_0x5e6cdc,_0x1f655c=Array[_0x8f71c7(0xbe)](_0x37d6c5?.[_0x8f71c7(0xc3)]?.[_0x8f71c7(0xc9)])?_0x37d6c5[_0x8f71c7(0xc3)][_0x8f71c7(0xc9)]:Array[_0x8f71c7(0xbe)](_0x37d6c5?.[_0x8f71c7(0xc9)])?_0x37d6c5[_0x8f71c7(0xc9)]:[],_0x3a8a4f=_0x1f655c[_0x8f71c7(0xc8)](_0x5f48a2=>{const _0x30f5e0=_0x8f71c7,_0x2f913a=Array['isArray'](_0x5f48a2?.[_0x30f5e0(0xc6)])?_0x5f48a2[_0x30f5e0(0xc6)]:Array[_0x30f5e0(0xbe)](_0x5f48a2?.[_0x30f5e0(0xe5)])?_0x5f48a2[_0x30f5e0(0xe5)]:Array[_0x30f5e0(0xbe)](_0x5f48a2?.['columns'])?_0x5f48a2[_0x30f5e0(0xb6)]:[],_0x271225=_0x2f913a['filter'](_0x218400=>typeof _0x218400===_0x30f5e0(0xc1))[_0x30f5e0(0xdd)](_0x121aa3=>_0x121aa3[_0x30f5e0(0xe1)]())[_0x30f5e0(0xf5)](Boolean);if(_0x271225[_0x30f5e0(0xce)]===0x0)return[];const _0x1b7808=[_0x5f48a2?.[_0x30f5e0(0xcb)],_0x5f48a2?.[_0x30f5e0(0xdf)],_0x5f48a2?.[_0x30f5e0(0xde)]][_0x30f5e0(0xc2)](_0x4d8d6d=>typeof _0x4d8d6d===_0x30f5e0(0xc1)&&_0x4d8d6d[_0x30f5e0(0xe1)]()),_0x31e09b=[_0x5f48a2?.[_0x30f5e0(0xd7)],_0x5f48a2?.[_0x30f5e0(0xf1)]][_0x30f5e0(0xc2)](_0x2f0e13=>typeof _0x2f0e13===_0x30f5e0(0xc1)&&_0x2f0e13[_0x30f5e0(0xe1)]());return[{..._0x1b7808?{'name':_0x1b7808[_0x30f5e0(0xe1)]()}:{},..._0x31e09b?{'type':_0x31e09b[_0x30f5e0(0xe1)]()}:{},'columns':_0x271225}];}),_0x18b56c=[..._0x3a8a4f],_0x571867=typeof _0x37d6c5?.['dbtableConfig']?.['pkField']===_0x8f71c7(0xc1)?_0x37d6c5[_0x8f71c7(0xee)][_0x8f71c7(0xbb)][_0x8f71c7(0xf3)](',')[_0x8f71c7(0xdd)](_0x325003=>_0x325003[_0x8f71c7(0xe1)]())['filter'](Boolean):[];return _0x571867[_0x8f71c7(0xce)]>0x0&&_0x18b56c[_0x8f71c7(0xf7)]({'type':_0x8f71c7(0xbc),'columns':_0x571867}),{'indexes':_0x18b56c,'metadataAvailable':_0x3a8a4f[_0x8f71c7(0xce)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25fb9e,_0x1a7bac){const _0x18aedf=a207_0x14f5,_0x25b798=_0x25fb9e();while(!![]){try{const _0x48e4c7=parseInt(_0x18aedf(0x1cf))/0x1*(-parseInt(_0x18aedf(0x1d0))/0x2)+parseInt(_0x18aedf(0x1d7))/0x3*(parseInt(_0x18aedf(0x1da))/0x4)+parseInt(_0x18aedf(0x1d2))/0x5*(-parseInt(_0x18aedf(0x1d4))/0x6)+-parseInt(_0x18aedf(0x1d1))/0x7*(-parseInt(_0x18aedf(0x1d5))/0x8)+parseInt(_0x18aedf(0x1d3))/0x9*(-parseInt(_0x18aedf(0x1d9))/0xa)+parseInt(_0x18aedf(0x1d6))/0xb+parseInt(_0x18aedf(0x1ce))/0xc*(parseInt(_0x18aedf(0x1d8))/0xd);if(_0x48e4c7===_0x1a7bac)break;else _0x25b798['push'](_0x25b798['shift']());}catch(_0x30f856){_0x25b798['push'](_0x25b798['shift']());}}}(a207_0x2411,0xc28d7));import{taskStatus}from'../../commands/task/status.js';function a207_0x2411(){const _0x5a09a0=['3qUNmLT','2109991KGxYeH','170WijlcY','2552848Vckiuo','96kIapCt','1491715wdMSZi','2yqsHzp','7117733ziYuLl','5cfawxP','682551eXTYVm','2615622ilrtvE','8EogSFJ','11663465VWcMir'];a207_0x2411=function(){return _0x5a09a0;};return a207_0x2411();}function a207_0x14f5(_0x48024c,_0x2c39e0){_0x48024c=_0x48024c-0x1ce;const _0x2411a3=a207_0x2411();let _0x14f5a9=_0x2411a3[_0x48024c];return _0x14f5a9;}export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a208_0x2641(_0x53f808,_0x4e9599){_0x53f808=_0x53f808-0x15e;const _0x39770d=a208_0x3977();let _0x2641a0=_0x39770d[_0x53f808];return _0x2641a0;}const a208_0x1426f7=a208_0x2641;(function(_0x423d54,_0x2dd04d){const _0xba3bdc=a208_0x2641,_0x166a53=_0x423d54();while(!![]){try{const _0x34cde2=parseInt(_0xba3bdc(0x174))/0x1+parseInt(_0xba3bdc(0x16b))/0x2*(parseInt(_0xba3bdc(0x172))/0x3)+-parseInt(_0xba3bdc(0x168))/0x4*(-parseInt(_0xba3bdc(0x16c))/0x5)+-parseInt(_0xba3bdc(0x170))/0x6*(parseInt(_0xba3bdc(0x176))/0x7)+-parseInt(_0xba3bdc(0x15e))/0x8+parseInt(_0xba3bdc(0x167))/0x9*(parseInt(_0xba3bdc(0x16d))/0xa)+parseInt(_0xba3bdc(0x173))/0xb*(-parseInt(_0xba3bdc(0x171))/0xc);if(_0x34cde2===_0x2dd04d)break;else _0x166a53['push'](_0x166a53['shift']());}catch(_0x3a3ce2){_0x166a53['push'](_0x166a53['shift']());}}}(a208_0x3977,0x76179));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a208_0x3977(){const _0x5e2b09=['taskId','trim','1999410QSiXar','1008bAwYjz','3ipCmvG','128546aCPXFd','514102jOKtQZ','task','7mcArSY','1034504jdNCpW','appCode','read','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','flagMissing','isTerminal','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','apiError','task-id','558zqZwbX','4dfewFE','status','str','717638tZqnaH','3432140nPpMwt','59440BkENuy'];a208_0x3977=function(){return _0x5e2b09;};return a208_0x3977();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a208_0x1426f7(0x175),'command':a208_0x1426f7(0x169),'description':a208_0x1426f7(0x161),'risk':a208_0x1426f7(0x160),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a208_0x1426f7(0x166),'type':'string','required':!![],'description':'Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x45d950){const _0x1919f8=a208_0x1426f7;if(!_0x45d950[_0x1919f8(0x16a)](_0x1919f8(0x166))['trim']())throw CliErrors[_0x1919f8(0x162)](_0x1919f8(0x166));},async 'execute'(_0x27371c){const _0x37196b=a208_0x1426f7,_0x180d9e=_0x27371c['str'](_0x37196b(0x166))[_0x37196b(0x16f)](),_0x466182=normalizeAsyncTask(await getAsyncTaskStatus(_0x180d9e,_0x27371c[_0x37196b(0x15f)],_0x27371c['cookie']));if(_0x466182[_0x37196b(0x16e)]!==_0x180d9e)throw CliErrors[_0x37196b(0x165)](_0x37196b(0x164)+_0x180d9e+',\x20received\x20'+_0x466182[_0x37196b(0x16e)]+'.');const _0x21ceb6=buildAsyncTaskStatusCommand(_0x466182[_0x37196b(0x16e)],_0x27371c['appCode']);return{'ok':!![],'message':asyncTaskMessage(_0x466182),'data':{'appCode':_0x27371c['appCode'],..._0x466182,'query':_0x466182[_0x37196b(0x163)]?null:{'command':_0x21ceb6}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x154e99,_0x5ef9d5){const _0x134c81=a209_0x3832,_0xb1debf=_0x154e99();while(!![]){try{const _0x135445=parseInt(_0x134c81(0x17a))/0x1*(parseInt(_0x134c81(0x17c))/0x2)+-parseInt(_0x134c81(0x180))/0x3+-parseInt(_0x134c81(0x17f))/0x4*(-parseInt(_0x134c81(0x17b))/0x5)+-parseInt(_0x134c81(0x17d))/0x6*(-parseInt(_0x134c81(0x181))/0x7)+-parseInt(_0x134c81(0x182))/0x8*(-parseInt(_0x134c81(0x179))/0x9)+parseInt(_0x134c81(0x17e))/0xa+-parseInt(_0x134c81(0x183))/0xb;if(_0x135445===_0x5ef9d5)break;else _0xb1debf['push'](_0xb1debf['shift']());}catch(_0xed91c6){_0xb1debf['push'](_0xb1debf['shift']());}}}(a209_0x19ec,0x6fd55));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a209_0x3832(_0x931532,_0x414f80){_0x931532=_0x931532-0x179;const _0x19ecbd=a209_0x19ec();let _0x383291=_0x19ecbd[_0x931532];return _0x383291;}function a209_0x19ec(){const _0x1a14ef=['429669szBpSD','478817mKuRhf','13105PGwBbT','2MCfKEQ','6OcDOxh','4995010KRJyOg','80YLnknL','692364PPNYlE','340011sJGZKb','24IaeYPm','5870447RlJdtv'];a209_0x19ec=function(){return _0x1a14ef;};return a209_0x19ec();}export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a210_0x48396f=a210_0x3df2;(function(_0x381e0c,_0x3343e0){const _0x57582f=a210_0x3df2,_0x4caf79=_0x381e0c();while(!![]){try{const _0xac2baf=parseInt(_0x57582f(0x16e))/0x1*(-parseInt(_0x57582f(0x171))/0x2)+-parseInt(_0x57582f(0x163))/0x3*(-parseInt(_0x57582f(0x16f))/0x4)+-parseInt(_0x57582f(0x170))/0x5+-parseInt(_0x57582f(0x165))/0x6*(parseInt(_0x57582f(0x172))/0x7)+parseInt(_0x57582f(0x169))/0x8+-parseInt(_0x57582f(0x161))/0x9+parseInt(_0x57582f(0x16b))/0xa;if(_0xac2baf===_0x3343e0)break;else _0x4caf79['push'](_0x4caf79['shift']());}catch(_0x111c46){_0x4caf79['push'](_0x4caf79['shift']());}}}(a210_0x1168,0x514bb));function a210_0x3df2(_0x1d6ae1,_0x30e509){_0x1d6ae1=_0x1d6ae1-0x15d;const _0x1168f5=a210_0x1168();let _0x3df25e=_0x1168f5[_0x1d6ae1];return _0x3df25e;}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a210_0x1168(){const _0x5c95ba=['List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','6eWbbsS','length','Exact\x20tenant\x20code','read','1477032qYxBfa','Pass\x20--tenant-code\x20<code>.','11736380qpEXun','tenant','trim','3JFTycQ','1294780dDFxRJ','2913300IifSkE','39588Jltuhu','4020331ytrqxn','members-list','flagMissing','tenant-code','\x20tenant\x20member(s)','string','str','4106655KEMqUU','Found\x20','6mGBSwV'];a210_0x1168=function(){return _0x5c95ba;};return a210_0x1168();}import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a210_0x48396f(0x16c),'command':a210_0x48396f(0x173),'description':a210_0x48396f(0x164),'risk':a210_0x48396f(0x168),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a210_0x48396f(0x15d),'type':a210_0x48396f(0x15f),'required':!![],'description':a210_0x48396f(0x167)}],async 'validate'(_0x493247){const _0x2e3f0f=a210_0x48396f;if(!_0x493247[_0x2e3f0f(0x160)](_0x2e3f0f(0x15d))[_0x2e3f0f(0x16d)]())throw CliErrors[_0x2e3f0f(0x174)](_0x2e3f0f(0x15d),_0x2e3f0f(0x16a));},async 'execute'(_0x3403b0){const _0x32df77=a210_0x48396f,_0x675604=_0x3403b0[_0x32df77(0x160)](_0x32df77(0x15d))[_0x32df77(0x16d)](),_0x29a6c4=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x675604,_0x29a6c4);const _0x41ad75=projectTenantMembers(await listTenantDirectoryMembers(_0x675604));return{'ok':!![],'data':{'tenantCode':_0x675604,'items':_0x41ad75,'totalCount':_0x41ad75[_0x32df77(0x166)]},'message':_0x32df77(0x162)+_0x41ad75['length']+_0x32df77(0x15e)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a211_0x5cc9(_0xeb6b7f,_0x4ca448){_0xeb6b7f=_0xeb6b7f-0x7b;const _0x3b0354=a211_0x3b03();let _0x5cc9ae=_0x3b0354[_0xeb6b7f];return _0x5cc9ae;}function a211_0x3b03(){const _0x58e17c=['22vugBTM','sort','tenantCode','trim','username','validation','some','status','Tenant\x20\x22','578237eYOjpr','3FEfOVP','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','values','ADMIN','adminFlag','4585004OGxvuE','nickname','14973867eiHoFt','31932tnVPtO','set','displayName','9302175Xscuie','role','8cBupUH','2729126aCDljO','userId','2527VEmuvP','8963380mhUkdX'];a211_0x3b03=function(){return _0x58e17c;};return a211_0x3b03();}(function(_0x3bbecb,_0x147bca){const _0x2680e1=a211_0x5cc9,_0x3c209f=_0x3bbecb();while(!![]){try{const _0x3ad8c7=parseInt(_0x2680e1(0x80))/0x1+parseInt(_0x2680e1(0x90))/0x2*(parseInt(_0x2680e1(0x81))/0x3)+-parseInt(_0x2680e1(0x87))/0x4+-parseInt(_0x2680e1(0x8d))/0x5+parseInt(_0x2680e1(0x8a))/0x6*(parseInt(_0x2680e1(0x92))/0x7)+parseInt(_0x2680e1(0x8f))/0x8*(-parseInt(_0x2680e1(0x89))/0x9)+-parseInt(_0x2680e1(0x93))/0xa*(-parseInt(_0x2680e1(0x94))/0xb);if(_0x3ad8c7===_0x147bca)break;else _0x3c209f['push'](_0x3c209f['shift']());}catch(_0x1cf440){_0x3c209f['push'](_0x3c209f['shift']());}}}(a211_0x3b03,0xf0c9d));import{CliErrors}from'../../errors.js';function textOrNull(_0x3314e8){const _0x5a26d7=a211_0x5cc9,_0xca3e42=_0x3314e8?.[_0x5a26d7(0x97)]();return _0xca3e42?_0xca3e42:null;}export function projectTenantMembers(_0x6b11bc){const _0x4c1f13=a211_0x5cc9,_0x4a69bc=new Map();for(const _0x1e5763 of _0x6b11bc){const _0x3e6bf0=Number(_0x1e5763[_0x4c1f13(0x91)]);if(!Number['isFinite'](_0x3e6bf0)||_0x3e6bf0<=0x0)continue;const _0x5570a5={'userId':_0x3e6bf0,'username':textOrNull(_0x1e5763[_0x4c1f13(0x7b)]),'displayName':textOrNull(_0x1e5763[_0x4c1f13(0x88)]),'role':_0x1e5763[_0x4c1f13(0x86)]===!![]?'ADMIN':'MEMBER','status':textOrNull(_0x1e5763[_0x4c1f13(0x7e)])},_0x35603a=_0x4a69bc['get'](_0x3e6bf0);if(!_0x35603a){_0x4a69bc[_0x4c1f13(0x8b)](_0x3e6bf0,_0x5570a5);continue;}_0x35603a[_0x4c1f13(0x7b)]??=_0x5570a5[_0x4c1f13(0x7b)],_0x35603a[_0x4c1f13(0x8c)]??=_0x5570a5[_0x4c1f13(0x8c)],_0x35603a[_0x4c1f13(0x7e)]??=_0x5570a5[_0x4c1f13(0x7e)];if(_0x5570a5['role']===_0x4c1f13(0x85))_0x35603a[_0x4c1f13(0x8e)]=_0x4c1f13(0x85);}return[..._0x4a69bc[_0x4c1f13(0x84)]()][_0x4c1f13(0x95)]((_0xac0358,_0x2521e5)=>_0xac0358[_0x4c1f13(0x91)]-_0x2521e5[_0x4c1f13(0x91)]);}export function assertTenantAccessible(_0x7f8a97,_0x3f2120){const _0x201205=a211_0x5cc9;if(_0x3f2120[_0x201205(0x7d)](_0x135a55=>_0x135a55[_0x201205(0x96)]===_0x7f8a97))return;throw CliErrors[_0x201205(0x7c)](_0x201205(0x7f)+_0x7f8a97+_0x201205(0x82),_0x201205(0x83));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a212_0x3c1fe2=a212_0x1d6d;(function(_0x58e3a4,_0x2d486f){const _0x4d0eec=a212_0x1d6d,_0x234d16=_0x58e3a4();while(!![]){try{const _0x4bfba9=parseInt(_0x4d0eec(0x7e))/0x1+parseInt(_0x4d0eec(0x7c))/0x2*(-parseInt(_0x4d0eec(0x6d))/0x3)+-parseInt(_0x4d0eec(0x74))/0x4+-parseInt(_0x4d0eec(0x79))/0x5*(parseInt(_0x4d0eec(0x6c))/0x6)+-parseInt(_0x4d0eec(0x70))/0x7*(-parseInt(_0x4d0eec(0x75))/0x8)+-parseInt(_0x4d0eec(0x80))/0x9+parseInt(_0x4d0eec(0x7d))/0xa;if(_0x4bfba9===_0x2d486f)break;else _0x234d16['push'](_0x234d16['shift']());}catch(_0x2eb800){_0x234d16['push'](_0x234d16['shift']());}}}(a212_0xd493,0xb99f7));import{asDryRunResult}from'../../commands/common/dry-run.js';function a212_0x1d6d(_0x352838,_0x54c7a2){_0x352838=_0x352838-0x6b;const _0xd49370=a212_0xd493();let _0x1d6d6f=_0xd49370[_0x352838];return _0x1d6d6f;}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID='dingtalk',CURRENT_BINDING_WARNING=a212_0x3c1fe2(0x78);function a212_0xd493(){const _0x54ec1d=['6hZNYZV','49701oyGOlj','ding-talk-user-id','str','3558751iRCYIC','write','trim','--ding-talk-user-id\x20cannot\x20be\x20empty.','5882584QAbyXb','16KHiaAB','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','7106065whywqX','validation','apiError','182GagUrP','42761530DIvdtH','1370455kaGAGc','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','13532643PVWmCj','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','POST','bind'];a212_0xd493=function(){return _0x54ec1d;};return a212_0xd493();}function readDingTalkUserId(_0x1f12ff){const _0x1cf416=a212_0x3c1fe2,_0x4031a3=_0x1f12ff[_0x1cf416(0x6f)](_0x1cf416(0x6e))[_0x1cf416(0x72)]();if(!_0x4031a3)throw CliErrors[_0x1cf416(0x7a)](_0x1cf416(0x73),_0x1cf416(0x77));return _0x4031a3;}function buildBindingData(_0xa73ff4,_0x509fbe){const _0x2aab86=a212_0x3c1fe2;return{'operation':_0x2aab86(0x6b),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xa73ff4},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0xa73ff4,'bound':!![]},'dryRun':_0x509fbe,'backend':{'method':_0x2aab86(0x82),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':'user-account','command':'dingding-sandbox-bind','description':a212_0x3c1fe2(0x81),'risk':a212_0x3c1fe2(0x71),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a212_0x3c1fe2(0x6e),'type':'string','required':!![],'description':a212_0x3c1fe2(0x7f)}],async 'validate'(_0x5e19fc){readDingTalkUserId(_0x5e19fc);},async 'dryRun'(_0x300469){const _0x10d785=a212_0x3c1fe2,_0x3c2520=readDingTalkUserId(_0x300469);return asDryRunResult(buildBindingData(_0x3c2520,!![]),{'method':_0x10d785(0x82),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x2a331a){const _0x32a927=a212_0x3c1fe2,_0x4d199f=readDingTalkUserId(_0x2a331a),_0x51f1e8=await bindDingTalkSandboxAccount(_0x4d199f);if(_0x51f1e8!==!![])throw CliErrors[_0x32a927(0x7b)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x32a927(0x76));return{'ok':!![],'data':buildBindingData(_0x4d199f,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf30678,_0x2d38c7){const _0x5e6958=a213_0x274b,_0x445a3=_0xf30678();while(!![]){try{const _0x2985b3=parseInt(_0x5e6958(0x69))/0x1+-parseInt(_0x5e6958(0x6b))/0x2*(-parseInt(_0x5e6958(0x70))/0x3)+-parseInt(_0x5e6958(0x6f))/0x4+-parseInt(_0x5e6958(0x74))/0x5*(parseInt(_0x5e6958(0x6e))/0x6)+-parseInt(_0x5e6958(0x6d))/0x7*(parseInt(_0x5e6958(0x6a))/0x8)+-parseInt(_0x5e6958(0x72))/0x9*(-parseInt(_0x5e6958(0x6c))/0xa)+-parseInt(_0x5e6958(0x73))/0xb*(-parseInt(_0x5e6958(0x71))/0xc);if(_0x2985b3===_0x2d38c7)break;else _0x445a3['push'](_0x445a3['shift']());}catch(_0x4512b7){_0x445a3['push'](_0x445a3['shift']());}}}(a213_0xa006,0x36fda));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a213_0x274b(_0x55e6bb,_0x170b86){_0x55e6bb=_0x55e6bb-0x69;const _0xa0064b=a213_0xa006();let _0x274b63=_0xa0064b[_0x55e6bb];return _0x274b63;}export const userAccountDefinitions=[dingTalkSandboxBind];function a213_0xa006(){const _0x54f7a9=['1561030bwVIbU','324466dLfOCg','6424RpYDfj','98QXAECV','891190WtjyWQ','3661BOjOUd','6owHVpU','144684QwASCt','15837Tzinep','35376zGoHvU','9itfctU','1199djPxfz'];a213_0xa006=function(){return _0x54f7a9;};return a213_0xa006();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a214_0x1214(_0x225123,_0x203333){_0x225123=_0x225123-0x19d;const _0x51abaf=a214_0x51ab();let _0x1214aa=_0x51abaf[_0x225123];return _0x1214aa;}const a214_0xff0c27=a214_0x1214;function a214_0x51ab(){const _0x5f1cc3=['9VGMLxd','4734NgEmvm','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','973ihaxrB','68210sgQCEh','1ZqJebn','workspace','20dqSrur','25688etuFZm','18883980wEerRl','5405cETwhi','workspace\x20add','name','3874574kmHDom','490344JjyxFR','1553526pekXXd'];a214_0x51ab=function(){return _0x5f1cc3;};return a214_0x51ab();}(function(_0x58887f,_0x1ba130){const _0x21b962=a214_0x1214,_0x29b006=_0x58887f();while(!![]){try{const _0x5846a7=-parseInt(_0x21b962(0x1a9))/0x1*(parseInt(_0x21b962(0x1a8))/0x2)+-parseInt(_0x21b962(0x1a4))/0x3*(parseInt(_0x21b962(0x1a2))/0x4)+parseInt(_0x21b962(0x19e))/0x5*(-parseInt(_0x21b962(0x1a5))/0x6)+-parseInt(_0x21b962(0x1a7))/0x7*(parseInt(_0x21b962(0x1ac))/0x8)+parseInt(_0x21b962(0x1a3))/0x9+parseInt(_0x21b962(0x1ab))/0xa*(parseInt(_0x21b962(0x1a1))/0xb)+parseInt(_0x21b962(0x19d))/0xc;if(_0x5846a7===_0x1ba130)break;else _0x29b006['push'](_0x29b006['shift']());}catch(_0x33f647){_0x29b006['push'](_0x29b006['shift']());}}}(a214_0x51ab,0xb704e));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a214_0xff0c27(0x1aa),'command':'add','description':a214_0xff0c27(0x1a6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a214_0xff0c27(0x1a0),'description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x3b542d=>validateAppName(_0x3b542d,a214_0xff0c27(0x19f)),'execute':_0x24fd8e=>runAppAdd(_0x24fd8e,a214_0xff0c27(0x19f))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a215_0x2572ff=a215_0x51d2;(function(_0x5f256d,_0x3ce979){const _0x4c76d0=a215_0x51d2,_0x185751=_0x5f256d();while(!![]){try{const _0x5f27be=-parseInt(_0x4c76d0(0x143))/0x1*(parseInt(_0x4c76d0(0x14b))/0x2)+parseInt(_0x4c76d0(0x153))/0x3+-parseInt(_0x4c76d0(0x138))/0x4+-parseInt(_0x4c76d0(0x158))/0x5*(parseInt(_0x4c76d0(0x135))/0x6)+-parseInt(_0x4c76d0(0x152))/0x7*(-parseInt(_0x4c76d0(0x13d))/0x8)+-parseInt(_0x4c76d0(0x12d))/0x9*(-parseInt(_0x4c76d0(0x13a))/0xa)+parseInt(_0x4c76d0(0x132))/0xb;if(_0x5f27be===_0x3ce979)break;else _0x185751['push'](_0x185751['shift']());}catch(_0x45bb25){_0x185751['push'](_0x185751['shift']());}}}(a215_0x4dd1,0xce792));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{collectDeploymentSyncProfile,getDeploymentSyncProfileFlagDefs}from'../../config/deployment-sync.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a215_0x2572ff(0x151),SAFE_PROFILE_KEYS=[a215_0x2572ff(0x124),a215_0x2572ff(0x128),a215_0x2572ff(0x14c),a215_0x2572ff(0x12b),'pageSize',a215_0x2572ff(0x11e),a215_0x2572ff(0x12e),a215_0x2572ff(0x148)],workspaceFlags=[{'name':a215_0x2572ff(0x13c),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x150)},{'name':a215_0x2572ff(0x124),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x134)},{'name':a215_0x2572ff(0x128),'type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x159),'enum':[...RABETBASE_ENV_VALUES]},{'name':a215_0x2572ff(0x14c),'type':'string','description':a215_0x2572ff(0x141)},{'name':'defaultFormat','type':'string','description':a215_0x2572ff(0x145),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a215_0x2572ff(0x14f),'type':a215_0x2572ff(0x147),'description':a215_0x2572ff(0x142)},{'name':'riskLevel','type':a215_0x2572ff(0x136),'description':a215_0x2572ff(0x126),'enum':[...RISK_LEVEL_VALUES]},{'name':a215_0x2572ff(0x12e),'type':a215_0x2572ff(0x136),'description':'App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)'},...getDeploymentSyncProfileFlagDefs()];function a215_0x51d2(_0x4cfde2,_0x10aa06){_0x4cfde2=_0x4cfde2-0x11d;const _0x4dd19f=a215_0x4dd1();let _0x51d274=_0x4dd19f[_0x4cfde2];return _0x51d274;}function isRecord(_0x3ab684){const _0x2cdf8d=a215_0x2572ff;return!!_0x3ab684&&typeof _0x3ab684==='object'&&!Array[_0x2cdf8d(0x12c)](_0x3ab684);}function a215_0x4dd1(){const _0x140d6b=['riskLevel','Invalid\x20appcode:\x20','updated','\x20(appcode:\x20','str','flag','appcode','\x20workspace\x20use\x20--app\x20<name>`.','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','write','env','Switch\x20the\x20current\x20workspace\x20app\x20binding','Missing\x20workspace\x20app\x20selector.','format','isArray','9239859keGyiF','locale','Use\x20`','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20',').\x20Config:\x20','19699636VRRMvx','defaultFormat','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','6JVAvdl','string','\x20--app\x20','1907592keuNAC','trim','10joBxOd','init','app','3216GOZiaZ','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','\x20workspace\x20','project','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','1erExRJ','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x22\x20not\x20found.','number','deploymentSync','initialized','workspace','1811758RnLxUP','apiDir','validation','Workspace\x20','pageSize','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','6629IbOVvp','1996920JRqSsj','apps','keys','\x20--appcode\x20<code>`.','workspace.','8176850mcFrDm','Target\x20environment','globalConfig','use'];a215_0x4dd1=function(){return _0x140d6b;};return a215_0x4dd1();}function assertValidAppcode(_0x5d062b){const _0x10504e=a215_0x2572ff,{valid:_0x25126,message:_0x16f076}=validateAppcode(_0x5d062b);if(!_0x25126)throw CliErrors[_0x10504e(0x14d)](_0x10504e(0x11f)+_0x5d062b,_0x16f076);}function sanitizeProfile(_0x45cf89){if(!isRecord(_0x45cf89))return{};const _0x8650b4={};for(const _0x2f0805 of SAFE_PROFILE_KEYS){if(_0x45cf89[_0x2f0805]!==undefined)_0x8650b4[_0x2f0805]=_0x45cf89[_0x2f0805];}return _0x8650b4;}function cloneProfile(_0x4b459b){return isRecord(_0x4b459b)?{..._0x4b459b}:{};}function collectWorkspaceProfileOverrides(_0x8a3725){const _0x30ba71=a215_0x2572ff,_0x1a8fbb={},_0x4c196b=_0x8a3725[_0x30ba71(0x122)]('env'),_0x26847c=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x14c)),_0x4ad66f=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x133)),_0x32d13d=_0x8a3725[_0x30ba71(0x123)](_0x30ba71(0x14f)),_0x278203=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x11e)),_0x1be093=_0x8a3725[_0x30ba71(0x122)](_0x30ba71(0x12e));if(_0x4c196b)_0x1a8fbb[_0x30ba71(0x128)]=_0x4c196b;if(_0x26847c)_0x1a8fbb[_0x30ba71(0x14c)]=_0x26847c;if(_0x4ad66f)_0x1a8fbb[_0x30ba71(0x12b)]=_0x4ad66f;if(_0x32d13d!==undefined&&_0x32d13d!=='')_0x1a8fbb[_0x30ba71(0x14f)]=Number(_0x32d13d);if(_0x278203)_0x1a8fbb[_0x30ba71(0x11e)]=_0x278203;if(_0x1be093)_0x1a8fbb[_0x30ba71(0x12e)]=_0x1be093;const _0x514c43=collectDeploymentSyncProfile(_0x81a4da=>_0x8a3725[_0x30ba71(0x122)](_0x81a4da));if(_0x514c43)_0x1a8fbb[_0x30ba71(0x148)]=_0x514c43;return _0x1a8fbb;}async function validateWorkspaceArgs(_0x57c84a){const _0x3a010b=a215_0x2572ff,_0x5cd249=_0x57c84a[_0x3a010b(0x122)]('app')['trim'](),_0x5ecbb0=_0x57c84a[_0x3a010b(0x122)]('appcode')[_0x3a010b(0x139)]();if(!_0x5cd249&&!_0x5ecbb0)throw CliErrors['validation'](_0x3a010b(0x12a),_0x3a010b(0x12f)+CLI_BIN_NAME+_0x3a010b(0x13e)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x5ecbb0)assertValidAppcode(_0x5ecbb0);}function resolveKnownApps(){const _0x461a3a=a215_0x2572ff,{config:_0x56cc83,layers:_0x241663}=readRawConfigWithLayers(),_0x38f845=isRecord(_0x56cc83[_0x461a3a(0x154)])?_0x56cc83['apps']:{},_0x41c1f8=isRecord(_0x241663[_0x461a3a(0x15a)][_0x461a3a(0x154)])?_0x241663[_0x461a3a(0x15a)]['apps']:{};return{..._0x41c1f8,..._0x38f845};}async function configureWorkspace(_0x329234,_0x80caeb){const _0x312815=a215_0x2572ff,_0x228a4b=_0x329234[_0x312815(0x122)]('app')['trim'](),_0x55f8ac=_0x329234[_0x312815(0x122)](_0x312815(0x124))[_0x312815(0x139)](),_0x443cf5=_0x228a4b||_0x55f8ac;if(!_0x443cf5)throw CliErrors[_0x312815(0x14d)](_0x312815(0x12a),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x312815(0x125));if(_0x55f8ac)assertValidAppcode(_0x55f8ac);const _0xe56b40=resolveWriteConfigPath(_0x312815(0x140)),_0x29585b=readConfigFile(_0xe56b40),_0x4320ee=resolveKnownApps(),_0x48889f=isRecord(_0x29585b[_0x312815(0x154)])?{..._0x29585b['apps']}:{},_0x12a30c=cloneProfile(_0x48889f[_0x443cf5]),_0x2eadf9=sanitizeProfile(_0x4320ee[_0x443cf5]),_0x3b5873=_0x55f8ac?{}:_0x2eadf9,_0x2b7a02=_0x55f8ac||_0x3b5873[_0x312815(0x124)];if(!_0x2b7a02){const _0x29d117=Object[_0x312815(0x155)](_0x4320ee),_0x56f177=_0x29d117['length']===0x0?_0x312815(0x12f)+CLI_BIN_NAME+_0x312815(0x13f)+_0x80caeb+_0x312815(0x137)+_0x443cf5+_0x312815(0x156):_0x312815(0x130)+_0x29d117['join'](',\x20');throw CliErrors[_0x312815(0x14d)]('App\x20\x22'+_0x443cf5+_0x312815(0x146),_0x56f177);}assertValidAppcode(String(_0x2b7a02));const _0x15654a={..._0x3b5873,..._0x12a30c,'appcode':String(_0x2b7a02),...collectWorkspaceProfileOverrides(_0x329234)};return _0x48889f[_0x443cf5]=_0x15654a,_0x29585b[_0x312815(0x154)]=_0x48889f,normalizeStoredDefaultApp(_0x29585b,_0x443cf5),delete _0x29585b[_0x312815(0x124)],delete _0x29585b[_0x312815(0x13c)],_0x15654a[_0x312815(0x128)]&&(_0x29585b[_0x312815(0x128)]=_0x15654a[_0x312815(0x128)]),writeConfigFile(_0xe56b40,_0x29585b),{'ok':!![],'message':_0x312815(0x14e)+(_0x80caeb===_0x312815(0x13b)?_0x312815(0x149):_0x312815(0x120))+':\x20'+_0x443cf5+_0x312815(0x121)+_0x15654a[_0x312815(0x124)]+_0x312815(0x131)+_0xe56b40+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x312815(0x157)+_0x80caeb,'configPath':_0xe56b40,'app':_0x443cf5,'appcode':_0x15654a[_0x312815(0x124)],'env':_0x15654a[_0x312815(0x128)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a215_0x2572ff(0x14a),'command':'init','description':a215_0x2572ff(0x144),'risk':a215_0x2572ff(0x127),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x46a4f6=>configureWorkspace(_0x46a4f6,a215_0x2572ff(0x13b))},workspaceUseDefinition={'service':a215_0x2572ff(0x14a),'command':a215_0x2572ff(0x11d),'description':a215_0x2572ff(0x129),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x22088d=>configureWorkspace(_0x22088d,a215_0x2572ff(0x11d))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a216_0x17590e=a216_0x32a7;(function(_0xb66164,_0x406559){const _0x4e1068=a216_0x32a7,_0x13b914=_0xb66164();while(!![]){try{const _0x1c0b2d=parseInt(_0x4e1068(0x10d))/0x1+parseInt(_0x4e1068(0x10e))/0x2+-parseInt(_0x4e1068(0x103))/0x3*(-parseInt(_0x4e1068(0x10f))/0x4)+-parseInt(_0x4e1068(0x104))/0x5*(parseInt(_0x4e1068(0x10a))/0x6)+-parseInt(_0x4e1068(0x108))/0x7+parseInt(_0x4e1068(0x112))/0x8*(-parseInt(_0x4e1068(0x105))/0x9)+parseInt(_0x4e1068(0x10b))/0xa*(-parseInt(_0x4e1068(0x111))/0xb);if(_0x1c0b2d===_0x406559)break;else _0x13b914['push'](_0x13b914['shift']());}catch(_0x194d17){_0x13b914['push'](_0x13b914['shift']());}}}(a216_0x4cc9,0x846e8));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a216_0x17590e(0x10c),'description':a216_0x17590e(0x109),'risk':a216_0x17590e(0x102),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a216_0x17590e(0x106),'description':a216_0x17590e(0x110),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x8b63f7=>validateAppName(_0x8b63f7,a216_0x17590e(0x107)),'execute':_0x49bdc1=>runAppRemove(_0x49bdc1,a216_0x17590e(0x107))};function a216_0x32a7(_0x243469,_0x1c643d){_0x243469=_0x243469-0x102;const _0x4cc9d2=a216_0x4cc9();let _0x32a7bc=_0x4cc9d2[_0x243469];return _0x32a7bc;}function a216_0x4cc9(){const _0xcb4238=['90UXgTjP','remove','652988lGQewc','81018BJnMDf','184yyvdlE','App\x20profile\x20name\x20to\x20remove','626923pVpSsl','180632RtczPW','write','65505IKzFpl','38455EiHBaU','36hiVPka','name','workspace\x20remove','581441ztNfaU','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','366JFXbmU'];a216_0x4cc9=function(){return _0xcb4238;};return a216_0x4cc9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a217_0x2b10(_0x26d5c4,_0x33791c){_0x26d5c4=_0x26d5c4-0x1a4;const _0x25a6c6=a217_0x25a6();let _0x2b1018=_0x25a6c6[_0x26d5c4];return _0x2b1018;}const a217_0x636b8e=a217_0x2b10;function a217_0x25a6(){const _0x3651dd=['Non-production\x20target\x20selected\x20by\x20the\x20server-side\x20environment\x20mapping','8Ctoujx','object','deployment-target-env','1960824MweATR','validation','--deployment-db-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Production\x20and\x20direct\x20targets\x20must\x20use\x20`rabetbase\x20deployment\x20sync`\x20with\x20explicit\x20confirmation.','1425219QxjjuA','deploymentSync\x20must\x20contain\x20dbLinkId\x20and\x20targetEnv.','520352JBXyZd','Base\x20dblink\x20ID\x20whose\x20server-side\x20environment\x20mapping\x20selects\x20the\x20automatic\x20sync\x20target','trim','dev','714378DvlLsl','78YLRINn','targetEnv','includes','dbLinkId','27BknaQP','string','--deployment-target-env\x20must\x20be\x20one\x20of:\x20','9829150ztdOrA','pre','number','isSafeInteger','deployment-db-id','4147241iomQuq','81645CMKwkK'];a217_0x25a6=function(){return _0x3651dd;};return a217_0x25a6();}(function(_0x27e955,_0x1ef5c2){const _0x3bb660=a217_0x2b10,_0x1f5caa=_0x27e955();while(!![]){try{const _0x51e7fc=-parseInt(_0x3bb660(0x1aa))/0x1+-parseInt(_0x3bb660(0x1ae))/0x2+-parseInt(_0x3bb660(0x1a8))/0x3+-parseInt(_0x3bb660(0x1a4))/0x4+-parseInt(_0x3bb660(0x1bc))/0x5*(parseInt(_0x3bb660(0x1af))/0x6)+-parseInt(_0x3bb660(0x1bb))/0x7*(parseInt(_0x3bb660(0x1be))/0x8)+-parseInt(_0x3bb660(0x1b3))/0x9*(-parseInt(_0x3bb660(0x1b6))/0xa);if(_0x51e7fc===_0x1ef5c2)break;else _0x1f5caa['push'](_0x1f5caa['shift']());}catch(_0x4459ef){_0x1f5caa['push'](_0x1f5caa['shift']());}}}(a217_0x25a6,0x49881));import{CliErrors}from'../errors.js';export const AUTO_DEPLOYMENT_TARGET_ENVS=[a217_0x636b8e(0x1ad),'test',a217_0x636b8e(0x1b7)];export function getDeploymentSyncProfileFlagDefs(){const _0x3b8c66=a217_0x636b8e;return[{'name':_0x3b8c66(0x1ba),'type':_0x3b8c66(0x1b8),'description':_0x3b8c66(0x1ab)},{'name':_0x3b8c66(0x1c0),'type':_0x3b8c66(0x1b4),'enum':[...AUTO_DEPLOYMENT_TARGET_ENVS],'description':_0x3b8c66(0x1bd)}];}export function collectDeploymentSyncProfile(_0x2cfe67){const _0x466f79=a217_0x636b8e,_0x109fe9=_0x2cfe67('deployment-db-id')[_0x466f79(0x1ac)](),_0x9b5a2d=_0x2cfe67('deployment-target-env')[_0x466f79(0x1ac)]();if(!_0x109fe9&&!_0x9b5a2d)return undefined;return validateDeploymentSyncProfile({'dbLinkId':_0x109fe9?Number(_0x109fe9):undefined,'targetEnv':_0x9b5a2d||undefined});}export function validateDeploymentSyncProfile(_0x3050ea){const _0x4e51d3=a217_0x636b8e;if(!_0x3050ea||typeof _0x3050ea!==_0x4e51d3(0x1bf)||Array['isArray'](_0x3050ea))throw CliErrors['validation'](_0x4e51d3(0x1a9));const _0x1ed3ec=_0x3050ea,_0x2886d3=Number(_0x1ed3ec[_0x4e51d3(0x1b2)]);if(!Number[_0x4e51d3(0x1b9)](_0x2886d3)||_0x2886d3<=0x0)throw CliErrors['validation'](_0x4e51d3(0x1a6));const _0x5ba2b5=typeof _0x1ed3ec[_0x4e51d3(0x1b0)]===_0x4e51d3(0x1b4)?_0x1ed3ec[_0x4e51d3(0x1b0)][_0x4e51d3(0x1ac)]():'';if(!AUTO_DEPLOYMENT_TARGET_ENVS[_0x4e51d3(0x1b1)](_0x5ba2b5))throw CliErrors[_0x4e51d3(0x1a5)](_0x4e51d3(0x1b5)+AUTO_DEPLOYMENT_TARGET_ENVS['join'](',\x20')+'.',_0x4e51d3(0x1a7));return{'dbLinkId':_0x2886d3,'targetEnv':_0x5ba2b5};}
|
|
@@ -1,10 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { ENTERPRISE_ROUTING_CDN_FIELDS, ENTERPRISE_ROUTING_DOMAIN_FIELDS, ENTERPRISE_ROUTING_CONSUMERS } from "../generated/routing-contract.js";
|
|
2
|
+
export declare const DOMAIN_CONFIG_FIELDS: readonly ["userDomain", "apiDomain", "runtimeDomain", "skillDomain", "kbDomain", "appDomain", "localDomain", "certificateDomain"];
|
|
2
3
|
export type DomainConfigField = (typeof DOMAIN_CONFIG_FIELDS)[number];
|
|
3
4
|
export type DomainConfig = Partial<Record<DomainConfigField, string>>;
|
|
5
|
+
export type EnterpriseRoutingDomainField = (typeof ENTERPRISE_ROUTING_DOMAIN_FIELDS)[number];
|
|
6
|
+
export type EnterpriseRoutingConsumer = (typeof ENTERPRISE_ROUTING_CONSUMERS)[number];
|
|
7
|
+
export type EnterpriseRoutingDomainOverrides = Partial<Record<"default" | EnterpriseRoutingConsumer, string>>;
|
|
8
|
+
export type EnterpriseRoutingDomainValue = string | EnterpriseRoutingDomainOverrides;
|
|
9
|
+
export type EnterpriseRoutingDomains = Record<EnterpriseRoutingDomainField, EnterpriseRoutingDomainValue | undefined>;
|
|
10
|
+
export type EnterpriseRoutingCdnField = (typeof ENTERPRISE_ROUTING_CDN_FIELDS)[number];
|
|
11
|
+
export type EnterpriseRoutingCdn = Record<EnterpriseRoutingCdnField, string>;
|
|
12
|
+
export type DomainConfigInput = {
|
|
13
|
+
mode: "legacy";
|
|
14
|
+
domains: DomainConfig;
|
|
15
|
+
} | {
|
|
16
|
+
mode: "enterprise-v1";
|
|
17
|
+
domains: DomainConfig;
|
|
18
|
+
manifestDomains: EnterpriseRoutingDomains;
|
|
19
|
+
cdn: EnterpriseRoutingCdn;
|
|
20
|
+
};
|
|
4
21
|
/** Old domain keys accepted only while reading existing configuration. */
|
|
5
22
|
export declare const LEGACY_DOMAIN_CONFIG_FIELDS: readonly ["agentDomain", "platformDomain", "skillHubDomain"];
|
|
6
|
-
export declare function normalizeDomainOrigin(field: DomainConfigField, input: unknown): string;
|
|
23
|
+
export declare function normalizeDomainOrigin(field: DomainConfigField | EnterpriseRoutingDomainField, input: unknown): string;
|
|
24
|
+
export declare function normalizeRoutingDomainValue(field: EnterpriseRoutingDomainField, input: unknown): EnterpriseRoutingDomainValue;
|
|
25
|
+
export declare function normalizeCdnBaseUrl(field: EnterpriseRoutingCdnField, input: unknown): string;
|
|
26
|
+
/**
|
|
27
|
+
* Parse the optional enterprise routing value stored in CLI configuration.
|
|
28
|
+
* Presence is strict: malformed values must never silently fall back to an
|
|
29
|
+
* official service route.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveEnterpriseRoutingConfig(input: unknown): DomainConfig | undefined;
|
|
32
|
+
export declare function resolveEnterpriseRoutingManifest(input: unknown): Extract<DomainConfigInput, {
|
|
33
|
+
mode: "enterprise-v1";
|
|
34
|
+
}> | undefined;
|
|
35
|
+
export declare function resolveRoutingDomainValue(field: EnterpriseRoutingDomainField, value: EnterpriseRoutingDomainValue, consumer: EnterpriseRoutingConsumer): string;
|
|
36
|
+
export declare function readDomainConfigInput(filePath: string): DomainConfigInput;
|
|
7
37
|
export declare function readDomainConfig(filePath: string): DomainConfig;
|
|
38
|
+
export declare function resolveDomainConfigInput(ctx: {
|
|
39
|
+
str(name: string): string;
|
|
40
|
+
}): DomainConfigInput;
|
|
8
41
|
export declare function resolveDomainFlags(ctx: {
|
|
9
42
|
str(name: string): string;
|
|
10
43
|
}): DomainConfig;
|
|
44
|
+
export declare function parseEnterpriseRoutingManifest(source: Record<string, unknown>): Extract<DomainConfigInput, {
|
|
45
|
+
mode: "enterprise-v1";
|
|
46
|
+
}>;
|