@lovrabet/rabetbase-cli 2.1.14-beta.2 → 2.1.14-beta.3
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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.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-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-selector.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/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/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/rename.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/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/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/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/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.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/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.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/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/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a127_0x4d9fa9=a127_0x1956;(function(_0x2a2886,_0x1b0f65){const _0x1c32ed=a127_0x1956,_0xdd75d=_0x2a2886();while(!![]){try{const _0x263d86=-parseInt(_0x1c32ed(0x144))/0x1*(parseInt(_0x1c32ed(0x14f))/0x2)+-parseInt(_0x1c32ed(0x169))/0x3*(parseInt(_0x1c32ed(0x171))/0x4)+parseInt(_0x1c32ed(0x13b))/0x5*(parseInt(_0x1c32ed(0x161))/0x6)+-parseInt(_0x1c32ed(0x15c))/0x7*(-parseInt(_0x1c32ed(0x142))/0x8)+-parseInt(_0x1c32ed(0x133))/0x9*(parseInt(_0x1c32ed(0x14e))/0xa)+parseInt(_0x1c32ed(0x151))/0xb*(-parseInt(_0x1c32ed(0x14c))/0xc)+parseInt(_0x1c32ed(0x163))/0xd;if(_0x263d86===_0x1b0f65)break;else _0xdd75d['push'](_0xdd75d['shift']());}catch(_0x2b1ad4){_0xdd75d['push'](_0xdd75d['shift']());}}}(a127_0x83ea,0x53b85));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';function a127_0x83ea(){const _0x205b61=['remoteId','sqlCode','push','length','dbName','993XAyjUF','trashDir','replace','projectRoot','filter','sqlRoot','Push\x20complete:\x20','Would\x20push\x20','3868hrKTaF','exec','sqlName','\x20SQL\x20file(s)','508779zUnwTT','isFinite','\x20skipped,\x20','path','bool','has','join','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','35cqttvS','hash','/smartapi/custom/updateUserCustomSql','map','\x20failed','No\x20database\x20matches\x20local\x20directory\x20\x22','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','1092008TaaDBR','lockFilePath','431kvoYSU','utf8','sqlRootDir','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','sqls','sqlConfig','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','str','84tIJCbn','appCode','80BpFdoW','2282TIPQoI','POST','492877iVJOBU','sqlcode','get','\x20pushed,\x20','startsWith','force','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','relativePath','version','set','filePath','7PxVDeX','validation','toISOString','sql','dbId','434874HNCPam','mode','16598504aWeBZJ'];a127_0x83ea=function(){return _0x205b61;};return a127_0x83ea();}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';function a127_0x1956(_0x3d5225,_0x3bf40f){_0x3d5225=_0x3d5225-0x131;const _0x83ea6=a127_0x83ea();let _0x195688=_0x83ea6[_0x3d5225];return _0x195688;}import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x1e5e44,_0x3bc290,_0x24b38a){const _0x1a8aa2=a127_0x1956,_0x4cc198=await scanLocalSqlQueries(_0x1e5e44),_0x59eea7=new Map();for(const _0x517bab of _0x4cc198){if(_0x24b38a&&_0x517bab[_0x1a8aa2(0x165)]!==_0x24b38a)continue;const _0x4d6ef6=_0x59eea7[_0x1a8aa2(0x153)](_0x517bab[_0x1a8aa2(0x165)])??[];_0x4d6ef6['push'](_0x517bab),_0x59eea7[_0x1a8aa2(0x15a)](_0x517bab[_0x1a8aa2(0x165)],_0x4d6ef6);}if(_0x24b38a&&!_0x59eea7[_0x1a8aa2(0x138)](_0x24b38a))throw CliErrors[_0x1a8aa2(0x15d)]('Local\x20SQL\x20not\x20found:\x20'+_0x24b38a);const _0x20d65b=[];for(const [_0x39223a,_0x1cfb24]of _0x59eea7['entries']()){if(_0x1cfb24[_0x1a8aa2(0x167)]===0x1){_0x20d65b[_0x1a8aa2(0x166)](_0x1cfb24[0x0]);continue;}const _0xfe6d35=_0x3bc290[_0x1a8aa2(0x148)][_0x39223a],_0x1b4dd3=_0xfe6d35?.['path'],_0x3d181e=_0x1b4dd3?_0x1cfb24[_0x1a8aa2(0x16d)](_0x1130fb=>_0x1130fb[_0x1a8aa2(0x158)]!==_0x1b4dd3):_0x1cfb24;if(_0xfe6d35&&_0x3d181e[_0x1a8aa2(0x167)]===0x1){_0x20d65b[_0x1a8aa2(0x166)](_0x3d181e[0x0]);continue;}throw CliErrors[_0x1a8aa2(0x15d)](_0x1a8aa2(0x13a)+_0x39223a+_0x1a8aa2(0x157));}return _0x20d65b;}export const sqlPush={'service':a127_0x4d9fa9(0x15f),'command':a127_0x4d9fa9(0x166),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a127_0x4d9fa9(0x147)}],async 'dryRun'(_0x4bc7e7){const _0x9228e=a127_0x4d9fa9,_0x4871c0=loadSqlProjectConfig(_0x4bc7e7[_0x9228e(0x14d)]),_0x3aea27=await readSqlLockFile(_0x4871c0['lockFilePath']),{appLock:_0x45f756}=ensureSqlLockScope(_0x3aea27??createEmptySqlLock(),_0x4bc7e7[_0x9228e(0x14d)],_0x4871c0['sqlRoot'],_0x9228e(0x166)),_0x51b2dc=await getTargetSqlQueries(_0x4871c0,_0x45f756,_0x4bc7e7[_0x9228e(0x14b)](_0x9228e(0x152))||undefined),_0x208764=[];for(const _0x54aade of _0x51b2dc){const _0x1a935c=await computeSqlFileHash(_0x54aade[_0x9228e(0x15b)]),_0x4af8da=_0x45f756[_0x9228e(0x148)][_0x54aade[_0x9228e(0x165)]],_0x3c46bc=!!_0x4af8da&&(_0x4af8da[_0x9228e(0x136)]!==_0x54aade['relativePath']||!!_0x54aade[_0x9228e(0x131)]&&_0x4af8da['sqlName']!==_0x54aade[_0x9228e(0x131)]);if(!_0x4bc7e7[_0x9228e(0x137)](_0x9228e(0x156))&&_0x4af8da&&_0x4af8da[_0x9228e(0x13c)]===_0x1a935c&&!_0x3c46bc)continue;_0x208764[_0x9228e(0x166)](_0x54aade[_0x9228e(0x165)]);}return{'method':_0x9228e(0x150),'url':_0x9228e(0x13d),'body':{'sqlCodes':_0x208764,'appCode':_0x4bc7e7[_0x9228e(0x14d)]},'description':_0x9228e(0x170)+_0x208764[_0x9228e(0x167)]+_0x9228e(0x132)};},async 'execute'(_0x438320){const _0x37f7bb=a127_0x4d9fa9,_0x32c2af=loadSqlProjectConfig(_0x438320[_0x37f7bb(0x14d)]),_0x452a1e=await readSqlLockFile(_0x32c2af[_0x37f7bb(0x143)]),{lockData:_0x43faaf,appLock:_0x10886a}=ensureSqlLockScope(_0x452a1e??createEmptySqlLock(),_0x438320[_0x37f7bb(0x14d)],_0x32c2af[_0x37f7bb(0x16e)],_0x37f7bb(0x166)),_0x20fe39=await getTargetSqlQueries(_0x32c2af,_0x10886a,_0x438320[_0x37f7bb(0x14b)]('sqlcode')||undefined);if(_0x20fe39[_0x37f7bb(0x167)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x1371d5=[],_0x2cd18a=[],_0x261130=[];for(const _0x247a7a of _0x20fe39){const _0x21726b=_0x10886a[_0x37f7bb(0x148)][_0x247a7a[_0x37f7bb(0x165)]];if(!_0x21726b){_0x261130[_0x37f7bb(0x166)]({'sqlCode':_0x247a7a['sqlCode'],'error':_0x37f7bb(0x14a)});continue;}try{const _0x1c1583=await computeSqlFileHash(_0x247a7a[_0x37f7bb(0x15b)]),_0x165815=_0x21726b[_0x37f7bb(0x136)]!==_0x247a7a['relativePath']||!!_0x247a7a[_0x37f7bb(0x131)]&&_0x21726b[_0x37f7bb(0x131)]!==_0x247a7a[_0x37f7bb(0x131)];if(!_0x438320['bool']('force')&&_0x21726b[_0x37f7bb(0x13c)]===_0x1c1583&&!_0x165815){_0x2cd18a[_0x37f7bb(0x166)]({'sqlCode':_0x247a7a[_0x37f7bb(0x165)],'reason':'unchanged'});continue;}if(_0x21726b[_0x37f7bb(0x159)]==null){_0x261130['push']({'sqlCode':_0x247a7a[_0x37f7bb(0x165)],'error':_0x37f7bb(0x141)});continue;}const _0x367337=await readFile(_0x247a7a['filePath'],_0x37f7bb(0x145)),_0x294843=stripLocalSqlMetadata(_0x367337,_0x247a7a[_0x37f7bb(0x162)]),_0x930af7=_0x247a7a[_0x37f7bb(0x131)]||_0x21726b[_0x37f7bb(0x131)],_0x10823f=await resolveTargetDbBinding(_0x438320[_0x37f7bb(0x14d)],_0x247a7a,_0x21726b),_0x483428=await updateSqlQuery({'id':_0x21726b[_0x37f7bb(0x164)],'appCode':_0x438320[_0x37f7bb(0x14d)],'sqlCode':_0x247a7a[_0x37f7bb(0x165)],'sqlName':_0x930af7,'dbId':_0x10823f['dbId'],'version':_0x21726b['version'],'sqlContent':_0x294843,'sqlConfig':_0x21726b[_0x37f7bb(0x149)]??undefined}),_0x25c35c=_0x483428[_0x37f7bb(0x160)]?await getDbName(_0x438320[_0x37f7bb(0x14d)],Number(_0x483428['dbId']))['catch'](()=>_0x10823f[_0x37f7bb(0x168)]):_0x10823f[_0x37f7bb(0x168)];_0x10886a[_0x37f7bb(0x148)][_0x247a7a[_0x37f7bb(0x165)]]={...buildSqlLockEntry(_0x483428,_0x294843,_0x1c1583,{'dbName':_0x25c35c}),'path':_0x247a7a[_0x37f7bb(0x158)],'mode':_0x21726b[_0x37f7bb(0x162)]},await archivePreviousSqlFileIfNeeded(_0x32c2af,_0x21726b[_0x37f7bb(0x136)],_0x247a7a[_0x37f7bb(0x158)]),_0x1371d5[_0x37f7bb(0x166)]({'sqlCode':_0x247a7a[_0x37f7bb(0x165)],'remoteId':_0x21726b[_0x37f7bb(0x164)]});}catch(_0x7b2eff){_0x261130['push']({'sqlCode':_0x247a7a['sqlCode'],'error':_0x7b2eff instanceof Error?_0x7b2eff['message']:String(_0x7b2eff)});}}return _0x10886a['lastSync']=new Date()[_0x37f7bb(0x15e)](),await writeSqlLockFile(_0x32c2af[_0x37f7bb(0x143)],_0x43faaf),{'ok':_0x261130['length']===0x0,'data':{'pushed':_0x1371d5,'skipped':_0x2cd18a,'failed':_0x261130},'message':_0x37f7bb(0x16f)+_0x1371d5[_0x37f7bb(0x167)]+_0x37f7bb(0x154)+_0x2cd18a[_0x37f7bb(0x167)]+_0x37f7bb(0x135)+_0x261130[_0x37f7bb(0x167)]+_0x37f7bb(0x13f)};}};async function archivePreviousSqlFileIfNeeded(_0x5d7f83,_0x1b05d7,_0x4e748a){const _0x515d7f=a127_0x4d9fa9;if(!_0x1b05d7||_0x1b05d7===_0x4e748a)return;const _0x3b49c1=join(_0x5d7f83[_0x515d7f(0x146)],_0x1b05d7);if(!await fileExists(_0x3b49c1))return;const _0x78c716=await moveToTrash(_0x5d7f83[_0x515d7f(0x16c)],_0x5d7f83[_0x515d7f(0x16a)],_0x3b49c1);await cleanupEmptyDirectories(dirname(_0x3b49c1),_0x5d7f83['sqlRootDir']),void _0x78c716;}async function moveToTrash(_0x4c8fd4,_0x40746e,_0x1394a5){const _0x5082ac=a127_0x4d9fa9,_0x301bbb=new Date()[_0x5082ac(0x15e)]()[_0x5082ac(0x16b)](/[:.]/g,'-'),_0x278883=relative(_0x4c8fd4,_0x1394a5),_0x2b8113=join(_0x40746e,_0x301bbb,_0x278883);return await mkdir(dirname(_0x2b8113),{'recursive':!![]}),await rename(_0x1394a5,_0x2b8113),_0x2b8113;}async function cleanupEmptyDirectories(_0x4a73b7,_0x5dbb9a){const _0x29b4f7=a127_0x4d9fa9;let _0x121c20=resolve(_0x4a73b7);const _0x524bac=resolve(_0x5dbb9a);while(_0x121c20[_0x29b4f7(0x155)](''+_0x524bac+sep)||_0x121c20===_0x524bac){if(_0x121c20===_0x524bac)return;try{const _0x421bad=await readdir(_0x121c20);if(_0x421bad[_0x29b4f7(0x167)]>0x0)return;await rmdir(_0x121c20);}catch{return;}_0x121c20=dirname(_0x121c20);}}async function resolveTargetDbBinding(_0x2a0c43,_0x35df56,_0x4012d1){const _0xfd9830=a127_0x4d9fa9,_0x25529f=_0x35df56['dbDirectory'];if(!_0x25529f)return{'dbId':_0x4012d1[_0xfd9830(0x160)],'dbName':_0x4012d1['dbName']};const _0x49a850=buildDbDirectoryName(_0x4012d1[_0xfd9830(0x168)],_0x4012d1['dbId']);if(_0x25529f===_0x49a850)return{'dbId':_0x4012d1[_0xfd9830(0x160)],'dbName':_0x4012d1[_0xfd9830(0x168)]};const _0x34e4ba=parseExplicitDbDirectory(_0x25529f);if(_0x34e4ba!=null)return{'dbId':_0x34e4ba,'dbName':await getDbName(_0x2a0c43,_0x34e4ba)['catch'](()=>undefined)};const _0x33b8ff=await listDatabases(_0x2a0c43),_0x512e9b=_0x33b8ff[_0xfd9830(0x16d)](_0x4b2556=>buildDbDirectoryName(_0x4b2556[_0xfd9830(0x168)],_0x4b2556[_0xfd9830(0x160)])===_0x25529f);if(_0x512e9b[_0xfd9830(0x167)]===0x1)return{'dbId':_0x512e9b[0x0]['dbId'],'dbName':_0x512e9b[0x0][_0xfd9830(0x168)]};if(_0x512e9b[_0xfd9830(0x167)]===0x0)throw CliErrors[_0xfd9830(0x15d)](_0xfd9830(0x140)+_0x25529f+'\x22\x20for\x20sqlCode\x20'+_0x35df56['sqlCode']+'.');const _0x1c36ec=_0x512e9b[_0xfd9830(0x13e)](_0xdc1b19=>_0xdc1b19[_0xfd9830(0x168)]+'\x20('+_0xdc1b19[_0xfd9830(0x160)]+')')[_0xfd9830(0x139)](',\x20');throw CliErrors['validation']('Local\x20directory\x20\x22'+_0x25529f+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x35df56['sqlCode']+':\x20'+_0x1c36ec);}function parseExplicitDbDirectory(_0x14fb4d){const _0xc853be=a127_0x4d9fa9,_0x2da4da=/^db-(\d+)$/[_0xc853be(0x172)](_0x14fb4d);if(!_0x2da4da)return null;const _0x22714b=Number(_0x2da4da[0x1]);return Number[_0xc853be(0x134)](_0x22714b)&&_0x22714b>0x0?_0x22714b:null;}
|
|
1
|
+
const a127_0x45e623=a127_0x194a;(function(_0x6c5eee,_0x55e6c4){const _0x46a9bf=a127_0x194a,_0x578648=_0x6c5eee();while(!![]){try{const _0x10e893=parseInt(_0x46a9bf(0x14b))/0x1*(parseInt(_0x46a9bf(0x14e))/0x2)+-parseInt(_0x46a9bf(0x14d))/0x3+parseInt(_0x46a9bf(0x16e))/0x4*(parseInt(_0x46a9bf(0x15c))/0x5)+parseInt(_0x46a9bf(0x16d))/0x6+-parseInt(_0x46a9bf(0x182))/0x7*(parseInt(_0x46a9bf(0x17e))/0x8)+-parseInt(_0x46a9bf(0x176))/0x9*(-parseInt(_0x46a9bf(0x188))/0xa)+-parseInt(_0x46a9bf(0x177))/0xb;if(_0x10e893===_0x55e6c4)break;else _0x578648['push'](_0x578648['shift']());}catch(_0x2603ef){_0x578648['push'](_0x578648['shift']());}}}(a127_0x35d5,0xf23dc));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';function a127_0x194a(_0x1d41a6,_0x7bc708){_0x1d41a6=_0x1d41a6-0x14b;const _0x35d5a5=a127_0x35d5();let _0x194a46=_0x35d5a5[_0x1d41a6];return _0x194a46;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a127_0x35d5(){const _0x22de50=['bool','3rOQEzz','validation','150969fpJhGd','569614rbeZrF','force','replace','\x22\x20for\x20sqlCode\x20','utf8','relativePath','hash','Local\x20SQL\x20not\x20found:\x20','sql','startsWith','str','trashDir','dbName','filePath','447955ZrFLOb','dbId','POST','version','Would\x20push\x20','set','Push\x20local\x20SQL\x20files\x20to\x20remote','message','lockFilePath','projectRoot','isFinite','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','exec','lastSync','remoteId','sqlcode','sqlRoot','6513576oJPAqS','24wiYycS','sqlName','push','path','length','\x20SQL\x20file(s)','appCode','unchanged','2770839TecZMZ','17529655wFXfyx','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','\x20failed','No\x20local\x20SQL\x20files\x20found.','join','sqlCode','toISOString','597144aAzwxq','No\x20database\x20matches\x20local\x20directory\x20\x22','mode','sqls','14TRqkFJ','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','high-risk-write','get','Local\x20directory\x20\x22','catch','10nCXgdE'];a127_0x35d5=function(){return _0x22de50;};return a127_0x35d5();}import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x294912,_0x6dec53,_0xf4214f){const _0x5e086f=a127_0x194a,_0x508ff2=await scanLocalSqlQueries(_0x294912),_0x3bc5d1=new Map();for(const _0x41fa10 of _0x508ff2){if(_0xf4214f&&_0x41fa10[_0x5e086f(0x17c)]!==_0xf4214f)continue;const _0x153082=_0x3bc5d1[_0x5e086f(0x185)](_0x41fa10[_0x5e086f(0x17c)])??[];_0x153082[_0x5e086f(0x170)](_0x41fa10),_0x3bc5d1[_0x5e086f(0x161)](_0x41fa10['sqlCode'],_0x153082);}if(_0xf4214f&&!_0x3bc5d1['has'](_0xf4214f))throw CliErrors[_0x5e086f(0x14c)](_0x5e086f(0x155)+_0xf4214f);const _0x2f04e8=[];for(const [_0x159575,_0x2bf043]of _0x3bc5d1['entries']()){if(_0x2bf043[_0x5e086f(0x172)]===0x1){_0x2f04e8[_0x5e086f(0x170)](_0x2bf043[0x0]);continue;}const _0x97725a=_0x6dec53[_0x5e086f(0x181)][_0x159575],_0x4f4175=_0x97725a?.[_0x5e086f(0x171)],_0x88949d=_0x4f4175?_0x2bf043['filter'](_0x5a2a52=>_0x5a2a52[_0x5e086f(0x153)]!==_0x4f4175):_0x2bf043;if(_0x97725a&&_0x88949d[_0x5e086f(0x172)]===0x1){_0x2f04e8[_0x5e086f(0x170)](_0x88949d[0x0]);continue;}throw CliErrors[_0x5e086f(0x14c)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x159575+_0x5e086f(0x183));}return _0x2f04e8;}export const sqlPush={'service':a127_0x45e623(0x156),'command':a127_0x45e623(0x170),'description':a127_0x45e623(0x162),'risk':a127_0x45e623(0x184),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a127_0x45e623(0x14f),'type':'boolean','description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x45a4af){const _0x477995=a127_0x45e623,_0x38d256=loadSqlProjectConfig(_0x45a4af['appCode']),_0x36c9e5=await readSqlLockFile(_0x38d256[_0x477995(0x164)]),{appLock:_0x53a651}=ensureSqlLockScope(_0x36c9e5??createEmptySqlLock(),_0x45a4af[_0x477995(0x174)],_0x38d256[_0x477995(0x16c)],_0x477995(0x170)),_0x188bd6=await getTargetSqlQueries(_0x38d256,_0x53a651,_0x45a4af[_0x477995(0x158)](_0x477995(0x16b))||undefined),_0x380b7e=[];for(const _0x5a26ec of _0x188bd6){const _0x2caef3=await computeSqlFileHash(_0x5a26ec[_0x477995(0x15b)]),_0x1bf27f=_0x53a651[_0x477995(0x181)][_0x5a26ec[_0x477995(0x17c)]],_0x33020b=!!_0x1bf27f&&(_0x1bf27f[_0x477995(0x171)]!==_0x5a26ec[_0x477995(0x153)]||!!_0x5a26ec[_0x477995(0x16f)]&&_0x1bf27f['sqlName']!==_0x5a26ec[_0x477995(0x16f)]);if(!_0x45a4af[_0x477995(0x189)](_0x477995(0x14f))&&_0x1bf27f&&_0x1bf27f[_0x477995(0x154)]===_0x2caef3&&!_0x33020b)continue;_0x380b7e['push'](_0x5a26ec['sqlCode']);}return{'method':_0x477995(0x15e),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x380b7e,'appCode':_0x45a4af['appCode']},'description':_0x477995(0x160)+_0x380b7e[_0x477995(0x172)]+_0x477995(0x173)};},async 'execute'(_0x21aad3){const _0xff53bc=a127_0x45e623,_0x4d62c6=loadSqlProjectConfig(_0x21aad3[_0xff53bc(0x174)]),_0x1de077=await readSqlLockFile(_0x4d62c6['lockFilePath']),{lockData:_0x2addfa,appLock:_0x545f47}=ensureSqlLockScope(_0x1de077??createEmptySqlLock(),_0x21aad3[_0xff53bc(0x174)],_0x4d62c6[_0xff53bc(0x16c)],_0xff53bc(0x170)),_0x3bb3fe=await getTargetSqlQueries(_0x4d62c6,_0x545f47,_0x21aad3['str'](_0xff53bc(0x16b))||undefined);if(_0x3bb3fe[_0xff53bc(0x172)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xff53bc(0x17a)};const _0x20c8f5=[],_0x3180ca=[],_0x5cc1bb=[];for(const _0x305c7e of _0x3bb3fe){const _0x3cda18=_0x545f47[_0xff53bc(0x181)][_0x305c7e[_0xff53bc(0x17c)]];if(!_0x3cda18){_0x5cc1bb['push']({'sqlCode':_0x305c7e[_0xff53bc(0x17c)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x3b6759=await computeSqlFileHash(_0x305c7e[_0xff53bc(0x15b)]),_0x17b598=_0x3cda18[_0xff53bc(0x171)]!==_0x305c7e['relativePath']||!!_0x305c7e['sqlName']&&_0x3cda18[_0xff53bc(0x16f)]!==_0x305c7e[_0xff53bc(0x16f)];if(!_0x21aad3[_0xff53bc(0x189)](_0xff53bc(0x14f))&&_0x3cda18[_0xff53bc(0x154)]===_0x3b6759&&!_0x17b598){_0x3180ca[_0xff53bc(0x170)]({'sqlCode':_0x305c7e['sqlCode'],'reason':_0xff53bc(0x175)});continue;}if(_0x3cda18[_0xff53bc(0x15f)]==null){_0x5cc1bb[_0xff53bc(0x170)]({'sqlCode':_0x305c7e[_0xff53bc(0x17c)],'error':_0xff53bc(0x178)});continue;}const _0x11379b=await readFile(_0x305c7e['filePath'],_0xff53bc(0x152)),_0x46e47d=stripLocalSqlMetadata(_0x11379b,_0x305c7e['mode']),_0x2cd7d3=_0x305c7e[_0xff53bc(0x16f)]||_0x3cda18[_0xff53bc(0x16f)],_0x11c489=await resolveTargetDbBinding(_0x21aad3[_0xff53bc(0x174)],_0x305c7e,_0x3cda18),_0x15d3ed=await updateSqlQuery({'id':_0x3cda18[_0xff53bc(0x16a)],'appCode':_0x21aad3[_0xff53bc(0x174)],'sqlCode':_0x305c7e[_0xff53bc(0x17c)],'sqlName':_0x2cd7d3,'dbId':_0x11c489[_0xff53bc(0x15d)],'version':_0x3cda18[_0xff53bc(0x15f)],'sqlContent':_0x46e47d,'sqlConfig':_0x3cda18['sqlConfig']??undefined}),_0x4d035f=_0x15d3ed[_0xff53bc(0x15d)]?await getDbName(_0x21aad3['appCode'],Number(_0x15d3ed[_0xff53bc(0x15d)]))['catch'](()=>_0x11c489[_0xff53bc(0x15a)]):_0x11c489[_0xff53bc(0x15a)];_0x545f47[_0xff53bc(0x181)][_0x305c7e[_0xff53bc(0x17c)]]={...buildSqlLockEntry(_0x15d3ed,_0x46e47d,_0x3b6759,{'dbName':_0x4d035f}),'path':_0x305c7e[_0xff53bc(0x153)],'mode':_0x3cda18[_0xff53bc(0x180)]},await archivePreviousSqlFileIfNeeded(_0x4d62c6,_0x3cda18[_0xff53bc(0x171)],_0x305c7e[_0xff53bc(0x153)]),_0x20c8f5[_0xff53bc(0x170)]({'sqlCode':_0x305c7e[_0xff53bc(0x17c)],'remoteId':_0x3cda18[_0xff53bc(0x16a)]});}catch(_0xadc084){_0x5cc1bb[_0xff53bc(0x170)]({'sqlCode':_0x305c7e[_0xff53bc(0x17c)],'error':_0xadc084 instanceof Error?_0xadc084[_0xff53bc(0x163)]:String(_0xadc084)});}}return _0x545f47[_0xff53bc(0x169)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4d62c6[_0xff53bc(0x164)],_0x2addfa),{'ok':_0x5cc1bb[_0xff53bc(0x172)]===0x0,'data':{'pushed':_0x20c8f5,'skipped':_0x3180ca,'failed':_0x5cc1bb},'message':'Push\x20complete:\x20'+_0x20c8f5['length']+'\x20pushed,\x20'+_0x3180ca['length']+'\x20skipped,\x20'+_0x5cc1bb[_0xff53bc(0x172)]+_0xff53bc(0x179)};}};async function archivePreviousSqlFileIfNeeded(_0xa3c8de,_0x58da82,_0x3a2ec5){const _0x355efa=a127_0x45e623;if(!_0x58da82||_0x58da82===_0x3a2ec5)return;const _0x2fadf3=join(_0xa3c8de['sqlRootDir'],_0x58da82);if(!await fileExists(_0x2fadf3))return;const _0x599fe9=await moveToTrash(_0xa3c8de[_0x355efa(0x165)],_0xa3c8de[_0x355efa(0x159)],_0x2fadf3);await cleanupEmptyDirectories(dirname(_0x2fadf3),_0xa3c8de['sqlRootDir']),void _0x599fe9;}async function moveToTrash(_0x44b41f,_0x3eb2a5,_0x388d80){const _0x2300a7=a127_0x45e623,_0x200810=new Date()[_0x2300a7(0x17d)]()[_0x2300a7(0x150)](/[:.]/g,'-'),_0x17e072=relative(_0x44b41f,_0x388d80),_0x47cf77=join(_0x3eb2a5,_0x200810,_0x17e072);return await mkdir(dirname(_0x47cf77),{'recursive':!![]}),await rename(_0x388d80,_0x47cf77),_0x47cf77;}async function cleanupEmptyDirectories(_0x50b5cd,_0x2c0839){const _0x517da2=a127_0x45e623;let _0x1cea91=resolve(_0x50b5cd);const _0x50f55f=resolve(_0x2c0839);while(_0x1cea91[_0x517da2(0x157)](''+_0x50f55f+sep)||_0x1cea91===_0x50f55f){if(_0x1cea91===_0x50f55f)return;try{const _0x4fd056=await readdir(_0x1cea91);if(_0x4fd056[_0x517da2(0x172)]>0x0)return;await rmdir(_0x1cea91);}catch{return;}_0x1cea91=dirname(_0x1cea91);}}async function resolveTargetDbBinding(_0x4c3259,_0x5eeb23,_0xa8fdd7){const _0xe55fb6=a127_0x45e623,_0x40164b=_0x5eeb23['dbDirectory'];if(!_0x40164b)return{'dbId':_0xa8fdd7[_0xe55fb6(0x15d)],'dbName':_0xa8fdd7[_0xe55fb6(0x15a)]};const _0x5ee973=buildDbDirectoryName(_0xa8fdd7[_0xe55fb6(0x15a)],_0xa8fdd7[_0xe55fb6(0x15d)]);if(_0x40164b===_0x5ee973)return{'dbId':_0xa8fdd7['dbId'],'dbName':_0xa8fdd7[_0xe55fb6(0x15a)]};const _0x5ded95=parseExplicitDbDirectory(_0x40164b);if(_0x5ded95!=null)return{'dbId':_0x5ded95,'dbName':await getDbName(_0x4c3259,_0x5ded95)[_0xe55fb6(0x187)](()=>undefined)};const _0x37b06a=await listDatabases(_0x4c3259),_0x2e1da8=_0x37b06a['filter'](_0x1fc648=>buildDbDirectoryName(_0x1fc648['dbName'],_0x1fc648[_0xe55fb6(0x15d)])===_0x40164b);if(_0x2e1da8['length']===0x1)return{'dbId':_0x2e1da8[0x0][_0xe55fb6(0x15d)],'dbName':_0x2e1da8[0x0][_0xe55fb6(0x15a)]};if(_0x2e1da8[_0xe55fb6(0x172)]===0x0)throw CliErrors[_0xe55fb6(0x14c)](_0xe55fb6(0x17f)+_0x40164b+_0xe55fb6(0x151)+_0x5eeb23[_0xe55fb6(0x17c)]+'.');const _0x1e1f97=_0x2e1da8['map'](_0x2dadda=>_0x2dadda[_0xe55fb6(0x15a)]+'\x20('+_0x2dadda[_0xe55fb6(0x15d)]+')')[_0xe55fb6(0x17b)](',\x20');throw CliErrors[_0xe55fb6(0x14c)](_0xe55fb6(0x186)+_0x40164b+_0xe55fb6(0x167)+_0x5eeb23['sqlCode']+':\x20'+_0x1e1f97);}function parseExplicitDbDirectory(_0x3b5a4e){const _0x4fd89b=a127_0x45e623,_0x4c4e56=/^db-(\d+)$/[_0x4fd89b(0x168)](_0x3b5a4e);if(!_0x4c4e56)return null;const _0x470060=Number(_0x4c4e56[0x1]);return Number[_0x4fd89b(0x166)](_0x470060)&&_0x470060>0x0?_0x470060:null;}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x52fe99=a128_0x5170;(function(_0x23bdf3,_0xba4ee1){const _0x988b01=a128_0x5170,_0x525bcd=_0x23bdf3();while(!![]){try{const _0x506809=-parseInt(_0x988b01(0xc8))/0x1+-parseInt(_0x988b01(0xc3))/0x2+-parseInt(_0x988b01(0xc5))/0x3*(-parseInt(_0x988b01(0xd0))/0x4)+-parseInt(_0x988b01(0xd2))/0x5*(-parseInt(_0x988b01(0xda))/0x6)+-parseInt(_0x988b01(0xd5))/0x7*(parseInt(_0x988b01(0xd4))/0x8)+parseInt(_0x988b01(0xd3))/0x9+-parseInt(_0x988b01(0xca))/0xa*(-parseInt(_0x988b01(0xcc))/0xb);if(_0x506809===_0xba4ee1)break;else _0x525bcd['push'](_0x525bcd['shift']());}catch(_0x3a6f57){_0x525bcd['push'](_0x525bcd['shift']());}}}(a128_0x86cd,0x1ffe6));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a128_0x5170(_0x4b3a8e,_0x2c1e1e){_0x4b3a8e=_0x4b3a8e-0xc3;const _0x86cdb1=a128_0x86cd();let _0x5170e8=_0x86cdb1[_0x4b3a8e];return _0x5170e8;}const SQL_SAVE_DEPRECATED_HINT=[a128_0x52fe99(0xdb),a128_0x52fe99(0xdc),a128_0x52fe99(0xce)]['join']('\x0a');function a128_0x86cd(){const _0x35c53a=['3qfKgqB','Path\x20to\x20the\x20SQL\x20file','Query\x20description','135830XaCuQX','file','1840UIYtPK','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','10758UeTRjZ','save','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`.','string','272980KHlDlU','description','10pbFkqf','500445SSPWxD','596768ItnGRw','21mKmfgJ','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','sqlname','validation','sql','678732kygyZd','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','SQL\x20query\x20display\x20name','78764XPmrYe','write'];a128_0x86cd=function(){return _0x35c53a;};return a128_0x86cd();}export const sqlSave={'service':a128_0x52fe99(0xd9),'command':a128_0x52fe99(0xcd),'description':a128_0x52fe99(0xcb),'risk':a128_0x52fe99(0xc4),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a128_0x52fe99(0xc9),'type':'string','required':!![],'description':a128_0x52fe99(0xc6)},SQLCODE_FLAG_OPTIONAL,{'name':a128_0x52fe99(0xd7),'type':a128_0x52fe99(0xcf),'description':a128_0x52fe99(0xdd)},{'name':'db','type':'string','description':a128_0x52fe99(0xd6)},{'name':a128_0x52fe99(0xd1),'type':'string','description':a128_0x52fe99(0xc7)}],async 'validate'(){const _0x546974=a128_0x52fe99;throw CliErrors[_0x546974(0xd8)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x40b44d=a128_0x52fe99;throw CliErrors[_0x40b44d(0xd8)](SQL_SAVE_DEPRECATED_HINT);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x484a9f=a129_0x155c;(function(_0x214955,_0xbe4aa1){const _0x4f8404=a129_0x155c,_0x160c29=_0x214955();while(!![]){try{const _0x493820=-parseInt(_0x4f8404(0xd0))/0x1*(-parseInt(_0x4f8404(0xbb))/0x2)+parseInt(_0x4f8404(0xc9))/0x3*(-parseInt(_0x4f8404(0xdc))/0x4)+parseInt(_0x4f8404(0xca))/0x5*(-parseInt(_0x4f8404(0xd3))/0x6)+parseInt(_0x4f8404(0xc5))/0x7+parseInt(_0x4f8404(0xbc))/0x8*(-parseInt(_0x4f8404(0xb7))/0x9)+parseInt(_0x4f8404(0xb6))/0xa+parseInt(_0x4f8404(0xda))/0xb;if(_0x493820===_0xbe4aa1)break;else _0x160c29['push'](_0x160c29['shift']());}catch(_0x2bc25e){_0x160c29['push'](_0x160c29['shift']());}}}(a129_0x44c6,0xdcc28));import{createInterface}from'node:readline';import{join}from'node:path';function a129_0x44c6(){const _0x2f8c30=['82512xWJtUQ','join','entries','stderr','1479238ZaVnJI','16VOmfBg','.rabetbase/sql','<!--\x20@lovrabet.','sqlRoot','mode','test','description','sqlName','filter','6149080srDqwS','mybatisXml','trim','lastSync','4923VQNwCk','598060fzeJmz','map','--\x20@lovrabet.','length','\x20-->','syncedAt','2zyBGea','stdin','dbId','24kTslqn','dbName','sqlCode','split','push','version','replace','730433ZJbCbw','close','3668ojlHmT','path','trimStart','question','includes','toLowerCase','endsWith','4817320YrvaUQ'];a129_0x44c6=function(){return _0x2f8c30;};return a129_0x44c6();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a129_0x484a9f(0xbd);export function buildSqlLockEntry(_0x13d3d8,_0x5691e2,_0x1db234,_0x3e19df){const _0x31c9f3=a129_0x484a9f,_0xc6d740=detectSqlMode(_0x5691e2);return{'path':buildSqlRelativePath(_0x13d3d8['sqlCode'],_0x13d3d8[_0x31c9f3(0xc3)],_0x3e19df?.[_0x31c9f3(0xd4)],_0xc6d740,_0x13d3d8['dbId']),'hash':_0x1db234,'remoteId':_0x13d3d8['id'],'version':_0x13d3d8[_0x31c9f3(0xd8)],'dbId':Number(_0x13d3d8[_0x31c9f3(0xd2)]),'dbName':_0x3e19df?.['dbName'],'sqlName':_0x13d3d8[_0x31c9f3(0xc3)],'sqlConfig':_0x13d3d8['sqlConfig']??undefined,'mode':_0xc6d740};}export function cloneSqlLockData(_0x3cb7b8){const _0x273585=a129_0x484a9f;return{'apps':Object['fromEntries'](Object[_0x273585(0xb9)](_0x3cb7b8['apps'])[_0x273585(0xcb)](([_0x3d62ee,_0x24573f])=>[_0x3d62ee,{'sqlRoot':_0x24573f[_0x273585(0xbf)],'lastSync':_0x24573f[_0x273585(0xc8)],'sqls':{..._0x24573f['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3dc8cb){return _0x3dc8cb['sqlContent']??'';}export function buildLocalSqlFileContent(_0x1e2364,_0x2bca9b,_0xf899a5){const _0x41b675=a129_0x484a9f,_0x34bbe2=_0xf899a5?.[_0x41b675(0xc0)]??detectSqlMode(_0x2bca9b),_0x2382c4=stripLocalSqlMetadata(_0x2bca9b,_0x34bbe2)['trim'](),_0x1c3f07=[...buildMetadataHeaderLines({'sqlCode':_0x1e2364['sqlCode'],'sqlName':_0x1e2364[_0x41b675(0xc3)],'dbId':_0x1e2364[_0x41b675(0xd2)],'dbName':_0xf899a5?.[_0x41b675(0xd4)],'mode':_0x34bbe2,'syncedAt':_0xf899a5?.[_0x41b675(0xcf)],'description':_0xf899a5?.[_0x41b675(0xc2)]},_0x34bbe2),'',_0x2382c4],_0x16d8e5=_0x1c3f07[_0x41b675(0xb8)]('\x0a');return _0x16d8e5[_0x41b675(0xb5)]('\x0a')?_0x16d8e5:_0x16d8e5+'\x0a';}export function stripLocalSqlMetadata(_0x3cf8bf,_0x606d9c){const _0x1dbe41=a129_0x484a9f,_0x4f0829=_0x3cf8bf[_0x1dbe41(0xd9)](/\r\n/g,'\x0a')[_0x1dbe41(0xd6)]('\x0a'),_0x361b0d=[];let _0x4a6b92=0x0;if(_0x606d9c===_0x1dbe41(0xc6))while(_0x4a6b92<_0x4f0829[_0x1dbe41(0xcd)]){const _0x37de5c=_0x4f0829[_0x4a6b92]??'';if(/^\s*<!--\s*@lovrabet\./[_0x1dbe41(0xc1)](_0x37de5c)){_0x4a6b92++;continue;}if(_0x37de5c[_0x1dbe41(0xc7)]()===''&&_0x4a6b92>0x0){_0x4a6b92++;continue;}break;}else while(_0x4a6b92<_0x4f0829[_0x1dbe41(0xcd)]){const _0x3e4d54=_0x4f0829[_0x4a6b92]??'';if(/^\s*--\s*@lovrabet\./[_0x1dbe41(0xc1)](_0x3e4d54)){_0x4a6b92++;continue;}if(_0x3e4d54[_0x1dbe41(0xc7)]()===''&&_0x4a6b92>0x0){_0x4a6b92++;continue;}break;}for(;_0x4a6b92<_0x4f0829['length'];_0x4a6b92++){_0x361b0d[_0x1dbe41(0xd7)](_0x4f0829[_0x4a6b92]);}return _0x361b0d[_0x1dbe41(0xb8)]('\x0a')[_0x1dbe41(0xde)]();}export function resolveSqlMode(_0x5a4bb7,_0xa85048){const _0x43dd8c=a129_0x484a9f;if(_0xa85048?.[_0x43dd8c(0xc0)])return _0xa85048[_0x43dd8c(0xc0)];return detectSqlMode(_0x5a4bb7);}export function resolveSqlFileName(_0xb0297e,_0x52e523,_0x3dc013){const _0x52c9f2=a129_0x484a9f;if(_0x3dc013?.['path'])return _0x3dc013[_0x52c9f2(0xdd)];if(_0x3dc013?.['sqlName']||_0x3dc013?.['dbName'])return buildSqlRelativePath(_0xb0297e,_0x3dc013?.[_0x52c9f2(0xc3)],_0x3dc013?.[_0x52c9f2(0xd4)],resolveSqlMode(_0x52e523,_0x3dc013),_0x3dc013?.[_0x52c9f2(0xd2)]);return buildDefaultSqlFileName(_0xb0297e,resolveSqlMode(_0x52e523,_0x3dc013));}export function resolveSqlLocalDir(_0x258aa9,_0xe93bb1){return join(_0x258aa9,SQL_LOCAL_REL_DIR,_0xe93bb1);}function a129_0x155c(_0x58e582,_0x1913ab){_0x58e582=_0x58e582-0xb5;const _0x44c63b=a129_0x44c6();let _0x155cee=_0x44c63b[_0x58e582];return _0x155cee;}export async function confirmForceOverwrite(_0x4f4041){const _0x4f48db=a129_0x484a9f,_0x50565d=createInterface({'input':process[_0x4f48db(0xd1)],'output':process[_0x4f48db(0xba)]}),_0x6f1f3a=await new Promise(_0x593a30=>{const _0x9bea3e=_0x4f48db;_0x50565d[_0x9bea3e(0xdf)](_0x4f4041+'\x20[y/N]\x20',_0x593a30);});return _0x50565d[_0x4f48db(0xdb)](),['y','yes'][_0x4f48db(0xe0)](_0x6f1f3a['trim']()[_0x4f48db(0xe1)]());}export function findSqlLockScope(_0x5acc21,_0x33ca26){return _0x5acc21['apps'][_0x33ca26];}function buildMetadataHeaderLines(_0x2945ed,_0x7dda9d){const _0x532b9e=a129_0x484a9f,_0x4aeefe=[['sqlCode',_0x2945ed[_0x532b9e(0xd5)]],[_0x532b9e(0xc3),_0x2945ed[_0x532b9e(0xc3)]],['dbId',_0x2945ed[_0x532b9e(0xd2)]],['dbName',_0x2945ed['dbName']],[_0x532b9e(0xc0),_0x2945ed[_0x532b9e(0xc0)]],['syncedAt',_0x2945ed['syncedAt']],[_0x532b9e(0xc2),_0x2945ed['description']]];if(_0x7dda9d==='mybatisXml')return _0x4aeefe[_0x532b9e(0xc4)](([,_0x3c04fc])=>_0x3c04fc!==undefined&&_0x3c04fc!==null&&String(_0x3c04fc)[_0x532b9e(0xc7)]()!=='')[_0x532b9e(0xcb)](([_0x12849f,_0x3806d1])=>_0x532b9e(0xbe)+_0x12849f+':\x20'+String(_0x3806d1)+_0x532b9e(0xce));return _0x4aeefe[_0x532b9e(0xc4)](([,_0x418fcd])=>_0x418fcd!==undefined&&_0x418fcd!==null&&String(_0x418fcd)[_0x532b9e(0xc7)]()!=='')['map'](([_0x5091d6,_0x1106a6])=>_0x532b9e(0xcc)+_0x5091d6+':\x20'+String(_0x1106a6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a130_0x2571c2=a130_0x102d;(function(_0x2c96fb,_0x18afad){const _0x2cef44=a130_0x102d,_0x2449cc=_0x2c96fb();while(!![]){try{const _0x18b460=parseInt(_0x2cef44(0x6d))/0x1+parseInt(_0x2cef44(0x6a))/0x2+-parseInt(_0x2cef44(0x6e))/0x3+-parseInt(_0x2cef44(0x6b))/0x4*(-parseInt(_0x2cef44(0x6c))/0x5)+-parseInt(_0x2cef44(0x88))/0x6*(parseInt(_0x2cef44(0x75))/0x7)+parseInt(_0x2cef44(0x87))/0x8*(-parseInt(_0x2cef44(0x73))/0x9)+-parseInt(_0x2cef44(0x79))/0xa*(-parseInt(_0x2cef44(0x81))/0xb);if(_0x18b460===_0x18afad)break;else _0x2449cc['push'](_0x2449cc['shift']());}catch(_0x5f59e0){_0x2449cc['push'](_0x2449cc['shift']());}}}(a130_0x4c9a,0x29327));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a130_0x102d(_0x38b0cb,_0x1a39e5){_0x38b0cb=_0x38b0cb-0x6a;const _0x4c9adc=a130_0x4c9a();let _0x102d52=_0x4c9adc[_0x38b0cb];return _0x102d52;}function a130_0x4c9a(){const _0x82f03c=['keys','length','bool','103522VTmyZF','156ziZtul','33810Fuiwak','209332eXmqiF','535533VhRXyY','filePath','boolean','appCode','lockKey','17307dIrxpF','path','70wpTxMd','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','status','lockFilePath','1209880nKTUub','paging','remote','push','sqlName','map','sqls','has','11UkfKNQ','sqlCode','\x20missing,\x20','\x20modified,\x20','\x20unchanged','hash','840OFELmW','57978qTMjEY','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','All\x20SQL\x20queries\x20are\x20in\x20sync.'];a130_0x4c9a=function(){return _0x82f03c;};return a130_0x4c9a();}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x5bf648){const _0x129a23=a130_0x102d,_0x6b7a52=[];let _0x4988a6=0x1;while(!![]){const _0x328a24=await listSqlQueries(_0x5bf648,{'currentPage':_0x4988a6,'pageSize':PAGE_SIZE}),_0x12b771=_0x328a24['tableData']??[];_0x6b7a52[_0x129a23(0x7c)](..._0x12b771[_0x129a23(0x7e)](_0x39071f=>_0x39071f[_0x129a23(0x82)]));if(_0x12b771[_0x129a23(0x8c)]===0x0)break;const _0x20b057=_0x328a24[_0x129a23(0x7a)]?.['totalCount'];if(_0x20b057!=null?_0x6b7a52[_0x129a23(0x8c)]>=_0x20b057:_0x12b771['length']<PAGE_SIZE)break;_0x4988a6++;}return _0x6b7a52;}export const sqlStatus={'service':'sql','command':a130_0x2571c2(0x77),'description':a130_0x2571c2(0x89),'risk':'read','flags':[{'name':a130_0x2571c2(0x7b),'type':a130_0x2571c2(0x70),'description':a130_0x2571c2(0x76)}],async 'execute'(_0x45569c){const _0x47b95e=a130_0x2571c2,_0x4ed22b=loadSqlProjectConfig(_0x45569c[_0x47b95e(0x71)]),_0x2d8eae=await readSqlLockFile(_0x4ed22b[_0x47b95e(0x78)]),{appLock:_0x32d40c}=ensureSqlLockScope(_0x2d8eae??createEmptySqlLock(),_0x4ed22b[_0x47b95e(0x71)],_0x4ed22b['sqlRoot'],_0x47b95e(0x77)),_0x49dced=await scanLocalSqlQueries(_0x4ed22b),_0x51453f=[],_0x4ef127=[],_0x54a8d9=[],_0x18d636=[],_0x533496=new Set(_0x49dced[_0x47b95e(0x7e)](_0xd23702=>_0xd23702[_0x47b95e(0x72)]));for(const _0x2199d2 of _0x49dced){const _0x54f72e=await computeSqlFileHash(_0x2199d2[_0x47b95e(0x6f)]),_0x467c58=_0x32d40c['sqls'][_0x2199d2['lockKey']],_0x209375=!!_0x467c58&&_0x467c58[_0x47b95e(0x74)]!==_0x2199d2['relativePath'],_0x23dfbf=!!_0x467c58&&!!_0x2199d2[_0x47b95e(0x7d)]&&_0x467c58['sqlName']!==_0x2199d2[_0x47b95e(0x7d)];if(!_0x467c58)_0x51453f[_0x47b95e(0x7c)](_0x2199d2[_0x47b95e(0x72)]);else _0x467c58[_0x47b95e(0x86)]!==_0x54f72e||_0x209375||_0x23dfbf?_0x4ef127[_0x47b95e(0x7c)](_0x2199d2[_0x47b95e(0x72)]):_0x54a8d9[_0x47b95e(0x7c)](_0x2199d2[_0x47b95e(0x72)]);}for(const _0x2d3876 of Object[_0x47b95e(0x8b)](_0x32d40c[_0x47b95e(0x7f)])){!_0x533496[_0x47b95e(0x80)](_0x2d3876)&&_0x18d636['push'](_0x2d3876);}const _0x3cf48c=[];if(_0x45569c[_0x47b95e(0x8d)](_0x47b95e(0x7b))){const _0x45e203=await fetchAllSqlCodes(_0x45569c[_0x47b95e(0x71)]);for(const _0x5938df of _0x45e203){!_0x533496[_0x47b95e(0x80)](_0x5938df)&&!_0x32d40c[_0x47b95e(0x7f)][_0x5938df]&&_0x3cf48c[_0x47b95e(0x7c)](_0x5938df);}}const _0x617360=_0x51453f[_0x47b95e(0x8c)]===0x0&&_0x4ef127[_0x47b95e(0x8c)]===0x0&&_0x18d636[_0x47b95e(0x8c)]===0x0&&_0x3cf48c[_0x47b95e(0x8c)]===0x0;return{'ok':!![],'data':{'added':_0x51453f,'modified':_0x4ef127,'missing':_0x18d636,'unchanged':_0x54a8d9,'remoteOnly':_0x3cf48c},'message':_0x617360?_0x47b95e(0x8a):_0x51453f[_0x47b95e(0x8c)]+'\x20added,\x20'+_0x4ef127[_0x47b95e(0x8c)]+_0x47b95e(0x84)+_0x18d636[_0x47b95e(0x8c)]+_0x47b95e(0x83)+_0x54a8d9[_0x47b95e(0x8c)]+_0x47b95e(0x85)+(_0x3cf48c[_0x47b95e(0x8c)]>0x0?',\x20'+_0x3cf48c[_0x47b95e(0x8c)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x1e7f26=a131_0x15bf;(function(_0x4afc22,_0x51bd8d){const _0x381ed3=a131_0x15bf,_0x10126f=_0x4afc22();while(!![]){try{const _0x598a90=-parseInt(_0x381ed3(0xbc))/0x1+parseInt(_0x381ed3(0x95))/0x2*(-parseInt(_0x381ed3(0x97))/0x3)+parseInt(_0x381ed3(0x96))/0x4*(parseInt(_0x381ed3(0x8c))/0x5)+-parseInt(_0x381ed3(0xb1))/0x6*(-parseInt(_0x381ed3(0xa0))/0x7)+parseInt(_0x381ed3(0x93))/0x8*(-parseInt(_0x381ed3(0xbb))/0x9)+parseInt(_0x381ed3(0xb6))/0xa*(parseInt(_0x381ed3(0x8e))/0xb)+-parseInt(_0x381ed3(0xac))/0xc*(parseInt(_0x381ed3(0xb7))/0xd);if(_0x598a90===_0x51bd8d)break;else _0x10126f['push'](_0x10126f['shift']());}catch(_0x5be2e6){_0x10126f['push'](_0x10126f['shift']());}}}(a131_0x11af,0xa3eb6));import{readFileSync,existsSync}from'node:fs';function a131_0x11af(){const _0x117abf=['str','schema:','tableName','119931GDgIpj','message','file','sqlType','flagMissing','toLowerCase','reason','fields','\x22\x20not\x20found\x20or\x20not\x20accessible','valid','string','Dataset\x20\x22','24ugvQWX','schemaWarnings','utf-8','map','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','138jZrCHP','sql','SQL\x20schema\x20validation','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','isArray','7420MVFkrB','4282187phmcVR','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','name','trim','9qvrEzH','96832mSwvph','parameters','tables','Table\x20\x22','8725ifDKVa','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','19228YlCviW','dbtableConfig','filter','schemas','validation','128032Goxush','validate','2TWalVf','192APgHHZ','995361TjiDsd','type','File\x20not\x20found:\x20','push','length','Provide\x20--file\x20or\x20--sql'];a131_0x11af=function(){return _0x117abf;};return a131_0x11af();}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetSupportsLocalDevelopment,filterDbBackedDatasets}from'../../commands/dataset/capability.js';function a131_0x15bf(_0x598255,_0x3795d9){_0x598255=_0x598255-0x89;const _0x11afad=a131_0x11af();let _0x15bfa0=_0x11afad[_0x598255];return _0x15bfa0;}export const sqlValidate={'service':a131_0x1e7f26(0xb2),'command':a131_0x1e7f26(0x94),'description':a131_0x1e7f26(0xb0),'risk':'read','flags':[{'name':a131_0x1e7f26(0xa2),'type':a131_0x1e7f26(0xaa),'description':a131_0x1e7f26(0xb4)},{'name':a131_0x1e7f26(0xb2),'type':a131_0x1e7f26(0xaa),'description':a131_0x1e7f26(0xb8)},{'name':a131_0x1e7f26(0x91),'type':a131_0x1e7f26(0xaa),'description':a131_0x1e7f26(0x8d)}],async 'execute'(_0x2d59d7){const _0x264042=a131_0x1e7f26,_0x239f9a=_0x2d59d7[_0x264042(0x9d)](_0x264042(0xa2)),_0x1ad5cd=_0x2d59d7['str']('sql');if(!_0x239f9a&&!_0x1ad5cd)throw CliErrors[_0x264042(0xa4)]('file',_0x264042(0x9c));let _0x5a74e0;if(_0x239f9a){const _0x1dce0a=resolve(process['cwd'](),_0x239f9a);if(!existsSync(_0x1dce0a))throw CliErrors[_0x264042(0x92)](_0x264042(0x99)+_0x1dce0a);_0x5a74e0=readFileSync(_0x1dce0a,_0x264042(0xae));}else _0x5a74e0=_0x1ad5cd;const _0x574914=validateSql(_0x5a74e0),_0x27df8c={'valid':_0x574914['valid'],'sqlType':_0x574914[_0x264042(0xa3)][_0x264042(0x98)],'isSelectOnly':_0x574914[_0x264042(0xa3)]['isSelectOnly'],'isDangerous':_0x574914[_0x264042(0xa3)]['isDangerous'],'tables':_0x574914[_0x264042(0x8a)],'parameters':_0x574914[_0x264042(0x89)],'message':_0x574914['message']};_0x574914[_0x264042(0xa3)]['reason']&&(_0x27df8c[_0x264042(0xa6)]=_0x574914[_0x264042(0xa3)][_0x264042(0xa6)]);const _0x54625b=_0x2d59d7[_0x264042(0x9d)](_0x264042(0x91));if(_0x54625b&&_0x574914[_0x264042(0xa9)]){const _0x28b44f=_0x54625b['split'](',')['map'](_0xccff8d=>_0xccff8d[_0x264042(0xba)]())[_0x264042(0x90)](Boolean),_0x395272=[],_0x1a08cd=filterDbBackedDatasets(await listDatasets(_0x2d59d7['appCode'])),_0xf6e3f2=new Map(_0x1a08cd[_0x264042(0xaf)](_0x336f08=>[_0x336f08['dbtableConfig']?.[_0x264042(0x9f)]?.[_0x264042(0xa5)](),_0x336f08]));for(const _0x452c9f of _0x574914[_0x264042(0x8a)]){const _0x13c1bb=_0xf6e3f2['get'](_0x452c9f[_0x264042(0xa5)]());!_0x13c1bb&&_0x395272[_0x264042(0x9a)](_0x264042(0x8b)+_0x452c9f+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x54b585 of _0x28b44f){let _0x1671dc;try{_0x1671dc=await getDatasetDetail(_0x54b585);}catch{_0x395272[_0x264042(0x9a)](_0x264042(0xab)+_0x54b585+_0x264042(0xa8));continue;}assertDatasetSupportsLocalDevelopment(_0x1671dc,_0x264042(0xb3));const _0x32f4d=Array[_0x264042(0xb5)](_0x1671dc[_0x264042(0xa7)])?_0x1671dc[_0x264042(0xa7)]:[],_0x23b945=new Set(_0x32f4d[_0x264042(0xaf)](_0x1622c1=>_0x1622c1[_0x264042(0xb9)]?.[_0x264042(0xa5)]())),_0xc4218b=_0x1671dc[_0x264042(0x8f)]?.['tableName']||_0x1671dc['tableName']||_0x54b585;_0x27df8c[_0x264042(0x9e)+_0xc4218b]={'code':_0x54b585,'tableName':_0xc4218b,'fieldCount':_0x23b945['size'],'fields':Array['from'](_0x23b945)};}_0x395272[_0x264042(0x9b)]>0x0&&(_0x27df8c[_0x264042(0xad)]=_0x395272);}return{'ok':_0x574914[_0x264042(0xa9)],'data':_0x27df8c,'message':_0x574914[_0x264042(0xa1)]};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x6e5e1e=a132_0x375c;(function(_0xf4de20,_0x2aa908){const _0x3e3dda=a132_0x375c,_0x110395=_0xf4de20();while(!![]){try{const _0x3a9bd8=-parseInt(_0x3e3dda(0x19a))/0x1+parseInt(_0x3e3dda(0x18f))/0x2+parseInt(_0x3e3dda(0x182))/0x3+-parseInt(_0x3e3dda(0x191))/0x4*(parseInt(_0x3e3dda(0x19c))/0x5)+parseInt(_0x3e3dda(0x189))/0x6+parseInt(_0x3e3dda(0x186))/0x7*(-parseInt(_0x3e3dda(0x190))/0x8)+-parseInt(_0x3e3dda(0x18b))/0x9*(-parseInt(_0x3e3dda(0x188))/0xa);if(_0x3a9bd8===_0x2aa908)break;else _0x110395['push'](_0x110395['shift']());}catch(_0x393c3c){_0x110395['push'](_0x110395['shift']());}}}(a132_0x2e7f,0x30eeb));function a132_0x375c(_0x18cff2,_0x563f27){_0x18cff2=_0x18cff2-0x182;const _0x2e7fed=a132_0x2e7f();let _0x375c25=_0x2e7fed[_0x18cff2];return _0x375c25;}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=[a132_0x6e5e1e(0x195),a132_0x6e5e1e(0x1a7),a132_0x6e5e1e(0x1a5),a132_0x6e5e1e(0x19e),'riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a132_0x6e5e1e(0x1a2),a132_0x6e5e1e(0x19b),a132_0x6e5e1e(0x1a5),a132_0x6e5e1e(0x19e),a132_0x6e5e1e(0x195),a132_0x6e5e1e(0x1a7),a132_0x6e5e1e(0x185)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x19e23d){return[..._0x19e23d]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x179140){const _0x5faeb1=a132_0x6e5e1e;return TOP_LEVEL_CONFIG_KEYS[_0x5faeb1(0x196)](_0x179140);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x573cba=a132_0x6e5e1e;return _0x573cba(0x199)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a132_0x6e5e1e(0x19b),'apiDir':'apiDir','cookie':a132_0x6e5e1e(0x195),'accessKey':a132_0x6e5e1e(0x1a7),'defaultFormat':'format','pageSize':a132_0x6e5e1e(0x19d),'riskLevel':a132_0x6e5e1e(0x1a6),'locale':a132_0x6e5e1e(0x1a5)};export function getAppProfileFlagDefs(){const _0x1be15c=a132_0x6e5e1e;return[{'name':'env','type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x1be15c(0x185),'type':_0x1be15c(0x194),'description':_0x1be15c(0x18a)},{'name':_0x1be15c(0x195),'type':_0x1be15c(0x194),'description':_0x1be15c(0x183),'hidden':!![]},{'name':'accessKey','type':_0x1be15c(0x194),'description':_0x1be15c(0x198),'hidden':!![]},{'name':_0x1be15c(0x184),'type':_0x1be15c(0x194),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x1be15c(0x19d),'type':_0x1be15c(0x192),'description':'Default\x20page\x20size'},{'name':_0x1be15c(0x1a6),'type':_0x1be15c(0x194),'description':_0x1be15c(0x18e),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x1be15c(0x1a5),'type':'string','description':_0x1be15c(0x1a0)}];}function a132_0x2e7f(){const _0x23e23d=['Risk\x20level','410470JbYZFq','1208TkBClV','19892OUJlmY','number','app','string','cookie','has','zh-CN','Access\x20key','Config\x20key\x20(','191239mmLABh','env','210OUsdpU','pageSize','format','length','Locale','defaultApp','appcode','trim','apps','locale','riskLevel','accessKey','880221LEmjbH','Auth\x20cookie','defaultFormat','apiDir','13944vWxJeQ','map','474680QOWqUA','2131284BPwtwo','API\x20directory\x20path','9EglSKX','inherit','en-US'];a132_0x2e7f=function(){return _0x23e23d;};return a132_0x2e7f();}export function collectAppProfileOverrides(_0x2fa780){const _0xa17e8d=a132_0x6e5e1e,_0x150b02={};for(const [_0x333205,_0x41036d]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x4946cc=_0x2fa780(_0x333205);if(!_0x4946cc)continue;_0x150b02[_0x41036d]=_0x41036d===_0xa17e8d(0x19d)?Number(_0x4946cc):_0x4946cc;}return _0x150b02;}export function buildAppProfileListFields(_0x183abf){const _0x38db3d=a132_0x6e5e1e;return{'env':_0x183abf['env']??null,'apiDir':_0x183abf[_0x38db3d(0x185)]??null,'hasCookie':!!_0x183abf[_0x38db3d(0x195)],'hasAccessKey':!!_0x183abf[_0x38db3d(0x1a7)],'format':_0x183abf[_0x38db3d(0x19e)]??null,'pageSize':_0x183abf[_0x38db3d(0x19d)]??null,'riskLevel':_0x183abf[_0x38db3d(0x1a6)]??null,'locale':_0x183abf[_0x38db3d(0x1a5)]??null};}export function buildAppDoctorFields(_0xf81ae1,_0x4a247c){const _0x2504f4=a132_0x6e5e1e;return{'env':{'value':_0xf81ae1[_0x2504f4(0x19b)]||_0x4a247c[_0x2504f4(0x19b)],'source':_0xf81ae1['env']?_0x2504f4(0x193):_0x2504f4(0x18c)},'apiDir':{'value':_0xf81ae1['apiDir']||_0x4a247c[_0x2504f4(0x185)],'source':_0xf81ae1[_0x2504f4(0x185)]?_0x2504f4(0x193):_0x2504f4(0x18c)},'cookie':{'value':_0xf81ae1['cookie']||_0x4a247c[_0x2504f4(0x195)],'source':_0xf81ae1[_0x2504f4(0x195)]?'app':_0x2504f4(0x18c)},'accessKey':{'value':_0xf81ae1['accessKey']||_0x4a247c[_0x2504f4(0x1a7)],'source':_0xf81ae1[_0x2504f4(0x1a7)]?'app':'inherit'}};}export function buildCanonicalAppConfig(_0xb171ba,_0x4affdf){const _0x2cae73=a132_0x6e5e1e,_0x350d08=_0xb171ba[_0x2cae73(0x187)](_0x329ab1=>String(_0x329ab1||'')[_0x2cae73(0x1a3)]())['filter'](Boolean);if(_0x350d08['length']===0x0)return{};const _0x469e22={};for(const _0x5f0ad2 of _0x350d08){_0x469e22[_0x5f0ad2]=_0x4affdf?{'appcode':_0x5f0ad2,'env':_0x4affdf}:{'appcode':_0x5f0ad2};}return{'apps':_0x469e22,'defaultApp':_0x350d08[0x0]};}export function buildCanonicalProjectConfig(_0x3535e7,_0x384fae){const _0x28a9eb=a132_0x6e5e1e,{appCodes:appCodes=[],env:_0x47f812,metadata:_0x41cb03}=_0x384fae,_0x54034d={..._0x3535e7,..._0x41cb03||{}};delete _0x54034d['appcode'],delete _0x54034d[_0x28a9eb(0x193)];if(_0x47f812)_0x54034d[_0x28a9eb(0x19b)]=_0x47f812;else!_0x54034d[_0x28a9eb(0x19b)]&&(_0x54034d[_0x28a9eb(0x19b)]=DEFAULT_CONFIG_VALUES[_0x28a9eb(0x19b)]);const _0x3fe6fb=buildCanonicalAppConfig(appCodes,_0x54034d[_0x28a9eb(0x19b)]);return Object['keys'](_0x3fe6fb)[_0x28a9eb(0x19f)]>0x0&&(_0x54034d['apps']=_0x3fe6fb[_0x28a9eb(0x1a4)],_0x54034d[_0x28a9eb(0x1a1)]=_0x3fe6fb['defaultApp']),_0x54034d;}const LOCALE_MAP={'zh':a132_0x6e5e1e(0x197),'zh-cn':'zh-CN','zh_cn':a132_0x6e5e1e(0x197),'en':a132_0x6e5e1e(0x18d),'en-us':a132_0x6e5e1e(0x18d),'en_us':a132_0x6e5e1e(0x18d)};export function normalizeLocale(_0x122292){if(!_0x122292)return null;return LOCALE_MAP[_0x122292['toLowerCase']()]??null;}
|
package/lib/constant/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x47f9b3=a133_0xdbd9;function a133_0x5a71(){const _0x25a086=['https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','864492kZjMeb','4RcrrcV','4689927MkxFqE','1330VIPrJe','3803525vMlKur','30zIVNIo','871923lbVOVt','1042440slQomw','600483lwNWGQ','2838dGQBnm'];a133_0x5a71=function(){return _0x25a086;};return a133_0x5a71();}function a133_0xdbd9(_0x580e6f,_0x2a4c7e){_0x580e6f=_0x580e6f-0x14f;const _0x5a71c2=a133_0x5a71();let _0xdbd906=_0x5a71c2[_0x580e6f];return _0xdbd906;}(function(_0x2e893b,_0x49f4a7){const _0x355806=a133_0xdbd9,_0x3d48b6=_0x2e893b();while(!![]){try{const _0x20dbdb=-parseInt(_0x355806(0x159))/0x1+parseInt(_0x355806(0x151))/0x2+-parseInt(_0x355806(0x157))/0x3+parseInt(_0x355806(0x152))/0x4*(-parseInt(_0x355806(0x155))/0x5)+parseInt(_0x355806(0x14f))/0x6*(-parseInt(_0x355806(0x154))/0x7)+parseInt(_0x355806(0x158))/0x8+parseInt(_0x355806(0x153))/0x9*(parseInt(_0x355806(0x156))/0xa);if(_0x20dbdb===_0x49f4a7)break;else _0x3d48b6['push'](_0x3d48b6['shift']());}catch(_0x24525b){_0x3d48b6['push'](_0x3d48b6['shift']());}}}(a133_0x5a71,0x5dca1));export const CLI_VERSION_POLICY_URL=a133_0x47f9b3(0x150);
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x53db81=a134_0x59e7;(function(_0x2239d1,_0x4e4d90){const _0x2f73cd=a134_0x59e7,_0x1ddfec=_0x2239d1();while(!![]){try{const _0x556375=-parseInt(_0x2f73cd(0xf9))/0x1+parseInt(_0x2f73cd(0x114))/0x2+-parseInt(_0x2f73cd(0x12f))/0x3*(-parseInt(_0x2f73cd(0x135))/0x4)+parseInt(_0x2f73cd(0x143))/0x5*(parseInt(_0x2f73cd(0x10d))/0x6)+parseInt(_0x2f73cd(0xef))/0x7*(-parseInt(_0x2f73cd(0x115))/0x8)+parseInt(_0x2f73cd(0x100))/0x9+-parseInt(_0x2f73cd(0xe3))/0xa;if(_0x556375===_0x4e4d90)break;else _0x1ddfec['push'](_0x1ddfec['shift']());}catch(_0x536c9e){_0x1ddfec['push'](_0x1ddfec['shift']());}}}(a134_0x3a18,0xcd23c));export const CLI_BIN_NAME=a134_0x53db81(0x10b);function a134_0x3a18(){const _0x3aa436=['Config\x20key','project','expected-count','sqlName','sql','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','all','expectedCount','Override\x20appcode','file','Skip\x20import\x20generation','Code\x20filter','description-file','params','Watch\x20mode','Select\x20app\x20profile\x20by\x20name','Title','verbose','114UFkCIG','Alias\x20for\x20--non-interactive','json\x20|\x20pretty\x20|\x20compress','string','skip-imports','Skip\x20confirmation\x20for\x20high-risk\x20writes','1124LqadCZ','Use\x20remote','title','map','DB\x20ID','nonInteractive','Enable\x20BFF\x20save','@lovrabet/rabetbase-cli','keyword','operation-type','Description\x20file','SQL\x20name','db-id','operationType','8272235FZYuOd','production\x20|\x20daily','sqlname','force','remote','skipImports','Confirm\x20destructive\x20action','Page\x20number','Show\x20help','<name>','Use\x20global\x20config\x20scope','Config\x20value','Clear','datasetcode','15577430Iwdqdb','description','dbId','confirm','type','Expected\x20affected\x20count','Apply\x20to\x20all','<code>','functionNode','Keyword\x20filter','dry-run','Verbose\x20output','7691411YMGKES','Force\x20non-interactive\x20mode\x20(CI)','SQL\x20code','Operation\x20type','target','boolean','Target\x20path','name','sqlcode','Environment','204548aufFas','sql-name','global','Dataset\x20code','env','function-node','dryRun','13298382YSrnUG','code','dbid','JSON\x20params','yes','value','Use\x20project\x20config\x20scope','SQL\x20string','enable-bff-save','page','Force\x20overwrite','rabetbase','Function\x20node','6KTjVVX','app','enableBffSave','key','clear','fromEntries','descriptionFile','1117186eOGAJM','8JBQWDp','schemas','non-interactive','format','appcode','output','Record\x20ID','Preview\x20operation\x20without\x20executing'];a134_0x3a18=function(){return _0x3aa436;};return a134_0x3a18();}export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';function a134_0x59e7(_0x354555,_0x9ee4a1){_0x354555=_0x354555-0xda;const _0x3a18e6=a134_0x3a18();let _0x59e758=_0x3a18e6[_0x354555];return _0x59e758;}export const NPM_PACKAGE_NAME=a134_0x53db81(0x13c);export const GLOBAL_FLAGS=[{'name':a134_0x53db81(0x119),'meowKey':'appcode','type':'string','description':a134_0x53db81(0x125),'hint':a134_0x53db81(0xea)},{'name':a134_0x53db81(0x10e),'meowKey':'app','type':a134_0x53db81(0x132),'description':a134_0x53db81(0x12c),'hint':a134_0x53db81(0xde)},{'name':a134_0x53db81(0xfd),'meowKey':a134_0x53db81(0xfd),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xf8),'hint':a134_0x53db81(0x144)},{'name':a134_0x53db81(0x118),'meowKey':'format','type':'string','description':'Output\x20format','hint':a134_0x53db81(0x131)},{'name':'jq','meowKey':'jq','type':a134_0x53db81(0x132),'description':a134_0x53db81(0x122),'hint':'<expr>'},{'name':a134_0x53db81(0xed),'meowKey':a134_0x53db81(0xff),'type':'boolean','description':a134_0x53db81(0x11c)},{'name':'yes','meowKey':a134_0x53db81(0x104),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0x134)},{'name':a134_0x53db81(0x117),'meowKey':a134_0x53db81(0x13a),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0xf0)},{'name':a134_0x53db81(0xfb),'meowKey':'global','type':'boolean','description':a134_0x53db81(0xdf)},{'name':a134_0x53db81(0x11e),'meowKey':a134_0x53db81(0x11e),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0x106)},{'name':'ci','meowKey':'ci','type':a134_0x53db81(0xf4),'description':a134_0x53db81(0x130),'hidden':!![]},{'name':'help','meowKey':'help','type':a134_0x53db81(0xf4),'description':a134_0x53db81(0xdd)},{'name':a134_0x53db81(0xf6),'meowKey':a134_0x53db81(0xf6),'type':a134_0x53db81(0x132),'description':'Name','hidden':!![]},{'name':'title','meowKey':a134_0x53db81(0x137),'type':'string','description':a134_0x53db81(0x12d),'hidden':!![]},{'name':a134_0x53db81(0x111),'meowKey':a134_0x53db81(0x111),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0xe1),'hidden':!![]},{'name':'watch','meowKey':'watch','type':'boolean','description':a134_0x53db81(0x12b),'hidden':!![]},{'name':'output','meowKey':a134_0x53db81(0x11a),'type':a134_0x53db81(0x132),'description':'Output\x20path','hidden':!![]},{'name':a134_0x53db81(0x12a),'meowKey':a134_0x53db81(0x12a),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0x103),'hidden':!![]},{'name':'datasetcode','meowKey':a134_0x53db81(0xe2),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xfc),'hidden':!![]},{'name':a134_0x53db81(0x123),'meowKey':a134_0x53db81(0x123),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0xe9),'hidden':!![]},{'name':a134_0x53db81(0x108),'meowKey':a134_0x53db81(0x10f),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0x13b),'hidden':!![]},{'name':'id','meowKey':'id','type':'string','description':a134_0x53db81(0x11b),'hidden':!![]},{'name':'type','meowKey':a134_0x53db81(0xe7),'type':a134_0x53db81(0x132),'description':'Type\x20filter','hidden':!![]},{'name':a134_0x53db81(0x126),'meowKey':'file','type':'string','description':'File\x20path','hidden':!![]},{'name':a134_0x53db81(0xf7),'meowKey':a134_0x53db81(0xf7),'type':'string','description':a134_0x53db81(0xf1),'hidden':!![]},{'name':a134_0x53db81(0xfa),'meowKey':a134_0x53db81(0x120),'type':'string','description':a134_0x53db81(0x140),'hidden':!![]},{'name':a134_0x53db81(0x145),'meowKey':a134_0x53db81(0x145),'type':'string','description':a134_0x53db81(0x140),'hidden':!![]},{'name':a134_0x53db81(0x141),'meowKey':a134_0x53db81(0xe5),'type':'string','description':a134_0x53db81(0x139),'hidden':!![]},{'name':a134_0x53db81(0x102),'meowKey':a134_0x53db81(0x102),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0x139),'hidden':!![]},{'name':a134_0x53db81(0xe4),'meowKey':a134_0x53db81(0xe4),'type':'string','description':'Description','hidden':!![]},{'name':a134_0x53db81(0x129),'meowKey':a134_0x53db81(0x113),'type':'string','description':a134_0x53db81(0x13f),'hidden':!![]},{'name':a134_0x53db81(0x109),'meowKey':a134_0x53db81(0x109),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xdc),'hidden':!![]},{'name':'pagesize','meowKey':'pagesize','type':'string','description':'Page\x20size','hidden':!![]},{'name':'keyword','meowKey':a134_0x53db81(0x13d),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xec),'hidden':!![]},{'name':a134_0x53db81(0x101),'meowKey':a134_0x53db81(0x101),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0x128),'hidden':!![]},{'name':a134_0x53db81(0x121),'meowKey':'sql','type':a134_0x53db81(0x132),'description':a134_0x53db81(0x107),'hidden':!![]},{'name':'schemas','meowKey':a134_0x53db81(0x116),'type':a134_0x53db81(0x132),'description':'Schemas','hidden':!![]},{'name':'operation','meowKey':'operation','type':'string','description':'Operation\x20type','hidden':!![]},{'name':a134_0x53db81(0xf3),'meowKey':a134_0x53db81(0xf3),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xf5),'hidden':!![]},{'name':a134_0x53db81(0x133),'meowKey':a134_0x53db81(0xda),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0x127),'hidden':!![]},{'name':a134_0x53db81(0x110),'meowKey':a134_0x53db81(0x110),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0x11d),'hidden':!![]},{'name':'value','meowKey':a134_0x53db81(0x105),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xe0),'hidden':!![]},{'name':'force','meowKey':a134_0x53db81(0x146),'type':a134_0x53db81(0xf4),'description':a134_0x53db81(0x10a),'hidden':!![]},{'name':a134_0x53db81(0xe6),'meowKey':'confirm','type':a134_0x53db81(0xf4),'description':a134_0x53db81(0xdb),'hidden':!![]},{'name':a134_0x53db81(0x147),'meowKey':a134_0x53db81(0x147),'type':'boolean','description':a134_0x53db81(0x136),'hidden':!![]},{'name':'verbose','meowKey':a134_0x53db81(0x12e),'type':'boolean','description':a134_0x53db81(0xee),'hidden':!![]},{'name':a134_0x53db81(0x11f),'meowKey':a134_0x53db81(0x124),'type':a134_0x53db81(0x132),'description':a134_0x53db81(0xe8),'hidden':!![]},{'name':a134_0x53db81(0x13e),'meowKey':a134_0x53db81(0x142),'type':'string','description':a134_0x53db81(0xf2),'hidden':!![]},{'name':a134_0x53db81(0xfe),'meowKey':a134_0x53db81(0xeb),'type':'string','description':a134_0x53db81(0x10c),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a134_0x53db81(0x119),a134_0x53db81(0x10e),a134_0x53db81(0xfd),a134_0x53db81(0x118),'jq',a134_0x53db81(0xed),'yes',a134_0x53db81(0x117),'ci']);export function buildMeowFlags(){const _0x10da17=a134_0x53db81;return Object[_0x10da17(0x112)](GLOBAL_FLAGS[_0x10da17(0x138)](_0x1f39a8=>[_0x1f39a8['meowKey'],{'type':_0x1f39a8[_0x10da17(0xe7)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a135_0x2fc5d1=a135_0x37bf;(function(_0x414d9c,_0xdf2a38){const _0x36ef7d=a135_0x37bf,_0x56cfb7=_0x414d9c();while(!![]){try{const _0x1fe8c4=-parseInt(_0x36ef7d(0x13c))/0x1*(parseInt(_0x36ef7d(0x134))/0x2)+-parseInt(_0x36ef7d(0x135))/0x3*(-parseInt(_0x36ef7d(0x13b))/0x4)+-parseInt(_0x36ef7d(0x133))/0x5*(parseInt(_0x36ef7d(0x130))/0x6)+parseInt(_0x36ef7d(0x13a))/0x7*(parseInt(_0x36ef7d(0x138))/0x8)+parseInt(_0x36ef7d(0x139))/0x9+-parseInt(_0x36ef7d(0x136))/0xa*(parseInt(_0x36ef7d(0x13d))/0xb)+parseInt(_0x36ef7d(0x137))/0xc;if(_0x1fe8c4===_0xdf2a38)break;else _0x56cfb7['push'](_0x56cfb7['shift']());}catch(_0x9486cd){_0x56cfb7['push'](_0x56cfb7['shift']());}}}(a135_0x3a9c,0xd41e4));function a135_0x37bf(_0x58c25c,_0x3348f6){_0x58c25c=_0x58c25c-0x12f;const _0x3a9c73=a135_0x3a9c();let _0x37bf69=_0x3a9c73[_0x58c25c];return _0x37bf69;}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a135_0x2fc5d1(0x12f),'format':a135_0x2fc5d1(0x132),'locale':a135_0x2fc5d1(0x131),'riskLevel':'high-risk-write','apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a135_0x2fc5d1(0x132);function a135_0x3a9c(){const _0x5d2ab5=['176FIjgrg','14390622RLRdaO','86611xmDsBv','4XHaTAo','30361mhYwSf','15898905zsBuzt','production','246kYOlBm','en-US','compress','131595vyhete','66QrunPP','675321eYqzhx','10OiNiYm','27586944PXZBnv'];a135_0x3a9c=function(){return _0x5d2ab5;};return a135_0x3a9c();}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x37ebdf=a136_0x3c00;function a136_0x3c00(_0x245c14,_0x50e5ed){_0x245c14=_0x245c14-0x91;const _0x5c696d=a136_0x5c69();let _0x3c0029=_0x5c696d[_0x245c14];return _0x3c0029;}(function(_0x50b6c2,_0x25d799){const _0x3ce274=a136_0x3c00,_0x5d6104=_0x50b6c2();while(!![]){try{const _0x52dcc5=-parseInt(_0x3ce274(0x97))/0x1*(parseInt(_0x3ce274(0x95))/0x2)+parseInt(_0x3ce274(0x9a))/0x3+-parseInt(_0x3ce274(0x9c))/0x4*(-parseInt(_0x3ce274(0xa2))/0x5)+parseInt(_0x3ce274(0x9f))/0x6+parseInt(_0x3ce274(0x9b))/0x7*(-parseInt(_0x3ce274(0xa0))/0x8)+-parseInt(_0x3ce274(0x91))/0x9*(-parseInt(_0x3ce274(0xa1))/0xa)+-parseInt(_0x3ce274(0x92))/0xb*(parseInt(_0x3ce274(0x9d))/0xc);if(_0x52dcc5===_0x25d799)break;else _0x5d6104['push'](_0x5d6104['shift']());}catch(_0x1cb7bb){_0x5d6104['push'](_0x5d6104['shift']());}}}(a136_0x5c69,0x4cdf8));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x3042b7){const _0x7517e7=a136_0x3c00;customApiDomain=_0x3042b7?.[_0x7517e7(0x94)],customUserDomain=_0x3042b7?.[_0x7517e7(0x9e)],customRuntimeDomain=_0x3042b7?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a136_0x37ebdf(0x99):'https://user-daily.lovrabet.com');function a136_0x5c69(){const _0x47f1d7=['https://runtime.lovrabet.com','apiDomain','783490qnfnJS','https://daily-runtime.lovrabet.com','1cjsYsi','https://api.lovrabet.com','https://user.lovrabet.com','550692dxaoek','24486TLtXRR','28pWjNEj','420EgQJdz','userDomain','3663618CVDVau','248Mpypkf','3632020LSYYAv','715cwjEuM','https://daily-api.lovrabet.com','9YxUWAc','107899lIZBKT'];a136_0x5c69=function(){return _0x47f1d7;};return a136_0x5c69();}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a136_0x37ebdf(0x98):a136_0x37ebdf(0xa3));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a136_0x37ebdf(0x93):a136_0x37ebdf(0x96));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a137_0x497e84=a137_0x4419;(function(_0x13667e,_0xb49e55){const _0xe61a79=a137_0x4419,_0x4a5b22=_0x13667e();while(!![]){try{const _0x374216=parseInt(_0xe61a79(0xf7))/0x1+-parseInt(_0xe61a79(0xf0))/0x2*(-parseInt(_0xe61a79(0xfa))/0x3)+parseInt(_0xe61a79(0xec))/0x4+parseInt(_0xe61a79(0xed))/0x5+parseInt(_0xe61a79(0xf9))/0x6*(-parseInt(_0xe61a79(0xf5))/0x7)+parseInt(_0xe61a79(0xef))/0x8*(parseInt(_0xe61a79(0xf1))/0x9)+parseInt(_0xe61a79(0xf4))/0xa*(-parseInt(_0xe61a79(0xee))/0xb);if(_0x374216===_0xb49e55)break;else _0x4a5b22['push'](_0x4a5b22['shift']());}catch(_0x441a2d){_0x4a5b22['push'](_0x4a5b22['shift']());}}}(a137_0x2dbc,0x646a2));export const RABETBASE_ENV_VALUES=[a137_0x497e84(0xf2),a137_0x497e84(0xf6)];function a137_0x4419(_0x4a7367,_0x416e9c){_0x4a7367=_0x4a7367-0xec;const _0x2dbcec=a137_0x2dbc();let _0x4419c7=_0x2dbcec[_0x4a7367];return _0x4419c7;}export function normalizeEnv(_0x146495){const _0x109ff4=a137_0x497e84;return _0x146495==='online'?_0x109ff4(0xf2):_0x146495;}export function isProduction(_0x4ca1c7){const _0x5a907b=a137_0x497e84;return normalizeEnv(_0x4ca1c7)===_0x5a907b(0xf2);}export function isDaily(_0x281302){const _0x5001d5=a137_0x497e84;return normalizeEnv(_0x281302)===_0x5001d5(0xf6);}export function isDev(_0x88eb21){const _0x523ce0=a137_0x497e84,_0x4b2a6a=normalizeEnv(_0x88eb21);return _0x4b2a6a===_0x523ce0(0xf8)||_0x4b2a6a===_0x523ce0(0xf3);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');function a137_0x2dbc(){const _0x34bd72=['production','dev','121890LKfUML','446509sNbNnH','daily','363956tvQHUC','development','18sVfKsb','3MoteSA','1399544oIouMu','2744325IJmiwK','1573LIqslV','47336ojpVTr','615704DHzuTN','1179XVZUXc'];a137_0x2dbc=function(){return _0x34bd72;};return a137_0x2dbc();}export function getEnv(){return env;}export function initEnv(_0x449a49){env=normalizeEnv(_0x449a49);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a138_0x14eda5=a138_0x3b44;function a138_0x3b44(_0x2158b5,_0x50226a){_0x2158b5=_0x2158b5-0x78;const _0x2918d9=a138_0x2918();let _0x3b4465=_0x2918d9[_0x2158b5];return _0x3b4465;}(function(_0x44a7ae,_0xbae38f){const _0xe2e99e=a138_0x3b44,_0x23733b=_0x44a7ae();while(!![]){try{const _0x3b38c0=parseInt(_0xe2e99e(0x7c))/0x1*(-parseInt(_0xe2e99e(0x7f))/0x2)+-parseInt(_0xe2e99e(0x7d))/0x3+-parseInt(_0xe2e99e(0x7a))/0x4*(-parseInt(_0xe2e99e(0x80))/0x5)+parseInt(_0xe2e99e(0x7e))/0x6+-parseInt(_0xe2e99e(0x78))/0x7+parseInt(_0xe2e99e(0x7b))/0x8+parseInt(_0xe2e99e(0x81))/0x9;if(_0x3b38c0===_0xbae38f)break;else _0x23733b['push'](_0x23733b['shift']());}catch(_0x546e09){_0x23733b['push'](_0x23733b['shift']());}}}(a138_0x2918,0xcf95e));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a138_0x14eda5(0x79),'pretty',a138_0x14eda5(0x82)];function a138_0x2918(){const _0x390836=['4644291rCRZHx','6309120HpPvAB','11226OWlXFs','5537395cbjoQR','9188883bxzIMe','compress','5086193wUDeuj','json','4ISyOPN','10336800JMnrVE','240CKfkHy'];a138_0x2918=function(){return _0x390836;};return a138_0x2918();}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a139_0x4ad9(){const _0x472114=['28808334tqZxqV','13272wnDFps','54817IwLIaV','1576NNBVqZ','1178736EpAyjn','4634090bghuDU','./src/api','1752684HcOSaI','2321632gYHtpR','1362UblALp'];a139_0x4ad9=function(){return _0x472114;};return a139_0x4ad9();}const a139_0x87e454=a139_0x36d8;(function(_0x51c4d2,_0x2c84a7){const _0x5d4166=a139_0x36d8,_0x5e5a35=_0x51c4d2();while(!![]){try{const _0x247adb=parseInt(_0x5d4166(0xeb))/0x1+-parseInt(_0x5d4166(0xef))/0x2+parseInt(_0x5d4166(0xf0))/0x3*(-parseInt(_0x5d4166(0xf2))/0x4)+parseInt(_0x5d4166(0xec))/0x5+-parseInt(_0x5d4166(0xee))/0x6+-parseInt(_0x5d4166(0xe9))/0x7*(parseInt(_0x5d4166(0xea))/0x8)+parseInt(_0x5d4166(0xf1))/0x9;if(_0x247adb===_0x2c84a7)break;else _0x5e5a35['push'](_0x5e5a35['shift']());}catch(_0xeaf582){_0x5e5a35['push'](_0x5e5a35['shift']());}}}(a139_0x4ad9,0xc4677));function a139_0x36d8(_0x2ed487,_0x504036){_0x2ed487=_0x2ed487-0xe9;const _0x4ad9b3=a139_0x4ad9();let _0x36d89d=_0x4ad9b3[_0x2ed487];return _0x36d89d;}export const DEFAULT_API_DIR=a139_0x87e454(0xed);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a140_0x594ac3=a140_0x5675;function a140_0x13dc(){const _0x3ce813=['5yHVDpB','2049072DawYIJ','5918000iFNuGu','high-risk-write','5334imllNg','8EqpusV','1504557imvsje','231831CcJGGj','write','4QjzJdP','6dOfqbx','3534846tQiyHg','4167870VEvcuY'];a140_0x13dc=function(){return _0x3ce813;};return a140_0x13dc();}(function(_0x3d5a94,_0x245c59){const _0x473e3c=a140_0x5675,_0x15b336=_0x3d5a94();while(!![]){try{const _0x55aed2=-parseInt(_0x473e3c(0x9d))/0x1*(-parseInt(_0x473e3c(0x97))/0x2)+parseInt(_0x473e3c(0x99))/0x3*(-parseInt(_0x473e3c(0x9c))/0x4)+parseInt(_0x473e3c(0xa0))/0x5*(parseInt(_0x473e3c(0x94))/0x6)+-parseInt(_0x473e3c(0x9e))/0x7+-parseInt(_0x473e3c(0x98))/0x8*(parseInt(_0x473e3c(0x9a))/0x9)+parseInt(_0x473e3c(0x9f))/0xa+parseInt(_0x473e3c(0x95))/0xb;if(_0x55aed2===_0x245c59)break;else _0x15b336['push'](_0x15b336['shift']());}catch(_0x47c5a8){_0x15b336['push'](_0x15b336['shift']());}}}(a140_0x13dc,0x445ed));function a140_0x5675(_0x49b5ac,_0x52b879){_0x49b5ac=_0x49b5ac-0x94;const _0x13dc27=a140_0x13dc();let _0x567524=_0x13dc27[_0x49b5ac];return _0x567524;}export const RISK_LEVEL_VALUES=['read',a140_0x594ac3(0x9b),a140_0x594ac3(0x96)];
|