@lovrabet/rabetbase-cli 2.4.5 → 2.4.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- 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/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/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-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/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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/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/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/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/{standard-page-status.d.ts → create.d.ts} +1 -1
- package/lib/commands/page/create.js +1 -0
- package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
- package/lib/commands/page/custom/detail.js +1 -0
- package/lib/commands/page/{react → custom}/list.d.ts +1 -1
- package/lib/commands/page/custom/list.js +1 -0
- package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
- package/lib/commands/page/custom/publish.js +1 -0
- package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
- package/lib/commands/page/custom/shared.js +1 -0
- package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
- package/lib/commands/page/custom/syntax.js +1 -0
- package/lib/commands/page/custom/template.js +1 -0
- package/lib/commands/page/{react → custom}/update.d.ts +1 -1
- package/lib/commands/page/custom/update.js +1 -0
- package/lib/commands/page/data-list-status.d.ts +2 -0
- package/lib/commands/page/data-list-status.js +1 -0
- 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.d.ts +18 -18
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/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/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/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +43 -43
- 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.d.ts +3 -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.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +34 -34
- package/skills/rabetbase/guides/backend-function.md +63 -18
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
- package/skills/rabetbase/guides/page-development-workflow.md +22 -22
- package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
- package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
- package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
- package/skills/rabetbase/references/rabetbase-menu-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
- package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
- package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
- package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
- package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
- package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
- package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
- package/skills/rabetbase.manifest.json +12 -12
- package/lib/commands/page/react/create.d.ts +0 -2
- package/lib/commands/page/react/create.js +0 -1
- package/lib/commands/page/react/detail.js +0 -1
- package/lib/commands/page/react/list.js +0 -1
- package/lib/commands/page/react/publish.js +0 -1
- package/lib/commands/page/react/shared.js +0 -1
- package/lib/commands/page/react/syntax.js +0 -1
- package/lib/commands/page/react/template.js +0 -1
- package/lib/commands/page/react/update.js +0 -1
- package/lib/commands/page/standard-page-status.js +0 -1
- package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
- /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a191_0x110479=a191_0x30d8;(function(_0x2bc606,_0x1f1f2d){const _0x4d5235=a191_0x30d8,_0x39ca42=_0x2bc606();while(!![]){try{const _0x2ea889=parseInt(_0x4d5235(0x10b))/0x1*(-parseInt(_0x4d5235(0x113))/0x2)+parseInt(_0x4d5235(0x127))/0x3*(parseInt(_0x4d5235(0x11b))/0x4)+parseInt(_0x4d5235(0x100))/0x5*(-parseInt(_0x4d5235(0xf6))/0x6)+parseInt(_0x4d5235(0x11f))/0x7*(-parseInt(_0x4d5235(0x101))/0x8)+parseInt(_0x4d5235(0x131))/0x9*(parseInt(_0x4d5235(0x134))/0xa)+-parseInt(_0x4d5235(0x104))/0xb+-parseInt(_0x4d5235(0x10a))/0xc*(-parseInt(_0x4d5235(0x11a))/0xd);if(_0x2ea889===_0x1f1f2d)break;else _0x39ca42['push'](_0x39ca42['shift']());}catch(_0x16658b){_0x39ca42['push'](_0x39ca42['shift']());}}}(a191_0x1c0a,0x88a9a));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a191_0x30d8(_0x16cbf5,_0x549243){_0x16cbf5=_0x16cbf5-0xf3;const _0x1c0a2f=a191_0x1c0a();let _0x30d869=_0x1c0a2f[_0x16cbf5];return _0x30d869;}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 a191_0x1c0a(){const _0x3d30c6=['No\x20database\x20matches\x20local\x20directory\x20\x22','push','str','appCode','set','dbId','sqlRootDir','/smartapi/custom/updateUserCustomSql','sql','9778599KyUCkq','sqlCode','\x20skipped,\x20','10XvFoIR','dbDirectory','\x22\x20for\x20sqlCode\x20','sqlName','force','validation','No\x20local\x20SQL\x20files\x20found.','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','6QwRFoK','lockFilePath','utf8','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','has','trashDir','startsWith','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','\x20pushed,\x20','4328925gjAMwL','2927648fyaKnR','\x20failed','path','9369294KikBDQ','remoteId','relativePath','version','hash','message','12OCpgDD','2FOJwNo','get','exec','dbName','sqls','mode','POST','catch','379906Jpmcbu','projectRoot','sqlcode','Local\x20directory\x20\x22','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlRoot','isFinite','14590550pdNobx','1628620mWbRnO','join','write','lastSync','7fOTdhY','filter','map','entries','length','unchanged','Local\x20SQL\x20not\x20found:\x20','Would\x20push\x20','6DyOboG'];a191_0x1c0a=function(){return _0x3d30c6;};return a191_0x1c0a();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x2fc2de,_0x429ea9,_0x2e2a95){const _0x1d276d=a191_0x30d8,_0x38c2db=await scanLocalSqlQueries(_0x2fc2de),_0x558ef=new Map();for(const _0x3a7f91 of _0x38c2db){if(_0x2e2a95&&_0x3a7f91['sqlCode']!==_0x2e2a95)continue;const _0x4ec7b7=_0x558ef[_0x1d276d(0x10c)](_0x3a7f91['sqlCode'])??[];_0x4ec7b7[_0x1d276d(0x129)](_0x3a7f91),_0x558ef[_0x1d276d(0x12c)](_0x3a7f91[_0x1d276d(0x132)],_0x4ec7b7);}if(_0x2e2a95&&!_0x558ef[_0x1d276d(0xfb)](_0x2e2a95))throw CliErrors[_0x1d276d(0xf3)](_0x1d276d(0x125)+_0x2e2a95);const _0xd5eb75=[];for(const [_0x5dff59,_0x1ecf9d]of _0x558ef[_0x1d276d(0x122)]()){if(_0x1ecf9d[_0x1d276d(0x123)]===0x1){_0xd5eb75[_0x1d276d(0x129)](_0x1ecf9d[0x0]);continue;}const _0x31f70f=_0x429ea9[_0x1d276d(0x10f)][_0x5dff59],_0x5a88a2=_0x31f70f?.[_0x1d276d(0x103)],_0x40d509=_0x5a88a2?_0x1ecf9d[_0x1d276d(0x120)](_0x197ec5=>_0x197ec5[_0x1d276d(0x106)]!==_0x5a88a2):_0x1ecf9d;if(_0x31f70f&&_0x40d509[_0x1d276d(0x123)]===0x1){_0xd5eb75[_0x1d276d(0x129)](_0x40d509[0x0]);continue;}throw CliErrors[_0x1d276d(0xf3)](_0x1d276d(0xf5)+_0x5dff59+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0xd5eb75;}export const sqlPush={'service':a191_0x110479(0x130),'command':a191_0x110479(0x129),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a191_0x110479(0x11d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a191_0x110479(0xfe)}],async 'dryRun'(_0x1f5fbb){const _0x5a2bff=a191_0x110479,_0x598c20=loadSqlProjectConfig(_0x1f5fbb[_0x5a2bff(0x12b)]),_0x5e4330=await readSqlLockFile(_0x598c20[_0x5a2bff(0xf7)]),{appLock:_0x1686b7}=ensureSqlLockScope(_0x5e4330??createEmptySqlLock(),_0x1f5fbb[_0x5a2bff(0x12b)],_0x598c20[_0x5a2bff(0x118)],_0x5a2bff(0x129)),_0x5635b9=await getTargetSqlQueries(_0x598c20,_0x1686b7,_0x1f5fbb[_0x5a2bff(0x12a)](_0x5a2bff(0x115))||undefined),_0x4b938c=[];for(const _0x297707 of _0x5635b9){const _0x5584a9=await computeSqlFileHash(_0x297707['filePath']),_0x430667=_0x1686b7[_0x5a2bff(0x10f)][_0x297707[_0x5a2bff(0x132)]],_0x14c4c1=!!_0x430667&&(_0x430667[_0x5a2bff(0x103)]!==_0x297707[_0x5a2bff(0x106)]||!!_0x297707[_0x5a2bff(0x137)]&&_0x430667['sqlName']!==_0x297707[_0x5a2bff(0x137)]);if(!_0x1f5fbb[_0x5a2bff(0xf9)](_0x5a2bff(0x138))&&_0x430667&&_0x430667[_0x5a2bff(0x108)]===_0x5584a9&&!_0x14c4c1)continue;_0x4b938c[_0x5a2bff(0x129)](_0x297707['sqlCode']);}return{'method':_0x5a2bff(0x111),'url':_0x5a2bff(0x12f),'body':{'sqlCodes':_0x4b938c,'appCode':_0x1f5fbb[_0x5a2bff(0x12b)]},'description':_0x5a2bff(0x126)+_0x4b938c[_0x5a2bff(0x123)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x1dc9e9){const _0x5d84bd=a191_0x110479,_0x7aa3e7=loadSqlProjectConfig(_0x1dc9e9[_0x5d84bd(0x12b)]),_0x2750c5=await readSqlLockFile(_0x7aa3e7[_0x5d84bd(0xf7)]),{lockData:_0x3dd614,appLock:_0x460697}=ensureSqlLockScope(_0x2750c5??createEmptySqlLock(),_0x1dc9e9[_0x5d84bd(0x12b)],_0x7aa3e7[_0x5d84bd(0x118)],_0x5d84bd(0x129)),_0x391e66=await getTargetSqlQueries(_0x7aa3e7,_0x460697,_0x1dc9e9[_0x5d84bd(0x12a)]('sqlcode')||undefined);if(_0x391e66[_0x5d84bd(0x123)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5d84bd(0xf4)};const _0x5a64b0=[],_0x288a32=[],_0x4e6477=[];for(const _0x57a846 of _0x391e66){const _0xec37b2=_0x460697[_0x5d84bd(0x10f)][_0x57a846['sqlCode']];if(!_0xec37b2){_0x4e6477[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'error':_0x5d84bd(0xfa)});continue;}try{const _0x3bacb9=await computeSqlFileHash(_0x57a846['filePath']),_0x163712=_0xec37b2[_0x5d84bd(0x103)]!==_0x57a846['relativePath']||!!_0x57a846['sqlName']&&_0xec37b2['sqlName']!==_0x57a846[_0x5d84bd(0x137)];if(!_0x1dc9e9['bool'](_0x5d84bd(0x138))&&_0xec37b2[_0x5d84bd(0x108)]===_0x3bacb9&&!_0x163712){_0x288a32[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'reason':_0x5d84bd(0x124)});continue;}if(_0xec37b2['version']==null){_0x4e6477[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'error':_0x5d84bd(0x117)});continue;}const _0x599607=await readFile(_0x57a846['filePath'],_0x5d84bd(0xf8)),_0x5c2486=stripLocalSqlMetadata(_0x599607,_0x57a846[_0x5d84bd(0x110)]),_0x271860=_0x57a846['sqlName']||_0xec37b2[_0x5d84bd(0x137)],_0x113504=await resolveTargetDbBinding(_0x1dc9e9[_0x5d84bd(0x12b)],_0x57a846,_0xec37b2),_0x4cc2a0=await updateSqlQuery({'id':_0xec37b2[_0x5d84bd(0x105)],'appCode':_0x1dc9e9['appCode'],'sqlCode':_0x57a846[_0x5d84bd(0x132)],'sqlName':_0x271860,'dbId':_0x113504[_0x5d84bd(0x12d)],'version':_0xec37b2[_0x5d84bd(0x107)],'sqlContent':_0x5c2486,'sqlConfig':_0xec37b2['sqlConfig']??undefined}),_0x271fd0=_0x4cc2a0[_0x5d84bd(0x12d)]?await getDbName(_0x1dc9e9['appCode'],Number(_0x4cc2a0['dbId']))[_0x5d84bd(0x112)](()=>_0x113504['dbName']):_0x113504['dbName'];_0x460697['sqls'][_0x57a846[_0x5d84bd(0x132)]]={...buildSqlLockEntry(_0x4cc2a0,_0x5c2486,_0x3bacb9,{'dbName':_0x271fd0}),'path':_0x57a846[_0x5d84bd(0x106)],'mode':_0xec37b2[_0x5d84bd(0x110)]},await archivePreviousSqlFileIfNeeded(_0x7aa3e7,_0xec37b2[_0x5d84bd(0x103)],_0x57a846['relativePath']),_0x5a64b0[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'remoteId':_0xec37b2[_0x5d84bd(0x105)]});}catch(_0x30af63){_0x4e6477[_0x5d84bd(0x129)]({'sqlCode':_0x57a846['sqlCode'],'error':_0x30af63 instanceof Error?_0x30af63[_0x5d84bd(0x109)]:String(_0x30af63)});}}return _0x460697[_0x5d84bd(0x11e)]=new Date()['toISOString'](),await writeSqlLockFile(_0x7aa3e7[_0x5d84bd(0xf7)],_0x3dd614),{'ok':_0x4e6477[_0x5d84bd(0x123)]===0x0,'data':{'pushed':_0x5a64b0,'skipped':_0x288a32,'failed':_0x4e6477},'message':'Push\x20complete:\x20'+_0x5a64b0[_0x5d84bd(0x123)]+_0x5d84bd(0xff)+_0x288a32[_0x5d84bd(0x123)]+_0x5d84bd(0x133)+_0x4e6477['length']+_0x5d84bd(0x102)};}};async function archivePreviousSqlFileIfNeeded(_0x241cfc,_0x1bf5e5,_0x2a9d2d){const _0xdca36a=a191_0x110479;if(!_0x1bf5e5||_0x1bf5e5===_0x2a9d2d)return;const _0x5e6e62=join(_0x241cfc[_0xdca36a(0x12e)],_0x1bf5e5);if(!await fileExists(_0x5e6e62))return;const _0x378764=await moveToTrash(_0x241cfc[_0xdca36a(0x114)],_0x241cfc[_0xdca36a(0xfc)],_0x5e6e62);await cleanupEmptyDirectories(dirname(_0x5e6e62),_0x241cfc['sqlRootDir']),void _0x378764;}async function moveToTrash(_0x586086,_0x48e81c,_0x4b2953){const _0x92143a=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x1c4c0c=relative(_0x586086,_0x4b2953),_0x36f50c=join(_0x48e81c,_0x92143a,_0x1c4c0c);return await mkdir(dirname(_0x36f50c),{'recursive':!![]}),await rename(_0x4b2953,_0x36f50c),_0x36f50c;}async function cleanupEmptyDirectories(_0x2d4072,_0x285bfc){const _0x3e3a25=a191_0x110479;let _0x3f8a10=resolve(_0x2d4072);const _0x1e5c32=resolve(_0x285bfc);while(_0x3f8a10[_0x3e3a25(0xfd)](''+_0x1e5c32+sep)||_0x3f8a10===_0x1e5c32){if(_0x3f8a10===_0x1e5c32)return;try{const _0x455250=await readdir(_0x3f8a10);if(_0x455250[_0x3e3a25(0x123)]>0x0)return;await rmdir(_0x3f8a10);}catch{return;}_0x3f8a10=dirname(_0x3f8a10);}}async function resolveTargetDbBinding(_0x12771b,_0x1c4b7d,_0x260cf8){const _0x1267cb=a191_0x110479,_0xd4477c=_0x1c4b7d[_0x1267cb(0x135)];if(!_0xd4477c)return{'dbId':_0x260cf8['dbId'],'dbName':_0x260cf8[_0x1267cb(0x10e)]};const _0x3e195d=buildDbDirectoryName(_0x260cf8[_0x1267cb(0x10e)],_0x260cf8[_0x1267cb(0x12d)]);if(_0xd4477c===_0x3e195d)return{'dbId':_0x260cf8['dbId'],'dbName':_0x260cf8['dbName']};const _0x3815f7=parseExplicitDbDirectory(_0xd4477c);if(_0x3815f7!=null)return{'dbId':_0x3815f7,'dbName':await getDbName(_0x12771b,_0x3815f7)[_0x1267cb(0x112)](()=>undefined)};const _0x47bfb7=await listDatabases(_0x12771b),_0x36ffde=_0x47bfb7['filter'](_0x492c50=>buildDbDirectoryName(_0x492c50[_0x1267cb(0x10e)],_0x492c50['dbId'])===_0xd4477c);if(_0x36ffde[_0x1267cb(0x123)]===0x1)return{'dbId':_0x36ffde[0x0]['dbId'],'dbName':_0x36ffde[0x0][_0x1267cb(0x10e)]};if(_0x36ffde['length']===0x0)throw CliErrors[_0x1267cb(0xf3)](_0x1267cb(0x128)+_0xd4477c+_0x1267cb(0x136)+_0x1c4b7d['sqlCode']+'.');const _0x47dc51=_0x36ffde[_0x1267cb(0x121)](_0x5cc6e0=>_0x5cc6e0['dbName']+'\x20('+_0x5cc6e0['dbId']+')')[_0x1267cb(0x11c)](',\x20');throw CliErrors[_0x1267cb(0xf3)](_0x1267cb(0x116)+_0xd4477c+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x1c4b7d[_0x1267cb(0x132)]+':\x20'+_0x47dc51);}function parseExplicitDbDirectory(_0x38af16){const _0x5ba65c=a191_0x110479,_0x135d36=/^db-(\d+)$/[_0x5ba65c(0x10d)](_0x38af16);if(!_0x135d36)return null;const _0x1a254b=Number(_0x135d36[0x1]);return Number[_0x5ba65c(0x119)](_0x1a254b)&&_0x1a254b>0x0?_0x1a254b:null;}
|
|
1
|
+
function a191_0x4b71(_0x5321ff,_0x5f5d45){_0x5321ff=_0x5321ff-0x14c;const _0x5ea0b7=a191_0x5ea0();let _0x4b714a=_0x5ea0b7[_0x5321ff];return _0x4b714a;}function a191_0x5ea0(){const _0x1d1a95=['appCode','162jlknFw','\x22\x20for\x20sqlCode\x20','boolean','relativePath','Would\x20push\x20','utf8','write','hash','lastSync','Push\x20complete:\x20','validation','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlName','6038560HrwNIT','6BWsYHB','468618adjOCj','dbDirectory','version','dbName','unchanged','message','sqlRoot','Local\x20directory\x20\x22','sql','Push\x20local\x20SQL\x20files\x20to\x20remote','5214604Dioiyy','\x20SQL\x20file(s)','str','\x20skipped,\x20','catch','remoteId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','push','Local\x20SQL\x20not\x20found:\x20','dbId','\x20failed','5829875EnnDrY','has','1312787IYVtlo','No\x20database\x20matches\x20local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','440jXNZoh','length','48141CHAuyr','mode','sqlcode','join','force','trashDir','No\x20local\x20SQL\x20files\x20found.','sqlRootDir','toISOString','\x20pushed,\x20','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','set','lockFilePath','sqlConfig','path','projectRoot','sqls','POST','bool','sqlCode','5963LrjYac','filePath','startsWith'];a191_0x5ea0=function(){return _0x1d1a95;};return a191_0x5ea0();}const a191_0x30e32f=a191_0x4b71;(function(_0x3c9cc0,_0x51ea80){const _0x551015=a191_0x4b71,_0x3ec9cc=_0x3c9cc0();while(!![]){try{const _0x511544=parseInt(_0x551015(0x14c))/0x1*(-parseInt(_0x551015(0x150))/0x2)+-parseInt(_0x551015(0x15f))/0x3+parseInt(_0x551015(0x169))/0x4+parseInt(_0x551015(0x174))/0x5*(-parseInt(_0x551015(0x15e))/0x6)+parseInt(_0x551015(0x176))/0x7+parseInt(_0x551015(0x15d))/0x8+-parseInt(_0x551015(0x17b))/0x9*(-parseInt(_0x551015(0x179))/0xa);if(_0x511544===_0x51ea80)break;else _0x3ec9cc['push'](_0x3ec9cc['shift']());}catch(_0x13b981){_0x3ec9cc['push'](_0x3ec9cc['shift']());}}}(a191_0x5ea0,0xa5158));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x18768b,_0x52fcce,_0x3346b2){const _0x1d76fe=a191_0x4b71,_0x905c75=await scanLocalSqlQueries(_0x18768b),_0xcd198c=new Map();for(const _0x2d25c7 of _0x905c75){if(_0x3346b2&&_0x2d25c7[_0x1d76fe(0x18e)]!==_0x3346b2)continue;const _0x1f19fa=_0xcd198c['get'](_0x2d25c7[_0x1d76fe(0x18e)])??[];_0x1f19fa['push'](_0x2d25c7),_0xcd198c[_0x1d76fe(0x186)](_0x2d25c7[_0x1d76fe(0x18e)],_0x1f19fa);}if(_0x3346b2&&!_0xcd198c[_0x1d76fe(0x175)](_0x3346b2))throw CliErrors[_0x1d76fe(0x15a)](_0x1d76fe(0x171)+_0x3346b2);const _0x48d6ac=[];for(const [_0x398820,_0x165f65]of _0xcd198c['entries']()){if(_0x165f65[_0x1d76fe(0x17a)]===0x1){_0x48d6ac[_0x1d76fe(0x170)](_0x165f65[0x0]);continue;}const _0x1c57ac=_0x52fcce[_0x1d76fe(0x18b)][_0x398820],_0xffa7d2=_0x1c57ac?.[_0x1d76fe(0x189)],_0x4eaedf=_0xffa7d2?_0x165f65['filter'](_0x5535c9=>_0x5535c9[_0x1d76fe(0x153)]!==_0xffa7d2):_0x165f65;if(_0x1c57ac&&_0x4eaedf[_0x1d76fe(0x17a)]===0x1){_0x48d6ac[_0x1d76fe(0x170)](_0x4eaedf[0x0]);continue;}throw CliErrors[_0x1d76fe(0x15a)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x398820+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x48d6ac;}export const sqlPush={'service':a191_0x30e32f(0x167),'command':a191_0x30e32f(0x170),'description':a191_0x30e32f(0x168),'risk':a191_0x30e32f(0x156),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a191_0x30e32f(0x17f),'type':a191_0x30e32f(0x152),'description':a191_0x30e32f(0x16f)}],async 'dryRun'(_0x5e340e){const _0x4fe06a=a191_0x30e32f,_0x5b1e08=loadSqlProjectConfig(_0x5e340e[_0x4fe06a(0x14f)]),_0x38f2ae=await readSqlLockFile(_0x5b1e08['lockFilePath']),{appLock:_0x1d3ff6}=ensureSqlLockScope(_0x38f2ae??createEmptySqlLock(),_0x5e340e['appCode'],_0x5b1e08[_0x4fe06a(0x165)],_0x4fe06a(0x170)),_0x2d593c=await getTargetSqlQueries(_0x5b1e08,_0x1d3ff6,_0x5e340e[_0x4fe06a(0x16b)](_0x4fe06a(0x17d))||undefined),_0x5ea96e=[];for(const _0x35efbd of _0x2d593c){const _0x27c453=await computeSqlFileHash(_0x35efbd[_0x4fe06a(0x14d)]),_0xe419fd=_0x1d3ff6[_0x4fe06a(0x18b)][_0x35efbd[_0x4fe06a(0x18e)]],_0x1aaffc=!!_0xe419fd&&(_0xe419fd[_0x4fe06a(0x189)]!==_0x35efbd[_0x4fe06a(0x153)]||!!_0x35efbd[_0x4fe06a(0x15c)]&&_0xe419fd[_0x4fe06a(0x15c)]!==_0x35efbd['sqlName']);if(!_0x5e340e['bool'](_0x4fe06a(0x17f))&&_0xe419fd&&_0xe419fd['hash']===_0x27c453&&!_0x1aaffc)continue;_0x5ea96e['push'](_0x35efbd[_0x4fe06a(0x18e)]);}return{'method':_0x4fe06a(0x18c),'url':_0x4fe06a(0x178),'body':{'sqlCodes':_0x5ea96e,'appCode':_0x5e340e[_0x4fe06a(0x14f)]},'description':_0x4fe06a(0x154)+_0x5ea96e['length']+_0x4fe06a(0x16a)};},async 'execute'(_0x2bda13){const _0x4acfda=a191_0x30e32f,_0x3ba4de=loadSqlProjectConfig(_0x2bda13[_0x4acfda(0x14f)]),_0x42248c=await readSqlLockFile(_0x3ba4de[_0x4acfda(0x187)]),{lockData:_0x314930,appLock:_0x12d267}=ensureSqlLockScope(_0x42248c??createEmptySqlLock(),_0x2bda13[_0x4acfda(0x14f)],_0x3ba4de['sqlRoot'],_0x4acfda(0x170)),_0x2f0986=await getTargetSqlQueries(_0x3ba4de,_0x12d267,_0x2bda13[_0x4acfda(0x16b)](_0x4acfda(0x17d))||undefined);if(_0x2f0986[_0x4acfda(0x17a)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4acfda(0x181)};const _0x3719db=[],_0x123713=[],_0x52024d=[];for(const _0x506003 of _0x2f0986){const _0x50eac7=_0x12d267[_0x4acfda(0x18b)][_0x506003['sqlCode']];if(!_0x50eac7){_0x52024d[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'error':_0x4acfda(0x15b)});continue;}try{const _0x1dc0de=await computeSqlFileHash(_0x506003['filePath']),_0x4484cc=_0x50eac7['path']!==_0x506003[_0x4acfda(0x153)]||!!_0x506003['sqlName']&&_0x50eac7['sqlName']!==_0x506003[_0x4acfda(0x15c)];if(!_0x2bda13[_0x4acfda(0x18d)]('force')&&_0x50eac7[_0x4acfda(0x157)]===_0x1dc0de&&!_0x4484cc){_0x123713['push']({'sqlCode':_0x506003[_0x4acfda(0x18e)],'reason':_0x4acfda(0x163)});continue;}if(_0x50eac7[_0x4acfda(0x161)]==null){_0x52024d[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x5d2a77=await readFile(_0x506003['filePath'],_0x4acfda(0x155)),_0x377407=stripLocalSqlMetadata(_0x5d2a77,_0x506003[_0x4acfda(0x17c)]),_0x1f1f14=_0x506003[_0x4acfda(0x15c)]||_0x50eac7['sqlName'],_0x15244e=await resolveTargetDbBinding(_0x2bda13[_0x4acfda(0x14f)],_0x506003,_0x50eac7),_0x493f13=await updateSqlQuery({'id':_0x50eac7['remoteId'],'appCode':_0x2bda13['appCode'],'sqlCode':_0x506003[_0x4acfda(0x18e)],'sqlName':_0x1f1f14,'dbId':_0x15244e[_0x4acfda(0x172)],'version':_0x50eac7[_0x4acfda(0x161)],'sqlContent':_0x377407,'sqlConfig':_0x50eac7[_0x4acfda(0x188)]??undefined}),_0x585b9c=_0x493f13[_0x4acfda(0x172)]?await getDbName(_0x2bda13[_0x4acfda(0x14f)],Number(_0x493f13[_0x4acfda(0x172)]))[_0x4acfda(0x16d)](()=>_0x15244e[_0x4acfda(0x162)]):_0x15244e['dbName'];_0x12d267['sqls'][_0x506003[_0x4acfda(0x18e)]]={...buildSqlLockEntry(_0x493f13,_0x377407,_0x1dc0de,{'dbName':_0x585b9c}),'path':_0x506003[_0x4acfda(0x153)],'mode':_0x50eac7[_0x4acfda(0x17c)]},await archivePreviousSqlFileIfNeeded(_0x3ba4de,_0x50eac7[_0x4acfda(0x189)],_0x506003['relativePath']),_0x3719db[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'remoteId':_0x50eac7[_0x4acfda(0x16e)]});}catch(_0x5a36f0){_0x52024d[_0x4acfda(0x170)]({'sqlCode':_0x506003[_0x4acfda(0x18e)],'error':_0x5a36f0 instanceof Error?_0x5a36f0[_0x4acfda(0x164)]:String(_0x5a36f0)});}}return _0x12d267[_0x4acfda(0x158)]=new Date()[_0x4acfda(0x183)](),await writeSqlLockFile(_0x3ba4de[_0x4acfda(0x187)],_0x314930),{'ok':_0x52024d[_0x4acfda(0x17a)]===0x0,'data':{'pushed':_0x3719db,'skipped':_0x123713,'failed':_0x52024d},'message':_0x4acfda(0x159)+_0x3719db[_0x4acfda(0x17a)]+_0x4acfda(0x184)+_0x123713[_0x4acfda(0x17a)]+_0x4acfda(0x16c)+_0x52024d[_0x4acfda(0x17a)]+_0x4acfda(0x173)};}};async function archivePreviousSqlFileIfNeeded(_0x1edb9c,_0x41d3e5,_0x5d892a){const _0x3912b7=a191_0x30e32f;if(!_0x41d3e5||_0x41d3e5===_0x5d892a)return;const _0x167735=join(_0x1edb9c[_0x3912b7(0x182)],_0x41d3e5);if(!await fileExists(_0x167735))return;const _0x1d4850=await moveToTrash(_0x1edb9c[_0x3912b7(0x18a)],_0x1edb9c[_0x3912b7(0x180)],_0x167735);await cleanupEmptyDirectories(dirname(_0x167735),_0x1edb9c[_0x3912b7(0x182)]),void _0x1d4850;}async function moveToTrash(_0xde4e3f,_0x2c7532,_0xcc153f){const _0x1545da=a191_0x30e32f,_0x9f7303=new Date()[_0x1545da(0x183)]()['replace'](/[:.]/g,'-'),_0x1a0cbe=relative(_0xde4e3f,_0xcc153f),_0x1de6d5=join(_0x2c7532,_0x9f7303,_0x1a0cbe);return await mkdir(dirname(_0x1de6d5),{'recursive':!![]}),await rename(_0xcc153f,_0x1de6d5),_0x1de6d5;}async function cleanupEmptyDirectories(_0x5418ce,_0xde6996){const _0x4c3bbd=a191_0x30e32f;let _0x4cefe9=resolve(_0x5418ce);const _0xfaaa5e=resolve(_0xde6996);while(_0x4cefe9[_0x4c3bbd(0x14e)](''+_0xfaaa5e+sep)||_0x4cefe9===_0xfaaa5e){if(_0x4cefe9===_0xfaaa5e)return;try{const _0x1f56d3=await readdir(_0x4cefe9);if(_0x1f56d3['length']>0x0)return;await rmdir(_0x4cefe9);}catch{return;}_0x4cefe9=dirname(_0x4cefe9);}}async function resolveTargetDbBinding(_0x5e4fcd,_0x5ebc9b,_0x3c9772){const _0xcd4a95=a191_0x30e32f,_0x1bce3d=_0x5ebc9b[_0xcd4a95(0x160)];if(!_0x1bce3d)return{'dbId':_0x3c9772[_0xcd4a95(0x172)],'dbName':_0x3c9772[_0xcd4a95(0x162)]};const _0x128ae2=buildDbDirectoryName(_0x3c9772[_0xcd4a95(0x162)],_0x3c9772[_0xcd4a95(0x172)]);if(_0x1bce3d===_0x128ae2)return{'dbId':_0x3c9772[_0xcd4a95(0x172)],'dbName':_0x3c9772[_0xcd4a95(0x162)]};const _0x3b4954=parseExplicitDbDirectory(_0x1bce3d);if(_0x3b4954!=null)return{'dbId':_0x3b4954,'dbName':await getDbName(_0x5e4fcd,_0x3b4954)[_0xcd4a95(0x16d)](()=>undefined)};const _0x3506a8=await listDatabases(_0x5e4fcd),_0x2ed114=_0x3506a8['filter'](_0x496b84=>buildDbDirectoryName(_0x496b84[_0xcd4a95(0x162)],_0x496b84['dbId'])===_0x1bce3d);if(_0x2ed114[_0xcd4a95(0x17a)]===0x1)return{'dbId':_0x2ed114[0x0][_0xcd4a95(0x172)],'dbName':_0x2ed114[0x0][_0xcd4a95(0x162)]};if(_0x2ed114[_0xcd4a95(0x17a)]===0x0)throw CliErrors[_0xcd4a95(0x15a)](_0xcd4a95(0x177)+_0x1bce3d+_0xcd4a95(0x151)+_0x5ebc9b[_0xcd4a95(0x18e)]+'.');const _0x2670db=_0x2ed114['map'](_0x2e6304=>_0x2e6304[_0xcd4a95(0x162)]+'\x20('+_0x2e6304[_0xcd4a95(0x172)]+')')[_0xcd4a95(0x17e)](',\x20');throw CliErrors[_0xcd4a95(0x15a)](_0xcd4a95(0x166)+_0x1bce3d+_0xcd4a95(0x185)+_0x5ebc9b[_0xcd4a95(0x18e)]+':\x20'+_0x2670db);}function parseExplicitDbDirectory(_0x16eaab){const _0x5a446e=/^db-(\d+)$/['exec'](_0x16eaab);if(!_0x5a446e)return null;const _0x5de6a6=Number(_0x5a446e[0x1]);return Number['isFinite'](_0x5de6a6)&&_0x5de6a6>0x0?_0x5de6a6:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a192_0x4444b0=a192_0x1fd2;(function(_0x3e0a69,_0x19a5b8){const _0x38aa58=a192_0x1fd2,_0x5888bc=_0x3e0a69();while(!![]){try{const _0x303696=-parseInt(_0x38aa58(0x108))/0x1*(-parseInt(_0x38aa58(0x11d))/0x2)+-parseInt(_0x38aa58(0x101))/0x3+-parseInt(_0x38aa58(0x102))/0x4+parseInt(_0x38aa58(0x122))/0x5+parseInt(_0x38aa58(0x113))/0x6+parseInt(_0x38aa58(0x123))/0x7*(-parseInt(_0x38aa58(0x111))/0x8)+parseInt(_0x38aa58(0x109))/0x9;if(_0x303696===_0x19a5b8)break;else _0x5888bc['push'](_0x5888bc['shift']());}catch(_0x2bc66c){_0x5888bc['push'](_0x5888bc['shift']());}}}(a192_0x45ce,0xbc028));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=a192_0x4444b0(0x128);export function buildSqlLockEntry(_0x3b98fd,_0x20b148,_0x3e0298,_0x3e3dc7){const _0x2474c8=a192_0x4444b0,_0x1974ba=detectSqlMode(_0x20b148);return{'path':buildSqlRelativePath(_0x3b98fd[_0x2474c8(0x112)],_0x3b98fd['sqlName'],_0x3e3dc7?.[_0x2474c8(0xff)],_0x1974ba,_0x3b98fd[_0x2474c8(0x126)]),'hash':_0x3e0298,'remoteId':_0x3b98fd['id'],'version':_0x3b98fd['version'],'dbId':Number(_0x3b98fd[_0x2474c8(0x126)]),'dbName':_0x3e3dc7?.['dbName'],'sqlName':_0x3b98fd[_0x2474c8(0x107)],'sqlConfig':_0x3b98fd[_0x2474c8(0x10e)]??undefined,'mode':_0x1974ba};}function a192_0x45ce(){const _0xebc481=['1204200issjcv','sqlContent','map','--\x20@lovrabet.','\x20[y/N]\x20','push','sqls','yes','length','path','116828AketKe','question','sqlRoot','trim','replace','5340040lbMcVi','14lYGkRi','trimStart','stderr','dbId','test','.rabetbase/sql','dbName','syncedAt','1605831xNpoXq','3824524yMUIzT','<!--\x20@lovrabet.','mybatisXml','apps','filter','sqlName','4sHypWO','20670822oQEzge','entries','split','\x20-->','description','sqlConfig','lastSync','mode','6150504IkOyqr','sqlCode'];a192_0x45ce=function(){return _0xebc481;};return a192_0x45ce();}export function cloneSqlLockData(_0x5ba7ff){const _0x3822fc=a192_0x4444b0;return{'apps':Object['fromEntries'](Object[_0x3822fc(0x10a)](_0x5ba7ff[_0x3822fc(0x105)])[_0x3822fc(0x115)](([_0x187fe7,_0x531641])=>[_0x187fe7,{'sqlRoot':_0x531641[_0x3822fc(0x11f)],'lastSync':_0x531641[_0x3822fc(0x10f)],'sqls':{..._0x531641[_0x3822fc(0x119)]}}]))};}export function ensureRemoteSqlContent(_0x3d608f){const _0x5570be=a192_0x4444b0;return _0x3d608f[_0x5570be(0x114)]??'';}export function buildLocalSqlFileContent(_0x11667c,_0x444be4,_0x35bacd){const _0x4ea140=a192_0x4444b0,_0x1699f8=_0x35bacd?.[_0x4ea140(0x110)]??detectSqlMode(_0x444be4),_0x432da3=stripLocalSqlMetadata(_0x444be4,_0x1699f8)[_0x4ea140(0x120)](),_0x372445=[...buildMetadataHeaderLines({'sqlCode':_0x11667c[_0x4ea140(0x112)],'sqlName':_0x11667c[_0x4ea140(0x107)],'dbId':_0x11667c[_0x4ea140(0x126)],'dbName':_0x35bacd?.[_0x4ea140(0xff)],'mode':_0x1699f8,'syncedAt':_0x35bacd?.[_0x4ea140(0x100)],'description':_0x35bacd?.[_0x4ea140(0x10d)]},_0x1699f8),'',_0x432da3],_0x445375=_0x372445['join']('\x0a');return _0x445375['endsWith']('\x0a')?_0x445375:_0x445375+'\x0a';}export function stripLocalSqlMetadata(_0x1da141,_0x142c30){const _0x427df8=a192_0x4444b0,_0x3b5c93=_0x1da141[_0x427df8(0x121)](/\r\n/g,'\x0a')[_0x427df8(0x10b)]('\x0a'),_0x537fe0=[];let _0xbfe10c=0x0;if(_0x142c30===_0x427df8(0x104))while(_0xbfe10c<_0x3b5c93[_0x427df8(0x11b)]){const _0x5257b2=_0x3b5c93[_0xbfe10c]??'';if(/^\s*<!--\s*@lovrabet\./[_0x427df8(0x127)](_0x5257b2)){_0xbfe10c++;continue;}if(_0x5257b2['trim']()===''&&_0xbfe10c>0x0){_0xbfe10c++;continue;}break;}else while(_0xbfe10c<_0x3b5c93['length']){const _0x1d33b7=_0x3b5c93[_0xbfe10c]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x1d33b7)){_0xbfe10c++;continue;}if(_0x1d33b7[_0x427df8(0x120)]()===''&&_0xbfe10c>0x0){_0xbfe10c++;continue;}break;}for(;_0xbfe10c<_0x3b5c93['length'];_0xbfe10c++){_0x537fe0[_0x427df8(0x118)](_0x3b5c93[_0xbfe10c]);}return _0x537fe0['join']('\x0a')[_0x427df8(0x124)]();}export function resolveSqlMode(_0x1b0b44,_0x1cbb47){const _0x3d65e5=a192_0x4444b0;if(_0x1cbb47?.[_0x3d65e5(0x110)])return _0x1cbb47[_0x3d65e5(0x110)];return detectSqlMode(_0x1b0b44);}export function resolveSqlFileName(_0x7f103e,_0x2a9ac5,_0x329778){const _0x3c554e=a192_0x4444b0;if(_0x329778?.[_0x3c554e(0x11c)])return _0x329778['path'];if(_0x329778?.[_0x3c554e(0x107)]||_0x329778?.[_0x3c554e(0xff)])return buildSqlRelativePath(_0x7f103e,_0x329778?.[_0x3c554e(0x107)],_0x329778?.[_0x3c554e(0xff)],resolveSqlMode(_0x2a9ac5,_0x329778),_0x329778?.[_0x3c554e(0x126)]);return buildDefaultSqlFileName(_0x7f103e,resolveSqlMode(_0x2a9ac5,_0x329778));}export function resolveSqlLocalDir(_0x2ece77,_0x4cd61c){return join(_0x2ece77,SQL_LOCAL_REL_DIR,_0x4cd61c);}export async function confirmForceOverwrite(_0x420436){const _0x1dfe0c=a192_0x4444b0,_0x49bed5=createInterface({'input':process['stdin'],'output':process[_0x1dfe0c(0x125)]}),_0x51cf6a=await new Promise(_0x30980c=>{const _0x1fe33d=_0x1dfe0c;_0x49bed5[_0x1fe33d(0x11e)](_0x420436+_0x1fe33d(0x117),_0x30980c);});return _0x49bed5['close'](),['y',_0x1dfe0c(0x11a)]['includes'](_0x51cf6a['trim']()['toLowerCase']());}export function findSqlLockScope(_0x444dcd,_0x471d7c){const _0x34a940=a192_0x4444b0;return _0x444dcd[_0x34a940(0x105)][_0x471d7c];}function a192_0x1fd2(_0x23d9db,_0x1f523f){_0x23d9db=_0x23d9db-0xff;const _0x45ce97=a192_0x45ce();let _0x1fd243=_0x45ce97[_0x23d9db];return _0x1fd243;}function buildMetadataHeaderLines(_0x12e247,_0x4639b0){const _0x10c012=a192_0x4444b0,_0x2ca6af=[['sqlCode',_0x12e247[_0x10c012(0x112)]],[_0x10c012(0x107),_0x12e247[_0x10c012(0x107)]],['dbId',_0x12e247[_0x10c012(0x126)]],[_0x10c012(0xff),_0x12e247[_0x10c012(0xff)]],[_0x10c012(0x110),_0x12e247[_0x10c012(0x110)]],[_0x10c012(0x100),_0x12e247[_0x10c012(0x100)]],[_0x10c012(0x10d),_0x12e247[_0x10c012(0x10d)]]];if(_0x4639b0===_0x10c012(0x104))return _0x2ca6af[_0x10c012(0x106)](([,_0x391ea3])=>_0x391ea3!==undefined&&_0x391ea3!==null&&String(_0x391ea3)[_0x10c012(0x120)]()!=='')['map'](([_0x2fd910,_0x5121a4])=>_0x10c012(0x103)+_0x2fd910+':\x20'+String(_0x5121a4)+_0x10c012(0x10c));return _0x2ca6af[_0x10c012(0x106)](([,_0xc8c4e5])=>_0xc8c4e5!==undefined&&_0xc8c4e5!==null&&String(_0xc8c4e5)[_0x10c012(0x120)]()!=='')[_0x10c012(0x115)](([_0x352190,_0x566170])=>_0x10c012(0x116)+_0x352190+':\x20'+String(_0x566170));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a193_0x571bed=a193_0x14b3;(function(_0xe9a421,_0x39ddb3){const _0x4a25c0=a193_0x14b3,_0xbc43d8=_0xe9a421();while(!![]){try{const _0x3f6458=-parseInt(_0x4a25c0(0xd4))/0x1*(-parseInt(_0x4a25c0(0xca))/0x2)+parseInt(_0x4a25c0(0xdb))/0x3*(parseInt(_0x4a25c0(0xe2))/0x4)+-parseInt(_0x4a25c0(0xda))/0x5*(-parseInt(_0x4a25c0(0xd2))/0x6)+parseInt(_0x4a25c0(0xdc))/0x7*(parseInt(_0x4a25c0(0xd9))/0x8)+-parseInt(_0x4a25c0(0xdf))/0x9+-parseInt(_0x4a25c0(0xd6))/0xa*(-parseInt(_0x4a25c0(0xe6))/0xb)+parseInt(_0x4a25c0(0xd5))/0xc*(-parseInt(_0x4a25c0(0xde))/0xd);if(_0x3f6458===_0x39ddb3)break;else _0xbc43d8['push'](_0xbc43d8['shift']());}catch(_0x2fbaed){_0xbc43d8['push'](_0xbc43d8['shift']());}}}(a193_0x89c6,0x6e9ba));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';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a193_0x14b3(_0x111e1f,_0x46295b){_0x111e1f=_0x111e1f-0xc2;const _0x89c647=a193_0x89c6();let _0x14b34c=_0x89c647[_0x111e1f];return _0x14b34c;}async function fetchAllSqlCodes(_0x4534a2){const _0x588c96=a193_0x14b3,_0x58d3a7=[];let _0x18547d=0x1;while(!![]){const _0x194182=await listSqlQueries(_0x4534a2,{'currentPage':_0x18547d,'pageSize':PAGE_SIZE}),_0x54f93c=_0x194182[_0x588c96(0xe0)]??[];_0x58d3a7[_0x588c96(0xe3)](..._0x54f93c[_0x588c96(0xc9)](_0x48642b=>_0x48642b['sqlCode']));if(_0x54f93c[_0x588c96(0xc2)]===0x0)break;const _0xe561fc=_0x194182[_0x588c96(0xcb)]?.[_0x588c96(0xd3)];if(_0xe561fc!=null?_0x58d3a7['length']>=_0xe561fc:_0x54f93c[_0x588c96(0xc2)]<PAGE_SIZE)break;_0x18547d++;}return _0x58d3a7;}export const sqlStatus={'service':'sql','command':a193_0x571bed(0xe9),'description':a193_0x571bed(0xd8),'risk':a193_0x571bed(0xcf),'flags':[{'name':a193_0x571bed(0xd7),'type':'boolean','description':a193_0x571bed(0xc4)}],async 'execute'(_0x281291){const _0x545850=a193_0x571bed,_0x173678=loadSqlProjectConfig(_0x281291[_0x545850(0xdd)]),_0x51a6d7=await readSqlLockFile(_0x173678[_0x545850(0xe4)]),{appLock:_0xdc4fbb}=ensureSqlLockScope(_0x51a6d7??createEmptySqlLock(),_0x173678[_0x545850(0xdd)],_0x173678[_0x545850(0xc3)],_0x545850(0xe9)),_0x5cc53d=await scanLocalSqlQueries(_0x173678),_0x788e5b=[],_0x1ccadf=[],_0x12f554=[],_0x5d3a60=[],_0xa29c62=new Set(_0x5cc53d[_0x545850(0xc9)](_0x55d6c7=>_0x55d6c7[_0x545850(0xe7)]));for(const _0x1dab18 of _0x5cc53d){const _0x14f012=await computeSqlFileHash(_0x1dab18[_0x545850(0xcc)]),_0x3b2021=_0xdc4fbb[_0x545850(0xc7)][_0x1dab18[_0x545850(0xe7)]],_0x4596b7=!!_0x3b2021&&_0x3b2021[_0x545850(0xc8)]!==_0x1dab18[_0x545850(0xe1)],_0x2d10e6=!!_0x3b2021&&!!_0x1dab18[_0x545850(0xc5)]&&_0x3b2021[_0x545850(0xc5)]!==_0x1dab18[_0x545850(0xc5)];if(!_0x3b2021)_0x788e5b[_0x545850(0xe3)](_0x1dab18[_0x545850(0xe7)]);else _0x3b2021[_0x545850(0xc6)]!==_0x14f012||_0x4596b7||_0x2d10e6?_0x1ccadf['push'](_0x1dab18['lockKey']):_0x12f554[_0x545850(0xe3)](_0x1dab18[_0x545850(0xe7)]);}for(const _0xff23a1 of Object[_0x545850(0xe5)](_0xdc4fbb[_0x545850(0xc7)])){!_0xa29c62[_0x545850(0xcd)](_0xff23a1)&&_0x5d3a60[_0x545850(0xe3)](_0xff23a1);}const _0x13c416=[];if(_0x281291[_0x545850(0xce)]('remote')){const _0x1ee9f6=await fetchAllSqlCodes(_0x281291[_0x545850(0xdd)]);for(const _0x4ed0be of _0x1ee9f6){!_0xa29c62['has'](_0x4ed0be)&&!_0xdc4fbb['sqls'][_0x4ed0be]&&_0x13c416[_0x545850(0xe3)](_0x4ed0be);}}const _0x4d205e=_0x788e5b[_0x545850(0xc2)]===0x0&&_0x1ccadf['length']===0x0&&_0x5d3a60[_0x545850(0xc2)]===0x0&&_0x13c416['length']===0x0;return{'ok':!![],'data':{'added':_0x788e5b,'modified':_0x1ccadf,'missing':_0x5d3a60,'unchanged':_0x12f554,'remoteOnly':_0x13c416},'message':_0x4d205e?_0x545850(0xd1):_0x788e5b[_0x545850(0xc2)]+_0x545850(0xe8)+_0x1ccadf[_0x545850(0xc2)]+_0x545850(0xd0)+_0x5d3a60[_0x545850(0xc2)]+'\x20missing,\x20'+_0x12f554['length']+'\x20unchanged'+(_0x13c416['length']>0x0?',\x20'+_0x13c416[_0x545850(0xc2)]+'\x20remote-only':'')};}};function a193_0x89c6(){const _0x1603bb=['55fzHGwa','86001IWUFdx','553tFNOvT','appCode','143MBtsxB','109818raQlEy','tableData','relativePath','92eqFJGF','push','lockFilePath','keys','3847767bEZbQZ','lockKey','\x20added,\x20','status','length','sqlRoot','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','sqlName','hash','sqls','path','map','1717834NRZnWT','paging','filePath','has','bool','read','\x20modified,\x20','All\x20SQL\x20queries\x20are\x20in\x20sync.','272958PqQNbu','totalCount','1fOQcmc','2661852fRqqJG','10UVnGSZ','remote','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','54360GwyGmM'];a193_0x89c6=function(){return _0x1603bb;};return a193_0x89c6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a194_0x2030ad=a194_0x501e;function a194_0x59b4(){const _0x2b5749=['push','sql','read','find','fields','joinAudit','flatMap','schema:','reason','Provide\x20--file\x20or\x20--sql','30310qUzRAt','tables','toLowerCase','name','valid','map','--check-indexes\x20requires\x20--schemas.','File\x20not\x20found:\x20','716QZHYtB','2564580vctyIL','from','7645atuhpF','Dataset\x20\x22','bool','index_columns','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','primary','\x22\x20not\x20found\x20in\x20any\x20dataset','file','index_name','parameters','tableName','string','1234135wvpJgR','isDangerous','schemaWarnings','8HSOpgR','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','str','dataset','cwd','trim','validation','message','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','length','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','isArray','pkField','filter','check-indexes','get','261546fzxcUJ','dbtableConfig','split','SQL\x20schema\x20validation','schemas','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','isSelectOnly','3JiiAqy','\x22\x20not\x20found\x20or\x20not\x20accessible','8679yHwsGa','size','appCode','sqlType','5012973iOOPXT','type','indexes','4479965wjXcrU','validate','columns','unshift'];a194_0x59b4=function(){return _0x2b5749;};return a194_0x59b4();}(function(_0x44051a,_0x4f6281){const _0x37bb57=a194_0x501e,_0x53c815=_0x44051a();while(!![]){try{const _0x803a71=parseInt(_0x37bb57(0x1b2))/0x1*(-parseInt(_0x37bb57(0x1ab))/0x2)+-parseInt(_0x37bb57(0x1b4))/0x3*(-parseInt(_0x37bb57(0x189))/0x4)+-parseInt(_0x37bb57(0x198))/0x5+-parseInt(_0x37bb57(0x18a))/0x6+-parseInt(_0x37bb57(0x173))/0x7+-parseInt(_0x37bb57(0x19b))/0x8*(parseInt(_0x37bb57(0x170))/0x9)+parseInt(_0x37bb57(0x181))/0xa*(parseInt(_0x37bb57(0x18c))/0xb);if(_0x803a71===_0x4f6281)break;else _0x53c815['push'](_0x53c815['shift']());}catch(_0x386eab){_0x53c815['push'](_0x53c815['shift']());}}}(a194_0x59b4,0x58178));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';import{CliErrors}from'../../errors.js';function a194_0x501e(_0xd6c801,_0xf17915){_0xd6c801=_0xd6c801-0x16e;const _0x59b41b=a194_0x59b4();let _0x501e19=_0x59b41b[_0xd6c801];return _0x501e19;}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2030ad(0x178),'command':a194_0x2030ad(0x174),'description':a194_0x2030ad(0x190),'risk':a194_0x2030ad(0x179),'flags':[{'name':'file','type':a194_0x2030ad(0x197),'description':a194_0x2030ad(0x1a5)},{'name':a194_0x2030ad(0x178),'type':a194_0x2030ad(0x197),'description':a194_0x2030ad(0x1a3)},{'name':a194_0x2030ad(0x1af),'type':a194_0x2030ad(0x197),'description':a194_0x2030ad(0x1b0)},{'name':'check-indexes','type':'boolean','description':a194_0x2030ad(0x19c)}],async 'execute'(_0xd1db24){const _0x5d9930=a194_0x2030ad,_0x515995=_0xd1db24[_0x5d9930(0x19d)](_0x5d9930(0x193)),_0x181f7d=_0xd1db24[_0x5d9930(0x19d)](_0x5d9930(0x178)),_0x235a94=_0xd1db24[_0x5d9930(0x19d)](_0x5d9930(0x1af)),_0x51314a=_0xd1db24[_0x5d9930(0x18e)](_0x5d9930(0x1a9));if(!_0x515995&&!_0x181f7d)throw CliErrors['flagMissing'](_0x5d9930(0x193),_0x5d9930(0x180));if(_0x51314a&&!_0x235a94)throw CliErrors[_0x5d9930(0x1a1)](_0x5d9930(0x187));let _0x1ae3c7;if(_0x515995){const _0x3206a4=resolve(process[_0x5d9930(0x19f)](),_0x515995);if(!existsSync(_0x3206a4))throw CliErrors[_0x5d9930(0x1a1)](_0x5d9930(0x188)+_0x3206a4);_0x1ae3c7=readFileSync(_0x3206a4,'utf-8');}else _0x1ae3c7=_0x181f7d;const _0x53ee90=validateSql(_0x1ae3c7),_0x33e7b7={'valid':_0x53ee90[_0x5d9930(0x185)],'sqlType':_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x171)],'isSelectOnly':_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x1b1)],'isDangerous':_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x199)],'tables':_0x53ee90[_0x5d9930(0x182)],'parameters':_0x53ee90[_0x5d9930(0x195)],'message':_0x53ee90[_0x5d9930(0x1a2)]};_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x17f)]&&(_0x33e7b7[_0x5d9930(0x17f)]=_0x53ee90[_0x5d9930(0x16f)][_0x5d9930(0x17f)]);if(_0x235a94&&_0x53ee90[_0x5d9930(0x185)]){const _0xb8a8e7=_0x235a94[_0x5d9930(0x1ad)](',')[_0x5d9930(0x186)](_0x33e4f=>_0x33e4f[_0x5d9930(0x1a0)]())['filter'](Boolean),_0x30c94d=[],_0x207a66=[],_0x1d238f=filterDbTableBackedDatasets(await listDatasets(_0xd1db24[_0x5d9930(0x16e)])),_0x49e146=new Map(_0x1d238f[_0x5d9930(0x186)](_0xabf989=>[_0xabf989[_0x5d9930(0x1ac)]?.[_0x5d9930(0x196)]?.['toLowerCase'](),_0xabf989]));for(const _0x458adf of _0x53ee90['tables']){const _0x278bb7=_0x49e146[_0x5d9930(0x1aa)](_0x458adf[_0x5d9930(0x183)]());!_0x278bb7&&_0x30c94d['push']('Table\x20\x22'+_0x458adf+_0x5d9930(0x192));}for(const _0x33fa34 of _0xb8a8e7){let _0x31c0e6;try{_0x31c0e6=await getDatasetDetail(_0x33fa34);}catch{_0x30c94d[_0x5d9930(0x177)](_0x5d9930(0x18d)+_0x33fa34+_0x5d9930(0x1b3));continue;}assertDatasetIsDbTableBacked(_0x31c0e6,_0x5d9930(0x1ae));const _0x4ee6c5=Array[_0x5d9930(0x1a6)](_0x31c0e6[_0x5d9930(0x17b)])?_0x31c0e6[_0x5d9930(0x17b)]:[],_0x233e2a=new Set(_0x4ee6c5[_0x5d9930(0x186)](_0x1fd0d1=>_0x1fd0d1['name']?.['toLowerCase']())),_0x4353ac=_0x31c0e6[_0x5d9930(0x1ac)]?.[_0x5d9930(0x196)]||_0x31c0e6[_0x5d9930(0x196)]||_0x33fa34;_0x33e7b7[_0x5d9930(0x17e)+_0x4353ac]={'code':_0x33fa34,'tableName':_0x4353ac,'fieldCount':_0x233e2a[_0x5d9930(0x1b5)],'fields':Array[_0x5d9930(0x18b)](_0x233e2a)};if(_0x51314a){const _0x7628e7=normalizeDatasetIndexes(_0x31c0e6);_0x207a66[_0x5d9930(0x177)]({'tableName':_0x4353ac,..._0x7628e7});}}_0x30c94d['length']>0x0&&(_0x33e7b7[_0x5d9930(0x19a)]=_0x30c94d),_0x51314a&&(_0x33e7b7[_0x5d9930(0x17c)]=auditSqlJoinIndexes(_0x1ae3c7,_0x207a66));}return{'ok':_0x53ee90['valid'],'data':_0x33e7b7,'message':_0x53ee90['message']};}};function normalizeDatasetIndexes(_0x283c55){const _0x48cae1=a194_0x2030ad,_0x288333=Array[_0x48cae1(0x1a6)](_0x283c55?.[_0x48cae1(0x19e)]?.['indexes'])?_0x283c55[_0x48cae1(0x19e)][_0x48cae1(0x172)]:Array['isArray'](_0x283c55?.[_0x48cae1(0x172)])?_0x283c55[_0x48cae1(0x172)]:[],_0x49aaf7=_0x288333[_0x48cae1(0x17d)](_0x478bfc=>{const _0x398563=_0x48cae1,_0x1ea294=Array[_0x398563(0x1a6)](_0x478bfc?.['index_columns'])?_0x478bfc[_0x398563(0x18f)]:Array[_0x398563(0x1a6)](_0x478bfc?.['columnNames'])?_0x478bfc['columnNames']:Array[_0x398563(0x1a6)](_0x478bfc?.[_0x398563(0x175)])?_0x478bfc[_0x398563(0x175)]:[],_0x18fb16=_0x1ea294[_0x398563(0x1a8)](_0x133231=>typeof _0x133231===_0x398563(0x197))[_0x398563(0x186)](_0x164b2b=>_0x164b2b[_0x398563(0x1a0)]())[_0x398563(0x1a8)](Boolean);if(_0x18fb16[_0x398563(0x1a4)]===0x0)return[];const _0x59d984=[_0x478bfc?.['indexName'],_0x478bfc?.[_0x398563(0x194)],_0x478bfc?.[_0x398563(0x184)]][_0x398563(0x17a)](_0x1b0f3b=>typeof _0x1b0f3b==='string'&&_0x1b0f3b[_0x398563(0x1a0)]()),_0x5650f3=[_0x478bfc?.['index_type'],_0x478bfc?.[_0x398563(0x171)]][_0x398563(0x17a)](_0x25bee6=>typeof _0x25bee6===_0x398563(0x197)&&_0x25bee6[_0x398563(0x1a0)]());return[{..._0x59d984?{'name':_0x59d984['trim']()}:{},..._0x5650f3?{'type':_0x5650f3['trim']()}:{},'columns':_0x18fb16}];}),_0x3fed82=[..._0x49aaf7],_0x59c140=typeof _0x283c55?.[_0x48cae1(0x1ac)]?.['pkField']===_0x48cae1(0x197)?_0x283c55[_0x48cae1(0x1ac)][_0x48cae1(0x1a7)][_0x48cae1(0x1ad)](',')[_0x48cae1(0x186)](_0x2df13e=>_0x2df13e[_0x48cae1(0x1a0)]())[_0x48cae1(0x1a8)](Boolean):[];return _0x59c140['length']>0x0&&_0x3fed82[_0x48cae1(0x176)]({'type':_0x48cae1(0x191),'columns':_0x59c140}),{'indexes':_0x3fed82,'metadataAvailable':_0x49aaf7[_0x48cae1(0x1a4)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a195_0x418e(){const _0x553cf0=['138mfjuDa','244960VOWrDZ','12299058iwujFU','3669405TDUgPI','928041RYEAAJ','2AXYRSU','39781730vYEtdJ','234455QRJaar','364gpoYgw','4822984SHkRnd'];a195_0x418e=function(){return _0x553cf0;};return a195_0x418e();}function a195_0x541a(_0x18b95d,_0x4e1096){_0x18b95d=_0x18b95d-0x1c4;const _0x418e9f=a195_0x418e();let _0x541ae6=_0x418e9f[_0x18b95d];return _0x541ae6;}(function(_0x2bd67f,_0x5bccd6){const _0x2d37e4=a195_0x541a,_0x3ed1df=_0x2bd67f();while(!![]){try{const _0x4a48fa=-parseInt(_0x2d37e4(0x1cd))/0x1*(-parseInt(_0x2d37e4(0x1c4))/0x2)+-parseInt(_0x2d37e4(0x1cc))/0x3+parseInt(_0x2d37e4(0x1c8))/0x4+-parseInt(_0x2d37e4(0x1c6))/0x5*(parseInt(_0x2d37e4(0x1c9))/0x6)+parseInt(_0x2d37e4(0x1c7))/0x7*(-parseInt(_0x2d37e4(0x1ca))/0x8)+-parseInt(_0x2d37e4(0x1cb))/0x9+parseInt(_0x2d37e4(0x1c5))/0xa;if(_0x4a48fa===_0x5bccd6)break;else _0x3ed1df['push'](_0x3ed1df['shift']());}catch(_0x14275a){_0x3ed1df['push'](_0x3ed1df['shift']());}}}(a195_0x418e,0xcfe4a));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a196_0x4b59(_0x1d47cb,_0x522a8a){_0x1d47cb=_0x1d47cb-0xd1;const _0x15b20b=a196_0x15b2();let _0x4b5992=_0x15b20b[_0x1d47cb];return _0x4b5992;}const a196_0x52c0d1=a196_0x4b59;(function(_0x461465,_0x26209d){const _0x1ee49f=a196_0x4b59,_0x3c29b5=_0x461465();while(!![]){try{const _0xc6e287=parseInt(_0x1ee49f(0xd2))/0x1*(-parseInt(_0x1ee49f(0xdc))/0x2)+parseInt(_0x1ee49f(0xe8))/0x3+parseInt(_0x1ee49f(0xdf))/0x4*(-parseInt(_0x1ee49f(0xe0))/0x5)+-parseInt(_0x1ee49f(0xd6))/0x6+-parseInt(_0x1ee49f(0xd7))/0x7+parseInt(_0x1ee49f(0xd1))/0x8+parseInt(_0x1ee49f(0xdb))/0x9;if(_0xc6e287===_0x26209d)break;else _0x3c29b5['push'](_0x3c29b5['shift']());}catch(_0xb215af){_0x3c29b5['push'](_0x3c29b5['shift']());}}}(a196_0x15b2,0x3d4b5));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a196_0x52c0d1(0xe6),'command':'status','description':a196_0x52c0d1(0xd9),'risk':a196_0x52c0d1(0xe1),'defaultOutputFormat':a196_0x52c0d1(0xe2),'structuredErrors':!![],'flags':[{'name':'task-id','type':a196_0x52c0d1(0xdd),'required':!![],'description':a196_0x52c0d1(0xda)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x23fbce){const _0x4f36c0=a196_0x52c0d1;if(!_0x23fbce[_0x4f36c0(0xe7)](_0x4f36c0(0xde))[_0x4f36c0(0xe5)]())throw CliErrors['flagMissing'](_0x4f36c0(0xde));},async 'execute'(_0x5654ca){const _0x1f8cc5=a196_0x52c0d1,_0x1e2298=_0x5654ca[_0x1f8cc5(0xe7)]('task-id')[_0x1f8cc5(0xe5)](),_0x41ab45=normalizeAsyncTask(await getAsyncTaskStatus(_0x1e2298,_0x5654ca[_0x1f8cc5(0xe3)],_0x5654ca[_0x1f8cc5(0xd4)]));if(_0x41ab45[_0x1f8cc5(0xe4)]!==_0x1e2298)throw CliErrors[_0x1f8cc5(0xd5)](_0x1f8cc5(0xd3)+_0x1e2298+',\x20received\x20'+_0x41ab45[_0x1f8cc5(0xe4)]+'.');const _0xa8dd29=buildAsyncTaskStatusCommand(_0x41ab45[_0x1f8cc5(0xe4)],_0x5654ca[_0x1f8cc5(0xe3)]);return{'ok':!![],'message':asyncTaskMessage(_0x41ab45),'data':{'appCode':_0x5654ca['appCode'],..._0x41ab45,'query':_0x41ab45[_0x1f8cc5(0xd8)]?null:{'command':_0xa8dd29}}};}};function a196_0x15b2(){const _0x4e143d=['apiError','186798sECEWx','2444001dLPwgW','isTerminal','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','6558309xwKBKA','246630auRJwO','string','task-id','21704SOoHje','155jSmSBV','read','compress','appCode','taskId','trim','task','str','1022484gklqNB','1786192aYlpUl','4uschSv','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','cookie'];a196_0x15b2=function(){return _0x4e143d;};return a196_0x15b2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a197_0x2b19(_0x4ffe31,_0x3a40b3){_0x4ffe31=_0x4ffe31-0xc3;const _0x58dbaf=a197_0x58db();let _0x2b19b5=_0x58dbaf[_0x4ffe31];return _0x2b19b5;}(function(_0x23d26e,_0x438c42){const _0x3a1d99=a197_0x2b19,_0x40f776=_0x23d26e();while(!![]){try{const _0x3b9727=-parseInt(_0x3a1d99(0xcb))/0x1+parseInt(_0x3a1d99(0xc9))/0x2*(-parseInt(_0x3a1d99(0xc3))/0x3)+-parseInt(_0x3a1d99(0xc5))/0x4*(-parseInt(_0x3a1d99(0xc7))/0x5)+-parseInt(_0x3a1d99(0xcc))/0x6+-parseInt(_0x3a1d99(0xca))/0x7+-parseInt(_0x3a1d99(0xc8))/0x8*(-parseInt(_0x3a1d99(0xc4))/0x9)+parseInt(_0x3a1d99(0xc6))/0xa;if(_0x3b9727===_0x438c42)break;else _0x40f776['push'](_0x40f776['shift']());}catch(_0x1e3bc3){_0x40f776['push'](_0x40f776['shift']());}}}(a197_0x58db,0x7ac69));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a197_0x58db(){const _0x513660=['835098cHgBRO','2138976UNbXmj','66561FCaqtd','2142pbzLNf','11724jMEoRR','18311100qgWkCS','135MhNzcO','9112sGXuem','34zxBNZq','767669YjWhXP'];a197_0x58db=function(){return _0x513660;};return a197_0x58db();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a198_0x50ad57=a198_0x4ce7;function a198_0x4ce7(_0xd0f8b0,_0x556f44){_0xd0f8b0=_0xd0f8b0-0x11a;const _0x471cdb=a198_0x471c();let _0x4ce768=_0x471cdb[_0xd0f8b0];return _0x4ce768;}(function(_0x3450de,_0xd37e6a){const _0x200775=a198_0x4ce7,_0x2d7b29=_0x3450de();while(!![]){try{const _0x250ec6=-parseInt(_0x200775(0x124))/0x1+-parseInt(_0x200775(0x123))/0x2+parseInt(_0x200775(0x128))/0x3+parseInt(_0x200775(0x127))/0x4+parseInt(_0x200775(0x12c))/0x5*(parseInt(_0x200775(0x122))/0x6)+parseInt(_0x200775(0x11b))/0x7*(parseInt(_0x200775(0x120))/0x8)+-parseInt(_0x200775(0x121))/0x9;if(_0x250ec6===_0xd37e6a)break;else _0x2d7b29['push'](_0x2d7b29['shift']());}catch(_0x61c4d7){_0x2d7b29['push'](_0x2d7b29['shift']());}}}(a198_0x471c,0xb30c3));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a198_0x471c(){const _0x534aac=['tenant-code','139960KxfwGr','12970602ybHICw','476610zPHsGw','15200SjnwGQ','1158332rLhZZZ','members-list','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','2291480rPRpTE','1955067tOhNzO','length','Exact\x20tenant\x20code','flagMissing','55CLVzuu','trim','497MyYxbn','\x20tenant\x20member(s)','read','Found\x20'];a198_0x471c=function(){return _0x534aac;};return a198_0x471c();}export const tenantMembersListDefinition={'service':'tenant','command':a198_0x50ad57(0x125),'description':a198_0x50ad57(0x126),'risk':a198_0x50ad57(0x11d),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'tenant-code','type':'string','required':!![],'description':a198_0x50ad57(0x12a)}],async 'validate'(_0xda585b){const _0x283d2e=a198_0x50ad57;if(!_0xda585b['str'](_0x283d2e(0x11f))[_0x283d2e(0x11a)]())throw CliErrors[_0x283d2e(0x12b)]('tenant-code','Pass\x20--tenant-code\x20<code>.');},async 'execute'(_0x2bf689){const _0x24cc93=a198_0x50ad57,_0x50caf2=_0x2bf689['str'](_0x24cc93(0x11f))[_0x24cc93(0x11a)](),_0xbef681=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x50caf2,_0xbef681);const _0x26e00e=projectTenantMembers(await listTenantDirectoryMembers(_0x50caf2));return{'ok':!![],'data':{'tenantCode':_0x50caf2,'items':_0x26e00e,'totalCount':_0x26e00e[_0x24cc93(0x129)]},'message':_0x24cc93(0x11e)+_0x26e00e[_0x24cc93(0x129)]+_0x24cc93(0x11c)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c2731,_0x2db87c){const _0x3d7e28=a199_0x9ef6,_0x4759bb=_0x1c2731();while(!![]){try{const _0x10bdd9=-parseInt(_0x3d7e28(0x16b))/0x1*(parseInt(_0x3d7e28(0x16c))/0x2)+parseInt(_0x3d7e28(0x161))/0x3*(parseInt(_0x3d7e28(0x162))/0x4)+parseInt(_0x3d7e28(0x166))/0x5*(-parseInt(_0x3d7e28(0x170))/0x6)+parseInt(_0x3d7e28(0x15e))/0x7*(-parseInt(_0x3d7e28(0x174))/0x8)+-parseInt(_0x3d7e28(0x15f))/0x9*(parseInt(_0x3d7e28(0x16f))/0xa)+-parseInt(_0x3d7e28(0x16d))/0xb*(parseInt(_0x3d7e28(0x173))/0xc)+parseInt(_0x3d7e28(0x16e))/0xd;if(_0x10bdd9===_0x2db87c)break;else _0x4759bb['push'](_0x4759bb['shift']());}catch(_0x2e5ac4){_0x4759bb['push'](_0x4759bb['shift']());}}}(a199_0x446b,0x23ef4));function a199_0x9ef6(_0x12fcf7,_0x3d164e){_0x12fcf7=_0x12fcf7-0x156;const _0x446b9c=a199_0x446b();let _0x9ef633=_0x446b9c[_0x12fcf7];return _0x9ef633;}import{CliErrors}from'../../errors.js';function textOrNull(_0x1362d3){const _0x33ae5b=a199_0x9ef6,_0x511a97=_0x1362d3?.[_0x33ae5b(0x160)]();return _0x511a97?_0x511a97:null;}function a199_0x446b(){const _0x2ab67a=['adminFlag','status','tenantCode','sort','isFinite','32326MPJomV','156672NfrAUW','trim','3ObCmDt','515728dvRlQq','validation','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','30uUyXfH','Tenant\x20\x22','username','MEMBER','some','1uDiCFZ','48406sfPTGu','847WiMETs','5434468gdiBjk','40cQLHyU','92184NOgoYp','ADMIN','displayName','8844rAQQNZ','272NzHASZ','set','role','userId'];a199_0x446b=function(){return _0x2ab67a;};return a199_0x446b();}export function projectTenantMembers(_0x2caa35){const _0x25fd17=a199_0x9ef6,_0x443960=new Map();for(const _0x47ac8d of _0x2caa35){const _0x5d9edc=Number(_0x47ac8d[_0x25fd17(0x158)]);if(!Number[_0x25fd17(0x15d)](_0x5d9edc)||_0x5d9edc<=0x0)continue;const _0x1eb605={'userId':_0x5d9edc,'username':textOrNull(_0x47ac8d[_0x25fd17(0x168)]),'displayName':textOrNull(_0x47ac8d['nickname']),'role':_0x47ac8d[_0x25fd17(0x159)]===!![]?_0x25fd17(0x171):_0x25fd17(0x169),'status':textOrNull(_0x47ac8d[_0x25fd17(0x15a)])},_0x3fae07=_0x443960['get'](_0x5d9edc);if(!_0x3fae07){_0x443960[_0x25fd17(0x156)](_0x5d9edc,_0x1eb605);continue;}_0x3fae07[_0x25fd17(0x168)]??=_0x1eb605['username'],_0x3fae07[_0x25fd17(0x172)]??=_0x1eb605['displayName'],_0x3fae07[_0x25fd17(0x15a)]??=_0x1eb605[_0x25fd17(0x15a)];if(_0x1eb605[_0x25fd17(0x157)]===_0x25fd17(0x171))_0x3fae07[_0x25fd17(0x157)]='ADMIN';}return[..._0x443960['values']()][_0x25fd17(0x15c)]((_0x2ec860,_0x4e626b)=>_0x2ec860[_0x25fd17(0x158)]-_0x4e626b[_0x25fd17(0x158)]);}export function assertTenantAccessible(_0x460439,_0x1c026a){const _0x2d72c3=a199_0x9ef6;if(_0x1c026a[_0x2d72c3(0x16a)](_0x1a3bf7=>_0x1a3bf7[_0x2d72c3(0x15b)]===_0x460439))return;throw CliErrors[_0x2d72c3(0x163)](_0x2d72c3(0x167)+_0x460439+_0x2d72c3(0x164),_0x2d72c3(0x165));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a200_0x1a2771=a200_0x4014;function a200_0x4014(_0x36f718,_0xd95d0e){_0x36f718=_0x36f718-0xd0;const _0x57ab53=a200_0x57ab();let _0x40146a=_0x57ab53[_0x36f718];return _0x40146a;}(function(_0x3dfa1a,_0x58c09e){const _0x19144e=a200_0x4014,_0x340e7b=_0x3dfa1a();while(!![]){try{const _0x4f33f2=-parseInt(_0x19144e(0xe6))/0x1+parseInt(_0x19144e(0xdf))/0x2*(parseInt(_0x19144e(0xdd))/0x3)+-parseInt(_0x19144e(0xeb))/0x4+-parseInt(_0x19144e(0xe2))/0x5*(-parseInt(_0x19144e(0xd1))/0x6)+-parseInt(_0x19144e(0xdb))/0x7*(parseInt(_0x19144e(0xd4))/0x8)+-parseInt(_0x19144e(0xde))/0x9*(-parseInt(_0x19144e(0xd9))/0xa)+-parseInt(_0x19144e(0xea))/0xb;if(_0x4f33f2===_0x58c09e)break;else _0x340e7b['push'](_0x340e7b['shift']());}catch(_0x487fce){_0x340e7b['push'](_0x340e7b['shift']());}}}(a200_0x57ab,0x33f5a));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a200_0x57ab(){const _0x49ea95=['395013PqlPqu','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','str','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','992915kHewZY','636992vsqBeB','apiError','18RGmXWE','ding-talk-user-id','string','8QrjmYP','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','--ding-talk-user-id\x20cannot\x20be\x20empty.','bind','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','130JmAsxo','trim','115885wJwatr','write','6rfdgMA','238131BWeFQG','377882PkZdLn','validation','dingding-sandbox','253430AfDdVO','dingding-sandbox-bind','user-account','POST'];a200_0x57ab=function(){return _0x49ea95;};return a200_0x57ab();}import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x1a2771(0xe1),CURRENT_BINDING_WARNING=a200_0x1a2771(0xd8);function readDingTalkUserId(_0x2bcc3e){const _0x1e331e=a200_0x1a2771,_0x5baf09=_0x2bcc3e[_0x1e331e(0xe8)](_0x1e331e(0xd2))[_0x1e331e(0xda)]();if(!_0x5baf09)throw CliErrors[_0x1e331e(0xe0)](_0x1e331e(0xd6),'Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.');return _0x5baf09;}function buildBindingData(_0x45b2d2,_0x497db7){const _0x4ac85d=a200_0x1a2771;return{'operation':_0x4ac85d(0xd7),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x45b2d2},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x45b2d2,'bound':!![]},'dryRun':_0x497db7,'backend':{'method':_0x4ac85d(0xe5),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x1a2771(0xe4),'command':a200_0x1a2771(0xe3),'description':a200_0x1a2771(0xe9),'risk':a200_0x1a2771(0xdc),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x1a2771(0xd2),'type':a200_0x1a2771(0xd3),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x2a3b90){readDingTalkUserId(_0x2a3b90);},async 'dryRun'(_0x394238){const _0xfcd79d=readDingTalkUserId(_0x394238);return asDryRunResult(buildBindingData(_0xfcd79d,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x435ee4){const _0x17bd53=a200_0x1a2771,_0x4695ef=readDingTalkUserId(_0x435ee4),_0x184cf7=await bindDingTalkSandboxAccount(_0x4695ef);if(_0x184cf7!==!![])throw CliErrors[_0x17bd53(0xd0)]('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x17bd53(0xe7));return{'ok':!![],'data':buildBindingData(_0x4695ef,![]),'message':_0x17bd53(0xd5)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a201_0x5b21(_0x437e54,_0x2d7631){_0x437e54=_0x437e54-0x185;const _0x39e4ee=a201_0x39e4();let _0x5b218f=_0x39e4ee[_0x437e54];return _0x5b218f;}(function(_0x4df4c2,_0x1fb796){const _0x1f2fec=a201_0x5b21,_0x4ec44f=_0x4df4c2();while(!![]){try{const _0x21a9c3=-parseInt(_0x1f2fec(0x185))/0x1*(parseInt(_0x1f2fec(0x18b))/0x2)+parseInt(_0x1f2fec(0x18a))/0x3*(-parseInt(_0x1f2fec(0x18c))/0x4)+-parseInt(_0x1f2fec(0x186))/0x5+-parseInt(_0x1f2fec(0x188))/0x6*(-parseInt(_0x1f2fec(0x187))/0x7)+parseInt(_0x1f2fec(0x18e))/0x8+parseInt(_0x1f2fec(0x18d))/0x9+parseInt(_0x1f2fec(0x189))/0xa;if(_0x21a9c3===_0x1fb796)break;else _0x4ec44f['push'](_0x4ec44f['shift']());}catch(_0x19b418){_0x4ec44f['push'](_0x4ec44f['shift']());}}}(a201_0x39e4,0x961df));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a201_0x39e4(){const _0x551806=['14611170IfmIRb','456qujZYU','2GmswDQ','23424eWIzWu','4343166rjgyZP','1468752LUdRFk','787847IJhsut','637010gxOMbC','410137KSGSZR','30udbiKF'];a201_0x39e4=function(){return _0x551806;};return a201_0x39e4();}export const userAccountDefinitions=[dingTalkSandboxBind];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a202_0x11a5c6=a202_0x579f;(function(_0x5065ec,_0x4a3b25){const _0x2e97a4=a202_0x579f,_0x3a83cc=_0x5065ec();while(!![]){try{const _0x12f025=parseInt(_0x2e97a4(0xaa))/0x1*(-parseInt(_0x2e97a4(0xac))/0x2)+parseInt(_0x2e97a4(0xb5))/0x3+parseInt(_0x2e97a4(0xb1))/0x4*(parseInt(_0x2e97a4(0xaf))/0x5)+-parseInt(_0x2e97a4(0xad))/0x6+parseInt(_0x2e97a4(0xa8))/0x7*(-parseInt(_0x2e97a4(0xa9))/0x8)+parseInt(_0x2e97a4(0xb0))/0x9+-parseInt(_0x2e97a4(0xa7))/0xa*(-parseInt(_0x2e97a4(0xab))/0xb);if(_0x12f025===_0x4a3b25)break;else _0x3a83cc['push'](_0x3a83cc['shift']());}catch(_0x1ed3b8){_0x3a83cc['push'](_0x3a83cc['shift']());}}}(a202_0x429f,0x98945));function a202_0x579f(_0x13d035,_0x5b2307){_0x13d035=_0x13d035-0xa7;const _0x429fab=a202_0x429f();let _0x579f6d=_0x429fab[_0x13d035];return _0x579f6d;}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a202_0x11a5c6(0xb2),'description':a202_0x11a5c6(0xb3),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x11a5c6(0xb6),'description':a202_0x11a5c6(0xae),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x41d95d=>validateAppName(_0x41d95d,a202_0x11a5c6(0xb4)),'execute':_0x439629=>runAppAdd(_0x439629,a202_0x11a5c6(0xb4))};function a202_0x429f(){const _0x2a3d47=['5yPUgdt','11daZJrM','288382Muumru','705138pYSHzF','App\x20profile\x20name','45MOOlHI','10893141YuKcCH','4356XQKNSh','add','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','workspace\x20add','204900dAWjhq','name','11479430vzZzSW','22330SJOwUN','2440VCYWOb'];a202_0x429f=function(){return _0x2a3d47;};return a202_0x429f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a203_0x31f5d3=a203_0x245c;(function(_0x102a1d,_0x96ab4f){const _0x8a178e=a203_0x245c,_0x4390d3=_0x102a1d();while(!![]){try{const _0x54c2a7=-parseInt(_0x8a178e(0xfa))/0x1+parseInt(_0x8a178e(0xf1))/0x2*(-parseInt(_0x8a178e(0xde))/0x3)+parseInt(_0x8a178e(0x107))/0x4*(parseInt(_0x8a178e(0xe8))/0x5)+-parseInt(_0x8a178e(0xd8))/0x6*(parseInt(_0x8a178e(0x105))/0x7)+-parseInt(_0x8a178e(0xe2))/0x8*(-parseInt(_0x8a178e(0x103))/0x9)+parseInt(_0x8a178e(0xe6))/0xa*(parseInt(_0x8a178e(0xf8))/0xb)+-parseInt(_0x8a178e(0xe9))/0xc*(-parseInt(_0x8a178e(0xf7))/0xd);if(_0x54c2a7===_0x96ab4f)break;else _0x4390d3['push'](_0x4390d3['shift']());}catch(_0x568378){_0x4390d3['push'](_0x4390d3['shift']());}}}(a203_0x4840,0xb41f1));import{CliErrors}from'../../errors.js';function a203_0x245c(_0x26cc0b,_0x51d233){_0x26cc0b=_0x26cc0b-0xd2;const _0x48406c=a203_0x4840();let _0x245cfb=_0x48406c[_0x26cc0b];return _0x245cfb;}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';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=['appcode','env',a203_0x31f5d3(0xe4),a203_0x31f5d3(0xd7),a203_0x31f5d3(0xec),'riskLevel',a203_0x31f5d3(0x10c)],workspaceFlags=[{'name':a203_0x31f5d3(0x10b),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0x102)},{'name':a203_0x31f5d3(0xf3),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xfc)},{'name':'env','type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xdb),'enum':[...RABETBASE_ENV_VALUES]},{'name':a203_0x31f5d3(0xe4),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xf6)},{'name':'defaultFormat','type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0xf2),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a203_0x31f5d3(0xec),'type':a203_0x31f5d3(0xe3),'description':a203_0x31f5d3(0xdc)},{'name':a203_0x31f5d3(0xfb),'type':a203_0x31f5d3(0xef),'description':a203_0x31f5d3(0x10a),'enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x31f5d3(0x10c),'type':a203_0x31f5d3(0xef),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x2703e4){const _0xf295de=a203_0x31f5d3;return!!_0x2703e4&&typeof _0x2703e4===_0xf295de(0x109)&&!Array[_0xf295de(0xfe)](_0x2703e4);}function assertValidAppcode(_0x3d63f7){const _0x796ff0=a203_0x31f5d3,{valid:_0x47ce4d,message:_0x5d2712}=validateAppcode(_0x3d63f7);if(!_0x47ce4d)throw CliErrors[_0x796ff0(0xe5)](_0x796ff0(0xeb)+_0x3d63f7,_0x5d2712);}function sanitizeProfile(_0x477666){if(!isRecord(_0x477666))return{};const _0x2a5b4e={};for(const _0x18bcb2 of SAFE_PROFILE_KEYS){if(_0x477666[_0x18bcb2]!==undefined)_0x2a5b4e[_0x18bcb2]=_0x477666[_0x18bcb2];}return _0x2a5b4e;}function cloneProfile(_0x21695f){return isRecord(_0x21695f)?{..._0x21695f}:{};}function collectWorkspaceProfileOverrides(_0x584169){const _0x2a3971=a203_0x31f5d3,_0x1d7de7={},_0x561183=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0xea)),_0x20d864=_0x584169[_0x2a3971(0xe1)]('apiDir'),_0x1610e5=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0xf4)),_0x1ff810=_0x584169['flag'](_0x2a3971(0xec)),_0xa138d6=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0xfb)),_0x57945c=_0x584169[_0x2a3971(0xe1)](_0x2a3971(0x10c));if(_0x561183)_0x1d7de7['env']=_0x561183;if(_0x20d864)_0x1d7de7[_0x2a3971(0xe4)]=_0x20d864;if(_0x1610e5)_0x1d7de7[_0x2a3971(0xd7)]=_0x1610e5;if(_0x1ff810!==undefined&&_0x1ff810!=='')_0x1d7de7[_0x2a3971(0xec)]=Number(_0x1ff810);if(_0xa138d6)_0x1d7de7['riskLevel']=_0xa138d6;if(_0x57945c)_0x1d7de7[_0x2a3971(0x10c)]=_0x57945c;return _0x1d7de7;}async function validateWorkspaceArgs(_0x459b41){const _0x50d603=a203_0x31f5d3,_0x304d57=_0x459b41['str']('app')[_0x50d603(0xf5)](),_0x486fd7=_0x459b41['str'](_0x50d603(0xf3))['trim']();if(!_0x304d57&&!_0x486fd7)throw CliErrors['validation']('Missing\x20workspace\x20app\x20selector.','Use\x20`'+CLI_BIN_NAME+_0x50d603(0xd3)+CLI_BIN_NAME+_0x50d603(0xee));if(_0x486fd7)assertValidAppcode(_0x486fd7);}function resolveKnownApps(){const _0x173720=a203_0x31f5d3,{config:_0x1a019a,layers:_0xaf1886}=readRawConfigWithLayers(),_0x2094b5=isRecord(_0x1a019a[_0x173720(0xd9)])?_0x1a019a[_0x173720(0xd9)]:{},_0xcf0c31=isRecord(_0xaf1886[_0x173720(0xf0)][_0x173720(0xd9)])?_0xaf1886[_0x173720(0xf0)][_0x173720(0xd9)]:{};return{..._0xcf0c31,..._0x2094b5};}async function configureWorkspace(_0x958aa,_0x103d16){const _0xe7d303=a203_0x31f5d3,_0x3aa7da=_0x958aa[_0xe7d303(0xe1)](_0xe7d303(0x10b))['trim'](),_0x3a95d9=_0x958aa['str'](_0xe7d303(0xf3))[_0xe7d303(0xf5)](),_0x5a2758=_0x3aa7da||_0x3a95d9;if(!_0x5a2758)throw CliErrors[_0xe7d303(0xe5)]('Missing\x20workspace\x20app\x20selector.',_0xe7d303(0x100)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0xe7d303(0xee));if(_0x3a95d9)assertValidAppcode(_0x3a95d9);const _0xae8e7a=resolveWriteConfigPath('project'),_0x39958f=readConfigFile(_0xae8e7a),_0x5aa0ed=resolveKnownApps(),_0x42dcc1=isRecord(_0x39958f[_0xe7d303(0xd9)])?{..._0x39958f[_0xe7d303(0xd9)]}:{},_0x11e7df=cloneProfile(_0x42dcc1[_0x5a2758]),_0x38884c=sanitizeProfile(_0x5aa0ed[_0x5a2758]),_0x2f11b6=_0x3a95d9?{}:_0x38884c,_0x288e10=_0x3a95d9||_0x2f11b6[_0xe7d303(0xf3)];if(!_0x288e10){const _0x45f2bd=Object[_0xe7d303(0xdd)](_0x5aa0ed),_0x1818d8=_0x45f2bd[_0xe7d303(0xd5)]===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20'+_0x103d16+'\x20--app\x20'+_0x5a2758+_0xe7d303(0xfd):_0xe7d303(0x104)+_0x45f2bd[_0xe7d303(0xe7)](',\x20');throw CliErrors[_0xe7d303(0xe5)]('App\x20\x22'+_0x5a2758+_0xe7d303(0x106),_0x1818d8);}assertValidAppcode(String(_0x288e10));const _0x1a9807={..._0x2f11b6,..._0x11e7df,'appcode':String(_0x288e10),...collectWorkspaceProfileOverrides(_0x958aa)};return _0x42dcc1[_0x5a2758]=_0x1a9807,_0x39958f['apps']=_0x42dcc1,_0x39958f[_0xe7d303(0xd2)]=_0x5a2758,delete _0x39958f[_0xe7d303(0xf3)],delete _0x39958f['app'],_0x1a9807[_0xe7d303(0xea)]&&(_0x39958f[_0xe7d303(0xea)]=_0x1a9807['env']),writeConfigFile(_0xae8e7a,_0x39958f),{'ok':!![],'message':_0xe7d303(0xdf)+(_0x103d16===_0xe7d303(0x101)?_0xe7d303(0xd6):'updated')+':\x20'+_0x5a2758+_0xe7d303(0xff)+_0x1a9807['appcode']+_0xe7d303(0x108)+_0xae8e7a+_0xe7d303(0xd4),'data':{'operation':'workspace.'+_0x103d16,'configPath':_0xae8e7a,'app':_0x5a2758,'appcode':_0x1a9807[_0xe7d303(0xf3)],'env':_0x1a9807[_0xe7d303(0xea)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x31f5d3(0xda),'command':a203_0x31f5d3(0x101),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':a203_0x31f5d3(0xed),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x23c95a=>configureWorkspace(_0x23c95a,a203_0x31f5d3(0x101))},workspaceUseDefinition={'service':a203_0x31f5d3(0xda),'command':a203_0x31f5d3(0xe0),'description':a203_0x31f5d3(0xf9),'risk':a203_0x31f5d3(0xed),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x46d43d=>configureWorkspace(_0x46d43d,a203_0x31f5d3(0xe0))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};function a203_0x4840(){const _0x3693ec=['Use\x20`','init','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','9Yggaap','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','112mxZrlB','\x22\x20not\x20found.','132092Sxucbd',').\x20Config:\x20','object','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','app','locale','defaultApp','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','.\x20Credentials:\x20not\x20written.','length','initialized','format','350712wshgyD','apps','workspace','Target\x20environment','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','keys','3JocDHT','Workspace\x20','use','str','7433328MDvbYY','number','apiDir','validation','318540qiVIIU','join','175rwmtpQ','276WAdAzS','env','Invalid\x20appcode:\x20','pageSize','write','\x20workspace\x20use\x20--app\x20<name>`.','string','globalConfig','1374430WziLNm','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','appcode','defaultFormat','trim','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','701415jFqgrD','11esApnO','Switch\x20the\x20current\x20workspace\x20app\x20binding','997566uGRIAB','riskLevel','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','\x20--appcode\x20<code>`.','isArray','\x20(appcode:\x20'];a203_0x4840=function(){return _0x3693ec;};return a203_0x4840();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a204_0x26d1(_0x2229b9,_0x420cc3){_0x2229b9=_0x2229b9-0x18e;const _0x295d52=a204_0x295d();let _0x26d105=_0x295d52[_0x2229b9];return _0x26d105;}const a204_0x285482=a204_0x26d1;function a204_0x295d(){const _0x3d6f3d=['776988GOFMlT','312901BHyEgY','write','1025664aIinnj','5770044jBiphs','27gEEoFU','5951950CkFTIZ','6768042ppNwIJ','App\x20profile\x20name\x20to\x20remove','6910168LYsqLg','8vREoTV','workspace','name','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)'];a204_0x295d=function(){return _0x3d6f3d;};return a204_0x295d();}(function(_0x3c3aaf,_0x2c0e32){const _0x161466=a204_0x26d1,_0x4855c0=_0x3c3aaf();while(!![]){try{const _0x446483=-parseInt(_0x161466(0x196))/0x1*(parseInt(_0x161466(0x190))/0x2)+parseInt(_0x161466(0x198))/0x3+parseInt(_0x161466(0x195))/0x4+-parseInt(_0x161466(0x19b))/0x5+parseInt(_0x161466(0x19c))/0x6+-parseInt(_0x161466(0x199))/0x7+parseInt(_0x161466(0x18f))/0x8*(parseInt(_0x161466(0x19a))/0x9);if(_0x446483===_0x2c0e32)break;else _0x4855c0['push'](_0x4855c0['shift']());}catch(_0x896be7){_0x4855c0['push'](_0x4855c0['shift']());}}}(a204_0x295d,0xf17f1));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a204_0x285482(0x191),'command':a204_0x285482(0x193),'description':a204_0x285482(0x194),'risk':a204_0x285482(0x197),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x285482(0x192),'description':a204_0x285482(0x18e),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x494274=>validateAppName(_0x494274,'workspace\x20remove'),'execute':_0x536004=>runAppRemove(_0x536004,'workspace\x20remove')};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a205_0x1c5592=a205_0x96a6;function a205_0x3554(){const _0x38bcd6=['apiDir','Locale','88005IGoRGj','app','toLowerCase','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','4606077DHPapq','defaultApp','84384ASdJlq','defaultFormat','1690164JlMLGz','locale','186tfEjLI','string','Config\x20key\x20(','map','646236hhOQaE','env','Access\x20key','Default\x20page\x20size','309194hDPrhn','riskLevel','API\x20directory\x20path','en-US','accessKey','keys','has','Auth\x20cookie','length','Target\x20environment','cookie','apps','Risk\x20level','pageSize','inherit','filter','appcode','zh-CN','format','1574235XHIaZC','join','entries'];a205_0x3554=function(){return _0x38bcd6;};return a205_0x3554();}(function(_0x105385,_0x2c33a5){const _0x361512=a205_0x96a6,_0xf0de81=_0x105385();while(!![]){try{const _0x598d15=-parseInt(_0x361512(0x1a9))/0x1+-parseInt(_0x361512(0x1a5))/0x2+-parseInt(_0x361512(0x1bc))/0x3+parseInt(_0x361512(0x19f))/0x4+parseInt(_0x361512(0x1c1))/0x5*(parseInt(_0x361512(0x1a1))/0x6)+parseInt(_0x361512(0x1c5))/0x7+parseInt(_0x361512(0x1c7))/0x8;if(_0x598d15===_0x2c33a5)break;else _0xf0de81['push'](_0xf0de81['shift']());}catch(_0x380b0a){_0xf0de81['push'](_0xf0de81['shift']());}}}(a205_0x3554,0x751ba));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.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';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a205_0x1c5592(0x1b3),a205_0x1c5592(0x1ad),a205_0x1c5592(0x1a0),'format',a205_0x1c5592(0x1aa)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x1c5592(0x1b9),'env',a205_0x1c5592(0x1a0),a205_0x1c5592(0x1bb),'cookie','accessKey',a205_0x1c5592(0x1bf)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x34cdd6){const _0x55d9f3=a205_0x1c5592;return[..._0x34cdd6][_0x55d9f3(0x1bd)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x4619df){const _0x451631=a205_0x1c5592;return TOP_LEVEL_CONFIG_KEYS[_0x451631(0x1af)](_0x4619df);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x16a673=a205_0x1c5592;return _0x16a673(0x1a3)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a205_0x1c5592(0x1a6),'apiDir':'apiDir','cookie':a205_0x1c5592(0x1b3),'accessKey':a205_0x1c5592(0x1ad),'defaultFormat':a205_0x1c5592(0x1bb),'pageSize':'pageSize','riskLevel':a205_0x1c5592(0x1aa),'locale':a205_0x1c5592(0x1a0)};export function getAppProfileFlagDefs(){const _0x425844=a205_0x1c5592;return[{'name':_0x425844(0x1a6),'type':_0x425844(0x1a2),'description':_0x425844(0x1b2),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':_0x425844(0x1a2),'description':_0x425844(0x1ab)},{'name':_0x425844(0x1b3),'type':'string','description':_0x425844(0x1b0),'hidden':!![]},{'name':_0x425844(0x1ad),'type':_0x425844(0x1a2),'description':_0x425844(0x1a7),'hidden':!![]},{'name':_0x425844(0x19e),'type':'string','description':_0x425844(0x1c4),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':_0x425844(0x1a8)},{'name':_0x425844(0x1aa),'type':_0x425844(0x1a2),'description':_0x425844(0x1b5),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x425844(0x1a2),'description':_0x425844(0x1c0)}];}export function collectAppProfileOverrides(_0x532544){const _0x4cd6ef=a205_0x1c5592,_0x42b587={};for(const [_0x2827d,_0x23d665]of Object[_0x4cd6ef(0x1be)](APP_PROFILE_FLAG_KEY_MAP)){const _0xd70e56=_0x532544(_0x2827d);if(!_0xd70e56)continue;_0x42b587[_0x23d665]=_0x23d665===_0x4cd6ef(0x1b6)?Number(_0xd70e56):_0xd70e56;}return _0x42b587;}export function buildAppProfileListFields(_0x1e4f15){const _0x17c7ec=a205_0x1c5592;return{'env':_0x1e4f15[_0x17c7ec(0x1a6)]??null,'apiDir':_0x1e4f15[_0x17c7ec(0x1bf)]??null,'hasCookie':!!_0x1e4f15[_0x17c7ec(0x1b3)],'hasAccessKey':!!_0x1e4f15[_0x17c7ec(0x1ad)],'format':_0x1e4f15[_0x17c7ec(0x1bb)]??null,'pageSize':_0x1e4f15[_0x17c7ec(0x1b6)]??null,'riskLevel':_0x1e4f15[_0x17c7ec(0x1aa)]??null,'locale':_0x1e4f15[_0x17c7ec(0x1a0)]??null};}function a205_0x96a6(_0x2fac12,_0x658d4e){_0x2fac12=_0x2fac12-0x19e;const _0x3554cf=a205_0x3554();let _0x96a6c1=_0x3554cf[_0x2fac12];return _0x96a6c1;}export function buildAppDoctorFields(_0x3ab0ea,_0x205f54){const _0x112d61=a205_0x1c5592;return{'env':{'value':_0x3ab0ea[_0x112d61(0x1a6)]||_0x205f54[_0x112d61(0x1a6)],'source':_0x3ab0ea[_0x112d61(0x1a6)]?_0x112d61(0x1c2):_0x112d61(0x1b7)},'apiDir':{'value':_0x3ab0ea[_0x112d61(0x1bf)]||_0x205f54['apiDir'],'source':_0x3ab0ea[_0x112d61(0x1bf)]?_0x112d61(0x1c2):_0x112d61(0x1b7)},'cookie':{'value':_0x3ab0ea[_0x112d61(0x1b3)]||_0x205f54[_0x112d61(0x1b3)],'source':_0x3ab0ea[_0x112d61(0x1b3)]?'app':_0x112d61(0x1b7)},'accessKey':{'value':_0x3ab0ea['accessKey']||_0x205f54[_0x112d61(0x1ad)],'source':_0x3ab0ea['accessKey']?'app':_0x112d61(0x1b7)}};}export function buildCanonicalAppConfig(_0x5c5172,_0x90f89){const _0x234281=a205_0x1c5592,_0x2651de=_0x5c5172[_0x234281(0x1a4)](_0x5b66a5=>String(_0x5b66a5||'')['trim']())[_0x234281(0x1b8)](Boolean);if(_0x2651de[_0x234281(0x1b1)]===0x0)return{};const _0x122486={};for(const _0x488db4 of _0x2651de){_0x122486[_0x488db4]=_0x90f89?{'appcode':_0x488db4,'env':_0x90f89}:{'appcode':_0x488db4};}return{'apps':_0x122486,'defaultApp':_0x2651de[0x0]};}export function buildCanonicalProjectConfig(_0x5a201a,_0x21931d){const _0x5cfb2c=a205_0x1c5592,{appCodes:appCodes=[],env:_0x525fe,metadata:_0x4595b1}=_0x21931d,_0x36767c={..._0x5a201a,..._0x4595b1||{}};delete _0x36767c[_0x5cfb2c(0x1b9)],delete _0x36767c[_0x5cfb2c(0x1c2)];if(_0x525fe)_0x36767c[_0x5cfb2c(0x1a6)]=_0x525fe;else!_0x36767c[_0x5cfb2c(0x1a6)]&&(_0x36767c['env']=DEFAULT_CONFIG_VALUES['env']);const _0x120b8a=buildCanonicalAppConfig(appCodes,_0x36767c[_0x5cfb2c(0x1a6)]);return Object[_0x5cfb2c(0x1ae)](_0x120b8a)[_0x5cfb2c(0x1b1)]>0x0&&(_0x36767c['apps']=_0x120b8a[_0x5cfb2c(0x1b4)],_0x36767c[_0x5cfb2c(0x1c6)]=_0x120b8a[_0x5cfb2c(0x1c6)]),_0x36767c;}const LOCALE_MAP={'zh':a205_0x1c5592(0x1ba),'zh-cn':a205_0x1c5592(0x1ba),'zh_cn':a205_0x1c5592(0x1ba),'en':a205_0x1c5592(0x1ac),'en-us':'en-US','en_us':a205_0x1c5592(0x1ac)};export function normalizeLocale(_0x4f5e81){const _0x32d9ef=a205_0x1c5592;if(!_0x4f5e81)return null;return LOCALE_MAP[_0x4f5e81[_0x32d9ef(0x1c3)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a206_0x391fad=a206_0x7cc2;(function(_0x818115,_0x333f5d){const _0x191325=a206_0x7cc2,_0x366a83=_0x818115();while(!![]){try{const _0x1125a4=parseInt(_0x191325(0x1ca))/0x1+-parseInt(_0x191325(0x1cf))/0x2*(-parseInt(_0x191325(0x1cc))/0x3)+-parseInt(_0x191325(0x1cb))/0x4+-parseInt(_0x191325(0x1c8))/0x5+parseInt(_0x191325(0x1c6))/0x6*(-parseInt(_0x191325(0x1cd))/0x7)+parseInt(_0x191325(0x1c3))/0x8*(parseInt(_0x191325(0x1c4))/0x9)+-parseInt(_0x191325(0x1c2))/0xa*(-parseInt(_0x191325(0x1c7))/0xb);if(_0x1125a4===_0x333f5d)break;else _0x366a83['push'](_0x366a83['shift']());}catch(_0x1f3345){_0x366a83['push'](_0x366a83['shift']());}}}(a206_0x35a0,0x9f483));function a206_0x35a0(){const _0x14c7e9=['7qDqbmW','https://g.lovrabet.com/dist/rabetbase-cli','560IIdFpL','20714500GTRRZL','8RJCEdD','1598238wucBGA','/templates/projects','6295866TWdzDZ','11iTQPLF','5900745tbbOqA','/config/index.json','722930IWEbBC','3960012aoDCHi','9642UWGCMr'];a206_0x35a0=function(){return _0x14c7e9;};return a206_0x35a0();}export const RABETBASE_CDN_BASE_URL=a206_0x391fad(0x1ce);function a206_0x7cc2(_0x1e558f,_0x3c73d7){_0x1e558f=_0x1e558f-0x1c2;const _0x35a0da=a206_0x35a0();let _0x7cc2d1=_0x35a0da[_0x1e558f];return _0x7cc2d1;}export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x391fad(0x1c9);export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x391fad(0x1c5);
|