@lovrabet/rabetbase-cli 2.3.6-beta.1 → 2.3.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/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/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_0x1d4494=a156_0x1b6d;(function(_0x4f9ca9,_0x137f90){const _0x182932=a156_0x1b6d,_0x2b999d=_0x4f9ca9();while(!![]){try{const _0x33a843=-parseInt(_0x182932(0x176))/0x1*(parseInt(_0x182932(0x188))/0x2)+-parseInt(_0x182932(0x154))/0x3*(parseInt(_0x182932(0x177))/0x4)+-parseInt(_0x182932(0x165))/0x5+parseInt(_0x182932(0x18c))/0x6+-parseInt(_0x182932(0x179))/0x7*(-parseInt(_0x182932(0x166))/0x8)+-parseInt(_0x182932(0x18b))/0x9+parseInt(_0x182932(0x15f))/0xa*(parseInt(_0x182932(0x183))/0xb);if(_0x33a843===_0x137f90)break;else _0x2b999d['push'](_0x2b999d['shift']());}catch(_0x535696){_0x2b999d['push'](_0x2b999d['shift']());}}}(a156_0x1e39,0xa5401));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a156_0x1b6d(_0x4d7570,_0xf6a65c){_0x4d7570=_0x4d7570-0x152;const _0x1e39d6=a156_0x1e39();let _0x1b6d16=_0x1e39d6[_0x4d7570];return _0x1b6d16;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';function a156_0x1e39(){const _0x2efbcc=['boolean','toISOString','catch','\x20written,\x20','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','22655290wwKTwb','mybatisXml','appCode','would_pull','replace','\x20skipped,\x20','6624325ABWzil','8052280jxRJpq','local\x20differs\x20from\x20remote','length','Would\x20pull\x20','conflict','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','test','string','sqlName','totalCount','lastSync','dbId','skipped','bool','sql','sqlContent','6yhopKw','2356308SyVdBQ','cancelled','7cNxBid','apps','write','force','POST','sqlCode','lockFilePath','filter','nonInteractive','name','11uJBwpe','Pull\x20complete:\x20','utf8','split','description','6728aSbdsr','sqlcode','sqlRootDir','10216377IaEYnS','2844480gBpJyf','paging','pull','sqls','push','3czzQsu','message','sqlRoot','str','trimStart','Force\x20pull\x20cancelled.'];a156_0x1e39=function(){return _0x2efbcc;};return a156_0x1e39();}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(_0x261941,_0x17f9c2){const _0x360c0a=a156_0x1b6d,_0x2368f9=[];let _0x565432=0x1;while(!![]){const _0x163645=await listSqlQueries(_0x261941,{'currentPage':_0x565432,'pageSize':PAGE_SIZE,'sqlCode':_0x17f9c2[_0x360c0a(0x17e)],'sqlName':_0x17f9c2[_0x360c0a(0x16e)]}),_0x26f7d8=_0x163645['tableData']??[];_0x2368f9['push'](..._0x26f7d8);if(_0x26f7d8[_0x360c0a(0x168)]===0x0)break;const _0x41e93a=_0x163645[_0x360c0a(0x18d)]?.[_0x360c0a(0x16f)];if(_0x41e93a!=null?_0x2368f9['length']>=_0x41e93a:_0x26f7d8['length']<PAGE_SIZE)break;_0x565432++;}return _0x2368f9;}async function ensureSqlContent(_0x50b65a){const _0x202a03=a156_0x1b6d;if(_0x50b65a[_0x202a03(0x175)]!=null&&String(_0x50b65a['sqlContent'])[_0x202a03(0x168)]>0x0)return _0x50b65a;return getSqlQueryDetail(_0x50b65a[_0x202a03(0x17e)]);}export const sqlPull={'service':a156_0x1d4494(0x174),'command':a156_0x1d4494(0x18e),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a156_0x1d4494(0x17b),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a156_0x1d4494(0x182),'type':a156_0x1d4494(0x16d),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a156_0x1d4494(0x17c),'type':a156_0x1d4494(0x15a),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4e5a6b){const _0x4558af=a156_0x1d4494,_0x37aba2=loadSqlProjectConfig(_0x4e5a6b[_0x4558af(0x161)]),_0x1fb94f=await readSqlLockFile(_0x37aba2[_0x4558af(0x17f)]),{appLock:_0x378e45}=ensureSqlLockScope(_0x1fb94f??createEmptySqlLock(),_0x37aba2[_0x4558af(0x161)],_0x37aba2[_0x4558af(0x156)],_0x4558af(0x18e)),_0x58bbb8=await fetchAllSqlQueries(_0x4e5a6b['appCode'],{'sqlCode':_0x4e5a6b[_0x4558af(0x157)](_0x4558af(0x189))||undefined,'sqlName':_0x4e5a6b[_0x4558af(0x157)](_0x4558af(0x182))||undefined}),_0x3794ce=[];for(const _0x26af6d of _0x58bbb8){const _0x4f492e=await ensureSqlContent(_0x26af6d),_0x51a37e=ensureRemoteSqlContent(_0x4f492e),_0x3db1d8=detectModeFromSql(_0x4f492e),_0x4dc8b1=_0x4f492e[_0x4558af(0x171)]?await getDbName(_0x4e5a6b['appCode'],Number(_0x4f492e[_0x4558af(0x171)]))['catch'](()=>undefined):undefined,_0x5c2876=buildLocalSqlFileContent({'sqlCode':_0x4f492e[_0x4558af(0x17e)],'sqlName':_0x4f492e[_0x4558af(0x16e)],'dbId':_0x4f492e['dbId']},_0x51a37e,{'dbName':_0x4dc8b1,'mode':_0x3db1d8,'syncedAt':new Date()[_0x4558af(0x15b)](),'description':_0x4f492e[_0x4558af(0x187)]}),_0x285671=buildSqlLockEntry(_0x4f492e,_0x51a37e,'',{'dbName':_0x4dc8b1}),_0x35d5ea=resolveLocalSqlFilePath(_0x37aba2,_0x4f492e[_0x4558af(0x17e)],_0x285671);let _0x3b35e8=_0x4558af(0x162),_0x456520;if(await fileExists(_0x35d5ea)){const _0x4e4bf9=await readFile(_0x35d5ea,_0x4558af(0x185));isEquivalentPulledSqlFile(_0x4e4bf9,_0x5c2876,_0x3db1d8)?(_0x3b35e8=_0x4558af(0x172),_0x456520='unchanged'):(_0x3b35e8=_0x4558af(0x16a),_0x456520=_0x4558af(0x15e));}_0x3794ce[_0x4558af(0x153)]({'sqlCode':_0x4f492e[_0x4558af(0x17e)],'sqlName':_0x4f492e['sqlName'],'filePath':_0x35d5ea,'status':_0x3b35e8,'reason':_0x456520});}return{'method':_0x4558af(0x17d),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x4e5a6b[_0x4558af(0x161)],'sqlCode':_0x4e5a6b[_0x4558af(0x157)](_0x4558af(0x189))||null,'sqlName':_0x4e5a6b[_0x4558af(0x157)](_0x4558af(0x182))||null,'files':_0x3794ce},'description':_0x4558af(0x169)+_0x3794ce['length']+'\x20SQL\x20file(s)\x20into\x20'+_0x37aba2[_0x4558af(0x18a)]};},async 'execute'(_0x6c54da){const _0xa8a25b=a156_0x1d4494,_0x468c3d=loadSqlProjectConfig(_0x6c54da['appCode']),_0xff5a85=await readSqlLockFile(_0x468c3d[_0xa8a25b(0x17f)]),{lockData:_0x4aafac,appLock:_0x4d25cd}=ensureSqlLockScope(_0xff5a85??createEmptySqlLock(),_0x468c3d[_0xa8a25b(0x161)],_0x468c3d[_0xa8a25b(0x156)],_0xa8a25b(0x18e)),_0x283b46=_0x6c54da[_0xa8a25b(0x173)]('force'),_0xa99af0=await fetchAllSqlQueries(_0x6c54da[_0xa8a25b(0x161)],{'sqlCode':_0x6c54da[_0xa8a25b(0x157)](_0xa8a25b(0x189))||undefined,'sqlName':_0x6c54da[_0xa8a25b(0x157)]('name')||undefined});if(_0xa99af0[_0xa8a25b(0x168)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x55efa5=[],_0x186241=[];for(const _0x30b3f1 of _0xa99af0){try{_0x55efa5[_0xa8a25b(0x153)](await ensureSqlContent(_0x30b3f1));}catch(_0x3a267d){_0x186241[_0xa8a25b(0x153)]({'sqlCode':_0x30b3f1[_0xa8a25b(0x17e)],'error':_0x3a267d instanceof Error?_0x3a267d[_0xa8a25b(0x155)]:String(_0x3a267d)});}}if(_0x283b46&&!_0x6c54da[_0xa8a25b(0x181)]){let _0x39d5ab=![];for(const _0x44f425 of _0x55efa5){const _0x561dc5=detectModeFromSql(_0x44f425),_0x28d261=_0x44f425['dbId']?await getDbName(_0x6c54da[_0xa8a25b(0x161)],Number(_0x44f425[_0xa8a25b(0x171)]))[_0xa8a25b(0x15c)](()=>undefined):undefined,_0x272e4c=buildLocalSqlFileContent({'sqlCode':_0x44f425[_0xa8a25b(0x17e)],'sqlName':_0x44f425['sqlName'],'dbId':_0x44f425[_0xa8a25b(0x171)]},ensureRemoteSqlContent(_0x44f425),{'dbName':_0x28d261,'mode':_0x561dc5,'syncedAt':new Date()['toISOString'](),'description':_0x44f425[_0xa8a25b(0x187)]}),_0x3a4e8b=resolveLocalSqlFilePath(_0x468c3d,_0x44f425[_0xa8a25b(0x17e)],buildSqlLockEntry(_0x44f425,ensureRemoteSqlContent(_0x44f425),'',{'dbName':_0x28d261}));if(await fileExists(_0x3a4e8b)){const _0x224f5f=await readFile(_0x3a4e8b,_0xa8a25b(0x185));if(!isEquivalentPulledSqlFile(_0x224f5f,_0x272e4c,_0x561dc5)){_0x39d5ab=!![];break;}}}if(_0x39d5ab){const _0x37a83b=await confirmForceOverwrite(_0xa8a25b(0x16b));if(!_0x37a83b)throw CliErrors[_0xa8a25b(0x178)](_0xa8a25b(0x159));}}const _0x379c66=cloneSqlLockData(_0x4aafac),_0x41617b=_0x379c66[_0xa8a25b(0x17a)][_0x468c3d[_0xa8a25b(0x161)]],_0x5e1cc2=[],_0x307062=[];for(const _0x44fd65 of _0x55efa5){const _0x5d2930=_0x41617b['sqls'][_0x44fd65[_0xa8a25b(0x17e)]],_0x146600=ensureRemoteSqlContent(_0x44fd65),_0x135ed6=detectModeFromSql(_0x44fd65),_0x27f29a=_0x44fd65['dbId']?await getDbName(_0x6c54da[_0xa8a25b(0x161)],Number(_0x44fd65[_0xa8a25b(0x171)]))[_0xa8a25b(0x15c)](()=>undefined):undefined,_0x32be88=buildLocalSqlFileContent({'sqlCode':_0x44fd65[_0xa8a25b(0x17e)],'sqlName':_0x44fd65[_0xa8a25b(0x16e)],'dbId':_0x44fd65['dbId']},_0x146600,{'dbName':_0x27f29a,'mode':_0x135ed6,'syncedAt':new Date()[_0xa8a25b(0x15b)](),'description':_0x44fd65[_0xa8a25b(0x187)]}),_0xf34a27=buildSqlLockEntry(_0x44fd65,_0x146600,computeSqlContentHash(_0x32be88),{'dbName':_0x27f29a}),_0x104a71=_0xf34a27['path'],_0x48b8b1=join(_0x468c3d[_0xa8a25b(0x18a)],_0x104a71);try{if(await fileExists(_0x48b8b1)){const _0x11b90a=await readFile(_0x48b8b1,'utf8');if(isEquivalentPulledSqlFile(_0x11b90a,_0x32be88,_0x135ed6)){_0x307062[_0xa8a25b(0x153)]({'sqlCode':_0x44fd65[_0xa8a25b(0x17e)],'reason':'unchanged'}),_0x41617b[_0xa8a25b(0x152)][_0x44fd65[_0xa8a25b(0x17e)]]={..._0xf34a27,'hash':computeSqlContentHash(_0x11b90a),'path':_0x104a71};continue;}if(!_0x283b46){_0x307062['push']({'sqlCode':_0x44fd65[_0xa8a25b(0x17e)],'reason':_0xa8a25b(0x167)});continue;}}const _0x1ed9bc=_0x5d2930?.['path']?join(_0x468c3d[_0xa8a25b(0x18a)],_0x5d2930['path']):undefined;_0x1ed9bc&&_0x1ed9bc!==_0x48b8b1&&await fileExists(_0x1ed9bc)&&await rm(_0x1ed9bc,{'force':!![]}),await ensureParentDirectory(_0x48b8b1),await writeFile(_0x48b8b1,_0x32be88,_0xa8a25b(0x185)),_0x41617b[_0xa8a25b(0x152)][_0x44fd65['sqlCode']]={..._0xf34a27,'path':_0x104a71},_0x5e1cc2[_0xa8a25b(0x153)]({'sqlCode':_0x44fd65[_0xa8a25b(0x17e)],'filePath':_0x48b8b1});}catch(_0x5c5065){_0x186241[_0xa8a25b(0x153)]({'sqlCode':_0x44fd65[_0xa8a25b(0x17e)],'error':_0x5c5065 instanceof Error?_0x5c5065[_0xa8a25b(0x155)]:String(_0x5c5065)});}}return _0x41617b[_0xa8a25b(0x170)]=new Date()['toISOString'](),await writeSqlLockFile(_0x468c3d[_0xa8a25b(0x17f)],_0x379c66),{'ok':_0x186241['length']===0x0,'data':{'pulled':_0x5e1cc2,'skipped':_0x307062,'failed':_0x186241},'message':_0xa8a25b(0x184)+_0x5e1cc2[_0xa8a25b(0x168)]+_0xa8a25b(0x15d)+_0x307062[_0xa8a25b(0x168)]+_0xa8a25b(0x164)+_0x186241['length']+'\x20failed'};}};function detectModeFromSql(_0x15c34f){const _0x504ff9=a156_0x1d4494,_0x4bc26e=ensureRemoteSqlContent(_0x15c34f),_0x18b311=stripLocalSqlMetadata(_0x4bc26e,'mybatisXml')[_0x504ff9(0x158)]();if(/^<(select|insert|update|delete)\b/i[_0x504ff9(0x16c)](_0x18b311))return _0x504ff9(0x160);return'sql';}function isEquivalentPulledSqlFile(_0x4c5f51,_0x4db224,_0x91a4a2){return normalizePullComparableContent(_0x4c5f51,_0x91a4a2)===normalizePullComparableContent(_0x4db224,_0x91a4a2);}function normalizePullComparableContent(_0x479fad,_0x5a090c){const _0x384fb7=a156_0x1d4494,_0x1c7241=_0x479fad[_0x384fb7(0x163)](/\r\n/g,'\x0a')[_0x384fb7(0x186)]('\x0a'),_0x2113b0=_0x1c7241[_0x384fb7(0x180)](_0x176c9e=>!isSyncedAtMetadataLine(_0x176c9e,_0x5a090c));return _0x2113b0['join']('\x0a');}function isSyncedAtMetadataLine(_0x9224c3,_0x4e9181){const _0x2277be=a156_0x1d4494;if(_0x4e9181===_0x2277be(0x160))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x2277be(0x16c)](_0x9224c3);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x9224c3);}
|
|
1
|
+
const a158_0x36f9dc=a158_0x5ff6;(function(_0x5eaee1,_0x3f1d0e){const _0x31747d=a158_0x5ff6,_0x45321b=_0x5eaee1();while(!![]){try{const _0x412cbd=-parseInt(_0x31747d(0xaf))/0x1*(-parseInt(_0x31747d(0xe2))/0x2)+-parseInt(_0x31747d(0xaa))/0x3*(-parseInt(_0x31747d(0xad))/0x4)+-parseInt(_0x31747d(0xba))/0x5*(parseInt(_0x31747d(0xab))/0x6)+parseInt(_0x31747d(0xcb))/0x7*(-parseInt(_0x31747d(0xde))/0x8)+-parseInt(_0x31747d(0xd9))/0x9*(-parseInt(_0x31747d(0xdc))/0xa)+-parseInt(_0x31747d(0xe5))/0xb*(parseInt(_0x31747d(0xe3))/0xc)+-parseInt(_0x31747d(0xd3))/0xd*(-parseInt(_0x31747d(0xd5))/0xe);if(_0x412cbd===_0x3f1d0e)break;else _0x45321b['push'](_0x45321b['shift']());}catch(_0x833faf){_0x45321b['push'](_0x45321b['shift']());}}}(a158_0x2550,0x41220));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a158_0x2550(){const _0x465858=['local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','bool','nonInteractive','217365xawggd','description','utf8','join','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','str','string','sqlcode','replace','tableData','toISOString','path','sqlName','sqlCode','appCode','filter','\x20written,\x20','1862VFiMKk','lastSync','apps','unchanged','trimStart','cancelled','message','catch','6929JKvDBF','test','14434VJQPUC','No\x20remote\x20SQL\x20queries\x20matched.','conflict','sql','69453UmfXgY','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','push','110RnRqFF','lockFilePath','9560QtoUsm','sqlRoot','sqlContent','sqls','1908EzBbjQ','78612JrrCJf','split','649ICMPeJ','pull','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','write','Force\x20overwrite\x20local\x20unsynced\x20changes','501eClkbt','66FrImgp','dbId','11568KVQxrz','Filter\x20by\x20SQL\x20display\x20name','348nPKHFs','length','mybatisXml','Pull\x20complete:\x20','name','force','local\x20differs\x20from\x20remote','Force\x20pull\x20cancelled.'];a158_0x2550=function(){return _0x465858;};return a158_0x2550();}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';function a158_0x5ff6(_0x11aaae,_0x484bf1){_0x11aaae=_0x11aaae-0xa9;const _0x2550a5=a158_0x2550();let _0x5ff666=_0x2550a5[_0x11aaae];return _0x5ff666;}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(_0x4c5f0c,_0x246bde){const _0x21333c=a158_0x5ff6,_0x59dd9d=[];let _0x4a46cc=0x1;while(!![]){const _0x3f0fc2=await listSqlQueries(_0x4c5f0c,{'currentPage':_0x4a46cc,'pageSize':PAGE_SIZE,'sqlCode':_0x246bde['sqlCode'],'sqlName':_0x246bde['sqlName']}),_0x31004d=_0x3f0fc2[_0x21333c(0xc3)]??[];_0x59dd9d[_0x21333c(0xdb)](..._0x31004d);if(_0x31004d[_0x21333c(0xb0)]===0x0)break;const _0x3a5317=_0x3f0fc2['paging']?.['totalCount'];if(_0x3a5317!=null?_0x59dd9d['length']>=_0x3a5317:_0x31004d['length']<PAGE_SIZE)break;_0x4a46cc++;}return _0x59dd9d;}async function ensureSqlContent(_0x461d85){const _0x3b70c3=a158_0x5ff6;if(_0x461d85['sqlContent']!=null&&String(_0x461d85[_0x3b70c3(0xe0)])[_0x3b70c3(0xb0)]>0x0)return _0x461d85;return getSqlQueryDetail(_0x461d85[_0x3b70c3(0xc7)]);}export const sqlPull={'service':a158_0x36f9dc(0xd8),'command':'pull','description':a158_0x36f9dc(0xbe),'risk':a158_0x36f9dc(0xe8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a158_0x36f9dc(0xb3),'type':a158_0x36f9dc(0xc0),'description':a158_0x36f9dc(0xae)},{'name':a158_0x36f9dc(0xb4),'type':'boolean','description':a158_0x36f9dc(0xa9)}],async 'dryRun'(_0x30b7e0){const _0x45c60b=a158_0x36f9dc,_0x25cce7=loadSqlProjectConfig(_0x30b7e0['appCode']),_0x3c5983=await readSqlLockFile(_0x25cce7[_0x45c60b(0xdd)]),{appLock:_0x359c9c}=ensureSqlLockScope(_0x3c5983??createEmptySqlLock(),_0x25cce7[_0x45c60b(0xc8)],_0x25cce7[_0x45c60b(0xdf)],_0x45c60b(0xe6)),_0x596f31=await fetchAllSqlQueries(_0x30b7e0[_0x45c60b(0xc8)],{'sqlCode':_0x30b7e0[_0x45c60b(0xbf)](_0x45c60b(0xc1))||undefined,'sqlName':_0x30b7e0['str'](_0x45c60b(0xb3))||undefined}),_0x295d25=[];for(const _0x3df544 of _0x596f31){const _0x2740bc=await ensureSqlContent(_0x3df544),_0x371c60=ensureRemoteSqlContent(_0x2740bc),_0x53bdce=detectModeFromSql(_0x2740bc),_0x4424e0=_0x2740bc[_0x45c60b(0xac)]?await getDbName(_0x30b7e0[_0x45c60b(0xc8)],Number(_0x2740bc['dbId']))[_0x45c60b(0xd2)](()=>undefined):undefined,_0x4618a8=buildLocalSqlFileContent({'sqlCode':_0x2740bc[_0x45c60b(0xc7)],'sqlName':_0x2740bc[_0x45c60b(0xc6)],'dbId':_0x2740bc[_0x45c60b(0xac)]},_0x371c60,{'dbName':_0x4424e0,'mode':_0x53bdce,'syncedAt':new Date()[_0x45c60b(0xc4)](),'description':_0x2740bc[_0x45c60b(0xbb)]}),_0x4ff6f6=buildSqlLockEntry(_0x2740bc,_0x371c60,'',{'dbName':_0x4424e0}),_0x429e10=resolveLocalSqlFilePath(_0x25cce7,_0x2740bc[_0x45c60b(0xc7)],_0x4ff6f6);let _0x263988='would_pull',_0x51093a;if(await fileExists(_0x429e10)){const _0x4a9d3c=await readFile(_0x429e10,_0x45c60b(0xbc));isEquivalentPulledSqlFile(_0x4a9d3c,_0x4618a8,_0x53bdce)?(_0x263988='skipped',_0x51093a=_0x45c60b(0xce)):(_0x263988=_0x45c60b(0xd7),_0x51093a=_0x45c60b(0xb7));}_0x295d25[_0x45c60b(0xdb)]({'sqlCode':_0x2740bc[_0x45c60b(0xc7)],'sqlName':_0x2740bc[_0x45c60b(0xc6)],'filePath':_0x429e10,'status':_0x263988,'reason':_0x51093a});}return{'method':'POST','url':_0x45c60b(0xda),'body':{'appCode':_0x30b7e0[_0x45c60b(0xc8)],'sqlCode':_0x30b7e0[_0x45c60b(0xbf)](_0x45c60b(0xc1))||null,'sqlName':_0x30b7e0[_0x45c60b(0xbf)](_0x45c60b(0xb3))||null,'files':_0x295d25},'description':'Would\x20pull\x20'+_0x295d25[_0x45c60b(0xb0)]+'\x20SQL\x20file(s)\x20into\x20'+_0x25cce7['sqlRootDir']};},async 'execute'(_0x5c0ba4){const _0x147bd2=a158_0x36f9dc,_0x278263=loadSqlProjectConfig(_0x5c0ba4[_0x147bd2(0xc8)]),_0x10b4b8=await readSqlLockFile(_0x278263[_0x147bd2(0xdd)]),{lockData:_0x4063e8,appLock:_0xea551f}=ensureSqlLockScope(_0x10b4b8??createEmptySqlLock(),_0x278263['appCode'],_0x278263['sqlRoot'],_0x147bd2(0xe6)),_0xf92904=_0x5c0ba4[_0x147bd2(0xb8)](_0x147bd2(0xb4)),_0x3e8f56=await fetchAllSqlQueries(_0x5c0ba4['appCode'],{'sqlCode':_0x5c0ba4['str'](_0x147bd2(0xc1))||undefined,'sqlName':_0x5c0ba4[_0x147bd2(0xbf)](_0x147bd2(0xb3))||undefined});if(_0x3e8f56[_0x147bd2(0xb0)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x147bd2(0xd6)};const _0x308fdb=[],_0x8d6673=[];for(const _0x24d239 of _0x3e8f56){try{_0x308fdb[_0x147bd2(0xdb)](await ensureSqlContent(_0x24d239));}catch(_0x144b2a){_0x8d6673[_0x147bd2(0xdb)]({'sqlCode':_0x24d239['sqlCode'],'error':_0x144b2a instanceof Error?_0x144b2a[_0x147bd2(0xd1)]:String(_0x144b2a)});}}if(_0xf92904&&!_0x5c0ba4[_0x147bd2(0xb9)]){let _0x3c7145=![];for(const _0x2226c6 of _0x308fdb){const _0x45c015=detectModeFromSql(_0x2226c6),_0x453304=_0x2226c6[_0x147bd2(0xac)]?await getDbName(_0x5c0ba4['appCode'],Number(_0x2226c6[_0x147bd2(0xac)]))[_0x147bd2(0xd2)](()=>undefined):undefined,_0x1ff584=buildLocalSqlFileContent({'sqlCode':_0x2226c6[_0x147bd2(0xc7)],'sqlName':_0x2226c6[_0x147bd2(0xc6)],'dbId':_0x2226c6[_0x147bd2(0xac)]},ensureRemoteSqlContent(_0x2226c6),{'dbName':_0x453304,'mode':_0x45c015,'syncedAt':new Date()[_0x147bd2(0xc4)](),'description':_0x2226c6['description']}),_0x118e1a=resolveLocalSqlFilePath(_0x278263,_0x2226c6[_0x147bd2(0xc7)],buildSqlLockEntry(_0x2226c6,ensureRemoteSqlContent(_0x2226c6),'',{'dbName':_0x453304}));if(await fileExists(_0x118e1a)){const _0x12b81e=await readFile(_0x118e1a,'utf8');if(!isEquivalentPulledSqlFile(_0x12b81e,_0x1ff584,_0x45c015)){_0x3c7145=!![];break;}}}if(_0x3c7145){const _0x11aede=await confirmForceOverwrite(_0x147bd2(0xe7));if(!_0x11aede)throw CliErrors[_0x147bd2(0xd0)](_0x147bd2(0xb6));}}const _0x4eca2a=cloneSqlLockData(_0x4063e8),_0x1605d8=_0x4eca2a[_0x147bd2(0xcd)][_0x278263[_0x147bd2(0xc8)]],_0x32e46c=[],_0x2bef38=[];for(const _0x285f57 of _0x308fdb){const _0x377a15=_0x1605d8[_0x147bd2(0xe1)][_0x285f57[_0x147bd2(0xc7)]],_0x462834=ensureRemoteSqlContent(_0x285f57),_0x4cb2da=detectModeFromSql(_0x285f57),_0x614c7d=_0x285f57['dbId']?await getDbName(_0x5c0ba4[_0x147bd2(0xc8)],Number(_0x285f57['dbId']))[_0x147bd2(0xd2)](()=>undefined):undefined,_0x52dee4=buildLocalSqlFileContent({'sqlCode':_0x285f57[_0x147bd2(0xc7)],'sqlName':_0x285f57[_0x147bd2(0xc6)],'dbId':_0x285f57[_0x147bd2(0xac)]},_0x462834,{'dbName':_0x614c7d,'mode':_0x4cb2da,'syncedAt':new Date()[_0x147bd2(0xc4)](),'description':_0x285f57[_0x147bd2(0xbb)]}),_0x117a78=buildSqlLockEntry(_0x285f57,_0x462834,computeSqlContentHash(_0x52dee4),{'dbName':_0x614c7d}),_0x250a5a=_0x117a78[_0x147bd2(0xc5)],_0x4c2771=join(_0x278263['sqlRootDir'],_0x250a5a);try{if(await fileExists(_0x4c2771)){const _0x5de895=await readFile(_0x4c2771,_0x147bd2(0xbc));if(isEquivalentPulledSqlFile(_0x5de895,_0x52dee4,_0x4cb2da)){_0x2bef38['push']({'sqlCode':_0x285f57['sqlCode'],'reason':'unchanged'}),_0x1605d8['sqls'][_0x285f57[_0x147bd2(0xc7)]]={..._0x117a78,'hash':computeSqlContentHash(_0x5de895),'path':_0x250a5a};continue;}if(!_0xf92904){_0x2bef38[_0x147bd2(0xdb)]({'sqlCode':_0x285f57['sqlCode'],'reason':_0x147bd2(0xb5)});continue;}}const _0x2cac30=_0x377a15?.[_0x147bd2(0xc5)]?join(_0x278263['sqlRootDir'],_0x377a15[_0x147bd2(0xc5)]):undefined;_0x2cac30&&_0x2cac30!==_0x4c2771&&await fileExists(_0x2cac30)&&await rm(_0x2cac30,{'force':!![]}),await ensureParentDirectory(_0x4c2771),await writeFile(_0x4c2771,_0x52dee4,_0x147bd2(0xbc)),_0x1605d8[_0x147bd2(0xe1)][_0x285f57['sqlCode']]={..._0x117a78,'path':_0x250a5a},_0x32e46c[_0x147bd2(0xdb)]({'sqlCode':_0x285f57[_0x147bd2(0xc7)],'filePath':_0x4c2771});}catch(_0x4c1acd){_0x8d6673['push']({'sqlCode':_0x285f57['sqlCode'],'error':_0x4c1acd instanceof Error?_0x4c1acd[_0x147bd2(0xd1)]:String(_0x4c1acd)});}}return _0x1605d8[_0x147bd2(0xcc)]=new Date()[_0x147bd2(0xc4)](),await writeSqlLockFile(_0x278263[_0x147bd2(0xdd)],_0x4eca2a),{'ok':_0x8d6673[_0x147bd2(0xb0)]===0x0,'data':{'pulled':_0x32e46c,'skipped':_0x2bef38,'failed':_0x8d6673},'message':_0x147bd2(0xb2)+_0x32e46c[_0x147bd2(0xb0)]+_0x147bd2(0xca)+_0x2bef38[_0x147bd2(0xb0)]+'\x20skipped,\x20'+_0x8d6673[_0x147bd2(0xb0)]+'\x20failed'};}};function detectModeFromSql(_0x331577){const _0x26867a=a158_0x36f9dc,_0x5acbc8=ensureRemoteSqlContent(_0x331577),_0x460b5a=stripLocalSqlMetadata(_0x5acbc8,_0x26867a(0xb1))[_0x26867a(0xcf)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x460b5a))return _0x26867a(0xb1);return _0x26867a(0xd8);}function isEquivalentPulledSqlFile(_0x4c75c6,_0x3b879f,_0x408c40){return normalizePullComparableContent(_0x4c75c6,_0x408c40)===normalizePullComparableContent(_0x3b879f,_0x408c40);}function normalizePullComparableContent(_0x5e4397,_0x470526){const _0x13c012=a158_0x36f9dc,_0x4d5e0b=_0x5e4397[_0x13c012(0xc2)](/\r\n/g,'\x0a')[_0x13c012(0xe4)]('\x0a'),_0xe6fce2=_0x4d5e0b[_0x13c012(0xc9)](_0x30c37e=>!isSyncedAtMetadataLine(_0x30c37e,_0x470526));return _0xe6fce2[_0x13c012(0xbd)]('\x0a');}function isSyncedAtMetadataLine(_0x212b77,_0x4c8314){const _0x44e873=a158_0x36f9dc;if(_0x4c8314===_0x44e873(0xb1))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x44e873(0xd4)](_0x212b77);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x212b77);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a157_0x30af38=a157_0x24b1;(function(_0x4d2c95,_0x48b3f4){const _0x50122e=a157_0x24b1,_0x20b9ae=_0x4d2c95();while(!![]){try{const _0x2851b3=-parseInt(_0x50122e(0x1c4))/0x1+-parseInt(_0x50122e(0x19d))/0x2*(-parseInt(_0x50122e(0x1bb))/0x3)+parseInt(_0x50122e(0x1bd))/0x4+parseInt(_0x50122e(0x199))/0x5*(-parseInt(_0x50122e(0x1cc))/0x6)+parseInt(_0x50122e(0x1d9))/0x7*(parseInt(_0x50122e(0x1ba))/0x8)+-parseInt(_0x50122e(0x1ac))/0x9*(-parseInt(_0x50122e(0x1c5))/0xa)+-parseInt(_0x50122e(0x1b2))/0xb;if(_0x2851b3===_0x48b3f4)break;else _0x20b9ae['push'](_0x20b9ae['shift']());}catch(_0x373bbd){_0x20b9ae['push'](_0x20b9ae['shift']());}}}(a157_0x2ea8,0xefaf7));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';function a157_0x24b1(_0x166332,_0x3a1614){_0x166332=_0x166332-0x199;const _0x2ea8d7=a157_0x2ea8();let _0x24b100=_0x2ea8d7[_0x166332];return _0x24b100;}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(_0x15c6e6,_0x12d2f5,_0x151dbb){const _0x403e8c=a157_0x24b1,_0x3ac51b=await scanLocalSqlQueries(_0x15c6e6),_0x3318fa=new Map();for(const _0x2320ec of _0x3ac51b){if(_0x151dbb&&_0x2320ec[_0x403e8c(0x1d5)]!==_0x151dbb)continue;const _0x329a30=_0x3318fa[_0x403e8c(0x19b)](_0x2320ec[_0x403e8c(0x1d5)])??[];_0x329a30[_0x403e8c(0x1d1)](_0x2320ec),_0x3318fa['set'](_0x2320ec['sqlCode'],_0x329a30);}if(_0x151dbb&&!_0x3318fa[_0x403e8c(0x1d2)](_0x151dbb))throw CliErrors[_0x403e8c(0x1b6)](_0x403e8c(0x1b1)+_0x151dbb);const _0x218edd=[];for(const [_0x95e943,_0x1aaedc]of _0x3318fa[_0x403e8c(0x1ca)]()){if(_0x1aaedc[_0x403e8c(0x1cd)]===0x1){_0x218edd[_0x403e8c(0x1d1)](_0x1aaedc[0x0]);continue;}const _0x29305b=_0x12d2f5[_0x403e8c(0x1da)][_0x95e943],_0x374668=_0x29305b?.[_0x403e8c(0x1a9)],_0x4f09fb=_0x374668?_0x1aaedc[_0x403e8c(0x1cf)](_0x4f9279=>_0x4f9279[_0x403e8c(0x1a2)]!==_0x374668):_0x1aaedc;if(_0x29305b&&_0x4f09fb[_0x403e8c(0x1cd)]===0x1){_0x218edd['push'](_0x4f09fb[0x0]);continue;}throw CliErrors[_0x403e8c(0x1b6)](_0x403e8c(0x1ab)+_0x95e943+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x218edd;}export const sqlPush={'service':a157_0x30af38(0x1b0),'command':a157_0x30af38(0x1d1),'description':a157_0x30af38(0x1d7),'risk':a157_0x30af38(0x1c7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a157_0x30af38(0x19c),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x2da79b){const _0x1f601a=a157_0x30af38,_0x416839=loadSqlProjectConfig(_0x2da79b[_0x1f601a(0x1af)]),_0x574d00=await readSqlLockFile(_0x416839[_0x1f601a(0x1d4)]),{appLock:_0x938628}=ensureSqlLockScope(_0x574d00??createEmptySqlLock(),_0x2da79b['appCode'],_0x416839[_0x1f601a(0x1a6)],_0x1f601a(0x1d1)),_0x514fe4=await getTargetSqlQueries(_0x416839,_0x938628,_0x2da79b[_0x1f601a(0x1d0)]('sqlcode')||undefined),_0x55a62d=[];for(const _0x430bec of _0x514fe4){const _0x47a058=await computeSqlFileHash(_0x430bec[_0x1f601a(0x1a3)]),_0x58fc41=_0x938628['sqls'][_0x430bec[_0x1f601a(0x1d5)]],_0x2389e0=!!_0x58fc41&&(_0x58fc41['path']!==_0x430bec[_0x1f601a(0x1a2)]||!!_0x430bec[_0x1f601a(0x1b4)]&&_0x58fc41[_0x1f601a(0x1b4)]!==_0x430bec['sqlName']);if(!_0x2da79b[_0x1f601a(0x1be)](_0x1f601a(0x1aa))&&_0x58fc41&&_0x58fc41[_0x1f601a(0x1d6)]===_0x47a058&&!_0x2389e0)continue;_0x55a62d[_0x1f601a(0x1d1)](_0x430bec[_0x1f601a(0x1d5)]);}return{'method':'POST','url':_0x1f601a(0x1b9),'body':{'sqlCodes':_0x55a62d,'appCode':_0x2da79b['appCode']},'description':_0x1f601a(0x1ce)+_0x55a62d['length']+_0x1f601a(0x1b8)};},async 'execute'(_0x57056b){const _0x4876f3=a157_0x30af38,_0x27980a=loadSqlProjectConfig(_0x57056b[_0x4876f3(0x1af)]),_0x46544d=await readSqlLockFile(_0x27980a['lockFilePath']),{lockData:_0x51b51c,appLock:_0x59f7c1}=ensureSqlLockScope(_0x46544d??createEmptySqlLock(),_0x57056b[_0x4876f3(0x1af)],_0x27980a[_0x4876f3(0x1a6)],_0x4876f3(0x1d1)),_0x71fdea=await getTargetSqlQueries(_0x27980a,_0x59f7c1,_0x57056b[_0x4876f3(0x1d0)]('sqlcode')||undefined);if(_0x71fdea['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4876f3(0x1c8)};const _0x30cf3=[],_0x5220da=[],_0x4884c8=[];for(const _0xac35c5 of _0x71fdea){const _0x1576a2=_0x59f7c1['sqls'][_0xac35c5[_0x4876f3(0x1d5)]];if(!_0x1576a2){_0x4884c8['push']({'sqlCode':_0xac35c5[_0x4876f3(0x1d5)],'error':_0x4876f3(0x1b5)});continue;}try{const _0x1690b5=await computeSqlFileHash(_0xac35c5[_0x4876f3(0x1a3)]),_0xd317ee=_0x1576a2[_0x4876f3(0x1a9)]!==_0xac35c5[_0x4876f3(0x1a2)]||!!_0xac35c5[_0x4876f3(0x1b4)]&&_0x1576a2[_0x4876f3(0x1b4)]!==_0xac35c5[_0x4876f3(0x1b4)];if(!_0x57056b[_0x4876f3(0x1be)](_0x4876f3(0x1aa))&&_0x1576a2[_0x4876f3(0x1d6)]===_0x1690b5&&!_0xd317ee){_0x5220da['push']({'sqlCode':_0xac35c5[_0x4876f3(0x1d5)],'reason':_0x4876f3(0x1bc)});continue;}if(_0x1576a2[_0x4876f3(0x1c6)]==null){_0x4884c8['push']({'sqlCode':_0xac35c5[_0x4876f3(0x1d5)],'error':_0x4876f3(0x1c9)});continue;}const _0x3c6b25=await readFile(_0xac35c5[_0x4876f3(0x1a3)],_0x4876f3(0x1ae)),_0x10339c=stripLocalSqlMetadata(_0x3c6b25,_0xac35c5[_0x4876f3(0x1d3)]),_0x1cbe1c=_0xac35c5[_0x4876f3(0x1b4)]||_0x1576a2['sqlName'],_0xe5e84c=await resolveTargetDbBinding(_0x57056b[_0x4876f3(0x1af)],_0xac35c5,_0x1576a2),_0x5eea57=await updateSqlQuery({'id':_0x1576a2[_0x4876f3(0x19f)],'appCode':_0x57056b[_0x4876f3(0x1af)],'sqlCode':_0xac35c5[_0x4876f3(0x1d5)],'sqlName':_0x1cbe1c,'dbId':_0xe5e84c[_0x4876f3(0x1d8)],'version':_0x1576a2['version'],'sqlContent':_0x10339c,'sqlConfig':_0x1576a2[_0x4876f3(0x1a8)]??undefined}),_0x21afb8=_0x5eea57[_0x4876f3(0x1d8)]?await getDbName(_0x57056b['appCode'],Number(_0x5eea57[_0x4876f3(0x1d8)]))[_0x4876f3(0x19a)](()=>_0xe5e84c[_0x4876f3(0x19e)]):_0xe5e84c[_0x4876f3(0x19e)];_0x59f7c1[_0x4876f3(0x1da)][_0xac35c5['sqlCode']]={...buildSqlLockEntry(_0x5eea57,_0x10339c,_0x1690b5,{'dbName':_0x21afb8}),'path':_0xac35c5[_0x4876f3(0x1a2)],'mode':_0x1576a2[_0x4876f3(0x1d3)]},await archivePreviousSqlFileIfNeeded(_0x27980a,_0x1576a2[_0x4876f3(0x1a9)],_0xac35c5[_0x4876f3(0x1a2)]),_0x30cf3['push']({'sqlCode':_0xac35c5[_0x4876f3(0x1d5)],'remoteId':_0x1576a2[_0x4876f3(0x19f)]});}catch(_0x180b72){_0x4884c8[_0x4876f3(0x1d1)]({'sqlCode':_0xac35c5['sqlCode'],'error':_0x180b72 instanceof Error?_0x180b72[_0x4876f3(0x1a5)]:String(_0x180b72)});}}return _0x59f7c1['lastSync']=new Date()[_0x4876f3(0x1c0)](),await writeSqlLockFile(_0x27980a[_0x4876f3(0x1d4)],_0x51b51c),{'ok':_0x4884c8[_0x4876f3(0x1cd)]===0x0,'data':{'pushed':_0x30cf3,'skipped':_0x5220da,'failed':_0x4884c8},'message':_0x4876f3(0x1c3)+_0x30cf3[_0x4876f3(0x1cd)]+'\x20pushed,\x20'+_0x5220da['length']+_0x4876f3(0x1b7)+_0x4884c8[_0x4876f3(0x1cd)]+_0x4876f3(0x1a4)};}};function a157_0x2ea8(){const _0x1fb3a9=['utf8','appCode','sql','Local\x20SQL\x20not\x20found:\x20','19875625QAvLfP','startsWith','sqlName','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','validation','\x20skipped,\x20','\x20SQL\x20file(s)','/smartapi/custom/updateUserCustomSql','58584AmuIzu','1059fVRMya','unchanged','1377732ihtlmr','bool','\x22\x20for\x20sqlCode\x20','toISOString','isFinite','sqlRootDir','Push\x20complete:\x20','133152ZabRlb','14290aTKRMq','version','high-risk-write','No\x20local\x20SQL\x20files\x20found.','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','entries','join','6OcqwYf','length','Would\x20push\x20','filter','str','push','has','mode','lockFilePath','sqlCode','hash','Push\x20local\x20SQL\x20files\x20to\x20remote','dbId','1806zTxbVm','sqls','8941655DDnZwj','catch','get','boolean','5602ylGjkO','dbName','remoteId','map','No\x20database\x20matches\x20local\x20directory\x20\x22','relativePath','filePath','\x20failed','message','sqlRoot','dbDirectory','sqlConfig','path','force','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','9369ruHmjQ','projectRoot'];a157_0x2ea8=function(){return _0x1fb3a9;};return a157_0x2ea8();}async function archivePreviousSqlFileIfNeeded(_0x2cd0ad,_0x359692,_0x4ca923){const _0x170a7d=a157_0x30af38;if(!_0x359692||_0x359692===_0x4ca923)return;const _0x3a85f0=join(_0x2cd0ad['sqlRootDir'],_0x359692);if(!await fileExists(_0x3a85f0))return;const _0x8b101d=await moveToTrash(_0x2cd0ad[_0x170a7d(0x1ad)],_0x2cd0ad['trashDir'],_0x3a85f0);await cleanupEmptyDirectories(dirname(_0x3a85f0),_0x2cd0ad[_0x170a7d(0x1c2)]),void _0x8b101d;}async function moveToTrash(_0x282920,_0x41af02,_0x26ca4e){const _0x117368=a157_0x30af38,_0x4f4147=new Date()[_0x117368(0x1c0)]()['replace'](/[:.]/g,'-'),_0x3ff3d8=relative(_0x282920,_0x26ca4e),_0x58e10e=join(_0x41af02,_0x4f4147,_0x3ff3d8);return await mkdir(dirname(_0x58e10e),{'recursive':!![]}),await rename(_0x26ca4e,_0x58e10e),_0x58e10e;}async function cleanupEmptyDirectories(_0x5a04ac,_0x4283c9){const _0x541553=a157_0x30af38;let _0x226c02=resolve(_0x5a04ac);const _0xed768e=resolve(_0x4283c9);while(_0x226c02[_0x541553(0x1b3)](''+_0xed768e+sep)||_0x226c02===_0xed768e){if(_0x226c02===_0xed768e)return;try{const _0x581f5b=await readdir(_0x226c02);if(_0x581f5b[_0x541553(0x1cd)]>0x0)return;await rmdir(_0x226c02);}catch{return;}_0x226c02=dirname(_0x226c02);}}async function resolveTargetDbBinding(_0x1db3f9,_0x214b38,_0x428314){const _0xae4fa7=a157_0x30af38,_0x467e3c=_0x214b38[_0xae4fa7(0x1a7)];if(!_0x467e3c)return{'dbId':_0x428314[_0xae4fa7(0x1d8)],'dbName':_0x428314[_0xae4fa7(0x19e)]};const _0xf6558a=buildDbDirectoryName(_0x428314['dbName'],_0x428314['dbId']);if(_0x467e3c===_0xf6558a)return{'dbId':_0x428314[_0xae4fa7(0x1d8)],'dbName':_0x428314['dbName']};const _0x4b3a5d=parseExplicitDbDirectory(_0x467e3c);if(_0x4b3a5d!=null)return{'dbId':_0x4b3a5d,'dbName':await getDbName(_0x1db3f9,_0x4b3a5d)['catch'](()=>undefined)};const _0x301d65=await listDatabases(_0x1db3f9),_0x546b3f=_0x301d65['filter'](_0x103fc0=>buildDbDirectoryName(_0x103fc0['dbName'],_0x103fc0[_0xae4fa7(0x1d8)])===_0x467e3c);if(_0x546b3f[_0xae4fa7(0x1cd)]===0x1)return{'dbId':_0x546b3f[0x0]['dbId'],'dbName':_0x546b3f[0x0]['dbName']};if(_0x546b3f[_0xae4fa7(0x1cd)]===0x0)throw CliErrors[_0xae4fa7(0x1b6)](_0xae4fa7(0x1a1)+_0x467e3c+_0xae4fa7(0x1bf)+_0x214b38[_0xae4fa7(0x1d5)]+'.');const _0x126973=_0x546b3f[_0xae4fa7(0x1a0)](_0x281ae3=>_0x281ae3[_0xae4fa7(0x19e)]+'\x20('+_0x281ae3[_0xae4fa7(0x1d8)]+')')[_0xae4fa7(0x1cb)](',\x20');throw CliErrors[_0xae4fa7(0x1b6)]('Local\x20directory\x20\x22'+_0x467e3c+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x214b38[_0xae4fa7(0x1d5)]+':\x20'+_0x126973);}function parseExplicitDbDirectory(_0x2f8e28){const _0x3a04fe=a157_0x30af38,_0x4fece5=/^db-(\d+)$/['exec'](_0x2f8e28);if(!_0x4fece5)return null;const _0x4f8fa7=Number(_0x4fece5[0x1]);return Number[_0x3a04fe(0x1c1)](_0x4f8fa7)&&_0x4f8fa7>0x0?_0x4f8fa7:null;}
|
|
1
|
+
const a159_0x307fe6=a159_0x23ec;(function(_0xe56ade,_0x4b6e20){const _0x57aaa4=a159_0x23ec,_0x26277a=_0xe56ade();while(!![]){try{const _0x4c2364=-parseInt(_0x57aaa4(0x149))/0x1+parseInt(_0x57aaa4(0x15b))/0x2*(-parseInt(_0x57aaa4(0x15d))/0x3)+-parseInt(_0x57aaa4(0x153))/0x4*(-parseInt(_0x57aaa4(0x13d))/0x5)+parseInt(_0x57aaa4(0x15a))/0x6+parseInt(_0x57aaa4(0x159))/0x7+-parseInt(_0x57aaa4(0x144))/0x8+-parseInt(_0x57aaa4(0x139))/0x9*(-parseInt(_0x57aaa4(0x134))/0xa);if(_0x4c2364===_0x4b6e20)break;else _0x26277a['push'](_0x26277a['shift']());}catch(_0x4d1775){_0x26277a['push'](_0x26277a['shift']());}}}(a159_0x2ed6,0x85ea1));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(_0x21c330,_0x501551,_0x232be2){const _0x3566c8=a159_0x23ec,_0x2b7853=await scanLocalSqlQueries(_0x21c330),_0x150d30=new Map();for(const _0x3caf15 of _0x2b7853){if(_0x232be2&&_0x3caf15[_0x3566c8(0x16e)]!==_0x232be2)continue;const _0xa66d29=_0x150d30[_0x3566c8(0x154)](_0x3caf15[_0x3566c8(0x16e)])??[];_0xa66d29[_0x3566c8(0x130)](_0x3caf15),_0x150d30['set'](_0x3caf15[_0x3566c8(0x16e)],_0xa66d29);}if(_0x232be2&&!_0x150d30[_0x3566c8(0x14d)](_0x232be2))throw CliErrors[_0x3566c8(0x137)]('Local\x20SQL\x20not\x20found:\x20'+_0x232be2);const _0xbc996d=[];for(const [_0x575f11,_0x44f999]of _0x150d30[_0x3566c8(0x136)]()){if(_0x44f999[_0x3566c8(0x140)]===0x1){_0xbc996d['push'](_0x44f999[0x0]);continue;}const _0x3df98d=_0x501551[_0x3566c8(0x160)][_0x575f11],_0x54831d=_0x3df98d?.[_0x3566c8(0x16c)],_0x1c435b=_0x54831d?_0x44f999['filter'](_0x55003e=>_0x55003e[_0x3566c8(0x157)]!==_0x54831d):_0x44f999;if(_0x3df98d&&_0x1c435b[_0x3566c8(0x140)]===0x1){_0xbc996d[_0x3566c8(0x130)](_0x1c435b[0x0]);continue;}throw CliErrors[_0x3566c8(0x137)](_0x3566c8(0x147)+_0x575f11+_0x3566c8(0x13a));}return _0xbc996d;}export const sqlPush={'service':a159_0x307fe6(0x166),'command':a159_0x307fe6(0x130),'description':a159_0x307fe6(0x174),'risk':a159_0x307fe6(0x14a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a159_0x307fe6(0x145),'type':a159_0x307fe6(0x135),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x5f57a2){const _0x78a3b1=a159_0x307fe6,_0x9c2212=loadSqlProjectConfig(_0x5f57a2[_0x78a3b1(0x133)]),_0x373e34=await readSqlLockFile(_0x9c2212[_0x78a3b1(0x172)]),{appLock:_0x31934c}=ensureSqlLockScope(_0x373e34??createEmptySqlLock(),_0x5f57a2[_0x78a3b1(0x133)],_0x9c2212[_0x78a3b1(0x170)],_0x78a3b1(0x130)),_0x3b3c9c=await getTargetSqlQueries(_0x9c2212,_0x31934c,_0x5f57a2[_0x78a3b1(0x148)](_0x78a3b1(0x14f))||undefined),_0x5a8032=[];for(const _0x3f8b36 of _0x3b3c9c){const _0x404f8f=await computeSqlFileHash(_0x3f8b36['filePath']),_0x191b70=_0x31934c[_0x78a3b1(0x160)][_0x3f8b36[_0x78a3b1(0x16e)]],_0x15c471=!!_0x191b70&&(_0x191b70[_0x78a3b1(0x16c)]!==_0x3f8b36['relativePath']||!!_0x3f8b36[_0x78a3b1(0x163)]&&_0x191b70[_0x78a3b1(0x163)]!==_0x3f8b36[_0x78a3b1(0x163)]);if(!_0x5f57a2['bool'](_0x78a3b1(0x145))&&_0x191b70&&_0x191b70[_0x78a3b1(0x152)]===_0x404f8f&&!_0x15c471)continue;_0x5a8032['push'](_0x3f8b36[_0x78a3b1(0x16e)]);}return{'method':_0x78a3b1(0x143),'url':_0x78a3b1(0x150),'body':{'sqlCodes':_0x5a8032,'appCode':_0x5f57a2[_0x78a3b1(0x133)]},'description':_0x78a3b1(0x164)+_0x5a8032['length']+_0x78a3b1(0x131)};},async 'execute'(_0xcded3d){const _0x358f48=a159_0x307fe6,_0x58d439=loadSqlProjectConfig(_0xcded3d[_0x358f48(0x133)]),_0x1a2480=await readSqlLockFile(_0x58d439['lockFilePath']),{lockData:_0x3ea56d,appLock:_0x2cce84}=ensureSqlLockScope(_0x1a2480??createEmptySqlLock(),_0xcded3d[_0x358f48(0x133)],_0x58d439[_0x358f48(0x170)],'push'),_0x3a0c3a=await getTargetSqlQueries(_0x58d439,_0x2cce84,_0xcded3d[_0x358f48(0x148)](_0x358f48(0x14f))||undefined);if(_0x3a0c3a[_0x358f48(0x140)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x358f48(0x162)};const _0x14fa79=[],_0x185185=[],_0x2f6e4f=[];for(const _0x16d699 of _0x3a0c3a){const _0x3b400d=_0x2cce84[_0x358f48(0x160)][_0x16d699[_0x358f48(0x16e)]];if(!_0x3b400d){_0x2f6e4f[_0x358f48(0x130)]({'sqlCode':_0x16d699[_0x358f48(0x16e)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1e68d6=await computeSqlFileHash(_0x16d699[_0x358f48(0x161)]),_0x2d8ad1=_0x3b400d[_0x358f48(0x16c)]!==_0x16d699[_0x358f48(0x157)]||!!_0x16d699[_0x358f48(0x163)]&&_0x3b400d[_0x358f48(0x163)]!==_0x16d699['sqlName'];if(!_0xcded3d[_0x358f48(0x13e)](_0x358f48(0x145))&&_0x3b400d['hash']===_0x1e68d6&&!_0x2d8ad1){_0x185185[_0x358f48(0x130)]({'sqlCode':_0x16d699[_0x358f48(0x16e)],'reason':_0x358f48(0x13b)});continue;}if(_0x3b400d[_0x358f48(0x16a)]==null){_0x2f6e4f[_0x358f48(0x130)]({'sqlCode':_0x16d699[_0x358f48(0x16e)],'error':_0x358f48(0x14e)});continue;}const _0x4bd5e1=await readFile(_0x16d699[_0x358f48(0x161)],_0x358f48(0x151)),_0x53cb9e=stripLocalSqlMetadata(_0x4bd5e1,_0x16d699[_0x358f48(0x14c)]),_0x26411c=_0x16d699[_0x358f48(0x163)]||_0x3b400d[_0x358f48(0x163)],_0x48e559=await resolveTargetDbBinding(_0xcded3d[_0x358f48(0x133)],_0x16d699,_0x3b400d),_0x42d3fa=await updateSqlQuery({'id':_0x3b400d[_0x358f48(0x15e)],'appCode':_0xcded3d[_0x358f48(0x133)],'sqlCode':_0x16d699[_0x358f48(0x16e)],'sqlName':_0x26411c,'dbId':_0x48e559[_0x358f48(0x158)],'version':_0x3b400d[_0x358f48(0x16a)],'sqlContent':_0x53cb9e,'sqlConfig':_0x3b400d[_0x358f48(0x16f)]??undefined}),_0xed4546=_0x42d3fa[_0x358f48(0x158)]?await getDbName(_0xcded3d[_0x358f48(0x133)],Number(_0x42d3fa[_0x358f48(0x158)]))['catch'](()=>_0x48e559['dbName']):_0x48e559[_0x358f48(0x15f)];_0x2cce84[_0x358f48(0x160)][_0x16d699['sqlCode']]={...buildSqlLockEntry(_0x42d3fa,_0x53cb9e,_0x1e68d6,{'dbName':_0xed4546}),'path':_0x16d699['relativePath'],'mode':_0x3b400d[_0x358f48(0x14c)]},await archivePreviousSqlFileIfNeeded(_0x58d439,_0x3b400d[_0x358f48(0x16c)],_0x16d699[_0x358f48(0x157)]),_0x14fa79['push']({'sqlCode':_0x16d699['sqlCode'],'remoteId':_0x3b400d[_0x358f48(0x15e)]});}catch(_0x2ae0f4){_0x2f6e4f['push']({'sqlCode':_0x16d699['sqlCode'],'error':_0x2ae0f4 instanceof Error?_0x2ae0f4[_0x358f48(0x168)]:String(_0x2ae0f4)});}}return _0x2cce84[_0x358f48(0x14b)]=new Date()[_0x358f48(0x167)](),await writeSqlLockFile(_0x58d439[_0x358f48(0x172)],_0x3ea56d),{'ok':_0x2f6e4f[_0x358f48(0x140)]===0x0,'data':{'pushed':_0x14fa79,'skipped':_0x185185,'failed':_0x2f6e4f},'message':_0x358f48(0x171)+_0x14fa79[_0x358f48(0x140)]+_0x358f48(0x16b)+_0x185185[_0x358f48(0x140)]+_0x358f48(0x15c)+_0x2f6e4f[_0x358f48(0x140)]+_0x358f48(0x175)};}};function a159_0x23ec(_0x3b99f3,_0x5f071b){_0x3b99f3=_0x3b99f3-0x130;const _0x2ed62e=a159_0x2ed6();let _0x23ecc9=_0x2ed62e[_0x3b99f3];return _0x23ecc9;}async function archivePreviousSqlFileIfNeeded(_0x53b348,_0x22730b,_0x1903a7){const _0x50cdd3=a159_0x307fe6;if(!_0x22730b||_0x22730b===_0x1903a7)return;const _0x440206=join(_0x53b348['sqlRootDir'],_0x22730b);if(!await fileExists(_0x440206))return;const _0x58eb13=await moveToTrash(_0x53b348[_0x50cdd3(0x16d)],_0x53b348[_0x50cdd3(0x13c)],_0x440206);await cleanupEmptyDirectories(dirname(_0x440206),_0x53b348['sqlRootDir']),void _0x58eb13;}async function moveToTrash(_0x4d9340,_0x450aaa,_0x3e4ac3){const _0x5b28e8=a159_0x307fe6,_0xa92a3a=new Date()[_0x5b28e8(0x167)]()[_0x5b28e8(0x138)](/[:.]/g,'-'),_0x425174=relative(_0x4d9340,_0x3e4ac3),_0x4b4aba=join(_0x450aaa,_0xa92a3a,_0x425174);return await mkdir(dirname(_0x4b4aba),{'recursive':!![]}),await rename(_0x3e4ac3,_0x4b4aba),_0x4b4aba;}async function cleanupEmptyDirectories(_0x14c1af,_0x45d015){const _0x5e361c=a159_0x307fe6;let _0x38ae51=resolve(_0x14c1af);const _0x528c1f=resolve(_0x45d015);while(_0x38ae51[_0x5e361c(0x173)](''+_0x528c1f+sep)||_0x38ae51===_0x528c1f){if(_0x38ae51===_0x528c1f)return;try{const _0x29e379=await readdir(_0x38ae51);if(_0x29e379[_0x5e361c(0x140)]>0x0)return;await rmdir(_0x38ae51);}catch{return;}_0x38ae51=dirname(_0x38ae51);}}async function resolveTargetDbBinding(_0x52473e,_0x11f61e,_0x121790){const _0x119c93=a159_0x307fe6,_0x2522e3=_0x11f61e[_0x119c93(0x156)];if(!_0x2522e3)return{'dbId':_0x121790[_0x119c93(0x158)],'dbName':_0x121790['dbName']};const _0x529e1d=buildDbDirectoryName(_0x121790[_0x119c93(0x15f)],_0x121790['dbId']);if(_0x2522e3===_0x529e1d)return{'dbId':_0x121790[_0x119c93(0x158)],'dbName':_0x121790['dbName']};const _0x3d0234=parseExplicitDbDirectory(_0x2522e3);if(_0x3d0234!=null)return{'dbId':_0x3d0234,'dbName':await getDbName(_0x52473e,_0x3d0234)[_0x119c93(0x13f)](()=>undefined)};const _0x3eb38e=await listDatabases(_0x52473e),_0x100567=_0x3eb38e[_0x119c93(0x141)](_0x6b5aaa=>buildDbDirectoryName(_0x6b5aaa[_0x119c93(0x15f)],_0x6b5aaa['dbId'])===_0x2522e3);if(_0x100567[_0x119c93(0x140)]===0x1)return{'dbId':_0x100567[0x0][_0x119c93(0x158)],'dbName':_0x100567[0x0]['dbName']};if(_0x100567[_0x119c93(0x140)]===0x0)throw CliErrors[_0x119c93(0x137)](_0x119c93(0x169)+_0x2522e3+_0x119c93(0x142)+_0x11f61e['sqlCode']+'.');const _0x1b2eaf=_0x100567['map'](_0x4946f1=>_0x4946f1[_0x119c93(0x15f)]+'\x20('+_0x4946f1['dbId']+')')['join'](',\x20');throw CliErrors[_0x119c93(0x137)](_0x119c93(0x155)+_0x2522e3+_0x119c93(0x146)+_0x11f61e[_0x119c93(0x16e)]+':\x20'+_0x1b2eaf);}function parseExplicitDbDirectory(_0x57e14f){const _0x33e5c9=a159_0x307fe6,_0xbf6198=/^db-(\d+)$/[_0x33e5c9(0x132)](_0x57e14f);if(!_0xbf6198)return null;const _0x13b492=Number(_0xbf6198[0x1]);return Number[_0x33e5c9(0x165)](_0x13b492)&&_0x13b492>0x0?_0x13b492:null;}function a159_0x2ed6(){const _0x17699f=['bool','catch','length','filter','\x22\x20for\x20sqlCode\x20','POST','4405536uNiSjN','force','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','str','993498XrDYsq','high-risk-write','lastSync','mode','has','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlcode','/smartapi/custom/updateUserCustomSql','utf8','hash','380VMkMwb','get','Local\x20directory\x20\x22','dbDirectory','relativePath','dbId','1207094Ecimde','1165734JJPDQW','32070ESwNDU','\x20skipped,\x20','177isAOJQ','remoteId','dbName','sqls','filePath','No\x20local\x20SQL\x20files\x20found.','sqlName','Would\x20push\x20','isFinite','sql','toISOString','message','No\x20database\x20matches\x20local\x20directory\x20\x22','version','\x20pushed,\x20','path','projectRoot','sqlCode','sqlConfig','sqlRoot','Push\x20complete:\x20','lockFilePath','startsWith','Push\x20local\x20SQL\x20files\x20to\x20remote','\x20failed','push','\x20SQL\x20file(s)','exec','appCode','70ZFsCiw','boolean','entries','validation','replace','2650464tZudoY','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','unchanged','trashDir','32135gRisPz'];a159_0x2ed6=function(){return _0x17699f;};return a159_0x2ed6();}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x465185=a160_0x181f;(function(_0x18f98a,_0x2383c4){const _0x2c7314=a160_0x181f,_0x19d5a9=_0x18f98a();while(!![]){try{const _0x2fe10a=-parseInt(_0x2c7314(0xc8))/0x1+-parseInt(_0x2c7314(0xc9))/0x2+parseInt(_0x2c7314(0xbc))/0x3*(parseInt(_0x2c7314(0xc1))/0x4)+parseInt(_0x2c7314(0xcc))/0x5+parseInt(_0x2c7314(0xbd))/0x6*(-parseInt(_0x2c7314(0xc2))/0x7)+-parseInt(_0x2c7314(0xc3))/0x8*(-parseInt(_0x2c7314(0xc0))/0x9)+-parseInt(_0x2c7314(0xcf))/0xa;if(_0x2fe10a===_0x2383c4)break;else _0x19d5a9['push'](_0x19d5a9['shift']());}catch(_0x192003){_0x19d5a9['push'](_0x19d5a9['shift']());}}}(a160_0x1dcd,0x2ef87));import{CliErrors}from'../../errors.js';function a160_0x181f(_0x29c965,_0x459bc2){_0x29c965=_0x29c965-0xbb;const _0x1dcd1a=a160_0x1dcd();let _0x181f20=_0x1dcd1a[_0x29c965];return _0x181f20;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a160_0x465185(0xc5),a160_0x465185(0xbb),a160_0x465185(0xca)][a160_0x465185(0xbf)]('\x0a');function a160_0x1dcd(){const _0x48c676=['1348290KHxdyF','write','sqlname','799670QchhqF','file','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','383871mPaBJQ','572526DeDgBe','validation','join','36AzIBAx','12YlYKlA','21GUbVHC','389320ytuTID','save','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Path\x20to\x20the\x20SQL\x20file','string','196227SmqSWv','186682QvuBnk','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`.','sql'];a160_0x1dcd=function(){return _0x48c676;};return a160_0x1dcd();}export const sqlSave={'service':a160_0x465185(0xcb),'command':a160_0x465185(0xc4),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a160_0x465185(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a160_0x465185(0xd0),'type':a160_0x465185(0xc7),'required':!![],'description':a160_0x465185(0xc6)},SQLCODE_FLAG_OPTIONAL,{'name':a160_0x465185(0xce),'type':a160_0x465185(0xc7),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a160_0x465185(0xc7),'description':a160_0x465185(0xd1)},{'name':'description','type':a160_0x465185(0xc7),'description':'Query\x20description'}],async 'validate'(){const _0x2d4cbe=a160_0x465185;throw CliErrors[_0x2d4cbe(0xbe)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3a843d=a160_0x465185;throw CliErrors[_0x3a843d(0xbe)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x5b0a3f=a161_0x1283;(function(_0x1877da,_0x22c7f0){const _0x364af3=a161_0x1283,_0x3f5e74=_0x1877da();while(!![]){try{const _0x243138=parseInt(_0x364af3(0xcb))/0x1*(-parseInt(_0x364af3(0xc4))/0x2)+-parseInt(_0x364af3(0xc3))/0x3*(parseInt(_0x364af3(0xbe))/0x4)+parseInt(_0x364af3(0xd1))/0x5+parseInt(_0x364af3(0xcd))/0x6+-parseInt(_0x364af3(0xb5))/0x7+parseInt(_0x364af3(0xcc))/0x8*(-parseInt(_0x364af3(0xc9))/0x9)+parseInt(_0x364af3(0xaa))/0xa*(parseInt(_0x364af3(0xc0))/0xb);if(_0x243138===_0x22c7f0)break;else _0x3f5e74['push'](_0x3f5e74['shift']());}catch(_0x2a50c5){_0x3f5e74['push'](_0x3f5e74['shift']());}}}(a161_0x3827,0x88a74));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a161_0x1283(_0xca0b20,_0x3da5a0){_0xca0b20=_0xca0b20-0xa7;const _0x38271f=a161_0x3827();let _0x128326=_0x38271f[_0xca0b20];return _0x128326;}export const SQL_LOCAL_REL_DIR=a161_0x5b0a3f(0xb1);export function buildSqlLockEntry(_0x51a0f7,_0x5074e4,_0x1ffad0,_0x4c3a42){const _0x4db765=a161_0x5b0a3f,_0x43d497=detectSqlMode(_0x5074e4);return{'path':buildSqlRelativePath(_0x51a0f7[_0x4db765(0xbf)],_0x51a0f7['sqlName'],_0x4c3a42?.[_0x4db765(0xb3)],_0x43d497,_0x51a0f7[_0x4db765(0xb0)]),'hash':_0x1ffad0,'remoteId':_0x51a0f7['id'],'version':_0x51a0f7[_0x4db765(0xbd)],'dbId':Number(_0x51a0f7[_0x4db765(0xb0)]),'dbName':_0x4c3a42?.[_0x4db765(0xb3)],'sqlName':_0x51a0f7[_0x4db765(0xbc)],'sqlConfig':_0x51a0f7['sqlConfig']??undefined,'mode':_0x43d497};}export function cloneSqlLockData(_0x2873c8){const _0x529bf8=a161_0x5b0a3f;return{'apps':Object['fromEntries'](Object[_0x529bf8(0xb9)](_0x2873c8[_0x529bf8(0xb6)])[_0x529bf8(0xad)](([_0x52c209,_0x379630])=>[_0x52c209,{'sqlRoot':_0x379630['sqlRoot'],'lastSync':_0x379630[_0x529bf8(0xab)],'sqls':{..._0x379630[_0x529bf8(0xb7)]}}]))};}export function ensureRemoteSqlContent(_0x2f2e23){return _0x2f2e23['sqlContent']??'';}export function buildLocalSqlFileContent(_0x11276e,_0x2a9dc3,_0x597dbe){const _0x2a2ca2=a161_0x5b0a3f,_0x526273=_0x597dbe?.[_0x2a2ca2(0xb4)]??detectSqlMode(_0x2a9dc3),_0x234353=stripLocalSqlMetadata(_0x2a9dc3,_0x526273)['trim'](),_0x53ff17=[...buildMetadataHeaderLines({'sqlCode':_0x11276e[_0x2a2ca2(0xbf)],'sqlName':_0x11276e[_0x2a2ca2(0xbc)],'dbId':_0x11276e['dbId'],'dbName':_0x597dbe?.[_0x2a2ca2(0xb3)],'mode':_0x526273,'syncedAt':_0x597dbe?.[_0x2a2ca2(0xcf)],'description':_0x597dbe?.[_0x2a2ca2(0xc8)]},_0x526273),'',_0x234353],_0x306028=_0x53ff17[_0x2a2ca2(0xc6)]('\x0a');return _0x306028['endsWith']('\x0a')?_0x306028:_0x306028+'\x0a';}export function stripLocalSqlMetadata(_0x58e8da,_0x8c47c4){const _0x1e1dd1=a161_0x5b0a3f,_0x3b5ba5=_0x58e8da[_0x1e1dd1(0xc1)](/\r\n/g,'\x0a')[_0x1e1dd1(0xae)]('\x0a'),_0x1a4513=[];let _0x4a484d=0x0;if(_0x8c47c4==='mybatisXml')while(_0x4a484d<_0x3b5ba5[_0x1e1dd1(0xd0)]){const _0x927888=_0x3b5ba5[_0x4a484d]??'';if(/^\s*<!--\s*@lovrabet\./[_0x1e1dd1(0xb8)](_0x927888)){_0x4a484d++;continue;}if(_0x927888[_0x1e1dd1(0xa7)]()===''&&_0x4a484d>0x0){_0x4a484d++;continue;}break;}else while(_0x4a484d<_0x3b5ba5[_0x1e1dd1(0xd0)]){const _0x268695=_0x3b5ba5[_0x4a484d]??'';if(/^\s*--\s*@lovrabet\./[_0x1e1dd1(0xb8)](_0x268695)){_0x4a484d++;continue;}if(_0x268695[_0x1e1dd1(0xa7)]()===''&&_0x4a484d>0x0){_0x4a484d++;continue;}break;}for(;_0x4a484d<_0x3b5ba5['length'];_0x4a484d++){_0x1a4513[_0x1e1dd1(0xac)](_0x3b5ba5[_0x4a484d]);}return _0x1a4513['join']('\x0a')[_0x1e1dd1(0xc5)]();}export function resolveSqlMode(_0x198d60,_0xc9bb53){const _0x3dd8bc=a161_0x5b0a3f;if(_0xc9bb53?.[_0x3dd8bc(0xb4)])return _0xc9bb53[_0x3dd8bc(0xb4)];return detectSqlMode(_0x198d60);}function a161_0x3827(){const _0x1711c9=['trimStart','join','stderr','description','261vGyVbw','toLowerCase','2Kwhfvv','303320hWenCC','5263380cfCVCn','includes','syncedAt','length','4575930rghHaL','<!--\x20@lovrabet.','trim','path','\x20-->','13112470jVkHhr','lastSync','push','map','split','question','dbId','.rabetbase/sql','yes','dbName','mode','5991930lnrWpL','apps','sqls','test','entries','close','filter','sqlName','version','2776BInxdJ','sqlCode','11BkoUVP','replace','--\x20@lovrabet.','1941ZbLFtm','139388RnNMIB'];a161_0x3827=function(){return _0x1711c9;};return a161_0x3827();}export function resolveSqlFileName(_0x67de37,_0x22436c,_0x5a99bd){const _0x3b1350=a161_0x5b0a3f;if(_0x5a99bd?.[_0x3b1350(0xa8)])return _0x5a99bd['path'];if(_0x5a99bd?.[_0x3b1350(0xbc)]||_0x5a99bd?.[_0x3b1350(0xb3)])return buildSqlRelativePath(_0x67de37,_0x5a99bd?.['sqlName'],_0x5a99bd?.[_0x3b1350(0xb3)],resolveSqlMode(_0x22436c,_0x5a99bd),_0x5a99bd?.[_0x3b1350(0xb0)]);return buildDefaultSqlFileName(_0x67de37,resolveSqlMode(_0x22436c,_0x5a99bd));}export function resolveSqlLocalDir(_0x48592a,_0x55fd90){return join(_0x48592a,SQL_LOCAL_REL_DIR,_0x55fd90);}export async function confirmForceOverwrite(_0x163d5d){const _0x4d004b=a161_0x5b0a3f,_0x253797=createInterface({'input':process['stdin'],'output':process[_0x4d004b(0xc7)]}),_0xe5822b=await new Promise(_0x232571=>{const _0x280352=_0x4d004b;_0x253797[_0x280352(0xaf)](_0x163d5d+'\x20[y/N]\x20',_0x232571);});return _0x253797[_0x4d004b(0xba)](),['y',_0x4d004b(0xb2)][_0x4d004b(0xce)](_0xe5822b[_0x4d004b(0xa7)]()[_0x4d004b(0xca)]());}export function findSqlLockScope(_0x4776e1,_0x530c52){return _0x4776e1['apps'][_0x530c52];}function buildMetadataHeaderLines(_0x5cc80d,_0x32c04b){const _0x3e4165=a161_0x5b0a3f,_0x37ebd4=[[_0x3e4165(0xbf),_0x5cc80d[_0x3e4165(0xbf)]],[_0x3e4165(0xbc),_0x5cc80d[_0x3e4165(0xbc)]],[_0x3e4165(0xb0),_0x5cc80d[_0x3e4165(0xb0)]],[_0x3e4165(0xb3),_0x5cc80d[_0x3e4165(0xb3)]],[_0x3e4165(0xb4),_0x5cc80d[_0x3e4165(0xb4)]],[_0x3e4165(0xcf),_0x5cc80d[_0x3e4165(0xcf)]],['description',_0x5cc80d[_0x3e4165(0xc8)]]];if(_0x32c04b==='mybatisXml')return _0x37ebd4[_0x3e4165(0xbb)](([,_0x462136])=>_0x462136!==undefined&&_0x462136!==null&&String(_0x462136)['trim']()!=='')[_0x3e4165(0xad)](([_0x163239,_0x6ecf8d])=>_0x3e4165(0xd2)+_0x163239+':\x20'+String(_0x6ecf8d)+_0x3e4165(0xa9));return _0x37ebd4['filter'](([,_0x5061f3])=>_0x5061f3!==undefined&&_0x5061f3!==null&&String(_0x5061f3)['trim']()!=='')['map'](([_0x3a49b5,_0x4d89a9])=>_0x3e4165(0xc2)+_0x3a49b5+':\x20'+String(_0x4d89a9));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x4efdcf=a162_0x4051;(function(_0x258571,_0xfd0977){const _0x593a42=a162_0x4051,_0x3aada4=_0x258571();while(!![]){try{const _0x465944=parseInt(_0x593a42(0x167))/0x1+parseInt(_0x593a42(0x151))/0x2*(-parseInt(_0x593a42(0x160))/0x3)+parseInt(_0x593a42(0x169))/0x4*(-parseInt(_0x593a42(0x154))/0x5)+-parseInt(_0x593a42(0x157))/0x6+parseInt(_0x593a42(0x163))/0x7*(-parseInt(_0x593a42(0x161))/0x8)+parseInt(_0x593a42(0x16e))/0x9+parseInt(_0x593a42(0x15e))/0xa;if(_0x465944===_0xfd0977)break;else _0x3aada4['push'](_0x3aada4['shift']());}catch(_0x1af080){_0x3aada4['push'](_0x3aada4['shift']());}}}(a162_0x5c02,0x84428));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a162_0x4051(_0x559a93,_0x498a0d){_0x559a93=_0x559a93-0x151;const _0x5c0246=a162_0x5c02();let _0x4051f4=_0x5c0246[_0x559a93];return _0x4051f4;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';function a162_0x5c02(){const _0x5812f6=['appCode','sqls','paging','119195XERETE','sqlName','464qqdvoh','push','relativePath','remote','sqlCode','5740083adDJeV','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','\x20unchanged','map','2kQQpQL','\x20remote-only','totalCount','4835ruYuLu','boolean','has','710250DuEBeG','sql','read','hash','lockKey','length','sqlRoot','7632590molqLY','lockFilePath','2034429UAqVmb','111704yvzJIo','path','35wIQWfS'];a162_0x5c02=function(){return _0x5812f6;};return a162_0x5c02();}import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x120dea){const _0x42afee=a162_0x4051,_0xaf22f5=[];let _0x214d4c=0x1;while(!![]){const _0x3093be=await listSqlQueries(_0x120dea,{'currentPage':_0x214d4c,'pageSize':PAGE_SIZE}),_0x4d2d17=_0x3093be['tableData']??[];_0xaf22f5[_0x42afee(0x16a)](..._0x4d2d17['map'](_0x5d40f3=>_0x5d40f3[_0x42afee(0x16d)]));if(_0x4d2d17[_0x42afee(0x15c)]===0x0)break;const _0x45ab48=_0x3093be[_0x42afee(0x166)]?.[_0x42afee(0x153)];if(_0x45ab48!=null?_0xaf22f5[_0x42afee(0x15c)]>=_0x45ab48:_0x4d2d17[_0x42afee(0x15c)]<PAGE_SIZE)break;_0x214d4c++;}return _0xaf22f5;}export const sqlStatus={'service':a162_0x4efdcf(0x158),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a162_0x4efdcf(0x159),'flags':[{'name':a162_0x4efdcf(0x16c),'type':a162_0x4efdcf(0x155),'description':a162_0x4efdcf(0x16f)}],async 'execute'(_0x573ea5){const _0x24716c=a162_0x4efdcf,_0x3b4ae3=loadSqlProjectConfig(_0x573ea5[_0x24716c(0x164)]),_0x20ea82=await readSqlLockFile(_0x3b4ae3[_0x24716c(0x15f)]),{appLock:_0x3a5dfa}=ensureSqlLockScope(_0x20ea82??createEmptySqlLock(),_0x3b4ae3[_0x24716c(0x164)],_0x3b4ae3[_0x24716c(0x15d)],'status'),_0x5ce4d9=await scanLocalSqlQueries(_0x3b4ae3),_0x5bb7f7=[],_0x216e07=[],_0x3163d4=[],_0x4cd0f0=[],_0x27255a=new Set(_0x5ce4d9[_0x24716c(0x171)](_0x133133=>_0x133133[_0x24716c(0x15b)]));for(const _0x15cafc of _0x5ce4d9){const _0x95b6c1=await computeSqlFileHash(_0x15cafc['filePath']),_0x2fad90=_0x3a5dfa[_0x24716c(0x165)][_0x15cafc['lockKey']],_0x3698db=!!_0x2fad90&&_0x2fad90[_0x24716c(0x162)]!==_0x15cafc[_0x24716c(0x16b)],_0x29a44a=!!_0x2fad90&&!!_0x15cafc[_0x24716c(0x168)]&&_0x2fad90[_0x24716c(0x168)]!==_0x15cafc[_0x24716c(0x168)];if(!_0x2fad90)_0x5bb7f7['push'](_0x15cafc[_0x24716c(0x15b)]);else _0x2fad90[_0x24716c(0x15a)]!==_0x95b6c1||_0x3698db||_0x29a44a?_0x216e07[_0x24716c(0x16a)](_0x15cafc[_0x24716c(0x15b)]):_0x3163d4[_0x24716c(0x16a)](_0x15cafc['lockKey']);}for(const _0x1ce96b of Object['keys'](_0x3a5dfa[_0x24716c(0x165)])){!_0x27255a[_0x24716c(0x156)](_0x1ce96b)&&_0x4cd0f0[_0x24716c(0x16a)](_0x1ce96b);}const _0x2f240d=[];if(_0x573ea5['bool'](_0x24716c(0x16c))){const _0x118585=await fetchAllSqlCodes(_0x573ea5[_0x24716c(0x164)]);for(const _0x185b49 of _0x118585){!_0x27255a[_0x24716c(0x156)](_0x185b49)&&!_0x3a5dfa['sqls'][_0x185b49]&&_0x2f240d[_0x24716c(0x16a)](_0x185b49);}}const _0x57c066=_0x5bb7f7[_0x24716c(0x15c)]===0x0&&_0x216e07[_0x24716c(0x15c)]===0x0&&_0x4cd0f0['length']===0x0&&_0x2f240d[_0x24716c(0x15c)]===0x0;return{'ok':!![],'data':{'added':_0x5bb7f7,'modified':_0x216e07,'missing':_0x4cd0f0,'unchanged':_0x3163d4,'remoteOnly':_0x2f240d},'message':_0x57c066?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x5bb7f7['length']+'\x20added,\x20'+_0x216e07[_0x24716c(0x15c)]+'\x20modified,\x20'+_0x4cd0f0[_0x24716c(0x15c)]+'\x20missing,\x20'+_0x3163d4['length']+_0x24716c(0x170)+(_0x2f240d['length']>0x0?',\x20'+_0x2f240d[_0x24716c(0x15c)]+_0x24716c(0x152):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x56818c=a163_0xd862;(function(_0x18e589,_0x30bd52){const _0x3a574a=a163_0xd862,_0x2118a4=_0x18e589();while(!![]){try{const _0x514e5d=-parseInt(_0x3a574a(0xf4))/0x1*(-parseInt(_0x3a574a(0xc4))/0x2)+parseInt(_0x3a574a(0xdb))/0x3*(-parseInt(_0x3a574a(0xc5))/0x4)+parseInt(_0x3a574a(0xd3))/0x5+parseInt(_0x3a574a(0xdf))/0x6+parseInt(_0x3a574a(0xf3))/0x7*(parseInt(_0x3a574a(0xcd))/0x8)+-parseInt(_0x3a574a(0xda))/0x9+parseInt(_0x3a574a(0xee))/0xa;if(_0x514e5d===_0x30bd52)break;else _0x2118a4['push'](_0x2118a4['shift']());}catch(_0x4d436a){_0x2118a4['push'](_0x2118a4['shift']());}}}(a163_0x83c2,0xe608a));function a163_0xd862(_0xdd1fce,_0x3226a9){_0xdd1fce=_0xdd1fce-0xc2;const _0x83c2f6=a163_0x83c2();let _0xd8627f=_0x83c2f6[_0xdd1fce];return _0xd8627f;}import{readFileSync,existsSync}from'node:fs';function a163_0x83c2(){const _0x482689=['trim','sqlType','7359520LWdtsE','name','cwd','split','\x22\x20not\x20found\x20in\x20any\x20dataset','20363LzVGfa','580eaKcLQ','validation','File\x20not\x20found:\x20','6452SNmMFC','316fBLTbS','get','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','Provide\x20--file\x20or\x20--sql','validate','valid','SQL\x20schema\x20validation','string','1704qgKxoq','toLowerCase','tableName','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','size','sql','1737335bNYmDw','push','isArray','reason','message','from','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','15179724xtKcAb','63255BeKsAh','schemas','flagMissing','utf-8','4322718KdFpUI','Dataset\x20\x22','str','length','map','\x22\x20not\x20found\x20or\x20not\x20accessible','isSelectOnly','file','Table\x20\x22','appCode','tables','schema:','dbtableConfig'];a163_0x83c2=function(){return _0x482689;};return a163_0x83c2();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a163_0x56818c(0xd2),'command':a163_0x56818c(0xc9),'description':a163_0x56818c(0xd9),'risk':'read','flags':[{'name':'file','type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a163_0x56818c(0xd2),'type':a163_0x56818c(0xcc),'description':a163_0x56818c(0xd0)},{'name':a163_0x56818c(0xdc),'type':a163_0x56818c(0xcc),'description':a163_0x56818c(0xc7)}],async 'execute'(_0x589067){const _0x2c8b91=a163_0x56818c,_0x3c5d36=_0x589067[_0x2c8b91(0xe1)](_0x2c8b91(0xe6)),_0x567508=_0x589067['str'](_0x2c8b91(0xd2));if(!_0x3c5d36&&!_0x567508)throw CliErrors[_0x2c8b91(0xdd)]('file',_0x2c8b91(0xc8));let _0x4dd74f;if(_0x3c5d36){const _0x484e18=resolve(process[_0x2c8b91(0xf0)](),_0x3c5d36);if(!existsSync(_0x484e18))throw CliErrors[_0x2c8b91(0xc2)](_0x2c8b91(0xc3)+_0x484e18);_0x4dd74f=readFileSync(_0x484e18,_0x2c8b91(0xde));}else _0x4dd74f=_0x567508;const _0x8a3990=validateSql(_0x4dd74f),_0x56b237={'valid':_0x8a3990[_0x2c8b91(0xca)],'sqlType':_0x8a3990[_0x2c8b91(0xed)]['type'],'isSelectOnly':_0x8a3990[_0x2c8b91(0xed)][_0x2c8b91(0xe5)],'isDangerous':_0x8a3990[_0x2c8b91(0xed)]['isDangerous'],'tables':_0x8a3990['tables'],'parameters':_0x8a3990['parameters'],'message':_0x8a3990[_0x2c8b91(0xd7)]};_0x8a3990[_0x2c8b91(0xed)][_0x2c8b91(0xd6)]&&(_0x56b237[_0x2c8b91(0xd6)]=_0x8a3990[_0x2c8b91(0xed)]['reason']);const _0x2ef533=_0x589067[_0x2c8b91(0xe1)](_0x2c8b91(0xdc));if(_0x2ef533&&_0x8a3990[_0x2c8b91(0xca)]){const _0x2f0a7f=_0x2ef533[_0x2c8b91(0xf1)](',')['map'](_0x5016c9=>_0x5016c9[_0x2c8b91(0xec)]())['filter'](Boolean),_0x25a02b=[],_0x2e1674=filterDbTableBackedDatasets(await listDatasets(_0x589067[_0x2c8b91(0xe8)])),_0x1f4c4e=new Map(_0x2e1674[_0x2c8b91(0xe3)](_0x26f28b=>[_0x26f28b[_0x2c8b91(0xeb)]?.[_0x2c8b91(0xcf)]?.[_0x2c8b91(0xce)](),_0x26f28b]));for(const _0xcb0aed of _0x8a3990[_0x2c8b91(0xe9)]){const _0x1e125b=_0x1f4c4e[_0x2c8b91(0xc6)](_0xcb0aed[_0x2c8b91(0xce)]());!_0x1e125b&&_0x25a02b[_0x2c8b91(0xd4)](_0x2c8b91(0xe7)+_0xcb0aed+_0x2c8b91(0xf2));}for(const _0x3b9ab5 of _0x2f0a7f){let _0xbbc00d;try{_0xbbc00d=await getDatasetDetail(_0x3b9ab5);}catch{_0x25a02b[_0x2c8b91(0xd4)](_0x2c8b91(0xe0)+_0x3b9ab5+_0x2c8b91(0xe4));continue;}assertDatasetIsDbTableBacked(_0xbbc00d,_0x2c8b91(0xcb));const _0x510cb1=Array[_0x2c8b91(0xd5)](_0xbbc00d['fields'])?_0xbbc00d['fields']:[],_0x380e18=new Set(_0x510cb1[_0x2c8b91(0xe3)](_0x3bd3ce=>_0x3bd3ce[_0x2c8b91(0xef)]?.[_0x2c8b91(0xce)]())),_0x13c51f=_0xbbc00d['dbtableConfig']?.['tableName']||_0xbbc00d[_0x2c8b91(0xcf)]||_0x3b9ab5;_0x56b237[_0x2c8b91(0xea)+_0x13c51f]={'code':_0x3b9ab5,'tableName':_0x13c51f,'fieldCount':_0x380e18[_0x2c8b91(0xd1)],'fields':Array[_0x2c8b91(0xd8)](_0x380e18)};}_0x25a02b[_0x2c8b91(0xe2)]>0x0&&(_0x56b237['schemaWarnings']=_0x25a02b);}return{'ok':_0x8a3990['valid'],'data':_0x56b237,'message':_0x8a3990[_0x2c8b91(0xd7)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0xa24420=a164_0x41d3;function a164_0x41d3(_0x5707c8,_0x3270d3){_0x5707c8=_0x5707c8-0x6a;const _0x125f18=a164_0x125f();let _0x41d305=_0x125f18[_0x5707c8];return _0x41d305;}(function(_0x1013f3,_0x2b0c45){const _0x5a2afb=a164_0x41d3,_0x3a24ca=_0x1013f3();while(!![]){try{const _0x3796a2=-parseInt(_0x5a2afb(0x76))/0x1*(-parseInt(_0x5a2afb(0x70))/0x2)+-parseInt(_0x5a2afb(0x6d))/0x3+-parseInt(_0x5a2afb(0x74))/0x4+-parseInt(_0x5a2afb(0x6b))/0x5*(-parseInt(_0x5a2afb(0x75))/0x6)+parseInt(_0x5a2afb(0x71))/0x7*(parseInt(_0x5a2afb(0x6c))/0x8)+parseInt(_0x5a2afb(0x77))/0x9+-parseInt(_0x5a2afb(0x73))/0xa;if(_0x3796a2===_0x2b0c45)break;else _0x3a24ca['push'](_0x3a24ca['shift']());}catch(_0x2d8307){_0x3a24ca['push'](_0x3a24ca['shift']());}}}(a164_0x125f,0x6e112));function a164_0x125f(){const _0x426459=['App\x20profile\x20name','3061330LeMOfp','1775656grWwDZ','6kuoRVp','1yZfkIW','7524315EuugpY','workspace','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','897125NqTRjs','814824KQiLpB','1035435BiEwEW','add','workspace\x20add','450014pmLjAE','21sbrivP'];a164_0x125f=function(){return _0x426459;};return a164_0x125f();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a164_0xa24420(0x78),'command':a164_0xa24420(0x6e),'description':a164_0xa24420(0x6a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a164_0xa24420(0x72),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x571ff8=>validateAppName(_0x571ff8,a164_0xa24420(0x6f)),'execute':_0x575e16=>runAppAdd(_0x575e16,a164_0xa24420(0x6f))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0xe7d13e=a165_0x2004;(function(_0x120484,_0x448cb1){const _0x5f8a51=a165_0x2004,_0x5463f8=_0x120484();while(!![]){try{const _0x446edd=parseInt(_0x5f8a51(0x8c))/0x1*(-parseInt(_0x5f8a51(0x9c))/0x2)+-parseInt(_0x5f8a51(0x74))/0x3*(parseInt(_0x5f8a51(0xa3))/0x4)+parseInt(_0x5f8a51(0xa5))/0x5+-parseInt(_0x5f8a51(0x84))/0x6+-parseInt(_0x5f8a51(0x78))/0x7*(-parseInt(_0x5f8a51(0x79))/0x8)+-parseInt(_0x5f8a51(0x8a))/0x9*(parseInt(_0x5f8a51(0x94))/0xa)+parseInt(_0x5f8a51(0x93))/0xb*(parseInt(_0x5f8a51(0x9a))/0xc);if(_0x446edd===_0x448cb1)break;else _0x5463f8['push'](_0x5463f8['shift']());}catch(_0x18d17d){_0x5463f8['push'](_0x5463f8['shift']());}}}(a165_0x3a1e,0xb1da6));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a165_0xe7d13e(0x8b),a165_0xe7d13e(0x88),a165_0xe7d13e(0x73),'format',a165_0xe7d13e(0x7a),a165_0xe7d13e(0x71),'locale'],workspaceFlags=[{'name':a165_0xe7d13e(0xa4),'type':'string','description':a165_0xe7d13e(0x8f)},{'name':a165_0xe7d13e(0x8b),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0xa9)},{'name':a165_0xe7d13e(0x88),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x81),'enum':[...RABETBASE_ENV_VALUES]},{'name':a165_0xe7d13e(0x73),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x9d)},{'name':a165_0xe7d13e(0x86),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x9e),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a165_0xe7d13e(0x7a),'type':a165_0xe7d13e(0x75),'description':a165_0xe7d13e(0x8d)},{'name':a165_0xe7d13e(0x71),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x89),'enum':[...RISK_LEVEL_VALUES]},{'name':a165_0xe7d13e(0x8e),'type':a165_0xe7d13e(0x99),'description':a165_0xe7d13e(0x7e)}];function isRecord(_0x39f407){const _0x10bc33=a165_0xe7d13e;return!!_0x39f407&&typeof _0x39f407===_0x10bc33(0x72)&&!Array['isArray'](_0x39f407);}function assertValidAppcode(_0x31d543){const _0x134634=a165_0xe7d13e,{valid:_0x23df5d,message:_0x53a6f2}=validateAppcode(_0x31d543);if(!_0x23df5d)throw CliErrors[_0x134634(0xa6)]('Invalid\x20appcode:\x20'+_0x31d543,_0x53a6f2);}function a165_0x3a1e(){const _0xd5b214=['7BBIsVz','567848yATcDe','pageSize','Use\x20`','defaultApp','\x20(appcode:\x20','Locale\x20for\x20this\x20workspace\x20app\x20profile','globalConfig','\x22\x20not\x20found.','Target\x20environment','workspace','apps','3315036EcJmfi','write','defaultFormat','.\x20Credentials:\x20not\x20written.','env','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','492354brHCws','appcode','467135yKDvLC','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','locale','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','\x20workspace\x20','project','trim','77Jwvzbx','20KoXTQr','str','use','flag','initialized','string','2854068IfOtKA','keys','2gqkBSc','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Missing\x20workspace\x20app\x20selector.','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','App\x20\x22','workspace.','4cqAqqQ','app','5228805SARmDX','validation','length','\x20--app\x20','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','updated',').\x20Config:\x20','init','join','riskLevel','object','apiDir','2772228aanSKA','number','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'];a165_0x3a1e=function(){return _0xd5b214;};return a165_0x3a1e();}function sanitizeProfile(_0x1f937d){if(!isRecord(_0x1f937d))return{};const _0x1373f0={};for(const _0x682ee5 of SAFE_PROFILE_KEYS){if(_0x1f937d[_0x682ee5]!==undefined)_0x1373f0[_0x682ee5]=_0x1f937d[_0x682ee5];}return _0x1373f0;}function cloneProfile(_0x4c9422){return isRecord(_0x4c9422)?{..._0x4c9422}:{};}function collectWorkspaceProfileOverrides(_0x5289fe){const _0x244e6f=a165_0xe7d13e,_0x2ee520={},_0x18b963=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x88)),_0x59e155=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x73)),_0x341bdb=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x86)),_0x8935a8=_0x5289fe[_0x244e6f(0x97)](_0x244e6f(0x7a)),_0x356e7d=_0x5289fe['str'](_0x244e6f(0x71)),_0x22ff91=_0x5289fe[_0x244e6f(0x95)](_0x244e6f(0x8e));if(_0x18b963)_0x2ee520[_0x244e6f(0x88)]=_0x18b963;if(_0x59e155)_0x2ee520[_0x244e6f(0x73)]=_0x59e155;if(_0x341bdb)_0x2ee520['format']=_0x341bdb;if(_0x8935a8!==undefined&&_0x8935a8!=='')_0x2ee520[_0x244e6f(0x7a)]=Number(_0x8935a8);if(_0x356e7d)_0x2ee520[_0x244e6f(0x71)]=_0x356e7d;if(_0x22ff91)_0x2ee520[_0x244e6f(0x8e)]=_0x22ff91;return _0x2ee520;}async function validateWorkspaceArgs(_0x475030){const _0x3b1ba4=a165_0xe7d13e,_0x35b3dc=_0x475030[_0x3b1ba4(0x95)](_0x3b1ba4(0xa4))['trim'](),_0x3fe132=_0x475030[_0x3b1ba4(0x95)](_0x3b1ba4(0x8b))[_0x3b1ba4(0x92)]();if(!_0x35b3dc&&!_0x3fe132)throw CliErrors['validation'](_0x3b1ba4(0x9f),_0x3b1ba4(0x7b)+CLI_BIN_NAME+_0x3b1ba4(0xa0)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x3fe132)assertValidAppcode(_0x3fe132);}function resolveKnownApps(){const _0x31e4fb=a165_0xe7d13e,{config:_0x28bfc7,layers:_0x295f57}=readRawConfigWithLayers(),_0x1dfd61=isRecord(_0x28bfc7[_0x31e4fb(0x83)])?_0x28bfc7[_0x31e4fb(0x83)]:{},_0x475d3f=isRecord(_0x295f57['globalConfig'][_0x31e4fb(0x83)])?_0x295f57[_0x31e4fb(0x7f)][_0x31e4fb(0x83)]:{};return{..._0x475d3f,..._0x1dfd61};}async function configureWorkspace(_0x59dbdd,_0x42d9a1){const _0x16e332=a165_0xe7d13e,_0x38a133=_0x59dbdd[_0x16e332(0x95)](_0x16e332(0xa4))[_0x16e332(0x92)](),_0x28833e=_0x59dbdd[_0x16e332(0x95)](_0x16e332(0x8b))[_0x16e332(0x92)](),_0x4ceede=_0x38a133||_0x28833e;if(!_0x4ceede)throw CliErrors[_0x16e332(0xa6)]('Missing\x20workspace\x20app\x20selector.',_0x16e332(0x7b)+CLI_BIN_NAME+_0x16e332(0xa0)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x28833e)assertValidAppcode(_0x28833e);const _0x440dc9=resolveWriteConfigPath(_0x16e332(0x91)),_0x27d814=readConfigFile(_0x440dc9),_0x43d5dd=resolveKnownApps(),_0x1e2266=isRecord(_0x27d814[_0x16e332(0x83)])?{..._0x27d814[_0x16e332(0x83)]}:{},_0x3ca57f=cloneProfile(_0x1e2266[_0x4ceede]),_0x3ff547=sanitizeProfile(_0x43d5dd[_0x4ceede]),_0x10751c=_0x28833e?{}:_0x3ff547,_0x46c196=_0x28833e||_0x10751c[_0x16e332(0x8b)];if(!_0x46c196){const _0x463845=Object[_0x16e332(0x9b)](_0x43d5dd),_0x43e658=_0x463845[_0x16e332(0xa7)]===0x0?_0x16e332(0x7b)+CLI_BIN_NAME+_0x16e332(0x90)+_0x42d9a1+_0x16e332(0xa8)+_0x4ceede+'\x20--appcode\x20<code>`.':_0x16e332(0x77)+_0x463845[_0x16e332(0x70)](',\x20');throw CliErrors[_0x16e332(0xa6)](_0x16e332(0xa1)+_0x4ceede+_0x16e332(0x80),_0x43e658);}assertValidAppcode(String(_0x46c196));const _0x158dce={..._0x10751c,..._0x3ca57f,'appcode':String(_0x46c196),...collectWorkspaceProfileOverrides(_0x59dbdd)};return _0x1e2266[_0x4ceede]=_0x158dce,_0x27d814[_0x16e332(0x83)]=_0x1e2266,_0x27d814[_0x16e332(0x7c)]=_0x4ceede,delete _0x27d814['appcode'],delete _0x27d814[_0x16e332(0xa4)],_0x158dce['env']&&(_0x27d814[_0x16e332(0x88)]=_0x158dce['env']),writeConfigFile(_0x440dc9,_0x27d814),{'ok':!![],'message':'Workspace\x20'+(_0x42d9a1===_0x16e332(0x6f)?_0x16e332(0x98):_0x16e332(0xaa))+':\x20'+_0x4ceede+_0x16e332(0x7d)+_0x158dce[_0x16e332(0x8b)]+_0x16e332(0xab)+_0x440dc9+_0x16e332(0x87),'data':{'operation':_0x16e332(0xa2)+_0x42d9a1,'configPath':_0x440dc9,'app':_0x4ceede,'appcode':_0x158dce['appcode'],'env':_0x158dce[_0x16e332(0x88)]??null,'credentialsWritten':![]}};}function a165_0x2004(_0x450e00,_0x17fb51){_0x450e00=_0x450e00-0x6f;const _0x3a1e27=a165_0x3a1e();let _0x2004d2=_0x3a1e27[_0x450e00];return _0x2004d2;}const workspaceInitDefinition={'service':a165_0xe7d13e(0x82),'command':'init','description':a165_0xe7d13e(0x76),'risk':a165_0xe7d13e(0x85),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x8d4ce6=>configureWorkspace(_0x8d4ce6,'init')},workspaceUseDefinition={'service':a165_0xe7d13e(0x82),'command':a165_0xe7d13e(0x96),'description':'Switch\x20the\x20current\x20workspace\x20app\x20binding','risk':a165_0xe7d13e(0x85),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x36b2d1=>configureWorkspace(_0x36b2d1,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a166_0x29c1(_0xcd28cc,_0x11a83a){_0xcd28cc=_0xcd28cc-0x1a8;const _0x28b04a=a166_0x28b0();let _0x29c162=_0x28b04a[_0xcd28cc];return _0x29c162;}const a166_0x243e56=a166_0x29c1;(function(_0x531cee,_0xacea41){const _0x513f0a=a166_0x29c1,_0x1af1e0=_0x531cee();while(!![]){try{const _0x290d3b=parseInt(_0x513f0a(0x1a8))/0x1*(-parseInt(_0x513f0a(0x1ad))/0x2)+-parseInt(_0x513f0a(0x1ae))/0x3+parseInt(_0x513f0a(0x1b7))/0x4+parseInt(_0x513f0a(0x1af))/0x5+parseInt(_0x513f0a(0x1b8))/0x6*(parseInt(_0x513f0a(0x1b2))/0x7)+-parseInt(_0x513f0a(0x1b9))/0x8*(parseInt(_0x513f0a(0x1a9))/0x9)+parseInt(_0x513f0a(0x1b4))/0xa*(-parseInt(_0x513f0a(0x1b6))/0xb);if(_0x290d3b===_0xacea41)break;else _0x1af1e0['push'](_0x1af1e0['shift']());}catch(_0x4b0e3f){_0x1af1e0['push'](_0x1af1e0['shift']());}}}(a166_0x28b0,0x5757a));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a166_0x28b0(){const _0x5a97cb=['1215900wfdMAL','2642100DHwKUa','workspace','App\x20profile\x20name\x20to\x20remove','4984609qVSaVQ','remove','1261430IgOECX','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','22XlXfZw','2684084oWmCtH','6tJsUDF','223160DjRsaI','700923HlNnUa','63asQeqe','name','workspace\x20remove','high-risk-write','2OmYkEJ'];a166_0x28b0=function(){return _0x5a97cb;};return a166_0x28b0();}export const workspaceRemoveDefinition={'service':a166_0x243e56(0x1b0),'command':a166_0x243e56(0x1b3),'description':a166_0x243e56(0x1b5),'risk':a166_0x243e56(0x1ac),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a166_0x243e56(0x1aa),'description':a166_0x243e56(0x1b1),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x42fb37=>validateAppName(_0x42fb37,a166_0x243e56(0x1ab)),'execute':_0x58f051=>runAppRemove(_0x58f051,a166_0x243e56(0x1ab))};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x26cc55=a167_0x1e26;(function(_0x5ae54c,_0x1ae470){const _0x364841=a167_0x1e26,_0x3cd73a=_0x5ae54c();while(!![]){try{const _0x3f1be0=parseInt(_0x364841(0x1be))/0x1+parseInt(_0x364841(0x1ce))/0x2*(-parseInt(_0x364841(0x1d4))/0x3)+-parseInt(_0x364841(0x1d6))/0x4*(-parseInt(_0x364841(0x1cf))/0x5)+-parseInt(_0x364841(0x1d3))/0x6*(-parseInt(_0x364841(0x1db))/0x7)+parseInt(_0x364841(0x1e2))/0x8+-parseInt(_0x364841(0x1dd))/0x9*(-parseInt(_0x364841(0x1c8))/0xa)+-parseInt(_0x364841(0x1c7))/0xb;if(_0x3f1be0===_0x1ae470)break;else _0x3cd73a['push'](_0x3cd73a['shift']());}catch(_0x3d8add){_0x3cd73a['push'](_0x3cd73a['shift']());}}}(a167_0x37e4,0xe5f20));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a167_0x26cc55(0x1cc),a167_0x26cc55(0x1ca),a167_0x26cc55(0x1d7),'format',a167_0x26cc55(0x1d2)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a167_0x26cc55(0x1df),a167_0x26cc55(0x1c3),a167_0x26cc55(0x1d7),'format','cookie',a167_0x26cc55(0x1ca),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x14dded){const _0x2296f1=a167_0x26cc55;return[..._0x14dded][_0x2296f1(0x1d1)](',\x20');}function a167_0x37e4(){const _0x91c52a=['Default\x20page\x20size','Access\x20key','35pASywO','inherit','6307731FMFuhC','length','appcode','Locale','apps','11944648cdLsVk','app','en-US','filter','string','entries','Risk\x20level','571329TBYnJC','defaultApp','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','number','apiDir','env','format','Auth\x20cookie','defaultFormat','27980546cUvHrv','20BVpdcI','trim','accessKey','zh-CN','cookie','Target\x20environment','2DYMaYv','6945kLYSKG','pageSize','join','riskLevel','207324eEeTlB','5056269LxpRrL','map','4412XXWXed','locale','toLowerCase'];a167_0x37e4=function(){return _0x91c52a;};return a167_0x37e4();}function a167_0x1e26(_0x166562,_0x32b25b){_0x166562=_0x166562-0x1bb;const _0x37e426=a167_0x37e4();let _0x1e26b0=_0x37e426[_0x166562];return _0x1e26b0;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x2e83b0){return TOP_LEVEL_CONFIG_KEYS['has'](_0x2e83b0);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a167_0x26cc55(0x1c2),'cookie':a167_0x26cc55(0x1cc),'accessKey':a167_0x26cc55(0x1ca),'defaultFormat':a167_0x26cc55(0x1c4),'pageSize':a167_0x26cc55(0x1d0),'riskLevel':'riskLevel','locale':a167_0x26cc55(0x1d7)};export function getAppProfileFlagDefs(){const _0x146505=a167_0x26cc55;return[{'name':_0x146505(0x1c3),'type':_0x146505(0x1bb),'description':_0x146505(0x1cd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x146505(0x1c2),'type':_0x146505(0x1bb),'description':'API\x20directory\x20path'},{'name':'cookie','type':_0x146505(0x1bb),'description':_0x146505(0x1c5),'hidden':!![]},{'name':_0x146505(0x1ca),'type':_0x146505(0x1bb),'description':_0x146505(0x1da),'hidden':!![]},{'name':_0x146505(0x1c6),'type':'string','description':_0x146505(0x1c0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x146505(0x1c1),'description':_0x146505(0x1d9)},{'name':'riskLevel','type':_0x146505(0x1bb),'description':_0x146505(0x1bd),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x146505(0x1d7),'type':'string','description':_0x146505(0x1e0)}];}export function collectAppProfileOverrides(_0x84e37c){const _0x3b8185=a167_0x26cc55,_0x20d15b={};for(const [_0x3ef571,_0x3ed377]of Object[_0x3b8185(0x1bc)](APP_PROFILE_FLAG_KEY_MAP)){const _0x3a0be7=_0x84e37c(_0x3ef571);if(!_0x3a0be7)continue;_0x20d15b[_0x3ed377]=_0x3ed377===_0x3b8185(0x1d0)?Number(_0x3a0be7):_0x3a0be7;}return _0x20d15b;}export function buildAppProfileListFields(_0x1f66e6){const _0x5817a2=a167_0x26cc55;return{'env':_0x1f66e6[_0x5817a2(0x1c3)]??null,'apiDir':_0x1f66e6[_0x5817a2(0x1c2)]??null,'hasCookie':!!_0x1f66e6[_0x5817a2(0x1cc)],'hasAccessKey':!!_0x1f66e6['accessKey'],'format':_0x1f66e6[_0x5817a2(0x1c4)]??null,'pageSize':_0x1f66e6['pageSize']??null,'riskLevel':_0x1f66e6[_0x5817a2(0x1d2)]??null,'locale':_0x1f66e6['locale']??null};}export function buildAppDoctorFields(_0x4be2ee,_0x5713ec){const _0x1a9006=a167_0x26cc55;return{'env':{'value':_0x4be2ee[_0x1a9006(0x1c3)]||_0x5713ec['env'],'source':_0x4be2ee['env']?_0x1a9006(0x1e3):_0x1a9006(0x1dc)},'apiDir':{'value':_0x4be2ee[_0x1a9006(0x1c2)]||_0x5713ec[_0x1a9006(0x1c2)],'source':_0x4be2ee[_0x1a9006(0x1c2)]?'app':_0x1a9006(0x1dc)},'cookie':{'value':_0x4be2ee['cookie']||_0x5713ec[_0x1a9006(0x1cc)],'source':_0x4be2ee[_0x1a9006(0x1cc)]?_0x1a9006(0x1e3):'inherit'},'accessKey':{'value':_0x4be2ee[_0x1a9006(0x1ca)]||_0x5713ec[_0x1a9006(0x1ca)],'source':_0x4be2ee[_0x1a9006(0x1ca)]?_0x1a9006(0x1e3):'inherit'}};}export function buildCanonicalAppConfig(_0x4c3fa6,_0x29a09a){const _0x85698d=a167_0x26cc55,_0x348d14=_0x4c3fa6[_0x85698d(0x1d5)](_0x5543d9=>String(_0x5543d9||'')[_0x85698d(0x1c9)]())[_0x85698d(0x1e5)](Boolean);if(_0x348d14[_0x85698d(0x1de)]===0x0)return{};const _0x5df17e={};for(const _0x265f5c of _0x348d14){_0x5df17e[_0x265f5c]=_0x29a09a?{'appcode':_0x265f5c,'env':_0x29a09a}:{'appcode':_0x265f5c};}return{'apps':_0x5df17e,'defaultApp':_0x348d14[0x0]};}export function buildCanonicalProjectConfig(_0x3317a6,_0x67bf29){const _0x1235ec=a167_0x26cc55,{appCodes:appCodes=[],env:_0x298a7f,metadata:_0x4163ae}=_0x67bf29,_0x280422={..._0x3317a6,..._0x4163ae||{}};delete _0x280422[_0x1235ec(0x1df)],delete _0x280422['app'];if(_0x298a7f)_0x280422['env']=_0x298a7f;else!_0x280422[_0x1235ec(0x1c3)]&&(_0x280422[_0x1235ec(0x1c3)]=DEFAULT_CONFIG_VALUES[_0x1235ec(0x1c3)]);const _0x27e5c1=buildCanonicalAppConfig(appCodes,_0x280422[_0x1235ec(0x1c3)]);return Object['keys'](_0x27e5c1)[_0x1235ec(0x1de)]>0x0&&(_0x280422['apps']=_0x27e5c1[_0x1235ec(0x1e1)],_0x280422[_0x1235ec(0x1bf)]=_0x27e5c1[_0x1235ec(0x1bf)]),_0x280422;}const LOCALE_MAP={'zh':a167_0x26cc55(0x1cb),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a167_0x26cc55(0x1e4),'en-us':'en-US','en_us':a167_0x26cc55(0x1e4)};export function normalizeLocale(_0x2046fb){const _0x379df2=a167_0x26cc55;if(!_0x2046fb)return null;return LOCALE_MAP[_0x2046fb[_0x379df2(0x1d8)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a168_0x4fe555=a168_0x43ae;function a168_0x43ae(_0x2817c4,_0x2af72c){_0x2817c4=_0x2817c4-0xce;const _0x10db27=a168_0x10db();let _0x43aeee=_0x10db27[_0x2817c4];return _0x43aeee;}function a168_0x10db(){const _0x33d19d=['391634iyBrvo','4053709MHIIOS','23211RnlHIb','2833520DWhSqg','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','75318lQKsdk','1DARGPI','1576YbUNnC','179223hcobby','392LJheTb','8NtygnA','225125LatSyh'];a168_0x10db=function(){return _0x33d19d;};return a168_0x10db();}(function(_0x366f99,_0x1aeb06){const _0x84a567=a168_0x43ae,_0x487d1=_0x366f99();while(!![]){try{const _0x3ae719=-parseInt(_0x84a567(0xd3))/0x1*(parseInt(_0x84a567(0xd9))/0x2)+-parseInt(_0x84a567(0xd5))/0x3*(-parseInt(_0x84a567(0xd7))/0x4)+parseInt(_0x84a567(0xd8))/0x5+-parseInt(_0x84a567(0xd2))/0x6*(parseInt(_0x84a567(0xd6))/0x7)+parseInt(_0x84a567(0xd4))/0x8*(parseInt(_0x84a567(0xcf))/0x9)+parseInt(_0x84a567(0xd0))/0xa+parseInt(_0x84a567(0xce))/0xb;if(_0x3ae719===_0x1aeb06)break;else _0x487d1['push'](_0x487d1['shift']());}catch(_0xd2c942){_0x487d1['push'](_0x487d1['shift']());}}}(a168_0x10db,0x67eb8));export const CLI_VERSION_POLICY_URL=a168_0x4fe555(0xd1);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a167_0x3ba5(){const _0x2222d3=['5878765yQUItQ','SQL\x20name','Config\x20key','page','description','Verbose\x20output','boolean','25530JMCtRS','3859500KhBMsl','datasetcode','3ucSMZW','operationType','target','Force\x20overwrite','DB\x20ID','Operation\x20type','string','from-env','SQL\x20code','enable-bff-save','force','<expr>','1402101EHEVwD','Environment','Enable\x20BFF\x20save','params','output','2114nZoYrH','non-interactive','Preview\x20operation\x20without\x20executing','232030ffPYjY','help','Tags','Watch\x20mode','Page\x20size','Record\x20ID','remote','Type\x20filter','skip-imports','Show\x20help','Apply\x20to\x20all','sqlName','88vgzzwK','Schemas','value','Output\x20format','pagesize','enableBffSave','Reveal\x20sensitive\x20value','skipImports','Use\x20project\x20config\x20scope','Skip\x20confirmation\x20for\x20high-risk\x20writes','key','app','fromEnv','Keyword\x20filter','Read\x20value\x20from\x20environment\x20variable','Function\x20node','operation','Name','nonInteractive','Clear','Read\x20value\x20from\x20stdin','clear','sqlcode','dryRun','10KdBWba','global','functionNode','dbid','name','fromEntries','schemas','Force\x20non-interactive\x20mode\x20(CI)','Confirm\x20destructive\x20action','descriptionFile','dry-run','Use\x20remote','json\x20|\x20pretty\x20|\x20compress','function-node','watch','sqlname','<code>','8085979ATauiU','rabetbase','meowKey','description-file','yes','verbose','Select\x20app\x20profile\x20by\x20name','Page\x20number','type','Expected\x20affected\x20count','format','File\x20path','stdin','appcode','project','map','Skip\x20import\x20generation','sql-name','Description\x20file','6047472sRQsKE','Title','Output\x20path','code','keyword','<name>','env','Config\x20value','tags','dbId','Override\x20appcode','all','file','confirm','Dataset\x20code','SQL\x20string'];a167_0x3ba5=function(){return _0x2222d3;};return a167_0x3ba5();}const a167_0x3ebfaf=a167_0x3bf8;(function(_0x1c6273,_0x502bf3){const _0x5a92bc=a167_0x3bf8,_0x27de14=_0x1c6273();while(!![]){try{const _0x20aa2a=parseInt(_0x5a92bc(0xcc))/0x1*(parseInt(_0x5a92bc(0xe0))/0x2)+-parseInt(_0x5a92bc(0xca))/0x3+-parseInt(_0x5a92bc(0xb2))/0x4+parseInt(_0x5a92bc(0xc2))/0x5+parseInt(_0x5a92bc(0xc9))/0x6*(parseInt(_0x5a92bc(0xdd))/0x7)+parseInt(_0x5a92bc(0xec))/0x8*(parseInt(_0x5a92bc(0xd8))/0x9)+-parseInt(_0x5a92bc(0x8e))/0xa*(parseInt(_0x5a92bc(0x9f))/0xb);if(_0x20aa2a===_0x502bf3)break;else _0x27de14['push'](_0x27de14['shift']());}catch(_0x1ae581){_0x27de14['push'](_0x27de14['shift']());}}}(a167_0x3ba5,0xf1766));function a167_0x3bf8(_0x411007,_0x2e38ed){_0x411007=_0x411007-0x89;const _0x3ba57d=a167_0x3ba5();let _0x3bf85e=_0x3ba57d[_0x411007];return _0x3bf85e;}export const CLI_BIN_NAME=a167_0x3ebfaf(0xa0);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':a167_0x3ebfaf(0xac),'meowKey':'appcode','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xbc),'hint':a167_0x3ebfaf(0x9e)},{'name':a167_0x3ebfaf(0xf7),'meowKey':'app','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xa5),'hint':a167_0x3ebfaf(0xb7)},{'name':'env','meowKey':a167_0x3ebfaf(0xb8),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xd9),'hint':'production\x20|\x20daily'},{'name':a167_0x3ebfaf(0xa9),'meowKey':a167_0x3ebfaf(0xa9),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xef),'hint':a167_0x3ebfaf(0x9a)},{'name':'jq','meowKey':'jq','type':a167_0x3ebfaf(0xd2),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a167_0x3ebfaf(0xd7)},{'name':a167_0x3ebfaf(0x98),'meowKey':a167_0x3ebfaf(0x8d),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xdf)},{'name':a167_0x3ebfaf(0xa3),'meowKey':a167_0x3ebfaf(0xa3),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xf5)},{'name':a167_0x3ebfaf(0xde),'meowKey':a167_0x3ebfaf(0xfe),'type':'boolean','description':a167_0x3ebfaf(0x95)},{'name':'global','meowKey':a167_0x3ebfaf(0x8f),'type':a167_0x3ebfaf(0xc8),'description':'Use\x20global\x20config\x20scope'},{'name':a167_0x3ebfaf(0xad),'meowKey':a167_0x3ebfaf(0xad),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xf4)},{'name':'ci','meowKey':'ci','type':a167_0x3ebfaf(0xc8),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a167_0x3ebfaf(0xe1),'meowKey':a167_0x3ebfaf(0xe1),'type':'boolean','description':a167_0x3ebfaf(0xe9)},{'name':a167_0x3ebfaf(0x92),'meowKey':a167_0x3ebfaf(0x92),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xfd),'hidden':!![]},{'name':'title','meowKey':'title','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xb3),'hidden':!![]},{'name':a167_0x3ebfaf(0x8b),'meowKey':'clear','type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0x89),'hidden':!![]},{'name':a167_0x3ebfaf(0x9c),'meowKey':a167_0x3ebfaf(0x9c),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xe3),'hidden':!![]},{'name':'output','meowKey':a167_0x3ebfaf(0xdc),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xb4),'hidden':!![]},{'name':'params','meowKey':a167_0x3ebfaf(0xdb),'type':a167_0x3ebfaf(0xd2),'description':'JSON\x20params','hidden':!![]},{'name':a167_0x3ebfaf(0xcb),'meowKey':a167_0x3ebfaf(0xcb),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xc0),'hidden':!![]},{'name':a167_0x3ebfaf(0xbd),'meowKey':a167_0x3ebfaf(0xbd),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xea),'hidden':!![]},{'name':a167_0x3ebfaf(0xd5),'meowKey':a167_0x3ebfaf(0xf1),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xda),'hidden':!![]},{'name':'id','meowKey':'id','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xe5),'hidden':!![]},{'name':a167_0x3ebfaf(0xa7),'meowKey':a167_0x3ebfaf(0xa7),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xe7),'hidden':!![]},{'name':a167_0x3ebfaf(0xbe),'meowKey':a167_0x3ebfaf(0xbe),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xaa),'hidden':!![]},{'name':a167_0x3ebfaf(0x8c),'meowKey':a167_0x3ebfaf(0x8c),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xd4),'hidden':!![]},{'name':a167_0x3ebfaf(0xb0),'meowKey':a167_0x3ebfaf(0xeb),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xc3),'hidden':!![]},{'name':a167_0x3ebfaf(0x9d),'meowKey':'sqlname','type':'string','description':a167_0x3ebfaf(0xc3),'hidden':!![]},{'name':'db-id','meowKey':a167_0x3ebfaf(0xbb),'type':a167_0x3ebfaf(0xd2),'description':'DB\x20ID','hidden':!![]},{'name':a167_0x3ebfaf(0x91),'meowKey':a167_0x3ebfaf(0x91),'type':'string','description':a167_0x3ebfaf(0xd0),'hidden':!![]},{'name':a167_0x3ebfaf(0xc6),'meowKey':a167_0x3ebfaf(0xc6),'type':'string','description':'Description','hidden':!![]},{'name':a167_0x3ebfaf(0xa2),'meowKey':a167_0x3ebfaf(0x97),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xb1),'hidden':!![]},{'name':a167_0x3ebfaf(0xc5),'meowKey':'page','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xa6),'hidden':!![]},{'name':a167_0x3ebfaf(0xf0),'meowKey':a167_0x3ebfaf(0xf0),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xe4),'hidden':!![]},{'name':a167_0x3ebfaf(0xb6),'meowKey':a167_0x3ebfaf(0xb6),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xf9),'hidden':!![]},{'name':a167_0x3ebfaf(0xb5),'meowKey':'code','type':a167_0x3ebfaf(0xd2),'description':'Code\x20filter','hidden':!![]},{'name':'sql','meowKey':'sql','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xc1),'hidden':!![]},{'name':a167_0x3ebfaf(0x94),'meowKey':'schemas','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xed),'hidden':!![]},{'name':a167_0x3ebfaf(0xfc),'meowKey':a167_0x3ebfaf(0xfc),'type':'string','description':a167_0x3ebfaf(0xd1),'hidden':!![]},{'name':a167_0x3ebfaf(0xce),'meowKey':'target','type':a167_0x3ebfaf(0xd2),'description':'Target\x20path','hidden':!![]},{'name':a167_0x3ebfaf(0xe8),'meowKey':a167_0x3ebfaf(0xf3),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xaf),'hidden':!![]},{'name':a167_0x3ebfaf(0xf6),'meowKey':a167_0x3ebfaf(0xf6),'type':'string','description':a167_0x3ebfaf(0xc4),'hidden':!![]},{'name':a167_0x3ebfaf(0xee),'meowKey':a167_0x3ebfaf(0xee),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xb9),'hidden':!![]},{'name':a167_0x3ebfaf(0xba),'meowKey':a167_0x3ebfaf(0xba),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xe2),'hidden':!![]},{'name':a167_0x3ebfaf(0xab),'meowKey':'stdin','type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0x8a),'hidden':!![]},{'name':a167_0x3ebfaf(0xd3),'meowKey':a167_0x3ebfaf(0xf8),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xfa),'hidden':!![]},{'name':'reveal','meowKey':'reveal','type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xf2),'hidden':!![]},{'name':a167_0x3ebfaf(0xd6),'meowKey':a167_0x3ebfaf(0xd6),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xcf),'hidden':!![]},{'name':a167_0x3ebfaf(0xbf),'meowKey':a167_0x3ebfaf(0xbf),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0x96),'hidden':!![]},{'name':'remote','meowKey':a167_0x3ebfaf(0xe6),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0x99),'hidden':!![]},{'name':a167_0x3ebfaf(0xa4),'meowKey':a167_0x3ebfaf(0xa4),'type':a167_0x3ebfaf(0xc8),'description':a167_0x3ebfaf(0xc7),'hidden':!![]},{'name':'expected-count','meowKey':'expectedCount','type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xa8),'hidden':!![]},{'name':'operation-type','meowKey':a167_0x3ebfaf(0xcd),'type':a167_0x3ebfaf(0xd2),'description':'Operation\x20type','hidden':!![]},{'name':a167_0x3ebfaf(0x9b),'meowKey':a167_0x3ebfaf(0x90),'type':a167_0x3ebfaf(0xd2),'description':a167_0x3ebfaf(0xfb),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a167_0x3ebfaf(0xac),a167_0x3ebfaf(0xf7),'env','format','jq',a167_0x3ebfaf(0x98),a167_0x3ebfaf(0xa3),a167_0x3ebfaf(0xde),'ci']);export function buildMeowFlags(){const _0x5a747a=a167_0x3ebfaf;return Object[_0x5a747a(0x93)](GLOBAL_FLAGS[_0x5a747a(0xae)](_0x1fb662=>[_0x1fb662[_0x5a747a(0xa1)],{'type':_0x1fb662[_0x5a747a(0xa7)]}]));}
|
|
1
|
+
const a169_0x51c153=a169_0x2b69;function a169_0x2b69(_0x22b7d0,_0x25c97b){_0x22b7d0=_0x22b7d0-0x174;const _0x513d9f=a169_0x513d();let _0x2b6963=_0x513d9f[_0x22b7d0];return _0x2b6963;}(function(_0xef650,_0x429d67){const _0x8335ad=a169_0x2b69,_0x486994=_0xef650();while(!![]){try{const _0x538cd1=-parseInt(_0x8335ad(0x17e))/0x1+parseInt(_0x8335ad(0x1b1))/0x2+parseInt(_0x8335ad(0x1a4))/0x3*(-parseInt(_0x8335ad(0x178))/0x4)+-parseInt(_0x8335ad(0x177))/0x5+parseInt(_0x8335ad(0x1c2))/0x6+parseInt(_0x8335ad(0x184))/0x7+parseInt(_0x8335ad(0x18f))/0x8;if(_0x538cd1===_0x429d67)break;else _0x486994['push'](_0x486994['shift']());}catch(_0x39c85e){_0x486994['push'](_0x486994['shift']());}}}(a169_0x513d,0xdaa30));export const CLI_BIN_NAME=a169_0x51c153(0x1b5);function a169_0x513d(){const _0x332d9f=['1070442kwfFkU','datasetcode','Keyword\x20filter','SQL\x20code','rabetbase','remote','global','Use\x20project\x20config\x20scope','nonInteractive','enable-bff-save','type','expectedCount','db-id','sql','Clear','target','format','5296200IHhBkp','clear','keyword','value','schemas','meowKey','appcode','Read\x20value\x20from\x20environment\x20variable','Watch\x20mode','Preview\x20operation\x20without\x20executing','functionNode','Skip\x20import\x20generation','Dataset\x20code','reveal','File\x20path','env','all','sql-name','Environment','@lovrabet/rabetbase-cli','Function\x20node','expected-count','Use\x20global\x20config\x20scope','Title','dbid','Rabetbase\x20CLI','function-node','non-interactive','Use\x20remote','<name>','stdin','DB\x20ID','4065395iUjcyp','4868qAaagm','confirm','Expected\x20affected\x20count','dry-run','Apply\x20to\x20all','Record\x20ID','526360hqNZMC','watch','fromEnv','Config\x20value','boolean','key','973854TwuDHy','pagesize','Output\x20format','Reveal\x20sensitive\x20value','production\x20|\x20daily','Code\x20filter','Read\x20value\x20from\x20stdin','fromEntries','yes','title','output','9074456ANOrkb','force','help','enableBffSave','Force\x20non-interactive\x20mode\x20(CI)','tags','params','<expr>','string','Enable\x20BFF\x20save','JSON\x20params','file','sqlcode','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','verbose','operation','SQL\x20string','Alias\x20for\x20--non-interactive','dryRun','skip-imports','skipImports','1125mcefal','Select\x20app\x20profile\x20by\x20name','page','app','sqlname','Page\x20number','Force\x20overwrite','map','Operation\x20type','name','Page\x20size','Target\x20path','code'];a169_0x513d=function(){return _0x332d9f;};return a169_0x513d();}export const CLI_DISPLAY_NAME=a169_0x51c153(0x1db);export const NPM_PACKAGE_NAME=a169_0x51c153(0x1d5);export const GLOBAL_FLAGS=[{'name':a169_0x51c153(0x1c8),'meowKey':a169_0x51c153(0x1c8),'type':a169_0x51c153(0x197),'description':'Override\x20appcode','hint':'<code>'},{'name':a169_0x51c153(0x1a7),'meowKey':a169_0x51c153(0x1a7),'type':'string','description':a169_0x51c153(0x1a5),'hint':a169_0x51c153(0x174)},{'name':'env','meowKey':'env','type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1d4),'hint':a169_0x51c153(0x188)},{'name':a169_0x51c153(0x1c1),'meowKey':a169_0x51c153(0x1c1),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x186),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a169_0x51c153(0x197),'description':a169_0x51c153(0x19c),'hint':a169_0x51c153(0x196)},{'name':a169_0x51c153(0x17b),'meowKey':a169_0x51c153(0x1a1),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1cb)},{'name':a169_0x51c153(0x18c),'meowKey':'yes','type':a169_0x51c153(0x182),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a169_0x51c153(0x1dd),'meowKey':a169_0x51c153(0x1b9),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x193)},{'name':a169_0x51c153(0x1b7),'meowKey':'global','type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1d8)},{'name':'project','meowKey':'project','type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1b8)},{'name':'ci','meowKey':'ci','type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1a0),'hidden':!![]},{'name':a169_0x51c153(0x191),'meowKey':a169_0x51c153(0x191),'type':a169_0x51c153(0x182),'description':'Show\x20help'},{'name':'name','meowKey':a169_0x51c153(0x1ad),'type':'string','description':'Name','hidden':!![]},{'name':a169_0x51c153(0x18d),'meowKey':a169_0x51c153(0x18d),'type':'string','description':a169_0x51c153(0x1d9),'hidden':!![]},{'name':a169_0x51c153(0x1c3),'meowKey':a169_0x51c153(0x1c3),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1bf),'hidden':!![]},{'name':a169_0x51c153(0x17f),'meowKey':a169_0x51c153(0x17f),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1ca),'hidden':!![]},{'name':a169_0x51c153(0x18e),'meowKey':a169_0x51c153(0x18e),'type':a169_0x51c153(0x197),'description':'Output\x20path','hidden':!![]},{'name':a169_0x51c153(0x195),'meowKey':a169_0x51c153(0x195),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x199),'hidden':!![]},{'name':a169_0x51c153(0x1b2),'meowKey':a169_0x51c153(0x1b2),'type':'string','description':a169_0x51c153(0x1ce),'hidden':!![]},{'name':'all','meowKey':a169_0x51c153(0x1d2),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x17c),'hidden':!![]},{'name':a169_0x51c153(0x1ba),'meowKey':a169_0x51c153(0x192),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x198),'hidden':!![]},{'name':'id','meowKey':'id','type':a169_0x51c153(0x197),'description':a169_0x51c153(0x17d),'hidden':!![]},{'name':a169_0x51c153(0x1bb),'meowKey':a169_0x51c153(0x1bb),'type':'string','description':'Type\x20filter','hidden':!![]},{'name':a169_0x51c153(0x19a),'meowKey':a169_0x51c153(0x19a),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1d0),'hidden':!![]},{'name':'sqlcode','meowKey':a169_0x51c153(0x19b),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1b4),'hidden':!![]},{'name':a169_0x51c153(0x1d3),'meowKey':'sqlName','type':a169_0x51c153(0x197),'description':'SQL\x20name','hidden':!![]},{'name':a169_0x51c153(0x1a8),'meowKey':'sqlname','type':'string','description':'SQL\x20name','hidden':!![]},{'name':a169_0x51c153(0x1bd),'meowKey':'dbId','type':a169_0x51c153(0x197),'description':a169_0x51c153(0x176),'hidden':!![]},{'name':a169_0x51c153(0x1da),'meowKey':a169_0x51c153(0x1da),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x176),'hidden':!![]},{'name':'description','meowKey':'description','type':a169_0x51c153(0x197),'description':'Description','hidden':!![]},{'name':'description-file','meowKey':'descriptionFile','type':a169_0x51c153(0x197),'description':'Description\x20file','hidden':!![]},{'name':a169_0x51c153(0x1a6),'meowKey':a169_0x51c153(0x1a6),'type':'string','description':a169_0x51c153(0x1a9),'hidden':!![]},{'name':a169_0x51c153(0x185),'meowKey':a169_0x51c153(0x185),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1ae),'hidden':!![]},{'name':'keyword','meowKey':a169_0x51c153(0x1c4),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1b3),'hidden':!![]},{'name':a169_0x51c153(0x1b0),'meowKey':a169_0x51c153(0x1b0),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x189),'hidden':!![]},{'name':a169_0x51c153(0x1be),'meowKey':a169_0x51c153(0x1be),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x19f),'hidden':!![]},{'name':'schemas','meowKey':a169_0x51c153(0x1c6),'type':'string','description':'Schemas','hidden':!![]},{'name':a169_0x51c153(0x19e),'meowKey':a169_0x51c153(0x19e),'type':'string','description':a169_0x51c153(0x1ac),'hidden':!![]},{'name':a169_0x51c153(0x1c0),'meowKey':a169_0x51c153(0x1c0),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1af),'hidden':!![]},{'name':a169_0x51c153(0x1a2),'meowKey':a169_0x51c153(0x1a3),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1cd),'hidden':!![]},{'name':a169_0x51c153(0x183),'meowKey':'key','type':a169_0x51c153(0x197),'description':'Config\x20key','hidden':!![]},{'name':a169_0x51c153(0x1c5),'meowKey':a169_0x51c153(0x1c5),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x181),'hidden':!![]},{'name':'tags','meowKey':a169_0x51c153(0x194),'type':'string','description':'Tags','hidden':!![]},{'name':a169_0x51c153(0x175),'meowKey':a169_0x51c153(0x175),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x18a),'hidden':!![]},{'name':'from-env','meowKey':a169_0x51c153(0x180),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1c9),'hidden':!![]},{'name':a169_0x51c153(0x1cf),'meowKey':'reveal','type':'boolean','description':a169_0x51c153(0x187),'hidden':!![]},{'name':a169_0x51c153(0x190),'meowKey':a169_0x51c153(0x190),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1aa),'hidden':!![]},{'name':a169_0x51c153(0x179),'meowKey':a169_0x51c153(0x179),'type':'boolean','description':'Confirm\x20destructive\x20action','hidden':!![]},{'name':a169_0x51c153(0x1b6),'meowKey':a169_0x51c153(0x1b6),'type':a169_0x51c153(0x182),'description':a169_0x51c153(0x1de),'hidden':!![]},{'name':'verbose','meowKey':a169_0x51c153(0x19d),'type':a169_0x51c153(0x182),'description':'Verbose\x20output','hidden':!![]},{'name':a169_0x51c153(0x1d7),'meowKey':a169_0x51c153(0x1bc),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x17a),'hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':a169_0x51c153(0x197),'description':'Operation\x20type','hidden':!![]},{'name':a169_0x51c153(0x1dc),'meowKey':a169_0x51c153(0x1cc),'type':a169_0x51c153(0x197),'description':a169_0x51c153(0x1d6),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode',a169_0x51c153(0x1a7),a169_0x51c153(0x1d1),a169_0x51c153(0x1c1),'jq',a169_0x51c153(0x17b),a169_0x51c153(0x18c),a169_0x51c153(0x1dd),'ci']);export function buildMeowFlags(){const _0x4d4694=a169_0x51c153;return Object[_0x4d4694(0x18b)](GLOBAL_FLAGS[_0x4d4694(0x1ab)](_0x375df2=>[_0x375df2[_0x4d4694(0x1c7)],{'type':_0x375df2[_0x4d4694(0x1bb)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a170_0x3fbe32=a170_0x35a6;(function(_0x3a2f28,_0x3aebb1){const _0x1f8ea6=a170_0x35a6,_0x2eb09c=_0x3a2f28();while(!![]){try{const _0x296991=-parseInt(_0x1f8ea6(0x125))/0x1+parseInt(_0x1f8ea6(0x120))/0x2*(-parseInt(_0x1f8ea6(0x11e))/0x3)+parseInt(_0x1f8ea6(0x123))/0x4+parseInt(_0x1f8ea6(0x126))/0x5*(-parseInt(_0x1f8ea6(0x122))/0x6)+-parseInt(_0x1f8ea6(0x124))/0x7+-parseInt(_0x1f8ea6(0x127))/0x8+parseInt(_0x1f8ea6(0x129))/0x9;if(_0x296991===_0x3aebb1)break;else _0x2eb09c['push'](_0x2eb09c['shift']());}catch(_0x259b1d){_0x2eb09c['push'](_0x2eb09c['shift']());}}}(a170_0x56e1,0xc1af1));import{DEFAULT_API_DIR}from'../constant/paths.js';function a170_0x35a6(_0x5385ed,_0x4a1672){_0x5385ed=_0x5385ed-0x11d;const _0x56e15d=a170_0x56e1();let _0x35a6b9=_0x56e15d[_0x5385ed];return _0x35a6b9;}export const DEFAULT_CONFIG_VALUES={'env':a170_0x3fbe32(0x11f),'format':a170_0x3fbe32(0x11d),'locale':a170_0x3fbe32(0x121),'riskLevel':a170_0x3fbe32(0x128),'apiDir':DEFAULT_API_DIR};function a170_0x56e1(){const _0x4508a9=['production','758GoHueT','en-US','12gJYDdL','2793044QuNdBX','10210578fqoyrM','1568579rCMnWa','3081070zBwYwJ','3245520ItbNbF','high-risk-write','52077348oUlcar','compress','8121sENWcq'];a170_0x56e1=function(){return _0x4508a9;};return a170_0x56e1();}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a170_0x3fbe32(0x11d);
|