@lovrabet/rabetbase-cli 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/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/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/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/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/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/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/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/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/paths.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/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/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/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a78_0x1baf21=a78_0x24d5;(function(_0x1482ed,_0x522321){const _0x275e30=a78_0x24d5,_0x29bf0b=_0x1482ed();while(!![]){try{const _0x2569a0=parseInt(_0x275e30(0x1df))/0x1+parseInt(_0x275e30(0x1f3))/0x2+-parseInt(_0x275e30(0x1c2))/0x3*(-parseInt(_0x275e30(0x1c6))/0x4)+parseInt(_0x275e30(0x1fd))/0x5*(parseInt(_0x275e30(0x1d1))/0x6)+-parseInt(_0x275e30(0x1dd))/0x7+-parseInt(_0x275e30(0x1e5))/0x8+-parseInt(_0x275e30(0x1ef))/0x9;if(_0x2569a0===_0x522321)break;else _0x29bf0b['push'](_0x29bf0b['shift']());}catch(_0x390661){_0x29bf0b['push'](_0x29bf0b['shift']());}}}(a78_0x5e4e,0xc9d64));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';function a78_0x5e4e(){const _0x27784d=['preview','285jPTyiQ','push','.bin','package.json','38020jeFPxi','close','scripts','\x20\x20\x20\x20','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','Available:\x20','validation','\x20run\x20','No\x20scripts\x20defined\x20in\x20package.json.','run','args','254526JqWaWx','log','\x20run\x20build','watch','node_modules','yarn','Script\x20name\x20defined\x20in\x20package.json','\x0a\x20\x20Available\x20scripts:\x0a','vite\x20preview\x20exited\x20with\x20code\x20','padEnd','has','(none)','128198JAbSvO','Enable\x20watch\x20mode\x20for\x20preview','1234818MyzkxG','\x20exited\x20with\x20code\x20','join','vite','utf-8','\x20run\x20preview','3717464Fxhvcd','length','inherit','parse','--watch','\x20\x20EXAMPLES','error','bun','needsUpgrade','entries','18592641hTaUCH','dev','start','keys','1796818TPcYJx','\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview','Run\x20a\x20package.json\x20script','\x20run\x20<script>\x0a','bun.lockb','pnpm','\x20run\x20start','boolean','map','cwd','40sUDWQU'];a78_0x5e4e=function(){return _0x27784d;};return a78_0x5e4e();}import{checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';function a78_0x24d5(_0x210fa7,_0x5e8a9e){_0x210fa7=_0x210fa7-0x1c2;const _0x5e4e1d=a78_0x5e4e();let _0x24d563=_0x5e4e1d[_0x210fa7];return _0x24d563;}const VERSION_CHECK_SCRIPTS=new Set([a78_0x1baf21(0x1f1),a78_0x1baf21(0x1f0)]);function readPackageScripts(_0x4ba54d){const _0x24be22=a78_0x1baf21,_0x369753=resolve(_0x4ba54d,_0x24be22(0x1c5));if(!existsSync(_0x369753))return null;try{const _0x305933=JSON[_0x24be22(0x1e8)](readFileSync(_0x369753,_0x24be22(0x1e3)));return _0x305933[_0x24be22(0x1c8)]??{};}catch{return null;}}function detectPackageManager(_0x5cd8f3){const _0x1a5500=a78_0x1baf21;if(existsSync(resolve(_0x5cd8f3,_0x1a5500(0x1f7)))||existsSync(resolve(_0x5cd8f3,'bun.lock')))return _0x1a5500(0x1ec);if(existsSync(resolve(_0x5cd8f3,'pnpm-lock.yaml')))return _0x1a5500(0x1f8);if(existsSync(resolve(_0x5cd8f3,'yarn.lock')))return _0x1a5500(0x1d6);return'npm';}async function versionCheck(_0x51c749){const _0x6d5177=a78_0x1baf21,_0x100534=await checkCliVersion();if(_0x100534[_0x6d5177(0x1ed)])printCliUpgradeWarning(_0x100534);const _0x51e7dc=await checkSdkVersion(_0x51c749);if(_0x51e7dc[_0x6d5177(0x1ed)])printSdkUpgradeWarning(_0x51e7dc);}function spawnScript(_0x58376a,_0x426780,_0x4eeb4a,_0x6e8e23){return new Promise((_0x5875f9,_0x5ba6d0)=>{const _0x2c7395=a78_0x24d5,_0x57d415=[_0x2c7395(0x1cf),_0x426780,..._0x4eeb4a],_0x5d5903=spawn(_0x58376a,_0x57d415,{'cwd':_0x6e8e23,'stdio':_0x2c7395(0x1e7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x6e8e23,_0x2c7395(0x1d5),_0x2c7395(0x1c4))+delimiter+process.env.PATH}});_0x5d5903['on'](_0x2c7395(0x1c7),_0x34e40c=>{const _0x7bd639=_0x2c7395;if(_0x34e40c===0x0||_0x34e40c===null)_0x5875f9();else _0x5ba6d0(new Error(_0x58376a+'\x20run\x20'+_0x426780+_0x7bd639(0x1e0)+_0x34e40c));}),_0x5d5903['on'](_0x2c7395(0x1eb),_0x5ba6d0);});}function spawnViteBuildWatch(_0x2848e9){return new Promise((_0x263110,_0x478f65)=>{const _0x265f3c=a78_0x24d5,_0x2f0cdc=spawn(_0x265f3c(0x1e2),['build',_0x265f3c(0x1e9)],{'cwd':_0x2848e9,'stdio':_0x265f3c(0x1e7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2848e9,_0x265f3c(0x1d5),'.bin')+delimiter+process.env.PATH}});_0x2f0cdc['on']('close',_0x3f157b=>{if(_0x3f157b===0x0||_0x3f157b===null)_0x263110();else _0x478f65(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x3f157b));}),_0x2f0cdc['on'](_0x265f3c(0x1eb),_0x478f65);});}function spawnVitePreview(_0x2ad812){return new Promise((_0x3580fe,_0x8867ae)=>{const _0xaa5e2f=a78_0x24d5,_0x4f5681=spawn(_0xaa5e2f(0x1e2),[_0xaa5e2f(0x1fe)],{'cwd':_0x2ad812,'stdio':_0xaa5e2f(0x1e7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2ad812,_0xaa5e2f(0x1d5),_0xaa5e2f(0x1c4))+delimiter+process.env.PATH}});_0x4f5681['on']('close',_0x425372=>{const _0x26a2ac=_0xaa5e2f;if(_0x425372===0x0||_0x425372===null)_0x3580fe();else _0x8867ae(new Error(_0x26a2ac(0x1d9)+_0x425372));}),_0x4f5681['on']('error',_0x8867ae);});}const runFlags=[{'name':a78_0x1baf21(0x1d4),'type':a78_0x1baf21(0x1fa),'description':a78_0x1baf21(0x1de),'default':![]}];export const runDefinition={'service':a78_0x1baf21(0x1cf),'command':'run','description':a78_0x1baf21(0x1f5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a78_0x1baf21(0x1d7),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4aabf1=a78_0x1baf21,_0x1b1605=readPackageScripts(process[_0x4aabf1(0x1fc)]()),_0x4939f5=[];if(_0x1b1605&&Object[_0x4aabf1(0x1f2)](_0x1b1605)[_0x4aabf1(0x1e6)]>0x0){const _0x40ce19=Object['keys'](_0x1b1605),_0x21dabb=Math['max'](..._0x40ce19[_0x4aabf1(0x1fb)](_0x78c698=>_0x78c698[_0x4aabf1(0x1e6)]));_0x4939f5['push'](_0x4aabf1(0x1ca));for(const [_0x467126,_0x224e5d]of Object[_0x4aabf1(0x1ee)](_0x1b1605)){_0x4939f5[_0x4aabf1(0x1c3)](_0x4aabf1(0x1c9)+CLI_BIN_NAME+_0x4aabf1(0x1cd)+_0x467126[_0x4aabf1(0x1da)](_0x21dabb+0x2)+'#\x20'+_0x224e5d);}}else _0x4939f5[_0x4aabf1(0x1c3)](_0x4aabf1(0x1ea)),_0x4939f5[_0x4aabf1(0x1c3)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4aabf1(0x1f9)),_0x4939f5['push'](_0x4aabf1(0x1c9)+CLI_BIN_NAME+_0x4aabf1(0x1d3)),_0x4939f5['push'](_0x4aabf1(0x1c9)+CLI_BIN_NAME+_0x4aabf1(0x1e4)),_0x4939f5['push'](_0x4aabf1(0x1c9)+CLI_BIN_NAME+_0x4aabf1(0x1f4));return _0x4939f5[_0x4aabf1(0x1e1)]('\x0a');},async 'execute'(_0x393e97){const _0xfef0=a78_0x1baf21,_0x27e955=process['cwd'](),_0x30e617=_0x393e97[_0xfef0(0x1d0)][0x0],_0x263d0e=_0x393e97[_0xfef0(0x1d0)]['slice'](0x1),_0x34ed7d=readPackageScripts(_0x27e955);if(!_0x34ed7d)throw CliErrors[_0xfef0(0x1cc)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x30e617){const _0x368094=Object[_0xfef0(0x1f2)](_0x34ed7d);if(_0x368094[_0xfef0(0x1e6)]===0x0)console[_0xfef0(0x1d2)](_0xfef0(0x1ce));else{console[_0xfef0(0x1d2)](_0xfef0(0x1d8));const _0x3bebfe=Math['max'](..._0x368094[_0xfef0(0x1fb)](_0x497cf6=>_0x497cf6[_0xfef0(0x1e6)]));for(const [_0x5a795a,_0x3bda09]of Object['entries'](_0x34ed7d)){console[_0xfef0(0x1d2)](_0xfef0(0x1c9)+_0x5a795a[_0xfef0(0x1da)](_0x3bebfe+0x2)+_0x3bda09);}console[_0xfef0(0x1d2)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0xfef0(0x1f6));}return{'ok':!![]};}if(!_0x34ed7d[_0x30e617])throw CliErrors[_0xfef0(0x1cc)]('Script\x20\x22'+_0x30e617+'\x22\x20not\x20found\x20in\x20package.json.',_0xfef0(0x1cb)+(Object[_0xfef0(0x1f2)](_0x34ed7d)[_0xfef0(0x1e1)](',\x20')||_0xfef0(0x1dc)));const _0x481cbd=detectPackageManager(_0x27e955);VERSION_CHECK_SCRIPTS[_0xfef0(0x1db)](_0x30e617)&&await versionCheck(_0x27e955);if(_0x30e617==='preview'&&_0x393e97['bool']('watch'))return await Promise['all']([spawnViteBuildWatch(_0x27e955),spawnVitePreview(_0x27e955)]),{'ok':!![]};return await spawnScript(_0x481cbd,_0x30e617,_0x263d0e,_0x27e955),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a79_0x267637=a79_0x58be;(function(_0x524d04,_0x4a9406){const _0xd39569=a79_0x58be,_0x111ec6=_0x524d04();while(!![]){try{const _0x9c8e59=-parseInt(_0xd39569(0x1a3))/0x1*(-parseInt(_0xd39569(0x19c))/0x2)+parseInt(_0xd39569(0x1a7))/0x3+-parseInt(_0xd39569(0x1a5))/0x4+-parseInt(_0xd39569(0x19e))/0x5*(parseInt(_0xd39569(0x1a6))/0x6)+-parseInt(_0xd39569(0x19f))/0x7*(-parseInt(_0xd39569(0x1a4))/0x8)+-parseInt(_0xd39569(0x19d))/0x9+parseInt(_0xd39569(0x1a2))/0xa;if(_0x9c8e59===_0x4a9406)break;else _0x111ec6['push'](_0x111ec6['shift']());}catch(_0x3725bb){_0x111ec6['push'](_0x111ec6['shift']());}}}(a79_0x5982,0xb7c3a));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2b72d8){const _0x3b18be=await buildSchemaPayload();return{'ok':!![],'data':_0x3b18be};}function a79_0x58be(_0x3bf146,_0x387f14){_0x3bf146=_0x3bf146-0x19c;const _0x598252=a79_0x5982();let _0x58becb=_0x598252[_0x3bf146];return _0x58becb;}function a79_0x5982(){const _0x2fc417=['1131350BgjVya','5446LkitqJ','Export\x20machine-readable\x20command\x20schema\x20(JSON)','export','5849080SsVqZf','42oXvpRE','32BvnDUr','1685548DtVykF','18uwHnoJ','4231551Gpyjlk','38474phZXMc','8582364lKcnJV'];a79_0x5982=function(){return _0x2fc417;};return a79_0x5982();}export const schemaDefinition={'service':'schema','command':a79_0x267637(0x1a1),'description':a79_0x267637(0x1a0),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a80_0xd5f6b1=a80_0x4b1e;function a80_0x3157(){const _0x8ebbe0=['cwd','skipped','796901JHyiNK','9070dXgSpk','log','3225270qKOQEC','90lEEvNu','inherit','3397310Tnepjd','4263796gFQCwf','pipe','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','Check\x20network\x20connectivity\x20and\x20try\x20again.','lovrabet/rabetbase','apiError','skill','105dppgRo','write','info','\x20skill\x20installed','../../skills/npx-skills-add.js','install','177RinQvq','451848ahPzaI','124788QFBldf'];a80_0x3157=function(){return _0x8ebbe0;};return a80_0x3157();}function a80_0x4b1e(_0x2f20e9,_0x4b7c18){_0x2f20e9=_0x2f20e9-0xe6;const _0x315701=a80_0x3157();let _0x4b1ee9=_0x315701[_0x2f20e9];return _0x4b1ee9;}(function(_0x4fcf84,_0xed8ba){const _0x4e976e=a80_0x4b1e,_0x410b1f=_0x4fcf84();while(!![]){try{const _0x2d441c=-parseInt(_0x4e976e(0xfc))/0x1+parseInt(_0x4e976e(0xfd))/0x2*(-parseInt(_0x4e976e(0xf7))/0x3)+parseInt(_0x4e976e(0xea))/0x4+parseInt(_0x4e976e(0xe9))/0x5+-parseInt(_0x4e976e(0xf9))/0x6*(-parseInt(_0x4e976e(0xf1))/0x7)+parseInt(_0x4e976e(0xf8))/0x8*(-parseInt(_0x4e976e(0xe7))/0x9)+parseInt(_0x4e976e(0xe6))/0xa;if(_0x2d441c===_0xed8ba)break;else _0x410b1f['push'](_0x410b1f['shift']());}catch(_0x3407a2){_0x410b1f['push'](_0x410b1f['shift']());}}}(a80_0x3157,0xb7428));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':a80_0xd5f6b1(0xf0),'command':a80_0xd5f6b1(0xf6),'description':'Install\x20developer\x20skill\x20package','risk':a80_0xd5f6b1(0xf2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x358c91){const _0x4acaa3=a80_0xd5f6b1;logger['setLogPath'](process[_0x4acaa3(0xfa)]()),logger[_0x4acaa3(0xf3)]('skill-install',_0x4acaa3(0xec));const {runNpxSkillsAddGlobal:_0x5b601b}=await import(_0x4acaa3(0xf5)),_0x624e25=_0x358c91['nonInteractive']?_0x4acaa3(0xeb):_0x4acaa3(0xe8);console[_0x4acaa3(0xfe)]('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...');const _0x19ca8c=_0x5b601b(process['cwd'](),_0x4acaa3(0xee),{'stdio':_0x624e25});if(_0x19ca8c[_0x4acaa3(0xfb)])console[_0x4acaa3(0xfe)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x19ca8c['ok'])console[_0x4acaa3(0xfe)](CLI_BIN_NAME+_0x4acaa3(0xf4));else throw CliErrors[_0x4acaa3(0xef)]('npx\x20skills\x20add\x20failed:\x20'+(_0x19ca8c['error']||'unknown'),_0x4acaa3(0xed));}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a81_0x4309(_0x385cf0,_0xcf4ebc){_0x385cf0=_0x385cf0-0x1f0;const _0x592f76=a81_0x592f();let _0x430964=_0x592f76[_0x385cf0];return _0x430964;}const a81_0x4e3c95=a81_0x4309;(function(_0x118a0c,_0x11e10a){const _0x34aaed=a81_0x4309,_0x12b398=_0x118a0c();while(!![]){try{const _0x51034b=-parseInt(_0x34aaed(0x1ff))/0x1*(-parseInt(_0x34aaed(0x1fe))/0x2)+parseInt(_0x34aaed(0x206))/0x3*(-parseInt(_0x34aaed(0x1fd))/0x4)+-parseInt(_0x34aaed(0x209))/0x5*(parseInt(_0x34aaed(0x201))/0x6)+-parseInt(_0x34aaed(0x205))/0x7+-parseInt(_0x34aaed(0x1fa))/0x8*(parseInt(_0x34aaed(0x1f5))/0x9)+parseInt(_0x34aaed(0x1f3))/0xa*(-parseInt(_0x34aaed(0x1f2))/0xb)+parseInt(_0x34aaed(0x204))/0xc;if(_0x51034b===_0x11e10a)break;else _0x12b398['push'](_0x12b398['shift']());}catch(_0x16932e){_0x12b398['push'](_0x12b398['shift']());}}}(a81_0x592f,0x43a48));import{getSqlQueryInfo}from'../../core/api-client.js';function a81_0x592f(){const _0x376677=['1360653TSIVXo','sqlName','sql','5BkGYUs','dbId','sqlContent','619465xoFjGn','70uwijEE','boolean','2060919zeEjma','description','sqlcode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','bool','16mfHHYb','sqlCode','detail','4ezgYRC','20wjWHOJ','25349KqjCPu','read','2554800FpiAdW','appCode','Return\x20full\x20raw\x20SQL\x20query\x20object','26187468QAlDKV','2990239QnTnRM'];a81_0x592f=function(){return _0x376677;};return a81_0x592f();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a81_0x4e3c95(0x208),'command':a81_0x4e3c95(0x1fc),'description':a81_0x4e3c95(0x1f8),'risk':a81_0x4e3c95(0x200),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a81_0x4e3c95(0x1f4),'description':a81_0x4e3c95(0x203)}],async 'execute'(_0x278a4c){const _0x142a2d=a81_0x4e3c95,_0x393f97=await getSqlQueryInfo(_0x278a4c[_0x142a2d(0x202)],_0x278a4c['str'](_0x142a2d(0x1f7))),_0x42a72a=_0x278a4c[_0x142a2d(0x1f9)]('verbose');if(_0x42a72a)return{'ok':!![],'data':_0x393f97};const _0x26a1ff=_0x393f97[_0x142a2d(0x1f0)]?await getDbName(_0x278a4c[_0x142a2d(0x202)],_0x393f97[_0x142a2d(0x1f0)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x393f97[_0x142a2d(0x1fb)],'sqlName':_0x393f97[_0x142a2d(0x207)],'db':_0x26a1ff?_0x26a1ff+'\x20('+_0x393f97[_0x142a2d(0x1f0)]+')':_0x393f97[_0x142a2d(0x1f0)]??'','description':_0x393f97[_0x142a2d(0x1f6)]??'','sqlContent':_0x393f97[_0x142a2d(0x1f1)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a82_0x104b23=a82_0x5697;(function(_0x34090b,_0x5020f7){const _0xe5d720=a82_0x5697,_0x41ea98=_0x34090b();while(!![]){try{const _0x2207f9=parseInt(_0xe5d720(0xd6))/0x1+-parseInt(_0xe5d720(0xd4))/0x2+-parseInt(_0xe5d720(0xcb))/0x3*(-parseInt(_0xe5d720(0xbf))/0x4)+parseInt(_0xe5d720(0xc0))/0x5+-parseInt(_0xe5d720(0xc1))/0x6+-parseInt(_0xe5d720(0xcf))/0x7*(-parseInt(_0xe5d720(0xc8))/0x8)+-parseInt(_0xe5d720(0xbe))/0x9*(parseInt(_0xe5d720(0xd1))/0xa);if(_0x2207f9===_0x5020f7)break;else _0x41ea98['push'](_0x41ea98['shift']());}catch(_0xc865d4){_0x41ea98['push'](_0x41ea98['shift']());}}}(a82_0x7efb,0x9903b));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a82_0x7efb(){const _0x26d614=['Invalid\x20JSON\x20for\x20--params:\x20','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','parse','string','execError','4890744tVzmto','isArray','appCode','2697BwNDTG','length','validation','sql','14uUJvSG','str','10RktTgA','execSuccess','params','411152VRKpgS','execResult','774441uKwTBb','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','now','Returned\x20','exec','19006398nYgABi','1448Ymgekp','4301660QmiWVV','1432512aZOBWG','SQL\x20execution\x20failed'];a82_0x7efb=function(){return _0x26d614;};return a82_0x7efb();}function a82_0x5697(_0x180a90,_0x14b9df){_0x180a90=_0x180a90-0xbb;const _0x7efbd0=a82_0x7efb();let _0x5697a9=_0x7efbd0[_0x180a90];return _0x5697a9;}export const sqlExec={'service':a82_0x104b23(0xce),'command':a82_0x104b23(0xbd),'description':a82_0x104b23(0xd7),'risk':'read','flags':[SQLCODE_FLAG,{'name':'params','type':a82_0x104b23(0xc6),'description':a82_0x104b23(0xc4)}],async 'execute'(_0x324cd6){const _0x56ceb5=a82_0x104b23;let _0x18f65d;const _0x36930d=_0x324cd6[_0x56ceb5(0xd0)](_0x56ceb5(0xd3));if(_0x36930d)try{_0x18f65d=JSON[_0x56ceb5(0xc5)](_0x36930d);}catch{throw CliErrors[_0x56ceb5(0xcd)](_0x56ceb5(0xc3)+_0x36930d);}const _0x2f10c8=Date[_0x56ceb5(0xbb)](),_0x31f6b2=await executeSql(_0x324cd6[_0x56ceb5(0xca)],_0x324cd6['str']('sqlcode'),_0x18f65d),_0x2922c1=Date[_0x56ceb5(0xbb)]()-_0x2f10c8,_0x3fe41d=_0x31f6b2?.[_0x56ceb5(0xd5)]??_0x31f6b2,_0x2b11d7=_0x31f6b2?.[_0x56ceb5(0xd2)]??!![];if(!_0x2b11d7)return{'ok':![],'data':{'error':_0x31f6b2?.[_0x56ceb5(0xc7)]||_0x56ceb5(0xc2),'elapsed':_0x2922c1},'message':_0x56ceb5(0xc2)};const _0x299cc1=Array[_0x56ceb5(0xc9)](_0x3fe41d)?_0x3fe41d:[];return{'ok':!![],'data':{'rows':_0x299cc1,'rowCount':_0x299cc1[_0x56ceb5(0xcc)],'elapsed':_0x2922c1},'message':_0x56ceb5(0xbc)+_0x299cc1['length']+'\x20row(s)\x20in\x20'+_0x2922c1+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5cf007,_0x1f93a2){const _0x5011c2=a83_0x3c3c,_0x6d5ea3=_0x5cf007();while(!![]){try{const _0xf7e595=parseInt(_0x5011c2(0x7b))/0x1+parseInt(_0x5011c2(0x74))/0x2*(-parseInt(_0x5011c2(0x76))/0x3)+-parseInt(_0x5011c2(0x7a))/0x4+parseInt(_0x5011c2(0x77))/0x5*(-parseInt(_0x5011c2(0x79))/0x6)+-parseInt(_0x5011c2(0x7c))/0x7+parseInt(_0x5011c2(0x78))/0x8+parseInt(_0x5011c2(0x75))/0x9;if(_0xf7e595===_0x1f93a2)break;else _0x6d5ea3['push'](_0x6d5ea3['shift']());}catch(_0x492f09){_0x6d5ea3['push'](_0x6d5ea3['shift']());}}}(a83_0x43fd,0x94dc3));import{sqlList}from'../../commands/sql/list.js';function a83_0x43fd(){const _0x394678=['3064128mxaYXt','326604jcpBRb','2673812pGBwEt','504102NRpiea','6732341mtMAOP','1456620CUarnY','19220157OMDyqw','3yiqdcD','5wLAMfd'];a83_0x43fd=function(){return _0x394678;};return a83_0x43fd();}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a83_0x3c3c(_0x1703d3,_0x5d383e){_0x1703d3=_0x1703d3-0x74;const _0x43fde2=a83_0x43fd();let _0x3c3c47=_0x43fde2[_0x1703d3];return _0x3c3c47;}import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a84_0x3cc2d9=a84_0x23ad;function a84_0x23ad(_0x18ed19,_0x35ce21){_0x18ed19=_0x18ed19-0xda;const _0x1ab13a=a84_0x1ab1();let _0x23ad14=_0x1ab13a[_0x18ed19];return _0x23ad14;}function a84_0x1ab1(){const _0x26587f=['5802962CFJsuw','sqlName','bool','2988bHlYBe','sqlcode','Found\x20','pagesize','2172527iqcdJt','str','39411GGAElS','page','num','name','35256LpEeeX','List\x20custom\x20SQL\x20queries','2670TXYugd','string','list','3222npvIPW','\x20SQL\x20queries\x20(total:\x20','number','totalCount','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','appCode','sqlCode','Filter\x20by\x20SQL\x20name','dbId','14065nrKlGB','5565856TeeaKP','Page\x20size','length','105236xGbFOn','boolean','3EdUxse','map','tableData','27RRhXcL','8jSwMKu','verbose','No\x20custom\x20SQL\x20queries\x20found.','sql'];a84_0x1ab1=function(){return _0x26587f;};return a84_0x1ab1();}(function(_0x3d2e39,_0x1c65e4){const _0x388bd7=a84_0x23ad,_0x3c1860=_0x3d2e39();while(!![]){try{const _0x4011e5=parseInt(_0x388bd7(0xf0))/0x1*(-parseInt(_0x388bd7(0xeb))/0x2)+parseInt(_0x388bd7(0xed))/0x3*(parseInt(_0x388bd7(0xe8))/0x4)+parseInt(_0x388bd7(0xe7))/0x5*(parseInt(_0x388bd7(0xde))/0x6)+-parseInt(_0x388bd7(0xfc))/0x7*(-parseInt(_0x388bd7(0xf1))/0x8)+-parseInt(_0x388bd7(0xfe))/0x9*(parseInt(_0x388bd7(0xdb))/0xa)+-parseInt(_0x388bd7(0xf5))/0xb+-parseInt(_0x388bd7(0xf8))/0xc*(-parseInt(_0x388bd7(0x102))/0xd);if(_0x4011e5===_0x1c65e4)break;else _0x3c1860['push'](_0x3c1860['shift']());}catch(_0x2891fa){_0x3c1860['push'](_0x3c1860['shift']());}}}(a84_0x1ab1,0xbc0e1));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a84_0x3cc2d9(0xf4),'command':a84_0x3cc2d9(0xdd),'description':a84_0x3cc2d9(0xda),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a84_0x3cc2d9(0x101),'type':a84_0x3cc2d9(0xdc),'description':a84_0x3cc2d9(0xe5)},{'name':'page','type':a84_0x3cc2d9(0xe0),'description':'Page\x20number','default':0x1},{'name':a84_0x3cc2d9(0xfb),'type':a84_0x3cc2d9(0xe0),'description':a84_0x3cc2d9(0xe9)},{'name':a84_0x3cc2d9(0xf2),'type':a84_0x3cc2d9(0xec),'description':a84_0x3cc2d9(0xe2)}],async 'execute'(_0x57b16c){const _0x8931fb=a84_0x3cc2d9,_0xa8aaa3=await listSqlQueries(_0x57b16c[_0x8931fb(0xe3)],{'sqlCode':_0x57b16c[_0x8931fb(0xfd)](_0x8931fb(0xf9))||undefined,'sqlName':_0x57b16c[_0x8931fb(0xfd)](_0x8931fb(0x101))||undefined,'currentPage':_0x57b16c[_0x8931fb(0x100)](_0x8931fb(0xff)),'pageSize':_0x57b16c['num']('pagesize',0x32)}),_0x492c9c=_0x57b16c[_0x8931fb(0xf7)](_0x8931fb(0xf2)),_0x229b63=_0xa8aaa3[_0x8931fb(0xef)]??[],_0x437e4f=_0xa8aaa3['paging']?.[_0x8931fb(0xe1)]??_0x229b63[_0x8931fb(0xea)];let _0x2a635e;return _0x492c9c?_0x2a635e=_0x229b63:_0x2a635e=await Promise['all'](_0x229b63[_0x8931fb(0xee)](async _0x4bbc7a=>{const _0x27ff8c=_0x8931fb,_0x2a6f14=_0x4bbc7a[_0x27ff8c(0xe6)]?await getDbName(_0x57b16c[_0x27ff8c(0xe3)],_0x4bbc7a[_0x27ff8c(0xe6)]):undefined;return{'sqlCode':_0x4bbc7a[_0x27ff8c(0xe4)],'sqlName':_0x4bbc7a[_0x27ff8c(0xf6)],'description':_0x4bbc7a['description']??'','db':_0x2a6f14?_0x2a6f14+'\x20('+_0x4bbc7a[_0x27ff8c(0xe6)]+')':_0x4bbc7a[_0x27ff8c(0xe6)]??''};})),{'ok':!![],'data':_0x2a635e,'message':_0x229b63[_0x8931fb(0xea)]===0x0?_0x8931fb(0xf3):_0x8931fb(0xfa)+_0x229b63[_0x8931fb(0xea)]+_0x8931fb(0xdf)+_0x437e4f+').'};}};
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a85_0x12138d=a85_0x174a;(function(_0x488153,_0x89bfbf){const _0x2f2145=a85_0x174a,_0x58fdd8=_0x488153();while(!![]){try{const _0x2befb3=-parseInt(_0x2f2145(0x177))/0x1*(-parseInt(_0x2f2145(0x19e))/0x2)+parseInt(_0x2f2145(0x17e))/0x3*(parseInt(_0x2f2145(0x193))/0x4)+parseInt(_0x2f2145(0x180))/0x5+parseInt(_0x2f2145(0x195))/0x6*(-parseInt(_0x2f2145(0x181))/0x7)+-parseInt(_0x2f2145(0x18f))/0x8*(parseInt(_0x2f2145(0x19f))/0x9)+-parseInt(_0x2f2145(0x174))/0xa*(parseInt(_0x2f2145(0x17b))/0xb)+parseInt(_0x2f2145(0x185))/0xc*(-parseInt(_0x2f2145(0x173))/0xd);if(_0x2befb3===_0x89bfbf)break;else _0x58fdd8['push'](_0x58fdd8['shift']());}catch(_0x1c34eb){_0x58fdd8['push'](_0x58fdd8['shift']());}}}(a85_0x3364,0x4b26a));import{readFileSync,existsSync}from'node:fs';function a85_0x174a(_0x5b7c90,_0x163283){_0x5b7c90=_0x5b7c90-0x171;const _0x33643a=a85_0x3364();let _0x174ab2=_0x33643a[_0x5b7c90];return _0x174ab2;}import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';function a85_0x3364(){const _0x4bcfc3=['1195RxBmJh','validation','parameters','type','110wwjVCH','appCode','Created','9jjmxYd','SQL\x20query\x20description','2465695knGSpI','92953kgiDth','utf-8','Updated','sqlcode','2579244PTQWpw','valid','SQL\x20validation\x20failed:\x20','cwd','action','tables','sqlname','Type:\x20','string','sql','16RvSacp','description','message','dbId','378824sJjQbh','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','30IdcfxU','POST','file','dbName','Path\x20to\x20the\x20SQL\x20file','sqlType','Conflict\x20detected','SQL\x20query\x20display\x20name','sqlCode','802mfGcdN','2500704skDkNo','save','\x20successfully','13iBwgoF','111590iqZEPg','str','join'];a85_0x3364=function(){return _0x4bcfc3;};return a85_0x3364();}import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a85_0x12138d(0x18e),'command':a85_0x12138d(0x171),'description':'Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','risk':'write','flags':[{'name':a85_0x12138d(0x197),'type':'string','required':!![],'description':a85_0x12138d(0x199)},SQLCODE_FLAG_OPTIONAL,{'name':'sqlname','type':a85_0x12138d(0x18d),'description':a85_0x12138d(0x19c)},{'name':'db','type':a85_0x12138d(0x18d),'description':a85_0x12138d(0x194)},{'name':a85_0x12138d(0x190),'type':a85_0x12138d(0x18d),'description':a85_0x12138d(0x17f)}],async 'validate'(_0xcf1944){const _0x411909=a85_0x12138d,_0x13ec96=resolve(process[_0x411909(0x188)](),_0xcf1944[_0x411909(0x175)](_0x411909(0x197)));if(!existsSync(_0x13ec96))throw CliErrors[_0x411909(0x178)]('File\x20not\x20found:\x20'+_0x13ec96);const _0xfc1f07=readFileSync(_0x13ec96,_0x411909(0x182)),_0x80112=validateSql(_0xfc1f07);if(!_0x80112[_0x411909(0x186)])throw CliErrors[_0x411909(0x178)](_0x411909(0x187)+_0x80112[_0x411909(0x191)]);},async 'dryRun'(_0x1375fe){const _0x241ed8=a85_0x12138d,_0x19cb07=resolve(process[_0x241ed8(0x188)](),_0x1375fe[_0x241ed8(0x175)](_0x241ed8(0x197))),_0xe2cbfa=readFileSync(_0x19cb07,_0x241ed8(0x182)),_0x913ee7=validateSql(_0xe2cbfa),_0x4e3c30=_0x1375fe['str']('db')||undefined,{db:_0x3f6164,error:_0x527ef7}=await resolveOneDb(_0x1375fe[_0x241ed8(0x17c)],_0x4e3c30);return{'method':_0x241ed8(0x196),'url':'/api/node-toolbox/sql/save','body':{'appCode':_0x1375fe[_0x241ed8(0x17c)],'sqlContent':'('+_0xe2cbfa['length']+'\x20chars)','sqlCode':_0x1375fe[_0x241ed8(0x175)](_0x241ed8(0x184))||undefined,'sqlName':_0x1375fe[_0x241ed8(0x175)](_0x241ed8(0x18b))||undefined,'db':_0x3f6164?_0x3f6164[_0x241ed8(0x198)]+'\x20('+_0x3f6164[_0x241ed8(0x192)]+')':_0x527ef7},'description':['Save\x20SQL\x20query\x20from\x20'+_0x1375fe[_0x241ed8(0x175)]('file'),'Validation:\x20'+_0x913ee7[_0x241ed8(0x191)],_0x241ed8(0x18c)+_0x913ee7[_0x241ed8(0x19a)][_0x241ed8(0x17a)]+'\x20|\x20Tables:\x20'+(_0x913ee7[_0x241ed8(0x18a)]['join'](',\x20')||'N/A')+'\x20|\x20Params:\x20'+(_0x913ee7[_0x241ed8(0x179)][_0x241ed8(0x176)](',\x20')||'none')][_0x241ed8(0x176)]('\x0a')};},async 'execute'(_0x3096fd){const _0x44e4e7=a85_0x12138d,_0x2255e4=resolve(process['cwd'](),_0x3096fd['str'](_0x44e4e7(0x197))),_0x254a79=readFileSync(_0x2255e4,_0x44e4e7(0x182)),_0x17ccd6=_0x3096fd[_0x44e4e7(0x175)]('db')||undefined,{db:_0x14d36d,error:_0x9c534b}=await resolveOneDb(_0x3096fd[_0x44e4e7(0x17c)],_0x17ccd6);if(_0x9c534b)throw CliErrors['validation'](_0x9c534b);const _0x2d2d53=await saveSqlQuery({'appCode':_0x3096fd[_0x44e4e7(0x17c)],'sqlContent':_0x254a79,'sqlCode':_0x3096fd[_0x44e4e7(0x175)](_0x44e4e7(0x184))||undefined,'sqlName':_0x3096fd[_0x44e4e7(0x175)](_0x44e4e7(0x18b))||undefined,'dbId':_0x14d36d['dbId'],'description':_0x3096fd[_0x44e4e7(0x175)]('description')||undefined});if(_0x2d2d53['blocked'])return{'ok':![],'data':_0x2d2d53,'message':_0x2d2d53[_0x44e4e7(0x191)]||_0x44e4e7(0x19b)};return{'ok':!![],'data':{'sqlCode':_0x2d2d53[_0x44e4e7(0x19d)],'sqlName':_0x2d2d53['sqlName'],'action':_0x2d2d53['action']},'message':(_0x2d2d53[_0x44e4e7(0x189)]==='created'?_0x44e4e7(0x17d):_0x44e4e7(0x183))+_0x44e4e7(0x172)+(_0x2d2d53[_0x44e4e7(0x19d)]?'\x20('+_0x2d2d53['sqlCode']+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a86_0x2558ec=a86_0x2129;(function(_0x89220a,_0x369dca){const _0x459705=a86_0x2129,_0x442e4f=_0x89220a();while(!![]){try{const _0x43d8c3=parseInt(_0x459705(0x193))/0x1*(-parseInt(_0x459705(0x177))/0x2)+-parseInt(_0x459705(0x16b))/0x3+parseInt(_0x459705(0x16a))/0x4+-parseInt(_0x459705(0x184))/0x5*(parseInt(_0x459705(0x189))/0x6)+parseInt(_0x459705(0x178))/0x7+parseInt(_0x459705(0x18a))/0x8*(parseInt(_0x459705(0x17e))/0x9)+parseInt(_0x459705(0x179))/0xa;if(_0x43d8c3===_0x369dca)break;else _0x442e4f['push'](_0x442e4f['shift']());}catch(_0x2b57db){_0x442e4f['push'](_0x442e4f['shift']());}}}(a86_0x30e8,0x2dfcf));import{readFileSync,existsSync}from'node:fs';function a86_0x30e8(){const _0x5d8d10=['message','valid','227916XxTdEn','tables','schema:','split','file','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','335LXMTmJ','sqlType','Table\x20\x22','tableName','toLowerCase','5706cDANeX','64RhswVX','cwd','str','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isSelectOnly','size','\x22\x20not\x20found\x20in\x20any\x20dataset','push','isDangerous','920gWnvwm','map','trim','sql','filter','schemas','Provide\x20--file\x20or\x20--sql','string','length','dbtableConfig','1344032uVjlUO','557901ujGFlL','validate','File\x20not\x20found:\x20','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','parameters','read','fields','flagMissing','schemaWarnings','reason','get','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','770WVlxxO','86506bDqZPo','2412930zTtFCv','from','type'];a86_0x30e8=function(){return _0x5d8d10;};return a86_0x30e8();}import{resolve}from'node:path';function a86_0x2129(_0x20cc70,_0x125632){_0x20cc70=_0x20cc70-0x165;const _0x30e80b=a86_0x30e8();let _0x212969=_0x30e80b[_0x20cc70];return _0x212969;}import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a86_0x2558ec(0x196),'command':a86_0x2558ec(0x16c),'description':a86_0x2558ec(0x176),'risk':a86_0x2558ec(0x170),'flags':[{'name':a86_0x2558ec(0x182),'type':a86_0x2558ec(0x167),'description':a86_0x2558ec(0x16e)},{'name':'sql','type':a86_0x2558ec(0x167),'description':a86_0x2558ec(0x18d)},{'name':a86_0x2558ec(0x165),'type':a86_0x2558ec(0x167),'description':a86_0x2558ec(0x183)}],async 'execute'(_0x419f37){const _0xedf647=a86_0x2558ec,_0x7a9d09=_0x419f37['str'](_0xedf647(0x182)),_0x2ab195=_0x419f37[_0xedf647(0x18c)](_0xedf647(0x196));if(!_0x7a9d09&&!_0x2ab195)throw CliErrors[_0xedf647(0x172)](_0xedf647(0x182),_0xedf647(0x166));let _0x3fa75e;if(_0x7a9d09){const _0x514f64=resolve(process[_0xedf647(0x18b)](),_0x7a9d09);if(!existsSync(_0x514f64))throw CliErrors['validation'](_0xedf647(0x16d)+_0x514f64);_0x3fa75e=readFileSync(_0x514f64,'utf-8');}else _0x3fa75e=_0x2ab195;const _0x118517=validateSql(_0x3fa75e),_0x19bd44={'valid':_0x118517[_0xedf647(0x17d)],'sqlType':_0x118517[_0xedf647(0x185)][_0xedf647(0x17b)],'isSelectOnly':_0x118517[_0xedf647(0x185)][_0xedf647(0x18e)],'isDangerous':_0x118517['sqlType'][_0xedf647(0x192)],'tables':_0x118517[_0xedf647(0x17f)],'parameters':_0x118517[_0xedf647(0x16f)],'message':_0x118517['message']};_0x118517[_0xedf647(0x185)][_0xedf647(0x174)]&&(_0x19bd44[_0xedf647(0x174)]=_0x118517[_0xedf647(0x185)][_0xedf647(0x174)]);const _0x46dc4d=_0x419f37[_0xedf647(0x18c)](_0xedf647(0x165));if(_0x46dc4d&&_0x118517[_0xedf647(0x17d)]){const _0x3665f7=_0x46dc4d[_0xedf647(0x181)](',')[_0xedf647(0x194)](_0x3447de=>_0x3447de[_0xedf647(0x195)]())[_0xedf647(0x197)](Boolean),_0x44bdf8=[],_0x1aced4=await listDatasets(_0x419f37['appCode']),_0x13d3ca=new Map(_0x1aced4[_0xedf647(0x194)](_0x52da8a=>[_0x52da8a['dbtableConfig']?.[_0xedf647(0x187)]?.[_0xedf647(0x188)](),_0x52da8a]));for(const _0x5d0ee8 of _0x118517[_0xedf647(0x17f)]){const _0x174f9f=_0x13d3ca[_0xedf647(0x175)](_0x5d0ee8[_0xedf647(0x188)]());!_0x174f9f&&_0x44bdf8[_0xedf647(0x191)](_0xedf647(0x186)+_0x5d0ee8+_0xedf647(0x190));}for(const _0x480394 of _0x3665f7){try{const _0x260959=await getDatasetDetail(_0x480394),_0x56ea34=Array['isArray'](_0x260959[_0xedf647(0x171)])?_0x260959[_0xedf647(0x171)]:[],_0x4384a1=new Set(_0x56ea34['map'](_0x2a852a=>_0x2a852a['name']?.['toLowerCase']())),_0x2cdbf8=_0x260959[_0xedf647(0x169)]?.[_0xedf647(0x187)]||_0x260959[_0xedf647(0x187)]||_0x480394;_0x19bd44[_0xedf647(0x180)+_0x2cdbf8]={'code':_0x480394,'tableName':_0x2cdbf8,'fieldCount':_0x4384a1[_0xedf647(0x18f)],'fields':Array[_0xedf647(0x17a)](_0x4384a1)};}catch{_0x44bdf8[_0xedf647(0x191)]('Dataset\x20\x22'+_0x480394+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x44bdf8[_0xedf647(0x168)]>0x0&&(_0x19bd44[_0xedf647(0x173)]=_0x44bdf8);}return{'ok':_0x118517['valid'],'data':_0x19bd44,'message':_0x118517[_0xedf647(0x17c)]};}};
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a87_0x3e12(_0x449c9b,_0x564204){_0x449c9b=_0x449c9b-0x19c;const _0x71f931=a87_0x71f9();let _0x3e1265=_0x71f931[_0x449c9b];return _0x3e1265;}const a87_0x2abbeb=a87_0x3e12;(function(_0x53d2ea,_0x4ea3d6){const _0x16b9f3=a87_0x3e12,_0x2309b4=_0x53d2ea();while(!![]){try{const _0x2348ae=parseInt(_0x16b9f3(0x1f0))/0x1+-parseInt(_0x16b9f3(0x1da))/0x2+-parseInt(_0x16b9f3(0x1e7))/0x3+parseInt(_0x16b9f3(0x1f9))/0x4+parseInt(_0x16b9f3(0x1d0))/0x5*(-parseInt(_0x16b9f3(0x1a4))/0x6)+-parseInt(_0x16b9f3(0x1e9))/0x7*(-parseInt(_0x16b9f3(0x1a9))/0x8)+parseInt(_0x16b9f3(0x1a2))/0x9*(parseInt(_0x16b9f3(0x1f8))/0xa);if(_0x2348ae===_0x4ea3d6)break;else _0x2309b4['push'](_0x2309b4['shift']());}catch(_0x5a59a6){_0x2309b4['push'](_0x2309b4['shift']());}}}(a87_0x71f9,0x2af27));export const CLI_BIN_NAME=a87_0x2abbeb(0x1de);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':'appcode','type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1fb),'hint':a87_0x2abbeb(0x1c5)},{'name':a87_0x2abbeb(0x1c2),'meowKey':a87_0x2abbeb(0x1c2),'type':'string','description':a87_0x2abbeb(0x1e0),'hint':a87_0x2abbeb(0x1ca)},{'name':a87_0x2abbeb(0x1c1),'meowKey':a87_0x2abbeb(0x1c1),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1a5),'hint':'production\x20|\x20daily'},{'name':a87_0x2abbeb(0x1ea),'meowKey':'format','type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1dc),'hint':a87_0x2abbeb(0x1b9)},{'name':'jq','meowKey':'jq','type':'string','description':a87_0x2abbeb(0x1be),'hint':a87_0x2abbeb(0x1b4)},{'name':'dry-run','meowKey':a87_0x2abbeb(0x1e8),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1e6)},{'name':a87_0x2abbeb(0x1a8),'meowKey':a87_0x2abbeb(0x1a8),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1ad)},{'name':'non-interactive','meowKey':a87_0x2abbeb(0x19c),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x19e)},{'name':a87_0x2abbeb(0x1ce),'meowKey':'global','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x19d)},{'name':a87_0x2abbeb(0x1bc),'meowKey':a87_0x2abbeb(0x1bc),'type':'boolean','description':a87_0x2abbeb(0x1bb)},{'name':'ci','meowKey':'ci','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1b6),'hidden':!![]},{'name':a87_0x2abbeb(0x1ac),'meowKey':a87_0x2abbeb(0x1ac),'type':'boolean','description':'Show\x20help'},{'name':'name','meowKey':a87_0x2abbeb(0x1d6),'type':'string','description':a87_0x2abbeb(0x1d2),'hidden':!![]},{'name':a87_0x2abbeb(0x1c9),'meowKey':a87_0x2abbeb(0x1c9),'type':a87_0x2abbeb(0x1db),'description':'Clear','hidden':!![]},{'name':a87_0x2abbeb(0x1ef),'meowKey':'watch','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1d7),'hidden':!![]},{'name':a87_0x2abbeb(0x1cc),'meowKey':a87_0x2abbeb(0x1cc),'type':'string','description':'Output\x20path','hidden':!![]},{'name':a87_0x2abbeb(0x1df),'meowKey':a87_0x2abbeb(0x1df),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1f7),'hidden':!![]},{'name':'datasetcode','meowKey':a87_0x2abbeb(0x1f4),'type':a87_0x2abbeb(0x1b5),'description':'Dataset\x20code','hidden':!![]},{'name':a87_0x2abbeb(0x1f1),'meowKey':'all','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1b7),'hidden':!![]},{'name':a87_0x2abbeb(0x1b1),'meowKey':a87_0x2abbeb(0x1b3),'type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1d1),'hidden':!![]},{'name':'id','meowKey':'id','type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1fa),'hidden':!![]},{'name':'type','meowKey':a87_0x2abbeb(0x1d9),'type':'string','description':a87_0x2abbeb(0x1c7),'hidden':!![]},{'name':a87_0x2abbeb(0x1aa),'meowKey':a87_0x2abbeb(0x1aa),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1eb),'hidden':!![]},{'name':a87_0x2abbeb(0x1ec),'meowKey':'sqlcode','type':'string','description':a87_0x2abbeb(0x1c8),'hidden':!![]},{'name':'sqlname','meowKey':a87_0x2abbeb(0x1b2),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1bf),'hidden':!![]},{'name':a87_0x2abbeb(0x1f2),'meowKey':a87_0x2abbeb(0x1f2),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1ba),'hidden':!![]},{'name':a87_0x2abbeb(0x1b8),'meowKey':a87_0x2abbeb(0x1b8),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1a3),'hidden':!![]},{'name':a87_0x2abbeb(0x1f5),'meowKey':a87_0x2abbeb(0x1f5),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1ed),'hidden':!![]},{'name':a87_0x2abbeb(0x1e5),'meowKey':a87_0x2abbeb(0x1e5),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1a1),'hidden':!![]},{'name':a87_0x2abbeb(0x1a0),'meowKey':a87_0x2abbeb(0x1a0),'type':a87_0x2abbeb(0x1b5),'description':'Keyword\x20filter','hidden':!![]},{'name':a87_0x2abbeb(0x1c3),'meowKey':a87_0x2abbeb(0x1c3),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1cb),'hidden':!![]},{'name':a87_0x2abbeb(0x1e2),'meowKey':a87_0x2abbeb(0x1e2),'type':a87_0x2abbeb(0x1b5),'description':'SQL\x20string','hidden':!![]},{'name':a87_0x2abbeb(0x1f6),'meowKey':a87_0x2abbeb(0x1f6),'type':'string','description':a87_0x2abbeb(0x1e4),'hidden':!![]},{'name':a87_0x2abbeb(0x1c4),'meowKey':a87_0x2abbeb(0x1c4),'type':a87_0x2abbeb(0x1b5),'description':'Operation\x20type','hidden':!![]},{'name':a87_0x2abbeb(0x1b0),'meowKey':a87_0x2abbeb(0x1b0),'type':'string','description':a87_0x2abbeb(0x1e3),'hidden':!![]},{'name':'skip-imports','meowKey':a87_0x2abbeb(0x1a7),'type':'boolean','description':'Skip\x20import\x20generation','hidden':!![]},{'name':a87_0x2abbeb(0x1cf),'meowKey':a87_0x2abbeb(0x1cf),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x19f),'hidden':!![]},{'name':a87_0x2abbeb(0x1cd),'meowKey':a87_0x2abbeb(0x1cd),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1ab),'hidden':!![]},{'name':a87_0x2abbeb(0x1d5),'meowKey':'force','type':a87_0x2abbeb(0x1db),'description':a87_0x2abbeb(0x1f3),'hidden':!![]},{'name':'remote','meowKey':a87_0x2abbeb(0x1ae),'type':'boolean','description':a87_0x2abbeb(0x1d4),'hidden':!![]},{'name':a87_0x2abbeb(0x1c6),'meowKey':a87_0x2abbeb(0x1c6),'type':'boolean','description':a87_0x2abbeb(0x1a6),'hidden':!![]},{'name':a87_0x2abbeb(0x1ee),'meowKey':a87_0x2abbeb(0x1c0),'type':a87_0x2abbeb(0x1b5),'description':'Operation\x20type','hidden':!![]},{'name':a87_0x2abbeb(0x1d3),'meowKey':a87_0x2abbeb(0x1dd),'type':a87_0x2abbeb(0x1b5),'description':a87_0x2abbeb(0x1af),'hidden':!![]}];function a87_0x71f9(){const _0x552c2c=['File\x20path','sqlcode','Page\x20number','operation-type','watch','120298eFdhxB','all','dbid','Force\x20overwrite','datasetcode','page','schemas','JSON\x20params','670OvYfmt','545220ZKYlxb','Record\x20ID','Override\x20appcode','nonInteractive','Use\x20global\x20config\x20scope','Force\x20non-interactive\x20mode\x20(CI)','Config\x20key','keyword','Page\x20size','87201pMHYJH','Description','119772svPlCZ','Environment','Verbose\x20output','skipImports','yes','500728jkJILW','file','Config\x20value','help','Skip\x20confirmation\x20for\x20high-risk\x20writes','remote','Function\x20node','target','enable-bff-save','sqlname','enableBffSave','<expr>','string','Alias\x20for\x20--non-interactive','Apply\x20to\x20all','description','json\x20|\x20pretty\x20|\x20compress','DB\x20ID','Use\x20project\x20config\x20scope','project','map','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','SQL\x20name','operationType','env','app','code','operation','<code>','verbose','Type\x20filter','SQL\x20code','clear','<name>','Code\x20filter','output','value','global','key','45JfjzCp','Enable\x20BFF\x20save','Name','function-node','Use\x20remote','force','name','Watch\x20mode','fromEntries','type','555538iDNmUV','boolean','Output\x20format','functionNode','rabetbase','params','Select\x20app\x20profile\x20by\x20name','meowKey','sql','Target\x20path','Schemas','pagesize','Preview\x20operation\x20without\x20executing','1005057fLHngZ','dryRun','7ZhEvPX','format'];a87_0x71f9=function(){return _0x552c2c;};return a87_0x71f9();}export function buildMeowFlags(){const _0x2c237e=a87_0x2abbeb;return Object[_0x2c237e(0x1d8)](GLOBAL_FLAGS[_0x2c237e(0x1bd)](_0x4ac82c=>[_0x4ac82c[_0x2c237e(0x1e1)],{'type':_0x4ac82c['type']}]));}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a88_0x2b2721=a88_0x1a6e;(function(_0x391f3e,_0x19a149){const _0x3b6e2c=a88_0x1a6e,_0x13dd67=_0x391f3e();while(!![]){try{const _0x168490=parseInt(_0x3b6e2c(0x67))/0x1*(-parseInt(_0x3b6e2c(0x6a))/0x2)+parseInt(_0x3b6e2c(0x6b))/0x3+parseInt(_0x3b6e2c(0x6d))/0x4+parseInt(_0x3b6e2c(0x68))/0x5*(parseInt(_0x3b6e2c(0x74))/0x6)+parseInt(_0x3b6e2c(0x6e))/0x7+-parseInt(_0x3b6e2c(0x72))/0x8*(-parseInt(_0x3b6e2c(0x69))/0x9)+-parseInt(_0x3b6e2c(0x6f))/0xa;if(_0x168490===_0x19a149)break;else _0x13dd67['push'](_0x13dd67['shift']());}catch(_0x3e4d2a){_0x13dd67['push'](_0x13dd67['shift']());}}}(a88_0x293b,0x7a34a));function a88_0x293b(){const _0x28ae7e=['9WugSVp','1891784Aalrmq','2702751tAaJCF','https://runtime.lovrabet.com','2085296xVvCNE','6257139yNmlOx','15574970STiMUU','https://api.lovrabet.com','runtimeDomain','2347832YyGVTS','userDomain','12nEFQKZ','apiDomain','https://user-daily.lovrabet.com','production','1PkEXEj','985865ecuPXK'];a88_0x293b=function(){return _0x28ae7e;};return a88_0x293b();}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a88_0x1a6e(_0x54237d,_0x214fae){_0x54237d=_0x54237d-0x65;const _0x293b22=a88_0x293b();let _0x1a6ec7=_0x293b22[_0x54237d];return _0x1a6ec7;}export function initDomains(_0x5533d9){const _0x5658e5=a88_0x1a6e;customApiDomain=_0x5533d9?.[_0x5658e5(0x75)],customUserDomain=_0x5533d9?.[_0x5658e5(0x73)],customRuntimeDomain=_0x5533d9?.[_0x5658e5(0x71)];}export const getUserDomain=()=>customUserDomain||(getEnv()===a88_0x2b2721(0x66)?'https://user.lovrabet.com':a88_0x2b2721(0x65));export const getApiDomain=()=>customApiDomain||(getEnv()===a88_0x2b2721(0x66)?a88_0x2b2721(0x70):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a88_0x2b2721(0x66)?a88_0x2b2721(0x6c):'https://daily-runtime.lovrabet.com');
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a89_0x10b161=a89_0x7bff;(function(_0x1ab5b5,_0x4f9ae8){const _0x538e80=a89_0x7bff,_0x10f934=_0x1ab5b5();while(!![]){try{const _0xd444c4=parseInt(_0x538e80(0x92))/0x1*(-parseInt(_0x538e80(0x95))/0x2)+parseInt(_0x538e80(0x93))/0x3+parseInt(_0x538e80(0x9c))/0x4*(-parseInt(_0x538e80(0x96))/0x5)+parseInt(_0x538e80(0x9b))/0x6+parseInt(_0x538e80(0x97))/0x7*(-parseInt(_0x538e80(0x94))/0x8)+-parseInt(_0x538e80(0x99))/0x9*(parseInt(_0x538e80(0x9d))/0xa)+parseInt(_0x538e80(0x98))/0xb;if(_0xd444c4===_0x4f9ae8)break;else _0x10f934['push'](_0x10f934['shift']());}catch(_0x1e6e80){_0x10f934['push'](_0x10f934['shift']());}}}(a89_0x447a,0xe2eca));export function normalizeEnv(_0x498923){const _0x4a3615=a89_0x7bff;return _0x498923===_0x4a3615(0x9e)?_0x4a3615(0x9a):_0x498923;}function a89_0x7bff(_0x3e6684,_0x22675d){_0x3e6684=_0x3e6684-0x92;const _0x447ae9=a89_0x447a();let _0x7bff28=_0x447ae9[_0x3e6684];return _0x7bff28;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x10b161(0x9a));function a89_0x447a(){const _0x476390=['144mSyxlU','3710EAeRjH','5FrReIs','266518QoplVY','26768148grafzy','18jxhuAg','production','2554650PhqPzk','5760116rQNaGa','2120490MwtrEP','online','101DUYHer','2421159fqbOWI'];a89_0x447a=function(){return _0x476390;};return a89_0x447a();}export function getEnv(){return env;}export function initEnv(_0x1155c6){env=normalizeEnv(_0x1155c6);}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a90_0x4c4e(){const _0x493f62=['410271DVFqSw','3165600XATXKP','3163YcwEIz','./src/api','15959688wCoxhi','106OCwvkz','98832KGZHgG','916872HAQkZF','5521502inIRKl'];a90_0x4c4e=function(){return _0x493f62;};return a90_0x4c4e();}function a90_0x21c3(_0x97cd6,_0x45fc13){_0x97cd6=_0x97cd6-0x1e2;const _0x4c4e0c=a90_0x4c4e();let _0x21c3f1=_0x4c4e0c[_0x97cd6];return _0x21c3f1;}const a90_0x2e1605=a90_0x21c3;(function(_0x184474,_0x56bebf){const _0x55c44c=a90_0x21c3,_0x332b69=_0x184474();while(!![]){try{const _0x40b995=-parseInt(_0x55c44c(0x1e2))/0x1*(parseInt(_0x55c44c(0x1e5))/0x2)+-parseInt(_0x55c44c(0x1e9))/0x3+-parseInt(_0x55c44c(0x1e6))/0x4+-parseInt(_0x55c44c(0x1ea))/0x5+parseInt(_0x55c44c(0x1e7))/0x6+-parseInt(_0x55c44c(0x1e8))/0x7+parseInt(_0x55c44c(0x1e4))/0x8;if(_0x40b995===_0x56bebf)break;else _0x332b69['push'](_0x332b69['shift']());}catch(_0x58f0a6){_0x332b69['push'](_0x332b69['shift']());}}}(a90_0x4c4e,0x60ddb));export const DEFAULT_API_DIR=a90_0x2e1605(0x1e3);
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a91_0x55a9(){const _0x346f5c=['length','./constant/env.js','./utils/is-non-interactive.js','.rabetbase.json','1673usyCPa','read','find','entries','807204GYUlgv','write','trim','apiDomain','authRequired','api.ts','pageSize','APP','locale','stringify','1362255IsCyoD','empty','apiDir','runtimeDomain','7227608HZxuMN','appcode','\x0a\x20\x20','PAGE_SIZE','production','slice','defaultApp','180599KEZGlE','Global','riskLevel','RISK_LEVEL','setLogPath','./auth/get-cookie.js','ACCESS_KEY','userDomain','cwd','keys','Project','APPCODE','object','message','.lovrabet.json','MAX_RISK','COOKIE','true','setRawCommand','maxRisk','join','high-risk-write','status','./constant/domain.js','1687128UuqgEy','env','utf8','string','online','format','missing','VERBOSE','-api.ts','daily','error','en-US','parse','accessKey','app','apps','warn','cookie','15558Uygjtt','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','3024512CGikoq','.lovrabetrc','filter'];a91_0x55a9=function(){return _0x346f5c;};return a91_0x55a9();}const a91_0x1a9cc5=a91_0x52ca;(function(_0xaf6dfe,_0x4ac52d){const _0x36c322=a91_0x52ca,_0x1d9bd5=_0xaf6dfe();while(!![]){try{const _0x350eed=-parseInt(_0x36c322(0x1fe))/0x1+parseInt(_0x36c322(0x1e9))/0x2+-parseInt(_0x36c322(0x216))/0x3+parseInt(_0x36c322(0x1de))/0x4+parseInt(_0x36c322(0x1f3))/0x5+-parseInt(_0x36c322(0x1dc))/0x6*(-parseInt(_0x36c322(0x1e5))/0x7)+-parseInt(_0x36c322(0x1f7))/0x8;if(_0x350eed===_0x4ac52d)break;else _0x1d9bd5['push'](_0x1d9bd5['shift']());}catch(_0x815ce2){_0x1d9bd5['push'](_0x1d9bd5['shift']());}}}(a91_0x55a9,0x62fea));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 a91_0x52ca(_0x471149,_0x290282){_0x471149=_0x471149-0x1d5;const _0x55a95d=a91_0x55a9();let _0x52ca95=_0x55a95d[_0x471149];return _0x52ca95;}import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x21e0ce){return process.env[`RABETBASE_${_0x21e0ce}`]||process.env[`LOVRABET_${_0x21e0ce}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x1a9cc5(0x1e4);export const CONFIG_NAMES=[a91_0x1a9cc5(0x1e4),a91_0x1a9cc5(0x20c),a91_0x1a9cc5(0x1df)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x1a9cc5(0x1e0)](_0x20cd7e=>_0x20cd7e!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x3330d4){for(const _0x5f4660 of CONFIG_NAMES){const _0x2ec503=resolve(_0x3330d4,_0x5f4660);if(existsSync(_0x2ec503))return _0x2ec503;}return undefined;}export async function createContext(_0x4197fd){const _0x99546e=a91_0x1a9cc5,_0x344212=readRawConfig(),_0x1a4a42=buildConfig(_0x344212,_0x4197fd),{initEnv:_0x489742}=await import(_0x99546e(0x1e2));if(_0x1a4a42[_0x99546e(0x217)])_0x489742(_0x1a4a42[_0x99546e(0x217)]);else _0x4197fd[_0x99546e(0x217)]&&typeof _0x4197fd[_0x99546e(0x217)]===_0x99546e(0x219)&&_0x489742(_0x4197fd['env']);const {initDomains:_0x511a5a,getUserDomain:_0xb8c4bc,getApiDomain:_0x4ad0ff}=await import(_0x99546e(0x215));_0x511a5a({'apiDomain':_0x344212[_0x99546e(0x1ec)]||undefined,'userDomain':_0x344212[_0x99546e(0x205)]||undefined,'runtimeDomain':_0x344212[_0x99546e(0x1f6)]||undefined});const _0x95db03={'apiDomain':_0x4ad0ff(),'userDomain':_0xb8c4bc()},_0x1bfe71=await buildAuth(_0x1a4a42);logger[_0x99546e(0x202)](process[_0x99546e(0x206)]());const _0x7657f4=(CLI_BIN_NAME+'\x20'+process['argv'][_0x99546e(0x1fc)](0x2)[_0x99546e(0x212)]('\x20'))[_0x99546e(0x1eb)]();logger[_0x99546e(0x210)](_0x7657f4);const {isNonInteractive:_0x55094b}=await import(_0x99546e(0x1e3)),_0x1ffddf=_0x55094b(_0x4197fd);return{'config':_0x1a4a42,'auth':_0x1bfe71,'logger':logger,'env':_0x95db03,'nonInteractive':_0x1ffddf};}export function buildConfigFromFlags(_0x3e3506){return buildConfig(readRawConfig(),_0x3e3506);}export function getProjectConfigPath(){const _0x1e8452=a91_0x1a9cc5;return resolveConfigPath(process[_0x1e8452(0x206)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4d9b7c){const _0x4e457a=a91_0x1a9cc5;if(!existsSync(_0x4d9b7c))return{'status':_0x4e457a(0x21c)};try{const _0x5886eb=readFileSync(_0x4d9b7c,{'encoding':_0x4e457a(0x218)});if(!_0x5886eb?.['trim']())return{'status':_0x4e457a(0x1f4)};const _0x1a2afb=JSON[_0x4e457a(0x1d6)](_0x5886eb);return{'status':'ok','data':_0x1a2afb};}catch(_0x26e9cc){return{'status':_0x4e457a(0x220),'message':_0x26e9cc instanceof Error?_0x26e9cc[_0x4e457a(0x20b)]:String(_0x26e9cc)};}}function parseCliConfigJsonFile(_0x4f4c88,_0x2b6b2b,_0x39b622){const _0x59f9ad=a91_0x1a9cc5,_0x1c0f1a=inspectCliConfigJsonFile(_0x4f4c88);if(_0x1c0f1a[_0x59f9ad(0x214)]===_0x59f9ad(0x21c)||_0x1c0f1a[_0x59f9ad(0x214)]===_0x59f9ad(0x1f4))return{};if(_0x1c0f1a[_0x59f9ad(0x214)]==='ok')return _0x1c0f1a['data'];return _0x2b6b2b==='warn'&&_0x39b622&&console['error'](CLI_BIN_NAME+':\x20'+_0x39b622+_0x59f9ad(0x1dd)+_0x4f4c88+_0x59f9ad(0x1f9)+_0x1c0f1a[_0x59f9ad(0x20b)]),{};}export function loadRawConfigLayers(_0x4c1f26){const _0x146107=a91_0x1a9cc5;let _0x19c5c1={},_0x1b460e={};const _0x5d0358=resolveConfigPath(homedir());_0x5d0358&&(_0x19c5c1=parseCliConfigJsonFile(_0x5d0358,'warn',_0x146107(0x1ff)));const _0x4e2ea9=_0x4c1f26||process[_0x146107(0x206)](),_0x2da943=resolveConfigPath(_0x4e2ea9);return _0x2da943&&(_0x1b460e=parseCliConfigJsonFile(_0x2da943,_0x146107(0x1da),_0x146107(0x208))),{'globalPath':_0x5d0358,'projectPath':_0x2da943,'globalConfig':_0x19c5c1,'projectConfig':_0x1b460e};}function mergeRawConfigLayers(_0x10954b){const _0x3c4a51=a91_0x1a9cc5,{globalConfig:_0x147d49,projectConfig:_0x195a30}=_0x10954b,_0x6e811b=_0x147d49[_0x3c4a51(0x1d9)]&&typeof _0x147d49[_0x3c4a51(0x1d9)]===_0x3c4a51(0x20a)?_0x147d49[_0x3c4a51(0x1d9)]:{},_0xe26887=_0x195a30[_0x3c4a51(0x1d9)]&&typeof _0x195a30[_0x3c4a51(0x1d9)]==='object'?_0x195a30[_0x3c4a51(0x1d9)]:{},_0xab00d6={..._0x6e811b,..._0xe26887},_0x5786c9={..._0x147d49,..._0x195a30};Object['keys'](_0xab00d6)[_0x3c4a51(0x1e1)]>0x0&&(_0x5786c9['apps']=_0xab00d6);if(_0x3c4a51(0x1fd)in _0x195a30)_0x5786c9[_0x3c4a51(0x1fd)]=_0x195a30[_0x3c4a51(0x1fd)];else{if(_0xe26887&&Object[_0x3c4a51(0x207)](_0xe26887)[_0x3c4a51(0x1e1)]>0x0)_0x5786c9[_0x3c4a51(0x1fd)]=Object['keys'](_0xe26887)[0x0];else _0x147d49[_0x3c4a51(0x1fd)]&&(_0x5786c9[_0x3c4a51(0x1fd)]=_0x147d49['defaultApp']);}return _0x5786c9;}export function readRawConfigWithLayers(_0x299d21){const _0x32a257=loadRawConfigLayers(_0x299d21);return{'config':mergeRawConfigLayers(_0x32a257),'layers':_0x32a257};}export function readRawConfig(_0x5f0a78){return mergeRawConfigLayers(loadRawConfigLayers(_0x5f0a78));}export function readConfigFile(_0x339819){return parseCliConfigJsonFile(_0x339819,'silent');}export function writeConfigFile(_0x528747,_0x263c19){const _0x202ccd=a91_0x1a9cc5,_0x7be52f=dirname(_0x528747);!existsSync(_0x7be52f)&&mkdirSync(_0x7be52f,{'recursive':!![]});const _0x3cea3a=_0x528747+'.tmp';try{writeFileSync(_0x3cea3a,JSON[_0x202ccd(0x1f2)](_0x263c19,null,0x2)+'\x0a',{'encoding':_0x202ccd(0x218),'mode':0x180}),renameSync(_0x3cea3a,_0x528747);}catch(_0x242dce){try{unlinkSync(_0x3cea3a);}catch{}throw _0x242dce;}}export function resolveWriteConfigPath(_0x30bf3f){const _0x483394=a91_0x1a9cc5,_0x281de9=_0x30bf3f==='project'?process[_0x483394(0x206)]():homedir(),_0x9aee05=resolveConfigPath(_0x281de9);return _0x9aee05??resolve(_0x281de9,NEW_CONFIG_NAME);}function buildConfig(_0x5b7705,_0x574070){const _0x34c776=a91_0x1a9cc5,_0x448d5d={};if(_0x5b7705['apps']&&typeof _0x5b7705[_0x34c776(0x1d9)]===_0x34c776(0x20a))for(const [_0x5ac2e0,_0x47eab2]of Object['entries'](_0x5b7705[_0x34c776(0x1d9)])){_0x47eab2&&typeof _0x47eab2==='object'&&_0x47eab2['appcode']&&(_0x448d5d[_0x5ac2e0]=_0x47eab2);}const _0xf4563e=_0x5b7705[_0x34c776(0x1fd)]||undefined,_0x20f0e3=Object[_0x34c776(0x207)](_0x448d5d)[_0x34c776(0x1e1)]>0x0,_0x24d82d=_0x574070[_0x34c776(0x1d8)]||env(_0x34c776(0x1f0))||undefined,_0x55fce4=_0x24d82d||_0xf4563e||undefined,_0x17783d=_0x574070[_0x34c776(0x1f8)]||env(_0x34c776(0x209))||undefined,_0x11e64c=_0x17783d?Object[_0x34c776(0x1e8)](_0x448d5d)['find'](([,_0x57c693])=>_0x57c693?.[_0x34c776(0x1f8)]===_0x17783d):undefined,_0x5d621b=_0x11e64c?.[0x0],_0x1ee70f=_0x11e64c?.[0x1];let _0x1b6ae3=_0x17783d?_0x5d621b:_0x55fce4,_0x3e261d=_0x1b6ae3&&_0x448d5d[_0x1b6ae3]?_0x448d5d[_0x1b6ae3]:undefined;_0x17783d&&_0x1ee70f&&(_0x3e261d=_0x1ee70f);const _0x3d9602=_0x17783d?_0x1ee70f??_0x3e261d:_0x3e261d,_0x581f41=_0x24d82d||(_0x17783d?_0x5d621b:undefined),_0x351adb=_0x17783d||_0x3d9602?.[_0x34c776(0x1f8)]||_0x5b7705['appcode']||_0x5b7705[_0x34c776(0x1d8)]||undefined,_0x3d18cc=_0x574070[_0x34c776(0x217)]||env('ENV')||_0x3d9602?.['env']||_0x5b7705[_0x34c776(0x217)]||_0x34c776(0x1fb),_0x340237=_0x3d9602?.['locale']||_0x5b7705[_0x34c776(0x1f1)]||_0x34c776(0x1d5),_0x382241=env(_0x34c776(0x20e))||_0x3d9602?.[_0x34c776(0x1db)]||_0x5b7705[_0x34c776(0x1db)]||undefined,_0x2a5c7a=env(_0x34c776(0x204))||_0x3d9602?.[_0x34c776(0x1d7)]||_0x5b7705[_0x34c776(0x1d7)]||undefined,_0x3b8cfa=_0x574070[_0x34c776(0x21b)]||env('FORMAT')||_0x3d9602?.[_0x34c776(0x21b)]||_0x5b7705[_0x34c776(0x21b)],_0x39599a=normalizeLegacyOutputFormat(_0x3b8cfa),_0x542fc6=env(_0x34c776(0x1fa))||_0x3d9602?.[_0x34c776(0x1ef)]||_0x5b7705[_0x34c776(0x1ef)],_0x4982b8=_0x542fc6?Number(_0x542fc6)||undefined:undefined,_0x37b802=env(_0x34c776(0x201))||env(_0x34c776(0x20d))||_0x3d9602?.[_0x34c776(0x200)]||_0x5b7705[_0x34c776(0x200)]||_0x5b7705[_0x34c776(0x211)],_0x23103d=_0x37b802===_0x34c776(0x1e6)||_0x37b802===_0x34c776(0x1ea)?_0x37b802:_0x34c776(0x213),_0x235f49=env(_0x34c776(0x21d)),_0x5af83d=_0x235f49==='1'||_0x235f49===_0x34c776(0x20f),_0x3bd942=_0x3d9602?.[_0x34c776(0x1f5)]||_0x5b7705[_0x34c776(0x1f5)]||DEFAULT_API_DIR;return{'appCode':typeof _0x351adb===_0x34c776(0x219)&&_0x351adb[_0x34c776(0x1eb)]()?_0x351adb[_0x34c776(0x1eb)]():undefined,'env':_0x3d18cc===_0x34c776(0x21a)?_0x34c776(0x1fb):_0x3d18cc==='daily'?_0x34c776(0x21f):_0x34c776(0x1fb),'locale':_0x340237,'cookie':_0x382241,'accessKey':_0x2a5c7a,'format':_0x39599a,'pageSize':_0x4982b8,'riskLevel':_0x23103d,'verbose':_0x5af83d,'apiDir':_0x3bd942,'apps':_0x448d5d,'defaultApp':_0xf4563e,'currentApp':_0x20f0e3?_0x1b6ae3:undefined,'explicitAppName':_0x581f41,'raw':_0x5b7705};}async function buildAuth(_0x2cbe7d){const _0x3b1cbe=a91_0x1a9cc5,{getCookie:_0x58dab7}=await import(_0x3b1cbe(0x203)),_0x535087=_0x2cbe7d[_0x3b1cbe(0x1db)]||_0x58dab7(),_0x4f61d2=_0x535087?await getIsSessionValid():![];return{'cookie':_0x535087,'isLoggedIn':_0x4f61d2,async 'getOrLogin'(){const _0x123a0e=_0x3b1cbe;if(_0x535087&&_0x4f61d2)return _0x535087;throw CliErrors[_0x123a0e(0x1ed)]();}};}export function resolveApiFilePath(_0x286386,_0x20ce95){const _0xa360d5=a91_0x1a9cc5,_0x38ac02=resolve(process[_0xa360d5(0x206)](),_0x286386),_0x1057d0=resolve(_0x38ac02,_0xa360d5(0x1ee));if(!_0x20ce95)return _0x1057d0;const _0x45747d=readRawConfig(),_0x53eb07=_0x45747d[_0xa360d5(0x1d9)]&&typeof _0x45747d[_0xa360d5(0x1d9)]==='object'?_0x45747d[_0xa360d5(0x1d9)]:{},_0x43a619=Object['entries'](_0x53eb07)[_0xa360d5(0x1e7)](([,_0x4f9367])=>_0x4f9367?.[_0xa360d5(0x1f8)]===_0x20ce95);if(!_0x43a619)return _0x1057d0;const [_0x7c779d,_0x37095f]=_0x43a619,_0x5c9b5b=typeof _0x45747d['defaultApp']===_0xa360d5(0x219)?_0x45747d[_0xa360d5(0x1fd)]:undefined;if(_0x37095f?.[_0xa360d5(0x1f5)])return _0x1057d0;if(_0x5c9b5b&&_0x7c779d!==_0x5c9b5b)return resolve(_0x38ac02,_0x7c779d+_0xa360d5(0x21e));return _0x1057d0;}
|
|
1
|
+
const a91_0x50add3=a91_0x2cf3;(function(_0x2f75b7,_0x50c86f){const _0x121bf3=a91_0x2cf3,_0x4cc0cc=_0x2f75b7();while(!![]){try{const _0x2a33c0=-parseInt(_0x121bf3(0x205))/0x1+-parseInt(_0x121bf3(0x234))/0x2+-parseInt(_0x121bf3(0x22e))/0x3*(-parseInt(_0x121bf3(0x216))/0x4)+-parseInt(_0x121bf3(0x220))/0x5*(-parseInt(_0x121bf3(0x206))/0x6)+parseInt(_0x121bf3(0x22b))/0x7*(parseInt(_0x121bf3(0x1f5))/0x8)+parseInt(_0x121bf3(0x200))/0x9+parseInt(_0x121bf3(0x212))/0xa*(-parseInt(_0x121bf3(0x1f7))/0xb);if(_0x2a33c0===_0x50c86f)break;else _0x4cc0cc['push'](_0x4cc0cc['shift']());}catch(_0x128734){_0x4cc0cc['push'](_0x4cc0cc['shift']());}}}(a91_0x1358,0x46457));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 a91_0x1358(){const _0x28f506=['setLogPath','project','warn','1422065cUXwEC','.lovrabet.json','find','high-risk-write','read','utf8','\x0a\x20\x20','cookie','format','write','en-US','1770167khMMpb','./auth/get-cookie.js','ACCESS_KEY','209847trSiWH','PAGE_SIZE','accessKey','daily','riskLevel','object','1096562IZbVhb','.rabetbase.json','-api.ts','env','./constant/env.js','Global','cwd','MAX_RISK','COOKIE','VERBOSE','production','silent','appcode','16deyeDZ','apiDir','197571OawQTs','missing','keys','locale','userDomain','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','pageSize','length','true','2843136AgOvHr','slice','apps','filter','api.ts','476024vcwryw','6fNntXc','app','.tmp','ENV','error','join','stringify','RISK_LEVEL','empty','defaultApp','Project','data','80bybUHe','trim','./utils/is-non-interactive.js','entries','20julCgm','string','authRequired','message','online','runtimeDomain','APPCODE'];a91_0x1358=function(){return _0x28f506;};return a91_0x1358();}import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x40b51b){return process.env[`RABETBASE_${_0x40b51b}`]||process.env[`LOVRABET_${_0x40b51b}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x50add3(0x235);export const CONFIG_NAMES=['.rabetbase.json',a91_0x50add3(0x221),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x50add3(0x203)](_0xe53972=>_0xe53972!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x40a6a6){for(const _0x5c5dc4 of CONFIG_NAMES){const _0x31b807=resolve(_0x40a6a6,_0x5c5dc4);if(existsSync(_0x31b807))return _0x31b807;}return undefined;}export async function createContext(_0x1e9aa9){const _0x4bb9a7=a91_0x50add3,_0x19c09c=readRawConfig(),_0x54e8b5=buildConfig(_0x19c09c,_0x1e9aa9),{initEnv:_0x51298d}=await import(_0x4bb9a7(0x1ec));if(_0x54e8b5[_0x4bb9a7(0x1eb)])_0x51298d(_0x54e8b5['env']);else _0x1e9aa9[_0x4bb9a7(0x1eb)]&&typeof _0x1e9aa9[_0x4bb9a7(0x1eb)]==='string'&&_0x51298d(_0x1e9aa9[_0x4bb9a7(0x1eb)]);const {initDomains:_0x779c96,getUserDomain:_0x3311d4,getApiDomain:_0x2e9929}=await import('./constant/domain.js');_0x779c96({'apiDomain':_0x19c09c['apiDomain']||undefined,'userDomain':_0x19c09c[_0x4bb9a7(0x1fb)]||undefined,'runtimeDomain':_0x19c09c[_0x4bb9a7(0x21b)]||undefined});const _0x393e27={'apiDomain':_0x2e9929(),'userDomain':_0x3311d4()},_0x543258=await buildAuth(_0x54e8b5);logger[_0x4bb9a7(0x21d)](process['cwd']());const _0x346833=(CLI_BIN_NAME+'\x20'+process['argv'][_0x4bb9a7(0x201)](0x2)[_0x4bb9a7(0x20b)]('\x20'))[_0x4bb9a7(0x213)]();logger['setRawCommand'](_0x346833);const {isNonInteractive:_0x393d98}=await import(_0x4bb9a7(0x214)),_0x2da333=_0x393d98(_0x1e9aa9);return{'config':_0x54e8b5,'auth':_0x543258,'logger':logger,'env':_0x393e27,'nonInteractive':_0x2da333};}export function buildConfigFromFlags(_0x34ea80){return buildConfig(readRawConfig(),_0x34ea80);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a91_0x2cf3(_0x3f1f2c,_0x54ccec){_0x3f1f2c=_0x3f1f2c-0x1ea;const _0x1358a5=a91_0x1358();let _0x2cf325=_0x1358a5[_0x3f1f2c];return _0x2cf325;}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3cf7b2){const _0xfd8e74=a91_0x50add3;if(!existsSync(_0x3cf7b2))return{'status':_0xfd8e74(0x1f8)};try{const _0x59887c=readFileSync(_0x3cf7b2,{'encoding':'utf8'});if(!_0x59887c?.[_0xfd8e74(0x213)]())return{'status':'empty'};const _0x5e69ea=JSON['parse'](_0x59887c);return{'status':'ok','data':_0x5e69ea};}catch(_0x4b6afa){return{'status':_0xfd8e74(0x20a),'message':_0x4b6afa instanceof Error?_0x4b6afa['message']:String(_0x4b6afa)};}}function parseCliConfigJsonFile(_0x361ee7,_0x18e652,_0x274f20){const _0x310e6a=a91_0x50add3,_0x361eae=inspectCliConfigJsonFile(_0x361ee7);if(_0x361eae['status']===_0x310e6a(0x1f8)||_0x361eae['status']===_0x310e6a(0x20e))return{};if(_0x361eae['status']==='ok')return _0x361eae[_0x310e6a(0x211)];return _0x18e652===_0x310e6a(0x21f)&&_0x274f20&&console['error'](CLI_BIN_NAME+':\x20'+_0x274f20+_0x310e6a(0x1fc)+_0x361ee7+_0x310e6a(0x226)+_0x361eae[_0x310e6a(0x219)]),{};}export function loadRawConfigLayers(_0x5cf02a){const _0x8c768d=a91_0x50add3;let _0x1f0dd1={},_0x3b9460={};const _0x55a439=resolveConfigPath(homedir());_0x55a439&&(_0x1f0dd1=parseCliConfigJsonFile(_0x55a439,_0x8c768d(0x21f),_0x8c768d(0x1ed)));const _0x3f291a=_0x5cf02a||process[_0x8c768d(0x1ee)](),_0x5407ad=resolveConfigPath(_0x3f291a);return _0x5407ad&&(_0x3b9460=parseCliConfigJsonFile(_0x5407ad,'warn',_0x8c768d(0x210))),{'globalPath':_0x55a439,'projectPath':_0x5407ad,'globalConfig':_0x1f0dd1,'projectConfig':_0x3b9460};}function mergeRawConfigLayers(_0x663a0d){const _0x301e14=a91_0x50add3,{globalConfig:_0x775a98,projectConfig:_0x23f1e7}=_0x663a0d,_0x5c747b=_0x775a98[_0x301e14(0x202)]&&typeof _0x775a98[_0x301e14(0x202)]===_0x301e14(0x233)?_0x775a98[_0x301e14(0x202)]:{},_0x1ea6b9=_0x23f1e7['apps']&&typeof _0x23f1e7[_0x301e14(0x202)]===_0x301e14(0x233)?_0x23f1e7[_0x301e14(0x202)]:{},_0x108d7b={..._0x5c747b,..._0x1ea6b9},_0x56cec8={..._0x775a98,..._0x23f1e7};Object[_0x301e14(0x1f9)](_0x108d7b)[_0x301e14(0x1fe)]>0x0&&(_0x56cec8[_0x301e14(0x202)]=_0x108d7b);if(_0x301e14(0x20f)in _0x23f1e7)_0x56cec8['defaultApp']=_0x23f1e7[_0x301e14(0x20f)];else{if(_0x1ea6b9&&Object[_0x301e14(0x1f9)](_0x1ea6b9)[_0x301e14(0x1fe)]>0x0)_0x56cec8['defaultApp']=Object[_0x301e14(0x1f9)](_0x1ea6b9)[0x0];else _0x775a98['defaultApp']&&(_0x56cec8[_0x301e14(0x20f)]=_0x775a98[_0x301e14(0x20f)]);}return _0x56cec8;}export function readRawConfigWithLayers(_0x41e480){const _0x286f4c=loadRawConfigLayers(_0x41e480);return{'config':mergeRawConfigLayers(_0x286f4c),'layers':_0x286f4c};}export function readRawConfig(_0x29d221){return mergeRawConfigLayers(loadRawConfigLayers(_0x29d221));}export function readConfigFile(_0x3e75da){const _0x357559=a91_0x50add3;return parseCliConfigJsonFile(_0x3e75da,_0x357559(0x1f3));}export function writeConfigFile(_0x57b40b,_0x3b111f){const _0x3914b0=a91_0x50add3,_0x1520e4=dirname(_0x57b40b);!existsSync(_0x1520e4)&&mkdirSync(_0x1520e4,{'recursive':!![]});const _0x3d18da=_0x57b40b+_0x3914b0(0x208);try{writeFileSync(_0x3d18da,JSON[_0x3914b0(0x20c)](_0x3b111f,null,0x2)+'\x0a',{'encoding':_0x3914b0(0x225),'mode':0x180}),renameSync(_0x3d18da,_0x57b40b);}catch(_0x4a6199){try{unlinkSync(_0x3d18da);}catch{}throw _0x4a6199;}}export function resolveWriteConfigPath(_0xd66ccb){const _0x2d4b24=a91_0x50add3,_0x4ddee2=_0xd66ccb===_0x2d4b24(0x21e)?process[_0x2d4b24(0x1ee)]():homedir(),_0x37b99c=resolveConfigPath(_0x4ddee2);return _0x37b99c??resolve(_0x4ddee2,NEW_CONFIG_NAME);}function buildConfig(_0x4e0753,_0x1beabb){const _0x4cb7a4=a91_0x50add3,_0x4e3c18={};if(_0x4e0753[_0x4cb7a4(0x202)]&&typeof _0x4e0753[_0x4cb7a4(0x202)]===_0x4cb7a4(0x233))for(const [_0x1d41d3,_0xd6015c]of Object['entries'](_0x4e0753[_0x4cb7a4(0x202)])){_0xd6015c&&typeof _0xd6015c==='object'&&_0xd6015c['appcode']&&(_0x4e3c18[_0x1d41d3]=_0xd6015c);}const _0x5c7b2b=_0x4e0753[_0x4cb7a4(0x20f)]||undefined,_0x14775d=Object[_0x4cb7a4(0x1f9)](_0x4e3c18)['length']>0x0,_0x7c623c=_0x1beabb[_0x4cb7a4(0x207)]||env('APP')||undefined,_0x513390=_0x7c623c||_0x5c7b2b||undefined,_0x50cc51=_0x1beabb['appcode']||env(_0x4cb7a4(0x21c))||undefined,_0x191bf5=_0x50cc51?Object[_0x4cb7a4(0x215)](_0x4e3c18)['find'](([,_0x43d684])=>_0x43d684?.[_0x4cb7a4(0x1f4)]===_0x50cc51):undefined,_0x318ca4=_0x191bf5?.[0x0],_0x52d6a8=_0x191bf5?.[0x1];let _0x791d8f=_0x50cc51?_0x318ca4:_0x513390,_0x5d03b3=_0x791d8f&&_0x4e3c18[_0x791d8f]?_0x4e3c18[_0x791d8f]:undefined;_0x50cc51&&_0x52d6a8&&(_0x5d03b3=_0x52d6a8);const _0x53dd0a=_0x50cc51?_0x52d6a8??_0x5d03b3:_0x5d03b3,_0x4809e1=_0x7c623c||(_0x50cc51?_0x318ca4:undefined),_0x546ee5=_0x50cc51||_0x53dd0a?.['appcode']||_0x4e0753[_0x4cb7a4(0x1f4)]||_0x4e0753[_0x4cb7a4(0x207)]||undefined,_0x23e888=_0x1beabb[_0x4cb7a4(0x1eb)]||env(_0x4cb7a4(0x209))||_0x53dd0a?.[_0x4cb7a4(0x1eb)]||_0x4e0753[_0x4cb7a4(0x1eb)]||_0x4cb7a4(0x1f2),_0x1880e8=_0x53dd0a?.[_0x4cb7a4(0x1fa)]||_0x4e0753[_0x4cb7a4(0x1fa)]||_0x4cb7a4(0x22a),_0x45a84b=env(_0x4cb7a4(0x1f0))||_0x53dd0a?.['cookie']||_0x4e0753['cookie']||undefined,_0x42c441=env(_0x4cb7a4(0x22d))||_0x53dd0a?.[_0x4cb7a4(0x230)]||_0x4e0753[_0x4cb7a4(0x230)]||undefined,_0x41c28e=_0x1beabb[_0x4cb7a4(0x228)]||env('FORMAT')||_0x53dd0a?.[_0x4cb7a4(0x228)]||_0x4e0753[_0x4cb7a4(0x228)],_0x445103=normalizeLegacyOutputFormat(_0x41c28e),_0xa0f192=env(_0x4cb7a4(0x22f))||_0x53dd0a?.[_0x4cb7a4(0x1fd)]||_0x4e0753['pageSize'],_0x53d9ac=_0xa0f192?Number(_0xa0f192)||undefined:undefined,_0x31c230=env(_0x4cb7a4(0x20d))||env(_0x4cb7a4(0x1ef))||_0x53dd0a?.['riskLevel']||_0x4e0753[_0x4cb7a4(0x232)]||_0x4e0753['maxRisk'],_0x105c97=_0x31c230===_0x4cb7a4(0x224)||_0x31c230===_0x4cb7a4(0x229)?_0x31c230:_0x4cb7a4(0x223),_0x2a759f=env(_0x4cb7a4(0x1f1)),_0x2c7e06=_0x2a759f==='1'||_0x2a759f===_0x4cb7a4(0x1ff),_0x885e8=_0x53dd0a?.[_0x4cb7a4(0x1f6)]||_0x4e0753[_0x4cb7a4(0x1f6)]||DEFAULT_API_DIR;return{'appCode':typeof _0x546ee5===_0x4cb7a4(0x217)&&_0x546ee5[_0x4cb7a4(0x213)]()?_0x546ee5[_0x4cb7a4(0x213)]():undefined,'env':_0x23e888===_0x4cb7a4(0x21a)?_0x4cb7a4(0x1f2):_0x23e888===_0x4cb7a4(0x231)?_0x4cb7a4(0x231):'production','locale':_0x1880e8,'cookie':_0x45a84b,'accessKey':_0x42c441,'format':_0x445103,'pageSize':_0x53d9ac,'riskLevel':_0x105c97,'verbose':_0x2c7e06,'apiDir':_0x885e8,'apps':_0x4e3c18,'defaultApp':_0x5c7b2b,'currentApp':_0x14775d?_0x791d8f:undefined,'explicitAppName':_0x4809e1,'raw':_0x4e0753};}async function buildAuth(_0x207b2c){const _0x1c8ac0=a91_0x50add3,{getCookie:_0x33e985}=await import(_0x1c8ac0(0x22c)),_0x26ab3f=_0x207b2c[_0x1c8ac0(0x227)]||_0x33e985(),_0x3d8679=_0x26ab3f?await getIsSessionValid():![];return{'cookie':_0x26ab3f,'isLoggedIn':_0x3d8679,async 'getOrLogin'(){const _0x495ab9=_0x1c8ac0;if(_0x26ab3f&&_0x3d8679)return _0x26ab3f;throw CliErrors[_0x495ab9(0x218)]();}};}export function resolveApiFilePath(_0x4187e2,_0x38e08d){const _0xdb3f6d=a91_0x50add3,_0x244825=resolve(process[_0xdb3f6d(0x1ee)](),_0x4187e2),_0x267c03=resolve(_0x244825,_0xdb3f6d(0x204));if(!_0x38e08d)return _0x267c03;const _0x37ccb9=readRawConfig(),_0xe1d64e=_0x37ccb9['apps']&&typeof _0x37ccb9['apps']==='object'?_0x37ccb9[_0xdb3f6d(0x202)]:{},_0x1f32b8=Object[_0xdb3f6d(0x215)](_0xe1d64e)[_0xdb3f6d(0x222)](([,_0x38463f])=>_0x38463f?.[_0xdb3f6d(0x1f4)]===_0x38e08d);if(!_0x1f32b8)return _0x267c03;const [_0x53c235,_0x2687a9]=_0x1f32b8,_0x933e2e=typeof _0x37ccb9[_0xdb3f6d(0x20f)]==='string'?_0x37ccb9[_0xdb3f6d(0x20f)]:undefined;if(_0x2687a9?.[_0xdb3f6d(0x1f6)])return _0x267c03;if(_0x933e2e&&_0x53c235!==_0x933e2e)return resolve(_0x244825,_0x53c235+_0xdb3f6d(0x1ea));return _0x267c03;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14827f,_0x5af67b){const _0x574ec7=a92_0x301c,_0x86010=_0x14827f();while(!![]){try{const _0x24e88e=parseInt(_0x574ec7(0x74))/0x1*(parseInt(_0x574ec7(0x7e))/0x2)+-parseInt(_0x574ec7(0x80))/0x3*(parseInt(_0x574ec7(0x79))/0x4)+parseInt(_0x574ec7(0x73))/0x5*(parseInt(_0x574ec7(0x7b))/0x6)+parseInt(_0x574ec7(0x76))/0x7*(-parseInt(_0x574ec7(0x77))/0x8)+-parseInt(_0x574ec7(0x7a))/0x9+parseInt(_0x574ec7(0x7c))/0xa*(parseInt(_0x574ec7(0x82))/0xb)+-parseInt(_0x574ec7(0x6f))/0xc*(-parseInt(_0x574ec7(0x72))/0xd);if(_0x24e88e===_0x5af67b)break;else _0x86010['push'](_0x86010['shift']());}catch(_0x42cb88){_0x86010['push'](_0x86010['shift']());}}}(a92_0x4981,0xd3cbe));function a92_0x4981(){const _0x2579d0=['set','21518tphPyV','3816rdiSdH','cwd','36ELgyYh','14643963pXfMUh','1668vnQXAP','2606980IXdXwJ','api.ts','10DNwIgF','datasetCode','30153Omnlyy','alias','33gTXbhi','find','60BMgizp','has','exec','1709461pOBEAB','17705RGRcxv','325481cpHyUs'];a92_0x4981=function(){return _0x2579d0;};return a92_0x4981();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x47b287){const _0x47faf3=a92_0x301c,_0x4c4c1a=[],_0x2d6be2=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x31b85e;while((_0x31b85e=_0x2d6be2[_0x47faf3(0x71)](_0x47b287))!==null){_0x4c4c1a['push']({'datasetCode':_0x31b85e[0x1],'tableName':_0x31b85e[0x2],'name':_0x31b85e[0x3],'alias':_0x31b85e[0x4]});}return _0x4c4c1a;}function a92_0x301c(_0x45341c,_0x54c0f7){_0x45341c=_0x45341c-0x6e;const _0x498115=a92_0x4981();let _0x301c9c=_0x498115[_0x45341c];return _0x301c9c;}export function loadAliasMap(_0x5ed398,_0x3d9ed1,_0x5748fb){const _0x57924e=a92_0x301c,_0xbee92e=_0x5748fb??resolve(process[_0x57924e(0x78)](),_0x5ed398,_0x57924e(0x7d));if(cache[_0x57924e(0x70)](_0xbee92e))return cache['get'](_0xbee92e);if(!existsSync(_0xbee92e))return cache[_0x57924e(0x75)](_0xbee92e,[]),[];try{const _0x367fef=readFileSync(_0xbee92e,'utf-8'),_0x277d2c=parseApiFile(_0x367fef);return cache[_0x57924e(0x75)](_0xbee92e,_0x277d2c),_0x277d2c;}catch{return cache['set'](_0xbee92e,[]),[];}}export function resolveAlias(_0x2064ea,_0x39465e,_0x3433d1,_0x4c7d02){const _0x42557a=a92_0x301c;if(!_0x39465e)return undefined;const _0xd82907=loadAliasMap(_0x2064ea,_0x3433d1,_0x4c7d02),_0x151240=_0xd82907[_0x42557a(0x6e)](_0xc878e5=>_0xc878e5[_0x42557a(0x81)]===_0x39465e);return _0x151240?.[_0x42557a(0x7f)];}export function listAliases(_0x4091fe,_0x6f2005,_0xae1c6d){return loadAliasMap(_0x4091fe,_0x6f2005,_0xae1c6d);}
|