@lovrabet/rabetbase-cli 2.4.4 → 2.4.5-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/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.d.ts +1 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/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/{permit/index.d.ts → dataset/business-groups.d.ts} +1 -1
- package/lib/commands/dataset/business-groups.js +1 -0
- 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.d.ts +15 -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/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/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.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.d.ts +15 -17
- 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 +70 -79
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +1 -0
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.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 +18 -24
- package/skills/rabetbase/guides/database-connection-workflow.md +6 -2
- package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +28 -0
- package/skills/rabetbase/references/rabetbase-dataset-delete.md +7 -5
- package/skills/rabetbase/references/rabetbase-dataset-list.md +6 -6
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +5 -5
- package/skills/rabetbase/references/rabetbase-db-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-delete.md +10 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +2 -0
- package/skills/rabetbase/references/rabetbase-db-list.md +3 -2
- package/skills/rabetbase/references/rabetbase-db-update.md +4 -2
- package/skills/rabetbase/references/rabetbase-role-list.md +9 -17
- package/skills/rabetbase/references/rabetbase-role-user-add.md +44 -16
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
- package/skills/rabetbase.manifest.json +4 -7
- package/lib/commands/permit/index.js +0 -1
- package/lib/commands/permit/page-get.d.ts +0 -2
- package/lib/commands/permit/page-get.js +0 -1
- package/lib/commands/permit/page-set.d.ts +0 -2
- package/lib/commands/permit/page-set.js +0 -1
- package/lib/commands/permit/role-apis-set.d.ts +0 -2
- package/lib/commands/permit/role-apis-set.js +0 -1
- package/lib/commands/permit/role-menus-set.d.ts +0 -2
- package/lib/commands/permit/role-menus-set.js +0 -1
- package/lib/commands/permit/role-menus.d.ts +0 -2
- package/lib/commands/permit/role-menus.js +0 -1
- package/lib/commands/permit/shared.d.ts +0 -74
- package/lib/commands/permit/shared.js +0 -1
- package/lib/commands/role/create.d.ts +0 -2
- package/lib/commands/role/create.js +0 -1
- package/skills/rabetbase/guides/role-permit-workflow.md +0 -127
- package/skills/rabetbase/references/rabetbase-permit-page-set.md +0 -69
- package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +0 -53
- package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +0 -57
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a198_0x8130a9=a198_0x3f84;(function(_0x279125,_0x534fe8){const _0x2d16b4=a198_0x3f84,_0xc42f47=_0x279125();while(!![]){try{const _0x576a36=parseInt(_0x2d16b4(0x138))/0x1+parseInt(_0x2d16b4(0x136))/0x2*(parseInt(_0x2d16b4(0x135))/0x3)+parseInt(_0x2d16b4(0x168))/0x4+-parseInt(_0x2d16b4(0x164))/0x5*(-parseInt(_0x2d16b4(0x137))/0x6)+parseInt(_0x2d16b4(0x142))/0x7+parseInt(_0x2d16b4(0x157))/0x8*(-parseInt(_0x2d16b4(0x172))/0x9)+parseInt(_0x2d16b4(0x167))/0xa*(-parseInt(_0x2d16b4(0x14c))/0xb);if(_0x576a36===_0x534fe8)break;else _0xc42f47['push'](_0xc42f47['shift']());}catch(_0x55787c){_0xc42f47['push'](_0xc42f47['shift']());}}}(a198_0x4df4,0x7228c));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';function a198_0x4df4(){const _0x240c2d=['trashDir','9375872kDThrj','Local\x20SQL\x20not\x20found:\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','length','Push\x20complete:\x20','sqlRoot','Local\x20directory\x20\x22','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','get','\x20skipped,\x20','236744DufNoo','sqls','force','dbDirectory','No\x20local\x20SQL\x20files\x20found.','filter','push','sqlCode','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlRootDir','replace','dbId','Push\x20local\x20SQL\x20files\x20to\x20remote','4260035NCGcnG','toISOString','mode','30wLyvnB','2435980Lqnpmr','appCode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sql','sqlName','lockFilePath','write','catch','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','27eYsrSn','map','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','set','exec','message','entries','relativePath','filePath','1611717NRPVyM','2byEsLA','6hyMqDk','684441yDaScK','\x20pushed,\x20','hash','sqlcode','remoteId','validation','/smartapi/custom/updateUserCustomSql','join','\x20SQL\x20file(s)','path','3015243axJLCM','boolean','utf8','POST','Would\x20push\x20','dbName','No\x20database\x20matches\x20local\x20directory\x20\x22','startsWith','lastSync'];a198_0x4df4=function(){return _0x240c2d;};return a198_0x4df4();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a198_0x3f84(_0x1c3eb0,_0x3b285a){_0x1c3eb0=_0x1c3eb0-0x135;const _0x4df429=a198_0x4df4();let _0x3f8453=_0x4df429[_0x1c3eb0];return _0x3f8453;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x234fe2,_0x5ae8cb,_0x41e129){const _0x1377fe=a198_0x3f84,_0x21a57a=await scanLocalSqlQueries(_0x234fe2),_0x56a61e=new Map();for(const _0x135516 of _0x21a57a){if(_0x41e129&&_0x135516[_0x1377fe(0x15e)]!==_0x41e129)continue;const _0xab4030=_0x56a61e[_0x1377fe(0x155)](_0x135516['sqlCode'])??[];_0xab4030['push'](_0x135516),_0x56a61e[_0x1377fe(0x175)](_0x135516[_0x1377fe(0x15e)],_0xab4030);}if(_0x41e129&&!_0x56a61e['has'](_0x41e129))throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14d)+_0x41e129);const _0x3eb7ef=[];for(const [_0x1b552f,_0xf0a761]of _0x56a61e[_0x1377fe(0x178)]()){if(_0xf0a761[_0x1377fe(0x14f)]===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0xf0a761[0x0]);continue;}const _0x383bf1=_0x5ae8cb[_0x1377fe(0x158)][_0x1b552f],_0x2483a8=_0x383bf1?.[_0x1377fe(0x141)],_0x8f0848=_0x2483a8?_0xf0a761['filter'](_0x2133d8=>_0x2133d8[_0x1377fe(0x179)]!==_0x2483a8):_0xf0a761;if(_0x383bf1&&_0x8f0848['length']===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0x8f0848[0x0]);continue;}throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14e)+_0x1b552f+_0x1377fe(0x15f));}return _0x3eb7ef;}export const sqlPush={'service':a198_0x8130a9(0x16b),'command':'push','description':a198_0x8130a9(0x163),'risk':a198_0x8130a9(0x16e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a198_0x8130a9(0x159),'type':a198_0x8130a9(0x143),'description':a198_0x8130a9(0x174)}],async 'dryRun'(_0x3491f1){const _0x404db9=a198_0x8130a9,_0x23b065=loadSqlProjectConfig(_0x3491f1[_0x404db9(0x169)]),_0x296622=await readSqlLockFile(_0x23b065[_0x404db9(0x16d)]),{appLock:_0x81ca33}=ensureSqlLockScope(_0x296622??createEmptySqlLock(),_0x3491f1[_0x404db9(0x169)],_0x23b065['sqlRoot'],'push'),_0x4bd504=await getTargetSqlQueries(_0x23b065,_0x81ca33,_0x3491f1['str'](_0x404db9(0x13b))||undefined),_0xc1259=[];for(const _0x2c22a7 of _0x4bd504){const _0x268156=await computeSqlFileHash(_0x2c22a7[_0x404db9(0x17a)]),_0x2c65b9=_0x81ca33['sqls'][_0x2c22a7[_0x404db9(0x15e)]],_0x3f9272=!!_0x2c65b9&&(_0x2c65b9[_0x404db9(0x141)]!==_0x2c22a7[_0x404db9(0x179)]||!!_0x2c22a7[_0x404db9(0x16c)]&&_0x2c65b9[_0x404db9(0x16c)]!==_0x2c22a7[_0x404db9(0x16c)]);if(!_0x3491f1[_0x404db9(0x153)](_0x404db9(0x159))&&_0x2c65b9&&_0x2c65b9['hash']===_0x268156&&!_0x3f9272)continue;_0xc1259[_0x404db9(0x15d)](_0x2c22a7[_0x404db9(0x15e)]);}return{'method':_0x404db9(0x145),'url':_0x404db9(0x13e),'body':{'sqlCodes':_0xc1259,'appCode':_0x3491f1[_0x404db9(0x169)]},'description':_0x404db9(0x146)+_0xc1259['length']+_0x404db9(0x140)};},async 'execute'(_0xa07ee5){const _0x1d9240=a198_0x8130a9,_0x52837a=loadSqlProjectConfig(_0xa07ee5['appCode']),_0x364539=await readSqlLockFile(_0x52837a[_0x1d9240(0x16d)]),{lockData:_0x4b978b,appLock:_0x29fe57}=ensureSqlLockScope(_0x364539??createEmptySqlLock(),_0xa07ee5[_0x1d9240(0x169)],_0x52837a[_0x1d9240(0x151)],_0x1d9240(0x15d)),_0x174d95=await getTargetSqlQueries(_0x52837a,_0x29fe57,_0xa07ee5['str']('sqlcode')||undefined);if(_0x174d95[_0x1d9240(0x14f)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x1d9240(0x15b)};const _0x1bdfb4=[],_0x3316fa=[],_0x510da0=[];for(const _0x28b734 of _0x174d95){const _0x5d87e3=_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']];if(!_0x5d87e3){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x154)});continue;}try{const _0x12c83e=await computeSqlFileHash(_0x28b734[_0x1d9240(0x17a)]),_0x1490f9=_0x5d87e3['path']!==_0x28b734[_0x1d9240(0x179)]||!!_0x28b734[_0x1d9240(0x16c)]&&_0x5d87e3['sqlName']!==_0x28b734['sqlName'];if(!_0xa07ee5[_0x1d9240(0x153)](_0x1d9240(0x159))&&_0x5d87e3[_0x1d9240(0x13a)]===_0x12c83e&&!_0x1490f9){_0x3316fa[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'reason':'unchanged'});continue;}if(_0x5d87e3['version']==null){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x16a)});continue;}const _0x265b42=await readFile(_0x28b734[_0x1d9240(0x17a)],_0x1d9240(0x144)),_0x52f0cd=stripLocalSqlMetadata(_0x265b42,_0x28b734[_0x1d9240(0x166)]),_0x240165=_0x28b734[_0x1d9240(0x16c)]||_0x5d87e3[_0x1d9240(0x16c)],_0x36ee64=await resolveTargetDbBinding(_0xa07ee5[_0x1d9240(0x169)],_0x28b734,_0x5d87e3),_0xe157e5=await updateSqlQuery({'id':_0x5d87e3[_0x1d9240(0x13c)],'appCode':_0xa07ee5[_0x1d9240(0x169)],'sqlCode':_0x28b734[_0x1d9240(0x15e)],'sqlName':_0x240165,'dbId':_0x36ee64[_0x1d9240(0x162)],'version':_0x5d87e3['version'],'sqlContent':_0x52f0cd,'sqlConfig':_0x5d87e3['sqlConfig']??undefined}),_0x38b54b=_0xe157e5[_0x1d9240(0x162)]?await getDbName(_0xa07ee5[_0x1d9240(0x169)],Number(_0xe157e5[_0x1d9240(0x162)]))[_0x1d9240(0x16f)](()=>_0x36ee64[_0x1d9240(0x147)]):_0x36ee64[_0x1d9240(0x147)];_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']]={...buildSqlLockEntry(_0xe157e5,_0x52f0cd,_0x12c83e,{'dbName':_0x38b54b}),'path':_0x28b734[_0x1d9240(0x179)],'mode':_0x5d87e3[_0x1d9240(0x166)]},await archivePreviousSqlFileIfNeeded(_0x52837a,_0x5d87e3[_0x1d9240(0x141)],_0x28b734[_0x1d9240(0x179)]),_0x1bdfb4['push']({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'remoteId':_0x5d87e3[_0x1d9240(0x13c)]});}catch(_0x24b2e6){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x24b2e6 instanceof Error?_0x24b2e6[_0x1d9240(0x177)]:String(_0x24b2e6)});}}return _0x29fe57[_0x1d9240(0x14a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x52837a[_0x1d9240(0x16d)],_0x4b978b),{'ok':_0x510da0[_0x1d9240(0x14f)]===0x0,'data':{'pushed':_0x1bdfb4,'skipped':_0x3316fa,'failed':_0x510da0},'message':_0x1d9240(0x150)+_0x1bdfb4[_0x1d9240(0x14f)]+_0x1d9240(0x139)+_0x3316fa[_0x1d9240(0x14f)]+_0x1d9240(0x156)+_0x510da0[_0x1d9240(0x14f)]+_0x1d9240(0x170)};}};async function archivePreviousSqlFileIfNeeded(_0x48c3ab,_0x1a6df2,_0x4de8f0){const _0x3cd742=a198_0x8130a9;if(!_0x1a6df2||_0x1a6df2===_0x4de8f0)return;const _0x238a03=join(_0x48c3ab['sqlRootDir'],_0x1a6df2);if(!await fileExists(_0x238a03))return;const _0x2606e3=await moveToTrash(_0x48c3ab['projectRoot'],_0x48c3ab[_0x3cd742(0x14b)],_0x238a03);await cleanupEmptyDirectories(dirname(_0x238a03),_0x48c3ab[_0x3cd742(0x160)]),void _0x2606e3;}async function moveToTrash(_0x4f19cb,_0x7c6537,_0x1b09a3){const _0x1dce91=a198_0x8130a9,_0xfa336b=new Date()[_0x1dce91(0x165)]()[_0x1dce91(0x161)](/[:.]/g,'-'),_0xef8a6f=relative(_0x4f19cb,_0x1b09a3),_0x3b3716=join(_0x7c6537,_0xfa336b,_0xef8a6f);return await mkdir(dirname(_0x3b3716),{'recursive':!![]}),await rename(_0x1b09a3,_0x3b3716),_0x3b3716;}async function cleanupEmptyDirectories(_0x81ce22,_0x4be9cc){const _0x446418=a198_0x8130a9;let _0x411427=resolve(_0x81ce22);const _0x5da06c=resolve(_0x4be9cc);while(_0x411427[_0x446418(0x149)](''+_0x5da06c+sep)||_0x411427===_0x5da06c){if(_0x411427===_0x5da06c)return;try{const _0x12ed32=await readdir(_0x411427);if(_0x12ed32['length']>0x0)return;await rmdir(_0x411427);}catch{return;}_0x411427=dirname(_0x411427);}}async function resolveTargetDbBinding(_0x365d35,_0x29c742,_0x23c93){const _0x35e841=a198_0x8130a9,_0x552e79=_0x29c742[_0x35e841(0x15a)];if(!_0x552e79)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0x32a2ae=buildDbDirectoryName(_0x23c93[_0x35e841(0x147)],_0x23c93['dbId']);if(_0x552e79===_0x32a2ae)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0xc5b942=parseExplicitDbDirectory(_0x552e79);if(_0xc5b942!=null)return{'dbId':_0xc5b942,'dbName':await getDbName(_0x365d35,_0xc5b942)[_0x35e841(0x16f)](()=>undefined)};const _0x502a15=await listDatabases(_0x365d35),_0x41e836=_0x502a15[_0x35e841(0x15c)](_0xbdcddb=>buildDbDirectoryName(_0xbdcddb['dbName'],_0xbdcddb['dbId'])===_0x552e79);if(_0x41e836[_0x35e841(0x14f)]===0x1)return{'dbId':_0x41e836[0x0][_0x35e841(0x162)],'dbName':_0x41e836[0x0][_0x35e841(0x147)]};if(_0x41e836[_0x35e841(0x14f)]===0x0)throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x148)+_0x552e79+'\x22\x20for\x20sqlCode\x20'+_0x29c742[_0x35e841(0x15e)]+'.');const _0x3cc6c7=_0x41e836[_0x35e841(0x173)](_0x5c6a06=>_0x5c6a06[_0x35e841(0x147)]+'\x20('+_0x5c6a06[_0x35e841(0x162)]+')')[_0x35e841(0x13f)](',\x20');throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x152)+_0x552e79+_0x35e841(0x171)+_0x29c742[_0x35e841(0x15e)]+':\x20'+_0x3cc6c7);}function parseExplicitDbDirectory(_0x4c4bdf){const _0x2cdfb6=a198_0x8130a9,_0x36f317=/^db-(\d+)$/[_0x2cdfb6(0x176)](_0x4c4bdf);if(!_0x36f317)return null;const _0x1e56ff=Number(_0x36f317[0x1]);return Number['isFinite'](_0x1e56ff)&&_0x1e56ff>0x0?_0x1e56ff:null;}
|
|
1
|
+
const a191_0x445a58=a191_0x5960;(function(_0x446792,_0x132c10){const _0x54faaf=a191_0x5960,_0x928946=_0x446792();while(!![]){try{const _0x47aa6c=parseInt(_0x54faaf(0x1ed))/0x1*(-parseInt(_0x54faaf(0x1dd))/0x2)+-parseInt(_0x54faaf(0x1c6))/0x3+parseInt(_0x54faaf(0x1ba))/0x4*(parseInt(_0x54faaf(0x1ee))/0x5)+parseInt(_0x54faaf(0x1d2))/0x6*(parseInt(_0x54faaf(0x1c2))/0x7)+-parseInt(_0x54faaf(0x1df))/0x8*(-parseInt(_0x54faaf(0x1b1))/0x9)+parseInt(_0x54faaf(0x1d1))/0xa+-parseInt(_0x54faaf(0x1b2))/0xb;if(_0x47aa6c===_0x132c10)break;else _0x928946['push'](_0x928946['shift']());}catch(_0x5b3e0b){_0x928946['push'](_0x928946['shift']());}}}(a191_0x19c2,0x62b15));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_0x5960(_0x126de7,_0x3443b1){_0x126de7=_0x126de7-0x1ab;const _0x19c235=a191_0x19c2();let _0x59608c=_0x19c235[_0x126de7];return _0x59608c;}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(_0x102d4e,_0x470bef,_0x1757c3){const _0x29540b=a191_0x5960,_0x5c46d6=await scanLocalSqlQueries(_0x102d4e),_0x5070ec=new Map();for(const _0x22f8e0 of _0x5c46d6){if(_0x1757c3&&_0x22f8e0[_0x29540b(0x1ea)]!==_0x1757c3)continue;const _0x1a73da=_0x5070ec['get'](_0x22f8e0[_0x29540b(0x1ea)])??[];_0x1a73da['push'](_0x22f8e0),_0x5070ec[_0x29540b(0x1c3)](_0x22f8e0['sqlCode'],_0x1a73da);}if(_0x1757c3&&!_0x5070ec[_0x29540b(0x1e2)](_0x1757c3))throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1b3)+_0x1757c3);const _0x5572ef=[];for(const [_0x1fb43d,_0x15c68e]of _0x5070ec[_0x29540b(0x1eb)]()){if(_0x15c68e['length']===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x15c68e[0x0]);continue;}const _0x223e5b=_0x470bef[_0x29540b(0x1ef)][_0x1fb43d],_0x3310e6=_0x223e5b?.[_0x29540b(0x1b5)],_0x4080eb=_0x3310e6?_0x15c68e[_0x29540b(0x1ac)](_0x5e0a69=>_0x5e0a69[_0x29540b(0x1d6)]!==_0x3310e6):_0x15c68e;if(_0x223e5b&&_0x4080eb[_0x29540b(0x1c1)]===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x4080eb[0x0]);continue;}throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1ab)+_0x1fb43d+_0x29540b(0x1d4));}return _0x5572ef;}export const sqlPush={'service':a191_0x445a58(0x1cb),'command':a191_0x445a58(0x1cd),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a191_0x445a58(0x1ca),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a191_0x445a58(0x1b9),'description':a191_0x445a58(0x1ae)}],async 'dryRun'(_0x343567){const _0xd9946a=a191_0x445a58,_0x19fd5b=loadSqlProjectConfig(_0x343567[_0xd9946a(0x1d0)]),_0x3abd2c=await readSqlLockFile(_0x19fd5b[_0xd9946a(0x1c7)]),{appLock:_0x128f4b}=ensureSqlLockScope(_0x3abd2c??createEmptySqlLock(),_0x343567[_0xd9946a(0x1d0)],_0x19fd5b[_0xd9946a(0x1d9)],_0xd9946a(0x1cd)),_0x6e6ada=await getTargetSqlQueries(_0x19fd5b,_0x128f4b,_0x343567[_0xd9946a(0x1b4)](_0xd9946a(0x1c8))||undefined),_0x59deb2=[];for(const _0x8028d3 of _0x6e6ada){const _0x97b16f=await computeSqlFileHash(_0x8028d3[_0xd9946a(0x1da)]),_0x15d8c1=_0x128f4b['sqls'][_0x8028d3[_0xd9946a(0x1ea)]],_0x18c675=!!_0x15d8c1&&(_0x15d8c1[_0xd9946a(0x1b5)]!==_0x8028d3['relativePath']||!!_0x8028d3[_0xd9946a(0x1e1)]&&_0x15d8c1[_0xd9946a(0x1e1)]!==_0x8028d3[_0xd9946a(0x1e1)]);if(!_0x343567[_0xd9946a(0x1c9)](_0xd9946a(0x1cc))&&_0x15d8c1&&_0x15d8c1[_0xd9946a(0x1ec)]===_0x97b16f&&!_0x18c675)continue;_0x59deb2[_0xd9946a(0x1cd)](_0x8028d3['sqlCode']);}return{'method':_0xd9946a(0x1e7),'url':_0xd9946a(0x1e8),'body':{'sqlCodes':_0x59deb2,'appCode':_0x343567[_0xd9946a(0x1d0)]},'description':_0xd9946a(0x1b6)+_0x59deb2[_0xd9946a(0x1c1)]+_0xd9946a(0x1bd)};},async 'execute'(_0x23e476){const _0x35d804=a191_0x445a58,_0x1d5c32=loadSqlProjectConfig(_0x23e476['appCode']),_0x3b33db=await readSqlLockFile(_0x1d5c32['lockFilePath']),{lockData:_0x270c11,appLock:_0x173a63}=ensureSqlLockScope(_0x3b33db??createEmptySqlLock(),_0x23e476[_0x35d804(0x1d0)],_0x1d5c32[_0x35d804(0x1d9)],_0x35d804(0x1cd)),_0x1a2f76=await getTargetSqlQueries(_0x1d5c32,_0x173a63,_0x23e476['str']('sqlcode')||undefined);if(_0x1a2f76[_0x35d804(0x1c1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x35d804(0x1c4)};const _0x6eeb4e=[],_0x1a28b3=[],_0x561048=[];for(const _0xd646ab of _0x1a2f76){const _0x534851=_0x173a63['sqls'][_0xd646ab['sqlCode']];if(!_0x534851){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x35d804(0x1c5)});continue;}try{const _0x22486a=await computeSqlFileHash(_0xd646ab[_0x35d804(0x1da)]),_0x3e7fa6=_0x534851[_0x35d804(0x1b5)]!==_0xd646ab[_0x35d804(0x1d6)]||!!_0xd646ab['sqlName']&&_0x534851[_0x35d804(0x1e1)]!==_0xd646ab[_0x35d804(0x1e1)];if(!_0x23e476[_0x35d804(0x1c9)](_0x35d804(0x1cc))&&_0x534851[_0x35d804(0x1ec)]===_0x22486a&&!_0x3e7fa6){_0x1a28b3['push']({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'reason':_0x35d804(0x1af)});continue;}if(_0x534851[_0x35d804(0x1e0)]==null){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x12c5ab=await readFile(_0xd646ab[_0x35d804(0x1da)],_0x35d804(0x1de)),_0x5def3a=stripLocalSqlMetadata(_0x12c5ab,_0xd646ab['mode']),_0x26d1b3=_0xd646ab[_0x35d804(0x1e1)]||_0x534851[_0x35d804(0x1e1)],_0x2c5f10=await resolveTargetDbBinding(_0x23e476[_0x35d804(0x1d0)],_0xd646ab,_0x534851),_0x10a802=await updateSqlQuery({'id':_0x534851[_0x35d804(0x1d3)],'appCode':_0x23e476[_0x35d804(0x1d0)],'sqlCode':_0xd646ab['sqlCode'],'sqlName':_0x26d1b3,'dbId':_0x2c5f10[_0x35d804(0x1d5)],'version':_0x534851['version'],'sqlContent':_0x5def3a,'sqlConfig':_0x534851[_0x35d804(0x1e5)]??undefined}),_0x5b34ef=_0x10a802['dbId']?await getDbName(_0x23e476['appCode'],Number(_0x10a802['dbId']))['catch'](()=>_0x2c5f10[_0x35d804(0x1b0)]):_0x2c5f10['dbName'];_0x173a63[_0x35d804(0x1ef)][_0xd646ab[_0x35d804(0x1ea)]]={...buildSqlLockEntry(_0x10a802,_0x5def3a,_0x22486a,{'dbName':_0x5b34ef}),'path':_0xd646ab['relativePath'],'mode':_0x534851[_0x35d804(0x1ce)]},await archivePreviousSqlFileIfNeeded(_0x1d5c32,_0x534851[_0x35d804(0x1b5)],_0xd646ab[_0x35d804(0x1d6)]),_0x6eeb4e[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'remoteId':_0x534851['remoteId']});}catch(_0x2f49a0){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x2f49a0 instanceof Error?_0x2f49a0[_0x35d804(0x1f0)]:String(_0x2f49a0)});}}return _0x173a63[_0x35d804(0x1cf)]=new Date()[_0x35d804(0x1bf)](),await writeSqlLockFile(_0x1d5c32[_0x35d804(0x1c7)],_0x270c11),{'ok':_0x561048['length']===0x0,'data':{'pushed':_0x6eeb4e,'skipped':_0x1a28b3,'failed':_0x561048},'message':_0x35d804(0x1c0)+_0x6eeb4e[_0x35d804(0x1c1)]+_0x35d804(0x1f1)+_0x1a28b3[_0x35d804(0x1c1)]+_0x35d804(0x1e6)+_0x561048[_0x35d804(0x1c1)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x2d4db9,_0x43a7a4,_0xf0d7c1){const _0x206bcd=a191_0x445a58;if(!_0x43a7a4||_0x43a7a4===_0xf0d7c1)return;const _0x550b75=join(_0x2d4db9['sqlRootDir'],_0x43a7a4);if(!await fileExists(_0x550b75))return;const _0x53a5b9=await moveToTrash(_0x2d4db9['projectRoot'],_0x2d4db9[_0x206bcd(0x1dc)],_0x550b75);await cleanupEmptyDirectories(dirname(_0x550b75),_0x2d4db9[_0x206bcd(0x1bc)]),void _0x53a5b9;}async function moveToTrash(_0x4b0bd6,_0x8f60d0,_0x1976fe){const _0x4743a3=a191_0x445a58,_0x3c9f6d=new Date()[_0x4743a3(0x1bf)]()[_0x4743a3(0x1b7)](/[:.]/g,'-'),_0x43b2df=relative(_0x4b0bd6,_0x1976fe),_0x202c14=join(_0x8f60d0,_0x3c9f6d,_0x43b2df);return await mkdir(dirname(_0x202c14),{'recursive':!![]}),await rename(_0x1976fe,_0x202c14),_0x202c14;}function a191_0x19c2(){const _0x518b5c=['.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbId','relativePath','map','exec','sqlRoot','filePath','Local\x20directory\x20\x22','trashDir','1696VBeobr','utf8','272Abqemw','version','sqlName','has','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','validation','sqlConfig','\x20skipped,\x20','POST','/smartapi/custom/updateUserCustomSql','\x22\x20for\x20sqlCode\x20','sqlCode','entries','hash','21iYtIQt','259085fhsTOQ','sqls','message','\x20pushed,\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filter','isFinite','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','unchanged','dbName','102519YSKXOp','17319665uKvIwf','Local\x20SQL\x20not\x20found:\x20','str','path','Would\x20push\x20','replace','No\x20database\x20matches\x20local\x20directory\x20\x22','boolean','44RnRnUr','join','sqlRootDir','\x20SQL\x20file(s)','dbDirectory','toISOString','Push\x20complete:\x20','length','14zeOcOw','set','No\x20local\x20SQL\x20files\x20found.','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','30159AGUnxP','lockFilePath','sqlcode','bool','write','sql','force','push','mode','lastSync','appCode','5900900LVTIeB','1377750aMnrdW','remoteId'];a191_0x19c2=function(){return _0x518b5c;};return a191_0x19c2();}async function cleanupEmptyDirectories(_0x2c1acc,_0x127fd5){let _0x4e6f01=resolve(_0x2c1acc);const _0x57269c=resolve(_0x127fd5);while(_0x4e6f01['startsWith'](''+_0x57269c+sep)||_0x4e6f01===_0x57269c){if(_0x4e6f01===_0x57269c)return;try{const _0x2969f5=await readdir(_0x4e6f01);if(_0x2969f5['length']>0x0)return;await rmdir(_0x4e6f01);}catch{return;}_0x4e6f01=dirname(_0x4e6f01);}}async function resolveTargetDbBinding(_0x5dd1eb,_0x6245a,_0x34ef27){const _0x28dd48=a191_0x445a58,_0x149913=_0x6245a[_0x28dd48(0x1be)];if(!_0x149913)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0xfea5c8=buildDbDirectoryName(_0x34ef27[_0x28dd48(0x1b0)],_0x34ef27[_0x28dd48(0x1d5)]);if(_0x149913===_0xfea5c8)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0x115dfd=parseExplicitDbDirectory(_0x149913);if(_0x115dfd!=null)return{'dbId':_0x115dfd,'dbName':await getDbName(_0x5dd1eb,_0x115dfd)['catch'](()=>undefined)};const _0x1c8d6e=await listDatabases(_0x5dd1eb),_0x2f9cdb=_0x1c8d6e[_0x28dd48(0x1ac)](_0x2c7e29=>buildDbDirectoryName(_0x2c7e29[_0x28dd48(0x1b0)],_0x2c7e29[_0x28dd48(0x1d5)])===_0x149913);if(_0x2f9cdb[_0x28dd48(0x1c1)]===0x1)return{'dbId':_0x2f9cdb[0x0][_0x28dd48(0x1d5)],'dbName':_0x2f9cdb[0x0][_0x28dd48(0x1b0)]};if(_0x2f9cdb['length']===0x0)throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1b8)+_0x149913+_0x28dd48(0x1e9)+_0x6245a[_0x28dd48(0x1ea)]+'.');const _0x147e47=_0x2f9cdb[_0x28dd48(0x1d7)](_0x166e3d=>_0x166e3d[_0x28dd48(0x1b0)]+'\x20('+_0x166e3d[_0x28dd48(0x1d5)]+')')[_0x28dd48(0x1bb)](',\x20');throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1db)+_0x149913+_0x28dd48(0x1e3)+_0x6245a[_0x28dd48(0x1ea)]+':\x20'+_0x147e47);}function parseExplicitDbDirectory(_0xe45f6f){const _0x37683a=a191_0x445a58,_0x2d4cca=/^db-(\d+)$/[_0x37683a(0x1d8)](_0xe45f6f);if(!_0x2d4cca)return null;const _0x1e1ae4=Number(_0x2d4cca[0x1]);return Number[_0x37683a(0x1ad)](_0x1e1ae4)&&_0x1e1ae4>0x0?_0x1e1ae4:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xe45b9c,_0x24d27d){const _0x1a2a10=a192_0x16c7,_0x54f3e2=_0xe45b9c();while(!![]){try{const _0x24c913=parseInt(_0x1a2a10(0x127))/0x1*(parseInt(_0x1a2a10(0x134))/0x2)+-parseInt(_0x1a2a10(0x13c))/0x3*(parseInt(_0x1a2a10(0x11a))/0x4)+parseInt(_0x1a2a10(0x12f))/0x5*(-parseInt(_0x1a2a10(0x131))/0x6)+-parseInt(_0x1a2a10(0x13a))/0x7+parseInt(_0x1a2a10(0x11c))/0x8+parseInt(_0x1a2a10(0x125))/0x9+parseInt(_0x1a2a10(0x12e))/0xa*(parseInt(_0x1a2a10(0x11b))/0xb);if(_0x24c913===_0x24d27d)break;else _0x54f3e2['push'](_0x54f3e2['shift']());}catch(_0x73d1be){_0x54f3e2['push'](_0x54f3e2['shift']());}}}(a192_0x5481,0xceae9));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='.rabetbase/sql';function a192_0x16c7(_0x53a0aa,_0x501423){_0x53a0aa=_0x53a0aa-0x110;const _0x548139=a192_0x5481();let _0x16c73e=_0x548139[_0x53a0aa];return _0x16c73e;}function a192_0x5481(){const _0x4f7498=['2rWozSP','sqlName','sqlContent','mode','dbName','mybatisXml','6121962cIAhpK','apps','118977Udbuhs','path','stdin','yes','syncedAt','close','description','lastSync','includes','sqls','sqlCode','104GcVQwd','25219634BCQBrp','2995144DkcZmD','trim','entries','test','map','trimStart','\x20[y/N]\x20','sqlConfig','split','7963578tPnwBR','endsWith','550931EWEotC','filter','length','--\x20@lovrabet.','fromEntries','dbId','push','10cVZJxa','613905wLqfJL','sqlRoot','66mPAmwV','stderr','join'];a192_0x5481=function(){return _0x4f7498;};return a192_0x5481();}export function buildSqlLockEntry(_0x4bde7b,_0x194960,_0x12f177,_0x5d5e88){const _0x56b56a=a192_0x16c7,_0x2080a0=detectSqlMode(_0x194960);return{'path':buildSqlRelativePath(_0x4bde7b[_0x56b56a(0x119)],_0x4bde7b[_0x56b56a(0x135)],_0x5d5e88?.[_0x56b56a(0x138)],_0x2080a0,_0x4bde7b[_0x56b56a(0x12c)]),'hash':_0x12f177,'remoteId':_0x4bde7b['id'],'version':_0x4bde7b['version'],'dbId':Number(_0x4bde7b['dbId']),'dbName':_0x5d5e88?.[_0x56b56a(0x138)],'sqlName':_0x4bde7b[_0x56b56a(0x135)],'sqlConfig':_0x4bde7b[_0x56b56a(0x123)]??undefined,'mode':_0x2080a0};}export function cloneSqlLockData(_0xa28cc8){const _0xaa9680=a192_0x16c7;return{'apps':Object[_0xaa9680(0x12b)](Object[_0xaa9680(0x11e)](_0xa28cc8[_0xaa9680(0x13b)])[_0xaa9680(0x120)](([_0x27b6b,_0x400118])=>[_0x27b6b,{'sqlRoot':_0x400118[_0xaa9680(0x130)],'lastSync':_0x400118[_0xaa9680(0x116)],'sqls':{..._0x400118[_0xaa9680(0x118)]}}]))};}export function ensureRemoteSqlContent(_0x3e466c){const _0xcd3b6b=a192_0x16c7;return _0x3e466c[_0xcd3b6b(0x136)]??'';}export function buildLocalSqlFileContent(_0x10c68a,_0x1ba8d8,_0x2fae74){const _0x2ddf2e=a192_0x16c7,_0x2ad335=_0x2fae74?.[_0x2ddf2e(0x137)]??detectSqlMode(_0x1ba8d8),_0x1bbe7d=stripLocalSqlMetadata(_0x1ba8d8,_0x2ad335)[_0x2ddf2e(0x11d)](),_0x2e8c2c=[...buildMetadataHeaderLines({'sqlCode':_0x10c68a['sqlCode'],'sqlName':_0x10c68a[_0x2ddf2e(0x135)],'dbId':_0x10c68a[_0x2ddf2e(0x12c)],'dbName':_0x2fae74?.[_0x2ddf2e(0x138)],'mode':_0x2ad335,'syncedAt':_0x2fae74?.[_0x2ddf2e(0x113)],'description':_0x2fae74?.[_0x2ddf2e(0x115)]},_0x2ad335),'',_0x1bbe7d],_0x587547=_0x2e8c2c[_0x2ddf2e(0x133)]('\x0a');return _0x587547[_0x2ddf2e(0x126)]('\x0a')?_0x587547:_0x587547+'\x0a';}export function stripLocalSqlMetadata(_0x722588,_0x5cd4c5){const _0x3444e9=a192_0x16c7,_0x432613=_0x722588['replace'](/\r\n/g,'\x0a')[_0x3444e9(0x124)]('\x0a'),_0x258f4d=[];let _0x2225bb=0x0;if(_0x5cd4c5==='mybatisXml')while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x40a19d=_0x432613[_0x2225bb]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x40a19d)){_0x2225bb++;continue;}if(_0x40a19d[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}else while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x3db748=_0x432613[_0x2225bb]??'';if(/^\s*--\s*@lovrabet\./[_0x3444e9(0x11f)](_0x3db748)){_0x2225bb++;continue;}if(_0x3db748[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}for(;_0x2225bb<_0x432613['length'];_0x2225bb++){_0x258f4d[_0x3444e9(0x12d)](_0x432613[_0x2225bb]);}return _0x258f4d['join']('\x0a')[_0x3444e9(0x121)]();}export function resolveSqlMode(_0x5dd49c,_0x368da5){const _0x4c0261=a192_0x16c7;if(_0x368da5?.[_0x4c0261(0x137)])return _0x368da5[_0x4c0261(0x137)];return detectSqlMode(_0x5dd49c);}export function resolveSqlFileName(_0x18b434,_0x550028,_0x32e61a){const _0x37a390=a192_0x16c7;if(_0x32e61a?.[_0x37a390(0x110)])return _0x32e61a[_0x37a390(0x110)];if(_0x32e61a?.[_0x37a390(0x135)]||_0x32e61a?.[_0x37a390(0x138)])return buildSqlRelativePath(_0x18b434,_0x32e61a?.[_0x37a390(0x135)],_0x32e61a?.['dbName'],resolveSqlMode(_0x550028,_0x32e61a),_0x32e61a?.['dbId']);return buildDefaultSqlFileName(_0x18b434,resolveSqlMode(_0x550028,_0x32e61a));}export function resolveSqlLocalDir(_0x418f8e,_0x1196f0){return join(_0x418f8e,SQL_LOCAL_REL_DIR,_0x1196f0);}export async function confirmForceOverwrite(_0x1be92d){const _0x18222a=a192_0x16c7,_0x5e3e72=createInterface({'input':process[_0x18222a(0x111)],'output':process[_0x18222a(0x132)]}),_0x13c987=await new Promise(_0x3ea5cc=>{const _0x53c81f=_0x18222a;_0x5e3e72['question'](_0x1be92d+_0x53c81f(0x122),_0x3ea5cc);});return _0x5e3e72[_0x18222a(0x114)](),['y',_0x18222a(0x112)][_0x18222a(0x117)](_0x13c987[_0x18222a(0x11d)]()['toLowerCase']());}export function findSqlLockScope(_0x12da49,_0x4aef32){const _0x3bf873=a192_0x16c7;return _0x12da49[_0x3bf873(0x13b)][_0x4aef32];}function buildMetadataHeaderLines(_0xbff397,_0x51330a){const _0x11c2a4=a192_0x16c7,_0x2ed238=[['sqlCode',_0xbff397[_0x11c2a4(0x119)]],[_0x11c2a4(0x135),_0xbff397['sqlName']],[_0x11c2a4(0x12c),_0xbff397[_0x11c2a4(0x12c)]],[_0x11c2a4(0x138),_0xbff397['dbName']],[_0x11c2a4(0x137),_0xbff397[_0x11c2a4(0x137)]],['syncedAt',_0xbff397['syncedAt']],[_0x11c2a4(0x115),_0xbff397['description']]];if(_0x51330a===_0x11c2a4(0x139))return _0x2ed238[_0x11c2a4(0x128)](([,_0x5b8061])=>_0x5b8061!==undefined&&_0x5b8061!==null&&String(_0x5b8061)[_0x11c2a4(0x11d)]()!=='')[_0x11c2a4(0x120)](([_0x1b836c,_0x3cc4d8])=>'<!--\x20@lovrabet.'+_0x1b836c+':\x20'+String(_0x3cc4d8)+'\x20-->');return _0x2ed238[_0x11c2a4(0x128)](([,_0x3c549b])=>_0x3c549b!==undefined&&_0x3c549b!==null&&String(_0x3c549b)[_0x11c2a4(0x11d)]()!=='')['map'](([_0x111607,_0x342271])=>_0x11c2a4(0x12a)+_0x111607+':\x20'+String(_0x342271));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a193_0x1ca1c1=a193_0x5948;(function(_0x1de720,_0x1fee27){const _0x2c5df4=a193_0x5948,_0x2f242b=_0x1de720();while(!![]){try{const _0x1d4698=parseInt(_0x2c5df4(0xc9))/0x1*(-parseInt(_0x2c5df4(0xe3))/0x2)+-parseInt(_0x2c5df4(0xdf))/0x3*(-parseInt(_0x2c5df4(0xdd))/0x4)+parseInt(_0x2c5df4(0xc7))/0x5*(-parseInt(_0x2c5df4(0xe2))/0x6)+parseInt(_0x2c5df4(0xdb))/0x7+parseInt(_0x2c5df4(0xe5))/0x8+-parseInt(_0x2c5df4(0xca))/0x9*(-parseInt(_0x2c5df4(0xd0))/0xa)+-parseInt(_0x2c5df4(0xd6))/0xb;if(_0x1d4698===_0x1fee27)break;else _0x2f242b['push'](_0x2f242b['shift']());}catch(_0x243380){_0x2f242b['push'](_0x2f242b['shift']());}}}(a193_0x3ad7,0x4033f));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a193_0x5948(_0xc1bcde,_0x319c85){_0xc1bcde=_0xc1bcde-0xc2;const _0x3ad734=a193_0x3ad7();let _0x594801=_0x3ad734[_0xc1bcde];return _0x594801;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x1fa17c){const _0xf741d7=a193_0x5948,_0x4195bd=[];let _0x53d4f8=0x1;while(!![]){const _0x10f10b=await listSqlQueries(_0x1fa17c,{'currentPage':_0x53d4f8,'pageSize':PAGE_SIZE}),_0x383d71=_0x10f10b[_0xf741d7(0xd4)]??[];_0x4195bd[_0xf741d7(0xe6)](..._0x383d71[_0xf741d7(0xcc)](_0xdedd95=>_0xdedd95[_0xf741d7(0xc4)]));if(_0x383d71[_0xf741d7(0xe0)]===0x0)break;const _0x905e02=_0x10f10b[_0xf741d7(0xe1)]?.[_0xf741d7(0xc2)];if(_0x905e02!=null?_0x4195bd[_0xf741d7(0xe0)]>=_0x905e02:_0x383d71[_0xf741d7(0xe0)]<PAGE_SIZE)break;_0x53d4f8++;}return _0x4195bd;}function a193_0x3ad7(){const _0x4ed731=['8349440unKbbo','\x20missing,\x20','has','\x20added,\x20','lockKey','1306935uMmvra','\x20modified,\x20','3148fvbUnZ','lockFilePath','1770VckNBj','length','paging','12zOBhAW','804986HSdEmz','sqlRoot','2176616ZreOnk','push','totalCount','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlCode','appCode','sqlName','34060eTftnJ','remote','1ZwhsVe','99WqAJoJ','All\x20SQL\x20queries\x20are\x20in\x20sync.','map','\x20remote-only','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','hash','468200jJMPzQ','status','sqls','filePath','tableData','boolean'];a193_0x3ad7=function(){return _0x4ed731;};return a193_0x3ad7();}export const sqlStatus={'service':'sql','command':'status','description':a193_0x1ca1c1(0xc3),'risk':'read','flags':[{'name':a193_0x1ca1c1(0xc8),'type':a193_0x1ca1c1(0xd5),'description':a193_0x1ca1c1(0xce)}],async 'execute'(_0x572a3e){const _0x32e47a=a193_0x1ca1c1,_0x5006a7=loadSqlProjectConfig(_0x572a3e[_0x32e47a(0xc5)]),_0x31439b=await readSqlLockFile(_0x5006a7[_0x32e47a(0xde)]),{appLock:_0x2d0a35}=ensureSqlLockScope(_0x31439b??createEmptySqlLock(),_0x5006a7[_0x32e47a(0xc5)],_0x5006a7[_0x32e47a(0xe4)],_0x32e47a(0xd1)),_0x52143e=await scanLocalSqlQueries(_0x5006a7),_0x329b89=[],_0x4bd31d=[],_0x6852a9=[],_0x388750=[],_0x2ad0e9=new Set(_0x52143e['map'](_0x22a77e=>_0x22a77e[_0x32e47a(0xda)]));for(const _0x4b78d4 of _0x52143e){const _0x26d34b=await computeSqlFileHash(_0x4b78d4[_0x32e47a(0xd3)]),_0x5d8977=_0x2d0a35[_0x32e47a(0xd2)][_0x4b78d4['lockKey']],_0x23ee04=!!_0x5d8977&&_0x5d8977['path']!==_0x4b78d4['relativePath'],_0x40d89d=!!_0x5d8977&&!!_0x4b78d4[_0x32e47a(0xc6)]&&_0x5d8977[_0x32e47a(0xc6)]!==_0x4b78d4[_0x32e47a(0xc6)];if(!_0x5d8977)_0x329b89[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);else _0x5d8977[_0x32e47a(0xcf)]!==_0x26d34b||_0x23ee04||_0x40d89d?_0x4bd31d[_0x32e47a(0xe6)](_0x4b78d4['lockKey']):_0x6852a9[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);}for(const _0x5b193e of Object['keys'](_0x2d0a35['sqls'])){!_0x2ad0e9[_0x32e47a(0xd8)](_0x5b193e)&&_0x388750[_0x32e47a(0xe6)](_0x5b193e);}const _0x51d296=[];if(_0x572a3e['bool'](_0x32e47a(0xc8))){const _0x50d14b=await fetchAllSqlCodes(_0x572a3e[_0x32e47a(0xc5)]);for(const _0x51943b of _0x50d14b){!_0x2ad0e9[_0x32e47a(0xd8)](_0x51943b)&&!_0x2d0a35[_0x32e47a(0xd2)][_0x51943b]&&_0x51d296['push'](_0x51943b);}}const _0x283f7f=_0x329b89[_0x32e47a(0xe0)]===0x0&&_0x4bd31d[_0x32e47a(0xe0)]===0x0&&_0x388750[_0x32e47a(0xe0)]===0x0&&_0x51d296[_0x32e47a(0xe0)]===0x0;return{'ok':!![],'data':{'added':_0x329b89,'modified':_0x4bd31d,'missing':_0x388750,'unchanged':_0x6852a9,'remoteOnly':_0x51d296},'message':_0x283f7f?_0x32e47a(0xcb):_0x329b89[_0x32e47a(0xe0)]+_0x32e47a(0xd9)+_0x4bd31d[_0x32e47a(0xe0)]+_0x32e47a(0xdc)+_0x388750[_0x32e47a(0xe0)]+_0x32e47a(0xd7)+_0x6852a9['length']+'\x20unchanged'+(_0x51d296[_0x32e47a(0xe0)]>0x0?',\x20'+_0x51d296[_0x32e47a(0xe0)]+_0x32e47a(0xcd):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a194_0x2210d3=a194_0x1bd1;(function(_0x3da535,_0x2c6320){const _0x327c55=a194_0x1bd1,_0x30abd5=_0x3da535();while(!![]){try{const _0x355d29=parseInt(_0x327c55(0x148))/0x1+parseInt(_0x327c55(0x15c))/0x2+-parseInt(_0x327c55(0x167))/0x3+-parseInt(_0x327c55(0x14c))/0x4*(-parseInt(_0x327c55(0x159))/0x5)+parseInt(_0x327c55(0x152))/0x6*(-parseInt(_0x327c55(0x15b))/0x7)+parseInt(_0x327c55(0x15d))/0x8+parseInt(_0x327c55(0x144))/0x9*(-parseInt(_0x327c55(0x13e))/0xa);if(_0x355d29===_0x2c6320)break;else _0x30abd5['push'](_0x30abd5['shift']());}catch(_0x5d9ed5){_0x30abd5['push'](_0x30abd5['shift']());}}}(a194_0x26f8,0xca1b1));function a194_0x26f8(){const _0x30eb1a=['Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','flagMissing','push','Provide\x20--file\x20or\x20--sql','schema:','indexes','200eTfYhI','schemas','parameters','map','sqlType','pkField','120816eZDdye','Dataset\x20\x22','dbtableConfig','isArray','511478iDuuIy','indexName','index_name','bool','44alJtXc','file','length','trim','message','flatMap','56004KAcovk','filter','size','dataset','--check-indexes\x20requires\x20--schemas.','tables','\x22\x20not\x20found\x20or\x20not\x20accessible','207300eiSnPr','index_columns','483QpDORH','1321746CFFDTb','10684056pvFzVV','Table\x20\x22','tableName','columns','string','index_type','utf-8','get','str','split','3670701VUStwV','read','unshift','reason','check-indexes','columnNames','type','isSelectOnly','toLowerCase','find','schemaWarnings','SQL\x20schema\x20validation','valid','File\x20not\x20found:\x20','isDangerous','validation','sql','name','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','\x22\x20not\x20found\x20in\x20any\x20dataset','validate','joinAudit','fields'];a194_0x26f8=function(){return _0x30eb1a;};return a194_0x26f8();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a194_0x1bd1(_0x4a5ec5,_0x58ad2f){_0x4a5ec5=_0x4a5ec5-0x122;const _0x26f8fc=a194_0x26f8();let _0x1bd13b=_0x26f8fc[_0x4a5ec5];return _0x1bd13b;}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2210d3(0x130),'command':a194_0x2210d3(0x134),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a194_0x2210d3(0x168),'flags':[{'name':a194_0x2210d3(0x14d),'type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x132)},{'name':'sql','type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x138)},{'name':a194_0x2210d3(0x13f),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a194_0x2210d3(0x124),'type':'boolean','description':a194_0x2210d3(0x137)}],async 'execute'(_0x24e13a){const _0x21a004=a194_0x2210d3,_0x2cce8c=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x14d)),_0x423faa=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x130)),_0xd97136=_0x24e13a['str'](_0x21a004(0x13f)),_0x1bddad=_0x24e13a[_0x21a004(0x14b)](_0x21a004(0x124));if(!_0x2cce8c&&!_0x423faa)throw CliErrors[_0x21a004(0x139)]('file',_0x21a004(0x13b));if(_0x1bddad&&!_0xd97136)throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x156));let _0x414de5;if(_0x2cce8c){const _0x5aacdf=resolve(process['cwd'](),_0x2cce8c);if(!existsSync(_0x5aacdf))throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x12d)+_0x5aacdf);_0x414de5=readFileSync(_0x5aacdf,_0x21a004(0x163));}else _0x414de5=_0x423faa;const _0xe873e6=validateSql(_0x414de5),_0x2fe89d={'valid':_0xe873e6[_0x21a004(0x12c)],'sqlType':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x126)],'isSelectOnly':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x127)],'isDangerous':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x12e)],'tables':_0xe873e6['tables'],'parameters':_0xe873e6[_0x21a004(0x140)],'message':_0xe873e6['message']};_0xe873e6[_0x21a004(0x142)]['reason']&&(_0x2fe89d[_0x21a004(0x123)]=_0xe873e6[_0x21a004(0x142)]['reason']);if(_0xd97136&&_0xe873e6[_0x21a004(0x12c)]){const _0x2e3b34=_0xd97136[_0x21a004(0x166)](',')[_0x21a004(0x141)](_0x13a5dd=>_0x13a5dd[_0x21a004(0x14f)]())[_0x21a004(0x153)](Boolean),_0x495e39=[],_0x507d45=[],_0x2f3b2a=filterDbTableBackedDatasets(await listDatasets(_0x24e13a['appCode'])),_0x52e2a3=new Map(_0x2f3b2a[_0x21a004(0x141)](_0x3ff41e=>[_0x3ff41e['dbtableConfig']?.[_0x21a004(0x15f)]?.[_0x21a004(0x128)](),_0x3ff41e]));for(const _0xa38bb8 of _0xe873e6[_0x21a004(0x157)]){const _0x4be4f1=_0x52e2a3[_0x21a004(0x164)](_0xa38bb8['toLowerCase']());!_0x4be4f1&&_0x495e39[_0x21a004(0x13a)](_0x21a004(0x15e)+_0xa38bb8+_0x21a004(0x133));}for(const _0x2c220e of _0x2e3b34){let _0x52262b;try{_0x52262b=await getDatasetDetail(_0x2c220e);}catch{_0x495e39[_0x21a004(0x13a)](_0x21a004(0x145)+_0x2c220e+_0x21a004(0x158));continue;}assertDatasetIsDbTableBacked(_0x52262b,_0x21a004(0x12b));const _0x54092d=Array[_0x21a004(0x147)](_0x52262b[_0x21a004(0x136)])?_0x52262b[_0x21a004(0x136)]:[],_0x3ab62d=new Set(_0x54092d[_0x21a004(0x141)](_0x3fb517=>_0x3fb517[_0x21a004(0x131)]?.[_0x21a004(0x128)]())),_0x10c826=_0x52262b[_0x21a004(0x146)]?.[_0x21a004(0x15f)]||_0x52262b[_0x21a004(0x15f)]||_0x2c220e;_0x2fe89d[_0x21a004(0x13c)+_0x10c826]={'code':_0x2c220e,'tableName':_0x10c826,'fieldCount':_0x3ab62d[_0x21a004(0x154)],'fields':Array['from'](_0x3ab62d)};if(_0x1bddad){const _0x4b0786=normalizeDatasetIndexes(_0x52262b);_0x507d45['push']({'tableName':_0x10c826,..._0x4b0786});}}_0x495e39[_0x21a004(0x14e)]>0x0&&(_0x2fe89d[_0x21a004(0x12a)]=_0x495e39),_0x1bddad&&(_0x2fe89d[_0x21a004(0x135)]=auditSqlJoinIndexes(_0x414de5,_0x507d45));}return{'ok':_0xe873e6[_0x21a004(0x12c)],'data':_0x2fe89d,'message':_0xe873e6[_0x21a004(0x150)]};}};function normalizeDatasetIndexes(_0x2c0363){const _0x514712=a194_0x2210d3,_0x1311c7=Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x155)]?.['indexes'])?_0x2c0363[_0x514712(0x155)]['indexes']:Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x13d)])?_0x2c0363[_0x514712(0x13d)]:[],_0x219889=_0x1311c7[_0x514712(0x151)](_0x188842=>{const _0x5e9d99=_0x514712,_0x2b8daa=Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x15a)])?_0x188842[_0x5e9d99(0x15a)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x125)])?_0x188842[_0x5e9d99(0x125)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x160)])?_0x188842[_0x5e9d99(0x160)]:[],_0xa97569=_0x2b8daa[_0x5e9d99(0x153)](_0x4b0335=>typeof _0x4b0335===_0x5e9d99(0x161))[_0x5e9d99(0x141)](_0x37e4df=>_0x37e4df[_0x5e9d99(0x14f)]())[_0x5e9d99(0x153)](Boolean);if(_0xa97569[_0x5e9d99(0x14e)]===0x0)return[];const _0xc766e=[_0x188842?.[_0x5e9d99(0x149)],_0x188842?.[_0x5e9d99(0x14a)],_0x188842?.[_0x5e9d99(0x131)]][_0x5e9d99(0x129)](_0x4d5ec1=>typeof _0x4d5ec1===_0x5e9d99(0x161)&&_0x4d5ec1[_0x5e9d99(0x14f)]()),_0x16549a=[_0x188842?.[_0x5e9d99(0x162)],_0x188842?.[_0x5e9d99(0x126)]][_0x5e9d99(0x129)](_0x1484d7=>typeof _0x1484d7===_0x5e9d99(0x161)&&_0x1484d7[_0x5e9d99(0x14f)]());return[{..._0xc766e?{'name':_0xc766e[_0x5e9d99(0x14f)]()}:{},..._0x16549a?{'type':_0x16549a[_0x5e9d99(0x14f)]()}:{},'columns':_0xa97569}];}),_0x22dcdb=[..._0x219889],_0x177374=typeof _0x2c0363?.[_0x514712(0x146)]?.[_0x514712(0x143)]===_0x514712(0x161)?_0x2c0363[_0x514712(0x146)]['pkField']['split'](',')[_0x514712(0x141)](_0xa97ca6=>_0xa97ca6[_0x514712(0x14f)]())[_0x514712(0x153)](Boolean):[];return _0x177374['length']>0x0&&_0x22dcdb[_0x514712(0x122)]({'type':'primary','columns':_0x177374}),{'indexes':_0x22dcdb,'metadataAvailable':_0x219889[_0x514712(0x14e)]>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e21f,_0x59c3de){const _0x43b2b2=a195_0x8a3c,_0x4ddab5=_0x1e21f();while(!![]){try{const _0x1b61ba=parseInt(_0x43b2b2(0x73))/0x1+parseInt(_0x43b2b2(0x72))/0x2+parseInt(_0x43b2b2(0x70))/0x3*(-parseInt(_0x43b2b2(0x6d))/0x4)+parseInt(_0x43b2b2(0x77))/0x5*(parseInt(_0x43b2b2(0x6f))/0x6)+-parseInt(_0x43b2b2(0x71))/0x7*(parseInt(_0x43b2b2(0x6e))/0x8)+parseInt(_0x43b2b2(0x74))/0x9+parseInt(_0x43b2b2(0x76))/0xa*(-parseInt(_0x43b2b2(0x75))/0xb);if(_0x1b61ba===_0x59c3de)break;else _0x4ddab5['push'](_0x4ddab5['shift']());}catch(_0x22c96){_0x4ddab5['push'](_0x4ddab5['shift']());}}}(a195_0x1a09,0x8abd7));function a195_0x8a3c(_0x424fc7,_0x1fd3d6){_0x424fc7=_0x424fc7-0x6d;const _0x1a09a4=a195_0x1a09();let _0x8a3cf0=_0x1a09a4[_0x424fc7];return _0x8a3cf0;}import{taskStatus}from'../../commands/task/status.js';function a195_0x1a09(){const _0x3ddd42=['349665XCBEgB','67020ibmiyY','59704WpmSBG','36hcrcNe','81rPCOpB','511oAXbwE','735144oIPAXM','946770hRHtaO','933561hwrCEv','2994266kAXYvs','10fvMbnr'];a195_0x1a09=function(){return _0x3ddd42;};return a195_0x1a09();}export const taskDefinitions=[taskStatus];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a196_0x22e1b5=a196_0x32c8;(function(_0x1ab464,_0x3b1efb){const _0x2fbde0=a196_0x32c8,_0x913d06=_0x1ab464();while(!![]){try{const _0x124ba7=-parseInt(_0x2fbde0(0x69))/0x1*(-parseInt(_0x2fbde0(0x6d))/0x2)+parseInt(_0x2fbde0(0x6a))/0x3*(-parseInt(_0x2fbde0(0x80))/0x4)+-parseInt(_0x2fbde0(0x82))/0x5+-parseInt(_0x2fbde0(0x7c))/0x6+-parseInt(_0x2fbde0(0x72))/0x7*(-parseInt(_0x2fbde0(0x79))/0x8)+-parseInt(_0x2fbde0(0x78))/0x9*(parseInt(_0x2fbde0(0x70))/0xa)+parseInt(_0x2fbde0(0x7d))/0xb;if(_0x124ba7===_0x3b1efb)break;else _0x913d06['push'](_0x913d06['shift']());}catch(_0x5a81f9){_0x913d06['push'](_0x913d06['shift']());}}}(a196_0x2ecb,0xdcd0e));function a196_0x2ecb(){const _0x4c1a3d=['4736EPAwYL','compress','str','1375590toRKRg','9735935sWgQnj','taskId','flagMissing','48mRdbSO','trim','5709770goWBCO','29IbPDAc','37980lQLndP','appCode','string','16478MjBcHh','status','task','2184470wewduU','cookie','17997chEOge','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id','apiError','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','9AyLLqI'];a196_0x2ecb=function(){return _0x4c1a3d;};return a196_0x2ecb();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a196_0x32c8(_0x446ac1,_0x36dd75){_0x446ac1=_0x446ac1-0x69;const _0x2ecb53=a196_0x2ecb();let _0x32c871=_0x2ecb53[_0x446ac1];return _0x32c871;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a196_0x22e1b5(0x6f),'command':a196_0x22e1b5(0x6e),'description':a196_0x22e1b5(0x74),'risk':'read','defaultOutputFormat':a196_0x22e1b5(0x7a),'structuredErrors':!![],'flags':[{'name':a196_0x22e1b5(0x75),'type':a196_0x22e1b5(0x6c),'required':!![],'description':a196_0x22e1b5(0x77)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x103675){const _0x4bec0a=a196_0x22e1b5;if(!_0x103675[_0x4bec0a(0x7b)](_0x4bec0a(0x75))[_0x4bec0a(0x81)]())throw CliErrors[_0x4bec0a(0x7f)]('task-id');},async 'execute'(_0x5cd387){const _0x25f45d=a196_0x22e1b5,_0x290cf2=_0x5cd387[_0x25f45d(0x7b)]('task-id')[_0x25f45d(0x81)](),_0x53fc7e=normalizeAsyncTask(await getAsyncTaskStatus(_0x290cf2,_0x5cd387['appCode'],_0x5cd387[_0x25f45d(0x71)]));if(_0x53fc7e[_0x25f45d(0x7e)]!==_0x290cf2)throw CliErrors[_0x25f45d(0x76)](_0x25f45d(0x73)+_0x290cf2+',\x20received\x20'+_0x53fc7e[_0x25f45d(0x7e)]+'.');const _0x3c111f=buildAsyncTaskStatusCommand(_0x53fc7e[_0x25f45d(0x7e)],_0x5cd387[_0x25f45d(0x6b)]);return{'ok':!![],'message':asyncTaskMessage(_0x53fc7e),'data':{'appCode':_0x5cd387[_0x25f45d(0x6b)],..._0x53fc7e,'query':_0x53fc7e['isTerminal']?null:{'command':_0x3c111f}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xef08e2,_0xb371d4){const _0x339465=a197_0x32dc,_0x2b39c0=_0xef08e2();while(!![]){try{const _0x22f13e=parseInt(_0x339465(0xa8))/0x1+-parseInt(_0x339465(0xad))/0x2+-parseInt(_0x339465(0xac))/0x3+-parseInt(_0x339465(0xae))/0x4+-parseInt(_0x339465(0xaa))/0x5*(-parseInt(_0x339465(0xa9))/0x6)+-parseInt(_0x339465(0xab))/0x7+parseInt(_0x339465(0xa7))/0x8;if(_0x22f13e===_0xb371d4)break;else _0x2b39c0['push'](_0x2b39c0['shift']());}catch(_0x35942b){_0x2b39c0['push'](_0x2b39c0['shift']());}}}(a197_0x2f8b,0xa19ab));function a197_0x2f8b(){const _0x5d919b=['5280788SHLRwa','16083816lDladh','953438DAepve','48vKACdL','590980pHorlf','8379707BMYiPO','308607mxAHlS','1254770UBDMoT'];a197_0x2f8b=function(){return _0x5d919b;};return a197_0x2f8b();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a197_0x32dc(_0x974d8d,_0x32699d){_0x974d8d=_0x974d8d-0xa7;const _0x2f8b72=a197_0x2f8b();let _0x32dc6d=_0x2f8b72[_0x974d8d];return _0x32dc6d;}export const tenantDefinitions=[tenantMembersListDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a198_0x52fe(_0x162a6f,_0x233aec){_0x162a6f=_0x162a6f-0x1b1;const _0x5a287d=a198_0x5a28();let _0x52fe2c=_0x5a287d[_0x162a6f];return _0x52fe2c;}const a198_0x2754b2=a198_0x52fe;(function(_0x19a6a6,_0x2a10dc){const _0x5731e7=a198_0x52fe,_0x2992a1=_0x19a6a6();while(!![]){try{const _0x36cfae=parseInt(_0x5731e7(0x1b2))/0x1*(-parseInt(_0x5731e7(0x1b6))/0x2)+-parseInt(_0x5731e7(0x1b7))/0x3+parseInt(_0x5731e7(0x1be))/0x4*(-parseInt(_0x5731e7(0x1bd))/0x5)+-parseInt(_0x5731e7(0x1b9))/0x6+-parseInt(_0x5731e7(0x1c1))/0x7*(-parseInt(_0x5731e7(0x1c6))/0x8)+parseInt(_0x5731e7(0x1bf))/0x9*(-parseInt(_0x5731e7(0x1c5))/0xa)+parseInt(_0x5731e7(0x1b1))/0xb;if(_0x36cfae===_0x2a10dc)break;else _0x2992a1['push'](_0x2992a1['shift']());}catch(_0x209355){_0x2992a1['push'](_0x2992a1['shift']());}}}(a198_0x5a28,0xeb510));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a198_0x2754b2(0x1b3),'command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a198_0x2754b2(0x1c2),'type':a198_0x2754b2(0x1c4),'required':!![],'description':a198_0x2754b2(0x1c0)}],async 'validate'(_0x435cce){const _0xa28176=a198_0x2754b2;if(!_0x435cce[_0xa28176(0x1b5)](_0xa28176(0x1c2))['trim']())throw CliErrors[_0xa28176(0x1bb)](_0xa28176(0x1c2),_0xa28176(0x1b8));},async 'execute'(_0x18b37b){const _0x2bf7d5=a198_0x2754b2,_0x13b798=_0x18b37b[_0x2bf7d5(0x1b5)](_0x2bf7d5(0x1c2))[_0x2bf7d5(0x1bc)](),_0x4d2108=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x13b798,_0x4d2108);const _0x124f5b=projectTenantMembers(await listTenantDirectoryMembers(_0x13b798));return{'ok':!![],'data':{'tenantCode':_0x13b798,'items':_0x124f5b,'totalCount':_0x124f5b[_0x2bf7d5(0x1c3)]},'message':_0x2bf7d5(0x1b4)+_0x124f5b['length']+_0x2bf7d5(0x1ba)};}};function a198_0x5a28(){const _0x2ec4e9=['2090qLALPn','6226152JnpAbO','54160337JgtWlu','12021sMdRsN','tenant','Found\x20','str','178GYJwns','1161573xPUISz','Pass\x20--tenant-code\x20<code>.','7806102QlSGYM','\x20tenant\x20member(s)','flagMissing','trim','6917585LMwGsm','4Eiyzdm','25686lztOaH','Exact\x20tenant\x20code','7OgyZmo','tenant-code','length','string'];a198_0x5a28=function(){return _0x2ec4e9;};return a198_0x5a28();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a199_0x3a73(_0xcd2005,_0x3a12d0){_0xcd2005=_0xcd2005-0x1f4;const _0x1f1c60=a199_0x1f1c();let _0x3a7376=_0x1f1c60[_0xcd2005];return _0x3a7376;}(function(_0x1bb0e7,_0x235b49){const _0x3e353b=a199_0x3a73,_0x17c794=_0x1bb0e7();while(!![]){try{const _0x5320ce=-parseInt(_0x3e353b(0x1f5))/0x1+parseInt(_0x3e353b(0x20d))/0x2*(parseInt(_0x3e353b(0x200))/0x3)+parseInt(_0x3e353b(0x1fb))/0x4+-parseInt(_0x3e353b(0x20a))/0x5*(parseInt(_0x3e353b(0x1f9))/0x6)+parseInt(_0x3e353b(0x204))/0x7+-parseInt(_0x3e353b(0x20b))/0x8+-parseInt(_0x3e353b(0x202))/0x9*(-parseInt(_0x3e353b(0x206))/0xa);if(_0x5320ce===_0x235b49)break;else _0x17c794['push'](_0x17c794['shift']());}catch(_0xa23c2b){_0x17c794['push'](_0x17c794['shift']());}}}(a199_0x1f1c,0x39087));import{CliErrors}from'../../errors.js';function textOrNull(_0x25ad74){const _0xb0f63d=a199_0x3a73,_0x4519c3=_0x25ad74?.[_0xb0f63d(0x1fd)]();return _0x4519c3?_0x4519c3:null;}export function projectTenantMembers(_0x36d407){const _0x2a0a5d=a199_0x3a73,_0x13ec20=new Map();for(const _0x50d0fe of _0x36d407){const _0x592bae=Number(_0x50d0fe['userId']);if(!Number[_0x2a0a5d(0x207)](_0x592bae)||_0x592bae<=0x0)continue;const _0x253441={'userId':_0x592bae,'username':textOrNull(_0x50d0fe[_0x2a0a5d(0x1f7)]),'displayName':textOrNull(_0x50d0fe['nickname']),'role':_0x50d0fe[_0x2a0a5d(0x203)]===!![]?_0x2a0a5d(0x205):_0x2a0a5d(0x1f8),'status':textOrNull(_0x50d0fe[_0x2a0a5d(0x208)])},_0x5a74fd=_0x13ec20[_0x2a0a5d(0x20e)](_0x592bae);if(!_0x5a74fd){_0x13ec20[_0x2a0a5d(0x1f4)](_0x592bae,_0x253441);continue;}_0x5a74fd[_0x2a0a5d(0x1f7)]??=_0x253441[_0x2a0a5d(0x1f7)],_0x5a74fd[_0x2a0a5d(0x209)]??=_0x253441[_0x2a0a5d(0x209)],_0x5a74fd[_0x2a0a5d(0x208)]??=_0x253441[_0x2a0a5d(0x208)];if(_0x253441[_0x2a0a5d(0x201)]===_0x2a0a5d(0x205))_0x5a74fd[_0x2a0a5d(0x201)]=_0x2a0a5d(0x205);}return[..._0x13ec20[_0x2a0a5d(0x20c)]()]['sort']((_0x547e8c,_0x37a0e2)=>_0x547e8c[_0x2a0a5d(0x1fa)]-_0x37a0e2['userId']);}function a199_0x1f1c(){const _0x27d77e=['2007VaMZVX','adminFlag','1359750EdFCPH','ADMIN','26330baJcbh','isFinite','status','displayName','10SCwPfQ','1774968VDautP','values','22aGWCuh','get','set','266222qGNYri','some','username','MEMBER','499794zxRGxr','userId','396800jHnOgy','tenantCode','trim','validation','Tenant\x20\x22','2097qhzSOr','role'];a199_0x1f1c=function(){return _0x27d77e;};return a199_0x1f1c();}export function assertTenantAccessible(_0x27eefb,_0x42a85d){const _0x3bb55d=a199_0x3a73;if(_0x42a85d[_0x3bb55d(0x1f6)](_0x1bf59e=>_0x1bf59e[_0x3bb55d(0x1fc)]===_0x27eefb))return;throw CliErrors[_0x3bb55d(0x1fe)](_0x3bb55d(0x1ff)+_0x27eefb+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a200_0x58336e=a200_0x5e05;(function(_0x3d3c4a,_0x14a691){const _0x1f6524=a200_0x5e05,_0xbb932=_0x3d3c4a();while(!![]){try{const _0x178b73=-parseInt(_0x1f6524(0x1b6))/0x1*(-parseInt(_0x1f6524(0x1c4))/0x2)+parseInt(_0x1f6524(0x1bb))/0x3*(-parseInt(_0x1f6524(0x1b9))/0x4)+-parseInt(_0x1f6524(0x1be))/0x5*(-parseInt(_0x1f6524(0x1c6))/0x6)+parseInt(_0x1f6524(0x1c3))/0x7+-parseInt(_0x1f6524(0x1ce))/0x8*(parseInt(_0x1f6524(0x1bf))/0x9)+-parseInt(_0x1f6524(0x1b7))/0xa+parseInt(_0x1f6524(0x1b5))/0xb;if(_0x178b73===_0x14a691)break;else _0xbb932['push'](_0xbb932['shift']());}catch(_0x3ae6c3){_0xbb932['push'](_0xbb932['shift']());}}}(a200_0x1942,0x75dd6));function a200_0x5e05(_0x3f29d9,_0x43185d){_0x3f29d9=_0x3f29d9-0x1b3;const _0x19423b=a200_0x1942();let _0x5e050c=_0x19423b[_0x3f29d9];return _0x5e050c;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a200_0x1942(){const _0x450962=['bind','string','POST','dingding-sandbox','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','8hInSwY','dingding-sandbox-bind','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','5238035TxrZxT','79eewnha','1030690arThuR','ding-talk-user-id','31732unVGbl','validation','114JmOIxm','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','5JlHBQe','1529208bHncSk','str','trim','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','2215094eFKJol','4904spRjJL','user-account','425244BUUjDL','--ding-talk-user-id\x20cannot\x20be\x20empty.','write'];a200_0x1942=function(){return _0x450962;};return a200_0x1942();}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x58336e(0x1cc),CURRENT_BINDING_WARNING=a200_0x58336e(0x1cd);function readDingTalkUserId(_0x306358){const _0x104154=a200_0x58336e,_0x2cf44f=_0x306358[_0x104154(0x1c0)](_0x104154(0x1b8))[_0x104154(0x1c1)]();if(!_0x2cf44f)throw CliErrors[_0x104154(0x1ba)](_0x104154(0x1c7),_0x104154(0x1bc));return _0x2cf44f;}function buildBindingData(_0x2c59f1,_0x20faf2){const _0x3fae7b=a200_0x58336e;return{'operation':_0x3fae7b(0x1c9),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1,'bound':!![]},'dryRun':_0x20faf2,'backend':{'method':_0x3fae7b(0x1cb),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x58336e(0x1c5),'command':a200_0x58336e(0x1b3),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':a200_0x58336e(0x1c8),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x58336e(0x1b8),'type':a200_0x58336e(0x1ca),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x1c6fca){readDingTalkUserId(_0x1c6fca);},async 'dryRun'(_0x182a4d){const _0xa2855f=readDingTalkUserId(_0x182a4d);return asDryRunResult(buildBindingData(_0xa2855f,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x43055c){const _0x5b2a8a=a200_0x58336e,_0x1404de=readDingTalkUserId(_0x43055c),_0x3e1a14=await bindDingTalkSandboxAccount(_0x1404de);if(_0x3e1a14!==!![])throw CliErrors['apiError'](_0x5b2a8a(0x1b4),_0x5b2a8a(0x1bd));return{'ok':!![],'data':buildBindingData(_0x1404de,![]),'message':_0x5b2a8a(0x1c2)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a201_0x2117(){const _0x2e5e4b=['2354052yXEJeX','8ObXDxA','471360keCmoo','8883650EgyLIb','11ZeFppG','330326sIPogl','7BPGXVV','10852YflBrf','78owkhHd','1771444fvWHIU','2824947LyNUnu'];a201_0x2117=function(){return _0x2e5e4b;};return a201_0x2117();}(function(_0x529e5f,_0x833728){const _0x29e7b3=a201_0x5bb5,_0x51160e=_0x529e5f();while(!![]){try{const _0x63f5d4=-parseInt(_0x29e7b3(0x10c))/0x1+parseInt(_0x29e7b3(0x10e))/0x2*(-parseInt(_0x29e7b3(0x10f))/0x3)+parseInt(_0x29e7b3(0x110))/0x4+parseInt(_0x29e7b3(0x114))/0x5+parseInt(_0x29e7b3(0x112))/0x6*(-parseInt(_0x29e7b3(0x10d))/0x7)+-parseInt(_0x29e7b3(0x113))/0x8*(parseInt(_0x29e7b3(0x111))/0x9)+parseInt(_0x29e7b3(0x10a))/0xa*(parseInt(_0x29e7b3(0x10b))/0xb);if(_0x63f5d4===_0x833728)break;else _0x51160e['push'](_0x51160e['shift']());}catch(_0x5b37c9){_0x51160e['push'](_0x51160e['shift']());}}}(a201_0x2117,0x3c83f));function a201_0x5bb5(_0x320ebc,_0x3bf42b){_0x320ebc=_0x320ebc-0x10a;const _0x21172a=a201_0x2117();let _0x5bb57b=_0x21172a[_0x320ebc];return _0x5bb57b;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a202_0x5b66(){const _0x22ec35=['1900430xbjIHC','2102wbBLZA','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1021196QzzLkp','workspace\x20add','add','130bIhfLj','App\x20profile\x20name','6587811TVMjOu','405652QKqYJL','40PdxgAe','1017VbbnPY','3240732INAzqB','name','8EoGtCH','712221TBqHEo','write'];a202_0x5b66=function(){return _0x22ec35;};return a202_0x5b66();}function a202_0x467c(_0x3b7017,_0x3b6099){_0x3b7017=_0x3b7017-0x16a;const _0x5b6620=a202_0x5b66();let _0x467cc8=_0x5b6620[_0x3b7017];return _0x467cc8;}const a202_0x429dde=a202_0x467c;(function(_0x108c46,_0xe753b4){const _0x46e617=a202_0x467c,_0x3f6e6d=_0x108c46();while(!![]){try{const _0xf8ec1b=parseInt(_0x46e617(0x172))/0x1+-parseInt(_0x46e617(0x175))/0x2*(-parseInt(_0x46e617(0x16e))/0x3)+parseInt(_0x46e617(0x16c))/0x4*(-parseInt(_0x46e617(0x16d))/0x5)+-parseInt(_0x46e617(0x16f))/0x6+-parseInt(_0x46e617(0x174))/0x7*(-parseInt(_0x46e617(0x171))/0x8)+-parseInt(_0x46e617(0x16b))/0x9+parseInt(_0x46e617(0x17a))/0xa*(parseInt(_0x46e617(0x177))/0xb);if(_0xf8ec1b===_0xe753b4)break;else _0x3f6e6d['push'](_0x3f6e6d['shift']());}catch(_0x1c9520){_0x3f6e6d['push'](_0x3f6e6d['shift']());}}}(a202_0x5b66,0x71267));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a202_0x429dde(0x179),'description':a202_0x429dde(0x176),'risk':a202_0x429dde(0x173),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x429dde(0x170),'description':a202_0x429dde(0x16a),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x5c5fa9=>validateAppName(_0x5c5fa9,a202_0x429dde(0x178)),'execute':_0x4033f7=>runAppAdd(_0x4033f7,a202_0x429dde(0x178))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a203_0x29b80a=a203_0x5623;(function(_0x47301,_0x4ee5bb){const _0x1d011f=a203_0x5623,_0x7b3b3f=_0x47301();while(!![]){try{const _0x167541=-parseInt(_0x1d011f(0x10c))/0x1+-parseInt(_0x1d011f(0x119))/0x2+parseInt(_0x1d011f(0x110))/0x3*(parseInt(_0x1d011f(0x115))/0x4)+-parseInt(_0x1d011f(0xf1))/0x5*(parseInt(_0x1d011f(0xfc))/0x6)+-parseInt(_0x1d011f(0x11d))/0x7+parseInt(_0x1d011f(0x10f))/0x8*(parseInt(_0x1d011f(0x118))/0x9)+parseInt(_0x1d011f(0x102))/0xa*(parseInt(_0x1d011f(0x108))/0xb);if(_0x167541===_0x4ee5bb)break;else _0x7b3b3f['push'](_0x7b3b3f['shift']());}catch(_0x337a31){_0x7b3b3f['push'](_0x7b3b3f['shift']());}}}(a203_0x3f0f,0xe3387));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';function a203_0x3f0f(){const _0x43764d=['workspace','flag','\x20--appcode\x20<code>`.','6544433qssPDl','riskLevel','Target\x20environment','trim','object','locale','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x20(appcode:\x20','apiDir','format','8982065yWqoYu','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','number','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','appcode','defaultFormat','length','env','workspace.','pageSize','App\x20\x22','6biRAbV','apps','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20use\x20--app\x20<name>`.','app','10cdeElS','validation','Use\x20`','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Locale\x20for\x20this\x20workspace\x20app\x20profile','init','60268197hCzmjG','\x20--app\x20','keys','use','1585888rDXxEu','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','str','5624096CPsHAL','15BrJABV','globalConfig','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','Missing\x20workspace\x20app\x20selector.','286792eZZOHa','string','write','9oPpebe','2585028MchtNr'];a203_0x3f0f=function(){return _0x43764d;};return a203_0x3f0f();}function a203_0x5623(_0x3d6934,_0x41dbb4){_0x3d6934=_0x3d6934-0xee;const _0x3f0f34=a203_0x3f0f();let _0x562364=_0x3f0f34[_0x3d6934];return _0x562364;}const WORKSPACE_USAGE=CLI_BIN_NAME+a203_0x29b80a(0x113),SAFE_PROFILE_KEYS=['appcode','env','apiDir',a203_0x29b80a(0xf0),a203_0x29b80a(0xfa),a203_0x29b80a(0x11e),a203_0x29b80a(0x122)],workspaceFlags=[{'name':a203_0x29b80a(0x101),'type':a203_0x29b80a(0x116),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a203_0x29b80a(0xf8),'type':'string','description':a203_0x29b80a(0x11f),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a203_0x29b80a(0x10d)},{'name':a203_0x29b80a(0xf6),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x123),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a203_0x29b80a(0xf3),'description':a203_0x29b80a(0x112)},{'name':a203_0x29b80a(0x11e),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0xf4),'enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x29b80a(0x122),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x106)}];function isRecord(_0x4732c8){const _0x17b09e=a203_0x29b80a;return!!_0x4732c8&&typeof _0x4732c8===_0x17b09e(0x121)&&!Array['isArray'](_0x4732c8);}function assertValidAppcode(_0x249e8f){const _0x44abce=a203_0x29b80a,{valid:_0x154775,message:_0x417ea9}=validateAppcode(_0x249e8f);if(!_0x154775)throw CliErrors[_0x44abce(0x103)]('Invalid\x20appcode:\x20'+_0x249e8f,_0x417ea9);}function sanitizeProfile(_0x2660da){if(!isRecord(_0x2660da))return{};const _0x25b20d={};for(const _0x34a2b4 of SAFE_PROFILE_KEYS){if(_0x2660da[_0x34a2b4]!==undefined)_0x25b20d[_0x34a2b4]=_0x2660da[_0x34a2b4];}return _0x25b20d;}function cloneProfile(_0x39842e){return isRecord(_0x39842e)?{..._0x39842e}:{};}function collectWorkspaceProfileOverrides(_0x3e4cbf){const _0x499b86=a203_0x29b80a,_0x190568={},_0xf2915f=_0x3e4cbf['str'](_0x499b86(0xf8)),_0x5cd1c0=_0x3e4cbf['str']('apiDir'),_0x5d9bcd=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0xf6)),_0x88384f=_0x3e4cbf[_0x499b86(0x11b)]('pageSize'),_0xf34247=_0x3e4cbf[_0x499b86(0x10e)]('riskLevel'),_0x1e8ce7=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0x122));if(_0xf2915f)_0x190568[_0x499b86(0xf8)]=_0xf2915f;if(_0x5cd1c0)_0x190568[_0x499b86(0xef)]=_0x5cd1c0;if(_0x5d9bcd)_0x190568[_0x499b86(0xf0)]=_0x5d9bcd;if(_0x88384f!==undefined&&_0x88384f!=='')_0x190568['pageSize']=Number(_0x88384f);if(_0xf34247)_0x190568[_0x499b86(0x11e)]=_0xf34247;if(_0x1e8ce7)_0x190568['locale']=_0x1e8ce7;return _0x190568;}async function validateWorkspaceArgs(_0x2fdcbf){const _0x23351c=a203_0x29b80a,_0x484df8=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0x101))[_0x23351c(0x120)](),_0x30e407=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0xf5))[_0x23351c(0x120)]();if(!_0x484df8&&!_0x30e407)throw CliErrors['validation'](_0x23351c(0x114),_0x23351c(0x104)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x23351c(0x100));if(_0x30e407)assertValidAppcode(_0x30e407);}function resolveKnownApps(){const _0x52b505=a203_0x29b80a,{config:_0x351695,layers:_0x587bfe}=readRawConfigWithLayers(),_0x2708b5=isRecord(_0x351695['apps'])?_0x351695[_0x52b505(0xfd)]:{},_0x4ff698=isRecord(_0x587bfe['globalConfig'][_0x52b505(0xfd)])?_0x587bfe[_0x52b505(0x111)][_0x52b505(0xfd)]:{};return{..._0x4ff698,..._0x2708b5};}async function configureWorkspace(_0xd92d6c,_0x384fff){const _0x303cd8=a203_0x29b80a,_0x1c53b0=_0xd92d6c[_0x303cd8(0x10e)](_0x303cd8(0x101))[_0x303cd8(0x120)](),_0x578c19=_0xd92d6c['str'](_0x303cd8(0xf5))['trim'](),_0x452292=_0x1c53b0||_0x578c19;if(!_0x452292)throw CliErrors[_0x303cd8(0x103)](_0x303cd8(0x114),'Use\x20`'+CLI_BIN_NAME+_0x303cd8(0x105)+CLI_BIN_NAME+_0x303cd8(0x100));if(_0x578c19)assertValidAppcode(_0x578c19);const _0x446b4e=resolveWriteConfigPath('project'),_0x301fde=readConfigFile(_0x446b4e),_0x25df8e=resolveKnownApps(),_0x23b70d=isRecord(_0x301fde[_0x303cd8(0xfd)])?{..._0x301fde[_0x303cd8(0xfd)]}:{},_0x1cf75d=cloneProfile(_0x23b70d[_0x452292]),_0x50b96d=sanitizeProfile(_0x25df8e[_0x452292]),_0x301a16=_0x578c19?{}:_0x50b96d,_0x1997b4=_0x578c19||_0x301a16['appcode'];if(!_0x1997b4){const _0x11f962=Object[_0x303cd8(0x10a)](_0x25df8e),_0x2c5a1b=_0x11f962[_0x303cd8(0xf7)]===0x0?_0x303cd8(0x104)+CLI_BIN_NAME+'\x20workspace\x20'+_0x384fff+_0x303cd8(0x109)+_0x452292+_0x303cd8(0x11c):_0x303cd8(0xf2)+_0x11f962['join'](',\x20');throw CliErrors['validation'](_0x303cd8(0xfb)+_0x452292+'\x22\x20not\x20found.',_0x2c5a1b);}assertValidAppcode(String(_0x1997b4));const _0x10724e={..._0x301a16,..._0x1cf75d,'appcode':String(_0x1997b4),...collectWorkspaceProfileOverrides(_0xd92d6c)};return _0x23b70d[_0x452292]=_0x10724e,_0x301fde['apps']=_0x23b70d,_0x301fde['defaultApp']=_0x452292,delete _0x301fde[_0x303cd8(0xf5)],delete _0x301fde[_0x303cd8(0x101)],_0x10724e[_0x303cd8(0xf8)]&&(_0x301fde[_0x303cd8(0xf8)]=_0x10724e[_0x303cd8(0xf8)]),writeConfigFile(_0x446b4e,_0x301fde),{'ok':!![],'message':'Workspace\x20'+(_0x384fff===_0x303cd8(0x107)?'initialized':'updated')+':\x20'+_0x452292+_0x303cd8(0xee)+_0x10724e['appcode']+').\x20Config:\x20'+_0x446b4e+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x303cd8(0xf9)+_0x384fff,'configPath':_0x446b4e,'app':_0x452292,'appcode':_0x10724e[_0x303cd8(0xf5)],'env':_0x10724e[_0x303cd8(0xf8)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x107),'description':a203_0x29b80a(0xfe),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4147e1=>configureWorkspace(_0x4147e1,a203_0x29b80a(0x107))},workspaceUseDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x10b),'description':a203_0x29b80a(0xff),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x9d6464=>configureWorkspace(_0x9d6464,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a204_0x4305c7=a204_0x567d;function a204_0x567d(_0x319d42,_0x3d9d32){_0x319d42=_0x319d42-0x19c;const _0x262c6a=a204_0x262c();let _0x567daf=_0x262c6a[_0x319d42];return _0x567daf;}(function(_0x6d2c6,_0x2008da){const _0x1b4e1c=a204_0x567d,_0x2ec167=_0x6d2c6();while(!![]){try{const _0x428af9=-parseInt(_0x1b4e1c(0x1a0))/0x1*(parseInt(_0x1b4e1c(0x1a9))/0x2)+-parseInt(_0x1b4e1c(0x1a8))/0x3*(parseInt(_0x1b4e1c(0x1a1))/0x4)+parseInt(_0x1b4e1c(0x19e))/0x5+-parseInt(_0x1b4e1c(0x1ac))/0x6*(-parseInt(_0x1b4e1c(0x1a2))/0x7)+parseInt(_0x1b4e1c(0x19d))/0x8+parseInt(_0x1b4e1c(0x1a5))/0x9+-parseInt(_0x1b4e1c(0x1ab))/0xa*(parseInt(_0x1b4e1c(0x1a4))/0xb);if(_0x428af9===_0x2008da)break;else _0x2ec167['push'](_0x2ec167['shift']());}catch(_0x1b42b1){_0x2ec167['push'](_0x2ec167['shift']());}}}(a204_0x262c,0x38428));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a204_0x262c(){const _0x56e89b=['10Urvnqm','48RxJRlG','write','574600xGNWSn','19680VwFIBE','App\x20profile\x20name\x20to\x20remove','12cxzIuT','212UQpswQ','284977PPBUXw','name','2613391iocAIT','4078917PZNwla','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','3039vXxvGr','55492oiigkk','workspace\x20remove'];a204_0x262c=function(){return _0x56e89b;};return a204_0x262c();}export const workspaceRemoveDefinition={'service':'workspace','command':a204_0x4305c7(0x1a6),'description':a204_0x4305c7(0x1a7),'risk':a204_0x4305c7(0x19c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x4305c7(0x1a3),'description':a204_0x4305c7(0x19f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3bfdf9=>validateAppName(_0x3bfdf9,'workspace\x20remove'),'execute':_0x30287d=>runAppRemove(_0x30287d,a204_0x4305c7(0x1aa))};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a205_0x2a2608=a205_0x3536;(function(_0x1fe300,_0xc51b32){const _0xb22d81=a205_0x3536,_0x203104=_0x1fe300();while(!![]){try{const _0x78544b=-parseInt(_0xb22d81(0x1c9))/0x1+-parseInt(_0xb22d81(0x1bc))/0x2*(-parseInt(_0xb22d81(0x1cc))/0x3)+parseInt(_0xb22d81(0x1d7))/0x4*(-parseInt(_0xb22d81(0x1b4))/0x5)+parseInt(_0xb22d81(0x1d5))/0x6*(parseInt(_0xb22d81(0x1c7))/0x7)+parseInt(_0xb22d81(0x1bb))/0x8*(parseInt(_0xb22d81(0x1d3))/0x9)+parseInt(_0xb22d81(0x1c8))/0xa+-parseInt(_0xb22d81(0x1c2))/0xb;if(_0x78544b===_0xc51b32)break;else _0x203104['push'](_0x203104['shift']());}catch(_0x40d601){_0x203104['push'](_0x203104['shift']());}}}(a205_0x11e4,0x970b1));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';function a205_0x11e4(){const _0x35924d=['3640VhVlHR','Default\x20page\x20size','inherit','length','Access\x20key','format','apiDir','riskLevel','2545yYAimc','accessKey','cookie','Config\x20key\x20(','app','en-US','locale','9242536xvtQgN','567718HapnLW','zh-CN','map','has','Locale','entries','7817458avhBeA','Auth\x20cookie','toLowerCase','env','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','7QiQQKz','4895730igDeDa','918185DdgzGe','apps','defaultApp','3yoXVZh','Target\x20environment','API\x20directory\x20path','string','filter','pageSize','keys','9FegoTU','appcode','4691862weKlNf','Risk\x20level'];a205_0x11e4=function(){return _0x35924d;};return a205_0x11e4();}export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a205_0x2a2608(0x1b5),a205_0x2a2608(0x1ba),a205_0x2a2608(0x1dc),a205_0x2a2608(0x1de)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x2a2608(0x1d4),a205_0x2a2608(0x1c5),a205_0x2a2608(0x1ba),'format',a205_0x2a2608(0x1b6),a205_0x2a2608(0x1b5),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5c72c0){return[..._0x5c72c0]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x183985){const _0x29e9fd=a205_0x2a2608;return TOP_LEVEL_CONFIG_KEYS[_0x29e9fd(0x1bf)](_0x183985);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a205_0x3536(_0xb17dc6,_0x2a7a89){_0xb17dc6=_0xb17dc6-0x1b4;const _0x11e494=a205_0x11e4();let _0x3536f0=_0x11e494[_0xb17dc6];return _0x3536f0;}export function getConfigCommandKeyDescription(){const _0x50b102=a205_0x2a2608;return _0x50b102(0x1b7)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a205_0x2a2608(0x1c5),'apiDir':a205_0x2a2608(0x1dd),'cookie':a205_0x2a2608(0x1b6),'accessKey':'accessKey','defaultFormat':a205_0x2a2608(0x1dc),'pageSize':a205_0x2a2608(0x1d1),'riskLevel':a205_0x2a2608(0x1de),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x59d973=a205_0x2a2608;return[{'name':_0x59d973(0x1c5),'type':'string','description':_0x59d973(0x1cd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x59d973(0x1dd),'type':'string','description':_0x59d973(0x1ce)},{'name':_0x59d973(0x1b6),'type':'string','description':_0x59d973(0x1c3),'hidden':!![]},{'name':_0x59d973(0x1b5),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1db),'hidden':!![]},{'name':'defaultFormat','type':_0x59d973(0x1cf),'description':_0x59d973(0x1c6),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x59d973(0x1d1),'type':'number','description':_0x59d973(0x1d8)},{'name':_0x59d973(0x1de),'type':'string','description':_0x59d973(0x1d6),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x59d973(0x1ba),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1c0)}];}export function collectAppProfileOverrides(_0x2ca2e3){const _0x259120=a205_0x2a2608,_0x25f20c={};for(const [_0x1716d6,_0x5adf94]of Object[_0x259120(0x1c1)](APP_PROFILE_FLAG_KEY_MAP)){const _0x31bb11=_0x2ca2e3(_0x1716d6);if(!_0x31bb11)continue;_0x25f20c[_0x5adf94]=_0x5adf94==='pageSize'?Number(_0x31bb11):_0x31bb11;}return _0x25f20c;}export function buildAppProfileListFields(_0x5aa890){const _0x4d1c78=a205_0x2a2608;return{'env':_0x5aa890[_0x4d1c78(0x1c5)]??null,'apiDir':_0x5aa890['apiDir']??null,'hasCookie':!!_0x5aa890[_0x4d1c78(0x1b6)],'hasAccessKey':!!_0x5aa890[_0x4d1c78(0x1b5)],'format':_0x5aa890[_0x4d1c78(0x1dc)]??null,'pageSize':_0x5aa890['pageSize']??null,'riskLevel':_0x5aa890[_0x4d1c78(0x1de)]??null,'locale':_0x5aa890[_0x4d1c78(0x1ba)]??null};}export function buildAppDoctorFields(_0x44d971,_0x273efc){const _0x26b04=a205_0x2a2608;return{'env':{'value':_0x44d971[_0x26b04(0x1c5)]||_0x273efc[_0x26b04(0x1c5)],'source':_0x44d971[_0x26b04(0x1c5)]?'app':'inherit'},'apiDir':{'value':_0x44d971[_0x26b04(0x1dd)]||_0x273efc[_0x26b04(0x1dd)],'source':_0x44d971['apiDir']?_0x26b04(0x1b8):_0x26b04(0x1d9)},'cookie':{'value':_0x44d971['cookie']||_0x273efc[_0x26b04(0x1b6)],'source':_0x44d971['cookie']?'app':'inherit'},'accessKey':{'value':_0x44d971['accessKey']||_0x273efc['accessKey'],'source':_0x44d971[_0x26b04(0x1b5)]?_0x26b04(0x1b8):_0x26b04(0x1d9)}};}export function buildCanonicalAppConfig(_0x571b2f,_0x2d6d72){const _0x5f2537=a205_0x2a2608,_0x4596d7=_0x571b2f[_0x5f2537(0x1be)](_0x5ccda8=>String(_0x5ccda8||'')['trim']())[_0x5f2537(0x1d0)](Boolean);if(_0x4596d7[_0x5f2537(0x1da)]===0x0)return{};const _0x1afac3={};for(const _0x129dda of _0x4596d7){_0x1afac3[_0x129dda]=_0x2d6d72?{'appcode':_0x129dda,'env':_0x2d6d72}:{'appcode':_0x129dda};}return{'apps':_0x1afac3,'defaultApp':_0x4596d7[0x0]};}export function buildCanonicalProjectConfig(_0x5d558c,_0x5acb6d){const _0x5a44ae=a205_0x2a2608,{appCodes:appCodes=[],env:_0x399f8a,metadata:_0x25d2c2}=_0x5acb6d,_0x3e81c4={..._0x5d558c,..._0x25d2c2||{}};delete _0x3e81c4['appcode'],delete _0x3e81c4['app'];if(_0x399f8a)_0x3e81c4[_0x5a44ae(0x1c5)]=_0x399f8a;else!_0x3e81c4[_0x5a44ae(0x1c5)]&&(_0x3e81c4[_0x5a44ae(0x1c5)]=DEFAULT_CONFIG_VALUES[_0x5a44ae(0x1c5)]);const _0x25f350=buildCanonicalAppConfig(appCodes,_0x3e81c4[_0x5a44ae(0x1c5)]);return Object[_0x5a44ae(0x1d2)](_0x25f350)[_0x5a44ae(0x1da)]>0x0&&(_0x3e81c4[_0x5a44ae(0x1ca)]=_0x25f350[_0x5a44ae(0x1ca)],_0x3e81c4[_0x5a44ae(0x1cb)]=_0x25f350[_0x5a44ae(0x1cb)]),_0x3e81c4;}const LOCALE_MAP={'zh':a205_0x2a2608(0x1bd),'zh-cn':'zh-CN','zh_cn':a205_0x2a2608(0x1bd),'en':'en-US','en-us':'en-US','en_us':a205_0x2a2608(0x1b9)};export function normalizeLocale(_0x4ab4e2){const _0x7fc565=a205_0x2a2608;if(!_0x4ab4e2)return null;return LOCALE_MAP[_0x4ab4e2[_0x7fc565(0x1c4)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a206_0x34f8c9=a206_0x141c;(function(_0x52517b,_0x224fdb){const _0x354846=a206_0x141c,_0x2f4c52=_0x52517b();while(!![]){try{const _0x34d7c7=-parseInt(_0x354846(0x105))/0x1*(parseInt(_0x354846(0xfb))/0x2)+-parseInt(_0x354846(0xf6))/0x3*(parseInt(_0x354846(0xfe))/0x4)+-parseInt(_0x354846(0x101))/0x5*(parseInt(_0x354846(0xfa))/0x6)+-parseInt(_0x354846(0x100))/0x7*(parseInt(_0x354846(0xff))/0x8)+-parseInt(_0x354846(0x103))/0x9*(parseInt(_0x354846(0xf8))/0xa)+parseInt(_0x354846(0xf7))/0xb+-parseInt(_0x354846(0xf9))/0xc*(-parseInt(_0x354846(0xfc))/0xd);if(_0x34d7c7===_0x224fdb)break;else _0x2f4c52['push'](_0x2f4c52['shift']());}catch(_0x352a1e){_0x2f4c52['push'](_0x2f4c52['shift']());}}}(a206_0x21bd,0x2d110));export const RABETBASE_CDN_BASE_URL=a206_0x34f8c9(0x104);export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0xfd);function a206_0x21bd(){const _0x46cac1=['27339bHypzu','87UeLsAq','2995553CtouAQ','5410gDTaJT','76872BbDXdu','216DuxlGy','2IFeSpa','1703yQUooM','/config/index.json','37740jzRDYL','24zpqENA','558033oTBtEX','27725oaXTkX','/templates/projects','3114DQATOR','https://g.lovrabet.com/dist/rabetbase-cli'];a206_0x21bd=function(){return _0x46cac1;};return a206_0x21bd();}function a206_0x141c(_0x2d5dde,_0x1d8598){_0x2d5dde=_0x2d5dde-0xf6;const _0x21bdc0=a206_0x21bd();let _0x141c53=_0x21bdc0[_0x2d5dde];return _0x141c53;}export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0x102);
|