@lovrabet/rabetbase-cli 2.0.2-beta.2 → 2.0.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ai-setup/config.js +1 -1
- 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/is-session-valid.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/doc.js +1 -0
- package/lib/commands/api/index.js +1 -0
- package/lib/commands/api/list.js +1 -0
- package/lib/commands/api/pull.js +1 -0
- package/lib/commands/app.js +1 -1
- package/lib/commands/auth.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/new.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/build.js +1 -1
- package/lib/commands/cli-update.js +1 -0
- 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/flags.js +1 -0
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.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/doctor.js +1 -0
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/mcp.js +1 -1
- package/lib/commands/menu/index.js +1 -0
- package/lib/commands/menu/shared/compare-table.js +1 -0
- package/lib/commands/menu/shared/index.js +1 -0
- package/lib/commands/menu/shared/inquirer.js +1 -0
- package/lib/commands/menu/shared/local-pages.js +1 -0
- package/lib/commands/menu/shared/logic.js +1 -0
- package/lib/commands/menu/shared/service.js +1 -0
- package/lib/commands/menu/shared/sync-core.js +1 -0
- package/lib/commands/menu/shared/update-core.js +1 -0
- package/lib/commands/menu/shared/valid-url.js +1 -0
- package/lib/commands/menu/sync.js +1 -0
- package/lib/commands/menu/update.js +1 -0
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.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/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.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/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.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.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.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/config.js +1 -1
- package/lib/utils/copy-directory.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/logger.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/package.json +5 -2
- package/templates/generate-api/api.ts.tpl +4 -4
- package/templates/generate-api/client.ts.tpl +2 -2
- package/lib/api/api-doc-ui.js +0 -1
- package/lib/api/api-pull-ui.js +0 -1
- package/lib/api/main.js +0 -1
- package/lib/api/pull-silent.js +0 -1
- package/lib/app-menu/app-menu-sync-ui.js +0 -1
- package/lib/app-menu/create-menu.js +0 -1
- package/lib/app-menu/get-local-pages.js +0 -1
- package/lib/app-menu/get-online-menu-list.js +0 -1
- package/lib/app-menu/types.js +0 -1
- package/lib/app-menu/use-get-online-menu-list.js +0 -1
- package/lib/app-menu/utils.js +0 -1
- package/lib/app-menu/valid-url.js +0 -1
- package/lib/app-menu-update-cdn/current-content.js +0 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +0 -1
- package/lib/app-menu-update-cdn/main.js +0 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
- package/lib/commands/api.js +0 -1
- package/lib/commands/menu.js +0 -1
- /package/lib/{app-menu-update-cdn → commands/menu/shared}/types.js +0 -0
package/lib/commands/run.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a60_0x521f(){const _0x24c952=['.bin','(none)','pnpm','yarn.lock','--watch','bun','bun.lock','33eHLxgp','dev','3288XtaJLP','\x0a\x20\x20Available\x20scripts:\x0a','916095mfQKpH','parse','Run\x20a\x20package.json\x20script','package.json','inherit','env','preview\x20--watch\x20mode:\x20vite\x20build\x20--watch\x20+\x20vite\x20preview','6562yHZUZD','run','has','logger','preview','slice','vite','Error:\x20No\x20package.json\x20found\x20in\x20current\x20directory.','entries','needsUpgrade','pnpm-lock.yaml','build','No\x20scripts\x20defined\x20in\x20package.json.','node_modules','704200IzOvzJ','scripts','start','\x20exited\x20with\x20code\x20','log','keys','cwd','\x20\x20Available:\x20','PATH','9481887tAossU','3388NKOgLp','length','error','\x22\x20not\x20found\x20in\x20package.json.\x0a','\x20run\x20','info','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','1845940LmTMRv','utf-8','2892568rIesyt','npm','padEnd','all','exit','close','join'];a60_0x521f=function(){return _0x24c952;};return a60_0x521f();}const a60_0x793158=a60_0x5507;(function(_0x51a2d7,_0x1f8b55){const _0x3588ec=a60_0x5507,_0x47d1da=_0x51a2d7();while(!![]){try{const _0x5bf588=parseInt(_0x3588ec(0x1d4))/0x1*(-parseInt(_0x3588ec(0x1df))/0x2)+-parseInt(_0x3588ec(0x1d8))/0x3+-parseInt(_0x3588ec(0x1b3))/0x4+parseInt(_0x3588ec(0x1c4))/0x5+parseInt(_0x3588ec(0x1d6))/0x6*(-parseInt(_0x3588ec(0x1bd))/0x7)+-parseInt(_0x3588ec(0x1c6))/0x8+parseInt(_0x3588ec(0x1bc))/0x9;if(_0x5bf588===_0x1f8b55)break;else _0x47d1da['push'](_0x47d1da['shift']());}catch(_0x348cc0){_0x47d1da['push'](_0x47d1da['shift']());}}}(a60_0x521f,0x325a0));import{readFileSync,existsSync}from'node:fs';import{resolve,delimiter,join}from'node:path';function a60_0x5507(_0x2ee634,_0x3c1a34){_0x2ee634=_0x2ee634-0x1a7;const _0x521fc6=a60_0x521f();let _0x5507bc=_0x521fc6[_0x2ee634];return _0x5507bc;}import{spawn}from'node:child_process';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a60_0x793158(0x1b5),a60_0x793158(0x1d5)]);function readPackageScripts(_0x58c385){const _0x29ebc6=a60_0x793158,_0x4bf79c=resolve(_0x58c385,_0x29ebc6(0x1db));if(!existsSync(_0x4bf79c))return null;try{const _0x35fe56=JSON[_0x29ebc6(0x1d9)](readFileSync(_0x4bf79c,_0x29ebc6(0x1c5)));return _0x35fe56[_0x29ebc6(0x1b4)]??{};}catch{return null;}}function detectPackageManager(_0x24786a){const _0x1a82bf=a60_0x793158;if(existsSync(resolve(_0x24786a,'bun.lockb'))||existsSync(resolve(_0x24786a,_0x1a82bf(0x1d3))))return _0x1a82bf(0x1d2);if(existsSync(resolve(_0x24786a,_0x1a82bf(0x1af))))return _0x1a82bf(0x1cf);if(existsSync(resolve(_0x24786a,_0x1a82bf(0x1d0))))return'yarn';return _0x1a82bf(0x1c7);}async function versionCheck(_0x36814d){const _0x5d7c8c=a60_0x793158,_0x277580=await checkCliVersion();if(_0x277580[_0x5d7c8c(0x1ae)])printCliUpgradeWarning(_0x277580);const _0x7a6476=await checkSdkVersion(_0x36814d);if(_0x7a6476[_0x5d7c8c(0x1ae)])printSdkUpgradeWarning(_0x7a6476);}function spawnScript(_0x43a696,_0x228435,_0x15a6a9,_0x23e4a4){return new Promise((_0x1db5a1,_0x1d05af)=>{const _0x244efa=a60_0x5507,_0x46cf30=[_0x244efa(0x1e0),_0x228435,..._0x15a6a9],_0x7b0871=spawn(_0x43a696,_0x46cf30,{'cwd':_0x23e4a4,'stdio':_0x244efa(0x1dc),'shell':!![],'env':{...process[_0x244efa(0x1dd)],'PATH':''+join(_0x23e4a4,_0x244efa(0x1b2),_0x244efa(0x1cd))+delimiter+process['env'][_0x244efa(0x1bb)]}});_0x7b0871['on'](_0x244efa(0x1cb),_0x55f2b6=>{const _0x42a49e=_0x244efa;if(_0x55f2b6===0x0||_0x55f2b6===null)_0x1db5a1();else _0x1d05af(new Error(_0x43a696+_0x42a49e(0x1c1)+_0x228435+_0x42a49e(0x1b6)+_0x55f2b6));}),_0x7b0871['on'](_0x244efa(0x1bf),_0x1d05af);});}function spawnViteBuildWatch(_0x533ac4){return new Promise((_0xafda8d,_0x40b60b)=>{const _0x59facb=a60_0x5507,_0xeefb5d=spawn(_0x59facb(0x1ab),[_0x59facb(0x1b0),_0x59facb(0x1d1)],{'cwd':_0x533ac4,'stdio':_0x59facb(0x1dc),'shell':!![],'env':{...process['env'],'PATH':''+join(_0x533ac4,'node_modules',_0x59facb(0x1cd))+delimiter+process[_0x59facb(0x1dd)][_0x59facb(0x1bb)]}});_0xeefb5d['on'](_0x59facb(0x1cb),_0x54a7fb=>{const _0x978020=_0x59facb;if(_0x54a7fb===0x0||_0x54a7fb===null)_0xafda8d();else _0x40b60b(new Error(_0x978020(0x1c3)+_0x54a7fb));}),_0xeefb5d['on'](_0x59facb(0x1bf),_0x40b60b);});}function spawnVitePreview(_0x54d2e6){return new Promise((_0x555efc,_0x4eb6c4)=>{const _0x5f3256=a60_0x5507,_0x55f376=spawn(_0x5f3256(0x1ab),[_0x5f3256(0x1a9)],{'cwd':_0x54d2e6,'stdio':_0x5f3256(0x1dc),'shell':!![],'env':{...process[_0x5f3256(0x1dd)],'PATH':''+join(_0x54d2e6,_0x5f3256(0x1b2),_0x5f3256(0x1cd))+delimiter+process[_0x5f3256(0x1dd)][_0x5f3256(0x1bb)]}});_0x55f376['on']('close',_0x9df147=>{if(_0x9df147===0x0||_0x9df147===null)_0x555efc();else _0x4eb6c4(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x9df147));}),_0x55f376['on'](_0x5f3256(0x1bf),_0x4eb6c4);});}export const runCommand={'name':a60_0x793158(0x1e0),'description':a60_0x793158(0x1da),async 'run'(_0x231c77,_0x4378e4,_0x572bd9){const _0x60c0b3=a60_0x793158,_0x23e286=process[_0x60c0b3(0x1b9)](),_0x4714c2=_0x4378e4[0x0],_0x3dacbc=_0x4378e4[_0x60c0b3(0x1aa)](0x1),_0x65a820=readPackageScripts(_0x23e286);!_0x65a820&&(console['error'](_0x60c0b3(0x1ac)),process[_0x60c0b3(0x1ca)](0x1));if(!_0x4714c2){const _0x384f2c=Object[_0x60c0b3(0x1b8)](_0x65a820);if(_0x384f2c[_0x60c0b3(0x1be)]===0x0)console[_0x60c0b3(0x1b7)](_0x60c0b3(0x1b1));else{console[_0x60c0b3(0x1b7)](_0x60c0b3(0x1d7));const _0x3cb8b7=Math['max'](..._0x384f2c['map'](_0x201c24=>_0x201c24[_0x60c0b3(0x1be)]));for(const [_0x1ca4da,_0x39e5e1]of Object[_0x60c0b3(0x1ad)](_0x65a820)){console['log']('\x20\x20\x20\x20'+_0x1ca4da[_0x60c0b3(0x1c8)](_0x3cb8b7+0x2)+_0x39e5e1);}console[_0x60c0b3(0x1b7)]('\x0a\x20\x20Usage:\x20rabetbase\x20run\x20<script>\x0a');}return;}!_0x65a820[_0x4714c2]&&(console['error']('Error:\x20Script\x20\x22'+_0x4714c2+_0x60c0b3(0x1c0)+(_0x60c0b3(0x1ba)+(Object[_0x60c0b3(0x1b8)](_0x65a820)[_0x60c0b3(0x1cc)](',\x20')||_0x60c0b3(0x1ce)))),process[_0x60c0b3(0x1ca)](0x1));const _0x21b5a7=detectPackageManager(_0x23e286);VERSION_CHECK_SCRIPTS[_0x60c0b3(0x1a7)](_0x4714c2)&&await versionCheck(_0x23e286);if(_0x4714c2==='preview'&&_0x572bd9['watch']){_0x231c77[_0x60c0b3(0x1a8)][_0x60c0b3(0x1c2)]('run',_0x60c0b3(0x1de)),await Promise[_0x60c0b3(0x1c9)]([spawnViteBuildWatch(_0x23e286),spawnVitePreview(_0x23e286)]);return;}_0x231c77[_0x60c0b3(0x1a8)]['info'](_0x60c0b3(0x1e0),_0x21b5a7+_0x60c0b3(0x1c1)+_0x4714c2+(_0x3dacbc[_0x60c0b3(0x1be)]?'\x20'+_0x3dacbc['join']('\x20'):'')),await spawnScript(_0x21b5a7,_0x4714c2,_0x3dacbc,_0x23e286);}};
|
package/lib/commands/skill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x523a9a=a61_0x2b24;function a61_0x2b24(_0x488a1d,_0x501fb2){_0x488a1d=_0x488a1d-0x199;const _0x71b121=a61_0x71b1();let _0x2b2483=_0x71b121[_0x488a1d];return _0x2b2483;}(function(_0x275bcc,_0x56c81e){const _0x2c76a3=a61_0x2b24,_0xb36ef6=_0x275bcc();while(!![]){try{const _0x12cb1e=parseInt(_0x2c76a3(0x1a0))/0x1+-parseInt(_0x2c76a3(0x1a4))/0x2*(parseInt(_0x2c76a3(0x19a))/0x3)+parseInt(_0x2c76a3(0x1a7))/0x4*(-parseInt(_0x2c76a3(0x1b8))/0x5)+-parseInt(_0x2c76a3(0x1b0))/0x6*(parseInt(_0x2c76a3(0x1b5))/0x7)+parseInt(_0x2c76a3(0x1a3))/0x8*(-parseInt(_0x2c76a3(0x1ad))/0x9)+-parseInt(_0x2c76a3(0x1b6))/0xa*(-parseInt(_0x2c76a3(0x1a5))/0xb)+parseInt(_0x2c76a3(0x19d))/0xc;if(_0x12cb1e===_0x56c81e)break;else _0xb36ef6['push'](_0xb36ef6['shift']());}catch(_0x5f8988){_0xb36ef6['push'](_0xb36ef6['shift']());}}}(a61_0x71b1,0xd32ac));function a61_0x71b1(){const _0x4a9f9e=['1699300EStKFX','npx\x20skills\x20add\x20failed:\x20','skill-install','71376UjBAvL','3460LSLlMv','132fIjfOn','log','3445696cHFhqk','rabetbase\x20skill\x20installed','lovrabet/rabetbase','skill','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','setLogPath','576NZGKCk','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','nonInteractive','3010458XxkfCf','install','../skills/npx-skills-add.js','info','cwd','7rukIxA','1271170lAkOCG','Install\x20skill\x20packages','10HAnNGC','unknown','skipped','2658hywcXY','logger','Check\x20network\x20connectivity\x20and\x20try\x20again.','23623380dCvkBo','error','pipe'];a61_0x71b1=function(){return _0x4a9f9e;};return a61_0x71b1();}import{skillsCommand as a61_0x49016a}from'../skills/main.js';import{CliErrors}from'../errors.js';export const skillCommand={'name':a61_0x523a9a(0x1aa),'description':a61_0x523a9a(0x1b7),async 'run'(_0x441f96,_0xe26305,_0x57baf9){const _0xab31ac=a61_0x523a9a,_0x252243=_0xe26305[0x0];if(_0x252243===_0xab31ac(0x1b1)){_0x441f96[_0xab31ac(0x19b)][_0xab31ac(0x1ac)](process[_0xab31ac(0x1b4)]()),_0x441f96[_0xab31ac(0x19b)][_0xab31ac(0x1b3)](_0xab31ac(0x1a2),_0xab31ac(0x1ae));const {runNpxSkillsAddGlobal:_0x5abe61}=await import(_0xab31ac(0x1b2)),_0x4b5f39=_0x441f96[_0xab31ac(0x1af)]?_0xab31ac(0x19f):'inherit';console[_0xab31ac(0x1a6)](_0xab31ac(0x1ab));const _0x483a8c=_0x5abe61(process[_0xab31ac(0x1b4)](),_0xab31ac(0x1a9),{'stdio':_0x4b5f39});if(_0x483a8c[_0xab31ac(0x199)])console[_0xab31ac(0x1a6)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x483a8c['ok'])console[_0xab31ac(0x1a6)](_0xab31ac(0x1a8));else throw CliErrors['apiError'](_0xab31ac(0x1a1)+(_0x483a8c[_0xab31ac(0x19e)]||_0xab31ac(0x1b9)),_0xab31ac(0x19c));}}else await a61_0x49016a(_0x252243,[],_0x57baf9);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x1ddacd=a62_0x1262;function a62_0x1262(_0x57d0b7,_0x9f19e){_0x57d0b7=_0x57d0b7-0x11d;const _0xf4f2c3=a62_0xf4f2();let _0x12626a=_0xf4f2c3[_0x57d0b7];return _0x12626a;}(function(_0x417e01,_0x4b33db){const _0x4cea67=a62_0x1262,_0x2022ff=_0x417e01();while(!![]){try{const _0x269dda=parseInt(_0x4cea67(0x122))/0x1*(-parseInt(_0x4cea67(0x131))/0x2)+parseInt(_0x4cea67(0x11d))/0x3+parseInt(_0x4cea67(0x11f))/0x4+-parseInt(_0x4cea67(0x125))/0x5*(-parseInt(_0x4cea67(0x12d))/0x6)+-parseInt(_0x4cea67(0x126))/0x7*(-parseInt(_0x4cea67(0x129))/0x8)+-parseInt(_0x4cea67(0x11e))/0x9*(parseInt(_0x4cea67(0x12c))/0xa)+parseInt(_0x4cea67(0x124))/0xb*(-parseInt(_0x4cea67(0x121))/0xc);if(_0x269dda===_0x4b33db)break;else _0x2022ff['push'](_0x2022ff['shift']());}catch(_0x225164){_0x2022ff['push'](_0x2022ff['shift']());}}}(a62_0xf4f2,0x8d091));import{getSqlQueryInfo}from'../../core/api-client.js';function a62_0xf4f2(){const _0x363727=['Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','appCode','1000659rsQwFN','92997dnqHsO','2427396lSHHWf','str','3721764MVcjLh','47035VoRqsN','sqlContent','11YZhULW','294115NDVdlJ','5019nFdiyJ','detail','sqlcode','10536cQvFcK','sql','description','1090GwQfEz','18WElGLI','verbose','sqlCode','dbId','2RitQDS'];a62_0xf4f2=function(){return _0x363727;};return a62_0xf4f2();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../common/flags.js';export const sqlDetail={'service':a62_0x1ddacd(0x12a),'command':a62_0x1ddacd(0x127),'description':a62_0x1ddacd(0x132),'risk':'read','flags':[SQLCODE_FLAG,{'name':a62_0x1ddacd(0x12e),'type':'boolean','description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x395445){const _0x1b52c0=a62_0x1ddacd,_0x325d7e=await getSqlQueryInfo(_0x395445[_0x1b52c0(0x133)],_0x395445[_0x1b52c0(0x120)](_0x1b52c0(0x128))),_0xbe9b7a=_0x395445['bool'](_0x1b52c0(0x12e));if(_0xbe9b7a)return{'ok':!![],'data':_0x325d7e};const _0x44416b=_0x325d7e[_0x1b52c0(0x130)]?await getDbName(_0x395445[_0x1b52c0(0x133)],_0x325d7e[_0x1b52c0(0x130)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x325d7e[_0x1b52c0(0x12f)],'sqlName':_0x325d7e['sqlName'],'db':_0x44416b?_0x44416b+'\x20('+_0x325d7e[_0x1b52c0(0x130)]+')':_0x325d7e[_0x1b52c0(0x130)]??'','description':_0x325d7e[_0x1b52c0(0x12b)]??'','sqlContent':_0x325d7e[_0x1b52c0(0x123)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a63_0x145a(_0x3050e5,_0x42efb0){_0x3050e5=_0x3050e5-0x16b;const _0x1ec129=a63_0x1ec1();let _0x145a58=_0x1ec129[_0x3050e5];return _0x145a58;}const a63_0x25b1fe=a63_0x145a;(function(_0x39e55b,_0x538a0e){const _0x535eec=a63_0x145a,_0x3e5a01=_0x39e55b();while(!![]){try{const _0x3d112b=parseInt(_0x535eec(0x173))/0x1+-parseInt(_0x535eec(0x17c))/0x2+-parseInt(_0x535eec(0x183))/0x3+-parseInt(_0x535eec(0x16f))/0x4*(-parseInt(_0x535eec(0x182))/0x5)+-parseInt(_0x535eec(0x181))/0x6+-parseInt(_0x535eec(0x16c))/0x7+parseInt(_0x535eec(0x177))/0x8*(parseInt(_0x535eec(0x174))/0x9);if(_0x3d112b===_0x538a0e)break;else _0x3e5a01['push'](_0x3e5a01['shift']());}catch(_0x3ec181){_0x3e5a01['push'](_0x3e5a01['shift']());}}}(a63_0x1ec1,0x2424a));import{executeSql}from'../../core/api-client.js';function a63_0x1ec1(){const _0x9bb0a0=['\x20row(s)\x20in\x20','read','804300JomtHQ','isArray','string','161088sfNYmk','Invalid\x20JSON\x20for\x20--params:\x20','str','now','96906evaYNR','2673frJDvu','execResult','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','5656NPPcmw','sql','sqlcode','exec','execSuccess','129382TkDZsc','length','params','parse','execError','826692yJWvzl','20zMzhlq','7674zTAcSx'];a63_0x1ec1=function(){return _0x9bb0a0;};return a63_0x1ec1();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../common/flags.js';export const sqlExec={'service':a63_0x25b1fe(0x178),'command':a63_0x25b1fe(0x17a),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a63_0x25b1fe(0x16b),'flags':[SQLCODE_FLAG,{'name':'params','type':a63_0x25b1fe(0x16e),'description':a63_0x25b1fe(0x176)}],async 'execute'(_0x48c538){const _0x496c4b=a63_0x25b1fe;let _0x3f2227;const _0x1a6a2b=_0x48c538['str'](_0x496c4b(0x17e));if(_0x1a6a2b)try{_0x3f2227=JSON[_0x496c4b(0x17f)](_0x1a6a2b);}catch{throw CliErrors['validation'](_0x496c4b(0x170)+_0x1a6a2b);}const _0x67a79e=Date[_0x496c4b(0x172)](),_0x1b29c0=await executeSql(_0x48c538['appCode'],_0x48c538[_0x496c4b(0x171)](_0x496c4b(0x179)),_0x3f2227),_0x4828b3=Date[_0x496c4b(0x172)]()-_0x67a79e,_0x5525ff=_0x1b29c0?.[_0x496c4b(0x175)]??_0x1b29c0,_0x4936ad=_0x1b29c0?.[_0x496c4b(0x17b)]??!![];if(!_0x4936ad)return{'ok':![],'data':{'error':_0x1b29c0?.[_0x496c4b(0x180)]||'SQL\x20execution\x20failed','elapsed':_0x4828b3},'message':'SQL\x20execution\x20failed'};const _0x19a47f=Array[_0x496c4b(0x16d)](_0x5525ff)?_0x5525ff:[];return{'ok':!![],'data':{'rows':_0x19a47f,'rowCount':_0x19a47f[_0x496c4b(0x17d)],'elapsed':_0x4828b3},'message':'Returned\x20'+_0x19a47f[_0x496c4b(0x17d)]+_0x496c4b(0x184)+_0x4828b3+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d0233,_0x156621){const _0x4cc5dd=a64_0x820b,_0x5a25d7=_0x5d0233();while(!![]){try{const _0x31e038=parseInt(_0x4cc5dd(0x18f))/0x1*(parseInt(_0x4cc5dd(0x198))/0x2)+parseInt(_0x4cc5dd(0x197))/0x3*(-parseInt(_0x4cc5dd(0x196))/0x4)+-parseInt(_0x4cc5dd(0x190))/0x5+-parseInt(_0x4cc5dd(0x192))/0x6*(parseInt(_0x4cc5dd(0x194))/0x7)+-parseInt(_0x4cc5dd(0x18e))/0x8*(parseInt(_0x4cc5dd(0x191))/0x9)+-parseInt(_0x4cc5dd(0x193))/0xa+parseInt(_0x4cc5dd(0x195))/0xb;if(_0x31e038===_0x156621)break;else _0x5a25d7['push'](_0x5a25d7['shift']());}catch(_0x31d0d4){_0x5a25d7['push'](_0x5a25d7['shift']());}}}(a64_0x3bce,0x48316));import{sqlList}from'./list.js';import{sqlDetail}from'./detail.js';function a64_0x820b(_0x11903c,_0x508048){_0x11903c=_0x11903c-0x18e;const _0x3bce96=a64_0x3bce();let _0x820ba2=_0x3bce96[_0x11903c];return _0x820ba2;}import{sqlValidate}from'./validate.js';function a64_0x3bce(){const _0x4eaee0=['4QsrHzj','76008vajDHC','38442liMXEf','40TwIllv','3tyCLOS','1976890yfPkgF','119862DlCnSy','2708670evjQOj','264340OZCHcN','7eRjvYa','13235442pHpQsJ'];a64_0x3bce=function(){return _0x4eaee0;};return a64_0x3bce();}import{sqlSave}from'./save.js';import{sqlExec}from'./exec.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x5d49ac=a65_0x55db;(function(_0x2c5d84,_0x15dff3){const _0x234f8c=a65_0x55db,_0x4457c5=_0x2c5d84();while(!![]){try{const _0x2c4624=parseInt(_0x234f8c(0xae))/0x1+parseInt(_0x234f8c(0x99))/0x2+parseInt(_0x234f8c(0xb4))/0x3+parseInt(_0x234f8c(0xb5))/0x4*(parseInt(_0x234f8c(0xaf))/0x5)+parseInt(_0x234f8c(0x9d))/0x6+parseInt(_0x234f8c(0xa9))/0x7+-parseInt(_0x234f8c(0xa0))/0x8;if(_0x2c4624===_0x15dff3)break;else _0x4457c5['push'](_0x4457c5['shift']());}catch(_0x37b85f){_0x4457c5['push'](_0x4457c5['shift']());}}}(a65_0x142c,0x6e21a));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a65_0x142c(){const _0xd71e2f=['boolean','read','Page\x20size','No\x20custom\x20SQL\x20queries\x20found.','map','Page\x20number','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','1514584tzjXFm','tableData','page','List\x20custom\x20SQL\x20queries','2996166xaSCnL','sql','appCode','12663128jdZAgP','str','name','list','Filter\x20by\x20SQL\x20name','pagesize','num','sqlCode','bool','154364rmhpPq','sqlcode','all','length','description','95743HQmCax','5EcFlbD','dbId','verbose','number','paging','296940QzHMmH','2242244CnwXUo','\x20SQL\x20queries\x20(total:\x20','totalCount'];a65_0x142c=function(){return _0xd71e2f;};return a65_0x142c();}import{SQLCODE_FLAG_OPTIONAL}from'../common/flags.js';function a65_0x55db(_0x1a66af,_0x2bd25c){_0x1a66af=_0x1a66af-0x93;const _0x142c71=a65_0x142c();let _0x55dbca=_0x142c71[_0x1a66af];return _0x55dbca;}export const sqlList={'service':a65_0x5d49ac(0x9e),'command':a65_0x5d49ac(0xa3),'description':a65_0x5d49ac(0x9c),'risk':a65_0x5d49ac(0x93),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a65_0x5d49ac(0xa2),'type':'string','description':a65_0x5d49ac(0xa4)},{'name':a65_0x5d49ac(0x9b),'type':'number','description':a65_0x5d49ac(0x97),'default':0x1},{'name':'pagesize','type':a65_0x5d49ac(0xb2),'description':a65_0x5d49ac(0x94)},{'name':a65_0x5d49ac(0xb1),'type':a65_0x5d49ac(0xb8),'description':a65_0x5d49ac(0x98)}],async 'execute'(_0x308652){const _0x5b6610=a65_0x5d49ac,_0x4d04ad=await listSqlQueries(_0x308652[_0x5b6610(0x9f)],{'sqlCode':_0x308652[_0x5b6610(0xa1)](_0x5b6610(0xaa))||undefined,'sqlName':_0x308652[_0x5b6610(0xa1)](_0x5b6610(0xa2))||undefined,'currentPage':_0x308652[_0x5b6610(0xa6)](_0x5b6610(0x9b)),'pageSize':_0x308652[_0x5b6610(0xa6)](_0x5b6610(0xa5),0x32)}),_0xbb6a50=_0x308652[_0x5b6610(0xa8)]('verbose'),_0x4372e7=_0x4d04ad[_0x5b6610(0x9a)]??[],_0x403075=_0x4d04ad[_0x5b6610(0xb3)]?.[_0x5b6610(0xb7)]??_0x4372e7[_0x5b6610(0xac)];let _0x44081b;return _0xbb6a50?_0x44081b=_0x4372e7:_0x44081b=await Promise[_0x5b6610(0xab)](_0x4372e7[_0x5b6610(0x96)](async _0x4cd3c1=>{const _0x90e1b=_0x5b6610,_0x4029fb=_0x4cd3c1[_0x90e1b(0xb0)]?await getDbName(_0x308652['appCode'],_0x4cd3c1[_0x90e1b(0xb0)]):undefined;return{'sqlCode':_0x4cd3c1[_0x90e1b(0xa7)],'sqlName':_0x4cd3c1['sqlName'],'description':_0x4cd3c1[_0x90e1b(0xad)]??'','db':_0x4029fb?_0x4029fb+'\x20('+_0x4cd3c1[_0x90e1b(0xb0)]+')':_0x4cd3c1[_0x90e1b(0xb0)]??''};})),{'ok':!![],'data':_0x44081b,'message':_0x4372e7['length']===0x0?_0x5b6610(0x95):'Found\x20'+_0x4372e7[_0x5b6610(0xac)]+_0x5b6610(0xb6)+_0x403075+').'};}};
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a66_0x4309(){const _0x1b8a91=['sqlcode','92NUHikL','\x20chars)','validation','File\x20not\x20found:\x20','\x20|\x20Tables:\x20','string','sqlType','sqlName','Conflict\x20detected','9380zysdTa','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','30TSotDF','123408NjVjxX','15852PTzEqC','\x20|\x20Params:\x20','121272XNDjua','902905WJVZDR','action','blocked','type','save','str','write','dbId','tables','file','join','sqlname','14234GvaZwb','description','none','9086970vVodqy','created','Path\x20to\x20the\x20SQL\x20file','SQL\x20validation\x20failed:\x20','SQL\x20query\x20display\x20name','message','N/A','cwd','valid','/api/node-toolbox/sql/save','\x20successfully','POST','Updated','46556SOlKZx','sql','Created','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','length','153PMHXCp','utf-8','appCode','sqlCode','343gsEKUZ'];a66_0x4309=function(){return _0x1b8a91;};return a66_0x4309();}const a66_0x52de0e=a66_0x121f;(function(_0xd36bfa,_0x321840){const _0x131b25=a66_0x121f,_0x14b489=_0xd36bfa();while(!![]){try{const _0xd6bf8e=parseInt(_0x131b25(0x157))/0x1+parseInt(_0x131b25(0x173))/0x2*(-parseInt(_0x131b25(0x152))/0x3)+parseInt(_0x131b25(0x17e))/0x4*(-parseInt(_0x131b25(0x187))/0x5)+parseInt(_0x131b25(0x156))/0x6*(parseInt(_0x131b25(0x17c))/0x7)+-parseInt(_0x131b25(0x153))/0x8*(parseInt(_0x131b25(0x178))/0x9)+parseInt(_0x131b25(0x166))/0xa+-parseInt(_0x131b25(0x163))/0xb*(parseInt(_0x131b25(0x154))/0xc);if(_0xd6bf8e===_0x321840)break;else _0x14b489['push'](_0x14b489['shift']());}catch(_0x354675){_0x14b489['push'](_0x14b489['shift']());}}}(a66_0x4309,0x875ce));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';function a66_0x121f(_0x350eec,_0x302fbc){_0x350eec=_0x350eec-0x151;const _0x430936=a66_0x4309();let _0x121f0a=_0x430936[_0x350eec];return _0x121f0a;}import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../common/flags.js';export const sqlSave={'service':a66_0x52de0e(0x174),'command':a66_0x52de0e(0x15b),'description':a66_0x52de0e(0x151),'risk':a66_0x52de0e(0x15d),'flags':[{'name':a66_0x52de0e(0x160),'type':a66_0x52de0e(0x183),'required':!![],'description':a66_0x52de0e(0x168)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':'string','description':a66_0x52de0e(0x16a)},{'name':'db','type':a66_0x52de0e(0x183),'description':a66_0x52de0e(0x176)},{'name':a66_0x52de0e(0x164),'type':'string','description':'SQL\x20query\x20description'}],async 'validate'(_0x494603){const _0x2be096=a66_0x52de0e,_0x182b63=resolve(process['cwd'](),_0x494603[_0x2be096(0x15c)](_0x2be096(0x160)));if(!existsSync(_0x182b63))throw CliErrors[_0x2be096(0x180)](_0x2be096(0x181)+_0x182b63);const _0x54b3f2=readFileSync(_0x182b63,_0x2be096(0x179)),_0x32ef52=validateSql(_0x54b3f2);if(!_0x32ef52[_0x2be096(0x16e)])throw CliErrors[_0x2be096(0x180)](_0x2be096(0x169)+_0x32ef52['message']);},async 'dryRun'(_0x134c13){const _0x435445=a66_0x52de0e,_0x53dfd2=resolve(process[_0x435445(0x16d)](),_0x134c13[_0x435445(0x15c)](_0x435445(0x160))),_0x2a6486=readFileSync(_0x53dfd2,'utf-8'),_0x52146b=validateSql(_0x2a6486),_0x2977e7=_0x134c13[_0x435445(0x15c)]('db')||undefined,{db:_0x506ce3,error:_0x106ca6}=await resolveOneDb(_0x134c13[_0x435445(0x17a)],_0x2977e7);return{'method':_0x435445(0x171),'url':_0x435445(0x16f),'body':{'appCode':_0x134c13['appCode'],'sqlContent':'('+_0x2a6486[_0x435445(0x177)]+_0x435445(0x17f),'sqlCode':_0x134c13[_0x435445(0x15c)](_0x435445(0x17d))||undefined,'sqlName':_0x134c13[_0x435445(0x15c)](_0x435445(0x162))||undefined,'db':_0x506ce3?_0x506ce3['dbName']+'\x20('+_0x506ce3[_0x435445(0x15e)]+')':_0x106ca6},'description':['Save\x20SQL\x20query\x20from\x20'+_0x134c13[_0x435445(0x15c)]('file'),'Validation:\x20'+_0x52146b[_0x435445(0x16b)],'Type:\x20'+_0x52146b[_0x435445(0x184)][_0x435445(0x15a)]+_0x435445(0x182)+(_0x52146b[_0x435445(0x15f)][_0x435445(0x161)](',\x20')||_0x435445(0x16c))+_0x435445(0x155)+(_0x52146b['parameters'][_0x435445(0x161)](',\x20')||_0x435445(0x165))][_0x435445(0x161)]('\x0a')};},async 'execute'(_0x165218){const _0xc98a54=a66_0x52de0e,_0x52e4a4=resolve(process[_0xc98a54(0x16d)](),_0x165218[_0xc98a54(0x15c)](_0xc98a54(0x160))),_0x43b0c5=readFileSync(_0x52e4a4,'utf-8'),_0x2630bc=_0x165218[_0xc98a54(0x15c)]('db')||undefined,{db:_0x211c9e,error:_0x57fd86}=await resolveOneDb(_0x165218[_0xc98a54(0x17a)],_0x2630bc);if(_0x57fd86)throw CliErrors[_0xc98a54(0x180)](_0x57fd86);const _0x2655c0=await saveSqlQuery({'appCode':_0x165218['appCode'],'sqlContent':_0x43b0c5,'sqlCode':_0x165218[_0xc98a54(0x15c)]('sqlcode')||undefined,'sqlName':_0x165218[_0xc98a54(0x15c)](_0xc98a54(0x162))||undefined,'dbId':_0x211c9e[_0xc98a54(0x15e)],'description':_0x165218['str'](_0xc98a54(0x164))||undefined});if(_0x2655c0[_0xc98a54(0x159)])return{'ok':![],'data':_0x2655c0,'message':_0x2655c0[_0xc98a54(0x16b)]||_0xc98a54(0x186)};return{'ok':!![],'data':{'sqlCode':_0x2655c0[_0xc98a54(0x17b)],'sqlName':_0x2655c0[_0xc98a54(0x185)],'action':_0x2655c0[_0xc98a54(0x158)]},'message':(_0x2655c0[_0xc98a54(0x158)]===_0xc98a54(0x167)?_0xc98a54(0x175):_0xc98a54(0x172))+_0xc98a54(0x170)+(_0x2655c0[_0xc98a54(0x17b)]?'\x20('+_0x2655c0[_0xc98a54(0x17b)]+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x1d4ffb=a67_0x50e9;(function(_0x4e7e99,_0x3bdb2b){const _0x384d01=a67_0x50e9,_0x18d1e5=_0x4e7e99();while(!![]){try{const _0x2f5cab=-parseInt(_0x384d01(0xd1))/0x1+-parseInt(_0x384d01(0xe3))/0x2*(parseInt(_0x384d01(0xf0))/0x3)+parseInt(_0x384d01(0xdc))/0x4+parseInt(_0x384d01(0xdf))/0x5*(-parseInt(_0x384d01(0xdb))/0x6)+-parseInt(_0x384d01(0xe1))/0x7*(-parseInt(_0x384d01(0xcb))/0x8)+-parseInt(_0x384d01(0xec))/0x9*(parseInt(_0x384d01(0xf4))/0xa)+parseInt(_0x384d01(0xce))/0xb;if(_0x2f5cab===_0x3bdb2b)break;else _0x18d1e5['push'](_0x18d1e5['shift']());}catch(_0x5ddec9){_0x18d1e5['push'](_0x18d1e5['shift']());}}}(a67_0x2c1b,0x2b2cb));function a67_0x50e9(_0x267373,_0x41cc14){_0x267373=_0x267373-0xc4;const _0x2c1b12=a67_0x2c1b();let _0x50e98e=_0x2c1b12[_0x267373];return _0x50e98e;}import{readFileSync,existsSync}from'node:fs';function a67_0x2c1b(){const _0x5f2038=['Provide\x20--file\x20or\x20--sql','length','tableName','name','utf-8','size','fields','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','81hviMJg','split','message','toLowerCase','2397oMKARe','Table\x20\x22','string','schemaWarnings','171320OMFWsc','tables','file','\x22\x20not\x20found\x20in\x20any\x20dataset','map','get','valid','parameters','trim','1896sQbbfA','appCode','dbtableConfig','5850922KGwQhD','File\x20not\x20found:\x20','sqlType','208863wcOwCh','sql','read','validate','validation','\x22\x20not\x20found\x20or\x20not\x20accessible','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','reason','push','isDangerous','1254pkikTp','728652gxDOAq','flagMissing','type','2885MDUTej','filter','1981PIdcbX','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','302CEjxfO'];a67_0x2c1b=function(){return _0x5f2038;};return a67_0x2c1b();}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';export const sqlValidate={'service':a67_0x1d4ffb(0xd2),'command':a67_0x1d4ffb(0xd4),'description':a67_0x1d4ffb(0xeb),'risk':a67_0x1d4ffb(0xd3),'flags':[{'name':'file','type':a67_0x1d4ffb(0xf2),'description':a67_0x1d4ffb(0xd7)},{'name':'sql','type':a67_0x1d4ffb(0xf2),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':'string','description':a67_0x1d4ffb(0xe2)}],async 'execute'(_0x3d9b70){const _0x223721=a67_0x1d4ffb,_0x42c9c7=_0x3d9b70['str'](_0x223721(0xc4)),_0x5b8834=_0x3d9b70['str'](_0x223721(0xd2));if(!_0x42c9c7&&!_0x5b8834)throw CliErrors[_0x223721(0xdd)](_0x223721(0xc4),_0x223721(0xe4));let _0x59c745;if(_0x42c9c7){const _0x4cd886=resolve(process['cwd'](),_0x42c9c7);if(!existsSync(_0x4cd886))throw CliErrors[_0x223721(0xd5)](_0x223721(0xcf)+_0x4cd886);_0x59c745=readFileSync(_0x4cd886,_0x223721(0xe8));}else _0x59c745=_0x5b8834;const _0x49a731=validateSql(_0x59c745),_0x6eabcc={'valid':_0x49a731[_0x223721(0xc8)],'sqlType':_0x49a731[_0x223721(0xd0)][_0x223721(0xde)],'isSelectOnly':_0x49a731[_0x223721(0xd0)]['isSelectOnly'],'isDangerous':_0x49a731['sqlType'][_0x223721(0xda)],'tables':_0x49a731[_0x223721(0xf5)],'parameters':_0x49a731[_0x223721(0xc9)],'message':_0x49a731['message']};_0x49a731[_0x223721(0xd0)][_0x223721(0xd8)]&&(_0x6eabcc['reason']=_0x49a731['sqlType']['reason']);const _0xfee366=_0x3d9b70['str']('schemas');if(_0xfee366&&_0x49a731['valid']){const _0x4b3361=_0xfee366[_0x223721(0xed)](',')['map'](_0x4e987b=>_0x4e987b[_0x223721(0xca)]())[_0x223721(0xe0)](Boolean),_0x20c815=[],_0x4edec6=await listDatasets(_0x3d9b70[_0x223721(0xcc)]),_0x18bf12=new Map(_0x4edec6[_0x223721(0xc6)](_0x4b55c8=>[_0x4b55c8[_0x223721(0xcd)]?.[_0x223721(0xe6)]?.[_0x223721(0xef)](),_0x4b55c8]));for(const _0x1116d9 of _0x49a731[_0x223721(0xf5)]){const _0x4609a9=_0x18bf12[_0x223721(0xc7)](_0x1116d9['toLowerCase']());!_0x4609a9&&_0x20c815[_0x223721(0xd9)](_0x223721(0xf1)+_0x1116d9+_0x223721(0xc5));}for(const _0x23df2f of _0x4b3361){try{const _0x17ad0c=await getDatasetDetail(_0x23df2f),_0x3b12b5=Array['isArray'](_0x17ad0c[_0x223721(0xea)])?_0x17ad0c[_0x223721(0xea)]:[],_0xd695cc=new Set(_0x3b12b5[_0x223721(0xc6)](_0x24da48=>_0x24da48[_0x223721(0xe7)]?.[_0x223721(0xef)]())),_0x2ad5ae=_0x17ad0c[_0x223721(0xcd)]?.[_0x223721(0xe6)]||_0x17ad0c[_0x223721(0xe6)]||_0x23df2f;_0x6eabcc['schema:'+_0x2ad5ae]={'code':_0x23df2f,'tableName':_0x2ad5ae,'fieldCount':_0xd695cc[_0x223721(0xe9)],'fields':Array['from'](_0xd695cc)};}catch{_0x20c815[_0x223721(0xd9)]('Dataset\x20\x22'+_0x23df2f+_0x223721(0xd6));}}_0x20c815[_0x223721(0xe5)]>0x0&&(_0x6eabcc[_0x223721(0xf3)]=_0x20c815);}return{'ok':_0x49a731[_0x223721(0xc8)],'data':_0x6eabcc,'message':_0x49a731[_0x223721(0xee)]};}};
|
package/lib/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a68_0x1e7aa6=a68_0x5492;(function(_0x3280c4,_0x3518b7){const _0x301f86=a68_0x5492,_0x469306=_0x3280c4();while(!![]){try{const _0x1edfa4=-parseInt(_0x301f86(0x1ed))/0x1+-parseInt(_0x301f86(0x1ef))/0x2*(parseInt(_0x301f86(0x1f8))/0x3)+parseInt(_0x301f86(0x1f3))/0x4*(-parseInt(_0x301f86(0x1f9))/0x5)+parseInt(_0x301f86(0x1f0))/0x6+-parseInt(_0x301f86(0x1f6))/0x7+parseInt(_0x301f86(0x1eb))/0x8*(parseInt(_0x301f86(0x1f2))/0x9)+parseInt(_0x301f86(0x1f4))/0xa;if(_0x1edfa4===_0x3518b7)break;else _0x469306['push'](_0x469306['shift']());}catch(_0x4e8138){_0x469306['push'](_0x469306['shift']());}}}(a68_0x13d3,0x2dd15));import{execa}from'execa';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a68_0x5492(_0x3aee38,_0x5a3263){_0x3aee38=_0x3aee38-0x1ea;const _0x13d317=a68_0x13d3();let _0x54928a=_0x13d317[_0x3aee38];return _0x54928a;}export async function runStart(_0x41404e){const _0x11a7bf=a68_0x5492,_0x6b6951=Date[_0x11a7bf(0x1ee)](),_0x164a76=_0x41404e||process['cwd'](),_0x1797b8=await checkCliVersion();_0x1797b8[_0x11a7bf(0x1f7)]&&printCliUpgradeWarning(_0x1797b8);const _0x22c859=await checkSdkVersion(_0x164a76);_0x22c859[_0x11a7bf(0x1f7)]&&printSdkUpgradeWarning(_0x22c859);try{await execa('vite',[],{'cwd':_0x164a76,'stdio':_0x11a7bf(0x1f1),'preferLocal':!![],'localDir':_0x164a76,'env':{...process[_0x11a7bf(0x1ea)]}});const _0x3fec00=Date[_0x11a7bf(0x1ee)]()-_0x6b6951;void _0x3fec00;}catch(_0x19bf85){throw _0x19bf85;}}function a68_0x13d3(){const _0x2b16d7=['2092290PledYv','inherit','9QAirqS','67588eXPkoT','8240200VPdzVj','启动开发服务器','776153jKpEiA','needsUpgrade','18sUXhVF','105zOvQCo','env','34528XxKVZz','start','189340EedKyN','now','111442IVvNjA'];a68_0x13d3=function(){return _0x2b16d7;};return a68_0x13d3();}export const startCommand={'name':a68_0x1e7aa6(0x1ec),'description':'Start\x20development\x20server',async 'run'(_0x346170,_0x31b70c,_0x2d2918){const _0x3f603f=a68_0x1e7aa6;_0x346170['logger']['info'](_0x3f603f(0x1ec),_0x3f603f(0x1f5)),await runStart();}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x167c24,_0x3b7471){const _0x71a3d7=a69_0x824b,_0x5d7c24=_0x167c24();while(!![]){try{const _0x3c8f6d=-parseInt(_0x71a3d7(0xe9))/0x1+parseInt(_0x71a3d7(0xf4))/0x2*(-parseInt(_0x71a3d7(0xe1))/0x3)+-parseInt(_0x71a3d7(0xe7))/0x4+-parseInt(_0x71a3d7(0xe3))/0x5*(parseInt(_0x71a3d7(0xf0))/0x6)+parseInt(_0x71a3d7(0xec))/0x7*(-parseInt(_0x71a3d7(0xdb))/0x8)+parseInt(_0x71a3d7(0xe2))/0x9*(parseInt(_0x71a3d7(0xf1))/0xa)+-parseInt(_0x71a3d7(0xee))/0xb*(-parseInt(_0x71a3d7(0xe5))/0xc);if(_0x3c8f6d===_0x3b7471)break;else _0x5d7c24['push'](_0x5d7c24['shift']());}catch(_0x3c5b30){_0x5d7c24['push'](_0x5d7c24['shift']());}}}(a69_0x30ae,0xc8139));function a69_0x30ae(){const _0x3013ed=['\x20\x20\x20\x20','1291784gZlyLV','Set\x20environment\x20(production/daily)','Set\x20App\x20Code\x20for\x20current\x20project','map','\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','1944ZvZnsw','Examples:','gray','\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Invalid\x20command.\x20Available\x20commands:','\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','6oppXQM','90pQXHCo','2515390NLTBIS','Set\x20a\x20config\x20value','744hYXkow','\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','6399220TqQBcO','description','1122900fhMLbT','command','column','47152gTyYIm','\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','1055318yTylvr','List\x20all\x20config\x20values','12DKpdZT','1528850pzfmeJ','Set\x20display\x20language\x20(zh/en)'];a69_0x30ae=function(){return _0x3013ed;};return a69_0x30ae();}import{jsxs as a69_0x5807d7,jsx as a69_0xd93edb}from'react/jsx-runtime';import{Box,Text}from'ink';function a69_0x824b(_0x3499c9,_0x5f0629){_0x3499c9=_0x3499c9-0xd9;const _0x30ae35=a69_0x30ae();let _0x824b0=_0x30ae35[_0x3499c9];return _0x824b0;}import{CLI_BIN_NAME}from'../constant/cli.js';export function ConfigHelp(){const _0x44880c=a69_0x824b,_0x4316f5=[{'command':CLI_BIN_NAME+_0x44880c(0xe0),'description':_0x44880c(0xe4)},{'command':CLI_BIN_NAME+_0x44880c(0xde),'description':'Get\x20a\x20config\x20value'},{'command':CLI_BIN_NAME+_0x44880c(0xe6),'description':_0x44880c(0xef)}],_0x46c60a=[{'command':CLI_BIN_NAME+_0x44880c(0xed),'description':_0x44880c(0xf6)},{'command':CLI_BIN_NAME+_0x44880c(0xda),'description':_0x44880c(0xf5)},{'command':CLI_BIN_NAME+'\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','description':_0x44880c(0xf2)}];return a69_0x5807d7(Box,{'flexDirection':_0x44880c(0xeb),'marginTop':0x1,'marginBottom':0x1,'children':[a69_0xd93edb(Box,{'marginBottom':0x1,'children':a69_0x5807d7(Text,{'color':_0x44880c(0xdd),'children':['\x20','!','\x20\x20',_0x44880c(0xdf)]})}),_0x4316f5[_0x44880c(0xd9)](_0x44d94d=>a69_0x5807d7(Box,{'children':[a69_0x5807d7(Text,{'children':[_0x44880c(0xf3),_0x44d94d[_0x44880c(0xea)]]}),a69_0xd93edb(Text,{'color':_0x44880c(0xdd),'children':_0x44d94d[_0x44880c(0xe8)]})]},_0x44d94d['command'])),a69_0xd93edb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a69_0x5807d7(Text,{'color':_0x44880c(0xdd),'children':['\x20*\x20',_0x44880c(0xdc)]})}),_0x46c60a[_0x44880c(0xd9)](_0x57597a=>a69_0x5807d7(Box,{'children':[a69_0x5807d7(Text,{'children':[_0x44880c(0xf3),_0x57597a['command']]}),a69_0xd93edb(Text,{'color':_0x44880c(0xdd),'children':_0x57597a['description']})]},_0x57597a[_0x44880c(0xea)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a70_0x344bdb=a70_0x9a3d;(function(_0x4bd27c,_0x334719){const _0x418597=a70_0x9a3d,_0x2f6e9b=_0x4bd27c();while(!![]){try{const _0x12fc68=parseInt(_0x418597(0x9e))/0x1*(parseInt(_0x418597(0x92))/0x2)+parseInt(_0x418597(0xa0))/0x3+-parseInt(_0x418597(0x8a))/0x4*(-parseInt(_0x418597(0xa1))/0x5)+-parseInt(_0x418597(0x83))/0x6+-parseInt(_0x418597(0x96))/0x7*(parseInt(_0x418597(0x99))/0x8)+-parseInt(_0x418597(0x8c))/0x9+-parseInt(_0x418597(0x81))/0xa*(parseInt(_0x418597(0x97))/0xb);if(_0x12fc68===_0x334719)break;else _0x2f6e9b['push'](_0x2f6e9b['shift']());}catch(_0x2a1426){_0x2f6e9b['push'](_0x2f6e9b['shift']());}}}(a70_0x51c8,0xdd6b8));import{jsx as a70_0x3ccbe7,jsxs as a70_0x513e59}from'react/jsx-runtime';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig}from'../utils/config.js';function a70_0x9a3d(_0x322fe1,_0x295312){_0x322fe1=_0x322fe1-0x81;const _0x51c84b=a70_0x51c8();let _0x9a3d58=_0x51c84b[_0x322fe1];return _0x9a3d58;}import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{logger}from'../utils/logger.js';function a70_0x51c8(){const _0x253c87=['log','length','env','online','string','env\x20value\x20must\x20be\x20\x22production\x22\x20or\x20\x22daily\x22','10Hidtub','includes','1461648uVMrLG','Invalid\x20locale\x20value.\x20Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','zh-CN','production','get','en-US','appcode','452ahRBfZ','保存配置失败','8697393jtWTUH','\x20locale\x20set\x20to:\x20','stringify','red','\x20env\x20set\x20to:\x20','flags','2dnYUHl','Global','message','column','609UFiyfK','8920703ePrweA','Failed\x20to\x20save\x20config','92712cbmrgZ','project','undefined','help','input','1686767ESkJiq','app','3138099fslSfE','53245ncBdAn','global','toLowerCase','locale','daily','set'];a70_0x51c8=function(){return _0x253c87;};return a70_0x51c8();}const LOCALE_MAP={'zh':a70_0x344bdb(0x85),'zh-cn':'zh-CN','zh_cn':a70_0x344bdb(0x85),'en':'en-US','en-us':'en-US','en_us':a70_0x344bdb(0x88)};function normalizeLocale(_0x5d44b6){const _0x24b6d7=a70_0x344bdb;if(!_0x5d44b6)return null;return LOCALE_MAP[_0x5d44b6[_0x24b6d7(0xa3)]()]??null;}export function Config(_0x1b5da9){const _0x585dde=a70_0x344bdb,{cli:_0x2d3a80}=_0x1b5da9,_0x1920ae=_0x2d3a80[_0x585dde(0x9d)][0x1],_0x3cb751=_0x2d3a80[_0x585dde(0x9d)][0x2],_0x4c20e9=['set','get']['includes'](_0x1920ae||''),_0x318af3=_0x2d3a80[_0x585dde(0x9d)][_0x585dde(0xa8)]>=0x3;if(_0x3cb751==='--help'||_0x2d3a80[_0x585dde(0x91)][_0x585dde(0x9c)])return a70_0x3ccbe7(ConfigHelp,{});const _0x15d0df=readConfig();if(_0x1920ae===_0x585dde(0xa6)){if(_0x3cb751){const _0x39338f=_0x2d3a80[_0x585dde(0x9d)][0x3];if(typeof _0x39338f!==_0x585dde(0x9b)){if(_0x3cb751===_0x585dde(0xa9)&&![_0x585dde(0xaa),_0x585dde(0x86),_0x585dde(0xa5)][_0x585dde(0x82)](_0x39338f))return a70_0x3ccbe7(Box,{'children':a70_0x3ccbe7(Text,{'color':_0x585dde(0x8f),'children':_0x585dde(0xac)})});if(_0x3cb751===_0x585dde(0xa4)&&!normalizeLocale(_0x39338f))return a70_0x3ccbe7(Box,{'flexDirection':_0x585dde(0x95),'children':a70_0x3ccbe7(Text,{'color':_0x585dde(0x8f),'children':_0x585dde(0x84)})});const _0x24f00a=_0x2d3a80[_0x585dde(0x91)][_0x585dde(0xa2)]?_0x585dde(0xa2):isInProject()?_0x585dde(0x9a):_0x585dde(0xa2),_0x34debc=resolveWriteConfigPath(_0x24f00a);let _0x401851=readConfigFile(_0x34debc);if(typeof _0x39338f!==_0x585dde(0xab)||_0x39338f[_0x585dde(0xa8)]>0x1f4)return a70_0x3ccbe7(Box,{'children':a70_0x3ccbe7(Text,{'color':_0x585dde(0x8f),'children':'Config\x20value\x20is\x20invalid\x20or\x20too\x20long'})});let _0x4a65f5=_0x3cb751,_0x3862de=_0x39338f;_0x3cb751===_0x585dde(0x9f)&&(_0x4a65f5=_0x585dde(0x89),delete _0x401851[_0x585dde(0x9f)]);_0x3cb751===_0x585dde(0x89)&&delete _0x401851['app'];_0x3cb751===_0x585dde(0xa4)&&(_0x3862de=normalizeLocale(_0x39338f));_0x401851[_0x4a65f5]=_0x3862de;try{writeConfigFile(_0x34debc,_0x401851);const _0x4c133c=_0x24f00a===_0x585dde(0xa2)?_0x585dde(0x93):'Project';_0x3cb751===_0x585dde(0xa9)&&console[_0x585dde(0xa7)]('✓\x20'+_0x4c133c+_0x585dde(0x90)+_0x39338f);if(_0x3cb751===_0x585dde(0xa4)){const _0x164bad=normalizeLocale(_0x39338f);console[_0x585dde(0xa7)]('✓\x20'+_0x4c133c+_0x585dde(0x8d)+_0x164bad);}}catch(_0x3ff595){return logger['error']('config',_0x585dde(0x8b),{'error':_0x3ff595 instanceof Error?_0x3ff595[_0x585dde(0x94)]:String(_0x3ff595),'configKey':_0x3cb751,'configValue':_0x39338f,'targetConfigPath':_0x34debc}),a70_0x3ccbe7(Box,{'children':a70_0x513e59(Text,{'color':_0x585dde(0x8f),'children':[_0x585dde(0x98),':','\x20',_0x3ff595 instanceof Error?_0x3ff595['message']:String(_0x3ff595)]})});}return null;}return a70_0x3ccbe7(Box,{'children':a70_0x3ccbe7(Text,{'color':'red','children':'No\x20config\x20value\x20provided'})});}}if(_0x1920ae===_0x585dde(0x87)){if(_0x3cb751){let _0xad443e=_0x3cb751;return _0x3cb751===_0x585dde(0x9f)&&(_0xad443e=_0x585dde(0x89)),console[_0x585dde(0xa7)](_0x15d0df[_0xad443e]||_0x585dde(0x9b)),null;}return null;}if(_0x1920ae==='list')return console[_0x585dde(0xa7)](JSON[_0x585dde(0x8e)](_0x15d0df,null,0x2)),null;if(!_0x4c20e9||!_0x318af3)return a70_0x3ccbe7(ConfigHelp,{});return null;}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71_0x2d6cf3=a71_0x2f94;(function(_0x48ec38,_0xd43628){const _0xb7d68f=a71_0x2f94,_0x12446b=_0x48ec38();while(!![]){try{const _0x174e80=-parseInt(_0xb7d68f(0x78))/0x1*(-parseInt(_0xb7d68f(0x6d))/0x2)+parseInt(_0xb7d68f(0x70))/0x3*(-parseInt(_0xb7d68f(0x77))/0x4)+-parseInt(_0xb7d68f(0x6e))/0x5*(parseInt(_0xb7d68f(0x6f))/0x6)+-parseInt(_0xb7d68f(0x74))/0x7+-parseInt(_0xb7d68f(0x71))/0x8+parseInt(_0xb7d68f(0x72))/0x9+parseInt(_0xb7d68f(0x75))/0xa*(parseInt(_0xb7d68f(0x73))/0xb);if(_0x174e80===_0xd43628)break;else _0x12446b['push'](_0x12446b['shift']());}catch(_0x148b75){_0x12446b['push'](_0x12446b['shift']());}}}(a71_0x38e6,0xae620));function a71_0x2f94(_0x513cbf,_0x2d82d6){_0x513cbf=_0x513cbf-0x6d;const _0x38e644=a71_0x38e6();let _0x2f944d=_0x38e644[_0x513cbf];return _0x2f944d;}export const CLI_BIN_NAME=a71_0x2d6cf3(0x76);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';function a71_0x38e6(){const _0x23d13f=['rabetbase','36XBGOXa','69VGMZQv','22634awrGKs','5hdcfyC','7402818HDWiAO','118749kCWnNd','6133920JJixzN','7304607AuMPMg','28026130TkEttG','7484848IKWUhy','10jctQma'];a71_0x38e6=function(){return _0x23d13f;};return a71_0x38e6();}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x87ffcd=a72_0x1bb8;function a72_0x1bb8(_0x436c5f,_0x157115){_0x436c5f=_0x436c5f-0x118;const _0x118647=a72_0x1186();let _0x1bb820=_0x118647[_0x436c5f];return _0x1bb820;}(function(_0x4170ca,_0x3b1c95){const _0x2d67a4=a72_0x1bb8,_0x480996=_0x4170ca();while(!![]){try{const _0x24f4d1=parseInt(_0x2d67a4(0x125))/0x1+-parseInt(_0x2d67a4(0x11a))/0x2+-parseInt(_0x2d67a4(0x128))/0x3+-parseInt(_0x2d67a4(0x11e))/0x4*(parseInt(_0x2d67a4(0x12a))/0x5)+-parseInt(_0x2d67a4(0x126))/0x6*(parseInt(_0x2d67a4(0x11b))/0x7)+-parseInt(_0x2d67a4(0x123))/0x8*(-parseInt(_0x2d67a4(0x11f))/0x9)+-parseInt(_0x2d67a4(0x124))/0xa*(-parseInt(_0x2d67a4(0x119))/0xb);if(_0x24f4d1===_0x3b1c95)break;else _0x480996['push'](_0x480996['shift']());}catch(_0x2b7edb){_0x480996['push'](_0x480996['shift']());}}}(a72_0x1186,0xf2587));import{getEnv}from'./env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x4a8431){const _0x2c093a=a72_0x1bb8;customApiDomain=_0x4a8431?.[_0x2c093a(0x121)],customUserDomain=_0x4a8431?.[_0x2c093a(0x127)],customRuntimeDomain=_0x4a8431?.[_0x2c093a(0x11d)];}function a72_0x1186(){const _0x23b99b=['465735VixEyF','582SwmHxd','userDomain','273150feHZuC','https://user-daily.lovrabet.com','1220295CeCVVS','https://user.lovrabet.com','production','60940VMUkZQ','233696uImpRF','47523cLPgwF','https://runtime.lovrabet.com','runtimeDomain','8KePVPC','25641vtznah','https://daily-runtime.lovrabet.com','apiDomain','https://daily-api.lovrabet.com','4552OPihnK','470pAyHjm'];a72_0x1186=function(){return _0x23b99b;};return a72_0x1186();}export const getUserDomain=()=>customUserDomain||(getEnv()===a72_0x87ffcd(0x118)?a72_0x87ffcd(0x12b):a72_0x87ffcd(0x129));export const getApiDomain=()=>customApiDomain||(getEnv()===a72_0x87ffcd(0x118)?'https://api.lovrabet.com':a72_0x87ffcd(0x122));export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a72_0x87ffcd(0x118)?a72_0x87ffcd(0x11c):a72_0x87ffcd(0x120));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a73_0x52f427=a73_0x45b3;function a73_0x45b3(_0xb96e02,_0xb47981){_0xb96e02=_0xb96e02-0x185;const _0x160f21=a73_0x160f();let _0x45b3a9=_0x160f21[_0xb96e02];return _0x45b3a9;}(function(_0xb2ae6c,_0x1e1016){const _0x5d2f35=a73_0x45b3,_0x32a49d=_0xb2ae6c();while(!![]){try{const _0x5cf82b=-parseInt(_0x5d2f35(0x187))/0x1*(parseInt(_0x5d2f35(0x18f))/0x2)+-parseInt(_0x5d2f35(0x18b))/0x3+-parseInt(_0x5d2f35(0x190))/0x4+-parseInt(_0x5d2f35(0x18d))/0x5+-parseInt(_0x5d2f35(0x18a))/0x6+-parseInt(_0x5d2f35(0x18e))/0x7+parseInt(_0x5d2f35(0x18c))/0x8;if(_0x5cf82b===_0x1e1016)break;else _0x32a49d['push'](_0x32a49d['shift']());}catch(_0x4906fc){_0x32a49d['push'](_0x32a49d['shift']());}}}(a73_0x160f,0x9fb86));export function normalizeEnv(_0x40e8c2){const _0x151bec=a73_0x45b3;return _0x40e8c2===_0x151bec(0x186)?'production':_0x40e8c2;}let env=normalizeEnv(process[a73_0x52f427(0x185)][a73_0x52f427(0x189)]||process[a73_0x52f427(0x185)]['LOVRABET_ENV']||a73_0x52f427(0x188));export function getEnv(){return env;}function a73_0x160f(){const _0x24ce0f=['5285946ewEdpD','3784953gsVsZM','39765168JciVuQ','825920BTEicB','6684587DWgvdm','181058PPudkV','1679848FVmtRj','env','online','7rQLTrt','production','RABETBASE_ENV'];a73_0x160f=function(){return _0x24ce0f;};return a73_0x160f();}export function initEnv(_0x162de6){env=normalizeEnv(_0x162de6);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a74_0x581bc8=a74_0x36b2;(function(_0x244e45,_0x30b6f4){const _0x2eae48=a74_0x36b2,_0x14a983=_0x244e45();while(!![]){try{const _0x36604a=-parseInt(_0x2eae48(0x108))/0x1+parseInt(_0x2eae48(0x11a))/0x2+parseInt(_0x2eae48(0x13e))/0x3*(-parseInt(_0x2eae48(0x127))/0x4)+parseInt(_0x2eae48(0x123))/0x5*(parseInt(_0x2eae48(0x119))/0x6)+-parseInt(_0x2eae48(0x140))/0x7+-parseInt(_0x2eae48(0x13a))/0x8*(parseInt(_0x2eae48(0x128))/0x9)+parseInt(_0x2eae48(0x132))/0xa;if(_0x36604a===_0x30b6f4)break;else _0x14a983['push'](_0x14a983['shift']());}catch(_0x150ec7){_0x14a983['push'](_0x14a983['shift']());}}}(a74_0x27a1,0x8d49e));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';function env(_0x1a1050){const _0x1fd2b8=a74_0x36b2;return process['env'][_0x1fd2b8(0x13d)+_0x1a1050]||process[_0x1fd2b8(0xfa)][_0x1fd2b8(0x104)+_0x1a1050]||undefined;}export const NEW_CONFIG_NAME=a74_0x581bc8(0xf7);export const CONFIG_NAMES=[a74_0x581bc8(0xf7),a74_0x581bc8(0x115),a74_0x581bc8(0x13c)];export function resolveConfigPath(_0x225baa){for(const _0xd4f3d7 of CONFIG_NAMES){const _0x38530a=resolve(_0x225baa,_0xd4f3d7);if(existsSync(_0x38530a))return _0x38530a;}return undefined;}export async function createContext(_0x32d4bd){const _0x23bf62=a74_0x581bc8,_0x53957e=readRawConfig(),_0x3ff99f=buildConfig(_0x53957e,_0x32d4bd),{initEnv:_0x563651}=await import(_0x23bf62(0x13f));if(_0x3ff99f[_0x23bf62(0xfa)])_0x563651(_0x3ff99f['env']);else _0x32d4bd['env']&&typeof _0x32d4bd['env']===_0x23bf62(0x126)&&_0x563651(_0x32d4bd['env']);const {initDomains:_0x212b15,getUserDomain:_0x48c339,getApiDomain:_0x210dcb}=await import(_0x23bf62(0xfd));_0x212b15({'apiDomain':_0x53957e['apiDomain']||undefined,'userDomain':_0x53957e[_0x23bf62(0x122)]||undefined,'runtimeDomain':_0x53957e['runtimeDomain']||undefined});const _0x37e029={'apiDomain':_0x210dcb(),'userDomain':_0x48c339()},_0x124752=await buildAuth(_0x3ff99f);logger['setLogPath'](process[_0x23bf62(0x113)]());const _0x542405=(CLI_BIN_NAME+'\x20'+process[_0x23bf62(0x136)][_0x23bf62(0x102)](0x2)[_0x23bf62(0x110)]('\x20'))['trim']();logger[_0x23bf62(0x12e)](_0x542405);const _0x1bfb5b=isNonInteractiveMode(_0x32d4bd);return{'config':_0x3ff99f,'auth':_0x124752,'logger':logger,'env':_0x37e029,'nonInteractive':_0x1bfb5b};}export function buildConfigFromFlags(_0x98035c){return buildConfig(readRawConfig(),_0x98035c);}export function getProjectConfigPath(){const _0x2f619c=a74_0x581bc8;return resolveConfigPath(process[_0x2f619c(0x113)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}function a74_0x27a1(){const _0x55efcf=['true','project','stringify','APP','entries','join','FORMAT','online','cwd','PAGE_SIZE','.lovrabet.json','./src/api','defaultApp','format','6AGAWOD','760922WlvmBR','ENV','isTTY','stdin','setRawMode','appcode','APPCODE','./auth/get-cookie.js','userDomain','3966190cECKHW','high-risk-write','maxRisk','string','13584qimSFJ','1331928ehJRmw','production','trim','cookie','object','isRaw','setRawCommand','riskLevel','length','pageSize','5195830rIvUNW','table','json','locale','argv','stdout','apiDir','.tmp','8gSMgVp','accessKey','.lovrabetrc','RABETBASE_','309uWMihP','./constant/env.js','3406228IYyEue','.rabetbase.json','utf8','nonInteractive','env','parse','apps','./constant/domain.js','ACCESS_KEY','RISK_LEVEL','read','keys','slice','COOKIE','LOVRABET_','daily','app','en-US','130180bzdOQi','VERBOSE','write'];a74_0x27a1=function(){return _0x55efcf;};return a74_0x27a1();}export function readRawConfig(_0x402d42){const _0x195a65=a74_0x581bc8;let _0x323587={},_0x2a2da4={};try{const _0x433ec4=resolveConfigPath(homedir());if(_0x433ec4){const _0x433f4d=readFileSync(_0x433ec4,{'encoding':'utf8'});if(_0x433f4d)_0x323587=JSON[_0x195a65(0xfb)](_0x433f4d);}}catch{}try{const _0x5dbfbf=_0x402d42||process['cwd'](),_0x411542=resolveConfigPath(_0x5dbfbf);if(_0x411542){const _0xaac3a9=readFileSync(_0x411542,{'encoding':_0x195a65(0xf8)});if(_0xaac3a9)_0x2a2da4=JSON[_0x195a65(0xfb)](_0xaac3a9);}}catch{}const _0x22fd7b=_0x323587[_0x195a65(0xfc)]&&typeof _0x323587['apps']===_0x195a65(0x12c)?_0x323587['apps']:{},_0x5a5135=_0x2a2da4['apps']&&typeof _0x2a2da4[_0x195a65(0xfc)]==='object'?_0x2a2da4['apps']:{},_0x4c71d9={..._0x22fd7b,..._0x5a5135},_0x18556a={..._0x323587,..._0x2a2da4};Object[_0x195a65(0x101)](_0x4c71d9)[_0x195a65(0x130)]>0x0&&(_0x18556a['apps']=_0x4c71d9);if('defaultApp'in _0x2a2da4)_0x18556a[_0x195a65(0x117)]=_0x2a2da4[_0x195a65(0x117)];else{if(_0x5a5135&&Object[_0x195a65(0x101)](_0x5a5135)[_0x195a65(0x130)]>0x0)_0x18556a[_0x195a65(0x117)]=Object[_0x195a65(0x101)](_0x5a5135)[0x0];else _0x323587['defaultApp']&&(_0x18556a[_0x195a65(0x117)]=_0x323587['defaultApp']);}return _0x18556a;}export function readConfigFile(_0x1d108e){const _0x47046f=a74_0x581bc8;try{if(existsSync(_0x1d108e)){const _0x4b9493=readFileSync(_0x1d108e,{'encoding':'utf8'});if(_0x4b9493)return JSON[_0x47046f(0xfb)](_0x4b9493);}}catch{}return{};}export function writeConfigFile(_0x2e50a6,_0x1579c5){const _0x191aaf=a74_0x581bc8,_0x15a383=dirname(_0x2e50a6);!existsSync(_0x15a383)&&mkdirSync(_0x15a383,{'recursive':!![]});const _0x18aa64=_0x2e50a6+_0x191aaf(0x139);try{writeFileSync(_0x18aa64,JSON[_0x191aaf(0x10d)](_0x1579c5,null,0x2)+'\x0a',{'encoding':_0x191aaf(0xf8),'mode':0x180}),renameSync(_0x18aa64,_0x2e50a6);}catch(_0x43dafc){try{unlinkSync(_0x18aa64);}catch{}throw _0x43dafc;}}export function resolveWriteConfigPath(_0x1ecc7b){const _0x22bc2d=a74_0x581bc8,_0x2c05f6=_0x1ecc7b===_0x22bc2d(0x10c)?process['cwd']():homedir(),_0x1f8ab6=resolveConfigPath(_0x2c05f6);return _0x1f8ab6??resolve(_0x2c05f6,NEW_CONFIG_NAME);}function buildConfig(_0xe6442a,_0x5a358d){const _0x50cbce=a74_0x581bc8,_0x17bdf1={};if(_0xe6442a[_0x50cbce(0xfc)]&&typeof _0xe6442a[_0x50cbce(0xfc)]===_0x50cbce(0x12c))for(const [_0x21d9e8,_0x276ceb]of Object[_0x50cbce(0x10f)](_0xe6442a[_0x50cbce(0xfc)])){_0x276ceb&&typeof _0x276ceb===_0x50cbce(0x12c)&&_0x276ceb[_0x50cbce(0x11f)]&&(_0x17bdf1[_0x21d9e8]=_0x276ceb);}const _0x4542ff=_0xe6442a[_0x50cbce(0x117)]||undefined,_0xde3da5=Object[_0x50cbce(0x101)](_0x17bdf1)[_0x50cbce(0x130)]>0x0,_0x3a75b5=_0x5a358d[_0x50cbce(0x106)]||env(_0x50cbce(0x10e))||undefined;let _0x4c786a=_0x3a75b5||_0x4542ff||undefined,_0x210809=_0x4c786a&&_0x17bdf1[_0x4c786a]?_0x17bdf1[_0x4c786a]:undefined;if(_0x5a358d[_0x50cbce(0x11f)]&&!_0x3a75b5){const _0x3586e2=Object[_0x50cbce(0x10f)](_0x17bdf1)['find'](([_0x24cde3,_0x2285de])=>_0x2285de[_0x50cbce(0x11f)]===_0x5a358d[_0x50cbce(0x11f)]);_0x3586e2&&(_0x4c786a=_0x3586e2[0x0],_0x210809=_0x3586e2[0x1]);}const _0x21f5ea=_0x3a75b5||(_0x5a358d[_0x50cbce(0x11f)]&&_0x4c786a&&!_0x4542ff?_0x4c786a:undefined),_0x2ef229=_0x5a358d['appcode']||env(_0x50cbce(0x120))||_0x210809?.['appcode']||_0xe6442a['appcode']||_0xe6442a[_0x50cbce(0x106)]||undefined,_0x574915=_0x5a358d[_0x50cbce(0xfa)]||env(_0x50cbce(0x11b))||_0x210809?.[_0x50cbce(0xfa)]||_0xe6442a[_0x50cbce(0xfa)]||_0x50cbce(0x129),_0x5d7fc6=_0x210809?.[_0x50cbce(0x135)]||_0xe6442a['locale']||_0x50cbce(0x107),_0x56abe8=env(_0x50cbce(0x103))||_0x210809?.['cookie']||_0xe6442a[_0x50cbce(0x12b)]||undefined,_0x11c7e9=env(_0x50cbce(0xfe))||_0x210809?.['accessKey']||_0xe6442a[_0x50cbce(0x13b)]||undefined,_0x500e22=_0x5a358d[_0x50cbce(0x118)]||env(_0x50cbce(0x111))||_0x210809?.[_0x50cbce(0x118)]||_0xe6442a[_0x50cbce(0x118)],_0x4db6a3=_0x500e22===_0x50cbce(0x134)||_0x500e22==='pretty'||_0x500e22===_0x50cbce(0x133)?_0x500e22:undefined,_0x56c743=env(_0x50cbce(0x114))||_0x210809?.[_0x50cbce(0x131)]||_0xe6442a[_0x50cbce(0x131)],_0x4697eb=_0x56c743?Number(_0x56c743)||undefined:undefined,_0x47197b=env(_0x50cbce(0xff))||env('MAX_RISK')||_0x210809?.['riskLevel']||_0xe6442a[_0x50cbce(0x12f)]||_0xe6442a[_0x50cbce(0x125)],_0x3056f4=_0x47197b===_0x50cbce(0x100)||_0x47197b===_0x50cbce(0x10a)?_0x47197b:_0x50cbce(0x124),_0x39adb4=env(_0x50cbce(0x109)),_0x1f4841=_0x39adb4==='1'||_0x39adb4==='true',_0x41cd3a=_0x210809?.[_0x50cbce(0x138)]||_0xe6442a['apiDir']||_0x50cbce(0x116);return{'appCode':typeof _0x2ef229===_0x50cbce(0x126)&&_0x2ef229[_0x50cbce(0x12a)]()?_0x2ef229[_0x50cbce(0x12a)]():undefined,'env':_0x574915===_0x50cbce(0x112)?_0x50cbce(0x129):_0x574915===_0x50cbce(0x105)?_0x50cbce(0x105):_0x50cbce(0x129),'locale':_0x5d7fc6,'cookie':_0x56abe8,'accessKey':_0x11c7e9,'format':_0x4db6a3,'pageSize':_0x4697eb,'riskLevel':_0x3056f4,'verbose':_0x1f4841,'apiDir':_0x41cd3a,'apps':_0x17bdf1,'defaultApp':_0x4542ff,'currentApp':_0xde3da5?_0x4c786a:undefined,'explicitAppName':_0x21f5ea,'raw':_0xe6442a};}async function buildAuth(_0x46d961){const _0x223d01=a74_0x581bc8,{getCookie:_0xf18e16}=await import(_0x223d01(0x121)),_0x1ffc24=_0x46d961[_0x223d01(0x12b)]||_0xf18e16(),_0x4b22b2=_0x1ffc24?await getIsSessionValid():![];return{'cookie':_0x1ffc24,'isLoggedIn':_0x4b22b2,async 'getOrLogin'(){if(_0x1ffc24&&_0x4b22b2)return _0x1ffc24;throw CliErrors['authRequired']();}};}function a74_0x36b2(_0x51d6c0,_0x17cc2d){_0x51d6c0=_0x51d6c0-0xf7;const _0x27a1a1=a74_0x27a1();let _0x36b2d3=_0x27a1a1[_0x51d6c0];return _0x36b2d3;}function isNonInteractiveMode(_0x1166e7){const _0x66c1d9=a74_0x581bc8;return!!(_0x1166e7[_0x66c1d9(0xf9)]||_0x1166e7['ci']||env('CI')===_0x66c1d9(0x10b)||process[_0x66c1d9(0xfa)]['CI']===_0x66c1d9(0x10b)||!process[_0x66c1d9(0x137)][_0x66c1d9(0x11c)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x2f8f0a=a74_0x581bc8;if(!process['stdin'][_0x2f8f0a(0x11c)])return![];try{const _0x5b0f92=process[_0x2f8f0a(0x11d)][_0x2f8f0a(0x12d)];return process['stdin'][_0x2f8f0a(0x11e)](!![]),process['stdin'][_0x2f8f0a(0x11e)](_0x5b0f92??![]),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x52a86c,_0x391fa0){const _0x49bbd4=a75_0x11aa,_0x25968d=_0x52a86c();while(!![]){try{const _0x8d6ff=parseInt(_0x49bbd4(0xb0))/0x1+parseInt(_0x49bbd4(0xa8))/0x2+-parseInt(_0x49bbd4(0xb3))/0x3*(-parseInt(_0x49bbd4(0xb6))/0x4)+parseInt(_0x49bbd4(0xba))/0x5*(-parseInt(_0x49bbd4(0xb1))/0x6)+parseInt(_0x49bbd4(0xad))/0x7+-parseInt(_0x49bbd4(0xb7))/0x8*(-parseInt(_0x49bbd4(0xa7))/0x9)+-parseInt(_0x49bbd4(0xa9))/0xa;if(_0x8d6ff===_0x391fa0)break;else _0x25968d['push'](_0x25968d['shift']());}catch(_0x29f3e9){_0x25968d['push'](_0x25968d['shift']());}}}(a75_0x1511,0x3a7e9));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x4ca877){const _0x525cc5=a75_0x11aa,_0x2c122a=[],_0x2bac7f=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x3b7671;while((_0x3b7671=_0x2bac7f[_0x525cc5(0xb2)](_0x4ca877))!==null){_0x2c122a[_0x525cc5(0xae)]({'datasetCode':_0x3b7671[0x1],'tableName':_0x3b7671[0x2],'name':_0x3b7671[0x3],'alias':_0x3b7671[0x4]});}return _0x2c122a;}export function loadAliasMap(_0x56d97b){const _0x24905a=a75_0x11aa,_0x10f908=resolve(process[_0x24905a(0xac)](),_0x56d97b);if(cache[_0x24905a(0xb9)](_0x10f908))return cache[_0x24905a(0xab)](_0x10f908);const _0x5d3ca7=resolve(_0x10f908,_0x24905a(0xb8));if(!existsSync(_0x5d3ca7))return cache[_0x24905a(0xb5)](_0x10f908,[]),[];try{const _0x388d9c=readFileSync(_0x5d3ca7,_0x24905a(0xaf)),_0x4e362b=parseApiFile(_0x388d9c);return cache[_0x24905a(0xb5)](_0x10f908,_0x4e362b),_0x4e362b;}catch{return cache[_0x24905a(0xb5)](_0x10f908,[]),[];}}function a75_0x1511(){const _0x253d7a=['1802227BVRzHQ','push','utf-8','191412POuTwV','1330422UYmkLG','exec','147zRapDD','alias','set','27480dFxDfS','171320JLnriD','api.ts','has','5UlXJov','find','162qPHWxn','762478NBxqPN','10908820mSaZYJ','datasetCode','get','cwd'];a75_0x1511=function(){return _0x253d7a;};return a75_0x1511();}function a75_0x11aa(_0x582b75,_0x17d590){_0x582b75=_0x582b75-0xa6;const _0x15114f=a75_0x1511();let _0x11aa88=_0x15114f[_0x582b75];return _0x11aa88;}export function resolveAlias(_0x42199f,_0x4293af){const _0x3e4107=a75_0x11aa;if(!_0x4293af)return undefined;const _0xf5e854=loadAliasMap(_0x42199f),_0x3b7a50=_0xf5e854[_0x3e4107(0xa6)](_0x29acc6=>_0x29acc6[_0x3e4107(0xb4)]===_0x4293af);return _0x3b7a50?.[_0x3e4107(0xaa)];}export function listAliases(_0x1a320){return loadAliasMap(_0x1a320);}
|