@lovrabet/rabetbase-cli 2.0.2-beta.7 → 2.0.2-beta.8
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/get-session-user.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 -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/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 -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/flags.js +1 -1
- 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 -1
- 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 -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/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -1
- 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/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/otel-logger-version.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.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 +1 -1
package/lib/commands/run.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x1ee41e=a61_0x3c90;(function(_0x3ff7be,_0x596034){const _0x1a1b50=a61_0x3c90,_0x369eb5=_0x3ff7be();while(!![]){try{const _0x21ec93=parseInt(_0x1a1b50(0x180))/0x1*(-parseInt(_0x1a1b50(0x1a4))/0x2)+-parseInt(_0x1a1b50(0x17d))/0x3*(-parseInt(_0x1a1b50(0x198))/0x4)+-parseInt(_0x1a1b50(0x19d))/0x5+-parseInt(_0x1a1b50(0x182))/0x6+parseInt(_0x1a1b50(0x18a))/0x7+-parseInt(_0x1a1b50(0x19e))/0x8+-parseInt(_0x1a1b50(0x181))/0x9*(-parseInt(_0x1a1b50(0x18d))/0xa);if(_0x21ec93===_0x596034)break;else _0x369eb5['push'](_0x369eb5['shift']());}catch(_0x493b5d){_0x369eb5['push'](_0x369eb5['shift']());}}}(a61_0x415a,0x20006));import{readFileSync,existsSync}from'node:fs';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a61_0x3c90(_0x543110,_0x1cb4ee){_0x543110=_0x543110-0x171;const _0x415a76=a61_0x415a();let _0x3c9032=_0x415a76[_0x543110];return _0x3c9032;}const VERSION_CHECK_SCRIPTS=new Set([a61_0x1ee41e(0x1a7),a61_0x1ee41e(0x17e)]);function readPackageScripts(_0x32402b){const _0x5f43f4=a61_0x1ee41e,_0x23a332=resolve(_0x32402b,_0x5f43f4(0x189));if(!existsSync(_0x23a332))return null;try{const _0x492c72=JSON[_0x5f43f4(0x196)](readFileSync(_0x23a332,'utf-8'));return _0x492c72[_0x5f43f4(0x17c)]??{};}catch{return null;}}function detectPackageManager(_0x13414f){const _0x1c47b9=a61_0x1ee41e;if(existsSync(resolve(_0x13414f,'bun.lockb'))||existsSync(resolve(_0x13414f,'bun.lock')))return _0x1c47b9(0x188);if(existsSync(resolve(_0x13414f,_0x1c47b9(0x171))))return'pnpm';if(existsSync(resolve(_0x13414f,_0x1c47b9(0x19a))))return'yarn';return _0x1c47b9(0x172);}async function versionCheck(_0x4560cf){const _0x241947=a61_0x1ee41e,_0x2fba0d=await checkCliVersion();if(_0x2fba0d['needsUpgrade'])printCliUpgradeWarning(_0x2fba0d);const _0x6782c0=await checkSdkVersion(_0x4560cf);if(_0x6782c0[_0x241947(0x1a6)])printSdkUpgradeWarning(_0x6782c0);}function spawnScript(_0x2c88d7,_0x4d6e90,_0x21f10f,_0xbe90bd){return new Promise((_0xa506c2,_0x24806e)=>{const _0x457318=a61_0x3c90,_0x59ed2f=['run',_0x4d6e90,..._0x21f10f],_0x72e61c=spawn(_0x2c88d7,_0x59ed2f,{'cwd':_0xbe90bd,'stdio':_0x457318(0x17f),'shell':!![],'env':{...process[_0x457318(0x199)],'PATH':''+join(_0xbe90bd,_0x457318(0x175),_0x457318(0x193))+delimiter+process[_0x457318(0x199)][_0x457318(0x19b)]}});_0x72e61c['on'](_0x457318(0x184),_0x3acf42=>{const _0x5e5dd8=_0x457318;if(_0x3acf42===0x0||_0x3acf42===null)_0xa506c2();else _0x24806e(new Error(_0x2c88d7+_0x5e5dd8(0x18e)+_0x4d6e90+'\x20exited\x20with\x20code\x20'+_0x3acf42));}),_0x72e61c['on']('error',_0x24806e);});}function spawnViteBuildWatch(_0x30c360){return new Promise((_0x39e6d7,_0x2ed87b)=>{const _0x19c733=a61_0x3c90,_0x132dcc=spawn(_0x19c733(0x18c),[_0x19c733(0x1a3),'--watch'],{'cwd':_0x30c360,'stdio':'inherit','shell':!![],'env':{...process[_0x19c733(0x199)],'PATH':''+join(_0x30c360,_0x19c733(0x175),_0x19c733(0x193))+delimiter+process[_0x19c733(0x199)][_0x19c733(0x19b)]}});_0x132dcc['on'](_0x19c733(0x184),_0x2830a4=>{const _0x381a8a=_0x19c733;if(_0x2830a4===0x0||_0x2830a4===null)_0x39e6d7();else _0x2ed87b(new Error(_0x381a8a(0x17b)+_0x2830a4));}),_0x132dcc['on'](_0x19c733(0x1a5),_0x2ed87b);});}function spawnVitePreview(_0x38f00e){return new Promise((_0x480ce5,_0x3c677c)=>{const _0x5cb7bb=a61_0x3c90,_0xfe2732=spawn(_0x5cb7bb(0x18c),[_0x5cb7bb(0x173)],{'cwd':_0x38f00e,'stdio':_0x5cb7bb(0x17f),'shell':!![],'env':{...process[_0x5cb7bb(0x199)],'PATH':''+join(_0x38f00e,_0x5cb7bb(0x175),'.bin')+delimiter+process[_0x5cb7bb(0x199)][_0x5cb7bb(0x19b)]}});_0xfe2732['on'](_0x5cb7bb(0x184),_0x1a4a0b=>{const _0x295a24=_0x5cb7bb;if(_0x1a4a0b===0x0||_0x1a4a0b===null)_0x480ce5();else _0x3c677c(new Error(_0x295a24(0x190)+_0x1a4a0b));}),_0xfe2732['on'](_0x5cb7bb(0x1a5),_0x3c677c);});}export const runCommand={'name':'run','description':a61_0x1ee41e(0x18f),async 'run'(_0x43b0b3,_0x9a9b6e,_0x285bc6){const _0xe5a7dd=a61_0x1ee41e,_0x44d9f2=process[_0xe5a7dd(0x186)](),_0x3a986d=_0x9a9b6e[0x0],_0x5baa0e=_0x9a9b6e[_0xe5a7dd(0x185)](0x1),_0x13553e=readPackageScripts(_0x44d9f2);!_0x13553e&&(console['error']('Error:\x20No\x20package.json\x20found\x20in\x20current\x20directory.'),process[_0xe5a7dd(0x187)](0x1));if(!_0x3a986d){const _0x2f3004=Object['keys'](_0x13553e);if(_0x2f3004[_0xe5a7dd(0x19f)]===0x0)console[_0xe5a7dd(0x1a1)](_0xe5a7dd(0x17a));else{console[_0xe5a7dd(0x1a1)](_0xe5a7dd(0x194));const _0x974539=Math[_0xe5a7dd(0x179)](..._0x2f3004['map'](_0x3fa6b0=>_0x3fa6b0['length']));for(const [_0x4a86b1,_0x5e4054]of Object['entries'](_0x13553e)){console[_0xe5a7dd(0x1a1)](_0xe5a7dd(0x174)+_0x4a86b1[_0xe5a7dd(0x177)](_0x974539+0x2)+_0x5e4054);}console['log']('\x0a\x20\x20Usage:\x20rabetbase\x20run\x20<script>\x0a');}return;}!_0x13553e[_0x3a986d]&&(console[_0xe5a7dd(0x1a5)](_0xe5a7dd(0x18b)+_0x3a986d+_0xe5a7dd(0x183)+(_0xe5a7dd(0x1a0)+(Object[_0xe5a7dd(0x191)](_0x13553e)[_0xe5a7dd(0x195)](',\x20')||_0xe5a7dd(0x19c)))),process['exit'](0x1));const _0x55796d=detectPackageManager(_0x44d9f2);VERSION_CHECK_SCRIPTS['has'](_0x3a986d)&&await versionCheck(_0x44d9f2);if(_0x3a986d==='preview'&&_0x285bc6[_0xe5a7dd(0x197)]){_0x43b0b3['logger'][_0xe5a7dd(0x1a2)](_0xe5a7dd(0x176),'preview\x20--watch\x20mode:\x20vite\x20build\x20--watch\x20+\x20vite\x20preview'),await Promise[_0xe5a7dd(0x178)]([spawnViteBuildWatch(_0x44d9f2),spawnVitePreview(_0x44d9f2)]);return;}_0x43b0b3[_0xe5a7dd(0x192)][_0xe5a7dd(0x1a2)](_0xe5a7dd(0x176),_0x55796d+'\x20run\x20'+_0x3a986d+(_0x5baa0e[_0xe5a7dd(0x19f)]?'\x20'+_0x5baa0e[_0xe5a7dd(0x195)]('\x20'):'')),await spawnScript(_0x55796d,_0x3a986d,_0x5baa0e,_0x44d9f2);}};function a61_0x415a(){const _0x24db0e=['preview','\x20\x20\x20\x20','node_modules','run','padEnd','all','max','No\x20scripts\x20defined\x20in\x20package.json.','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','scripts','66gDNKPu','dev','inherit','3197WOVnYH','1107747lEAuja','433332YxYmkH','\x22\x20not\x20found\x20in\x20package.json.\x0a','close','slice','cwd','exit','bun','package.json','1632085MbeWyD','Error:\x20Script\x20\x22','vite','20xhKAOn','\x20run\x20','Run\x20a\x20package.json\x20script','vite\x20preview\x20exited\x20with\x20code\x20','keys','logger','.bin','\x0a\x20\x20Available\x20scripts:\x0a','join','parse','watch','20012AIEXps','env','yarn.lock','PATH','(none)','1146380bPRFFF','1152184mckyNz','length','\x20\x20Available:\x20','log','info','build','8NWrLNT','error','needsUpgrade','start','pnpm-lock.yaml','npm'];a61_0x415a=function(){return _0x24db0e;};return a61_0x415a();}
|
package/lib/commands/skill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a62_0x19f7(){const _0x215a78=['nonInteractive','npx\x20skills\x20add\x20failed:\x20','log','Check\x20network\x20connectivity\x20and\x20try\x20again.','inherit','28ZcYvKG','219237eDItpB','1132750eQEkAZ','rabetbase\x20skill\x20installed','error','7026288BPScOS','29049584ITtApL','info','unknown','logger','install','cwd','3553244cNBgXy','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','321362xQaemq','6893803NqNpqL','skill-install','lovrabet/rabetbase','pipe'];a62_0x19f7=function(){return _0x215a78;};return a62_0x19f7();}(function(_0x220a45,_0xe3897d){const _0xe53514=a62_0x4a49,_0x4a14b3=_0x220a45();while(!![]){try{const _0x4dfc3d=-parseInt(_0xe53514(0x169))/0x1+-parseInt(_0xe53514(0x173))/0x2*(parseInt(_0xe53514(0x174))/0x3)+-parseInt(_0xe53514(0x167))/0x4+-parseInt(_0xe53514(0x175))/0x5+-parseInt(_0xe53514(0x178))/0x6+parseInt(_0xe53514(0x16a))/0x7+parseInt(_0xe53514(0x179))/0x8;if(_0x4dfc3d===_0xe3897d)break;else _0x4a14b3['push'](_0x4a14b3['shift']());}catch(_0x681168){_0x4a14b3['push'](_0x4a14b3['shift']());}}}(a62_0x19f7,0xf0a32));import{skillsCommand as a62_0x5b30ae}from'../skills/main.js';function a62_0x4a49(_0x9126ae,_0xf6c95b){_0x9126ae=_0x9126ae-0x167;const _0x19f727=a62_0x19f7();let _0x4a4977=_0x19f727[_0x9126ae];return _0x4a4977;}import{CliErrors}from'../errors.js';export const skillCommand={'name':'skill','description':'Install\x20skill\x20packages',async 'run'(_0x48a4bd,_0x3cc2bc,_0x12864d){const _0x4df4d7=a62_0x4a49,_0x3b8aaf=_0x3cc2bc[0x0];if(_0x3b8aaf===_0x4df4d7(0x17d)){_0x48a4bd[_0x4df4d7(0x17c)]['setLogPath'](process[_0x4df4d7(0x17e)]()),_0x48a4bd[_0x4df4d7(0x17c)][_0x4df4d7(0x17a)](_0x4df4d7(0x16b),'执行安装技能包命令(委托给\x20npx\x20skills\x20--global)');const {runNpxSkillsAddGlobal:_0x3f4fd5}=await import('../skills/npx-skills-add.js'),_0xb1bd21=_0x48a4bd[_0x4df4d7(0x16e)]?_0x4df4d7(0x16d):_0x4df4d7(0x172);console['log'](_0x4df4d7(0x168));const _0x509408=_0x3f4fd5(process[_0x4df4d7(0x17e)](),_0x4df4d7(0x16c),{'stdio':_0xb1bd21});if(_0x509408['skipped'])console[_0x4df4d7(0x170)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x509408['ok'])console[_0x4df4d7(0x170)](_0x4df4d7(0x176));else throw CliErrors['apiError'](_0x4df4d7(0x16f)+(_0x509408[_0x4df4d7(0x177)]||_0x4df4d7(0x17b)),_0x4df4d7(0x171));}}else await a62_0x5b30ae(_0x3b8aaf,[],_0x12864d);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a63_0x5965(_0x26ca75,_0x1c702b){_0x26ca75=_0x26ca75-0x9d;const _0x5e8816=a63_0x5e88();let _0x59657a=_0x5e8816[_0x26ca75];return _0x59657a;}const a63_0x49b3de=a63_0x5965;function a63_0x5e88(){const _0x1a5e4d=['description','sqlcode','1185JBqzCf','sql','9369830eGWpIH','31tfCEiW','detail','read','1440zdcwph','678mbJKQQ','bool','34792087vPmMGh','4107138ehsoEy','sqlContent','verbose','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','str','44802eGTUtG','dbId','90194GIFbAe','25788vFQIAn','appCode','68033CgNUhq'];a63_0x5e88=function(){return _0x1a5e4d;};return a63_0x5e88();}(function(_0x52f92e,_0xe61919){const _0x5ba253=a63_0x5965,_0x47a796=_0x52f92e();while(!![]){try{const _0x42a573=-parseInt(_0x5ba253(0xb1))/0x1*(parseInt(_0x5ba253(0xa8))/0x2)+-parseInt(_0x5ba253(0xa1))/0x3+-parseInt(_0x5ba253(0xa9))/0x4*(-parseInt(_0x5ba253(0xae))/0x5)+parseInt(_0x5ba253(0x9e))/0x6*(-parseInt(_0x5ba253(0xab))/0x7)+-parseInt(_0x5ba253(0x9d))/0x8*(-parseInt(_0x5ba253(0xa6))/0x9)+-parseInt(_0x5ba253(0xb0))/0xa+parseInt(_0x5ba253(0xa0))/0xb;if(_0x42a573===_0xe61919)break;else _0x47a796['push'](_0x47a796['shift']());}catch(_0x5293b4){_0x47a796['push'](_0x47a796['shift']());}}}(a63_0x5e88,0xbf8e5));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../common/flags.js';export const sqlDetail={'service':a63_0x49b3de(0xaf),'command':a63_0x49b3de(0xb2),'description':a63_0x49b3de(0xa4),'risk':a63_0x49b3de(0xb3),'flags':[SQLCODE_FLAG,{'name':a63_0x49b3de(0xa3),'type':'boolean','description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x4fbe07){const _0x3ff854=a63_0x49b3de,_0x4c6ad9=await getSqlQueryInfo(_0x4fbe07[_0x3ff854(0xaa)],_0x4fbe07[_0x3ff854(0xa5)](_0x3ff854(0xad))),_0x1c674a=_0x4fbe07[_0x3ff854(0x9f)](_0x3ff854(0xa3));if(_0x1c674a)return{'ok':!![],'data':_0x4c6ad9};const _0x52f99e=_0x4c6ad9[_0x3ff854(0xa7)]?await getDbName(_0x4fbe07[_0x3ff854(0xaa)],_0x4c6ad9[_0x3ff854(0xa7)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4c6ad9['sqlCode'],'sqlName':_0x4c6ad9['sqlName'],'db':_0x52f99e?_0x52f99e+'\x20('+_0x4c6ad9[_0x3ff854(0xa7)]+')':_0x4c6ad9[_0x3ff854(0xa7)]??'','description':_0x4c6ad9[_0x3ff854(0xac)]??'','sqlContent':_0x4c6ad9[_0x3ff854(0xa2)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x1aa5e0=a64_0x18d8;(function(_0xfac349,_0x3181e9){const _0x1da3bd=a64_0x18d8,_0x4021c6=_0xfac349();while(!![]){try{const _0x3c135d=parseInt(_0x1da3bd(0x1f6))/0x1+-parseInt(_0x1da3bd(0x1e9))/0x2*(-parseInt(_0x1da3bd(0x1fd))/0x3)+parseInt(_0x1da3bd(0x1f4))/0x4+parseInt(_0x1da3bd(0x1fc))/0x5*(-parseInt(_0x1da3bd(0x1f3))/0x6)+-parseInt(_0x1da3bd(0x201))/0x7+-parseInt(_0x1da3bd(0x1f1))/0x8+-parseInt(_0x1da3bd(0x1ec))/0x9;if(_0x3c135d===_0x3181e9)break;else _0x4021c6['push'](_0x4021c6['shift']());}catch(_0x15b488){_0x4021c6['push'](_0x4021c6['shift']());}}}(a64_0x2834,0x95ea6));import{executeSql}from'../../core/api-client.js';function a64_0x2834(){const _0x243f7d=['execResult','4190968DMePWa','execError','9984bTEprT','3579764eyUIMI','isArray','763477FuKCyP','validation','read','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','str','Invalid\x20JSON\x20for\x20--params:\x20','295PYrdko','342tcZCOn','parse','sqlcode','sql','3342157LmzGDs','\x20row(s)\x20in\x20','Returned\x20','exec','string','appCode','13524lbzbtH','length','SQL\x20execution\x20failed','6441606dPyJyX','now','execSuccess','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode'];a64_0x2834=function(){return _0x243f7d;};return a64_0x2834();}function a64_0x18d8(_0x1da504,_0x2ec43a){_0x1da504=_0x1da504-0x1e8;const _0x2834f9=a64_0x2834();let _0x18d80b=_0x2834f9[_0x1da504];return _0x18d80b;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../common/flags.js';export const sqlExec={'service':a64_0x1aa5e0(0x200),'command':a64_0x1aa5e0(0x204),'description':a64_0x1aa5e0(0x1ef),'risk':a64_0x1aa5e0(0x1f8),'flags':[SQLCODE_FLAG,{'name':'params','type':a64_0x1aa5e0(0x205),'description':a64_0x1aa5e0(0x1f9)}],async 'execute'(_0x44af4a){const _0x2448a9=a64_0x1aa5e0;let _0x235e38;const _0x2b0663=_0x44af4a[_0x2448a9(0x1fa)]('params');if(_0x2b0663)try{_0x235e38=JSON[_0x2448a9(0x1fe)](_0x2b0663);}catch{throw CliErrors[_0x2448a9(0x1f7)](_0x2448a9(0x1fb)+_0x2b0663);}const _0x984b69=Date[_0x2448a9(0x1ed)](),_0x14da4f=await executeSql(_0x44af4a[_0x2448a9(0x1e8)],_0x44af4a[_0x2448a9(0x1fa)](_0x2448a9(0x1ff)),_0x235e38),_0x1a178d=Date[_0x2448a9(0x1ed)]()-_0x984b69,_0x4299b0=_0x14da4f?.[_0x2448a9(0x1f0)]??_0x14da4f,_0x3ef2fe=_0x14da4f?.[_0x2448a9(0x1ee)]??!![];if(!_0x3ef2fe)return{'ok':![],'data':{'error':_0x14da4f?.[_0x2448a9(0x1f2)]||'SQL\x20execution\x20failed','elapsed':_0x1a178d},'message':_0x2448a9(0x1eb)};const _0x3d9d9e=Array[_0x2448a9(0x1f5)](_0x4299b0)?_0x4299b0:[];return{'ok':!![],'data':{'rows':_0x3d9d9e,'rowCount':_0x3d9d9e[_0x2448a9(0x1ea)],'elapsed':_0x1a178d},'message':_0x2448a9(0x203)+_0x3d9d9e[_0x2448a9(0x1ea)]+_0x2448a9(0x202)+_0x1a178d+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a65_0x1f6e(){const _0x5c0503=['64ySleIG','214043QzJDxC','4OnxKAC','1092AhCKWm','32892ZKkaQH','64gEIQxN','66560OWgtrZ','2987880idYsXF','60weGDuF','572517mXbGex','246TjRRfr','1382854LAwQdF','19545mZrYoT'];a65_0x1f6e=function(){return _0x5c0503;};return a65_0x1f6e();}(function(_0x1cd279,_0x1cbc9f){const _0x7180a8=a65_0x1485,_0x3b02da=_0x1cd279();while(!![]){try{const _0x28200f=-parseInt(_0x7180a8(0x9e))/0x1*(-parseInt(_0x7180a8(0x9f))/0x2)+parseInt(_0x7180a8(0x9c))/0x3*(parseInt(_0x7180a8(0xa2))/0x4)+-parseInt(_0x7180a8(0xa3))/0x5*(parseInt(_0x7180a8(0x9a))/0x6)+parseInt(_0x7180a8(0x97))/0x7+parseInt(_0x7180a8(0x9d))/0x8*(parseInt(_0x7180a8(0x99))/0x9)+-parseInt(_0x7180a8(0x98))/0xa*(parseInt(_0x7180a8(0x9b))/0xb)+parseInt(_0x7180a8(0xa1))/0xc*(parseInt(_0x7180a8(0xa0))/0xd);if(_0x28200f===_0x1cbc9f)break;else _0x3b02da['push'](_0x3b02da['shift']());}catch(_0x34672a){_0x3b02da['push'](_0x3b02da['shift']());}}}(a65_0x1f6e,0x6139e));import{sqlList}from'./list.js';import{sqlDetail}from'./detail.js';function a65_0x1485(_0x1bca59,_0x3f15f9){_0x1bca59=_0x1bca59-0x97;const _0x1f6eef=a65_0x1f6e();let _0x148526=_0x1f6eef[_0x1bca59];return _0x148526;}import{sqlValidate}from'./validate.js';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 a66_0x45b18e=a66_0x3e90;function a66_0x3e90(_0x1cdb1c,_0x131196){_0x1cdb1c=_0x1cdb1c-0x129;const _0x215355=a66_0x2153();let _0x3e90f0=_0x215355[_0x1cdb1c];return _0x3e90f0;}(function(_0x208fc7,_0x52b98e){const _0x458a38=a66_0x3e90,_0xff49e4=_0x208fc7();while(!![]){try{const _0xf42dcc=parseInt(_0x458a38(0x13d))/0x1+-parseInt(_0x458a38(0x12a))/0x2+-parseInt(_0x458a38(0x14a))/0x3+parseInt(_0x458a38(0x148))/0x4+parseInt(_0x458a38(0x138))/0x5*(parseInt(_0x458a38(0x13b))/0x6)+parseInt(_0x458a38(0x139))/0x7+-parseInt(_0x458a38(0x13f))/0x8*(parseInt(_0x458a38(0x12c))/0x9);if(_0xf42dcc===_0x52b98e)break;else _0xff49e4['push'](_0xff49e4['shift']());}catch(_0x355098){_0xff49e4['push'](_0xff49e4['shift']());}}}(a66_0x2153,0x3213c));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../common/flags.js';export const sqlList={'service':a66_0x45b18e(0x13a),'command':a66_0x45b18e(0x132),'description':'List\x20custom\x20SQL\x20queries','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a66_0x45b18e(0x129),'type':a66_0x45b18e(0x12d),'description':a66_0x45b18e(0x142)},{'name':'page','type':a66_0x45b18e(0x136),'description':a66_0x45b18e(0x134),'default':0x1},{'name':a66_0x45b18e(0x144),'type':'number','description':a66_0x45b18e(0x130)},{'name':a66_0x45b18e(0x135),'type':a66_0x45b18e(0x12e),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x267488){const _0x5e04ac=a66_0x45b18e,_0xa9f88b=await listSqlQueries(_0x267488[_0x5e04ac(0x146)],{'sqlCode':_0x267488['str'](_0x5e04ac(0x12b))||undefined,'sqlName':_0x267488[_0x5e04ac(0x14b)](_0x5e04ac(0x129))||undefined,'currentPage':_0x267488[_0x5e04ac(0x149)]('page'),'pageSize':_0x267488[_0x5e04ac(0x149)](_0x5e04ac(0x144),0x32)}),_0x8290e4=_0x267488[_0x5e04ac(0x147)](_0x5e04ac(0x135)),_0x3e33e6=_0xa9f88b[_0x5e04ac(0x140)]??[],_0xcf7e69=_0xa9f88b[_0x5e04ac(0x145)]?.[_0x5e04ac(0x131)]??_0x3e33e6[_0x5e04ac(0x137)];let _0xeef302;return _0x8290e4?_0xeef302=_0x3e33e6:_0xeef302=await Promise[_0x5e04ac(0x12f)](_0x3e33e6[_0x5e04ac(0x143)](async _0x1d17fa=>{const _0x116e64=_0x5e04ac,_0x218f15=_0x1d17fa[_0x116e64(0x141)]?await getDbName(_0x267488[_0x116e64(0x146)],_0x1d17fa['dbId']):undefined;return{'sqlCode':_0x1d17fa[_0x116e64(0x133)],'sqlName':_0x1d17fa[_0x116e64(0x13c)],'description':_0x1d17fa['description']??'','db':_0x218f15?_0x218f15+'\x20('+_0x1d17fa[_0x116e64(0x141)]+')':_0x1d17fa[_0x116e64(0x141)]??''};})),{'ok':!![],'data':_0xeef302,'message':_0x3e33e6['length']===0x0?_0x5e04ac(0x13e):'Found\x20'+_0x3e33e6[_0x5e04ac(0x137)]+'\x20SQL\x20queries\x20(total:\x20'+_0xcf7e69+').'};}};function a66_0x2153(){const _0x1d5e91=['sqlCode','Page\x20number','verbose','number','length','15GvofDo','50827NFyiAG','sql','805758yYOQog','sqlName','34148SFdBym','No\x20custom\x20SQL\x20queries\x20found.','72tMBjkP','tableData','dbId','Filter\x20by\x20SQL\x20name','map','pagesize','paging','appCode','bool','1536784DTQHmM','num','745893cGYZBX','str','name','697220qbjpLd','sqlcode','26127HQzjSN','string','boolean','all','Page\x20size','totalCount','list'];a66_0x2153=function(){return _0x1d5e91;};return a66_0x2153();}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x16915f=a67_0x2270;(function(_0x4f8544,_0x49e915){const _0x59e93b=a67_0x2270,_0x5ea3f9=_0x4f8544();while(!![]){try{const _0x931f54=-parseInt(_0x59e93b(0x114))/0x1*(parseInt(_0x59e93b(0x102))/0x2)+parseInt(_0x59e93b(0x111))/0x3+parseInt(_0x59e93b(0xfa))/0x4*(parseInt(_0x59e93b(0x10c))/0x5)+-parseInt(_0x59e93b(0x117))/0x6*(-parseInt(_0x59e93b(0x105))/0x7)+parseInt(_0x59e93b(0x12e))/0x8*(parseInt(_0x59e93b(0x108))/0x9)+parseInt(_0x59e93b(0x12a))/0xa*(-parseInt(_0x59e93b(0x123))/0xb)+-parseInt(_0x59e93b(0x107))/0xc*(parseInt(_0x59e93b(0xff))/0xd);if(_0x931f54===_0x49e915)break;else _0x5ea3f9['push'](_0x5ea3f9['shift']());}catch(_0x426a65){_0x5ea3f9['push'](_0x5ea3f9['shift']());}}}(a67_0x446f,0xeab45));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';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';function a67_0x2270(_0x566cdb,_0x469206){_0x566cdb=_0x566cdb-0xf8;const _0x446fcd=a67_0x446f();let _0x2270d5=_0x446fcd[_0x566cdb];return _0x2270d5;}import{SQLCODE_FLAG_OPTIONAL}from'../common/flags.js';function a67_0x446f(){const _0x3608d6=['84aMpbJQ','99rxprlR','file','dbId','save','16980HxwMMJ','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','sqlCode','Path\x20to\x20the\x20SQL\x20file','cwd','5232867rdVYld','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','\x20|\x20Tables:\x20','1725eipdLD','action','Updated','586794dVzqRI','Validation:\x20','File\x20not\x20found:\x20','SQL\x20query\x20description','length','string','N/A','type','sqlcode','validation','created','appCode','3026485kOtICF','valid','Created','\x20|\x20Params:\x20','SQL\x20query\x20display\x20name','str','POST','50AsHPSC','tables','blocked','join','516064sppXWc','Type:\x20','parameters','description','936PIYkBp','Save\x20SQL\x20query\x20from\x20','sqlType','dbName','\x20successfully','507065nyEwyM','message','SQL\x20validation\x20failed:\x20','1534GkKaHW','sqlname','/api/node-toolbox/sql/save','49lCuasr','utf-8'];a67_0x446f=function(){return _0x3608d6;};return a67_0x446f();}export const sqlSave={'service':'sql','command':a67_0x16915f(0x10b),'description':a67_0x16915f(0x112),'risk':'write','flags':[{'name':a67_0x16915f(0x109),'type':a67_0x16915f(0x11c),'required':!![],'description':a67_0x16915f(0x10f)},SQLCODE_FLAG_OPTIONAL,{'name':a67_0x16915f(0x103),'type':a67_0x16915f(0x11c),'description':a67_0x16915f(0x127)},{'name':'db','type':'string','description':a67_0x16915f(0x10d)},{'name':'description','type':a67_0x16915f(0x11c),'description':a67_0x16915f(0x11a)}],async 'validate'(_0x5836af){const _0x10cfd3=a67_0x16915f,_0x456c94=resolve(process['cwd'](),_0x5836af['str'](_0x10cfd3(0x109)));if(!existsSync(_0x456c94))throw CliErrors[_0x10cfd3(0x120)](_0x10cfd3(0x119)+_0x456c94);const _0x225554=readFileSync(_0x456c94,_0x10cfd3(0x106)),_0x113926=validateSql(_0x225554);if(!_0x113926[_0x10cfd3(0x124)])throw CliErrors['validation'](_0x10cfd3(0x101)+_0x113926['message']);},async 'dryRun'(_0x904dcb){const _0x39ad58=a67_0x16915f,_0x1449a9=resolve(process[_0x39ad58(0x110)](),_0x904dcb[_0x39ad58(0x128)](_0x39ad58(0x109))),_0x6ae7a9=readFileSync(_0x1449a9,'utf-8'),_0x59e32a=validateSql(_0x6ae7a9),_0x20c958=_0x904dcb[_0x39ad58(0x128)]('db')||undefined,{db:_0x3f0f4f,error:_0x4555f8}=await resolveOneDb(_0x904dcb[_0x39ad58(0x122)],_0x20c958);return{'method':_0x39ad58(0x129),'url':_0x39ad58(0x104),'body':{'appCode':_0x904dcb[_0x39ad58(0x122)],'sqlContent':'('+_0x6ae7a9[_0x39ad58(0x11b)]+'\x20chars)','sqlCode':_0x904dcb[_0x39ad58(0x128)](_0x39ad58(0x11f))||undefined,'sqlName':_0x904dcb[_0x39ad58(0x128)](_0x39ad58(0x103))||undefined,'db':_0x3f0f4f?_0x3f0f4f[_0x39ad58(0xfd)]+'\x20('+_0x3f0f4f[_0x39ad58(0x10a)]+')':_0x4555f8},'description':[_0x39ad58(0xfb)+_0x904dcb['str'](_0x39ad58(0x109)),_0x39ad58(0x118)+_0x59e32a[_0x39ad58(0x100)],_0x39ad58(0x12f)+_0x59e32a[_0x39ad58(0xfc)][_0x39ad58(0x11e)]+_0x39ad58(0x113)+(_0x59e32a[_0x39ad58(0x12b)][_0x39ad58(0x12d)](',\x20')||_0x39ad58(0x11d))+_0x39ad58(0x126)+(_0x59e32a[_0x39ad58(0xf8)]['join'](',\x20')||'none')][_0x39ad58(0x12d)]('\x0a')};},async 'execute'(_0x5176ff){const _0x1c7b11=a67_0x16915f,_0x38f8f2=resolve(process[_0x1c7b11(0x110)](),_0x5176ff['str']('file')),_0x4764f8=readFileSync(_0x38f8f2,_0x1c7b11(0x106)),_0x14865c=_0x5176ff[_0x1c7b11(0x128)]('db')||undefined,{db:_0x408020,error:_0x11c4c1}=await resolveOneDb(_0x5176ff[_0x1c7b11(0x122)],_0x14865c);if(_0x11c4c1)throw CliErrors[_0x1c7b11(0x120)](_0x11c4c1);const _0x366f25=await saveSqlQuery({'appCode':_0x5176ff['appCode'],'sqlContent':_0x4764f8,'sqlCode':_0x5176ff['str'](_0x1c7b11(0x11f))||undefined,'sqlName':_0x5176ff['str'](_0x1c7b11(0x103))||undefined,'dbId':_0x408020[_0x1c7b11(0x10a)],'description':_0x5176ff[_0x1c7b11(0x128)](_0x1c7b11(0xf9))||undefined});if(_0x366f25[_0x1c7b11(0x12c)])return{'ok':![],'data':_0x366f25,'message':_0x366f25[_0x1c7b11(0x100)]||'Conflict\x20detected'};return{'ok':!![],'data':{'sqlCode':_0x366f25['sqlCode'],'sqlName':_0x366f25['sqlName'],'action':_0x366f25[_0x1c7b11(0x115)]},'message':(_0x366f25[_0x1c7b11(0x115)]===_0x1c7b11(0x121)?_0x1c7b11(0x125):_0x1c7b11(0x116))+_0x1c7b11(0xfe)+(_0x366f25[_0x1c7b11(0x10e)]?'\x20('+_0x366f25['sqlCode']+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x77387c=a68_0x4d88;(function(_0x392d96,_0xbe970f){const _0x36fa9b=a68_0x4d88,_0x41110d=_0x392d96();while(!![]){try{const _0x5038c1=-parseInt(_0x36fa9b(0x159))/0x1*(-parseInt(_0x36fa9b(0x15e))/0x2)+-parseInt(_0x36fa9b(0x14c))/0x3*(-parseInt(_0x36fa9b(0x172))/0x4)+-parseInt(_0x36fa9b(0x158))/0x5*(-parseInt(_0x36fa9b(0x171))/0x6)+parseInt(_0x36fa9b(0x157))/0x7+-parseInt(_0x36fa9b(0x152))/0x8+-parseInt(_0x36fa9b(0x160))/0x9+-parseInt(_0x36fa9b(0x170))/0xa*(parseInt(_0x36fa9b(0x147))/0xb);if(_0x5038c1===_0xbe970f)break;else _0x41110d['push'](_0x41110d['shift']());}catch(_0x17f7f4){_0x41110d['push'](_0x41110d['shift']());}}}(a68_0xa5e1,0xb65cb));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a68_0xa5e1(){const _0x456cb6=['174378WJVmmK','parameters','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','type','map','reason','3188632PNIDTe','isArray','schemas','toLowerCase','File\x20not\x20found:\x20','9803717pFihkq','1502075VMeGIE','31oPHknz','dbtableConfig','size','isSelectOnly','message','23356jcJABt','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','788634VYjHSE','Table\x20\x22','appCode','name','sql','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','str','trim','\x22\x20not\x20found\x20or\x20not\x20accessible','read','valid','filter','string','length','isDangerous','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','10PscamB','12jBcmYc','80fbqHYD','sqlType','schema:','schemaWarnings','from','split','utf-8','get','25220129ElOaOT','file','tableName','tables','fields'];a68_0xa5e1=function(){return _0x456cb6;};return a68_0xa5e1();}import{CliErrors}from'../../errors.js';function a68_0x4d88(_0x287adb,_0x4326a3){_0x287adb=_0x287adb-0x145;const _0xa5e1e3=a68_0xa5e1();let _0x4d8837=_0xa5e1e3[_0x287adb];return _0x4d8837;}export const sqlValidate={'service':a68_0x77387c(0x164),'command':'validate','description':a68_0x77387c(0x16f),'risk':a68_0x77387c(0x169),'flags':[{'name':'file','type':a68_0x77387c(0x16c),'description':a68_0x77387c(0x14e)},{'name':a68_0x77387c(0x164),'type':a68_0x77387c(0x16c),'description':a68_0x77387c(0x165)},{'name':a68_0x77387c(0x154),'type':'string','description':a68_0x77387c(0x15f)}],async 'execute'(_0x3e3d4f){const _0x3122f=a68_0x77387c,_0x4124b0=_0x3e3d4f[_0x3122f(0x166)](_0x3122f(0x148)),_0x47add8=_0x3e3d4f['str']('sql');if(!_0x4124b0&&!_0x47add8)throw CliErrors['flagMissing'](_0x3122f(0x148),'Provide\x20--file\x20or\x20--sql');let _0x39a733;if(_0x4124b0){const _0x1152b6=resolve(process['cwd'](),_0x4124b0);if(!existsSync(_0x1152b6))throw CliErrors['validation'](_0x3122f(0x156)+_0x1152b6);_0x39a733=readFileSync(_0x1152b6,_0x3122f(0x145));}else _0x39a733=_0x47add8;const _0x29b0c5=validateSql(_0x39a733),_0x2edcd8={'valid':_0x29b0c5[_0x3122f(0x16a)],'sqlType':_0x29b0c5['sqlType'][_0x3122f(0x14f)],'isSelectOnly':_0x29b0c5['sqlType'][_0x3122f(0x15c)],'isDangerous':_0x29b0c5[_0x3122f(0x173)][_0x3122f(0x16e)],'tables':_0x29b0c5[_0x3122f(0x14a)],'parameters':_0x29b0c5[_0x3122f(0x14d)],'message':_0x29b0c5['message']};_0x29b0c5[_0x3122f(0x173)][_0x3122f(0x151)]&&(_0x2edcd8[_0x3122f(0x151)]=_0x29b0c5[_0x3122f(0x173)][_0x3122f(0x151)]);const _0x52e39f=_0x3e3d4f[_0x3122f(0x166)](_0x3122f(0x154));if(_0x52e39f&&_0x29b0c5[_0x3122f(0x16a)]){const _0x1f7dfb=_0x52e39f[_0x3122f(0x177)](',')[_0x3122f(0x150)](_0x333ed8=>_0x333ed8[_0x3122f(0x167)]())[_0x3122f(0x16b)](Boolean),_0x3bb28e=[],_0x18540b=await listDatasets(_0x3e3d4f[_0x3122f(0x162)]),_0x2c97de=new Map(_0x18540b[_0x3122f(0x150)](_0x2bc068=>[_0x2bc068['dbtableConfig']?.[_0x3122f(0x149)]?.[_0x3122f(0x155)](),_0x2bc068]));for(const _0x58bb4d of _0x29b0c5[_0x3122f(0x14a)]){const _0x1f9bb6=_0x2c97de[_0x3122f(0x146)](_0x58bb4d[_0x3122f(0x155)]());!_0x1f9bb6&&_0x3bb28e['push'](_0x3122f(0x161)+_0x58bb4d+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0xe899b5 of _0x1f7dfb){try{const _0x1ea96a=await getDatasetDetail(_0xe899b5),_0x47d322=Array[_0x3122f(0x153)](_0x1ea96a[_0x3122f(0x14b)])?_0x1ea96a[_0x3122f(0x14b)]:[],_0x36e711=new Set(_0x47d322[_0x3122f(0x150)](_0xd92e75=>_0xd92e75[_0x3122f(0x163)]?.[_0x3122f(0x155)]())),_0x111b5b=_0x1ea96a[_0x3122f(0x15a)]?.[_0x3122f(0x149)]||_0x1ea96a[_0x3122f(0x149)]||_0xe899b5;_0x2edcd8[_0x3122f(0x174)+_0x111b5b]={'code':_0xe899b5,'tableName':_0x111b5b,'fieldCount':_0x36e711[_0x3122f(0x15b)],'fields':Array[_0x3122f(0x176)](_0x36e711)};}catch{_0x3bb28e['push']('Dataset\x20\x22'+_0xe899b5+_0x3122f(0x168));}}_0x3bb28e[_0x3122f(0x16d)]>0x0&&(_0x2edcd8[_0x3122f(0x175)]=_0x3bb28e);}return{'ok':_0x29b0c5[_0x3122f(0x16a)],'data':_0x2edcd8,'message':_0x29b0c5[_0x3122f(0x15d)]};}};
|
package/lib/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a69_0x5add7c=a69_0xc57f;function a69_0xc57f(_0x28dc6a,_0x54a1a1){_0x28dc6a=_0x28dc6a-0x177;const _0x38d300=a69_0x38d3();let _0xc57f0b=_0x38d300[_0x28dc6a];return _0xc57f0b;}(function(_0x2e2b02,_0x5e1af9){const _0x5ea161=a69_0xc57f,_0xe6ddbc=_0x2e2b02();while(!![]){try{const _0xe1312a=-parseInt(_0x5ea161(0x184))/0x1+parseInt(_0x5ea161(0x17c))/0x2*(parseInt(_0x5ea161(0x182))/0x3)+parseInt(_0x5ea161(0x17e))/0x4+parseInt(_0x5ea161(0x180))/0x5*(-parseInt(_0x5ea161(0x18b))/0x6)+-parseInt(_0x5ea161(0x17b))/0x7*(-parseInt(_0x5ea161(0x185))/0x8)+-parseInt(_0x5ea161(0x17f))/0x9+parseInt(_0x5ea161(0x17a))/0xa*(parseInt(_0x5ea161(0x188))/0xb);if(_0xe1312a===_0x5e1af9)break;else _0xe6ddbc['push'](_0xe6ddbc['shift']());}catch(_0x23b6ee){_0xe6ddbc['push'](_0xe6ddbc['shift']());}}}(a69_0x38d3,0x95df8));import{execa}from'execa';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a69_0x38d3(){const _0xc77652=['inherit','logger','4348256aDBRkk','启动开发服务器','needsUpgrade','4962uKDbPD','cwd','vite','start','env','40wejKCL','7xJkagF','2638fOiaGo','now','1229496pgGpcH','9055584QXxyXA','6005eTxGRr','Start\x20development\x20server','993yTGfQn','info','282155ikOBDM','4562328xyeYTK'];a69_0x38d3=function(){return _0xc77652;};return a69_0x38d3();}export async function runStart(_0x4f609d){const _0x386788=a69_0xc57f,_0x8e522d=Date[_0x386788(0x17d)](),_0x23c108=_0x4f609d||process[_0x386788(0x18c)](),_0x16da83=await checkCliVersion();_0x16da83['needsUpgrade']&&printCliUpgradeWarning(_0x16da83);const _0x3663d1=await checkSdkVersion(_0x23c108);_0x3663d1[_0x386788(0x18a)]&&printSdkUpgradeWarning(_0x3663d1);try{await execa(_0x386788(0x177),[],{'cwd':_0x23c108,'stdio':_0x386788(0x186),'preferLocal':!![],'localDir':_0x23c108,'env':{...process[_0x386788(0x179)]}});const _0x1d46f0=Date[_0x386788(0x17d)]()-_0x8e522d;void _0x1d46f0;}catch(_0x2f8194){throw _0x2f8194;}}export const startCommand={'name':a69_0x5add7c(0x178),'description':a69_0x5add7c(0x181),async 'run'(_0x1cd868,_0x4b4f5a,_0x5432f3){const _0x1b8b53=a69_0x5add7c;_0x1cd868[_0x1b8b53(0x187)][_0x1b8b53(0x183)](_0x1b8b53(0x178),_0x1b8b53(0x189)),await runStart();}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb79ad9,_0x3c445f){const _0x491607=a70_0x196b,_0x440e7e=_0xb79ad9();while(!![]){try{const _0xa2b149=-parseInt(_0x491607(0x169))/0x1+-parseInt(_0x491607(0x15c))/0x2*(-parseInt(_0x491607(0x158))/0x3)+-parseInt(_0x491607(0x163))/0x4*(-parseInt(_0x491607(0x156))/0x5)+parseInt(_0x491607(0x160))/0x6+-parseInt(_0x491607(0x155))/0x7*(-parseInt(_0x491607(0x164))/0x8)+-parseInt(_0x491607(0x168))/0x9+-parseInt(_0x491607(0x167))/0xa*(parseInt(_0x491607(0x151))/0xb);if(_0xa2b149===_0x3c445f)break;else _0x440e7e['push'](_0x440e7e['shift']());}catch(_0x21d625){_0x440e7e['push'](_0x440e7e['shift']());}}}(a70_0x490f,0x3f5c7));import{jsxs as a70_0x3844e1,jsx as a70_0x51b41d}from'react/jsx-runtime';import{Box,Text}from'ink';function a70_0x490f(){const _0x19972d=['column','5370500wtWVUF','275742Uytien','186730kPGxTj','Get\x20a\x20config\x20value','11SjxccI','\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20*\x20','\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','133mzxjyC','6045mfPBIl','description','3AUkDzC','map','command','\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','403292QBqTSg','\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','List\x20all\x20config\x20values','Examples:','1539084nbQKTU','\x20\x20\x20\x20','gray','892TOrFAO','120496tjrODg','Set\x20App\x20Code\x20for\x20current\x20project'];a70_0x490f=function(){return _0x19972d;};return a70_0x490f();}function a70_0x196b(_0x3d2581,_0x27c689){_0x3d2581=_0x3d2581-0x151;const _0x490f19=a70_0x490f();let _0x196bba=_0x490f19[_0x3d2581];return _0x196bba;}import{CLI_BIN_NAME}from'../constant/cli.js';export function ConfigHelp(){const _0x4097e1=a70_0x196b,_0x290995=[{'command':CLI_BIN_NAME+_0x4097e1(0x15b),'description':'Set\x20a\x20config\x20value'},{'command':CLI_BIN_NAME+'\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':_0x4097e1(0x16a)},{'command':CLI_BIN_NAME+_0x4097e1(0x152),'description':_0x4097e1(0x15e)}],_0x41bc07=[{'command':CLI_BIN_NAME+'\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','description':_0x4097e1(0x165)},{'command':CLI_BIN_NAME+_0x4097e1(0x154),'description':'Set\x20environment\x20(production/daily)'},{'command':CLI_BIN_NAME+_0x4097e1(0x15d),'description':'Set\x20display\x20language\x20(zh/en)'}];return a70_0x3844e1(Box,{'flexDirection':_0x4097e1(0x166),'marginTop':0x1,'marginBottom':0x1,'children':[a70_0x51b41d(Box,{'marginBottom':0x1,'children':a70_0x3844e1(Text,{'color':'gray','children':['\x20','!','\x20\x20','Invalid\x20command.\x20Available\x20commands:']})}),_0x290995[_0x4097e1(0x159)](_0x11cad7=>a70_0x3844e1(Box,{'children':[a70_0x3844e1(Text,{'children':['\x20\x20\x20\x20',_0x11cad7[_0x4097e1(0x15a)]]}),a70_0x51b41d(Text,{'color':_0x4097e1(0x162),'children':_0x11cad7['description']})]},_0x11cad7['command'])),a70_0x51b41d(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a70_0x3844e1(Text,{'color':'gray','children':[_0x4097e1(0x153),_0x4097e1(0x15f)]})}),_0x41bc07[_0x4097e1(0x159)](_0xfa4550=>a70_0x3844e1(Box,{'children':[a70_0x3844e1(Text,{'children':[_0x4097e1(0x161),_0xfa4550[_0x4097e1(0x15a)]]}),a70_0x51b41d(Text,{'color':_0x4097e1(0x162),'children':_0xfa4550[_0x4097e1(0x157)]})]},_0xfa4550[_0x4097e1(0x15a)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71_0x10bf29=a71_0x26b4;(function(_0x4a8aee,_0x4851f1){const _0x1827fe=a71_0x26b4,_0x54957a=_0x4a8aee();while(!![]){try{const _0x56b5f8=-parseInt(_0x1827fe(0x1c2))/0x1*(-parseInt(_0x1827fe(0x1b1))/0x2)+parseInt(_0x1827fe(0x1ae))/0x3*(-parseInt(_0x1827fe(0x1d5))/0x4)+parseInt(_0x1827fe(0x1d9))/0x5+-parseInt(_0x1827fe(0x1c8))/0x6*(-parseInt(_0x1827fe(0x1b3))/0x7)+parseInt(_0x1827fe(0x1d2))/0x8+-parseInt(_0x1827fe(0x1bc))/0x9*(parseInt(_0x1827fe(0x1c3))/0xa)+-parseInt(_0x1827fe(0x1be))/0xb*(parseInt(_0x1827fe(0x1b6))/0xc);if(_0x56b5f8===_0x4851f1)break;else _0x54957a['push'](_0x54957a['shift']());}catch(_0x80a1fe){_0x54957a['push'](_0x54957a['shift']());}}}(a71_0x3b9c,0xd0345));import{jsx as a71_0x9543c8,jsxs as a71_0x547298}from'react/jsx-runtime';import{ConfigHelp}from'./config-help.js';function a71_0x3b9c(){const _0x22db15=['保存配置失败','38106nYHivp','length','flags','\x20env\x20set\x20to:\x20','zh-CN','\x20locale\x20set\x20to:\x20','appcode','production','Config\x20value\x20is\x20invalid\x20or\x20too\x20long','env\x20value\x20must\x20be\x20\x22production\x22\x20or\x20\x22daily\x22','13289504hnlLNI','global','en-US','1470652clhbmk','No\x20config\x20value\x20provided','list','config','5690500iLtntd','Global','undefined','9JLRGBZ','Project','string','1291146IqhItH','toLowerCase','1106SGePFa','red','get','276yOCOdG','log','input','set','stringify','locale','513AKATow','app','1374857bDlzao','daily','env','online','2AamPMH','46210cufwBO','message','project','includes'];a71_0x3b9c=function(){return _0x22db15;};return a71_0x3b9c();}import{Box,Text}from'ink';import{readConfig}from'../utils/config.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{logger}from'../utils/logger.js';const LOCALE_MAP={'zh':'zh-CN','zh-cn':a71_0x10bf29(0x1cc),'zh_cn':'zh-CN','en':a71_0x10bf29(0x1d4),'en-us':a71_0x10bf29(0x1d4),'en_us':a71_0x10bf29(0x1d4)};function a71_0x26b4(_0x43005d,_0x5a3189){_0x43005d=_0x43005d-0x1ad;const _0x3b9c02=a71_0x3b9c();let _0x26b4e6=_0x3b9c02[_0x43005d];return _0x26b4e6;}function normalizeLocale(_0x3b89ec){const _0x387931=a71_0x10bf29;if(!_0x3b89ec)return null;return LOCALE_MAP[_0x3b89ec[_0x387931(0x1b2)]()]??null;}export function Config(_0x496eb7){const _0x50d8c3=a71_0x10bf29,{cli:_0x5ba48a}=_0x496eb7,_0x34630b=_0x5ba48a[_0x50d8c3(0x1b8)][0x1],_0x5d8a2f=_0x5ba48a[_0x50d8c3(0x1b8)][0x2],_0x2ca052=[_0x50d8c3(0x1b9),_0x50d8c3(0x1b5)][_0x50d8c3(0x1c6)](_0x34630b||''),_0x404bef=_0x5ba48a[_0x50d8c3(0x1b8)][_0x50d8c3(0x1c9)]>=0x3;if(_0x5d8a2f==='--help'||_0x5ba48a[_0x50d8c3(0x1ca)]['help'])return a71_0x9543c8(ConfigHelp,{});const _0x51aad1=readConfig();if(_0x34630b==='set'){if(_0x5d8a2f){const _0x3befe0=_0x5ba48a[_0x50d8c3(0x1b8)][0x3];if(typeof _0x3befe0!==_0x50d8c3(0x1ad)){if(_0x5d8a2f===_0x50d8c3(0x1c0)&&![_0x50d8c3(0x1c1),_0x50d8c3(0x1cf),_0x50d8c3(0x1bf)][_0x50d8c3(0x1c6)](_0x3befe0))return a71_0x9543c8(Box,{'children':a71_0x9543c8(Text,{'color':_0x50d8c3(0x1b4),'children':_0x50d8c3(0x1d1)})});if(_0x5d8a2f==='locale'&&!normalizeLocale(_0x3befe0))return a71_0x9543c8(Box,{'flexDirection':'column','children':a71_0x9543c8(Text,{'color':_0x50d8c3(0x1b4),'children':'Invalid\x20locale\x20value.\x20Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US'})});const _0x1a4417=_0x5ba48a['flags'][_0x50d8c3(0x1d3)]?_0x50d8c3(0x1d3):isInProject()?_0x50d8c3(0x1c5):_0x50d8c3(0x1d3),_0x15f3c5=resolveWriteConfigPath(_0x1a4417);let _0x203f53=readConfigFile(_0x15f3c5);if(typeof _0x3befe0!==_0x50d8c3(0x1b0)||_0x3befe0[_0x50d8c3(0x1c9)]>0x1f4)return a71_0x9543c8(Box,{'children':a71_0x9543c8(Text,{'color':_0x50d8c3(0x1b4),'children':_0x50d8c3(0x1d0)})});let _0x2c8fd5=_0x5d8a2f,_0x330cf9=_0x3befe0;_0x5d8a2f===_0x50d8c3(0x1bd)&&(_0x2c8fd5=_0x50d8c3(0x1ce),delete _0x203f53[_0x50d8c3(0x1bd)]);_0x5d8a2f==='appcode'&&delete _0x203f53['app'];_0x5d8a2f===_0x50d8c3(0x1bb)&&(_0x330cf9=normalizeLocale(_0x3befe0));_0x203f53[_0x2c8fd5]=_0x330cf9;try{writeConfigFile(_0x15f3c5,_0x203f53);const _0x4e1536=_0x1a4417===_0x50d8c3(0x1d3)?_0x50d8c3(0x1da):_0x50d8c3(0x1af);_0x5d8a2f===_0x50d8c3(0x1c0)&&console[_0x50d8c3(0x1b7)]('✓\x20'+_0x4e1536+_0x50d8c3(0x1cb)+_0x3befe0);if(_0x5d8a2f===_0x50d8c3(0x1bb)){const _0x1d530f=normalizeLocale(_0x3befe0);console[_0x50d8c3(0x1b7)]('✓\x20'+_0x4e1536+_0x50d8c3(0x1cd)+_0x1d530f);}}catch(_0x2b6235){return logger['error'](_0x50d8c3(0x1d8),_0x50d8c3(0x1c7),{'error':_0x2b6235 instanceof Error?_0x2b6235[_0x50d8c3(0x1c4)]:String(_0x2b6235),'configKey':_0x5d8a2f,'configValue':_0x3befe0,'targetConfigPath':_0x15f3c5}),a71_0x9543c8(Box,{'children':a71_0x547298(Text,{'color':'red','children':['Failed\x20to\x20save\x20config',':','\x20',_0x2b6235 instanceof Error?_0x2b6235['message']:String(_0x2b6235)]})});}return null;}return a71_0x9543c8(Box,{'children':a71_0x9543c8(Text,{'color':_0x50d8c3(0x1b4),'children':_0x50d8c3(0x1d6)})});}}if(_0x34630b===_0x50d8c3(0x1b5)){if(_0x5d8a2f){let _0x338ee2=_0x5d8a2f;return _0x5d8a2f===_0x50d8c3(0x1bd)&&(_0x338ee2=_0x50d8c3(0x1ce)),console['log'](_0x51aad1[_0x338ee2]||'undefined'),null;}return null;}if(_0x34630b===_0x50d8c3(0x1d7))return console[_0x50d8c3(0x1b7)](JSON[_0x50d8c3(0x1ba)](_0x51aad1,null,0x2)),null;if(!_0x2ca052||!_0x404bef)return a71_0x9543c8(ConfigHelp,{});return null;}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x1080a8=a72_0x1e3e;function a72_0x1e3e(_0x3c5cc6,_0x4cfa41){_0x3c5cc6=_0x3c5cc6-0xff;const _0x227db9=a72_0x227d();let _0x1e3e51=_0x227db9[_0x3c5cc6];return _0x1e3e51;}(function(_0xbda1ee,_0x1d429e){const _0x5ef892=a72_0x1e3e,_0x4bca54=_0xbda1ee();while(!![]){try{const _0x19c6c5=-parseInt(_0x5ef892(0x105))/0x1+-parseInt(_0x5ef892(0x101))/0x2*(-parseInt(_0x5ef892(0x108))/0x3)+-parseInt(_0x5ef892(0x107))/0x4+parseInt(_0x5ef892(0x100))/0x5+parseInt(_0x5ef892(0x102))/0x6+parseInt(_0x5ef892(0x106))/0x7+-parseInt(_0x5ef892(0x104))/0x8*(-parseInt(_0x5ef892(0x103))/0x9);if(_0x19c6c5===_0x1d429e)break;else _0x4bca54['push'](_0x4bca54['shift']());}catch(_0xcf1e02){_0x4bca54['push'](_0x4bca54['shift']());}}}(a72_0x227d,0xe095f));function a72_0x227d(){const _0x32f632=['3XbZHeF','@lovrabet/rabetbase-cli','660295TYydLg','2445842wQHUCE','2888226OTctpt','9QuVdzI','3926952izbPOe','1124272bIDCNK','9178372iKxbpj','6376964GgwVhu'];a72_0x227d=function(){return _0x32f632;};return a72_0x227d();}export const CLI_BIN_NAME='rabetbase';export const NPM_PACKAGE_NAME=a72_0x1080a8(0xff);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a73_0x13590a=a73_0x56e0;(function(_0x1ad19b,_0x503747){const _0x52767b=a73_0x56e0,_0xf27c83=_0x1ad19b();while(!![]){try{const _0x4da8c7=parseInt(_0x52767b(0x100))/0x1+-parseInt(_0x52767b(0x104))/0x2+parseInt(_0x52767b(0xfd))/0x3*(-parseInt(_0x52767b(0xf5))/0x4)+parseInt(_0x52767b(0x101))/0x5*(-parseInt(_0x52767b(0xfa))/0x6)+parseInt(_0x52767b(0xf6))/0x7*(-parseInt(_0x52767b(0x102))/0x8)+parseInt(_0x52767b(0xfe))/0x9*(parseInt(_0x52767b(0xfc))/0xa)+parseInt(_0x52767b(0xf9))/0xb;if(_0x4da8c7===_0x503747)break;else _0xf27c83['push'](_0xf27c83['shift']());}catch(_0x786188){_0xf27c83['push'](_0xf27c83['shift']());}}}(a73_0xb66c,0x1e46f));function a73_0x56e0(_0x15f1d7,_0x267670){_0x15f1d7=_0x15f1d7-0xf5;const _0xb66c51=a73_0xb66c();let _0x56e066=_0xb66c51[_0x15f1d7];return _0x56e066;}function a73_0xb66c(){const _0x1e8d5f=['https://user.lovrabet.com','https://daily-api.lovrabet.com','production','79088bQOYns','28tjiLeF','userDomain','https://daily-runtime.lovrabet.com','1444168IRneZG','66qyMxav','https://runtime.lovrabet.com','223420kvZJxq','15oCrvYz','90ltrGTb','apiDomain','187387MYDeZz','65090RrevXa','280928kVOMKH','https://api.lovrabet.com','71116VinVvi','https://user-daily.lovrabet.com'];a73_0xb66c=function(){return _0x1e8d5f;};return a73_0xb66c();}import{getEnv}from'./env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x1f5b47){const _0x1ad171=a73_0x56e0;customApiDomain=_0x1f5b47?.[_0x1ad171(0xff)],customUserDomain=_0x1f5b47?.[_0x1ad171(0xf7)],customRuntimeDomain=_0x1f5b47?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(getEnv()===a73_0x13590a(0x108)?a73_0x13590a(0x106):a73_0x13590a(0x105));export const getApiDomain=()=>customApiDomain||(getEnv()==='production'?a73_0x13590a(0x103):a73_0x13590a(0x107));export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a73_0x13590a(0x108)?a73_0x13590a(0xfb):a73_0x13590a(0xf8));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a74_0x5393(){const _0x1a36d5=['46290OkmMQK','env','LOVRABET_ENV','4hEsEKu','4491PKDtgG','2128VYrXOQ','2965KXeFEq','online','1939424LKWmpf','240168uPavlk','296236PtXANG','17410UrlDyv','148071qDxhTa','production'];a74_0x5393=function(){return _0x1a36d5;};return a74_0x5393();}const a74_0x537aac=a74_0x26fd;(function(_0x42edd9,_0x4f9eb8){const _0x1c0a0f=a74_0x26fd,_0x31e0fe=_0x42edd9();while(!![]){try{const _0x3ad544=-parseInt(_0x1c0a0f(0x1ec))/0x1+-parseInt(_0x1c0a0f(0x1e5))/0x2*(parseInt(_0x1c0a0f(0x1eb))/0x3)+parseInt(_0x1c0a0f(0x1e7))/0x4*(-parseInt(_0x1c0a0f(0x1e8))/0x5)+-parseInt(_0x1c0a0f(0x1e2))/0x6+-parseInt(_0x1c0a0f(0x1ee))/0x7+parseInt(_0x1c0a0f(0x1ea))/0x8+-parseInt(_0x1c0a0f(0x1e6))/0x9*(-parseInt(_0x1c0a0f(0x1ed))/0xa);if(_0x3ad544===_0x4f9eb8)break;else _0x31e0fe['push'](_0x31e0fe['shift']());}catch(_0x3ec390){_0x31e0fe['push'](_0x31e0fe['shift']());}}}(a74_0x5393,0x4bcdf));export function normalizeEnv(_0x50cbd3){const _0x4ce26d=a74_0x26fd;return _0x50cbd3===_0x4ce26d(0x1e9)?_0x4ce26d(0x1ef):_0x50cbd3;}function a74_0x26fd(_0x4a7eb3,_0x2eb709){_0x4a7eb3=_0x4a7eb3-0x1e2;const _0x53932c=a74_0x5393();let _0x26fd03=_0x53932c[_0x4a7eb3];return _0x26fd03;}let env=normalizeEnv(process[a74_0x537aac(0x1e3)]['RABETBASE_ENV']||process['env'][a74_0x537aac(0x1e4)]||a74_0x537aac(0x1ef));export function getEnv(){return env;}export function initEnv(_0x22a2d0){env=normalizeEnv(_0x22a2d0);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a75_0x3b5c78=a75_0x38b0;(function(_0x17601a,_0x42ad44){const _0x5b400c=a75_0x38b0,_0x56c6ba=_0x17601a();while(!![]){try{const _0x1d5bb9=-parseInt(_0x5b400c(0x128))/0x1*(parseInt(_0x5b400c(0x134))/0x2)+parseInt(_0x5b400c(0x141))/0x3*(-parseInt(_0x5b400c(0x11b))/0x4)+parseInt(_0x5b400c(0x103))/0x5*(-parseInt(_0x5b400c(0x124))/0x6)+parseInt(_0x5b400c(0x123))/0x7*(-parseInt(_0x5b400c(0x119))/0x8)+-parseInt(_0x5b400c(0x102))/0x9*(parseInt(_0x5b400c(0x12a))/0xa)+parseInt(_0x5b400c(0x104))/0xb*(parseInt(_0x5b400c(0x13b))/0xc)+parseInt(_0x5b400c(0x129))/0xd;if(_0x1d5bb9===_0x42ad44)break;else _0x56c6ba['push'](_0x56c6ba['shift']());}catch(_0x1e65fa){_0x56c6ba['push'](_0x56c6ba['shift']());}}}(a75_0x56dd,0x405de));function a75_0x56dd(){const _0x42a425=['.tmp','utf8','cookie','env','defaultApp','entries','isTTY','.lovrabet.json','json','appcode','keys','ENV','read','./constant/env.js','COOKIE','PAGE_SIZE','apps','FORMAT','243272uyEHyq','riskLevel','20408nmWnQY','pageSize','apiDir','stdin','cwd','accessKey','high-risk-write','table','14ciJuZt','1546116HxbWvg','object','production','MAX_RISK','1143pVeead','17989673zeFGmO','45860YQieqs','en-US','LOVRABET_','APP','nonInteractive','project','pretty','join','APPCODE','runtimeDomain','634jXEKaY','trim','maxRisk','online','write','length','daily','1021224oHDXis','true','./constant/domain.js','setRawCommand','argv','setLogPath','291XRIJbS','app','parse','string','locale','225IpksjH','5YJEoaE','22UddJLC','./src/api','format'];a75_0x56dd=function(){return _0x42a425;};return a75_0x56dd();}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';function a75_0x38b0(_0x372aba,_0x505caa){_0x372aba=_0x372aba-0xfe;const _0x56dd92=a75_0x56dd();let _0x38b0e3=_0x56dd92[_0x372aba];return _0x38b0e3;}import{CLI_BIN_NAME}from'./constant/cli.js';function env(_0xd7294a){const _0x73d6b2=a75_0x38b0;return process[_0x73d6b2(0x10a)]['RABETBASE_'+_0xd7294a]||process[_0x73d6b2(0x10a)][_0x73d6b2(0x12c)+_0xd7294a]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=['.rabetbase.json',a75_0x3b5c78(0x10e),'.lovrabetrc'];export function resolveConfigPath(_0x500c70){for(const _0x3488e5 of CONFIG_NAMES){const _0x310ee8=resolve(_0x500c70,_0x3488e5);if(existsSync(_0x310ee8))return _0x310ee8;}return undefined;}export async function createContext(_0x40d0fa){const _0x4d50df=a75_0x3b5c78,_0x77fa44=readRawConfig(),_0x16a825=buildConfig(_0x77fa44,_0x40d0fa),{initEnv:_0x4a6c06}=await import(_0x4d50df(0x114));if(_0x16a825['env'])_0x4a6c06(_0x16a825[_0x4d50df(0x10a)]);else _0x40d0fa['env']&&typeof _0x40d0fa[_0x4d50df(0x10a)]===_0x4d50df(0x100)&&_0x4a6c06(_0x40d0fa[_0x4d50df(0x10a)]);const {initDomains:_0x4f1087,getUserDomain:_0x31b0fb,getApiDomain:_0x54c20a}=await import(_0x4d50df(0x13d));_0x4f1087({'apiDomain':_0x77fa44['apiDomain']||undefined,'userDomain':_0x77fa44['userDomain']||undefined,'runtimeDomain':_0x77fa44[_0x4d50df(0x133)]||undefined});const _0x195c6b={'apiDomain':_0x54c20a(),'userDomain':_0x31b0fb()},_0x54b00c=await buildAuth(_0x16a825);logger[_0x4d50df(0x140)](process[_0x4d50df(0x11f)]());const _0x15ba0c=(CLI_BIN_NAME+'\x20'+process[_0x4d50df(0x13f)]['slice'](0x2)[_0x4d50df(0x131)]('\x20'))['trim']();logger[_0x4d50df(0x13e)](_0x15ba0c);const _0x482d03=isNonInteractiveMode(_0x40d0fa);return{'config':_0x16a825,'auth':_0x54b00c,'logger':logger,'env':_0x195c6b,'nonInteractive':_0x482d03};}export function buildConfigFromFlags(_0x47e32d){return buildConfig(readRawConfig(),_0x47e32d);}export function getProjectConfigPath(){const _0x2ceb7a=a75_0x3b5c78;return resolveConfigPath(process[_0x2ceb7a(0x11f)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x512950){const _0x2437f4=a75_0x3b5c78;let _0x212c1b={},_0x5123a5={};try{const _0x6bacd2=resolveConfigPath(homedir());if(_0x6bacd2){const _0x71e37b=readFileSync(_0x6bacd2,{'encoding':_0x2437f4(0x108)});if(_0x71e37b)_0x212c1b=JSON[_0x2437f4(0xff)](_0x71e37b);}}catch{}try{const _0x2c58ec=_0x512950||process['cwd'](),_0x168da3=resolveConfigPath(_0x2c58ec);if(_0x168da3){const _0x472ff4=readFileSync(_0x168da3,{'encoding':_0x2437f4(0x108)});if(_0x472ff4)_0x5123a5=JSON[_0x2437f4(0xff)](_0x472ff4);}}catch{}const _0x25e808=_0x212c1b[_0x2437f4(0x117)]&&typeof _0x212c1b[_0x2437f4(0x117)]==='object'?_0x212c1b[_0x2437f4(0x117)]:{},_0x5b1232=_0x5123a5['apps']&&typeof _0x5123a5[_0x2437f4(0x117)]===_0x2437f4(0x125)?_0x5123a5['apps']:{},_0x25f3bb={..._0x25e808,..._0x5b1232},_0x2e2c2c={..._0x212c1b,..._0x5123a5};Object[_0x2437f4(0x111)](_0x25f3bb)[_0x2437f4(0x139)]>0x0&&(_0x2e2c2c['apps']=_0x25f3bb);if(_0x2437f4(0x10b)in _0x5123a5)_0x2e2c2c['defaultApp']=_0x5123a5[_0x2437f4(0x10b)];else{if(_0x5b1232&&Object['keys'](_0x5b1232)[_0x2437f4(0x139)]>0x0)_0x2e2c2c[_0x2437f4(0x10b)]=Object['keys'](_0x5b1232)[0x0];else _0x212c1b[_0x2437f4(0x10b)]&&(_0x2e2c2c[_0x2437f4(0x10b)]=_0x212c1b[_0x2437f4(0x10b)]);}return _0x2e2c2c;}export function readConfigFile(_0x1413a7){try{if(existsSync(_0x1413a7)){const _0x4a4780=readFileSync(_0x1413a7,{'encoding':'utf8'});if(_0x4a4780)return JSON['parse'](_0x4a4780);}}catch{}return{};}export function writeConfigFile(_0x1b28b6,_0x4f9093){const _0x31d272=a75_0x3b5c78,_0x17a456=dirname(_0x1b28b6);!existsSync(_0x17a456)&&mkdirSync(_0x17a456,{'recursive':!![]});const _0x25af54=_0x1b28b6+_0x31d272(0x107);try{writeFileSync(_0x25af54,JSON['stringify'](_0x4f9093,null,0x2)+'\x0a',{'encoding':_0x31d272(0x108),'mode':0x180}),renameSync(_0x25af54,_0x1b28b6);}catch(_0x96796){try{unlinkSync(_0x25af54);}catch{}throw _0x96796;}}export function resolveWriteConfigPath(_0x3b52c1){const _0x5edd23=a75_0x3b5c78,_0x49525c=_0x3b52c1===_0x5edd23(0x12f)?process[_0x5edd23(0x11f)]():homedir(),_0x2d49be=resolveConfigPath(_0x49525c);return _0x2d49be??resolve(_0x49525c,NEW_CONFIG_NAME);}function buildConfig(_0x2cb6cc,_0x296c41){const _0x27c072=a75_0x3b5c78,_0x35811d={};if(_0x2cb6cc['apps']&&typeof _0x2cb6cc[_0x27c072(0x117)]==='object')for(const [_0x539181,_0x33bf93]of Object[_0x27c072(0x10c)](_0x2cb6cc[_0x27c072(0x117)])){_0x33bf93&&typeof _0x33bf93===_0x27c072(0x125)&&_0x33bf93[_0x27c072(0x110)]&&(_0x35811d[_0x539181]=_0x33bf93);}const _0x18fd49=_0x2cb6cc[_0x27c072(0x10b)]||undefined,_0x2e1da0=Object[_0x27c072(0x111)](_0x35811d)[_0x27c072(0x139)]>0x0,_0x30112c=_0x296c41['app']||env(_0x27c072(0x12d))||undefined;let _0x446ecd=_0x30112c||_0x18fd49||undefined,_0x46b1f7=_0x446ecd&&_0x35811d[_0x446ecd]?_0x35811d[_0x446ecd]:undefined;if(_0x296c41[_0x27c072(0x110)]&&!_0x30112c){const _0x4f8ddc=Object[_0x27c072(0x10c)](_0x35811d)['find'](([_0x3a5ea8,_0x51cef8])=>_0x51cef8['appcode']===_0x296c41[_0x27c072(0x110)]);_0x4f8ddc&&(_0x446ecd=_0x4f8ddc[0x0],_0x46b1f7=_0x4f8ddc[0x1]);}const _0x10053b=_0x30112c||(_0x296c41[_0x27c072(0x110)]&&_0x446ecd&&!_0x18fd49?_0x446ecd:undefined),_0x6c4618=_0x296c41['appcode']||env(_0x27c072(0x132))||_0x46b1f7?.[_0x27c072(0x110)]||_0x2cb6cc['appcode']||_0x2cb6cc[_0x27c072(0xfe)]||undefined,_0x209f9e=_0x296c41['env']||env(_0x27c072(0x112))||_0x46b1f7?.['env']||_0x2cb6cc[_0x27c072(0x10a)]||'production',_0x360dd0=_0x46b1f7?.['locale']||_0x2cb6cc[_0x27c072(0x101)]||_0x27c072(0x12b),_0x5e6c33=env(_0x27c072(0x115))||_0x46b1f7?.[_0x27c072(0x109)]||_0x2cb6cc[_0x27c072(0x109)]||undefined,_0x2a0473=env('ACCESS_KEY')||_0x46b1f7?.[_0x27c072(0x120)]||_0x2cb6cc[_0x27c072(0x120)]||undefined,_0x171cba=_0x296c41[_0x27c072(0x106)]||env(_0x27c072(0x118))||_0x46b1f7?.['format']||_0x2cb6cc[_0x27c072(0x106)],_0x4dd42d=_0x171cba===_0x27c072(0x10f)||_0x171cba===_0x27c072(0x130)||_0x171cba===_0x27c072(0x122)?_0x171cba:undefined,_0x5b6bba=env(_0x27c072(0x116))||_0x46b1f7?.['pageSize']||_0x2cb6cc[_0x27c072(0x11c)],_0xcca8cd=_0x5b6bba?Number(_0x5b6bba)||undefined:undefined,_0xa9f4df=env('RISK_LEVEL')||env(_0x27c072(0x127))||_0x46b1f7?.['riskLevel']||_0x2cb6cc[_0x27c072(0x11a)]||_0x2cb6cc[_0x27c072(0x136)],_0x37b465=_0xa9f4df===_0x27c072(0x113)||_0xa9f4df===_0x27c072(0x138)?_0xa9f4df:_0x27c072(0x121),_0x5caac6=env('VERBOSE'),_0x150e8f=_0x5caac6==='1'||_0x5caac6===_0x27c072(0x13c),_0x4a8c47=_0x46b1f7?.[_0x27c072(0x11d)]||_0x2cb6cc[_0x27c072(0x11d)]||_0x27c072(0x105);return{'appCode':typeof _0x6c4618===_0x27c072(0x100)&&_0x6c4618[_0x27c072(0x135)]()?_0x6c4618[_0x27c072(0x135)]():undefined,'env':_0x209f9e===_0x27c072(0x137)?'production':_0x209f9e===_0x27c072(0x13a)?'daily':_0x27c072(0x126),'locale':_0x360dd0,'cookie':_0x5e6c33,'accessKey':_0x2a0473,'format':_0x4dd42d,'pageSize':_0xcca8cd,'riskLevel':_0x37b465,'verbose':_0x150e8f,'apiDir':_0x4a8c47,'apps':_0x35811d,'defaultApp':_0x18fd49,'currentApp':_0x2e1da0?_0x446ecd:undefined,'explicitAppName':_0x10053b,'raw':_0x2cb6cc};}async function buildAuth(_0x43347c){const _0x2e8ddf=a75_0x3b5c78,{getCookie:_0x26deeb}=await import('./auth/get-cookie.js'),_0x57d157=_0x43347c[_0x2e8ddf(0x109)]||_0x26deeb(),_0x4a6d72=_0x57d157?await getIsSessionValid():![];return{'cookie':_0x57d157,'isLoggedIn':_0x4a6d72,async 'getOrLogin'(){if(_0x57d157&&_0x4a6d72)return _0x57d157;throw CliErrors['authRequired']();}};}function isNonInteractiveMode(_0x57b1e9){const _0x571df1=a75_0x3b5c78;return!!(_0x57b1e9[_0x571df1(0x12e)]||_0x57b1e9['ci']||env('CI')===_0x571df1(0x13c)||process['env']['CI']===_0x571df1(0x13c)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x1bf218=a75_0x3b5c78;if(!process[_0x1bf218(0x11e)][_0x1bf218(0x10d)])return![];try{const _0x100dd8=process['stdin']['isRaw'];return process[_0x1bf218(0x11e)]['setRawMode'](!![]),process[_0x1bf218(0x11e)]['setRawMode'](_0x100dd8??![]),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a76_0xec1c(){const _0x14129c=['637283jjgiyH','1321416cWLKYU','2DCgrpW','2127145YHLUPu','get','datasetCode','api.ts','alias','find','push','has','16ysaChL','1635021tOvHBG','145649VGLdoi','215604LjpTDf','5599104awjWKa','set','100MoMGfK'];a76_0xec1c=function(){return _0x14129c;};return a76_0xec1c();}(function(_0x54e34d,_0x1a9977){const _0x575a1f=a76_0x15b0,_0xe667ed=_0x54e34d();while(!![]){try{const _0xe3cc91=-parseInt(_0x575a1f(0x1b6))/0x1*(-parseInt(_0x575a1f(0x1b8))/0x2)+parseInt(_0x575a1f(0x1c4))/0x3*(-parseInt(_0x575a1f(0x1c1))/0x4)+-parseInt(_0x575a1f(0x1b9))/0x5+-parseInt(_0x575a1f(0x1c5))/0x6+-parseInt(_0x575a1f(0x1c3))/0x7+-parseInt(_0x575a1f(0x1b7))/0x8+-parseInt(_0x575a1f(0x1c2))/0x9*(-parseInt(_0x575a1f(0x1b5))/0xa);if(_0xe3cc91===_0x1a9977)break;else _0xe667ed['push'](_0xe667ed['shift']());}catch(_0x1c4f35){_0xe667ed['push'](_0xe667ed['shift']());}}}(a76_0xec1c,0x97d50));import{readFileSync,existsSync}from'node:fs';function a76_0x15b0(_0x28aece,_0xccb491){_0x28aece=_0x28aece-0x1b4;const _0xec1cca=a76_0xec1c();let _0x15b034=_0xec1cca[_0x28aece];return _0x15b034;}import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x36e6f1){const _0x1df2fa=a76_0x15b0,_0x5252a6=[],_0x3ad579=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x30106d;while((_0x30106d=_0x3ad579['exec'](_0x36e6f1))!==null){_0x5252a6[_0x1df2fa(0x1bf)]({'datasetCode':_0x30106d[0x1],'tableName':_0x30106d[0x2],'name':_0x30106d[0x3],'alias':_0x30106d[0x4]});}return _0x5252a6;}export function loadAliasMap(_0x593498){const _0x3cd37e=a76_0x15b0,_0x3e5a50=resolve(process['cwd'](),_0x593498);if(cache[_0x3cd37e(0x1c0)](_0x3e5a50))return cache[_0x3cd37e(0x1ba)](_0x3e5a50);const _0x2d817e=resolve(_0x3e5a50,_0x3cd37e(0x1bc));if(!existsSync(_0x2d817e))return cache[_0x3cd37e(0x1b4)](_0x3e5a50,[]),[];try{const _0x238c11=readFileSync(_0x2d817e,'utf-8'),_0x306024=parseApiFile(_0x238c11);return cache[_0x3cd37e(0x1b4)](_0x3e5a50,_0x306024),_0x306024;}catch{return cache[_0x3cd37e(0x1b4)](_0x3e5a50,[]),[];}}export function resolveAlias(_0x53bb9b,_0x3624b1){const _0x4381eb=a76_0x15b0;if(!_0x3624b1)return undefined;const _0x5ea357=loadAliasMap(_0x53bb9b),_0x26ee3c=_0x5ea357[_0x4381eb(0x1be)](_0x1d6358=>_0x1d6358[_0x4381eb(0x1bd)]===_0x3624b1);return _0x26ee3c?.[_0x4381eb(0x1bb)];}export function listAliases(_0x1a74e5){return loadAliasMap(_0x1a74e5);}
|