@lovrabet/rabetbase-cli 2.3.5-beta.1 → 2.3.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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_0x34fbd7=a156_0x4bca;(function(_0x2d7e9c,_0x46869c){const _0x30170c=a156_0x4bca,_0x1175a2=_0x2d7e9c();while(!![]){try{const _0x9c8043=parseInt(_0x30170c(0xc9))/0x1+-parseInt(_0x30170c(0xc4))/0x2+parseInt(_0x30170c(0xd2))/0x3*(-parseInt(_0x30170c(0xb2))/0x4)+parseInt(_0x30170c(0xc7))/0x5*(parseInt(_0x30170c(0xbe))/0x6)+-parseInt(_0x30170c(0xea))/0x7+parseInt(_0x30170c(0xcb))/0x8+-parseInt(_0x30170c(0xd3))/0x9;if(_0x9c8043===_0x46869c)break;else _0x1175a2['push'](_0x1175a2['shift']());}catch(_0x29da71){_0x1175a2['push'](_0x1175a2['shift']());}}}(a156_0x2e3b,0x2f51e));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x4e48a3,_0x4b3135){const _0xf77c26=a156_0x4bca,_0x49c2c4=[];let _0x521fcd=0x1;while(!![]){const _0x13d859=await listSqlQueries(_0x4e48a3,{'currentPage':_0x521fcd,'pageSize':PAGE_SIZE,'sqlCode':_0x4b3135[_0xf77c26(0xbf)],'sqlName':_0x4b3135[_0xf77c26(0xca)]}),_0x3e300c=_0x13d859[_0xf77c26(0xb5)]??[];_0x49c2c4[_0xf77c26(0xda)](..._0x3e300c);if(_0x3e300c[_0xf77c26(0xd9)]===0x0)break;const _0x17fa12=_0x13d859[_0xf77c26(0xc3)]?.[_0xf77c26(0xb7)];if(_0x17fa12!=null?_0x49c2c4['length']>=_0x17fa12:_0x3e300c[_0xf77c26(0xd9)]<PAGE_SIZE)break;_0x521fcd++;}return _0x49c2c4;}async function ensureSqlContent(_0x2ede69){const _0x49c661=a156_0x4bca;if(_0x2ede69[_0x49c661(0xe1)]!=null&&String(_0x2ede69[_0x49c661(0xe1)])[_0x49c661(0xd9)]>0x0)return _0x2ede69;return getSqlQueryDetail(_0x2ede69[_0x49c661(0xbf)]);}export const sqlPull={'service':a156_0x34fbd7(0xb8),'command':'pull','description':a156_0x34fbd7(0xe6),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a156_0x34fbd7(0xd8),'type':'string','description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a156_0x34fbd7(0xcc),'type':a156_0x34fbd7(0xc0),'description':a156_0x34fbd7(0xd6)}],async 'dryRun'(_0x17f04b){const _0x477110=a156_0x34fbd7,_0x3d20df=loadSqlProjectConfig(_0x17f04b[_0x477110(0xbd)]),_0x2e1b2b=await readSqlLockFile(_0x3d20df[_0x477110(0xb9)]),{appLock:_0x366bfd}=ensureSqlLockScope(_0x2e1b2b??createEmptySqlLock(),_0x3d20df[_0x477110(0xbd)],_0x3d20df['sqlRoot'],_0x477110(0xe0)),_0xbea892=await fetchAllSqlQueries(_0x17f04b[_0x477110(0xbd)],{'sqlCode':_0x17f04b[_0x477110(0xc5)](_0x477110(0xe3))||undefined,'sqlName':_0x17f04b[_0x477110(0xc5)](_0x477110(0xd8))||undefined}),_0x5b11f3=[];for(const _0x60b00b of _0xbea892){const _0x5bf1da=await ensureSqlContent(_0x60b00b),_0x5c536b=ensureRemoteSqlContent(_0x5bf1da),_0x4abb65=detectModeFromSql(_0x5bf1da),_0x43a6ab=_0x5bf1da['dbId']?await getDbName(_0x17f04b['appCode'],Number(_0x5bf1da[_0x477110(0xb4)]))[_0x477110(0xcf)](()=>undefined):undefined,_0x35fc24=buildLocalSqlFileContent({'sqlCode':_0x5bf1da['sqlCode'],'sqlName':_0x5bf1da[_0x477110(0xca)],'dbId':_0x5bf1da['dbId']},_0x5c536b,{'dbName':_0x43a6ab,'mode':_0x4abb65,'syncedAt':new Date()['toISOString'](),'description':_0x5bf1da[_0x477110(0xde)]}),_0x499fb1=buildSqlLockEntry(_0x5bf1da,_0x5c536b,'',{'dbName':_0x43a6ab}),_0x27cf7b=resolveLocalSqlFilePath(_0x3d20df,_0x5bf1da[_0x477110(0xbf)],_0x499fb1);let _0x870197=_0x477110(0xdb),_0x2341ac;if(await fileExists(_0x27cf7b)){const _0x447f2d=await readFile(_0x27cf7b,_0x477110(0xd1));isEquivalentPulledSqlFile(_0x447f2d,_0x35fc24,_0x4abb65)?(_0x870197=_0x477110(0xd4),_0x2341ac=_0x477110(0xc2)):(_0x870197=_0x477110(0xc8),_0x2341ac=_0x477110(0xce));}_0x5b11f3[_0x477110(0xda)]({'sqlCode':_0x5bf1da[_0x477110(0xbf)],'sqlName':_0x5bf1da[_0x477110(0xca)],'filePath':_0x27cf7b,'status':_0x870197,'reason':_0x2341ac});}return{'method':'POST','url':_0x477110(0xe7),'body':{'appCode':_0x17f04b[_0x477110(0xbd)],'sqlCode':_0x17f04b[_0x477110(0xc5)]('sqlcode')||null,'sqlName':_0x17f04b['str'](_0x477110(0xd8))||null,'files':_0x5b11f3},'description':_0x477110(0xb1)+_0x5b11f3[_0x477110(0xd9)]+_0x477110(0xb6)+_0x3d20df[_0x477110(0xcd)]};},async 'execute'(_0x22633f){const _0x1fb8e3=a156_0x34fbd7,_0x667b86=loadSqlProjectConfig(_0x22633f['appCode']),_0x42befb=await readSqlLockFile(_0x667b86[_0x1fb8e3(0xb9)]),{lockData:_0x52ab66,appLock:_0x3b0bca}=ensureSqlLockScope(_0x42befb??createEmptySqlLock(),_0x667b86['appCode'],_0x667b86[_0x1fb8e3(0xba)],_0x1fb8e3(0xe0)),_0x5037ca=_0x22633f[_0x1fb8e3(0xc1)](_0x1fb8e3(0xcc)),_0x579d08=await fetchAllSqlQueries(_0x22633f[_0x1fb8e3(0xbd)],{'sqlCode':_0x22633f[_0x1fb8e3(0xc5)](_0x1fb8e3(0xe3))||undefined,'sqlName':_0x22633f[_0x1fb8e3(0xc5)](_0x1fb8e3(0xd8))||undefined});if(_0x579d08[_0x1fb8e3(0xd9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1fb8e3(0xdc)};const _0xe3aa2c=[],_0x682dfc=[];for(const _0x1c1aa4 of _0x579d08){try{_0xe3aa2c[_0x1fb8e3(0xda)](await ensureSqlContent(_0x1c1aa4));}catch(_0x21ad0f){_0x682dfc[_0x1fb8e3(0xda)]({'sqlCode':_0x1c1aa4[_0x1fb8e3(0xbf)],'error':_0x21ad0f instanceof Error?_0x21ad0f[_0x1fb8e3(0xeb)]:String(_0x21ad0f)});}}if(_0x5037ca&&!_0x22633f[_0x1fb8e3(0xe5)]){let _0x5b9fc6=![];for(const _0x26cab5 of _0xe3aa2c){const _0x3ebb6a=detectModeFromSql(_0x26cab5),_0x92bfa6=_0x26cab5['dbId']?await getDbName(_0x22633f[_0x1fb8e3(0xbd)],Number(_0x26cab5[_0x1fb8e3(0xb4)]))['catch'](()=>undefined):undefined,_0x3d0a69=buildLocalSqlFileContent({'sqlCode':_0x26cab5[_0x1fb8e3(0xbf)],'sqlName':_0x26cab5['sqlName'],'dbId':_0x26cab5[_0x1fb8e3(0xb4)]},ensureRemoteSqlContent(_0x26cab5),{'dbName':_0x92bfa6,'mode':_0x3ebb6a,'syncedAt':new Date()['toISOString'](),'description':_0x26cab5[_0x1fb8e3(0xde)]}),_0x4097a6=resolveLocalSqlFilePath(_0x667b86,_0x26cab5[_0x1fb8e3(0xbf)],buildSqlLockEntry(_0x26cab5,ensureRemoteSqlContent(_0x26cab5),'',{'dbName':_0x92bfa6}));if(await fileExists(_0x4097a6)){const _0xcccfc3=await readFile(_0x4097a6,_0x1fb8e3(0xd1));if(!isEquivalentPulledSqlFile(_0xcccfc3,_0x3d0a69,_0x3ebb6a)){_0x5b9fc6=!![];break;}}}if(_0x5b9fc6){const _0x5c6a26=await confirmForceOverwrite(_0x1fb8e3(0xe9));if(!_0x5c6a26)throw CliErrors['cancelled'](_0x1fb8e3(0xbb));}}const _0x3cf9c4=cloneSqlLockData(_0x52ab66),_0x443c96=_0x3cf9c4[_0x1fb8e3(0xe2)][_0x667b86[_0x1fb8e3(0xbd)]],_0x42254e=[],_0x1ce2b6=[];for(const _0x49ee90 of _0xe3aa2c){const _0x4589e8=_0x443c96[_0x1fb8e3(0xec)][_0x49ee90[_0x1fb8e3(0xbf)]],_0x123a38=ensureRemoteSqlContent(_0x49ee90),_0x3cb93a=detectModeFromSql(_0x49ee90),_0x5d899c=_0x49ee90[_0x1fb8e3(0xb4)]?await getDbName(_0x22633f['appCode'],Number(_0x49ee90[_0x1fb8e3(0xb4)]))[_0x1fb8e3(0xcf)](()=>undefined):undefined,_0x1fa48e=buildLocalSqlFileContent({'sqlCode':_0x49ee90[_0x1fb8e3(0xbf)],'sqlName':_0x49ee90[_0x1fb8e3(0xca)],'dbId':_0x49ee90[_0x1fb8e3(0xb4)]},_0x123a38,{'dbName':_0x5d899c,'mode':_0x3cb93a,'syncedAt':new Date()[_0x1fb8e3(0xc6)](),'description':_0x49ee90[_0x1fb8e3(0xde)]}),_0x4abc63=buildSqlLockEntry(_0x49ee90,_0x123a38,computeSqlContentHash(_0x1fa48e),{'dbName':_0x5d899c}),_0x337ed1=_0x4abc63['path'],_0x18182f=join(_0x667b86[_0x1fb8e3(0xcd)],_0x337ed1);try{if(await fileExists(_0x18182f)){const _0x3c150c=await readFile(_0x18182f,_0x1fb8e3(0xd1));if(isEquivalentPulledSqlFile(_0x3c150c,_0x1fa48e,_0x3cb93a)){_0x1ce2b6[_0x1fb8e3(0xda)]({'sqlCode':_0x49ee90[_0x1fb8e3(0xbf)],'reason':_0x1fb8e3(0xc2)}),_0x443c96[_0x1fb8e3(0xec)][_0x49ee90[_0x1fb8e3(0xbf)]]={..._0x4abc63,'hash':computeSqlContentHash(_0x3c150c),'path':_0x337ed1};continue;}if(!_0x5037ca){_0x1ce2b6[_0x1fb8e3(0xda)]({'sqlCode':_0x49ee90[_0x1fb8e3(0xbf)],'reason':_0x1fb8e3(0xed)});continue;}}const _0x4faffd=_0x4589e8?.[_0x1fb8e3(0xe8)]?join(_0x667b86['sqlRootDir'],_0x4589e8[_0x1fb8e3(0xe8)]):undefined;_0x4faffd&&_0x4faffd!==_0x18182f&&await fileExists(_0x4faffd)&&await rm(_0x4faffd,{'force':!![]}),await ensureParentDirectory(_0x18182f),await writeFile(_0x18182f,_0x1fa48e,_0x1fb8e3(0xd1)),_0x443c96[_0x1fb8e3(0xec)][_0x49ee90['sqlCode']]={..._0x4abc63,'path':_0x337ed1},_0x42254e['push']({'sqlCode':_0x49ee90['sqlCode'],'filePath':_0x18182f});}catch(_0x3553f3){_0x682dfc[_0x1fb8e3(0xda)]({'sqlCode':_0x49ee90[_0x1fb8e3(0xbf)],'error':_0x3553f3 instanceof Error?_0x3553f3[_0x1fb8e3(0xeb)]:String(_0x3553f3)});}}return _0x443c96[_0x1fb8e3(0xe4)]=new Date()[_0x1fb8e3(0xc6)](),await writeSqlLockFile(_0x667b86[_0x1fb8e3(0xb9)],_0x3cf9c4),{'ok':_0x682dfc[_0x1fb8e3(0xd9)]===0x0,'data':{'pulled':_0x42254e,'skipped':_0x1ce2b6,'failed':_0x682dfc},'message':'Pull\x20complete:\x20'+_0x42254e[_0x1fb8e3(0xd9)]+_0x1fb8e3(0xd0)+_0x1ce2b6[_0x1fb8e3(0xd9)]+_0x1fb8e3(0xdd)+_0x682dfc[_0x1fb8e3(0xd9)]+_0x1fb8e3(0xd7)};}};function a156_0x4bca(_0x3a2fb4,_0x4b7069){_0x3a2fb4=_0x3a2fb4-0xb1;const _0x2e3be3=a156_0x2e3b();let _0x4bcaee=_0x2e3be3[_0x3a2fb4];return _0x4bcaee;}function detectModeFromSql(_0x19d3bf){const _0x1c3370=a156_0x34fbd7,_0x36d181=ensureRemoteSqlContent(_0x19d3bf),_0xb653ac=stripLocalSqlMetadata(_0x36d181,_0x1c3370(0xd5))['trimStart']();if(/^<(select|insert|update|delete)\b/i['test'](_0xb653ac))return _0x1c3370(0xd5);return _0x1c3370(0xb8);}function isEquivalentPulledSqlFile(_0x12200b,_0x14e1d7,_0x5e0464){return normalizePullComparableContent(_0x12200b,_0x5e0464)===normalizePullComparableContent(_0x14e1d7,_0x5e0464);}function normalizePullComparableContent(_0x87d985,_0x1c8dac){const _0x3a64ec=a156_0x34fbd7,_0x51b61c=_0x87d985[_0x3a64ec(0xdf)](/\r\n/g,'\x0a')['split']('\x0a'),_0x3c1607=_0x51b61c[_0x3a64ec(0xb3)](_0x4a779a=>!isSyncedAtMetadataLine(_0x4a779a,_0x1c8dac));return _0x3c1607['join']('\x0a');}function isSyncedAtMetadataLine(_0x2a492e,_0x178ea6){const _0xf7ecf9=a156_0x34fbd7;if(_0x178ea6==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0xf7ecf9(0xbc)](_0x2a492e);return/^\s*--\s*@lovrabet\.syncedAt:/[_0xf7ecf9(0xbc)](_0x2a492e);}function a156_0x2e3b(){const _0x3a3ea7=['lastSync','nonInteractive','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','path','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','520422gHIGIv','message','sqls','local\x20differs\x20from\x20remote','Would\x20pull\x20','689236zHydhW','filter','dbId','tableData','\x20SQL\x20file(s)\x20into\x20','totalCount','sql','lockFilePath','sqlRoot','Force\x20pull\x20cancelled.','test','appCode','154578MhlTjV','sqlCode','boolean','bool','unchanged','paging','377934ajQfdx','str','toISOString','55ZOTXGe','conflict','316569INAqez','sqlName','3051648EZwjoL','force','sqlRootDir','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','catch','\x20written,\x20','utf8','3TSbJOY','3167766eTlRyO','skipped','mybatisXml','Force\x20overwrite\x20local\x20unsynced\x20changes','\x20failed','name','length','push','would_pull','No\x20remote\x20SQL\x20queries\x20matched.','\x20skipped,\x20','description','replace','pull','sqlContent','apps','sqlcode'];a156_0x2e3b=function(){return _0x3a3ea7;};return a156_0x2e3b();}
|
|
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);}
|
package/lib/commands/sql/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a157_0x212957=a157_0x5b4c;(function(_0x266177,_0xb6001a){const _0x5ac7e6=a157_0x5b4c,_0x4504c3=_0x266177();while(!![]){try{const _0x453a51=parseInt(_0x5ac7e6(0xa9))/0x1+parseInt(_0x5ac7e6(0x9a))/0x2+parseInt(_0x5ac7e6(0x9f))/0x3+-parseInt(_0x5ac7e6(0x8b))/0x4*(-parseInt(_0x5ac7e6(0x8c))/0x5)+parseInt(_0x5ac7e6(0xb1))/0x6+parseInt(_0x5ac7e6(0x95))/0x7+-parseInt(_0x5ac7e6(0xb3))/0x8;if(_0x453a51===_0xb6001a)break;else _0x4504c3['push'](_0x4504c3['shift']());}catch(_0x5819b6){_0x4504c3['push'](_0x4504c3['shift']());}}}(a157_0x4323,0x70e10));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';function a157_0x5b4c(_0x4eeec1,_0x5b9d37){_0x4eeec1=_0x4eeec1-0x80;const _0x43233e=a157_0x4323();let _0x5b4c59=_0x43233e[_0x4eeec1];return _0x5b4c59;}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0xc1effe,_0x1f6953,_0x3f8f82){const _0x2bef2d=a157_0x5b4c,_0x2a36c9=await scanLocalSqlQueries(_0xc1effe),_0x60caec=new Map();for(const _0x692477 of _0x2a36c9){if(_0x3f8f82&&_0x692477['sqlCode']!==_0x3f8f82)continue;const _0x597faa=_0x60caec[_0x2bef2d(0xb6)](_0x692477['sqlCode'])??[];_0x597faa[_0x2bef2d(0xab)](_0x692477),_0x60caec['set'](_0x692477[_0x2bef2d(0xb4)],_0x597faa);}if(_0x3f8f82&&!_0x60caec[_0x2bef2d(0xa7)](_0x3f8f82))throw CliErrors[_0x2bef2d(0x89)](_0x2bef2d(0x84)+_0x3f8f82);const _0xc98683=[];for(const [_0x1a54e3,_0x54116e]of _0x60caec[_0x2bef2d(0x87)]()){if(_0x54116e['length']===0x1){_0xc98683[_0x2bef2d(0xab)](_0x54116e[0x0]);continue;}const _0x3fcd36=_0x1f6953[_0x2bef2d(0x8d)][_0x1a54e3],_0x5b6857=_0x3fcd36?.[_0x2bef2d(0x90)],_0xb5adc7=_0x5b6857?_0x54116e[_0x2bef2d(0x83)](_0x3b08b3=>_0x3b08b3['relativePath']!==_0x5b6857):_0x54116e;if(_0x3fcd36&&_0xb5adc7[_0x2bef2d(0xa1)]===0x1){_0xc98683[_0x2bef2d(0xab)](_0xb5adc7[0x0]);continue;}throw CliErrors[_0x2bef2d(0x89)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x1a54e3+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0xc98683;}export const sqlPush={'service':'sql','command':a157_0x212957(0xab),'description':a157_0x212957(0x96),'risk':a157_0x212957(0xbf),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a157_0x212957(0x81),'type':a157_0x212957(0x94),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x1611b9){const _0xa0ab4d=a157_0x212957,_0x402bd3=loadSqlProjectConfig(_0x1611b9[_0xa0ab4d(0xba)]),_0x44210c=await readSqlLockFile(_0x402bd3[_0xa0ab4d(0x82)]),{appLock:_0x4af2ae}=ensureSqlLockScope(_0x44210c??createEmptySqlLock(),_0x1611b9[_0xa0ab4d(0xba)],_0x402bd3[_0xa0ab4d(0xc1)],_0xa0ab4d(0xab)),_0x2f7f14=await getTargetSqlQueries(_0x402bd3,_0x4af2ae,_0x1611b9[_0xa0ab4d(0x91)](_0xa0ab4d(0xa8))||undefined),_0x2acc6d=[];for(const _0x2cd829 of _0x2f7f14){const _0x54a903=await computeSqlFileHash(_0x2cd829[_0xa0ab4d(0x9c)]),_0x43edb0=_0x4af2ae['sqls'][_0x2cd829[_0xa0ab4d(0xb4)]],_0x95163e=!!_0x43edb0&&(_0x43edb0[_0xa0ab4d(0x90)]!==_0x2cd829[_0xa0ab4d(0xa6)]||!!_0x2cd829[_0xa0ab4d(0xac)]&&_0x43edb0[_0xa0ab4d(0xac)]!==_0x2cd829[_0xa0ab4d(0xac)]);if(!_0x1611b9[_0xa0ab4d(0x86)](_0xa0ab4d(0x81))&&_0x43edb0&&_0x43edb0[_0xa0ab4d(0x85)]===_0x54a903&&!_0x95163e)continue;_0x2acc6d['push'](_0x2cd829['sqlCode']);}return{'method':_0xa0ab4d(0x8e),'url':_0xa0ab4d(0xb5),'body':{'sqlCodes':_0x2acc6d,'appCode':_0x1611b9[_0xa0ab4d(0xba)]},'description':_0xa0ab4d(0x93)+_0x2acc6d['length']+'\x20SQL\x20file(s)'};},async 'execute'(_0x389e06){const _0x520712=a157_0x212957,_0x58a473=loadSqlProjectConfig(_0x389e06[_0x520712(0xba)]),_0x2495c3=await readSqlLockFile(_0x58a473['lockFilePath']),{lockData:_0x395dd0,appLock:_0x150276}=ensureSqlLockScope(_0x2495c3??createEmptySqlLock(),_0x389e06[_0x520712(0xba)],_0x58a473[_0x520712(0xc1)],'push'),_0x4365f6=await getTargetSqlQueries(_0x58a473,_0x150276,_0x389e06[_0x520712(0x91)](_0x520712(0xa8))||undefined);if(_0x4365f6[_0x520712(0xa1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x520712(0xc0)};const _0x2c10df=[],_0x5f2ed4=[],_0x2c7a2a=[];for(const _0x2f8364 of _0x4365f6){const _0x1b74c7=_0x150276[_0x520712(0x8d)][_0x2f8364[_0x520712(0xb4)]];if(!_0x1b74c7){_0x2c7a2a[_0x520712(0xab)]({'sqlCode':_0x2f8364[_0x520712(0xb4)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x381453=await computeSqlFileHash(_0x2f8364['filePath']),_0x8d298f=_0x1b74c7[_0x520712(0x90)]!==_0x2f8364[_0x520712(0xa6)]||!!_0x2f8364[_0x520712(0xac)]&&_0x1b74c7['sqlName']!==_0x2f8364[_0x520712(0xac)];if(!_0x389e06[_0x520712(0x86)](_0x520712(0x81))&&_0x1b74c7['hash']===_0x381453&&!_0x8d298f){_0x5f2ed4['push']({'sqlCode':_0x2f8364[_0x520712(0xb4)],'reason':_0x520712(0x9b)});continue;}if(_0x1b74c7['version']==null){_0x2c7a2a[_0x520712(0xab)]({'sqlCode':_0x2f8364['sqlCode'],'error':_0x520712(0xb2)});continue;}const _0x49382c=await readFile(_0x2f8364[_0x520712(0x9c)],_0x520712(0xad)),_0x292042=stripLocalSqlMetadata(_0x49382c,_0x2f8364[_0x520712(0xa2)]),_0x495018=_0x2f8364[_0x520712(0xac)]||_0x1b74c7[_0x520712(0xac)],_0x32fcd2=await resolveTargetDbBinding(_0x389e06[_0x520712(0xba)],_0x2f8364,_0x1b74c7),_0x559494=await updateSqlQuery({'id':_0x1b74c7[_0x520712(0xbd)],'appCode':_0x389e06['appCode'],'sqlCode':_0x2f8364['sqlCode'],'sqlName':_0x495018,'dbId':_0x32fcd2[_0x520712(0xb9)],'version':_0x1b74c7[_0x520712(0x88)],'sqlContent':_0x292042,'sqlConfig':_0x1b74c7[_0x520712(0xa5)]??undefined}),_0x1cec96=_0x559494[_0x520712(0xb9)]?await getDbName(_0x389e06[_0x520712(0xba)],Number(_0x559494[_0x520712(0xb9)]))[_0x520712(0xb0)](()=>_0x32fcd2[_0x520712(0xa3)]):_0x32fcd2['dbName'];_0x150276[_0x520712(0x8d)][_0x2f8364[_0x520712(0xb4)]]={...buildSqlLockEntry(_0x559494,_0x292042,_0x381453,{'dbName':_0x1cec96}),'path':_0x2f8364[_0x520712(0xa6)],'mode':_0x1b74c7[_0x520712(0xa2)]},await archivePreviousSqlFileIfNeeded(_0x58a473,_0x1b74c7['path'],_0x2f8364['relativePath']),_0x2c10df['push']({'sqlCode':_0x2f8364[_0x520712(0xb4)],'remoteId':_0x1b74c7[_0x520712(0xbd)]});}catch(_0x11a39c){_0x2c7a2a[_0x520712(0xab)]({'sqlCode':_0x2f8364['sqlCode'],'error':_0x11a39c instanceof Error?_0x11a39c[_0x520712(0x8f)]:String(_0x11a39c)});}}return _0x150276[_0x520712(0xbc)]=new Date()[_0x520712(0xa0)](),await writeSqlLockFile(_0x58a473[_0x520712(0x82)],_0x395dd0),{'ok':_0x2c7a2a[_0x520712(0xa1)]===0x0,'data':{'pushed':_0x2c10df,'skipped':_0x5f2ed4,'failed':_0x2c7a2a},'message':_0x520712(0x97)+_0x2c10df[_0x520712(0xa1)]+'\x20pushed,\x20'+_0x5f2ed4['length']+_0x520712(0xaf)+_0x2c7a2a[_0x520712(0xa1)]+_0x520712(0xb8)};}};async function archivePreviousSqlFileIfNeeded(_0x52aff2,_0xdd4faa,_0x195849){const _0x4409cc=a157_0x212957;if(!_0xdd4faa||_0xdd4faa===_0x195849)return;const _0x4367ff=join(_0x52aff2['sqlRootDir'],_0xdd4faa);if(!await fileExists(_0x4367ff))return;const _0xfa7c7a=await moveToTrash(_0x52aff2[_0x4409cc(0x98)],_0x52aff2[_0x4409cc(0x99)],_0x4367ff);await cleanupEmptyDirectories(dirname(_0x4367ff),_0x52aff2[_0x4409cc(0x9d)]),void _0xfa7c7a;}async function moveToTrash(_0xa7450f,_0x3226bd,_0x1dc788){const _0x42e9db=a157_0x212957,_0x2b8de0=new Date()['toISOString']()[_0x42e9db(0xb7)](/[:.]/g,'-'),_0x4e62bb=relative(_0xa7450f,_0x1dc788),_0x2b8998=join(_0x3226bd,_0x2b8de0,_0x4e62bb);return await mkdir(dirname(_0x2b8998),{'recursive':!![]}),await rename(_0x1dc788,_0x2b8998),_0x2b8998;}async function cleanupEmptyDirectories(_0x30a03e,_0x2e5286){const _0x41fa63=a157_0x212957;let _0x2bbc17=resolve(_0x30a03e);const _0x23189d=resolve(_0x2e5286);while(_0x2bbc17[_0x41fa63(0xaa)](''+_0x23189d+sep)||_0x2bbc17===_0x23189d){if(_0x2bbc17===_0x23189d)return;try{const _0xa06fad=await readdir(_0x2bbc17);if(_0xa06fad[_0x41fa63(0xa1)]>0x0)return;await rmdir(_0x2bbc17);}catch{return;}_0x2bbc17=dirname(_0x2bbc17);}}async function resolveTargetDbBinding(_0x25ce37,_0x12bf2b,_0x1a5ae6){const _0x23dae3=a157_0x212957,_0x416f12=_0x12bf2b[_0x23dae3(0xae)];if(!_0x416f12)return{'dbId':_0x1a5ae6['dbId'],'dbName':_0x1a5ae6[_0x23dae3(0xa3)]};const _0x28a051=buildDbDirectoryName(_0x1a5ae6[_0x23dae3(0xa3)],_0x1a5ae6[_0x23dae3(0xb9)]);if(_0x416f12===_0x28a051)return{'dbId':_0x1a5ae6[_0x23dae3(0xb9)],'dbName':_0x1a5ae6['dbName']};const _0x25d5d2=parseExplicitDbDirectory(_0x416f12);if(_0x25d5d2!=null)return{'dbId':_0x25d5d2,'dbName':await getDbName(_0x25ce37,_0x25d5d2)[_0x23dae3(0xb0)](()=>undefined)};const _0x3aa1f2=await listDatabases(_0x25ce37),_0x5f2cb7=_0x3aa1f2['filter'](_0x5c3159=>buildDbDirectoryName(_0x5c3159['dbName'],_0x5c3159[_0x23dae3(0xb9)])===_0x416f12);if(_0x5f2cb7['length']===0x1)return{'dbId':_0x5f2cb7[0x0][_0x23dae3(0xb9)],'dbName':_0x5f2cb7[0x0][_0x23dae3(0xa3)]};if(_0x5f2cb7[_0x23dae3(0xa1)]===0x0)throw CliErrors[_0x23dae3(0x89)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x416f12+_0x23dae3(0x92)+_0x12bf2b['sqlCode']+'.');const _0x2193e9=_0x5f2cb7[_0x23dae3(0x8a)](_0x1b9e06=>_0x1b9e06[_0x23dae3(0xa3)]+'\x20('+_0x1b9e06['dbId']+')')[_0x23dae3(0xbb)](',\x20');throw CliErrors[_0x23dae3(0x89)](_0x23dae3(0xa4)+_0x416f12+_0x23dae3(0x80)+_0x12bf2b[_0x23dae3(0xb4)]+':\x20'+_0x2193e9);}function parseExplicitDbDirectory(_0x2cfecc){const _0x31eb7a=a157_0x212957,_0x724348=/^db-(\d+)$/[_0x31eb7a(0xbe)](_0x2cfecc);if(!_0x724348)return null;const _0x55951a=Number(_0x724348[0x1]);return Number[_0x31eb7a(0x9e)](_0x55951a)&&_0x55951a>0x0?_0x55951a:null;}function a157_0x4323(){const _0x506fee=['exec','high-risk-write','No\x20local\x20SQL\x20files\x20found.','sqlRoot','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','force','lockFilePath','filter','Local\x20SQL\x20not\x20found:\x20','hash','bool','entries','version','validation','map','1808nTKZgH','4495fNtLzp','sqls','POST','message','path','str','\x22\x20for\x20sqlCode\x20','Would\x20push\x20','boolean','3232985qSTnXo','Push\x20local\x20SQL\x20files\x20to\x20remote','Push\x20complete:\x20','projectRoot','trashDir','250428PWWphP','unchanged','filePath','sqlRootDir','isFinite','2245110NQLHOP','toISOString','length','mode','dbName','Local\x20directory\x20\x22','sqlConfig','relativePath','has','sqlcode','876571llbTAn','startsWith','push','sqlName','utf8','dbDirectory','\x20skipped,\x20','catch','4766346iwJgBk','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','23603176GsjiaC','sqlCode','/smartapi/custom/updateUserCustomSql','get','replace','\x20failed','dbId','appCode','join','lastSync','remoteId'];a157_0x4323=function(){return _0x506fee;};return a157_0x4323();}
|
|
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;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a158_0x5ac2b6=a158_0x2eb3;(function(_0x513bae,_0x11d3b6){const _0x23646a=a158_0x2eb3,_0x2e78fc=_0x513bae();while(!![]){try{const _0x5be110=parseInt(_0x23646a(0x1d0))/0x1+parseInt(_0x23646a(0x1c5))/0x2*(parseInt(_0x23646a(0x1cc))/0x3)+parseInt(_0x23646a(0x1d4))/0x4+-parseInt(_0x23646a(0x1d9))/0x5*(parseInt(_0x23646a(0x1d3))/0x6)+-parseInt(_0x23646a(0x1d6))/0x7+parseInt(_0x23646a(0x1d7))/0x8+-parseInt(_0x23646a(0x1c9))/0x9;if(_0x5be110===_0x11d3b6)break;else _0x2e78fc['push'](_0x2e78fc['shift']());}catch(_0x485d6b){_0x2e78fc['push'](_0x2e78fc['shift']());}}}(a158_0x17e8,0x7a27b));import{CliErrors}from'../../errors.js';function a158_0x17e8(){const _0x7ef5d5=['975hPCLVR','sql','join','sqlname','125912HFbxlb','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','validation','file','3620367OOdyIK','SQL\x20query\x20display\x20name','description','27bdPBWg','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','string','save','137219ZFRUTM','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`.','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','10518vgyIWB','2851904FtpMNq','write','2689498ljbbNi','1694880zGqdbu','Path\x20to\x20the\x20SQL\x20file'];a158_0x17e8=function(){return _0x7ef5d5;};return a158_0x17e8();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a158_0x2eb3(_0x5491ef,_0x26f376){_0x5491ef=_0x5491ef-0x1c2;const _0x17e8fa=a158_0x17e8();let _0x2eb3c5=_0x17e8fa[_0x5491ef];return _0x2eb3c5;}const SQL_SAVE_DEPRECATED_HINT=[a158_0x5ac2b6(0x1d2),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a158_0x5ac2b6(0x1d1)][a158_0x5ac2b6(0x1c3)]('\x0a');export const sqlSave={'service':a158_0x5ac2b6(0x1c2),'command':a158_0x5ac2b6(0x1cf),'description':a158_0x5ac2b6(0x1c6),'risk':a158_0x5ac2b6(0x1d5),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a158_0x5ac2b6(0x1c8),'type':a158_0x5ac2b6(0x1ce),'required':!![],'description':a158_0x5ac2b6(0x1d8)},SQLCODE_FLAG_OPTIONAL,{'name':a158_0x5ac2b6(0x1c4),'type':'string','description':a158_0x5ac2b6(0x1ca)},{'name':'db','type':a158_0x5ac2b6(0x1ce),'description':a158_0x5ac2b6(0x1cd)},{'name':a158_0x5ac2b6(0x1cb),'type':a158_0x5ac2b6(0x1ce),'description':'Query\x20description'}],async 'validate'(){const _0x14295e=a158_0x5ac2b6;throw CliErrors[_0x14295e(0x1c7)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x9b4f30=a159_0x4056;(function(_0x25cf28,_0x4cafa8){const _0x385e7e=a159_0x4056,_0x34e455=_0x25cf28();while(!![]){try{const _0x212534=-parseInt(_0x385e7e(0x11f))/0x1*(-parseInt(_0x385e7e(0x11d))/0x2)+parseInt(_0x385e7e(0x120))/0x3*(-parseInt(_0x385e7e(0x143))/0x4)+parseInt(_0x385e7e(0x147))/0x5*(parseInt(_0x385e7e(0x130))/0x6)+-parseInt(_0x385e7e(0x128))/0x7*(parseInt(_0x385e7e(0x12d))/0x8)+parseInt(_0x385e7e(0x124))/0x9*(-parseInt(_0x385e7e(0x134))/0xa)+-parseInt(_0x385e7e(0x12e))/0xb+parseInt(_0x385e7e(0x13b))/0xc;if(_0x212534===_0x4cafa8)break;else _0x34e455['push'](_0x34e455['shift']());}catch(_0x15fb47){_0x34e455['push'](_0x34e455['shift']());}}}(a159_0x43ad,0x26af8));import{createInterface}from'node:readline';function a159_0x4056(_0xc55464,_0x5c7b42){_0xc55464=_0xc55464-0x11c;const _0x43adae=a159_0x43ad();let _0x405698=_0x43adae[_0xc55464];return _0x405698;}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a159_0x9b4f30(0x122);export function buildSqlLockEntry(_0x55df59,_0x48df9c,_0x46f163,_0x265685){const _0x21ca02=a159_0x9b4f30,_0x5161e4=detectSqlMode(_0x48df9c);return{'path':buildSqlRelativePath(_0x55df59['sqlCode'],_0x55df59['sqlName'],_0x265685?.[_0x21ca02(0x129)],_0x5161e4,_0x55df59['dbId']),'hash':_0x46f163,'remoteId':_0x55df59['id'],'version':_0x55df59[_0x21ca02(0x135)],'dbId':Number(_0x55df59[_0x21ca02(0x137)]),'dbName':_0x265685?.[_0x21ca02(0x129)],'sqlName':_0x55df59[_0x21ca02(0x13f)],'sqlConfig':_0x55df59[_0x21ca02(0x12c)]??undefined,'mode':_0x5161e4};}export function cloneSqlLockData(_0x21ebb7){const _0x13ff2f=a159_0x9b4f30;return{'apps':Object['fromEntries'](Object[_0x13ff2f(0x132)](_0x21ebb7[_0x13ff2f(0x146)])['map'](([_0x26dd2e,_0x3b861a])=>[_0x26dd2e,{'sqlRoot':_0x3b861a[_0x13ff2f(0x125)],'lastSync':_0x3b861a['lastSync'],'sqls':{..._0x3b861a[_0x13ff2f(0x145)]}}]))};}export function ensureRemoteSqlContent(_0xad2d01){const _0x5dc9df=a159_0x9b4f30;return _0xad2d01[_0x5dc9df(0x139)]??'';}export function buildLocalSqlFileContent(_0x4adf6c,_0x111d88,_0x317682){const _0x39e72e=a159_0x9b4f30,_0x48e0a8=_0x317682?.['mode']??detectSqlMode(_0x111d88),_0x2191a0=stripLocalSqlMetadata(_0x111d88,_0x48e0a8)[_0x39e72e(0x11e)](),_0x53d1b2=[...buildMetadataHeaderLines({'sqlCode':_0x4adf6c['sqlCode'],'sqlName':_0x4adf6c['sqlName'],'dbId':_0x4adf6c[_0x39e72e(0x137)],'dbName':_0x317682?.[_0x39e72e(0x129)],'mode':_0x48e0a8,'syncedAt':_0x317682?.[_0x39e72e(0x144)],'description':_0x317682?.['description']},_0x48e0a8),'',_0x2191a0],_0x5d0022=_0x53d1b2[_0x39e72e(0x141)]('\x0a');return _0x5d0022['endsWith']('\x0a')?_0x5d0022:_0x5d0022+'\x0a';}export function stripLocalSqlMetadata(_0xa9af9d,_0x158f50){const _0x5544d4=a159_0x9b4f30,_0x57efcf=_0xa9af9d['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x194936=[];let _0xab47d5=0x0;if(_0x158f50===_0x5544d4(0x136))while(_0xab47d5<_0x57efcf[_0x5544d4(0x121)]){const _0x1429a4=_0x57efcf[_0xab47d5]??'';if(/^\s*<!--\s*@lovrabet\./[_0x5544d4(0x140)](_0x1429a4)){_0xab47d5++;continue;}if(_0x1429a4['trim']()===''&&_0xab47d5>0x0){_0xab47d5++;continue;}break;}else while(_0xab47d5<_0x57efcf[_0x5544d4(0x121)]){const _0x42cf10=_0x57efcf[_0xab47d5]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x42cf10)){_0xab47d5++;continue;}if(_0x42cf10[_0x5544d4(0x11e)]()===''&&_0xab47d5>0x0){_0xab47d5++;continue;}break;}for(;_0xab47d5<_0x57efcf[_0x5544d4(0x121)];_0xab47d5++){_0x194936[_0x5544d4(0x148)](_0x57efcf[_0xab47d5]);}return _0x194936[_0x5544d4(0x141)]('\x0a')[_0x5544d4(0x13e)]();}function a159_0x43ad(){const _0x31fef4=['\x20-->','30ksSWKe','filter','entries','path','131810xzkGts','version','mybatisXml','dbId','description','sqlContent','toLowerCase','3135852jsQKsU','question','mode','trimStart','sqlName','test','join','stderr','139144Wtmtol','syncedAt','sqls','apps','229850rkMDGZ','push','close','map','2EUClHJ','trim','101569QbdhtB','3nIsQfk','length','.rabetbase/sql','includes','9qaKomv','sqlRoot','\x20[y/N]\x20','--\x20@lovrabet.','246869EVVCGM','dbName','<!--\x20@lovrabet.','sqlCode','sqlConfig','64JsCZAN','1145991lUeaCW'];a159_0x43ad=function(){return _0x31fef4;};return a159_0x43ad();}export function resolveSqlMode(_0xad9c91,_0x37bbe6){const _0x5ebc1c=a159_0x9b4f30;if(_0x37bbe6?.[_0x5ebc1c(0x13d)])return _0x37bbe6[_0x5ebc1c(0x13d)];return detectSqlMode(_0xad9c91);}export function resolveSqlFileName(_0x8f579b,_0x422f94,_0x19d2f8){const _0x1d7dd1=a159_0x9b4f30;if(_0x19d2f8?.[_0x1d7dd1(0x133)])return _0x19d2f8[_0x1d7dd1(0x133)];if(_0x19d2f8?.[_0x1d7dd1(0x13f)]||_0x19d2f8?.['dbName'])return buildSqlRelativePath(_0x8f579b,_0x19d2f8?.[_0x1d7dd1(0x13f)],_0x19d2f8?.[_0x1d7dd1(0x129)],resolveSqlMode(_0x422f94,_0x19d2f8),_0x19d2f8?.[_0x1d7dd1(0x137)]);return buildDefaultSqlFileName(_0x8f579b,resolveSqlMode(_0x422f94,_0x19d2f8));}export function resolveSqlLocalDir(_0x254dca,_0x3fa940){return join(_0x254dca,SQL_LOCAL_REL_DIR,_0x3fa940);}export async function confirmForceOverwrite(_0x214270){const _0x12404e=a159_0x9b4f30,_0x4d1249=createInterface({'input':process['stdin'],'output':process[_0x12404e(0x142)]}),_0x3dd0a6=await new Promise(_0x358227=>{const _0x5da9ba=_0x12404e;_0x4d1249[_0x5da9ba(0x13c)](_0x214270+_0x5da9ba(0x126),_0x358227);});return _0x4d1249[_0x12404e(0x149)](),['y','yes'][_0x12404e(0x123)](_0x3dd0a6[_0x12404e(0x11e)]()[_0x12404e(0x13a)]());}export function findSqlLockScope(_0x390fea,_0x906fe3){const _0x99a345=a159_0x9b4f30;return _0x390fea[_0x99a345(0x146)][_0x906fe3];}function buildMetadataHeaderLines(_0x2cdd94,_0x48d436){const _0x4716bb=a159_0x9b4f30,_0x33152b=[['sqlCode',_0x2cdd94[_0x4716bb(0x12b)]],['sqlName',_0x2cdd94[_0x4716bb(0x13f)]],[_0x4716bb(0x137),_0x2cdd94[_0x4716bb(0x137)]],[_0x4716bb(0x129),_0x2cdd94[_0x4716bb(0x129)]],['mode',_0x2cdd94['mode']],[_0x4716bb(0x144),_0x2cdd94[_0x4716bb(0x144)]],[_0x4716bb(0x138),_0x2cdd94[_0x4716bb(0x138)]]];if(_0x48d436==='mybatisXml')return _0x33152b['filter'](([,_0x4255f9])=>_0x4255f9!==undefined&&_0x4255f9!==null&&String(_0x4255f9)[_0x4716bb(0x11e)]()!=='')[_0x4716bb(0x11c)](([_0xcd99c5,_0x535e24])=>_0x4716bb(0x12a)+_0xcd99c5+':\x20'+String(_0x535e24)+_0x4716bb(0x12f));return _0x33152b[_0x4716bb(0x131)](([,_0x4a1b43])=>_0x4a1b43!==undefined&&_0x4a1b43!==null&&String(_0x4a1b43)['trim']()!=='')[_0x4716bb(0x11c)](([_0x145d2b,_0x3be33e])=>_0x4716bb(0x127)+_0x145d2b+':\x20'+String(_0x3be33e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a160_0xa199e4=a160_0x1235;(function(_0x48358d,_0x12abbb){const _0x1ffb94=a160_0x1235,_0x4341a4=_0x48358d();while(!![]){try{const _0x1ebc04=parseInt(_0x1ffb94(0x17f))/0x1*(parseInt(_0x1ffb94(0x173))/0x2)+-parseInt(_0x1ffb94(0x172))/0x3+-parseInt(_0x1ffb94(0x17d))/0x4+-parseInt(_0x1ffb94(0x16e))/0x5+parseInt(_0x1ffb94(0x177))/0x6*(parseInt(_0x1ffb94(0x166))/0x7)+-parseInt(_0x1ffb94(0x163))/0x8*(-parseInt(_0x1ffb94(0x184))/0x9)+parseInt(_0x1ffb94(0x17c))/0xa*(parseInt(_0x1ffb94(0x176))/0xb);if(_0x1ebc04===_0x12abbb)break;else _0x4341a4['push'](_0x4341a4['shift']());}catch(_0x13571){_0x4341a4['push'](_0x4341a4['shift']());}}}(a160_0x3101,0xd1957));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a160_0x1235(_0x23442a,_0x4e2114){_0x23442a=_0x23442a-0x163;const _0x31011d=a160_0x3101();let _0x1235d6=_0x31011d[_0x23442a];return _0x1235d6;}function a160_0x3101(){const _0x4a8321=['6JZKlqR','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','path','remote','status','3440xWDJhH','3367580KQlPWd','\x20remote-only','4WNMDCb','sqlCode','All\x20SQL\x20queries\x20are\x20in\x20sync.','filePath','appCode','3986244eQULVB','relativePath','sqlRoot','lockFilePath','paging','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','16qYpwiR','tableData','totalCount','8572354ACaDLP','bool','sqlName','keys','\x20added,\x20','sql','length','lockKey','7500020OGPmZp','sqls','has','map','358368FDNLyI','597282GMVoiJ','push','\x20unchanged','473KOTCST'];a160_0x3101=function(){return _0x4a8321;};return a160_0x3101();}async function fetchAllSqlCodes(_0x5ed309){const _0x11056f=a160_0x1235,_0x16a791=[];let _0x1173b4=0x1;while(!![]){const _0x3cb625=await listSqlQueries(_0x5ed309,{'currentPage':_0x1173b4,'pageSize':PAGE_SIZE}),_0xc45d=_0x3cb625[_0x11056f(0x164)]??[];_0x16a791[_0x11056f(0x174)](..._0xc45d[_0x11056f(0x171)](_0x322d96=>_0x322d96[_0x11056f(0x180)]));if(_0xc45d[_0x11056f(0x16c)]===0x0)break;const _0x273ef4=_0x3cb625[_0x11056f(0x188)]?.[_0x11056f(0x165)];if(_0x273ef4!=null?_0x16a791['length']>=_0x273ef4:_0xc45d['length']<PAGE_SIZE)break;_0x1173b4++;}return _0x16a791;}export const sqlStatus={'service':a160_0xa199e4(0x16b),'command':a160_0xa199e4(0x17b),'description':a160_0xa199e4(0x189),'risk':'read','flags':[{'name':'remote','type':'boolean','description':a160_0xa199e4(0x178)}],async 'execute'(_0x26a838){const _0x43c5f4=a160_0xa199e4,_0x4d5ec1=loadSqlProjectConfig(_0x26a838[_0x43c5f4(0x183)]),_0x5311df=await readSqlLockFile(_0x4d5ec1[_0x43c5f4(0x187)]),{appLock:_0x1fa486}=ensureSqlLockScope(_0x5311df??createEmptySqlLock(),_0x4d5ec1[_0x43c5f4(0x183)],_0x4d5ec1[_0x43c5f4(0x186)],_0x43c5f4(0x17b)),_0xbe2524=await scanLocalSqlQueries(_0x4d5ec1),_0x5ebfd4=[],_0xa7f564=[],_0xbff2c8=[],_0x564152=[],_0x1b366d=new Set(_0xbe2524[_0x43c5f4(0x171)](_0x85778d=>_0x85778d[_0x43c5f4(0x16d)]));for(const _0x45dfa9 of _0xbe2524){const _0xd428ea=await computeSqlFileHash(_0x45dfa9[_0x43c5f4(0x182)]),_0x2cdcdd=_0x1fa486[_0x43c5f4(0x16f)][_0x45dfa9[_0x43c5f4(0x16d)]],_0x1846c1=!!_0x2cdcdd&&_0x2cdcdd[_0x43c5f4(0x179)]!==_0x45dfa9[_0x43c5f4(0x185)],_0x3c8568=!!_0x2cdcdd&&!!_0x45dfa9[_0x43c5f4(0x168)]&&_0x2cdcdd['sqlName']!==_0x45dfa9[_0x43c5f4(0x168)];if(!_0x2cdcdd)_0x5ebfd4[_0x43c5f4(0x174)](_0x45dfa9[_0x43c5f4(0x16d)]);else _0x2cdcdd['hash']!==_0xd428ea||_0x1846c1||_0x3c8568?_0xa7f564[_0x43c5f4(0x174)](_0x45dfa9[_0x43c5f4(0x16d)]):_0xbff2c8[_0x43c5f4(0x174)](_0x45dfa9[_0x43c5f4(0x16d)]);}for(const _0x504faa of Object[_0x43c5f4(0x169)](_0x1fa486['sqls'])){!_0x1b366d[_0x43c5f4(0x170)](_0x504faa)&&_0x564152['push'](_0x504faa);}const _0x2dae34=[];if(_0x26a838[_0x43c5f4(0x167)](_0x43c5f4(0x17a))){const _0xfdd3a0=await fetchAllSqlCodes(_0x26a838[_0x43c5f4(0x183)]);for(const _0x1775bb of _0xfdd3a0){!_0x1b366d['has'](_0x1775bb)&&!_0x1fa486[_0x43c5f4(0x16f)][_0x1775bb]&&_0x2dae34[_0x43c5f4(0x174)](_0x1775bb);}}const _0x41034b=_0x5ebfd4[_0x43c5f4(0x16c)]===0x0&&_0xa7f564[_0x43c5f4(0x16c)]===0x0&&_0x564152[_0x43c5f4(0x16c)]===0x0&&_0x2dae34[_0x43c5f4(0x16c)]===0x0;return{'ok':!![],'data':{'added':_0x5ebfd4,'modified':_0xa7f564,'missing':_0x564152,'unchanged':_0xbff2c8,'remoteOnly':_0x2dae34},'message':_0x41034b?_0x43c5f4(0x181):_0x5ebfd4[_0x43c5f4(0x16c)]+_0x43c5f4(0x16a)+_0xa7f564[_0x43c5f4(0x16c)]+'\x20modified,\x20'+_0x564152[_0x43c5f4(0x16c)]+'\x20missing,\x20'+_0xbff2c8[_0x43c5f4(0x16c)]+_0x43c5f4(0x175)+(_0x2dae34[_0x43c5f4(0x16c)]>0x0?',\x20'+_0x2dae34[_0x43c5f4(0x16c)]+_0x43c5f4(0x17e):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x3e6d1f=a161_0x41f4;(function(_0x4eb708,_0x330302){const _0xc9ee8b=a161_0x41f4,_0x56b98c=_0x4eb708();while(!![]){try{const _0x50afde=parseInt(_0xc9ee8b(0x1ea))/0x1+parseInt(_0xc9ee8b(0x1fb))/0x2+parseInt(_0xc9ee8b(0x1d5))/0x3*(parseInt(_0xc9ee8b(0x1e0))/0x4)+parseInt(_0xc9ee8b(0x1d7))/0x5+parseInt(_0xc9ee8b(0x1ff))/0x6*(-parseInt(_0xc9ee8b(0x1df))/0x7)+-parseInt(_0xc9ee8b(0x1ec))/0x8+-parseInt(_0xc9ee8b(0x1fc))/0x9*(parseInt(_0xc9ee8b(0x1fe))/0xa);if(_0x50afde===_0x330302)break;else _0x56b98c['push'](_0x56b98c['shift']());}catch(_0x2c7b84){_0x56b98c['push'](_0x56b98c['shift']());}}}(a161_0x4e41,0x7f627));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a161_0x4e41(){const _0x5951ae=['sqlType','598224svPyeT','cwd','4212936XooLHh','Provide\x20--file\x20or\x20--sql','push','from','reason','Table\x20\x22','Dataset\x20\x22','get','isArray','dbtableConfig','\x22\x20not\x20found\x20in\x20any\x20dataset','schema:','appCode','size','parameters','671080Ygihfd','1225953uhXdXD','tables','10GpwlSC','2925642UAtVqB','split','filter','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','valid','map','read','toLowerCase','fields','file','18bwxHht','str','2816580WKqgux','schemas','string','\x22\x20not\x20found\x20or\x20not\x20accessible','message','name','sql','validation','7xbbYcl','116752uzNUqL','isDangerous','schemaWarnings','flagMissing','trim','File\x20not\x20found:\x20','validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','length'];a161_0x4e41=function(){return _0x5951ae;};return a161_0x4e41();}import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';function a161_0x41f4(_0x5e1584,_0x5c9fa9){_0x5e1584=_0x5e1584-0x1cc;const _0x4e41eb=a161_0x4e41();let _0x41f49f=_0x4e41eb[_0x5e1584];return _0x41f49f;}export const sqlValidate={'service':'sql','command':a161_0x3e6d1f(0x1e6),'description':a161_0x3e6d1f(0x1e7),'risk':a161_0x3e6d1f(0x1d1),'flags':[{'name':'file','type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a161_0x3e6d1f(0x1dd),'type':'string','description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a161_0x3e6d1f(0x1d8),'type':a161_0x3e6d1f(0x1d9),'description':a161_0x3e6d1f(0x1ce)}],async 'execute'(_0x1c976b){const _0x58dfb3=a161_0x3e6d1f,_0x164038=_0x1c976b[_0x58dfb3(0x1d6)](_0x58dfb3(0x1d4)),_0x5b502a=_0x1c976b[_0x58dfb3(0x1d6)]('sql');if(!_0x164038&&!_0x5b502a)throw CliErrors[_0x58dfb3(0x1e3)](_0x58dfb3(0x1d4),_0x58dfb3(0x1ed));let _0x1184f3;if(_0x164038){const _0x49aab1=resolve(process[_0x58dfb3(0x1eb)](),_0x164038);if(!existsSync(_0x49aab1))throw CliErrors[_0x58dfb3(0x1de)](_0x58dfb3(0x1e5)+_0x49aab1);_0x1184f3=readFileSync(_0x49aab1,'utf-8');}else _0x1184f3=_0x5b502a;const _0x3684bb=validateSql(_0x1184f3),_0x5091d3={'valid':_0x3684bb[_0x58dfb3(0x1cf)],'sqlType':_0x3684bb[_0x58dfb3(0x1e9)]['type'],'isSelectOnly':_0x3684bb['sqlType']['isSelectOnly'],'isDangerous':_0x3684bb[_0x58dfb3(0x1e9)][_0x58dfb3(0x1e1)],'tables':_0x3684bb[_0x58dfb3(0x1fd)],'parameters':_0x3684bb[_0x58dfb3(0x1fa)],'message':_0x3684bb[_0x58dfb3(0x1db)]};_0x3684bb[_0x58dfb3(0x1e9)][_0x58dfb3(0x1f0)]&&(_0x5091d3[_0x58dfb3(0x1f0)]=_0x3684bb[_0x58dfb3(0x1e9)][_0x58dfb3(0x1f0)]);const _0x281958=_0x1c976b[_0x58dfb3(0x1d6)](_0x58dfb3(0x1d8));if(_0x281958&&_0x3684bb['valid']){const _0x6d3c38=_0x281958[_0x58dfb3(0x1cc)](',')[_0x58dfb3(0x1d0)](_0x5d070d=>_0x5d070d[_0x58dfb3(0x1e4)]())[_0x58dfb3(0x1cd)](Boolean),_0x2dc962=[],_0x1c17af=filterDbTableBackedDatasets(await listDatasets(_0x1c976b[_0x58dfb3(0x1f8)])),_0x1f2c6e=new Map(_0x1c17af['map'](_0x4aa106=>[_0x4aa106[_0x58dfb3(0x1f5)]?.['tableName']?.[_0x58dfb3(0x1d2)](),_0x4aa106]));for(const _0x1423b4 of _0x3684bb[_0x58dfb3(0x1fd)]){const _0x1e5bcc=_0x1f2c6e[_0x58dfb3(0x1f3)](_0x1423b4[_0x58dfb3(0x1d2)]());!_0x1e5bcc&&_0x2dc962[_0x58dfb3(0x1ee)](_0x58dfb3(0x1f1)+_0x1423b4+_0x58dfb3(0x1f6));}for(const _0x3606d5 of _0x6d3c38){let _0x48fbed;try{_0x48fbed=await getDatasetDetail(_0x3606d5);}catch{_0x2dc962['push'](_0x58dfb3(0x1f2)+_0x3606d5+_0x58dfb3(0x1da));continue;}assertDatasetIsDbTableBacked(_0x48fbed,'SQL\x20schema\x20validation');const _0x1c52a0=Array[_0x58dfb3(0x1f4)](_0x48fbed[_0x58dfb3(0x1d3)])?_0x48fbed[_0x58dfb3(0x1d3)]:[],_0x3d444c=new Set(_0x1c52a0[_0x58dfb3(0x1d0)](_0x2beb59=>_0x2beb59[_0x58dfb3(0x1dc)]?.[_0x58dfb3(0x1d2)]())),_0x24accf=_0x48fbed[_0x58dfb3(0x1f5)]?.['tableName']||_0x48fbed['tableName']||_0x3606d5;_0x5091d3[_0x58dfb3(0x1f7)+_0x24accf]={'code':_0x3606d5,'tableName':_0x24accf,'fieldCount':_0x3d444c[_0x58dfb3(0x1f9)],'fields':Array[_0x58dfb3(0x1ef)](_0x3d444c)};}_0x2dc962[_0x58dfb3(0x1e8)]>0x0&&(_0x5091d3[_0x58dfb3(0x1e2)]=_0x2dc962);}return{'ok':_0x3684bb[_0x58dfb3(0x1cf)],'data':_0x5091d3,'message':_0x3684bb[_0x58dfb3(0x1db)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a162_0x484589=a162_0x5e45;(function(_0x59c0c1,_0x423575){const _0x1826b5=a162_0x5e45,_0x5a440e=_0x59c0c1();while(!![]){try{const _0x2cfcf2=parseInt(_0x1826b5(0xc9))/0x1+parseInt(_0x1826b5(0xd0))/0x2+parseInt(_0x1826b5(0xcd))/0x3+parseInt(_0x1826b5(0xca))/0x4*(-parseInt(_0x1826b5(0xcc))/0x5)+-parseInt(_0x1826b5(0xd1))/0x6+parseInt(_0x1826b5(0xd3))/0x7*(-parseInt(_0x1826b5(0xd4))/0x8)+parseInt(_0x1826b5(0xd5))/0x9;if(_0x2cfcf2===_0x423575)break;else _0x5a440e['push'](_0x5a440e['shift']());}catch(_0x1a03f6){_0x5a440e['push'](_0x5a440e['shift']());}}}(a162_0x3a14,0xcbfe9));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a162_0x3a14(){const _0x2eaa4d=['16eEyAos','3423042SpuCJr','add','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','name','302359fiQXMq','1880kgkiBr','App\x20profile\x20name','6945LviSCM','3832422sTKLkz','workspace','write','1495772NljYmE','2916480HpiBCO','workspace\x20add','2567551EyKqgS'];a162_0x3a14=function(){return _0x2eaa4d;};return a162_0x3a14();}function a162_0x5e45(_0x3dddf3,_0x3fe54d){_0x3dddf3=_0x3dddf3-0xc8;const _0x3a147a=a162_0x3a14();let _0x5e4557=_0x3a147a[_0x3dddf3];return _0x5e4557;}export const workspaceAddDefinition={'service':a162_0x484589(0xce),'command':a162_0x484589(0xd6),'description':a162_0x484589(0xd7),'risk':a162_0x484589(0xcf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a162_0x484589(0xc8),'description':a162_0x484589(0xcb),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x42807a=>validateAppName(_0x42807a,a162_0x484589(0xd2)),'execute':_0x4e0d22=>runAppAdd(_0x4e0d22,a162_0x484589(0xd2))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0xc1c43c=a163_0x5907;(function(_0x5b57b7,_0x53db13){const _0x55635d=a163_0x5907,_0x15e1c4=_0x5b57b7();while(!![]){try{const _0x2c8e58=parseInt(_0x55635d(0x14b))/0x1+parseInt(_0x55635d(0x169))/0x2+parseInt(_0x55635d(0x16c))/0x3*(-parseInt(_0x55635d(0x14d))/0x4)+-parseInt(_0x55635d(0x154))/0x5*(-parseInt(_0x55635d(0x158))/0x6)+-parseInt(_0x55635d(0x15b))/0x7*(-parseInt(_0x55635d(0x15a))/0x8)+-parseInt(_0x55635d(0x165))/0x9*(-parseInt(_0x55635d(0x163))/0xa)+parseInt(_0x55635d(0x15e))/0xb*(-parseInt(_0x55635d(0x13d))/0xc);if(_0x2c8e58===_0x53db13)break;else _0x15e1c4['push'](_0x15e1c4['shift']());}catch(_0x1b2c1f){_0x15e1c4['push'](_0x15e1c4['shift']());}}}(a163_0x482d,0xc8d1f));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';function a163_0x5907(_0x142943,_0x17a20a){_0x142943=_0x142943-0x13a;const _0x482d78=a163_0x482d();let _0x590768=_0x482d78[_0x142943];return _0x590768;}import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';function a163_0x482d(){const _0x4f5ddb=['\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','join','apps','validation',').\x20Config:\x20','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','Missing\x20workspace\x20app\x20selector.','initialized','27190572IfBVXK','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Initialize\x20the\x20current\x20workspace\x20app\x20binding','\x22\x20not\x20found.','keys','env','Switch\x20the\x20current\x20workspace\x20app\x20binding','isArray','object','locale','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','appcode','\x20(appcode:\x20','globalConfig','987569PhgEPd','Use\x20`','903016BmCjcI','defaultApp','use','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','write','workspace','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','43480dYEefv','.\x20Credentials:\x20not\x20written.','trim','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','1002SemyCN','flag','136YfSNGR','639667xqBKsU','Target\x20environment','pageSize','22xFtYKe','apiDir','\x20workspace\x20use\x20--app\x20<name>`.','string','app','2770uLuZUJ','\x20--appcode\x20<code>`.','42057WvbUWC','Invalid\x20appcode:\x20','Workspace\x20','riskLevel','1939276PsiVoz','Locale\x20for\x20this\x20workspace\x20app\x20profile','init','12tYuUiu','project','App\x20\x22','format','workspace.','number','str'];a163_0x482d=function(){return _0x4f5ddb;};return a163_0x482d();}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+a163_0xc1c43c(0x173),SAFE_PROFILE_KEYS=[a163_0xc1c43c(0x148),'env','apiDir',a163_0xc1c43c(0x16f),a163_0xc1c43c(0x15d),a163_0xc1c43c(0x168),'locale'],workspaceFlags=[{'name':a163_0xc1c43c(0x162),'type':a163_0xc1c43c(0x161),'description':a163_0xc1c43c(0x13a)},{'name':a163_0xc1c43c(0x148),'type':'string','description':a163_0xc1c43c(0x147)},{'name':a163_0xc1c43c(0x142),'type':a163_0xc1c43c(0x161),'description':a163_0xc1c43c(0x15c),'enum':[...RABETBASE_ENV_VALUES]},{'name':a163_0xc1c43c(0x15f),'type':a163_0xc1c43c(0x161),'description':'API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile'},{'name':'defaultFormat','type':a163_0xc1c43c(0x161),'description':a163_0xc1c43c(0x153),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a163_0xc1c43c(0x15d),'type':a163_0xc1c43c(0x171),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a163_0xc1c43c(0x168),'type':a163_0xc1c43c(0x161),'description':a163_0xc1c43c(0x157),'enum':[...RISK_LEVEL_VALUES]},{'name':a163_0xc1c43c(0x146),'type':'string','description':a163_0xc1c43c(0x16a)}];function isRecord(_0x1c880c){const _0xe8cf42=a163_0xc1c43c;return!!_0x1c880c&&typeof _0x1c880c===_0xe8cf42(0x145)&&!Array[_0xe8cf42(0x144)](_0x1c880c);}function assertValidAppcode(_0x3a58bf){const _0x37e5ad=a163_0xc1c43c,{valid:_0x4e2ac8,message:_0x3f84f7}=validateAppcode(_0x3a58bf);if(!_0x4e2ac8)throw CliErrors[_0x37e5ad(0x176)](_0x37e5ad(0x166)+_0x3a58bf,_0x3f84f7);}function sanitizeProfile(_0xa0c48c){if(!isRecord(_0xa0c48c))return{};const _0x45c34e={};for(const _0x1b93d8 of SAFE_PROFILE_KEYS){if(_0xa0c48c[_0x1b93d8]!==undefined)_0x45c34e[_0x1b93d8]=_0xa0c48c[_0x1b93d8];}return _0x45c34e;}function cloneProfile(_0x592787){return isRecord(_0x592787)?{..._0x592787}:{};}function collectWorkspaceProfileOverrides(_0x4079e9){const _0x3e2da9=a163_0xc1c43c,_0x3b24d8={},_0x575692=_0x4079e9[_0x3e2da9(0x172)](_0x3e2da9(0x142)),_0x4bd97d=_0x4079e9[_0x3e2da9(0x172)](_0x3e2da9(0x15f)),_0x1efc3f=_0x4079e9[_0x3e2da9(0x172)]('defaultFormat'),_0x36d7f6=_0x4079e9[_0x3e2da9(0x159)](_0x3e2da9(0x15d)),_0x4b8174=_0x4079e9['str'](_0x3e2da9(0x168)),_0x4f46cf=_0x4079e9[_0x3e2da9(0x172)](_0x3e2da9(0x146));if(_0x575692)_0x3b24d8[_0x3e2da9(0x142)]=_0x575692;if(_0x4bd97d)_0x3b24d8['apiDir']=_0x4bd97d;if(_0x1efc3f)_0x3b24d8[_0x3e2da9(0x16f)]=_0x1efc3f;if(_0x36d7f6!==undefined&&_0x36d7f6!=='')_0x3b24d8[_0x3e2da9(0x15d)]=Number(_0x36d7f6);if(_0x4b8174)_0x3b24d8[_0x3e2da9(0x168)]=_0x4b8174;if(_0x4f46cf)_0x3b24d8[_0x3e2da9(0x146)]=_0x4f46cf;return _0x3b24d8;}async function validateWorkspaceArgs(_0x5f0570){const _0x3408fd=a163_0xc1c43c,_0x356bfc=_0x5f0570[_0x3408fd(0x172)]('app')['trim'](),_0x254e91=_0x5f0570[_0x3408fd(0x172)]('appcode')[_0x3408fd(0x156)]();if(!_0x356bfc&&!_0x254e91)throw CliErrors[_0x3408fd(0x176)](_0x3408fd(0x13b),_0x3408fd(0x14c)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x3408fd(0x160));if(_0x254e91)assertValidAppcode(_0x254e91);}function resolveKnownApps(){const _0x56fe87=a163_0xc1c43c,{config:_0x1ee51a,layers:_0x2ac4b7}=readRawConfigWithLayers(),_0x4cc86e=isRecord(_0x1ee51a[_0x56fe87(0x175)])?_0x1ee51a[_0x56fe87(0x175)]:{},_0x17461a=isRecord(_0x2ac4b7[_0x56fe87(0x14a)][_0x56fe87(0x175)])?_0x2ac4b7[_0x56fe87(0x14a)][_0x56fe87(0x175)]:{};return{..._0x17461a,..._0x4cc86e};}async function configureWorkspace(_0x595e8e,_0x32d4a4){const _0x3f7372=a163_0xc1c43c,_0x245fc0=_0x595e8e[_0x3f7372(0x172)](_0x3f7372(0x162))[_0x3f7372(0x156)](),_0x30256d=_0x595e8e[_0x3f7372(0x172)]('appcode')[_0x3f7372(0x156)](),_0x11dda2=_0x245fc0||_0x30256d;if(!_0x11dda2)throw CliErrors[_0x3f7372(0x176)](_0x3f7372(0x13b),_0x3f7372(0x14c)+CLI_BIN_NAME+_0x3f7372(0x13e)+CLI_BIN_NAME+_0x3f7372(0x160));if(_0x30256d)assertValidAppcode(_0x30256d);const _0x19ba04=resolveWriteConfigPath(_0x3f7372(0x16d)),_0x44d72d=readConfigFile(_0x19ba04),_0x134ff5=resolveKnownApps(),_0x589436=isRecord(_0x44d72d['apps'])?{..._0x44d72d['apps']}:{},_0x2963a3=cloneProfile(_0x589436[_0x11dda2]),_0x5e7271=sanitizeProfile(_0x134ff5[_0x11dda2]),_0x46a032=_0x30256d?{}:_0x5e7271,_0x28e681=_0x30256d||_0x46a032[_0x3f7372(0x148)];if(!_0x28e681){const _0x47829d=Object[_0x3f7372(0x141)](_0x134ff5),_0x104522=_0x47829d['length']===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20'+_0x32d4a4+'\x20--app\x20'+_0x11dda2+_0x3f7372(0x164):_0x3f7372(0x150)+_0x47829d[_0x3f7372(0x174)](',\x20');throw CliErrors[_0x3f7372(0x176)](_0x3f7372(0x16e)+_0x11dda2+_0x3f7372(0x140),_0x104522);}assertValidAppcode(String(_0x28e681));const _0x2e4f5f={..._0x46a032,..._0x2963a3,'appcode':String(_0x28e681),...collectWorkspaceProfileOverrides(_0x595e8e)};return _0x589436[_0x11dda2]=_0x2e4f5f,_0x44d72d['apps']=_0x589436,_0x44d72d[_0x3f7372(0x14e)]=_0x11dda2,delete _0x44d72d[_0x3f7372(0x148)],delete _0x44d72d[_0x3f7372(0x162)],_0x2e4f5f[_0x3f7372(0x142)]&&(_0x44d72d[_0x3f7372(0x142)]=_0x2e4f5f['env']),writeConfigFile(_0x19ba04,_0x44d72d),{'ok':!![],'message':_0x3f7372(0x167)+(_0x32d4a4==='init'?_0x3f7372(0x13c):'updated')+':\x20'+_0x11dda2+_0x3f7372(0x149)+_0x2e4f5f[_0x3f7372(0x148)]+_0x3f7372(0x177)+_0x19ba04+_0x3f7372(0x155),'data':{'operation':_0x3f7372(0x170)+_0x32d4a4,'configPath':_0x19ba04,'app':_0x11dda2,'appcode':_0x2e4f5f['appcode'],'env':_0x2e4f5f[_0x3f7372(0x142)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a163_0xc1c43c(0x152),'command':a163_0xc1c43c(0x16b),'description':a163_0xc1c43c(0x13f),'risk':a163_0xc1c43c(0x151),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x337413=>configureWorkspace(_0x337413,'init')},workspaceUseDefinition={'service':a163_0xc1c43c(0x152),'command':a163_0xc1c43c(0x14f),'description':a163_0xc1c43c(0x143),'risk':a163_0xc1c43c(0x151),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x438812=>configureWorkspace(_0x438812,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a164_0x3328(){const _0x52c80f=['workspace','workspace\x20remove','2717848RExlHw','156789WRRpHU','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','16cVTbkT','3424234BsgAkH','1408956chfwcr','name','7301007DuWZjp','1YXiMsY','6318170XyJyMq','5SJTTfy','App\x20profile\x20name\x20to\x20remove','high-risk-write','remove','2316895iquZVX'];a164_0x3328=function(){return _0x52c80f;};return a164_0x3328();}const a164_0x4b1fa6=a164_0xa372;function a164_0xa372(_0x4df741,_0x2ab9d0){_0x4df741=_0x4df741-0x132;const _0x33280b=a164_0x3328();let _0xa372f4=_0x33280b[_0x4df741];return _0xa372f4;}(function(_0x19a629,_0x565af1){const _0x1c8f95=a164_0xa372,_0x3ffc93=_0x19a629();while(!![]){try{const _0x33b757=parseInt(_0x1c8f95(0x13d))/0x1*(parseInt(_0x1c8f95(0x139))/0x2)+parseInt(_0x1c8f95(0x136))/0x3*(-parseInt(_0x1c8f95(0x138))/0x4)+-parseInt(_0x1c8f95(0x13f))/0x5*(-parseInt(_0x1c8f95(0x13a))/0x6)+-parseInt(_0x1c8f95(0x132))/0x7+-parseInt(_0x1c8f95(0x135))/0x8+-parseInt(_0x1c8f95(0x13c))/0x9+parseInt(_0x1c8f95(0x13e))/0xa;if(_0x33b757===_0x565af1)break;else _0x3ffc93['push'](_0x3ffc93['shift']());}catch(_0x1c5d08){_0x3ffc93['push'](_0x3ffc93['shift']());}}}(a164_0x3328,0xd8bd9));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a164_0x4b1fa6(0x133),'command':a164_0x4b1fa6(0x142),'description':a164_0x4b1fa6(0x137),'risk':a164_0x4b1fa6(0x141),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a164_0x4b1fa6(0x13b),'description':a164_0x4b1fa6(0x140),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x41a91e=>validateAppName(_0x41a91e,a164_0x4b1fa6(0x134)),'execute':_0x15c029=>runAppRemove(_0x15c029,a164_0x4b1fa6(0x134))};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x562883=a165_0x46db;(function(_0x297c81,_0x5bc160){const _0x5af787=a165_0x46db,_0x2a71fc=_0x297c81();while(!![]){try{const _0x12b49f=-parseInt(_0x5af787(0x158))/0x1+-parseInt(_0x5af787(0x17e))/0x2*(-parseInt(_0x5af787(0x168))/0x3)+-parseInt(_0x5af787(0x169))/0x4*(-parseInt(_0x5af787(0x16e))/0x5)+-parseInt(_0x5af787(0x15e))/0x6*(-parseInt(_0x5af787(0x174))/0x7)+-parseInt(_0x5af787(0x172))/0x8+parseInt(_0x5af787(0x166))/0x9+-parseInt(_0x5af787(0x179))/0xa*(parseInt(_0x5af787(0x164))/0xb);if(_0x12b49f===_0x5bc160)break;else _0x2a71fc['push'](_0x2a71fc['shift']());}catch(_0x2c3b6a){_0x2a71fc['push'](_0x2a71fc['shift']());}}}(a165_0x9978,0xe47fd));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a165_0x562883(0x160),a165_0x562883(0x170),'format',a165_0x562883(0x15f)];export const TOP_LEVEL_CONFIG_KEYS=new Set(['appcode',a165_0x562883(0x157),'locale',a165_0x562883(0x162),'cookie','accessKey',a165_0x562883(0x16f)]);function a165_0x9978(){const _0x321788=['riskLevel','accessKey','map','format','string','11244211YXtTno','en-US','5247369PxdSNu','join','3WyVzdF','74508SVLonB','trim','pageSize','defaultFormat','has','65FUlJlB','apiDir','locale','Target\x20environment','8568080JhWlAg','entries','21GKXRcz','appcode','Risk\x20level','keys','defaultApp','10zicvSS','apps','length','app','number','3488938mcAcVp','inherit','Access\x20key','env','322980qqzNZP','zh-CN','Auth\x20cookie','Locale','cookie','toLowerCase','1564926HTtZby'];a165_0x9978=function(){return _0x321788;};return a165_0x9978();}export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x2747d2){const _0x521b2d=a165_0x562883;return[..._0x2747d2][_0x521b2d(0x167)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x572b52){const _0x4c8a75=a165_0x562883;return TOP_LEVEL_CONFIG_KEYS[_0x4c8a75(0x16d)](_0x572b52);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a165_0x562883(0x157),'apiDir':'apiDir','cookie':a165_0x562883(0x15c),'accessKey':a165_0x562883(0x160),'defaultFormat':'format','pageSize':'pageSize','riskLevel':'riskLevel','locale':a165_0x562883(0x170)};export function getAppProfileFlagDefs(){const _0x576af2=a165_0x562883;return[{'name':'env','type':'string','description':_0x576af2(0x171),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x576af2(0x16f),'type':_0x576af2(0x163),'description':'API\x20directory\x20path'},{'name':_0x576af2(0x15c),'type':_0x576af2(0x163),'description':_0x576af2(0x15a),'hidden':!![]},{'name':_0x576af2(0x160),'type':_0x576af2(0x163),'description':_0x576af2(0x156),'hidden':!![]},{'name':_0x576af2(0x16c),'type':'string','description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x576af2(0x16b),'type':_0x576af2(0x17d),'description':'Default\x20page\x20size'},{'name':_0x576af2(0x15f),'type':'string','description':_0x576af2(0x176),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x576af2(0x170),'type':_0x576af2(0x163),'description':_0x576af2(0x15b)}];}function a165_0x46db(_0x31751e,_0x2805b1){_0x31751e=_0x31751e-0x155;const _0x997885=a165_0x9978();let _0x46db23=_0x997885[_0x31751e];return _0x46db23;}export function collectAppProfileOverrides(_0x53d4a5){const _0x3a3ca3=a165_0x562883,_0x1cc544={};for(const [_0x2ffde8,_0x501016]of Object[_0x3a3ca3(0x173)](APP_PROFILE_FLAG_KEY_MAP)){const _0x3441d3=_0x53d4a5(_0x2ffde8);if(!_0x3441d3)continue;_0x1cc544[_0x501016]=_0x501016===_0x3a3ca3(0x16b)?Number(_0x3441d3):_0x3441d3;}return _0x1cc544;}export function buildAppProfileListFields(_0x417d10){const _0x3da3db=a165_0x562883;return{'env':_0x417d10['env']??null,'apiDir':_0x417d10[_0x3da3db(0x16f)]??null,'hasCookie':!!_0x417d10[_0x3da3db(0x15c)],'hasAccessKey':!!_0x417d10['accessKey'],'format':_0x417d10[_0x3da3db(0x162)]??null,'pageSize':_0x417d10[_0x3da3db(0x16b)]??null,'riskLevel':_0x417d10[_0x3da3db(0x15f)]??null,'locale':_0x417d10[_0x3da3db(0x170)]??null};}export function buildAppDoctorFields(_0x309c97,_0x14a4e5){const _0xe5e503=a165_0x562883;return{'env':{'value':_0x309c97[_0xe5e503(0x157)]||_0x14a4e5[_0xe5e503(0x157)],'source':_0x309c97[_0xe5e503(0x157)]?_0xe5e503(0x17c):'inherit'},'apiDir':{'value':_0x309c97[_0xe5e503(0x16f)]||_0x14a4e5['apiDir'],'source':_0x309c97[_0xe5e503(0x16f)]?_0xe5e503(0x17c):_0xe5e503(0x155)},'cookie':{'value':_0x309c97['cookie']||_0x14a4e5['cookie'],'source':_0x309c97['cookie']?_0xe5e503(0x17c):_0xe5e503(0x155)},'accessKey':{'value':_0x309c97['accessKey']||_0x14a4e5[_0xe5e503(0x160)],'source':_0x309c97[_0xe5e503(0x160)]?_0xe5e503(0x17c):_0xe5e503(0x155)}};}export function buildCanonicalAppConfig(_0x4ccaea,_0x776294){const _0x4413fb=a165_0x562883,_0x42330b=_0x4ccaea[_0x4413fb(0x161)](_0x300561=>String(_0x300561||'')[_0x4413fb(0x16a)]())['filter'](Boolean);if(_0x42330b[_0x4413fb(0x17b)]===0x0)return{};const _0x567605={};for(const _0x13a790 of _0x42330b){_0x567605[_0x13a790]=_0x776294?{'appcode':_0x13a790,'env':_0x776294}:{'appcode':_0x13a790};}return{'apps':_0x567605,'defaultApp':_0x42330b[0x0]};}export function buildCanonicalProjectConfig(_0x224070,_0x4535de){const _0x1228cc=a165_0x562883,{appCodes:appCodes=[],env:_0x1e05d3,metadata:_0x15c822}=_0x4535de,_0x272461={..._0x224070,..._0x15c822||{}};delete _0x272461[_0x1228cc(0x175)],delete _0x272461[_0x1228cc(0x17c)];if(_0x1e05d3)_0x272461['env']=_0x1e05d3;else!_0x272461[_0x1228cc(0x157)]&&(_0x272461['env']=DEFAULT_CONFIG_VALUES['env']);const _0x5e73c5=buildCanonicalAppConfig(appCodes,_0x272461['env']);return Object[_0x1228cc(0x177)](_0x5e73c5)[_0x1228cc(0x17b)]>0x0&&(_0x272461['apps']=_0x5e73c5[_0x1228cc(0x17a)],_0x272461['defaultApp']=_0x5e73c5[_0x1228cc(0x178)]),_0x272461;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a165_0x562883(0x159),'zh_cn':a165_0x562883(0x159),'en':a165_0x562883(0x165),'en-us':a165_0x562883(0x165),'en_us':a165_0x562883(0x165)};export function normalizeLocale(_0x221793){const _0x19dcbe=a165_0x562883;if(!_0x221793)return null;return LOCALE_MAP[_0x221793[_0x19dcbe(0x15d)]()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a166_0x489c(){const _0x36683e=['12RXeDGn','40431911VqFvzo','3Lpswtc','112vQbxlk','1731188PaYMyS','345432dsMeNr','72FaTSmU','2052WTvPQE','341XDrydQ','634699fmLIuH','4570prqhHo','300290WXTnCG','538119GnugTY','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json'];a166_0x489c=function(){return _0x36683e;};return a166_0x489c();}function a166_0x5852(_0x3b9065,_0x3ad14f){_0x3b9065=_0x3b9065-0x95;const _0x489cdd=a166_0x489c();let _0x58528f=_0x489cdd[_0x3b9065];return _0x58528f;}const a166_0x3652e3=a166_0x5852;(function(_0x16127b,_0x5f2b26){const _0x41af85=a166_0x5852,_0x33ba98=_0x16127b();while(!![]){try{const _0x4a3cff=-parseInt(_0x41af85(0x97))/0x1+parseInt(_0x41af85(0xa0))/0x2*(parseInt(_0x41af85(0x9e))/0x3)+parseInt(_0x41af85(0x95))/0x4*(-parseInt(_0x41af85(0x98))/0x5)+parseInt(_0x41af85(0xa1))/0x6*(-parseInt(_0x41af85(0x9f))/0x7)+parseInt(_0x41af85(0xa2))/0x8*(-parseInt(_0x41af85(0x9a))/0x9)+parseInt(_0x41af85(0x99))/0xa*(-parseInt(_0x41af85(0x96))/0xb)+-parseInt(_0x41af85(0x9c))/0xc*(-parseInt(_0x41af85(0x9d))/0xd);if(_0x4a3cff===_0x5f2b26)break;else _0x33ba98['push'](_0x33ba98['shift']());}catch(_0x3b0d0e){_0x33ba98['push'](_0x33ba98['shift']());}}}(a166_0x489c,0x75ac6));export const CLI_VERSION_POLICY_URL=a166_0x3652e3(0x9b);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a167_0x59ad30=a167_0x3dfe;(function(_0x38f961,_0x28dcaa){const _0x4e6db3=a167_0x3dfe,_0x370e6f=_0x38f961();while(!![]){try{const _0x1069ad=-parseInt(_0x4e6db3(0x167))/0x1+parseInt(_0x4e6db3(0x1b0))/0x2*(parseInt(_0x4e6db3(0x195))/0x3)+-parseInt(_0x4e6db3(0x17d))/0x4*(parseInt(_0x4e6db3(0x182))/0x5)+-parseInt(_0x4e6db3(0x17c))/0x6+parseInt(_0x4e6db3(0x1a1))/0x7+-parseInt(_0x4e6db3(0x179))/0x8+-parseInt(_0x4e6db3(0x185))/0x9*(-parseInt(_0x4e6db3(0x1b3))/0xa);if(_0x1069ad===_0x28dcaa)break;else _0x370e6f['push'](_0x370e6f['shift']());}catch(_0x342fe6){_0x370e6f['push'](_0x370e6f['shift']());}}}(a167_0x1d2f,0x988b4));export const CLI_BIN_NAME=a167_0x59ad30(0x18f);export const CLI_DISPLAY_NAME=a167_0x59ad30(0x1a3);export const NPM_PACKAGE_NAME=a167_0x59ad30(0x16f);function a167_0x3dfe(_0x179f6f,_0x518389){_0x179f6f=_0x179f6f-0x15e;const _0x1d2f2b=a167_0x1d2f();let _0x3dfea6=_0x1d2f2b[_0x179f6f];return _0x3dfea6;}export const GLOBAL_FLAGS=[{'name':a167_0x59ad30(0x15f),'meowKey':a167_0x59ad30(0x15f),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x16d),'hint':'<code>'},{'name':a167_0x59ad30(0x183),'meowKey':a167_0x59ad30(0x183),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x160),'hint':a167_0x59ad30(0x1c2)},{'name':a167_0x59ad30(0x1a9),'meowKey':a167_0x59ad30(0x1a9),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x1a2),'hint':'production\x20|\x20daily'},{'name':a167_0x59ad30(0x198),'meowKey':a167_0x59ad30(0x198),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x16b),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x17e),'hint':'<expr>'},{'name':a167_0x59ad30(0x192),'meowKey':'dryRun','type':'boolean','description':a167_0x59ad30(0x171)},{'name':'yes','meowKey':a167_0x59ad30(0x1ac),'type':'boolean','description':a167_0x59ad30(0x17f)},{'name':a167_0x59ad30(0x15e),'meowKey':a167_0x59ad30(0x1cb),'type':a167_0x59ad30(0x1af),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a167_0x59ad30(0x188),'meowKey':'global','type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x161)},{'name':a167_0x59ad30(0x16a),'meowKey':a167_0x59ad30(0x16a),'type':a167_0x59ad30(0x1af),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a167_0x59ad30(0x1af),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a167_0x59ad30(0x1b1),'meowKey':a167_0x59ad30(0x1b1),'type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x1bf)},{'name':a167_0x59ad30(0x1c5),'meowKey':a167_0x59ad30(0x1c5),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x17b),'hidden':!![]},{'name':'title','meowKey':a167_0x59ad30(0x1bb),'type':a167_0x59ad30(0x1ba),'description':'Title','hidden':!![]},{'name':a167_0x59ad30(0x1ad),'meowKey':a167_0x59ad30(0x1ad),'type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x1ca),'hidden':!![]},{'name':a167_0x59ad30(0x181),'meowKey':'watch','type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x1ae),'hidden':!![]},{'name':a167_0x59ad30(0x186),'meowKey':'output','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x189),'hidden':!![]},{'name':a167_0x59ad30(0x1c1),'meowKey':a167_0x59ad30(0x1c1),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x1c7),'hidden':!![]},{'name':a167_0x59ad30(0x1b9),'meowKey':a167_0x59ad30(0x1b9),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x1be),'hidden':!![]},{'name':a167_0x59ad30(0x1cc),'meowKey':'all','type':a167_0x59ad30(0x1af),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a167_0x59ad30(0x175),'meowKey':a167_0x59ad30(0x191),'type':'boolean','description':'Enable\x20BFF\x20save','hidden':!![]},{'name':'id','meowKey':'id','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x1a0),'hidden':!![]},{'name':a167_0x59ad30(0x17a),'meowKey':a167_0x59ad30(0x17a),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x16e),'hidden':!![]},{'name':a167_0x59ad30(0x174),'meowKey':a167_0x59ad30(0x174),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x19c),'hidden':!![]},{'name':a167_0x59ad30(0x1bd),'meowKey':'sqlcode','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x18a),'hidden':!![]},{'name':a167_0x59ad30(0x1a5),'meowKey':a167_0x59ad30(0x16c),'type':'string','description':a167_0x59ad30(0x1b7),'hidden':!![]},{'name':a167_0x59ad30(0x1a7),'meowKey':'sqlname','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x1b7),'hidden':!![]},{'name':a167_0x59ad30(0x1b8),'meowKey':a167_0x59ad30(0x170),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x180),'hidden':!![]},{'name':'dbid','meowKey':'dbid','type':a167_0x59ad30(0x1ba),'description':'DB\x20ID','hidden':!![]},{'name':a167_0x59ad30(0x1a8),'meowKey':'description','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x187),'hidden':!![]},{'name':a167_0x59ad30(0x199),'meowKey':a167_0x59ad30(0x18e),'type':'string','description':a167_0x59ad30(0x164),'hidden':!![]},{'name':a167_0x59ad30(0x1a6),'meowKey':a167_0x59ad30(0x1a6),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x176),'hidden':!![]},{'name':a167_0x59ad30(0x19f),'meowKey':'pagesize','type':a167_0x59ad30(0x1ba),'description':'Page\x20size','hidden':!![]},{'name':a167_0x59ad30(0x18b),'meowKey':'keyword','type':'string','description':a167_0x59ad30(0x1c4),'hidden':!![]},{'name':a167_0x59ad30(0x1bc),'meowKey':a167_0x59ad30(0x1bc),'type':'string','description':a167_0x59ad30(0x190),'hidden':!![]},{'name':'sql','meowKey':a167_0x59ad30(0x1c8),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x19d),'hidden':!![]},{'name':a167_0x59ad30(0x165),'meowKey':a167_0x59ad30(0x165),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x173),'hidden':!![]},{'name':a167_0x59ad30(0x1cd),'meowKey':'operation','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x196),'hidden':!![]},{'name':a167_0x59ad30(0x1ab),'meowKey':a167_0x59ad30(0x1ab),'type':'string','description':a167_0x59ad30(0x172),'hidden':!![]},{'name':a167_0x59ad30(0x1b6),'meowKey':a167_0x59ad30(0x169),'type':a167_0x59ad30(0x1af),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':'key','meowKey':'key','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x1b5),'hidden':!![]},{'name':a167_0x59ad30(0x19b),'meowKey':'value','type':a167_0x59ad30(0x1ba),'description':'Config\x20value','hidden':!![]},{'name':a167_0x59ad30(0x1a4),'meowKey':'tags','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x177),'hidden':!![]},{'name':a167_0x59ad30(0x193),'meowKey':'stdin','type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x1b2),'hidden':!![]},{'name':'from-env','meowKey':a167_0x59ad30(0x162),'type':a167_0x59ad30(0x1ba),'description':'Read\x20value\x20from\x20environment\x20variable','hidden':!![]},{'name':a167_0x59ad30(0x1c0),'meowKey':a167_0x59ad30(0x1c0),'type':'boolean','description':a167_0x59ad30(0x163),'hidden':!![]},{'name':a167_0x59ad30(0x168),'meowKey':a167_0x59ad30(0x168),'type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x19a),'hidden':!![]},{'name':a167_0x59ad30(0x1c6),'meowKey':a167_0x59ad30(0x1c6),'type':a167_0x59ad30(0x1af),'description':'Confirm\x20destructive\x20action','hidden':!![]},{'name':a167_0x59ad30(0x1b4),'meowKey':a167_0x59ad30(0x1b4),'type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x1c9),'hidden':!![]},{'name':a167_0x59ad30(0x18d),'meowKey':a167_0x59ad30(0x18d),'type':a167_0x59ad30(0x1af),'description':a167_0x59ad30(0x194),'hidden':!![]},{'name':'expected-count','meowKey':a167_0x59ad30(0x18c),'type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x184),'hidden':!![]},{'name':'operation-type','meowKey':a167_0x59ad30(0x19e),'type':'string','description':'Operation\x20type','hidden':!![]},{'name':a167_0x59ad30(0x178),'meowKey':'functionNode','type':a167_0x59ad30(0x1ba),'description':a167_0x59ad30(0x166),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a167_0x59ad30(0x15f),a167_0x59ad30(0x183),'env','format','jq',a167_0x59ad30(0x192),a167_0x59ad30(0x1ac),a167_0x59ad30(0x15e),'ci']);function a167_0x1d2f(){const _0x185430=['DB\x20ID','watch','5ZZEzth','app','Expected\x20affected\x20count','837ngLpiY','output','Description','global','Output\x20path','SQL\x20code','keyword','expectedCount','verbose','descriptionFile','rabetbase','Code\x20filter','enableBffSave','dry-run','stdin','Verbose\x20output','42345LyNylm','Operation\x20type','meowKey','format','description-file','Force\x20overwrite','value','File\x20path','SQL\x20string','operationType','pagesize','Record\x20ID','6987211HWIQYG','Environment','Rabetbase\x20CLI','tags','sql-name','page','sqlname','description','env','fromEntries','target','yes','clear','Watch\x20mode','boolean','44fChLTL','help','Read\x20value\x20from\x20stdin','175590oJvGXq','remote','Config\x20key','skip-imports','SQL\x20name','db-id','datasetcode','string','title','code','sqlcode','Dataset\x20code','Show\x20help','reveal','params','<name>','map','Keyword\x20filter','name','confirm','JSON\x20params','sql','Use\x20remote','Clear','nonInteractive','all','operation','non-interactive','appcode','Select\x20app\x20profile\x20by\x20name','Use\x20global\x20config\x20scope','fromEnv','Reveal\x20sensitive\x20value','Description\x20file','schemas','Function\x20node','786833rrWZXD','force','skipImports','project','Output\x20format','sqlName','Override\x20appcode','Type\x20filter','@lovrabet/rabetbase-cli','dbId','Preview\x20operation\x20without\x20executing','Target\x20path','Schemas','file','enable-bff-save','Page\x20number','Tags','function-node','9477080YzxkHK','type','Name','1937022rySnZQ','90260FSxUXx','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Skip\x20confirmation\x20for\x20high-risk\x20writes'];a167_0x1d2f=function(){return _0x185430;};return a167_0x1d2f();}export function buildMeowFlags(){const _0x3dc417=a167_0x59ad30;return Object[_0x3dc417(0x1aa)](GLOBAL_FLAGS[_0x3dc417(0x1c3)](_0x4ded9c=>[_0x4ded9c[_0x3dc417(0x197)],{'type':_0x4ded9c[_0x3dc417(0x17a)]}]));}
|
|
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)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a168_0x2e1eb4=a168_0x523f;(function(_0x3c66d5,_0x1037e6){const _0x433349=a168_0x523f,_0x2dfde4=_0x3c66d5();while(!![]){try{const _0x32551b=-parseInt(_0x433349(0xd1))/0x1+parseInt(_0x433349(0xca))/0x2+parseInt(_0x433349(0xc9))/0x3+parseInt(_0x433349(0xce))/0x4+-parseInt(_0x433349(0xd0))/0x5*(-parseInt(_0x433349(0xcc))/0x6)+-parseInt(_0x433349(0xd3))/0x7+-parseInt(_0x433349(0xc7))/0x8*(parseInt(_0x433349(0xc8))/0x9);if(_0x32551b===_0x1037e6)break;else _0x2dfde4['push'](_0x2dfde4['shift']());}catch(_0x53b695){_0x2dfde4['push'](_0x2dfde4['shift']());}}}(a168_0x26d2,0xaa531));function a168_0x523f(_0x33b578,_0x44f4ec){_0x33b578=_0x33b578-0xc7;const _0x26d2d4=a168_0x26d2();let _0x523fff=_0x26d2d4[_0x33b578];return _0x523fff;}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a168_0x2e1eb4(0xcb),'format':a168_0x2e1eb4(0xcd),'locale':a168_0x2e1eb4(0xd2),'riskLevel':a168_0x2e1eb4(0xcf),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a168_0x2e1eb4(0xcd);function a168_0x26d2(){const _0x2cc995=['1194714xKajzx','2481417mLSrSz','1334372Twbepa','production','54306OrBHHH','compress','2289232tHMZyA','high-risk-write','185gcdHpC','196950bZfZGo','en-US','5902337LvsoeD','40jtoiYT'];a168_0x26d2=function(){return _0x2cc995;};return a168_0x26d2();}
|