@lovrabet/rabetbase-cli 2.3.6 → 2.3.7-beta.2
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/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.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/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -0
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/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 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -0
- 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.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -0
- 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/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/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/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.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/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.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/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.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-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/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.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.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/copy-directory.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/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a156_0x3c5819=a156_0x5b38;(function(_0x85826a,_0x405240){const _0x11b64c=a156_0x5b38,_0x5858e0=_0x85826a();while(!![]){try{const _0x18c7ac=parseInt(_0x11b64c(0x1f5))/0x1+-parseInt(_0x11b64c(0x1c6))/0x2*(-parseInt(_0x11b64c(0x1dc))/0x3)+parseInt(_0x11b64c(0x1dd))/0x4*(parseInt(_0x11b64c(0x1f1))/0x5)+-parseInt(_0x11b64c(0x1ed))/0x6*(parseInt(_0x11b64c(0x1ff))/0x7)+-parseInt(_0x11b64c(0x1d3))/0x8+-parseInt(_0x11b64c(0x1e2))/0x9+-parseInt(_0x11b64c(0x1ce))/0xa;if(_0x18c7ac===_0x405240)break;else _0x5858e0['push'](_0x5858e0['shift']());}catch(_0x233200){_0x5858e0['push'](_0x5858e0['shift']());}}}(a156_0x3210,0xa3f29));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a156_0x5b38(_0xb005fd,_0x1ff9a3){_0xb005fd=_0xb005fd-0x1c6;const _0x32106f=a156_0x3210();let _0x5b3820=_0x32106f[_0xb005fd];return _0x5b3820;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a156_0x3210(){const _0x2993fe=['toISOString','Filter\x20by\x20SQL\x20display\x20name','sqlcode','sqlCode','sqls','279iPMYjF','24Qszikz','mybatisXml','description','sql','push','4716324PYasQx','catch','appCode','sqlRoot','conflict','lastSync','write','tableData','dbId','test','sqlName','1288398pUiZgV','No\x20remote\x20SQL\x20queries\x20matched.','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','paging','1017550skJVvS','sqlContent','trimStart','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','80430GnXuEC','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Force\x20overwrite\x20local\x20unsynced\x20changes','unchanged','string','Force\x20pull\x20cancelled.','length','lockFilePath','cancelled','Would\x20pull\x20','21gfFQwr','\x20written,\x20','local\x20differs\x20from\x20remote','21236ECOWWC','skipped','pull','POST','name','replace','path','str','1741890WnpQvk','apps','sqlRootDir','\x20SQL\x20file(s)\x20into\x20','utf8','2200088jiLVlD','force','filter','message'];a156_0x3210=function(){return _0x2993fe;};return a156_0x3210();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1b6357,_0x7063bc){const _0x4bb2d0=a156_0x5b38,_0x9b0f9a=[];let _0x3ad9d7=0x1;while(!![]){const _0x46966b=await listSqlQueries(_0x1b6357,{'currentPage':_0x3ad9d7,'pageSize':PAGE_SIZE,'sqlCode':_0x7063bc[_0x4bb2d0(0x1da)],'sqlName':_0x7063bc[_0x4bb2d0(0x1ec)]}),_0x50eb57=_0x46966b[_0x4bb2d0(0x1e9)]??[];_0x9b0f9a[_0x4bb2d0(0x1e1)](..._0x50eb57);if(_0x50eb57[_0x4bb2d0(0x1fb)]===0x0)break;const _0x43f87d=_0x46966b[_0x4bb2d0(0x1f0)]?.['totalCount'];if(_0x43f87d!=null?_0x9b0f9a[_0x4bb2d0(0x1fb)]>=_0x43f87d:_0x50eb57[_0x4bb2d0(0x1fb)]<PAGE_SIZE)break;_0x3ad9d7++;}return _0x9b0f9a;}async function ensureSqlContent(_0x1b04b0){const _0x68dffa=a156_0x5b38;if(_0x1b04b0[_0x68dffa(0x1f2)]!=null&&String(_0x1b04b0['sqlContent'])[_0x68dffa(0x1fb)]>0x0)return _0x1b04b0;return getSqlQueryDetail(_0x1b04b0['sqlCode']);}export const sqlPull={'service':a156_0x3c5819(0x1e0),'command':a156_0x3c5819(0x1c8),'description':a156_0x3c5819(0x1f6),'risk':a156_0x3c5819(0x1e8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a156_0x3c5819(0x1f9),'description':a156_0x3c5819(0x1d8)},{'name':'force','type':'boolean','description':a156_0x3c5819(0x1f7)}],async 'dryRun'(_0x2fccd7){const _0x4f086f=a156_0x3c5819,_0xbb6647=loadSqlProjectConfig(_0x2fccd7[_0x4f086f(0x1e4)]),_0x47e9b6=await readSqlLockFile(_0xbb6647[_0x4f086f(0x1fc)]),{appLock:_0x3753dd}=ensureSqlLockScope(_0x47e9b6??createEmptySqlLock(),_0xbb6647[_0x4f086f(0x1e4)],_0xbb6647[_0x4f086f(0x1e5)],_0x4f086f(0x1c8)),_0x213ce3=await fetchAllSqlQueries(_0x2fccd7[_0x4f086f(0x1e4)],{'sqlCode':_0x2fccd7['str'](_0x4f086f(0x1d9))||undefined,'sqlName':_0x2fccd7[_0x4f086f(0x1cd)](_0x4f086f(0x1ca))||undefined}),_0x36ceaf=[];for(const _0x307dd2 of _0x213ce3){const _0x55417d=await ensureSqlContent(_0x307dd2),_0x1d4110=ensureRemoteSqlContent(_0x55417d),_0x5ec41f=detectModeFromSql(_0x55417d),_0x3160b6=_0x55417d[_0x4f086f(0x1ea)]?await getDbName(_0x2fccd7[_0x4f086f(0x1e4)],Number(_0x55417d[_0x4f086f(0x1ea)]))[_0x4f086f(0x1e3)](()=>undefined):undefined,_0x4fafb5=buildLocalSqlFileContent({'sqlCode':_0x55417d[_0x4f086f(0x1da)],'sqlName':_0x55417d[_0x4f086f(0x1ec)],'dbId':_0x55417d[_0x4f086f(0x1ea)]},_0x1d4110,{'dbName':_0x3160b6,'mode':_0x5ec41f,'syncedAt':new Date()[_0x4f086f(0x1d7)](),'description':_0x55417d[_0x4f086f(0x1df)]}),_0x42b60b=buildSqlLockEntry(_0x55417d,_0x1d4110,'',{'dbName':_0x3160b6}),_0x12baa9=resolveLocalSqlFilePath(_0xbb6647,_0x55417d['sqlCode'],_0x42b60b);let _0x47e07a='would_pull',_0x4b4f79;if(await fileExists(_0x12baa9)){const _0x24bca3=await readFile(_0x12baa9,'utf8');isEquivalentPulledSqlFile(_0x24bca3,_0x4fafb5,_0x5ec41f)?(_0x47e07a=_0x4f086f(0x1c7),_0x4b4f79=_0x4f086f(0x1f8)):(_0x47e07a=_0x4f086f(0x1e6),_0x4b4f79='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x36ceaf[_0x4f086f(0x1e1)]({'sqlCode':_0x55417d[_0x4f086f(0x1da)],'sqlName':_0x55417d['sqlName'],'filePath':_0x12baa9,'status':_0x47e07a,'reason':_0x4b4f79});}return{'method':_0x4f086f(0x1c9),'url':_0x4f086f(0x1f4),'body':{'appCode':_0x2fccd7[_0x4f086f(0x1e4)],'sqlCode':_0x2fccd7[_0x4f086f(0x1cd)]('sqlcode')||null,'sqlName':_0x2fccd7[_0x4f086f(0x1cd)](_0x4f086f(0x1ca))||null,'files':_0x36ceaf},'description':_0x4f086f(0x1fe)+_0x36ceaf['length']+_0x4f086f(0x1d1)+_0xbb6647[_0x4f086f(0x1d0)]};},async 'execute'(_0x584d29){const _0x135169=a156_0x3c5819,_0x1cace1=loadSqlProjectConfig(_0x584d29[_0x135169(0x1e4)]),_0x5eeff6=await readSqlLockFile(_0x1cace1[_0x135169(0x1fc)]),{lockData:_0x3f327e,appLock:_0x4dc0ee}=ensureSqlLockScope(_0x5eeff6??createEmptySqlLock(),_0x1cace1[_0x135169(0x1e4)],_0x1cace1[_0x135169(0x1e5)],'pull'),_0x46e3ca=_0x584d29['bool'](_0x135169(0x1d4)),_0x2f9d1b=await fetchAllSqlQueries(_0x584d29[_0x135169(0x1e4)],{'sqlCode':_0x584d29[_0x135169(0x1cd)](_0x135169(0x1d9))||undefined,'sqlName':_0x584d29[_0x135169(0x1cd)](_0x135169(0x1ca))||undefined});if(_0x2f9d1b[_0x135169(0x1fb)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x135169(0x1ee)};const _0x1b65b6=[],_0x3d6e63=[];for(const _0x1b5e00 of _0x2f9d1b){try{_0x1b65b6[_0x135169(0x1e1)](await ensureSqlContent(_0x1b5e00));}catch(_0x2ffea5){_0x3d6e63[_0x135169(0x1e1)]({'sqlCode':_0x1b5e00[_0x135169(0x1da)],'error':_0x2ffea5 instanceof Error?_0x2ffea5[_0x135169(0x1d6)]:String(_0x2ffea5)});}}if(_0x46e3ca&&!_0x584d29['nonInteractive']){let _0xd7b443=![];for(const _0x1007d3 of _0x1b65b6){const _0x1ed436=detectModeFromSql(_0x1007d3),_0x159b29=_0x1007d3[_0x135169(0x1ea)]?await getDbName(_0x584d29['appCode'],Number(_0x1007d3[_0x135169(0x1ea)]))[_0x135169(0x1e3)](()=>undefined):undefined,_0x134120=buildLocalSqlFileContent({'sqlCode':_0x1007d3[_0x135169(0x1da)],'sqlName':_0x1007d3[_0x135169(0x1ec)],'dbId':_0x1007d3['dbId']},ensureRemoteSqlContent(_0x1007d3),{'dbName':_0x159b29,'mode':_0x1ed436,'syncedAt':new Date()[_0x135169(0x1d7)](),'description':_0x1007d3[_0x135169(0x1df)]}),_0x97cce4=resolveLocalSqlFilePath(_0x1cace1,_0x1007d3[_0x135169(0x1da)],buildSqlLockEntry(_0x1007d3,ensureRemoteSqlContent(_0x1007d3),'',{'dbName':_0x159b29}));if(await fileExists(_0x97cce4)){const _0x1695f1=await readFile(_0x97cce4,'utf8');if(!isEquivalentPulledSqlFile(_0x1695f1,_0x134120,_0x1ed436)){_0xd7b443=!![];break;}}}if(_0xd7b443){const _0x46bb1e=await confirmForceOverwrite(_0x135169(0x1ef));if(!_0x46bb1e)throw CliErrors[_0x135169(0x1fd)](_0x135169(0x1fa));}}const _0x4487ac=cloneSqlLockData(_0x3f327e),_0x3a1d6d=_0x4487ac[_0x135169(0x1cf)][_0x1cace1[_0x135169(0x1e4)]],_0x32effb=[],_0x1c2796=[];for(const _0x23088f of _0x1b65b6){const _0x275f2a=_0x3a1d6d[_0x135169(0x1db)][_0x23088f[_0x135169(0x1da)]],_0x314752=ensureRemoteSqlContent(_0x23088f),_0x1d3870=detectModeFromSql(_0x23088f),_0x26d90e=_0x23088f['dbId']?await getDbName(_0x584d29[_0x135169(0x1e4)],Number(_0x23088f[_0x135169(0x1ea)]))['catch'](()=>undefined):undefined,_0x50b9d8=buildLocalSqlFileContent({'sqlCode':_0x23088f['sqlCode'],'sqlName':_0x23088f['sqlName'],'dbId':_0x23088f['dbId']},_0x314752,{'dbName':_0x26d90e,'mode':_0x1d3870,'syncedAt':new Date()[_0x135169(0x1d7)](),'description':_0x23088f[_0x135169(0x1df)]}),_0x350120=buildSqlLockEntry(_0x23088f,_0x314752,computeSqlContentHash(_0x50b9d8),{'dbName':_0x26d90e}),_0x43fc13=_0x350120[_0x135169(0x1cc)],_0x80f10e=join(_0x1cace1[_0x135169(0x1d0)],_0x43fc13);try{if(await fileExists(_0x80f10e)){const _0x124f51=await readFile(_0x80f10e,'utf8');if(isEquivalentPulledSqlFile(_0x124f51,_0x50b9d8,_0x1d3870)){_0x1c2796['push']({'sqlCode':_0x23088f['sqlCode'],'reason':'unchanged'}),_0x3a1d6d[_0x135169(0x1db)][_0x23088f[_0x135169(0x1da)]]={..._0x350120,'hash':computeSqlContentHash(_0x124f51),'path':_0x43fc13};continue;}if(!_0x46e3ca){_0x1c2796['push']({'sqlCode':_0x23088f[_0x135169(0x1da)],'reason':_0x135169(0x201)});continue;}}const _0x4947af=_0x275f2a?.['path']?join(_0x1cace1[_0x135169(0x1d0)],_0x275f2a[_0x135169(0x1cc)]):undefined;_0x4947af&&_0x4947af!==_0x80f10e&&await fileExists(_0x4947af)&&await rm(_0x4947af,{'force':!![]}),await ensureParentDirectory(_0x80f10e),await writeFile(_0x80f10e,_0x50b9d8,_0x135169(0x1d2)),_0x3a1d6d[_0x135169(0x1db)][_0x23088f[_0x135169(0x1da)]]={..._0x350120,'path':_0x43fc13},_0x32effb[_0x135169(0x1e1)]({'sqlCode':_0x23088f[_0x135169(0x1da)],'filePath':_0x80f10e});}catch(_0x586313){_0x3d6e63['push']({'sqlCode':_0x23088f['sqlCode'],'error':_0x586313 instanceof Error?_0x586313[_0x135169(0x1d6)]:String(_0x586313)});}}return _0x3a1d6d[_0x135169(0x1e7)]=new Date()[_0x135169(0x1d7)](),await writeSqlLockFile(_0x1cace1[_0x135169(0x1fc)],_0x4487ac),{'ok':_0x3d6e63['length']===0x0,'data':{'pulled':_0x32effb,'skipped':_0x1c2796,'failed':_0x3d6e63},'message':'Pull\x20complete:\x20'+_0x32effb[_0x135169(0x1fb)]+_0x135169(0x200)+_0x1c2796[_0x135169(0x1fb)]+'\x20skipped,\x20'+_0x3d6e63['length']+'\x20failed'};}};function detectModeFromSql(_0xe1e4af){const _0x72b6a4=a156_0x3c5819,_0x2fb697=ensureRemoteSqlContent(_0xe1e4af),_0x22ea1d=stripLocalSqlMetadata(_0x2fb697,_0x72b6a4(0x1de))[_0x72b6a4(0x1f3)]();if(/^<(select|insert|update|delete)\b/i[_0x72b6a4(0x1eb)](_0x22ea1d))return _0x72b6a4(0x1de);return _0x72b6a4(0x1e0);}function isEquivalentPulledSqlFile(_0x192d31,_0x28d25f,_0x11e50e){return normalizePullComparableContent(_0x192d31,_0x11e50e)===normalizePullComparableContent(_0x28d25f,_0x11e50e);}function normalizePullComparableContent(_0xd60c24,_0x3dd52a){const _0x24532b=a156_0x3c5819,_0x38e2ea=_0xd60c24[_0x24532b(0x1cb)](/\r\n/g,'\x0a')['split']('\x0a'),_0xf71e49=_0x38e2ea[_0x24532b(0x1d5)](_0x2c0f2=>!isSyncedAtMetadataLine(_0x2c0f2,_0x3dd52a));return _0xf71e49['join']('\x0a');}function isSyncedAtMetadataLine(_0x156da5,_0x3781d4){const _0x326488=a156_0x3c5819;if(_0x3781d4===_0x326488(0x1de))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x156da5);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x326488(0x1eb)](_0x156da5);}
|
|
1
|
+
function a160_0x447e(_0x6c9441,_0x6ef2a1){_0x6c9441=_0x6c9441-0xa4;const _0x2f5c49=a160_0x2f5c();let _0x447ee3=_0x2f5c49[_0x6c9441];return _0x447ee3;}const a160_0x537a4=a160_0x447e;(function(_0x1d085b,_0xfa8a3d){const _0x5d7956=a160_0x447e,_0x23f542=_0x1d085b();while(!![]){try{const _0xef4a72=-parseInt(_0x5d7956(0xa6))/0x1+-parseInt(_0x5d7956(0xb8))/0x2+parseInt(_0x5d7956(0xaf))/0x3+-parseInt(_0x5d7956(0xb9))/0x4+parseInt(_0x5d7956(0xae))/0x5+-parseInt(_0x5d7956(0xd2))/0x6*(-parseInt(_0x5d7956(0xd4))/0x7)+parseInt(_0x5d7956(0xd0))/0x8;if(_0xef4a72===_0xfa8a3d)break;else _0x23f542['push'](_0x23f542['shift']());}catch(_0x1ae473){_0x23f542['push'](_0x23f542['shift']());}}}(a160_0x2f5c,0xef095));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x50cf63,_0x3ddece){const _0x3024e9=a160_0x447e,_0x1199cc=[];let _0x30e4ea=0x1;while(!![]){const _0x169d00=await listSqlQueries(_0x50cf63,{'currentPage':_0x30e4ea,'pageSize':PAGE_SIZE,'sqlCode':_0x3ddece[_0x3024e9(0xb2)],'sqlName':_0x3ddece[_0x3024e9(0xc1)]}),_0x29b061=_0x169d00[_0x3024e9(0xd9)]??[];_0x1199cc[_0x3024e9(0xdb)](..._0x29b061);if(_0x29b061[_0x3024e9(0xd7)]===0x0)break;const _0x2786f6=_0x169d00['paging']?.[_0x3024e9(0xc9)];if(_0x2786f6!=null?_0x1199cc['length']>=_0x2786f6:_0x29b061[_0x3024e9(0xd7)]<PAGE_SIZE)break;_0x30e4ea++;}return _0x1199cc;}async function ensureSqlContent(_0x388a6a){const _0x19f7cc=a160_0x447e;if(_0x388a6a[_0x19f7cc(0xbf)]!=null&&String(_0x388a6a[_0x19f7cc(0xbf)])[_0x19f7cc(0xd7)]>0x0)return _0x388a6a;return getSqlQueryDetail(_0x388a6a[_0x19f7cc(0xb2)]);}export const sqlPull={'service':a160_0x537a4(0xc8),'command':a160_0x537a4(0xad),'description':a160_0x537a4(0xbe),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a160_0x537a4(0xb1),'type':a160_0x537a4(0xc7),'description':a160_0x537a4(0xab)},{'name':'force','type':a160_0x537a4(0xdc),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x10110f){const _0x4cd0ee=a160_0x537a4,_0x525c42=loadSqlProjectConfig(_0x10110f['appCode']),_0x34d5b7=await readSqlLockFile(_0x525c42[_0x4cd0ee(0xa8)]),{appLock:_0x438a75}=ensureSqlLockScope(_0x34d5b7??createEmptySqlLock(),_0x525c42[_0x4cd0ee(0xdd)],_0x525c42[_0x4cd0ee(0xa4)],_0x4cd0ee(0xad)),_0x490dcc=await fetchAllSqlQueries(_0x10110f[_0x4cd0ee(0xdd)],{'sqlCode':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xc3))||undefined,'sqlName':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xb1))||undefined}),_0x36e343=[];for(const _0x559e1c of _0x490dcc){const _0x4d5650=await ensureSqlContent(_0x559e1c),_0x16f177=ensureRemoteSqlContent(_0x4d5650),_0x3d32cf=detectModeFromSql(_0x4d5650),_0x55e48d=_0x4d5650[_0x4cd0ee(0xda)]?await getDbName(_0x10110f[_0x4cd0ee(0xdd)],Number(_0x4d5650[_0x4cd0ee(0xda)]))['catch'](()=>undefined):undefined,_0x1e5866=buildLocalSqlFileContent({'sqlCode':_0x4d5650['sqlCode'],'sqlName':_0x4d5650[_0x4cd0ee(0xc1)],'dbId':_0x4d5650[_0x4cd0ee(0xda)]},_0x16f177,{'dbName':_0x55e48d,'mode':_0x3d32cf,'syncedAt':new Date()[_0x4cd0ee(0xc0)](),'description':_0x4d5650[_0x4cd0ee(0xb5)]}),_0x88e7e9=buildSqlLockEntry(_0x4d5650,_0x16f177,'',{'dbName':_0x55e48d}),_0x524eb1=resolveLocalSqlFilePath(_0x525c42,_0x4d5650[_0x4cd0ee(0xb2)],_0x88e7e9);let _0x4aff64=_0x4cd0ee(0xa5),_0x37fed5;if(await fileExists(_0x524eb1)){const _0x18aa69=await readFile(_0x524eb1,_0x4cd0ee(0xca));isEquivalentPulledSqlFile(_0x18aa69,_0x1e5866,_0x3d32cf)?(_0x4aff64='skipped',_0x37fed5='unchanged'):(_0x4aff64=_0x4cd0ee(0xb6),_0x37fed5=_0x4cd0ee(0xb3));}_0x36e343[_0x4cd0ee(0xdb)]({'sqlCode':_0x4d5650[_0x4cd0ee(0xb2)],'sqlName':_0x4d5650[_0x4cd0ee(0xc1)],'filePath':_0x524eb1,'status':_0x4aff64,'reason':_0x37fed5});}return{'method':_0x4cd0ee(0xac),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x10110f[_0x4cd0ee(0xdd)],'sqlCode':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xc3))||null,'sqlName':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xb1))||null,'files':_0x36e343},'description':_0x4cd0ee(0xba)+_0x36e343[_0x4cd0ee(0xd7)]+_0x4cd0ee(0xcc)+_0x525c42[_0x4cd0ee(0xa7)]};},async 'execute'(_0x506607){const _0x4f9ccb=a160_0x537a4,_0x5a9f9f=loadSqlProjectConfig(_0x506607[_0x4f9ccb(0xdd)]),_0x1608a8=await readSqlLockFile(_0x5a9f9f[_0x4f9ccb(0xa8)]),{lockData:_0x132acc,appLock:_0x368c55}=ensureSqlLockScope(_0x1608a8??createEmptySqlLock(),_0x5a9f9f[_0x4f9ccb(0xdd)],_0x5a9f9f[_0x4f9ccb(0xa4)],_0x4f9ccb(0xad)),_0x26a74a=_0x506607[_0x4f9ccb(0xb4)](_0x4f9ccb(0xb7)),_0x2d50d9=await fetchAllSqlQueries(_0x506607[_0x4f9ccb(0xdd)],{'sqlCode':_0x506607['str'](_0x4f9ccb(0xc3))||undefined,'sqlName':_0x506607[_0x4f9ccb(0xbd)](_0x4f9ccb(0xb1))||undefined});if(_0x2d50d9[_0x4f9ccb(0xd7)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4f9ccb(0xc5)};const _0x228164=[],_0xd729cf=[];for(const _0x399cc3 of _0x2d50d9){try{_0x228164[_0x4f9ccb(0xdb)](await ensureSqlContent(_0x399cc3));}catch(_0x4a4aa6){_0xd729cf['push']({'sqlCode':_0x399cc3['sqlCode'],'error':_0x4a4aa6 instanceof Error?_0x4a4aa6[_0x4f9ccb(0xaa)]:String(_0x4a4aa6)});}}if(_0x26a74a&&!_0x506607['nonInteractive']){let _0x18ad29=![];for(const _0x401f93 of _0x228164){const _0x28c45a=detectModeFromSql(_0x401f93),_0x979ab7=_0x401f93[_0x4f9ccb(0xda)]?await getDbName(_0x506607[_0x4f9ccb(0xdd)],Number(_0x401f93['dbId']))[_0x4f9ccb(0xde)](()=>undefined):undefined,_0x287c9d=buildLocalSqlFileContent({'sqlCode':_0x401f93['sqlCode'],'sqlName':_0x401f93['sqlName'],'dbId':_0x401f93[_0x4f9ccb(0xda)]},ensureRemoteSqlContent(_0x401f93),{'dbName':_0x979ab7,'mode':_0x28c45a,'syncedAt':new Date()[_0x4f9ccb(0xc0)](),'description':_0x401f93['description']}),_0x536e9d=resolveLocalSqlFilePath(_0x5a9f9f,_0x401f93[_0x4f9ccb(0xb2)],buildSqlLockEntry(_0x401f93,ensureRemoteSqlContent(_0x401f93),'',{'dbName':_0x979ab7}));if(await fileExists(_0x536e9d)){const _0x29c630=await readFile(_0x536e9d,_0x4f9ccb(0xca));if(!isEquivalentPulledSqlFile(_0x29c630,_0x287c9d,_0x28c45a)){_0x18ad29=!![];break;}}}if(_0x18ad29){const _0x366e6b=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x366e6b)throw CliErrors['cancelled'](_0x4f9ccb(0xcb));}}const _0x162691=cloneSqlLockData(_0x132acc),_0x5043a1=_0x162691[_0x4f9ccb(0xd6)][_0x5a9f9f[_0x4f9ccb(0xdd)]],_0x127c2b=[],_0x717e72=[];for(const _0x1fe994 of _0x228164){const _0x23a430=_0x5043a1[_0x4f9ccb(0xce)][_0x1fe994['sqlCode']],_0x10a2fd=ensureRemoteSqlContent(_0x1fe994),_0x4ff51a=detectModeFromSql(_0x1fe994),_0x2a0b78=_0x1fe994['dbId']?await getDbName(_0x506607['appCode'],Number(_0x1fe994[_0x4f9ccb(0xda)]))[_0x4f9ccb(0xde)](()=>undefined):undefined,_0x2c8d19=buildLocalSqlFileContent({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'sqlName':_0x1fe994[_0x4f9ccb(0xc1)],'dbId':_0x1fe994[_0x4f9ccb(0xda)]},_0x10a2fd,{'dbName':_0x2a0b78,'mode':_0x4ff51a,'syncedAt':new Date()['toISOString'](),'description':_0x1fe994[_0x4f9ccb(0xb5)]}),_0x2e9e0b=buildSqlLockEntry(_0x1fe994,_0x10a2fd,computeSqlContentHash(_0x2c8d19),{'dbName':_0x2a0b78}),_0x75fdbd=_0x2e9e0b[_0x4f9ccb(0xc6)],_0x27c0a8=join(_0x5a9f9f[_0x4f9ccb(0xa7)],_0x75fdbd);try{if(await fileExists(_0x27c0a8)){const _0x57a39c=await readFile(_0x27c0a8,_0x4f9ccb(0xca));if(isEquivalentPulledSqlFile(_0x57a39c,_0x2c8d19,_0x4ff51a)){_0x717e72['push']({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'reason':_0x4f9ccb(0xcf)}),_0x5043a1[_0x4f9ccb(0xce)][_0x1fe994['sqlCode']]={..._0x2e9e0b,'hash':computeSqlContentHash(_0x57a39c),'path':_0x75fdbd};continue;}if(!_0x26a74a){_0x717e72[_0x4f9ccb(0xdb)]({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'reason':_0x4f9ccb(0xc4)});continue;}}const _0x55396a=_0x23a430?.[_0x4f9ccb(0xc6)]?join(_0x5a9f9f[_0x4f9ccb(0xa7)],_0x23a430[_0x4f9ccb(0xc6)]):undefined;_0x55396a&&_0x55396a!==_0x27c0a8&&await fileExists(_0x55396a)&&await rm(_0x55396a,{'force':!![]}),await ensureParentDirectory(_0x27c0a8),await writeFile(_0x27c0a8,_0x2c8d19,'utf8'),_0x5043a1[_0x4f9ccb(0xce)][_0x1fe994[_0x4f9ccb(0xb2)]]={..._0x2e9e0b,'path':_0x75fdbd},_0x127c2b[_0x4f9ccb(0xdb)]({'sqlCode':_0x1fe994['sqlCode'],'filePath':_0x27c0a8});}catch(_0x2b2193){_0xd729cf[_0x4f9ccb(0xdb)]({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'error':_0x2b2193 instanceof Error?_0x2b2193[_0x4f9ccb(0xaa)]:String(_0x2b2193)});}}return _0x5043a1[_0x4f9ccb(0xd3)]=new Date()[_0x4f9ccb(0xc0)](),await writeSqlLockFile(_0x5a9f9f['lockFilePath'],_0x162691),{'ok':_0xd729cf['length']===0x0,'data':{'pulled':_0x127c2b,'skipped':_0x717e72,'failed':_0xd729cf},'message':_0x4f9ccb(0xb0)+_0x127c2b[_0x4f9ccb(0xd7)]+_0x4f9ccb(0xbc)+_0x717e72[_0x4f9ccb(0xd7)]+_0x4f9ccb(0xbb)+_0xd729cf[_0x4f9ccb(0xd7)]+'\x20failed'};}};function detectModeFromSql(_0x757116){const _0x3744ce=a160_0x537a4,_0x2f46d7=ensureRemoteSqlContent(_0x757116),_0x49b030=stripLocalSqlMetadata(_0x2f46d7,_0x3744ce(0xc2))[_0x3744ce(0xd5)]();if(/^<(select|insert|update|delete)\b/i[_0x3744ce(0xa9)](_0x49b030))return _0x3744ce(0xc2);return _0x3744ce(0xc8);}function isEquivalentPulledSqlFile(_0x3c0b87,_0x558ec3,_0x1779cc){return normalizePullComparableContent(_0x3c0b87,_0x1779cc)===normalizePullComparableContent(_0x558ec3,_0x1779cc);}function a160_0x2f5c(){const _0x20047d=['appCode','catch','sqlRoot','would_pull','893077UqhwVb','sqlRootDir','lockFilePath','test','message','Filter\x20by\x20SQL\x20display\x20name','POST','pull','4066750LyZaMN','2393337QYILGf','Pull\x20complete:\x20','name','sqlCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','bool','description','conflict','force','2440762iLPduJ','2423164zdvemd','Would\x20pull\x20','\x20skipped,\x20','\x20written,\x20','str','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlContent','toISOString','sqlName','mybatisXml','sqlcode','local\x20differs\x20from\x20remote','No\x20remote\x20SQL\x20queries\x20matched.','path','string','sql','totalCount','utf8','Force\x20pull\x20cancelled.','\x20SQL\x20file(s)\x20into\x20','split','sqls','unchanged','2860496BSnqIV','filter','462FFFmEu','lastSync','157241bLUnRF','trimStart','apps','length','join','tableData','dbId','push','boolean'];a160_0x2f5c=function(){return _0x20047d;};return a160_0x2f5c();}function normalizePullComparableContent(_0x2259a4,_0x19f453){const _0x517f83=a160_0x537a4,_0x5b280f=_0x2259a4['replace'](/\r\n/g,'\x0a')[_0x517f83(0xcd)]('\x0a'),_0x53519f=_0x5b280f[_0x517f83(0xd1)](_0x1b54f2=>!isSyncedAtMetadataLine(_0x1b54f2,_0x19f453));return _0x53519f[_0x517f83(0xd8)]('\x0a');}function isSyncedAtMetadataLine(_0x82ee15,_0x5e039c){const _0x5567d8=a160_0x537a4;if(_0x5e039c===_0x5567d8(0xc2))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x82ee15);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x5567d8(0xa9)](_0x82ee15);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a157_0x56aecf=a157_0x5cbd;(function(_0x40b394,_0xc0ea85){const _0x2ebd98=a157_0x5cbd,_0x20ac40=_0x40b394();while(!![]){try{const _0x4a75b4=parseInt(_0x2ebd98(0x20f))/0x1+-parseInt(_0x2ebd98(0x213))/0x2+-parseInt(_0x2ebd98(0x1fa))/0x3*(parseInt(_0x2ebd98(0x1ec))/0x4)+parseInt(_0x2ebd98(0x212))/0x5*(-parseInt(_0x2ebd98(0x1fb))/0x6)+parseInt(_0x2ebd98(0x216))/0x7*(-parseInt(_0x2ebd98(0x1ea))/0x8)+parseInt(_0x2ebd98(0x1e0))/0x9+-parseInt(_0x2ebd98(0x1f6))/0xa*(-parseInt(_0x2ebd98(0x1e4))/0xb);if(_0x4a75b4===_0xc0ea85)break;else _0x20ac40['push'](_0x20ac40['shift']());}catch(_0x18568c){_0x20ac40['push'](_0x20ac40['shift']());}}}(a157_0x2389,0x20236));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';function a157_0x5cbd(_0x40ff17,_0x250070){_0x40ff17=_0x40ff17-0x1de;const _0x238913=a157_0x2389();let _0x5cbde3=_0x238913[_0x40ff17];return _0x5cbde3;}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(_0xce3a56,_0x33d505,_0x15f998){const _0xe8132c=a157_0x5cbd,_0x41a9af=await scanLocalSqlQueries(_0xce3a56),_0x3a2b37=new Map();for(const _0x513815 of _0x41a9af){if(_0x15f998&&_0x513815['sqlCode']!==_0x15f998)continue;const _0x16cd93=_0x3a2b37[_0xe8132c(0x202)](_0x513815[_0xe8132c(0x1f0)])??[];_0x16cd93[_0xe8132c(0x1ed)](_0x513815),_0x3a2b37['set'](_0x513815[_0xe8132c(0x1f0)],_0x16cd93);}if(_0x15f998&&!_0x3a2b37[_0xe8132c(0x20d)](_0x15f998))throw CliErrors[_0xe8132c(0x1f3)]('Local\x20SQL\x20not\x20found:\x20'+_0x15f998);const _0x32298d=[];for(const [_0x13153f,_0x48f35b]of _0x3a2b37['entries']()){if(_0x48f35b[_0xe8132c(0x219)]===0x1){_0x32298d['push'](_0x48f35b[0x0]);continue;}const _0x285978=_0x33d505[_0xe8132c(0x203)][_0x13153f],_0x2f28f2=_0x285978?.[_0xe8132c(0x210)],_0x429421=_0x2f28f2?_0x48f35b[_0xe8132c(0x20b)](_0xbd7961=>_0xbd7961['relativePath']!==_0x2f28f2):_0x48f35b;if(_0x285978&&_0x429421['length']===0x1){_0x32298d[_0xe8132c(0x1ed)](_0x429421[0x0]);continue;}throw CliErrors[_0xe8132c(0x1f3)](_0xe8132c(0x1e5)+_0x13153f+_0xe8132c(0x1de));}return _0x32298d;}function a157_0x2389(){const _0x4b3227=['version','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','20qIRWRb','filePath','lockFilePath','sqlName','123TCFOaj','1098KapPCg','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','POST','sqlConfig','\x22\x20for\x20sqlCode\x20','Would\x20push\x20','str','get','sqls','bool','sqlcode','map','dbId','appCode','force','relativePath','filter','trashDir','has','Local\x20directory\x20\x22','208080HjRfsx','path','Push\x20complete:\x20','1095XvKrcB','407616aNPVfY','utf8','unchanged','1587362GokHlB','No\x20database\x20matches\x20local\x20directory\x20\x22','hash','length','sqlRoot','join','\x20failed','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','message','711270GaPNGm','catch','toISOString','remoteId','2940135XkJtNk','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','dbDirectory','dbName','high-risk-write','8zlPzni','\x20SQL\x20file(s)','21404qbOAZK','push','mode','isFinite','sqlCode','sqlRootDir','No\x20local\x20SQL\x20files\x20found.','validation'];a157_0x2389=function(){return _0x4b3227;};return a157_0x2389();}export const sqlPush={'service':'sql','command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a157_0x56aecf(0x1e9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a157_0x56aecf(0x209),'type':'boolean','description':a157_0x56aecf(0x1f5)}],async 'dryRun'(_0x5edde3){const _0x1eedd8=a157_0x56aecf,_0x57c869=loadSqlProjectConfig(_0x5edde3[_0x1eedd8(0x208)]),_0x1f8ac8=await readSqlLockFile(_0x57c869['lockFilePath']),{appLock:_0x50e948}=ensureSqlLockScope(_0x1f8ac8??createEmptySqlLock(),_0x5edde3[_0x1eedd8(0x208)],_0x57c869['sqlRoot'],'push'),_0x4a7aee=await getTargetSqlQueries(_0x57c869,_0x50e948,_0x5edde3[_0x1eedd8(0x201)](_0x1eedd8(0x205))||undefined),_0x24ddd8=[];for(const _0x3df94b of _0x4a7aee){const _0x193ca9=await computeSqlFileHash(_0x3df94b[_0x1eedd8(0x1f7)]),_0x3f1b7b=_0x50e948[_0x1eedd8(0x203)][_0x3df94b['sqlCode']],_0x20af68=!!_0x3f1b7b&&(_0x3f1b7b[_0x1eedd8(0x210)]!==_0x3df94b[_0x1eedd8(0x20a)]||!!_0x3df94b['sqlName']&&_0x3f1b7b['sqlName']!==_0x3df94b[_0x1eedd8(0x1f9)]);if(!_0x5edde3['bool'](_0x1eedd8(0x209))&&_0x3f1b7b&&_0x3f1b7b[_0x1eedd8(0x218)]===_0x193ca9&&!_0x20af68)continue;_0x24ddd8[_0x1eedd8(0x1ed)](_0x3df94b[_0x1eedd8(0x1f0)]);}return{'method':_0x1eedd8(0x1fd),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x24ddd8,'appCode':_0x5edde3[_0x1eedd8(0x208)]},'description':_0x1eedd8(0x200)+_0x24ddd8[_0x1eedd8(0x219)]+_0x1eedd8(0x1eb)};},async 'execute'(_0x488fd7){const _0x2b5c2b=a157_0x56aecf,_0xc39d10=loadSqlProjectConfig(_0x488fd7[_0x2b5c2b(0x208)]),_0x5aef8b=await readSqlLockFile(_0xc39d10[_0x2b5c2b(0x1f8)]),{lockData:_0x423d35,appLock:_0x2af636}=ensureSqlLockScope(_0x5aef8b??createEmptySqlLock(),_0x488fd7[_0x2b5c2b(0x208)],_0xc39d10[_0x2b5c2b(0x21a)],_0x2b5c2b(0x1ed)),_0x5aed48=await getTargetSqlQueries(_0xc39d10,_0x2af636,_0x488fd7['str'](_0x2b5c2b(0x205))||undefined);if(_0x5aed48[_0x2b5c2b(0x219)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2b5c2b(0x1f2)};const _0x4bd865=[],_0x57de41=[],_0x2f8167=[];for(const _0x42b5dd of _0x5aed48){const _0x47528b=_0x2af636[_0x2b5c2b(0x203)][_0x42b5dd['sqlCode']];if(!_0x47528b){_0x2f8167[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x367cdc=await computeSqlFileHash(_0x42b5dd['filePath']),_0x4c4717=_0x47528b[_0x2b5c2b(0x210)]!==_0x42b5dd[_0x2b5c2b(0x20a)]||!!_0x42b5dd[_0x2b5c2b(0x1f9)]&&_0x47528b[_0x2b5c2b(0x1f9)]!==_0x42b5dd[_0x2b5c2b(0x1f9)];if(!_0x488fd7[_0x2b5c2b(0x204)](_0x2b5c2b(0x209))&&_0x47528b[_0x2b5c2b(0x218)]===_0x367cdc&&!_0x4c4717){_0x57de41[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'reason':_0x2b5c2b(0x215)});continue;}if(_0x47528b[_0x2b5c2b(0x1f4)]==null){_0x2f8167[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'error':_0x2b5c2b(0x1e6)});continue;}const _0xfa3cf4=await readFile(_0x42b5dd[_0x2b5c2b(0x1f7)],_0x2b5c2b(0x214)),_0x2b24b1=stripLocalSqlMetadata(_0xfa3cf4,_0x42b5dd[_0x2b5c2b(0x1ee)]),_0xe64964=_0x42b5dd[_0x2b5c2b(0x1f9)]||_0x47528b[_0x2b5c2b(0x1f9)],_0xdc586=await resolveTargetDbBinding(_0x488fd7['appCode'],_0x42b5dd,_0x47528b),_0x46a0f3=await updateSqlQuery({'id':_0x47528b[_0x2b5c2b(0x1e3)],'appCode':_0x488fd7[_0x2b5c2b(0x208)],'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'sqlName':_0xe64964,'dbId':_0xdc586[_0x2b5c2b(0x207)],'version':_0x47528b[_0x2b5c2b(0x1f4)],'sqlContent':_0x2b24b1,'sqlConfig':_0x47528b[_0x2b5c2b(0x1fe)]??undefined}),_0x4fa353=_0x46a0f3['dbId']?await getDbName(_0x488fd7[_0x2b5c2b(0x208)],Number(_0x46a0f3[_0x2b5c2b(0x207)]))[_0x2b5c2b(0x1e1)](()=>_0xdc586[_0x2b5c2b(0x1e8)]):_0xdc586['dbName'];_0x2af636[_0x2b5c2b(0x203)][_0x42b5dd[_0x2b5c2b(0x1f0)]]={...buildSqlLockEntry(_0x46a0f3,_0x2b24b1,_0x367cdc,{'dbName':_0x4fa353}),'path':_0x42b5dd[_0x2b5c2b(0x20a)],'mode':_0x47528b['mode']},await archivePreviousSqlFileIfNeeded(_0xc39d10,_0x47528b[_0x2b5c2b(0x210)],_0x42b5dd['relativePath']),_0x4bd865[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'remoteId':_0x47528b['remoteId']});}catch(_0x1a2f57){_0x2f8167[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'error':_0x1a2f57 instanceof Error?_0x1a2f57[_0x2b5c2b(0x1df)]:String(_0x1a2f57)});}}return _0x2af636['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0xc39d10[_0x2b5c2b(0x1f8)],_0x423d35),{'ok':_0x2f8167[_0x2b5c2b(0x219)]===0x0,'data':{'pushed':_0x4bd865,'skipped':_0x57de41,'failed':_0x2f8167},'message':_0x2b5c2b(0x211)+_0x4bd865[_0x2b5c2b(0x219)]+'\x20pushed,\x20'+_0x57de41[_0x2b5c2b(0x219)]+'\x20skipped,\x20'+_0x2f8167['length']+_0x2b5c2b(0x21c)};}};async function archivePreviousSqlFileIfNeeded(_0x5a75ba,_0x451885,_0x5cca12){const _0xcb273b=a157_0x56aecf;if(!_0x451885||_0x451885===_0x5cca12)return;const _0x2f69a3=join(_0x5a75ba[_0xcb273b(0x1f1)],_0x451885);if(!await fileExists(_0x2f69a3))return;const _0x3b21cb=await moveToTrash(_0x5a75ba['projectRoot'],_0x5a75ba[_0xcb273b(0x20c)],_0x2f69a3);await cleanupEmptyDirectories(dirname(_0x2f69a3),_0x5a75ba[_0xcb273b(0x1f1)]),void _0x3b21cb;}async function moveToTrash(_0x5be437,_0x4ec202,_0x1e8ed7){const _0x563556=a157_0x56aecf,_0x148f65=new Date()[_0x563556(0x1e2)]()['replace'](/[:.]/g,'-'),_0x4eb31d=relative(_0x5be437,_0x1e8ed7),_0x574865=join(_0x4ec202,_0x148f65,_0x4eb31d);return await mkdir(dirname(_0x574865),{'recursive':!![]}),await rename(_0x1e8ed7,_0x574865),_0x574865;}async function cleanupEmptyDirectories(_0x1b6319,_0x11aa82){const _0xd4636a=a157_0x56aecf;let _0x4203dc=resolve(_0x1b6319);const _0x3fcff1=resolve(_0x11aa82);while(_0x4203dc['startsWith'](''+_0x3fcff1+sep)||_0x4203dc===_0x3fcff1){if(_0x4203dc===_0x3fcff1)return;try{const _0x44b5ac=await readdir(_0x4203dc);if(_0x44b5ac[_0xd4636a(0x219)]>0x0)return;await rmdir(_0x4203dc);}catch{return;}_0x4203dc=dirname(_0x4203dc);}}async function resolveTargetDbBinding(_0x4a4c8c,_0x1995a6,_0x3caabf){const _0xa21b76=a157_0x56aecf,_0x5b0df3=_0x1995a6[_0xa21b76(0x1e7)];if(!_0x5b0df3)return{'dbId':_0x3caabf[_0xa21b76(0x207)],'dbName':_0x3caabf[_0xa21b76(0x1e8)]};const _0x4e67f6=buildDbDirectoryName(_0x3caabf[_0xa21b76(0x1e8)],_0x3caabf['dbId']);if(_0x5b0df3===_0x4e67f6)return{'dbId':_0x3caabf[_0xa21b76(0x207)],'dbName':_0x3caabf[_0xa21b76(0x1e8)]};const _0x4225a9=parseExplicitDbDirectory(_0x5b0df3);if(_0x4225a9!=null)return{'dbId':_0x4225a9,'dbName':await getDbName(_0x4a4c8c,_0x4225a9)['catch'](()=>undefined)};const _0x1f869e=await listDatabases(_0x4a4c8c),_0x13dcb7=_0x1f869e['filter'](_0x132830=>buildDbDirectoryName(_0x132830['dbName'],_0x132830[_0xa21b76(0x207)])===_0x5b0df3);if(_0x13dcb7[_0xa21b76(0x219)]===0x1)return{'dbId':_0x13dcb7[0x0]['dbId'],'dbName':_0x13dcb7[0x0]['dbName']};if(_0x13dcb7[_0xa21b76(0x219)]===0x0)throw CliErrors[_0xa21b76(0x1f3)](_0xa21b76(0x217)+_0x5b0df3+_0xa21b76(0x1ff)+_0x1995a6['sqlCode']+'.');const _0x215c04=_0x13dcb7[_0xa21b76(0x206)](_0x5483ec=>_0x5483ec[_0xa21b76(0x1e8)]+'\x20('+_0x5483ec[_0xa21b76(0x207)]+')')[_0xa21b76(0x21b)](',\x20');throw CliErrors[_0xa21b76(0x1f3)](_0xa21b76(0x20e)+_0x5b0df3+_0xa21b76(0x1fc)+_0x1995a6[_0xa21b76(0x1f0)]+':\x20'+_0x215c04);}function parseExplicitDbDirectory(_0x458c51){const _0x2346e3=a157_0x56aecf,_0x1c509c=/^db-(\d+)$/['exec'](_0x458c51);if(!_0x1c509c)return null;const _0x8d8cfa=Number(_0x1c509c[0x1]);return Number[_0x2346e3(0x1ef)](_0x8d8cfa)&&_0x8d8cfa>0x0?_0x8d8cfa:null;}
|
|
1
|
+
const a161_0x428e6a=a161_0x73b8;(function(_0x292c80,_0x5ead11){const _0x476fc9=a161_0x73b8,_0x4a0ce=_0x292c80();while(!![]){try{const _0x43ad55=parseInt(_0x476fc9(0xe9))/0x1+parseInt(_0x476fc9(0xfc))/0x2+parseInt(_0x476fc9(0xd2))/0x3*(parseInt(_0x476fc9(0xf0))/0x4)+-parseInt(_0x476fc9(0x10c))/0x5+-parseInt(_0x476fc9(0x109))/0x6+parseInt(_0x476fc9(0xd5))/0x7*(parseInt(_0x476fc9(0xf5))/0x8)+-parseInt(_0x476fc9(0xd0))/0x9;if(_0x43ad55===_0x5ead11)break;else _0x4a0ce['push'](_0x4a0ce['shift']());}catch(_0x3e9c15){_0x4a0ce['push'](_0x4a0ce['shift']());}}}(a161_0x397e,0x24acb));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x24463a,_0x1f6b57,_0x1e6fff){const _0x1072d0=a161_0x73b8,_0x331005=await scanLocalSqlQueries(_0x24463a),_0x5481c8=new Map();for(const _0x362e86 of _0x331005){if(_0x1e6fff&&_0x362e86[_0x1072d0(0xd1)]!==_0x1e6fff)continue;const _0x494d8d=_0x5481c8[_0x1072d0(0x104)](_0x362e86[_0x1072d0(0xd1)])??[];_0x494d8d[_0x1072d0(0xd8)](_0x362e86),_0x5481c8[_0x1072d0(0x102)](_0x362e86['sqlCode'],_0x494d8d);}if(_0x1e6fff&&!_0x5481c8[_0x1072d0(0xef)](_0x1e6fff))throw CliErrors['validation'](_0x1072d0(0xda)+_0x1e6fff);const _0x6b6de7=[];for(const [_0x34d352,_0x2ed44b]of _0x5481c8['entries']()){if(_0x2ed44b['length']===0x1){_0x6b6de7[_0x1072d0(0xd8)](_0x2ed44b[0x0]);continue;}const _0xa8fe6f=_0x1f6b57[_0x1072d0(0x106)][_0x34d352],_0x585c41=_0xa8fe6f?.[_0x1072d0(0xe6)],_0x45c64e=_0x585c41?_0x2ed44b[_0x1072d0(0xf8)](_0x140e80=>_0x140e80[_0x1072d0(0xf4)]!==_0x585c41):_0x2ed44b;if(_0xa8fe6f&&_0x45c64e['length']===0x1){_0x6b6de7[_0x1072d0(0xd8)](_0x45c64e[0x0]);continue;}throw CliErrors[_0x1072d0(0xe2)](_0x1072d0(0xe8)+_0x34d352+_0x1072d0(0xed));}return _0x6b6de7;}export const sqlPush={'service':'sql','command':a161_0x428e6a(0xd8),'description':a161_0x428e6a(0xfa),'risk':a161_0x428e6a(0xfd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a161_0x428e6a(0xdf),'type':a161_0x428e6a(0xf7),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x401101){const _0x116555=a161_0x428e6a,_0x5e5eb6=loadSqlProjectConfig(_0x401101[_0x116555(0xdc)]),_0x41a3e3=await readSqlLockFile(_0x5e5eb6[_0x116555(0x105)]),{appLock:_0x131822}=ensureSqlLockScope(_0x41a3e3??createEmptySqlLock(),_0x401101[_0x116555(0xdc)],_0x5e5eb6['sqlRoot'],_0x116555(0xd8)),_0x521aca=await getTargetSqlQueries(_0x5e5eb6,_0x131822,_0x401101[_0x116555(0xce)](_0x116555(0xcb))||undefined),_0x15d9f0=[];for(const _0x41558c of _0x521aca){const _0x3e3f7a=await computeSqlFileHash(_0x41558c[_0x116555(0xca)]),_0x5c2489=_0x131822[_0x116555(0x106)][_0x41558c[_0x116555(0xd1)]],_0x2439da=!!_0x5c2489&&(_0x5c2489['path']!==_0x41558c['relativePath']||!!_0x41558c['sqlName']&&_0x5c2489[_0x116555(0xfb)]!==_0x41558c[_0x116555(0xfb)]);if(!_0x401101[_0x116555(0xe1)](_0x116555(0xdf))&&_0x5c2489&&_0x5c2489[_0x116555(0xd7)]===_0x3e3f7a&&!_0x2439da)continue;_0x15d9f0[_0x116555(0xd8)](_0x41558c[_0x116555(0xd1)]);}return{'method':_0x116555(0xd9),'url':_0x116555(0x10a),'body':{'sqlCodes':_0x15d9f0,'appCode':_0x401101['appCode']},'description':_0x116555(0xf9)+_0x15d9f0[_0x116555(0xf3)]+_0x116555(0xcd)};},async 'execute'(_0x3eeaa2){const _0x2706a3=a161_0x428e6a,_0x28d4f8=loadSqlProjectConfig(_0x3eeaa2['appCode']),_0x3d46d8=await readSqlLockFile(_0x28d4f8[_0x2706a3(0x105)]),{lockData:_0x54d934,appLock:_0x326fb4}=ensureSqlLockScope(_0x3d46d8??createEmptySqlLock(),_0x3eeaa2['appCode'],_0x28d4f8[_0x2706a3(0xe0)],_0x2706a3(0xd8)),_0x2146c6=await getTargetSqlQueries(_0x28d4f8,_0x326fb4,_0x3eeaa2['str'](_0x2706a3(0xcb))||undefined);if(_0x2146c6[_0x2706a3(0xf3)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2706a3(0xd3)};const _0x842a15=[],_0x324146=[],_0x2d6449=[];for(const _0x344291 of _0x2146c6){const _0x229f36=_0x326fb4[_0x2706a3(0x106)][_0x344291['sqlCode']];if(!_0x229f36){_0x2d6449['push']({'sqlCode':_0x344291[_0x2706a3(0xd1)],'error':_0x2706a3(0xff)});continue;}try{const _0x46a13e=await computeSqlFileHash(_0x344291[_0x2706a3(0xca)]),_0x45332f=_0x229f36[_0x2706a3(0xe6)]!==_0x344291[_0x2706a3(0xf4)]||!!_0x344291[_0x2706a3(0xfb)]&&_0x229f36[_0x2706a3(0xfb)]!==_0x344291['sqlName'];if(!_0x3eeaa2['bool'](_0x2706a3(0xdf))&&_0x229f36['hash']===_0x46a13e&&!_0x45332f){_0x324146[_0x2706a3(0xd8)]({'sqlCode':_0x344291['sqlCode'],'reason':_0x2706a3(0xee)});continue;}if(_0x229f36[_0x2706a3(0x101)]==null){_0x2d6449[_0x2706a3(0xd8)]({'sqlCode':_0x344291[_0x2706a3(0xd1)],'error':_0x2706a3(0x10d)});continue;}const _0x210d17=await readFile(_0x344291[_0x2706a3(0xca)],'utf8'),_0x5911b9=stripLocalSqlMetadata(_0x210d17,_0x344291['mode']),_0x4ac754=_0x344291[_0x2706a3(0xfb)]||_0x229f36[_0x2706a3(0xfb)],_0x41bee2=await resolveTargetDbBinding(_0x3eeaa2[_0x2706a3(0xdc)],_0x344291,_0x229f36),_0x233c3f=await updateSqlQuery({'id':_0x229f36[_0x2706a3(0xd6)],'appCode':_0x3eeaa2['appCode'],'sqlCode':_0x344291[_0x2706a3(0xd1)],'sqlName':_0x4ac754,'dbId':_0x41bee2[_0x2706a3(0xf2)],'version':_0x229f36['version'],'sqlContent':_0x5911b9,'sqlConfig':_0x229f36[_0x2706a3(0x10b)]??undefined}),_0x11ff48=_0x233c3f['dbId']?await getDbName(_0x3eeaa2[_0x2706a3(0xdc)],Number(_0x233c3f['dbId']))[_0x2706a3(0xe7)](()=>_0x41bee2[_0x2706a3(0xfe)]):_0x41bee2[_0x2706a3(0xfe)];_0x326fb4['sqls'][_0x344291['sqlCode']]={...buildSqlLockEntry(_0x233c3f,_0x5911b9,_0x46a13e,{'dbName':_0x11ff48}),'path':_0x344291['relativePath'],'mode':_0x229f36[_0x2706a3(0xde)]},await archivePreviousSqlFileIfNeeded(_0x28d4f8,_0x229f36[_0x2706a3(0xe6)],_0x344291[_0x2706a3(0xf4)]),_0x842a15[_0x2706a3(0xd8)]({'sqlCode':_0x344291[_0x2706a3(0xd1)],'remoteId':_0x229f36['remoteId']});}catch(_0x4d497c){_0x2d6449[_0x2706a3(0xd8)]({'sqlCode':_0x344291[_0x2706a3(0xd1)],'error':_0x4d497c instanceof Error?_0x4d497c[_0x2706a3(0xeb)]:String(_0x4d497c)});}}return _0x326fb4[_0x2706a3(0x108)]=new Date()[_0x2706a3(0xf6)](),await writeSqlLockFile(_0x28d4f8[_0x2706a3(0x105)],_0x54d934),{'ok':_0x2d6449[_0x2706a3(0xf3)]===0x0,'data':{'pushed':_0x842a15,'skipped':_0x324146,'failed':_0x2d6449},'message':_0x2706a3(0xdb)+_0x842a15[_0x2706a3(0xf3)]+_0x2706a3(0xe5)+_0x324146[_0x2706a3(0xf3)]+_0x2706a3(0xe4)+_0x2d6449[_0x2706a3(0xf3)]+_0x2706a3(0xcf)};}};async function archivePreviousSqlFileIfNeeded(_0xd6882,_0x42b77a,_0x497faa){const _0x58ba52=a161_0x428e6a;if(!_0x42b77a||_0x42b77a===_0x497faa)return;const _0x80f88d=join(_0xd6882[_0x58ba52(0xec)],_0x42b77a);if(!await fileExists(_0x80f88d))return;const _0x23eae6=await moveToTrash(_0xd6882[_0x58ba52(0xdd)],_0xd6882[_0x58ba52(0x103)],_0x80f88d);await cleanupEmptyDirectories(dirname(_0x80f88d),_0xd6882[_0x58ba52(0xec)]),void _0x23eae6;}function a161_0x397e(){const _0xa616c7=['sqlcode','map','\x20SQL\x20file(s)','str','\x20failed','373932NZCAbr','sqlCode','300POxCsJ','No\x20local\x20SQL\x20files\x20found.','\x22\x20for\x20sqlCode\x20','35lwsUNz','remoteId','hash','push','POST','Local\x20SQL\x20not\x20found:\x20','Push\x20complete:\x20','appCode','projectRoot','mode','force','sqlRoot','bool','validation','Local\x20directory\x20\x22','\x20skipped,\x20','\x20pushed,\x20','path','catch','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','291097xIhfdI','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','message','sqlRootDir','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','unchanged','has','4544UXyDJk','exec','dbId','length','relativePath','136ntKMLr','toISOString','boolean','filter','Would\x20push\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlName','48274jmcCOR','high-risk-write','dbName','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','dbDirectory','version','set','trashDir','get','lockFilePath','sqls','isFinite','lastSync','598632YizGAs','/smartapi/custom/updateUserCustomSql','sqlConfig','686900JQgmfG','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','filePath'];a161_0x397e=function(){return _0xa616c7;};return a161_0x397e();}async function moveToTrash(_0x3c450d,_0x73cab1,_0x2f53cc){const _0x4ac236=a161_0x428e6a,_0x3ae4cb=new Date()[_0x4ac236(0xf6)]()['replace'](/[:.]/g,'-'),_0x4cf546=relative(_0x3c450d,_0x2f53cc),_0x2cd00a=join(_0x73cab1,_0x3ae4cb,_0x4cf546);return await mkdir(dirname(_0x2cd00a),{'recursive':!![]}),await rename(_0x2f53cc,_0x2cd00a),_0x2cd00a;}async function cleanupEmptyDirectories(_0x3692be,_0x542ef9){let _0x295b7b=resolve(_0x3692be);const _0x5c835c=resolve(_0x542ef9);while(_0x295b7b['startsWith'](''+_0x5c835c+sep)||_0x295b7b===_0x5c835c){if(_0x295b7b===_0x5c835c)return;try{const _0x8ea353=await readdir(_0x295b7b);if(_0x8ea353['length']>0x0)return;await rmdir(_0x295b7b);}catch{return;}_0x295b7b=dirname(_0x295b7b);}}async function resolveTargetDbBinding(_0x6df8da,_0x3b216a,_0x212407){const _0x5e8b61=a161_0x428e6a,_0x332775=_0x3b216a[_0x5e8b61(0x100)];if(!_0x332775)return{'dbId':_0x212407[_0x5e8b61(0xf2)],'dbName':_0x212407[_0x5e8b61(0xfe)]};const _0x422952=buildDbDirectoryName(_0x212407[_0x5e8b61(0xfe)],_0x212407[_0x5e8b61(0xf2)]);if(_0x332775===_0x422952)return{'dbId':_0x212407[_0x5e8b61(0xf2)],'dbName':_0x212407[_0x5e8b61(0xfe)]};const _0x19f22f=parseExplicitDbDirectory(_0x332775);if(_0x19f22f!=null)return{'dbId':_0x19f22f,'dbName':await getDbName(_0x6df8da,_0x19f22f)['catch'](()=>undefined)};const _0x42517f=await listDatabases(_0x6df8da),_0x4a3cd5=_0x42517f[_0x5e8b61(0xf8)](_0x35e853=>buildDbDirectoryName(_0x35e853['dbName'],_0x35e853[_0x5e8b61(0xf2)])===_0x332775);if(_0x4a3cd5[_0x5e8b61(0xf3)]===0x1)return{'dbId':_0x4a3cd5[0x0][_0x5e8b61(0xf2)],'dbName':_0x4a3cd5[0x0][_0x5e8b61(0xfe)]};if(_0x4a3cd5['length']===0x0)throw CliErrors[_0x5e8b61(0xe2)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x332775+_0x5e8b61(0xd4)+_0x3b216a[_0x5e8b61(0xd1)]+'.');const _0x491fd8=_0x4a3cd5[_0x5e8b61(0xcc)](_0x4b5b0b=>_0x4b5b0b[_0x5e8b61(0xfe)]+'\x20('+_0x4b5b0b[_0x5e8b61(0xf2)]+')')['join'](',\x20');throw CliErrors[_0x5e8b61(0xe2)](_0x5e8b61(0xe3)+_0x332775+_0x5e8b61(0xea)+_0x3b216a[_0x5e8b61(0xd1)]+':\x20'+_0x491fd8);}function a161_0x73b8(_0x5bf747,_0x1395da){_0x5bf747=_0x5bf747-0xca;const _0x397e01=a161_0x397e();let _0x73b8a9=_0x397e01[_0x5bf747];return _0x73b8a9;}function parseExplicitDbDirectory(_0x1d1d48){const _0x357c46=a161_0x428e6a,_0x2e8523=/^db-(\d+)$/[_0x357c46(0xf1)](_0x1d1d48);if(!_0x2e8523)return null;const _0x10741f=Number(_0x2e8523[0x1]);return Number[_0x357c46(0x107)](_0x10741f)&&_0x10741f>0x0?_0x10741f:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x1cc99b=a162_0x50e4;function a162_0x50e4(_0x3b87f7,_0x23903f){_0x3b87f7=_0x3b87f7-0x159;const _0x146b5e=a162_0x146b();let _0x50e455=_0x146b5e[_0x3b87f7];return _0x50e455;}(function(_0x8bfd2c,_0x3b0c95){const _0x1597d6=a162_0x50e4,_0x3ebbdc=_0x8bfd2c();while(!![]){try{const _0x190b79=-parseInt(_0x1597d6(0x15b))/0x1+-parseInt(_0x1597d6(0x16b))/0x2+parseInt(_0x1597d6(0x15a))/0x3*(-parseInt(_0x1597d6(0x170))/0x4)+-parseInt(_0x1597d6(0x163))/0x5*(parseInt(_0x1597d6(0x16a))/0x6)+parseInt(_0x1597d6(0x171))/0x7*(-parseInt(_0x1597d6(0x164))/0x8)+parseInt(_0x1597d6(0x169))/0x9*(-parseInt(_0x1597d6(0x160))/0xa)+parseInt(_0x1597d6(0x159))/0xb*(parseInt(_0x1597d6(0x168))/0xc);if(_0x190b79===_0x3b0c95)break;else _0x3ebbdc['push'](_0x3ebbdc['shift']());}catch(_0x4371e3){_0x3ebbdc['push'](_0x3ebbdc['shift']());}}}(a162_0x146b,0x5d333));function a162_0x146b(){const _0x3bfbd7=['Query\x20description','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','5PvHkQC','17432yZPuMz','save','write','sqlname','32118444BXPZgc','198wRWJga','689160RfiqyN','732326IktZVe','SQL\x20query\x20display\x20name','file','description','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','4MhKWFV','1673mKDeEs','11sCdgTf','1418394OSxmkX','393498TkDOhB','Path\x20to\x20the\x20SQL\x20file','string','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','validation','193950CGwhTy'];a162_0x146b=function(){return _0x3bfbd7;};return a162_0x146b();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a162_0x1cc99b(0x16f),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a162_0x1cc99b(0x15e)]['join']('\x0a');export const sqlSave={'service':'sql','command':a162_0x1cc99b(0x165),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a162_0x1cc99b(0x166),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a162_0x1cc99b(0x16d),'type':a162_0x1cc99b(0x15d),'required':!![],'description':a162_0x1cc99b(0x15c)},SQLCODE_FLAG_OPTIONAL,{'name':a162_0x1cc99b(0x167),'type':a162_0x1cc99b(0x15d),'description':a162_0x1cc99b(0x16c)},{'name':'db','type':a162_0x1cc99b(0x15d),'description':a162_0x1cc99b(0x162)},{'name':a162_0x1cc99b(0x16e),'type':a162_0x1cc99b(0x15d),'description':a162_0x1cc99b(0x161)}],async 'validate'(){const _0x36f221=a162_0x1cc99b;throw CliErrors[_0x36f221(0x15f)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3d8237=a162_0x1cc99b;throw CliErrors[_0x3d8237(0x15f)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a163_0x50eb(_0x321d59,_0x5a185c){_0x321d59=_0x321d59-0x112;const _0x257636=a163_0x2576();let _0x50eb90=_0x257636[_0x321d59];return _0x50eb90;}const a163_0x203136=a163_0x50eb;(function(_0x124389,_0x3b9d15){const _0x3be6fa=a163_0x50eb,_0x16a37b=_0x124389();while(!![]){try{const _0x2d9ee7=-parseInt(_0x3be6fa(0x13a))/0x1+-parseInt(_0x3be6fa(0x13d))/0x2+-parseInt(_0x3be6fa(0x139))/0x3+-parseInt(_0x3be6fa(0x11a))/0x4+-parseInt(_0x3be6fa(0x12c))/0x5+-parseInt(_0x3be6fa(0x11d))/0x6+parseInt(_0x3be6fa(0x12a))/0x7;if(_0x2d9ee7===_0x3b9d15)break;else _0x16a37b['push'](_0x16a37b['shift']());}catch(_0x3a5cad){_0x16a37b['push'](_0x16a37b['shift']());}}}(a163_0x2576,0x329d8));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a163_0x2576(){const _0x2ba35c=['sqlRoot','length','136396UcFnJC','replace','sqlCode','.rabetbase/sql','endsWith','syncedAt','\x20[y/N]\x20','stdin','dbId','222168shCZpA','<!--\x20@lovrabet.','--\x20@lovrabet.','994242shyjXV','sqlConfig','trimStart','trim','split','path','fromEntries','apps','join','version','entries','push','question','7904813Rfgnhx','sqlContent','1936525xYEQoq','\x20-->','yes','test','mode','description','toLowerCase','lastSync','filter','mybatisXml','dbName','map','sqlName','465216CtbZkL','90115gZPmrV'];a163_0x2576=function(){return _0x2ba35c;};return a163_0x2576();}export const SQL_LOCAL_REL_DIR=a163_0x203136(0x114);export function buildSqlLockEntry(_0x422d56,_0x228481,_0x274a11,_0x3c45d4){const _0x1d0fcc=a163_0x203136,_0xee4afc=detectSqlMode(_0x228481);return{'path':buildSqlRelativePath(_0x422d56[_0x1d0fcc(0x113)],_0x422d56[_0x1d0fcc(0x138)],_0x3c45d4?.['dbName'],_0xee4afc,_0x422d56['dbId']),'hash':_0x274a11,'remoteId':_0x422d56['id'],'version':_0x422d56[_0x1d0fcc(0x126)],'dbId':Number(_0x422d56['dbId']),'dbName':_0x3c45d4?.[_0x1d0fcc(0x136)],'sqlName':_0x422d56[_0x1d0fcc(0x138)],'sqlConfig':_0x422d56[_0x1d0fcc(0x11e)]??undefined,'mode':_0xee4afc};}export function cloneSqlLockData(_0x45b6b){const _0x39ae76=a163_0x203136;return{'apps':Object[_0x39ae76(0x123)](Object[_0x39ae76(0x127)](_0x45b6b[_0x39ae76(0x124)])[_0x39ae76(0x137)](([_0x3cf06f,_0xfcd67])=>[_0x3cf06f,{'sqlRoot':_0xfcd67[_0x39ae76(0x13b)],'lastSync':_0xfcd67[_0x39ae76(0x133)],'sqls':{..._0xfcd67['sqls']}}]))};}export function ensureRemoteSqlContent(_0x1e7c24){const _0x234026=a163_0x203136;return _0x1e7c24[_0x234026(0x12b)]??'';}export function buildLocalSqlFileContent(_0x3ae017,_0x138a31,_0x5dde61){const _0x2ff207=a163_0x203136,_0x34ff17=_0x5dde61?.[_0x2ff207(0x130)]??detectSqlMode(_0x138a31),_0x1907aa=stripLocalSqlMetadata(_0x138a31,_0x34ff17)[_0x2ff207(0x120)](),_0x2d7cea=[...buildMetadataHeaderLines({'sqlCode':_0x3ae017[_0x2ff207(0x113)],'sqlName':_0x3ae017[_0x2ff207(0x138)],'dbId':_0x3ae017[_0x2ff207(0x119)],'dbName':_0x5dde61?.[_0x2ff207(0x136)],'mode':_0x34ff17,'syncedAt':_0x5dde61?.[_0x2ff207(0x116)],'description':_0x5dde61?.[_0x2ff207(0x131)]},_0x34ff17),'',_0x1907aa],_0x1eaf62=_0x2d7cea[_0x2ff207(0x125)]('\x0a');return _0x1eaf62[_0x2ff207(0x115)]('\x0a')?_0x1eaf62:_0x1eaf62+'\x0a';}export function stripLocalSqlMetadata(_0x3b9b4e,_0x1d3a31){const _0x4c6b67=a163_0x203136,_0x1b47a0=_0x3b9b4e[_0x4c6b67(0x112)](/\r\n/g,'\x0a')[_0x4c6b67(0x121)]('\x0a'),_0x20e2f7=[];let _0x226636=0x0;if(_0x1d3a31===_0x4c6b67(0x135))while(_0x226636<_0x1b47a0[_0x4c6b67(0x13c)]){const _0x2e7f2e=_0x1b47a0[_0x226636]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4c6b67(0x12f)](_0x2e7f2e)){_0x226636++;continue;}if(_0x2e7f2e[_0x4c6b67(0x120)]()===''&&_0x226636>0x0){_0x226636++;continue;}break;}else while(_0x226636<_0x1b47a0['length']){const _0x1c1371=_0x1b47a0[_0x226636]??'';if(/^\s*--\s*@lovrabet\./[_0x4c6b67(0x12f)](_0x1c1371)){_0x226636++;continue;}if(_0x1c1371[_0x4c6b67(0x120)]()===''&&_0x226636>0x0){_0x226636++;continue;}break;}for(;_0x226636<_0x1b47a0[_0x4c6b67(0x13c)];_0x226636++){_0x20e2f7[_0x4c6b67(0x128)](_0x1b47a0[_0x226636]);}return _0x20e2f7[_0x4c6b67(0x125)]('\x0a')[_0x4c6b67(0x11f)]();}export function resolveSqlMode(_0x4be4c3,_0x35384a){const _0x454186=a163_0x203136;if(_0x35384a?.[_0x454186(0x130)])return _0x35384a[_0x454186(0x130)];return detectSqlMode(_0x4be4c3);}export function resolveSqlFileName(_0x365752,_0x1aa543,_0x6b5843){const _0x3261d3=a163_0x203136;if(_0x6b5843?.[_0x3261d3(0x122)])return _0x6b5843['path'];if(_0x6b5843?.[_0x3261d3(0x138)]||_0x6b5843?.['dbName'])return buildSqlRelativePath(_0x365752,_0x6b5843?.[_0x3261d3(0x138)],_0x6b5843?.['dbName'],resolveSqlMode(_0x1aa543,_0x6b5843),_0x6b5843?.['dbId']);return buildDefaultSqlFileName(_0x365752,resolveSqlMode(_0x1aa543,_0x6b5843));}export function resolveSqlLocalDir(_0x1257c9,_0x1cd085){return join(_0x1257c9,SQL_LOCAL_REL_DIR,_0x1cd085);}export async function confirmForceOverwrite(_0x5a3fa1){const _0x1db166=a163_0x203136,_0x545760=createInterface({'input':process[_0x1db166(0x118)],'output':process['stderr']}),_0x1afb04=await new Promise(_0x4a92b2=>{const _0x1c8a5c=_0x1db166;_0x545760[_0x1c8a5c(0x129)](_0x5a3fa1+_0x1c8a5c(0x117),_0x4a92b2);});return _0x545760['close'](),['y',_0x1db166(0x12e)]['includes'](_0x1afb04[_0x1db166(0x120)]()[_0x1db166(0x132)]());}export function findSqlLockScope(_0x4e22ea,_0x482f13){const _0xf4734d=a163_0x203136;return _0x4e22ea[_0xf4734d(0x124)][_0x482f13];}function buildMetadataHeaderLines(_0x52634c,_0x89b6f0){const _0x3778c4=a163_0x203136,_0x5d9453=[['sqlCode',_0x52634c[_0x3778c4(0x113)]],[_0x3778c4(0x138),_0x52634c[_0x3778c4(0x138)]],[_0x3778c4(0x119),_0x52634c[_0x3778c4(0x119)]],[_0x3778c4(0x136),_0x52634c[_0x3778c4(0x136)]],[_0x3778c4(0x130),_0x52634c['mode']],['syncedAt',_0x52634c['syncedAt']],[_0x3778c4(0x131),_0x52634c[_0x3778c4(0x131)]]];if(_0x89b6f0===_0x3778c4(0x135))return _0x5d9453[_0x3778c4(0x134)](([,_0x4b4c5d])=>_0x4b4c5d!==undefined&&_0x4b4c5d!==null&&String(_0x4b4c5d)[_0x3778c4(0x120)]()!=='')[_0x3778c4(0x137)](([_0x3aaae2,_0x2d3efd])=>_0x3778c4(0x11b)+_0x3aaae2+':\x20'+String(_0x2d3efd)+_0x3778c4(0x12d));return _0x5d9453[_0x3778c4(0x134)](([,_0x4cb151])=>_0x4cb151!==undefined&&_0x4cb151!==null&&String(_0x4cb151)['trim']()!=='')['map'](([_0x3bdff0,_0x55876b])=>_0x3778c4(0x11c)+_0x3bdff0+':\x20'+String(_0x55876b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0x477883=a164_0x26e6;(function(_0x478a63,_0x32891c){const _0x4a2d01=a164_0x26e6,_0x2baae4=_0x478a63();while(!![]){try{const _0x35c045=parseInt(_0x4a2d01(0x144))/0x1+-parseInt(_0x4a2d01(0x156))/0x2+parseInt(_0x4a2d01(0x13e))/0x3+parseInt(_0x4a2d01(0x149))/0x4*(parseInt(_0x4a2d01(0x162))/0x5)+-parseInt(_0x4a2d01(0x153))/0x6+-parseInt(_0x4a2d01(0x13d))/0x7+parseInt(_0x4a2d01(0x15d))/0x8;if(_0x35c045===_0x32891c)break;else _0x2baae4['push'](_0x2baae4['shift']());}catch(_0x44b7e8){_0x2baae4['push'](_0x2baae4['shift']());}}}(a164_0x5c83,0x8b9a4));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a164_0x26e6(_0x349768,_0x26290f){_0x349768=_0x349768-0x13d;const _0x5c8337=a164_0x5c83();let _0x26e6a0=_0x5c8337[_0x349768];return _0x26e6a0;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a164_0x5c83(){const _0x31f69a=['appCode','paging','totalCount','\x20added,\x20','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','4689696AfKQQl','tableData','sqls','344752hFXUwd','sqlName','\x20missing,\x20','map','keys','\x20remote-only','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','6905744tSieKi','bool','has','relativePath','push','288055GstroF','7102578LwUvYj','921054aVOlWD','lockKey','status','All\x20SQL\x20queries\x20are\x20in\x20sync.','length','read','736501qEwlyh','path','filePath','remote','sqlRoot','44QYQlpk','hash','\x20unchanged','lockFilePath','sqlCode'];a164_0x5c83=function(){return _0x31f69a;};return a164_0x5c83();}async function fetchAllSqlCodes(_0x4ce17b){const _0x5c1f71=a164_0x26e6,_0x1d94dd=[];let _0x5c5358=0x1;while(!![]){const _0x2cdbdd=await listSqlQueries(_0x4ce17b,{'currentPage':_0x5c5358,'pageSize':PAGE_SIZE}),_0x3f88a8=_0x2cdbdd[_0x5c1f71(0x154)]??[];_0x1d94dd['push'](..._0x3f88a8[_0x5c1f71(0x159)](_0x2aa6bb=>_0x2aa6bb[_0x5c1f71(0x14d)]));if(_0x3f88a8[_0x5c1f71(0x142)]===0x0)break;const _0x530158=_0x2cdbdd[_0x5c1f71(0x14f)]?.[_0x5c1f71(0x150)];if(_0x530158!=null?_0x1d94dd[_0x5c1f71(0x142)]>=_0x530158:_0x3f88a8[_0x5c1f71(0x142)]<PAGE_SIZE)break;_0x5c5358++;}return _0x1d94dd;}export const sqlStatus={'service':'sql','command':'status','description':a164_0x477883(0x15c),'risk':a164_0x477883(0x143),'flags':[{'name':a164_0x477883(0x147),'type':'boolean','description':a164_0x477883(0x152)}],async 'execute'(_0x131431){const _0x576db9=a164_0x477883,_0x9beabb=loadSqlProjectConfig(_0x131431['appCode']),_0x2d2c0f=await readSqlLockFile(_0x9beabb[_0x576db9(0x14c)]),{appLock:_0x3abd3a}=ensureSqlLockScope(_0x2d2c0f??createEmptySqlLock(),_0x9beabb['appCode'],_0x9beabb[_0x576db9(0x148)],_0x576db9(0x140)),_0x5e5748=await scanLocalSqlQueries(_0x9beabb),_0x25881a=[],_0x32b3b0=[],_0x357fdd=[],_0x5507e4=[],_0x520045=new Set(_0x5e5748[_0x576db9(0x159)](_0x353f64=>_0x353f64[_0x576db9(0x13f)]));for(const _0x276af3 of _0x5e5748){const _0x50eb63=await computeSqlFileHash(_0x276af3[_0x576db9(0x146)]),_0x20d944=_0x3abd3a[_0x576db9(0x155)][_0x276af3[_0x576db9(0x13f)]],_0x457a59=!!_0x20d944&&_0x20d944[_0x576db9(0x145)]!==_0x276af3[_0x576db9(0x160)],_0x192cf0=!!_0x20d944&&!!_0x276af3[_0x576db9(0x157)]&&_0x20d944[_0x576db9(0x157)]!==_0x276af3[_0x576db9(0x157)];if(!_0x20d944)_0x25881a[_0x576db9(0x161)](_0x276af3[_0x576db9(0x13f)]);else _0x20d944[_0x576db9(0x14a)]!==_0x50eb63||_0x457a59||_0x192cf0?_0x32b3b0[_0x576db9(0x161)](_0x276af3[_0x576db9(0x13f)]):_0x357fdd[_0x576db9(0x161)](_0x276af3['lockKey']);}for(const _0xf49cb9 of Object[_0x576db9(0x15a)](_0x3abd3a[_0x576db9(0x155)])){!_0x520045[_0x576db9(0x15f)](_0xf49cb9)&&_0x5507e4[_0x576db9(0x161)](_0xf49cb9);}const _0x27d666=[];if(_0x131431[_0x576db9(0x15e)]('remote')){const _0x1102bc=await fetchAllSqlCodes(_0x131431[_0x576db9(0x14e)]);for(const _0x4ca1a4 of _0x1102bc){!_0x520045[_0x576db9(0x15f)](_0x4ca1a4)&&!_0x3abd3a[_0x576db9(0x155)][_0x4ca1a4]&&_0x27d666['push'](_0x4ca1a4);}}const _0x1d5569=_0x25881a[_0x576db9(0x142)]===0x0&&_0x32b3b0[_0x576db9(0x142)]===0x0&&_0x5507e4['length']===0x0&&_0x27d666[_0x576db9(0x142)]===0x0;return{'ok':!![],'data':{'added':_0x25881a,'modified':_0x32b3b0,'missing':_0x5507e4,'unchanged':_0x357fdd,'remoteOnly':_0x27d666},'message':_0x1d5569?_0x576db9(0x141):_0x25881a[_0x576db9(0x142)]+_0x576db9(0x151)+_0x32b3b0[_0x576db9(0x142)]+'\x20modified,\x20'+_0x5507e4[_0x576db9(0x142)]+_0x576db9(0x158)+_0x357fdd[_0x576db9(0x142)]+_0x576db9(0x14b)+(_0x27d666[_0x576db9(0x142)]>0x0?',\x20'+_0x27d666['length']+_0x576db9(0x15b):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x247fa5=a165_0x13c0;function a165_0x13c0(_0x235d74,_0x177eef){_0x235d74=_0x235d74-0x1c1;const _0x562b9a=a165_0x562b();let _0x13c059=_0x562b9a[_0x235d74];return _0x13c059;}(function(_0x530adf,_0x185f05){const _0x241537=a165_0x13c0,_0x47d029=_0x530adf();while(!![]){try{const _0x2d9f22=parseInt(_0x241537(0x1e9))/0x1*(-parseInt(_0x241537(0x1c5))/0x2)+-parseInt(_0x241537(0x1cb))/0x3+-parseInt(_0x241537(0x1d1))/0x4+parseInt(_0x241537(0x1d6))/0x5*(parseInt(_0x241537(0x1e2))/0x6)+parseInt(_0x241537(0x1db))/0x7+parseInt(_0x241537(0x1eb))/0x8+-parseInt(_0x241537(0x1d4))/0x9;if(_0x2d9f22===_0x185f05)break;else _0x47d029['push'](_0x47d029['shift']());}catch(_0x247a48){_0x47d029['push'](_0x47d029['shift']());}}}(a165_0x562b,0x62020));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a165_0x562b(){const _0x39e472=['sql','SQL\x20schema\x20validation','schemas','push','1840440ERpvdi','Table\x20\x22','isSelectOnly','toLowerCase','tables','valid','1653000RvRljx','type','appCode','360198BTRXNT','reason','5grngOQ','fields','size','tableName','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','4412205ozLgcY','\x22\x20not\x20found\x20or\x20not\x20accessible','schema:','get','parameters','Provide\x20--file\x20or\x20--sql','trim','4679238PjVObz','sqlType','file','dbtableConfig','flagMissing','cwd','length','7HWokyH','map','4865688LfchCF','isArray','validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','str','split','message','schemaWarnings','name','File\x20not\x20found:\x20','validation','filter','157202smohbV','string'];a165_0x562b=function(){return _0x39e472;};return a165_0x562b();}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a165_0x247fa5(0x1c7),'command':a165_0x247fa5(0x1ed),'description':a165_0x247fa5(0x1ee),'risk':'read','flags':[{'name':a165_0x247fa5(0x1e4),'type':a165_0x247fa5(0x1c6),'description':a165_0x247fa5(0x1da)},{'name':a165_0x247fa5(0x1c7),'type':a165_0x247fa5(0x1c6),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x1e00d2){const _0xe8347f=a165_0x247fa5,_0x176ca7=_0x1e00d2['str'](_0xe8347f(0x1e4)),_0x2a065e=_0x1e00d2[_0xe8347f(0x1ef)](_0xe8347f(0x1c7));if(!_0x176ca7&&!_0x2a065e)throw CliErrors[_0xe8347f(0x1e6)](_0xe8347f(0x1e4),_0xe8347f(0x1e0));let _0x3e32dd;if(_0x176ca7){const _0x5ebf8f=resolve(process[_0xe8347f(0x1e7)](),_0x176ca7);if(!existsSync(_0x5ebf8f))throw CliErrors[_0xe8347f(0x1c3)](_0xe8347f(0x1c2)+_0x5ebf8f);_0x3e32dd=readFileSync(_0x5ebf8f,'utf-8');}else _0x3e32dd=_0x2a065e;const _0x5d5fea=validateSql(_0x3e32dd),_0x56a5f3={'valid':_0x5d5fea[_0xe8347f(0x1d0)],'sqlType':_0x5d5fea[_0xe8347f(0x1e3)][_0xe8347f(0x1d2)],'isSelectOnly':_0x5d5fea[_0xe8347f(0x1e3)][_0xe8347f(0x1cd)],'isDangerous':_0x5d5fea[_0xe8347f(0x1e3)]['isDangerous'],'tables':_0x5d5fea[_0xe8347f(0x1cf)],'parameters':_0x5d5fea[_0xe8347f(0x1df)],'message':_0x5d5fea[_0xe8347f(0x1f1)]};_0x5d5fea['sqlType']['reason']&&(_0x56a5f3[_0xe8347f(0x1d5)]=_0x5d5fea[_0xe8347f(0x1e3)][_0xe8347f(0x1d5)]);const _0x2a4cfd=_0x1e00d2[_0xe8347f(0x1ef)](_0xe8347f(0x1c9));if(_0x2a4cfd&&_0x5d5fea['valid']){const _0x8439c0=_0x2a4cfd[_0xe8347f(0x1f0)](',')[_0xe8347f(0x1ea)](_0x4607b6=>_0x4607b6[_0xe8347f(0x1e1)]())[_0xe8347f(0x1c4)](Boolean),_0x9de078=[],_0x902cc=filterDbTableBackedDatasets(await listDatasets(_0x1e00d2[_0xe8347f(0x1d3)])),_0x4f307c=new Map(_0x902cc[_0xe8347f(0x1ea)](_0x2cc58b=>[_0x2cc58b[_0xe8347f(0x1e5)]?.[_0xe8347f(0x1d9)]?.[_0xe8347f(0x1ce)](),_0x2cc58b]));for(const _0xc952e2 of _0x5d5fea[_0xe8347f(0x1cf)]){const _0x598e84=_0x4f307c[_0xe8347f(0x1de)](_0xc952e2['toLowerCase']());!_0x598e84&&_0x9de078[_0xe8347f(0x1ca)](_0xe8347f(0x1cc)+_0xc952e2+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x203877 of _0x8439c0){let _0x5bab48;try{_0x5bab48=await getDatasetDetail(_0x203877);}catch{_0x9de078[_0xe8347f(0x1ca)]('Dataset\x20\x22'+_0x203877+_0xe8347f(0x1dc));continue;}assertDatasetIsDbTableBacked(_0x5bab48,_0xe8347f(0x1c8));const _0x154f11=Array[_0xe8347f(0x1ec)](_0x5bab48[_0xe8347f(0x1d7)])?_0x5bab48[_0xe8347f(0x1d7)]:[],_0xdb81e9=new Set(_0x154f11[_0xe8347f(0x1ea)](_0x5cc896=>_0x5cc896[_0xe8347f(0x1c1)]?.[_0xe8347f(0x1ce)]())),_0x1c8d40=_0x5bab48['dbtableConfig']?.['tableName']||_0x5bab48[_0xe8347f(0x1d9)]||_0x203877;_0x56a5f3[_0xe8347f(0x1dd)+_0x1c8d40]={'code':_0x203877,'tableName':_0x1c8d40,'fieldCount':_0xdb81e9[_0xe8347f(0x1d8)],'fields':Array['from'](_0xdb81e9)};}_0x9de078[_0xe8347f(0x1e8)]>0x0&&(_0x56a5f3[_0xe8347f(0x1f2)]=_0x9de078);}return{'ok':_0x5d5fea[_0xe8347f(0x1d0)],'data':_0x56a5f3,'message':_0x5d5fea['message']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x58a37c=a166_0x5363;function a166_0x5363(_0x5c6b1c,_0x11d4f6){_0x5c6b1c=_0x5c6b1c-0xa8;const _0x596205=a166_0x5962();let _0x536371=_0x596205[_0x5c6b1c];return _0x536371;}(function(_0x474c3c,_0x278a68){const _0x2d3e39=a166_0x5363,_0x53ca58=_0x474c3c();while(!![]){try{const _0x15efe8=-parseInt(_0x2d3e39(0xb6))/0x1+parseInt(_0x2d3e39(0xa8))/0x2+-parseInt(_0x2d3e39(0xb2))/0x3*(parseInt(_0x2d3e39(0xa9))/0x4)+parseInt(_0x2d3e39(0xb5))/0x5+parseInt(_0x2d3e39(0xaa))/0x6+-parseInt(_0x2d3e39(0xad))/0x7*(-parseInt(_0x2d3e39(0xab))/0x8)+-parseInt(_0x2d3e39(0xaf))/0x9;if(_0x15efe8===_0x278a68)break;else _0x53ca58['push'](_0x53ca58['shift']());}catch(_0x13cbc5){_0x53ca58['push'](_0x53ca58['shift']());}}}(a166_0x5962,0x79631));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a166_0x5962(){const _0xa7f445=['2997620RHVvqr','846777XtTypY','721118SFkBIx','4660zaypUm','5470878IKjXQA','5734576kwPJIQ','App\x20profile\x20name','7Blubbe','add','3695400UNpvhg','workspace','write','2148JSfBWD','workspace\x20add','name'];a166_0x5962=function(){return _0xa7f445;};return a166_0x5962();}export const workspaceAddDefinition={'service':a166_0x58a37c(0xb0),'command':a166_0x58a37c(0xae),'description':'Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a166_0x58a37c(0xb1),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a166_0x58a37c(0xb4),'description':a166_0x58a37c(0xac),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x19aab1=>validateAppName(_0x19aab1,a166_0x58a37c(0xb3)),'execute':_0x5cc97c=>runAppAdd(_0x5cc97c,a166_0x58a37c(0xb3))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x70b7de=a167_0x50cd;(function(_0x379d19,_0x4df457){const _0x3ba424=a167_0x50cd,_0x234aa1=_0x379d19();while(!![]){try{const _0x4fa6d5=parseInt(_0x3ba424(0xba))/0x1+-parseInt(_0x3ba424(0xa7))/0x2*(parseInt(_0x3ba424(0xb9))/0x3)+-parseInt(_0x3ba424(0xd9))/0x4*(parseInt(_0x3ba424(0xd4))/0x5)+parseInt(_0x3ba424(0xc0))/0x6*(parseInt(_0x3ba424(0xcf))/0x7)+-parseInt(_0x3ba424(0xdc))/0x8*(parseInt(_0x3ba424(0xbd))/0x9)+parseInt(_0x3ba424(0xd0))/0xa+parseInt(_0x3ba424(0xb1))/0xb*(parseInt(_0x3ba424(0xac))/0xc);if(_0x4fa6d5===_0x4df457)break;else _0x234aa1['push'](_0x234aa1['shift']());}catch(_0xd478f3){_0x234aa1['push'](_0x234aa1['shift']());}}}(a167_0x5bce,0x80298));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';function a167_0x5bce(){const _0x18bf70=['\x20workspace\x20','App\x20\x22','workspace','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','flag','Initialize\x20the\x20current\x20workspace\x20app\x20binding','locale','apiDir','number','582183nKYRRe','9686230hOgTzd','app','Invalid\x20appcode:\x20','\x20--app\x20','1707715KTbTDz','Locale\x20for\x20this\x20workspace\x20app\x20profile','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','trim','appcode','8OUjuJl','env','Use\x20`','7895216eeOklg','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','updated','validation','riskLevel','init','format','53614lTyNdW','workspace.','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20use\x20--app\x20<name>`.','isArray','156rKmlsF','defaultApp','keys','string','Missing\x20workspace\x20app\x20selector.','1355178dLzhWN','project','write','\x20(appcode:\x20','str','Switch\x20the\x20current\x20workspace\x20app\x20binding','apps','pageSize','84BqRWEo','292170yTLsdB','defaultFormat','initialized','9cQQUNc','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','.\x20Credentials:\x20not\x20written.','6yQRmZv','Workspace\x20','Target\x20environment','object','join','globalConfig'];a167_0x5bce=function(){return _0x18bf70;};return a167_0x5bce();}function a167_0x50cd(_0x503ca8,_0x501db4){_0x503ca8=_0x503ca8-0xa4;const _0x5bce2c=a167_0x5bce();let _0x50cdbc=_0x5bce2c[_0x503ca8];return _0x50cdbc;}import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a167_0x70b7de(0xd8),a167_0x70b7de(0xda),a167_0x70b7de(0xcd),a167_0x70b7de(0xa6),a167_0x70b7de(0xb8),'riskLevel',a167_0x70b7de(0xcc)],workspaceFlags=[{'name':a167_0x70b7de(0xd1),'type':'string','description':a167_0x70b7de(0xc9)},{'name':a167_0x70b7de(0xd8),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xdd)},{'name':a167_0x70b7de(0xda),'type':'string','description':a167_0x70b7de(0xc2),'enum':[...RABETBASE_ENV_VALUES]},{'name':a167_0x70b7de(0xcd),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xa9)},{'name':a167_0x70b7de(0xbb),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xbe),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a167_0x70b7de(0xce),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a167_0x70b7de(0xa4),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xd6),'enum':[...RISK_LEVEL_VALUES]},{'name':a167_0x70b7de(0xcc),'type':'string','description':a167_0x70b7de(0xd5)}];function isRecord(_0x5d6b7){const _0x222a3d=a167_0x70b7de;return!!_0x5d6b7&&typeof _0x5d6b7===_0x222a3d(0xc3)&&!Array[_0x222a3d(0xab)](_0x5d6b7);}function assertValidAppcode(_0x14cf3c){const _0x5b1d7d=a167_0x70b7de,{valid:_0x5eaa0f,message:_0x477c1e}=validateAppcode(_0x14cf3c);if(!_0x5eaa0f)throw CliErrors[_0x5b1d7d(0xdf)](_0x5b1d7d(0xd2)+_0x14cf3c,_0x477c1e);}function sanitizeProfile(_0x49d155){if(!isRecord(_0x49d155))return{};const _0x22f478={};for(const _0x2d6871 of SAFE_PROFILE_KEYS){if(_0x49d155[_0x2d6871]!==undefined)_0x22f478[_0x2d6871]=_0x49d155[_0x2d6871];}return _0x22f478;}function cloneProfile(_0x207f34){return isRecord(_0x207f34)?{..._0x207f34}:{};}function collectWorkspaceProfileOverrides(_0xae89a6){const _0x5eb356=a167_0x70b7de,_0x765837={},_0x6f1a1a=_0xae89a6['str'](_0x5eb356(0xda)),_0x58aade=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xcd)),_0x139fa8=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xbb)),_0xa2b42=_0xae89a6[_0x5eb356(0xca)](_0x5eb356(0xb8)),_0x168ee3=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xa4)),_0x2c288f=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xcc));if(_0x6f1a1a)_0x765837['env']=_0x6f1a1a;if(_0x58aade)_0x765837['apiDir']=_0x58aade;if(_0x139fa8)_0x765837[_0x5eb356(0xa6)]=_0x139fa8;if(_0xa2b42!==undefined&&_0xa2b42!=='')_0x765837[_0x5eb356(0xb8)]=Number(_0xa2b42);if(_0x168ee3)_0x765837[_0x5eb356(0xa4)]=_0x168ee3;if(_0x2c288f)_0x765837[_0x5eb356(0xcc)]=_0x2c288f;return _0x765837;}async function validateWorkspaceArgs(_0x1a7b10){const _0x44afee=a167_0x70b7de,_0x139e31=_0x1a7b10[_0x44afee(0xb5)](_0x44afee(0xd1))[_0x44afee(0xd7)](),_0x5bba0f=_0x1a7b10[_0x44afee(0xb5)](_0x44afee(0xd8))[_0x44afee(0xd7)]();if(!_0x139e31&&!_0x5bba0f)throw CliErrors['validation'](_0x44afee(0xb0),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x44afee(0xaa));if(_0x5bba0f)assertValidAppcode(_0x5bba0f);}function resolveKnownApps(){const _0x4441ec=a167_0x70b7de,{config:_0x370f9c,layers:_0x187329}=readRawConfigWithLayers(),_0x17638d=isRecord(_0x370f9c[_0x4441ec(0xb7)])?_0x370f9c[_0x4441ec(0xb7)]:{},_0x5b6c0c=isRecord(_0x187329[_0x4441ec(0xc5)][_0x4441ec(0xb7)])?_0x187329[_0x4441ec(0xc5)]['apps']:{};return{..._0x5b6c0c,..._0x17638d};}async function configureWorkspace(_0x4d0eec,_0x3ddab2){const _0x4d3cd3=a167_0x70b7de,_0x426a4f=_0x4d0eec[_0x4d3cd3(0xb5)](_0x4d3cd3(0xd1))['trim'](),_0x58a62a=_0x4d0eec[_0x4d3cd3(0xb5)](_0x4d3cd3(0xd8))['trim'](),_0x532a38=_0x426a4f||_0x58a62a;if(!_0x532a38)throw CliErrors[_0x4d3cd3(0xdf)](_0x4d3cd3(0xb0),_0x4d3cd3(0xdb)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x4d3cd3(0xaa));if(_0x58a62a)assertValidAppcode(_0x58a62a);const _0x2ed727=resolveWriteConfigPath(_0x4d3cd3(0xb2)),_0x2dfd2f=readConfigFile(_0x2ed727),_0x24d40f=resolveKnownApps(),_0x820eba=isRecord(_0x2dfd2f[_0x4d3cd3(0xb7)])?{..._0x2dfd2f['apps']}:{},_0x2b185b=cloneProfile(_0x820eba[_0x532a38]),_0x569b26=sanitizeProfile(_0x24d40f[_0x532a38]),_0x292714=_0x58a62a?{}:_0x569b26,_0x4a11bd=_0x58a62a||_0x292714[_0x4d3cd3(0xd8)];if(!_0x4a11bd){const _0x3c4ba1=Object[_0x4d3cd3(0xae)](_0x24d40f),_0x5dfcd6=_0x3c4ba1['length']===0x0?_0x4d3cd3(0xdb)+CLI_BIN_NAME+_0x4d3cd3(0xc6)+_0x3ddab2+_0x4d3cd3(0xd3)+_0x532a38+'\x20--appcode\x20<code>`.':'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x3c4ba1[_0x4d3cd3(0xc4)](',\x20');throw CliErrors['validation'](_0x4d3cd3(0xc7)+_0x532a38+'\x22\x20not\x20found.',_0x5dfcd6);}assertValidAppcode(String(_0x4a11bd));const _0x2631c2={..._0x292714,..._0x2b185b,'appcode':String(_0x4a11bd),...collectWorkspaceProfileOverrides(_0x4d0eec)};return _0x820eba[_0x532a38]=_0x2631c2,_0x2dfd2f['apps']=_0x820eba,_0x2dfd2f[_0x4d3cd3(0xad)]=_0x532a38,delete _0x2dfd2f['appcode'],delete _0x2dfd2f['app'],_0x2631c2[_0x4d3cd3(0xda)]&&(_0x2dfd2f[_0x4d3cd3(0xda)]=_0x2631c2[_0x4d3cd3(0xda)]),writeConfigFile(_0x2ed727,_0x2dfd2f),{'ok':!![],'message':_0x4d3cd3(0xc1)+(_0x3ddab2==='init'?_0x4d3cd3(0xbc):_0x4d3cd3(0xde))+':\x20'+_0x532a38+_0x4d3cd3(0xb4)+_0x2631c2[_0x4d3cd3(0xd8)]+').\x20Config:\x20'+_0x2ed727+_0x4d3cd3(0xbf),'data':{'operation':_0x4d3cd3(0xa8)+_0x3ddab2,'configPath':_0x2ed727,'app':_0x532a38,'appcode':_0x2631c2[_0x4d3cd3(0xd8)],'env':_0x2631c2[_0x4d3cd3(0xda)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a167_0x70b7de(0xc8),'command':a167_0x70b7de(0xa5),'description':a167_0x70b7de(0xcb),'risk':a167_0x70b7de(0xb3),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x33b8b8=>configureWorkspace(_0x33b8b8,a167_0x70b7de(0xa5))},workspaceUseDefinition={'service':a167_0x70b7de(0xc8),'command':'use','description':a167_0x70b7de(0xb6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x5b5a54=>configureWorkspace(_0x5b5a54,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a168_0x117592=a168_0x497b;(function(_0x17a528,_0x5adce0){const _0x4e3fc4=a168_0x497b,_0x13adc6=_0x17a528();while(!![]){try{const _0x3aba02=parseInt(_0x4e3fc4(0x13c))/0x1+-parseInt(_0x4e3fc4(0x13e))/0x2+-parseInt(_0x4e3fc4(0x142))/0x3+-parseInt(_0x4e3fc4(0x13d))/0x4*(-parseInt(_0x4e3fc4(0x140))/0x5)+-parseInt(_0x4e3fc4(0x143))/0x6+parseInt(_0x4e3fc4(0x138))/0x7*(-parseInt(_0x4e3fc4(0x13b))/0x8)+parseInt(_0x4e3fc4(0x141))/0x9;if(_0x3aba02===_0x5adce0)break;else _0x13adc6['push'](_0x13adc6['shift']());}catch(_0x4540ef){_0x13adc6['push'](_0x13adc6['shift']());}}}(a168_0x4743,0x86b27));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a168_0x497b(_0x106fb1,_0x59e362){_0x106fb1=_0x106fb1-0x134;const _0x47433d=a168_0x4743();let _0x497b12=_0x47433d[_0x106fb1];return _0x497b12;}function a168_0x4743(){const _0x5483bf=['workspace','217903mqWmoQ','high-risk-write','remove','120WswkvL','907772MGnKtY','117652ceAVod','18070PwdRsp','App\x20profile\x20name\x20to\x20remove','90PxhlCC','8455923ytceqE','1219458vQqTNa','5655468PGPUEv','name','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','workspace\x20remove'];a168_0x4743=function(){return _0x5483bf;};return a168_0x4743();}export const workspaceRemoveDefinition={'service':a168_0x117592(0x137),'command':a168_0x117592(0x13a),'description':a168_0x117592(0x135),'risk':a168_0x117592(0x139),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a168_0x117592(0x134),'description':a168_0x117592(0x13f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x2cfae2=>validateAppName(_0x2cfae2,a168_0x117592(0x136)),'execute':_0x6c0f3e=>runAppRemove(_0x6c0f3e,a168_0x117592(0x136))};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a169_0x483b99=a169_0x299c;(function(_0x2d1e7d,_0x7022fa){const _0x22cc32=a169_0x299c,_0x4d10d9=_0x2d1e7d();while(!![]){try{const _0x34d2d6=-parseInt(_0x22cc32(0x1f2))/0x1+parseInt(_0x22cc32(0x206))/0x2+parseInt(_0x22cc32(0x202))/0x3*(-parseInt(_0x22cc32(0x1f3))/0x4)+parseInt(_0x22cc32(0x213))/0x5*(parseInt(_0x22cc32(0x20d))/0x6)+parseInt(_0x22cc32(0x215))/0x7+-parseInt(_0x22cc32(0x210))/0x8*(-parseInt(_0x22cc32(0x207))/0x9)+parseInt(_0x22cc32(0x216))/0xa;if(_0x34d2d6===_0x7022fa)break;else _0x4d10d9['push'](_0x4d10d9['shift']());}catch(_0x4f5ed6){_0x4d10d9['push'](_0x4d10d9['shift']());}}}(a169_0x5972,0x89a2a));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';function a169_0x5972(){const _0x2f26ef=['7976YuRMfN','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','number','8765mnpfWd','defaultFormat','1576491vtGPng','4524700NRMFUy','locale','inherit','apiDir','Locale','appcode','726410lXpcbJ','8bugfeE','Default\x20page\x20size','length','entries','Config\x20key\x20(','string','accessKey','Access\x20key','toLowerCase','map','filter','en-US','join','riskLevel','keys','575205GWErEe','format','API\x20directory\x20path','has','700940EPICyR','3105epjQfL','env','zh-CN','app','Risk\x20level','pageSize','1032kJUjXZ','cookie','defaultApp'];a169_0x5972=function(){return _0x2f26ef;};return a169_0x5972();}import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a169_0x483b99(0x20e),'accessKey',a169_0x483b99(0x217),a169_0x483b99(0x203),a169_0x483b99(0x200)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a169_0x483b99(0x21b),a169_0x483b99(0x208),a169_0x483b99(0x217),'format','cookie',a169_0x483b99(0x1f9),a169_0x483b99(0x219)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x19583f){const _0x3fafd7=a169_0x483b99;return[..._0x19583f][_0x3fafd7(0x1ff)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x338005){const _0x41d053=a169_0x483b99;return TOP_LEVEL_CONFIG_KEYS[_0x41d053(0x205)](_0x338005);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x2551f9=a169_0x483b99;return _0x2551f9(0x1f7)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a169_0x483b99(0x208),'apiDir':a169_0x483b99(0x219),'cookie':a169_0x483b99(0x20e),'accessKey':a169_0x483b99(0x1f9),'defaultFormat':a169_0x483b99(0x203),'pageSize':'pageSize','riskLevel':a169_0x483b99(0x200),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x104ba6=a169_0x483b99;return[{'name':_0x104ba6(0x208),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x104ba6(0x219),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x204)},{'name':_0x104ba6(0x20e),'type':_0x104ba6(0x1f8),'description':'Auth\x20cookie','hidden':!![]},{'name':_0x104ba6(0x1f9),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x1fa),'hidden':!![]},{'name':_0x104ba6(0x214),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x211),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x104ba6(0x20c),'type':_0x104ba6(0x212),'description':_0x104ba6(0x1f4)},{'name':_0x104ba6(0x200),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x20b),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x104ba6(0x217),'type':'string','description':_0x104ba6(0x21a)}];}function a169_0x299c(_0x3c385c,_0x24d867){_0x3c385c=_0x3c385c-0x1f2;const _0x597254=a169_0x5972();let _0x299c4e=_0x597254[_0x3c385c];return _0x299c4e;}export function collectAppProfileOverrides(_0x587bad){const _0x568bbf=a169_0x483b99,_0x3ae221={};for(const [_0x5166aa,_0x2fc321]of Object[_0x568bbf(0x1f6)](APP_PROFILE_FLAG_KEY_MAP)){const _0x1ed482=_0x587bad(_0x5166aa);if(!_0x1ed482)continue;_0x3ae221[_0x2fc321]=_0x2fc321===_0x568bbf(0x20c)?Number(_0x1ed482):_0x1ed482;}return _0x3ae221;}export function buildAppProfileListFields(_0x303969){const _0x556079=a169_0x483b99;return{'env':_0x303969[_0x556079(0x208)]??null,'apiDir':_0x303969[_0x556079(0x219)]??null,'hasCookie':!!_0x303969[_0x556079(0x20e)],'hasAccessKey':!!_0x303969[_0x556079(0x1f9)],'format':_0x303969['format']??null,'pageSize':_0x303969[_0x556079(0x20c)]??null,'riskLevel':_0x303969[_0x556079(0x200)]??null,'locale':_0x303969[_0x556079(0x217)]??null};}export function buildAppDoctorFields(_0x20216e,_0x24ec69){const _0x59a3b2=a169_0x483b99;return{'env':{'value':_0x20216e[_0x59a3b2(0x208)]||_0x24ec69[_0x59a3b2(0x208)],'source':_0x20216e[_0x59a3b2(0x208)]?_0x59a3b2(0x20a):_0x59a3b2(0x218)},'apiDir':{'value':_0x20216e[_0x59a3b2(0x219)]||_0x24ec69[_0x59a3b2(0x219)],'source':_0x20216e[_0x59a3b2(0x219)]?'app':_0x59a3b2(0x218)},'cookie':{'value':_0x20216e[_0x59a3b2(0x20e)]||_0x24ec69[_0x59a3b2(0x20e)],'source':_0x20216e[_0x59a3b2(0x20e)]?_0x59a3b2(0x20a):_0x59a3b2(0x218)},'accessKey':{'value':_0x20216e[_0x59a3b2(0x1f9)]||_0x24ec69[_0x59a3b2(0x1f9)],'source':_0x20216e[_0x59a3b2(0x1f9)]?_0x59a3b2(0x20a):_0x59a3b2(0x218)}};}export function buildCanonicalAppConfig(_0x45afea,_0x1b5df5){const _0x58c2e5=a169_0x483b99,_0x2de5b2=_0x45afea[_0x58c2e5(0x1fc)](_0xcb1fb6=>String(_0xcb1fb6||'')['trim']())[_0x58c2e5(0x1fd)](Boolean);if(_0x2de5b2[_0x58c2e5(0x1f5)]===0x0)return{};const _0x3370cb={};for(const _0x2ba7a4 of _0x2de5b2){_0x3370cb[_0x2ba7a4]=_0x1b5df5?{'appcode':_0x2ba7a4,'env':_0x1b5df5}:{'appcode':_0x2ba7a4};}return{'apps':_0x3370cb,'defaultApp':_0x2de5b2[0x0]};}export function buildCanonicalProjectConfig(_0x5c886e,_0x81d426){const _0x3d9fd1=a169_0x483b99,{appCodes:appCodes=[],env:_0x5fc23d,metadata:_0x3c6b89}=_0x81d426,_0x279776={..._0x5c886e,..._0x3c6b89||{}};delete _0x279776['appcode'],delete _0x279776['app'];if(_0x5fc23d)_0x279776['env']=_0x5fc23d;else!_0x279776[_0x3d9fd1(0x208)]&&(_0x279776[_0x3d9fd1(0x208)]=DEFAULT_CONFIG_VALUES['env']);const _0x291444=buildCanonicalAppConfig(appCodes,_0x279776[_0x3d9fd1(0x208)]);return Object[_0x3d9fd1(0x201)](_0x291444)[_0x3d9fd1(0x1f5)]>0x0&&(_0x279776['apps']=_0x291444['apps'],_0x279776['defaultApp']=_0x291444[_0x3d9fd1(0x20f)]),_0x279776;}const LOCALE_MAP={'zh':a169_0x483b99(0x209),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a169_0x483b99(0x1fe),'en-us':'en-US','en_us':a169_0x483b99(0x1fe)};export function normalizeLocale(_0x1188a5){const _0xcbdfb7=a169_0x483b99;if(!_0x1188a5)return null;return LOCALE_MAP[_0x1188a5[_0xcbdfb7(0x1fb)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a170_0xa027(){const _0x4a3a67=['137242ypEgFP','7ZCRTcR','4673034zlHcAK','14901795YFdQPS','97951GbFoan','1788cizaVE','840jqqveC','336mmVBbj','966YZEjgJ','47945bFaLat','10bjuvxQ','5885UuRCVA','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','140179FKaDmW','4kGgDBL'];a170_0xa027=function(){return _0x4a3a67;};return a170_0xa027();}const a170_0x2c8638=a170_0x1a13;(function(_0x1f605b,_0x5b0818){const _0xc33cbd=a170_0x1a13,_0x5f0206=_0x1f605b();while(!![]){try{const _0x19ce67=parseInt(_0xc33cbd(0x1a3))/0x1*(parseInt(_0xc33cbd(0x1a2))/0x2)+parseInt(_0xc33cbd(0x1a4))/0x3*(parseInt(_0xc33cbd(0x1b0))/0x4)+-parseInt(_0xc33cbd(0x1ab))/0x5*(parseInt(_0xc33cbd(0x1a8))/0x6)+parseInt(_0xc33cbd(0x1a6))/0x7*(-parseInt(_0xc33cbd(0x1a9))/0x8)+-parseInt(_0xc33cbd(0x1a5))/0x9*(-parseInt(_0xc33cbd(0x1ac))/0xa)+parseInt(_0xc33cbd(0x1ad))/0xb*(-parseInt(_0xc33cbd(0x1a7))/0xc)+-parseInt(_0xc33cbd(0x1af))/0xd*(parseInt(_0xc33cbd(0x1aa))/0xe);if(_0x19ce67===_0x5b0818)break;else _0x5f0206['push'](_0x5f0206['shift']());}catch(_0x5115ab){_0x5f0206['push'](_0x5f0206['shift']());}}}(a170_0xa027,0xe5760));function a170_0x1a13(_0x5c4572,_0x41a7b2){_0x5c4572=_0x5c4572-0x1a2;const _0xa0271d=a170_0xa027();let _0x1a13ac=_0xa0271d[_0x5c4572];return _0x1a13ac;}export const CLI_VERSION_POLICY_URL=a170_0x2c8638(0x1ae);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a167_0x680f(){const _0x1a2346=['Name','code','expected-count','yes','Force\x20overwrite','format','Apply\x20to\x20all','rabetbase','<code>','SQL\x20string','dbid','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Override\x20appcode','Page\x20number','operationType','Clear','118vmgqdN','title','help','32759860niNFHV','Read\x20value\x20from\x20environment\x20variable','description-file','18295LPKGcF','Confirm\x20destructive\x20action','Keyword\x20filter','project','keyword','functionNode','env','stdin','string','value','clear','Function\x20node','Code\x20filter','DB\x20ID','Watch\x20mode','datasetcode','Dataset\x20code','Output\x20format','description','Page\x20size','dry-run','SQL\x20code','verbose','Rabetbase\x20CLI','242505pSqyxv','target','global','Config\x20key','6CvduDm','Record\x20ID','fromEntries','confirm','enable-bff-save','Use\x20remote','Target\x20path','file','Environment','type','Skip\x20import\x20generation','Enable\x20BFF\x20save','operation-type','4987283zbTjNP','Config\x20value','output','sqlcode','operation','json\x20|\x20pretty\x20|\x20compress','remote','page','<name>','reveal','Title','8eOZypV','sql','non-interactive','2138115RXNpLr','Select\x20app\x20profile\x20by\x20name','appcode','function-node','2893940dPLNDZ','skip-imports','expectedCount','Alias\x20for\x20--non-interactive','sqlName','File\x20path','key','boolean','Type\x20filter','schemas','meowKey','Operation\x20type','pagesize','Tags','params','Verbose\x20output','dbId','skipImports','force','Reveal\x20sensitive\x20value','SQL\x20name','sql-name','sqlname','all','descriptionFile','name','watch','Force\x20non-interactive\x20mode\x20(CI)','Preview\x20operation\x20without\x20executing','11836521WvTklN','Use\x20project\x20config\x20scope','tags','fromEnv','app','@lovrabet/rabetbase-cli'];a167_0x680f=function(){return _0x1a2346;};return a167_0x680f();}const a167_0x1f567d=a167_0x1064;function a167_0x1064(_0x1c42a9,_0x534aa6){_0x1c42a9=_0x1c42a9-0x71;const _0x680f73=a167_0x680f();let _0x1064a4=_0x680f73[_0x1c42a9];return _0x1064a4;}(function(_0x16b4e8,_0x5ceafa){const _0x115690=a167_0x1064,_0x57d53d=_0x16b4e8();while(!![]){try{const _0x4af244=parseInt(_0x115690(0xae))/0x1*(parseInt(_0x115690(0xa8))/0x2)+-parseInt(_0x115690(0xc6))/0x3+parseInt(_0x115690(0x75))/0x4+parseInt(_0x115690(0x71))/0x5+-parseInt(_0x115690(0xca))/0x6*(-parseInt(_0x115690(0xd7))/0x7)+parseInt(_0x115690(0xe2))/0x8*(parseInt(_0x115690(0x92))/0x9)+-parseInt(_0x115690(0xab))/0xa;if(_0x4af244===_0x5ceafa)break;else _0x57d53d['push'](_0x57d53d['shift']());}catch(_0x241405){_0x57d53d['push'](_0x57d53d['shift']());}}}(a167_0x680f,0xdc0d2));export const CLI_BIN_NAME=a167_0x1f567d(0x9f);export const CLI_DISPLAY_NAME=a167_0x1f567d(0xc5);export const NPM_PACKAGE_NAME=a167_0x1f567d(0x97);export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a167_0x1f567d(0x73),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xa4),'hint':a167_0x1f567d(0xa0)},{'name':a167_0x1f567d(0x96),'meowKey':a167_0x1f567d(0x96),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x72),'hint':a167_0x1f567d(0xdf)},{'name':'env','meowKey':'env','type':'string','description':a167_0x1f567d(0xd2),'hint':'production\x20|\x20daily'},{'name':a167_0x1f567d(0x9d),'meowKey':a167_0x1f567d(0x9d),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xbf),'hint':a167_0x1f567d(0xdc)},{'name':'jq','meowKey':'jq','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xa3),'hint':'<expr>'},{'name':a167_0x1f567d(0xc2),'meowKey':'dryRun','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x91)},{'name':a167_0x1f567d(0x9b),'meowKey':a167_0x1f567d(0x9b),'type':'boolean','description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':'non-interactive','meowKey':'nonInteractive','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x90)},{'name':'global','meowKey':a167_0x1f567d(0xc8),'type':'boolean','description':'Use\x20global\x20config\x20scope'},{'name':'project','meowKey':a167_0x1f567d(0xb1),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x93)},{'name':'ci','meowKey':'ci','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x78),'hidden':!![]},{'name':a167_0x1f567d(0xaa),'meowKey':'help','type':a167_0x1f567d(0x7c),'description':'Show\x20help'},{'name':a167_0x1f567d(0x8e),'meowKey':a167_0x1f567d(0x8e),'type':'string','description':a167_0x1f567d(0x98),'hidden':!![]},{'name':'title','meowKey':a167_0x1f567d(0xa9),'type':'string','description':a167_0x1f567d(0xe1),'hidden':!![]},{'name':'clear','meowKey':a167_0x1f567d(0xb8),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xa7),'hidden':!![]},{'name':a167_0x1f567d(0x8f),'meowKey':a167_0x1f567d(0x8f),'type':'boolean','description':a167_0x1f567d(0xbc),'hidden':!![]},{'name':'output','meowKey':a167_0x1f567d(0xd9),'type':'string','description':'Output\x20path','hidden':!![]},{'name':a167_0x1f567d(0x83),'meowKey':'params','type':a167_0x1f567d(0xb6),'description':'JSON\x20params','hidden':!![]},{'name':a167_0x1f567d(0xbd),'meowKey':'datasetcode','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xbe),'hidden':!![]},{'name':a167_0x1f567d(0x8c),'meowKey':a167_0x1f567d(0x8c),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x9e),'hidden':!![]},{'name':a167_0x1f567d(0xce),'meowKey':'enableBffSave','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xd5),'hidden':!![]},{'name':'id','meowKey':'id','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xcb),'hidden':!![]},{'name':a167_0x1f567d(0xd3),'meowKey':'type','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x7d),'hidden':!![]},{'name':a167_0x1f567d(0xd1),'meowKey':a167_0x1f567d(0xd1),'type':'string','description':a167_0x1f567d(0x7a),'hidden':!![]},{'name':a167_0x1f567d(0xda),'meowKey':a167_0x1f567d(0xda),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xc3),'hidden':!![]},{'name':a167_0x1f567d(0x8a),'meowKey':a167_0x1f567d(0x79),'type':a167_0x1f567d(0xb6),'description':'SQL\x20name','hidden':!![]},{'name':a167_0x1f567d(0x8b),'meowKey':a167_0x1f567d(0x8b),'type':'string','description':a167_0x1f567d(0x89),'hidden':!![]},{'name':'db-id','meowKey':a167_0x1f567d(0x85),'type':a167_0x1f567d(0xb6),'description':'DB\x20ID','hidden':!![]},{'name':'dbid','meowKey':a167_0x1f567d(0xa2),'type':'string','description':a167_0x1f567d(0xbb),'hidden':!![]},{'name':a167_0x1f567d(0xc0),'meowKey':a167_0x1f567d(0xc0),'type':a167_0x1f567d(0xb6),'description':'Description','hidden':!![]},{'name':a167_0x1f567d(0xad),'meowKey':a167_0x1f567d(0x8d),'type':'string','description':'Description\x20file','hidden':!![]},{'name':a167_0x1f567d(0xde),'meowKey':a167_0x1f567d(0xde),'type':'string','description':a167_0x1f567d(0xa5),'hidden':!![]},{'name':a167_0x1f567d(0x81),'meowKey':a167_0x1f567d(0x81),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xc1),'hidden':!![]},{'name':a167_0x1f567d(0xb2),'meowKey':'keyword','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xb0),'hidden':!![]},{'name':a167_0x1f567d(0x99),'meowKey':a167_0x1f567d(0x99),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xba),'hidden':!![]},{'name':'sql','meowKey':a167_0x1f567d(0xe3),'type':'string','description':a167_0x1f567d(0xa1),'hidden':!![]},{'name':a167_0x1f567d(0x7e),'meowKey':a167_0x1f567d(0x7e),'type':a167_0x1f567d(0xb6),'description':'Schemas','hidden':!![]},{'name':'operation','meowKey':a167_0x1f567d(0xdb),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x80),'hidden':!![]},{'name':a167_0x1f567d(0xc7),'meowKey':a167_0x1f567d(0xc7),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xd0),'hidden':!![]},{'name':a167_0x1f567d(0x76),'meowKey':a167_0x1f567d(0x86),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xd4),'hidden':!![]},{'name':a167_0x1f567d(0x7b),'meowKey':a167_0x1f567d(0x7b),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xc9),'hidden':!![]},{'name':'value','meowKey':a167_0x1f567d(0xb7),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xd8),'hidden':!![]},{'name':a167_0x1f567d(0x94),'meowKey':a167_0x1f567d(0x94),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x82),'hidden':!![]},{'name':a167_0x1f567d(0xb5),'meowKey':'stdin','type':a167_0x1f567d(0x7c),'description':'Read\x20value\x20from\x20stdin','hidden':!![]},{'name':'from-env','meowKey':a167_0x1f567d(0x95),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xac),'hidden':!![]},{'name':a167_0x1f567d(0xe0),'meowKey':a167_0x1f567d(0xe0),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x88),'hidden':!![]},{'name':a167_0x1f567d(0x87),'meowKey':'force','type':'boolean','description':a167_0x1f567d(0x9c),'hidden':!![]},{'name':a167_0x1f567d(0xcd),'meowKey':a167_0x1f567d(0xcd),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xaf),'hidden':!![]},{'name':a167_0x1f567d(0xdd),'meowKey':a167_0x1f567d(0xdd),'type':'boolean','description':a167_0x1f567d(0xcf),'hidden':!![]},{'name':'verbose','meowKey':a167_0x1f567d(0xc4),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x84),'hidden':!![]},{'name':a167_0x1f567d(0x9a),'meowKey':a167_0x1f567d(0x77),'type':a167_0x1f567d(0xb6),'description':'Expected\x20affected\x20count','hidden':!![]},{'name':a167_0x1f567d(0xd6),'meowKey':a167_0x1f567d(0xa6),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x80),'hidden':!![]},{'name':a167_0x1f567d(0x74),'meowKey':a167_0x1f567d(0xb3),'type':'string','description':a167_0x1f567d(0xb9),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a167_0x1f567d(0x73),a167_0x1f567d(0x96),a167_0x1f567d(0xb4),a167_0x1f567d(0x9d),'jq','dry-run','yes',a167_0x1f567d(0xe4),'ci']);export function buildMeowFlags(){const _0x44c419=a167_0x1f567d;return Object[_0x44c419(0xcc)](GLOBAL_FLAGS['map'](_0x36977b=>[_0x36977b[_0x44c419(0x7f)],{'type':_0x36977b[_0x44c419(0xd3)]}]));}
|
|
1
|
+
const a171_0x3fdc65=a171_0x2463;(function(_0x29539e,_0x28fe2f){const _0x8351b9=a171_0x2463,_0x41dfd2=_0x29539e();while(!![]){try{const _0x11254e=parseInt(_0x8351b9(0x240))/0x1+-parseInt(_0x8351b9(0x21e))/0x2*(-parseInt(_0x8351b9(0x21a))/0x3)+parseInt(_0x8351b9(0x1e3))/0x4*(-parseInt(_0x8351b9(0x24b))/0x5)+parseInt(_0x8351b9(0x1db))/0x6*(-parseInt(_0x8351b9(0x1e5))/0x7)+-parseInt(_0x8351b9(0x1eb))/0x8*(-parseInt(_0x8351b9(0x23b))/0x9)+-parseInt(_0x8351b9(0x1d9))/0xa*(-parseInt(_0x8351b9(0x1da))/0xb)+parseInt(_0x8351b9(0x1f2))/0xc*(-parseInt(_0x8351b9(0x1ec))/0xd);if(_0x11254e===_0x28fe2f)break;else _0x41dfd2['push'](_0x41dfd2['shift']());}catch(_0xd8cd5c){_0x41dfd2['push'](_0x41dfd2['shift']());}}}(a171_0x245c,0xb5b98));export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME=a171_0x3fdc65(0x1fd);export const NPM_PACKAGE_NAME=a171_0x3fdc65(0x1f6);function a171_0x245c(){const _0x265ea1=['Verbose\x20output','Dataset\x20code','tags','sqlName','Record\x20ID','functionNode','app','sqlcode','key','reveal','11045CHYaSF','Page\x20size','output','dbid','datasetcode','Read\x20value\x20from\x20environment\x20variable','10ydopIT','14477639xsQrDZ','1674444FOqRIm','Code\x20filter','Environment','name','fromEntries','Tags','expectedCount','SQL\x20code','724AIpLKr','<name>','28GzNsAh','sql-name','all','stdin','meowKey','verbose','8SQUKCY','325rJBhrb','dbId','skip-imports','value','SQL\x20string','operation-type','660780lppMpm','Skip\x20import\x20generation','pagesize','format','@lovrabet/rabetbase-cli','Description','env','schemas','Type\x20filter','fromEnv','Config\x20key','Rabetbase\x20CLI','help','Override\x20appcode','Title','force','Target\x20path','Watch\x20mode','string','operationType','Function\x20node','SQL\x20name','global','operation','Keyword\x20filter','File\x20path','confirm','boolean','nonInteractive','<expr>','Clear','description','Name','Select\x20app\x20profile\x20by\x20name','map','Use\x20global\x20config\x20scope','Expected\x20affected\x20count','skipImports','JSON\x20params','Output\x20format','3782301nhquBg','sql','Schemas','production\x20|\x20daily','2ZTlxsF','yes','Force\x20non-interactive\x20mode\x20(CI)','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','watch','Description\x20file','code','page','non-interactive','title','db-id','Operation\x20type','Read\x20value\x20from\x20stdin','json\x20|\x20pretty\x20|\x20compress','appcode','Apply\x20to\x20all','project','enableBffSave','keyword','Use\x20remote','dryRun','DB\x20ID','type','Confirm\x20destructive\x20action','Use\x20project\x20config\x20scope','Enable\x20BFF\x20save','Alias\x20for\x20--non-interactive','params','dry-run','7697457fUhhdn','Output\x20path','expected-count','descriptionFile','target','204905gsFesK'];a171_0x245c=function(){return _0x265ea1;};return a171_0x245c();}export const GLOBAL_FLAGS=[{'name':a171_0x3fdc65(0x22c),'meowKey':a171_0x3fdc65(0x22c),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1ff),'hint':'<code>'},{'name':a171_0x3fdc65(0x247),'meowKey':a171_0x3fdc65(0x247),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x213),'hint':a171_0x3fdc65(0x1e4)},{'name':a171_0x3fdc65(0x1f8),'meowKey':a171_0x3fdc65(0x1f8),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1dd),'hint':a171_0x3fdc65(0x21d)},{'name':a171_0x3fdc65(0x1f5),'meowKey':a171_0x3fdc65(0x1f5),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x219),'hint':a171_0x3fdc65(0x22b)},{'name':'jq','meowKey':'jq','type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x221),'hint':a171_0x3fdc65(0x20f)},{'name':a171_0x3fdc65(0x23a),'meowKey':a171_0x3fdc65(0x232),'type':a171_0x3fdc65(0x20d),'description':'Preview\x20operation\x20without\x20executing'},{'name':a171_0x3fdc65(0x21f),'meowKey':a171_0x3fdc65(0x21f),'type':a171_0x3fdc65(0x20d),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a171_0x3fdc65(0x226),'meowKey':a171_0x3fdc65(0x20e),'type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x220)},{'name':a171_0x3fdc65(0x208),'meowKey':a171_0x3fdc65(0x208),'type':'boolean','description':a171_0x3fdc65(0x215)},{'name':a171_0x3fdc65(0x22e),'meowKey':a171_0x3fdc65(0x22e),'type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x236)},{'name':'ci','meowKey':'ci','type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x238),'hidden':!![]},{'name':a171_0x3fdc65(0x1fe),'meowKey':a171_0x3fdc65(0x1fe),'type':'boolean','description':'Show\x20help'},{'name':a171_0x3fdc65(0x1de),'meowKey':a171_0x3fdc65(0x1de),'type':'string','description':a171_0x3fdc65(0x212),'hidden':!![]},{'name':'title','meowKey':a171_0x3fdc65(0x227),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x200),'hidden':!![]},{'name':'clear','meowKey':'clear','type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x210),'hidden':!![]},{'name':'watch','meowKey':a171_0x3fdc65(0x222),'type':'boolean','description':a171_0x3fdc65(0x203),'hidden':!![]},{'name':a171_0x3fdc65(0x1d5),'meowKey':a171_0x3fdc65(0x1d5),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x23c),'hidden':!![]},{'name':a171_0x3fdc65(0x239),'meowKey':'params','type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x218),'hidden':!![]},{'name':a171_0x3fdc65(0x1d7),'meowKey':a171_0x3fdc65(0x1d7),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x242),'hidden':!![]},{'name':a171_0x3fdc65(0x1e7),'meowKey':a171_0x3fdc65(0x1e7),'type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x22d),'hidden':!![]},{'name':'enable-bff-save','meowKey':a171_0x3fdc65(0x22f),'type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x237),'hidden':!![]},{'name':'id','meowKey':'id','type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x245),'hidden':!![]},{'name':a171_0x3fdc65(0x234),'meowKey':a171_0x3fdc65(0x234),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1fa),'hidden':!![]},{'name':'file','meowKey':'file','type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x20b),'hidden':!![]},{'name':a171_0x3fdc65(0x248),'meowKey':'sqlcode','type':'string','description':a171_0x3fdc65(0x1e2),'hidden':!![]},{'name':a171_0x3fdc65(0x1e6),'meowKey':a171_0x3fdc65(0x244),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x207),'hidden':!![]},{'name':'sqlname','meowKey':'sqlname','type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x207),'hidden':!![]},{'name':a171_0x3fdc65(0x228),'meowKey':a171_0x3fdc65(0x1ed),'type':'string','description':a171_0x3fdc65(0x233),'hidden':!![]},{'name':a171_0x3fdc65(0x1d6),'meowKey':'dbid','type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x233),'hidden':!![]},{'name':'description','meowKey':a171_0x3fdc65(0x211),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1f7),'hidden':!![]},{'name':'description-file','meowKey':a171_0x3fdc65(0x23e),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x223),'hidden':!![]},{'name':a171_0x3fdc65(0x225),'meowKey':a171_0x3fdc65(0x225),'type':a171_0x3fdc65(0x204),'description':'Page\x20number','hidden':!![]},{'name':'pagesize','meowKey':a171_0x3fdc65(0x1f4),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1d4),'hidden':!![]},{'name':a171_0x3fdc65(0x230),'meowKey':a171_0x3fdc65(0x230),'type':'string','description':a171_0x3fdc65(0x20a),'hidden':!![]},{'name':'code','meowKey':a171_0x3fdc65(0x224),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1dc),'hidden':!![]},{'name':a171_0x3fdc65(0x21b),'meowKey':a171_0x3fdc65(0x21b),'type':'string','description':a171_0x3fdc65(0x1f0),'hidden':!![]},{'name':a171_0x3fdc65(0x1f9),'meowKey':a171_0x3fdc65(0x1f9),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x21c),'hidden':!![]},{'name':'operation','meowKey':a171_0x3fdc65(0x209),'type':'string','description':a171_0x3fdc65(0x229),'hidden':!![]},{'name':a171_0x3fdc65(0x23f),'meowKey':a171_0x3fdc65(0x23f),'type':'string','description':a171_0x3fdc65(0x202),'hidden':!![]},{'name':a171_0x3fdc65(0x1ee),'meowKey':a171_0x3fdc65(0x217),'type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x1f3),'hidden':!![]},{'name':a171_0x3fdc65(0x249),'meowKey':a171_0x3fdc65(0x249),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1fc),'hidden':!![]},{'name':a171_0x3fdc65(0x1ef),'meowKey':a171_0x3fdc65(0x1ef),'type':a171_0x3fdc65(0x204),'description':'Config\x20value','hidden':!![]},{'name':a171_0x3fdc65(0x243),'meowKey':a171_0x3fdc65(0x243),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1e0),'hidden':!![]},{'name':a171_0x3fdc65(0x1e8),'meowKey':'stdin','type':'boolean','description':a171_0x3fdc65(0x22a),'hidden':!![]},{'name':'from-env','meowKey':a171_0x3fdc65(0x1fb),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x1d8),'hidden':!![]},{'name':a171_0x3fdc65(0x24a),'meowKey':a171_0x3fdc65(0x24a),'type':a171_0x3fdc65(0x20d),'description':'Reveal\x20sensitive\x20value','hidden':!![]},{'name':a171_0x3fdc65(0x201),'meowKey':a171_0x3fdc65(0x201),'type':a171_0x3fdc65(0x20d),'description':'Force\x20overwrite','hidden':!![]},{'name':a171_0x3fdc65(0x20c),'meowKey':'confirm','type':'boolean','description':a171_0x3fdc65(0x235),'hidden':!![]},{'name':'remote','meowKey':'remote','type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x231),'hidden':!![]},{'name':a171_0x3fdc65(0x1ea),'meowKey':a171_0x3fdc65(0x1ea),'type':a171_0x3fdc65(0x20d),'description':a171_0x3fdc65(0x241),'hidden':!![]},{'name':a171_0x3fdc65(0x23d),'meowKey':a171_0x3fdc65(0x1e1),'type':a171_0x3fdc65(0x204),'description':a171_0x3fdc65(0x216),'hidden':!![]},{'name':a171_0x3fdc65(0x1f1),'meowKey':a171_0x3fdc65(0x205),'type':a171_0x3fdc65(0x204),'description':'Operation\x20type','hidden':!![]},{'name':'function-node','meowKey':a171_0x3fdc65(0x246),'type':'string','description':a171_0x3fdc65(0x206),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode','app',a171_0x3fdc65(0x1f8),'format','jq',a171_0x3fdc65(0x23a),'yes',a171_0x3fdc65(0x226),'ci']);function a171_0x2463(_0x43cd28,_0xaf844b){_0x43cd28=_0x43cd28-0x1d4;const _0x245cca=a171_0x245c();let _0x24633e=_0x245cca[_0x43cd28];return _0x24633e;}export function buildMeowFlags(){const _0x20961=a171_0x3fdc65;return Object[_0x20961(0x1df)](GLOBAL_FLAGS[_0x20961(0x214)](_0x4b5adb=>[_0x4b5adb[_0x20961(0x1e9)],{'type':_0x4b5adb['type']}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a172_0x4a8194=a172_0x18d8;(function(_0x27bfea,_0x247d48){const _0x207206=a172_0x18d8,_0x42a0e5=_0x27bfea();while(!![]){try{const _0x46c66f=-parseInt(_0x207206(0xe6))/0x1*(parseInt(_0x207206(0xe4))/0x2)+parseInt(_0x207206(0xe5))/0x3+parseInt(_0x207206(0xe2))/0x4+-parseInt(_0x207206(0xe8))/0x5*(parseInt(_0x207206(0xee))/0x6)+-parseInt(_0x207206(0xeb))/0x7+parseInt(_0x207206(0xe9))/0x8+parseInt(_0x207206(0xec))/0x9;if(_0x46c66f===_0x247d48)break;else _0x42a0e5['push'](_0x42a0e5['shift']());}catch(_0x301d32){_0x42a0e5['push'](_0x42a0e5['shift']());}}}(a172_0x4edf,0xca6eb));function a172_0x18d8(_0xb45ff0,_0x5702b6){_0xb45ff0=_0xb45ff0-0xe2;const _0x4edf62=a172_0x4edf();let _0x18d868=_0x4edf62[_0xb45ff0];return _0x18d868;}import{DEFAULT_API_DIR}from'../constant/paths.js';function a172_0x4edf(){const _0x108760=['3335295gDYpoA','1650805NHzkpo','compress','4317070Hzusqe','8175360NADkwJ','production','7545097xsasKj','18299142iHbhfr','en-US','6YvjbuA','1017320awccwI','high-risk-write','2KyoZbm'];a172_0x4edf=function(){return _0x108760;};return a172_0x4edf();}export const DEFAULT_CONFIG_VALUES={'env':a172_0x4a8194(0xea),'format':a172_0x4a8194(0xe7),'locale':a172_0x4a8194(0xed),'riskLevel':a172_0x4a8194(0xe3),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a172_0x4a8194(0xe7);
|