@lovrabet/rabetbase-cli 2.3.6-beta.1 → 2.3.6
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/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/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 a156_0x3c5819=a156_0x5b38;(function(_0x85826a,_0x405240){const _0x11b64c=a156_0x5b38,_0x5858e0=_0x85826a();while(!![]){try{const _0x18c7ac=parseInt(_0x11b64c(0x1f5))/0x1+-parseInt(_0x11b64c(0x1c6))/0x2*(-parseInt(_0x11b64c(0x1dc))/0x3)+parseInt(_0x11b64c(0x1dd))/0x4*(parseInt(_0x11b64c(0x1f1))/0x5)+-parseInt(_0x11b64c(0x1ed))/0x6*(parseInt(_0x11b64c(0x1ff))/0x7)+-parseInt(_0x11b64c(0x1d3))/0x8+-parseInt(_0x11b64c(0x1e2))/0x9+-parseInt(_0x11b64c(0x1ce))/0xa;if(_0x18c7ac===_0x405240)break;else _0x5858e0['push'](_0x5858e0['shift']());}catch(_0x233200){_0x5858e0['push'](_0x5858e0['shift']());}}}(a156_0x3210,0xa3f29));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';function a156_0x5b38(_0xb005fd,_0x1ff9a3){_0xb005fd=_0xb005fd-0x1c6;const _0x32106f=a156_0x3210();let _0x5b3820=_0x32106f[_0xb005fd];return _0x5b3820;}import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a156_0x3210(){const _0x2993fe=['toISOString','Filter\x20by\x20SQL\x20display\x20name','sqlcode','sqlCode','sqls','279iPMYjF','24Qszikz','mybatisXml','description','sql','push','4716324PYasQx','catch','appCode','sqlRoot','conflict','lastSync','write','tableData','dbId','test','sqlName','1288398pUiZgV','No\x20remote\x20SQL\x20queries\x20matched.','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','paging','1017550skJVvS','sqlContent','trimStart','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','80430GnXuEC','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Force\x20overwrite\x20local\x20unsynced\x20changes','unchanged','string','Force\x20pull\x20cancelled.','length','lockFilePath','cancelled','Would\x20pull\x20','21gfFQwr','\x20written,\x20','local\x20differs\x20from\x20remote','21236ECOWWC','skipped','pull','POST','name','replace','path','str','1741890WnpQvk','apps','sqlRootDir','\x20SQL\x20file(s)\x20into\x20','utf8','2200088jiLVlD','force','filter','message'];a156_0x3210=function(){return _0x2993fe;};return a156_0x3210();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1b6357,_0x7063bc){const _0x4bb2d0=a156_0x5b38,_0x9b0f9a=[];let _0x3ad9d7=0x1;while(!![]){const _0x46966b=await listSqlQueries(_0x1b6357,{'currentPage':_0x3ad9d7,'pageSize':PAGE_SIZE,'sqlCode':_0x7063bc[_0x4bb2d0(0x1da)],'sqlName':_0x7063bc[_0x4bb2d0(0x1ec)]}),_0x50eb57=_0x46966b[_0x4bb2d0(0x1e9)]??[];_0x9b0f9a[_0x4bb2d0(0x1e1)](..._0x50eb57);if(_0x50eb57[_0x4bb2d0(0x1fb)]===0x0)break;const _0x43f87d=_0x46966b[_0x4bb2d0(0x1f0)]?.['totalCount'];if(_0x43f87d!=null?_0x9b0f9a[_0x4bb2d0(0x1fb)]>=_0x43f87d:_0x50eb57[_0x4bb2d0(0x1fb)]<PAGE_SIZE)break;_0x3ad9d7++;}return _0x9b0f9a;}async function ensureSqlContent(_0x1b04b0){const _0x68dffa=a156_0x5b38;if(_0x1b04b0[_0x68dffa(0x1f2)]!=null&&String(_0x1b04b0['sqlContent'])[_0x68dffa(0x1fb)]>0x0)return _0x1b04b0;return getSqlQueryDetail(_0x1b04b0['sqlCode']);}export const sqlPull={'service':a156_0x3c5819(0x1e0),'command':a156_0x3c5819(0x1c8),'description':a156_0x3c5819(0x1f6),'risk':a156_0x3c5819(0x1e8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a156_0x3c5819(0x1f9),'description':a156_0x3c5819(0x1d8)},{'name':'force','type':'boolean','description':a156_0x3c5819(0x1f7)}],async 'dryRun'(_0x2fccd7){const _0x4f086f=a156_0x3c5819,_0xbb6647=loadSqlProjectConfig(_0x2fccd7[_0x4f086f(0x1e4)]),_0x47e9b6=await readSqlLockFile(_0xbb6647[_0x4f086f(0x1fc)]),{appLock:_0x3753dd}=ensureSqlLockScope(_0x47e9b6??createEmptySqlLock(),_0xbb6647[_0x4f086f(0x1e4)],_0xbb6647[_0x4f086f(0x1e5)],_0x4f086f(0x1c8)),_0x213ce3=await fetchAllSqlQueries(_0x2fccd7[_0x4f086f(0x1e4)],{'sqlCode':_0x2fccd7['str'](_0x4f086f(0x1d9))||undefined,'sqlName':_0x2fccd7[_0x4f086f(0x1cd)](_0x4f086f(0x1ca))||undefined}),_0x36ceaf=[];for(const _0x307dd2 of _0x213ce3){const _0x55417d=await ensureSqlContent(_0x307dd2),_0x1d4110=ensureRemoteSqlContent(_0x55417d),_0x5ec41f=detectModeFromSql(_0x55417d),_0x3160b6=_0x55417d[_0x4f086f(0x1ea)]?await getDbName(_0x2fccd7[_0x4f086f(0x1e4)],Number(_0x55417d[_0x4f086f(0x1ea)]))[_0x4f086f(0x1e3)](()=>undefined):undefined,_0x4fafb5=buildLocalSqlFileContent({'sqlCode':_0x55417d[_0x4f086f(0x1da)],'sqlName':_0x55417d[_0x4f086f(0x1ec)],'dbId':_0x55417d[_0x4f086f(0x1ea)]},_0x1d4110,{'dbName':_0x3160b6,'mode':_0x5ec41f,'syncedAt':new Date()[_0x4f086f(0x1d7)](),'description':_0x55417d[_0x4f086f(0x1df)]}),_0x42b60b=buildSqlLockEntry(_0x55417d,_0x1d4110,'',{'dbName':_0x3160b6}),_0x12baa9=resolveLocalSqlFilePath(_0xbb6647,_0x55417d['sqlCode'],_0x42b60b);let _0x47e07a='would_pull',_0x4b4f79;if(await fileExists(_0x12baa9)){const _0x24bca3=await readFile(_0x12baa9,'utf8');isEquivalentPulledSqlFile(_0x24bca3,_0x4fafb5,_0x5ec41f)?(_0x47e07a=_0x4f086f(0x1c7),_0x4b4f79=_0x4f086f(0x1f8)):(_0x47e07a=_0x4f086f(0x1e6),_0x4b4f79='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x36ceaf[_0x4f086f(0x1e1)]({'sqlCode':_0x55417d[_0x4f086f(0x1da)],'sqlName':_0x55417d['sqlName'],'filePath':_0x12baa9,'status':_0x47e07a,'reason':_0x4b4f79});}return{'method':_0x4f086f(0x1c9),'url':_0x4f086f(0x1f4),'body':{'appCode':_0x2fccd7[_0x4f086f(0x1e4)],'sqlCode':_0x2fccd7[_0x4f086f(0x1cd)]('sqlcode')||null,'sqlName':_0x2fccd7[_0x4f086f(0x1cd)](_0x4f086f(0x1ca))||null,'files':_0x36ceaf},'description':_0x4f086f(0x1fe)+_0x36ceaf['length']+_0x4f086f(0x1d1)+_0xbb6647[_0x4f086f(0x1d0)]};},async 'execute'(_0x584d29){const _0x135169=a156_0x3c5819,_0x1cace1=loadSqlProjectConfig(_0x584d29[_0x135169(0x1e4)]),_0x5eeff6=await readSqlLockFile(_0x1cace1[_0x135169(0x1fc)]),{lockData:_0x3f327e,appLock:_0x4dc0ee}=ensureSqlLockScope(_0x5eeff6??createEmptySqlLock(),_0x1cace1[_0x135169(0x1e4)],_0x1cace1[_0x135169(0x1e5)],'pull'),_0x46e3ca=_0x584d29['bool'](_0x135169(0x1d4)),_0x2f9d1b=await fetchAllSqlQueries(_0x584d29[_0x135169(0x1e4)],{'sqlCode':_0x584d29[_0x135169(0x1cd)](_0x135169(0x1d9))||undefined,'sqlName':_0x584d29[_0x135169(0x1cd)](_0x135169(0x1ca))||undefined});if(_0x2f9d1b[_0x135169(0x1fb)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x135169(0x1ee)};const _0x1b65b6=[],_0x3d6e63=[];for(const _0x1b5e00 of _0x2f9d1b){try{_0x1b65b6[_0x135169(0x1e1)](await ensureSqlContent(_0x1b5e00));}catch(_0x2ffea5){_0x3d6e63[_0x135169(0x1e1)]({'sqlCode':_0x1b5e00[_0x135169(0x1da)],'error':_0x2ffea5 instanceof Error?_0x2ffea5[_0x135169(0x1d6)]:String(_0x2ffea5)});}}if(_0x46e3ca&&!_0x584d29['nonInteractive']){let _0xd7b443=![];for(const _0x1007d3 of _0x1b65b6){const _0x1ed436=detectModeFromSql(_0x1007d3),_0x159b29=_0x1007d3[_0x135169(0x1ea)]?await getDbName(_0x584d29['appCode'],Number(_0x1007d3[_0x135169(0x1ea)]))[_0x135169(0x1e3)](()=>undefined):undefined,_0x134120=buildLocalSqlFileContent({'sqlCode':_0x1007d3[_0x135169(0x1da)],'sqlName':_0x1007d3[_0x135169(0x1ec)],'dbId':_0x1007d3['dbId']},ensureRemoteSqlContent(_0x1007d3),{'dbName':_0x159b29,'mode':_0x1ed436,'syncedAt':new Date()[_0x135169(0x1d7)](),'description':_0x1007d3[_0x135169(0x1df)]}),_0x97cce4=resolveLocalSqlFilePath(_0x1cace1,_0x1007d3[_0x135169(0x1da)],buildSqlLockEntry(_0x1007d3,ensureRemoteSqlContent(_0x1007d3),'',{'dbName':_0x159b29}));if(await fileExists(_0x97cce4)){const _0x1695f1=await readFile(_0x97cce4,'utf8');if(!isEquivalentPulledSqlFile(_0x1695f1,_0x134120,_0x1ed436)){_0xd7b443=!![];break;}}}if(_0xd7b443){const _0x46bb1e=await confirmForceOverwrite(_0x135169(0x1ef));if(!_0x46bb1e)throw CliErrors[_0x135169(0x1fd)](_0x135169(0x1fa));}}const _0x4487ac=cloneSqlLockData(_0x3f327e),_0x3a1d6d=_0x4487ac[_0x135169(0x1cf)][_0x1cace1[_0x135169(0x1e4)]],_0x32effb=[],_0x1c2796=[];for(const _0x23088f of _0x1b65b6){const _0x275f2a=_0x3a1d6d[_0x135169(0x1db)][_0x23088f[_0x135169(0x1da)]],_0x314752=ensureRemoteSqlContent(_0x23088f),_0x1d3870=detectModeFromSql(_0x23088f),_0x26d90e=_0x23088f['dbId']?await getDbName(_0x584d29[_0x135169(0x1e4)],Number(_0x23088f[_0x135169(0x1ea)]))['catch'](()=>undefined):undefined,_0x50b9d8=buildLocalSqlFileContent({'sqlCode':_0x23088f['sqlCode'],'sqlName':_0x23088f['sqlName'],'dbId':_0x23088f['dbId']},_0x314752,{'dbName':_0x26d90e,'mode':_0x1d3870,'syncedAt':new Date()[_0x135169(0x1d7)](),'description':_0x23088f[_0x135169(0x1df)]}),_0x350120=buildSqlLockEntry(_0x23088f,_0x314752,computeSqlContentHash(_0x50b9d8),{'dbName':_0x26d90e}),_0x43fc13=_0x350120[_0x135169(0x1cc)],_0x80f10e=join(_0x1cace1[_0x135169(0x1d0)],_0x43fc13);try{if(await fileExists(_0x80f10e)){const _0x124f51=await readFile(_0x80f10e,'utf8');if(isEquivalentPulledSqlFile(_0x124f51,_0x50b9d8,_0x1d3870)){_0x1c2796['push']({'sqlCode':_0x23088f['sqlCode'],'reason':'unchanged'}),_0x3a1d6d[_0x135169(0x1db)][_0x23088f[_0x135169(0x1da)]]={..._0x350120,'hash':computeSqlContentHash(_0x124f51),'path':_0x43fc13};continue;}if(!_0x46e3ca){_0x1c2796['push']({'sqlCode':_0x23088f[_0x135169(0x1da)],'reason':_0x135169(0x201)});continue;}}const _0x4947af=_0x275f2a?.['path']?join(_0x1cace1[_0x135169(0x1d0)],_0x275f2a[_0x135169(0x1cc)]):undefined;_0x4947af&&_0x4947af!==_0x80f10e&&await fileExists(_0x4947af)&&await rm(_0x4947af,{'force':!![]}),await ensureParentDirectory(_0x80f10e),await writeFile(_0x80f10e,_0x50b9d8,_0x135169(0x1d2)),_0x3a1d6d[_0x135169(0x1db)][_0x23088f[_0x135169(0x1da)]]={..._0x350120,'path':_0x43fc13},_0x32effb[_0x135169(0x1e1)]({'sqlCode':_0x23088f[_0x135169(0x1da)],'filePath':_0x80f10e});}catch(_0x586313){_0x3d6e63['push']({'sqlCode':_0x23088f['sqlCode'],'error':_0x586313 instanceof Error?_0x586313[_0x135169(0x1d6)]:String(_0x586313)});}}return _0x3a1d6d[_0x135169(0x1e7)]=new Date()[_0x135169(0x1d7)](),await writeSqlLockFile(_0x1cace1[_0x135169(0x1fc)],_0x4487ac),{'ok':_0x3d6e63['length']===0x0,'data':{'pulled':_0x32effb,'skipped':_0x1c2796,'failed':_0x3d6e63},'message':'Pull\x20complete:\x20'+_0x32effb[_0x135169(0x1fb)]+_0x135169(0x200)+_0x1c2796[_0x135169(0x1fb)]+'\x20skipped,\x20'+_0x3d6e63['length']+'\x20failed'};}};function detectModeFromSql(_0xe1e4af){const _0x72b6a4=a156_0x3c5819,_0x2fb697=ensureRemoteSqlContent(_0xe1e4af),_0x22ea1d=stripLocalSqlMetadata(_0x2fb697,_0x72b6a4(0x1de))[_0x72b6a4(0x1f3)]();if(/^<(select|insert|update|delete)\b/i[_0x72b6a4(0x1eb)](_0x22ea1d))return _0x72b6a4(0x1de);return _0x72b6a4(0x1e0);}function isEquivalentPulledSqlFile(_0x192d31,_0x28d25f,_0x11e50e){return normalizePullComparableContent(_0x192d31,_0x11e50e)===normalizePullComparableContent(_0x28d25f,_0x11e50e);}function normalizePullComparableContent(_0xd60c24,_0x3dd52a){const _0x24532b=a156_0x3c5819,_0x38e2ea=_0xd60c24[_0x24532b(0x1cb)](/\r\n/g,'\x0a')['split']('\x0a'),_0xf71e49=_0x38e2ea[_0x24532b(0x1d5)](_0x2c0f2=>!isSyncedAtMetadataLine(_0x2c0f2,_0x3dd52a));return _0xf71e49['join']('\x0a');}function isSyncedAtMetadataLine(_0x156da5,_0x3781d4){const _0x326488=a156_0x3c5819;if(_0x3781d4===_0x326488(0x1de))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x156da5);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x326488(0x1eb)](_0x156da5);}
|
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 a157_0x56aecf=a157_0x5cbd;(function(_0x40b394,_0xc0ea85){const _0x2ebd98=a157_0x5cbd,_0x20ac40=_0x40b394();while(!![]){try{const _0x4a75b4=parseInt(_0x2ebd98(0x20f))/0x1+-parseInt(_0x2ebd98(0x213))/0x2+-parseInt(_0x2ebd98(0x1fa))/0x3*(parseInt(_0x2ebd98(0x1ec))/0x4)+parseInt(_0x2ebd98(0x212))/0x5*(-parseInt(_0x2ebd98(0x1fb))/0x6)+parseInt(_0x2ebd98(0x216))/0x7*(-parseInt(_0x2ebd98(0x1ea))/0x8)+parseInt(_0x2ebd98(0x1e0))/0x9+-parseInt(_0x2ebd98(0x1f6))/0xa*(-parseInt(_0x2ebd98(0x1e4))/0xb);if(_0x4a75b4===_0xc0ea85)break;else _0x20ac40['push'](_0x20ac40['shift']());}catch(_0x18568c){_0x20ac40['push'](_0x20ac40['shift']());}}}(a157_0x2389,0x20236));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';function a157_0x5cbd(_0x40ff17,_0x250070){_0x40ff17=_0x40ff17-0x1de;const _0x238913=a157_0x2389();let _0x5cbde3=_0x238913[_0x40ff17];return _0x5cbde3;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xce3a56,_0x33d505,_0x15f998){const _0xe8132c=a157_0x5cbd,_0x41a9af=await scanLocalSqlQueries(_0xce3a56),_0x3a2b37=new Map();for(const _0x513815 of _0x41a9af){if(_0x15f998&&_0x513815['sqlCode']!==_0x15f998)continue;const _0x16cd93=_0x3a2b37[_0xe8132c(0x202)](_0x513815[_0xe8132c(0x1f0)])??[];_0x16cd93[_0xe8132c(0x1ed)](_0x513815),_0x3a2b37['set'](_0x513815[_0xe8132c(0x1f0)],_0x16cd93);}if(_0x15f998&&!_0x3a2b37[_0xe8132c(0x20d)](_0x15f998))throw CliErrors[_0xe8132c(0x1f3)]('Local\x20SQL\x20not\x20found:\x20'+_0x15f998);const _0x32298d=[];for(const [_0x13153f,_0x48f35b]of _0x3a2b37['entries']()){if(_0x48f35b[_0xe8132c(0x219)]===0x1){_0x32298d['push'](_0x48f35b[0x0]);continue;}const _0x285978=_0x33d505[_0xe8132c(0x203)][_0x13153f],_0x2f28f2=_0x285978?.[_0xe8132c(0x210)],_0x429421=_0x2f28f2?_0x48f35b[_0xe8132c(0x20b)](_0xbd7961=>_0xbd7961['relativePath']!==_0x2f28f2):_0x48f35b;if(_0x285978&&_0x429421['length']===0x1){_0x32298d[_0xe8132c(0x1ed)](_0x429421[0x0]);continue;}throw CliErrors[_0xe8132c(0x1f3)](_0xe8132c(0x1e5)+_0x13153f+_0xe8132c(0x1de));}return _0x32298d;}function a157_0x2389(){const _0x4b3227=['version','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','20qIRWRb','filePath','lockFilePath','sqlName','123TCFOaj','1098KapPCg','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','POST','sqlConfig','\x22\x20for\x20sqlCode\x20','Would\x20push\x20','str','get','sqls','bool','sqlcode','map','dbId','appCode','force','relativePath','filter','trashDir','has','Local\x20directory\x20\x22','208080HjRfsx','path','Push\x20complete:\x20','1095XvKrcB','407616aNPVfY','utf8','unchanged','1587362GokHlB','No\x20database\x20matches\x20local\x20directory\x20\x22','hash','length','sqlRoot','join','\x20failed','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','message','711270GaPNGm','catch','toISOString','remoteId','2940135XkJtNk','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','dbDirectory','dbName','high-risk-write','8zlPzni','\x20SQL\x20file(s)','21404qbOAZK','push','mode','isFinite','sqlCode','sqlRootDir','No\x20local\x20SQL\x20files\x20found.','validation'];a157_0x2389=function(){return _0x4b3227;};return a157_0x2389();}export const sqlPush={'service':'sql','command':'push','description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a157_0x56aecf(0x1e9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a157_0x56aecf(0x209),'type':'boolean','description':a157_0x56aecf(0x1f5)}],async 'dryRun'(_0x5edde3){const _0x1eedd8=a157_0x56aecf,_0x57c869=loadSqlProjectConfig(_0x5edde3[_0x1eedd8(0x208)]),_0x1f8ac8=await readSqlLockFile(_0x57c869['lockFilePath']),{appLock:_0x50e948}=ensureSqlLockScope(_0x1f8ac8??createEmptySqlLock(),_0x5edde3[_0x1eedd8(0x208)],_0x57c869['sqlRoot'],'push'),_0x4a7aee=await getTargetSqlQueries(_0x57c869,_0x50e948,_0x5edde3[_0x1eedd8(0x201)](_0x1eedd8(0x205))||undefined),_0x24ddd8=[];for(const _0x3df94b of _0x4a7aee){const _0x193ca9=await computeSqlFileHash(_0x3df94b[_0x1eedd8(0x1f7)]),_0x3f1b7b=_0x50e948[_0x1eedd8(0x203)][_0x3df94b['sqlCode']],_0x20af68=!!_0x3f1b7b&&(_0x3f1b7b[_0x1eedd8(0x210)]!==_0x3df94b[_0x1eedd8(0x20a)]||!!_0x3df94b['sqlName']&&_0x3f1b7b['sqlName']!==_0x3df94b[_0x1eedd8(0x1f9)]);if(!_0x5edde3['bool'](_0x1eedd8(0x209))&&_0x3f1b7b&&_0x3f1b7b[_0x1eedd8(0x218)]===_0x193ca9&&!_0x20af68)continue;_0x24ddd8[_0x1eedd8(0x1ed)](_0x3df94b[_0x1eedd8(0x1f0)]);}return{'method':_0x1eedd8(0x1fd),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x24ddd8,'appCode':_0x5edde3[_0x1eedd8(0x208)]},'description':_0x1eedd8(0x200)+_0x24ddd8[_0x1eedd8(0x219)]+_0x1eedd8(0x1eb)};},async 'execute'(_0x488fd7){const _0x2b5c2b=a157_0x56aecf,_0xc39d10=loadSqlProjectConfig(_0x488fd7[_0x2b5c2b(0x208)]),_0x5aef8b=await readSqlLockFile(_0xc39d10[_0x2b5c2b(0x1f8)]),{lockData:_0x423d35,appLock:_0x2af636}=ensureSqlLockScope(_0x5aef8b??createEmptySqlLock(),_0x488fd7[_0x2b5c2b(0x208)],_0xc39d10[_0x2b5c2b(0x21a)],_0x2b5c2b(0x1ed)),_0x5aed48=await getTargetSqlQueries(_0xc39d10,_0x2af636,_0x488fd7['str'](_0x2b5c2b(0x205))||undefined);if(_0x5aed48[_0x2b5c2b(0x219)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2b5c2b(0x1f2)};const _0x4bd865=[],_0x57de41=[],_0x2f8167=[];for(const _0x42b5dd of _0x5aed48){const _0x47528b=_0x2af636[_0x2b5c2b(0x203)][_0x42b5dd['sqlCode']];if(!_0x47528b){_0x2f8167[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x367cdc=await computeSqlFileHash(_0x42b5dd['filePath']),_0x4c4717=_0x47528b[_0x2b5c2b(0x210)]!==_0x42b5dd[_0x2b5c2b(0x20a)]||!!_0x42b5dd[_0x2b5c2b(0x1f9)]&&_0x47528b[_0x2b5c2b(0x1f9)]!==_0x42b5dd[_0x2b5c2b(0x1f9)];if(!_0x488fd7[_0x2b5c2b(0x204)](_0x2b5c2b(0x209))&&_0x47528b[_0x2b5c2b(0x218)]===_0x367cdc&&!_0x4c4717){_0x57de41[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'reason':_0x2b5c2b(0x215)});continue;}if(_0x47528b[_0x2b5c2b(0x1f4)]==null){_0x2f8167[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'error':_0x2b5c2b(0x1e6)});continue;}const _0xfa3cf4=await readFile(_0x42b5dd[_0x2b5c2b(0x1f7)],_0x2b5c2b(0x214)),_0x2b24b1=stripLocalSqlMetadata(_0xfa3cf4,_0x42b5dd[_0x2b5c2b(0x1ee)]),_0xe64964=_0x42b5dd[_0x2b5c2b(0x1f9)]||_0x47528b[_0x2b5c2b(0x1f9)],_0xdc586=await resolveTargetDbBinding(_0x488fd7['appCode'],_0x42b5dd,_0x47528b),_0x46a0f3=await updateSqlQuery({'id':_0x47528b[_0x2b5c2b(0x1e3)],'appCode':_0x488fd7[_0x2b5c2b(0x208)],'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'sqlName':_0xe64964,'dbId':_0xdc586[_0x2b5c2b(0x207)],'version':_0x47528b[_0x2b5c2b(0x1f4)],'sqlContent':_0x2b24b1,'sqlConfig':_0x47528b[_0x2b5c2b(0x1fe)]??undefined}),_0x4fa353=_0x46a0f3['dbId']?await getDbName(_0x488fd7[_0x2b5c2b(0x208)],Number(_0x46a0f3[_0x2b5c2b(0x207)]))[_0x2b5c2b(0x1e1)](()=>_0xdc586[_0x2b5c2b(0x1e8)]):_0xdc586['dbName'];_0x2af636[_0x2b5c2b(0x203)][_0x42b5dd[_0x2b5c2b(0x1f0)]]={...buildSqlLockEntry(_0x46a0f3,_0x2b24b1,_0x367cdc,{'dbName':_0x4fa353}),'path':_0x42b5dd[_0x2b5c2b(0x20a)],'mode':_0x47528b['mode']},await archivePreviousSqlFileIfNeeded(_0xc39d10,_0x47528b[_0x2b5c2b(0x210)],_0x42b5dd['relativePath']),_0x4bd865[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'remoteId':_0x47528b['remoteId']});}catch(_0x1a2f57){_0x2f8167[_0x2b5c2b(0x1ed)]({'sqlCode':_0x42b5dd[_0x2b5c2b(0x1f0)],'error':_0x1a2f57 instanceof Error?_0x1a2f57[_0x2b5c2b(0x1df)]:String(_0x1a2f57)});}}return _0x2af636['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0xc39d10[_0x2b5c2b(0x1f8)],_0x423d35),{'ok':_0x2f8167[_0x2b5c2b(0x219)]===0x0,'data':{'pushed':_0x4bd865,'skipped':_0x57de41,'failed':_0x2f8167},'message':_0x2b5c2b(0x211)+_0x4bd865[_0x2b5c2b(0x219)]+'\x20pushed,\x20'+_0x57de41[_0x2b5c2b(0x219)]+'\x20skipped,\x20'+_0x2f8167['length']+_0x2b5c2b(0x21c)};}};async function archivePreviousSqlFileIfNeeded(_0x5a75ba,_0x451885,_0x5cca12){const _0xcb273b=a157_0x56aecf;if(!_0x451885||_0x451885===_0x5cca12)return;const _0x2f69a3=join(_0x5a75ba[_0xcb273b(0x1f1)],_0x451885);if(!await fileExists(_0x2f69a3))return;const _0x3b21cb=await moveToTrash(_0x5a75ba['projectRoot'],_0x5a75ba[_0xcb273b(0x20c)],_0x2f69a3);await cleanupEmptyDirectories(dirname(_0x2f69a3),_0x5a75ba[_0xcb273b(0x1f1)]),void _0x3b21cb;}async function moveToTrash(_0x5be437,_0x4ec202,_0x1e8ed7){const _0x563556=a157_0x56aecf,_0x148f65=new Date()[_0x563556(0x1e2)]()['replace'](/[:.]/g,'-'),_0x4eb31d=relative(_0x5be437,_0x1e8ed7),_0x574865=join(_0x4ec202,_0x148f65,_0x4eb31d);return await mkdir(dirname(_0x574865),{'recursive':!![]}),await rename(_0x1e8ed7,_0x574865),_0x574865;}async function cleanupEmptyDirectories(_0x1b6319,_0x11aa82){const _0xd4636a=a157_0x56aecf;let _0x4203dc=resolve(_0x1b6319);const _0x3fcff1=resolve(_0x11aa82);while(_0x4203dc['startsWith'](''+_0x3fcff1+sep)||_0x4203dc===_0x3fcff1){if(_0x4203dc===_0x3fcff1)return;try{const _0x44b5ac=await readdir(_0x4203dc);if(_0x44b5ac[_0xd4636a(0x219)]>0x0)return;await rmdir(_0x4203dc);}catch{return;}_0x4203dc=dirname(_0x4203dc);}}async function resolveTargetDbBinding(_0x4a4c8c,_0x1995a6,_0x3caabf){const _0xa21b76=a157_0x56aecf,_0x5b0df3=_0x1995a6[_0xa21b76(0x1e7)];if(!_0x5b0df3)return{'dbId':_0x3caabf[_0xa21b76(0x207)],'dbName':_0x3caabf[_0xa21b76(0x1e8)]};const _0x4e67f6=buildDbDirectoryName(_0x3caabf[_0xa21b76(0x1e8)],_0x3caabf['dbId']);if(_0x5b0df3===_0x4e67f6)return{'dbId':_0x3caabf[_0xa21b76(0x207)],'dbName':_0x3caabf[_0xa21b76(0x1e8)]};const _0x4225a9=parseExplicitDbDirectory(_0x5b0df3);if(_0x4225a9!=null)return{'dbId':_0x4225a9,'dbName':await getDbName(_0x4a4c8c,_0x4225a9)['catch'](()=>undefined)};const _0x1f869e=await listDatabases(_0x4a4c8c),_0x13dcb7=_0x1f869e['filter'](_0x132830=>buildDbDirectoryName(_0x132830['dbName'],_0x132830[_0xa21b76(0x207)])===_0x5b0df3);if(_0x13dcb7[_0xa21b76(0x219)]===0x1)return{'dbId':_0x13dcb7[0x0]['dbId'],'dbName':_0x13dcb7[0x0]['dbName']};if(_0x13dcb7[_0xa21b76(0x219)]===0x0)throw CliErrors[_0xa21b76(0x1f3)](_0xa21b76(0x217)+_0x5b0df3+_0xa21b76(0x1ff)+_0x1995a6['sqlCode']+'.');const _0x215c04=_0x13dcb7[_0xa21b76(0x206)](_0x5483ec=>_0x5483ec[_0xa21b76(0x1e8)]+'\x20('+_0x5483ec[_0xa21b76(0x207)]+')')[_0xa21b76(0x21b)](',\x20');throw CliErrors[_0xa21b76(0x1f3)](_0xa21b76(0x20e)+_0x5b0df3+_0xa21b76(0x1fc)+_0x1995a6[_0xa21b76(0x1f0)]+':\x20'+_0x215c04);}function parseExplicitDbDirectory(_0x458c51){const _0x2346e3=a157_0x56aecf,_0x1c509c=/^db-(\d+)$/['exec'](_0x458c51);if(!_0x1c509c)return null;const _0x8d8cfa=Number(_0x1c509c[0x1]);return Number[_0x2346e3(0x1ef)](_0x8d8cfa)&&_0x8d8cfa>0x0?_0x8d8cfa:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x42f38d=a158_0x4b7f;(function(_0x5111e9,_0x555f5a){const _0x363505=a158_0x4b7f,_0x50c028=_0x5111e9();while(!![]){try{const _0x37b149=-parseInt(_0x363505(0x1e9))/0x1*(-parseInt(_0x363505(0x1eb))/0x2)+-parseInt(_0x363505(0x1df))/0x3*(parseInt(_0x363505(0x1d5))/0x4)+-parseInt(_0x363505(0x1dd))/0x5*(parseInt(_0x363505(0x1e7))/0x6)+-parseInt(_0x363505(0x1da))/0x7*(parseInt(_0x363505(0x1db))/0x8)+-parseInt(_0x363505(0x1d4))/0x9*(parseInt(_0x363505(0x1e2))/0xa)+parseInt(_0x363505(0x1e0))/0xb*(-parseInt(_0x363505(0x1e8))/0xc)+parseInt(_0x363505(0x1e6))/0xd*(parseInt(_0x363505(0x1d3))/0xe);if(_0x37b149===_0x555f5a)break;else _0x50c028['push'](_0x50c028['shift']());}catch(_0x54cd19){_0x50c028['push'](_0x50c028['shift']());}}}(a158_0x34a5,0x508c2));import{CliErrors}from'../../errors.js';function a158_0x34a5(){const _0x12982c=['Query\x20description','5teZZSB','sqlname','812874cHBMuE','352MthBUC','SQL\x20query\x20display\x20name','200ILTtty','sql','write','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','1354327lfdLtj','1835178nSLMdr','40128UAUbGI','1YagpXl','validation','678856vilUbt','description','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`.','154byWGCg','183069gouHkY','4IhPzFW','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','save','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','string','226891srQUun','16ojROfK'];a158_0x34a5=function(){return _0x12982c;};return a158_0x34a5();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a158_0x4b7f(_0xa91bac,_0x11ac35){_0xa91bac=_0xa91bac-0x1d3;const _0x34a512=a158_0x34a5();let _0x4b7f8e=_0x34a512[_0xa91bac];return _0x4b7f8e;}const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a158_0x42f38d(0x1d6),a158_0x42f38d(0x1ed)]['join']('\x0a');export const sqlSave={'service':a158_0x42f38d(0x1e3),'command':a158_0x42f38d(0x1d7),'description':a158_0x42f38d(0x1d8),'risk':a158_0x42f38d(0x1e4),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':a158_0x42f38d(0x1d9),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a158_0x42f38d(0x1de),'type':a158_0x42f38d(0x1d9),'description':a158_0x42f38d(0x1e1)},{'name':'db','type':a158_0x42f38d(0x1d9),'description':a158_0x42f38d(0x1e5)},{'name':a158_0x42f38d(0x1ec),'type':a158_0x42f38d(0x1d9),'description':a158_0x42f38d(0x1dc)}],async 'validate'(){const _0x1132d2=a158_0x42f38d;throw CliErrors[_0x1132d2(0x1ea)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x184c57=a158_0x42f38d;throw CliErrors[_0x184c57(0x1ea)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x51b696=a159_0x2c52;(function(_0x3e47df,_0x4168b9){const _0x13d4f2=a159_0x2c52,_0x355535=_0x3e47df();while(!![]){try{const _0x25f292=parseInt(_0x13d4f2(0x169))/0x1*(parseInt(_0x13d4f2(0x15d))/0x2)+parseInt(_0x13d4f2(0x16a))/0x3*(parseInt(_0x13d4f2(0x17c))/0x4)+-parseInt(_0x13d4f2(0x179))/0x5*(-parseInt(_0x13d4f2(0x158))/0x6)+parseInt(_0x13d4f2(0x176))/0x7+parseInt(_0x13d4f2(0x16d))/0x8*(parseInt(_0x13d4f2(0x170))/0x9)+-parseInt(_0x13d4f2(0x15e))/0xa+parseInt(_0x13d4f2(0x173))/0xb*(-parseInt(_0x13d4f2(0x15a))/0xc);if(_0x25f292===_0x4168b9)break;else _0x355535['push'](_0x355535['shift']());}catch(_0x5bc5e4){_0x355535['push'](_0x355535['shift']());}}}(a159_0x4665,0x364db));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a159_0x51b696(0x165);export function buildSqlLockEntry(_0x512134,_0x3e1807,_0x5cdcbb,_0x1dcab1){const _0x19c812=a159_0x51b696,_0x5a718a=detectSqlMode(_0x3e1807);return{'path':buildSqlRelativePath(_0x512134[_0x19c812(0x15b)],_0x512134[_0x19c812(0x164)],_0x1dcab1?.[_0x19c812(0x157)],_0x5a718a,_0x512134[_0x19c812(0x178)]),'hash':_0x5cdcbb,'remoteId':_0x512134['id'],'version':_0x512134[_0x19c812(0x159)],'dbId':Number(_0x512134[_0x19c812(0x178)]),'dbName':_0x1dcab1?.[_0x19c812(0x157)],'sqlName':_0x512134[_0x19c812(0x164)],'sqlConfig':_0x512134['sqlConfig']??undefined,'mode':_0x5a718a};}export function cloneSqlLockData(_0x3428da){const _0x46c589=a159_0x51b696;return{'apps':Object['fromEntries'](Object[_0x46c589(0x167)](_0x3428da[_0x46c589(0x17a)])[_0x46c589(0x16b)](([_0x184ee5,_0x102d9d])=>[_0x184ee5,{'sqlRoot':_0x102d9d['sqlRoot'],'lastSync':_0x102d9d[_0x46c589(0x155)],'sqls':{..._0x102d9d[_0x46c589(0x17d)]}}]))};}export function ensureRemoteSqlContent(_0x4ca172){const _0x5d8ef0=a159_0x51b696;return _0x4ca172[_0x5d8ef0(0x156)]??'';}export function buildLocalSqlFileContent(_0x33a456,_0x10a0d2,_0x9c2af){const _0x1bc11d=a159_0x51b696,_0xf2c1d5=_0x9c2af?.['mode']??detectSqlMode(_0x10a0d2),_0x2cf53a=stripLocalSqlMetadata(_0x10a0d2,_0xf2c1d5)[_0x1bc11d(0x175)](),_0x9d01df=[...buildMetadataHeaderLines({'sqlCode':_0x33a456[_0x1bc11d(0x15b)],'sqlName':_0x33a456['sqlName'],'dbId':_0x33a456[_0x1bc11d(0x178)],'dbName':_0x9c2af?.[_0x1bc11d(0x157)],'mode':_0xf2c1d5,'syncedAt':_0x9c2af?.['syncedAt'],'description':_0x9c2af?.[_0x1bc11d(0x172)]},_0xf2c1d5),'',_0x2cf53a],_0x2dec9a=_0x9d01df['join']('\x0a');return _0x2dec9a[_0x1bc11d(0x161)]('\x0a')?_0x2dec9a:_0x2dec9a+'\x0a';}export function stripLocalSqlMetadata(_0x5ec39e,_0x4db95d){const _0x128c5d=a159_0x51b696,_0x27b276=_0x5ec39e[_0x128c5d(0x153)](/\r\n/g,'\x0a')['split']('\x0a'),_0x56536e=[];let _0x430940=0x0;if(_0x4db95d===_0x128c5d(0x17e))while(_0x430940<_0x27b276[_0x128c5d(0x151)]){const _0x5ea238=_0x27b276[_0x430940]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x5ea238)){_0x430940++;continue;}if(_0x5ea238[_0x128c5d(0x175)]()===''&&_0x430940>0x0){_0x430940++;continue;}break;}else while(_0x430940<_0x27b276[_0x128c5d(0x151)]){const _0x251cd1=_0x27b276[_0x430940]??'';if(/^\s*--\s*@lovrabet\./[_0x128c5d(0x160)](_0x251cd1)){_0x430940++;continue;}if(_0x251cd1[_0x128c5d(0x175)]()===''&&_0x430940>0x0){_0x430940++;continue;}break;}for(;_0x430940<_0x27b276['length'];_0x430940++){_0x56536e[_0x128c5d(0x15f)](_0x27b276[_0x430940]);}return _0x56536e[_0x128c5d(0x152)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x3b9b12,_0x354dc1){const _0x546375=a159_0x51b696;if(_0x354dc1?.[_0x546375(0x171)])return _0x354dc1['mode'];return detectSqlMode(_0x3b9b12);}function a159_0x2c52(_0x528cee,_0x23fbab){_0x528cee=_0x528cee-0x151;const _0x466542=a159_0x4665();let _0x2c521a=_0x466542[_0x528cee];return _0x2c521a;}export function resolveSqlFileName(_0x1c45dd,_0x2a2e17,_0x3a90ba){const _0x53c9d5=a159_0x51b696;if(_0x3a90ba?.[_0x53c9d5(0x163)])return _0x3a90ba[_0x53c9d5(0x163)];if(_0x3a90ba?.[_0x53c9d5(0x164)]||_0x3a90ba?.[_0x53c9d5(0x157)])return buildSqlRelativePath(_0x1c45dd,_0x3a90ba?.[_0x53c9d5(0x164)],_0x3a90ba?.['dbName'],resolveSqlMode(_0x2a2e17,_0x3a90ba),_0x3a90ba?.[_0x53c9d5(0x178)]);return buildDefaultSqlFileName(_0x1c45dd,resolveSqlMode(_0x2a2e17,_0x3a90ba));}export function resolveSqlLocalDir(_0x4be3ea,_0x461ced){return join(_0x4be3ea,SQL_LOCAL_REL_DIR,_0x461ced);}export async function confirmForceOverwrite(_0x3880ec){const _0x14d056=a159_0x51b696,_0x2b00af=createInterface({'input':process[_0x14d056(0x162)],'output':process[_0x14d056(0x17f)]}),_0x167720=await new Promise(_0x597215=>{const _0x474d14=_0x14d056;_0x2b00af[_0x474d14(0x174)](_0x3880ec+'\x20[y/N]\x20',_0x597215);});return _0x2b00af[_0x14d056(0x16c)](),['y',_0x14d056(0x16e)][_0x14d056(0x168)](_0x167720['trim']()[_0x14d056(0x17b)]());}export function findSqlLockScope(_0x19c777,_0x30fe5f){const _0x31d70d=a159_0x51b696;return _0x19c777[_0x31d70d(0x17a)][_0x30fe5f];}function a159_0x4665(){const _0x3984e5=['stderr','length','join','replace','--\x20@lovrabet.','lastSync','sqlContent','dbName','6njZACs','version','468FVzVeY','sqlCode','filter','170938TjdewD','428600oFpmWj','push','test','endsWith','stdin','path','sqlName','.rabetbase/sql','syncedAt','entries','includes','1aAPIGn','727818gavgBN','map','close','3736mYXeAD','yes','<!--\x20@lovrabet.','45oxKVtH','mode','description','128623VYBqMU','question','trim','1067822utfegu','\x20-->','dbId','1191790iUypYB','apps','toLowerCase','4rehGbR','sqls','mybatisXml'];a159_0x4665=function(){return _0x3984e5;};return a159_0x4665();}function buildMetadataHeaderLines(_0x3a81de,_0x5cf837){const _0x53e6e0=a159_0x51b696,_0x6ba7b9=[['sqlCode',_0x3a81de[_0x53e6e0(0x15b)]],[_0x53e6e0(0x164),_0x3a81de['sqlName']],[_0x53e6e0(0x178),_0x3a81de['dbId']],[_0x53e6e0(0x157),_0x3a81de[_0x53e6e0(0x157)]],[_0x53e6e0(0x171),_0x3a81de['mode']],['syncedAt',_0x3a81de[_0x53e6e0(0x166)]],[_0x53e6e0(0x172),_0x3a81de[_0x53e6e0(0x172)]]];if(_0x5cf837==='mybatisXml')return _0x6ba7b9[_0x53e6e0(0x15c)](([,_0x289214])=>_0x289214!==undefined&&_0x289214!==null&&String(_0x289214)[_0x53e6e0(0x175)]()!=='')['map'](([_0x3de2ec,_0x579f8e])=>_0x53e6e0(0x16f)+_0x3de2ec+':\x20'+String(_0x579f8e)+_0x53e6e0(0x177));return _0x6ba7b9[_0x53e6e0(0x15c)](([,_0x108722])=>_0x108722!==undefined&&_0x108722!==null&&String(_0x108722)[_0x53e6e0(0x175)]()!=='')[_0x53e6e0(0x16b)](([_0x562358,_0x1fc5cf])=>_0x53e6e0(0x154)+_0x562358+':\x20'+String(_0x1fc5cf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0x477f4e=a160_0x2f12;(function(_0x3ef2b8,_0x30d24f){const _0x83b1a6=a160_0x2f12,_0x244660=_0x3ef2b8();while(!![]){try{const _0x528410=parseInt(_0x83b1a6(0x75))/0x1*(parseInt(_0x83b1a6(0x8f))/0x2)+parseInt(_0x83b1a6(0x7c))/0x3*(-parseInt(_0x83b1a6(0x84))/0x4)+-parseInt(_0x83b1a6(0x91))/0x5+parseInt(_0x83b1a6(0x78))/0x6+parseInt(_0x83b1a6(0x80))/0x7*(parseInt(_0x83b1a6(0x7d))/0x8)+-parseInt(_0x83b1a6(0x79))/0x9+parseInt(_0x83b1a6(0x86))/0xa*(parseInt(_0x83b1a6(0x82))/0xb);if(_0x528410===_0x30d24f)break;else _0x244660['push'](_0x244660['shift']());}catch(_0x3e9974){_0x244660['push'](_0x244660['shift']());}}}(a160_0x2ead,0xeffe9));function a160_0x2f12(_0x144f3f,_0x17c0cd){_0x144f3f=_0x144f3f-0x73;const _0x2eadcd=a160_0x2ead();let _0x2f12b5=_0x2eadcd[_0x144f3f];return _0x2f12b5;}import{listSqlQueries}from'../../core/api-client.js';function a160_0x2ead(){const _0x4d8528=['tableData','11CMKkab','bool','24egEJdV','lockKey','1496270MpCETA','paging','sql','length','boolean','\x20modified,\x20','relativePath','All\x20SQL\x20queries\x20are\x20in\x20sync.','\x20unchanged','46JjsEKV','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','5664325CiCUWs','hash','push','map','appCode','remote','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','sqlRoot','totalCount','sqlCode','filePath','28497Wivlbp','\x20remote-only','keys','10212600cBiYwP','4193847PnMZpe','status','sqls','466530GgVztz','8ZGRjUb','sqlName','has','7054369NpkgJn'];a160_0x2ead=function(){return _0x4d8528;};return a160_0x2ead();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3f8047){const _0x3e1857=a160_0x2f12,_0x487f61=[];let _0x56a383=0x1;while(!![]){const _0x2457bf=await listSqlQueries(_0x3f8047,{'currentPage':_0x56a383,'pageSize':PAGE_SIZE}),_0xf06c63=_0x2457bf[_0x3e1857(0x81)]??[];_0x487f61[_0x3e1857(0x93)](..._0xf06c63[_0x3e1857(0x94)](_0x4005c4=>_0x4005c4[_0x3e1857(0x73)]));if(_0xf06c63[_0x3e1857(0x89)]===0x0)break;const _0x50c153=_0x2457bf[_0x3e1857(0x87)]?.[_0x3e1857(0x99)];if(_0x50c153!=null?_0x487f61[_0x3e1857(0x89)]>=_0x50c153:_0xf06c63[_0x3e1857(0x89)]<PAGE_SIZE)break;_0x56a383++;}return _0x487f61;}export const sqlStatus={'service':a160_0x477f4e(0x88),'command':a160_0x477f4e(0x7a),'description':a160_0x477f4e(0x90),'risk':'read','flags':[{'name':'remote','type':a160_0x477f4e(0x8a),'description':a160_0x477f4e(0x97)}],async 'execute'(_0x288337){const _0x1ac3ab=a160_0x477f4e,_0x707c98=loadSqlProjectConfig(_0x288337[_0x1ac3ab(0x95)]),_0x5e5255=await readSqlLockFile(_0x707c98['lockFilePath']),{appLock:_0x3454bc}=ensureSqlLockScope(_0x5e5255??createEmptySqlLock(),_0x707c98[_0x1ac3ab(0x95)],_0x707c98[_0x1ac3ab(0x98)],_0x1ac3ab(0x7a)),_0x4c35e7=await scanLocalSqlQueries(_0x707c98),_0x4225f7=[],_0x2b7f31=[],_0x180396=[],_0x4a286b=[],_0x11aa20=new Set(_0x4c35e7[_0x1ac3ab(0x94)](_0x4f47dc=>_0x4f47dc[_0x1ac3ab(0x85)]));for(const _0x2cf570 of _0x4c35e7){const _0x5a8583=await computeSqlFileHash(_0x2cf570[_0x1ac3ab(0x74)]),_0x4d2871=_0x3454bc[_0x1ac3ab(0x7b)][_0x2cf570['lockKey']],_0x20e5b3=!!_0x4d2871&&_0x4d2871['path']!==_0x2cf570[_0x1ac3ab(0x8c)],_0x9eded9=!!_0x4d2871&&!!_0x2cf570[_0x1ac3ab(0x7e)]&&_0x4d2871[_0x1ac3ab(0x7e)]!==_0x2cf570['sqlName'];if(!_0x4d2871)_0x4225f7['push'](_0x2cf570['lockKey']);else _0x4d2871[_0x1ac3ab(0x92)]!==_0x5a8583||_0x20e5b3||_0x9eded9?_0x2b7f31[_0x1ac3ab(0x93)](_0x2cf570['lockKey']):_0x180396[_0x1ac3ab(0x93)](_0x2cf570[_0x1ac3ab(0x85)]);}for(const _0xb1b972 of Object[_0x1ac3ab(0x77)](_0x3454bc['sqls'])){!_0x11aa20[_0x1ac3ab(0x7f)](_0xb1b972)&&_0x4a286b[_0x1ac3ab(0x93)](_0xb1b972);}const _0x1927d8=[];if(_0x288337[_0x1ac3ab(0x83)](_0x1ac3ab(0x96))){const _0x1f9aa6=await fetchAllSqlCodes(_0x288337[_0x1ac3ab(0x95)]);for(const _0x311e90 of _0x1f9aa6){!_0x11aa20[_0x1ac3ab(0x7f)](_0x311e90)&&!_0x3454bc[_0x1ac3ab(0x7b)][_0x311e90]&&_0x1927d8[_0x1ac3ab(0x93)](_0x311e90);}}const _0x37f96b=_0x4225f7[_0x1ac3ab(0x89)]===0x0&&_0x2b7f31[_0x1ac3ab(0x89)]===0x0&&_0x4a286b[_0x1ac3ab(0x89)]===0x0&&_0x1927d8[_0x1ac3ab(0x89)]===0x0;return{'ok':!![],'data':{'added':_0x4225f7,'modified':_0x2b7f31,'missing':_0x4a286b,'unchanged':_0x180396,'remoteOnly':_0x1927d8},'message':_0x37f96b?_0x1ac3ab(0x8d):_0x4225f7[_0x1ac3ab(0x89)]+'\x20added,\x20'+_0x2b7f31[_0x1ac3ab(0x89)]+_0x1ac3ab(0x8b)+_0x4a286b[_0x1ac3ab(0x89)]+'\x20missing,\x20'+_0x180396[_0x1ac3ab(0x89)]+_0x1ac3ab(0x8e)+(_0x1927d8[_0x1ac3ab(0x89)]>0x0?',\x20'+_0x1927d8[_0x1ac3ab(0x89)]+_0x1ac3ab(0x76):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x56bce1=a161_0x4442;(function(_0x26ad0d,_0x3999f0){const _0xa33b6a=a161_0x4442,_0x342d5e=_0x26ad0d();while(!![]){try{const _0x16cbef=parseInt(_0xa33b6a(0x136))/0x1+-parseInt(_0xa33b6a(0x116))/0x2+-parseInt(_0xa33b6a(0x115))/0x3+-parseInt(_0xa33b6a(0x112))/0x4*(-parseInt(_0xa33b6a(0x12d))/0x5)+parseInt(_0xa33b6a(0x12e))/0x6*(parseInt(_0xa33b6a(0x11b))/0x7)+parseInt(_0xa33b6a(0x11e))/0x8+-parseInt(_0xa33b6a(0x140))/0x9*(-parseInt(_0xa33b6a(0x117))/0xa);if(_0x16cbef===_0x3999f0)break;else _0x342d5e['push'](_0x342d5e['shift']());}catch(_0x33e1ae){_0x342d5e['push'](_0x342d5e['shift']());}}}(a161_0x5330,0x4dd00));function a161_0x4442(_0x1e06bb,_0xd0ff03){_0x1e06bb=_0x1e06bb-0x10f;const _0x53304e=a161_0x5330();let _0x4442b1=_0x53304e[_0x1e06bb];return _0x4442b1;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a161_0x5330(){const _0x59ccb9=['1224570JxltAm','1244302LDqzNy','61140WrPzez','appCode','Provide\x20--file\x20or\x20--sql','size','1562162WkjUnf','toLowerCase','dbtableConfig','606384AGHPkG','schema:','sql','parameters','tables','isDangerous','isSelectOnly','Table\x20\x22','\x22\x20not\x20found\x20or\x20not\x20accessible','length','schemas','from','isArray','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','sqlType','1457930jOIHIn','6BqYDZE','tableName','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','schemaWarnings','filter','cwd','validation','trim','424127cMcZYJ','utf-8','flagMissing','fields','string','valid','str','map','name','push','63gKdzUd','SQL\x20schema\x20validation','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','message','8RerHBv','Dataset\x20\x22','reason'];a161_0x5330=function(){return _0x59ccb9;};return a161_0x5330();}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':a161_0x56bce1(0x120),'command':'validate','description':a161_0x56bce1(0x110),'risk':'read','flags':[{'name':'file','type':a161_0x56bce1(0x13a),'description':a161_0x56bce1(0x12b)},{'name':a161_0x56bce1(0x120),'type':a161_0x56bce1(0x13a),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a161_0x56bce1(0x128),'type':'string','description':a161_0x56bce1(0x130)}],async 'execute'(_0x4c1dfa){const _0x12a836=a161_0x56bce1,_0x612c4d=_0x4c1dfa[_0x12a836(0x13c)]('file'),_0x47ea13=_0x4c1dfa[_0x12a836(0x13c)](_0x12a836(0x120));if(!_0x612c4d&&!_0x47ea13)throw CliErrors[_0x12a836(0x138)]('file',_0x12a836(0x119));let _0x42c6ce;if(_0x612c4d){const _0x4a6abd=resolve(process[_0x12a836(0x133)](),_0x612c4d);if(!existsSync(_0x4a6abd))throw CliErrors[_0x12a836(0x134)]('File\x20not\x20found:\x20'+_0x4a6abd);_0x42c6ce=readFileSync(_0x4a6abd,_0x12a836(0x137));}else _0x42c6ce=_0x47ea13;const _0x207810=validateSql(_0x42c6ce),_0x3808c8={'valid':_0x207810['valid'],'sqlType':_0x207810[_0x12a836(0x12c)]['type'],'isSelectOnly':_0x207810[_0x12a836(0x12c)][_0x12a836(0x124)],'isDangerous':_0x207810[_0x12a836(0x12c)][_0x12a836(0x123)],'tables':_0x207810[_0x12a836(0x122)],'parameters':_0x207810[_0x12a836(0x121)],'message':_0x207810[_0x12a836(0x111)]};_0x207810['sqlType'][_0x12a836(0x114)]&&(_0x3808c8['reason']=_0x207810['sqlType'][_0x12a836(0x114)]);const _0x28b6f1=_0x4c1dfa[_0x12a836(0x13c)]('schemas');if(_0x28b6f1&&_0x207810[_0x12a836(0x13b)]){const _0x77bbca=_0x28b6f1['split'](',')['map'](_0x249fca=>_0x249fca[_0x12a836(0x135)]())[_0x12a836(0x132)](Boolean),_0x157374=[],_0x13e007=filterDbTableBackedDatasets(await listDatasets(_0x4c1dfa[_0x12a836(0x118)])),_0x1769ca=new Map(_0x13e007[_0x12a836(0x13d)](_0x9464e2=>[_0x9464e2[_0x12a836(0x11d)]?.[_0x12a836(0x12f)]?.['toLowerCase'](),_0x9464e2]));for(const _0x3fb344 of _0x207810['tables']){const _0x1ff828=_0x1769ca['get'](_0x3fb344[_0x12a836(0x11c)]());!_0x1ff828&&_0x157374[_0x12a836(0x13f)](_0x12a836(0x125)+_0x3fb344+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x2cf93d of _0x77bbca){let _0x5aa9ab;try{_0x5aa9ab=await getDatasetDetail(_0x2cf93d);}catch{_0x157374['push'](_0x12a836(0x113)+_0x2cf93d+_0x12a836(0x126));continue;}assertDatasetIsDbTableBacked(_0x5aa9ab,_0x12a836(0x10f));const _0x3f2c5b=Array[_0x12a836(0x12a)](_0x5aa9ab[_0x12a836(0x139)])?_0x5aa9ab[_0x12a836(0x139)]:[],_0x52973c=new Set(_0x3f2c5b[_0x12a836(0x13d)](_0x161e44=>_0x161e44[_0x12a836(0x13e)]?.[_0x12a836(0x11c)]())),_0x1012a1=_0x5aa9ab[_0x12a836(0x11d)]?.['tableName']||_0x5aa9ab[_0x12a836(0x12f)]||_0x2cf93d;_0x3808c8[_0x12a836(0x11f)+_0x1012a1]={'code':_0x2cf93d,'tableName':_0x1012a1,'fieldCount':_0x52973c[_0x12a836(0x11a)],'fields':Array[_0x12a836(0x129)](_0x52973c)};}_0x157374[_0x12a836(0x127)]>0x0&&(_0x3808c8[_0x12a836(0x131)]=_0x157374);}return{'ok':_0x207810[_0x12a836(0x13b)],'data':_0x3808c8,'message':_0x207810[_0x12a836(0x111)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x3d611e=a162_0x10a3;(function(_0x2c5b17,_0x5dd729){const _0x25ef97=a162_0x10a3,_0x170416=_0x2c5b17();while(!![]){try{const _0x543d3b=-parseInt(_0x25ef97(0x11d))/0x1*(-parseInt(_0x25ef97(0x11f))/0x2)+-parseInt(_0x25ef97(0x121))/0x3*(-parseInt(_0x25ef97(0x124))/0x4)+parseInt(_0x25ef97(0x118))/0x5+-parseInt(_0x25ef97(0x116))/0x6*(parseInt(_0x25ef97(0x11c))/0x7)+parseInt(_0x25ef97(0x123))/0x8+parseInt(_0x25ef97(0x127))/0x9*(parseInt(_0x25ef97(0x11a))/0xa)+-parseInt(_0x25ef97(0x122))/0xb*(parseInt(_0x25ef97(0x120))/0xc);if(_0x543d3b===_0x5dd729)break;else _0x170416['push'](_0x170416['shift']());}catch(_0x387484){_0x170416['push'](_0x170416['shift']());}}}(a162_0x1224,0xd68f5));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a162_0x10a3(_0x242e46,_0x45e176){_0x242e46=_0x242e46-0x116;const _0x122451=a162_0x1224();let _0x10a317=_0x122451[_0x242e46];return _0x10a317;}export const workspaceAddDefinition={'service':'workspace','command':a162_0x3d611e(0x11b),'description':a162_0x3d611e(0x11e),'risk':a162_0x3d611e(0x119),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a162_0x3d611e(0x125),'description':a162_0x3d611e(0x126),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x2557c2=>validateAppName(_0x2557c2,a162_0x3d611e(0x117)),'execute':_0x475189=>runAppAdd(_0x475189,'workspace\x20add')};function a162_0x1224(){const _0x2700b2=['44CZgKGG','13392200jHKpsu','19324PJzoyL','name','App\x20profile\x20name','1044XYiwjg','13866fQTjcx','workspace\x20add','6518615GPXPtm','write','81920oxbVnI','add','3458QFSJhO','17yKuapu','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','149314VoaPck','11704104lZVvJj','450cKfHoE'];a162_0x1224=function(){return _0x2700b2;};return a162_0x1224();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x114526=a163_0x5651;(function(_0x228372,_0x2026f1){const _0x193be1=a163_0x5651,_0x8578bc=_0x228372();while(!![]){try{const _0x26dc8c=-parseInt(_0x193be1(0xc1))/0x1*(parseInt(_0x193be1(0x9d))/0x2)+parseInt(_0x193be1(0xb5))/0x3*(-parseInt(_0x193be1(0x99))/0x4)+parseInt(_0x193be1(0x94))/0x5+parseInt(_0x193be1(0xbc))/0x6*(parseInt(_0x193be1(0xab))/0x7)+parseInt(_0x193be1(0xac))/0x8*(parseInt(_0x193be1(0xc0))/0x9)+parseInt(_0x193be1(0xb9))/0xa+parseInt(_0x193be1(0x9e))/0xb;if(_0x26dc8c===_0x2026f1)break;else _0x8578bc['push'](_0x8578bc['shift']());}catch(_0x57cab2){_0x8578bc['push'](_0x8578bc['shift']());}}}(a163_0x2610,0x5be29));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a163_0x5651(_0x320ed1,_0x59b61d){_0x320ed1=_0x320ed1-0x8f;const _0x26100e=a163_0x2610();let _0x565113=_0x26100e[_0x320ed1];return _0x565113;}import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';function a163_0x2610(){const _0x5c2ff9=['str','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','444830yLRfAk','join','Workspace\x20','Initialize\x20the\x20current\x20workspace\x20app\x20binding','defaultApp','8sQuKRI','Missing\x20workspace\x20app\x20selector.','riskLevel',').\x20Config:\x20','3362noUqMV','2306007XxjDko','pageSize','object','use','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','length','workspace','trim','\x20workspace\x20','.\x20Credentials:\x20not\x20written.','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','project','defaultFormat','2191swJOlu','720iKsQHn','format','keys','write','\x22\x20not\x20found.','app','locale','\x20--appcode\x20<code>`.','App\x20\x22','979125dpkZrA','apiDir','init','\x20(appcode:\x20','1706630uPxLjO','Switch\x20the\x20current\x20workspace\x20app\x20binding','string','12912SFcIWC','workspace.','Use\x20`','apps','34182PPySEb','271cFMhqK','env','validation','\x20workspace\x20use\x20--app\x20<name>`.','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','globalConfig','appcode'];a163_0x2610=function(){return _0x5c2ff9;};return a163_0x2610();}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=[a163_0x114526(0x91),a163_0x114526(0xc2),a163_0x114526(0xb6),a163_0x114526(0xad),a163_0x114526(0x9f),'riskLevel',a163_0x114526(0xb2)],workspaceFlags=[{'name':a163_0x114526(0xb1),'type':'string','description':a163_0x114526(0xa2)},{'name':a163_0x114526(0x91),'type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a163_0x114526(0xc2),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':'API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a163_0x114526(0xaa),'type':a163_0x114526(0xbb),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a163_0x114526(0x9f),'type':'number','description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a163_0x114526(0x9b),'type':a163_0x114526(0xbb),'description':a163_0x114526(0xa8),'enum':[...RISK_LEVEL_VALUES]},{'name':a163_0x114526(0xb2),'type':a163_0x114526(0xbb),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x20ea6f){const _0x4edb5c=a163_0x114526;return!!_0x20ea6f&&typeof _0x20ea6f===_0x4edb5c(0xa0)&&!Array['isArray'](_0x20ea6f);}function assertValidAppcode(_0x1c4ffb){const _0xdfcb90=a163_0x114526,{valid:_0x4285da,message:_0x4164d5}=validateAppcode(_0x1c4ffb);if(!_0x4285da)throw CliErrors[_0xdfcb90(0xc3)]('Invalid\x20appcode:\x20'+_0x1c4ffb,_0x4164d5);}function sanitizeProfile(_0x17d167){if(!isRecord(_0x17d167))return{};const _0x21569c={};for(const _0xdb2ecd of SAFE_PROFILE_KEYS){if(_0x17d167[_0xdb2ecd]!==undefined)_0x21569c[_0xdb2ecd]=_0x17d167[_0xdb2ecd];}return _0x21569c;}function cloneProfile(_0x102063){return isRecord(_0x102063)?{..._0x102063}:{};}function collectWorkspaceProfileOverrides(_0x231850){const _0xd948e4=a163_0x114526,_0x46e376={},_0x225505=_0x231850[_0xd948e4(0x92)](_0xd948e4(0xc2)),_0x1dc235=_0x231850[_0xd948e4(0x92)](_0xd948e4(0xb6)),_0x1d7ee5=_0x231850[_0xd948e4(0x92)](_0xd948e4(0xaa)),_0x6431cd=_0x231850['flag'](_0xd948e4(0x9f)),_0x2a30e4=_0x231850[_0xd948e4(0x92)](_0xd948e4(0x9b)),_0x4a5601=_0x231850[_0xd948e4(0x92)]('locale');if(_0x225505)_0x46e376['env']=_0x225505;if(_0x1dc235)_0x46e376[_0xd948e4(0xb6)]=_0x1dc235;if(_0x1d7ee5)_0x46e376[_0xd948e4(0xad)]=_0x1d7ee5;if(_0x6431cd!==undefined&&_0x6431cd!=='')_0x46e376[_0xd948e4(0x9f)]=Number(_0x6431cd);if(_0x2a30e4)_0x46e376['riskLevel']=_0x2a30e4;if(_0x4a5601)_0x46e376['locale']=_0x4a5601;return _0x46e376;}async function validateWorkspaceArgs(_0x4a3ace){const _0x5c72e4=a163_0x114526,_0x5689e6=_0x4a3ace[_0x5c72e4(0x92)](_0x5c72e4(0xb1))[_0x5c72e4(0xa5)](),_0x4549cd=_0x4a3ace['str'](_0x5c72e4(0x91))[_0x5c72e4(0xa5)]();if(!_0x5689e6&&!_0x4549cd)throw CliErrors[_0x5c72e4(0xc3)](_0x5c72e4(0x9a),'Use\x20`'+CLI_BIN_NAME+_0x5c72e4(0x93)+CLI_BIN_NAME+_0x5c72e4(0xc4));if(_0x4549cd)assertValidAppcode(_0x4549cd);}function resolveKnownApps(){const _0x323f38=a163_0x114526,{config:_0x49e571,layers:_0x2ca8d2}=readRawConfigWithLayers(),_0x13cf8f=isRecord(_0x49e571[_0x323f38(0xbf)])?_0x49e571[_0x323f38(0xbf)]:{},_0x1f787a=isRecord(_0x2ca8d2[_0x323f38(0x90)][_0x323f38(0xbf)])?_0x2ca8d2[_0x323f38(0x90)][_0x323f38(0xbf)]:{};return{..._0x1f787a,..._0x13cf8f};}async function configureWorkspace(_0xc54c1e,_0x418274){const _0x4baa0d=a163_0x114526,_0x310531=_0xc54c1e[_0x4baa0d(0x92)](_0x4baa0d(0xb1))[_0x4baa0d(0xa5)](),_0x574d17=_0xc54c1e[_0x4baa0d(0x92)](_0x4baa0d(0x91))[_0x4baa0d(0xa5)](),_0x12aec=_0x310531||_0x574d17;if(!_0x12aec)throw CliErrors[_0x4baa0d(0xc3)]('Missing\x20workspace\x20app\x20selector.',_0x4baa0d(0xbe)+CLI_BIN_NAME+_0x4baa0d(0x93)+CLI_BIN_NAME+_0x4baa0d(0xc4));if(_0x574d17)assertValidAppcode(_0x574d17);const _0x3241c8=resolveWriteConfigPath(_0x4baa0d(0xa9)),_0x1a31b0=readConfigFile(_0x3241c8),_0x2b5b58=resolveKnownApps(),_0xdee4ea=isRecord(_0x1a31b0[_0x4baa0d(0xbf)])?{..._0x1a31b0['apps']}:{},_0x3155f4=cloneProfile(_0xdee4ea[_0x12aec]),_0x42553e=sanitizeProfile(_0x2b5b58[_0x12aec]),_0x57de4f=_0x574d17?{}:_0x42553e,_0x2814d8=_0x574d17||_0x57de4f[_0x4baa0d(0x91)];if(!_0x2814d8){const _0x573980=Object[_0x4baa0d(0xae)](_0x2b5b58),_0x2f92b5=_0x573980[_0x4baa0d(0xa3)]===0x0?_0x4baa0d(0xbe)+CLI_BIN_NAME+_0x4baa0d(0xa6)+_0x418274+'\x20--app\x20'+_0x12aec+_0x4baa0d(0xb3):_0x4baa0d(0x8f)+_0x573980[_0x4baa0d(0x95)](',\x20');throw CliErrors[_0x4baa0d(0xc3)](_0x4baa0d(0xb4)+_0x12aec+_0x4baa0d(0xb0),_0x2f92b5);}assertValidAppcode(String(_0x2814d8));const _0x8e3ea5={..._0x57de4f,..._0x3155f4,'appcode':String(_0x2814d8),...collectWorkspaceProfileOverrides(_0xc54c1e)};return _0xdee4ea[_0x12aec]=_0x8e3ea5,_0x1a31b0[_0x4baa0d(0xbf)]=_0xdee4ea,_0x1a31b0[_0x4baa0d(0x98)]=_0x12aec,delete _0x1a31b0[_0x4baa0d(0x91)],delete _0x1a31b0['app'],_0x8e3ea5[_0x4baa0d(0xc2)]&&(_0x1a31b0[_0x4baa0d(0xc2)]=_0x8e3ea5[_0x4baa0d(0xc2)]),writeConfigFile(_0x3241c8,_0x1a31b0),{'ok':!![],'message':_0x4baa0d(0x96)+(_0x418274==='init'?'initialized':'updated')+':\x20'+_0x12aec+_0x4baa0d(0xb8)+_0x8e3ea5[_0x4baa0d(0x91)]+_0x4baa0d(0x9c)+_0x3241c8+_0x4baa0d(0xa7),'data':{'operation':_0x4baa0d(0xbd)+_0x418274,'configPath':_0x3241c8,'app':_0x12aec,'appcode':_0x8e3ea5[_0x4baa0d(0x91)],'env':_0x8e3ea5[_0x4baa0d(0xc2)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':'init','description':a163_0x114526(0x97),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x50992b=>configureWorkspace(_0x50992b,a163_0x114526(0xb7))},workspaceUseDefinition={'service':a163_0x114526(0xa4),'command':a163_0x114526(0xa1),'description':a163_0x114526(0xba),'risk':a163_0x114526(0xaf),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2afc54=>configureWorkspace(_0x2afc54,a163_0x114526(0xa1))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a164_0x5a2d11=a164_0xd968;function a164_0xd968(_0x3c571f,_0x56d38d){_0x3c571f=_0x3c571f-0xf8;const _0x48703e=a164_0x4870();let _0xd968a4=_0x48703e[_0x3c571f];return _0xd968a4;}(function(_0x2321c1,_0x3e6693){const _0x2e1aad=a164_0xd968,_0x45f147=_0x2321c1();while(!![]){try{const _0x155514=parseInt(_0x2e1aad(0xf8))/0x1+-parseInt(_0x2e1aad(0x109))/0x2+-parseInt(_0x2e1aad(0xfd))/0x3*(-parseInt(_0x2e1aad(0x100))/0x4)+parseInt(_0x2e1aad(0xfc))/0x5*(parseInt(_0x2e1aad(0x107))/0x6)+-parseInt(_0x2e1aad(0x105))/0x7*(-parseInt(_0x2e1aad(0x101))/0x8)+-parseInt(_0x2e1aad(0xff))/0x9*(parseInt(_0x2e1aad(0xfb))/0xa)+-parseInt(_0x2e1aad(0x102))/0xb*(parseInt(_0x2e1aad(0x104))/0xc);if(_0x155514===_0x3e6693)break;else _0x45f147['push'](_0x45f147['shift']());}catch(_0x9eff29){_0x45f147['push'](_0x45f147['shift']());}}}(a164_0x4870,0x359ea));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a164_0x5a2d11(0xfe),'command':a164_0x5a2d11(0x106),'description':a164_0x5a2d11(0x103),'risk':a164_0x5a2d11(0xfa),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a164_0x5a2d11(0xf9),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x13b125=>validateAppName(_0x13b125,a164_0x5a2d11(0x108)),'execute':_0x1942a0=>runAppRemove(_0x1942a0,a164_0x5a2d11(0x108))};function a164_0x4870(){const _0x22fc55=['Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','13908amktdu','2252642gbFEFP','remove','2290506ufDrxV','workspace\x20remove','564628Xnjvqc','245538xSWBnf','App\x20profile\x20name\x20to\x20remove','high-risk-write','2630ltMdbO','5BxoRjH','9EdIFkc','workspace','8172yizeOn','419144duDGWu','8suGKZR','4961PtCtqO'];a164_0x4870=function(){return _0x22fc55;};return a164_0x4870();}
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x27d9bf=a165_0x3f92;(function(_0x394da8,_0x15fc3b){const _0x367b8c=a165_0x3f92,_0x4b4510=_0x394da8();while(!![]){try{const _0x386a03=-parseInt(_0x367b8c(0xa2))/0x1*(-parseInt(_0x367b8c(0x90))/0x2)+parseInt(_0x367b8c(0x97))/0x3*(parseInt(_0x367b8c(0x9d))/0x4)+-parseInt(_0x367b8c(0x85))/0x5+-parseInt(_0x367b8c(0xa1))/0x6*(-parseInt(_0x367b8c(0x83))/0x7)+parseInt(_0x367b8c(0x88))/0x8*(parseInt(_0x367b8c(0x8d))/0x9)+-parseInt(_0x367b8c(0xa4))/0xa+-parseInt(_0x367b8c(0x9f))/0xb*(-parseInt(_0x367b8c(0x95))/0xc);if(_0x386a03===_0x15fc3b)break;else _0x4b4510['push'](_0x4b4510['shift']());}catch(_0xfc51f8){_0x4b4510['push'](_0x4b4510['shift']());}}}(a165_0x5483,0xc4823));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';function a165_0x5483(){const _0x414ce7=['join','3471564tdfOkf','entries','297cnlqkT','app','1488zCokQa','7185zBqEhN','trim','7665850tZiRFb','keys','Default\x20page\x20size','defaultApp','filter','has','number','pageSize','Locale','env','zh-CN','accessKey','riskLevel','10381wzmrht','length','2090905prfCAl','Config\x20key\x20(','cookie','64MXBkpS','locale','appcode','API\x20directory\x20path','Auth\x20cookie','266841GdQpuP','Risk\x20level','Target\x20environment','66vNUMhH','format','defaultFormat','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','en-US','124308totKgy','apps','3LrTVZL','string','inherit','apiDir','toLowerCase'];a165_0x5483=function(){return _0x414ce7;};return a165_0x5483();}export const PROJECT_CREATE_INHERITABLE_KEYS=[a165_0x27d9bf(0x87),a165_0x27d9bf(0xaf),a165_0x27d9bf(0x89),'format',a165_0x27d9bf(0xb0)];export const TOP_LEVEL_CONFIG_KEYS=new Set(['appcode',a165_0x27d9bf(0xad),a165_0x27d9bf(0x89),a165_0x27d9bf(0x91),a165_0x27d9bf(0x87),a165_0x27d9bf(0xaf),a165_0x27d9bf(0x9a)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0xde21bb){const _0x3649dc=a165_0x27d9bf;return[..._0xde21bb][_0x3649dc(0x9c)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3251a4){const _0xc3a345=a165_0x27d9bf;return TOP_LEVEL_CONFIG_KEYS[_0xc3a345(0xa9)](_0x3251a4);}function a165_0x3f92(_0x56c745,_0x26c8f1){_0x56c745=_0x56c745-0x83;const _0x5483cc=a165_0x5483();let _0x3f9237=_0x5483cc[_0x56c745];return _0x3f9237;}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0xc6207f=a165_0x27d9bf;return _0xc6207f(0x86)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a165_0x27d9bf(0xad),'apiDir':a165_0x27d9bf(0x9a),'cookie':a165_0x27d9bf(0x87),'accessKey':a165_0x27d9bf(0xaf),'defaultFormat':a165_0x27d9bf(0x91),'pageSize':a165_0x27d9bf(0xab),'riskLevel':a165_0x27d9bf(0xb0),'locale':a165_0x27d9bf(0x89)};export function getAppProfileFlagDefs(){const _0x5ce1f3=a165_0x27d9bf;return[{'name':_0x5ce1f3(0xad),'type':'string','description':_0x5ce1f3(0x8f),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x5ce1f3(0x9a),'type':_0x5ce1f3(0x98),'description':_0x5ce1f3(0x8b)},{'name':_0x5ce1f3(0x87),'type':_0x5ce1f3(0x98),'description':_0x5ce1f3(0x8c),'hidden':!![]},{'name':'accessKey','type':_0x5ce1f3(0x98),'description':'Access\x20key','hidden':!![]},{'name':_0x5ce1f3(0x92),'type':_0x5ce1f3(0x98),'description':_0x5ce1f3(0x93),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x5ce1f3(0xab),'type':_0x5ce1f3(0xaa),'description':_0x5ce1f3(0xa6)},{'name':_0x5ce1f3(0xb0),'type':_0x5ce1f3(0x98),'description':_0x5ce1f3(0x8e),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x5ce1f3(0x89),'type':_0x5ce1f3(0x98),'description':_0x5ce1f3(0xac)}];}export function collectAppProfileOverrides(_0x50e425){const _0x4684f5=a165_0x27d9bf,_0x13c316={};for(const [_0x415b1d,_0x1cd9e2]of Object[_0x4684f5(0x9e)](APP_PROFILE_FLAG_KEY_MAP)){const _0x4bcdce=_0x50e425(_0x415b1d);if(!_0x4bcdce)continue;_0x13c316[_0x1cd9e2]=_0x1cd9e2===_0x4684f5(0xab)?Number(_0x4bcdce):_0x4bcdce;}return _0x13c316;}export function buildAppProfileListFields(_0x400c01){const _0x111f74=a165_0x27d9bf;return{'env':_0x400c01[_0x111f74(0xad)]??null,'apiDir':_0x400c01[_0x111f74(0x9a)]??null,'hasCookie':!!_0x400c01[_0x111f74(0x87)],'hasAccessKey':!!_0x400c01[_0x111f74(0xaf)],'format':_0x400c01['format']??null,'pageSize':_0x400c01[_0x111f74(0xab)]??null,'riskLevel':_0x400c01[_0x111f74(0xb0)]??null,'locale':_0x400c01[_0x111f74(0x89)]??null};}export function buildAppDoctorFields(_0x4571a5,_0x3e6b78){const _0x526ed4=a165_0x27d9bf;return{'env':{'value':_0x4571a5['env']||_0x3e6b78[_0x526ed4(0xad)],'source':_0x4571a5['env']?_0x526ed4(0xa0):_0x526ed4(0x99)},'apiDir':{'value':_0x4571a5['apiDir']||_0x3e6b78[_0x526ed4(0x9a)],'source':_0x4571a5['apiDir']?_0x526ed4(0xa0):_0x526ed4(0x99)},'cookie':{'value':_0x4571a5[_0x526ed4(0x87)]||_0x3e6b78[_0x526ed4(0x87)],'source':_0x4571a5[_0x526ed4(0x87)]?_0x526ed4(0xa0):_0x526ed4(0x99)},'accessKey':{'value':_0x4571a5[_0x526ed4(0xaf)]||_0x3e6b78[_0x526ed4(0xaf)],'source':_0x4571a5['accessKey']?_0x526ed4(0xa0):_0x526ed4(0x99)}};}export function buildCanonicalAppConfig(_0x1c7a8d,_0x52bb83){const _0x30f871=a165_0x27d9bf,_0x483ce3=_0x1c7a8d['map'](_0x248bd5=>String(_0x248bd5||'')[_0x30f871(0xa3)]())[_0x30f871(0xa8)](Boolean);if(_0x483ce3[_0x30f871(0x84)]===0x0)return{};const _0x5bb022={};for(const _0x511376 of _0x483ce3){_0x5bb022[_0x511376]=_0x52bb83?{'appcode':_0x511376,'env':_0x52bb83}:{'appcode':_0x511376};}return{'apps':_0x5bb022,'defaultApp':_0x483ce3[0x0]};}export function buildCanonicalProjectConfig(_0x5f1568,_0x276f52){const _0x288da0=a165_0x27d9bf,{appCodes:appCodes=[],env:_0x367e72,metadata:_0xce77}=_0x276f52,_0x40957d={..._0x5f1568,..._0xce77||{}};delete _0x40957d[_0x288da0(0x8a)],delete _0x40957d[_0x288da0(0xa0)];if(_0x367e72)_0x40957d[_0x288da0(0xad)]=_0x367e72;else!_0x40957d['env']&&(_0x40957d[_0x288da0(0xad)]=DEFAULT_CONFIG_VALUES[_0x288da0(0xad)]);const _0x269ad0=buildCanonicalAppConfig(appCodes,_0x40957d[_0x288da0(0xad)]);return Object[_0x288da0(0xa5)](_0x269ad0)[_0x288da0(0x84)]>0x0&&(_0x40957d['apps']=_0x269ad0[_0x288da0(0x96)],_0x40957d[_0x288da0(0xa7)]=_0x269ad0[_0x288da0(0xa7)]),_0x40957d;}const LOCALE_MAP={'zh':a165_0x27d9bf(0xae),'zh-cn':a165_0x27d9bf(0xae),'zh_cn':a165_0x27d9bf(0xae),'en':a165_0x27d9bf(0x94),'en-us':a165_0x27d9bf(0x94),'en_us':'en-US'};export function normalizeLocale(_0x4c6462){const _0x25a17e=a165_0x27d9bf;if(!_0x4c6462)return null;return LOCALE_MAP[_0x4c6462[_0x25a17e(0x9b)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a166_0x2a93(){const _0x17ed95=['253192KPhKfy','27IJicgv','873954VypaWo','8CACNcF','1012914qthuEL','706210SyBslp','18ZrrWOP','2112910FnWdwZ','18232280rHAict','112448SCaFss','30zYIYba'];a166_0x2a93=function(){return _0x17ed95;};return a166_0x2a93();}(function(_0x176c4f,_0x1a3b01){const _0x27887a=a166_0x5573,_0x3825f5=_0x176c4f();while(!![]){try{const _0x276e08=parseInt(_0x27887a(0x9b))/0x1+parseInt(_0x27887a(0x94))/0x2+parseInt(_0x27887a(0x9c))/0x3*(-parseInt(_0x27887a(0x9d))/0x4)+parseInt(_0x27887a(0x97))/0x5*(-parseInt(_0x27887a(0x98))/0x6)+parseInt(_0x27887a(0x96))/0x7*(-parseInt(_0x27887a(0x95))/0x8)+-parseInt(_0x27887a(0x9e))/0x9*(parseInt(_0x27887a(0x99))/0xa)+parseInt(_0x27887a(0x9a))/0xb;if(_0x276e08===_0x1a3b01)break;else _0x3825f5['push'](_0x3825f5['shift']());}catch(_0x3c48b2){_0x3825f5['push'](_0x3825f5['shift']());}}}(a166_0x2a93,0x5aba8));function a166_0x5573(_0x5e7040,_0x3dd722){_0x5e7040=_0x5e7040-0x94;const _0x2a9380=a166_0x2a93();let _0x5573fc=_0x2a9380[_0x5e7040];return _0x5573fc;}export const CLI_VERSION_POLICY_URL='https://g.lovrabet.com/dist/rabetbase-cli/config/index.json';
|
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
|
+
function a167_0x680f(){const _0x1a2346=['Name','code','expected-count','yes','Force\x20overwrite','format','Apply\x20to\x20all','rabetbase','<code>','SQL\x20string','dbid','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Override\x20appcode','Page\x20number','operationType','Clear','118vmgqdN','title','help','32759860niNFHV','Read\x20value\x20from\x20environment\x20variable','description-file','18295LPKGcF','Confirm\x20destructive\x20action','Keyword\x20filter','project','keyword','functionNode','env','stdin','string','value','clear','Function\x20node','Code\x20filter','DB\x20ID','Watch\x20mode','datasetcode','Dataset\x20code','Output\x20format','description','Page\x20size','dry-run','SQL\x20code','verbose','Rabetbase\x20CLI','242505pSqyxv','target','global','Config\x20key','6CvduDm','Record\x20ID','fromEntries','confirm','enable-bff-save','Use\x20remote','Target\x20path','file','Environment','type','Skip\x20import\x20generation','Enable\x20BFF\x20save','operation-type','4987283zbTjNP','Config\x20value','output','sqlcode','operation','json\x20|\x20pretty\x20|\x20compress','remote','page','<name>','reveal','Title','8eOZypV','sql','non-interactive','2138115RXNpLr','Select\x20app\x20profile\x20by\x20name','appcode','function-node','2893940dPLNDZ','skip-imports','expectedCount','Alias\x20for\x20--non-interactive','sqlName','File\x20path','key','boolean','Type\x20filter','schemas','meowKey','Operation\x20type','pagesize','Tags','params','Verbose\x20output','dbId','skipImports','force','Reveal\x20sensitive\x20value','SQL\x20name','sql-name','sqlname','all','descriptionFile','name','watch','Force\x20non-interactive\x20mode\x20(CI)','Preview\x20operation\x20without\x20executing','11836521WvTklN','Use\x20project\x20config\x20scope','tags','fromEnv','app','@lovrabet/rabetbase-cli'];a167_0x680f=function(){return _0x1a2346;};return a167_0x680f();}const a167_0x1f567d=a167_0x1064;function a167_0x1064(_0x1c42a9,_0x534aa6){_0x1c42a9=_0x1c42a9-0x71;const _0x680f73=a167_0x680f();let _0x1064a4=_0x680f73[_0x1c42a9];return _0x1064a4;}(function(_0x16b4e8,_0x5ceafa){const _0x115690=a167_0x1064,_0x57d53d=_0x16b4e8();while(!![]){try{const _0x4af244=parseInt(_0x115690(0xae))/0x1*(parseInt(_0x115690(0xa8))/0x2)+-parseInt(_0x115690(0xc6))/0x3+parseInt(_0x115690(0x75))/0x4+parseInt(_0x115690(0x71))/0x5+-parseInt(_0x115690(0xca))/0x6*(-parseInt(_0x115690(0xd7))/0x7)+parseInt(_0x115690(0xe2))/0x8*(parseInt(_0x115690(0x92))/0x9)+-parseInt(_0x115690(0xab))/0xa;if(_0x4af244===_0x5ceafa)break;else _0x57d53d['push'](_0x57d53d['shift']());}catch(_0x241405){_0x57d53d['push'](_0x57d53d['shift']());}}}(a167_0x680f,0xdc0d2));export const CLI_BIN_NAME=a167_0x1f567d(0x9f);export const CLI_DISPLAY_NAME=a167_0x1f567d(0xc5);export const NPM_PACKAGE_NAME=a167_0x1f567d(0x97);export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a167_0x1f567d(0x73),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xa4),'hint':a167_0x1f567d(0xa0)},{'name':a167_0x1f567d(0x96),'meowKey':a167_0x1f567d(0x96),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x72),'hint':a167_0x1f567d(0xdf)},{'name':'env','meowKey':'env','type':'string','description':a167_0x1f567d(0xd2),'hint':'production\x20|\x20daily'},{'name':a167_0x1f567d(0x9d),'meowKey':a167_0x1f567d(0x9d),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xbf),'hint':a167_0x1f567d(0xdc)},{'name':'jq','meowKey':'jq','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xa3),'hint':'<expr>'},{'name':a167_0x1f567d(0xc2),'meowKey':'dryRun','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x91)},{'name':a167_0x1f567d(0x9b),'meowKey':a167_0x1f567d(0x9b),'type':'boolean','description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':'non-interactive','meowKey':'nonInteractive','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x90)},{'name':'global','meowKey':a167_0x1f567d(0xc8),'type':'boolean','description':'Use\x20global\x20config\x20scope'},{'name':'project','meowKey':a167_0x1f567d(0xb1),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x93)},{'name':'ci','meowKey':'ci','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x78),'hidden':!![]},{'name':a167_0x1f567d(0xaa),'meowKey':'help','type':a167_0x1f567d(0x7c),'description':'Show\x20help'},{'name':a167_0x1f567d(0x8e),'meowKey':a167_0x1f567d(0x8e),'type':'string','description':a167_0x1f567d(0x98),'hidden':!![]},{'name':'title','meowKey':a167_0x1f567d(0xa9),'type':'string','description':a167_0x1f567d(0xe1),'hidden':!![]},{'name':'clear','meowKey':a167_0x1f567d(0xb8),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xa7),'hidden':!![]},{'name':a167_0x1f567d(0x8f),'meowKey':a167_0x1f567d(0x8f),'type':'boolean','description':a167_0x1f567d(0xbc),'hidden':!![]},{'name':'output','meowKey':a167_0x1f567d(0xd9),'type':'string','description':'Output\x20path','hidden':!![]},{'name':a167_0x1f567d(0x83),'meowKey':'params','type':a167_0x1f567d(0xb6),'description':'JSON\x20params','hidden':!![]},{'name':a167_0x1f567d(0xbd),'meowKey':'datasetcode','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xbe),'hidden':!![]},{'name':a167_0x1f567d(0x8c),'meowKey':a167_0x1f567d(0x8c),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x9e),'hidden':!![]},{'name':a167_0x1f567d(0xce),'meowKey':'enableBffSave','type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xd5),'hidden':!![]},{'name':'id','meowKey':'id','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xcb),'hidden':!![]},{'name':a167_0x1f567d(0xd3),'meowKey':'type','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x7d),'hidden':!![]},{'name':a167_0x1f567d(0xd1),'meowKey':a167_0x1f567d(0xd1),'type':'string','description':a167_0x1f567d(0x7a),'hidden':!![]},{'name':a167_0x1f567d(0xda),'meowKey':a167_0x1f567d(0xda),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xc3),'hidden':!![]},{'name':a167_0x1f567d(0x8a),'meowKey':a167_0x1f567d(0x79),'type':a167_0x1f567d(0xb6),'description':'SQL\x20name','hidden':!![]},{'name':a167_0x1f567d(0x8b),'meowKey':a167_0x1f567d(0x8b),'type':'string','description':a167_0x1f567d(0x89),'hidden':!![]},{'name':'db-id','meowKey':a167_0x1f567d(0x85),'type':a167_0x1f567d(0xb6),'description':'DB\x20ID','hidden':!![]},{'name':'dbid','meowKey':a167_0x1f567d(0xa2),'type':'string','description':a167_0x1f567d(0xbb),'hidden':!![]},{'name':a167_0x1f567d(0xc0),'meowKey':a167_0x1f567d(0xc0),'type':a167_0x1f567d(0xb6),'description':'Description','hidden':!![]},{'name':a167_0x1f567d(0xad),'meowKey':a167_0x1f567d(0x8d),'type':'string','description':'Description\x20file','hidden':!![]},{'name':a167_0x1f567d(0xde),'meowKey':a167_0x1f567d(0xde),'type':'string','description':a167_0x1f567d(0xa5),'hidden':!![]},{'name':a167_0x1f567d(0x81),'meowKey':a167_0x1f567d(0x81),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xc1),'hidden':!![]},{'name':a167_0x1f567d(0xb2),'meowKey':'keyword','type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xb0),'hidden':!![]},{'name':a167_0x1f567d(0x99),'meowKey':a167_0x1f567d(0x99),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xba),'hidden':!![]},{'name':'sql','meowKey':a167_0x1f567d(0xe3),'type':'string','description':a167_0x1f567d(0xa1),'hidden':!![]},{'name':a167_0x1f567d(0x7e),'meowKey':a167_0x1f567d(0x7e),'type':a167_0x1f567d(0xb6),'description':'Schemas','hidden':!![]},{'name':'operation','meowKey':a167_0x1f567d(0xdb),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x80),'hidden':!![]},{'name':a167_0x1f567d(0xc7),'meowKey':a167_0x1f567d(0xc7),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xd0),'hidden':!![]},{'name':a167_0x1f567d(0x76),'meowKey':a167_0x1f567d(0x86),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xd4),'hidden':!![]},{'name':a167_0x1f567d(0x7b),'meowKey':a167_0x1f567d(0x7b),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xc9),'hidden':!![]},{'name':'value','meowKey':a167_0x1f567d(0xb7),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xd8),'hidden':!![]},{'name':a167_0x1f567d(0x94),'meowKey':a167_0x1f567d(0x94),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x82),'hidden':!![]},{'name':a167_0x1f567d(0xb5),'meowKey':'stdin','type':a167_0x1f567d(0x7c),'description':'Read\x20value\x20from\x20stdin','hidden':!![]},{'name':'from-env','meowKey':a167_0x1f567d(0x95),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0xac),'hidden':!![]},{'name':a167_0x1f567d(0xe0),'meowKey':a167_0x1f567d(0xe0),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x88),'hidden':!![]},{'name':a167_0x1f567d(0x87),'meowKey':'force','type':'boolean','description':a167_0x1f567d(0x9c),'hidden':!![]},{'name':a167_0x1f567d(0xcd),'meowKey':a167_0x1f567d(0xcd),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0xaf),'hidden':!![]},{'name':a167_0x1f567d(0xdd),'meowKey':a167_0x1f567d(0xdd),'type':'boolean','description':a167_0x1f567d(0xcf),'hidden':!![]},{'name':'verbose','meowKey':a167_0x1f567d(0xc4),'type':a167_0x1f567d(0x7c),'description':a167_0x1f567d(0x84),'hidden':!![]},{'name':a167_0x1f567d(0x9a),'meowKey':a167_0x1f567d(0x77),'type':a167_0x1f567d(0xb6),'description':'Expected\x20affected\x20count','hidden':!![]},{'name':a167_0x1f567d(0xd6),'meowKey':a167_0x1f567d(0xa6),'type':a167_0x1f567d(0xb6),'description':a167_0x1f567d(0x80),'hidden':!![]},{'name':a167_0x1f567d(0x74),'meowKey':a167_0x1f567d(0xb3),'type':'string','description':a167_0x1f567d(0xb9),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a167_0x1f567d(0x73),a167_0x1f567d(0x96),a167_0x1f567d(0xb4),a167_0x1f567d(0x9d),'jq','dry-run','yes',a167_0x1f567d(0xe4),'ci']);export function buildMeowFlags(){const _0x44c419=a167_0x1f567d;return Object[_0x44c419(0xcc)](GLOBAL_FLAGS['map'](_0x36977b=>[_0x36977b[_0x44c419(0x7f)],{'type':_0x36977b[_0x44c419(0xd3)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a168_0x49d6(){const _0x4d944e=['en-US','9OjBFGj','production','502049JgEMok','high-risk-write','23090naIomy','1652644IiONan','7NsyFfX','14pnmyoJ','3817310rUWLBp','25037397wdJRQs','2604592nIiMXp','714ExHQgN','170301MQyOch'];a168_0x49d6=function(){return _0x4d944e;};return a168_0x49d6();}function a168_0x1c28(_0x478475,_0x2313fb){_0x478475=_0x478475-0x147;const _0x49d656=a168_0x49d6();let _0x1c28c4=_0x49d656[_0x478475];return _0x1c28c4;}const a168_0x2a2dc9=a168_0x1c28;(function(_0x13159e,_0xdd0fd1){const _0xc151e6=a168_0x1c28,_0x2697d8=_0x13159e();while(!![]){try{const _0x44f7e6=parseInt(_0xc151e6(0x14f))/0x1+parseInt(_0xc151e6(0x154))/0x2*(parseInt(_0xc151e6(0x14b))/0x3)+parseInt(_0xc151e6(0x152))/0x4+parseInt(_0xc151e6(0x151))/0x5*(parseInt(_0xc151e6(0x14a))/0x6)+-parseInt(_0xc151e6(0x153))/0x7*(-parseInt(_0xc151e6(0x149))/0x8)+parseInt(_0xc151e6(0x14d))/0x9*(parseInt(_0xc151e6(0x147))/0xa)+-parseInt(_0xc151e6(0x148))/0xb;if(_0x44f7e6===_0xdd0fd1)break;else _0x2697d8['push'](_0x2697d8['shift']());}catch(_0x4aa820){_0x2697d8['push'](_0x2697d8['shift']());}}}(a168_0x49d6,0x479b3));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a168_0x2a2dc9(0x14e),'format':'compress','locale':a168_0x2a2dc9(0x14c),'riskLevel':a168_0x2a2dc9(0x150),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
|